blecsd 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -2
- package/README.md +168 -65
- package/dist/3d/index.d.ts +2 -2
- package/dist/3d/index.js +1 -1
- package/dist/audio/index.d.ts +2 -2
- package/dist/{border-D_Jb4ZJV.d.ts → border-Jb7TrMob.d.ts} +20 -10
- package/dist/chunk-2IEMMRUO.js +1 -0
- package/dist/chunk-3AV52GY5.js +1 -0
- package/dist/chunk-3LHLSY3Y.js +1 -0
- package/dist/chunk-3O4TQHGK.js +4 -0
- package/dist/chunk-3UJWZ5ZN.js +1 -0
- package/dist/chunk-5N3O25O7.js +1 -0
- package/dist/chunk-6M2J5QUA.js +1 -0
- package/dist/chunk-7IQEUVGF.js +1 -0
- package/dist/chunk-A6M6TFBL.js +1 -0
- package/dist/chunk-CUEUJAHK.js +3 -0
- package/dist/chunk-D42Q2KKR.js +1 -0
- package/dist/chunk-DYEXOFUU.js +2 -0
- package/dist/chunk-DYU72XLL.js +1 -0
- package/dist/chunk-E4CJRSND.js +1 -0
- package/dist/chunk-FCMTWFSE.js +1 -0
- package/dist/chunk-FL56THSI.js +25 -0
- package/dist/{chunk-2UBBZFE4.js → chunk-G437VE43.js} +1 -1
- package/dist/chunk-GGXNWT36.js +8 -0
- package/dist/chunk-HLFORKXS.js +1 -0
- package/dist/chunk-J7MBKEBY.js +1 -0
- package/dist/{chunk-TYMY2TBR.js → chunk-JHCKPCUH.js} +3 -3
- package/dist/chunk-LDAFEXN5.js +1 -0
- package/dist/chunk-MKMFUXLB.js +33 -0
- package/dist/chunk-MQWPHPUM.js +1 -0
- package/dist/chunk-MTI376CU.js +5 -0
- package/dist/chunk-MTV2RJZD.js +1 -0
- package/dist/chunk-NPDPBAW6.js +4 -0
- package/dist/chunk-OR3BZY7C.js +1 -0
- package/dist/{chunk-VNZ6CWJA.js → chunk-R7AICVRN.js} +2 -2
- package/dist/{chunk-3B7MIVW6.js → chunk-RZ7FGVI6.js} +1 -1
- package/dist/chunk-UMGTXSQB.js +11 -0
- package/dist/chunk-X3Q3T2SS.js +4 -0
- package/dist/{chunk-JKVHO4LH.js → chunk-XZJRWFOS.js} +1 -1
- package/dist/chunk-ZAHG7Y3X.js +1 -0
- package/dist/cli/init.d.ts +1 -1
- package/dist/{componentStorage-DTkj1Qyj.d.ts → componentStorage-CJTh-TPO.d.ts} +1 -1
- package/dist/components/index.d.ts +1942 -515
- package/dist/components/index.js +1 -1
- package/dist/core/index.d.ts +634 -69
- package/dist/core/index.js +1 -1
- package/dist/debug/index.d.ts +491 -98
- package/dist/debug/index.js +1 -1
- package/dist/dirtyTracking-C4v8MmM9.d.ts +235 -0
- package/dist/errors/index.d.ts +12 -12
- package/dist/errors/index.js +1 -1
- package/dist/{events-BbbxkgvX.d.ts → events-9ForpTfM.d.ts} +75 -2
- package/dist/game/index.d.ts +7 -7
- package/dist/game/index.js +1 -1
- package/dist/{gameLoop-BIPW7-OY.d.ts → gameLoop-C-Ez_i54.d.ts} +2 -2
- package/dist/{index-zSGJ2eUk.d.ts → index-DBS5Uefn.d.ts} +2 -2
- package/dist/index.d.ts +282 -21
- package/dist/index.js +3 -1
- package/dist/input/index.d.ts +1 -1
- package/dist/input/index.js +1 -1
- package/dist/{inputActions-CefRUBuT.d.ts → inputActions-CRsUtTHM.d.ts} +10 -721
- package/dist/{packedStore-480t2X74.d.ts → packedStore-BgvnEdE7.d.ts} +1 -1
- package/dist/{renderable-jTMOA-GK.d.ts → renderable-CwqGwrEV.d.ts} +9 -9
- package/dist/{scheduler-DcfoFuum.d.ts → scheduler-CMcYew9Z.d.ts} +65 -3
- package/dist/systems/index.d.ts +125 -36
- package/dist/systems/index.js +1 -1
- package/dist/terminal/index.d.ts +2233 -2299
- package/dist/terminal/index.js +1 -1
- package/dist/{tilemap-j0twN9-y.d.ts → tilemap-BirMJdbu.d.ts} +2 -2
- package/dist/{types-BcsvoKzf.d.ts → types-CPB4CpbH.d.ts} +2 -2
- package/dist/utils/index.d.ts +26 -25
- package/dist/utils/index.js +1 -1
- package/dist/{virtualScrollback-DvZTRU8a.d.ts → virtualScrollback-D9uLFe8l.d.ts} +4 -4
- package/dist/{virtualViewport-Dx2iJliO.d.ts → virtualViewport-Bpv6jlKt.d.ts} +283 -761
- package/dist/widgets/bigText.d.ts +1 -1
- package/dist/widgets/bigText.js +1 -1
- package/dist/widgets/index.d.ts +10519 -5463
- package/dist/widgets/index.js +1 -1
- package/package.json +102 -6
- package/dist/chunk-35I22JJO.js +0 -1
- package/dist/chunk-3APDF6RW.js +0 -1
- package/dist/chunk-3EGGGI5J.js +0 -3
- package/dist/chunk-4GISPPOH.js +0 -33
- package/dist/chunk-4X4N4HNQ.js +0 -2
- package/dist/chunk-6N6BRCEM.js +0 -4
- package/dist/chunk-AXZQAH4X.js +0 -1
- package/dist/chunk-BCADUCOZ.js +0 -1
- package/dist/chunk-EJ5WVDDZ.js +0 -6
- package/dist/chunk-FMFEOAML.js +0 -1
- package/dist/chunk-FYEBZAWN.js +0 -1
- package/dist/chunk-GYHI26UE.js +0 -1
- package/dist/chunk-H2YAOJDW.js +0 -1
- package/dist/chunk-JUWDTH25.js +0 -1
- package/dist/chunk-K2B2OXQ5.js +0 -5
- package/dist/chunk-KD55INV7.js +0 -1
- package/dist/chunk-KFAK4A3G.js +0 -1
- package/dist/chunk-LB3JA744.js +0 -19
- package/dist/chunk-LCN2ZITE.js +0 -1
- package/dist/chunk-P6CJO3BC.js +0 -1
- package/dist/chunk-PSXXMBVJ.js +0 -1
- package/dist/chunk-VCW7EOZ4.js +0 -12
- package/dist/chunk-W5OU7Z6J.js +0 -1
- package/dist/chunk-WHF27JF3.js +0 -4
- package/dist/chunk-WNG4A3K7.js +0 -4
- package/dist/chunk-WY3KY2TR.js +0 -1
- package/dist/chunk-XZA63ZPO.js +0 -1
- package/dist/{keyParser-Bwm8-l7v.d.ts → keyParser-BnHbg2iD.d.ts} +1 -1
package/dist/chunk-4GISPPOH.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {s,b as b$1,c as c$1,d,e}from'./chunk-LCN2ZITE.js';import {f}from'./chunk-SHUC6JWA.js';import {c}from'./chunk-5PELJRUQ.js';import {z as z$1}from'zod';import*as Gn from'fs';import*as k from'path';s();function _(e){return {topLeft:String.fromCodePoint(e.topLeft),topRight:String.fromCodePoint(e.topRight),bottomLeft:String.fromCodePoint(e.bottomLeft),bottomRight:String.fromCodePoint(e.bottomRight),horizontal:String.fromCodePoint(e.horizontal),vertical:String.fromCodePoint(e.vertical)}}var Ar=_(b$1),wr=_(c$1),Er=_(d),Wr=_(e),Mr={topLeft:"+",topRight:"+",bottomLeft:"+",bottomRight:"+",horizontal:"-",vertical:"|"},Ir={topLeft:"\u250C",topRight:"\u2510",bottomLeft:"\u2514",bottomRight:"\u2518",horizontal:"\u254C",vertical:"\u254E"};function Dr(e,t,n=4294967295,r=0){let o=[];for(let i=0;i<t;i++){let a=[];for(let l=0;l<e;l++)a.push({char:" ",fg:n,bg:r});o.push(a);}return {width:e,height:t,cells:o,setCell(i,a,l,s,u){if(i<0||i>=e||a<0||a>=t)return;let d=o[a]?.[i];d&&(d.char=l,s!==void 0&&(d.fg=s),u!==void 0&&(d.bg=u));}}}function vr(e,t,n,r,o,i,a,l,s,u){e.setCell(t,n,l.topLeft,s,u),i>1&&e.setCell(r,n,l.topRight,s,u),a>1&&e.setCell(t,o,l.bottomLeft,s,u),i>1&&a>1&&e.setCell(r,o,l.bottomRight,s,u);}function Br(e,t,n,r,o,i,a,l,s,u){for(let d=t+1;d<r;d++)e.setCell(d,n,l.horizontal,s,u),a>1&&e.setCell(d,o,l.horizontal,s,u);for(let d=n+1;d<o;d++)e.setCell(t,d,l.vertical,s,u),i>1&&e.setCell(r,d,l.vertical,s,u);}function Fr(e,t,n,r,o,i,a={}){let{fg:l,bg:s,fill:u=false,fillChar:d=" "}=a;if(r<1||o<1)return;let f=t+r-1,c=n+o-1;vr(e,t,n,f,c,r,o,i,l,s),Br(e,t,n,f,c,r,o,i,l,s),u&&r>2&&o>2&&At(e,t+1,n+1,r-2,o-2,d,l,s);}function Pr(e,t,n,r,o="\u2500",i,a){for(let l=0;l<r;l++)e.setCell(t+l,n,o,i,a);}function _r(e,t,n,r,o="\u2502",i,a){for(let l=0;l<r;l++)e.setCell(t,n+l,o,i,a);}function At(e,t,n,r,o,i=" ",a,l){for(let s=0;s<o;s++)for(let u=0;u<r;u++)e.setCell(t+u,n+s,i,a,l);}function Or(e,t,n,r,o,i){for(let a=0;a<r.length;a++){let l=r[a];l!==void 0&&e.setCell(t+a,n,l,o,i);}}function Nr(e){let t=[];for(let n=0;n<e.height;n++){let r="";for(let o=0;o<e.width;o++)r+=e.cells[n]?.[o]?.char??" ";t.push(r);}return t.join(`
|
|
2
|
-
`)}var zr={maxDelayMs:16,maxBatchSize:100,immediateCursor:true};function Hr(e,t){return {config:{...zr,...t},pending:[],flushCallback:e,flushTimer:null,totalProcessed:0,totalFlushes:0}}function Gr(e,t){if(e.pending.push(t),e.pending.length>=e.config.maxBatchSize){J(e);return}e.flushTimer||(e.flushTimer=setTimeout(()=>{J(e);},e.config.maxDelayMs));}function J(e){if(e.flushTimer&&(clearTimeout(e.flushTimer),e.flushTimer=null),e.pending.length===0)return;let t=[...e.pending];e.pending=[];let n=Kr(t),r=t.length>1?(t[t.length-1]?.timestamp??0)-(t[0]?.timestamp??0):0,o={dirtyRegion:n,changeCount:t.length,timeSpanMs:r,changes:t};return e.totalProcessed+=t.length,e.totalFlushes++,e.flushCallback&&e.flushCallback(o),o}function Ur(e){return {config:e.config,pendingCount:e.pending.length,flushScheduled:e.flushTimer!==null,totalProcessed:e.totalProcessed,totalFlushes:e.totalFlushes,avgChangesPerFlush:e.totalFlushes>0?e.totalProcessed/e.totalFlushes:0}}function Vr(e,t,n){return {startLine:e,startColumn:t,endLine:e,endColumn:t,text:n,timestamp:Date.now()}}function jr(e,t,n,r){return {startLine:e,startColumn:t,endLine:n,endColumn:r,text:"",timestamp:Date.now()}}function $r(e,t,n,r,o){return {startLine:e,startColumn:t,endLine:n,endColumn:r,text:o,timestamp:Date.now()}}function Zr(e){let t=J(e);return e.flushCallback=null,t}function Kr(e){if(e.length===0)return {startLine:0,endLine:0,lineCountChanged:false,lineDelta:0};let t=Number.POSITIVE_INFINITY,n=0,r=0;for(let o of e){t=Math.min(t,o.startLine),n=Math.max(n,o.endLine);let i=0;for(let l=0;l<o.text.length;l++)o.text[l]===`
|
|
3
|
-
`&&i++;let a=o.endLine-o.startLine;r+=i-a,n=Math.max(n,o.startLine+i);}return {startLine:t===Number.POSITIVE_INFINITY?0:t,endLine:n,lineCountChanged:r!==0,lineDelta:r}}f();var Y={scrollPadding:5,horizontalPadding:5,lineWrap:true,tabWidth:4};function qr(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
4
|
-
`&&t.push(n+1);return {offsets:t,lineCount:t.length}}function Xr(e){let t=[0],n=0;for(let r=0;r<e.length-1;r++)n+=e[r]??0,t.push(n);return {offsets:t,lineCount:e.length}}function Jr(e,t){let n=e.offsets,r=0,o=n.length-1;for(;r<=o;){let i=r+o>>>1;(n[i]??0)<=t?r=i+1:o=i-1;}return Math.max(0,r-1)}function Yr(e,t){return t<0||t>=e.lineCount?-1:e.offsets[t]??-1}function Q(e=0,t=0){return {line:Math.max(0,e),column:Math.max(0,t)}}function Qr(e=0,t=24,n=0,r=80){return {topLine:Math.max(0,e),height:Math.max(1,t),leftColumn:Math.max(0,n),width:Math.max(1,r)}}function eo(e){return {...Y,...e}}function I(e,t,n,r){let o={...Y,...r},{topLine:i,leftColumn:a}=t,l=false,s=e.line-t.height+1+o.scrollPadding,u=e.line-o.scrollPadding;i>u&&(i=Math.max(0,u),l=true),i<s&&(i=Math.min(Math.max(0,n-t.height),Math.max(0,s)),l=true);let d=e.column-t.width+1+o.horizontalPadding,f=e.column-o.horizontalPadding;return a>f&&(a=Math.max(0,f),l=true),a<d&&(a=Math.max(0,d),l=true),l?{viewport:{...t,topLine:i,leftColumn:a},scrolled:true}:{viewport:t,scrolled:false}}function Ee(e,t,n){let r=Math.max(0,Math.min(e.line,t-1)),o=r<t?n(r):0,i=Math.max(0,Math.min(e.column,o));return {line:r,column:i}}function wt(e,t,n,r,o){let i=Q(e.line-t,e.column),a=Ee(i,r,()=>e.column),{viewport:l,scrolled:s}=I(a,n,r,o);return {cursor:a,viewport:l,scrolled:s}}function Et(e,t,n,r,o){let i=Q(e.line+t,e.column),a=Ee(i,r,()=>e.column),{viewport:l,scrolled:s}=I(a,n,r,o);return {cursor:a,viewport:l,scrolled:s}}function We(e,t,n,r){let o=Math.max(0,Math.min(e,n-1)),i=Q(o,0),{viewport:a,scrolled:l}=I(i,t,n,r);return {cursor:i,viewport:a,scrolled:l}}function to(e,t,n,r){return wt(e,t.height-1,t,n,r)}function no(e,t,n,r){return Et(e,t.height-1,t,n,r)}function ro(e,t,n){return We(0,e,t,n)}function oo(e,t,n){return We(t-1,e,t,n)}function io(e,t,n,r,o,i){let a={...Y,...i},{line:l,column:s}=e;s-=t,s<0&&a.lineWrap&&l>0?(l--,s=o(l)):s=Math.max(0,s);let u={line:l,column:s},{viewport:d,scrolled:f}=I(u,n,r,i);return {cursor:u,viewport:d,scrolled:f}}function ao(e,t,n,r,o,i){let a={...Y,...i},{line:l,column:s}=e,u=o(l);s+=t,s>u&&a.lineWrap&&l<r-1?(l++,s=0):s=Math.min(s,u);let d={line:l,column:s},{viewport:f,scrolled:c}=I(d,n,r,i);return {cursor:d,viewport:f,scrolled:c}}var lo=3,so=10;function Wt(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r|0;}return t}function uo(e,t){let n=e.length,r=t.length,o=n+r,i=wo(e,t);if(i)return i;let a=Eo(e,t,o);return fo(a.trace,e,t,a.offset)}function fo(e,t,n,r){let o=[],i=t.length,a=n.length;for(let l=e.length-1;l>=0;l--){let s=e[l]??[],u=i-a,d=Io(u,l,s,r),f=s[d+r]??0,c=f-d,m=Do(o,t,i,a,f,c);i=m.x,a=m.y;let h=vo(o,t,n,l,i,a,f);i=h.x,a=h.y;}return o}function co(e,t){let n=e.length,r=t.length,o=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let i=1;i<=n;i++){let a=o[i];if(a)for(let l=1;l<=r;l++)e[i-1]===t[l-1]?a[l]=(o[i-1]?.[l-1]??0)+1:a[l]=Math.max(o[i-1]?.[l]??0,a[l-1]??0);}return o}function mo(e,t,n){let r=[],o=t.length,i=n.length,a=[];for(;o>0||i>0;){let l=No(e,t,n,o,i);a.unshift(l.op),o=l.nextI,i=l.nextJ;}for(let l of a)r.push({type:l.type,content:l.line,oldLineNo:l.oldNo,newLineNo:l.newNo});return r}function ho(e,t){let n=e.length,r=t.length;if(n>100||r>100)return uo(e,t);let o=co(e,t);return mo(o,e,t)}function go(e,t,n){if(e.length===0)return [];let r=[],o=[],i=0,a=1,l=1,s=0,u=0;function d(){if(o.length===0)return;let f=o.filter(m=>m.type==="remove"||m.type==="context").length,c=o.filter(m=>m.type==="add"||m.type==="context").length;r.push({id:i++,oldStart:a,oldCount:f,newStart:l,newCount:c,lines:o,collapsed:false,contextBefore:u,contextAfter:s}),a+=f,l+=c,o=[],u=0;}for(let f of e)if(f.type==="context")if(s++,s>t*2+n){let c=o.slice(-t);o=o.slice(0,-t),o.length>0&&(s=t,d()),o=[...c,f],u=c.length+1,s=1;}else o.push(f);else s=0,o.push(f);return d(),r}function Dt(e,t,n={}){let r=performance.now(),o=n.contextLines??3,i=n.collapseThreshold??10,{oldLines:a,newLines:l}=Bo(e,t),s=ho(a,l),u=go(s,o,i);n.initiallyCollapsed&&Fo(u);let d=Po(s);return {chunks:u,additions:d.additions,deletions:d.deletions,contextLines:d.contextLines,computeTimeMs:performance.now()-r}}function po(){return {oldHash:0,newHash:0,result:null,expandedChunks:new Set}}function bo(e){e.oldHash=0,e.newHash=0,e.result=null,e.expandedChunks.clear();}function xo(e,t,n,r={}){let o=Wt(t),i=Wt(n);if(e.oldHash===o&&e.newHash===i&&e.result)return e.result;let a=Dt(t,n,r);e.oldHash=o,e.newHash=i,e.result=a;for(let l of a.chunks)e.expandedChunks.has(l.id)&&(l.collapsed=false);return a}function vt(e,t,n){let r=t.chunks.find(o=>o.id===n);r&&(r.collapsed=false,e.expandedChunks.add(n));}function Bt(e,t,n){let r=t.chunks.find(o=>o.id===n);r&&(r.collapsed=true,e.expandedChunks.delete(n));}function yo(e,t,n){let r=t.chunks.find(o=>o.id===n);return r?r.collapsed?(vt(e,t,n),false):(Bt(e,t,n),true):false}function Co(e,t){for(let n of t.chunks)n.collapsed=false,e.expandedChunks.add(n.id);}function So(e,t){for(let n of t.chunks)n.lines.some(o=>o.type==="add"||o.type==="remove")||(n.collapsed=true,e.expandedChunks.delete(n.id));}function Lo(e,t,n){let r=[];for(let l of e.chunks)if(l.collapsed)r.push({line:{type:"header",content:`... ${l.lines.length} lines hidden ...`},chunkId:l.id,collapsed:true});else for(let s of l.lines)r.push({line:s,chunkId:l.id,collapsed:false});let o=Math.max(0,t),i=Math.min(r.length,t+n),a=r.slice(o,i);return {lines:a.map(l=>l.line),startIndex:o,totalLines:r.length,chunkInfo:a.map(l=>({chunkId:l.chunkId,collapsed:l.collapsed}))}}function ko(e){let t=0;for(let n of e.chunks)n.collapsed?t+=1:t+=n.lines.length;return t}function To(e,t,n){let r=_o(e),o=Math.max(0,t),i=Math.min(r.length,t+n);return r.slice(o,i)}function Ro(e,t="a",n="b"){let r=[];r.push(`--- ${t}`),r.push(`+++ ${n}`);for(let o of e.chunks){r.push(`@@ -${o.oldStart},${o.oldCount} +${o.newStart},${o.newCount} @@`);for(let i of o.lines){let a=i.type==="add"?"+":i.type==="remove"?"-":" ";r.push(a+i.content);}}return r.join(`
|
|
5
|
-
`)}function Ao(e){let t=performance.now(),n=e.split(`
|
|
6
|
-
`),r=[],o=null,i=[],a=0,l=0,s=0,u=0,d=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;for(let f of n){if(f.startsWith("---")||f.startsWith("+++"))continue;let c=d.exec(f);if(c){let h=Oo(c,a);a+=1;let g=It(r,o,i);o=h,i=g;continue}if(!o)continue;let m=zo(f);m&&(i.push(m.line),l+=m.additions,s+=m.deletions,u+=m.contextLines);}return It(r,o,i),{chunks:r,additions:l,deletions:s,contextLines:u,computeTimeMs:performance.now()-t}}function wo(e,t){let n=e.length,r=t.length;return n===0&&r===0?[]:n===0?t.map((o,i)=>({type:"add",content:o,newLineNo:i+1})):r===0?e.map((o,i)=>({type:"remove",content:o,oldLineNo:i+1})):null}function Eo(e,t,n){let r=e.length,o=t.length,i=2*n+1,a=new Array(i).fill(0),l=n,s=[];e:for(let u=0;u<=n;u++){s.push(a.slice());for(let d=-u;d<=u;d+=2){let f=Wo(a,d,u,l),c=Mo(e,t,f,d);if(a[d+l]=c.x,c.x>=r&&c.y>=o)break e}}return {trace:s,offset:l}}function Wo(e,t,n,r){return t===-n||t!==n&&(e[t-1+r]??0)<(e[t+1+r]??0)?e[t+1+r]??0:(e[t-1+r]??0)+1}function Mo(e,t,n,r){let o=n,i=o-r;for(;o<e.length&&i<t.length&&e[o]===t[i];)o++,i++;return {x:o,y:i}}function Io(e,t,n,r){return e===-t||e!==t&&(n[e-1+r]??0)<(n[e+1+r]??0)?e+1:e-1}function Do(e,t,n,r,o,i){let a=n,l=r;for(;a>o&&l>i;)a--,l--,e.unshift({type:"context",content:t[a]??"",oldLineNo:a+1,newLineNo:l+1});return {x:a,y:l}}function vo(e,t,n,r,o,i,a){if(r<=0)return {x:o,y:i};if(o===a){let s=i-1;return e.unshift({type:"add",content:n[s]??"",newLineNo:s+1}),{x:o,y:s}}let l=o-1;return e.unshift({type:"remove",content:t[l]??"",oldLineNo:l+1}),{x:l,y:i}}function Bo(e,t){return {oldLines:e===""?[]:e.split(`
|
|
7
|
-
`),newLines:t===""?[]:t.split(`
|
|
8
|
-
`)}}function Fo(e){for(let t of e)t.lines.some(r=>r.type==="add"||r.type==="remove")||(t.collapsed=true);}function Po(e){let t=0,n=0,r=0;for(let o of e)o.type==="add"?t++:o.type==="remove"?n++:o.type==="context"&&r++;return {additions:t,deletions:n,contextLines:r}}function _o(e){let t=[];for(let n of e.chunks){if(n.collapsed){t.push({left:void 0,right:void 0});continue}let r=[],o=[];for(let i of n.lines){if(i.type==="context"){Mt(t,r,o),t.push({left:ee(i,"context","left"),right:ee(i,"context","right")});continue}if(i.type==="remove"){r.push(i);continue}i.type==="add"&&o.push(i);}Mt(t,r,o);}return t}function Mt(e,t,n){for(;t.length>0||n.length>0;){let r=t.shift(),o=n.shift();e.push({left:r?ee(r,"remove","left"):void 0,right:o?ee(o,"add","right"):void 0});}}function ee(e,t,n){return {lineNo:(n==="left"?e.oldLineNo:e.newLineNo)??0,content:e.content,type:t}}function Oo(e,t){return {id:t,oldStart:parseInt(e[1]??"0",10),oldCount:parseInt(e[2]??"1",10),newStart:parseInt(e[3]??"0",10),newCount:parseInt(e[4]??"1",10),lines:[],collapsed:false,contextBefore:0,contextAfter:0}}function No(e,t,n,r,o){let i=r>0?t[r-1]:void 0,a=o>0?n[o-1]:void 0;return i!==void 0&&a!==void 0&&i===a?{op:{type:"context",line:i,oldNo:r,newNo:o},nextI:r-1,nextJ:o-1}:a!==void 0&&(r===0||(e[r]?.[o-1]??0)>=(e[r-1]?.[o]??0))?{op:{type:"add",line:a,newNo:o},nextI:r,nextJ:o-1}:{op:{type:"remove",line:i??"",oldNo:r},nextI:r-1,nextJ:o}}function It(e,t,n){return !t||n.length===0?n:(e.push({...t,lines:n}),[])}function zo(e){return e.startsWith("+")?{line:{type:"add",content:e.slice(1)},additions:1,deletions:0,contextLines:0}:e.startsWith("-")?{line:{type:"remove",content:e.slice(1)},additions:0,deletions:1,contextLines:0}:e.startsWith(" ")?{line:{type:"context",content:e.slice(1)},additions:0,deletions:0,contextLines:1}:null}function Ho(e){return {additions:e.additions,deletions:e.deletions,totalChanges:e.additions+e.deletions,chunks:e.chunks.length,collapsedChunks:e.chunks.filter(t=>t.collapsed).length}}var Gt={};c(Gt,{CP1252_HIGH_BYTES:()=>ve,CP437_CONTROL_CHARS:()=>O,CP437_HIGH_BYTES:()=>Me,CP850_HIGH_BYTES:()=>Ie,CP866_HIGH_BYTES:()=>De,CodePageSchema:()=>C,ConversionOptionsSchema:()=>Go,UnmappableModeSchema:()=>_t,bufferToString:()=>$o,byteToChar:()=>Fe,charToByte:()=>jo,getCodePageMap:()=>Xo,getSupportedCodePages:()=>qo,isCodePageSupported:()=>Ko,stringToBuffer:()=>Zo});var Me=["\xC7","\xFC","\xE9","\xE2","\xE4","\xE0","\xE5","\xE7","\xEA","\xEB","\xE8","\xEF","\xEE","\xEC","\xC4","\xC5","\xC9","\xE6","\xC6","\xF4","\xF6","\xF2","\xFB","\xF9","\xFF","\xD6","\xDC","\xA2","\xA3","\xA5","\u20A7","\u0192","\xE1","\xED","\xF3","\xFA","\xF1","\xD1","\xAA","\xBA","\xBF","\u2310","\xAC","\xBD","\xBC","\xA1","\xAB","\xBB","\u2591","\u2592","\u2593","\u2502","\u2524","\u2561","\u2562","\u2556","\u2555","\u2563","\u2551","\u2557","\u255D","\u255C","\u255B","\u2510","\u2514","\u2534","\u252C","\u251C","\u2500","\u253C","\u255E","\u255F","\u255A","\u2554","\u2569","\u2566","\u2560","\u2550","\u256C","\u2567","\u2568","\u2564","\u2565","\u2559","\u2558","\u2552","\u2553","\u256B","\u256A","\u2518","\u250C","\u2588","\u2584","\u258C","\u2590","\u2580","\u03B1","\xDF","\u0393","\u03C0","\u03A3","\u03C3","\xB5","\u03C4","\u03A6","\u0398","\u03A9","\u03B4","\u221E","\u03C6","\u03B5","\u2229","\u2261","\xB1","\u2265","\u2264","\u2320","\u2321","\xF7","\u2248","\xB0","\u2219","\xB7","\u221A","\u207F","\xB2","\u25A0","\xA0"],O=["\0","\u263A","\u263B","\u2665","\u2666","\u2663","\u2660","\u2022","\u25D8","\u25CB","\u25D9","\u2642","\u2640","\u266A","\u266B","\u263C","\u25BA","\u25C4","\u2195","\u203C","\xB6","\xA7","\u25AC","\u21A8","\u2191","\u2193","\u2192","\u2190","\u221F","\u2194","\u25B2","\u25BC"],Ie=["\xC7","\xFC","\xE9","\xE2","\xE4","\xE0","\xE5","\xE7","\xEA","\xEB","\xE8","\xEF","\xEE","\xEC","\xC4","\xC5","\xC9","\xE6","\xC6","\xF4","\xF6","\xF2","\xFB","\xF9","\xFF","\xD6","\xDC","\xF8","\xA3","\xD8","\xD7","\u0192","\xE1","\xED","\xF3","\xFA","\xF1","\xD1","\xAA","\xBA","\xBF","\xAE","\xAC","\xBD","\xBC","\xA1","\xAB","\xBB","\u2591","\u2592","\u2593","\u2502","\u2524","\xC1","\xC2","\xC0","\xA9","\u2563","\u2551","\u2557","\u255D","\xA2","\xA5","\u2510","\u2514","\u2534","\u252C","\u251C","\u2500","\u253C","\xE3","\xC3","\u255A","\u2554","\u2569","\u2566","\u2560","\u2550","\u256C","\xA4","\xF0","\xD0","\xCA","\xCB","\xC8","\u0131","\xCD","\xCE","\xCF","\u2518","\u250C","\u2588","\u2584","\xA6","\xCC","\u2580","\xD3","\xDF","\xD4","\xD2","\xF5","\xD5","\xB5","\xFE","\xDE","\xDA","\xDB","\xD9","\xFD","\xDD","\xAF","\xB4","\xAD","\xB1","\u2017","\xBE","\xB6","\xA7","\xF7","\xB8","\xB0","\xA8","\xB7","\xB9","\xB3","\xB2","\u25A0","\xA0"],De=["\u0410","\u0411","\u0412","\u0413","\u0414","\u0415","\u0416","\u0417","\u0418","\u0419","\u041A","\u041B","\u041C","\u041D","\u041E","\u041F","\u0420","\u0421","\u0422","\u0423","\u0424","\u0425","\u0426","\u0427","\u0428","\u0429","\u042A","\u042B","\u042C","\u042D","\u042E","\u042F","\u0430","\u0431","\u0432","\u0433","\u0434","\u0435","\u0436","\u0437","\u0438","\u0439","\u043A","\u043B","\u043C","\u043D","\u043E","\u043F","\u2591","\u2592","\u2593","\u2502","\u2524","\u2561","\u2562","\u2556","\u2555","\u2563","\u2551","\u2557","\u255D","\u255C","\u255B","\u2510","\u2514","\u2534","\u252C","\u251C","\u2500","\u253C","\u255E","\u255F","\u255A","\u2554","\u2569","\u2566","\u2560","\u2550","\u256C","\u2567","\u2568","\u2564","\u2565","\u2559","\u2558","\u2552","\u2553","\u256B","\u256A","\u2518","\u250C","\u2588","\u2584","\u258C","\u2590","\u2580","\u0440","\u0441","\u0442","\u0443","\u0444","\u0445","\u0446","\u0447","\u0448","\u0449","\u044A","\u044B","\u044C","\u044D","\u044E","\u044F","\u0401","\u0451","\u0404","\u0454","\u0407","\u0457","\u040E","\u045E","\xB0","\u2219","\xB7","\u221A","\u2116","\xA4","\u25A0","\xA0"],ve=["\u20AC","\x81","\u201A","\u0192","\u201E","\u2026","\u2020","\u2021","\u02C6","\u2030","\u0160","\u2039","\u0152","\x8D","\u017D","\x8F","\x90","\u2018","\u2019","\u201C","\u201D","\u2022","\u2013","\u2014","\u02DC","\u2122","\u0161","\u203A","\u0153","\x9D","\u017E","\u0178","\xA0","\xA1","\xA2","\xA3","\xA4","\xA5","\xA6","\xA7","\xA8","\xA9","\xAA","\xAB","\xAC","\xAD","\xAE","\xAF","\xB0","\xB1","\xB2","\xB3","\xB4","\xB5","\xB6","\xB7","\xB8","\xB9","\xBA","\xBB","\xBC","\xBD","\xBE","\xBF","\xC0","\xC1","\xC2","\xC3","\xC4","\xC5","\xC6","\xC7","\xC8","\xC9","\xCA","\xCB","\xCC","\xCD","\xCE","\xCF","\xD0","\xD1","\xD2","\xD3","\xD4","\xD5","\xD6","\xD7","\xD8","\xD9","\xDA","\xDB","\xDC","\xDD","\xDE","\xDF","\xE0","\xE1","\xE2","\xE3","\xE4","\xE5","\xE6","\xE7","\xE8","\xE9","\xEA","\xEB","\xEC","\xED","\xEE","\xEF","\xF0","\xF1","\xF2","\xF3","\xF4","\xF5","\xF6","\xF7","\xF8","\xF9","\xFA","\xFB","\xFC","\xFD","\xFE","\xFF"],Be={cp437:Me,cp850:Ie,cp866:De,cp1252:ve},Ft={cp437:O,cp850:void 0,cp866:void 0,cp1252:void 0};var C=z$1.enum(["cp437","cp850","cp866","cp1252"]),_t=z$1.enum(["replace","skip","error"]),Go=z$1.object({codepage:C,unmappable:_t.default("replace"),replacement:z$1.string().default("\uFFFD"),interpretControlChars:z$1.boolean().default(false)}).strict(),Ot=128,Nt=32,Uo=128,zt=255;function Vo(e,t){let n=new Map;for(let r=0;r<e.length;r++){let o=e[r];o&&n.set(o,Ot+r);}if(t)for(let r=0;r<t.length;r++){let o=t[r];o&&o!=="\0"&&n.set(o,r);}for(let r=0;r<Nt;r++)n.set(String.fromCharCode(r),r);for(let r=32;r<=126;r++)n.set(String.fromCharCode(r),r);return n.set("\x7F",127),n}var Pt=new Map;function Ht(e){let t=Pt.get(e);if(t)return t;let n=Be[e],r=Ft[e];if(!n)throw new Error(`Unknown codepage: ${e}`);let o=Vo(n,r);return Pt.set(e,o),o}function Fe(e,t,n){let r=C.parse(t);if(e<0||e>zt)throw new RangeError(`Byte value must be 0-255, got: ${e}`);let o=e|0;if(o<Nt){if(n?.interpretControlChars&&r==="cp437"){let s=O[o];if(s)return s}return String.fromCharCode(o)}if(o<Uo)return String.fromCharCode(o);let i=Be[r];if(!i)throw new Error(`Unknown codepage: ${r}`);let a=o-Ot,l=i[a];return l||(n?.replacement??"\uFFFD")}function jo(e,t){let n=C.parse(t),r=Ht(n),i=[...e][0];if(i)return r.get(i)}function $o(e,t,n){let r=C.parse(t),o={replacement:"\uFFFD",interpretControlChars:false,...n},i=[];for(let a=0;a<e.length;a++){let l=e[a];if(l===void 0)continue;let s=Fe(l,r,o);i.push(s);}return i.join("")}function Zo(e,t,n){let r=C.parse(t),o={unmappable:"replace",replacement:"?",...n},i=Ht(r),a=[],l=[...e];for(let s=0;s<l.length;s++){let u=l[s];if(!u)continue;let d=i.get(u);if(d!==void 0){a.push(d);continue}switch(o.unmappable){case "error":throw new Error(`Character '${u}' (U+${u.codePointAt(0)?.toString(16).toUpperCase().padStart(4,"0")}) cannot be encoded in ${r}`);case "skip":break;default:{let f=o.replacement??"?",c=i.get(f);c!==void 0?a.push(c):a.push(63);break}}}return Buffer.from(a)}function Ko(e){return C.safeParse(e).success}function qo(){return ["cp437","cp850","cp866","cp1252"]}function Xo(e,t){let n=C.parse(e),r=[];for(let o=0;o<=zt;o++)r.push(Fe(o,n,t));return r}var Ut=55296,Vt=56319,jt=56320,$t=57343;function Pe(e){return e>=55296&&e<=56319}function _e(e){return e>=56320&&e<=57343}function z(e){return e>=55296&&e<=57343}function Zt(e,t){if(t<0||t>=e.length)return false;let n=e.charCodeAt(t);return z(n)}function Kt(e,t){if(!Pe(e))throw new Error(`Invalid high surrogate: 0x${e.toString(16)}`);if(!_e(t))throw new Error(`Invalid low surrogate: 0x${t.toString(16)}`);return (e-55296)*1024+(t-56320)+65536}function qt(e){if(e<=65535)throw new Error(`Code point 0x${e.toString(16)} doesn't need surrogate encoding`);if(e>1114111)throw new Error(`Invalid code point: 0x${e.toString(16)} (exceeds U+10FFFF)`);let t=e-65536,n=(t>>10)+55296,r=(t&1023)+56320;return [n,r]}function Xt(e,t){if(t<0||t>=e.length)return -1;let n=e.codePointAt(t);return n===void 0?-1:n}function Jt(...e){return String.fromCodePoint(...e)}function*Oe(e){for(let t of e){let n=t.codePointAt(0);n!==void 0&&(yield n);}}function Yt(e){return [...Oe(e)]}function*Qt(e){for(let t of e)yield t;}function en(e){let t=0;for(let n of e)t++;return t}function tn(e){return !(e<0||e>1114111||e>=55296&&e<=57343)}function nn(e){return e>=0&&e<=65535}function te(e){return e>=65536&&e<=1114111}function rn(e,t){if(t<0)return "";let n=0;for(let r of e){if(n===t)return r;n++;}return ""}function on(e,t,n){let r=t<0?0:t,o="",i=0;for(let a of e){if(n!==void 0&&i>=n)break;i>=r&&(o+=a),i++;}return o}var ne=[[768,879],[6832,6911],[7616,7679],[8400,8447],[65056,65071],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1552,1562],[1611,1631],[1648,1648],[1750,1756],[1759,1764],[1767,1768],[1770,1773],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2260,2273],[2275,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2901,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6159,6159],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[65024,65039],[917760,917999]],re=new Set((function*(){for(let[e,t]of ne)for(let n=e;n<=t;n++)yield n;})());function Jo(e,t){let n=0,r=t.length-1;for(;n<=r;){let o=Math.floor((n+r)/2),i=t[o];if(!i)break;let[a,l]=i;if(e<a)r=o-1;else if(e>l)n=o+1;else return true}return false}function H(e){return e<768?false:re.has(e)}function an(e){return e<768?false:Jo(e,ne)}function ln(){return re.size}var Ne=[[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12352,12447],[12448,12543],[12544,12591],[12592,12687],[12688,12703],[12704,12735],[12736,12783],[12784,12799],[12800,13055],[13056,13311],[13312,19903],[19968,40959],[40960,42127],[42128,42191],[44032,55203],[63744,64255],[65040,65055],[65072,65103],[65104,65135],[65280,65376],[65504,65510],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[194560,195103],[196608,201551],[201552,205743]],sn=[[65281,65374],[65504,65510]],ze=[[0,31],[127,159],[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1552,1562],[1611,1631],[1648,1648],[1750,1756],[1759,1764],[1767,1768],[1770,1773],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2260,2273],[2275,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[6832,6845],[6846,6846],[6847,6848],[7616,7679],[8203,8207],[8288,8292],[8294,8303],[8400,8447],[65024,65039],[65056,65071],[65279,65279],[917760,917999]],He=[[161,161],[164,164],[167,168],[170,170],[173,174],[176,180],[182,186],[188,191],[198,198],[208,208],[215,216],[222,225],[230,230],[232,234],[236,237],[240,240],[242,243],[247,250],[252,252],[254,254],[913,929],[931,937],[945,961],[963,969],[1025,1025],[1040,1103],[1105,1105],[9472,9599],[9600,9631],[9632,9727],[9728,9983],[9984,10175]],Ge=[[127744,128511],[128512,128591],[128640,128767],[129280,129535],[129536,129647],[129648,129791]];function oe(e,t){let n=0,r=t.length-1;for(;n<=r;){let o=Math.floor((n+r)/2),i=t[o];if(!i)break;let[a,l]=i;if(e<a)r=o-1;else if(e>l)n=o+1;else return true}return false}function D(e){return e<4352?false:!!(oe(e,Ne)||oe(e,Ge))}function S(e){return oe(e,ze)}function Ue(e){return oe(e,He)}function p(e,t=false){return S(e)?0:D(e)||t&&Ue(e)?2:1}var un=typeof Intl<"u"&&"Segmenter"in Intl,Ve=null;function dn(){return un?(Ve||(Ve=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Ve):null}function*A(e){if(e.length===0)return;let t=dn();if(t)for(let n of t.segment(e))yield n.segment;else for(let n of e)yield n;}function je(e){return [...A(e)]}function fn(e){if(e.length===0)return 0;let t=dn();if(t){let r=0;for(let o of t.segment(e))r++;return r}let n=0;for(let r of e)n++;return n}function cn(e,t){if(t<0)return;let n=0;for(let r of A(e)){if(n===t)return r;n++;}}function mn(e,t,n){let r=t<0?0:t,o="",i=0;for(let a of A(e)){if(n!==void 0&&i>=n)break;i>=r&&(o+=a),i++;}return o}function le(e){if(e.length===0)return 0;let t=e.codePointAt(0);return t===void 0?0:Yo(e)?2:p(t)}function Yo(e){if(e.length===0)return false;let t=e.codePointAt(0);return t===void 0?false:!!(t>=127462&&t<=127487||t>=127744&&t<=129535||t>=129536&&t<=129791||t>=9728&&t<=9983||t>=9984&&t<=10175||e.includes("\uFE0F")||e.includes("\u200D"))}function ie(e){let t=0;for(let n of A(e))t+=le(n);return t}function ae(e,t){let n=0,r="";for(let o of A(e)){let i=le(o);if(n+i>t)return {text:r,width:n,truncated:true};n+=i,r+=o;}return {text:r,width:n,truncated:false}}function hn(e,t,n="\u2026"){if(ie(e)<=t)return e;let o=ie(n);if(o>=t)return ae(n,t).text;let i=t-o;return ae(e,i).text+n}function gn(){return un}function pn(e){return je(e).reverse().join("")}var Qo={replacement:"?",dropWide:true,dropCombining:true,dropAstral:true,dropZeroWidth:true,dropControl:false};function bn(e){return e>=0&&e<=31?e!==9&&e!==10&&e!==13:e===127||e>=128&&e<=159}function ei(e){return e===9||e===10||e===13}function ti(e,t,n){return n&&S(t)?ei(t)?e:"":null}function ni(e,t,n,r,o){return te(t)?n||r&&D(t)?o:e:null}function ri(e,t,n){if(z(t))return n.replacement;if(H(t))return n.dropCombining?"":e;if(bn(t))return n.dropControl?"":e;let r=ti(e,t,n.dropZeroWidth);if(r!==null)return r;let o=ni(e,t,n.dropAstral,n.dropWide,n.replacement);return o!==null?o:n.dropWide&&D(t)?n.replacement:e}function xn(e,t){let n={...Qo,...t},r="";for(let o of e){let i=o.codePointAt(0);if(i===void 0){r+=n.replacement;continue}r+=ri(o,i,n);}return r}function yn(e,t="?"){let n="";for(let r of e){let o=r.codePointAt(0);if(o===void 0){n+=t;continue}o>=32&&o<=126||o===9||o===10||o===13?n+=r:n+=t;}return n}function Cn(e){let t="";for(let n of e){let r=n.codePointAt(0);r!==void 0&&!S(r)&&(t+=n);}return t}function Sn(e){let t="";for(let n of e){let r=n.codePointAt(0);r!==void 0&&!H(r)&&(t+=n);}return t}function Ln(e){let t="";for(let n of e){let r=n.codePointAt(0);r!==void 0&&!bn(r)&&(t+=n);}return t}function kn(e){return e.normalize("NFC")}function Tn(e){return e.normalize("NFD")}function Rn(e){return e.normalize("NFKC")}function An(e){return e.normalize("NFKD")}function wn(e,t=false){return p(e,t)}function G(e,t=false){if(e.length===0)return 0;let n=e.codePointAt(0);return n===void 0?0:p(n,t)}function En(e,t,n=false){if(t<0)return -1;let r=0;for(let o of e){if(r===t){let i=o.codePointAt(0);return i===void 0?0:p(i,n)}r++;}return -1}var ue=8,de=9;function b(e,t){let n=t?.tabWidth??ue,r=t?.ambiguousAsWide??false,o=0;for(let i of e){let a=i.codePointAt(0);if(a!==void 0){if(a===de){let l=o%n;o+=n-l;continue}o+=p(a,r);}}return o}function Wn(e,t){return b(e,t)}function $e(e,t,n){let r=n?.ambiguousAsWide??false,o=n?.tabWidth??ue,i=0,a="";for(let l of e){let s=l.codePointAt(0);if(s===void 0)continue;let u;if(s===de){let d=i%o;u=o-d;}else u=p(s,r);if(i+u>t)return {text:a,width:i,truncated:true};i+=u,a+=l;}return {text:a,width:i,truncated:false}}function se(e,t,n){return $e(e,t,n).text}function Mn(e,t,n="\u2026",r){if(b(e,r)<=t)return e;let i=b(n,r);if(i>=t)return se(n,t,r);let a=t-i;return se(e,a,r)+n}function In(e,t,n=" ",r){let o=b(e,r);if(o>=t)return e;let i=G(n,r?.ambiguousAsWide);if(i===0)return e;let a=t-o,l=Math.floor(a/i);return e+n.repeat(l)}function Dn(e,t,n=" ",r){let o=b(e,r);if(o>=t)return e;let i=G(n,r?.ambiguousAsWide);if(i===0)return e;let a=t-o,l=Math.floor(a/i);return n.repeat(l)+e}function vn(e,t,n=" ",r){let o=b(e,r);if(o>=t)return e;let i=G(n,r?.ambiguousAsWide);if(i===0)return e;let a=t-o,l=Math.floor(a/2),s=a-l,u=Math.floor(l/i),d=Math.floor(s/i);return n.repeat(u)+e+n.repeat(d)}function Bn(e,t,n){let r=n?.ambiguousAsWide??false,o=n?.tabWidth??ue;if(t<0)return -1;let i=0,a=0;for(let l of e){let s=l.codePointAt(0);if(s===void 0){a++;continue}let u;if(s===de){let d=i%o;u=o-d;}else u=p(s,r);if(t>=i&&t<i+u||u===0&&t===i)return a;i+=u,a++;}return -1}function Fn(e,t,n){let r=n?.ambiguousAsWide??false,o=n?.tabWidth??ue;if(t<0)return -1;let i=0,a=0;for(let l of e){if(a===t)return i;let s=l.codePointAt(0);if(s===void 0){a++;continue}let u;if(s===de){let d=i%o;u=o-d;}else u=p(s,r);i+=u,a++;}return -1}function Pn(e){for(let t of e){let n=t.codePointAt(0);if(n!==void 0&&p(n)===2)return true}return false}function _n(e){for(let t of e){let n=t.codePointAt(0);if(n!==void 0&&S(n))return true}return false}var On=z$1.object({codePoint:z$1.number().int().nonnegative(),width:z$1.number().int().min(0).max(2)}),Nn=z$1.object({terminal:z$1.string().min(1),overrides:z$1.array(On)});function oi(){return [{label:"Family emoji (ZWJ sequence)",input:"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}",expectedWidth:2,category:"emoji-zwj",notes:"Most terminals render as single 2-wide glyph, some render 8-wide"},{label:"Couple with heart (ZWJ)",input:"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F468}",expectedWidth:2,category:"emoji-zwj",notes:"ZWJ joins three characters into one grapheme"},{label:"Person with white hair (ZWJ)",input:"\u{1F9D1}\u200D\u{1F9B3}",expectedWidth:2,category:"emoji-zwj"},{label:"Pirate flag (ZWJ)",input:"\u{1F3F4}\u200D\u2620\uFE0F",expectedWidth:2,category:"emoji-zwj"},{label:"ZWJ character alone",input:"\u200D",expectedWidth:0,category:"emoji-zwj"},{label:"US flag (regional indicators)",input:"\u{1F1FA}\u{1F1F8}",expectedWidth:2,category:"regional-indicators",notes:"Two regional indicators form a flag"},{label:"Japan flag",input:"\u{1F1EF}\u{1F1F5}",expectedWidth:2,category:"regional-indicators"},{label:"Single regional indicator",input:"\u{1F1FA}",expectedWidth:2,category:"regional-indicators",notes:"Unpaired regional indicators vary by terminal"},{label:"Text presentation (VS15)",input:"\u2764\uFE0E",expectedWidth:1,category:"variation-selectors",notes:"VS15 forces text presentation (narrow)"},{label:"Emoji presentation (VS16)",input:"\u2764\uFE0F",expectedWidth:2,category:"variation-selectors",notes:"VS16 forces emoji presentation (wide)"},{label:"Number sign with VS16",input:"#\uFE0F\u20E3",expectedWidth:2,category:"variation-selectors",notes:"Keycap sequence"},{label:"Variation selector alone",input:"\uFE0F",expectedWidth:0,category:"variation-selectors"},{label:"CJK ideograph (U+4E2D)",input:"\u4E2D",expectedWidth:2,category:"cjk"},{label:'CJK string "\u4E2D\u6587\u6D4B\u8BD5"',input:"\u4E2D\u6587\u6D4B\u8BD5",expectedWidth:8,category:"cjk"},{label:"Hangul syllable (\uAC00)",input:"\uAC00",expectedWidth:2,category:"cjk"},{label:"Katakana (\u30AB\u30BF\u30AB\u30CA)",input:"\u30AB\u30BF\u30AB\u30CA",expectedWidth:8,category:"cjk"},{label:"CJK compatibility ideograph",input:"\uF900",expectedWidth:2,category:"cjk"},{label:"Latin a + combining acute",input:"a\u0301",expectedWidth:1,category:"combining"},{label:"Multiple combining marks (Zalgo-style)",input:"a\u0300\u0301\u0302\u0303",expectedWidth:1,category:"combining",notes:"All combining marks are zero-width"},{label:"Devanagari with combining",input:"\u0915\u094D\u0937",expectedWidth:2,category:"combining",notes:"Consonant cluster"},{label:"Korean jamo with combining",input:"\u1100\u1161",expectedWidth:2,category:"combining",notes:"Lead + vowel jamo"},{label:"Single tab",input:" ",expectedWidth:8,category:"tabs",notes:"Default tab width is 8"},{label:"Tab after 3 chars",input:"abc ",expectedWidth:8,category:"tabs",notes:"Tab extends to next 8-column boundary"},{label:"Null character",input:"\0",expectedWidth:0,category:"control"},{label:"Bell character",input:"\x07",expectedWidth:0,category:"control"},{label:"Backspace",input:"\b",expectedWidth:0,category:"control"},{label:"Soft hyphen",input:"\xAD",expectedWidth:1,category:"control",notes:"Soft hyphen is technically a format character but width=1 in most terminals"},{label:"Fullwidth A",input:"\uFF21",expectedWidth:2,category:"fullwidth"},{label:"Fullwidth digits",input:"\uFF10\uFF11\uFF12",expectedWidth:6,category:"fullwidth"},{label:"Fullwidth exclamation mark",input:"\uFF01",expectedWidth:2,category:"fullwidth"},{label:"Halfwidth katakana",input:"\uFF66",expectedWidth:1,category:"halfwidth"},{label:"Halfwidth Hangul",input:"\uFFA0",expectedWidth:1,category:"halfwidth"},{label:"Greek alpha",input:"\u03B1",expectedWidth:1,category:"ambiguous",notes:"Ambiguous width - 1 in Western locale, 2 in CJK locale"},{label:"Box drawing (light horizontal)",input:"\u2500",expectedWidth:1,category:"ambiguous"},{label:"Bullet (\u2022)",input:"\u2022",expectedWidth:1,category:"ambiguous"},{label:"Musical symbol (U+1D11E)",input:"\u{1D11E}",expectedWidth:1,category:"surrogate-pairs"},{label:"Emoji face (U+1F600)",input:"\u{1F600}",expectedWidth:2,category:"surrogate-pairs"},{label:"Skin tone modifier (U+1F3FD)",input:"\u{1F44B}\u{1F3FD}",expectedWidth:2,category:"surrogate-pairs",notes:"Waving hand + medium skin tone"},{label:"ASCII + CJK mixed",input:"Hello\u4E16\u754C",expectedWidth:9,category:"mixed"},{label:"Emoji + text mixed",input:"\u{1F389} Party!",expectedWidth:9,category:"mixed"},{label:"Empty string",input:"",expectedWidth:0,category:"mixed"},{label:"Newline only",input:`
|
|
9
|
-
`,expectedWidth:0,category:"mixed"}]}function ii(){return [{label:"Family ZWJ emoji",input:"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}",expectedWidth:2,terminalWidths:{"xterm-256color":8,kitty:2,alacritty:2,wezterm:2,"gnome-terminal":2,iterm2:2,"windows-terminal":2},severity:"major"},{label:"Flag sequence (regional indicators)",input:"\u{1F1FA}\u{1F1F8}",expectedWidth:2,terminalWidths:{"xterm-256color":4,kitty:2,alacritty:2,wezterm:2,iterm2:2},severity:"major"},{label:"Unpaired regional indicator",input:"\u{1F1FA}",expectedWidth:2,terminalWidths:{"xterm-256color":2,kitty:1,alacritty:2},severity:"minor"},{label:"Skin tone emoji",input:"\u{1F44B}\u{1F3FD}",expectedWidth:2,terminalWidths:{"xterm-256color":4,kitty:2,alacritty:2,iterm2:2},severity:"major"},{label:"VS16 heart emoji",input:"\u2764\uFE0F",expectedWidth:2,terminalWidths:{"xterm-256color":1,kitty:2,alacritty:2,iterm2:2},severity:"minor"},{label:"Keycap sequence #\uFE0F\u20E3",input:"#\uFE0F\u20E3",expectedWidth:2,terminalWidths:{"xterm-256color":2,kitty:2,alacritty:1},severity:"minor"},{label:"Devanagari conjunct",input:"\u0915\u094D\u0937",expectedWidth:2,terminalWidths:{"xterm-256color":1,kitty:2,alacritty:1},severity:"minor"},{label:"Zalgo text (heavy combining)",input:"a\u0300\u0301\u0302\u0303\u0304\u0305\u0306\u0307",expectedWidth:1,terminalWidths:{"xterm-256color":1,kitty:1,alacritty:1},severity:"critical"}]}var B=new Map;function ai(e){let t=Nn.parse(e);for(let n of t.overrides)B.set(n.codePoint,n.width);}function li(){B.clear();}function si(){return B.size}function ui(e){return B.get(e)??null}function di(e,t){if(B.size===0)return b(e,t);let n=t?.tabWidth??8,r=0,o=0;for(let i=0;i<e.length;i++){let a=e.codePointAt(i);if(a===void 0)continue;if(a===10){o=0;continue}if(a===9){let s=n-o%n;r+=s,o+=s;continue}let l=B.get(a);if(l!==void 0)r+=l,o+=l;else {let s=p(a);r+=s,o+=s;}a>65535&&i++;}return r}function fi(e,t){let n=[],r=0;for(let o of e){let i=b(o.input,t);i===o.expectedWidth?r++:n.push({testCase:o,actualWidth:i});}return {total:e.length,passed:r,failed:n.length,failures:n}}function ci(e,t){return e.filter(n=>n.category===t)}function mi(e){let t=new Set;for(let n of e)t.add(n.category);return [...t]}function hi(e){let t=[];if(t.push(`Width Test Results: ${e.passed}/${e.total} passed`),t.push(""),e.failures.length===0)return t.push("All tests passed!"),t.join(`
|
|
10
|
-
`);t.push(`Failures (${e.failed}):`);for(let n of e.failures)t.push(` [${n.testCase.category}] ${n.testCase.label}`),t.push(` Expected: ${n.testCase.expectedWidth}, Got: ${n.actualWidth}`),t.push(` Input: ${JSON.stringify(n.testCase.input)}`),n.testCase.notes&&t.push(` Note: ${n.testCase.notes}`);return t.join(`
|
|
11
|
-
`)}var gi=1e3,zn=100;function fe(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t^e.charCodeAt(n);return t>>>0}function pi(e){return {width:e,entries:new Map,dirty:new Set,totalLines:0,lineOffsets:[],fullInvalidate:true}}function bi(e){e.entries.clear(),e.dirty.clear(),e.totalLines=0,e.lineOffsets.length=0,e.fullInvalidate=true;}function xi(e,t){if(e.width!==t){e.width=t,e.fullInvalidate=true;for(let[n]of e.entries)e.dirty.add(n);}}function yi(e,t,n,r){if(t<=0)return {lines:[""],breakPoints:[0]};if(e.length===0)return {lines:[""],breakPoints:[0]};let o=Ci();for(let i=0;i<=e.length;i++)Ai(o,e,i,t,n,r);return {lines:o.lines,breakPoints:o.breakPoints}}function Ci(){return {lines:[],breakPoints:[0],lineStart:0,lineWidth:0,wordWidth:0,lastBreakable:-1,lastBreakableWidth:0}}function Si(e,t,n,r){let o=t.slice(e.lineStart,n);(o.length>0||e.lines.length===0)&&(e.lines.push(o),r||e.breakPoints.push(n+1)),Li(e,n+1);}function Li(e,t){e.lineStart=t,e.lineWidth=0,e.wordWidth=0,e.lastBreakable=-1,e.lastBreakableWidth=0;}function ki(e,t,n){e.lastBreakable=t,e.lastBreakableWidth=e.lineWidth,e.wordWidth=0,e.lineWidth+=n;}function Ti(e,t){e.wordWidth+=t,e.lineWidth+=t;}function Ri(e,t,n,r,o,i){if(e.lastBreakable>=e.lineStart&&!i){let a=t.slice(e.lineStart,e.lastBreakable);e.lines.push(a),e.breakPoints.push(e.lastBreakable+1),e.lineStart=e.lastBreakable+1,e.lineWidth=e.lineWidth-e.lastBreakableWidth-1,e.lastBreakable=-1;return}if(i||e.wordWidth>o){let a=t.slice(e.lineStart,n);e.lines.push(a),e.breakPoints.push(n),e.lineStart=n,e.lineWidth=r,e.wordWidth=r,e.lastBreakable=-1;}}function Ai(e,t,n,r,o,i){let a=n<t.length?t[n]:void 0,l=n===t.length;if(a===`
|
|
12
|
-
`||l){Si(e,t,n,l);return}let u=i?b(a??""):1;a===" "||a===" "?ki(e,n,u):Ti(e,u),e.lineWidth>r&&Ri(e,t,n,u,r,o);}function Ze(e,t,n,r){let{lines:o,breakPoints:i}=yi(e,t,n,r);return {text:e,hash:fe(e),width:t,lines:o,breakPoints:i}}function wi(e,t,n){let r=n?.width??e.width,o=n?.breakWord??false,i=n?.unicodeWidth??true,a=t.split(`
|
|
13
|
-
`),l=[];e.lineOffsets.length=0;let s=0;for(let u=0;u<a.length;u++){let d=a[u];if(d===void 0)continue;e.lineOffsets.push(s);let f=e.entries.get(u),c=fe(d);if(f&&f.hash===c&&f.width===r&&!e.dirty.has(u)&&!e.fullInvalidate){l.push(...f.lines),s+=f.lines.length;continue}let m=Ze(d,r,o,i);e.entries.set(u,m),e.dirty.delete(u),l.push(...m.lines),s+=m.lines.length;}e.totalLines=s,e.fullInvalidate=false;for(let[u]of e.entries)u>=a.length&&e.entries.delete(u);return l}function Ei(e,t,n,r,o){let i=performance.now(),a=o?.width??e.width,l=o?.breakWord??false,s=o?.unicodeWidth??true,u=t.split(`
|
|
14
|
-
`),d=[],f=Wi(e,n),c=f.currentLine,m=f.targetParagraph,h=0,g=u.length;for(let x=m;x<g&&c<r;x++){let St=u[x];if(St===void 0)continue;let Lr=Mi(e,x,St,a,l,s);c=Ii(d,Lr.lines,c,n,r),h=x+1;}let M=performance.now()-i;return {lines:d,hasMore:h<g,nextParagraph:h,timeMs:M}}function Wi(e,t){let n=0,r=0;if(e.lineOffsets.length===0||e.fullInvalidate)return {targetParagraph:n,currentLine:r};for(let o=0;o<e.lineOffsets.length;o++){let i=e.lineOffsets[o];if(i!==void 0&&i<=t)n=o,r=i;else break}return {targetParagraph:n,currentLine:r}}function Mi(e,t,n,r,o,i){let a=e.entries.get(t),l=fe(n);if(a&&a.hash===l&&a.width===r&&!e.dirty.has(t)&&!e.fullInvalidate)return a;let s=Ze(n,r,o,i);return e.entries.set(t,s),e.dirty.delete(t),s}function Ii(e,t,n,r,o){let i=n;for(let a=0;a<t.length;a++){if(i>=r&&i<o){let l=t[a];l!==void 0&&e.push(l);}i++;}return i}function Di(e,t,n,r=zn,o){let i=performance.now(),a=o?.width??e.width,l=o?.breakWord??false,s=o?.unicodeWidth??true,u=t.split(`
|
|
15
|
-
`),d=[],f=Math.min(n+r,u.length);for(let m=n;m<f;m++){let h=u[m];if(h===void 0)continue;let g=e.entries.get(m),M=fe(h),x;g&&g.hash===M&&g.width===a&&!e.dirty.has(m)&&!e.fullInvalidate?x=g:(x=Ze(h,a,l,s),e.entries.set(m,x),e.dirty.delete(m)),d.push(...x.lines);}let c=performance.now()-i;return {lines:d,hasMore:f<u.length,nextParagraph:f,timeMs:c}}function vi(e,t,n){for(let r=t;r<n;r++)e.dirty.add(r);}function Bi(e,t){e.dirty.add(t);}function Fi(e){e.fullInvalidate=true;}function Pi(e,t){if(t<0||t>=e.totalLines)return;let n=0,r=e.lineOffsets.length-1,o=0;for(;n<=r;){let u=Math.floor((n+r)/2),d=e.lineOffsets[u];if(d===void 0)break;d<=t?(o=u,n=u+1):r=u-1;}let i=e.lineOffsets[o]??0,a=t-i,s=e.entries.get(o)?.breakPoints[a]??0;return {paragraph:o,lineInParagraph:a,charOffset:s}}function _i(e,t,n=0){if(t<0||t>=e.lineOffsets.length)return -1;let r=e.lineOffsets[t];return r===void 0?-1:r+n}function Oi(e){return {cachedParagraphs:e.entries.size,dirtyParagraphs:e.dirty.size,totalLines:e.totalLines,width:e.width,fullInvalidate:e.fullInvalidate}}var Ni={minFoldableLines:2,labelTemplate:"... {count} lines",maxDepth:10};function zi(e,t){return {config:{...Ni,...t},regions:new Map,totalDocumentLines:e,nextId:0}}function Hi(e,t,n,r){let o=n-t;if(o<e.config.minFoldableLines||t<0||n>=e.totalDocumentLines||t>=n)return;let i=`fold-${e.nextId++}`,a=na(e,t,n);if(a>=e.config.maxDepth)return;let l=r??e.config.labelTemplate.replace("{count}",String(o)),s={id:i,startLine:t,endLine:n,folded:false,label:l,depth:a};return e.regions.set(i,s),i}function Gi(e,t){return e.regions.delete(t)}function Ui(e,t){let n=e.regions.get(t);return !n||n.folded?false:(e.regions.set(t,{...n,folded:true}),true)}function Vi(e,t){let n=e.regions.get(t);return !n||!n.folded?false:(e.regions.set(t,{...n,folded:false}),true)}function ji(e,t){let n=e.regions.get(t);if(!n)return;let r=!n.folded;return e.regions.set(t,{...n,folded:r}),r}function $i(e){let t=0;for(let[n,r]of e.regions)r.folded||(e.regions.set(n,{...r,folded:true}),t++);return t}function Zi(e){let t=0;for(let[n,r]of e.regions)r.folded&&(e.regions.set(n,{...r,folded:false}),t++);return t}function Ki(e,t){let n=0;for(let[r,o]of e.regions)o.depth>=t&&!o.folded&&(e.regions.set(r,{...o,folded:true}),n++);return n}function qi(e,t){let n;for(let r of e.regions.values())t>=r.startLine&&t<=r.endLine&&(!n||r.depth>n.depth)&&(n=r);return n}function Xi(e){return Array.from(e.regions.values()).sort((t,n)=>t.startLine-n.startLine)}function Ji(e,t,n){let r=me(e),o=[],i=0,a=0;for(;i<t&&a<e.totalDocumentLines;){let l=ce(r,a);l?(i++,a=l.endLine+1):(i++,a++);}for(;o.length<n&&a<e.totalDocumentLines;){let l=ce(r,a);l?(o.push({originalLine:l.startLine,isFoldPlaceholder:true,foldId:l.id,foldLabel:l.label,hiddenLines:l.endLine-l.startLine}),a=l.endLine+1):(o.push({originalLine:a,isFoldPlaceholder:false,foldId:void 0,foldLabel:void 0,hiddenLines:0}),a++);}return o}function Yi(e,t){let n=me(e),r=0,o=0;for(;r<t&&o<e.totalDocumentLines;){let i=ce(n,o);i?(r++,o=i.endLine+1):(r++,o++);}return o}function Qi(e,t){let n=me(e),r=0,o=0;for(;o<t&&o<e.totalDocumentLines;){let i=ce(n,o);if(i){if(r++,t>i.startLine&&t<=i.endLine)return -1;o=i.endLine+1;}else r++,o++;}return r}function ea(e){let t=0,n=0,r=0,o=me(e);for(let i of o)t++,n+=i.endLine-i.startLine;for(let i of e.regions.values())i.depth>r&&(r=i.depth),i.folded&&(t=Math.max(t,t));return {totalRegions:e.regions.size,foldedRegions:t,hiddenLines:n,visibleLines:e.totalDocumentLines-n,maxDepth:r}}function ta(e,t){e.totalDocumentLines=t;for(let[n,r]of e.regions)(r.startLine>=t||r.endLine>=t)&&e.regions.delete(n);}function na(e,t,n){let r=0;for(let o of e.regions.values())o.startLine<=t&&o.endLine>=n&&(r=Math.max(r,o.depth+1));return r}function me(e){let t=[];for(let r of e.regions.values())r.folded&&t.push({id:r.id,startLine:r.startLine,endLine:r.endLine,label:r.label});t.sort((r,o)=>r.startLine-o.startLine);let n=[];for(let r of t){let o=n[n.length-1];if(o&&r.startLine<=o.endLine){r.endLine>o.endLine&&(n[n.length-1]={...o,endLine:r.endLine});continue}n.push(r);}return n}function ce(e,t){let n=0,r=e.length-1;for(;n<=r;){let o=n+r>>>1,i=e[o];if(!i)break;if(t<i.startLine)r=o-1;else if(t>i.endLine)n=o+1;else return i}}var ra=z$1.object({caseSensitive:z$1.boolean().default(false),threshold:z$1.number().min(0).max(1).default(0),limit:z$1.number().int().positive().optional(),consecutiveBonus:z$1.number().min(0).max(1).default(.3),wordBoundaryBonus:z$1.number().min(0).max(1).default(.2),prefixBonus:z$1.number().min(0).max(1).default(.5),gapPenalty:z$1.number().min(0).max(1).default(.1)}),oa={caseSensitive:false,threshold:0,limit:void 0,consecutiveBonus:.3,wordBoundaryBonus:.2,prefixBonus:.5,gapPenalty:.1};function Ke(e={}){return {...oa,...e}}function ia(e,t){if(t===0)return true;let n=e[t-1],r=e[t];return !n||!r?false:n===" "||n==="_"||n==="-"||n==="/"||n===n.toLowerCase()&&r===r.toUpperCase()}function aa(e,t,n,r,o,i){let a=e.length/Math.max(t.length,e.length),l=0,s=-2;for(let u=0;u<o.length;u++){let d=o[u];if(d!==void 0){if(d===s+1)l++,a+=i.consecutiveBonus*(l/e.length);else if(l=0,s>=0){let f=d-s-1;a-=i.gapPenalty*(f/t.length);}ia(t,d)&&(a+=i.wordBoundaryBonus/e.length),s=d;}}return o[0]===0&&(a+=i.prefixBonus),n===r&&(a=1),Math.max(0,Math.min(1,a))}function he(e,t,n={}){let r=Ke(n);if(!e)return {item:t,text:t,score:1,indices:[]};let o=r.caseSensitive?e:e.toLowerCase(),i=r.caseSensitive?t:t.toLowerCase(),a=[],l=0,s=0;for(;l<o.length&&s<i.length;)o[l]===i[s]&&(a.push(s),l++),s++;if(l!==o.length)return null;let u=aa(e,t,o,i,a,r);return {item:t,text:t,score:u,indices:a}}function Hn(e,t,n={}){let r=Ke(n),o=[];for(let i of t){let a=he(e,i,r);a&&a.score>=(r.threshold||0)&&o.push(a);}return o.sort((i,a)=>a.score-i.score),r.limit!==void 0&&o.length>r.limit?o.slice(0,r.limit):o}function la(e,t,n){let{getText:r=String,...o}=n,i=Ke(o),a=[];for(let l of t){let s=r(l),u=he(e,s,i);u&&u.score>=(i.threshold||0)&&a.push({item:l,text:s,score:u.score,indices:u.indices});}return a.sort((l,s)=>s.score-l.score),i.limit!==void 0&&a.length>i.limit?a.slice(0,i.limit):a}function sa(e,t,n=r=>`[${r}]`){let r=new Set(t),o="";for(let i=0;i<e.length;i++){let a=e[i];a!==void 0&&(r.has(i)?o+=n(a):o+=a);}return o}function ua(e,t,n={}){return Hn(e,t,n).map(o=>o.item)}function da(e,t,n={}){let r=he(e,t,n);return r!==null&&r.score>=(n.threshold??0)}function Un(e,t){let n={...e};for(let r in t)if(Object.hasOwn(t,r)){let o=t[r],i=n[r];o!==null&&typeof o=="object"&&!Array.isArray(o)&&i!==null&&typeof i=="object"&&!Array.isArray(i)?n[r]=Un(i,o):n[r]=o;}return n}function fa(e,t){return {...e,...t}}function ca(e){return [...e].sort((t,n)=>{let r=t.name.startsWith("."),o=n.name.startsWith(".");return r&&!o?1:!r&&o?-1:t.name.toLowerCase().localeCompare(n.name.toLowerCase())})}function ma(e){return [...e].sort((t,n)=>t.index-n.index)}function ha(e){return [...e].sort((t,n)=>n.priority-t.priority)}function ga(e,t,n=false){return [...e].sort((r,o)=>{let i=t(r),a=t(o),l;return typeof i=="string"&&typeof a=="string"?l=i.localeCompare(a):l=i-a,n?-l:l})}var Vn=new Set(["node_modules",".git",".svn",".hg","dist","build","coverage",".cache",".next","__pycache__"]);function pa(e,t,n){let r=n?.maxDepth??10,o=new Set([...Vn,...n?.excludeDirs??[]]);function i(a,l){if(l>r)return null;let s=jn(a);if(!s)return null;let u=xa(s,a,t);return u||ya(s,a,l,r,o,i)}return i(k.resolve(e),0)}function ba(e,t,n){let r=n?.maxDepth??10,o=new Set([...Vn,...n?.excludeDirs??[]]),i=n?.maxResults??Number.POSITIVE_INFINITY,a=[];function l(s,u){if(u>r||a.length>=i)return;let d=jn(s);d&&(Ca(d,s,t,a,i),Sa(d,s,u,r,o,a,i,l));}return l(k.resolve(e),0),a}function jn(e){try{return Gn.readdirSync(e,{withFileTypes:!0})}catch{return null}}function xa(e,t,n){for(let r of e)if(r.name===n&&r.isFile())return k.join(t,r.name);return null}function ya(e,t,n,r,o,i){for(let a of e){if(!a.isDirectory()||o.has(a.name))continue;let l=i(k.join(t,a.name),n+1);if(l)return l}return null}function Ca(e,t,n,r,o){for(let i of e){if(r.length>=o)return;i.name===n&&i.isFile()&&r.push(k.join(t,i.name));}}function Sa(e,t,n,r,o,i,a,l){for(let s of e){if(i.length>=a)return;!s.isDirectory()||o.has(s.name)||l(k.join(t,s.name),n+1);}}function La(e){return [...new Set(e)]}function ka(e,t){let n=new Set,r=[];for(let o of e){let i=t(o);n.has(i)||(n.add(i),r.push(o));}return r}function Ta(e,t){let n=new Map;for(let r of e){let o=t(r),i=n.get(o);i?i.push(r):n.set(o,[r]);}return n}function Ra(e,t){let n=[],r=[];for(let o of e)t(o)?n.push(o):r.push(o);return [n,r]}var Aa={chunkSize:1e3,maxCachedChunks:50,readAheadLines:500,readBehindLines:200,maxMemoryBytes:104857600};function wa(e,t){return {config:{...Aa,...t},source:e,chunks:new Map,accessOrder:[],hits:0,misses:0}}function Ea(e,t,n){let r={start:Math.max(0,t),end:Math.min(n,e.source.totalLines)},o=[],i=e.config.chunkSize,a=Math.floor(r.start/i),l=Math.floor(Math.max(0,r.end-1)/i);for(let s=a;s<=l;s++){let u=Zn(e,s);if(!u)continue;let d=s*i,f=Math.max(0,r.start-d),c=Math.min(u.lines.length,r.end-d);for(let m=f;m<c;m++){let h=u.lines[m];h!==void 0&&o.push(h);}}return o}function Wa(e,t,n){let{readAheadLines:r,readBehindLines:o,chunkSize:i}=e.config,a=Math.max(0,t-o),l=Math.min(e.source.totalLines,n+r),s=Math.floor(a/i),u=Math.floor(Math.max(0,l-1)/i);for(let d=s;d<=u;d++)Zn(e,d);}function $n(e,t){let n=t??e.config.maxCachedChunks,r=0;for(;e.chunks.size>n&&e.accessOrder.length>0;){let o=e.accessOrder.shift();if(o===void 0)break;e.chunks.has(o)&&(e.chunks.delete(o),r++);}return r}function Ma(e){e.chunks.clear(),e.accessOrder=[],e.hits=0,e.misses=0;}function Ia(e){let t=0;for(let r of e.chunks.values())t+=r.byteSize;let n=e.hits+e.misses;return {config:e.config,totalLines:e.source.totalLines,loadedChunks:e.chunks.size,memoryUsage:t,hitRate:n>0?e.hits/n:0}}function Da(e,t,n){let r=e.config.chunkSize,o=Math.floor(t/r),i=Math.floor(Math.max(0,n-1)/r);for(let a=o;a<=i;a++)if(!e.chunks.has(a))return false;return true}function va(e){return {totalLines:e.length,isExactCount:true,loadRange:(t,n)=>e.slice(t,n)}}function Zn(e,t){let n=e.chunks.get(t);if(n)return e.hits++,Ba(e,t),{...n,lastAccessedAt:Date.now()};e.misses++;let r=e.config.chunkSize,o=t*r,i=Math.min(o+r,e.source.totalLines);if(o>=e.source.totalLines)return;e.chunks.size>=e.config.maxCachedChunks&&$n(e,e.config.maxCachedChunks-1);let a=e.source.loadRange(o,i),l=0;for(let u of a)l+=u.length*2;let s={index:t,startLine:o,endLine:i,lines:a,byteSize:l,lastAccessedAt:Date.now()};return e.chunks.set(t,s),e.accessOrder.push(t),s}function Ba(e,t){let n=e.accessOrder.indexOf(t);n>=0&&e.accessOrder.splice(n,1),e.accessOrder.push(t);}var qe={mode:"absolute",minWidth:3,rightPadding:1,padChar:" ",separator:"\u2502",highlightCurrent:true};function ge(e,t){if(e<=0)return t;let n=Math.floor(Math.log10(e))+1;return Math.max(n,t)}function Kn(e,t){let n={...qe,...t};return e+n.rightPadding+1}function Fa(e){return {...qe,...e}}function qn(e,t,n,r){let o=e===t;if(r==="absolute")return String(e).padStart(n," ");if(r==="relative"){if(o)return String(e).padStart(n," ");let a=Math.abs(e-t);return String(a).padStart(n," ")}if(o)return String(e).padStart(n," ");let i=Math.abs(e-t);return String(i).padStart(n," ")}function Pa(e,t,n,r,o){let i={...qe,...o},a=ge(e,i.minWidth),l=Kn(a,i),s=[],u=Math.min(t+n,e);for(let d=t;d<u;d++){let f=d+1,c=f===r,h=qn(f,r,a,i.mode)+i.padChar.repeat(i.rightPadding)+i.separator;s.push({text:h,isCurrent:c,lineNumber:f,width:l});}return {lines:s,gutterWidth:l,digitWidth:a,totalLines:e}}function _a(e,t,n=3){return ge(e,n)!==ge(t,n)}function Oa(e,t,n,r="\x1B[0m"){return e.lines.map(o=>`${o.isCurrent?t:n}${o.text}${r}`)}var Na=100,pe={inString:null,inComment:false,templateDepth:0,commentDepth:0},U={name:"javascript",extensions:[".js",".jsx",".ts",".tsx",".mjs",".cjs"],keywords:new Set(["async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","finally","for","from","function","if","implements","import","in","instanceof","interface","let","new","of","package","private","protected","public","return","static","super","switch","this","throw","try","type","typeof","var","void","while","with","yield","as","is","keyof","readonly","declare","namespace","abstract","satisfies"]),builtins:new Set(["Array","Boolean","Date","Error","Function","JSON","Math","Number","Object","Promise","RegExp","String","Symbol","Map","Set","WeakMap","WeakSet","console","window","document","globalThis","process","require","module","exports","Buffer","setTimeout","setInterval","clearTimeout","clearInterval","fetch","Response","Request","Headers","URL","URLSearchParams","FormData","Blob","File","FileReader","Intl","Proxy","Reflect","BigInt"]),types:new Set(["any","boolean","number","string","void","never","unknown","null","undefined","object","symbol","bigint"]),constants:new Set(["true","false","null","undefined","NaN","Infinity"]),operators:/[+\-*/%=<>!&|^~?:]+/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",stringDelimiters:["'",'"'],templateLiteralStart:"`",templateLiteralEnd:"`",numberPattern:/\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\d[\d_]*)?\.?\d[\d_]*(?:[eE][+-]?\d[\d_]*)?n?)\b/,identifierPattern:/[a-zA-Z_$][a-zA-Z0-9_$]*/,nestedComments:false},V={name:"python",extensions:[".py",".pyw",".pyi"],keywords:new Set(["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield","match","case"]),builtins:new Set(["abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__"]),types:new Set(["int","float","str","bool","list","dict","set","tuple","bytes","None"]),constants:new Set(["True","False","None","Ellipsis","NotImplemented","__debug__"]),operators:/[+\-*/%=<>!@&|^~:]+/,lineComment:"#",blockCommentStart:null,blockCommentEnd:null,stringDelimiters:["'",'"',"'''",'"""'],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\d[\d_]*)?\.?\d[\d_]*(?:[eE][+-]?\d[\d_]*)?[jJ]?)\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:false},be={name:"rust",extensions:[".rs"],keywords:new Set(["as","async","await","break","const","continue","crate","dyn","else","enum","extern","false","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","Self","static","struct","super","trait","true","type","union","unsafe","use","where","while","macro_rules"]),builtins:new Set(["Option","Some","None","Result","Ok","Err","Box","Vec","String","HashMap","HashSet","Rc","Arc","RefCell","Cell","Mutex","RwLock","println","eprintln","print","eprint","format","panic","assert","assert_eq","assert_ne","debug_assert","todo","unimplemented","unreachable","cfg","derive"]),types:new Set(["bool","char","str","u8","u16","u32","u64","u128","usize","i8","i16","i32","i64","i128","isize","f32","f64","()"]),constants:new Set(["true","false"]),operators:/[+\-*/%=<>!&|^~?:@]+/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",stringDelimiters:['"'],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\d[\d_]*)?\.?\d[\d_]*(?:[eE][+-]?\d[\d_]*)?(?:_?(?:u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize|f32|f64))?)\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:true},Xe={name:"go",extensions:[".go"],keywords:new Set(["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"]),builtins:new Set(["append","cap","close","complex","copy","delete","imag","len","make","new","panic","print","println","real","recover"]),types:new Set(["bool","byte","complex64","complex128","error","float32","float64","int","int8","int16","int32","int64","rune","string","uint","uint8","uint16","uint32","uint64","uintptr"]),constants:new Set(["true","false","nil","iota"]),operators:/[+\-*/%=<>!&|^~:]+/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",stringDelimiters:['"',"'","`"],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\d[\d_]*)?\.?\d[\d_]*(?:[eE][+-]?\d[\d_]*)?i?)\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:false},xe={name:"shell",extensions:[".sh",".bash",".zsh",".fish"],keywords:new Set(["if","then","else","elif","fi","case","esac","for","while","until","do","done","in","function","select","time","coproc","return","exit","break","continue","local","declare","typeset","readonly","export","unset","shift","source","alias","unalias"]),builtins:new Set(["echo","printf","read","cd","pwd","pushd","popd","dirs","set","shopt","test","eval","exec","trap","wait","kill","jobs","fg","bg","suspend","disown","builtin","command","type","hash","help","let","true","false","getopts","bind","complete","compgen","compopt","caller","enable","mapfile","readarray","ulimit","umask"]),types:new Set([]),constants:new Set(["true","false"]),operators:/[+\-*/%=<>!&|^~?:;]+/,lineComment:"#",blockCommentStart:null,blockCommentEnd:null,stringDelimiters:['"',"'"],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b\d+\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:false},Je={name:"json",extensions:[".json",".jsonc",".json5"],keywords:new Set([]),builtins:new Set([]),types:new Set([]),constants:new Set(["true","false","null"]),operators:/[:]/,lineComment:null,blockCommentStart:null,blockCommentEnd:null,stringDelimiters:['"'],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b-?(?:\d+)?\.?\d+(?:[eE][+-]?\d+)?\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:false},$={name:"plaintext",extensions:[".txt",".text"],keywords:new Set([]),builtins:new Set([]),types:new Set([]),constants:new Set([]),operators:/(?!)/,lineComment:null,blockCommentStart:null,blockCommentEnd:null,stringDelimiters:[],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/(?!)/,identifierPattern:/(?!)/,nestedComments:false},Ye=[U,V,be,Xe,xe,Je,$];function Qe(e){return {grammar:e,entries:new Map,dirty:new Set,lineCount:0,fullInvalidate:true}}function za(e){e.entries.clear(),e.dirty.clear(),e.lineCount=0,e.fullInvalidate=true;}function et(e,t){if(e.grammar.name!==t.name){e.grammar=t,e.fullInvalidate=true;for(let n=0;n<e.lineCount;n++)e.dirty.add(n);}}function Ha(e){return {cachedLines:e.entries.size,dirtyLines:e.dirty.size,grammar:e.grammar.name,lineCount:e.lineCount,fullInvalidate:e.fullInvalidate}}function Ga(e,t,n){for(let r=t;r<n;r++)e.dirty.add(r);}function Ua(e,t){e.dirty.add(t);}function Va(e){e.fullInvalidate=true;for(let t=0;t<e.lineCount;t++)e.dirty.add(t);}function j(e,t){return e.inString===t.inString&&e.inComment===t.inComment&&e.templateDepth===t.templateDepth&&e.commentDepth===t.commentDepth}function F(e,t,n){let o=Za(e,t,n,[]),i=Ka(e),a=ja(i);for(;o.pos<t.length;)$a(o,a)||o.pos++;return {text:t,tokens:o.tokens,startState:n,endState:o.state}}function ja(e){return [qa,Xa,Ja,Ya,Qa,el,tl,t=>nl(t,e),al,ll,sl,ul]}function $a(e,t){for(let n of t)if(n(e))return true;return false}function Za(e,t,n,r){return {grammar:e,line:t,tokens:r,pos:0,state:{...n},addToken:(o,i,a)=>{a>i&&r.push({type:o,start:i,end:a,text:t.slice(i,a)});},startsWithAt:(o,i)=>t.slice(i,i+o.length)===o}}function Ka(e){return [...e.stringDelimiters].sort((t,n)=>n.length-t.length)}function qa(e){if(e.state.inString===null)return false;let t=e.state.inString,n=e.pos;for(;e.pos<e.line.length;){let r=e.line[e.pos];if(r==="\\"&&e.pos+1<e.line.length)e.pos+=2;else if(t.length===3&&e.startsWithAt(t,e.pos)||t.length===1&&r===t){e.pos+=t.length,e.state={...e.state,inString:null};break}else e.pos++;}return e.addToken("string",n,e.pos),true}function Xa(e){if(!e.state.inComment||!e.grammar.blockCommentEnd)return false;let t=e.pos;for(;e.pos<e.line.length;)if(e.grammar.nestedComments&&e.grammar.blockCommentStart&&e.startsWithAt(e.grammar.blockCommentStart,e.pos))e.state={...e.state,commentDepth:e.state.commentDepth+1},e.pos+=e.grammar.blockCommentStart.length;else if(e.startsWithAt(e.grammar.blockCommentEnd,e.pos))if(e.grammar.nestedComments&&e.state.commentDepth>0)e.state={...e.state,commentDepth:e.state.commentDepth-1},e.pos+=e.grammar.blockCommentEnd.length;else {e.pos+=e.grammar.blockCommentEnd.length,e.state={...e.state,inComment:false,commentDepth:0};break}else e.pos++;return e.addToken("comment",t,e.pos),true}function Ja(e){if(e.state.templateDepth<=0||!e.grammar.templateLiteralEnd)return false;let t=e.pos;for(;e.pos<e.line.length;)if(e.line[e.pos]==="\\"&&e.pos+1<e.line.length)e.pos+=2;else if(e.startsWithAt("${",e.pos)){e.addToken("string",t,e.pos),e.pos+=2,e.addToken("punctuation",e.pos-2,e.pos);break}else if(e.startsWithAt(e.grammar.templateLiteralEnd,e.pos)){e.pos+=e.grammar.templateLiteralEnd.length,e.state={...e.state,templateDepth:e.state.templateDepth-1};break}else e.pos++;return e.pos>t&&e.addToken("string",t,e.pos),true}function Ya(e){if(!/\s/.test(e.line[e.pos]||""))return false;let t=e.pos;for(;e.pos<e.line.length&&/\s/.test(e.line[e.pos]||"");)e.pos++;return e.addToken("text",t,e.pos),true}function Qa(e){return !e.grammar.lineComment||!e.startsWithAt(e.grammar.lineComment,e.pos)?false:(e.addToken("comment",e.pos,e.line.length),e.pos=e.line.length,true)}function el(e){if(!e.grammar.blockCommentStart||!e.startsWithAt(e.grammar.blockCommentStart,e.pos))return false;let t=e.pos;return rl(e)||(e.state={...e.state,inComment:true}),e.addToken("comment",t,e.pos),true}function tl(e){if(!e.grammar.templateLiteralStart||!e.startsWithAt(e.grammar.templateLiteralStart,e.pos))return false;let t=e.pos;for(e.pos+=e.grammar.templateLiteralStart.length;e.pos<e.line.length&&e.grammar.templateLiteralEnd;)if(e.line[e.pos]==="\\"&&e.pos+1<e.line.length)e.pos+=2;else if(e.startsWithAt("${",e.pos)){e.addToken("string",t,e.pos),e.pos+=2,e.addToken("punctuation",e.pos-2,e.pos),e.state={...e.state,templateDepth:e.state.templateDepth+1};break}else if(e.startsWithAt(e.grammar.templateLiteralEnd,e.pos)){e.pos+=e.grammar.templateLiteralEnd.length,e.addToken("string",t,e.pos);break}else e.pos++;return e.pos>=e.line.length&&e.pos>t+1&&(e.state={...e.state,templateDepth:e.state.templateDepth+1},e.addToken("string",t,e.pos)),true}function nl(e,t){let n=ol(e,t);if(!n)return false;let r=e.pos;return e.pos+=n.length,il(e,n),e.pos>=e.line.length&&n.length===3&&(e.state={...e.state,inString:n}),e.addToken("string",r,e.pos),true}function rl(e){if(!e.grammar.blockCommentStart||!e.grammar.blockCommentEnd)return false;for(e.pos+=e.grammar.blockCommentStart.length;e.pos<e.line.length;){if(e.grammar.nestedComments&&e.startsWithAt(e.grammar.blockCommentStart,e.pos)){e.state={...e.state,commentDepth:e.state.commentDepth+1},e.pos+=e.grammar.blockCommentStart.length;continue}if(e.startsWithAt(e.grammar.blockCommentEnd,e.pos)){if(e.grammar.nestedComments&&e.state.commentDepth>0){e.state={...e.state,commentDepth:e.state.commentDepth-1},e.pos+=e.grammar.blockCommentEnd.length;continue}return e.pos+=e.grammar.blockCommentEnd.length,true}e.pos++;}return false}function ol(e,t){for(let n of t)if(e.startsWithAt(n,e.pos))return n;return null}function il(e,t){for(;e.pos<e.line.length;){if(e.line[e.pos]==="\\"&&e.pos+1<e.line.length){e.pos+=2;continue}if(t.length===3&&e.startsWithAt(t,e.pos)||t.length===1&&e.line[e.pos]===t){e.pos+=t.length;break}e.pos++;}}function al(e){let t=e.grammar.numberPattern.exec(e.line.slice(e.pos));return !t||t.index!==0?false:(e.addToken("number",e.pos,e.pos+t[0].length),e.pos+=t[0].length,true)}function ll(e){let t=e.grammar.identifierPattern.exec(e.line.slice(e.pos));if(!t||t.index!==0)return false;let n=t[0],r="identifier";return e.grammar.keywords.has(n)?r="keyword":e.grammar.constants.has(n)?r="constant":e.grammar.builtins.has(n)?r="builtin":(e.grammar.types.has(n)||/^[A-Z]/.test(n))&&(r="type"),e.line.slice(e.pos+n.length).trimStart().startsWith("(")&&r==="identifier"&&(r="function"),e.addToken(r,e.pos,e.pos+n.length),e.pos+=n.length,true}function sl(e){let t=e.grammar.operators.exec(e.line.slice(e.pos));return !t||t.index!==0?false:(e.addToken("operator",e.pos,e.pos+t[0].length),e.pos+=t[0].length,true)}function ul(e){let t=e.line[e.pos]||"";return /[()[\]{},;.]/.test(t)?(e.addToken("punctuation",e.pos,e.pos+1),e.pos++,true):false}function tt(e,t){let n=t.split(`
|
|
16
|
-
`);e.lineCount=n.length,e.fullInvalidate&&(e.entries.clear(),e.dirty.clear(),e.fullInvalidate=false);let r=[],o=pe;for(let i=0;i<n.length;i++){let a=n[i]??"",l=e.entries.get(i);if(l&&l.text===a&&j(l.startState,o)&&!e.dirty.has(i))r.push(l),o=l.endState;else {let s=F(e.grammar,a,o);e.entries.set(i,s),e.dirty.delete(i),r.push(s),o=s.endState;let u=e.entries.get(i+1);u&&!j(o,u.startState)&&e.dirty.add(i+1);}}return r}function dl(e,t,n,r){let o=performance.now(),i=t.split(`
|
|
17
|
-
`);e.lineCount=i.length;let a=Math.max(0,n),l=Math.min(i.length,r);e.fullInvalidate&&(e.entries.clear(),e.dirty.clear(),e.fullInvalidate=false);let s=pe;for(let c=0;c<a;c++){let m=i[c]??"",h=e.entries.get(c);if(h&&h.text===m&&j(h.startState,s)&&!e.dirty.has(c))s=h.endState;else {let g=F(e.grammar,m,s);e.entries.set(c,g),e.dirty.delete(c),s=g.endState;}}let u=[];for(let c=a;c<l;c++){let m=i[c]??"",h=e.entries.get(c);if(h&&h.text===m&&j(h.startState,s)&&!e.dirty.has(c))u.push(h),s=h.endState;else {let g=F(e.grammar,m,s);e.entries.set(c,g),e.dirty.delete(c),u.push(g),s=g.endState;}}let d=l<i.length,f=performance.now()-o;return {lines:u,hasMore:d,nextLine:l,timeMs:f}}function fl(e,t,n,r=100){let o=performance.now(),i=t.split(`
|
|
18
|
-
`);e.lineCount=i.length;let a=Math.max(0,Math.min(n,i.length)),l=Math.min(a+r,i.length),s=pe,u=e.entries.get(a-1);if(a>0&&u)s=u.endState;else if(a>0)for(let m=0;m<a;m++){let h=i[m]??"",g=e.entries.get(m);if(g&&g.text===h&&j(g.startState,s))s=g.endState;else {let M=F(e.grammar,h,s);e.entries.set(m,M),s=M.endState;}}let d=[];for(let m=a;m<l;m++){let h=i[m]??"",g=F(e.grammar,h,s);e.entries.set(m,g),e.dirty.delete(m),d.push(g),s=g.endState;}let f=l<i.length,c=performance.now()-o;return {lines:d,hasMore:f,nextLine:l,timeMs:c}}function nt(e){let t=e.slice(e.lastIndexOf(".")).toLowerCase();for(let n of Ye)if(n.extensions.includes(t))return n;return $}function cl(e){let t=e.split(`
|
|
19
|
-
`)[0]||"";if(t.startsWith("#!")){if(/python/.test(t))return V;if(/node|deno|bun/.test(t))return U;if(/bash|sh|zsh/.test(t))return xe}return /^package\s+\w+/.test(t)?Xe:/^(use\s+|mod\s+|fn\s+|struct\s+|impl\s+|pub\s+)/.test(t)?be:/^(import|from|def|class)\s+/.test(t)?V:/^(import|export|const|let|var|function|class)\s+/.test(t)?U:/^\s*\{/.test(t)?Je:$}function rt(e){let t=e.toLowerCase();for(let n of Ye)if(n.name===t)return n;return t==="ts"||t==="typescript"||t==="tsx"||t==="jsx"?U:t==="py"?V:t==="rs"?be:t==="bash"||t==="sh"||t==="zsh"?xe:$}var ml=100,Yn=/^(#{1,6})\s+(.+)$/,Qn=/^(`{3,}|~{3,})(\w*)?$/,er=/^([-*_])\s*\1\s*\1\s*(\1|\s)*$/,ye=/^(\s*)[-*+]\s+(.*)$/,Ce=/^(\s*)(\d+)[.)]\s+(.*)$/,hl=/^\[([ xX])\]\s+(.*)$/,ot=/^>\s?(.*)$/,gl=/^\|?[\s:-]+\|[\s:|+-]+\|?$/,Xn=/^\|(.+)\|$/;function T(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return t}function w(e){let t=[],n=e,r=0;for(;r<n.length;){let o=bl(n.slice(r));if(o){r>0&&(t.push({type:"text",content:n.slice(0,r)}),n=n.slice(r),r=0),t.push(o.element),n=n.slice(o.length);continue}r++;}return n.length>0&&t.push({type:"text",content:n}),t}var pl=[xl,yl,Cl,Sl,Ll,kl];function bl(e){for(let t of pl){let n=t(e);if(n)return n}return null}function xl(e){let t=e.match(/^`([^`]+)`/);return t?{element:{type:"code",content:t[1]??""},length:t[0].length}:null}function yl(e){let t=e.match(/^(\*\*|__)(.+?)\1/);if(!t)return null;let n=t[2]??"";return {element:{type:"bold",content:n,children:w(n)},length:t[0].length}}function Cl(e){let t=e.match(/^(\*|_)(.+?)\1/);if(!t)return null;let n=t[2]??"";return {element:{type:"italic",content:n,children:w(n)},length:t[0].length}}function Sl(e){let t=e.match(/^\[([^\]]+)\]\(([^)]+)\)/);return t?{element:{type:"link",content:t[1]??"",href:t[2]??""},length:t[0].length}:null}function Ll(e){let t=e.match(/^!\[([^\]]*)\]\(([^)]+)\)/);return t?{element:{type:"image",content:t[1]??"",href:t[2]??""},length:t[0].length}:null}function kl(e){let t=e.match(/^~~(.+?)~~/);return t?{element:{type:"strikethrough",content:t[1]??""},length:t[0].length}:null}function it(e){let t=performance.now(),n=e.split(`
|
|
20
|
-
`),r=[],o=0;for(;o<n.length;){let i=n[o];if(i===void 0){o++;continue}if(i.trim()===""){o++;continue}let a=Rl(n,o);if(a){r.push(a.block),o=a.nextIndex;continue}o++;}return {blocks:r,parseTimeMs:performance.now()-t}}var Tl=[Al,wl,El,Wl,Ml,Il,Dl];function Rl(e,t){for(let n of Tl){let r=n(e,t);if(r)return r}return null}function Al(e,t){let n=e[t];if(n===void 0)return null;let r=n.match(Yn);if(!r)return null;let o=r[2]??"";return {block:{type:"heading",source:n,lineStart:t,lineEnd:t+1,hash:T(n),data:{kind:"heading",level:r[1]?.length??1,text:o,inline:w(o)}},nextIndex:t+1}}function wl(e,t){let n=e[t];return n===void 0||!er.test(n)?null:{block:{type:"hr",source:n,lineStart:t,lineEnd:t+1,hash:T(n),data:{kind:"hr"}},nextIndex:t+1}}function El(e,t){let n=e[t];if(n===void 0)return null;let r=n.match(Qn);if(!r)return null;let o=r[1]??"",i=r[2]??"",a=[],l=t,s=t+1;for(;s<e.length;){let d=e[s];if(d===void 0)break;if(d.startsWith(o)&&d.trim()===o){s++;break}a.push(d),s++;}let u=a.join(`
|
|
21
|
-
`);return {block:{type:"code",source:e.slice(l,s).join(`
|
|
22
|
-
`),lineStart:l,lineEnd:s,hash:T(u+i),data:{kind:"code",language:i||nt("code.txt").name||"",code:u}},nextIndex:s}}function Wl(e,t){let n=e[t];if(n===void 0||!ot.test(n))return null;let r=[],o=t,i=t;for(;i<e.length;){let s=e[i];if(s===void 0)break;let u=s.match(ot);if(!u&&s.trim()!=="")break;r.push(u?u[1]??"":""),i++;}let a=r.join(`
|
|
23
|
-
`),l=it(a);return {block:{type:"blockquote",source:e.slice(o,i).join(`
|
|
24
|
-
`),lineStart:o,lineEnd:i,hash:T(a),data:{kind:"blockquote",content:a,blocks:l.blocks}},nextIndex:i}}function Ml(e,t){let n=e[t],r=e[t+1];if(n===void 0||r===void 0||!Xn.test(n)||!gl.test(r))return null;let o=t,i=Jn(n),a=vl(r),l=[],s=t+2;for(;s<e.length;){let u=e[s];if(u===void 0||!Xn.test(u))break;l.push(Jn(u)),s++;}return {block:{type:"table",source:e.slice(o,s).join(`
|
|
25
|
-
`),lineStart:o,lineEnd:s,hash:T(e.slice(o,s).join(`
|
|
26
|
-
`)),data:{kind:"table",headers:i,alignments:a,rows:l}},nextIndex:s}}function Il(e,t){let n=e[t];if(n===void 0)return null;let r=Fl(n);if(!r)return null;let o=t,i=Pl(e,t,r.ordered);return {block:{type:"list",source:e.slice(o,i.nextIndex).join(`
|
|
27
|
-
`),lineStart:o,lineEnd:i.nextIndex,hash:T(e.slice(o,i.nextIndex).join(`
|
|
28
|
-
`)),data:{kind:"list",ordered:r.ordered,start:r.start,items:i.items}},nextIndex:i.nextIndex}}function Dl(e,t){let n=[],r=t,o=t;for(;o<e.length;){let a=e[o];if(a===void 0||a.trim()===""||n.length>0&&Ol(a))break;n.push(a),o++;}if(n.length===0)return null;let i=n.join(" ");return {block:{type:"paragraph",source:n.join(`
|
|
29
|
-
`),lineStart:r,lineEnd:o,hash:T(i),data:{kind:"paragraph",text:i,inline:w(i)}},nextIndex:o}}function Jn(e){return tr(e).map(t=>{let n=t.trim();return {content:n,inline:w(n)}})}function vl(e){return tr(e).map(t=>{let n=t.trim();return n.startsWith(":")&&n.endsWith(":")?"center":n.endsWith(":")?"right":n.startsWith(":")?"left":null})}function tr(e){return e.slice(1,-1).split("|")}function Bl(e,t,n){let r=e[t];return r===void 0?false:n?Ce.test(r):ye.test(r)}function Fl(e){let t=e.match(ye),n=e.match(Ce);return !t&&!n?null:{ordered:!!n,start:n?parseInt(n[2]??"1",10):void 0}}function Pl(e,t,n){let r=[],o=t;for(;o<e.length;){let i=e[o];if(i===void 0)break;let a=n?i.match(Ce):i.match(ye);if(!a&&i.trim()===""){if(!Bl(e,o+1,n))break;o++;continue}if(!a)break;r.push(_l(a,n)),o++;}return {items:r,nextIndex:o}}function _l(e,t){let n=(e[1]??"").length,r=t?e[3]??"":e[2]??"",o=r.match(hl),i=o?o[2]??"":r;return {content:i,inline:w(i),indent:n,checked:o?o[1]?.toLowerCase()==="x":void 0}}function Ol(e){return Yn.test(e)||er.test(e)||Qn.test(e)||ye.test(e)||Ce.test(e)||ot.test(e)}function Nl(){return {blocks:new Map,sourceHash:0,highlightCaches:new Map,renderedLines:null}}function zl(e){e.blocks.clear(),e.sourceHash=0,e.highlightCaches.clear(),e.renderedLines=null;}function Hl(e,t){let n=T(t);if(e.sourceHash===n&&e.renderedLines)return {blocks:Array.from(e.blocks.values()),parseTimeMs:0};let r=it(t);e.blocks.clear();for(let o of r.blocks){let i=`${o.lineStart}-${o.lineEnd}`;e.blocks.set(i,o);}return e.sourceHash=n,e.renderedLines=null,r}function Gl(e,t,n){for(let[r,o]of e.blocks)o.lineStart<n&&o.lineEnd>t&&e.blocks.delete(r);e.renderedLines=null;}function at(e,t){let n=[],r={},o=Ul[e.data.kind];return o&&o(e,t,n,r),n}function lt(e,t){if(t.renderedLines)return t.renderedLines;let n=[],r=0;for(let[o,i]of e.blocks.entries()){let a=at(i,t);for(let l of a)n.push({...l,blockIndex:o}),r++;o<e.blocks.length-1&&(n.push({content:"",style:{},blockIndex:o,lineInBlock:-1}),r++);}return t.renderedLines=n,n}var Ul={heading:Vl,paragraph:jl,code:$l,list:Zl,table:Kl,blockquote:ql,hr:Xl,html:Jl};function Vl(e,t,n,r){let o=e.data;o.kind==="heading"&&n.push({content:`${"#".repeat(o.level)} ${o.text}`,style:{bold:true},blockIndex:0,lineInBlock:0});}function jl(e,t,n,r){let o=e.data;o.kind==="paragraph"&&n.push({content:o.text,style:r,blockIndex:0,lineInBlock:0});}function $l(e,t,n,r){let o=e.data;if(o.kind!=="code")return;let i=rt(o.language||"plaintext"),a=t.highlightCaches.get(e.hash.toString());a?a.grammar.name!==i.name&&et(a,i):(a=Qe(i),t.highlightCaches.set(e.hash.toString(),a)),tt(a,o.code);for(let[l,s]of o.code.split(`
|
|
30
|
-
`).entries())n.push({content:s,style:{dim:true},blockIndex:0,lineInBlock:l});}function Zl(e,t,n,r){let o=e.data;if(o.kind==="list")for(let[i,a]of o.items.entries()){let l=o.ordered?`${(o.start||1)+i}. `:`${" ".repeat(a.indent/2)}- `,s=a.checked!==void 0?a.checked?"[x] ":"[ ] ":"";n.push({content:l+s+a.content,style:r,blockIndex:0,lineInBlock:i});}}function Kl(e,t,n,r){let o=e.data;if(o.kind!=="table")return;let i=o.headers.map(l=>l.content).join(" | ");n.push({content:`| ${i} |`,style:{bold:true},blockIndex:0,lineInBlock:0});let a=o.headers.map((l,s)=>{let u=o.alignments[s];return u==="center"?":---:":u==="right"?"---:":u==="left"?":---":"---"}).join(" | ");n.push({content:`| ${a} |`,style:r,blockIndex:0,lineInBlock:1});for(let[l,s]of o.rows.entries()){let u=s.map(d=>d.content).join(" | ");n.push({content:`| ${u} |`,style:r,blockIndex:0,lineInBlock:l+2});}}function ql(e,t,n,r){let o=e.data;if(o.kind==="blockquote"){for(let i of o.blocks){let a=at(i,t);for(let l of a)n.push({...l,content:`> ${l.content}`,style:{...l.style,italic:true}});}n.length===0&&n.push({content:">",style:{italic:true},blockIndex:0,lineInBlock:0});}}function Xl(e,t,n,r){e.data.kind==="hr"&&n.push({content:"---",style:{dim:true},blockIndex:0,lineInBlock:0});}function Jl(e,t,n,r){let o=e.data;if(o.kind==="html")for(let[i,a]of o.html.split(`
|
|
31
|
-
`).entries())n.push({content:a,style:{dim:true},blockIndex:0,lineInBlock:i});}function Yl(e,t,n,r){let o=lt(e,t),i=Math.min(n+r,o.length);return {lines:o.slice(n,i),totalLines:o.length,startIndex:n,endIndex:i}}function Ql(e,t){return lt(e,t).length}function es(e){let t=0,n=0,r=0,o=0,i=0,a=0;for(let l of e.blocks){switch(a+=l.lineEnd-l.lineStart,l.type){case "heading":t++;break;case "code":n++;break;case "list":r++;break;case "table":o++;break}let s=u=>{let d=0;for(let f of u)f.type==="link"&&d++,f.children&&(d+=s(f.children));return d};(l.data.kind==="paragraph"||l.data.kind==="heading")&&(i+=s(l.data.inline));}return {blockCount:e.blocks.length,lineCount:a,headingCount:t,codeBlockCount:n,listCount:r,tableCount:o,linkCount:i}}var ts=512,ns=256,rs=48;function os(e){let t=0;for(let n=0;n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function is(e){let t=[];for(let n=0;n<e.length;n++)e.charCodeAt(n)===10&&t.push(n);return t}function Z(e){let t=is(e);return {type:"leaf",text:e,length:e.length,newlines:t.length,lineBreaks:t}}function K(){return {type:"leaf",text:"",length:0,newlines:0,lineBreaks:[]}}function Se(e,t){let n=e.type==="node"?e.depth:0,r=t.type==="node"?t.depth:0;return {type:"node",left:e,right:t,leftLength:e.length,length:e.length+t.length,newlines:e.newlines+t.newlines,depth:Math.max(n,r)+1}}function as(e){let t=e.left.type==="node"?e.left.depth:0,n=e.right.type==="node"?e.right.depth:0;return Math.abs(t-n)>1||e.depth>48}function Le(e,t){if(e.type==="leaf"){e.length>0&&t.push(e.text);return}Le(e.left,t),Le(e.right,t);}function ke(e){if(e.length===0)return K();if(e.length===1){let o=e[0];return o===void 0?K():Z(o)}let t=Math.floor(e.length/2),n=ke(e.slice(0,t)),r=ke(e.slice(t));return Se(n,r)}function ls(e){if(e.type==="leaf"||!as(e))return e;let t=[];Le(e,t);let n=[];for(let r of t)if(r.length<=512)n.push(r);else for(let o=0;o<r.length;o+=512)n.push(r.slice(o,o+512));return ke(n)}function nr(e=""){if(e.length===0)return K();if(e.length<=512)return Z(e);let t=[];for(let n=0;n<e.length;n+=512)t.push(e.slice(n,n+512));return ke(t)}function ss(){return K()}function us(e){return e.length}function ds(e){return e.newlines}function fs(e){return e.newlines+1}function cs(e){return e.length===0}function st(e,t){if(!(t<0||t>=e.length))return e.type==="leaf"?e.text.charAt(t):t<e.leftLength?st(e.left,t):st(e.right,t-e.leftLength)}function R(e,t,n){let r=n??e.length,o=t;if(o<0&&(o=0),r>e.length)return R(e,o,e.length);if(o>=r)return "";if(e.type==="leaf")return e.text.slice(o,r);let i=e.leftLength;if(r<=i)return R(e.left,o,r);if(o>=i)return R(e.right,o-i,r-i);let a=R(e.left,o,i),l=R(e.right,0,r-i);return a+l}function ms(e){if(e.type==="leaf")return e.text;let t=[];return Le(e,t),t.join("")}function ut(e,t){if(t<=0)return 0;if(t>=e.length)return e.newlines;if(e.type==="leaf"){let r=0;for(let o of e.lineBreaks){if(o>=t)break;r++;}return r}return t<e.leftLength?ut(e.left,t):e.left.newlines+ut(e.right,t-e.leftLength)}function rr(e,t){return t<0?-1:t===0?0:t>e.newlines?-1:dt(e,t,0)}function dt(e,t,n){if(e.type==="leaf"){let o=0;for(let i of e.lineBreaks)if(o++,o===t)return n+i+1;return -1}let r=e.left.newlines;return t<=r?dt(e.left,t,n):dt(e.right,t-r,n+e.leftLength)}function or(e,t){return t<0||t>e.newlines?-1:t===e.newlines?e.length:ft(e,t,0)}function ft(e,t,n){if(e.type==="leaf"){let o=0;for(let i of e.lineBreaks){if(o===t)return n+i;o++;}return -1}let r=e.left.newlines;return t<r?ft(e.left,t,n):ft(e.right,t-r,n+e.leftLength)}function ir(e,t){if(t<0||t>e.newlines)return;let n=rr(e,t),r=or(e,t);return n===-1?{text:R(e,0,r===-1?e.length:r),start:0,end:r===-1?e.length:r,lineNumber:t}:{text:R(e,n,r===-1?e.length:r),start:n,end:r===-1?e.length:r,lineNumber:t}}function hs(e,t,n){let r=[],o=e.newlines+1;for(let i=t;i<n&&i<o;i++){let a=ir(e,i);a&&r.push(a);}return r}function q(e,t){if(t<=0)return {left:null,right:e};if(t>=e.length)return {left:e,right:null};if(e.type==="leaf"){let o=e.text.slice(0,t),i=e.text.slice(t);return {left:o.length>0?Z(o):null,right:i.length>0?Z(i):null}}if(t<=e.leftLength){let{left:o,right:i}=q(e.left,t);return i===null?{left:o,right:e.right}:{left:o,right:Se(i,e.right)}}let{left:n,right:r}=q(e.right,t-e.leftLength);return n===null?{left:e.left,right:r}:{left:Se(e.left,n),right:r}}function ct(e,t){if(e===null||e.length===0)return t??K();if(t===null||t.length===0)return e;if(e.type==="leaf"&&t.type==="leaf"&&e.length+t.length<=512)return Z(e.text+t.text);let n=Se(e,t);return ls(n)}function Te(e,t,n){if(n.length===0)return e;let r=t;r<0&&(r=0),r>e.length&&(r=e.length);let o=nr(n),{left:i,right:a}=q(e,r);return ct(ct(i,o),a)}function gs(e,t){return Te(e,e.length,t)}function ps(e,t){return Te(e,0,t)}function ar(e,t,n){let r=t,o=n;if(r<0&&(r=0),o>e.length&&(o=e.length),r>=o)return e;let{left:i}=q(e,r),{right:a}=q(e,o);return ct(i,a)}function bs(e,t,n,r){let o=ar(e,t,n);return Te(o,t,r)}function xs(e){let t=0,n=0,r=0;function o(i,a){if(i.type==="leaf"){t++,n+=i.length,r=Math.max(r,a);return}o(i.left,a+1),o(i.right,a+1);}return o(e,0),{length:e.length,newlines:e.newlines,leafCount:t,depth:r,avgLeafSize:t>0?n/t:0}}function mt(e){return e.type==="leaf"?e.length===e.text.length&&e.newlines===os(e.text)&&e.lineBreaks.length===e.newlines:e.leftLength!==e.left.length||e.length!==e.left.length+e.right.length||e.newlines!==e.left.newlines+e.right.newlines?false:mt(e.left)&&mt(e.right)}var lr=(u=>(u[u.NONE=0]="NONE",u[u.BOLD=1]="BOLD",u[u.UNDERLINE=2]="UNDERLINE",u[u.BLINK=4]="BLINK",u[u.INVERSE=8]="INVERSE",u[u.INVISIBLE=16]="INVISIBLE",u[u.DIM=32]="DIM",u[u.ITALIC=64]="ITALIC",u[u.STRIKETHROUGH=128]="STRIKETHROUGH",u))(lr||{});function ht(e){let t=0;return e.bold&&(t|=1),e.underline&&(t|=2),e.blink&&(t|=4),e.inverse&&(t|=8),e.invisible&&(t|=16),e.dim&&(t|=32),e.italic&&(t|=64),e.strikethrough&&(t|=128),t}function ys(e){return {bold:(e&1)!==0,underline:(e&2)!==0,blink:(e&4)!==0,inverse:(e&8)!==0,invisible:(e&16)!==0,dim:(e&32)!==0,italic:(e&64)!==0,strikethrough:(e&128)!==0}}function Cs(e,t=4294967295,n=0){return {fg:e.fg??t,bg:e.bg??n,attrs:ht(e)}}function Ss(e){return {fg:e.fg,bg:e.bg,attrs:ht(e)}}function Ls(e,t){return e.fg===t.fg&&e.bg===t.bg&&e.attrs===t.attrs}function ks(e){return {fg:e.fg,bg:e.bg,attrs:e.attrs}}function Ts(e,t){return {fg:t.fg??e.fg,bg:t.bg??e.bg,attrs:t.attrs!==void 0?t.attrs:e.attrs}}function Rs(e,t){return (e.attrs&t)!==0}function As(e,t){return {fg:e.fg,bg:e.bg,attrs:e.attrs|t}}function ws(e,t){return {fg:e.fg,bg:e.bg,attrs:e.attrs&~t}}function Es(e){return {fg:e.bg,bg:e.fg,attrs:e.attrs}}function Ws(){return {fg:4294967295,bg:0,attrs:0}}function Ms(e){let t=BigInt(e.fg>>>0),n=BigInt(e.bg>>>0)<<32n,r=BigInt(e.attrs)<<64n;return t|n|r}function Is(e){let t=Number(e&0xffffffffn),n=Number(e>>32n&0xffffffffn),r=Number(e>>64n&0xffn);return {fg:t,bg:n,attrs:r}}var E=4294967295,W=0,P=/\{(\/?[a-zA-Z0-9_#-]+|\/)\}/g,Re="\0LBRACE\0",Ae="\0RBRACE\0",gt={black:255,red:4278190335,green:16711935,yellow:4294902015,blue:65535,magenta:4278255615,cyan:16777215,white:4294967295,"bright-black":2155905279,gray:2155905279,grey:2155905279,"bright-red":4286611711,"bright-green":2164228351,"bright-yellow":4294934783,"bright-blue":2155937791,"bright-magenta":4286644223,"bright-cyan":2164260863,"bright-white":4294967295,orange:4289003775,pink:4290825215,purple:2147516671,brown:2771004159,lime:852308735,navy:33023,teal:8421631,olive:2155872511,maroon:2147483903,aqua:16777215,silver:3233857791,default:0,transparent:0},sr={bold:1,underline:2,ul:2,blink:4,inverse:8,invisible:16,hidden:16,dim:32,italic:64,strikethrough:128,strike:128},ur={left:"left",center:"center",right:"right"};function Ds(e){let t=e.startsWith("#")?e.slice(1):e;if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$/.test(t))return null;let n,r,o;if(t.length===3){let i=t[0]??"0",a=t[1]??"0",l=t[2]??"0";n=Number.parseInt(i+i,16),r=Number.parseInt(a+a,16),o=Number.parseInt(l+l,16);}else n=Number.parseInt(t.slice(0,2),16),r=Number.parseInt(t.slice(2,4),16),o=Number.parseInt(t.slice(4,6),16);return (n<<24|r<<16|o<<8|255)>>>0}function bt(e){let t=e.toLowerCase();if(t in gt)return gt[t]??null;let n=Ds(e);if(n!==null)return n;let r=Number.parseInt(e,10);return !Number.isNaN(r)&&r>=0&&r<=255?vs(r):null}function vs(e){if(e<8)return [255,2147483903,8388863,2155872511,33023,2147516671,8421631,3233857791][e]??255;if(e<16)return [2155905279,4278190335,16711935,4294902015,65535,4278255615,16777215,4294967295][e-8]??2155905279;if(e<232){let n=e-16,r=Math.floor(n/36)*51,o=Math.floor(n/6)%6*51,i=n%6*51;return (r<<24|o<<16|i<<8|255)>>>0}let t=(e-232)*10+8;return (t<<24|t<<16|t<<8|255)>>>0}function Bs(){return {fg:[],bg:[],attrs:new Map}}function Fs(e,t){e.fg=E,e.bg=W,e.attrs=0,t.fg=[],t.bg=[],t.attrs.clear();}function Ps(e,t,n){n.attrs.get(e)?.pop()?.prevValue?t.attrs|=e:t.attrs&=~e;}function _s(e,t,n,r){let o=r.attrs.get(e);o||(o=[],r.attrs.set(e,o)),o.push({type:"attr",prevValue:n.attrs&e,tagName:t}),n.attrs|=e;}function Os(e,t,n,r){if(!(e in sr))return false;let o=sr[e];return o===void 0?false:(t?Ps(o,n,r):_s(o,e,n,r),true)}function Ns(e,t,n,r){let o=e.match(/^(.+)-fg$/);if(!o?.[1])return false;if(t)if(r.fg.length>0){let i=r.fg.pop();i&&(n.fg=i.prevValue);}else n.fg=E;else {let i=bt(o[1]);i!==null&&(r.fg.push({type:"fg",prevValue:n.fg,tagName:e}),n.fg=i);}return true}function zs(e,t,n,r){let o=e.match(/^(.+)-bg$/);if(!o?.[1])return false;if(t)if(r.bg.length>0){let i=r.bg.pop();i&&(n.bg=i.prevValue);}else n.bg=W;else {let i=bt(o[1]);i!==null&&(r.bg.push({type:"bg",prevValue:n.bg,tagName:e}),n.bg=i);}return true}function Hs(e,t,n,r){if(t)return false;let o=bt(e);return o===null?false:(r.fg.push({type:"fg",prevValue:n.fg,tagName:e}),n.fg=o,true)}function Gs(e,t,n){if(e==="/")return Fs(t,n),null;let r=e.startsWith("/"),o=r?e.slice(1):e;return o in ur?ur[o]??null:(Os(o,r,t,n)||Ns(o,r,t,n)||zs(o,r,t,n)||Hs(o,r,t,n),null)}function Us(e){let t=[],n="left",r="",o=e.replace(/\{\{/g,Re).replace(/\}\}/g,Ae),i={fg:E,bg:W,attrs:0},a=Bs(),l=0,s;for(P.lastIndex=0;(s=P.exec(o))!==null;){if(s.index>l){let d=dr(o.slice(l,s.index));r=fr(t,i,d,r);}let u=s[1];if(u!==void 0){let d=Gs(u,i,a);d!==null&&(n=d);}l=P.lastIndex;}if(l<o.length){let u=dr(o.slice(l));r=fr(t,i,u,r);}return t.length===0&&e.length===0?{segments:[],alignment:n,plainText:""}:{segments:t,alignment:n,plainText:r}}function dr(e){return e.replaceAll(Re,"{").replaceAll(Ae,"}")}function fr(e,t,n,r){return n.length===0?r:(e.push({text:n,fg:t.fg,bg:t.bg,attrs:t.attrs}),r+n)}function xt(e){return e.replace(/\{\{/g,Re).replace(/\}\}/g,Ae).replace(P,"").replaceAll(Re,"{").replaceAll(Ae,"}")}function Vs(e){return xt(e).trim()}function we(e){return e.replace(/\{/g,"{{").replace(/\}/g,"}}")}function js(e,t){let n=[];if(t.bold&&n.push("{bold}"),t.underline&&n.push("{underline}"),t.blink&&n.push("{blink}"),t.inverse&&n.push("{inverse}"),t.invisible&&n.push("{invisible}"),t.dim&&n.push("{dim}"),t.italic&&n.push("{italic}"),t.strikethrough&&n.push("{strikethrough}"),t.fg!==void 0&&t.fg!==E){let o=pt(t.fg);n.push(`{#${o}-fg}`);}if(t.bg!==void 0&&t.bg!==W){let o=pt(t.bg);n.push(`{#${o}-bg}`);}let r=we(e);return n.length===0?r:`${n.join("")}${r}{/}`}function pt(e){let t=e>>>24&255,n=e>>>16&255,r=e>>>8&255;return t.toString(16).padStart(2,"0")+n.toString(16).padStart(2,"0")+r.toString(16).padStart(2,"0")}function $s(e){if(e.length===0)return [];let t=e[0];if(!t)return [];let n=[],r={...t};for(let o=1;o<e.length;o++){let i=e[o];i&&(i.fg===r.fg&&i.bg===r.bg&&i.attrs===r.attrs?r={...r,text:r.text+i.text}:(n.push(r),r={...i}));}return n.push(r),n}function Zs(e){return xt(e).length}function Ks(e){let t=e.replace(/\{\{/g,"").replace(/\}\}/g,"");return P.lastIndex=0,P.test(t)}var cr=z$1.enum(["left","center","right"]);function X(e,t){for(let[r,o]of Object.entries(gt))if(o===e)return `{${r}-${t}}`;return `{#${pt(e)}-${t}}`}function qs(e){return e&1?"{bold}":e&2?"{underline}":e&4?"{blink}":e&8?"{inverse}":e&16?"{invisible}":e&32?"{dim}":e&64?"{italic}":e&128?"{strikethrough}":""}function Xs(e){let t=[];return e.bold&&t.push("{bold}"),e.underline&&t.push("{underline}"),e.blink&&t.push("{blink}"),e.inverse&&t.push("{inverse}"),e.invisible&&t.push("{invisible}"),e.dim&&t.push("{dim}"),e.italic&&t.push("{italic}"),e.strikethrough&&t.push("{strikethrough}"),e.fg!==void 0&&e.fg!==E&&t.push(X(e.fg,"fg")),e.bg!==void 0&&e.bg!==W&&t.push(X(e.bg,"bg")),t}function Js(e){let t=[];return e.bg!==void 0&&e.bg!==W&&t.push("{/bg}"),e.fg!==void 0&&e.fg!==E&&t.push("{/fg}"),e.strikethrough&&t.push("{/strikethrough}"),e.italic&&t.push("{/italic}"),e.dim&&t.push("{/dim}"),e.invisible&&t.push("{/invisible}"),e.inverse&&t.push("{/inverse}"),e.blink&&t.push("{/blink}"),e.underline&&t.push("{/underline}"),e.bold&&t.push("{/bold}"),t}function Ys(e,t,n){let r=we(e),o=t.join(""),i=n?n.join(""):"{/}";return `${o}${r}${i}`}function mr(e){let t=[];return e&1&&t.push("{bold}"),e&2&&t.push("{underline}"),e&4&&t.push("{blink}"),e&8&&t.push("{inverse}"),e&16&&t.push("{invisible}"),e&32&&t.push("{dim}"),e&64&&t.push("{italic}"),e&128&&t.push("{strikethrough}"),t}function hr(e){let t=[],n=mr(e.attrs);t.push(...n),e.fg!==E&&t.push(X(e.fg,"fg")),e.bg!==W&&t.push(X(e.bg,"bg"));let r=we(e.text);return t.length===0?r:`${t.join("")}${r}{/}`}function Qs(e){let t=[];e.alignment!=="left"&&t.push(`{${e.alignment}}`);for(let n of e.segments)t.push(hr(n));return t.join("")}var gr=z$1.object({text:z$1.string(),fg:z$1.number(),bg:z$1.number(),attrs:z$1.number()}),eu=z$1.object({segments:z$1.array(gr),alignment:cr,plainText:z$1.string()});var tu=5e3,nu=1e5,ru=/(?:^|[^\w])/,ou=/(?:$|[^\w])/;function iu(e){let t=new Map,n=e.length;for(let r=0;r<n-1;r++){let o=e[r];o!==void 0&&t.set(o,n-1-r);}return t}function pr(e,t,n=true,r=0){if(t.length===0)return [];let o=n?e:e.toLowerCase(),i=n?t:t.toLowerCase(),a=o.length,l=i.length,s=[];if(l>a)return s;let u=iu(i),d=r+l-1;for(;d<a;){let f=l-1,c=d;for(;f>=0&&o[c]===i[f];)f--,c--;if(f<0)s.push(c+1),d++;else {let m=o[d],h=m!==void 0?u.get(m)??l:l;d+=Math.max(1,h);}}return s}function au(e){let t=0,n=Math.min(e.length,1e3);for(let r=0;r<n;r++){let o=e.charCodeAt(r);t=(t<<5)-t+o|0;}return t=(t<<5)-t+e.length|0,t}function lu(e,t){let n=0,r=0;for(let o=0;o<t&&o<e.length;o++)e[o]===`
|
|
32
|
-
`&&(n++,r=o+1);return {line:n,column:t-r}}function br(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
33
|
-
`&&t.push(n+1);return t}function su(e,t){let n=0,r=e.length-1;for(;n<r;){let o=Math.floor((n+r+1)/2),i=e[o];i!==void 0&&i<=t?n=o:r=o-1;}return n}function xr(e,t,n={}){let r=performance.now(),o=n.caseSensitive??false,i=n.wholeWord??false,a=n.maxMatches,l=n.startPosition??0;if(t.length===0)return yt(t,r);let s=pr(e,t,o,l),u=br(e),{matches:d,truncated:f}=du(e,t,s,u,i,a);return {matches:d,totalCount:f?s.length:d.length,truncated:f,timedOut:false,timeMs:performance.now()-r,query:t}}function yr(e,t,n={}){let r=performance.now(),o=n.caseSensitive??false,i=n.maxMatches,a=n.timeout??5e3,l=n.startPosition??0;if(t.length===0)return yt(t,r);let s=uu(t,o);if(!s)return yt(t,r);let u=br(e),d=cu(e,s,u,l,r+a,i);return {matches:d.matches,totalCount:d.matches.length,truncated:d.truncated,timedOut:d.timedOut,timeMs:performance.now()-r,query:t}}function yt(e,t){return {matches:[],totalCount:0,truncated:false,timedOut:false,timeMs:performance.now()-t,query:e}}function uu(e,t){try{let n=t?"g":"gi";return new RegExp(e,n)}catch{return null}}function du(e,t,n,r,o,i){let a=[],l=false;for(let s of n)if(!(o&&!fu(e,s,t.length))&&(a.push(Cr(e,r,s,t.length)),i&&a.length>=i)){l=true;break}return {matches:a,truncated:l}}function fu(e,t,n){let r=t>0?e[t-1]:"",o=e[t+n]??"";return !(r&&/\w/.test(r)||o&&/\w/.test(o))}function Cr(e,t,n,r){let o=su(t,n),i=t[o]??0,a=e.slice(n,n+r);return {start:n,end:n+r,line:o,column:n-i,text:a}}function cu(e,t,n,r,o,i){let a=[],l=false,s=false,u=r;t.lastIndex=r;let d=t.exec(e);for(;d!==null;){if(a.length%1e3===0&&performance.now()>o){s=true;break}if(d.index===u&&(t.lastIndex=u+1),u=t.lastIndex,a.push(Cr(e,n,d.index,d[0].length)),i&&a.length>=i){l=true;break}d=t.exec(e);}return {matches:a,truncated:l,timedOut:s}}function Ct(e,t,n={}){return n.regex?yr(e,t,n):xr(e,t,n)}function Sr(e,t,n,r=1e5,o={}){let i=performance.now();if(t.length===0||n>=e.length)return {matches:[],hasMore:false,nextPosition:e.length,timeMs:performance.now()-i};let a=Math.min(n+r,e.length),l=e.slice(0,a),u=Ct(l,t,{...o,startPosition:n}).matches.filter(f=>f.start>=n&&f.start<a),d=a<e.length;return {matches:u,hasMore:d,nextPosition:a,timeMs:performance.now()-i}}function mu(){return {query:"",options:{},matches:[],textHash:0,currentIndex:-1,complete:false,lastPosition:0}}function hu(e){e.query="",e.options={},e.matches=[],e.textHash=0,e.currentIndex=-1,e.complete=false,e.lastPosition=0;}function gu(e,t,n,r={}){let o=au(t),i=e.query!==n,a=e.options.caseSensitive!==r.caseSensitive||e.options.wholeWord!==r.wholeWord||e.options.regex!==r.regex,l=e.textHash!==o;return i||a||l?(e.query=n,e.options=r,e.matches=[],e.textHash=o,e.currentIndex=-1,e.complete=false,e.lastPosition=0,true):false}function pu(e,t,n=1e5){let r=performance.now();if(e.query.length===0)return {matches:e.matches,totalCount:0,truncated:false,timedOut:false,timeMs:performance.now()-r,query:e.query};if(e.complete)return {matches:e.matches,totalCount:e.matches.length,truncated:false,timedOut:false,timeMs:performance.now()-r,query:e.query};let o=Sr(t,e.query,e.lastPosition,n,e.options);return e.matches.push(...o.matches),e.lastPosition=o.nextPosition,e.complete=!o.hasMore,{matches:e.matches,totalCount:e.matches.length,truncated:false,timedOut:false,timeMs:performance.now()-r,query:e.query}}function bu(e){if(e.matches.length!==0)return e.currentIndex=(e.currentIndex+1)%e.matches.length,e.matches[e.currentIndex]}function xu(e){if(e.matches.length!==0)return e.currentIndex=e.currentIndex<=0?e.matches.length-1:e.currentIndex-1,e.matches[e.currentIndex]}function yu(e,t){if(!(t<0||t>=e.matches.length))return e.currentIndex=t,e.matches[t]}function Cu(e,t,n=true){if(e.matches.length===0)return;let r=0,o=e.matches.length-1;for(;r<o;){let l=Math.floor((r+o)/2),s=e.matches[l];s&&s.start<t?r=l+1:o=l;}let i=e.matches[r],a=r>0?e.matches[r-1]:void 0;if(n&&i)return e.currentIndex=r,{match:i,index:r};if(!n&&a)return e.currentIndex=r-1,{match:a,index:r-1};if(i)return e.currentIndex=r,{match:i,index:r};if(a)return e.currentIndex=r-1,{match:a,index:r-1}}function Su(e,t,n){return e.matches.filter(r=>r.line>=t&&r.line<n)}function Lu(e){return {current:e.currentIndex+1,total:e.matches.length,complete:e.complete}}function ku(e,t,n={}){let r=Ct(e,t,n);return {...r,matches:[...r.matches].reverse()}}export{To as $,Sn as $a,$i as $b,Qe as $c,Ss as $d,Q as A,re as Aa,si as Ab,Ta as Ac,ns as Ad,Qs as Ae,Qr as B,H as Ba,ui as Bb,Ra as Bc,rs as Bd,gr as Be,eo as C,an as Ca,di as Cb,wa as Cc,nr as Cd,eu as Ce,I as D,ln as Da,fi as Db,Ea as Dc,ss as Dd,tu as De,Ee as E,Ne as Ea,ci as Eb,Wa as Ec,us as Ed,nu as Ee,wt as F,sn as Fa,mi as Fb,$n as Fc,ds as Fd,ru as Fe,Et as G,ze as Ga,hi as Gb,Ma as Gc,fs as Gd,ou as Ge,We as H,He as Ha,gi as Hb,Ia as Hc,cs as Hd,pr as He,to as I,Ge as Ia,zn as Ib,Da as Ic,st as Id,lu as Ie,no as J,D as Ja,pi as Jb,va as Jc,R as Jd,xr as Je,ro as K,S as Ka,bi as Kb,ge as Kc,ms as Kd,yr as Ke,oo as L,Ue as La,xi as Lb,Kn as Lc,ut as Ld,Ct as Le,io as M,p as Ma,wi as Mb,Fa as Mc,rr as Md,Sr as Me,ao as N,A as Na,Ei as Nb,qn as Nc,or as Nd,mu as Ne,lo as O,je as Oa,Di as Ob,Pa as Oc,ir as Od,hu as Oe,so as P,fn as Pa,vi as Pb,_a as Pc,hs as Pd,gu as Pe,Dt as Q,cn as Qa,Bi as Qb,Oa as Qc,Te as Qd,pu as Qe,po as R,mn as Ra,Fi as Rb,Na as Rc,gs as Rd,bu as Re,bo as S,le as Sa,Pi as Sb,pe as Sc,ps as Sd,xu as Se,xo as T,ie as Ta,_i as Tb,U as Tc,ar as Td,yu as Te,vt as U,ae as Ua,Oi as Ub,V as Uc,bs as Ud,Cu as Ue,Bt as V,hn as Va,zi as Vb,be as Vc,xs as Vd,Su as Ve,yo as W,gn as Wa,Hi as Wb,Xe as Wc,mt as Wd,Lu as We,Co as X,pn as Xa,Gi as Xb,xe as Xc,lr as Xd,ku as Xe,So as Y,xn as Ya,Ui as Yb,Je as Yc,ht as Yd,Lo as Z,yn as Za,Vi as Zb,$ as Zc,ys as Zd,ko as _,Cn as _a,ji as _b,Ye as _c,Cs as _d,_ as a,Ro as aa,Ln as ab,Zi as ac,za as ad,Ls as ae,Ar as b,Ao as ba,kn as bb,Ki as bc,et as bd,ks as be,wr as c,Ho as ca,Tn as cb,qi as cc,Ha as cd,Ts as ce,Er as d,Gt as da,Rn as db,Xi as dc,Ga as dd,Rs as de,Wr as e,Ut as ea,An as eb,Ji as ec,Ua as ed,As as ee,Mr as f,Vt as fa,wn as fb,Yi as fc,Va as fd,ws as fe,Ir as g,jt as ga,G as gb,Qi as gc,F as gd,Es as ge,Dr as h,$t as ha,En as hb,ea as hc,tt as hd,Ws as he,Fr as i,Pe as ia,b as ib,ta as ic,dl as id,Ms as ie,Pr as j,_e as ja,Wn as jb,ra as jc,fl as jd,Is as je,_r as k,z as ka,$e as kb,he as kc,nt as kd,Us as ke,At as l,Zt as la,se as lb,Hn as lc,cl as ld,xt as le,Or as m,Kt as ma,Mn as mb,la as mc,rt as md,Vs as me,Nr as n,qt as na,In as nb,sa as nc,ml as nd,we as ne,Hr as o,Xt as oa,Dn as ob,ua as oc,w as od,js as oe,Gr as p,Jt as pa,vn as pb,da as pc,it as pd,$s as pe,J as q,Oe as qa,Bn as qb,Un as qc,Nl as qd,Zs as qe,Ur as r,Yt as ra,Fn as rb,fa as rc,zl as rd,Ks as re,Vr as s,Qt as sa,Pn as sb,ca as sc,Hl as sd,cr as se,jr as t,en as ta,_n as tb,ma as tc,Gl as td,X as te,$r as u,tn as ua,On as ub,ha as uc,at as ud,qs as ue,Zr as v,nn as va,Nn as vb,ga as vc,lt as vd,Xs as ve,qr as w,te as wa,oi as wb,pa as wc,Yl as wd,Js as we,Xr as x,rn as xa,ii as xb,ba as xc,Ql as xd,Ys as xe,Jr as y,on as ya,ai as yb,La as yc,es as yd,mr as ye,Yr as z,ne as za,li as zb,ka as zc,ts as zd,hr as ze};
|
package/dist/chunk-4X4N4HNQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {c as c$4}from'./chunk-H2YAOJDW.js';import {O,v,u,x,Z,Ja,X,W as W$2,Nc,nd,Ld,le,pe,$a,db,Bb,ub,Pb,fc,lc,vc,Ac,wc,qe}from'./chunk-P6CJO3BC.js';import {d as d$3,c as c$3,e as e$1}from'./chunk-BCADUCOZ.js';import {c as c$1,d as d$2}from'./chunk-KD55INV7.js';import {k,a,b as b$1,l}from'./chunk-PSXXMBVJ.js';import {s,i,j as j$1}from'./chunk-LCN2ZITE.js';import {d as d$1,e}from'./chunk-FYEBZAWN.js';import {V as V$1,W as W$1,r,K,c as c$2,d as d$4}from'./chunk-W5OU7Z6J.js';import {c,b}from'./chunk-G7GIWWLE.js';import {n,d,h}from'./chunk-PXXGH3BV.js';import {z as z$1}from'zod';s();n();var j=z$1.object({x:z$1.number().optional(),y:z$1.number().optional(),z:z$1.number().optional(),absolute:z$1.boolean().optional()}),R=z$1.object({width:z$1.union([z$1.number(),z$1.string()]).optional(),height:z$1.union([z$1.number(),z$1.string()]).optional(),minWidth:z$1.number().optional(),maxWidth:z$1.number().optional(),minHeight:z$1.number().optional(),maxHeight:z$1.number().optional(),shrink:z$1.boolean().optional()}),L=z$1.object({fg:z$1.number().optional(),bg:z$1.number().optional(),bold:z$1.boolean().optional(),italic:z$1.boolean().optional(),underline:z$1.boolean().optional(),strikethrough:z$1.boolean().optional(),dim:z$1.boolean().optional(),inverse:z$1.boolean().optional(),blink:z$1.boolean().optional(),visible:z$1.boolean().optional()}),W=z$1.object({type:z$1.number().optional(),left:z$1.boolean().optional(),right:z$1.boolean().optional(),top:z$1.boolean().optional(),bottom:z$1.boolean().optional(),fg:z$1.number().optional(),bg:z$1.number().optional(),chars:z$1.custom().optional()}),N=z$1.object({left:z$1.number().optional(),right:z$1.number().optional(),top:z$1.number().optional(),bottom:z$1.number().optional()}),ft=z$1.object({text:z$1.string().optional(),align:z$1.number().optional(),valign:z$1.number().optional(),wrap:z$1.boolean().optional(),parseTags:z$1.boolean().optional()}),ee=z$1.object({clickable:z$1.boolean().optional(),draggable:z$1.boolean().optional(),hoverable:z$1.boolean().optional(),keyable:z$1.boolean().optional(),hoverEffectFg:z$1.number().optional(),hoverEffectBg:z$1.number().optional()}),Q=z$1.object({focusable:z$1.boolean().optional(),tabIndex:z$1.number().optional(),focusEffectFg:z$1.number().optional(),focusEffectBg:z$1.number().optional()}),et=z$1.object({scrollable:z$1.boolean().optional(),scrollX:z$1.number().optional(),scrollY:z$1.number().optional(),scrollWidth:z$1.number().optional(),scrollHeight:z$1.number().optional(),scrollbarVisible:z$1.number().optional()}),dt=z$1.object({parent:z$1.number().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L),pt=z$1.object({parent:z$1.number().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L).merge(ft),ct=z$1.object({parent:z$1.number().optional(),label:z$1.string().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L).merge(ee).merge(Q),mt=z$1.object({width:z$1.number().int().positive(),height:z$1.number().int().positive(),title:z$1.string().optional(),cursorVisible:z$1.boolean().optional(),cursorShape:z$1.number().int().min(0).max(5).optional(),fullUnicode:z$1.boolean().optional(),autoPadding:z$1.boolean().optional()}),gt=z$1.object({parent:z$1.number().optional(),value:z$1.string().optional(),placeholder:z$1.string().optional(),maxLength:z$1.number().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L).merge(ee).merge(Q),bt=z$1.object({parent:z$1.number().optional(),items:z$1.array(z$1.string()).optional(),selectedIndex:z$1.number().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L).merge(et).merge(Q),yt=z$1.object({parent:z$1.number().optional(),label:z$1.string().optional(),checked:z$1.boolean().optional(),checkedChar:z$1.string().optional(),uncheckedChar:z$1.string().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L).merge(ee).merge(Q),vt=z$1.object({parent:z$1.number().optional(),value:z$1.string().optional(),placeholder:z$1.string().optional(),secret:z$1.boolean().optional(),censor:z$1.string().optional(),maxLength:z$1.number().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L).merge(ee).merge(Q),ht=z$1.object({parent:z$1.number().optional(),value:z$1.string().optional(),placeholder:z$1.string().optional(),maxLength:z$1.number().optional(),scrollable:z$1.boolean().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L).merge(ee).merge(Q).merge(et),Et=z$1.object({parent:z$1.number().optional(),options:z$1.array(z$1.object({label:z$1.string(),value:z$1.string()})).optional(),selectedIndex:z$1.number().optional(),placeholder:z$1.string().optional(),closedIndicator:z$1.string().optional(),openIndicator:z$1.string().optional(),selectedMark:z$1.string().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L).merge(ee).merge(Q),St=z$1.object({parent:z$1.number().optional(),min:z$1.number().optional(),max:z$1.number().optional(),value:z$1.number().optional(),step:z$1.number().optional(),orientation:z$1.number().optional(),showValue:z$1.boolean().optional(),trackChar:z$1.string().optional(),thumbChar:z$1.string().optional(),fillChar:z$1.string().optional(),trackFg:z$1.number().optional(),trackBg:z$1.number().optional(),thumbFg:z$1.number().optional(),thumbBg:z$1.number().optional(),fillFg:z$1.number().optional(),fillBg:z$1.number().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L).merge(ee).merge(Q),xt=z$1.object({parent:z$1.number().optional(),keys:z$1.boolean().optional(),submitOnEnter:z$1.boolean().optional(),fields:z$1.array(z$1.object({name:z$1.string(),entity:z$1.number(),initialValue:z$1.unknown().optional()})).optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L),Bt=z$1.object({parent:z$1.number().optional(),value:z$1.number().optional(),min:z$1.number().optional(),max:z$1.number().optional(),orientation:z$1.number().optional(),showPercentage:z$1.boolean().optional(),fillChar:z$1.string().optional(),emptyChar:z$1.string().optional(),fillFg:z$1.number().optional(),fillBg:z$1.number().optional(),emptyFg:z$1.number().optional(),emptyBg:z$1.number().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L),kt=z$1.object({parent:z$1.number().optional(),selectedIndex:z$1.number().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L),Ct=z$1.object({parent:z$1.number().optional(),radioSet:z$1.number().optional(),value:z$1.string().optional(),label:z$1.string().optional(),selected:z$1.boolean().optional(),selectedChar:z$1.string().optional(),unselectedChar:z$1.string().optional(),border:W.optional(),padding:N.optional()}).merge(j).merge(R).merge(L).merge(ee).merge(Q);function P(n,o){h(n,o,r),h(n,o,K),h(n,o,c$2),h(n,o,b),r.x[o]=0,r.y[o]=0,r.z[o]=0,r.absolute[o]=0,K.width[o]=0,K.height[o]=0,K.minWidth[o]=0,K.minHeight[o]=0,K.maxWidth[o]=Number.POSITIVE_INFINITY,K.maxHeight[o]=Number.POSITIVE_INFINITY,K.shrink[o]=0,c$2.visible[o]=1,c$2.dirty[o]=1,c$2.fg[o]=4294967295,c$2.bg[o]=255,c$2.bold[o]=0,c$2.underline[o]=0,c$2.blink[o]=0,c$2.inverse[o]=0,c$2.transparent[o]=0,b.parent[o]=0,b.firstChild[o]=0,b.nextSibling[o]=0,b.prevSibling[o]=0,b.childCount[o]=0,b.depth[o]=0;}function z(n,o){o.x!==void 0&&(r.x[n]=o.x),o.y!==void 0&&(r.y[n]=o.y),o.z!==void 0&&(r.z[n]=o.z),o.absolute!==void 0&&(r.absolute[n]=o.absolute?1:0);}function Ze(n){return typeof n=="string"&&n.endsWith("%")?-(Number.parseFloat(n)+2):n==="auto"?-1:n}function Tt(n,o){o.minWidth!==void 0&&(K.minWidth[n]=o.minWidth),o.maxWidth!==void 0&&(K.maxWidth[n]=o.maxWidth),o.minHeight!==void 0&&(K.minHeight[n]=o.minHeight),o.maxHeight!==void 0&&(K.maxHeight[n]=o.maxHeight),o.shrink!==void 0&&(K.shrink[n]=o.shrink?1:0);}function U(n,o){o.width!==void 0&&(K.width[n]=Ze(o.width)),o.height!==void 0&&(K.height[n]=Ze(o.height)),Tt(n,o);}function H(n,o,e){let t={};e.fg!==void 0&&(t.fg=e.fg),e.bg!==void 0&&(t.bg=e.bg),e.bold!==void 0&&(t.bold=e.bold),e.underline!==void 0&&(t.underline=e.underline),e.inverse!==void 0&&(t.inverse=e.inverse),e.blink!==void 0&&(t.blink=e.blink),Object.keys(t).length>0&&d$4(n,o,t),e.visible!==void 0&&(c$2.visible[o]=e.visible?1:0);}function V(n,o,e){if(!e||!(e.type!==void 0||e.left!==void 0||e.right!==void 0||e.top!==void 0||e.bottom!==void 0||e.fg!==void 0||e.bg!==void 0||e.chars!==void 0))return;i.type[o]=e.type??0,i.left[o]=0,i.right[o]=0,i.top[o]=0,i.bottom[o]=0,i.fg[o]=4294967295,i.bg[o]=255;let l={};e.type!==void 0&&(l.type=e.type),e.left!==void 0&&(l.left=e.left),e.right!==void 0&&(l.right=e.right),e.top!==void 0&&(l.top=e.top),e.bottom!==void 0&&(l.bottom=e.bottom),e.fg!==void 0&&(l.fg=e.fg),e.bg!==void 0&&(l.bg=e.bg),e.chars!==void 0&&(l.chars=e.chars),j$1(n,o,l);}function Y(n,o,e){if(!e||!(e.left!==void 0||e.right!==void 0||e.top!==void 0||e.bottom!==void 0))return;a.left[o]=0,a.right[o]=0,a.top[o]=0,a.bottom[o]=0;let l={};e.left!==void 0&&(l.left=e.left),e.right!==void 0&&(l.right=e.right),e.top!==void 0&&(l.top=e.top),e.bottom!==void 0&&(l.bottom=e.bottom),b$1(n,o,l);}function pn(n,o={}){let e=dt.parse(o),t=d(n);return P(n,t),z(t,e),U(t,e),H(n,t,e),V(n,t,e.border),Y(n,t,e.padding),e.parent!==void 0&&c(n,t,e.parent),t}function te(n,o){h(n,o,d$1),d$1.align[o]=0,d$1.valign[o]=0,d$1.wrap[o]=0,d$1.parseTags[o]=0,d$1.length[o]=0,d$1.hash[o]=0,d$1.contentId[o]=0;}function It(n,o){o.align!==void 0&&(d$1.align[n]=o.align),o.valign!==void 0&&(d$1.valign[n]=o.valign),o.wrap!==void 0&&(d$1.wrap[n]=o.wrap?1:0),o.parseTags!==void 0&&(d$1.parseTags[n]=o.parseTags?1:0);}function Ft(n,o,e$1){if(e$1.text!==void 0){let t={};e$1.align!==void 0&&(t.align=e$1.align),e$1.valign!==void 0&&(t.valign=e$1.valign),e$1.wrap!==void 0&&(t.wrap=e$1.wrap),e$1.parseTags!==void 0&&(t.parseTags=e$1.parseTags),e(n,o,e$1.text,t);}else It(o,e$1);}function cn(n,o={}){let e=pt.parse(o),t=d(n);return P(n,t),z(t,e),U(t,e),H(n,t,e),V(n,t,e.border),Y(n,t,e.padding),te(n,t),Ft(n,t,e),e.parent!==void 0&&c(n,t,e.parent),t}function mn(n,o={}){let e$1=ct.parse(o),t=d(n);P(n,t),z(t,e$1),U(t,e$1),H(n,t,e$1),V(n,t,e$1.border),Y(n,t,e$1.padding),d$1.align[t]=1,d$1.valign[t]=1,d$1.wrap[t]=0,d$1.parseTags[t]=0,d$1.length[t]=0,d$1.hash[t]=0,e$1.label!==void 0&&e(n,t,e$1.label),h(n,t,c$1),c$1.clickable[t]=1,c$1.draggable[t]=0,c$1.hoverable[t]=1,c$1.hovered[t]=0,c$1.pressed[t]=0,c$1.keyable[t]=1,c$1.hoverEffectFg[t]=4294967295,c$1.hoverEffectBg[t]=1145324799;let l={};e$1.clickable!==void 0&&(l.clickable=e$1.clickable),e$1.draggable!==void 0&&(l.draggable=e$1.draggable),e$1.hoverable!==void 0&&(l.hoverable=e$1.hoverable),e$1.keyable!==void 0&&(l.keyable=e$1.keyable),e$1.hoverEffectFg!==void 0&&(l.hoverEffectFg=e$1.hoverEffectFg),e$1.hoverEffectBg!==void 0&&(l.hoverEffectBg=e$1.hoverEffectBg),Object.keys(l).length>0&&d$2(n,t,l),h(n,t,V$1),V$1.focusable[t]=1,V$1.focused[t]=0,V$1.tabIndex[t]=0,V$1.focusEffectFg[t]=4294967295,V$1.focusEffectBg[t]=6750207;let u={};return e$1.focusable!==void 0&&(u.focusable=e$1.focusable),e$1.tabIndex!==void 0&&(u.tabIndex=e$1.tabIndex),e$1.focusEffectFg!==void 0&&(u.focusEffectFg=e$1.focusEffectFg),e$1.focusEffectBg!==void 0&&(u.focusEffectBg=e$1.focusEffectBg),Object.keys(u).length>0&&W$1(n,t,u),e$1.parent!==void 0&&c(n,t,e$1.parent),t}function gn(n,o){if(d$3(n))throw new Error("A screen already exists in this world. Only one screen is allowed.");let e=mt.parse(o),t=d(n);return P(n,t),r.x[t]=0,r.y[t]=0,r.z[t]=0,r.absolute[t]=0,K.width[t]=e.width,K.height[t]=e.height,c$2.visible[t]=1,c$2.dirty[t]=1,b.parent[t]=0,b.depth[t]=0,c$3(n,t,{cursorVisible:e.cursorVisible,cursorShape:e.cursorShape,fullUnicode:e.fullUnicode,autoPadding:e.autoPadding}),e$1(n,t),t}function bn(n,o={}){let e$1=gt.parse(o),t=d(n);P(n,t),z(t,e$1),U(t,e$1),H(n,t,e$1),V(n,t,e$1.border),Y(n,t,e$1.padding),d$1.align[t]=0,d$1.valign[t]=1,d$1.wrap[t]=0,d$1.parseTags[t]=0,d$1.length[t]=0,d$1.hash[t]=0,e$1.value!==void 0&&e(n,t,e$1.value),c$1.clickable[t]=1,c$1.draggable[t]=0,c$1.hoverable[t]=1,c$1.hovered[t]=0,c$1.pressed[t]=0,c$1.keyable[t]=1,c$1.hoverEffectFg[t]=4294967295,c$1.hoverEffectBg[t]=858993663;let l={};e$1.clickable!==void 0&&(l.clickable=e$1.clickable),e$1.draggable!==void 0&&(l.draggable=e$1.draggable),e$1.hoverable!==void 0&&(l.hoverable=e$1.hoverable),e$1.keyable!==void 0&&(l.keyable=e$1.keyable),e$1.hoverEffectFg!==void 0&&(l.hoverEffectFg=e$1.hoverEffectFg),e$1.hoverEffectBg!==void 0&&(l.hoverEffectBg=e$1.hoverEffectBg),Object.keys(l).length>0&&d$2(n,t,l),h(n,t,V$1),V$1.focusable[t]=1,V$1.focused[t]=0,V$1.tabIndex[t]=0,V$1.focusEffectFg[t]=4294967295,V$1.focusEffectBg[t]=6750207;let u={};return e$1.focusable!==void 0&&(u.focusable=e$1.focusable),e$1.tabIndex!==void 0&&(u.tabIndex=e$1.tabIndex),e$1.focusEffectFg!==void 0&&(u.focusEffectFg=e$1.focusEffectFg),e$1.focusEffectBg!==void 0&&(u.focusEffectBg=e$1.focusEffectBg),Object.keys(u).length>0&&W$1(n,t,u),e$1.parent!==void 0&&c(n,t,e$1.parent),t}function Mt(n,o,e){h(n,o,k),k.scrollX[o]=0,k.scrollY[o]=0,k.scrollWidth[o]=0,k.scrollHeight[o]=e,k.scrollbarVisible[o]=2;}function At(n,o,e){let t={};e.scrollable!==void 0&&(t.scrollX=0),e.scrollX!==void 0&&(t.scrollX=e.scrollX),e.scrollY!==void 0&&(t.scrollY=e.scrollY),e.scrollWidth!==void 0&&(t.scrollWidth=e.scrollWidth),e.scrollHeight!==void 0&&(t.scrollHeight=e.scrollHeight),e.scrollbarVisible!==void 0&&(t.scrollbarVisible=e.scrollbarVisible),Object.keys(t).length>0&&l(n,o,t);}function Pt(n){c$1.clickable[n]=1,c$1.draggable[n]=0,c$1.hoverable[n]=0,c$1.hovered[n]=0,c$1.pressed[n]=0,c$1.keyable[n]=1,c$1.hoverEffectFg[n]=4294967295,c$1.hoverEffectBg[n]=1145324799;}function Dt(n,o){h(n,o,V$1),V$1.focusable[o]=1,V$1.focused[o]=0,V$1.tabIndex[o]=0,V$1.focusEffectFg[o]=4294967295,V$1.focusEffectBg[o]=6750207;}function ne(n,o,e){let t={};e.focusable!==void 0&&(t.focusable=e.focusable),e.tabIndex!==void 0&&(t.tabIndex=e.tabIndex),e.focusEffectFg!==void 0&&(t.focusEffectFg=e.focusEffectFg),e.focusEffectBg!==void 0&&(t.focusEffectBg=e.focusEffectBg),Object.keys(t).length>0&&W$1(n,o,t);}function ie(n,o,e){let t={};e.clickable!==void 0&&(t.clickable=e.clickable),e.draggable!==void 0&&(t.draggable=e.draggable),e.hoverable!==void 0&&(t.hoverable=e.hoverable),e.keyable!==void 0&&(t.keyable=e.keyable),e.hoverEffectFg!==void 0&&(t.hoverEffectFg=e.hoverEffectFg),e.hoverEffectBg!==void 0&&(t.hoverEffectBg=e.hoverEffectBg),Object.keys(t).length>0&&d$2(n,o,t);}function ae(n,o){h(n,o,c$1),c$1.clickable[o]=1,c$1.draggable[o]=0,c$1.hoverable[o]=1,c$1.hovered[o]=0,c$1.pressed[o]=0,c$1.keyable[o]=1,c$1.hoverEffectFg[o]=4294967295,c$1.hoverEffectBg[o]=1145324799;}function re(n,o){h(n,o,V$1),V$1.focusable[o]=1,V$1.focused[o]=0,V$1.tabIndex[o]=0,V$1.focusEffectFg[o]=4294967295,V$1.focusEffectBg[o]=6750207;}function Kt(n,o,e){let t={};e.scrollX!==void 0&&(t.scrollX=e.scrollX),e.scrollY!==void 0&&(t.scrollY=e.scrollY),e.scrollWidth!==void 0&&(t.scrollWidth=e.scrollWidth),e.scrollHeight!==void 0&&(t.scrollHeight=e.scrollHeight),e.scrollbarVisible!==void 0&&(t.scrollbarVisible=e.scrollbarVisible),Object.keys(t).length>0&&l(n,o,t);}function Ot(n,o){let e={};o.trackChar!==void 0&&(e.trackChar=o.trackChar),o.thumbChar!==void 0&&(e.thumbChar=o.thumbChar),o.fillChar!==void 0&&(e.fillChar=o.fillChar),o.trackFg!==void 0&&(e.trackFg=o.trackFg),o.trackBg!==void 0&&(e.trackBg=o.trackBg),o.thumbFg!==void 0&&(e.thumbFg=o.thumbFg),o.thumbBg!==void 0&&(e.thumbBg=o.thumbBg),o.fillFg!==void 0&&(e.fillFg=o.fillFg),o.fillBg!==void 0&&(e.fillBg=o.fillBg),qe(n,e);}function yn(n,o={}){let e$1=bt.parse(o),t=d(n);return P(n,t),z(t,e$1),U(t,e$1),H(n,t,e$1),V(n,t,e$1.border),Y(n,t,e$1.padding),te(n,t),e$1.items!==void 0&&e$1.items.length>0&&e(n,t,e$1.items.join(`
|
|
2
|
-
`)),Mt(n,t,e$1.items?.length??0),At(n,t,e$1),Dt(n,t),ne(n,t,e$1),Pt(t),e$1.parent!==void 0&&c(n,t,e$1.parent),t}function vn(n,o={}){let e$1=yt.parse(o),t=d(n);return P(n,t),z(t,e$1),U(t,e$1),H(n,t,e$1),V(n,t,e$1.border),Y(n,t,e$1.padding),te(n,t),d$1.align[t]=0,d$1.valign[t]=1,e$1.label!==void 0&&e(n,t,e$1.label),ae(n,t),ie(n,t,e$1),re(n,t),ne(n,t,e$1),O(t,{checkedChar:e$1.checkedChar??u,uncheckedChar:e$1.uncheckedChar??v}),x(n,t,e$1.checked??false),e$1.parent!==void 0&&c(n,t,e$1.parent),t}function hn(n,o={}){let e$1=vt.parse(o),t=d(n);return P(n,t),z(t,e$1),U(t,e$1),H(n,t,e$1),V(n,t,e$1.border),Y(n,t,e$1.padding),te(n,t),d$1.align[t]=0,d$1.valign[t]=1,e$1.value!==void 0&&e(n,t,e$1.value),ae(n,t),c$1.hoverEffectBg[t]=858993663,ie(n,t,e$1),re(n,t),ne(n,t,e$1),Z(n,t),Ja(t,{secret:e$1.secret??false,censor:e$1.censor??W$2,placeholder:e$1.placeholder??X,maxLength:e$1.maxLength??0}),e$1.parent!==void 0&&c(n,t,e$1.parent),t}function En(n,o={}){let e$1=ht.parse(o),t=d(n);return P(n,t),z(t,e$1),U(t,e$1),H(n,t,e$1),V(n,t,e$1.border),Y(n,t,e$1.padding),te(n,t),d$1.align[t]=0,d$1.valign[t]=0,e$1.value!==void 0&&e(n,t,e$1.value),ae(n,t),c$1.hoverEffectBg[t]=858993663,ie(n,t,e$1),re(n,t),ne(n,t,e$1),e$1.scrollable&&(h(n,t,k),k.scrollX[t]=0,k.scrollY[t]=0,k.scrollWidth[t]=0,k.scrollHeight[t]=0,k.scrollbarVisible[t]=2,Kt(n,t,e$1)),Z(n,t),Ja(t,{secret:false,censor:"",placeholder:e$1.placeholder??X,maxLength:e$1.maxLength??0,multiline:true}),e$1.parent!==void 0&&c(n,t,e$1.parent),t}function Sn(n,o={}){let e$1=Et.parse(o),t=d(n);P(n,t),z(t,e$1),U(t,e$1),H(n,t,e$1),V(n,t,e$1.border),Y(n,t,e$1.padding),te(n,t),d$1.align[t]=0,d$1.valign[t]=1,ae(n,t),c$1.hoverEffectBg[t]=858993663,ie(n,t,e$1),re(n,t),ne(n,t,e$1);let l=e$1.options??[],u=e$1.selectedIndex??-1;Nc(n,t,l,u);let b={};return e$1.closedIndicator!==void 0&&(b.closedIndicator=e$1.closedIndicator),e$1.openIndicator!==void 0&&(b.openIndicator=e$1.openIndicator),e$1.selectedMark!==void 0&&(b.selectedMark=e$1.selectedMark),nd(t,b),u>=0&&l[u]?e(n,t,l[u].label):e$1.placeholder&&e(n,t,e$1.placeholder),e$1.parent!==void 0&&c(n,t,e$1.parent),t}function xn(n,o={}){let e=St.parse(o),t=d(n);P(n,t),z(t,e),U(t,e),H(n,t,e),V(n,t,e.border),Y(n,t,e.padding),ae(n,t),c$1.draggable[t]=1,c$1.hoverEffectBg[t]=858993663,ie(n,t,e),re(n,t),ne(n,t,e);let l=e.min??0,u=e.max??100,b=e.value??0,y=e.step??1;return Ld(n,t,l,u,b,y),e.orientation!==void 0&&le(n,t,e.orientation),e.showValue!==void 0&&pe(n,t,e.showValue),Ot(t,e),e.parent!==void 0&&c(n,t,e.parent),t}function Bn(n,o={}){let e=xt.parse(o),t=d(n);if(P(n,t),z(t,e),U(t,e),H(n,t,e),V(n,t,e.border),Y(n,t,e.padding),$a(n,t,{keys:e.keys??true,submitOnEnter:e.submitOnEnter??true}),e.fields)for(let l of e.fields)db(n,t,l.entity,l.name,l.initialValue);return e.parent!==void 0&&c(n,t,e.parent),t}function kn(n,o={}){let e=Bt.parse(o),t=d(n);return P(n,t),z(t,e),U(t,e),H(n,t,e),V(n,t,e.border),Y(n,t,e.padding),Bb(n,t,{value:e.value??0,min:e.min??0,max:e.max??100,orientation:e.orientation??ub.Horizontal,showPercentage:e.showPercentage??false}),(e.fillChar!==void 0||e.emptyChar!==void 0||e.fillFg!==void 0||e.fillBg!==void 0||e.emptyFg!==void 0||e.emptyBg!==void 0)&&Pb(t,{fillChar:e.fillChar,emptyChar:e.emptyChar,fillFg:e.fillFg,fillBg:e.fillBg,emptyFg:e.emptyFg,emptyBg:e.emptyBg}),e.parent!==void 0&&c(n,t,e.parent),t}function Cn(n,o={}){let e=kt.parse(o),t=d(n);return P(n,t),z(t,e),U(t,e),H(n,t,e),V(n,t,e.border),Y(n,t,e.padding),fc(n,t),e.parent!==void 0&&c(n,t,e.parent),t}function Tn(n,o={}){let e$1=Ct.parse(o),t=d(n);return P(n,t),z(t,e$1),U(t,e$1),H(n,t,e$1),V(n,t,e$1.border),Y(n,t,e$1.padding),te(n,t),d$1.align[t]=0,d$1.valign[t]=1,e$1.label!==void 0&&e(n,t,e$1.label),ae(n,t),c$1.hoverEffectBg[t]=858993663,ie(n,t,e$1),re(n,t),ne(n,t,e$1),lc(n,t,e$1.radioSet),e$1.value!==void 0&&vc(t,e$1.value),(e$1.selectedChar!==void 0||e$1.unselectedChar!==void 0)&&Ac(t,{selectedChar:e$1.selectedChar,unselectedChar:e$1.unselectedChar}),e$1.parent!==void 0&&c(n,t,e$1.parent),e$1.selected&&wc(n,t),t}var jt=(t=>(t[t.STOPPED=0]="STOPPED",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t))(jt||{});function ue(){let[n,o]=process.hrtime();return n+o/1e9}function Mn(n,o={},e={}){let t=n,l=c$4(),u={...e},b=0,y={targetFPS:o.targetFPS??60,fixedTimestep:o.fixedTimestep??true,maxDeltaTime:o.maxDeltaTime??.1,fixedTimestepMode:o.fixedTimestepMode},B=0,_=y.targetFPS>0?1/y.targetFPS:0,M=0,r=0,s=0,f=0,x=0,k=0,I=0,E=y.fixedTimestepMode?1/y.fixedTimestepMode.tickRate:1/60,q=0,oe=0,a=0,d=0,g=0,h=null,X=null;function Ee(){if(y.targetFPS===0)h=setImmediate(()=>me());else {let S=ue()-B,$=Math.max(0,_-S);$>.001?X=setTimeout(()=>me(),$*1e3):h=setImmediate(()=>me());}}function Se(){h!==null&&(clearImmediate(h),h=null),X!==null&&(clearTimeout(X),X=null);}function xe(p){u.onBeforeInput?.(t,p),t=l.run(t,p),u.onAfterInput?.(t,p),u.onBeforeUpdate?.(t,p),u.onAfterUpdate?.(t,p),u.onBeforeRender?.(t,p),u.onAfterRender?.(t,p),M++;}function Be(p){let S=y.fixedTimestepMode;if(!S)return;u.onBeforeInput?.(t,p),t=l.runInputOnly(t,p),u.onAfterInput?.(t,p),I+=p,g=0;let $=0;for(;I>=E;){if($>=S.maxUpdatesPerFrame){g=Math.floor(I/E),I=I%E;break}u.onBeforeFixedUpdate?.(t,E,q),u.onBeforeUpdate?.(t,E),t=l.runFixedUpdatePhases(t,E),u.onAfterUpdate?.(t,E),u.onAfterFixedUpdate?.(t,E,q),I-=E,q++,oe++,$++;}d=S.interpolate?I/E:0,S.interpolate&&u.onInterpolate&&u.onInterpolate(t,d),u.onBeforeRender?.(t,p),t=l.runRenderPhases(t,p),u.onAfterRender?.(t,p),M++;}function st(p,S){k=S*1e3,f++,p-s>=1&&(x=f,a=oe,f=0,oe=0,s=p);}function me(){if(b!==1)return;let p=ue(),S=p-B;B=p,S>y.maxDeltaTime&&(S=y.maxDeltaTime),y.fixedTimestepMode?Be(S):xe(S),st(p,S),Ee();}let ke={getState(){return b},isRunning(){return b===1},isPaused(){return b===2},isStopped(){return b===0},getStats(){return {fps:x,frameTime:k,frameCount:M,runningTime:b!==0?ue()-r:0,tickCount:q,ticksPerSecond:a,interpolationAlpha:d,skippedUpdates:g}},getInterpolationAlpha(){return d},getFixedTimestepConfig(){return y.fixedTimestepMode},isFixedTimestepMode(){return y.fixedTimestepMode!==void 0},getScheduler(){return l},getWorld(){return t},setWorld(p){if(b!==0)throw new Error("Cannot change world while loop is running");t=p;},setTargetFPS(p){y.targetFPS=p,_=p>0?1/p:0;},getTargetFPS(){return y.targetFPS},registerSystem(p,S,$=0){l.registerSystem(p,S,$);},unregisterSystem(p){l.unregisterSystem(p);},registerInputSystem(p,S=0){l.registerInputSystem(p,S);},setHooks(p){u={...u,...p};},start(){if(b===1)return;let p=b===0;b=1,B=ue(),p?(M=0,r=B,s=B,f=0,I=0,q=0,oe=0,a=0,d=0,g=0,u.onStart?.()):u.onResume?.(),Ee();},stop(){b!==0&&(Se(),b=0,u.onStop?.());},pause(){b===1&&(Se(),b=2,u.onPause?.());},resume(){b===2&&ke.start();},step(p){let S=ue(),$=p??(B>0?S-B:1/60);B=S;let fe=Math.min($,y.maxDeltaTime);y.fixedTimestepMode?Be(fe):xe(fe),k=fe*1e3;},stepFixed(){if(!y.fixedTimestepMode)throw new Error("stepFixed() requires fixedTimestepMode to be enabled");u.onBeforeFixedUpdate?.(t,E,q),u.onBeforeUpdate?.(t,E),t=l.runFixedUpdatePhases(t,E),u.onAfterUpdate?.(t,E),u.onAfterFixedUpdate?.(t,E,q),q++;}};return ke}function An(n){return n?.isRunning()??false}function Pn(n){return n?.isPaused()??false}var Rt=z$1.object({action:z$1.string().min(1,"Action name is required"),keys:z$1.array(z$1.string()).default([]),mouseButtons:z$1.array(z$1.enum(["left","right","middle","wheelUp","wheelDown","unknown"])).optional(),continuous:z$1.boolean().default(false),deadzone:z$1.number().min(0).max(1).default(.1)}),Lt=z$1.object({version:z$1.number().int().positive(),bindings:z$1.array(z$1.object({action:z$1.string(),keys:z$1.array(z$1.string()),mouseButtons:z$1.array(z$1.string()).optional(),continuous:z$1.boolean().optional()}))}),tt={active:false,justActivated:false,justDeactivated:false,activeTime:0,value:0},Wt=1;function Nt(n,o){for(let e of n.keys)if(o.isKeyDown(e))return true;for(let e of n.mouseButtons)if(o.isMouseButtonDown(e))return true;return false}function On(n){let o=new Map,e=new Map,t=new Map,l=new Set;function u(r,s,f){r.active=true,r.justActivated=true,r.activeTime=0,r.value=1,_(s,r,f);}function b(r,s,f){r.active=false,r.justDeactivated=true,r.value=0,_(s,r,f);}function y(r,s,f,x,k){r.activeTime+=x,r.value=1,s.continuous&&_(f,r,k);}function B(r,s,f,x,k){f.justActivated=false,f.justDeactivated=false;let I=f.active,E=Nt(s,k);E&&!I?u(f,r,k):!E&&I?b(f,r,k):E&&y(f,s,r,x,k);}function _(r,s,f){let x=t.get(r);if(x)for(let k of x)k(r,s,f);for(let k of l)k(r,s,f);}let M={register(r){let s=Rt.parse(r),f={action:s.action,keys:[...s.keys],mouseButtons:s.mouseButtons?[...s.mouseButtons]:[],continuous:s.continuous??false,deadzone:s.deadzone??.1};return o.set(s.action,f),e.has(s.action)||e.set(s.action,{...tt}),M},registerAll(r){for(let s of r)M.register(s);return M},unregister(r){let s=o.delete(r);return e.delete(r),t.delete(r),s},hasAction(r){return o.has(r)},getActions(){return [...o.keys()]},getBinding(r){let s=o.get(r);if(s)return {action:s.action,keys:[...s.keys],mouseButtons:s.mouseButtons.length>0?[...s.mouseButtons]:void 0,continuous:s.continuous,deadzone:s.deadzone}},update(r,s){let f=s*1e3;for(let[x,k]of o){let I=e.get(x);I&&B(x,k,I,f,r);}},isActive(r){return e.get(r)?.active??false},isJustActivated(r){return e.get(r)?.justActivated??false},isJustDeactivated(r){return e.get(r)?.justDeactivated??false},getValue(r){return e.get(r)?.value??0},getActiveTime(r){return e.get(r)?.activeTime??0},getState(r){return e.get(r)??tt},getActiveActions(){let r=[];for(let[s,f]of e)f.active&&r.push(s);return r},rebindKeys(r,s){let f=o.get(r);return f?(f.keys=[...s],true):false},rebindMouseButtons(r,s){let f=o.get(r);return f?(f.mouseButtons=[...s],true):false},addKey(r,s){let f=o.get(r);return f?(f.keys.includes(s)||f.keys.push(s),true):false},removeKey(r,s){let f=o.get(r);if(!f)return false;let x=f.keys.indexOf(s);return x!==-1?(f.keys.splice(x,1),true):false},getKeysForAction(r){let s=o.get(r);return s?[...s.keys]:[]},getMouseButtonsForAction(r){let s=o.get(r);return s?[...s.mouseButtons]:[]},getActionsForKey(r){let s=[];for(let[f,x]of o)x.keys.includes(r)&&s.push(f);return s},onAction(r,s){let f=t.get(r);return f||(f=new Set,t.set(r,f)),f.add(s),()=>{f?.delete(s);}},onAnyAction(r){return l.add(r),()=>{l.delete(r);}},saveBindings(){let r=[];for(let[,s]of o)r.push({action:s.action,keys:[...s.keys],mouseButtons:s.mouseButtons.length>0?[...s.mouseButtons]:void 0,continuous:s.continuous||void 0});return {version:Wt,bindings:r}},loadBindings(r){let s=Lt.parse(r);o.clear(),e.clear();for(let f of s.bindings)M.register({action:f.action,keys:f.keys,mouseButtons:f.mouseButtons,continuous:f.continuous});},toJSON(r=false){let s=M.saveBindings();return r?JSON.stringify(s,null,2):JSON.stringify(s)},fromJSON(r){let s=JSON.parse(r);M.loadBindings(s);},resetStates(){for(let r of e.values())r.active=false,r.justActivated=false,r.justDeactivated=false,r.activeTime=0,r.value=0;},clear(){o.clear(),e.clear(),t.clear(),l.clear();}};return n&&M.registerAll(n),M}var jn={platformer:[{action:"move_left",keys:["a","left"],continuous:true},{action:"move_right",keys:["d","right"],continuous:true},{action:"jump",keys:["space","w","up"]},{action:"crouch",keys:["s","down"],continuous:true},{action:"attack",keys:["j","enter"]}],topDown:[{action:"move_up",keys:["w","up"],continuous:true},{action:"move_down",keys:["s","down"],continuous:true},{action:"move_left",keys:["a","left"],continuous:true},{action:"move_right",keys:["d","right"],continuous:true},{action:"action",keys:["space","enter"]}],menu:[{action:"up",keys:["w","up"]},{action:"down",keys:["s","down"]},{action:"left",keys:["a","left"]},{action:"right",keys:["d","right"]},{action:"confirm",keys:["enter","space"]},{action:"cancel",keys:["escape","backspace"]}]};function ce(){return performance.now()}function he(n){return n.length===0?0:n.reduce((e,t)=>e+t,0)/n.length}function nt(n,o){if(n.length===0)return 0;if(n.length===1)return n[0]??0;let e=Math.ceil(o*n.length)-1;return n[Math.max(0,Math.min(e,n.length-1))]??0}function zt(n,o){o&&console.warn(`[InputEventBuffer] Dropped ${n} events due to buffer overflow`);}function Ut(n={}){let o=n.warnOnOverflow??true;return {keyEvents:[],mouseEvents:[],latencySamples:[],frameProcessingTimes:[],frameStartTime:0,totalKeyEvents:0,totalMouseEvents:0,droppedEvents:0,config:{maxBufferSize:n.maxBufferSize??1e3,maxLatencySamples:n.maxLatencySamples??1e3,maxFrameSamples:n.maxFrameSamples??100,warnOnOverflow:o,onOverflow:n.onOverflow??(e=>zt(e,o))}}}function ot(n,o){let e=n.config.maxBufferSize;if(e<=0)return 0;if(o.length>e){let t=o.length-e;return o.splice(0,t),n.droppedEvents+=t,n.config.onOverflow(t),t}return 0}function Ln(n,o,e){n.totalKeyEvents++;let t={type:"key",event:o,timestamp:e??ce()};n.keyEvents.push(t),ot(n,n.keyEvents);}function Wn(n,o,e){n.totalMouseEvents++;let t={type:"mouse",event:o,timestamp:e??ce()};n.mouseEvents.push(t),ot(n,n.mouseEvents);}function Ht(n){let o=n.keyEvents;return n.keyEvents=[],o}function Vt(n){let o=n.mouseEvents;return n.mouseEvents=[],o}function Nn(n){let o=Ht(n),e=Vt(n),t=[...o,...e];return t.sort((l,u)=>l.timestamp-u.timestamp),t}function zn(n){let o=[...n.keyEvents,...n.mouseEvents];return o.sort((e,t)=>e.timestamp-t.timestamp),o}function Un(n){return n.keyEvents}function Hn(n){return n.mouseEvents}function Vn(n){n.keyEvents=[],n.mouseEvents=[];}function Yn(n){return n.keyEvents.length}function _n(n){return n.mouseEvents.length}function Xn(n){return n.keyEvents.length+n.mouseEvents.length}function Gn(n){return n.keyEvents.length>0||n.mouseEvents.length>0}function Jn(n){return {totalKeyEvents:n.totalKeyEvents,totalMouseEvents:n.totalMouseEvents,pendingKeyEvents:n.keyEvents.length,pendingMouseEvents:n.mouseEvents.length,droppedEvents:n.droppedEvents,maxBufferSize:n.config.maxBufferSize}}function qn(n){n.totalKeyEvents=0,n.totalMouseEvents=0,n.droppedEvents=0;}function wn(n){n.frameStartTime=ce();}function $n(n){let e=ce()-n.frameStartTime;return n.frameProcessingTimes.push(e),n.frameProcessingTimes.length>n.config.maxFrameSamples&&n.frameProcessingTimes.shift(),e}function Qn(n,o){n.latencySamples.push(o),n.latencySamples.length>n.config.maxLatencySamples&&n.latencySamples.shift();}function Zn(n,o,e){for(let t=0;t<Math.min(e,10);t++)n.latencySamples.push(o);for(;n.latencySamples.length>n.config.maxLatencySamples;)n.latencySamples.shift();}function it(n){let o=n.latencySamples,e=n.frameProcessingTimes;if(o.length===0)return {min:0,max:0,avg:0,p95:0,p99:0,sampleCount:0,lastFrameProcessingTime:e[e.length-1]??0,avgFrameProcessingTime:he(e)};let t=[...o].sort((l,u)=>l-u);return {min:t[0]??0,max:t[t.length-1]??0,avg:he(t),p95:nt(t,.95),p99:nt(t,.99),sampleCount:t.length,lastFrameProcessingTime:e[e.length-1]??0,avgFrameProcessingTime:he(e)}}function eo(n){n.latencySamples=[],n.frameProcessingTimes=[];}function to(n,o=16){return it(n).p95<=o}function no(n,o=1){return it(n).avgFrameProcessingTime<=o}var oo=Ut();var at={pressed:false,justPressed:false,justReleased:false,heldTime:0,repeatCount:0,lastEventTime:0},se={pressed:false,justPressed:false,justReleased:false,heldTime:0,lastEventTime:0};function rt(){return {x:0,y:0,deltaX:0,deltaY:0,wheelDelta:0,buttons:{left:{...se},right:{...se},middle:{...se},wheelUp:{...se},wheelDown:{...se},unknown:{...se}}}}function Yt(n,o){return n.toLowerCase()}function ao(n={}){let o={trackRepeats:n.trackRepeats??true,debounceTime:n.debounceTime??0,customRepeatRate:n.customRepeatRate??0,customRepeatDelay:n.customRepeatDelay??500},e=new Map,t=rt(),l=0,u=0,b=0,y=false,B=false,_=false;function M(){for(let a of e.values())a.justPressed=false,a.justReleased=false;for(let a of Object.values(t.buttons))a.justPressed=false,a.justReleased=false;}function r(a){for(let d of e.values())d.pressed&&(d.heldTime+=a);}function s(a,d){return o.debounceTime<=0||a.lastEventTime<=0?false:d-a.lastEventTime<o.debounceTime}function f(a){o.trackRepeats&&a.repeatCount++;}function x(a){a.pressed=true,a.justPressed=true,a.justReleased=false,a.heldTime=0,a.repeatCount=0;}function k(a,d){let g=Yt(a.name),h=e.get(g);h||(h={...at},e.set(g,h)),!s(h,d)&&(h.pressed?f(h):x(h),h.lastEventTime=d,a.ctrl&&!h.pressed&&(y=true),a.meta&&!h.pressed&&(B=true),a.shift&&!h.pressed&&(_=true));}function I(a,d){let g=e.get(a);!g||!g.pressed||(g.pressed=false,g.justPressed=false,g.justReleased=true,g.lastEventTime=d,a==="ctrl"&&(y=false),a==="alt"&&(B=false),a==="shift"&&(_=false));}function E(a){let d=t.x,g=t.y;t.x=a.x,t.y=a.y,t.deltaX+=a.x-d,t.deltaY+=a.y-g;}function q(a,d,g){d==="press"&&!a.pressed?(a.pressed=true,a.justPressed=true,a.justReleased=false,a.heldTime=0):d==="release"&&a.pressed&&(a.pressed=false,a.justPressed=false,a.justReleased=true),a.lastEventTime=g;}function oe(a,d){E(a),a.button==="wheelUp"?t.wheelDelta+=1:a.button==="wheelDown"&&(t.wheelDelta-=1);let g=t.buttons[a.button];g&&q(g,a.action,d);}return {update(a,d,g){l++,u=a.length,b=d.length;let h=g*1e3;M(),r(h);for(let X of a)k(X.event,X.timestamp);t.deltaX=0,t.deltaY=0,t.wheelDelta=0;for(let X of d)oe(X.event,X.timestamp);for(let X of Object.values(t.buttons))X.pressed&&(X.heldTime+=h);},isKeyDown(a){return e.get(a.toLowerCase())?.pressed??false},isKeyPressed(a){return e.get(a.toLowerCase())?.justPressed??false},isKeyReleased(a){return e.get(a.toLowerCase())?.justReleased??false},getKeyHeldTime(a){return e.get(a.toLowerCase())?.heldTime??0},getKeyState(a){return e.get(a.toLowerCase())??at},getKeyRepeatCount(a){return e.get(a.toLowerCase())?.repeatCount??0},getPressedKeys(){let a=[];for(let[d,g]of e)g.pressed&&a.push(d);return a},getJustPressedKeys(){let a=[];for(let[d,g]of e)g.justPressed&&a.push(d);return a},getJustReleasedKeys(){let a=[];for(let[d,g]of e)g.justReleased&&a.push(d);return a},isCtrlDown(){return y},isAltDown(){return B},isShiftDown(){return _},hasModifier(){return y||B||_},isMouseButtonDown(a){return t.buttons[a]?.pressed??false},isMouseButtonPressed(a){return t.buttons[a]?.justPressed??false},isMouseButtonReleased(a){return t.buttons[a]?.justReleased??false},getMouseX(){return t.x},getMouseY(){return t.y},getMousePosition(){return {x:t.x,y:t.y}},getMouseDelta(){return {deltaX:t.deltaX,deltaY:t.deltaY}},getWheelDelta(){return t.wheelDelta},getMouseState(){return t},releaseKey(a){I(a.toLowerCase(),performance.now());},releaseAllKeys(){let a=performance.now();for(let[d,g]of e)g.pressed&&I(d,a);y=false,B=false,_=false;},releaseAllMouseButtons(){let a=performance.now();for(let d of Object.values(t.buttons))d.pressed&&(d.pressed=false,d.justReleased=true,d.lastEventTime=a);},releaseAll(){this.releaseAllKeys(),this.releaseAllMouseButtons();},getStats(){let a=0,d=0,g=0;for(let h of e.values())h.pressed&&a++,h.justPressed&&d++,h.justReleased&&g++;return {keysDown:a,keysPressed:d,keysReleased:g,keyEventsThisFrame:u,mouseEventsThisFrame:b,frameCount:l}},getFrameCount(){return l},reset(){e.clear(),t=rt(),l=0,u=0,b=0,y=false,B=false,_=false;}}}function ro(n,o){for(let e of o)if(n.isKeyDown(e))return true;return false}function so(n,o){for(let e of o)if(!n.isKeyDown(e))return false;return true}function lo(n,o){for(let e of o)if(n.isKeyPressed(e))return true;return false}function uo(n){let o=0,e=0;return (n.isKeyDown("a")||n.isKeyDown("left"))&&(o-=1),(n.isKeyDown("d")||n.isKeyDown("right"))&&(o+=1),(n.isKeyDown("w")||n.isKeyDown("up"))&&(e-=1),(n.isKeyDown("s")||n.isKeyDown("down"))&&(e+=1),{x:o,y:e}}export{qn as $,Bn as A,kn as B,Cn as C,Tn as D,jt as E,Mn as F,An as G,Pn as H,Rt as I,Lt as J,On as K,jn as L,Ut as M,Ln as N,Wn as O,Ht as P,Vt as Q,Nn as R,zn as S,Un as T,Hn as U,Vn as V,Yn as W,_n as X,Xn as Y,Gn as Z,Jn as _,dt as a,wn as aa,pt as b,$n as ba,ct as c,Qn as ca,mt as d,Zn as da,gt as e,it as ea,bt as f,eo as fa,yt as g,to as ga,vt as h,no as ha,ht as i,oo as ia,Et as j,ao as ja,St as k,ro as ka,xt as l,so as la,Bt as m,lo as ma,kt as n,uo as na,Ct as o,pn as p,cn as q,mn as r,gn as s,bn as t,yn as u,vn as v,hn as w,En as x,Sn as y,xn as z};
|
package/dist/chunk-6N6BRCEM.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import {f as f$2,e as e$1}from'./chunk-AEJIX2MW.js';import {e,f as f$4,k as k$2,c,b as b$1}from'./chunk-C5PCEQ6G.js';import {f as f$3,e as e$2,g as g$1,j}from'./chunk-TYMY2TBR.js';import {b,k as k$1,d as d$1,f as f$1}from'./chunk-KFAK4A3G.js';import {a as a$1}from'./chunk-EAY7B5GL.js';import {g}from'./chunk-W5OU7Z6J.js';import {q as q$1,p as p$1}from'./chunk-Z4EZERNE.js';import {z as z$1}from'zod';var gt="> ",pt=" ",dt=4294967295,yt=6750207,ht=3435973887,xt=255,Ct=1717987071,S=1e4,i={isList:new Uint8Array(S),selectedIndex:new Int32Array(S).fill(-1),itemCount:new Uint32Array(S),firstVisible:new Uint32Array(S),visibleCount:new Uint32Array(S),interactive:new Uint8Array(S),mouse:new Uint8Array(S),keys:new Uint8Array(S),searchEnabled:new Uint8Array(S),totalCount:new Uint32Array(S),isLoading:new Uint8Array(S)},p=a$1({iterable:true}),P=new Map,H=new Map,J=new Map,Vt="Loading...",V=new Map,k=new Map,D=new Map,I=new Map,M=new Map,Pt={initial:"idle",states:{idle:{on:{focus:"focused",disable:"disabled"}},focused:{on:{blur:"idle",startSelect:"selecting",startSearch:"searching",disable:"disabled"}},selecting:{on:{endSelect:"focused",blur:"idle",disable:"disabled"}},searching:{on:{endSearch:"focused",blur:"idle",disable:"disabled"}},disabled:{on:{enable:"idle"}}}};function nn(e,t,n=[],r={}){z$1.array(q$1).parse(n),p$1.parse(r),i.isList[t]=1,i.selectedIndex[t]=r.selectedIndex??-1,i.itemCount[t]=n.length,i.firstVisible[t]=0,i.visibleCount[t]=r.visibleCount??n.length,i.interactive[t]=r.interactive!==false?1:0,i.mouse[t]=r.mouse!==false?1:0,i.keys[t]=r.keys!==false?1:0,i.searchEnabled[t]=r.search===true?1:0,p.set(t,[...n]),b(e,t,Pt);}function G(e,t){return i.isList[t]===1&&k$1(e,t)}function Et(e,t){return d$1(e,t)??"idle"}function St(e,t,n){return Et(e,t)===n}function rn(e,t){let n=Et(e,t);return n==="focused"||n==="selecting"}function Yt(e,t){return St(e,t,"disabled")}function U(e,t,n){if(!G(e,t))return false;let r=f$1(e,t,n);return r&&g(e,t),r}function on(e,t){return U(e,t,"focus")}function ln(e,t){return U(e,t,"blur")}function sn(e,t){return U(e,t,"disable")}function an(e,t){return U(e,t,"enable")}function cn(e){return p.get(e)??[]}function un(e,t,n){p.set(t,[...n]),i.itemCount[t]=n.length,(i.selectedIndex[t]??-1)>=n.length&&(i.selectedIndex[t]=n.length>0?n.length-1:-1),(i.firstVisible[t]??0)>=n.length&&(i.firstVisible[t]=Math.max(0,n.length-1)),g(e,t);}function fn(e,t,n,r){let o=p.get(t)??[],l=r??o.length;o.splice(l,0,n),p.set(t,o),i.itemCount[t]=o.length;let s=i.selectedIndex[t]??-1;s>=0&&l<=s&&(i.selectedIndex[t]=s+1),g(e,t);}function bn(e,t,n){let r=p.get(t)??[];if(n<0||n>=r.length)return;let o=r.splice(n,1)[0];i.itemCount[t]=r.length;let l=i.selectedIndex[t]??-1;return l>=0&&(n<l?i.selectedIndex[t]=l-1:n===l&&(i.selectedIndex[t]=r.length>0?Math.min(n,r.length-1):-1)),g(e,t),o}function w(e,t){return p.get(e)?.[t]}function mn(e,t,n,r){let o=p.get(t);return !o||n<0||n>=o.length?false:(o[n]=r,g(e,t),true)}function gn(e){return i.itemCount[e]??0}function pn(e,t){p.set(t,[]),i.itemCount[t]=0,i.selectedIndex[t]=-1,i.firstVisible[t]=0,g(e,t);}function dn(e){return i.selectedIndex[e]??-1}function yn(e){let t=i.selectedIndex[e]??-1;if(!(t<0))return w(e,t)}function Nt(e,t,n){return t<-1||t>=n?false:t<0?true:!w(e,t)?.disabled}function Ot(e,t){if(t<0)return;let n=w(e,t);if(!n)return;let r=k.get(e);if(r)for(let o of r)o(t,n);}function L(e,t,n){let r=i.itemCount[t]??0,o=i.selectedIndex[t]??-1;return !Nt(t,n,r)||o===n?false:(i.selectedIndex[t]=n,g(e,t),Ot(t,n),Ht(e,t,n),true)}function hn(e,t,n=true){let r=i.itemCount[t]??0;if(r===0)return false;let o=i.selectedIndex[t]??-1,l=o;do{if(o--,o<0)if(n)o=r-1;else return false;if(!w(t,o)?.disabled)return L(e,t,o)}while(o!==l);return false}function xn(e,t,n=true){let r=i.itemCount[t]??0;if(r===0)return false;let o=i.selectedIndex[t]??-1,l=o;do{if(o++,o>=r)if(n)o=0;else return false;if(!w(t,o)?.disabled)return L(e,t,o)}while(o!==l);return false}function Cn(e,t){let n=i.itemCount[t]??0;for(let r=0;r<n;r++)if(!w(t,r)?.disabled)return L(e,t,r);return false}function En(e,t){let n=i.itemCount[t]??0;for(let r=n-1;r>=0;r--)if(!w(t,r)?.disabled)return L(e,t,r);return false}function Sn(e,t,n){let o=(p.get(t)??[]).findIndex(l=>l.value===n);return o>=0?L(e,t,o):false}function vn(e,t){L(e,t,-1);}function Ln(e,t){let n=i.selectedIndex[t]??-1;if(n<0)return false;let r=w(t,n);if(!r||r.disabled)return false;let o=D.get(t);if(o)for(let l of o)l(n,r);return true}function Tn(e){return i.firstVisible[e]??0}function Z(e,t,n){let r=i.itemCount[t]??0,o=i.totalCount[t]??r,l=Math.max(0,Math.max(r,o)-1),s=Math.max(0,Math.min(n,l));i.firstVisible[t]=s,g(e,t),Kt(t);}function An(e){return i.visibleCount[e]??0}function In(e,t,n){i.visibleCount[t]=Math.max(1,n),g(e,t);}function Ht(e,t,n){if(n<0)return;let r=i.firstVisible[t]??0,o=i.visibleCount[t]??0,l=r+o-1;n<r?Z(e,t,n):n>l&&Z(e,t,n-o+1);}function wn(e,t,n){let r=i.firstVisible[t]??0,o=i.visibleCount[t]??0,l=i.itemCount[t]??0,s=r+n*o;if(s<0||s>=l)return false;Z(e,t,s);let c=i.selectedIndex[t]??-1;if(c>=0){let b=c+n*o;L(e,t,Math.max(0,Math.min(b,l-1)));}return true}function Gt(e){let t=p.get(e)??[],n=i.firstVisible[e]??0,r=i.visibleCount[e]??t.length,o=[];for(let l=0;l<r&&n+l<t.length;l++){let s=n+l,c=t[s];c&&o.push({index:s,item:c});}return o}function Bn(e,t,n){i.totalCount[t]=n,g(e,t);}function zt(e){let t=i.totalCount[e]??0;return t===0?i.itemCount[e]??0:t}function Wn(e,t){P.set(e,t);}function Fn(e){return P.get(e)}function kn(e){P.delete(e);}function Dn(e,t){let n=H.get(e);return n||(n=new Set,H.set(e,n)),n.add(t),()=>{n?.delete(t);}}function Kt(e,t){let n=H.get(e);if(!n||n.size===0)return;let r=i.firstVisible[e]??0,o=i.visibleCount[e]??0,l=i.itemCount[e]??0,s=i.totalCount[e]??l,c=o,b={firstVisible:r,visibleCount:o,loadedCount:l,totalCount:s,nearEnd:r+o>=l-c,nearStart:r<=c};for(let g of n)g(b);}function mt(e,t,n){i.isLoading[t]=n?1:0,g(e,t);}function Mn(e){return i.isLoading[e]===1}function Un(e,t){J.set(e,t);}function Rn(e){return J.get(e)??Vt}async function _n(e,t,n,r){let o=P.get(t);if(o&&i.isLoading[t]!==1){mt(e,t,true);try{let l=await o(n,r),s=p.get(t)??[];for(;s.length<n+l.length;)s.push({text:"",disabled:!0});for(let c=0;c<l.length;c++){let b=l[c];b&&(s[n+c]=b);}p.set(t,s),i.itemCount[t]=s.length,g(e,t);}finally{mt(e,t,false);}}}function Xn(e){let t=i.firstVisible[e]??0,n=i.visibleCount[e]??0,r=i.totalCount[e]??0,o=p.get(e)??[],l=Math.min(t+n,r);for(let s=t;s<l;s++){let c=o[s];if(!c||c.text==="")return {needsLoad:true,startIndex:t,count:n}}return {needsLoad:false,startIndex:0,count:0}}function Vn(e,t){let n=i.firstVisible[e]??0,r=i.visibleCount[e]??0,o=i.itemCount[e]??0,l=zt(e),s=t??r;return {firstVisible:n,visibleCount:r,loadedCount:o,totalCount:l,nearEnd:n+r>=o-s,nearStart:n<=s}}function Pn(e,t,n){let r=p.get(t)??[];r.push(...n),p.set(t,r),i.itemCount[t]=r.length,g(e,t);}function Yn(e,t){let n=V.get(e);V.set(e,{selectedPrefix:t.selectedPrefix??n?.selectedPrefix??gt,unselectedPrefix:t.unselectedPrefix??n?.unselectedPrefix??pt,selectedFg:t.selectedFg??n?.selectedFg??dt,selectedBg:t.selectedBg??n?.selectedBg??yt,itemFg:t.itemFg??n?.itemFg??ht,itemBg:t.itemBg??n?.itemBg??xt,disabledFg:t.disabledFg??n?.disabledFg??Ct});}function Qt(e){return V.get(e)??{selectedPrefix:gt,unselectedPrefix:pt,selectedFg:dt,selectedBg:yt,itemFg:ht,itemBg:xt,disabledFg:Ct}}function Nn(e){V.delete(e);}function On(e){return i.interactive[e]===1}function Hn(e,t,n){i.interactive[t]=n?1:0,g(e,t);}function Gn(e){return i.mouse[e]===1}function zn(e,t,n){i.mouse[t]=n?1:0,g(e,t);}function jt(e){return i.keys[e]===1}function Kn(e,t,n){i.keys[t]=n?1:0,g(e,t);}function $t(e){return i.searchEnabled[e]===1}function Qn(e,t,n){i.searchEnabled[t]=n?1:0,g(e,t);}function Zt(e,t){return St(e,t,"searching")}function jn(e,t){if(!G(e,t)||!$t(t))return false;let n=U(e,t,"startSearch");return n&&I.set(t,""),n}function $n(e,t){if(!G(e,t))return false;let n=U(e,t,"endSearch");return n&&I.delete(t),n}function Zn(e){return I.get(e)??""}function q(e,t,n){I.set(t,n),g(e,t);let r=M.get(t);if(r)for(let o of r)o(n);return n.length>0?Jt(e,t,n):false}function Jn(e,t,n){let r=I.get(t)??"";return q(e,t,r+n)}function qn(e,t){let n=I.get(t)??"";return n.length===0?false:q(e,t,n.slice(0,-1))}function tr(e,t){q(e,t,"");}function Jt(e,t,n){let r=p.get(t)??[],o=n.toLowerCase();for(let l=0;l<r.length;l++){let s=r[l];if(s&&!s.disabled&&s.text.toLowerCase().startsWith(o))return L(e,t,l)}return false}function er(e,t){let n=I.get(t);if(!n||n.length===0)return false;let r=p.get(t)??[],o=i.selectedIndex[t]??-1,l=n.toLowerCase();for(let s=o+1;s<r.length;s++){let c=r[s];if(c&&!c.disabled&&c.text.toLowerCase().startsWith(l))return L(e,t,s)}for(let s=0;s<=o;s++){let c=r[s];if(c&&!c.disabled&&c.text.toLowerCase().startsWith(l))return L(e,t,s)}return false}function nr(e,t){let n=M.get(e)??[];return n.push(t),M.set(e,n),()=>{let r=M.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1);}}}function rr(e,t){let n=k.get(e)??[];return n.push(t),k.set(e,n),()=>{let r=k.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1);}}}function or(e,t){let n=D.get(e)??[];return n.push(t),D.set(e,n),()=>{let r=D.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1);}}}function lr(e){k.delete(e),D.delete(e),M.delete(e);}function sr(e,t,n){if(!G(e,t)||Yt(e,t)||!jt(t))return null;if(Zt(e,t))return qt(n);switch(n){case "up":case "k":return {type:"selectPrev"};case "down":case "j":return {type:"selectNext"};case "home":case "g":return {type:"selectFirst"};case "end":case "G":return {type:"selectLast"};case "pageup":return {type:"pageUp"};case "pagedown":return {type:"pageDown"};case "enter":case "space":return {type:"confirm"};case "escape":return {type:"cancel"};case "/":return {type:"startSearch"};default:return null}}function qt(e){switch(e){case "escape":return {type:"endSearch"};case "enter":return {type:"endSearch"};case "backspace":return {type:"searchBackspace"};case "up":case "down":return {type:"endSearch"};case "tab":case "C-n":return {type:"searchNextMatch"};default:return e.length===1&&e>=" "?{type:"searchChar",char:e}:null}}function ar(e,t){let n=Qt(e),r=Gt(e),o=i.selectedIndex[e]??-1,l=[];for(let{index:s,item:c}of r){let g=s===o?n.selectedPrefix:n.unselectedPrefix,y=c.text,C=t-g.length,E=y.length>C?`${y.slice(0,C-1)}\u2026`:y;l.push(g+E);}return l}function ir(){i.isList.fill(0),i.selectedIndex.fill(-1),i.itemCount.fill(0),i.firstVisible.fill(0),i.visibleCount.fill(0),i.interactive.fill(0),i.mouse.fill(0),i.keys.fill(0),i.searchEnabled.fill(0),i.totalCount.fill(0),i.isLoading.fill(0),p.clear(),V.clear(),k.clear(),D.clear(),I.clear(),M.clear(),P.clear(),H.clear(),J.clear();}var te=["|","/","-","\\"],ur=[". ",".. ","..."," .."," ."," "],fr=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],br=["\u2596","\u2598","\u259D","\u2597"],mr=100,m={frame:new Uint8Array(1e4),frameCount:new Uint8Array(1e4),interval:new Uint16Array(1e4),elapsed:new Float32Array(1e4)},R=new Map,Y=new Set;function gr(e,t,n={}){let r=n.frames??te,o=n.interval??100;m.frame[t]=0,m.frameCount[t]=r.length,m.interval[t]=o,m.elapsed[t]=0,R.set(t,r),Y.add(t);}function pr(e,t){Y.has(t)&&(m.frame[t]=0,m.frameCount[t]=0,m.interval[t]=0,m.elapsed[t]=0,R.delete(t),Y.delete(t));}function dr(e,t){return Y.has(t)}function yr(e){let t=R.get(e);if(!t)return "";let n=m.frame[e]??0;return t[n%t.length]??""}function hr(e){let t=R.get(e);return t?{frame:m.frame[e]??0,frameCount:m.frameCount[e]??0,interval:m.interval[e]??100,elapsed:m.elapsed[e]??0,frames:t}:null}function xr(e,t){m.interval[e]=t;}function Cr(e,t){R.set(e,t),m.frameCount[e]=t.length,(m.frame[e]??0)>=t.length&&(m.frame[e]=0);}function ee(e){let t=m.frameCount[e]??1,n=((m.frame[e]??0)+1)%t;return m.frame[e]=n,n}function Er(e,t){let n=(m.elapsed[e]??0)+t,r=m.interval[e]??100;return n>=r?(ee(e),m.elapsed[e]=n%r,true):(m.elapsed[e]=n,false)}function Sr(e){m.frame[e]=0,m.elapsed[e]=0;}function vr(){R.clear(),Y.clear();}var vt=4294967295,Lt=858993663,Tt=3435973887,At=255,It=1717987071,wt=255,v=1e4,T={rowCount:new Uint32Array(v),colCount:new Uint16Array(v),headerRows:new Uint8Array(v).fill(1),pad:new Uint8Array(v).fill(1),cellBorders:new Uint8Array(v)},f={isTable:new Uint8Array(v),rowCount:new Uint32Array(v),colCount:new Uint16Array(v),headerRows:new Uint8Array(v).fill(1),pad:new Uint8Array(v).fill(1),cellBorders:new Uint8Array(v)},d=new Map,X=new Map,_=new Map;function Ar(e,t,n={}){f.isTable[t]=1,f.rowCount[t]=0,f.colCount[t]=0,f.headerRows[t]=n.headerRows??1,f.pad[t]=n.pad??1,f.cellBorders[t]=n.cellBorders===true?1:0,T.rowCount[t]=0,T.colCount[t]=0,T.headerRows[t]=n.headerRows??1,T.pad[t]=n.pad??1,T.cellBorders[t]=n.cellBorders===true?1:0,d.set(t,[]),X.set(t,[]);}function Ir(e,t){return f.isTable[t]===1}function wr(e,t){f.isTable[t]=0,f.rowCount[t]=0,f.colCount[t]=0,f.headerRows[t]=1,f.pad[t]=1,f.cellBorders[t]=0,T.rowCount[t]=0,T.colCount[t]=0,T.headerRows[t]=1,T.pad[t]=1,T.cellBorders[t]=0,d.delete(t),X.delete(t),_.delete(t);}function Br(e,t,n){let r=n.map(o=>o.map(l=>typeof l=="string"?{value:l}:l));d.set(t,r),f.rowCount[t]=r.length,f.colCount[t]=r.reduce((o,l)=>Math.max(o,l.length),0),g(e,t);}function Wr(e){return d.get(e)??[]}function Fr(e){return (d.get(e)??[]).map(n=>n.map(r=>r.value))}function kr(e,t,n,r,o){let l=d.get(t);if(!l||n<0||r<0)return false;for(;l.length<=n;)l.push([]);let s=l[n];if(!s)return false;for(;s.length<=r;)s.push({value:""});s[r]=typeof o=="string"?{value:o}:o;let c=l.reduce((b,g)=>Math.max(b,g.length),0);return f.colCount[t]=c,f.rowCount[t]=l.length,g(e,t),true}function ne(e,t,n){let r=d.get(e);if(!(!r||t<0||n<0))return r[t]?.[n]}function Dr(e,t,n){return ne(e,t,n)?.value}function Mr(e,t){return d.get(e)?.[t]}function Ur(e,t){return (d.get(e)??[]).map(r=>r[t]??{value:""})}function Rr(e){return f.rowCount[e]??0}function _r(e){return f.colCount[e]??0}function Xr(e,t,n){let r=d.get(t)??[],o=n.map(l=>typeof l=="string"?{value:l}:l);r.push(o),f.rowCount[t]=r.length,f.colCount[t]=Math.max(f.colCount[t]??0,o.length),g(e,t);}function Vr(e,t,n,r){let o=d.get(t)??[],l=r.map(c=>typeof c=="string"?{value:c}:c),s=Math.max(0,Math.min(n,o.length));o.splice(s,0,l),f.rowCount[t]=o.length,f.colCount[t]=Math.max(f.colCount[t]??0,l.length),g(e,t);}function Pr(e,t,n){let r=d.get(t);if(!r||n<0||n>=r.length)return;let o=r.splice(n,1)[0];return f.rowCount[t]=r.length,f.colCount[t]=r.reduce((l,s)=>Math.max(l,s.length),0),g(e,t),o}function Yr(e,t){d.set(t,[]),f.rowCount[t]=0,f.colCount[t]=0,g(e,t);}function Nr(e,t,n){X.set(t,[...n]);let r=d.get(t)??[];if((f.headerRows[t]??1)>0){let l=n.map(s=>({value:s.header,align:s.align??"left"}));r.length===0?r.unshift(l):r[0]=l,f.rowCount[t]=r.length,f.colCount[t]=n.length;}g(e,t);}function Or(e){return X.get(e)??[]}function Hr(e){let t=d.get(e)??[],n=f.headerRows[e]??1;return t.slice(0,n)}function Gr(e){let t=d.get(e)??[],n=f.headerRows[e]??1;return t.slice(n)}function zr(e,t,n){f.headerRows[t]=Math.max(0,Math.min(255,n)),g(e,t);}function Kr(e){return f.headerRows[e]??1}function Qr(e,t){let n=_.get(e),r=t.altRowBg??n?.altRowBg,o=t.selectedFg??n?.selectedFg,l=t.selectedBg??n?.selectedBg,s={headerFg:t.headerFg??n?.headerFg??vt,headerBg:t.headerBg??n?.headerBg??Lt,cellFg:t.cellFg??n?.cellFg??Tt,cellBg:t.cellBg??n?.cellBg??At,borderFg:t.borderFg??n?.borderFg??It,borderBg:t.borderBg??n?.borderBg??wt,...r!==void 0&&{altRowBg:r},...o!==void 0&&{selectedFg:o},...l!==void 0&&{selectedBg:l}};_.set(e,s);}function jr(e){return _.get(e)??{headerFg:vt,headerBg:Lt,cellFg:Tt,cellBg:At,borderFg:It,borderBg:wt}}function $r(e){_.delete(e);}function Zr(e){return f.pad[e]??1}function Jr(e,t,n){f.pad[t]=Math.max(0,Math.min(255,n)),g(e,t);}function qr(e){return f.cellBorders[e]===1}function to(e,t,n){f.cellBorders[t]=n?1:0,g(e,t);}function re(e,t,n){let r=new Array(t).fill(0);for(let o of e)for(let l=0;l<o.length;l++){let s=o[l];s&&(r[l]=Math.max(r[l]??0,s.value.length+n*2));}return r}function oe(e,t){for(let n=0;n<t.length;n++){let r=t[n];r&&(r.width!==void 0?e[n]=r.width:(r.minWidth!==void 0&&(e[n]=Math.max(e[n]??0,r.minWidth)),r.maxWidth!==void 0&&(e[n]=Math.min(e[n]??0,r.maxWidth))));}}function le(e,t){let n=e.reduce((r,o)=>r+o,0);if(n>t){let r=t/n;for(let o=0;o<e.length;o++)e[o]=Math.floor((e[o]??0)*r);}}function se(e,t){let n=d.get(e)??[],r=X.get(e)??[],o=f.colCount[e]??0,l=f.pad[e]??1,s=re(n,o,l);return oe(s,r),t!==void 0&&le(s,t),s}function ae(e,t,n){if(n==="right")return e.padStart(t);if(n==="center"){let r=Math.floor((t-e.length)/2);return e.padStart(r+e.length).padEnd(t)}return e.padEnd(t)}function ie(e,t,n,r){let o=t-n*2,l=e.value;l.length>o&&(l=`${l.slice(0,o-1)}\u2026`);let s=ae(l,o,e.align??"left");return r+s+r}function ce(e,t,n,r){let o=" ".repeat(n),l=r?"\u2502":"",s="";for(let c=0;c<t.length;c++){let b=e[c]??{value:""};c>0&&r&&(s+=l),s+=ie(b,t[c]??0,n,o);}return s}function eo(e,t){let n=d.get(e)??[],r=se(e,t),o=f.pad[e]??1,l=f.cellBorders[e]===1,s=f.headerRows[e]??1,c=[];for(let b=0;b<n.length;b++)c.push(ce(n[b]??[],r,o,l)),l&&b===s-1&&b<n.length-1&&c.push(r.map(g=>"\u2500".repeat(g)).join("\u253C"));return c}function no(){f.isTable.fill(0),f.rowCount.fill(0),f.colCount.fill(0),f.headerRows.fill(1),f.pad.fill(1),f.cellBorders.fill(0),d.clear(),X.clear(),_.clear();}var B=1e4,ue=80,fe=24,be=1e3,a={isTerminal:new Uint8Array(B),width:new Uint16Array(B),height:new Uint16Array(B),cursorX:new Uint16Array(B),cursorY:new Uint16Array(B),cursorVisible:new Uint8Array(B),scrollOffset:new Uint32Array(B),altScreenActive:new Uint8Array(B)},x=new Map,me=z$1.object({width:z$1.number().int().positive().default(ue),height:z$1.number().int().positive().default(fe),scrollbackLines:z$1.number().int().nonnegative().default(be),cursorVisible:z$1.boolean().default(true),cursorShape:z$1.enum(["block","underline","bar"]).default("block"),cursorBlink:z$1.boolean().default(true)});function ge(e,t,n,r,o){let l={maxLines:n,chunkSize:Math.min(n,1e3)};return {buffer:k$2(e,t),scrollback:e$2(l),currentAttr:e$1(),escapeBuffer:"",inEscape:false,savedCursorX:0,savedCursorY:0,savedAttr:e$1(),altBuffer:null,cursorShape:r,cursorBlink:o}}function pe(e,t,n){return n*e+t}function de(e){let t=b$1,n=c,r=[255,2852126975,11141375,2863268095,43775,2852170495,11184895,2863311615,1431655935,4283782655,1442797055,4294923775,1431699455,4283826175,1442840575,4294967295];return e.fg.type===1?t=r[e.fg.value]??b$1:e.fg.type===3&&(t=e.fg.value<<8|255),e.bg.type===1?n=r[e.bg.value]??c:e.bg.type===3&&(n=e.bg.value<<8|255),{fg:t,bg:n,attrs:e.styles}}function et(e$1,t,n){let r=ye(e$1.buffer,0,t);g$1(e$1.scrollback,r);for(let l=0;l<n-1;l++)for(let s=0;s<t;s++){let c=(l+1)*t+s,b=l*t+s,g=e$1.buffer.cells[c];g&&(e$1.buffer.cells[b]=f$4(g));}let o=e();for(let l=0;l<t;l++){let s=(n-1)*t+l;e$1.buffer.cells[s]=f$4(o);}}function ye(e,t,n){let r="";for(let o=0;o<n;o++){let l=t*n+o,s=e.cells[l];r+=s?.char??" ";}return r.trimEnd()}function co(e,t,n={}){let r=me.parse(n);a.isTerminal[t]=1,a.width[t]=r.width,a.height[t]=r.height,a.cursorX[t]=0,a.cursorY[t]=0,a.cursorVisible[t]=r.cursorVisible?1:0,a.scrollOffset[t]=0,a.altScreenActive[t]=0;let o=ge(r.width,r.height,r.scrollbackLines,r.cursorShape,r.cursorBlink);x.set(t,o),g(e,t);}function he(e){return a.isTerminal[e]===1}function uo(e){return x.get(e)}function fo(e){if(he(e))return {width:a.width[e]??0,height:a.height[e]??0,cursorX:a.cursorX[e]??0,cursorY:a.cursorY[e]??0,cursorVisible:a.cursorVisible[e]===1,scrollOffset:a.scrollOffset[e]??0}}function xe(e,t,n,r,o){let l=(a.cursorY[t]??0)+1;l>=o&&(et(n,r,o),l=o-1),a.cursorX[t]=0,a.cursorY[t]=l,g(e,t);}function Ce(e,t,n){let r=a.cursorX[t]??0,o=Math.min((Math.floor(r/8)+1)*8,n-1);a.cursorX[t]=o,g(e,t);}function Ee(e$1,t,n,r,o,l){let s=a.cursorX[t]??0,c=a.cursorY[t]??0,{fg:b,bg:g$1,attrs:y}=de(n.currentAttr),C=pe(o,s,c);n.buffer.cells[C]=e(r,b,g$1,y);let E=s+1;E>=o&&(E=0,c++,c>=l&&(et(n,o,l),c=l-1)),a.cursorX[t]=E,a.cursorY[t]=c,g(e$1,t);}function Se(e,t,n){let r=x.get(t);if(!r)return;let o=a.width[t]??0,l=a.height[t]??0;if(n===`
|
|
2
|
-
`){xe(e,t,r,o,l);return}if(n==="\r"){a.cursorX[t]=0,g(e,t);return}if(n==="\b"){let s=a.cursorX[t]??0;s>0&&(a.cursorX[t]=s-1),g(e,t);return}if(n===" "){Ce(e,t,o);return}Ee(e,t,r,n,o,l);}function bo(e,t,n){let r=x.get(t);if(r)for(let o=0;o<n.length;o++){let l=n[o];if(l!==void 0){if(l==="\x1B"){r.inEscape=true,r.escapeBuffer=l;continue}if(r.inEscape){r.escapeBuffer+=l,ve(r.escapeBuffer)&&(Le(e,t,r,r.escapeBuffer),r.inEscape=false,r.escapeBuffer="");continue}Se(e,t,l);}}}function ve(e){if(e.length<2)return false;if(e[1]==="["){let t=e[e.length-1];return t===void 0?false:/[A-Za-z@`~]/.test(t)}return e[1]==="]"?e.endsWith("\x07")||e.endsWith("\x1B\\"):e.length>=2}function Le(e,t,n,r){if(r.length<2)return;let o=r[1];if(o==="["){Te(e,t,n,r);return}switch(o){case "c":Qe(e,t);break;case "7":n.savedCursorX=a.cursorX[t]??0,n.savedCursorY=a.cursorY[t]??0,n.savedAttr=f$2(n.currentAttr);break;case "8":a.cursorX[t]=n.savedCursorX,a.cursorY[t]=n.savedCursorY,n.currentAttr=f$2(n.savedAttr),g(e,t);break;case "D":z(e,t,n,1);break;case "M":tt(e,t,1);break;case "E":a.cursorX[t]=0,z(e,t,n,1);break}}function Te(e,t,n,r){let o=r.match(/^\x1b\[(\??[\d;]*)([A-Za-z@`~])$/);if(!o)return;let l=o[1]??"",s=o[2],c=l===""?[]:l.split(";").map(E=>parseInt(E,10)||0),b=c[0]??1,g$1=c[1]??1,y=a.width[t]??0,C=a.height[t]??0;switch(s){case "A":tt(e,t,b);break;case "B":z(e,t,n,b);break;case "C":Be(e,t,b,y);break;case "D":We(e,t,b);break;case "E":a.cursorX[t]=0,z(e,t,n,b);break;case "F":a.cursorX[t]=0,tt(e,t,b);break;case "G":a.cursorX[t]=Math.min(Math.max(b-1,0),y-1),g(e,t);break;case "H":case "f":a.cursorY[t]=Math.min(Math.max(b-1,0),C-1),a.cursorX[t]=Math.min(Math.max(g$1-1,0),y-1),g(e,t);break;case "J":De(e,t,n,c[0]??0);break;case "K":Me(e,t,n,c[0]??0);break;case "m":ze(n,c.length===0?[0]:c);break;case "h":Bt(e,t,n,l,true);break;case "l":Bt(e,t,n,l,false);break;case "s":n.savedCursorX=a.cursorX[t]??0,n.savedCursorY=a.cursorY[t]??0;break;case "u":a.cursorX[t]=n.savedCursorX,a.cursorY[t]=n.savedCursorY,g(e,t);break}}function Ae(e,t,n){a.cursorVisible[t]=n?1:0,g(e,t);}function Ie(e,t,n,r){r?(n.savedCursorX=a.cursorX[t]??0,n.savedCursorY=a.cursorY[t]??0,Ft(e,t,n)):(kt(e,t,n),a.cursorX[t]=n.savedCursorX,a.cursorY[t]=n.savedCursorY),g(e,t);}function we(e,t,n,r,o){o?(Ft(e,t,n),r==="1047"&&Dt(n,0,n.buffer.cells.length)):kt(e,t,n),g(e,t);}function Bt(e,t,n,r,o){let l=r.startsWith("?")?r.slice(1):r;if(l==="25"){Ae(e,t,o);return}if(l==="1049"){Ie(e,t,n,o);return}if(l==="47"||l==="1047"){we(e,t,n,l,o);return}}function Ft(e$1,t,n){if(a.altScreenActive[t]===1)return;let r=a.width[t]??0,o=a.height[t]??0;n.altBuffer||(n.altBuffer=k$2(r,o));for(let s=0;s<n.buffer.cells.length&&s<n.altBuffer.cells.length;s++){let c=n.buffer.cells[s];c&&(n.altBuffer.cells[s]=f$4(c));}let l=e();for(let s=0;s<n.buffer.cells.length;s++)n.buffer.cells[s]=f$4(l);a.cursorX[t]=0,a.cursorY[t]=0,a.altScreenActive[t]=1;}function kt(e,t,n){if(a.altScreenActive[t]!==0){if(n.altBuffer)for(let r=0;r<n.altBuffer.cells.length&&r<n.buffer.cells.length;r++){let o=n.altBuffer.cells[r];o&&(n.buffer.cells[r]=f$4(o));}a.altScreenActive[t]=0;}}function tt(e,t,n){let r=a.cursorY[t]??0;a.cursorY[t]=Math.max(0,r-n),g(e,t);}function z(e,t,n,r){let o=a.width[t]??0,l=a.height[t]??0,s=a.cursorY[t]??0;for(s+=r;s>=l;)et(n,o,l),s--;a.cursorY[t]=s,g(e,t);}function Be(e,t,n,r){let o=a.cursorX[t]??0;a.cursorX[t]=Math.min(r-1,o+n),g(e,t);}function We(e,t,n){let r=a.cursorX[t]??0;a.cursorX[t]=Math.max(0,r-n),g(e,t);}function Dt(e$1,t,n){let r=e();for(let o=t;o<n;o++)e$1.buffer.cells[o]=f$4(r);}function Mt(e$1,t,n,r,o){let l=e();for(let s=r;s<=o;s++){let c=n*t+s;e$1.buffer.cells[c]=f$4(l);}}function Ut(e$1,t,n,r){let o=e();for(let l=n;l<r;l++)for(let s=0;s<t;s++){let c=l*t+s;e$1.buffer.cells[c]=f$4(o);}}function Fe(e,t,n,r,o){Mt(e,t,o,r,t-1),Ut(e,t,o+1,n);}function ke(e,t,n,r){Ut(e,t,0,r),Mt(e,t,r,0,n);}function De(e,t,n,r){let o=a.width[t]??0,l=a.height[t]??0,s=a.cursorX[t]??0,c=a.cursorY[t]??0;r===0?Fe(n,o,l,s,c):r===1?ke(n,o,s,c):(r===2||r===3)&&(Dt(n,0,n.buffer.cells.length),r===3&&f$3(n.scrollback)),g(e,t);}function Me(e$1,t,n,r){let o=a.width[t]??0,l=a.cursorX[t]??0,s=a.cursorY[t]??0,c=e();switch(r){case 0:for(let b=l;b<o;b++){let g=s*o+b;n.buffer.cells[g]=f$4(c);}break;case 1:for(let b=0;b<=l;b++){let g=s*o+b;n.buffer.cells[g]=f$4(c);}break;case 2:for(let b=0;b<o;b++){let g=s*o+b;n.buffer.cells[g]=f$4(c);}break}g(e$1,t);}function Ue(e){return e.currentAttr=e$1(),1}function Re(e,t,n){let r=t[n]??0;return e.currentAttr.styles|=1<<r-1,1}function _e(e,t,n){let r=t[n]??0;return e.currentAttr.styles&=~(1<<r-22+1),1}function Xe(e,t,n){let r=t[n]??0;return e.currentAttr.fg={type:1,value:r-30},1}function Ve(e){return e.currentAttr.fg={type:0,value:0},1}function Pe(e,t,n){let r=t[n]??0;return e.currentAttr.bg={type:1,value:r-40},1}function Ye(e){return e.currentAttr.bg={type:0,value:0},1}function Ne(e,t,n){let r=t[n]??0;return e.currentAttr.fg={type:1,value:r-90+8},1}function Oe(e,t,n){let r=t[n]??0;return e.currentAttr.bg={type:1,value:r-100+8},1}function He(e){return e===0?Ue:e>=1&&e<=9?Re:e>=22&&e<=29?_e:e>=30&&e<=37?Xe:e===39?Ve:e>=90&&e<=97?Ne:e>=40&&e<=47?Pe:e===49?Ye:e>=100&&e<=107?Oe:null}function Ge(e,t,n){let r=t[n]??0;if(r===38){let l=Wt(e,t,n,"fg");return l>0?l:1}if(r===48){let l=Wt(e,t,n,"bg");return l>0?l:1}let o=He(r);return o?o(e,t,n):1}function Wt(e,t,n,r){if(n+1>=t.length)return 0;let o=t[n+1];if(o===5&&n+2<t.length){let l=t[n+2]??0;return e.currentAttr[r]={type:2,value:l},3}if(o===2&&n+4<t.length){let l=t[n+2]??0,s=t[n+3]??0,c=t[n+4]??0;return e.currentAttr[r]={type:3,value:l<<16|s<<8|c},5}return 0}function ze(e,t){let n=0;for(;n<t.length;){let r=Ge(e,t,n);n+=r;}}function Ke(e$2,t){let n=x.get(t);if(!n)return;let r=e();for(let o=0;o<n.buffer.cells.length;o++)n.buffer.cells[o]=f$4(r);a.cursorX[t]=0,a.cursorY[t]=0,n.currentAttr=e$1(),g(e$2,t);}function Qe(e,t){let n=x.get(t);n&&(Ke(e,t),f$3(n.scrollback),n.escapeBuffer="",n.inEscape=false,n.savedCursorX=0,n.savedCursorY=0,n.savedAttr=e$1(),a.cursorVisible[t]=1,a.scrollOffset[t]=0,g(e,t));}function mo(e,t,n,r){let o=a.width[t]??0,l=a.height[t]??0;a.cursorX[t]=Math.min(Math.max(n,0),o-1),a.cursorY[t]=Math.min(Math.max(r,0),l-1),g(e,t);}function go(e,t,n){a.cursorVisible[t]=n?1:0,g(e,t);}function po(e,t,n){let r=x.get(t);if(!r)return;let o=a.scrollOffset[t]??0,l=r.scrollback.totalLines;a.scrollOffset[t]=Math.min(o+n,l),g(e,t);}function yo(e,t,n){let r=a.scrollOffset[t]??0;a.scrollOffset[t]=Math.max(0,r-n),g(e,t);}function ho(e,t){let n=x.get(t);n&&(a.scrollOffset[t]=n.scrollback.totalLines,g(e,t));}function xo(e,t){a.scrollOffset[t]=0,g(e,t);}function Co(e,t,n,r){let o=x.get(t);if(!o)return;let l=a.width[t]??0,s=a.height[t]??0,c=k$2(n,r),b=Math.min(l,n),g$1=Math.min(s,r);for(let E=0;E<g$1;E++)for(let N=0;N<b;N++){let Rt=E*l+N,_t=E*n+N,nt=o.buffer.cells[Rt];nt&&(c.cells[_t]=f$4(nt));}o.buffer=c,a.width[t]=n,a.height[t]=r;let y=a.cursorX[t]??0,C=a.cursorY[t]??0;a.cursorX[t]=Math.min(y,n-1),a.cursorY[t]=Math.min(C,r-1),g(e,t);}function Eo(e){a.isTerminal[e]=0,a.width[e]=0,a.height[e]=0,a.cursorX[e]=0,a.cursorY[e]=0,a.cursorVisible[e]=0,a.scrollOffset[e]=0,a.altScreenActive[e]=0,x.delete(e);}function je(e,t,n){let r=j(e.scrollback,e.scrollback.totalLines-n,e.scrollback.totalLines-n+t),o="";for(let l of r.lines)o+=l.ansi??l.text,o+=`
|
|
3
|
-
`;return o}function $e(e,t){let n="";return (e.fg!==t.fg||e.bg!==t.bg)&&(n+="\x1B[0m",t.fg=e.fg,t.bg=e.bg),n+=e.char,{output:n,fg:t.fg,bg:t.bg}}function So(e){let t=x.get(e);if(!t)return "";let n=a.width[e]??0,r=a.height[e]??0,o=a.scrollOffset[e]??0;if(o>0)return je(t,r,o);let l="",s={fg:-1,bg:-1};for(let c=0;c<r;c++){for(let b=0;b<n;b++){let g=c*n+b,y=t.buffer.cells[g];if(!y)continue;let C=$e(y,s);l+=C.output,s.fg=C.fg,s.bg=C.bg;}c<r-1&&(l+=`
|
|
4
|
-
`);}return l}function vo(e){return x.get(e)?.buffer.cells}function Lo(){a.isTerminal.fill(0),a.width.fill(0),a.height.fill(0),a.cursorX.fill(0),a.cursorY.fill(0),a.cursorVisible.fill(0),a.scrollOffset.fill(0),a.altScreenActive.fill(0),x.clear();}export{Un as $,At as $a,yo as $b,gn as A,nr as Aa,Kr as Ab,pn as B,rr as Ba,Qr as Bb,dn as C,or as Ca,jr as Cb,yn as D,lr as Da,$r as Db,L as E,sr as Ea,Zr as Eb,hn as F,ar as Fa,Jr as Fb,xn as G,ir as Ga,qr as Gb,Cn as H,te as Ha,to as Hb,En as I,ur as Ia,se as Ib,Sn as J,fr as Ja,eo as Jb,vn as K,br as Ka,no as Kb,Ln as L,mr as La,ue as Lb,Tn as M,m as Ma,fe as Mb,Z as N,gr as Na,be as Nb,An as O,pr as Oa,a as Ob,In as P,dr as Pa,me as Pb,Ht as Q,yr as Qa,co as Qb,wn as R,hr as Ra,he as Rb,Gt as S,xr as Sa,uo as Sb,Bn as T,Cr as Ta,fo as Tb,zt as U,ee as Ua,Se as Ub,Wn as V,Er as Va,bo as Vb,Fn as W,Sr as Wa,Ke as Wb,kn as X,vr as Xa,Qe as Xb,Dn as Y,vt as Ya,mo as Yb,mt as Z,Lt as Za,go as Zb,Mn as _,Tt as _a,po as _b,gt as a,Rn as aa,It as ab,ho as ac,pt as b,_n as ba,wt as bb,xo as bc,dt as c,Xn as ca,T as cb,Co as cc,yt as d,Vn as da,f as db,Eo as dc,ht as e,Pn as ea,Ar as eb,So as ec,xt as f,Yn as fa,Ir as fb,vo as fc,Ct as g,Qt as ga,wr as gb,Lo as gc,i as h,Nn as ha,Br as hb,Pt as i,On as ia,Wr as ib,nn as j,Hn as ja,Fr as jb,G as k,Gn as ka,kr as kb,Et as l,zn as la,ne as lb,St as m,jt as ma,Dr as mb,rn as n,Kn as na,Mr as nb,Yt as o,$t as oa,Ur as ob,U as p,Qn as pa,Rr as pb,on as q,Zt as qa,_r as qb,ln as r,jn as ra,Xr as rb,sn as s,$n as sa,Vr as sb,an as t,Zn as ta,Pr as tb,cn as u,q as ua,Yr as ub,un as v,Jn as va,Nr as vb,fn as w,qn as wa,Or as wb,bn as x,tr as xa,Hr as xb,w as y,Jt as ya,Gr as yb,mn as z,er as za,zr as zb};
|
package/dist/chunk-AXZQAH4X.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a={YYYY:t=>t.getFullYear().toString(),YY:t=>t.getFullYear().toString().slice(-2),MM:t=>(t.getMonth()+1).toString().padStart(2,"0"),DD:t=>t.getDate().toString().padStart(2,"0"),HH:t=>t.getHours().toString().padStart(2,"0"),hh:t=>{let e=t.getHours()%12;return (e===0?12:e).toString().padStart(2,"0")},mm:t=>t.getMinutes().toString().padStart(2,"0"),ss:t=>t.getSeconds().toString().padStart(2,"0"),SSS:t=>t.getMilliseconds().toString().padStart(3,"0"),SS:t=>Math.floor(t.getMilliseconds()/10).toString().padStart(2,"0"),AA:t=>t.getHours()<12?"AM":"PM",aa:t=>t.getHours()<12?"am":"pm"},o=new RegExp(Object.keys(a).sort((t,e)=>e.length-t.length).join("|"),"g");function g(t,e){return e.replace(o,r=>{let n=a[r];return n?n(t):r})}function i(t=new Date){return Math.floor(t.getTime()/1e3)}function s(t=new Date){return t.getTime()}export{g as a,i as b,s as c};
|
package/dist/chunk-BCADUCOZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {M as M$1,L as L$1,c}from'./chunk-W5OU7Z6J.js';import {a as a$1}from'./chunk-G7GIWWLE.js';import {n,h,i}from'./chunk-PXXGH3BV.js';n();var l=1e4,b={BLOCK:0,UNDERLINE:1,BAR:2,BLINKING_BLOCK:3,BLINKING_UNDERLINE:4,BLINKING_BAR:5},o={cursorX:new Uint16Array(l),cursorY:new Uint16Array(l),cursorVisible:new Uint8Array(l),cursorShape:new Uint8Array(l),focused:new Uint32Array(l),hovered:new Uint32Array(l),fullUnicode:new Uint8Array(l),autoPadding:new Uint8Array(l)},a=new WeakMap;function g(r,e,n={}){h(r,e,o),o.cursorX[e]=0,o.cursorY[e]=0,o.cursorVisible[e]=n.cursorVisible!==false?1:0,o.cursorShape[e]=n.cursorShape??b.BLOCK,o.focused[e]=a$1,o.hovered[e]=a$1,o.fullUnicode[e]=n.fullUnicode!==false?1:0,o.autoPadding[e]=n.autoPadding===true?1:0;}function W(r){return a.has(r)}function C(r,e){if(a.has(r))throw new Error("A screen already exists in this world. Only one screen is allowed.");a.set(r,e);}function U(r){return a.get(r)??null}function v(r,e){return a.get(r)===e}function t(r,e){return i(r,e,o)}function A(r,e){if(t(r,e))return {x:o.cursorX[e],y:o.cursorY[e],visible:o.cursorVisible[e]===1,shape:o.cursorShape[e]}}function V(r,e,n,s){return t(r,e)?(o.cursorX[e]=Math.max(0,Math.floor(n)),o.cursorY[e]=Math.max(0,Math.floor(s)),true):false}function w(r,e,n){return t(r,e)?(o.cursorVisible[e]=n?1:0,true):false}function N(r,e,n){return t(r,e)?(o.cursorShape[e]=n,true):false}function P(r,e){if(!t(r,e))return null;let n=o.focused[e];return n===a$1?null:n}function L(r,e,n){return t(r,e)?(o.focused[e]=n??a$1,true):false}function I(r,e){if(!t(r,e))return null;let n=o.hovered[e];return n===a$1?null:n}function B(r,e,n){return t(r,e)?(o.hovered[e]=n??a$1,true):false}function D(r,e){if(!t(r,e))return;let n=M$1(r,e),s=o.focused[e],c=o.hovered[e];return {cursor:{x:o.cursorX[e],y:o.cursorY[e],visible:o.cursorVisible[e]===1,shape:o.cursorShape[e]},focused:s===a$1?null:s,hovered:c===a$1?null:c,fullUnicode:o.fullUnicode[e]===1,autoPadding:o.autoPadding[e]===1,width:n?.width??0,height:n?.height??0}}function Y(r,e){if(!t(r,e))return;let n=M$1(r,e);if(n)return {width:n.width,height:n.height}}function K(r,e,n,s){return !t(r,e)||n<=0||s<=0?false:(L$1(r,e,n,s),c.dirty[e]=1,true)}function M(r,e){return t(r,e)?o.fullUnicode[e]===1:false}function O(r,e,n){return t(r,e)?(o.fullUnicode[e]=n?1:0,true):false}function F(r,e){return t(r,e)?o.autoPadding[e]===1:false}function R(r,e,n){return t(r,e)?(o.autoPadding[e]=n?1:0,true):false}function X(r){return a.get(r)===void 0?false:(a.delete(r),true)}function _(r){a.delete(r);}export{b as a,o as b,g as c,W as d,C as e,U as f,v as g,t as h,A as i,V as j,w as k,N as l,P as m,L as n,I as o,B as p,D as q,Y as r,K as s,M as t,O as u,F as v,R as w,X as x,_ as y};
|
package/dist/chunk-EJ5WVDDZ.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import {i as i$1}from'./chunk-CIK4AMUA.js';import {ha,A,Q,I}from'./chunk-JKVHO4LH.js';import {c as c$2,a as a$1,b as b$2}from'./chunk-OMMJ7B5P.js';import {c as c$1,i as i$4,j}from'./chunk-KD55INV7.js';import {a,k}from'./chunk-PSXXMBVJ.js';import {s,i,m as m$1}from'./chunk-LCN2ZITE.js';import {d,e}from'./chunk-FYEBZAWN.js';import {r,K,c,V,s as s$1,L as L$1,d as d$2,m,n as n$1,Y}from'./chunk-W5OU7Z6J.js';import {b as b$1}from'./chunk-SHUC6JWA.js';import {b,i as i$3,f}from'./chunk-G7GIWWLE.js';import {n,i as i$2,g,d as d$1,e as e$1}from'./chunk-PXXGH3BV.js';s();n();n();var Se={snapshotInterval:5e3,maxSnapshots:100,entityLeakThreshold:10,heapLeakThreshold:1024*1024,trackedComponents:[]};function xe(t){let e={...Se,...t},n=[],o=null;function r(s){let a=g(s),u={};for(let{component:C,name:R}of e.trackedComponents){let $=0;for(let M of a)i$2(s,M,C)&&$++;u[R]=$;}let l=process.memoryUsage(),f={timestamp:Date.now(),entityCount:a.length,componentCounts:u,heapUsed:l.heapUsed,heapTotal:l.heapTotal,rss:l.rss,external:l.external};for(n.push(f);n.length>e.maxSnapshots;)n.shift();return f}function m(s,a){let u={},l=new Set([...Object.keys(s.componentCounts),...Object.keys(a.componentCounts)]);for(let f of l)u[f]=(a.componentCounts[f]??0)-(s.componentCounts[f]??0);return u}function c(s,a,u,l){let f=s/a;return f<=e.entityLeakThreshold?null:{type:"entity",message:`Entity count growing at ${f.toFixed(1)}/sec (${u.entityCount} -> ${l.entityCount})`,growthRate:f}}function g$1(s,a){let u=s/a;return u<=e.heapLeakThreshold?null:{type:"heap",message:`Heap growing at ${(u/1024).toFixed(1)}KB/sec`,growthRate:u}}function b(s,a){let u=[];for(let[l,f]of Object.entries(s)){let C=f/a;C>e.entityLeakThreshold&&u.push({type:"component",message:`${l} component growing at ${C.toFixed(1)}/sec`,growthRate:C});}return u}function d(s,a){let u=a.timestamp-s.timestamp,l=u/1e3,f=a.entityCount-s.entityCount,C=a.heapUsed-s.heapUsed,R=a.rss-s.rss,$=m(s,a),M=[];if(l>0){let N=c(f,l,s,a);N&&M.push(N);let K=g$1(C,l);K&&M.push(K);let he=b($,l);M.push(...he);}return {elapsed:u,entityCountDelta:f,componentDeltas:$,heapUsedDelta:C,rssDelta:R,possibleLeaks:M}}function i(s){return Math.abs(s)<1024?`${s}B`:Math.abs(s)<1024*1024?`${(s/1024).toFixed(1)}KB`:`${(s/(1024*1024)).toFixed(1)}MB`}function p(s,a){s.push("Memory Profile Report"),s.push("\u2550".repeat(40)),s.push(`Entities: ${a.entityCount}`),s.push(`Heap Used: ${i(a.heapUsed)}`),s.push(`Heap Total: ${i(a.heapTotal)}`),s.push(`RSS: ${i(a.rss)}`),s.push(`External: ${i(a.external)}`);}function S(s,a){if(Object.keys(a.componentCounts).length!==0){s.push(""),s.push("Component Counts:");for(let[u,l]of Object.entries(a.componentCounts))s.push(` ${u}: ${l}`);}}function x(s,a){if(n.length<2)return;let u=n[0];if(!u)return;let l=d(u,a);if(s.push(""),s.push(`Trends (over ${(l.elapsed/1e3).toFixed(0)}s):`),s.push(` Entity delta: ${l.entityCountDelta>0?"+":""}${l.entityCountDelta}`),s.push(` Heap delta: ${l.heapUsedDelta>0?"+":""}${i(l.heapUsedDelta)}`),l.possibleLeaks.length>0){s.push(""),s.push("WARNINGS:");for(let f of l.possibleLeaks)s.push(` [${f.type}] ${f.message}`);}}return {snapshot(s){return r(s)},diff(s,a){return d(s,a)},getSnapshots(){return n},getLatestSnapshot(){return n.length>0?n[n.length-1]??null:null},getReport(s){let a=r(s),u=[];return p(u,a),S(u,a),x(u,a),u.join(`
|
|
2
|
-
`)},startAutoSnapshot(s){o===null&&(e.snapshotInterval<=0||(r(s),o=setInterval(()=>{r(s);},e.snapshotInterval)));},stopAutoSnapshot(){o!==null&&(clearInterval(o),o=null);},reset(){n.length=0,o!==null&&(clearInterval(o),o=null);}}}n();var Ce={x:0,y:0,width:35,toggleKey:"F12",showFPS:true,showEntityCount:true,showMemory:true,showSystemTimings:true,maxSystemsShown:5,bgColor:33023,fgColor:4294967295,visibleOnStart:false};function Me(t,e$2={}){let n={...Ce,...e$2},o=n.visibleOnStart,r=null;n.showSystemTimings&&!ye()&&ge(true);function m$1(){let i=d$1(t);return s$1(t,i,n.x,n.y,9999),L$1(t,i,n.width,10),d$2(t,i,{fg:n.fgColor,bg:n.bgColor}),m(t,i),e(t,i,"Loading..."),b$2(i,"name","__debug_overlay__"),i}function c(i,p){return `\u2502 FPS: \x1B[${i>=55?"32":i>=30?"33":"31"}m${i.toString().padStart(3)}\x1B[0m (${p.toFixed(1)}ms)`}function g(i){let p=H(),S=Object.entries(p).filter(([,s])=>s>0).sort(([,s],[,a])=>a-s).slice(0,i);if(S.length===0)return [];let x=["\u251C\u2500 Systems \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"];for(let[s,a]of S){let u=a.toFixed(2).padStart(6),l=s.length>20?`${s.slice(0,17)}...`:s;x.push(`\u2502 ${l.padEnd(20)} ${u}ms`);}return x}function b(i){let p=["\u250C\u2500 Debug \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"];return n.showFPS&&p.push(c(i.fps,i.frameTime)),n.showEntityCount&&p.push(`\u2502 Entities: ${i.entityCount}`),n.showMemory&&i.memoryUsageMB!==null&&p.push(`\u2502 Memory: ${i.memoryUsageMB.toFixed(1)}MB`),n.showSystemTimings&&p.push(...g(n.maxSystemsShown)),p.push(`\u2502 Frame: ${i.frameCount}`),p.push(`\u2502 Time: ${i.runningTime.toFixed(1)}s`),p.push("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),p.join(`
|
|
3
|
-
`)}let d={get visible(){return o},get entity(){return r},get config(){return n},show(){o=true,r||(r=m$1()),m(t,r);},hide(){o=false,r&&n$1(t,r);},toggle(){o?d.hide():d.show();},update(i,p){if(!o||!r)return;let S=de(i,p),x=b(S);e(i,r,x);let s=x.split(`
|
|
4
|
-
`).length;L$1(i,r,n.width,s);},destroy(){r&&(e$1(t,r),r=null),o=false;}};return o&&(r=m$1()),d}function Ee(t=20){let e=[];return {get entries(){return e},get maxEntries(){return t},log(n,o){for(e.push({type:n,detail:o,timestamp:Date.now()});e.length>t;)e.shift();},clear(){e.length=0;},getRecentEntries(n=5){return e.slice(-n)}}}function ve(){let t=new Map,e=new Map;return {start(n){t.set(n,performance.now());},end(n){let o=t.get(n);if(o===void 0)return 0;let r=performance.now()-o;t.delete(n);let m=e.get(n);return m?(m.total+=r,m.min=Math.min(m.min,r),m.max=Math.max(m.max,r),m.count++):e.set(n,{total:r,min:r,max:r,count:1}),r},getAverage(n){let o=e.get(n);return !o||o.count===0?0:o.total/o.count},getAll(){let n={};for(let[o,r]of e)n[o]={avg:r.count>0?r.total/r.count:0,min:r.min,max:r.max,count:r.count};return n},reset(){t.clear(),e.clear();}}}function Te(t=60){let e=[],n=0;return {addSample(o){for(e.push(o),n+=o;e.length>t;){let r=e.shift();r!==void 0&&(n-=r);}},getSamples(){return e},getCurrentFPS(){if(e.length===0)return 0;let o=e[e.length-1]??0;return o>0?1e3/o:0},getAverageFPS(){if(e.length===0)return 0;let o=n/e.length;return o>0?1e3/o:0},getMinMaxFPS(){if(e.length===0)return {min:0,max:0};let o=Number.MAX_VALUE,r=0;for(let m of e)o=Math.min(o,m),r=Math.max(r,m);return {min:r>0?1e3/r:0,max:o>0?1e3/o:0}},reset(){e.length=0,n=0;}}}var L=false,P=new Map,w=null,G=0,$e=100,_=[{component:r,name:"Position"},{component:K,name:"Dimensions"},{component:c,name:"Renderable"},{component:d,name:"Content"},{component:i,name:"Border"},{component:a,name:"Padding"},{component:b,name:"Hierarchy"},{component:c$1,name:"Interactive"},{component:V,name:"Focusable"},{component:k,name:"Scrollable"},{component:ha,name:"Velocity"},{component:A,name:"Animation"},{component:Q,name:"Collider"},{component:i$1,name:"Shadow"}];function De(t,e,n,o){if(!i$2(t,e,n))return null;let r={},m=n;for(let[c,g]of Object.entries(m))if(ArrayBuffer.isView(g)||Array.isArray(g)){let b=g;r[c]=b[e];}return {name:o,data:r}}function we(t,e){let n=[];for(let{component:c,name:g}of _){let b=De(t,e,c,g);b&&n.push(b);}let o=i$2(t,e,b)?i$3(t,e):null,r=i$2(t,e,b)?f(t,e):[],m=c$2(e,"name")?a$1(e,"name")??null:null;return {entity:e,name:m,components:n,parent:o===0?null:o,children:r}}function Pe(t){let e=[],n=t.name?` (${t.name})`:"";e.push(`Entity ${t.entity}${n}`),t.parent!==null&&e.push(`\u251C\u2500 Parent: ${t.parent}`),t.children.length>0&&e.push(`\u251C\u2500 Children: [${t.children.join(", ")}]`);let o=t.components.length;return t.components.forEach((r,m)=>{let g=m===o-1?"\u2514\u2500":"\u251C\u2500",b=Object.entries(r.data).map(([d,i])=>{if(typeof i=="number"){if(d==="fg"||d==="bg"){let{r:p,g:S,b:x,a:s}=b$1(i>>>0),a=u=>u.toString(16).padStart(2,"0");return `${d}=#${a(p)}${a(S)}${a(x)}${a(Math.round(s*255))}`}if(!Number.isInteger(i))return `${d}=${i.toFixed(2)}`}return `${d}=${i}`}).join(", ");e.push(`${g} ${r.name}: ${b}`);}),e.join(`
|
|
5
|
-
`)}function Le(t){let e=g(t),n={},o=[];for(let{name:r}of _)n[r]=0;for(let r of e){for(let{component:m,name:c}of _)if(i$2(t,r,m)){let g=n[c]??0;n[c]=g+1;}i$2(t,r,b)&&i$3(t,r)===0&&o.push(r);}return {entityCount:e.length,componentCounts:n,hierarchyRoots:o}}function Re(t){let e=[];e.push("World Statistics"),e.push("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),e.push(`Entities: ${t.entityCount}`),e.push(""),e.push("Components:");let n=Object.entries(t.componentCounts).filter(([,o])=>o>0).sort(([,o],[,r])=>r-o);for(let[o,r]of n){let m=(r/t.entityCount*100).toFixed(0);e.push(` ${o}: ${r} (${m}%)`);}return t.hierarchyRoots.length>0&&(e.push(""),e.push(`Hierarchy Roots: [${t.hierarchyRoots.join(", ")}]`)),e.join(`
|
|
6
|
-
`)}function ge(t){L=t,t||P.clear();}function ye(){return L}function ke(t,e){if(!L)return;let n=P.get(t);n?(n.totalTime+=e,n.callCount++):P.set(t,{name:t,totalTime:e,callCount:1});}function an(t,e){return(o=>{if(!L)return e(o);let r=performance.now(),m=e(o),c=performance.now()-r;return ke(t,c),m})}function H(){let t={};for(let[e,n]of P)t[e]=n.callCount>0?n.totalTime/n.callCount:0;return t}function mn(){P.clear();}function un(){w=null,G=0;}function de(t,e){let n=performance.now();if(w&&n-G<$e)return w;let o=e?.getStats()??{fps:0,frameTime:0,frameCount:0,runningTime:0},m=g(t).length,c=null;typeof process<"u"&&process.memoryUsage&&(c=process.memoryUsage().heapUsed/(1024*1024));let g$1=H();return w={fps:o.fps,frameTime:o.frameTime,frameCount:o.frameCount,runningTime:o.runningTime,entityCount:m,memoryUsageMB:c,systemTimings:g$1},G=n,w}var h={enabled:false,showHitboxes:true,showPadding:false,showMargins:false,color:4278255360};function ln(t,e){h.enabled=t,e&&(h.showHitboxes=e.showHitboxes??h.showHitboxes,h.showPadding=e.showPadding??h.showPadding,h.showMargins=e.showMargins??h.showMargins,h.color=e.color??h.color);}function cn(){return h.enabled}function pn(){return {...h}}function fn(t){return h.enabled?g(t).filter(n=>i$2(t,n,r)&&i$2(t,n,K)):[]}function We(t,e){let n=[];return i$2(t,e,V)&&Y(t,e)&&n.push("focused"),i$2(t,e,c$1)&&(i$4(t,e)&&n.push("hovered"),j(t,e)&&n.push("pressed")),I(t,e)&&n.push("animated"),m$1(t,e)&&n.push("bordered"),n}function gn(t,e){let n=[],o=c$2(e,"name")?a$1(e,"name"):null;if(n.push(`Entity ${e}${o?` (${o})`:""}`),i$2(t,e,r)){let m=Math.round(r.x[e]??0),c=Math.round(r.y[e]??0);n.push(`@ ${m},${c}`);}i$2(t,e,K)&&n.push(`[${K.width[e]}x${K.height[e]}]`);let r$1=We(t,e);return r$1.length>0&&n.push(r$1.join(" ")),n.join(" ")}function yn(t,e){let n=we(t,e),o=Pe(n);console.log(`[DEBUG] ${o}`);}function dn(t){let e=Le(t),n=Re(e);console.log(`[DEBUG] ${n}`);}export{xe as a,Me as b,Ee as c,ve as d,Te as e,_ as f,we as g,Pe as h,Le as i,Re as j,ge as k,ye as l,ke as m,an as n,H as o,mn as p,un as q,de as r,ln as s,cn as t,pn as u,fn as v,gn as w,yn as x,dn as y};
|
package/dist/chunk-FMFEOAML.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {f,c as c$1,e,b as b$1,d as d$1}from'./chunk-4LWWONFK.js';import {k as k$1,m as m$1,p,s as s$2,i as i$2,c as c$3,n as n$2,r as r$2}from'./chunk-FGHEFXLK.js';import {a as a$1,e as e$2,r as r$1,t,o as o$1}from'./chunk-C5PCEQ6G.js';import {a,g as g$1}from'./chunk-WY3KY2TR.js';import {c as c$4,a as a$2}from'./chunk-XZA63ZPO.js';import {v as v$1,c,o,m as m$2,p as p$2,k as k$2}from'./chunk-KD55INV7.js';import {s as s$1,n as n$1,l as l$1,i as i$3}from'./chunk-LCN2ZITE.js';import {r,K,V,e as e$1,p as p$1,i as i$1,c as c$2,ca,ia,ha,h,Z,_}from'./chunk-W5OU7Z6J.js';import {n,i,k}from'./chunk-PXXGH3BV.js';n();var s={eventQueue:[],capturedEntity:null,lastMouseX:0,lastMouseY:0,lastHoveredEntity:null,eventBus:a()};function ae(){s.eventQueue=[],s.capturedEntity=null,s.lastMouseX=0,s.lastMouseY=0,s.lastHoveredEntity=null;}function le(t){s.eventQueue.push({type:"key",event:t,timestamp:Date.now()});}function ce(t){s.eventQueue.push({type:"mouse",event:t,timestamp:Date.now()});}function me(){return s.eventQueue}function pe(){s.eventQueue=[];}function ye(){return s.eventBus}function de(t){s.capturedEntity=t;}function vt(){s.capturedEntity=null;}function Ee(){return s.capturedEntity!==null}function be(){return s.capturedEntity}function Bt(t,e,n,r$1){if(!i(t,e,r)||!i(t,e,K))return false;let o=r.x[e]??0,u=r.y[e]??0,i$1=K.width[e]??0,f=K.height[e]??0;return i$1<=0||f<=0?false:n>=o&&n<o+i$1&&r$1>=u&&r$1<u+f}function St(t,e,n){let r$1=[],o=Array.from(k(t,[r,K]));for(let u of o){if(!Bt(t,u,e,n))continue;let i=r.x[u]??0,f=r.y[u]??0,c=r.z[u]??0;r$1.push({entity:u,localX:e-i,localY:n-f,zIndex:c});}return r$1.sort((u,i)=>i.zIndex-u.zIndex),r$1}function xt(t,e,n){let r=St(t,e,n);for(let o of r)if(v$1(t,o.entity))return o.entity;return null}function It(t){switch(t){case "left":return c$3.LEFT;case "middle":return c$3.MIDDLE;case "right":return c$3.RIGHT;case "wheelUp":return c$3.WHEEL_UP;case "wheelDown":return c$3.WHEEL_DOWN;default:return c$3.NONE}}function Dt(t,e){let n=ca();if(e.name==="tab"){let r=Array.from(k(t,[V]));e.shift?ia(t,r):ha(t,r);return}if(n!==null){let r=e.raw.length>0?e.raw[0]??0:0;i$2(t,n,{lastKeyCode:r,lastKeyTime:Date.now(),ctrl:e.ctrl,meta:e.meta,shift:e.shift}),s.eventBus.emit("keypress",{key:e.name,ctrl:e.ctrl,meta:e.meta,shift:e.shift});}}function Ct(t,e,n,r,o$1){e!==n&&(e!==null&&v$1(t,e)&&(o(t,e,false),s.eventBus.emit("mouseleave",{x:r,y:o$1})),n!==null&&v$1(t,n)&&m$2(t,n)&&(o(t,n,true),s.eventBus.emit("mouseenter",{x:r,y:o$1})),s.lastHoveredEntity=n);}function Rt(t,e,n,r,o){p(t,e)&&(n$2(t,e,{x:n,y:r,button:o,pressed:true}),r$2(t,e,n,r,o)),v$1(t,e)&&p$2(t,e,true),s.eventBus.emit("mousedown",{x:n,y:r,button:o}),Z(t,e)&&_(t,e);}function Nt(t,e,n,r,o){p(t,e)&&n$2(t,e,{x:n,y:r,button:o,pressed:false}),v$1(t,e)&&p$2(t,e,false),s.eventBus.emit("mouseup",{x:n,y:r,button:o}),k$2(t,e)&&s.eventBus.emit("click",{x:n,y:r,button:o}),s.capturedEntity!==null&&vt();}function Mt(t,e){let n=e.x,r=e.y,o=It(e.button);s.lastMouseX=n,s.lastMouseY=r;let u=s.capturedEntity;if(u===null&&(u=xt(t,n,r)),Ct(t,s.lastHoveredEntity,u,n,r),s.eventBus.emit("mousemove",{x:n,y:r}),u!==null)switch(e.action){case "press":Rt(t,u,n,r,o);break;case "release":Nt(t,u,n,r,o);break;case "move":p(t,u)&&n$2(t,u,{x:n,y:r});break;case "wheel":{let i=o===c$3.WHEEL_UP?"up":"down";s.eventBus.emit("scroll",{direction:i,amount:1});break}}}var yt=t=>{let e=[...s.eventQueue];s.eventQueue=[];for(let n of e)n.type==="key"?Dt(t,n.event):n.type==="mouse"&&Mt(t,n.event);return t};function he(){return yt}function ge(t,e=0){t.registerInputSystem(yt,e);}function ve(t,e){k$1(t,e)&&m$1(t,e),p(t,e)&&s$2(t,e);}function Be(t){let e=Array.from(k(t,[c])),n=Array.from(k(t,[V])),r=new Set([...e,...n]);return Array.from(r)}var m="\x1B[",l={RESET:0,BOLD:1,DIM:2,ITALIC:3,UNDERLINE:4,BLINK:5,INVERSE:7,HIDDEN:8,STRIKETHROUGH:9,FG_256:38,BG_256:48};function dt(){return {lastX:-1,lastY:-1,lastFg:-1,lastBg:-1,lastAttrs:-1,alternateScreen:false}}function b(...t){return `${m}${t.join(";")}m`}function Ot(t,e){return `${m}${e+1};${t+1}H`}function Wt(t){return `${m}${t+1}G`}function At(t){return t===1?`${m}C`:`${m}${t}C`}function Et(t){return {a:t>>>24&255,r:t>>>16&255,g:t>>>8&255,b:t&255}}function Tt(t){let{r:e,g:n,b:r,a:o}=Et(t);return o===0?b(39):b(l.FG_256,2,e,n,r)}function Lt(t){let{r:e,g:n,b:r,a:o}=Et(t);return o===0?b(49):b(l.BG_256,2,e,n,r)}function Ht(t){let e=[];return t===a$1.NONE||(t&a$1.BOLD&&e.push(l.BOLD),t&a$1.DIM&&e.push(l.DIM),t&a$1.ITALIC&&e.push(l.ITALIC),t&a$1.UNDERLINE&&e.push(l.UNDERLINE),t&a$1.BLINK&&e.push(l.BLINK),t&a$1.INVERSE&&e.push(l.INVERSE),t&a$1.HIDDEN&&e.push(l.HIDDEN),t&a$1.STRIKETHROUGH&&e.push(l.STRIKETHROUGH),e.length===0)?"":b(...e)}function Kt(t,e,n){if(t.lastX===e&&t.lastY===n)return "";if(t.lastY===n){let r=e-t.lastX;return r===1?"":r>0&&r<=4?At(r):Wt(e)}return Ot(e,n)}function Pt(t,e){let n="";return t.lastAttrs!==-1&&t.lastAttrs!==a$1.NONE&&e.attrs===a$1.NONE&&(n+=b(l.RESET),t.lastFg=-1,t.lastBg=-1,t.lastAttrs=-1),e.attrs!==t.lastAttrs&&e.attrs!==a$1.NONE?(t.lastAttrs!==-1&&t.lastAttrs!==a$1.NONE&&(n+=b(l.RESET),t.lastFg=-1,t.lastBg=-1),n+=Ht(e.attrs),t.lastAttrs=e.attrs):e.attrs===a$1.NONE&&t.lastAttrs===-1&&(t.lastAttrs=a$1.NONE),e.fg!==t.lastFg&&(n+=Tt(e.fg),t.lastFg=e.fg),e.bg!==t.lastBg&&(n+=Lt(e.bg),t.lastBg=e.bg),n}function kt(t,e){let{x:n,y:r,cell:o}=e,u="";return u+=Kt(t,n,r),u+=Pt(t,o),u+=o.char,t.lastX=n+1,t.lastY=r,u}function Qt(t,e){if(e.length===0)return "";let n="",r=[...e].sort((o,u)=>o.y!==u.y?o.y-u.y:o.x-u.x);for(let o of r)n+=kt(t,o);return n}var T=null,g=null,d=null;function De(t){g=t;}function Ce(){return g}function Re(){g=null;}function Ne(t){d=t;}function Me(){return d}function Oe(){d=null;}function S(){return T||(T=dt()),T}function We(){T=dt();}var $t=t=>{if(!g||!d)return t;let e$1=f(d);if(e$1.length===0)return c$1(d),e(d),t;let n=S(),r=Qt(n,e$1);return r.length>0&&g.write(r),c$1(d),e(d),t};function Ae(){return $t}function v(t){g&&g.write(t);}function Te(){v(`${m}?25l`);}function Ut(){v(`${m}?25h`);}function Le(){v(`${m}?1049h`);let t=S();t.alternateScreen=true;}function Ft(){v(`${m}?1049l`);let t=S();t.alternateScreen=false;}function He(){v(`${m}2J`);}function Xt(){v(`${m}H`);let t=S();t.lastX=0,t.lastY=0;}function Yt(){v(b(l.RESET));let t=S();t.lastFg=-1,t.lastBg=-1,t.lastAttrs=-1;}function Ke(){S().alternateScreen&&Ft(),Yt(),Ut(),Xt();}s$1();n();function zt(t,e){if(!i(t,e,c$2))return a$1.NONE;let n=a$1.NONE;return c$2.bold[e]===1&&(n|=a$1.BOLD),c$2.underline[e]===1&&(n|=a$1.UNDERLINE),c$2.blink[e]===1&&(n|=a$1.BLINK),c$2.inverse[e]===1&&(n|=a$1.INVERSE),n}function _t(t,e){if(c$4(t,e))return {x:a$2.x[e],y:a$2.y[e],width:a$2.width[e],height:a$2.height[e]}}function Gt(t,e){return n$1(t,e)?{top:i$3.top[e]===1?1:0,right:i$3.right[e]===1?1:0,bottom:i$3.bottom[e]===1?1:0,left:i$3.left[e]===1?1:0}:{top:0,right:0,bottom:0,left:0}}function qt(t,e){return {x:t.x+e.left,y:t.y+e.top,width:Math.max(0,t.width-e.left-e.right),height:Math.max(0,t.height-e.top-e.bottom)}}function Vt(t,e,n){let{world:r,buffer:o}=t,u=e$1(r,e);if(!u||u.transparent)return;let i=zt(r,e),f=e$2(" ",u.fg,u.bg,i);r$1(o,n.x,n.y,n.width,n.height,f);}function L(t,e,n,r,o,u){let i=String.fromCodePoint(r);o$1(t,e,n,e$2(i,o,u));}function bt(t,e,n,r,o,u,i){let f=String.fromCodePoint(o),c=e$2(f,u,i);for(let p=0;p<r;p++)o$1(t,e+p,n,c);}function ht(t,e,n,r,o,u,i){let f=String.fromCodePoint(o),c=e$2(f,u,i);for(let p=0;p<r;p++)o$1(t,e,n+p,c);}function jt(t,e,n,r,o,u){if(!e)return;let{x:i,y:f,width:c,height:p}=n;r.top&&r.left&&L(t,i,f,e.charTopLeft,o,u),r.top&&r.right&&L(t,i+c-1,f,e.charTopRight,o,u),r.bottom&&r.left&&L(t,i,f+p-1,e.charBottomLeft,o,u),r.bottom&&r.right&&L(t,i+c-1,f+p-1,e.charBottomRight,o,u);}function wt(t,e,n,r,o,u){let i=r.left?1:0,f=n.width-i-(r.right?1:0);f<=0||(r.top&&bt(t,n.x+i,n.y,f,e,o,u),r.bottom&&bt(t,n.x+i,n.y+n.height-1,f,e,o,u));}function Jt(t,e,n,r,o,u){let i=r.top?1:0,f=n.height-i-(r.bottom?1:0);f<=0||(r.left&&ht(t,n.x,n.y+i,f,e,o,u),r.right&&ht(t,n.x+n.width-1,n.y+i,f,e,o,u));}function Zt(t,e,n){let{world:r,buffer:o}=t;if(!n$1(r,e))return;let u=l$1(r,e);if(!u||u.type===0||n.width<1||n.height<1)return;let{fg:i,bg:f}=u,c={left:u.left,top:u.top,right:u.right,bottom:u.bottom};jt(o,u,n,c,i,f),wt(o,u.charHorizontal,n,c,i,f),Jt(o,u.charVertical,n,c,i,f);}function Ge(t,e,n){}function qe(t,e,n){}function te(t,e){let{world:n,doubleBuffer:r}=t,o=_t(n,e);if(!o||o.width<=0||o.height<=0)return;Vt(t,e,o),Zt(t,e,o);let u=Gt(n,e);qt(o,u);d$1(r,o.x,o.y,o.width,o.height),h(n,e);}var x=null;function Ve(t){x=t;}function je(){return x}function we(){x=null;}var ee=t=>{if(!x)return t;let e=b$1(x),n={world:t,buffer:e,doubleBuffer:x},o=g$1(t).queryRenderables(t),u=[];for(let i of o)p$1(t,i)&&i$1(t,i)&&u.push({eid:i,z:r.z[i]});u.sort((i,f)=>i.z-f.z);for(let{eid:i}of u)te(n,i);return t};function Je(){return ee}function Ze(t$1,e,n,r,o,u,i=a$1.NONE){return t(t$1,e,n,r,o,u,i)}function tn(t,e,n,r,o,u){r$1(t,e,n,r,o,u);}function en(t){let n=g$1(t).queryRenderables(t);for(let r of n)c$2.dirty[r]=1;}export{Oe as A,S as B,We as C,$t as D,Ae as E,v as F,Te as G,Ut as H,Le as I,Ft as J,He as K,Xt as L,Yt as M,Ke as N,Vt as O,Zt as P,Ge as Q,qe as R,Ve as S,je as T,we as U,ee as V,Je as W,Ze as X,tn as Y,en as Z,s as a,ae as b,le as c,ce as d,me as e,pe as f,ye as g,de as h,vt as i,Ee as j,be as k,Bt as l,St as m,xt as n,yt as o,he as p,ge as q,ve as r,Be as s,dt as t,Qt as u,De as v,Ce as w,Re as x,Ne as y,Me as z};
|
package/dist/chunk-FYEBZAWN.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-WNG4A3K7.js';import {n,i as i$1,h as h$1}from'./chunk-PXXGH3BV.js';n();var i=1e4,E=(o=>(o[o.Left=0]="Left",o[o.Center=1]="Center",o[o.Right=2]="Right",o))(E||{}),m=(o=>(o[o.Top=0]="Top",o[o.Middle=1]="Middle",o[o.Bottom=2]="Bottom",o))(m||{}),u=new Map,f=1,s={set(t,n){let e=f++;return u.set(e,n),e},get(t){return u.get(t)??""},delete(t){u.delete(t);},clear(){u.clear(),f=1;}};function C(t){let n=5381;for(let e=0;e<t.length;e++)n=(n<<5)+n^t.charCodeAt(e);return n>>>0}var r={contentId:new Uint32Array(i),length:new Uint32Array(i),hash:new Uint32Array(i),wrap:new Uint8Array(i),align:new Uint8Array(i),valign:new Uint8Array(i),parseTags:new Uint8Array(i)};function b(t){r.contentId[t]=0,r.length[t]=0,r.hash[t]=0,r.wrap[t]=0,r.align[t]=0,r.valign[t]=0,r.parseTags[t]=0;}function l(t,n){i$1(t,n,r)||(h$1(t,n,r),b(n));}function T(t,n){n.wrap!==void 0&&(r.wrap[t]=n.wrap?1:0),n.align!==void 0&&(r.align[t]=n.align),n.valign!==void 0&&(r.valign[t]=n.valign),n.parseTags!==void 0&&(r.parseTags[t]=n.parseTags?1:0);}function y(t,n,e,o){l(t,n);let g=s.set(n,e);return r.contentId[n]=g,r.length[n]=e.length,r.hash[n]=C(e),o&&T(n,o),n}function h(t,n){if(!i$1(t,n,r))return "";let e=r.contentId[n];return s.get(e)}function w(t,n){if(!i$1(t,n,r))return;let e=r.contentId[n];return {text:s.get(e),length:r.length[n],hash:r.hash[n],wrap:r.wrap[n]===1,align:r.align[n],valign:r.valign[n],parseTags:r.parseTags[n]===1}}function v(t,n,e,o){let g=a(e);return y(t,n,g,o)}function I(t,n){let e=h(t,n);return a(e)}function A(t,n,e){let o=h(t,n);return y(t,n,o+e)}function U(t,n){if(!i$1(t,n,r))return n;let e=r.contentId[n];return e!==0&&s.delete(e),r.contentId[n]=0,r.length[n]=0,r.hash[n]=0,n}function O(t,n){return i$1(t,n,r)}function D(t,n){return i$1(t,n,r)?r.length[n]:0}function L(t,n){return i$1(t,n,r)?r.hash[n]:0}function P(t,n,e){return l(t,n),r.align[n]=e,n}function S(t,n,e){return l(t,n),r.valign[n]=e,n}function M(t,n,e){return l(t,n),r.wrap[n]=e?1:0,n}function _(t,n){return i$1(t,n,r)?r.wrap[n]===1:false}function B(t,n,e){return l(t,n),r.parseTags[n]=e?1:0,n}function F(t,n){return i$1(t,n,r)?r.parseTags[n]===1:false}function H(){s.clear();}export{E as a,m as b,s as c,r as d,y as e,h as f,w as g,v as h,I as i,A as j,U as k,O as l,D as m,L as n,P as o,S as p,M as q,_ as r,B as s,F as t,H as u};
|
package/dist/chunk-GYHI26UE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var f={enabled:false,scrollStep:1,horizontalStep:1,viewportHeight:24};function d(){return {mode:"normal",searchBuffer:"",lastSearch:"",lastSearchDirection:"forward",countPrefix:0,gPending:false}}function m(e){return {...f,...e}}function h(e,r,n){return n.enabled?r.mode==="search"?b(e,r):x(e,r,n):[{type:"none"},r]}function p(e,r,n){if(!n.enabled)return false;if(r.mode==="search")return true;let t=e.name;if(!e.ctrl&&!e.meta&&t>="1"&&t<="9"||r.countPrefix>0&&t==="0")return true;let i=new Set(["j","k","h","l","g","/","n"]);return !!(!e.ctrl&&!e.meta&&!e.shift&&i.has(t)||e.shift&&(t==="g"||t==="h"||t==="m"||t==="l"||t==="n")||e.ctrl&&(t==="d"||t==="u"||t==="f"||t==="b"))}function s(e,r){let n=e.name;if(!e.ctrl&&!e.meta&&!e.shift&&n>="1"&&n<="9"){let t=Number(n);return [{type:"none"},{...r,countPrefix:r.countPrefix*10+t,gPending:false}]}return r.countPrefix>0&&n==="0"&&!e.ctrl&&!e.meta?[{type:"none"},{...r,countPrefix:r.countPrefix*10}]:null}function g(e,r,n,t){let i=e.name,o=!e.ctrl&&!e.meta&&!e.shift;return i==="j"&&o?[{type:"scroll",direction:"down",amount:r*n.scrollStep},t]:i==="k"&&o?[{type:"scroll",direction:"up",amount:r*n.scrollStep},t]:i==="h"&&o?[{type:"scroll",direction:"left",amount:r*n.horizontalStep},t]:i==="l"&&o?[{type:"scroll",direction:"right",amount:r*n.horizontalStep},t]:null}function V(e,r,n){let t=e.name;return t==="g"&&!e.ctrl&&!e.meta&&!e.shift?r.gPending?[{type:"jump",target:"top"},n]:[{type:"none"},{...r,gPending:true}]:e.shift&&t==="g"?[{type:"jump",target:"bottom"},n]:e.shift&&t==="h"?[{type:"jump",target:"high"},n]:e.shift&&t==="m"?[{type:"jump",target:"middle"},n]:e.shift&&t==="l"?[{type:"jump",target:"low"},n]:null}function y(e,r){let n=e.name;return e.ctrl&&n==="d"?[{type:"page",direction:"down",amount:"half"},r]:e.ctrl&&n==="u"?[{type:"page",direction:"up",amount:"half"},r]:e.ctrl&&n==="f"?[{type:"page",direction:"down",amount:"full"},r]:e.ctrl&&n==="b"?[{type:"page",direction:"up",amount:"full"},r]:null}function S(e,r,n){let t=e.name;return t==="/"&&!e.ctrl&&!e.meta&&!e.shift?[{type:"enterSearch"},{...n,mode:"search",searchBuffer:""}]:t==="n"&&!e.ctrl&&!e.meta&&!e.shift?r.lastSearch?[{type:"searchNext",direction:r.lastSearchDirection},n]:[{type:"none"},n]:e.shift&&t==="n"?r.lastSearch?[{type:"searchNext",direction:r.lastSearchDirection==="forward"?"backward":"forward"},n]:[{type:"none"},n]:null}function x(e,r,n){let t=s(e,r);if(t)return t;let i=r.countPrefix>0?r.countPrefix:1,o={...r,countPrefix:0,gPending:false},a=g(e,i,n,o);if(a)return a;let u=V(e,r,o);if(u)return u;let c=y(e,o);if(c)return c;let l=S(e,r,o);return l||[{type:"none"},o]}function b(e,r){if(e.name==="return"||e.name==="enter")return r.searchBuffer.length===0?[{type:"exitSearch"},{...r,mode:"normal"}]:[{type:"search",query:r.searchBuffer,direction:"forward"},{...r,mode:"normal",lastSearch:r.searchBuffer,lastSearchDirection:"forward",searchBuffer:""}];if(e.name==="escape")return [{type:"exitSearch"},{...r,mode:"normal",searchBuffer:""}];if(e.name==="backspace")return r.searchBuffer.length===0?[{type:"exitSearch"},{...r,mode:"normal"}]:[{type:"none"},{...r,searchBuffer:r.searchBuffer.slice(0,-1)}];if(e.sequence.length===1&&!e.ctrl&&!e.meta){let n=r.searchBuffer+e.sequence;return [{type:"searchInput",char:e.sequence},{...r,searchBuffer:n}]}return [{type:"none"},r]}function w(e,r){return e==="half"?Math.max(1,Math.floor(r/2)):Math.max(1,r-1)}function P(e,r,n,t){switch(e){case "top":return 0;case "bottom":return Math.max(0,t-1);case "high":return r;case "middle":return r+Math.floor(n/2);case "low":return r+n-1}}export{d as a,m as b,h as c,p as d,w as e,P as f};
|
package/dist/chunk-H2YAOJDW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=(r=>(r[r.INPUT=0]="INPUT",r[r.EARLY_UPDATE=1]="EARLY_UPDATE",r[r.UPDATE=2]="UPDATE",r[r.LATE_UPDATE=3]="LATE_UPDATE",r[r.PHYSICS=4]="PHYSICS",r[r.LAYOUT=5]="LAYOUT",r[r.RENDER=6]="RENDER",r[r.POST_RENDER=7]="POST_RENDER",r))(d||{});var u=0;function f(){return u}function l(o){o.sort((m,e)=>m.priority-e.priority);}function a(){let o=new Map,m=[];for(let e=0;e<=7;e++)o.set(e,[]);return {registerSystem(e,t,s=0){if(e===0)throw new Error("Cannot register systems to INPUT phase. INPUT phase is protected and always runs first.");let n=o.get(e);n&&(n.push({system:t,priority:s}),l(n));},registerInputSystem(e,t=0){m.push({system:e,priority:t}),l(m);},unregisterSystem(e){for(let[t,s]of o){if(t===0)continue;let n=s.findIndex(y=>y.system===e);n!==-1&&s.splice(n,1);}},unregisterInputSystem(e){let t=m.findIndex(s=>s.system===e);t!==-1&&m.splice(t,1);},run(e,t){u=t;let s=e;for(let n of m)s=n.system(s);for(let n=0;n<=7;n++){let y=o.get(n);if(y)for(let i of y)s=i.system(s);}return s},runInputOnly(e,t){u=t;let s=e;for(let y of m)s=y.system(s);let n=o.get(0);if(n)for(let y of n)s=y.system(s);return s},runFixedUpdatePhases(e,t){u=t;let s=e,n=[1,2,3,4];for(let y of n){let i=o.get(y);if(i)for(let r of i)s=r.system(s);}return s},runRenderPhases(e,t){u=t;let s=e,n=[5,6,7];for(let y of n){let i=o.get(y);if(i)for(let r of i)s=r.system(s);}return s},getSystemsForPhase(e){if(e===0)return m.map(s=>s.system);let t=o.get(e);return t?t.map(s=>s.system):[]},getSystemCount(e){if(e===0)return m.length;let t=o.get(e);return t?t.length:0},getTotalSystemCount(){let e=m.length;for(let t of o.values())e+=t.length;return e},hasSystem(e){if(m.some(t=>t.system===e))return true;for(let t of o.values())if(t.some(s=>s.system===e))return true;return false},clearPhase(e){if(e===0)throw new Error("Cannot clear INPUT phase. INPUT phase is protected.");let t=o.get(e);t&&(t.length=0);},clearAllSystems(){for(let[e,t]of o)e!==0&&(t.length=0);}}}export{d as a,f as b,a as c};
|