blecsd 0.3.0 → 0.6.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/README.md +146 -147
- package/dist/{border-Jb7TrMob.d.ts → border-Br-Jc027.d.ts} +2 -2
- package/dist/{cell-DwIu2ryP.d.ts → cell-5Ty_3yMs.d.ts} +1 -1
- package/dist/cellRenderer-D0-DJXWl.d.ts +374 -0
- package/dist/chunk-4N7IFBRQ.js +4 -0
- package/dist/{chunk-DNRXW56C.js → chunk-4XCFTNGN.js} +1 -1
- package/dist/chunk-5YWRP2KG.js +3 -0
- package/dist/chunk-6PX5R326.js +1 -0
- package/dist/chunk-73Y45MLV.js +12 -0
- package/dist/chunk-7ZFQO3OQ.js +1 -0
- package/dist/chunk-A3GSH6MV.js +1 -0
- package/dist/chunk-A5B2BGUM.js +1 -0
- package/dist/chunk-AM6IDSXI.js +1 -0
- package/dist/chunk-EHYOVHRL.js +2 -0
- package/dist/chunk-EMZA6G2M.js +4 -0
- package/dist/chunk-EOFT3PNU.js +1 -0
- package/dist/chunk-ETFDYZVJ.js +1 -0
- package/dist/chunk-FUW7OD3H.js +1 -0
- package/dist/chunk-GRMSEMU7.js +1 -0
- package/dist/chunk-I7AUKTXE.js +1 -0
- package/dist/chunk-IANAVH2A.js +1 -0
- package/dist/chunk-JN2OGNK3.js +1 -0
- package/dist/chunk-JVMNMAHX.js +1 -0
- package/dist/chunk-K2QWNDXV.js +1 -0
- package/dist/chunk-KYNS3GBJ.js +2 -0
- package/dist/chunk-LI3ZYXUT.js +1 -0
- package/dist/chunk-LNEISTXM.js +1 -0
- package/dist/chunk-QABNK7IA.js +1 -0
- package/dist/chunk-QS5QXZNJ.js +1 -0
- package/dist/chunk-QTDRFJG2.js +1 -0
- package/dist/chunk-RJULLVTH.js +1 -0
- package/dist/chunk-SVHITP3F.js +2 -0
- package/dist/chunk-UKVY43V3.js +1 -0
- package/dist/chunk-VIT4KE6Q.js +1 -0
- package/dist/chunk-XG5PVDOP.js +1 -0
- package/dist/chunk-XH5GTWCV.js +1 -0
- package/dist/chunk-XYMPBCYW.js +1 -0
- package/dist/chunk-YRSSCEAS.js +1 -0
- package/dist/chunk-ZL46COQF.js +1 -0
- package/dist/cli/init.js +1 -1
- package/dist/{componentStorage-CJTh-TPO.d.ts → componentStorage-CXJvx4Lt.d.ts} +2 -2
- package/dist/components/index.d.ts +7209 -6691
- package/dist/components/index.js +5 -1
- package/dist/core/index.d.ts +2501 -1262
- package/dist/core/index.js +1 -1
- package/dist/debug/index.d.ts +310 -84
- package/dist/debug/index.js +8 -1
- package/dist/{dirtyTracking-C4v8MmM9.d.ts → dirtyTracking-kCS9-NVF.d.ts} +2 -2
- package/dist/{doubleBuffer-CKQFmlPN.d.ts → doubleBuffer-CWASihKh.d.ts} +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/{inputActions-CRsUtTHM.d.ts → factories-vW7bn_He.d.ts} +21 -786
- package/dist/{gameLoop-C-Ez_i54.d.ts → gameLoop-C1AyRWyP.d.ts} +3 -3
- package/dist/index.d.ts +25 -500
- package/dist/index.js +1 -3
- package/dist/input/index.d.ts +1 -1
- package/dist/input/index.js +1 -1
- package/dist/inputStream-COARA4CP.d.ts +1182 -0
- package/dist/interactiveSystem-h92W9W4n.d.ts +1977 -0
- package/dist/{keyParser-BnHbg2iD.d.ts → keyParser-DReXe2j-.d.ts} +41 -41
- package/dist/{events-9ForpTfM.d.ts → mouseParser-CCqSEUVN.d.ts} +177 -2
- package/dist/{packedStore-BgvnEdE7.d.ts → packedStore-480t2X74.d.ts} +1 -1
- package/dist/panelMovement-DGzIQ8Ll.d.ts +1908 -0
- package/dist/{parser-iMHmQuUh.d.ts → parser-Q1YLXYpF.d.ts} +1 -1
- package/dist/positioning-DiUivJXa.d.ts +917 -0
- package/dist/{renderable-CwqGwrEV.d.ts → renderable-IbSJao5y.d.ts} +2 -2
- package/dist/{scheduler-CMcYew9Z.d.ts → scheduler-NbHT3-D2.d.ts} +3 -1
- package/dist/schemas/index.d.ts +6 -6
- package/dist/schemas/index.js +1 -1
- package/dist/systems/index.d.ts +1057 -1807
- package/dist/systems/index.js +1 -1
- package/dist/terminal/index.d.ts +7207 -2709
- package/dist/terminal/index.js +1 -1
- package/dist/terminalBuffer-BbUz27qM.d.ts +691 -0
- package/dist/{terminus-14-bold-HWSPRLJD.js → terminus-14-bold-ZS4IH465.js} +1 -1
- package/dist/{terminus-14-normal-T3SWMH4D.js → terminus-14-normal-HD5N7F5W.js} +1 -1
- package/dist/text/index.d.ts +263 -0
- package/dist/text/index.js +3 -0
- package/dist/textWrap-Ct2J8gO6.d.ts +761 -0
- package/dist/{tilemap-BirMJdbu.d.ts → tilemap-ByvTsepD.d.ts} +5 -5
- package/dist/{types-CPB4CpbH.d.ts → types-B8LmNkzG.d.ts} +1 -1
- package/dist/utils/index.d.ts +827 -780
- package/dist/utils/index.js +32 -1
- package/dist/{virtualScrollback-D9uLFe8l.d.ts → virtualScrollback-CiooIebp.d.ts} +4 -4
- package/dist/virtualViewport-fIlbIGPt.d.ts +657 -0
- package/dist/{virtualizedLineStore-DwPEvPkk.d.ts → virtualizedLineStore-DfyhojPZ.d.ts} +1 -1
- package/dist/widgets/bigText.d.ts +13 -13
- package/dist/widgets/bigText.js +1 -1
- package/dist/widgets/fonts/index.d.ts +1 -1
- package/dist/widgets/fonts/index.js +1 -1
- package/dist/widgets/index.d.ts +2933 -1102
- package/dist/widgets/index.js +24 -1
- package/package.json +9 -22
- package/dist/3d/index.d.ts +0 -5
- package/dist/3d/index.js +0 -1
- package/dist/audio/index.d.ts +0 -177
- package/dist/audio/index.js +0 -1
- package/dist/chunk-2IEMMRUO.js +0 -1
- package/dist/chunk-35LCBY6P.js +0 -1
- package/dist/chunk-3AV52GY5.js +0 -1
- package/dist/chunk-3LHLSY3Y.js +0 -1
- package/dist/chunk-3O4TQHGK.js +0 -4
- package/dist/chunk-3UJWZ5ZN.js +0 -1
- package/dist/chunk-5PELJRUQ.js +0 -1
- package/dist/chunk-6M2J5QUA.js +0 -1
- package/dist/chunk-7IQEUVGF.js +0 -1
- package/dist/chunk-A6M6TFBL.js +0 -1
- package/dist/chunk-CIK4AMUA.js +0 -1
- package/dist/chunk-CUEUJAHK.js +0 -3
- package/dist/chunk-D42Q2KKR.js +0 -1
- package/dist/chunk-DYEXOFUU.js +0 -2
- package/dist/chunk-DYU72XLL.js +0 -1
- package/dist/chunk-E4CJRSND.js +0 -1
- package/dist/chunk-EAY7B5GL.js +0 -1
- package/dist/chunk-FCMTWFSE.js +0 -1
- package/dist/chunk-FGHEFXLK.js +0 -1
- package/dist/chunk-FL56THSI.js +0 -25
- package/dist/chunk-G437VE43.js +0 -1
- package/dist/chunk-G7GIWWLE.js +0 -1
- package/dist/chunk-GGXNWT36.js +0 -8
- package/dist/chunk-HLFORKXS.js +0 -1
- package/dist/chunk-J7MBKEBY.js +0 -1
- package/dist/chunk-K3SX2LY5.js +0 -1
- package/dist/chunk-LDAFEXN5.js +0 -1
- package/dist/chunk-LYSK5S63.js +0 -1
- package/dist/chunk-MKMFUXLB.js +0 -33
- package/dist/chunk-MQWPHPUM.js +0 -1
- package/dist/chunk-MTI376CU.js +0 -5
- package/dist/chunk-MTV2RJZD.js +0 -1
- package/dist/chunk-NZ55KBM6.js +0 -1
- package/dist/chunk-OB66FB4F.js +0 -1
- package/dist/chunk-OMMJ7B5P.js +0 -1
- package/dist/chunk-OR3BZY7C.js +0 -1
- package/dist/chunk-PXXGH3BV.js +0 -1
- package/dist/chunk-R7AICVRN.js +0 -2
- package/dist/chunk-RZ7FGVI6.js +0 -1
- package/dist/chunk-SHUC6JWA.js +0 -1
- package/dist/chunk-TWSWTBYL.js +0 -1
- package/dist/chunk-UMGTXSQB.js +0 -11
- package/dist/chunk-X3Q3T2SS.js +0 -4
- package/dist/chunk-XZJRWFOS.js +0 -1
- package/dist/chunk-ZAHG7Y3X.js +0 -1
- package/dist/game/index.d.ts +0 -486
- package/dist/game/index.js +0 -1
- package/dist/index-DBS5Uefn.d.ts +0 -3156
- package/dist/mouseParser-Cfrbn3AX.d.ts +0 -177
- package/dist/viewport3d-xI33-_wq.d.ts +0 -182
- package/dist/virtualViewport-Bpv6jlKt.d.ts +0 -1856
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blecsd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "A modern, high-performance terminal UI library built on TypeScript and ECS architecture",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,10 +37,6 @@
|
|
|
37
37
|
"import": "./dist/terminal/index.js",
|
|
38
38
|
"types": "./dist/terminal/index.d.ts"
|
|
39
39
|
},
|
|
40
|
-
"./3d": {
|
|
41
|
-
"import": "./dist/3d/index.js",
|
|
42
|
-
"types": "./dist/3d/index.d.ts"
|
|
43
|
-
},
|
|
44
40
|
"./schemas": {
|
|
45
41
|
"import": "./dist/schemas/index.js",
|
|
46
42
|
"types": "./dist/schemas/index.d.ts"
|
|
@@ -49,14 +45,6 @@
|
|
|
49
45
|
"import": "./dist/utils/index.js",
|
|
50
46
|
"types": "./dist/utils/index.d.ts"
|
|
51
47
|
},
|
|
52
|
-
"./game": {
|
|
53
|
-
"import": "./dist/game/index.js",
|
|
54
|
-
"types": "./dist/game/index.d.ts"
|
|
55
|
-
},
|
|
56
|
-
"./audio": {
|
|
57
|
-
"import": "./dist/audio/index.js",
|
|
58
|
-
"types": "./dist/audio/index.d.ts"
|
|
59
|
-
},
|
|
60
48
|
"./core": {
|
|
61
49
|
"import": "./dist/core/index.js",
|
|
62
50
|
"types": "./dist/core/index.d.ts"
|
|
@@ -72,6 +60,10 @@
|
|
|
72
60
|
"./input": {
|
|
73
61
|
"import": "./dist/input/index.js",
|
|
74
62
|
"types": "./dist/input/index.d.ts"
|
|
63
|
+
},
|
|
64
|
+
"./text": {
|
|
65
|
+
"import": "./dist/text/index.js",
|
|
66
|
+
"types": "./dist/text/index.d.ts"
|
|
75
67
|
}
|
|
76
68
|
},
|
|
77
69
|
"typesVersions": {
|
|
@@ -88,9 +80,6 @@
|
|
|
88
80
|
"errors": [
|
|
89
81
|
"dist/errors/index.d.ts"
|
|
90
82
|
],
|
|
91
|
-
"game": [
|
|
92
|
-
"dist/game/index.d.ts"
|
|
93
|
-
],
|
|
94
83
|
"input": [
|
|
95
84
|
"dist/input/index.d.ts"
|
|
96
85
|
],
|
|
@@ -115,11 +104,8 @@
|
|
|
115
104
|
"widgets/fonts": [
|
|
116
105
|
"dist/widgets/fonts/index.d.ts"
|
|
117
106
|
],
|
|
118
|
-
"
|
|
119
|
-
"dist/
|
|
120
|
-
],
|
|
121
|
-
"audio": [
|
|
122
|
-
"dist/audio/index.d.ts"
|
|
107
|
+
"text": [
|
|
108
|
+
"dist/text/index.d.ts"
|
|
123
109
|
]
|
|
124
110
|
}
|
|
125
111
|
},
|
|
@@ -162,7 +148,8 @@
|
|
|
162
148
|
"size:why": "size-limit --why",
|
|
163
149
|
"verify-pack": "./scripts/verify-pack.sh",
|
|
164
150
|
"doccheck": "tsx scripts/doccheck.ts",
|
|
165
|
-
"playground": "tsx playground/index.ts"
|
|
151
|
+
"playground": "tsx playground/index.ts",
|
|
152
|
+
"gallery": "tsx playground/gallery.ts"
|
|
166
153
|
},
|
|
167
154
|
"size-limit": [
|
|
168
155
|
{
|
package/dist/3d/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { A as AmbientLight, a as AmbientLightSchema, b as Animation3D, c as Animation3DData, B as BackendCapabilities, d as BackendCapabilitiesSchema, e as BackendPreference, f as BackendPreferenceSchema, g as BackendSelection, h as BackendSelectionSchema, j as BackendType, k as BackendTypeSchema, l as BrailleConfig, m as BrailleConfigSchema, C as Camera3D, n as Camera3DData, o as ClipRect, p as ClipRectSchema, q as ClippedLine, r as CubeMeshOptions, s as CubeMeshOptionsSchema, t as CylinderMeshOptions, u as CylinderMeshOptionsSchema, D as DirectionalLight, v as DirectionalLightSchema, E as EncodedCell, w as EncodedCellSchema, x as EncodedOutput, y as EncodedOutputSchema, z as EulerAngles, F as EulerAnglesSchema, G as FrustumPlane, H as GraphicsCapabilities, I as HalfBlockConfig, J as HalfBlockConfigSchema, K as KittyConfig, L as KittyConfigSchema, M as LineEndpoint, N as LineEndpointSchema, O as Mat4, P as Mat4Schema, Q as Material3D, R as Material3DData, S as Mesh, T as MeshData, U as MeshProjection, V as MouseDragInput, W as MouseInteraction3D, X as MouseInteraction3DData, Y as ObjFace, Z as ObjGroup, _ as ObjLoadOptions, $ as ObjLoadOptionsSchema, a0 as ObjParseResult, a1 as ObjVertex, a2 as OrthographicConfig, a3 as OrthographicConfigSchema, a4 as PerspectiveConfig, a5 as PerspectiveConfigSchema, a6 as PixelBufferConfig, a7 as PixelBufferConfigSchema, a8 as PixelFramebuffer, a9 as PlaneMeshOptions, aa as PlaneMeshOptionsSchema, ab as ProjectedVertex, ac as RGBAColor, ad as RGBAColorSchema, ae as RendererBackend, af as ScreenCoord, ag as SextantConfig, ah as SextantConfigSchema, ai as SixelConfig, aj as SixelConfigSchema, ak as SphereMeshOptions, al as SphereMeshOptionsSchema, am as Transform3D, an as Transform3DData, ao as TriangleBBox, ap as TriangleVertex, aq as TriangleVertexSchema, ar as Vec3, as as Vec3Input, at as Vec3InputSchema, au as Vec3Schema, av as Viewport3D, aw as Viewport3DData, ax as ViewportConfig, ay as ViewportConfigSchema, az as ViewportOutput, aA as ViewportProjection, aB as animation3DSystem, aC as backendStore, aD as blendPixel, aE as buildMVP, aF as clearBackendStore, aG as clearFramebuffer, aH as clearFramebufferStore, aI as clearMeshStore, aJ as clearMouseInputStore, aK as clearOutputStore, aL as clearProjectionStore, aM as clipLine, aN as computeBoundingBox, aO as computeFaceNormal, aP as computeFlatShading, aQ as computeOutcode, aR as createBackendByType, aS as createBrailleBackend, aT as createCubeMesh, aU as createCylinderMesh, aV as createHalfBlockBackend, aW as createKittyBackend, aX as createMeshFromArrays, aY as createPixelFramebuffer, aZ as createPlaneMesh, a_ as createSextantBackend, a$ as createSixelBackend, b0 as createSphereMesh, b1 as detectBestBackend, b2 as disableMouseInteraction, b3 as drawLine, b4 as drawLineAA, b5 as drawLineColor, b6 as drawLineDepth, b7 as enableMouseInteraction, b8 as extractFrustumPlanes, b9 as feedMouseDrag, ba as feedMouseScroll, bb as fillRect, bc as fillTriangle, bd as fillTriangleFlat, be as framebufferStore, bf as getAnimation3D, bg as getCamera3D, bh as getDepth, bi as getMaterial3D, bj as getMesh, bk as getMeshCount, bl as getMeshData, bm as getMouseInteraction3D, bn as getPixel, bo as getProjMatrix, bp as getTransform3D, bq as getViewMatrix, br as getViewport3D, bs as getWorldMatrix, bt as isDirty, bu as isInBounds, bv as isPointInFrustum, bw as isSphereInFrustum, bx as loadObjAsMesh, by as lookAt, bz as markDirty, bA as mat4Determinant, bB as mat4Equals, bC as mat4FromTRS, bD as mat4Identity, bE as mat4Invert, bF as mat4IsIdentity, bG as mat4Multiply, bH as mat4RotateX, bI as mat4RotateY, bJ as mat4RotateZ, bK as mat4Scale, bL as mat4TransformDirection, bM as mat4TransformVec3, bN as mat4Translate, bO as mat4Transpose, bP as mouseInputStore, bQ as mouseInteraction3DSystem, bR as orthographicMatrix, bS as outputStore, bT as parseObj, bU as perspectiveMatrix, bV as projectVertex, bW as projectionStore, bX as projectionSystem, bY as rasterSystem, bZ as registerMesh, b_ as sceneGraphSystem, b$ as setAnimation3D, c0 as setCamera3D, c1 as setMaterial3D, c2 as setMesh, c3 as setPixel, c4 as setPixelUnsafe, c5 as setRotation, c6 as setScale, c7 as setTransform3D, c8 as setTranslation, c9 as setViewport3D, ca as shadeFace, cb as testAndSetDepth, cc as triangleArea2, cd as triangleBoundingBox, ce as unprojectVertex, cf as unregisterMesh, cg as vec3, ch as vec3Add, ci as vec3Cross, cj as vec3Distance, ck as vec3Dot, cl as vec3Equals, cm as vec3FromArray, cn as vec3Length, co as vec3LengthSq, cp as vec3Lerp, cq as vec3Negate, cr as vec3Normalize, cs as vec3Scale, ct as vec3Sub, cu as vec3Zero, cv as viewportOutputSystem, cw as viewportTransform } from '../index-DBS5Uefn.js';
|
|
2
|
-
export { A as Animation3DConfig, b as Animation3DConfigSchema, C as Camera3DConfig, c as Camera3DConfigSchema, M as Material3DConfig, d as Material3DConfigSchema, a as MouseInteraction3DConfig, e as MouseInteraction3DConfigSchema, T as Transform3DConfig, f as Transform3DConfigSchema, V as Viewport3DConfig, g as Viewport3DConfigSchema, h as Viewport3DWidgetConfig, i as Viewport3DWidgetConfigSchema } from '../viewport3d-xI33-_wq.js';
|
|
3
|
-
import 'zod';
|
|
4
|
-
import '../types-CPB4CpbH.js';
|
|
5
|
-
import 'bitecs';
|
package/dist/3d/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as Animation3D,m as CubeMeshOptionsSchema,p as CylinderMeshOptionsSchema,d as MouseInteraction3D,l as ObjLoadOptionsSchema,o as PlaneMeshOptionsSchema,n as SphereMeshOptionsSchema,H as animation3DSystem,K as backendStore,y as blendPixel,M as clearBackendStore,f as clearMouseInputStore,N as clearOutputStore,u as clipLine,r as computeBoundingBox,A as computeFaceNormal,B as computeFlatShading,t as computeOutcode,D as createCubeMesh,G as createCylinderMesh,F as createPlaneMesh,E as createSphereMesh,j as disableMouseInteraction,z as drawLineAA,i as enableMouseInteraction,v as extractFrustumPlanes,g as feedMouseDrag,h as feedMouseScroll,c as getAnimation3D,k as getMouseInteraction3D,w as isPointInFrustum,x as isSphereInFrustum,s as loadObjAsMesh,e as mouseInputStore,I as mouseInteraction3DSystem,L as outputStore,q as parseObj,J as sceneGraphSystem,b as setAnimation3D,C as shadeFace,O as viewportOutputSystem}from'../chunk-R7AICVRN.js';export{Xa as AmbientLightSchema,w as Animation3DConfigSchema,b as BackendCapabilitiesSchema,k as BackendPreferenceSchema,e as BackendSelectionSchema,a as BackendTypeSchema,f as BrailleConfigSchema,y as Camera3D,t as Camera3DConfigSchema,ga as ClipRectSchema,Wa as DirectionalLightSchema,c as EncodedCellSchema,d as EncodedOutputSchema,ca as EulerAnglesSchema,g as HalfBlockConfigSchema,j as KittyConfigSchema,Ta as LineEndpointSchema,ba as Mat4Schema,D as Material3D,u as Material3DConfigSchema,G as Mesh,x as MouseInteraction3DConfigSchema,ea as OrthographicConfigSchema,da as PerspectiveConfigSchema,Sa as PixelBufferConfigSchema,Ua as RGBAColorSchema,h as SextantConfigSchema,i as SixelConfigSchema,P as Transform3D,s as Transform3DConfigSchema,Va as TriangleVertexSchema,aa as Vec3InputSchema,$ as Vec3Schema,Y as Viewport3D,v as Viewport3DConfigSchema,mb as Viewport3DWidgetConfigSchema,fa as ViewportConfigSchema,Ra as buildMVP,Za as clearFramebuffer,rb as clearFramebufferStore,O as clearMeshStore,ob as clearProjectionStore,q as createBackendByType,l as createBrailleBackend,m as createHalfBlockBackend,n as createKittyBackend,I as createMeshFromArrays,Ya as createPixelFramebuffer,o as createSextantBackend,p as createSixelBackend,r as detectBestBackend,fb as drawLine,hb as drawLineColor,gb as drawLineDepth,eb as fillRect,kb as fillTriangle,lb as fillTriangleFlat,qb as framebufferStore,A as getCamera3D,cb as getDepth,F as getMaterial3D,M as getMesh,N as getMeshCount,J as getMeshData,$a as getPixel,B as getProjMatrix,R as getTransform3D,C as getViewMatrix,_ as getViewport3D,V as getWorldMatrix,X as isDirty,_a as isInBounds,Na as lookAt,W as markDirty,Ea as mat4Determinant,Ka as mat4Equals,Ia as mat4FromTRS,wa as mat4Identity,Fa as mat4Invert,Ja as mat4IsIdentity,xa as mat4Multiply,za as mat4RotateX,Aa as mat4RotateY,Ba as mat4RotateZ,Ca as mat4Scale,Ha as mat4TransformDirection,Ga as mat4TransformVec3,ya as mat4Translate,Da as mat4Transpose,Ma as orthographicMatrix,La as perspectiveMatrix,Pa as projectVertex,nb as projectionStore,pb as projectionSystem,sb as rasterSystem,H as registerMesh,z as setCamera3D,E as setMaterial3D,L as setMesh,ab as setPixel,bb as setPixelUnsafe,T as setRotation,U as setScale,Q as setTransform3D,S as setTranslation,Z as setViewport3D,db as testAndSetDepth,ib as triangleArea2,jb as triangleBoundingBox,Qa as unprojectVertex,K as unregisterMesh,ha as vec3,ja as vec3Add,na as vec3Cross,ta as vec3Distance,ma as vec3Dot,ua as vec3Equals,ia as vec3FromArray,pa as vec3Length,oa as vec3LengthSq,ra as vec3Lerp,sa as vec3Negate,qa as vec3Normalize,la as vec3Scale,ka as vec3Sub,va as vec3Zero,Oa as viewportTransform}from'../chunk-LYSK5S63.js';import'../chunk-D42Q2KKR.js';import'../chunk-5N3O25O7.js';import'../chunk-G7GIWWLE.js';import'../chunk-PXXGH3BV.js';import'../chunk-5PELJRUQ.js';
|
package/dist/audio/index.d.ts
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { c as EventMap, a as EventBus } from '../events-9ForpTfM.js';
|
|
2
|
-
import { U as Unsubscribe } from '../types-CPB4CpbH.js';
|
|
3
|
-
import 'bitecs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Audio integration hooks for games.
|
|
7
|
-
*
|
|
8
|
-
* Provides typed interfaces and hook functions for integrating audio
|
|
9
|
-
* into terminal games. blECSd does not play audio directly; instead,
|
|
10
|
-
* users supply an AudioAdapter implementation and the library wires
|
|
11
|
-
* event-based sound triggers, volume control, and channel management.
|
|
12
|
-
*
|
|
13
|
-
* @module audio/hooks
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Audio channel for routing sounds.
|
|
18
|
-
*/
|
|
19
|
-
declare const AudioChannel: {
|
|
20
|
-
readonly Music: 0;
|
|
21
|
-
readonly SFX: 1;
|
|
22
|
-
};
|
|
23
|
-
type AudioChannelValue = (typeof AudioChannel)[keyof typeof AudioChannel];
|
|
24
|
-
/**
|
|
25
|
-
* Options for playing a sound.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```typescript
|
|
29
|
-
* import { AudioChannel } from 'blecsd';
|
|
30
|
-
*
|
|
31
|
-
* const options: PlayOptions = {
|
|
32
|
-
* id: 'explosion',
|
|
33
|
-
* loop: false,
|
|
34
|
-
* volume: 0.8,
|
|
35
|
-
* channel: AudioChannel.SFX,
|
|
36
|
-
* };
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
interface PlayOptions {
|
|
40
|
-
/** Unique identifier for the sound */
|
|
41
|
-
readonly id: string;
|
|
42
|
-
/** Whether the sound should loop (default: false) */
|
|
43
|
-
readonly loop?: boolean;
|
|
44
|
-
/** Volume level from 0 to 1 (default: 1) */
|
|
45
|
-
readonly volume?: number;
|
|
46
|
-
/** Audio channel to play on (default: AudioChannel.SFX) */
|
|
47
|
-
readonly channel?: AudioChannelValue;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* User-provided audio adapter that handles actual audio playback.
|
|
51
|
-
* blECSd never plays audio directly; this interface is what users implement.
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```typescript
|
|
55
|
-
* import type { AudioAdapter } from 'blecsd';
|
|
56
|
-
*
|
|
57
|
-
* const myAudio: AudioAdapter = {
|
|
58
|
-
* play: (opts) => { console.log(`Playing ${opts.id}`); },
|
|
59
|
-
* stop: (id) => { console.log(`Stopping ${id}`); },
|
|
60
|
-
* stopAll: () => { console.log('Stopping all'); },
|
|
61
|
-
* setVolume: (channel, volume) => { ... },
|
|
62
|
-
* setMuted: (channel, muted) => { ... },
|
|
63
|
-
* };
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
interface AudioAdapter {
|
|
67
|
-
/** Play a sound with the given options */
|
|
68
|
-
play(options: PlayOptions): void;
|
|
69
|
-
/** Stop a specific sound by its ID */
|
|
70
|
-
stop(id: string): void;
|
|
71
|
-
/** Stop all currently playing sounds */
|
|
72
|
-
stopAll(): void;
|
|
73
|
-
/** Set the volume for a channel (0 to 1) */
|
|
74
|
-
setVolume(channel: AudioChannelValue, volume: number): void;
|
|
75
|
-
/** Mute or unmute a channel */
|
|
76
|
-
setMuted(channel: AudioChannelValue, muted: boolean): void;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* A sound trigger that maps an event to a sound.
|
|
80
|
-
*/
|
|
81
|
-
interface SoundTrigger<T extends EventMap, K extends keyof T> {
|
|
82
|
-
/** The event name to listen for */
|
|
83
|
-
readonly event: K;
|
|
84
|
-
/** The sound ID to play when the event fires */
|
|
85
|
-
readonly soundId: string;
|
|
86
|
-
/** Optional play options override */
|
|
87
|
-
readonly options?: Omit<PlayOptions, 'id'>;
|
|
88
|
-
/** Optional predicate to conditionally trigger the sound */
|
|
89
|
-
readonly when?: (payload: T[K]) => boolean;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Audio manager state.
|
|
93
|
-
*/
|
|
94
|
-
interface AudioState {
|
|
95
|
-
readonly musicVolume: number;
|
|
96
|
-
readonly sfxVolume: number;
|
|
97
|
-
readonly musicMuted: boolean;
|
|
98
|
-
readonly sfxMuted: boolean;
|
|
99
|
-
readonly adapter: AudioAdapter | undefined;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Audio manager returned by createAudioManager.
|
|
103
|
-
*/
|
|
104
|
-
interface AudioManager {
|
|
105
|
-
/** Get current audio state */
|
|
106
|
-
getState(): AudioState;
|
|
107
|
-
/** Set the audio adapter implementation */
|
|
108
|
-
setAdapter(adapter: AudioAdapter): void;
|
|
109
|
-
/** Remove the current adapter */
|
|
110
|
-
clearAdapter(): void;
|
|
111
|
-
/** Play a sound */
|
|
112
|
-
play(options: PlayOptions): void;
|
|
113
|
-
/** Play a sound by ID with default options */
|
|
114
|
-
playSound(id: string, channel?: AudioChannelValue): void;
|
|
115
|
-
/** Play background music (loops by default) */
|
|
116
|
-
playMusic(id: string, volume?: number): void;
|
|
117
|
-
/** Stop a specific sound */
|
|
118
|
-
stop(id: string): void;
|
|
119
|
-
/** Stop all sounds */
|
|
120
|
-
stopAll(): void;
|
|
121
|
-
/** Set volume for a channel (0 to 1) */
|
|
122
|
-
setVolume(channel: AudioChannelValue, volume: number): void;
|
|
123
|
-
/** Get volume for a channel */
|
|
124
|
-
getVolume(channel: AudioChannelValue): number;
|
|
125
|
-
/** Mute a channel */
|
|
126
|
-
mute(channel: AudioChannelValue): void;
|
|
127
|
-
/** Unmute a channel */
|
|
128
|
-
unmute(channel: AudioChannelValue): void;
|
|
129
|
-
/** Toggle mute for a channel */
|
|
130
|
-
toggleMute(channel: AudioChannelValue): void;
|
|
131
|
-
/** Check if a channel is muted */
|
|
132
|
-
isMuted(channel: AudioChannelValue): boolean;
|
|
133
|
-
/** Register a sound trigger for an event bus */
|
|
134
|
-
onEvent<T extends EventMap, K extends keyof T>(bus: EventBus<T>, trigger: SoundTrigger<T, K>): Unsubscribe;
|
|
135
|
-
/** Register multiple sound triggers at once */
|
|
136
|
-
onEvents<T extends EventMap>(bus: EventBus<T>, triggers: ReadonlyArray<SoundTrigger<T, keyof T>>): Unsubscribe;
|
|
137
|
-
/** Destroy the audio manager and clean up */
|
|
138
|
-
destroy(): void;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Creates an audio manager for integrating sound into a game.
|
|
142
|
-
*
|
|
143
|
-
* The manager does not play audio directly. Instead, users provide an
|
|
144
|
-
* AudioAdapter that handles actual playback. The manager handles
|
|
145
|
-
* channel volumes, muting, and event-based sound triggers.
|
|
146
|
-
*
|
|
147
|
-
* @param adapter - Optional initial audio adapter
|
|
148
|
-
* @returns An AudioManager instance
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* ```typescript
|
|
152
|
-
* import { createAudioManager, AudioChannel } from 'blecsd';
|
|
153
|
-
*
|
|
154
|
-
* const audio = createAudioManager();
|
|
155
|
-
*
|
|
156
|
-
* // Set an adapter (user-provided audio implementation)
|
|
157
|
-
* audio.setAdapter(myAudioAdapter);
|
|
158
|
-
*
|
|
159
|
-
* // Play sounds
|
|
160
|
-
* audio.playSound('click', AudioChannel.SFX);
|
|
161
|
-
* audio.playMusic('background_theme');
|
|
162
|
-
*
|
|
163
|
-
* // Volume control
|
|
164
|
-
* audio.setVolume(AudioChannel.Music, 0.5);
|
|
165
|
-
* audio.mute(AudioChannel.SFX);
|
|
166
|
-
*
|
|
167
|
-
* // Event-based triggers
|
|
168
|
-
* const unsub = audio.onEvent(eventBus, {
|
|
169
|
-
* event: 'player:hit',
|
|
170
|
-
* soundId: 'damage',
|
|
171
|
-
* options: { volume: 0.8 },
|
|
172
|
-
* });
|
|
173
|
-
* ```
|
|
174
|
-
*/
|
|
175
|
-
declare function createAudioManager(adapter?: AudioAdapter): AudioManager;
|
|
176
|
-
|
|
177
|
-
export { type AudioAdapter, AudioChannel, type AudioChannelValue, type AudioManager, type AudioState, type PlayOptions, type SoundTrigger, createAudioManager };
|
package/dist/audio/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as AudioChannel,b as createAudioManager}from'../chunk-NZ55KBM6.js';import'../chunk-5PELJRUQ.js';
|
package/dist/chunk-2IEMMRUO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {z as z$1}from'zod';var x=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)}),p={caseSensitive:false,threshold:0,limit:void 0,consecutiveBonus:.3,wordBoundaryBonus:.2,prefixBonus:.5,gapPenalty:.1};function f(e={}){return {...p,...e}}function z(e,t){if(t===0)return true;let i=e[t-1],n=e[t];return !i||!n?false:i===" "||i==="_"||i==="-"||i==="/"||i===i.toLowerCase()&&n===n.toUpperCase()}function y(e,t,i,n,s,o){let r=e.length/Math.max(t.length,e.length),a=0,u=-2;for(let c=0;c<s.length;c++){let d=s[c];if(d!==void 0){if(d===u+1)a++,r+=o.consecutiveBonus*(a/e.length);else if(a=0,u>=0){let h=d-u-1;r-=o.gapPenalty*(h/t.length);}z(t,d)&&(r+=o.wordBoundaryBonus/e.length),u=d;}}return s[0]===0&&(r+=o.prefixBonus),i===n&&(r=1),Math.max(0,Math.min(1,r))}function g(e,t,i={}){let n=f(i);if(!e)return {item:t,text:t,score:1,indices:[]};let s=n.caseSensitive?e:e.toLowerCase(),o=n.caseSensitive?t:t.toLowerCase(),r=[],a=0,u=0;for(;a<s.length&&u<o.length;)s[a]===o[u]&&(r.push(u),a++),u++;if(a!==s.length)return null;let c=y(e,t,s,o,r,n);return {item:t,text:t,score:c,indices:r}}function S(e,t,i={}){let n=f(i),s=[];for(let o of t){let r=g(e,o,n);r&&r.score>=(n.threshold||0)&&s.push(r);}return s.sort((o,r)=>r.score-o.score),n.limit!==void 0&&s.length>n.limit?s.slice(0,n.limit):s}function O(e,t,i){let{getText:n=String,...s}=i,o=f(s),r=[];for(let a of t){let u=n(a),c=g(e,u,o);c&&c.score>=(o.threshold||0)&&r.push({item:a,text:u,score:c.score,indices:c.indices});}return r.sort((a,u)=>u.score-a.score),o.limit!==void 0&&r.length>o.limit?r.slice(0,o.limit):r}function M(e,t,i=n=>`[${n}]`){let n=new Set(t),s="";for(let o=0;o<e.length;o++){let r=e[o];r!==void 0&&(n.has(o)?s+=i(r):s+=r);}return s}function T(e,t,i={}){return S(e,t,i).map(s=>s.item)}function v(e,t,i={}){let n=g(e,t,i);return n!==null&&n.score>=(i.threshold??0)}var m={YYYY:e=>e.getFullYear().toString(),YY:e=>e.getFullYear().toString().slice(-2),MM:e=>(e.getMonth()+1).toString().padStart(2,"0"),DD:e=>e.getDate().toString().padStart(2,"0"),HH:e=>e.getHours().toString().padStart(2,"0"),hh:e=>{let t=e.getHours()%12;return (t===0?12:t).toString().padStart(2,"0")},mm:e=>e.getMinutes().toString().padStart(2,"0"),ss:e=>e.getSeconds().toString().padStart(2,"0"),SSS:e=>e.getMilliseconds().toString().padStart(3,"0"),SS:e=>Math.floor(e.getMilliseconds()/10).toString().padStart(2,"0"),AA:e=>e.getHours()<12?"AM":"PM",aa:e=>e.getHours()<12?"am":"pm"},b=new RegExp(Object.keys(m).sort((e,t)=>t.length-e.length).join("|"),"g");function w(e,t){return t.replace(b,i=>{let n=m[i];return n?n(e):i})}function D(e=new Date){return Math.floor(e.getTime()/1e3)}function R(e=new Date){return e.getTime()}export{x as a,g as b,S as c,O as d,M as e,T as f,v as g,w as h,D as i,R as j};
|
package/dist/chunk-35LCBY6P.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {z as z$1}from'zod';var S=z$1.number().int().positive(),h=z$1.number().int().nonnegative(),b=z$1.number().min(0).max(100),g=z$1.string().refine(t=>!!(/^#[0-9a-fA-F]{3,8}$/.test(t)||/^rgba?\(/.test(t)||/^hsla?\(/.test(t)||/^[a-zA-Z]+$/.test(t)),{message:"Invalid color format"}),x=z$1.union([z$1.number(),z$1.string().regex(/^\d+(\.\d+)?%$/,'Percentage must be in format "50%"')]),f=z$1.union([z$1.number(),z$1.string().regex(/^\d+(\.\d+)?%$/,'Percentage must be in format "50%"'),z$1.enum(["center","left","right","top","bottom"])]);var r=z$1.object({tickRate:z$1.number().int().min(1).max(240),maxUpdatesPerFrame:z$1.number().int().min(1).max(30),interpolate:z$1.boolean()}),d=z$1.object({targetFPS:z$1.number().min(0).max(240).optional(),fixedTimestep:z$1.boolean().optional(),maxDeltaTime:z$1.number().positive().max(1).optional(),fixedTimestepMode:r.optional()}),v=z$1.object({fps:z$1.number().nonnegative(),frameTime:z$1.number().nonnegative(),frameCount:z$1.number().int().nonnegative(),runningTime:z$1.number().nonnegative(),tickCount:z$1.number().int().nonnegative(),ticksPerSecond:z$1.number().nonnegative(),interpolationAlpha:z$1.number().min(0).max(1),skippedUpdates:z$1.number().int().nonnegative()});var c=z$1.object({x:z$1.number().positive(),y:z$1.number().positive()}).nullable(),y=z$1.object({constrainToParent:z$1.boolean().optional(),constrainAxis:z$1.enum(["x","y"]).nullable().optional(),snapToGrid:c.optional(),minX:z$1.number().finite().optional(),maxX:z$1.number().finite().optional(),minY:z$1.number().finite().optional(),maxY:z$1.number().finite().optional(),bringToFront:z$1.boolean().optional(),frontZIndex:z$1.number().int().min(0).max(65535).optional()}).refine(t=>t.minX!==void 0&&t.maxX!==void 0?t.minX<=t.maxX:true,{message:"minX must be <= maxX"}).refine(t=>t.minY!==void 0&&t.maxY!==void 0?t.minY<=t.maxY:true,{message:"minY must be <= maxY"}),s=z$1.object({type:z$1.literal("key"),key:z$1.string(),raw:z$1.string().optional()}),p=z$1.object({type:z$1.literal("mouse"),action:z$1.string(),x:z$1.number().int().nonnegative(),y:z$1.number().int().nonnegative(),button:z$1.string().optional()}),P=z$1.discriminatedUnion("type",[s,p]),E=z$1.object({lastX:z$1.number().int().nonnegative(),lastY:z$1.number().int().nonnegative(),lastFg:z$1.number().int().nonnegative(),lastBg:z$1.number().int().nonnegative(),lastAttrs:z$1.number().int().nonnegative(),alternateScreen:z$1.boolean()}),C=z$1.object({x:z$1.number().finite(),y:z$1.number().finite(),width:z$1.number().finite().nonnegative(),height:z$1.number().finite().nonnegative()}),I=z$1.object({x:z$1.number().finite(),y:z$1.number().finite(),width:z$1.number().finite().nonnegative(),height:z$1.number().finite().nonnegative(),z:z$1.number().int().min(0).max(65535)}),T=z$1.enum(["focus","blur"]);var u=z$1.enum(["ascii","utf8","utf-8","utf16le","utf-16le","ucs2","ucs-2","base64","base64url","latin1","binary","hex"]),O=z$1.object({isAlternateBuffer:z$1.boolean().optional(),isMouseEnabled:z$1.boolean().optional()}),j=z$1.object({isAlternateBuffer:z$1.boolean().optional(),isMouseEnabled:z$1.boolean().optional(),timeout:z$1.number().int().nonnegative().max(3e5).optional(),maxBuffer:z$1.number().int().positive().max(104857600).optional(),encoding:u.optional()}),A=z$1.object({content:z$1.string().optional(),extension:z$1.string().regex(/^\.\w+$/,"Extension must start with a dot").optional(),editor:z$1.string().min(1).optional(),isAlternateBuffer:z$1.boolean().optional(),isMouseEnabled:z$1.boolean().optional()});var l=z$1.number().int().min(0).max(4294967295),m=z$1.union([z$1.string().regex(/^#[0-9a-fA-F]{3,8}$/,"Invalid hex color format"),l]),z=z$1.union([z$1.number().int().positive(),z$1.string().regex(/^\d+(\.\d+)?%$/,'Percentage must be in format "50%"'),z$1.literal("auto")]),D=z$1.union([z$1.number().int(),z$1.string().regex(/^\d+(\.\d+)?%$/,'Percentage must be in format "50%"'),z$1.enum(["center","left","right","top","bottom"])]),F=z$1.number().int().min(10).max(6e4),B=z$1.number().min(.1).max(10),N=z$1.string().min(1).refine(t=>!t.includes("\0"),{message:"Path must not contain null bytes"}),W=z$1.enum(["left","center","right"]),V=z$1.enum(["top","middle","bottom"]),X=z$1.union([z$1.boolean(),z$1.object({type:z$1.enum(["line","bg","none"]).optional(),fg:m.optional(),bg:m.optional()})]).optional(),Y=z$1.union([z$1.number().int().min(0).max(255),z$1.object({left:z$1.number().int().min(0).max(255).optional(),top:z$1.number().int().min(0).max(255).optional(),right:z$1.number().int().min(0).max(255).optional(),bottom:z$1.number().int().min(0).max(255).optional()})]).optional(),k=z$1.number().min(0).max(1),L=z$1.string().min(1).refine(t=>!t.includes("\0"),{message:"Tree path must not contain null bytes"});export{F as A,B,N as C,W as D,V as E,X as F,Y as G,k as H,L as I,S as a,h as b,b as c,g as d,x as e,f,r as g,d as h,v as i,c as j,y as k,s as l,p as m,P as n,E as o,C as p,I as q,T as r,u as s,O as t,j as u,A as v,l as w,m as x,z as y,D as z};
|
package/dist/chunk-3AV52GY5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {d,f}from'./chunk-6M2J5QUA.js';import {E,J as J$1,v,B,I as I$1,r,u,t}from'./chunk-ZAHG7Y3X.js';import {k as k$1,i as i$1,a,f as f$1}from'./chunk-G7GIWWLE.js';import {n,i,k,h}from'./chunk-PXXGH3BV.js';n();var p=1e4,o={x:new Float32Array(p),y:new Float32Array(p),width:new Float32Array(p),height:new Float32Array(p),valid:new Uint8Array(p)};function A(n,t){if(i(n,t,o)&&o.valid[t]===1)return {x:o.x[t],y:o.y[t],width:o.width[t],height:o.height[t]}}function et(n,t){return i(n,t,o)&&o.valid[t]===1}function ot(n,t){i(n,t,o)&&(o.valid[t]=0);}function G(n,t){i(n,t,o)||(h(n,t,o),o.x[t]=0,o.y[t]=0,o.width[t]=0,o.height[t]=0,o.valid[t]=0);}function x(n){if(!d(n))return {width:80,height:24};let t=f(n);return !t||!B(n,t)?{width:80,height:24}:{width:v.width[t],height:v.height[t]}}function I(n,t$1,e,i,s){let r$1;if(n===r)r$1=e;else if(u(n)){let u=t(n);r$1=u!==null?u/100*t$1:0;}else r$1=n;return r$1=Math.max(i,r$1),Number.isFinite(s)&&(r$1=Math.min(s,r$1)),Math.floor(r$1)}function U(n,t,e,i,s,r){G(n,t);let u=J$1(n,t)?E.x[t]:0,m=J$1(n,t)?E.y[t]:0,a=I$1(n,t),f,y;a?(f=u,y=m):(f=e+u,y=i+m);let l=0,g=0;if(B(n,t)){let _=v.width[t],k=v.height[t],O=v.minWidth[t],q=v.minHeight[t],B=v.maxWidth[t],R=v.maxHeight[t],S=v.shrink[t]===1,X=S?0:s,j=S?0:r;l=I(_,s,X,O,B),g=I(k,r,j,q,R);}a||(f+l>e+s&&(l=Math.max(0,e+s-f)),y+g>i+r&&(g=Math.max(0,i+r-y))),o.x[t]=f,o.y[t]=y,o.width[t]=l,o.height[t]=g,o.valid[t]=1;}function Y(n,t,e,i,s,r){U(n,t,e,i,s,r);let u=A(n,t);if(!u)return;let m=f$1(n,t);for(let a of m)Y(n,a,u.x,u.y,u.width,u.height);}function J(n){let t=k(n,[E]),e=[];for(let i of t)k$1(n,i)?i$1(n,i)===a&&e.push(i):e.push(i);return e}var K=n=>{let t=x(n),e=J(n);for(let i of e)Y(n,i,0,0,t.width,t.height);return n};function rt(){return K}function it(n){let t=k(n,[E]);for(let e of t)i(n,e,o)&&(o.valid[e]=0);}function Q(n,t){if(!J$1(n,t))return;let e=0,i=0,s,r;if(k$1(n,t)){let u=i$1(n,t);if(u!==a){let m=Q(n,u);if(m)e=m.x,i=m.y,s=m.width,r=m.height;else {let a=x(n);s=a.width,r=a.height;}}else {let m=x(n);s=m.width,r=m.height;}}else {let u=x(n);s=u.width,r=u.height;}return U(n,t,e,i,s,r),A(n,t)}function ut(n,t){let e=A(n,t);if(e)return {left:e.x,top:e.y,right:e.x+e.width-1,bottom:e.y+e.height-1}}export{o as a,A as b,et as c,ot as d,K as e,rt as f,it as g,Q as h,ut as i};
|
package/dist/chunk-3LHLSY3Y.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {g as g$1,f,j as j$1}from'./chunk-Z4EZERNE.js';import {n as n$1,i as i$1,h}from'./chunk-PXXGH3BV.js';n$1();var g=1e4,e={left:new Uint8Array(g),top:new Uint8Array(g),right:new Uint8Array(g),bottom:new Uint8Array(g)};function S(r){e.left[r]=0,e.top[r]=0,e.right[r]=0,e.bottom[r]=0;}function w(r,t){i$1(r,t,e)||(h(r,t,e),S(t));}function U(r,t,l){return g$1.parse(l),w(r,t),l.left!==void 0&&(e.left[t]=l.left),l.top!==void 0&&(e.top[t]=l.top),l.right!==void 0&&(e.right[t]=l.right),l.bottom!==void 0&&(e.bottom[t]=l.bottom),t}function k(r,t,l){return f.parse(l),w(r,t),e.left[t]=l,e.top[t]=l,e.right[t]=l,e.bottom[t]=l,t}function C(r,t,l,o){return f.parse(l),f.parse(o),w(r,t),e.left[t]=l,e.right[t]=l,e.top[t]=o,e.bottom[t]=o,t}function F(r,t){if(i$1(r,t,e))return {left:e.left[t],top:e.top[t],right:e.right[t],bottom:e.bottom[t]}}function D(r,t){return i$1(r,t,e)}function B(r,t){return i$1(r,t,e)?e.left[t]+e.right[t]:0}function L(r,t){return i$1(r,t,e)?e.top[t]+e.bottom[t]:0}function I(r,t){return i$1(r,t,e)?e.left[t]>0||e.top[t]>0||e.right[t]>0||e.bottom[t]>0:false}n$1();var u=1e4,Y=(o=>(o[o.Hidden=0]="Hidden",o[o.Visible=1]="Visible",o[o.Auto=2]="Auto",o))(Y||{}),n={scrollX:new Float32Array(u),scrollY:new Float32Array(u),scrollWidth:new Float32Array(u),scrollHeight:new Float32Array(u),viewportWidth:new Float32Array(u),viewportHeight:new Float32Array(u),scrollbarVisible:new Uint8Array(u),trackVisible:new Uint8Array(u),alwaysScroll:new Uint8Array(u),clampEnabled:new Uint8Array(u)};function X(r){n.scrollX[r]=0,n.scrollY[r]=0,n.scrollWidth[r]=0,n.scrollHeight[r]=0,n.viewportWidth[r]=0,n.viewportHeight[r]=0,n.scrollbarVisible[r]=2,n.trackVisible[r]=1,n.alwaysScroll[r]=0,n.clampEnabled[r]=1;}function i(r,t){i$1(r,t,n)||(h(r,t,n),X(t));}function m(r){if(!(n.clampEnabled[r]===1))return;let l=n.viewportWidth[r],o=n.viewportHeight[r],c=n.scrollWidth[r],s=n.scrollHeight[r];if(l>0){let b=Math.max(0,c-l);n.scrollX[r]=Math.max(0,Math.min(b,n.scrollX[r]));}else n.scrollX[r]=Math.max(0,n.scrollX[r]);if(o>0){let b=Math.max(0,s-o);n.scrollY[r]=Math.max(0,Math.min(b,n.scrollY[r]));}else n.scrollY[r]=Math.max(0,n.scrollY[r]);}function A(r,t){t.scrollWidth!==void 0&&(n.scrollWidth[r]=t.scrollWidth),t.scrollHeight!==void 0&&(n.scrollHeight[r]=t.scrollHeight),t.viewportWidth!==void 0&&(n.viewportWidth[r]=t.viewportWidth),t.viewportHeight!==void 0&&(n.viewportHeight[r]=t.viewportHeight),t.scrollbarVisible!==void 0&&(n.scrollbarVisible[r]=t.scrollbarVisible);}function P(r,t){t.trackVisible!==void 0&&(n.trackVisible[r]=t.trackVisible?1:0),t.alwaysScroll!==void 0&&(n.alwaysScroll[r]=t.alwaysScroll?1:0),t.clampEnabled!==void 0&&(n.clampEnabled[r]=t.clampEnabled?1:0);}function V(r,t){A(r,t),P(r,t),t.scrollX!==void 0&&(n.scrollX[r]=t.scrollX),t.scrollY!==void 0&&(n.scrollY[r]=t.scrollY),m(r);}function j(r,t,l){return j$1.parse(l),i(r,t),V(t,l),t}function M(r,t,l,o){return i(r,t),n.scrollX[t]=l,n.scrollY[t]=o,m(t),t}function q(r,t){return i$1(r,t,n)?{x:n.scrollX[t],y:n.scrollY[t]}:{x:0,y:0}}function z(r,t,l,o){return i(r,t),n.scrollX[t]=n.scrollX[t]+l,n.scrollY[t]=n.scrollY[t]+o,m(t),t}function G(r,t,l,o){return M(r,t,l,o)}function J(r,t){if(!i$1(r,t,n))return {x:0,y:0};let l=n.scrollX[t],o=n.scrollY[t],c=n.scrollWidth[t],s=n.scrollHeight[t],b=n.viewportWidth[t],W=n.viewportHeight[t],h=c-b,p=s-W,E=h>0?l/h*100:0,x=p>0?o/p*100:0;return {x:Math.min(100,Math.max(0,E)),y:Math.min(100,Math.max(0,x))}}function K(r,t,l,o){i(r,t);let c=n.scrollWidth[t],s=n.scrollHeight[t],b=n.viewportWidth[t],W=n.viewportHeight[t],h=Math.min(100,Math.max(0,l)),p=Math.min(100,Math.max(0,o)),E=Math.max(0,c-b),x=Math.max(0,s-W);return n.scrollX[t]=h/100*E,n.scrollY[t]=p/100*x,t}function Q(r,t){if(i$1(r,t,n))return {scrollX:n.scrollX[t],scrollY:n.scrollY[t],scrollWidth:n.scrollWidth[t],scrollHeight:n.scrollHeight[t],viewportWidth:n.viewportWidth[t],viewportHeight:n.viewportHeight[t],scrollbarVisible:n.scrollbarVisible[t],trackVisible:n.trackVisible[t]===1,alwaysScroll:n.alwaysScroll[t]===1,clampEnabled:n.clampEnabled[t]===1}}function Z(r,t){return i$1(r,t,n)}function $(r,t,l,o){return i(r,t),n.scrollWidth[t]=l,n.scrollHeight[t]=o,m(t),t}function tt(r,t,l,o){return i(r,t),n.viewportWidth[t]=l,n.viewportHeight[t]=o,m(t),t}function rt(r,t,l){return i(r,t),n.scrollbarVisible[t]=l,t}function nt(r,t){return i(r,t),n.scrollY[t]=0,t}function lt(r,t){i(r,t);let l=n.scrollHeight[t],o=n.viewportHeight[t];return n.scrollY[t]=Math.max(0,l-o),t}function ot(r,t){return i(r,t),n.scrollX[t]=0,t}function et(r,t){i(r,t);let l=n.scrollWidth[t],o=n.viewportWidth[t];return n.scrollX[t]=Math.max(0,l-o),t}function at(r,t){if(!i$1(r,t,n))return false;let l=n.scrollWidth[t],o=n.scrollHeight[t],c=n.viewportWidth[t],s=n.viewportHeight[t];return c>0||s>0?l>c||o>s:l>0||o>0}function ct(r,t){if(!i$1(r,t,n))return false;let l=n.scrollWidth[t],o=n.viewportWidth[t];return l>o}function st(r,t){if(!i$1(r,t,n))return false;let l=n.scrollHeight[t],o=n.viewportHeight[t];return l>o}function it(r,t){return i$1(r,t,n)?n.scrollY[t]<=0:true}function ut(r,t){if(!i$1(r,t,n))return true;let l=n.scrollY[t],o=n.scrollHeight[t],c=n.viewportHeight[t],s=Math.max(0,o-c);return l>=s}function bt(r,t){return i$1(r,t,n)?n.scrollX[t]<=0:true}function mt(r,t){if(!i$1(r,t,n))return true;let l=n.scrollX[t],o=n.scrollWidth[t],c=n.viewportWidth[t],s=Math.max(0,o-c);return l>=s}export{et as A,at as B,ct as C,st as D,it as E,ut as F,bt as G,mt as H,e as a,U as b,k as c,C as d,F as e,D as f,B as g,L as h,I as i,Y as j,n as k,j as l,M as m,q as n,z as o,G as p,J as q,K as r,Q as s,Z as t,$ as u,tt as v,rt as w,nt as x,lt as y,ot as z};
|
package/dist/chunk-3O4TQHGK.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$2,j as j$1}from'./chunk-JHCKPCUH.js';import {b,k as k$1,d as d$1,f as f$1}from'./chunk-A6M6TFBL.js';import {a as a$1}from'./chunk-EAY7B5GL.js';import {g as g$1}from'./chunk-ZAHG7Y3X.js';import {q,p as p$1}from'./chunk-Z4EZERNE.js';import {z as z$1}from'zod';var at="> ",ct=" ",ut=4294967295,ft=6750207,mt=3435973887,bt=255,pt=1717987071;var Xt="Loading...";var a={isList:new Uint8Array(1e4),selectedIndex:new Int32Array(1e4).fill(-1),itemCount:new Uint32Array(1e4),firstVisible:new Uint32Array(1e4),visibleCount:new Uint32Array(1e4),interactive:new Uint8Array(1e4),mouse:new Uint8Array(1e4),keys:new Uint8Array(1e4),searchEnabled:new Uint8Array(1e4),totalCount:new Uint32Array(1e4),isLoading:new Uint8Array(1e4)},d=a$1({iterable:true}),U=new Map,G=new Map,j=new Map,X=new Map,D=new Map,B=new Map,T=new Map,V=new Map,F=new Map,$=new Map,I=new Map,H=new Map,P=new Map;function _(e){return d.get(e)??[]}function oe(e,t,r){d.set(t,[...r]),a.itemCount[t]=r.length,(a.selectedIndex[t]??-1)>=r.length&&(a.selectedIndex[t]=r.length>0?r.length-1:-1),(a.firstVisible[t]??0)>=r.length&&(a.firstVisible[t]=Math.max(0,r.length-1)),g$1(e,t);}function le(e,t,r,n){let o=d.get(t)??[],l=n??o.length;o.splice(l,0,r),d.set(t,o),a.itemCount[t]=o.length;let s=a.selectedIndex[t]??-1;s>=0&&l<=s&&(a.selectedIndex[t]=s+1),g$1(e,t);}function se(e,t,r){let n=d.get(t)??[];if(r<0||r>=n.length)return;let o=n.splice(r,1)[0];a.itemCount[t]=n.length;let l=a.selectedIndex[t]??-1;return l>=0&&(r<l?a.selectedIndex[t]=l-1:r===l&&(a.selectedIndex[t]=n.length>0?Math.min(r,n.length-1):-1)),g$1(e,t),o}function A(e,t){return d.get(e)?.[t]}function ie(e,t,r,n){let o=d.get(t);return !o||r<0||r>=o.length?false:(o[r]=n,g$1(e,t),true)}function ae(e){return a.itemCount[e]??0}function ce(e,t){d.set(t,[]),a.itemCount[t]=0,a.selectedIndex[t]=-1,a.firstVisible[t]=0,g$1(e,t);}function ue(e){return a.firstVisible[e]??0}function fe(e,t){let r=G.get(e);if(!r||r.size===0)return;let n=a.firstVisible[e]??0,o=a.visibleCount[e]??0,l=a.itemCount[e]??0,s=a.totalCount[e]??l,c=o,m={firstVisible:n,visibleCount:o,loadedCount:l,totalCount:s,nearEnd:n+o>=l-c,nearStart:n<=c};for(let b of r)b(m);}function tt(e,t,r){let n=a.itemCount[t]??0,o=a.totalCount[t]??n,l=Math.max(0,Math.max(n,o)-1),s=Math.max(0,Math.min(r,l));a.firstVisible[t]=s,g$1(e,t),fe(t);}function me(e){return a.visibleCount[e]??0}function be(e,t,r){a.visibleCount[t]=Math.max(1,r),g$1(e,t);}function yt(e,t,r){if(r<0)return;let n=a.firstVisible[t]??0,o=a.visibleCount[t]??0,l=n+o-1;r<n?tt(e,t,r):r>l&&tt(e,t,r-o+1);}var dt=null;function Vt(e){dt=e;}function pe(e,t,r){let n=a.firstVisible[t]??0,o=a.visibleCount[t]??0,l=a.itemCount[t]??0,s=n+r*o;if(s<0||s>=l)return false;tt(e,t,s);let c=a.selectedIndex[t]??-1;if(c>=0&&dt){let m=c+r*o;dt(e,t,Math.max(0,Math.min(m,l-1)));}return true}function ht(e){let t=d.get(e)??[],r=a.firstVisible[e]??0,n=a.visibleCount[e]??t.length,o=[];for(let l=0;l<n&&r+l<t.length;l++){let s=r+l,c=t[s];c&&o.push({index:s,item:c});}return o}function de(e,t,r){a.totalCount[t]=r,g$1(e,t);}function Pt(e){let t=a.totalCount[e]??0;return t===0?a.itemCount[e]??0:t}function ge(e,t){U.set(e,t);}function ye(e){return U.get(e)}function he(e){U.delete(e);}function xe(e,t){let r=G.get(e);return r||(r=new Set,G.set(e,r)),r.add(t),()=>{r?.delete(t);}}function gt(e,t,r){a.isLoading[t]=r?1:0,g$1(e,t);}function Ee(e){return a.isLoading[e]===1}function Ce(e,t){j.set(e,t);}function Le(e){return j.get(e)??Xt}async function Se(e,t,r,n){let o=U.get(t);if(o&&a.isLoading[t]!==1){gt(e,t,true);try{let l=await o(r,n),s=d.get(t)??[];for(;s.length<r+l.length;)s.push({text:"",disabled:!0});for(let c=0;c<l.length;c++){let m=l[c];m&&(s[r+c]=m);}d.set(t,s),a.itemCount[t]=s.length,g$1(e,t);}finally{gt(e,t,false);}}}function ve(e){let t=a.firstVisible[e]??0,r=a.visibleCount[e]??0,n=a.totalCount[e]??0,o=d.get(e)??[],l=Math.min(t+r,n);for(let s=t;s<l;s++){let c=o[s];if(!c||c.text==="")return {needsLoad:true,startIndex:t,count:r}}return {needsLoad:false,startIndex:0,count:0}}function Te(e,t){let r=a.firstVisible[e]??0,n=a.visibleCount[e]??0,o=a.itemCount[e]??0,l=Pt(e),s=t??n;return {firstVisible:r,visibleCount:n,loadedCount:o,totalCount:l,nearEnd:r+n>=o-s,nearStart:r<=s}}function Ie(e,t,r){let n=d.get(t)??[];n.push(...r),d.set(t,n),a.itemCount[t]=n.length,g$1(e,t);}function Ae(e){return a.selectedIndex[e]??-1}function we(e){let t=a.selectedIndex[e]??-1;if(!(t<0))return A(e,t)}function We(e,t,r){return t<-1||t>=r?false:t<0?true:!A(e,t)?.disabled}function De(e,t){if(t<0)return;let r=A(e,t);if(!r)return;let n=D.get(e);if(n)for(let o of n)o(t,r);}function x(e,t,r){let n=a.itemCount[t]??0,o=a.selectedIndex[t]??-1;return !We(t,r,n)||o===r?false:(a.selectedIndex[t]=r,g$1(e,t),De(t,r),yt(e,t,r),true)}function Be(e,t,r=true){let n=a.itemCount[t]??0;if(n===0)return false;let o=a.selectedIndex[t]??-1,l=o;do{if(o--,o<0)if(r)o=n-1;else return false;if(!A(t,o)?.disabled)return x(e,t,o)}while(o!==l);return false}function Fe(e,t,r=true){let n=a.itemCount[t]??0;if(n===0)return false;let o=a.selectedIndex[t]??-1,l=o;do{if(o++,o>=n)if(r)o=0;else return false;if(!A(t,o)?.disabled)return x(e,t,o)}while(o!==l);return false}function _e(e,t){let r=a.itemCount[t]??0;for(let n=0;n<r;n++)if(!A(t,n)?.disabled)return x(e,t,n);return false}function ke(e,t){let r=a.itemCount[t]??0;for(let n=r-1;n>=0;n--)if(!A(t,n)?.disabled)return x(e,t,n);return false}function Me(e,t,r){let o=(d.get(t)??[]).findIndex(l=>l.value===r);return o>=0?x(e,t,o):false}function Re(e,t){x(e,t,-1);}function Ue(e,t){let r=a.selectedIndex[t]??-1;if(r<0)return false;let n=A(t,r);if(!n||n.disabled)return false;let o=B.get(t);if(o)for(let l of o)l(r,n);return true}function Xe(e,t){let r=D.get(e)??[];return r.push(t),D.set(e,r),()=>{let n=D.get(e);if(n){let o=n.indexOf(t);o!==-1&&n.splice(o,1);}}}function Ve(e,t){let r=B.get(e)??[];return r.push(t),B.set(e,r),()=>{let n=B.get(e);if(n){let o=n.indexOf(t);o!==-1&&n.splice(o,1);}}}function Pe(e,t){let r=F.get(e)??[];return r.push(t),F.set(e,r),()=>{let n=F.get(e);if(n){let o=n.indexOf(t);o!==-1&&n.splice(o,1);}}}function Ye(e){let t=F.get(e);if(t)for(let r of t)r();}function Ne(e){D.delete(e),B.delete(e),F.delete(e);}var xt={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 Ge(e,t,r=[],n={}){z$1.array(q).parse(r),p$1.parse(n),a.isList[t]=1,a.selectedIndex[t]=n.selectedIndex??-1,a.itemCount[t]=r.length,a.firstVisible[t]=0,a.visibleCount[t]=n.visibleCount??r.length,a.interactive[t]=n.interactive!==false?1:0,a.mouse[t]=n.mouse!==false?1:0,a.keys[t]=n.keys!==false?1:0,a.searchEnabled[t]=n.search===true?1:0,d.set(t,[...r]),b(e,t,xt);}function Y(e,t){return a.isList[t]===1&&k$1(e,t)}function Et(e,t){return d$1(e,t)??"idle"}function et(e,t,r){return Et(e,t)===r}function He(e,t){let r=Et(e,t);return r==="focused"||r==="selecting"}function Ct(e,t){return et(e,t,"disabled")}function k(e,t,r){if(!Y(e,t))return false;let n=f$1(e,t,r);return n&&g$1(e,t),n}function ze(e,t){return k(e,t,"focus")}function Qe(e,t){return k(e,t,"blur")}function Ke(e,t){return k(e,t,"disable")}function je(e,t){return k(e,t,"enable")}function $e(e,t){let r=X.get(e);X.set(e,{selectedPrefix:t.selectedPrefix??r?.selectedPrefix??"> ",unselectedPrefix:t.unselectedPrefix??r?.unselectedPrefix??" ",selectedFg:t.selectedFg??r?.selectedFg??4294967295,selectedBg:t.selectedBg??r?.selectedBg??6750207,itemFg:t.itemFg??r?.itemFg??3435973887,itemBg:t.itemBg??r?.itemBg??255,disabledFg:t.disabledFg??r?.disabledFg??1717987071});}function Lt(e){return X.get(e)??{selectedPrefix:"> ",unselectedPrefix:" ",selectedFg:4294967295,selectedBg:6750207,itemFg:3435973887,itemBg:255,disabledFg:1717987071}}function Ze(e){X.delete(e);}function Je(e,t,r){let n=r.toLowerCase();H.set(t,n);let o=_(t),l=n===""?[...o]:o.filter(s=>s.text.toLowerCase().includes(n));P.set(t,l),l.length>0?a.selectedIndex[t]=0:a.selectedIndex[t]=-1,a.firstVisible[t]=0,g$1(e,t);}function qe(e,t){H.delete(t),P.delete(t),a.firstVisible[t]=0,_(t).length>0&&(a.selectedIndex[t]=0),g$1(e,t);}function tr(e){let t=H.get(e);if(t===void 0||t==="")return _(e);let r=P.get(e);if(r)return r;let o=_(e).filter(l=>l.text.toLowerCase().includes(t.toLowerCase()));return P.set(e,o),o}function er(e,t){$.set(e,t),t&&!I.has(e)&&I.set(e,new Set);}function M(e){return $.get(e)??false}function rr(e,t){if(!M(e))throw new Error("Multi-select is not enabled for this list");let r=I.get(e);return r?r.has(t)?(r.delete(t),false):(r.add(t),true):false}function nr(e){if(!M(e))throw new Error("Multi-select is not enabled for this list");let t=I.get(e);return t?Array.from(t).sort((r,n)=>r-n):[]}function or(e){if(!M(e))return;let t=_(e),r=I.get(e);if(r){r.clear();for(let n=0;n<t.length;n++)r.add(n);}}function lr(e){if(!M(e))return;let t=I.get(e);t&&t.clear();}function sr(e,t){return M(e)?I.get(e)?.has(t)??false:false}function ir(e){return a.interactive[e]===1}function ar(e,t,r){a.interactive[t]=r?1:0,g$1(e,t);}function cr(e){return a.mouse[e]===1}function ur(e,t,r){a.mouse[t]=r?1:0,g$1(e,t);}function St(e){return a.keys[e]===1}function fr(e,t,r){a.keys[t]=r?1:0,g$1(e,t);}function Yt(e){return a.searchEnabled[e]===1}function mr(e,t,r){a.searchEnabled[t]=r?1:0,g$1(e,t);}function vt(e,t){return et(e,t,"searching")}function br(e,t){if(!Y(e,t)||!Yt(t))return false;let r=k(e,t,"startSearch");return r&&T.set(t,""),r}function pr(e,t){if(!Y(e,t))return false;let r=k(e,t,"endSearch");return r&&T.delete(t),r}function dr(e){return T.get(e)??""}function rt(e,t,r){T.set(t,r),g$1(e,t);let n=V.get(t);if(n)for(let o of n)o(r);return r.length>0?Nt(e,t,r):false}function gr(e,t,r){let n=T.get(t)??"";return rt(e,t,n+r)}function yr(e,t){let r=T.get(t)??"";return r.length===0?false:rt(e,t,r.slice(0,-1))}function hr(e,t){rt(e,t,"");}function Nt(e,t,r){let n=d.get(t)??[],o=r.toLowerCase();for(let l=0;l<n.length;l++){let s=n[l];if(s&&!s.disabled&&s.text.toLowerCase().startsWith(o))return x(e,t,l)}return false}function xr(e,t){let r=T.get(t);if(!r||r.length===0)return false;let n=d.get(t)??[],o=a.selectedIndex[t]??-1,l=r.toLowerCase();for(let s=o+1;s<n.length;s++){let c=n[s];if(c&&!c.disabled&&c.text.toLowerCase().startsWith(l))return x(e,t,s)}for(let s=0;s<=o;s++){let c=n[s];if(c&&!c.disabled&&c.text.toLowerCase().startsWith(l))return x(e,t,s)}return false}function Er(e,t){let r=V.get(e)??[];return r.push(t),V.set(e,r),()=>{let n=V.get(e);if(n){let o=n.indexOf(t);o!==-1&&n.splice(o,1);}}}function Cr(e,t,r){if(!Y(e,t)||Ct(e,t)||!St(t))return null;if(vt(e,t))return Lr(r);switch(r){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":return {type:"confirm"};case " ":case "space":return M(t)?{type:"toggleSelect"}:{type:"confirm"};case "escape":return {type:"cancel"};case "/":return {type:"startSearch"};default:return null}}function Lr(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 Sr(e,t){let r=Lt(e),n=ht(e),o=a.selectedIndex[e]??-1,l=[];for(let{index:s,item:c}of n){let b=s===o?r.selectedPrefix:r.unselectedPrefix,y=c.text,C=t-b.length,L=y.length>C?`${y.slice(0,C-1)}\u2026`:y;l.push(b+L);}return l}function vr(){a.isList.fill(0),a.selectedIndex.fill(-1),a.itemCount.fill(0),a.firstVisible.fill(0),a.visibleCount.fill(0),a.interactive.fill(0),a.mouse.fill(0),a.keys.fill(0),a.searchEnabled.fill(0),a.totalCount.fill(0),a.isLoading.fill(0),d.clear(),X.clear(),D.clear(),B.clear(),F.clear(),$.clear(),I.clear(),H.clear(),P.clear(),T.clear(),V.clear(),U.clear(),G.clear(),j.clear();}Vt(x);var Tr=["|","/","-","\\"],Oo=[". ",".. ","..."," .."," ."," "],Go=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],Ho=["\u2596","\u2598","\u259D","\u2597"],zo=100,p={frame:new Uint8Array(1e4),frameCount:new Uint8Array(1e4),interval:new Uint16Array(1e4),elapsed:new Float32Array(1e4)},z=new Map,Z=new Set;function Qo(e,t,r={}){let n=r.frames??Tr,o=r.interval??100;p.frame[t]=0,p.frameCount[t]=n.length,p.interval[t]=o,p.elapsed[t]=0,z.set(t,n),Z.add(t);}function Ko(e,t){Z.has(t)&&(p.frame[t]=0,p.frameCount[t]=0,p.interval[t]=0,p.elapsed[t]=0,z.delete(t),Z.delete(t));}function jo(e,t){return Z.has(t)}function $o(e){let t=z.get(e);if(!t)return "";let r=p.frame[e]??0;return t[r%t.length]??""}function Zo(e){let t=z.get(e);return t?{frame:p.frame[e]??0,frameCount:p.frameCount[e]??0,interval:p.interval[e]??100,elapsed:p.elapsed[e]??0,frames:t}:null}function Jo(e,t){p.interval[e]=t;}function qo(e,t){z.set(e,t),p.frameCount[e]=t.length,(p.frame[e]??0)>=t.length&&(p.frame[e]=0);}function Ir(e){let t=p.frameCount[e]??1,r=((p.frame[e]??0)+1)%t;return p.frame[e]=r,r}function tl(e,t){let r=(p.elapsed[e]??0)+t,n=p.interval[e]??100;return r>=n?(Ir(e),p.elapsed[e]=r%n,true):(p.elapsed[e]=r,false)}function el(e){p.frame[e]=0,p.elapsed[e]=0;}function rl(){z.clear(),Z.clear();}var Ot=4294967295,Gt=858993663,Ht=3435973887,zt=255,Qt=1717987071,Kt=255,S=1e4,w={rowCount:new Uint32Array(S),colCount:new Uint16Array(S),headerRows:new Uint8Array(S).fill(1),pad:new Uint8Array(S).fill(1),cellBorders:new Uint8Array(S)},f={isTable:new Uint8Array(S),rowCount:new Uint32Array(S),colCount:new Uint16Array(S),headerRows:new Uint8Array(S).fill(1),pad:new Uint8Array(S).fill(1),cellBorders:new Uint8Array(S)},g=new Map,K=new Map,Q=new Map;function ll(e,t,r={}){f.isTable[t]=1,f.rowCount[t]=0,f.colCount[t]=0,f.headerRows[t]=r.headerRows??1,f.pad[t]=r.pad??1,f.cellBorders[t]=r.cellBorders===true?1:0,w.rowCount[t]=0,w.colCount[t]=0,w.headerRows[t]=r.headerRows??1,w.pad[t]=r.pad??1,w.cellBorders[t]=r.cellBorders===true?1:0,g.set(t,[]),K.set(t,[]);}function sl(e,t){return f.isTable[t]===1}function il(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,w.rowCount[t]=0,w.colCount[t]=0,w.headerRows[t]=1,w.pad[t]=1,w.cellBorders[t]=0,g.delete(t),K.delete(t),Q.delete(t);}function al(e,t,r){let n=r.map(o=>o.map(l=>typeof l=="string"?{value:l}:l));g.set(t,n),f.rowCount[t]=n.length,f.colCount[t]=n.reduce((o,l)=>Math.max(o,l.length),0),g$1(e,t);}function cl(e,t){return g.get(t)??[]}function ul(e,t){return (g.get(t)??[]).map(n=>n.map(o=>o.value))}function fl(e,t,r,n,o){let l=g.get(t);if(!l||r<0||n<0)return false;for(;l.length<=r;)l.push([]);let s=l[r];if(!s)return false;for(;s.length<=n;)s.push({value:""});s[n]=typeof o=="string"?{value:o}:o;let c=l.reduce((m,b)=>Math.max(m,b.length),0);return f.colCount[t]=c,f.rowCount[t]=l.length,g$1(e,t),true}function Ar(e,t,r,n){let o=g.get(t);if(!(!o||r<0||n<0))return o[r]?.[n]}function ml(e,t,r,n){return Ar(e,t,r,n)?.value}function bl(e,t,r){return g.get(t)?.[r]}function pl(e,t,r){return (g.get(t)??[]).map(o=>o[r]??{value:""})}function dl(e,t){return f.rowCount[t]??0}function gl(e,t){return f.colCount[t]??0}function yl(e,t,r){let n=g.get(t)??[],o=r.map(l=>typeof l=="string"?{value:l}:l);n.push(o),f.rowCount[t]=n.length,f.colCount[t]=Math.max(f.colCount[t]??0,o.length),g$1(e,t);}function hl(e,t,r,n){let o=g.get(t)??[],l=n.map(c=>typeof c=="string"?{value:c}:c),s=Math.max(0,Math.min(r,o.length));o.splice(s,0,l),f.rowCount[t]=o.length,f.colCount[t]=Math.max(f.colCount[t]??0,l.length),g$1(e,t);}function xl(e,t,r){let n=g.get(t);if(!n||r<0||r>=n.length)return;let o=n.splice(r,1)[0];return f.rowCount[t]=n.length,f.colCount[t]=n.reduce((l,s)=>Math.max(l,s.length),0),g$1(e,t),o}function El(e,t){g.set(t,[]),f.rowCount[t]=0,f.colCount[t]=0,g$1(e,t);}function Cl(e,t,r){K.set(t,[...r]);let n=g.get(t)??[];if((f.headerRows[t]??1)>0){let l=r.map(s=>({value:s.header,align:s.align??"left"}));n.length===0?n.unshift(l):n[0]=l,f.rowCount[t]=n.length,f.colCount[t]=r.length;}g$1(e,t);}function Ll(e,t){return K.get(t)??[]}function Sl(e,t){let r=g.get(t)??[],n=f.headerRows[t]??1;return r.slice(0,n)}function vl(e,t){let r=g.get(t)??[],n=f.headerRows[t]??1;return r.slice(n)}function Tl(e,t,r){f.headerRows[t]=Math.max(0,Math.min(255,r)),g$1(e,t);}function Il(e,t){return f.headerRows[t]??1}function Al(e,t,r){let n=Q.get(t),o=r.altRowBg??n?.altRowBg,l=r.selectedFg??n?.selectedFg,s=r.selectedBg??n?.selectedBg,c={headerFg:r.headerFg??n?.headerFg??Ot,headerBg:r.headerBg??n?.headerBg??Gt,cellFg:r.cellFg??n?.cellFg??Ht,cellBg:r.cellBg??n?.cellBg??zt,borderFg:r.borderFg??n?.borderFg??Qt,borderBg:r.borderBg??n?.borderBg??Kt,...o!==void 0&&{altRowBg:o},...l!==void 0&&{selectedFg:l},...s!==void 0&&{selectedBg:s}};Q.set(t,c);}function wl(e,t){return Q.get(t)??{headerFg:Ot,headerBg:Gt,cellFg:Ht,cellBg:zt,borderFg:Qt,borderBg:Kt}}function Wl(e,t){Q.delete(t);}function Dl(e,t){return f.pad[t]??1}function Bl(e,t,r){f.pad[t]=Math.max(0,Math.min(255,r)),g$1(e,t);}function Fl(e,t){return f.cellBorders[t]===1}function _l(e,t,r){f.cellBorders[t]=r?1:0,g$1(e,t);}function wr(e,t,r){let n=new Array(t).fill(0);for(let o of e)for(let l=0;l<o.length;l++){let s=o[l];s&&(n[l]=Math.max(n[l]??0,s.value.length+r*2));}return n}function Wr(e,t){for(let r=0;r<t.length;r++){let n=t[r];n&&(n.width!==void 0?e[r]=n.width:(n.minWidth!==void 0&&(e[r]=Math.max(e[r]??0,n.minWidth)),n.maxWidth!==void 0&&(e[r]=Math.min(e[r]??0,n.maxWidth))));}}function Dr(e,t){let r=e.reduce((n,o)=>n+o,0);if(r>t){let n=t/r;for(let o=0;o<e.length;o++)e[o]=Math.floor((e[o]??0)*n);}}function Br(e,t,r){let n=g.get(t)??[],o=K.get(t)??[],l=f.colCount[t]??0,s=f.pad[t]??1,c=wr(n,l,s);return Wr(c,o),r!==void 0&&Dr(c,r),c}function Fr(e,t,r){if(r==="right")return e.padStart(t);if(r==="center"){let n=Math.floor((t-e.length)/2);return e.padStart(n+e.length).padEnd(t)}return e.padEnd(t)}function _r(e,t,r,n){let o=t-r*2,l=e.value;l.length>o&&(l=`${l.slice(0,o-1)}\u2026`);let s=Fr(l,o,e.align??"left");return n+s+n}function kr(e,t,r,n){let o=" ".repeat(r),l=n?"\u2502":"",s="";for(let c=0;c<t.length;c++){let m=e[c]??{value:""};c>0&&n&&(s+=l),s+=_r(m,t[c]??0,r,o);}return s}function kl(e,t,r){let n=g.get(t)??[],o=Br(e,t,r),l=f.pad[t]??1,s=f.cellBorders[t]===1,c=f.headerRows[t]??1,m=[];for(let b=0;b<n.length;b++)m.push(kr(n[b]??[],o,l,s)),s&&b===c-1&&b<n.length-1&&m.push(o.map(y=>"\u2500".repeat(y)).join("\u253C"));return m}function Ml(){f.isTable.fill(0),f.rowCount.fill(0),f.colCount.fill(0),f.headerRows.fill(1),f.pad.fill(1),f.cellBorders.fill(0),g.clear(),K.clear(),Q.clear();}var R=1e4,Mr=80,Rr=24,Ur=1e3,i={isTerminal:new Uint8Array(R),width:new Uint16Array(R),height:new Uint16Array(R),cursorX:new Uint16Array(R),cursorY:new Uint16Array(R),cursorVisible:new Uint8Array(R),scrollOffset:new Uint32Array(R),altScreenActive:new Uint8Array(R)},E=new Map,Xr=z$1.object({width:z$1.number().int().positive().default(Mr),height:z$1.number().int().positive().default(Rr),scrollbackLines:z$1.number().int().nonnegative().default(Ur),cursorVisible:z$1.boolean().default(true),cursorShape:z$1.enum(["block","underline","bar"]).default("block"),cursorBlink:z$1.boolean().default(true)});function Vr(e,t,r,n,o){let l={maxLines:r,chunkSize:Math.min(r,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:n,cursorBlink:o}}function Pr(e,t,r){return r*e+t}function Yr(e){let t=b$1,r=c,n=[255,2852126975,11141375,2863268095,43775,2852170495,11184895,2863311615,1431655935,4283782655,1442797055,4294923775,1431699455,4283826175,1442840575,4294967295];return e.fg.type===1?t=n[e.fg.value]??b$1:e.fg.type===3&&(t=e.fg.value<<8|255),e.bg.type===1?r=n[e.bg.value]??c:e.bg.type===3&&(r=e.bg.value<<8|255),{fg:t,bg:r,attrs:e.styles}}function It(e$1,t,r){let n=Nr(e$1.buffer,0,t);g$2(e$1.scrollback,n);for(let l=0;l<r-1;l++)for(let s=0;s<t;s++){let c=(l+1)*t+s,m=l*t+s,b=e$1.buffer.cells[c];b&&(e$1.buffer.cells[m]=f$4(b));}let o=e();for(let l=0;l<t;l++){let s=(r-1)*t+l;e$1.buffer.cells[s]=f$4(o);}}function Nr(e,t,r){let n="";for(let o=0;o<r;o++){let l=t*r+o,s=e.cells[l];n+=s?.char??" ";}return n.trimEnd()}function Nl(e,t,r={}){let n=Xr.parse(r);i.isTerminal[t]=1,i.width[t]=n.width,i.height[t]=n.height,i.cursorX[t]=0,i.cursorY[t]=0,i.cursorVisible[t]=n.cursorVisible?1:0,i.scrollOffset[t]=0,i.altScreenActive[t]=0;let o=Vr(n.width,n.height,n.scrollbackLines,n.cursorShape,n.cursorBlink);E.set(t,o),g$1(e,t);}function Or(e){return i.isTerminal[e]===1}function Ol(e){return E.get(e)}function Gl(e){if(Or(e))return {width:i.width[e]??0,height:i.height[e]??0,cursorX:i.cursorX[e]??0,cursorY:i.cursorY[e]??0,cursorVisible:i.cursorVisible[e]===1,scrollOffset:i.scrollOffset[e]??0}}function Gr(e,t,r,n,o){let l=(i.cursorY[t]??0)+1;l>=o&&(It(r,n,o),l=o-1),i.cursorX[t]=0,i.cursorY[t]=l,g$1(e,t);}function Hr(e,t,r){let n=i.cursorX[t]??0,o=Math.min((Math.floor(n/8)+1)*8,r-1);i.cursorX[t]=o,g$1(e,t);}function zr(e$1,t,r,n,o,l){let s=i.cursorX[t]??0,c=i.cursorY[t]??0,{fg:m,bg:b,attrs:y}=Yr(r.currentAttr),C=Pr(o,s,c);r.buffer.cells[C]=e(n,m,b,y);let L=s+1;L>=o&&(L=0,c++,c>=l&&(It(r,o,l),c=l-1)),i.cursorX[t]=L,i.cursorY[t]=c,g$1(e$1,t);}function Qr(e,t,r){let n=E.get(t);if(!n)return;let o=i.width[t]??0,l=i.height[t]??0;if(r===`
|
|
2
|
-
`){Gr(e,t,n,o,l);return}if(r==="\r"){i.cursorX[t]=0,g$1(e,t);return}if(r==="\b"){let s=i.cursorX[t]??0;s>0&&(i.cursorX[t]=s-1),g$1(e,t);return}if(r===" "){Hr(e,t,o);return}zr(e,t,n,r,o,l);}function Hl(e,t,r){let n=E.get(t);if(n)for(let o=0;o<r.length;o++){let l=r[o];if(l!==void 0){if(l==="\x1B"){n.inEscape=true,n.escapeBuffer=l;continue}if(n.inEscape){n.escapeBuffer+=l,Kr(n.escapeBuffer)&&(jr(e,t,n,n.escapeBuffer),n.inEscape=false,n.escapeBuffer="");continue}Qr(e,t,l);}}}function Kr(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 jr(e,t,r,n){if(n.length<2)return;let o=n[1];if(o==="["){$r(e,t,r,n);return}switch(o){case "c":En(e,t);break;case "7":r.savedCursorX=i.cursorX[t]??0,r.savedCursorY=i.cursorY[t]??0,r.savedAttr=f$2(r.currentAttr);break;case "8":i.cursorX[t]=r.savedCursorX,i.cursorY[t]=r.savedCursorY,r.currentAttr=f$2(r.savedAttr),g$1(e,t);break;case "D":nt(e,t,r,1);break;case "M":Tt(e,t,1);break;case "E":i.cursorX[t]=0,nt(e,t,r,1);break}}function $r(e,t,r,n){let o=n.match(/^\x1b\[(\??[\d;]*)([A-Za-z@`~])$/);if(!o)return;let l=o[1]??"",s=o[2],c=l===""?[]:l.split(";").map(L=>parseInt(L,10)||0),m=c[0]??1,b=c[1]??1,y=i.width[t]??0,C=i.height[t]??0;switch(s){case "A":Tt(e,t,m);break;case "B":nt(e,t,r,m);break;case "C":tn(e,t,m,y);break;case "D":en(e,t,m);break;case "E":i.cursorX[t]=0,nt(e,t,r,m);break;case "F":i.cursorX[t]=0,Tt(e,t,m);break;case "G":i.cursorX[t]=Math.min(Math.max(m-1,0),y-1),g$1(e,t);break;case "H":case "f":i.cursorY[t]=Math.min(Math.max(m-1,0),C-1),i.cursorX[t]=Math.min(Math.max(b-1,0),y-1),g$1(e,t);break;case "J":on(e,t,r,c[0]??0);break;case "K":ln(e,t,r,c[0]??0);break;case "m":hn(r,c.length===0?[0]:c);break;case "h":jt(e,t,r,l,true);break;case "l":jt(e,t,r,l,false);break;case "s":r.savedCursorX=i.cursorX[t]??0,r.savedCursorY=i.cursorY[t]??0;break;case "u":i.cursorX[t]=r.savedCursorX,i.cursorY[t]=r.savedCursorY,g$1(e,t);break}}function Zr(e,t,r){i.cursorVisible[t]=r?1:0,g$1(e,t);}function Jr(e,t,r,n){n?(r.savedCursorX=i.cursorX[t]??0,r.savedCursorY=i.cursorY[t]??0,Zt(e,t,r)):(Jt(e,t,r),i.cursorX[t]=r.savedCursorX,i.cursorY[t]=r.savedCursorY),g$1(e,t);}function qr(e,t,r,n,o){o?(Zt(e,t,r),n==="1047"&&qt(r,0,r.buffer.cells.length)):Jt(e,t,r),g$1(e,t);}function jt(e,t,r,n,o){let l=n.startsWith("?")?n.slice(1):n;if(l==="25"){Zr(e,t,o);return}if(l==="1049"){Jr(e,t,r,o);return}if(l==="47"||l==="1047"){qr(e,t,r,l,o);return}}function Zt(e$1,t,r){if(i.altScreenActive[t]===1)return;let n=i.width[t]??0,o=i.height[t]??0;r.altBuffer||(r.altBuffer=k$2(n,o));for(let s=0;s<r.buffer.cells.length&&s<r.altBuffer.cells.length;s++){let c=r.buffer.cells[s];c&&(r.altBuffer.cells[s]=f$4(c));}let l=e();for(let s=0;s<r.buffer.cells.length;s++)r.buffer.cells[s]=f$4(l);i.cursorX[t]=0,i.cursorY[t]=0,i.altScreenActive[t]=1;}function Jt(e,t,r){if(i.altScreenActive[t]!==0){if(r.altBuffer)for(let n=0;n<r.altBuffer.cells.length&&n<r.buffer.cells.length;n++){let o=r.altBuffer.cells[n];o&&(r.buffer.cells[n]=f$4(o));}i.altScreenActive[t]=0;}}function Tt(e,t,r){let n=i.cursorY[t]??0;i.cursorY[t]=Math.max(0,n-r),g$1(e,t);}function nt(e,t,r,n){let o=i.width[t]??0,l=i.height[t]??0,s=i.cursorY[t]??0;for(s+=n;s>=l;)It(r,o,l),s--;i.cursorY[t]=s,g$1(e,t);}function tn(e,t,r,n){let o=i.cursorX[t]??0;i.cursorX[t]=Math.min(n-1,o+r),g$1(e,t);}function en(e,t,r){let n=i.cursorX[t]??0;i.cursorX[t]=Math.max(0,n-r),g$1(e,t);}function qt(e$1,t,r){let n=e();for(let o=t;o<r;o++)e$1.buffer.cells[o]=f$4(n);}function te(e$1,t,r,n,o){let l=e();for(let s=n;s<=o;s++){let c=r*t+s;e$1.buffer.cells[c]=f$4(l);}}function ee(e$1,t,r,n){let o=e();for(let l=r;l<n;l++)for(let s=0;s<t;s++){let c=l*t+s;e$1.buffer.cells[c]=f$4(o);}}function rn(e,t,r,n,o){te(e,t,o,n,t-1),ee(e,t,o+1,r);}function nn(e,t,r,n){ee(e,t,0,n),te(e,t,n,0,r);}function on(e,t,r,n){let o=i.width[t]??0,l=i.height[t]??0,s=i.cursorX[t]??0,c=i.cursorY[t]??0;n===0?rn(r,o,l,s,c):n===1?nn(r,o,s,c):(n===2||n===3)&&(qt(r,0,r.buffer.cells.length),n===3&&f$3(r.scrollback)),g$1(e,t);}function ln(e$1,t,r,n){let o=i.width[t]??0,l=i.cursorX[t]??0,s=i.cursorY[t]??0,c=e();switch(n){case 0:for(let m=l;m<o;m++){let b=s*o+m;r.buffer.cells[b]=f$4(c);}break;case 1:for(let m=0;m<=l;m++){let b=s*o+m;r.buffer.cells[b]=f$4(c);}break;case 2:for(let m=0;m<o;m++){let b=s*o+m;r.buffer.cells[b]=f$4(c);}break}g$1(e$1,t);}function sn(e){return e.currentAttr=e$1(),1}function an(e,t,r){let n=t[r]??0;return e.currentAttr.styles|=1<<n-1,1}function cn(e,t,r){let n=t[r]??0;return e.currentAttr.styles&=~(1<<n-22+1),1}function un(e,t,r){let n=t[r]??0;return e.currentAttr.fg={type:1,value:n-30},1}function fn(e){return e.currentAttr.fg={type:0,value:0},1}function mn(e,t,r){let n=t[r]??0;return e.currentAttr.bg={type:1,value:n-40},1}function bn(e){return e.currentAttr.bg={type:0,value:0},1}function pn(e,t,r){let n=t[r]??0;return e.currentAttr.fg={type:1,value:n-90+8},1}function dn(e,t,r){let n=t[r]??0;return e.currentAttr.bg={type:1,value:n-100+8},1}function gn(e){return e===0?sn:e>=1&&e<=9?an:e>=22&&e<=29?cn:e>=30&&e<=37?un:e===39?fn:e>=90&&e<=97?pn:e>=40&&e<=47?mn:e===49?bn:e>=100&&e<=107?dn:null}function yn(e,t,r){let n=t[r]??0;if(n===38){let l=$t(e,t,r,"fg");return l>0?l:1}if(n===48){let l=$t(e,t,r,"bg");return l>0?l:1}let o=gn(n);return o?o(e,t,r):1}function $t(e,t,r,n){if(r+1>=t.length)return 0;let o=t[r+1];if(o===5&&r+2<t.length){let l=t[r+2]??0;return e.currentAttr[n]={type:2,value:l},3}if(o===2&&r+4<t.length){let l=t[r+2]??0,s=t[r+3]??0,c=t[r+4]??0;return e.currentAttr[n]={type:3,value:l<<16|s<<8|c},5}return 0}function hn(e,t){let r=0;for(;r<t.length;){let n=yn(e,t,r);r+=n;}}function xn(e$2,t){let r=E.get(t);if(!r)return;let n=e();for(let o=0;o<r.buffer.cells.length;o++)r.buffer.cells[o]=f$4(n);i.cursorX[t]=0,i.cursorY[t]=0,r.currentAttr=e$1(),g$1(e$2,t);}function En(e,t){let r=E.get(t);r&&(xn(e,t),f$3(r.scrollback),r.escapeBuffer="",r.inEscape=false,r.savedCursorX=0,r.savedCursorY=0,r.savedAttr=e$1(),i.cursorVisible[t]=1,i.scrollOffset[t]=0,g$1(e,t));}function zl(e,t,r,n){let o=i.width[t]??0,l=i.height[t]??0;i.cursorX[t]=Math.min(Math.max(r,0),o-1),i.cursorY[t]=Math.min(Math.max(n,0),l-1),g$1(e,t);}function Ql(e,t,r){i.cursorVisible[t]=r?1:0,g$1(e,t);}function Kl(e,t,r){let n=E.get(t);if(!n)return;let o=i.scrollOffset[t]??0,l=n.scrollback.totalLines;i.scrollOffset[t]=Math.min(o+r,l),g$1(e,t);}function jl(e,t,r){let n=i.scrollOffset[t]??0;i.scrollOffset[t]=Math.max(0,n-r),g$1(e,t);}function $l(e,t){let r=E.get(t);r&&(i.scrollOffset[t]=r.scrollback.totalLines,g$1(e,t));}function Zl(e,t){i.scrollOffset[t]=0,g$1(e,t);}function Jl(e,t,r,n){let o=E.get(t);if(!o)return;let l=i.width[t]??0,s=i.height[t]??0,c=k$2(r,n),m=Math.min(l,r),b=Math.min(s,n);for(let L=0;L<b;L++)for(let J=0;J<m;J++){let re=L*l+J,ne=L*r+J,At=o.buffer.cells[re];At&&(c.cells[ne]=f$4(At));}o.buffer=c,i.width[t]=r,i.height[t]=n;let y=i.cursorX[t]??0,C=i.cursorY[t]??0;i.cursorX[t]=Math.min(y,r-1),i.cursorY[t]=Math.min(C,n-1),g$1(e,t);}function ql(e){i.isTerminal[e]=0,i.width[e]=0,i.height[e]=0,i.cursorX[e]=0,i.cursorY[e]=0,i.cursorVisible[e]=0,i.scrollOffset[e]=0,i.altScreenActive[e]=0,E.delete(e);}function Cn(e,t,r){let n=j$1(e.scrollback,e.scrollback.totalLines-r,e.scrollback.totalLines-r+t),o="";for(let l of n.lines)o+=l.ansi??l.text,o+=`
|
|
3
|
-
`;return o}function Ln(e,t){let r="";return (e.fg!==t.fg||e.bg!==t.bg)&&(r+="\x1B[0m",t.fg=e.fg,t.bg=e.bg),r+=e.char,{output:r,fg:t.fg,bg:t.bg}}function ts(e){let t=E.get(e);if(!t)return "";let r=i.width[e]??0,n=i.height[e]??0,o=i.scrollOffset[e]??0;if(o>0)return Cn(t,n,o);let l="",s={fg:-1,bg:-1};for(let c=0;c<n;c++){for(let m=0;m<r;m++){let b=c*r+m,y=t.buffer.cells[b];if(!y)continue;let C=Ln(y,s);l+=C.output,s.fg=C.fg,s.bg=C.bg;}c<n-1&&(l+=`
|
|
4
|
-
`);}return l}function es(e){return E.get(e)?.buffer.cells}function rs(){i.isTerminal.fill(0),i.width.fill(0),i.height.fill(0),i.cursorX.fill(0),i.cursorY.fill(0),i.cursorVisible.fill(0),i.scrollOffset.fill(0),i.altScreenActive.fill(0),E.clear();}export{Ge as $,jo as $a,Xr as $b,ye as A,ur as Aa,pl as Ab,he as B,St as Ba,dl as Bb,xe as C,fr as Ca,gl as Cb,gt as D,Yt as Da,yl as Db,Ee as E,mr as Ea,hl as Eb,Ce as F,vt as Fa,xl as Fb,Le as G,br as Ga,El as Gb,Se as H,pr as Ha,Cl as Hb,ve as I,dr as Ia,Ll as Ib,Te as J,rt as Ja,Sl as Jb,Ie as K,gr as Ka,vl as Kb,Ae as L,yr as La,Tl as Lb,we as M,hr as Ma,Il as Mb,x as N,Nt as Na,Al as Nb,Be as O,xr as Oa,wl as Ob,Fe as P,Er as Pa,Wl as Pb,_e as Q,Cr as Qa,Dl as Qb,ke as R,Sr as Ra,Bl as Rb,Me as S,vr as Sa,Fl as Sb,Re as T,Tr as Ta,_l as Tb,Ue as U,Oo as Ua,Br as Ub,Xe as V,Go as Va,kl as Vb,Ve as W,Ho as Wa,Ml as Wb,Pe as X,zo as Xa,Mr as Xb,Ye as Y,p as Ya,Rr as Yb,Ne as Z,Qo as Za,Ur as Zb,xt as _,Ko as _a,i as _b,at as a,Y as aa,$o as ab,Nl as ac,ct as b,Et as ba,Zo as bb,Or as bc,ut as c,et as ca,Jo as cb,Ol as cc,ft as d,He as da,qo as db,Gl as dc,mt as e,Ct as ea,Ir as eb,Qr as ec,bt as f,k as fa,tl as fb,Hl as fc,pt as g,ze as ga,el as gb,xn as gc,a as h,Qe as ha,rl as hb,En as hc,_ as i,Ke as ia,Ot as ib,zl as ic,oe as j,je as ja,Gt as jb,Ql as jc,le as k,$e as ka,Ht as kb,Kl as kc,se as l,Lt as la,zt as lb,jl as lc,A as m,Ze as ma,Qt as mb,$l as mc,ie as n,Je as na,Kt as nb,Zl as nc,ae as o,qe as oa,w as ob,Jl as oc,ce as p,tr as pa,f as pb,ql as pc,ue as q,er as qa,ll as qb,ts as qc,tt as r,M as ra,sl as rb,es as rc,me as s,rr as sa,il as sb,rs as sc,be as t,nr as ta,al as tb,yt as u,or as ua,cl as ub,pe as v,lr as va,ul as vb,ht as w,sr as wa,fl as wb,de as x,ir as xa,Ar as xb,Pt as y,ar as ya,ml as yb,ge as z,cr as za,bl as zb};
|
package/dist/chunk-3UJWZ5ZN.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b,d as d$2}from'./chunk-4LWWONFK.js';import {d as d$1,A,i,B as B$1}from'./chunk-TWSWTBYL.js';import {a,e as e$1,r,o,t}from'./chunk-C5PCEQ6G.js';import {k as k$2}from'./chunk-VOCM5T2G.js';import {c as c$1,a as a$1}from'./chunk-3AV52GY5.js';import {u,p as p$2,k as k$1}from'./chunk-DYU72XLL.js';import {E,c,p as p$1,h,e}from'./chunk-ZAHG7Y3X.js';import {n,k,i as i$1}from'./chunk-PXXGH3BV.js';import {z}from'zod';u();n();var d=z.number().int().min(0).max(4294967295),J=z.number().int().min(0).max(65535),ne=z.object({fg:d.optional(),bg:d.optional(),selectedFg:d.optional(),selectedBg:d.optional(),cursorFg:d.optional(),cursorBg:d.optional(),showLineNumbers:z.boolean().optional(),lineNumberWidth:z.number().int().nonnegative().max(20).optional(),attrs:J.optional()}),Re=z.object({fg:d.default(4294967295),bg:d.default(255),selectedFg:d.default(255),selectedBg:d.default(4294967295),cursorFg:d.default(255),cursorBg:d.default(16711935),showLineNumbers:z.boolean().default(false),lineNumberWidth:z.number().int().nonnegative().max(20).default(0),attrs:J.default(a.NONE)}),Q={fg:4294967295,bg:255,selectedFg:255,selectedBg:4294967295,cursorFg:255,cursorBg:16711935,showLineNumbers:false,lineNumberWidth:0,attrs:a.NONE},p=null,L=new Map,B=new Map;function Ne(t){p=t;}function Se(){return p}function Ve(){p=null;}function ve(t,e){L.set(t,e);}function we(t){return L.get(t)}function De(t){L.delete(t);}function ze(t,e){L.set(t,e);}function We(t,e){let r=ne.parse(e),f={};for(let[n,o]of Object.entries(r))o!==void 0&&(f[n]=o);let i=B.get(t)??Q;B.set(t,{...i,...f});}function re(t){return B.get(t)??Q}function Fe(t){B.delete(t);}function ie(t,e){if(!i$1(t,e,c))return a.NONE;let r=a.NONE;return c.bold[e]===1&&(r|=a.BOLD),c.underline[e]===1&&(r|=a.UNDERLINE),c.blink[e]===1&&(r|=a.BLINK),c.inverse[e]===1&&(r|=a.INVERSE),r}function oe(t,e){if(c$1(t,e))return {x:a$1.x[e],y:a$1.y[e],width:a$1.width[e],height:a$1.height[e]}}function fe(t,e){return p$2(t,e)?{top:k$1.top[e]===1?1:0,right:k$1.right[e]===1?1:0,bottom:k$1.bottom[e]===1?1:0,left:k$1.left[e]===1?1:0}:{top:0,right:0,bottom:0,left:0}}function ue(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 M(t$1,e,r,f,i,n,o$1,u){let m=e$1(" ",n,o$1,u);for(let l=0;l<f;l++)o(t$1,e+l,r,m);let a=i.length>f?i.slice(0,f):i;a.length>0&&t(t$1,e,r,a,n,o$1,u);}function le(t$1,e,r,f,i,n,o){let u=`${String(i+1).padStart(f-1," ")} `;t(t$1,e,r,u.slice(0,f),n,o,a.DIM);}function ae(t,e,r,f,i,n){let{buffer:o}=t,{x:u,y:m,width:a$1,height:l}=r,x=k$2(i,f.start,f.end),S=n.showLineNumbers?u+n.lineNumberWidth:u,V=n.showLineNumbers?Math.max(0,a$1-n.lineNumberWidth):a$1,b=d$1.selectedLine[e],v=d$1.cursorLine[e];for(let c=0;c<x.lines.length;c++){let E=m+c;if(c>=l)break;let D=x.startLine+c,Z=x.lines[c]??"",z=n.fg,W=n.bg;D===v?(z=n.cursorFg,W=n.cursorBg):D===b&&(z=n.selectedFg,W=n.selectedBg),n.showLineNumbers&&le(o,u,E,n.lineNumberWidth,D,n.fg,n.bg),M(o,S,E,V,Z,z,W,n.attrs);}let T=Math.min(x.lines.length,l);for(let c=T;c<l;c++){let E=m+c;n.showLineNumbers&&M(o,u,E,n.lineNumberWidth,"",n.fg,n.bg,a.NONE),M(o,S,E,V,"",n.fg,n.bg,a.NONE);}}function se(t,e,r,f,i){if(r<=i)return;let{buffer:n}=t,o$1=e.height,u=e.x+e.width-1,m=e.y,a=i/r,l=Math.max(1,Math.floor(o$1*a)),x=Math.floor(f/r*o$1),S=e$1("\u2502",1717987071,255);for(let b=0;b<o$1;b++)o(n,u,m+b,S);let V=e$1("\u2588",2863311615,255);for(let b=0;b<l;b++){let v=m+x+b;v<m+o$1&&o(n,u,v,V);}}function de(t,e$2,r$1){let{world:f,buffer:i}=t,n=e(f,e$2);if(!n||n.transparent)return;let o=ie(f,e$2),u=e$1(" ",n.fg,n.bg,o);r(i,r$1.x,r$1.y,r$1.width,r$1.height,u);}function me(t,e){let{world:r,doubleBuffer:f}=t,i$1=oe(r,e);if(!i$1||i$1.width<=0||i$1.height<=0)return;let n=L.get(e);if(!n)return;let o=i(r,e);if(!o)return;let u=re(e);de(t,e,i$1);let m=fe(r,e),a=ue(i$1,m);a.width>0&&a.height>0&&ae(t,e,a,o,n,u);let l={firstVisibleLine:d$1.firstVisibleLine[e],visibleLineCount:d$1.visibleLineCount[e],totalLineCount:d$1.totalLineCount[e]};l.totalLineCount>l.visibleLineCount&&se(t,a,l.totalLineCount,l.firstVisibleLine,l.visibleLineCount),d$2(f,i$1.x,i$1.y,i$1.width,i$1.height),B$1(r,e),h(r,e);}var ce=t=>{if(!p)return t;let e=b(p),r={world:t,buffer:e,doubleBuffer:p},f=k(t,[d$1,E,c]);for(let i of f)p$1(t,i)&&(!A(t,i)&&c.dirty[i]!==1||me(r,i));return t};function Me(){return ce}function Oe(){p=null,L.clear(),B.clear();}function ke(t){L.delete(t),B.delete(t);}export{Re as a,Ne as b,Se as c,Ve as d,ve as e,we as f,De as g,ze as h,We as i,re as j,Fe as k,ce as l,Me as m,Oe as n,ke as o};
|
package/dist/chunk-5PELJRUQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var k=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var l=(a,b)=>()=>(a&&(b=a(a=0)),b);var m=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:true});},j=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of h(b))!i.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=g(b,d))||f.enumerable});return a};var n=a=>j(e({},"__esModule",{value:true}),a);export{k as a,l as b,m as c,n as d};
|
package/dist/chunk-6M2J5QUA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {x,w as w$1,c}from'./chunk-ZAHG7Y3X.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,i){return t(r,e)?(o.cursorX[e]=Math.max(0,Math.floor(n)),o.cursorY[e]=Math.max(0,Math.floor(i)),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=x(r,e),i=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:i===a$1?null:i,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=x(r,e);if(n)return {width:n.width,height:n.height}}function K(r,e,n,i){return !t(r,e)||n<=0||i<=0?false:(w$1(r,e,n,i),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-7IQEUVGF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {n,f,i}from'./chunk-PXXGH3BV.js';n();var s=class extends Error{constructor(t){super(t),this.name="EntityValidationError";}},p=new WeakMap;function l(n,t){p.set(n,t);}function g(n){let t=p.get(n);if(t)return t;if(n&&typeof n=="object"){let e=Object.keys(n);if(e.length>0)return `Component(${e.slice(0,2).join(", ")}${e.length>2?", ...":""})`}return "Component"}function u(n,t,e,r){if(!f(n,t))throw new s(`Entity ${t} does not exist in the world (context: ${r}). The entity may have been removed or never created.`);let o=[];for(let i$1 of e)i(n,t,i$1)||o.push(g(i$1));if(o.length>0){let i=o.join(", "),c=o[0];throw new s(`Entity ${t} is missing required component${o.length>1?"s":""} for ${r}: ${i}. Did you forget to call addComponent(world, ${t}, ${c})?`)}}function C(n,t,e){if(!f(n,t))return false;for(let r of e)if(!i(n,t,r))return false;return true}export{s as a,l as b,u as c,C as d};
|
package/dist/chunk-A6M6TFBL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {g as g$1}from'./chunk-ZAHG7Y3X.js';import {n,h as h$1,i,j as j$1,l as l$1,m as m$1}from'./chunk-PXXGH3BV.js';import {z as z$1}from'zod';n();function pt(e){return typeof e=="string"?{target:e}:e}function xt(e){let t=e.initial,n=e.context,o=new Set;function r(s){if(s)for(let c of s)c(n);}function i(s){if(s!==t)for(let c of o)c(t,s);}let d=e.states[t];if(d?.entry)for(let s of d.entry)s(n);let x={get current(){return t},get context(){return n},send(s){let c=e.states[t];if(!c?.on)return false;let b=c.on[s];if(b===void 0)return false;let{target:B,actions:Ut,guard:ct}=pt(b);if(ct&&!ct(n))return false;let _t=t;return r(c.exit),r(Ut),t=B,r(e.states[t]?.entry),i(_t),true},can(s){let c=e.states[t];if(!c?.on)return false;let b=c.on[s];if(b===void 0)return false;let{guard:B}=pt(b);return !(B&&!B(n))},matches(s){return t===s},subscribe(s){return o.add(s),()=>{o.delete(s);}},validEvents(){let s=e.states[t];if(!s?.on)return [];let c=[];for(let b of Object.keys(s.on))x.can(b)&&c.push(b);return c},reset(){let s=t;r(e.states[t]?.exit),t=e.initial,r(e.states[t]?.entry),i(s);}};return x}var Lt=z$1.union([z$1.string(),z$1.object({target:z$1.string()})]),Ot=z$1.object({entry:z$1.array(z$1.function()).optional(),exit:z$1.array(z$1.function()).optional(),on:z$1.record(z$1.string(),Lt).optional()});z$1.object({initial:z$1.string(),states:z$1.record(z$1.string(),Ot),context:z$1.unknown().optional()});var Ft=1e4;function wt(e=Ft){return {machineId:new Uint32Array(e),currentState:new Uint16Array(e),previousState:new Uint16Array(e),stateAge:new Float32Array(e)}}var l=wt(),ht=new WeakSet,bt=null;function S(e){return ht.has(e)||(bt=l$1(e,m$1(()=>l)),ht.add(e)),bt}var X=new Map,q=new Map,J=new Map,gt=1,C={register(e){let t=gt++,n=xt(e);X.set(t,n);let o=Object.keys(e.states),r=new Map;for(let i=0;i<o.length;i++){let d=o[i];d!==void 0&&r.set(d,i);}return q.set(t,r),J.set(t,o),t},getMachine(e){return X.get(e)},getStateIndex(e,t){return q.get(e)?.get(t)??0},getStateName(e,t){return J.get(e)?.[t]??""},unregister(e){X.delete(e),q.delete(e),J.delete(e);},clear(){X.clear(),q.clear(),J.clear(),gt=1;}};function k(e,t,n){let o=S(e),r=C.register(n),i=C.getStateIndex(r,n.initial);return h$1(e,t,o),l.machineId[t]=r,l.currentState[t]=i,l.previousState[t]=i,l.stateAge[t]=0,r}function Me(e,t){let n=S(e);if(!i(e,t,n))return;let o=l.machineId[t]??0;C.unregister(o),j$1(e,t,n);}function h(e,t){let n=S(e);if(!i(e,t,n))return "";let o=l.machineId[t]??0,r=l.currentState[t]??0;return C.getStateName(o,r)}function Re(e,t){let n=S(e);if(!i(e,t,n))return "";let o=l.machineId[t]??0,r=l.previousState[t]??0;return C.getStateName(o,r)}function m(e,t,n){let o=S(e);if(!i(e,t,o))return false;let r=l.machineId[t]??0,i$1=C.getMachine(r);if(!i$1)return false;let d=i$1.current,x=i$1.send(n);if(x){let s=C.getStateIndex(r,i$1.current),c=C.getStateIndex(r,d);l.previousState[t]=c,l.currentState[t]=s,l.stateAge[t]=0;}return x}function Ue(e,t,n){let o=S(e);if(!i(e,t,o))return false;let r=l.machineId[t]??0,i$1=C.getMachine(r);return i$1?i$1.can(n):false}function _e(e,t){let n=S(e);return i(e,t,n)?l.stateAge[t]??0:0}function I(e,t,n){return h(e,t)===n}function De(e,t,n){let o=S(e);for(let r of t)if(i(e,r,o)){let i=l.stateAge[r]??0;l.stateAge[r]=i+n;}}function W(e,t){let n=S(e);return i(e,t,n)}var Vt={initial:"idle",states:{idle:{on:{mouseenter:"hovered",focus:"focused",disable:"disabled"}},hovered:{on:{mousedown:"pressed",mouseleave:"idle",focus:"focused",disable:"disabled"}},pressed:{on:{mouseup:"hovered",mouseleave:"idle"}},focused:{on:{blur:"idle",mouseenter:"hovered",disable:"disabled"}},disabled:{on:{enable:"idle"}}}},Pt=1e4;function Ht(e=Pt){return {isButton:new Uint8Array(e),machineId:new Uint32Array(e)}}var P=Ht(),A=new Map;function we(){P.isButton.fill(0),P.machineId.fill(0),A.clear();}function Ve(e,t){let n=k(e,t,Vt);return P.isButton[t]=1,P.machineId[t]=n,n}function H(e,t){return (P.isButton[t]??0)===1&&W(e,t)}function yt(e,t){if(H(e,t))return h(e,t)}function Et(e,t,n){if(!H(e,t))return false;let o=h(e,t),r=m(e,t,n);return r&&(g$1(e,t),o==="pressed"&&n==="mouseup"&&Ct(t)),r}function Q(e,t,n){return H(e,t)?I(e,t,n):false}function Pe(e,t){return Q(e,t,"hovered")}function He(e,t){return Q(e,t,"pressed")}function Ke(e,t){return Q(e,t,"focused")}function Ne(e,t){return Q(e,t,"disabled")}function je(e,t){return Et(e,t,"disable")}function Ge(e,t){return Et(e,t,"enable")}function Ye(e,t){let n=A.get(e);return n||(n=[],A.set(e,n)),n.push(t),()=>{let o=A.get(e);if(o){let r=o.indexOf(t);r!==-1&&o.splice(r,1);}}}function Ct(e){let t=A.get(e);if(t)for(let n of t)n();}function Kt(e,t){return !H(e,t)||yt(e,t)==="disabled"?false:(Ct(t),true)}function ze(e){A.delete(e);}function Xe(e,t,n){if(!H(e,t))return false;let o=yt(e,t);return o==="disabled"||o!=="focused"?false:n==="return"||n==="enter"||n==="space"?(Kt(e,t),true):false}var Nt={initial:"unchecked",states:{unchecked:{on:{toggle:"checked",check:"checked",disable:"disabled"}},checked:{on:{toggle:"unchecked",uncheck:"unchecked",disable:"disabled"}},disabled:{on:{enable:"unchecked"}}}},jt=1e4;function Gt(e=jt){return {isCheckbox:new Uint8Array(e),machineId:new Uint32Array(e)}}var K=Gt(),M=new Map,St="\u2611",mt="\u2610",N=new Map;function Ze(){K.isCheckbox.fill(0),K.machineId.fill(0),M.clear(),N.clear();}function $e(e,t,n=false){let o=k(e,t,Nt);return K.isCheckbox[t]=1,K.machineId[t]=o,n&&m(e,t,"check"),o}function j(e,t){return (K.isCheckbox[t]??0)===1&&W(e,t)}function Z(e,t){if(j(e,t))return h(e,t)}function G(e,t,n){if(!j(e,t))return false;let o=h(e,t),r=m(e,t,n);if(r){g$1(e,t);let i=h(e,t);(o==="checked"||o==="unchecked")&&(i==="checked"||i==="unchecked")&&o!==i&&qt(t,i==="checked");}return r}function $(e,t,n){return j(e,t)?I(e,t,n):false}function tn(e,t){return $(e,t,"checked")}function en(e,t){return $(e,t,"unchecked")}function nn(e,t){return $(e,t,"disabled")}function Yt(e,t){return G(e,t,"toggle")}function zt(e,t){return G(e,t,"check")}function Xt(e,t){return G(e,t,"uncheck")}function on(e,t){return G(e,t,"disable")}function rn(e,t){return G(e,t,"enable")}function an(e,t,n){if(!j(e,t))return false;let o=Z(e,t);return o==="disabled"?false:n&&o==="unchecked"?zt(e,t):!n&&o==="checked"?Xt(e,t):false}function sn(e,t){let n=M.get(e);return n||(n=[],M.set(e,n)),n.push(t),()=>{let o=M.get(e);if(o){let r=o.indexOf(t);r!==-1&&o.splice(r,1);}}}function qt(e,t){let n=M.get(e);if(n)for(let o of n)o(t);}function cn(e){M.delete(e);}function un(e,t,n){return !j(e,t)||Z(e,t)==="disabled"?false:n==="return"||n==="enter"||n==="space"?(Yt(e,t),true):false}function ln(e,t){let n=N.get(e)??{checkedChar:St,uncheckedChar:mt};N.set(e,{checkedChar:t.checkedChar??n.checkedChar,uncheckedChar:t.uncheckedChar??n.uncheckedChar});}function Jt(e){return N.get(e)??{checkedChar:St,uncheckedChar:mt}}function dn(e,t){let n=Jt(t);return Z(e,t)==="checked"?n.checkedChar:n.uncheckedChar}function fn(e){N.delete(e);}var Qt={initial:"idle",states:{idle:{on:{focus:"focused",disable:"disabled"}},focused:{on:{startEdit:"editing",blur:"idle",error:"error",disable:"disabled"}},editing:{on:{endEdit:"focused",blur:"idle",error:"error"}},error:{on:{clearError:"focused",blur:"idle",disable:"disabled"}},disabled:{on:{enable:"idle"}}}},Zt=1e4,U={Line:0,Block:1},$t=530;function te(e=Zt){return {isTextInput:new Uint8Array(e),machineId:new Uint32Array(e),cursorPos:new Uint32Array(e),selectionStart:new Int32Array(e).fill(-1),selectionEnd:new Int32Array(e).fill(-1),inputMode:new Uint8Array(e),cursorMode:new Uint8Array(e),cursorBlink:new Uint8Array(e).fill(1),cursorBlinkStart:new Float64Array(e)}}var a=te(),tt="*",et="",O=new Map,_=new Map,D=new Map,L=new Map,R=new Map;function bn(){a.isTextInput.fill(0),a.machineId.fill(0),a.cursorPos.fill(0),a.selectionStart.fill(-1),a.selectionEnd.fill(-1),a.inputMode.fill(0),a.cursorMode.fill(0),a.cursorBlink.fill(1),a.cursorBlinkStart.fill(0),O.clear(),_.clear(),D.clear(),L.clear(),it.clear(),R.clear();}function gn(e,t){let n=k(e,t,Qt);return a.isTextInput[t]=1,a.machineId[t]=n,a.cursorPos[t]=0,a.selectionStart[t]=-1,a.selectionEnd[t]=-1,a.inputMode[t]=0,a.cursorMode[t]=U.Line,a.cursorBlink[t]=1,a.cursorBlinkStart[t]=Date.now(),O.set(t,{secret:false,censor:tt,placeholder:et,maxLength:0,multiline:false}),n}function v(e,t){return (a.isTextInput[t]??0)===1&&W(e,t)}function nt(e,t){if(v(e,t))return h(e,t)}function T(e,t,n){if(!v(e,t))return false;let o=m(e,t,n);if(o){g$1(e,t);let r=h(e,t);a.inputMode[t]=r==="editing"?1:0;}return o}function ot(e,t,n){return v(e,t)?I(e,t,n):false}function yn(e,t){let n=nt(e,t);return n==="focused"||n==="editing"}function En(e,t){return ot(e,t,"editing")}function Cn(e,t){return ot(e,t,"error")}function Sn(e,t){return ot(e,t,"disabled")}function ee(e,t){return T(e,t,"focus")}function mn(e,t){return T(e,t,"blur")}function vn(e,t){return T(e,t,"startEdit")}function kn(e,t){return T(e,t,"endEdit")}function In(e,t){return T(e,t,"disable")}function Wn(e,t){return T(e,t,"enable")}function Tn(e,t){return T(e,t,"error")}function Bn(e,t){return T(e,t,"clearError")}function rt(e,t){return a.cursorPos[t]??0}function ne(e,t,n){v(e,t)&&(a.cursorPos[t]=Math.max(0,n),a.cursorBlinkStart[t]=Date.now(),g$1(e,t));}function An(e,t,n){let o=rt(e,t);ne(e,t,o+n);}function vt(e,t){let n=a.selectionStart[t],o=a.selectionEnd[t];return n===void 0||o===void 0||n<0||o<0?null:[n,o]}function Mn(e,t,n,o){v(e,t)&&(a.selectionStart[t]=n,a.selectionEnd[t]=o,g$1(e,t));}function Rn(e,t){v(e,t)&&(a.selectionStart[t]=-1,a.selectionEnd[t]=-1,g$1(e,t));}function Un(e,t){return vt(e,t)!==null}var oe="\u2502",re="\u2588",it=new Map;function at(e,t){return it.get(t)??{blink:true,blinkIntervalMs:$t,lineChar:oe,blockChar:re}}function _n(e,t,n){let o=at(e,t);it.set(t,{blink:n.blink??o.blink,blinkIntervalMs:n.blinkIntervalMs??o.blinkIntervalMs,lineChar:n.lineChar??o.lineChar,blockChar:n.blockChar??o.blockChar});}function st(e,t){return a.cursorMode[t]??0}function ie(e,t,n){v(e,t)&&(a.cursorMode[t]=n,g$1(e,t));}function Dn(e,t){let o=st(e,t)===U.Line?U.Block:U.Line;return ie(e,t,o),o}function ae(e,t){return (a.cursorBlink[t]??1)===1}function Ln(e,t,n){v(e,t)&&(a.cursorBlink[t]=n?1:0,n&&(a.cursorBlinkStart[t]=Date.now()),g$1(e,t));}function On(e,t){a.cursorBlinkStart[t]=Date.now();}function se(e,t){let n=nt(e,t);if(n!=="focused"&&n!=="editing")return false;if(!ae(e,t))return true;let o=at(e,t),r=a.cursorBlinkStart[t]??Date.now(),i=Date.now()-r;return Math.floor(i/o.blinkIntervalMs)%2===0}function ce(e,t){let n=at(e,t);return st(e,t)===U.Block?n.blockChar:n.lineChar}function Fn(e,t,n){let o=y(e,t),r=rt(e,t),i=n;if(o.secret&&(i=o.censor.repeat(n.length)),i.length===0&&o.placeholder)return {displayText:o.placeholder,cursorVisible:false,cursorPosition:0};if(!se(e,t))return {displayText:i,cursorVisible:false,cursorPosition:r};let x=ce(e,t),s=st(e,t),c;return s===U.Block&&r<i.length?c=i.substring(0,r)+x+i.substring(r+1):c=i.substring(0,r)+x+i.substring(r),{displayText:c,cursorVisible:true,cursorPosition:r}}function wn(e,t){let n=vt(e,t);if(!n)return null;let[o,r]=n;return {start:Math.min(o,r),end:Math.max(o,r)}}function Vn(e,t,n){let o=O.get(t)??{secret:false,censor:tt,placeholder:et,maxLength:0,multiline:false,validator:void 0,validationTiming:"both"};O.set(t,{secret:n.secret??o.secret,censor:n.censor??o.censor,placeholder:n.placeholder??o.placeholder,maxLength:n.maxLength??o.maxLength,multiline:n.multiline??o.multiline,validator:n.validator??o.validator,validationTiming:n.validationTiming??o.validationTiming});}function y(e,t){return O.get(t)??{secret:false,censor:tt,placeholder:et,maxLength:0,multiline:false,validator:void 0,validationTiming:"both"}}function ue(e,t){return y(e,t).secret}function le(e,t){return y(e,t).censor}function Pn(e,t){return y(e,t).placeholder}function Hn(e,t){return y(e,t).maxLength}function Kn(e,t){return y(e,t).multiline}function Nn(e,t,n){return ue(e,t)?le(e,t).repeat(n.length):n}function jn(e,t,n){let o=_.get(t);return o||(o=[],_.set(t,o)),o.push(n),()=>{let r=_.get(t);if(r){let i=r.indexOf(n);i!==-1&&r.splice(i,1);}}}function Gn(e,t,n){let o=D.get(t);return o||(o=[],D.set(t,o)),o.push(n),()=>{let r=D.get(t);if(r){let i=r.indexOf(n);i!==-1&&r.splice(i,1);}}}function Yn(e,t,n){let o=L.get(t);return o||(o=[],L.set(t,o)),o.push(n),()=>{let r=L.get(t);if(r){let i=r.indexOf(n);i!==-1&&r.splice(i,1);}}}function zn(e,t,n){let o=y(e,t);o.validator&&(o.validationTiming==="onChange"||o.validationTiming==="both")&&kt(e,t,n);let r=_.get(t);if(r)for(let i of r)i(n);}function Xn(e,t,n){let o=y(e,t);if(o.validator&&(o.validationTiming==="onSubmit"||o.validationTiming==="both")&&!kt(e,t,n))return false;let r=D.get(t);if(r)for(let i of r)i(n);return true}function qn(e,t){let n=L.get(t);if(n)for(let o of n)o();}function Jn(e,t){_.delete(t),D.delete(t),L.delete(t),O.delete(t),R.delete(t);}function kt(e,t,n){let o=y(e,t);if(!o.validator)return R.set(t,null),true;let r=o.validator(n);return r===true?(R.set(t,null),true):r===false?(R.set(t,"Invalid input"),false):(R.set(t,r),false)}function de(e,t,n){return e.multiline?e.maxLength>0&&n.length>=e.maxLength?null:{type:"newline",position:t}:{type:"submit",value:n}}function fe(e,t){return e.multiline?{type:"submit",value:t}:{type:"cancel"}}function pe(e,t,n){return e==="left"&&t>0?{type:"moveCursor",position:t-1}:e==="right"&&t<n?{type:"moveCursor",position:t+1}:e==="home"&&t!==0?{type:"moveCursor",position:0}:e==="end"&&t!==n?{type:"moveCursor",position:n}:null}function xe(e,t,n){return e==="backspace"&&t>0?{type:"delete",start:t-1,end:t}:e==="delete"&&t<n?{type:"delete",start:t,end:t+1}:null}function he(e,t,n){return e==="left"?{type:"moveWordLeft",text:n,position:t}:e==="right"?{type:"moveWordRight",text:n,position:t}:e==="backspace"?{type:"deleteWordBackward",text:n,position:t}:e==="delete"?{type:"deleteWordForward",text:n,position:t}:null}function be(e,t,n,o){return e.length!==1||n.maxLength>0&&o>=n.maxLength?null:{type:"insert",char:e,position:t}}function Qn(e,t,n,o,r=false){if(!v(e,t))return null;let i=nt(e,t);if(i==="disabled")return null;if(i==="idle")return ee(e,t),null;let d=rt(e,t),x=y(e,t),s=o.length;if(n==="return"||n==="enter")return de(x,d,o);if(n==="escape")return fe(x,o);if(r){let B=he(n,d,o);if(B)return B}let c=xe(n,d,s);if(c)return c;let b=pe(n,d,s);return b||be(n,d,x,s)}var ge={initial:"unselected",states:{unselected:{on:{select:"selected",disable:"disabled"}},selected:{on:{deselect:"unselected",disable:"disabled"}},disabled:{on:{enable:"unselected"}}}},It=1e4;function ye(e=It){return {isRadioButton:new Uint8Array(e),machineId:new Uint32Array(e),radioSetId:new Uint32Array(e)}}var p=ye();function Ee(e=It){return {isRadioSet:new Uint8Array(e),selectedButton:new Uint32Array(e)}}var g=Ee(),Wt="\u25C9",Tt="\u25CB",Y=new Map,w=new Map,F=new Map;function eo(){p.isRadioButton.fill(0),p.machineId.fill(0),p.radioSetId.fill(0),g.isRadioSet.fill(0),g.selectedButton.fill(0),Y.clear(),w.clear(),F.clear();}function no(e,t){g.isRadioSet[t]=1,g.selectedButton[t]=0,g$1(e,t);}function oo(e,t){return g.isRadioSet[t]===1}function Ce(e){return g.selectedButton[e]}function ro(e){let t=g.selectedButton[e];return t===0?null:w.get(t)??null}function io(e,t){let n=F.get(e)??[];return n.push(t),F.set(e,n),()=>{let o=F.get(e);if(o){let r=o.indexOf(t);r!==-1&&o.splice(r,1);}}}function Bt(e){let t=F.get(e);if(t){let n=Ce(e),o=n!==0?w.get(n)??null:null;for(let r of t)r(o,n!==0?n:null);}}function ao(e){F.delete(e);}function so(e,t,n){p.isRadioButton[t]=1,p.radioSetId[t]=n??0;let o=k(e,t,ge);return p.machineId[t]=o,me(t,{}),g$1(e,t),o}function V(e,t){return p.isRadioButton[t]===1}function co(e,t){if(V(e,t)&&W(e,t))return h(e,t)}function z(e,t,n){return V(e,t)?m(e,t,n):false}function At(e,t,n){return V(e,t)?I(e,t,n):false}function Se(e,t){return At(e,t,"selected")}function Mt(e,t){return At(e,t,"disabled")}function uo(e){return p.radioSetId[e]}function lo(e,t){p.radioSetId[e]=t;}function fo(e){return w.get(e)}function po(e,t){w.set(e,t);}function Rt(e,t){if(!V(e,t)||Mt(e,t))return;let n=p.radioSetId[t];if(n!==0){let o=g.selectedButton[n];o!==0&&o!==t&&z(e,o,"deselect"),g.selectedButton[n]=t;}z(e,t,"select"),g$1(e,t),n!==0&&Bt(n);}function xo(e,t){if(!V(e,t))return;z(e,t,"deselect");let n=p.radioSetId[t];n!==0&&g.selectedButton[n]===t&&(g.selectedButton[n]=0,Bt(n)),g$1(e,t);}function ho(e,t){z(e,t,"disable"),g$1(e,t);}function bo(e,t){z(e,t,"enable"),g$1(e,t);}function me(e,t){let n=Y.get(e);Y.set(e,{selectedChar:t.selectedChar??n?.selectedChar??Wt,unselectedChar:t.unselectedChar??n?.unselectedChar??Tt});}function ve(e){return Y.get(e)??{selectedChar:Wt,unselectedChar:Tt}}function go(e,t){let n=ve(t);return Se(e,t)?n.selectedChar:n.unselectedChar}function yo(e){Y.delete(e);}function Eo(e,t,n){return !V(e,t)||Mt(e,t)?false:n==="space"||n==="return"||n==="enter"?(Rt(e,t),true):false}function ke(e){let t=[];for(let n=0;n<p.isRadioButton.length;n++)p.isRadioButton[n]===1&&p.radioSetId[n]===e&&t.push(n);return t}function Co(e,t,n){let o=ke(t);for(let r of o)if(w.get(r)===n)return Rt(e,r),true;return false}export{dn as $,Nn as $a,Kt as A,ne as Aa,Mt as Ab,ze as B,An as Ba,uo as Bb,Xe as C,vt as Ca,lo as Cb,Nt as D,Mn as Da,fo as Db,K as E,Rn as Ea,po as Eb,St as F,Un as Fa,Rt as Fb,mt as G,oe as Ga,xo as Gb,Ze as H,re as Ha,ho as Hb,$e as I,at as Ia,bo as Ib,j as J,_n as Ja,me as Jb,Z as K,st as Ka,ve as Kb,G as L,ie as La,go as Lb,$ as M,Dn as Ma,yo as Mb,tn as N,ae as Na,Eo as Nb,en as O,Ln as Oa,ke as Ob,nn as P,On as Pa,Co as Pb,Yt as Q,se as Qa,zt as R,ce as Ra,Xt as S,Fn as Sa,on as T,wn as Ta,rn as U,Vn as Ua,an as V,y as Va,sn as W,ue as Wa,cn as X,le as Xa,un as Y,Pn as Ya,ln as Z,Hn as Za,Jt as _,Kn as _a,C as a,fn as aa,jn as ab,k as b,Qt as ba,Gn as bb,Me as c,U as ca,Yn as cb,h as d,$t as da,zn as db,Re as e,a as ea,Xn as eb,m as f,tt as fa,qn as fb,Ue as g,et as ga,Jn as gb,_e as h,bn as ha,Qn as hb,I as i,gn as ia,ge as ib,De as j,v as ja,p as jb,W as k,nt as ka,g as kb,Vt as l,T as la,Wt as lb,P as m,ot as ma,Tt as mb,we as n,yn as na,eo as nb,Ve as o,En as oa,no as ob,H as p,Cn as pa,oo as pb,yt as q,Sn as qa,Ce as qb,Et as r,ee as ra,ro as rb,Q as s,mn as sa,io as sb,Pe as t,vn as ta,ao as tb,He as u,kn as ua,so as ub,Ke as v,In as va,V as vb,Ne as w,Wn as wa,co as wb,je as x,Tn as xa,z as xb,Ge as y,Bn as ya,At as yb,Ye as z,rt as za,Se as zb};
|
package/dist/chunk-CIK4AMUA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {f,e}from'./chunk-SHUC6JWA.js';import {n,i,h}from'./chunk-PXXGH3BV.js';n();f();var d=1e4,g=1,O=1,_=4281545523,D=128,B=9608,Y=9618,M=9617,v=9619,r={enabled:new Uint8Array(d),offsetX:new Int8Array(d),offsetY:new Int8Array(d),color:new Uint32Array(d),opacity:new Uint8Array(d),char:new Uint32Array(d),blendWithBg:new Uint8Array(d)};function p(t){r.enabled[t]=0,r.offsetX[t]=g,r.offsetY[t]=O,r.color[t]=_,r.opacity[t]=D,r.char[t]=B,r.blendWithBg[t]=1;}function l(t,n){i(t,n,r)||(h(t,n,r),p(n));}function L(t,n,o){return l(t,n),H(n,o),n}function H(t,n){n.enabled!==void 0&&(r.enabled[t]=n.enabled?1:0),n.offsetX!==void 0&&(r.offsetX[t]=n.offsetX),n.offsetY!==void 0&&(r.offsetY[t]=n.offsetY),n.color!==void 0&&(r.color[t]=e(n.color)),n.opacity!==void 0&&(r.opacity[t]=Math.max(0,Math.min(255,n.opacity))),n.char!==void 0&&(r.char[t]=n.char),n.blendWithBg!==void 0&&(r.blendWithBg[t]=n.blendWithBg?1:0);}function X(t,n){if(i(t,n,r))return {enabled:r.enabled[n]===1,offsetX:r.offsetX[n],offsetY:r.offsetY[n],color:r.color[n],opacity:r.opacity[n],char:r.char[n],blendWithBg:r.blendWithBg[n]===1}}function R(t,n){return i(t,n,r)}function I(t,n){return i(t,n,r)?r.enabled[n]===1:false}function G(t,n){return l(t,n),r.enabled[n]=1,n}function K(t,n){return i(t,n,r)&&(r.enabled[n]=0),n}function j(t,n){return l(t,n),r.enabled[n]=r.enabled[n]===1?0:1,n}function k(t,n,o,e){return l(t,n),r.offsetX[n]=o,r.offsetY[n]=e,n}function q(t,n){if(i(t,n,r))return {x:r.offsetX[n],y:r.offsetY[n]}}function z(t,n,o){return l(t,n),r.color[n]=e(o),n}function J(t,n){if(i(t,n,r))return r.color[n]}function N(t,n,o){return l(t,n),r.opacity[n]=Math.max(0,Math.min(255,o)),n}function Q(t,n){if(i(t,n,r))return r.opacity[n]}function V(t,n,o){return l(t,n),r.char[n]=o,n}function Z(t,n){if(i(t,n,r))return r.char[n]}function $(t,n,o){return l(t,n),r.blendWithBg[n]=o?1:0,n}function nn(t,n){return i(t,n,r)?r.blendWithBg[n]===1:false}function tn(t,n){return i(t,n,r)&&p(n),n}function C(t,n,o,e,a,u,b){for(let f=0;f<a;f++)for(let i=0;i<u;i++)t.push({x:n+e+i,y:o+f+b,type:"right"});}function P(t,n,o,e,a,u,b){for(let f=0;f<b;f++)for(let i=0;i<e;i++)t.push({x:n+i+u,y:o+a+f,type:"bottom"});}function U(t,n,o,e,a,u,b){for(let f=0;f<b;f++)for(let i=0;i<u;i++)t.push({x:n+e+i,y:o+a+f,type:"corner"});}function rn(t,n,o,e,a,u){let b=[];return a>0&&C(b,t,n,o,e,a,u),u>0&&P(b,t,n,o,e,a,u),a>0&&u>0&&U(b,t,n,o,e,a,u),b}function on(t,n,o){let e=t>>16&255,a=t>>8&255,u=t&255,b=n>>16&255,f=n>>8&255,i=n&255,x=n>>24&255,s=o/255,m=1-s,S=Math.round(e*s+b*m),E=Math.round(a*s+f*m),w=Math.round(u*s+i*m);return (x&255)<<24|(S&255)<<16|(E&255)<<8|w&255}export{tn as A,rn as B,on as C,g as a,O as b,_ as c,D as d,B as e,Y as f,M as g,v as h,r as i,L as j,X as k,R as l,I as m,G as n,K as o,j as p,k as q,q as r,z as s,J as t,N as u,Q as v,V as w,Z as x,$ as y,nn as z};
|
package/dist/chunk-CUEUJAHK.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import {b,e as e$3,d as d$2,f as f$3,g as g$1}from'./chunk-DNRXW56C.js';import {e}from'./chunk-FCMTWFSE.js';import {Y as Y$1,g,_ as _$1,ba,aa,F,K as K$1,j as j$1,w as w$1,z as z$1,d as d$1}from'./chunk-ZAHG7Y3X.js';import {f as f$1,e as e$2}from'./chunk-SHUC6JWA.js';import {f as f$2,d}from'./chunk-G7GIWWLE.js';import {n,e as e$1}from'./chunk-PXXGH3BV.js';import {readFileSync}from'fs';import {z}from'zod';n();f$1();var N=z.union([z.number(),z.string().regex(/^\d+(\.\d+)?%$/,'Percentage must be in format "50%"'),z.literal("auto")]),f=z.union([z.number(),z.string().regex(/^\d+(\.\d+)?%$/,'Percentage must be in format "50%"'),z.enum(["center","left","right","top","bottom"])]),J=z.object({left:f.optional(),top:f.optional(),right:f.optional(),bottom:f.optional(),width:N.optional(),height:N.optional(),fg:z.union([z.string(),z.number()]).optional(),bg:z.union([z.string(),z.number()]).optional(),text:z.string(),font:z.union([z.string(),b]).optional(),shrink:z.boolean().optional()}),Y=1e4,c={isBigText:new Uint8Array(Y)},U="terminus-14-bold",T=new Map,a=new Map;function _(t){if(t===void 0)return 0;if(typeof t=="number")return t;switch(t){case "left":case "top":return 0;case "center":return 0;case "right":case "bottom":return 0}return 0}function M(t){return t===void 0||typeof t=="string"&&t==="auto"?"auto":t}async function j(t){return t?typeof t!="string"?t:t==="terminus-14-bold"||t==="terminus-14-normal"?d$2(t):H(t):d$2(U)}function q(t){return t?typeof t!="string"?t:t==="terminus-14-bold"||t==="terminus-14-normal"?e$3(t):T.get(t):e$3(U)}function K(t,i){let n=" ".repeat(t);return Array.from({length:i},()=>n)}function Q(t,i){let n=t.charHeight,r=Array.from({length:n},()=>"");for(let e of Array.from(i)){let u=f$3(t,e)?g$1(t,e):K(t.charWidth,t.charHeight);for(let g=0;g<n;g+=1){let O=u[g]??"";r[g]=`${r[g]}${O}`;}}return r}function B(t,i){let n=i.split(`
|
|
2
|
-
`),r=[];for(let e of n)r.push(...Q(t,e));return r.join(`
|
|
3
|
-
`)}function H(t){let i=T.get(t);if(i)return i;let n=readFileSync(t,"utf8"),r=JSON.parse(n),e=b.parse(r);return T.set(t,e),e}var ft=H;function R(t,i,n){let r=_(n.left),e=_(n.top);F(t,i,r,e);let s=M(n.width),u=M(n.height);w$1(t,i,s,u);let g=n.shrink!==false;z$1(t,i,g);}function X(t,i,n){n.fg===void 0&&n.bg===void 0||d$1(t,i,{fg:n.fg!==void 0?e$2(n.fg):void 0,bg:n.bg!==void 0?e$2(n.bg):void 0});}async function Z(t,i,n){let r=await j(n.font),e$1=B(r,n.text);a.set(i,n.text),e(t,i,e$1);}async function ct(t,i,n){let r=J.parse(n),e=i;c.isBigText[e]=1,R(t,e,r),X(t,e,r),await Z(t,e,r),Y$1(t,e,{focusable:true});let s={eid:e,show(){return j$1(t,e,true),s},hide(){return j$1(t,e,false),s},move(u,g$1){return K$1(t,e,u,g$1),g(t,e),s},setPosition(u,g$1){return F(t,e,u,g$1),g(t,e),s},setText(u){return tt(t,e,u,r.font),s},getText(){return a.get(e)??""},focus(){return aa(t,e),s},blur(){return ba(t,e),s},isFocused(){return _$1(t,e)},append(u){return d(t,e,u),s},getChildren(){return f$2(t,e)},destroy(){c.isBigText[e]=0,a.delete(e),e$1(t,e);}};return s}function w(t,i,n,r){let e$1=q(r);if(e$1){let s=B(e$1,n);a.set(i,n),e(t,i,s),g(t,i);return}j(r).then(s=>{let u=B(s,n);a.set(i,n),e(t,i,u),g(t,i);});}function tt(t,i,n,r){return w(t,i,n,r),i}function pt(t,i){return c.isBigText[i]===1}function lt(){c.isBigText.fill(0),a.clear();}export{J as a,c as b,H as c,ft as d,ct as e,w as f,pt as g,lt as h};
|
package/dist/chunk-D42Q2KKR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-5N3O25O7.js';import {z}from'zod';z.object({enabled:z.boolean(),historySize:z.number().int().nonnegative().optional()});z.object({enabled:z.boolean(),budgetMs:z.number().positive().optional(),skippablePhases:z.array(z.nativeEnum(a)).readonly().optional()});var g=0;function L(){return g}function I(o){o.sort((l,n)=>l.priority-n.priority);}function D(){let o=new Map,l=[],n=false,S=0,p=[],d=null,N=0,i=false,v=16.67,T=new Set([4]),b=null;for(let e=0;e<=7;e++)o.set(e,[]);function A(){let e=[];for(let t=0;t<=7;t++)e.push({phase:t,duration:0,systemCount:0});return {phases:e,totalFrameTime:0,frameNumber:N++}}function P(e,t,r){if(!n||!d)return;let s=d.phases[e];s&&(s.duration=t,s.systemCount=r);}function U(){if(!n||!d)return;let e=0;for(let t of d.phases)e+=t.duration;if(d.totalFrameTime=e,S>0)for(p.push(d);p.length>S;)p.shift();}return {registerSystem(e,t,r=0){if(e===0)throw new Error("Cannot register systems to INPUT phase. INPUT phase is protected and always runs first.");let s=o.get(e);s&&(s.push({system:t,priority:r}),I(s));},registerInputSystem(e,t=0){l.push({system:e,priority:t}),I(l);},unregisterSystem(e){for(let[t,r]of o){if(t===0)continue;let s=r.findIndex(m=>m.system===e);s!==-1&&r.splice(s,1);}},unregisterInputSystem(e){let t=l.findIndex(r=>r.system===e);t!==-1&&l.splice(t,1);},run(e,t){g=t,n&&(d=A());let r=i||n?performance.now():0,s=[],m=false,u=e,f=n||i?performance.now():0;for(let a of l)u=a.system(u);for(let a=0;a<=7;a++){let h=o.get(a);if(!h){if(a===0&&n){let c=performance.now();P(a,c-f,l.length);}else n&&P(a,0,0);continue}if(i&&m&&T.has(a)){s.push(a),n&&P(a,0,0);continue}let x=a===0?f:n||i?performance.now():0;for(let c of h)u=c.system(u);let E=n||i?performance.now():0;if(n){let c=a===0?l.length+h.length:h.length;P(a,E-x,c);}i&&!m&&E-r>v&&(m=true);}if(n&&U(),i){let h=performance.now()-r;b={exceeded:m,skippedPhases:s,remainingMs:v-h};}return u},runInputOnly(e,t){g=t;let r=e;for(let m of l)r=m.system(r);let s=o.get(0);if(s)for(let m of s)r=m.system(r);return r},runFixedUpdatePhases(e,t){g=t;let r=e,s=[1,2,3,4];for(let m of s){let u=o.get(m);if(u)for(let f of u)r=f.system(r);}return r},runRenderPhases(e,t){g=t;let r=e,s=[5,6,7];for(let m of s){let u=o.get(m);if(u)for(let f of u)r=f.system(r);}return r},getSystemsForPhase(e){if(e===0)return l.map(r=>r.system);let t=o.get(e);return t?t.map(r=>r.system):[]},getSystemCount(e){if(e===0)return l.length;let t=o.get(e);return t?t.length:0},getTotalSystemCount(){let e=l.length;for(let t of o.values())e+=t.length;return e},hasSystem(e){if(l.some(t=>t.system===e))return true;for(let t of o.values())if(t.some(r=>r.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);},enableTelemetry(e={enabled:true}){n=e.enabled,S=e.historySize??0,n||(p.length=0,d=null);},disableTelemetry(){n=false,p.length=0,d=null;},getTelemetry(){return d},getTelemetryHistory(){return p},isTelemetryEnabled(){return n},enableFrameBudget(e={enabled:true}){i=e.enabled,v=e.budgetMs??16.67,e.skippablePhases?T=new Set(e.skippablePhases):T=new Set([4]),T.delete(0),i||(b=null);},disableFrameBudget(){i=false,b=null;},getAdaptiveFrameBudgetStatus(){return b},isFrameBudgetEnabled(){return i}}}export{L as a,D as b};
|