@nick-skriabin/glyph 0.1.45 → 0.1.47
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 +28 -15
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -717,23 +717,36 @@ render(<App />, { useNativeCursor: false });
|
|
|
717
717
|
|
|
718
718
|
## Examples
|
|
719
719
|
|
|
720
|
+
Interactive examples are included in the repo. Each demonstrates different components and patterns:
|
|
721
|
+
|
|
722
|
+
| Example | Description | Source |
|
|
723
|
+
|---------|-------------|--------|
|
|
724
|
+
| **basic-layout** | Flexbox layout fundamentals | [View →](https://github.com/nick-skriabin/glyph/tree/main/examples/basic-layout) |
|
|
725
|
+
| **modal-input** | Modal dialogs, input focus trapping | [View →](https://github.com/nick-skriabin/glyph/tree/main/examples/modal-input) |
|
|
726
|
+
| **scrollview-demo** | Scrollable content with keyboard navigation | [View →](https://github.com/nick-skriabin/glyph/tree/main/examples/scrollview-demo) |
|
|
727
|
+
| **list-demo** | Keyboard-navigable lists | [View →](https://github.com/nick-skriabin/glyph/tree/main/examples/list-demo) |
|
|
728
|
+
| **menu-demo** | Styled menus with icons | [View →](https://github.com/nick-skriabin/glyph/tree/main/examples/menu-demo) |
|
|
729
|
+
| **select-demo** | Dropdown select with search | [View →](https://github.com/nick-skriabin/glyph/tree/main/examples/select-demo) |
|
|
730
|
+
| **forms-demo** | Checkbox and Radio inputs | [View →](https://github.com/nick-skriabin/glyph/tree/main/examples/forms-demo) |
|
|
731
|
+
| **masked-input** | Input masks (phone, credit card, SSN) | [View →](https://github.com/nick-skriabin/glyph/tree/main/examples/masked-input) |
|
|
732
|
+
| **dialog-demo** | Alert and Confirm dialogs | [View →](https://github.com/nick-skriabin/glyph/tree/main/examples/dialog-demo) |
|
|
733
|
+
| **jump-nav** | Quick navigation with keyboard hints | [View →](https://github.com/nick-skriabin/glyph/tree/main/examples/jump-nav) |
|
|
734
|
+
| **showcase** | Progress bars, Spinners, Toasts | [View →](https://github.com/nick-skriabin/glyph/tree/main/examples/showcase) |
|
|
735
|
+
| **dashboard** | Full task manager (all components) | [View →](https://github.com/nick-skriabin/glyph/tree/main/examples/dashboard) |
|
|
736
|
+
|
|
737
|
+
### Running Examples Locally
|
|
738
|
+
|
|
720
739
|
```bash
|
|
721
740
|
# Clone and install
|
|
722
|
-
git clone
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
# Run
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
pnpm --filter select-demo dev # Dropdown select with search
|
|
732
|
-
pnpm --filter forms-demo dev # Checkbox and Radio inputs
|
|
733
|
-
pnpm --filter masked-input dev # Input masks (phone, credit card, etc.)
|
|
734
|
-
pnpm --filter dialog-demo dev # Alert and Confirm dialogs
|
|
735
|
-
pnpm --filter dashboard dev # Full task manager (all components)
|
|
736
|
-
pnpm --filter showcase dev # Progress, Spinner, Toasts
|
|
741
|
+
git clone https://github.com/nick-skriabin/glyph.git && cd glyph
|
|
742
|
+
bun install && bun run build
|
|
743
|
+
|
|
744
|
+
# Run any example
|
|
745
|
+
bun run --filter <example-name> dev
|
|
746
|
+
|
|
747
|
+
# e.g.
|
|
748
|
+
bun run --filter dashboard dev
|
|
749
|
+
bun run --filter jump-nav dev
|
|
737
750
|
```
|
|
738
751
|
|
|
739
752
|
---
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import te,{createContext,forwardRef,useState,useContext,useRef,useEffect,useLayoutEffect,useMemo,useCallback}from'react';import An from'react-reconciler';import ue from'string-width';import nn,{FlexDirection,Justify,Align,Direction,Edge,Wrap,Gutter,PositionType,Overflow,MeasureMode}from'yoga-layout';var Hn=0;function Bt(){return `glyph-focus-${Hn++}`}function Lt(e,t){let n=t.style??{};return {type:e,props:t,style:n,children:[],rawTextChildren:[],parent:null,yogaNode:null,text:null,layout:{x:0,y:0,width:0,height:0,innerX:0,innerY:0,innerWidth:0,innerHeight:0},focusId:e==="input"||t.focusable?Bt():null,hidden:false}}function st(e,t){t.parent=e,e.children.push(t);}function Mt(e,t){let n=e.children.indexOf(t);n!==-1&&(e.children.splice(n,1),t.parent=null);}function Vt(e,t,n){t.parent=e;let r=e.children.indexOf(n);r!==-1?e.children.splice(r,0,t):e.children.push(t);}function _e(e){let t={},n=e;for(;n;){let r=n.style;t.color===void 0&&r.color!==void 0&&(t.color=r.color),t.bg===void 0&&r.bg!==void 0&&(t.bg=r.bg),t.bold===void 0&&r.bold!==void 0&&(t.bold=r.bold),t.dim===void 0&&r.dim!==void 0&&(t.dim=r.dim),t.italic===void 0&&r.italic!==void 0&&(t.italic=r.italic),t.underline===void 0&&r.underline!==void 0&&(t.underline=r.underline),n=n.parent;}return t}function it(e){if(e.text!=null)return e.text;let t="";for(let n of e.children)t+=it(n);return t}var lt=32,Ht={supportsMutation:true,supportsPersistence:false,supportsHydration:false,isPrimaryRenderer:true,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,supportsMicrotasks:true,scheduleMicrotask:queueMicrotask,getCurrentUpdatePriority:()=>lt,setCurrentUpdatePriority:e=>{},resolveUpdatePriority:()=>lt,getCurrentEventPriority:()=>lt,resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,shouldAttemptEagerTransition:()=>false,getInstanceFromNode:()=>null,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},prepareScopeUpdate:()=>{},getInstanceFromScope:()=>null,detachDeletedInstance:()=>{},requestPostPaintCallback:e=>{},maySuspendCommit:(e,t)=>false,preloadInstance:(e,t)=>true,startSuspendingCommit:()=>{},suspendInstance:(e,t)=>{},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:{$$typeof:Symbol.for("react.context"),_currentValue:null},resetFormInstance:e=>{},bindToConsole:(e,t,n)=>Function.prototype.bind.call(console[e],console,...t),supportsResources:false,isHostHoistableType:(e,t)=>false,supportsSingletons:false,isHostSingletonType:e=>false,supportsTestSelectors:false,createInstance(e,t,n,r,o){return Lt(e,t)},createTextInstance(e,t,n,r){return {type:"raw-text",text:e,parent:null}},appendInitialChild(e,t){if(t.type==="raw-text"){let n=t;n.parent=e,e.rawTextChildren.push(n),e.text=e.rawTextChildren.map(r=>r.text).join("");}else st(e,t);},finalizeInitialChildren(e,t,n,r,o){return false},shouldSetTextContent(e,t){return false},getRootHostContext(e){return {}},getChildHostContext(e,t,n){return e},getPublicInstance(e){return e},prepareForCommit(e){return null},resetAfterCommit(e){e.onCommit();},preparePortalMount(){},appendChild(e,t){if(t.type==="raw-text"){let n=t;n.parent=e,e.rawTextChildren.push(n),e.text=e.rawTextChildren.map(r=>r.text).join("");}else st(e,t);},appendChildToContainer(e,t){if(t.type==="raw-text")return;let n=t;n.parent=null,e.children.push(n);},insertBefore(e,t,n){t.type==="raw-text"||n.type==="raw-text"||Vt(e,t,n);},insertInContainerBefore(e,t,n){if(t.type==="raw-text"||n.type==="raw-text")return;let r=t,o=n,s=e.children.indexOf(o);s!==-1?e.children.splice(s,0,r):e.children.push(r);},removeChild(e,t){if(t.type==="raw-text"){let n=t;n.parent=null;let r=e.rawTextChildren.indexOf(n);r!==-1&&e.rawTextChildren.splice(r,1),e.text=e.rawTextChildren.map(o=>o.text).join("")||null;return}Mt(e,t);},removeChildFromContainer(e,t){if(t.type==="raw-text")return;let n=t,r=e.children.indexOf(n);r!==-1&&e.children.splice(r,1);},commitTextUpdate(e,t,n){e.text=n,e.parent&&(e.parent.text=e.parent.rawTextChildren.map(r=>r.text).join(""));},commitUpdate(e,t,n,r,o){e.props=r,e.style=r.style??{},r.focusable&&!e.focusId&&(e.focusId=`focus-${Math.random().toString(36).slice(2,9)}`);},hideInstance(e){e.hidden=true;},hideTextInstance(e){e.text="";},unhideInstance(e,t){e.hidden=false;},unhideTextInstance(e,t){e.text=t;},clearContainer(e){e.children.length=0;},resetTextContent(e){e.text=null;}};var Ie=An(Ht);Ie.injectIntoDevTools({bundleType:process.env.NODE_ENV==="production"?0:1,version:"0.1.0",rendererPackageName:"glyph"});var $e=class{stdout;stdin;wasRaw=false;cleanedUp=false;dataHandlers=new Set;stdinAttached=false;oscState="normal";oscAccum="";escFlushTimer=null;palette=new Map;paletteResolve=null;constructor(t=process.stdout,n=process.stdin){this.stdout=t,this.stdin=n;}get columns(){return this.stdout.columns||80}get rows(){return this.stdout.rows||24}enterRawMode(){this.stdin.isTTY&&(this.wasRaw=this.stdin.isRaw,this.stdin.setRawMode(true),this.stdin.resume(),this.stdin.setEncoding("utf-8"));}exitRawMode(){this.stdin.isTTY&&!this.wasRaw&&(this.stdin.setRawMode(false),this.stdin.pause());}write(t){this.stdout.write(t);}hideCursor(){this.write("\x1B[?25l");}showCursor(){this.write("\x1B[?25h");}moveCursor(t,n){this.write(`\x1B[${n+1};${t+1}H`);}setCursorColor(t){this.write(`\x1B]12;${t}\x07`);}resetCursorColor(){this.write("\x1B]112\x07");}enterAltScreen(){this.write("\x1B[?1049h");}exitAltScreen(){this.write("\x1B[?1049l");}clearScreen(){this.write("\x1B[2J\x1B[H");}resetStyles(){this.write("\x1B[0m");}enableKittyKeyboard(){this.write("\x1B[>1u");}disableKittyKeyboard(){this.write("\x1B[<u");}setup(){this.enterRawMode(),this.enterAltScreen(),this.enableKittyKeyboard(),this.hideCursor(),this.clearScreen(),this.attachStdinListener(),this.installCleanupHandlers();}cleanup(){this.cleanedUp||(this.cleanedUp=true,this.escFlushTimer!==null&&(clearTimeout(this.escFlushTimer),this.escFlushTimer=null),this.resetStyles(),this.resetCursorColor(),this.disableKittyKeyboard(),this.showCursor(),this.exitAltScreen(),this.exitRawMode());}suspend(){this.escFlushTimer!==null&&(clearTimeout(this.escFlushTimer),this.escFlushTimer=null),this.oscState="normal",this.oscAccum="",this.resetStyles(),this.resetCursorColor(),this.disableKittyKeyboard(),this.showCursor(),this.exitAltScreen(),this.exitRawMode();}resume(){this.enterRawMode(),this.enterAltScreen(),this.enableKittyKeyboard(),this.hideCursor(),this.clearScreen();}attachStdinListener(){this.stdinAttached||(this.stdinAttached=true,this.stdin.on("data",t=>{let n=typeof t=="string"?t:t.toString("utf-8");this.dispatchFiltered(n);}));}onData(t){return this.dataHandlers.add(t),()=>{this.dataHandlers.delete(t);}}dispatchFiltered(t){this.escFlushTimer!==null&&(clearTimeout(this.escFlushTimer),this.escFlushTimer=null);let n=this.filterOsc(t);if(n.length>0)for(let r of this.dataHandlers)r(n);this.oscState==="esc"&&(this.escFlushTimer=setTimeout(()=>{this.escFlushTimer=null,this.oscState="normal";for(let r of this.dataHandlers)r("\x1B");},50));}filterOsc(t){let n="";for(let r=0;r<t.length;r++){let o=t[r],s=t.charCodeAt(r);switch(this.oscState){case "normal":s===27?this.oscState="esc":n+=o;break;case "esc":o==="]"?(this.oscState="osc",this.oscAccum=""):(n+="\x1B"+o,this.oscState="normal");break;case "osc":s===7?(this.handleOscResponse(this.oscAccum),this.oscAccum="",this.oscState="normal"):s===27?this.oscState="osc_esc":this.oscAccum+=o;break;case "osc_esc":o==="\\"?(this.handleOscResponse(this.oscAccum),this.oscAccum="",this.oscState="normal"):(this.oscAccum+="\x1B"+o,this.oscState="osc");break}}return n}handleOscResponse(t){let n=t.match(/^4;(\d+);rgb:([0-9a-fA-F]+)\/([0-9a-fA-F]+)\/([0-9a-fA-F]+)/);if(n){let r=parseInt(n[1],10),o=parseInt(n[2].substring(0,2),16),s=parseInt(n[3].substring(0,2),16),i=parseInt(n[4].substring(0,2),16);this.palette.set(r,[o,s,i]),this.palette.size>=16&&this.paletteResolve&&(this.paletteResolve(),this.paletteResolve=null);}}queryPalette(){return new Promise(t=>{let n=()=>t(this.palette),r=setTimeout(n,200);this.paletteResolve=()=>{clearTimeout(r),n();};let o="";for(let s=0;s<16;s++)o+=`\x1B]4;${s};?\x07`;this.write(o);})}onResize(t){return this.stdout.on("resize",t),()=>{this.stdout.off("resize",t);}}installCleanupHandlers(){let t=()=>this.cleanup();process.on("exit",t);let n=r=>{t(),process.kill(process.pid,r);};process.once("SIGINT",()=>n("SIGINT")),process.once("SIGTERM",()=>n("SIGTERM")),process.on("uncaughtException",r=>{t(),console.error(r),process.exit(1);}),process.on("unhandledRejection",r=>{t(),console.error(r),process.exit(1);});}};function At(e){switch(e){case 9:return "tab";case 13:return "return";case 27:return "escape";case 32:return " ";case 127:return "backspace";case 57358:return "capslock";case 57359:return "scrolllock";case 57360:return "numlock";case 57361:return "printscreen";case 57362:return "pause";case 57363:return "menu";case 57364:return "f13";case 57365:return "f14";case 57366:return "f15";case 57367:return "f16";case 57368:return "f17";case 57369:return "f18";case 57370:return "f19";case 57371:return "f20";case 57372:return "f21";case 57373:return "f22";case 57374:return "f23";case 57375:return "f24";case 57376:return "f25";case 57399:return "kp0";case 57400:return "kp1";case 57401:return "kp2";case 57402:return "kp3";case 57403:return "kp4";case 57404:return "kp5";case 57405:return "kp6";case 57406:return "kp7";case 57407:return "kp8";case 57408:return "kp9";case 57409:return "kpdecimal";case 57410:return "kpdivide";case 57411:return "kpmultiply";case 57412:return "kpminus";case 57413:return "kpplus";case 57414:return "kpenter";case 57415:return "kpequal";case 57416:return "kpleft";case 57417:return "kpright";case 57418:return "kpup";case 57419:return "kpdown";case 57420:return "kppageup";case 57421:return "kppagedown";case 57422:return "kphome";case 57423:return "kpend";case 57424:return "kpinsert";case 57425:return "kpdelete";case 57428:return "mediaplaypause";case 57429:return "mediastop";case 57430:return "mediaprev";case 57431:return "medianext";case 57432:return "mediarewind";case 57433:return "mediafastforward";case 57434:return "mediamute";case 57435:return "volumedown";case 57436:return "volumeup";default:return e>=32&&e<=126?String.fromCharCode(e).toLowerCase():"unknown"}}function jn(e){switch(e.split(";")[0]){case "1":return "home";case "2":return "insert";case "3":return "delete";case "4":return "end";case "5":return "pageup";case "6":return "pagedown";case "7":return "home";case "8":return "end";case "11":return "f1";case "12":return "f2";case "13":return "f3";case "14":return "f4";case "15":return "f5";case "17":return "f6";case "18":return "f7";case "19":return "f8";case "20":return "f9";case "21":return "f10";case "23":return "f11";case "24":return "f12";case "25":return "f13";case "26":return "f14";case "28":return "f15";case "29":return "f16";case "31":return "f17";case "32":return "f18";case "33":return "f19";case "34":return "f20";default:return "unknown"}}function qe(e,t){let n=t-1;n&1&&(e.shift=true),n&2&&(e.alt=true),n&4&&(e.ctrl=true),n&8&&(e.meta=true);}function jt(e){let t=[],n=0;for(;n<e.length;){let r=e[n],o=e.charCodeAt(n);if(r==="\x1B"){if(e[n+1]==="["){let s=Dn(e,n);if(s){t.push(s.key),n=s.end;continue}}if(e[n+1]==="O"){let s=On(e,n);if(s){t.push(s.key),n=s.end;continue}}if(n+1<e.length&&e.charCodeAt(n+1)>=32){t.push({name:e[n+1].toLowerCase(),sequence:e.substring(n,n+2),alt:true}),n+=2;continue}t.push({name:"escape",sequence:"\x1B"}),n++;continue}if(o>=1&&o<=26){let s=String.fromCharCode(o+96);o===13?t.push({name:"return",sequence:"\r"}):o===9?t.push({name:"tab",sequence:" "}):o===8?t.push({name:"backspace",sequence:"\b"}):t.push({name:s,sequence:r,ctrl:true}),n++;continue}if(o===127){t.push({name:"backspace",sequence:r}),n++;continue}t.push({name:r,sequence:r}),n++;}return t}function On(e,t){if(t+2>=e.length)return null;let n=e[t+2],r=e.substring(t,t+3),o;switch(n){case "A":o={name:"up",sequence:r};break;case "B":o={name:"down",sequence:r};break;case "C":o={name:"right",sequence:r};break;case "D":o={name:"left",sequence:r};break;case "H":o={name:"home",sequence:r};break;case "F":o={name:"end",sequence:r};break;case "P":o={name:"f1",sequence:r};break;case "Q":o={name:"f2",sequence:r};break;case "R":o={name:"f3",sequence:r};break;case "S":o={name:"f4",sequence:r};break;case "j":o={name:"kpmultiply",sequence:r};break;case "k":o={name:"kpplus",sequence:r};break;case "l":o={name:"kpcomma",sequence:r};break;case "m":o={name:"kpminus",sequence:r};break;case "n":o={name:"kpdecimal",sequence:r};break;case "o":o={name:"kpdivide",sequence:r};break;case "p":o={name:"kp0",sequence:r};break;case "q":o={name:"kp1",sequence:r};break;case "r":o={name:"kp2",sequence:r};break;case "s":o={name:"kp3",sequence:r};break;case "t":o={name:"kp4",sequence:r};break;case "u":o={name:"kp5",sequence:r};break;case "v":o={name:"kp6",sequence:r};break;case "w":o={name:"kp7",sequence:r};break;case "x":o={name:"kp8",sequence:r};break;case "y":o={name:"kp9",sequence:r};break;case "M":o={name:"kpenter",sequence:r};break;default:return null}return {key:o,end:t+3}}function Dn(e,t){let n=t+2,r="";for(;n<e.length;){let c=e.charCodeAt(n);if(c>=48&&c<=63)r+=e[n],n++;else break}if(n>=e.length)return null;let o=e[n],s=e.substring(t,n+1);n++;let i;switch(o){case "A":i={name:"up",sequence:s};break;case "B":i={name:"down",sequence:s};break;case "C":i={name:"right",sequence:s};break;case "D":i={name:"left",sequence:s};break;case "H":i={name:"home",sequence:s};break;case "F":i={name:"end",sequence:s};break;case "Z":i={name:"tab",sequence:s,shift:true};break;case "P":i={name:"f1",sequence:s};break;case "Q":i={name:"f2",sequence:s};break;case "R":i={name:"f3",sequence:s};break;case "S":i={name:"f4",sequence:s};break;case "~":{if(r.startsWith("27;")){let c=r.split(";"),l=parseInt(c[1]??"1",10),u=parseInt(c[2]??"0",10);i={name:At(u),sequence:s},qe(i,l);break}if(i={name:jn(r),sequence:s},r.includes(";")){let c=r.split(";"),l=parseInt(c[1]??"1",10);qe(i,l);}break}case "u":{let c=r.split(";"),l=parseInt(c[0]??"0",10),u=parseInt(c[1]??"1",10);i={name:At(l),sequence:s},qe(i,u);break}case "I":i={name:"focus",sequence:s};break;case "O":i={name:"blur",sequence:s};break;default:i={name:"unknown",sequence:s};}if(r.includes(";")&&!["~","u"].includes(o)){let c=r.split(";"),l=parseInt(c[c.length-1]??"1",10);l>=1&&l<=16&&qe(i,l);}return {key:i,end:n}}var Kn={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",blackBright:"\x1B[90m",redBright:"\x1B[91m",greenBright:"\x1B[92m",yellowBright:"\x1B[93m",blueBright:"\x1B[94m",magentaBright:"\x1B[95m",cyanBright:"\x1B[96m",whiteBright:"\x1B[97m"},Wn={black:"\x1B[40m",red:"\x1B[41m",green:"\x1B[42m",yellow:"\x1B[43m",blue:"\x1B[44m",magenta:"\x1B[45m",cyan:"\x1B[46m",white:"\x1B[47m",blackBright:"\x1B[100m",redBright:"\x1B[101m",greenBright:"\x1B[102m",yellowBright:"\x1B[103m",blueBright:"\x1B[104m",magentaBright:"\x1B[105m",cyanBright:"\x1B[106m",whiteBright:"\x1B[107m"};function ct(e){let t=e.replace("#",""),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),o=parseInt(t.substring(4,6),16);return {r:n,g:r,b:o}}function Ot(e){if(typeof e=="string"){if(e.startsWith("#")){let{r:o,g:s,b:i}=ct(e);return `\x1B[38;2;${o};${s};${i}m`}return Kn[e]??"\x1B[39m"}if(typeof e=="number")return `\x1B[38;5;${e}m`;let{r:t,g:n,b:r}=e;return `\x1B[38;2;${t};${n};${r}m`}function Dt(e){if(typeof e=="string"){if(e.startsWith("#")){let{r:o,g:s,b:i}=ct(e);return `\x1B[48;2;${o};${s};${i}m`}return Wn[e]??"\x1B[49m"}if(typeof e=="number")return `\x1B[48;5;${e}m`;let{r:t,g:n,b:r}=e;return `\x1B[48;2;${t};${n};${r}m`}var Kt={black:[0,0,0],red:[170,0,0],green:[0,170,0],yellow:[170,170,0],blue:[0,0,170],magenta:[170,0,170],cyan:[0,170,170],white:[170,170,170],blackBright:[85,85,85],redBright:[255,85,85],greenBright:[85,255,85],yellowBright:[255,255,85],blueBright:[85,85,255],magentaBright:[255,85,255],cyanBright:[85,255,255],whiteBright:[255,255,255]},Wt=["black","red","green","yellow","blue","magenta","cyan","white","blackBright","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright"],Te=null;function _t(e){e.size>0&&(Te=e);}function _n(e){if(Te){let t=Wt.indexOf(e);if(t!==-1){let n=Te.get(t);if(n)return n}}return Kt[e]??null}function $n(e){if(typeof e=="string"){if(e.startsWith("#")){let t=ct(e);return [t.r,t.g,t.b]}return _n(e)}if(typeof e=="number"){if(e<16){if(Te){let s=Te.get(e);if(s)return s}return Kt[Wt[e]]}if(e>=232){let s=(e-232)*10+8;return [s,s,s]}let t=e-16,n=t%6*51,r=Math.floor(t/6)%6*51;return [Math.floor(t/36)*51,r,n]}return [e.r,e.g,e.b]}function ze(e){let t=$n(e);if(!t)return false;let[n,r,o]=t.map(i=>{let c=i/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)});return .2126*n+.7152*r+.0722*o>.4}function ut(e,t){return e===t?true:e==null||t==null?false:typeof e=="object"&&typeof t=="object"?e.r===t.r&&e.g===t.g&&e.b===t.b:false}function $t(e){return e&&ze(e)?"black":"white"}var ke=class e{width;height;cells;constructor(t,n){this.width=t,this.height=n,this.cells=new Array(t*n),this.clear();}clear(){for(let t=0;t<this.cells.length;t++)this.cells[t]={ch:" "};}resize(t,n){this.width=t,this.height=n,this.cells=new Array(t*n),this.clear();}get(t,n){if(!(t<0||t>=this.width||n<0||n>=this.height))return this.cells[n*this.width+t]}set(t,n,r){t<0||t>=this.width||n<0||n>=this.height||(this.cells[n*this.width+t]=r);}setChar(t,n,r,o,s,i,c,l,u){t<0||t>=this.width||n<0||n>=this.height||(this.cells[n*this.width+t]={ch:r,fg:o,bg:s,bold:i,dim:c,italic:l,underline:u});}fillRect(t,n,r,o,s,i,c){for(let l=n;l<n+o;l++)for(let u=t;u<t+r;u++)this.setChar(u,l,s,i,c);}clone(){let t=new e(this.width,this.height);for(let n=0;n<this.cells.length;n++){let r=this.cells[n];t.cells[n]={...r};}return t}cellsEqual(t,n){return t.ch===n.ch&&ut(t.fg,n.fg)&&ut(t.bg,n.bg)&&(t.bold??false)===(n.bold??false)&&(t.dim??false)===(n.dim??false)&&(t.italic??false)===(n.italic??false)&&(t.underline??false)===(n.underline??false)}};var qn={single:{topLeft:"\u250C",topRight:"\u2510",bottomLeft:"\u2514",bottomRight:"\u2518",horizontal:"\u2500",vertical:"\u2502"},double:{topLeft:"\u2554",topRight:"\u2557",bottomLeft:"\u255A",bottomRight:"\u255D",horizontal:"\u2550",vertical:"\u2551"},round:{topLeft:"\u256D",topRight:"\u256E",bottomLeft:"\u2570",bottomRight:"\u256F",horizontal:"\u2500",vertical:"\u2502"},ascii:{topLeft:"+",topRight:"+",bottomLeft:"+",bottomRight:"+",horizontal:"-",vertical:"|"}};function qt(e){return e==="none"?null:qn[e]}function zt(e,t,n,r){if(e.length===0)return {width:0,height:0};let o=e.split(`
|
|
2
|
-
`);if(n===MeasureMode.Undefined||r==="none"){let l=0;for(let u of o){let f=ue(u);f>l&&(l=f);}return {width:l,height:o.length}}let s=Math.max(1,Math.floor(t)),i=ce(o,s,r),c=0;for(let l of i){let u=ue(l);u>c&&(c=u);}return {width:c,height:i.length}}function ce(e,t,n){let r=[];for(let o of e){if(ue(o)<=t){r.push(o);continue}if(n==="truncate"){r.push(Xt(o,t));continue}if(n==="ellipsis"){r.push(Xn(o,t));continue}let i=Jn(o,t);r.push(...i);}return r}function Xt(e,t){let n="",r=0;for(let o of e){let s=ue(o);if(r+s>t)break;n+=o,r+=s;}return n}function Xn(e,t){if(t<=1)return t===1?"\u2026":"";let n=Xt(e,t-1);return ue(n)<ue(e)?n+"\u2026":e}function Jn(e,t){let n=[],r="",o=0,s="",i=0;for(let c=0;c<=e.length;c++){let l=e[c],u=c===e.length,f=l===" ";if(u||f){if(s.length>0){if(o+i<=t)r+=s,o+=i;else if(i<=t)r.length>0&&n.push(r),r=s,o=i;else for(let
|
|
3
|
-
`),R=ce(
|
|
4
|
-
`),M=ce(
|
|
5
|
-
`),o=[],s=0;for(let l of r){let u=ce([l],n,"wrap"),f=0;for(let
|
|
6
|
-
`),s=[],i=0;for(let f of o){let
|
|
7
|
-
`),r=t;for(let s=0;s<n.length;s++){if(r<=n[s].length)return {line:s,col:r,lines:n};r-=n[s].length+1;}let o=n.length-1;return {line:o,col:n[o].length,lines:n}}function Be(e,t,n){let r=0;for(let o=0;o<t&&o<e.length;o++)r+=e[o].length+1;return r+Math.min(n,e[t]?.length??0)}function xr(e){let{value:t,defaultValue:n="",onChange:r,onKeyPress:o,onBeforeChange:s,placeholder:i,style:c,focusedStyle:l,multiline:u,autoFocus:f,type:
|
|
8
|
-
`+
|
|
9
|
-
`);)d--;let
|
|
10
|
-
`;)d--;return
|
|
11
|
-
`;)d++;for(;d<
|
|
12
|
-
`;)d--;let
|
|
13
|
-
`;)d++;for(;d<
|
|
14
|
-
`)))))}function Ct({count:e,renderItem:t,selectedIndex:n,onSelectionChange:r,onSelect:o,defaultSelectedIndex:s=0,disabledIndices:i,style:c,focusable:l=true}){let u=n!==void 0,[f,h]=useState(s),w=u?n:f,R=useContext(W),T=useContext(Y),a=useRef(null),m=useRef(null),g=useRef(o);g.current=o;let[v,E]=useState(false),[A,D]=useState(false),F=useRef(null),B=useCallback(x=>{let S=Math.max(0,Math.min(x,e-1));u?r?.(S):h(S);},[u,r,e]),k=useCallback((x,S)=>{if(!i||i.size===0)return Math.max(0,Math.min(x+S,e-1));let b=x+S;for(;b>=0&&b<e&&i.has(b);)b+=S;return b<0||b>=e?x:b},[i,e]);useEffect(()=>{if(!(!R||!m.current||!a.current||!l))return R.register(m.current,a.current)},[R,l,v]),useEffect(()=>{if(!R||!m.current)return;let x=m.current;return D(R.focusedId===x),R.onFocusChange(S=>{D(S===x);})},[R,v]);let M=useCallback(x=>{let S=x?e-1:0,b=x?-1:1,V=S;for(;V>=0&&V<e&&i?.has(V);)V+=b;return V>=0&&V<e?V:x?e-1:0},[i,e]);useEffect(()=>{if(!T||!m.current||!l)return;let x=m.current,S=b=>R?.focusedId!==x?false:b.name==="g"&&!b.ctrl&&!b.alt?F.current==="g"?(B(M(false)),F.current=null,true):(F.current="g",true):b.name==="G"||b.name==="g"&&b.shift?(F.current=null,B(M(true)),true):(F.current=null,b.name==="up"||b.name==="k"?(B(k(w,-1)),true):b.name==="down"||b.name==="j"?(B(k(w,1)),true):b.name==="return"?(i?.has(w)||g.current?.(w),true):false);return T.registerInputHandler(x,S)},[T,R,l,w,B,k,M,i,v]);let C=[];for(let x=0;x<e;x++)C.push(te.createElement(te.Fragment,{key:x},t({index:x,selected:x===w,focused:A})));return te.createElement("box",{style:{flexDirection:"column",...c},focusable:l,ref:x=>{x?(a.current=x,m.current=x.focusId,E(true)):(a.current=null,m.current=null,E(false));}},...C)}function jr({items:e,selectedIndex:t,onSelectionChange:n,onSelect:r,defaultSelectedIndex:o=0,style:s,highlightColor:i="cyan",focusable:c=true}){let l=new Set;for(let f=0;f<e.length;f++)e[f].disabled&&l.add(f);let u=f=>{let h=e[f];h&&!h.disabled&&r?.(h.value,f);};return te.createElement(Ct,{count:e.length,selectedIndex:t,onSelectionChange:n,onSelect:u,defaultSelectedIndex:o,disabledIndices:l.size>0?l:void 0,style:s,focusable:c,renderItem:({index:f,selected:h,focused:w})=>{let R=e[f],T=R.disabled,a=h&&w,m=h?">":" ";return te.createElement("box",{style:{flexDirection:"row",...a?{bg:i}:{}}},te.createElement("text",{style:a?{bold:true,color:"black"}:T?{dim:true}:{}},`${m} ${R.label}`))}})}function Wr({value:e,indeterminate:t=false,width:n="100%",label:r,showPercent:o=false,style:s,filled:i="\u2588",empty:c="\u2591"}){let l=useRef(null),f=fe(l).innerWidth,[h,w]=useState(0);useEffect(()=>{if(!t)return;let g=setInterval(()=>{w(v=>(v+1)%Math.max(1,f+6));},100);return ()=>clearInterval(g)},[t,f]);let R=Math.max(0,Math.min(1,e??0)),T=o?` ${Math.round(R*100)}%`:"",a="";if(f>0)if(t&&e===void 0){let g=Math.max(1,Math.min(3,Math.floor(f/4))),v=[];for(let E=0;E<f;E++)E>=h-g&&E<h?v.push(i):v.push(c);a=v.join("");}else {let g=Math.round(R*f);a=i.repeat(g)+c.repeat(f-g);}let m=[];return r&&m.push(te.createElement("text",{key:"label",style:{bold:true}},r+" ")),m.push(te.createElement("box",{key:"track",style:{flexGrow:1,flexShrink:1},ref:g=>{l.current=g??null;}},te.createElement("text",{key:"bar",style:{}},a))),o&&m.push(te.createElement("text",{key:"pct",style:{bold:true}},T)),te.createElement("box",{style:{flexDirection:"row",width:n,...s}},...m)}var qr=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function zr({frames:e=qr,intervalMs:t=80,label:n,style:r}){let[o,s]=useState(0);useEffect(()=>{let c=setInterval(()=>{s(l=>(l+1)%e.length);},t);return ()=>clearInterval(c)},[e.length,t]);let i=[te.createElement("text",{key:"frame",style:r},e[o])];return n&&i.push(te.createElement("text",{key:"label",style:{}}," "+n)),te.createElement("box",{style:{flexDirection:"row"}},...i)}var Rn=createContext(null),Qr=0;function eo(){let e=useContext(Rn);if(!e)throw new Error("useToast must be used within a <ToastHost>");return e.push}var to={info:{bg:"blackBright",title:"cyanBright",text:"white"},success:{bg:"blackBright",title:"greenBright",text:"white"},warning:{bg:"blackBright",title:"yellowBright",text:"white"},error:{bg:"blackBright",title:"redBright",text:"white"}};function no({position:e="bottom-right",maxVisible:t=5,children:n}){let[r,o]=useState([]),s=useRef(new Map),i=useCallback(R=>{let T=`toast-${Qr++}`,a={id:T,durationMs:3e3,variant:"info",...R};if(o(m=>[...m,a]),a.durationMs&&a.durationMs>0){let m=setTimeout(()=>{s.current.delete(T),o(g=>g.filter(v=>v.id!==T));},a.durationMs);s.current.set(T,m);}},[]);useEffect(()=>()=>{for(let R of s.current.values())clearTimeout(R);s.current.clear();},[]);let c=useRef({push:i});c.current.push=i;let l=e.startsWith("top"),u=e.endsWith("right"),f={position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:900,flexDirection:"column",justifyContent:l?"flex-start":"flex-end",alignItems:u?"flex-end":"flex-start",padding:1},w=r.slice(-t).map(R=>{let T=R.variant??"info",a=to[T],m=[];return R.title&&m.push(te.createElement("text",{key:"title",style:{bold:true,color:a.title}},R.title)),m.push(te.createElement("text",{key:"msg",style:{color:a.text}},R.message)),te.createElement("box",{key:R.id,style:{bg:a.bg,paddingX:1,flexDirection:"column",minWidth:20,maxWidth:50}},...m)});return te.createElement(Rn.Provider,{value:c.current},n,w.length>0?te.createElement("box",{style:f},...w):null)}function oo({items:e,value:t,onChange:n,placeholder:r="Select...",style:o,focusedStyle:s,dropdownStyle:i,highlightColor:c="cyan",maxVisible:l=8,searchable:u=true,disabled:f}){let h=useContext(W),w=useContext(Y),R=useContext(Ce),T=useContext(Ye),a=useRef(null),m=useRef(null),g=useRef(n);g.current=n;let[v,E]=useState(false),[A,D]=useState(false),[F,B]=useState(false),[k,M]=useState(0),[C,x]=useState(""),[S,b]=useState(0),V=fe(a),_=R?.rows??24,O=T?.getBounds(),X=e.find(P=>P.value===t)?.label??"",H=useMemo(()=>{if(!C)return e;let P=C.toLowerCase();return e.filter(z=>z.label.toLowerCase().includes(P))},[e,C]),q=Math.min(l,H.length),L=H.slice(S,S+q);useEffect(()=>{M(0),b(0);},[C]),useEffect(()=>{!A&&F&&(B(false),x(""));},[A,F]),useEffect(()=>{if(!(!h||!m.current||!a.current))return h.register(m.current,a.current)},[h,v]),useEffect(()=>{!h||!m.current||h.setSkippable(m.current,!!f);},[h,f,v]),useEffect(()=>{if(!h||!m.current)return;let P=m.current;return D(h.focusedId===P),h.onFocusChange(z=>{D(z===P);})},[h,v]);let J=useCallback((P,z)=>{let d=P+z;for(;d>=0&&d<H.length;){if(!H[d].disabled)return d;d+=z;}return P},[H]),se=useCallback(P=>{P<S?b(P):P>=S+q&&b(P-q+1);},[S,q]);useEffect(()=>{if(!w||!m.current||f)return;let P=m.current,z=d=>{if(h?.focusedId!==P)return false;if(!F){if(d.name==="return"||d.name===" "||d.sequence===" "||d.name==="down"){B(true),x("");let N=H.findIndex(j=>j.value===t),Z=N>=0?N:0;return M(Z),b(Math.max(0,Z-Math.floor(l/2))),true}return false}if(d.name==="tab")return B(false),x(""),false;if(d.name==="escape")return B(false),x(""),true;if(d.name==="return"){let N=H[k];return N&&!N.disabled&&(g.current?.(N.value),B(false),x("")),true}if(d.name==="up"){let N=J(k,-1);return M(N),se(N),true}if(d.name==="down"){let N=J(k,1);return M(N),se(N),true}if(d.name==="backspace")return u&&C.length>0&&x(N=>N.slice(0,-1)),true;if(d.name==="home"){let N=J(-1,1);return M(N),se(N),true}if(d.name==="end"){let N=J(H.length,-1);return M(N),se(N),true}if(u&&d.sequence&&d.sequence.length===1&&!d.ctrl&&!d.alt){let N=d.sequence;if(N>=" "&&N<="~")return x(Z=>Z+N),true}return true};return w.registerInputHandler(P,z)},[w,h,f,F,k,H,t,l,u,C,J,se,v]);let y={flexDirection:"row",width:"100%",...!o?.bg&&o?.border===void 0?{border:"single"}:{},...o,...A&&s?s:{}},G=X?o?.color??void 0:"blackBright",p=[te.createElement("text",{key:"label",style:{flexGrow:1,flexShrink:1,color:G,wrap:"ellipsis",...X?{}:{dim:true}}},X||r),te.createElement("text",{key:"arrow",style:{flexShrink:0,color:A?c:"blackBright"}},F?" \u25B2":" \u25BC")],I=null;if(F){let P=[];u&&C&&P.push(te.createElement("box",{key:"search",style:{paddingX:1}},te.createElement("text",{style:{color:"blackBright",dim:true}},`/${C}`))),H.length===0&&P.push(te.createElement("box",{key:"empty",style:{paddingX:1}},te.createElement("text",{style:{dim:true,color:"blackBright"}},"No matches"))),S>0&&P.push(te.createElement("box",{key:"scroll-up",style:{justifyContent:"center",alignItems:"center"}},te.createElement("text",{style:{dim:true,color:"blackBright"}},"\u25B2"))),L.forEach((ve,ot)=>{let We=S+ot===k,xe=ve.disabled,Mn={paddingX:1,...We&&!xe?{bg:c}:{}},Vn={...We&&!xe?{color:"black",bold:true}:{},...xe?{dim:true,color:"blackBright"}:{}};P.push(te.createElement("box",{key:`item-${ve.value}`,style:Mn},te.createElement("text",{style:Vn},ve.label)));}),S+q<H.length&&P.push(te.createElement("box",{key:"scroll-down",style:{justifyContent:"center",alignItems:"center"}},te.createElement("text",{style:{dim:true,color:"blackBright"}},"\u25BC")));let z=S>0,d=S+q<H.length,N=u&&C,Z=H.length===0,j=!i?.bg&&i?.border===void 0,ee=q+(j?2:0);z&&(ee+=1),d&&(ee+=1),N&&(ee+=1),Z&&(ee+=1);let de=V.y+V.height,ye,Re;O?(ye=O.visibleBottom-de,Re=V.y-O.visibleTop):(ye=_-de,Re=V.y);let De=ye<ee&&Re>=ee?-ee:V.height||1;I=te.createElement("box",{style:{position:"absolute",top:De,left:0,right:0,zIndex:9999,...j?{border:"single"}:{},bg:"black",flexDirection:"column",...i}},...P);}let $={flexDirection:"column",width:y.width??"100%",minWidth:y.minWidth,maxWidth:y.maxWidth,flexGrow:y.flexGrow,flexShrink:y.flexShrink??1};return te.createElement("box",{style:$},te.createElement("box",{style:y,focusable:true,ref:P=>{P?(a.current=P,m.current=P.focusId,E(true)):(a.current=null,m.current=null,E(false));}},...p),I)}function so({checked:e,onChange:t,label:n,style:r,focusedStyle:o,disabled:s,checkedChar:i="\u2713",uncheckedChar:c=" "}){let l=useContext(W),u=useContext(Y),f=useRef(null),h=useRef(null),w=useRef(t);w.current=t;let R=useRef(e);R.current=e;let[T,a]=useState(false),[m,g]=useState(false);useEffect(()=>{if(!(!l||!h.current||!f.current||s))return l.register(h.current,f.current)},[l,s,T]),useEffect(()=>{if(!l||!h.current)return;let F=h.current;return g(l.focusedId===F),l.onFocusChange(B=>{g(B===F);})},[l,T]),useEffect(()=>{if(!u||!h.current||s)return;let F=h.current,B=k=>l?.focusedId!==F?false:k.name==="return"||k.name===" "||k.sequence===" "?(w.current(!R.current),true):false;return u.registerInputHandler(F,B)},[u,l,s,T]);let v={flexDirection:"row",gap:1,...r,...m&&o?o:{}},E=e?i:c,A={color:s?"blackBright":m?"white":r?.color},D={color:s?"blackBright":r?.color};return te.createElement("box",{style:v,focusable:!s,ref:F=>{F?(f.current=F,h.current=F.focusId,a(true)):(f.current=null,h.current=null,a(false));}},te.createElement("text",{key:"box",style:A},`[${E}]`),n?te.createElement("text",{key:"label",style:D},n):null)}function lo({items:e,value:t,onChange:n,style:r,itemStyle:o,focusedItemStyle:s,selectedItemStyle:i,disabled:c,direction:l="column",gap:u=0,selectedChar:f="\u25CF",unselectedChar:h="\u25CB"}){let w=useContext(W),R=useContext(Y),T=useRef(null),a=useRef(null),m=useRef(n);m.current=n;let[g,v]=useState(false),[E,A]=useState(false),[D,F]=useState(()=>{let C=e.findIndex(x=>x.value===t);return C>=0?C:e.findIndex(x=>!x.disabled)}),B=useCallback((C,x)=>{let S=C;for(let b=0;b<e.length;b++)if(S=(S+x+e.length)%e.length,!e[S]?.disabled)return S;return C},[e]);useEffect(()=>{if(!(!w||!a.current||!T.current||c))return w.register(a.current,T.current)},[w,c,g]),useEffect(()=>{if(!w||!a.current)return;let C=a.current;return A(w.focusedId===C),w.onFocusChange(x=>{A(x===C);})},[w,g]),useEffect(()=>{if(!R||!a.current||c)return;let C=a.current,x=S=>{if(w?.focusedId!==C)return false;if(S.name==="up"||S.name==="left"||S.name==="k"||S.name==="tab"&&S.shift)return F(b=>B(b,-1)),true;if(S.name==="down"||S.name==="right"||S.name==="j"||S.name==="tab"&&!S.shift)return F(b=>B(b,1)),true;if(S.name==="return"||S.name===" "||S.sequence===" "){let b=e[D];return b&&!b.disabled&&m.current(b.value),true}return false};return R.registerInputHandler(C,x)},[R,w,c,e,D,B,g]),useEffect(()=>{let C=e.findIndex(x=>x.value===t);C>=0&&F(C);},[t,e]);let k={flexDirection:l,gap:u,...r},M=e.map((C,x)=>{let S=C.value===t,b=x===D,V=c||C.disabled,_=S?f:h,O={flexDirection:"row",gap:1,...o};S&&i&&(O={...O,...i}),E&&b&&s&&(O={...O,...s});let K=V?"blackBright":E&&b?s?.color??"white":S?i?.color??o?.color:o?.color;return te.createElement("box",{key:x,style:O},te.createElement("text",{key:"radio",style:{color:K}},`(${_})`),te.createElement("text",{key:"label",style:{color:K}},C.label))});return te.createElement("box",{style:k,focusable:!c,ref:C=>{C?(T.current=C,a.current=C.focusId,v(true)):(T.current=null,a.current=null,v(false));}},...M)}var En=createContext(null);function uo(){let e=useContext(En);if(!e)throw new Error("useDialog must be used within a DialogHost");return e}function ao({children:e}){let[t,n]=useState([]),r=useRef(0),o=useCallback((u,f)=>new Promise(h=>{let w=++r.current;n(R=>[...R,{id:w,type:"alert",content:u,okText:f?.okText??"OK",cancelText:"",style:f?.style,buttonStyle:f?.buttonStyle,okButtonStyle:f?.okButtonStyle,focusedButtonStyle:f?.focusedButtonStyle,backdropStyle:f?.backdropStyle,resolve:()=>h()}]);}),[]),s=useCallback((u,f)=>new Promise(h=>{let w=++r.current;n(R=>[...R,{id:w,type:"confirm",content:u,okText:f?.okText??"OK",cancelText:f?.cancelText??"Cancel",style:f?.style,buttonStyle:f?.buttonStyle,okButtonStyle:f?.okButtonStyle,cancelButtonStyle:f?.cancelButtonStyle,focusedButtonStyle:f?.focusedButtonStyle,backdropStyle:f?.backdropStyle,resolve:h}]);}),[]),i=useCallback((u,f)=>{n(h=>{let w=h.find(R=>R.id===u);return w&&w.resolve(f),h.filter(R=>R.id!==u)});},[]),c={alert:o,confirm:s},l=t[t.length-1];return te.createElement(En.Provider,{value:c},e,l&&te.createElement(fo,{key:l.id,dialog:l,onDismiss:i}))}function fo({dialog:e,onDismiss:t}){let n=useContext(W),r=useRef(null),o=useRef(null),s=useRef(null),i=useRef(null),[c,l]=useState("ok"),[u,f]=useState(0);useEffect(()=>{if(!n||u===0)return;let g=[];return r.current&&s.current&&g.push(n.register(s.current,r.current)),o.current&&i.current&&g.push(n.register(i.current,o.current)),s.current&&n.requestFocus(s.current),()=>g.forEach(v=>v())},[n,u]),useEffect(()=>{if(n)return n.onFocusChange(g=>{g===s.current?l("ok"):g===i.current&&l("cancel");})},[n]),Le(g=>{if(g.name==="return"||g.name==="space"){e.type==="alert"?t(e.id,true):t(e.id,c==="ok");return}if(g.name==="escape"){t(e.id,false);return}e.type==="confirm"&&n&&(g.name==="left"||g.name==="right")&&(c==="ok"&&i.current?n.requestFocus(i.current):s.current&&n.requestFocus(s.current));},[e,c,n,t]);let h=typeof e.content=="string",w=h?e.content.length:0,T={minWidth:Math.max(20,h?Math.min(w+6,50):30),maxWidth:50,bg:"black",border:"round",borderColor:"white",padding:1,flexDirection:"column",gap:1,...e.style},a=(g,v)=>{let E={paddingX:2,bg:"blackBright",color:"white"},A={bg:"white",color:"black",bold:true},D=g==="ok"?e.okButtonStyle:e.cancelButtonStyle;return {...E,...e.buttonStyle,...D,...v?{...A,...e.focusedButtonStyle}:{}}},m={position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999,...e.backdropStyle};return te.createElement(ft,{trap:true},te.createElement("box",{style:m}),te.createElement("box",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,justifyContent:"center",alignItems:"center",zIndex:1e3}},te.createElement("box",{style:T},te.createElement("box",{style:{flexDirection:"column"}},typeof e.content=="string"?te.createElement("text",null,e.content):e.content),te.createElement("box",{style:{flexDirection:"row",justifyContent:"flex-end",gap:1}},e.type==="confirm"&&te.createElement("box",{style:a("cancel",c==="cancel"),focusable:true,ref:g=>{g&&g.focusId&&!i.current&&(o.current=g,i.current=g.focusId,f(v=>v+1));}},te.createElement("text",null,e.cancelText)),te.createElement("box",{style:a("ok",c==="ok"),focusable:true,ref:g=>{g&&g.focusId&&!s.current&&(r.current=g,s.current=g.focusId,f(v=>v+1));}},te.createElement("text",null,e.okText))))))}function ho(e,t){let n=[],r=t.split("");if(e<=r.length)for(let o=0;o<e;o++)n.push(r[o]);else for(let o=0;o<r.length&&n.length<e;o++)for(let s=0;s<r.length&&n.length<e;s++)n.push(r[o]+r[s]);return n}function go({children:e,activationKey:t="ctrl+o",hintStyle:n,hintBg:r="yellow",hintFg:o="black",hintChars:s="asdfghjklqwertyuiopzxcvbnm",enabled:i=true,debug:c=false}){let l=c?(...C)=>console.error("[JumpNav]",...C):()=>{},[u,f]=useState(false),[h,w]=useState(""),[R,T]=useState([]),a=useContext(Y),m=useContext(W),g=useContext(oe);useEffect(()=>{l("Mounted, inputCtx:",!!a,"focusCtx:",!!m,"enabled:",i);},[]);let E=useCallback(C=>{let x=C.toLowerCase().split("+");return {ctrl:x.includes("ctrl"),alt:x.includes("alt"),shift:x.includes("shift"),meta:x.includes("meta"),name:x[x.length-1]??""}},[])(t),A=useCallback(()=>{if(!m?.getActiveElements){l("refreshElements: no getActiveElements");return}let C=m.getActiveElements();l("getActiveElements returned",C.length,"elements");let x=C.map(({id:S,node:b})=>({id:S,node:b,layout:g?.getLayout(b)??b.layout}));x.sort((S,b)=>S.layout.y!==b.layout.y?S.layout.y-b.layout.y:S.layout.x-b.layout.x),T(x);},[m,g,l]),D=useRef(false);useEffect(()=>{u&&!D.current&&(l("Activated! Refreshing elements..."),A()),D.current=u;},[u,A,l]);let F=R.filter(C=>C.layout.width>0&&C.layout.height>0),B=ho(F.length,s),k=useMemo(()=>{let C=new Map;return F.forEach((x,S)=>{B[S]&&C.set(B[S],x.id);}),C},[F,B]);useEffect(()=>{if(!a||!i){l("Not subscribing - inputCtx:",!!a,"enabled:",i);return}l("Subscribing to priority input, activation key:",t);let C=x=>{let S=x.name===E.name,b=!!x.ctrl===E.ctrl,V=!!x.alt===E.alt,_=!!x.shift===E.shift,O=!!x.meta===E.meta;if(!u&&S&&b&&V&&_&&O)return l("Activation key matched! Activating..."),f(true),w(""),true;if(u){if(x.name==="escape")return l("Escape pressed, deactivating"),f(false),w(""),true;if(x.name==="backspace")return w(""),true;if(x.sequence&&x.sequence.length===1&&/[a-z]/i.test(x.sequence)){let K=h+x.sequence.toLowerCase();l("Buffer:",K);let X=k.get(K);return X?(l("Jumping to",X),m?.requestFocus(X),f(false),w(""),true):[...k.keys()].some(q=>q.startsWith(K))?(w(K),true):(w(""),true)}return true}return false};return a.subscribePriority(C)},[a,i,u,E,h,k,m,t,l]);let M=u?te.createElement("box",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:99998}},...F.map((C,x)=>{let S=B[x];if(!S)return null;let{x:b,y:V}=C.layout,_=S.startsWith(h)&&h.length>0;return te.createElement("box",{key:C.id,style:{position:"absolute",top:V,left:Math.max(0,b-S.length-2),bg:_?"cyan":r,color:o,paddingX:1,zIndex:99999,...n}},te.createElement("text",{style:{bold:true,color:o}},S))}),te.createElement("box",{style:{position:"absolute",bottom:0,left:0,right:0,bg:"blackBright",paddingX:1,zIndex:99999}},te.createElement("text",{style:{color:"white"}},h?`Jump: ${h}_`:"Press a key to jump \u2022 ESC to cancel"))):null;return te.createElement(te.Fragment,null,e,M)}function So(e){let t=useContext(W),[n]=useState(()=>`focus-${Math.random().toString(36).slice(2,9)}`),r=t?t.focusedId===n:false;useEffect(()=>{if(!(!t||!e?.current))return e.current.focusId=n,t.register(n,e.current)},[t,n,e]);let o=useMemo(()=>()=>{t?.requestFocus(n);},[t,n]);return {focused:r,focus:o}}function Ro(e={}){let{disabled:t,onFocus:n,onBlur:r,onKeyPress:o}=e,s=useContext(W),i=useContext(Y),c=useRef(null),l=useRef(null),[u,f]=useState(false),h=useRef(n),w=useRef(r),R=useRef(o);h.current=n,w.current=r,R.current=o;let T=useCallback(m=>{c.current=m,m?l.current=m.focusId??null:l.current=null;},[]);useEffect(()=>{if(!(!s||!l.current||!c.current))return s.register(l.current,c.current)},[s]),useEffect(()=>{!s||!l.current||s.setSkippable(l.current,!!t);},[s,t]),useEffect(()=>{if(!s||!l.current)return;let m=l.current,g=s.focusedId===m;return f(g),s.onFocusChange(v=>{let E=v===m;f(A=>(E&&!A?h.current?.():!E&&A&&w.current?.(),E));})},[s]),useEffect(()=>{if(!i||!l.current||t)return;let m=l.current,g=v=>s?.focusedId!==m?false:R.current?.(v)===true;return i.registerInputHandler(m,g)},[i,s,t]);let a=useCallback(()=>{s&&l.current&&s.requestFocus(l.current);},[s]);return {ref:T,isFocused:u,focus:a,focusId:l.current}}function Io(){let e=useContext(Ce);if(!e)throw new Error("useApp must be used within a Glyph render tree");return {exit:e.exit,get columns(){return e.columns},get rows(){return e.rows}}}function Eo(){let e=useContext(W),t=useContext(oe),[n,r]=useState([]),o=useRef(()=>{}),s=useCallback(()=>{if(!e)return;let c=(e.getActiveElements?.()??e.getRegisteredElements?.()??[]).map(({id:l,node:u})=>({id:l,node:u,layout:t?.getLayout(u)??u.layout,type:u.type}));c.sort((l,u)=>l.layout.y!==u.layout.y?l.layout.y-u.layout.y:l.layout.x-u.layout.x),r(c);},[e,t]);return o.current=s,useEffect(()=>{if(!e)return;s();let i=e.onFocusChange(()=>{s();}),c=setTimeout(s,50);return ()=>{i(),clearTimeout(c);}},[e,t,s]),e?{elements:n,focusedId:e.focusedId,requestFocus:e.requestFocus,focusNext:e.focusNext,focusPrev:e.focusPrev,refresh:()=>o.current()}:null}function Fo(e){let t=[];for(let n of e)switch(n){case "9":t.push({type:"digit",char:n});break;case "a":t.push({type:"letter",char:n});break;case "*":t.push({type:"alphanumeric",char:n});break;default:t.push({type:"literal",char:n});break}return t}function Go(e,t){switch(t){case "digit":return /\d/.test(e);case "letter":return /[a-zA-Z]/.test(e);case "alphanumeric":return /[a-zA-Z0-9]/.test(e);case "literal":return true}}function ne(e){let t=typeof e=="string"?{mask:e}:e,{mask:n,placeholder:r="_",showPlaceholder:o=false}=t,s=Fo(n);return (i,c)=>{let l=[];for(let h of i)(h!==r&&!/[\s\-\(\)\/\.\:]/.test(h)||/[a-zA-Z0-9]/.test(h))&&/[a-zA-Z0-9]/.test(h)&&l.push(h);let u="",f=0;for(let h of s)if(h.type==="literal")(f<l.length||o)&&(u+=h.char);else if(f<l.length){let w=l[f];if(Go(w,h.type))u+=w,f++;else {f++;continue}}else o&&(u+=r);return u}}var Bo={usPhone:ne("(999) 999-9999"),intlPhone:ne("+9 999 999 9999"),dateUS:ne("99/99/9999"),dateEU:ne("99/99/9999"),dateISO:ne("9999-99-99"),time:ne("99:99"),timeFull:ne("99:99:99"),creditCard:ne("9999 9999 9999 9999"),ssn:ne("999-99-9999"),zip:ne("99999"),zipPlus4:ne("99999-9999"),ipv4:ne("999.999.999.999"),mac:ne("**:**:**:**:**:**")};export{pr as Box,Pr as Button,so as Checkbox,ao as DialogHost,ft as FocusScope,xr as Input,go as JumpNav,Ir as Keybind,Ct as List,jr as Menu,kr as Portal,Wr as Progress,lo as Radio,Ar as ScrollView,oo as Select,Rr as Spacer,zr as Spinner,gr as Text,no as ToastHost,ne as createMask,Bo as masks,ar as render,Io as useApp,uo as useDialog,So as useFocus,Eo as useFocusRegistry,Ro as useFocusable,Le as useInput,fe as useLayout,eo as useToast};//# sourceMappingURL=index.js.map
|
|
2
|
+
`);if(n===MeasureMode.Undefined||r==="none"){let l=0;for(let u of o){let f=ue(u);f>l&&(l=f);}return {width:l,height:o.length}}let s=Math.max(1,Math.floor(t)),i=ce(o,s,r),c=0;for(let l of i){let u=ue(l);u>c&&(c=u);}return {width:c,height:i.length}}function ce(e,t,n){let r=[];for(let o of e){if(ue(o)<=t){r.push(o);continue}if(n==="truncate"){r.push(Xt(o,t));continue}if(n==="ellipsis"){r.push(Xn(o,t));continue}let i=Jn(o,t);r.push(...i);}return r}function Xt(e,t){let n="",r=0;for(let o of e){let s=ue(o);if(r+s>t)break;n+=o,r+=s;}return n}function Xn(e,t){if(t<=1)return t===1?"\u2026":"";let n=Xt(e,t-1);return ue(n)<ue(e)?n+"\u2026":e}function Jn(e,t){let n=[],r="",o=0,s="",i=0;for(let c=0;c<=e.length;c++){let l=e[c],u=c===e.length,f=l===" ";if(u||f){if(s.length>0){if(o+i<=t)r+=s,o+=i;else if(i<=t)r.length>0&&n.push(r),r=s,o=i;else for(let m of s){let S=ue(m);o+S>t&&r.length>0&&(n.push(r),r="",o=0),r+=m,o+=S;}s="",i=0;}f&&(o+1<=t?(r+=" ",o+=1):(r.length>0&&n.push(r),r=" ",o=1));}else l&&(s+=l,i+=ue(l));}return r.length>0&&n.push(r),n.length>0?n:[""]}function Jt(e,t,n={}){t.clear();let r={},o=[],s={x:0,y:0,width:t.width,height:t.height};for(let i of e)i.hidden||Yt(i,s,i.style.zIndex??0,o);o.sort((i,c)=>i.zIndex-c.zIndex);for(let i of o){let c=Un(i.node,t,i.clip,n);c?.cursorPosition&&(r.cursorPosition=c.cursorPosition);}return r}function Yt(e,t,n,r){if(e.hidden)return;let o=e.style.zIndex??n,s=e.style.clip?Yn(t,{x:e.layout.innerX,y:e.layout.innerY,width:e.layout.innerWidth,height:e.layout.innerHeight}):t;if(r.push({node:e,clip:t,zIndex:o}),e.type!=="text"&&e.type!=="input")for(let i of e.children)Yt(i,s,o,r);}function Yn(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),o=Math.min(e.x+e.width,t.x+t.width),s=Math.min(e.y+e.height,t.y+t.height);return {x:n,y:r,width:Math.max(0,o-n),height:Math.max(0,s-r)}}function Xe(e,t,n){return e>=n.x&&e<n.x+n.width&&t>=n.y&&t<n.y+n.height}function Un(e,t,n,r={}){let{x:o,y:s,width:i,height:c,innerX:l,innerY:u,innerWidth:f,innerHeight:m}=e.layout,S=e.style;if(i<=0||c<=0)return;let v=_e(e).bg;if(S.bg)for(let p=s;p<s+c;p++)for(let h=o;h<o+i;h++)Xe(h,p,n)&&t.setChar(h,p," ",void 0,S.bg);let a=S.border?qt(S.border):null;if(a&&i>=2&&c>=2){let p=S.borderColor,h=v;ie(t,n,o,s,a.topLeft,p,h);for(let I=o+1;I<o+i-1;I++)ie(t,n,I,s,a.horizontal,p,h);ie(t,n,o+i-1,s,a.topRight,p,h),ie(t,n,o,s+c-1,a.bottomLeft,p,h);for(let I=o+1;I<o+i-1;I++)ie(t,n,I,s+c-1,a.horizontal,p,h);ie(t,n,o+i-1,s+c-1,a.bottomRight,p,h);for(let I=s+1;I<s+c-1;I++)ie(t,n,o,I,a.vertical,p,h),ie(t,n,o+i-1,I,a.vertical,p,h);}if(e.type==="text")Zn(e,t,n);else if(e.type==="input")return Qn(e,t,n,r)}function ie(e,t,n,r,o,s,i,c,l,u,f){Xe(n,r,t)&&e.setChar(n,r,o,s,i,c,l,u,f);}function Ut(e,t){if(e!==void 0)return e;if(t!==void 0)return ze(t)?"black":"white"}function Zn(e,t,n){let{innerX:r,innerY:o,innerWidth:s,innerHeight:i}=e.layout,c=_e(e),l=it(e);if(!l)return;let u=Ut(c.color,c.bg),f=e.style.wrap??"wrap",m=e.style.textAlign??"left",S=l.split(`
|
|
3
|
+
`),R=ce(S,s,f);for(let v=0;v<R.length&&v<i;v++){let a=R[v],p=ue(a),h=0;m==="center"?h=Math.max(0,Math.floor((s-p)/2)):m==="right"&&(h=Math.max(0,s-p));let I=0;for(let P of a){let j=ue(P);j>0&&ie(t,n,r+h+I,o+v,P,u,c.bg,c.bold,c.dim,c.italic,c.underline),I+=j;}}}function Qn(e,t,n,r={}){let{cursorInfo:o,useNativeCursor:s}=r,{innerX:i,innerY:c,innerWidth:l,innerHeight:u}=e.layout;if(l<=0||u<=0)return;let f=e.props.value??e.props.defaultValue??"",m=e.props.placeholder??"",S=f||m,R=!f&&!!m,v=e.props.multiline??false,a=_e(e),p=Ut(a.color,a.bg),h=a.bg?ze(a.bg)?"blackBright":"whiteBright":"blackBright",I=R?h:p??a.color??e.style.color,P=R?h:I,j=R?true:a.dim,K=o&&o.nodeId===e.focusId,E;if(v&&!R){let G=e.style.wrap??"wrap",T=S.split(`
|
|
4
|
+
`),M=ce(T,l,G),b=0,y=0;if(K){let x=o.position,V=0,z=x,O=0;for(let J=0;J<T.length;J++){let B=T[J].length;if(x<=O+B){V=J,z=x-O;break}O+=B+1;}let W=0;for(let J=0;J<V;J++)W+=ce([T[J]],l,G).length;let Y=ce([T[V]],l,G),X=0,_=0;for(let J=0;J<Y.length;J++){let B=Y[J];if(z<=X+B.length){_=J;break}X+=B.length;}b=W+_,y=ue(T[V].slice(X,X+(z-X)));}let C=Math.max(0,b-u+1);for(let x=0;x<u;x++){let V=C+x;if(V>=M.length)break;let z=M[V],O=0;for(let W of z){if(O>=l)break;let Y=ue(W);Y>0&&ie(t,n,i+O,c+x,W,P,a.bg,a.bold,j,a.italic,a.underline),O+=Y;}}if(K){let x=b-C;if(x>=0&&x<u){let V=Math.min(y,l-1),z=i+V,O=c+x;if(Xe(z,O,n)&&z<i+l)if(s)E={cursorPosition:{x:z,y:O,bg:a.bg}};else {let W=t.get(z,O),Y=W?.ch&&W.ch!==" "?W.ch:"\u258C",X=a.bg??"black",_=a.color??"white";t.setChar(z,O,Y,X,_,W?.bold,W?.dim,W?.italic,false);}}}}else {let G=0;for(let T of S){if(G>=l)break;let M=ue(T);M>0&&ie(t,n,i+G,c,T,P,a.bg,a.bold,j,a.italic,a.underline),G+=M;}if(K){let T=Math.min(o.position,l-1),M=i+T;if(Xe(M,c,n)&&M<i+l)if(s)E={cursorPosition:{x:M,y:c,bg:a.bg}};else {let b=t.get(M,c),y=b?.ch&&b.ch!==" "?b.ch:"\u258C",C=a.bg??"black",x=a.color??"white";t.setChar(M,c,y,C,x,b?.bold,b?.dim,b?.italic,false);}}}return E}var er="\x1B",me=`${er}[`;function tr(e,t){return `${me}${t+1};${e+1}H`}function nr(e){let t=`${me}0m`;return e.bold&&(t+=`${me}1m`),e.dim&&(t+=`${me}2m`),e.italic&&(t+=`${me}3m`),e.underline&&(t+=`${me}4m`),e.fg!=null&&(t+=Ot(e.fg)),e.bg!=null&&(t+=Dt(e.bg)),t}function Zt(e,t,n){let r="",o=-1,s=-1,i="";for(let c=0;c<t.height;c++)for(let l=0;l<t.width;l++){let u=t.get(l,c);if(!n){let m=e.get(l,c);if(m&&t.cellsEqual(u,m))continue}(s!==c||o!==l)&&(r+=tr(l,c));let f=nr(u);f!==i&&(r+=f,i=f),r+=u.ch,o=l+1,s=c;}return r.length>0&&(r+=`${me}0m`),r}var ir={row:FlexDirection.Row,column:FlexDirection.Column},lr={"flex-start":Justify.FlexStart,center:Justify.Center,"flex-end":Justify.FlexEnd,"space-between":Justify.SpaceBetween,"space-around":Justify.SpaceAround},cr={"flex-start":Align.FlexStart,center:Align.Center,"flex-end":Align.FlexEnd,stretch:Align.Stretch};function tn(e,t,n){n!==void 0&&(typeof n=="string"&&n.endsWith("%"),t(n));}function ae(e,t,n){n!==void 0&&(typeof n=="string"&&n.endsWith("%")?e.setPositionPercent(t,parseFloat(n)):e.setPosition(t,n));}function ur(e,t,n){tn(e,o=>e.setWidth(o),t.width),tn(e,o=>e.setHeight(o),t.height),t.minWidth!==void 0&&e.setMinWidth(t.minWidth),t.minHeight!==void 0&&e.setMinHeight(t.minHeight),t.maxWidth!==void 0&&e.setMaxWidth(t.maxWidth),t.maxHeight!==void 0&&e.setMaxHeight(t.maxHeight),t.padding!==void 0&&e.setPadding(Edge.All,t.padding),t.paddingX!==void 0&&e.setPadding(Edge.Horizontal,t.paddingX),t.paddingY!==void 0&&e.setPadding(Edge.Vertical,t.paddingY),t.paddingTop!==void 0&&e.setPadding(Edge.Top,t.paddingTop),t.paddingRight!==void 0&&e.setPadding(Edge.Right,t.paddingRight),t.paddingBottom!==void 0&&e.setPadding(Edge.Bottom,t.paddingBottom),t.paddingLeft!==void 0&&e.setPadding(Edge.Left,t.paddingLeft);let r=t.border!=null&&t.border!=="none";e.setBorder(Edge.All,r?1:0),t.flexDirection&&e.setFlexDirection(ir[t.flexDirection]??FlexDirection.Column),t.flexWrap&&e.setFlexWrap(t.flexWrap==="wrap"?Wrap.Wrap:Wrap.NoWrap),t.justifyContent&&e.setJustifyContent(lr[t.justifyContent]??Justify.FlexStart),t.alignItems&&e.setAlignItems(cr[t.alignItems]??Align.Stretch),t.flexGrow!==void 0&&e.setFlexGrow(t.flexGrow),t.flexShrink!==void 0&&e.setFlexShrink(t.flexShrink),t.gap!==void 0&&e.setGap(Gutter.All,t.gap),t.position==="absolute"?e.setPositionType(PositionType.Absolute):e.setPositionType(PositionType.Relative),t.inset!==void 0&&(ae(e,Edge.Top,t.inset),ae(e,Edge.Right,t.inset),ae(e,Edge.Bottom,t.inset),ae(e,Edge.Left,t.inset)),ae(e,Edge.Top,t.top),ae(e,Edge.Right,t.right),ae(e,Edge.Bottom,t.bottom),ae(e,Edge.Left,t.left),t.clip&&e.setOverflow(Overflow.Hidden);}function rn(e){let t=nn.Node.create();if(e.yogaNode=t,ur(t,e.style,e.type),e.type==="text"||e.type==="input")t.setMeasureFunc((n,r,o,s)=>{let i;return e.type==="input"?(i=e.props.value??e.props.defaultValue??e.props.placeholder??"",i.length===0&&(i=" ")):i=on(e),zt(i,n,r,e.style.wrap??"wrap")});else for(let n=0;n<e.children.length;n++){let r=e.children[n];r.hidden||(rn(r),t.insertChild(r.yogaNode,t.getChildCount()));}}function on(e){if(e.text!=null)return e.text;let t="";for(let n of e.children)t+=on(n);if(t===""&&e.props.children!=null){if(typeof e.props.children=="string")return e.props.children;if(typeof e.props.children=="number")return String(e.props.children)}return t}function sn(e,t,n){let r=e.yogaNode,o=r.getComputedLayout(),s=t+o.left,i=n+o.top,c=o.width,l=o.height,u=e.style.border&&e.style.border!=="none"?1:0,f=r.getComputedPadding(Edge.Top),m=r.getComputedPadding(Edge.Right),S=r.getComputedPadding(Edge.Bottom),R=r.getComputedPadding(Edge.Left),v=s+u+R,a=i+u+f,p=Math.max(0,c-u*2-R-m),h=Math.max(0,l-u*2-f-S);e.layout={x:s,y:i,width:c,height:l,innerX:v,innerY:a,innerWidth:p,innerHeight:h};for(let I of e.children)I.hidden||!I.yogaNode||sn(I,s,i);}function ln(e,t,n){let r=nn.Node.create();r.setWidth(t),r.setHeight(n),r.setFlexDirection(FlexDirection.Column);for(let o of e)o.hidden||(rn(o),r.insertChild(o.yogaNode,r.getChildCount()));r.calculateLayout(t,n,Direction.LTR);for(let o of e)o.hidden||!o.yogaNode||sn(o,0,0);r.freeRecursive(),cn(e);}function cn(e){for(let t of e)t.yogaNode=null,cn(t.children);}var Z=createContext(null),q=createContext(null),oe=createContext(null),Ce=createContext(null),Ye=createContext(null);function ar(e,t={}){let n=t.stdout??process.stdout,r=t.stdin??process.stdin,o=t.debug??false,s=t.useNativeCursor??true,i=new $e(n,r);i.setup();let c=false;i.queryPalette().then(g=>{_t(g),f=true,x();});let l=new ke(i.columns,i.rows),u=new ke(i.columns,i.rows),f=true,m=new Set,S=new Set,R=new Map,v={subscribe(g){return m.add(g),()=>m.delete(g)},subscribePriority(g){return S.add(g),()=>S.delete(g)},registerInputHandler(g,L){return R.set(g,L),()=>R.delete(g)}},a=null,p=new Map,h=[],I=new Set,P=[],j=new Set;function K(g){if(a!==g){a=g,x();for(let L of j)L(a);}}function E(){let g=[...h];if(P.length>0){let L=P[P.length-1];g=g.filter(N=>L.has(N));}return g=g.filter(L=>!I.has(L)),g.sort((L,N)=>{let w=p.get(L),k=p.get(N);if(!w||!k)return 0;let F=w.layout,$=k.layout;return F.y!==$.y?F.y-$.y:F.x-$.x}),g}let G={get focusedId(){return a},register(g,L){if(p.set(g,L),h.includes(g)||h.push(g),P.length>0&&P[P.length-1].add(g),a===null){let N=E();N.length>0&&K(N[0]);}return ()=>{p.delete(g);let N=h.indexOf(g);if(N!==-1&&h.splice(N,1),a===g){let w=E();K(w[0]??null);}}},requestFocus(g){K(g);},focusNext(){let g=E();if(g.length===0)return;let N=((a?g.indexOf(a):-1)+1)%g.length;K(g[N]);},focusPrev(){let g=E();if(g.length===0)return;let N=((a?g.indexOf(a):0)-1+g.length)%g.length;K(g[N]);},setSkippable(g,L){if(L){if(I.add(g),a===g){let N=E();N.length>0&&K(N[0]);}}else I.delete(g);},trapIds:null,pushTrap(g){return P.push(g),()=>{let L=P.indexOf(g);L!==-1&&P.splice(L,1);}},onFocusChange(g){return j.add(g),()=>{j.delete(g);}},getRegisteredElements(){let g=[];for(let L of h){if(I.has(L))continue;let N=p.get(L);N&&g.push({id:L,node:N});}return g},getActiveElements(){let g=E(),L=[];for(let N of g){if(I.has(N))continue;let w=p.get(N);w&&L.push({id:N,node:w});}return L}},T=new Map,M={getLayout(g){return g.layout},subscribe(g,L){return T.has(g)||T.set(g,new Set),T.get(g).add(L),()=>{let N=T.get(g);N&&(N.delete(L),N.size===0&&T.delete(g));}}},b={registerNode(){},unregisterNode(){},scheduleRender:x,exit(g){le.exit(g);},get columns(){return i.columns},get rows(){return i.rows}},y={type:"root",children:[],onCommit(){x();}},C=false;function x(){C||(C=true,queueMicrotask(()=>{C=false,V();}));}function V(){let g=i.columns,L=i.rows;(u.width!==g||u.height!==L)&&(u.resize(g,L),l.resize(g,L),f=true),ln(y.children,g,L),z(y.children);let N;if(a){let F=p.get(a);F?.type==="input"&&(N={nodeId:a,position:F.props.cursorPosition??F.props.value?.length??0});}let w=Jt(y.children,u,{cursorInfo:N,useNativeCursor:s}),k=Zt(l,u,f);if(k.length>0&&i.write(k),s)if(w.cursorPosition){let F=$t(w.cursorPosition.bg);i.setCursorColor(F),i.moveCursor(w.cursorPosition.x,w.cursorPosition.y),c||(i.showCursor(),c=true);}else c&&(i.hideCursor(),c=false);for(let F=0;F<u.cells.length;F++)l.cells[F]={...u.cells[F]};f=false;}function z(g){for(let L of g){let N=T.get(L);if(N)for(let w of N)w(L.layout);z(L.children);}}let O=i.onData(g=>{let L=jt(g);for(let N of L){if(N.ctrl&&N.name==="c"){le.exit();return}if(N.ctrl&&N.name==="z"){i.suspend(),process.kill(0,"SIGSTOP");return}let w=false;for(let k of S)if(k(N)){w=true;break}if(!w&&a){let k=R.get(a);k&&(w=k(N));}if(!w&&N.name==="tab"&&!N.ctrl&&!N.alt){N.shift?G.focusPrev():G.focusNext();continue}if(!w)for(let k of m)k(N);}}),W=i.onResize(()=>{f=true,x();}),Y=()=>{i.resume(),f=true,x();};process.on("SIGCONT",Y);let X=te.createElement(Ce.Provider,{value:b},te.createElement(Z.Provider,{value:v},te.createElement(q.Provider,{value:G},te.createElement(oe.Provider,{value:M},e)))),_=g=>{o&&console.error("Uncaught error:",g);},J=g=>{o&&console.error("Error caught by boundary:",g);},B=g=>{o&&console.error("Recoverable error:",g);},se=Ie.createContainer(y,0,null,false,null,"",_,J,B,null);Ie.updateContainer(X,se,null,null);let le={unmount(){Ie.updateContainer(null,se,null,null),O(),W(),process.off("SIGCONT",Y),i.cleanup();},exit(g){le.unmount(),process.exit(g??0);}};return le}var pr=forwardRef(function({children:t,style:n,focusable:r},o){return te.createElement("box",{style:n,focusable:r,ref:o},t)});var gr=forwardRef(function({children:t,style:n,wrap:r},o){let s=r?{...n,wrap:r}:n;return te.createElement("text",{style:s,ref:o},t)});function un(e,t,n){if(n<=0)return {visualLine:0,visualCol:t,totalVisualLines:1,lineStartOffset:0,lineLength:e.length};let r=e.split(`
|
|
5
|
+
`),o=[],s=0;for(let l of r){let u=ce([l],n,"wrap"),f=0;for(let m of u)o.push({text:m,logicalOffset:s+f}),f+=m.length;s+=l.length+1;}let i=0;for(let l=0;l<o.length;l++){let u=o[l],f=u.text.length,m=l+1<o.length&&o[l+1].logicalOffset!==u.logicalOffset+f,S=f+(m?1:0);if(t<i+f||l===o.length-1)return {visualLine:l,visualCol:Math.min(t-i,f),totalVisualLines:o.length,lineStartOffset:i,lineLength:f};i+=S;}let c=o.length-1;return {visualLine:c,visualCol:o[c].text.length,totalVisualLines:o.length,lineStartOffset:i-o[c].text.length,lineLength:o[c].text.length}}function an(e,t,n,r){if(r<=0)return Math.min(n,e.length);let o=e.split(`
|
|
6
|
+
`),s=[],i=0;for(let f of o){let m=ce([f],r,"wrap"),S=0;for(let R of m)s.push({text:R,startOffset:i+S}),S+=R.length;i+=f.length+1;}let c=Math.max(0,Math.min(t,s.length-1)),l=s[c],u=Math.min(n,l.text.length);return l.startOffset+u}function Ge(e,t){let n=e.split(`
|
|
7
|
+
`),r=t;for(let s=0;s<n.length;s++){if(r<=n[s].length)return {line:s,col:r,lines:n};r-=n[s].length+1;}let o=n.length-1;return {line:o,col:n[o].length,lines:n}}function Be(e,t,n){let r=0;for(let o=0;o<t&&o<e.length;o++)r+=e[o].length+1;return r+Math.min(n,e[t]?.length??0)}function xr(e){let{value:t,defaultValue:n="",onChange:r,onKeyPress:o,onBeforeChange:s,placeholder:i,style:c,focusedStyle:l,multiline:u,autoFocus:f,type:m="text"}=e,[S,R]=useState(n),[v,a]=useState(n.length),[p,h]=useState(0),[I,P]=useState(false),[j,K]=useState(false),E=useContext(Z),G=useContext(q),T=useContext(oe),M=useRef(null),b=useRef(null),y=t!==void 0,C=y?t:S;useEffect(()=>{if(!T||!M.current)return;let _=T.getLayout(M.current);return h(_.innerWidth),T.subscribe(M.current,J=>{h(J.innerWidth);})},[T]);let x=useRef(C),V=useRef(v),z=useRef(C),O=useRef(v);useEffect(()=>{C!==z.current&&(x.current=C,z.current=C,V.current>C.length&&(V.current=C.length,O.current=C.length,a(C.length)));},[C]),useEffect(()=>{v!==O.current&&(V.current=v,O.current=v);},[v]);let W=useRef({isControlled:y,onChange:r,onKeyPress:o,onBeforeChange:s,multiline:u??false,innerWidth:p,type:m});W.current={isControlled:y,onChange:r,onKeyPress:o,onBeforeChange:s,multiline:u??false,innerWidth:p,type:m},useEffect(()=>{if(!(!G||!b.current||!M.current))return G.register(b.current,M.current)},[G,j]);let Y=useRef(false);useEffect(()=>{if(!j){Y.current=false;return}if(f&&!Y.current&&G&&b.current){Y.current=true;let _=b.current,J=setTimeout(()=>{G.requestFocus(_);},0);return ()=>clearTimeout(J)}},[f,G,j]),useEffect(()=>{if(!G||!b.current)return;let _=b.current;return P(G.focusedId===_),G.onFocusChange(J=>{P(J===_);})},[G,j]),useEffect(()=>{if(!E||!b.current)return;let _=b.current,J=B=>{let{isControlled:se,onChange:le,onKeyPress:g,onBeforeChange:L,multiline:N}=W.current;if(g?.(B)===true)return true;let w=x.current,k=V.current;if(B.name==="escape")return false;let F=(d,A)=>{let H=d,Q=A;if(L){let U=L(d,w);if(U===false)return;typeof U=="string"&&(H=U,Q=U.length);}x.current=H,V.current=Q,z.current=H,O.current=Q,se||R(H),le?.(H),a(Q);},$=d=>{V.current=d,O.current=d,a(d);};if(B.name==="return"){if(N){let d=w.slice(0,k)+`
|
|
8
|
+
`+w.slice(k);return F(d,k+1),true}return false}if(B.ctrl){if(B.name==="w"){if(k>0){let d=k;for(;d>0&&w[d-1]===" ";)d--;for(;d>0&&w[d-1]!==" "&&(!N||w[d-1]!==`
|
|
9
|
+
`);)d--;let A=w.slice(0,d)+w.slice(k);F(A,d);}return true}if(B.name==="a"){if(N){let{line:d,lines:A}=Ge(w,k);$(Be(A,d,0));}else $(0);return true}if(B.name==="e"){if(N){let{line:d,lines:A}=Ge(w,k);$(Be(A,d,A[d].length));}else $(w.length);return true}if(B.name==="k"){if(N){let{line:d,lines:A}=Ge(w,k),H=Be(A,d,A[d].length);if(k<H){let Q=w.slice(0,k)+w.slice(H);F(Q,k);}}else if(k<w.length){let d=w.slice(0,k);F(d,k);}return true}return false}if(B.alt){if(B.name==="left"||B.name==="b"){let d=k;for(;d>0&&w[d-1]===" ";)d--;for(;d>0&&w[d-1]!==" "&&w[d-1]!==`
|
|
10
|
+
`;)d--;return $(d),true}if(B.name==="right"||B.name==="f"){let d=k;for(;d<w.length&&w[d]!==" "&&w[d]!==`
|
|
11
|
+
`;)d++;for(;d<w.length&&w[d]===" ";)d++;return $(d),true}if(B.name==="backspace"||B.name==="d")if(B.name==="backspace"){if(k>0){let d=k;for(;d>0&&w[d-1]===" ";)d--;for(;d>0&&w[d-1]!==" "&&w[d-1]!==`
|
|
12
|
+
`;)d--;let A=w.slice(0,d)+w.slice(k);F(A,d);}return true}else {if(k<w.length){let d=k;for(;d<w.length&&w[d]!==" "&&w[d]!==`
|
|
13
|
+
`;)d++;for(;d<w.length&&w[d]===" ";)d++;let A=w.slice(0,k)+w.slice(d);F(A,k);}return true}return false}if(B.name==="left")return $(Math.max(0,k-1)),true;if(B.name==="right")return $(Math.min(w.length,k+1)),true;if(B.name==="up"){let{innerWidth:d}=W.current,A=un(w,k,d);return A.visualLine>0&&$(an(w,A.visualLine-1,A.visualCol,d)),true}if(B.name==="down"){let{innerWidth:d}=W.current,A=un(w,k,d);return A.visualLine<A.totalVisualLines-1&&$(an(w,A.visualLine+1,A.visualCol,d)),true}if(B.name==="home"){if(N){let{line:d,lines:A}=Ge(w,k);$(Be(A,d,0));}else $(0);return true}if(B.name==="end"){if(N){let{line:d,lines:A}=Ge(w,k);$(Be(A,d,A[d].length));}else $(w.length);return true}if(B.name==="backspace"){if(k>0){let d=w.slice(0,k-1)+w.slice(k);F(d,k-1);}return true}if(B.name==="delete"){if(k<w.length){let d=w.slice(0,k)+w.slice(k+1);F(d,k);}return true}if(B.name.length>1)return false;let D=B.sequence;if(D.length===1&&D.charCodeAt(0)>=32){let{type:d}=W.current;if(d==="number"){let H=/[0-9]/.test(D),Q=D==="."&&!w.includes("."),U=D==="-"&&k===0&&!w.includes("-");if(!H&&!Q&&!U)return true}let A=w.slice(0,k)+D+w.slice(k);return F(A,k+1),true}return false};return E.registerInputHandler(_,J)},[E,j]);let X={...c,...I&&l?l:{}};return te.createElement("input",{style:X,value:C,defaultValue:n,placeholder:i,onChange:r,cursorPosition:V.current,multiline:u??false,focused:I,ref:_=>{_?(M.current=_,b.current=_.focusId,K(true)):(M.current=null,b.current=null,K(false));}})}function ft({trap:e=false,children:t}){let n=useContext(q),r=useRef(null),o=useRef(new Set);return useLayoutEffect(()=>{if(!e||!n)return;r.current=n.focusedId;let s=n.pushTrap(o.current);return ()=>{s(),r.current&&n.requestFocus(r.current);}},[e,n]),useEffect(()=>{if(!(!e||!n)&&o.current.size>0){let s=o.current.values().next().value;s&&n.requestFocus(s);}},[e,n]),te.createElement(te.Fragment,null,t)}function Rr({size:e}){return te.createElement("box",{style:{flexGrow:e??1}})}function hn(e){let t=e.toLowerCase().split("+");return {name:t[t.length-1],ctrl:t.includes("ctrl"),alt:t.includes("alt"),shift:t.includes("shift"),meta:t.includes("meta")||t.includes("cmd")||t.includes("super")||t.includes("win")}}function gn(e,t){return !(t.name!==e.name||e.ctrl!==!!t.ctrl||e.alt!==!!t.alt||e.shift!==!!t.shift||e.meta!==!!t.meta)}function Ir({keypress:e,onPress:t,whenFocused:n,priority:r,disabled:o}){let s=useContext(Z),i=useContext(q),c=useRef(t);c.current=t;let l=useRef(hn(e));return l.current=hn(e),useEffect(()=>{if(!(!s||o))if(r){let u=f=>!gn(l.current,f)||n&&i?.focusedId!==n?false:(c.current(),true);return s.subscribePriority(u)}else {let u=f=>{gn(l.current,f)&&(n&&i?.focusedId!==n||c.current());};return s.subscribe(u)}},[s,i,n,r,o]),null}function kr({children:e,zIndex:t=1e3}){return te.createElement("box",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:t}},e)}function Pr({onPress:e,style:t,focusedStyle:n,children:r,disabled:o}){let s=useContext(q),i=useContext(Z),c=useRef(null),l=useRef(null),u=useRef(e);u.current=e;let[f,m]=useState(false),[S,R]=useState(false);useEffect(()=>{if(!(!s||!l.current||!c.current||o))return s.register(l.current,c.current)},[s,o,f]),useEffect(()=>{if(!s||!l.current)return;let a=l.current;return R(s.focusedId===a),s.onFocusChange(p=>{R(p===a);})},[s,f]),useEffect(()=>{if(!i||!l.current||o)return;let a=l.current,p=h=>s?.focusedId!==a?false:h.name==="return"||h.name===" "||h.sequence===" "?(u.current?.(),true):false;return i.registerInputHandler(a,p)},[i,s,o,f]);let v={...t,...S&&n?n:{}};return te.createElement("box",{style:v,focusable:!o,ref:a=>{a?(c.current=a,l.current=a.focusId,m(true)):(c.current=null,l.current=null,m(false));}},r)}var Br={x:0,y:0,width:0,height:0,innerX:0,innerY:0,innerWidth:0,innerHeight:0};function de(e){let t=useContext(oe),[n,r]=useState(Br);return useEffect(()=>{if(!(!t||!e?.current))return r(t.getLayout(e.current)),t.subscribe(e.current,r)},[t,e]),n}function Le(e,t=[]){let n=useContext(Z);useEffect(()=>{if(n)return n.subscribe(e)},[n,...t]);}function Ar({children:e,style:t,scrollOffset:n,onScroll:r,defaultScrollOffset:o=0,scrollStep:s=1,disableKeyboard:i,scrollToFocus:c=true,showScrollbar:l=true,focusable:u=true,focusedStyle:f}){let m=n!==void 0,[S,R]=useState(o),v=m?n:S,a=useRef(null),p=useRef(null),h=de(a),I=de(p),P=useContext(q),j=useContext(oe),K=useRef(null);u&&!K.current&&(K.current=`scrollview-${Math.random().toString(36).slice(2,9)}`);let E=u?K.current:null;useEffect(()=>{if(!(!u||!E||!P||!a.current))return P.register(E,a.current)},[u,E,P]);let G=u&&E&&P?.focusedId===E,T=h.innerHeight,M=I.height,b=Math.max(0,M-T),y=Math.max(0,Math.min(v,b)),C=useMemo(()=>({getBounds:()=>{let H=h.y;return {visibleTop:H,visibleBottom:H+T,viewportHeight:T,scrollOffset:y}}}),[h.y,T,y]),x=useCallback(H=>{let Q=Math.max(0,Math.min(H,b));m?r?.(Q):R(Q);},[m,r,b]);useEffect(()=>{v>b&&b>=0&&x(b);},[v,b,x]),useEffect(()=>!c||!P||!j||!p.current?void 0:P.onFocusChange(Q=>{if(!Q||!p.current)return;let U=Ke=>{if(Ke.focusId===Q)return Ke;for(let We of Ke.children){let xe=U(We);if(xe)return xe}return null},pe=U(p.current);if(!pe)return;let ye=j.getLayout(pe),Re=p.current.layout?.y??0,Oe=ye.y-Re,De=Oe+ye.height,ve=v,ot=v+T;Oe<ve?x(Oe):De>ot&&x(De-T);}),[c,P,j,v,T,x]);let V=useCallback(()=>{if(!P)return false;let H=P.focusedId;if(!H)return false;if(u&&E&&H===E)return true;if(!p.current)return false;let Q=U=>{if(U.focusId===H)return true;for(let pe of U.children)if(Q(pe))return true;return false};return Q(p.current)},[P,u,E]);Le(H=>{if(i||!V())return;let Q=Math.max(1,Math.floor(T/2)),U=Math.max(1,T);switch(H.name){case "pageup":x(v-U);break;case "pagedown":x(v+U);break;default:H.ctrl&&(H.name==="d"?x(v+Q):H.name==="u"?x(v-Q):H.name==="f"?x(v+U):H.name==="b"&&x(v-U));break}},[v,s,T,b,i,x,V]);let{padding:z,paddingX:O,paddingY:W,paddingTop:Y,paddingRight:X,paddingBottom:_,paddingLeft:J,...B}=t??{},le=B.border!=null&&B.border!=="none"?2:0,g=M>0?M+le:void 0,L={...B,...G?f:{},clip:true,...B.height===void 0&&g!==void 0?{height:g,flexShrink:B.flexShrink??1,minHeight:B.minHeight??0}:{}},N={position:"absolute",top:-y,left:0,right:0,flexDirection:"column",...z!==void 0&&{padding:z},...O!==void 0&&{paddingX:O},...W!==void 0&&{paddingY:W},...Y!==void 0&&{paddingTop:Y},...X!==void 0&&{paddingRight:X},..._!==void 0&&{paddingBottom:_},...J!==void 0&&{paddingLeft:J}},w=M>T&&T>0,k=l&&w,F=Math.max(1,Math.floor(T/M*T)),$=M-T,D=$>0?Math.floor(y/$*(T-F)):0,d=[];if(k)for(let H=0;H<T;H++)H>=D&&H<D+F?d.push("\u2588"):d.push("\u2591");let A={position:"absolute",top:0,right:0,width:1,height:T,flexDirection:"column"};return te.createElement(Ye.Provider,{value:C},te.createElement("box",{style:L,ref:H=>{a.current=H??null;},...u?{focusable:true,focusId:E}:{}},te.createElement("box",{style:{...N,paddingRight:k?(N.paddingRight??0)+1:N.paddingRight},ref:H=>{p.current=H??null;}},e),k&&te.createElement("box",{style:A},te.createElement("text",{style:{color:"blackBright"}},d.join(`
|
|
14
|
+
`)))))}function Ct({count:e,renderItem:t,selectedIndex:n,onSelectionChange:r,onSelect:o,defaultSelectedIndex:s=0,disabledIndices:i,style:c,focusable:l=true}){let u=n!==void 0,[f,m]=useState(s),S=u?n:f,R=useContext(q),v=useContext(Z),a=useRef(null),p=useRef(null),h=useRef(o);h.current=o;let[I,P]=useState(false),[j,K]=useState(false),E=useRef(null),G=useCallback(y=>{let C=Math.max(0,Math.min(y,e-1));u?r?.(C):m(C);},[u,r,e]),T=useCallback((y,C)=>{if(!i||i.size===0)return Math.max(0,Math.min(y+C,e-1));let x=y+C;for(;x>=0&&x<e&&i.has(x);)x+=C;return x<0||x>=e?y:x},[i,e]);useEffect(()=>{if(!(!R||!p.current||!a.current||!l))return R.register(p.current,a.current)},[R,l,I]),useEffect(()=>{if(!R||!p.current)return;let y=p.current;return K(R.focusedId===y),R.onFocusChange(C=>{K(C===y);})},[R,I]);let M=useCallback(y=>{let C=y?e-1:0,x=y?-1:1,V=C;for(;V>=0&&V<e&&i?.has(V);)V+=x;return V>=0&&V<e?V:y?e-1:0},[i,e]);useEffect(()=>{if(!v||!p.current||!l)return;let y=p.current,C=x=>R?.focusedId!==y?false:x.name==="g"&&!x.ctrl&&!x.alt?E.current==="g"?(G(M(false)),E.current=null,true):(E.current="g",true):x.name==="G"||x.name==="g"&&x.shift?(E.current=null,G(M(true)),true):(E.current=null,x.name==="up"||x.name==="k"?(G(T(S,-1)),true):x.name==="down"||x.name==="j"?(G(T(S,1)),true):x.name==="return"?(i?.has(S)||h.current?.(S),true):false);return v.registerInputHandler(y,C)},[v,R,l,S,G,T,M,i,I]);let b=[];for(let y=0;y<e;y++)b.push(te.createElement(te.Fragment,{key:y},t({index:y,selected:y===S,focused:j})));return te.createElement("box",{style:{flexDirection:"column",...c},focusable:l,ref:y=>{y?(a.current=y,p.current=y.focusId,P(true)):(a.current=null,p.current=null,P(false));}},...b)}function jr({items:e,selectedIndex:t,onSelectionChange:n,onSelect:r,defaultSelectedIndex:o=0,style:s,highlightColor:i="cyan",focusable:c=true}){let l=new Set;for(let f=0;f<e.length;f++)e[f].disabled&&l.add(f);let u=f=>{let m=e[f];m&&!m.disabled&&r?.(m.value,f);};return te.createElement(Ct,{count:e.length,selectedIndex:t,onSelectionChange:n,onSelect:u,defaultSelectedIndex:o,disabledIndices:l.size>0?l:void 0,style:s,focusable:c,renderItem:({index:f,selected:m,focused:S})=>{let R=e[f],v=R.disabled,a=m&&S,p=m?">":" ";return te.createElement("box",{style:{flexDirection:"row",...a?{bg:i}:{}}},te.createElement("text",{style:a?{bold:true,color:"black"}:v?{dim:true}:{}},`${p} ${R.label}`))}})}function Wr({value:e,indeterminate:t=false,width:n="100%",label:r,showPercent:o=false,style:s,filled:i="\u2588",empty:c="\u2591"}){let l=useRef(null),f=de(l).innerWidth,[m,S]=useState(0);useEffect(()=>{if(!t)return;let h=setInterval(()=>{S(I=>(I+1)%Math.max(1,f+6));},100);return ()=>clearInterval(h)},[t,f]);let R=Math.max(0,Math.min(1,e??0)),v=o?` ${Math.round(R*100)}%`:"",a="";if(f>0)if(t&&e===void 0){let h=Math.max(1,Math.min(3,Math.floor(f/4))),I=[];for(let P=0;P<f;P++)P>=m-h&&P<m?I.push(i):I.push(c);a=I.join("");}else {let h=Math.round(R*f);a=i.repeat(h)+c.repeat(f-h);}let p=[];return r&&p.push(te.createElement("text",{key:"label",style:{bold:true}},r+" ")),p.push(te.createElement("box",{key:"track",style:{flexGrow:1,flexShrink:1},ref:h=>{l.current=h??null;}},te.createElement("text",{key:"bar",style:{}},a))),o&&p.push(te.createElement("text",{key:"pct",style:{bold:true}},v)),te.createElement("box",{style:{flexDirection:"row",width:n,...s}},...p)}var qr=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function zr({frames:e=qr,intervalMs:t=80,label:n,style:r}){let[o,s]=useState(0);useEffect(()=>{let c=setInterval(()=>{s(l=>(l+1)%e.length);},t);return ()=>clearInterval(c)},[e.length,t]);let i=[te.createElement("text",{key:"frame",style:r},e[o])];return n&&i.push(te.createElement("text",{key:"label",style:{}}," "+n)),te.createElement("box",{style:{flexDirection:"row"}},...i)}var Rn=createContext(null),Qr=0;function eo(){let e=useContext(Rn);if(!e)throw new Error("useToast must be used within a <ToastHost>");return e.push}var to={info:{bg:"blackBright",title:"cyanBright",text:"white"},success:{bg:"blackBright",title:"greenBright",text:"white"},warning:{bg:"blackBright",title:"yellowBright",text:"white"},error:{bg:"blackBright",title:"redBright",text:"white"}};function no({position:e="bottom-right",maxVisible:t=5,children:n}){let[r,o]=useState([]),s=useRef(new Map),i=useCallback(R=>{let v=`toast-${Qr++}`,a={id:v,durationMs:3e3,variant:"info",...R};if(o(p=>[...p,a]),a.durationMs&&a.durationMs>0){let p=setTimeout(()=>{s.current.delete(v),o(h=>h.filter(I=>I.id!==v));},a.durationMs);s.current.set(v,p);}},[]);useEffect(()=>()=>{for(let R of s.current.values())clearTimeout(R);s.current.clear();},[]);let c=useRef({push:i});c.current.push=i;let l=e.startsWith("top"),u=e.endsWith("right"),f={position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:900,flexDirection:"column",justifyContent:l?"flex-start":"flex-end",alignItems:u?"flex-end":"flex-start",padding:1},S=r.slice(-t).map(R=>{let v=R.variant??"info",a=to[v],p=[];return R.title&&p.push(te.createElement("text",{key:"title",style:{bold:true,color:a.title}},R.title)),p.push(te.createElement("text",{key:"msg",style:{color:a.text}},R.message)),te.createElement("box",{key:R.id,style:{bg:a.bg,paddingX:1,flexDirection:"column",minWidth:20,maxWidth:50}},...p)});return te.createElement(Rn.Provider,{value:c.current},n,S.length>0?te.createElement("box",{style:f},...S):null)}function oo({items:e,value:t,onChange:n,placeholder:r="Select...",style:o,focusedStyle:s,dropdownStyle:i,highlightColor:c="cyan",maxVisible:l=8,searchable:u=true,disabled:f}){let m=useContext(q),S=useContext(Z),R=useContext(Ce),v=useContext(Ye),a=useRef(null),p=useRef(null),h=useRef(n);h.current=n;let[I,P]=useState(false),[j,K]=useState(false),[E,G]=useState(false),[T,M]=useState(0),[b,y]=useState(""),[C,x]=useState(0),V=de(a),z=R?.rows??24,O=v?.getBounds(),Y=e.find(F=>F.value===t)?.label??"",X=useMemo(()=>{if(!b)return e;let F=b.toLowerCase();return e.filter($=>$.label.toLowerCase().includes(F))},[e,b]),_=Math.min(l,X.length),J=X.slice(C,C+_);useEffect(()=>{M(0),x(0);},[b]),useEffect(()=>{!j&&E&&(G(false),y(""));},[j,E]),useEffect(()=>{if(!(!m||!p.current||!a.current))return m.register(p.current,a.current)},[m,I]),useEffect(()=>{!m||!p.current||m.setSkippable(p.current,!!f);},[m,f,I]),useEffect(()=>{if(!m||!p.current)return;let F=p.current;return K(m.focusedId===F),m.onFocusChange($=>{K($===F);})},[m,I]);let B=useCallback((F,$)=>{let D=F+$;for(;D>=0&&D<X.length;){if(!X[D].disabled)return D;D+=$;}return F},[X]),se=useCallback(F=>{F<C?x(F):F>=C+_&&x(F-_+1);},[C,_]);useEffect(()=>{if(!S||!p.current||f)return;let F=p.current,$=D=>{if(m?.focusedId!==F)return false;if(!E){if(D.name==="return"||D.name===" "||D.sequence===" "||D.name==="down"){G(true),y("");let d=X.findIndex(H=>H.value===t),A=d>=0?d:0;return M(A),x(Math.max(0,A-Math.floor(l/2))),true}return false}if(D.name==="tab")return G(false),y(""),false;if(D.name==="escape")return G(false),y(""),true;if(D.name==="return"){let d=X[T];return d&&!d.disabled&&(h.current?.(d.value),G(false),y("")),true}if(D.name==="up"){let d=B(T,-1);return M(d),se(d),true}if(D.name==="down"){let d=B(T,1);return M(d),se(d),true}if(D.name==="backspace")return u&&b.length>0&&y(d=>d.slice(0,-1)),true;if(D.name==="home"){let d=B(-1,1);return M(d),se(d),true}if(D.name==="end"){let d=B(X.length,-1);return M(d),se(d),true}if(u&&D.sequence&&D.sequence.length===1&&!D.ctrl&&!D.alt){let d=D.sequence;if(d>=" "&&d<="~")return y(A=>A+d),true}return true};return S.registerInputHandler(F,$)},[S,m,f,E,T,X,t,l,u,b,B,se,I]);let g={flexDirection:"row",width:"100%",...!o?.bg&&o?.border===void 0?{border:"single"}:{},...o,...j&&s?s:{}},L=Y?o?.color??void 0:"blackBright",N=[te.createElement("text",{key:"label",style:{flexGrow:1,flexShrink:1,color:L,wrap:"ellipsis",...Y?{}:{dim:true}}},Y||r),te.createElement("text",{key:"arrow",style:{flexShrink:0,color:j?c:"blackBright"}},E?" \u25B2":" \u25BC")],w=null;if(E){let F=[];u&&b&&F.push(te.createElement("box",{key:"search",style:{paddingX:1}},te.createElement("text",{style:{color:"blackBright",dim:true}},`/${b}`))),X.length===0&&F.push(te.createElement("box",{key:"empty",style:{paddingX:1}},te.createElement("text",{style:{dim:true,color:"blackBright"}},"No matches"))),C>0&&F.push(te.createElement("box",{key:"scroll-up",style:{justifyContent:"center",alignItems:"center"}},te.createElement("text",{style:{dim:true,color:"blackBright"}},"\u25B2"))),J.forEach((ve,ot)=>{let We=C+ot===T,xe=ve.disabled,Mn={paddingX:1,...We&&!xe?{bg:c}:{}},Vn={...We&&!xe?{color:"black",bold:true}:{},...xe?{dim:true,color:"blackBright"}:{}};F.push(te.createElement("box",{key:`item-${ve.value}`,style:Mn},te.createElement("text",{style:Vn},ve.label)));}),C+_<X.length&&F.push(te.createElement("box",{key:"scroll-down",style:{justifyContent:"center",alignItems:"center"}},te.createElement("text",{style:{dim:true,color:"blackBright"}},"\u25BC")));let $=C>0,D=C+_<X.length,d=u&&b,A=X.length===0,H=!i?.bg&&i?.border===void 0,U=_+(H?2:0);$&&(U+=1),D&&(U+=1),d&&(U+=1),A&&(U+=1);let pe=V.y+V.height,ye,Re;O?(ye=O.visibleBottom-pe,Re=V.y-O.visibleTop):(ye=z-pe,Re=V.y);let De=ye<U&&Re>=U?-U:V.height||1;w=te.createElement("box",{style:{position:"absolute",top:De,left:0,right:0,zIndex:9999,...H?{border:"single"}:{},bg:"black",flexDirection:"column",...i}},...F);}let k={flexDirection:"column",width:g.width??"100%",minWidth:g.minWidth,maxWidth:g.maxWidth,flexGrow:g.flexGrow,flexShrink:g.flexShrink??1};return te.createElement("box",{style:k},te.createElement("box",{style:g,focusable:true,ref:F=>{F?(a.current=F,p.current=F.focusId,P(true)):(a.current=null,p.current=null,P(false));}},...N),w)}function so({checked:e,onChange:t,label:n,style:r,focusedStyle:o,disabled:s,checkedChar:i="\u2713",uncheckedChar:c=" "}){let l=useContext(q),u=useContext(Z),f=useRef(null),m=useRef(null),S=useRef(t);S.current=t;let R=useRef(e);R.current=e;let[v,a]=useState(false),[p,h]=useState(false);useEffect(()=>{if(!(!l||!m.current||!f.current||s))return l.register(m.current,f.current)},[l,s,v]),useEffect(()=>{if(!l||!m.current)return;let E=m.current;return h(l.focusedId===E),l.onFocusChange(G=>{h(G===E);})},[l,v]),useEffect(()=>{if(!u||!m.current||s)return;let E=m.current,G=T=>l?.focusedId!==E?false:T.name==="return"||T.name===" "||T.sequence===" "?(S.current(!R.current),true):false;return u.registerInputHandler(E,G)},[u,l,s,v]);let I={flexDirection:"row",gap:1,...r,...p&&o?o:{}},P=e?i:c,j={color:s?"blackBright":p?"white":r?.color},K={color:s?"blackBright":r?.color};return te.createElement("box",{style:I,focusable:!s,ref:E=>{E?(f.current=E,m.current=E.focusId,a(true)):(f.current=null,m.current=null,a(false));}},te.createElement("text",{key:"box",style:j},`[${P}]`),n?te.createElement("text",{key:"label",style:K},n):null)}function lo({items:e,value:t,onChange:n,style:r,itemStyle:o,focusedItemStyle:s,selectedItemStyle:i,disabled:c,direction:l="column",gap:u=0,selectedChar:f="\u25CF",unselectedChar:m="\u25CB"}){let S=useContext(q),R=useContext(Z),v=useRef(null),a=useRef(null),p=useRef(n);p.current=n;let[h,I]=useState(false),[P,j]=useState(false),[K,E]=useState(()=>{let b=e.findIndex(y=>y.value===t);return b>=0?b:e.findIndex(y=>!y.disabled)}),G=useCallback((b,y)=>{let C=b;for(let x=0;x<e.length;x++)if(C=(C+y+e.length)%e.length,!e[C]?.disabled)return C;return b},[e]);useEffect(()=>{if(!(!S||!a.current||!v.current||c))return S.register(a.current,v.current)},[S,c,h]),useEffect(()=>{if(!S||!a.current)return;let b=a.current;return j(S.focusedId===b),S.onFocusChange(y=>{j(y===b);})},[S,h]),useEffect(()=>{if(!R||!a.current||c)return;let b=a.current,y=C=>{if(S?.focusedId!==b)return false;if(C.name==="up"||C.name==="left"||C.name==="k"||C.name==="tab"&&C.shift)return E(x=>G(x,-1)),true;if(C.name==="down"||C.name==="right"||C.name==="j"||C.name==="tab"&&!C.shift)return E(x=>G(x,1)),true;if(C.name==="return"||C.name===" "||C.sequence===" "){let x=e[K];return x&&!x.disabled&&p.current(x.value),true}return false};return R.registerInputHandler(b,y)},[R,S,c,e,K,G,h]),useEffect(()=>{let b=e.findIndex(y=>y.value===t);b>=0&&E(b);},[t,e]);let T={flexDirection:l,gap:u,...r},M=e.map((b,y)=>{let C=b.value===t,x=y===K,V=c||b.disabled,z=C?f:m,O={flexDirection:"row",gap:1,...o};C&&i&&(O={...O,...i}),P&&x&&s&&(O={...O,...s});let W=V?"blackBright":P&&x?s?.color??"white":C?i?.color??o?.color:o?.color;return te.createElement("box",{key:y,style:O},te.createElement("text",{key:"radio",style:{color:W}},`(${z})`),te.createElement("text",{key:"label",style:{color:W}},b.label))});return te.createElement("box",{style:T,focusable:!c,ref:b=>{b?(v.current=b,a.current=b.focusId,I(true)):(v.current=null,a.current=null,I(false));}},...M)}var En=createContext(null);function uo(){let e=useContext(En);if(!e)throw new Error("useDialog must be used within a DialogHost");return e}function ao({children:e}){let[t,n]=useState([]),r=useRef(0),o=useCallback((u,f)=>new Promise(m=>{let S=++r.current;n(R=>[...R,{id:S,type:"alert",content:u,okText:f?.okText??"OK",cancelText:"",style:f?.style,buttonStyle:f?.buttonStyle,okButtonStyle:f?.okButtonStyle,focusedButtonStyle:f?.focusedButtonStyle,backdropStyle:f?.backdropStyle,resolve:()=>m()}]);}),[]),s=useCallback((u,f)=>new Promise(m=>{let S=++r.current;n(R=>[...R,{id:S,type:"confirm",content:u,okText:f?.okText??"OK",cancelText:f?.cancelText??"Cancel",style:f?.style,buttonStyle:f?.buttonStyle,okButtonStyle:f?.okButtonStyle,cancelButtonStyle:f?.cancelButtonStyle,focusedButtonStyle:f?.focusedButtonStyle,backdropStyle:f?.backdropStyle,resolve:m}]);}),[]),i=useCallback((u,f)=>{n(m=>{let S=m.find(R=>R.id===u);return S&&S.resolve(f),m.filter(R=>R.id!==u)});},[]),c={alert:o,confirm:s},l=t[t.length-1];return te.createElement(En.Provider,{value:c},e,l&&te.createElement(fo,{key:l.id,dialog:l,onDismiss:i}))}function fo({dialog:e,onDismiss:t}){let n=useContext(q),r=useRef(null),o=useRef(null),s=useRef(null),i=useRef(null),[c,l]=useState("ok"),[u,f]=useState(0);useEffect(()=>{if(!n||u===0)return;let h=[];return r.current&&s.current&&h.push(n.register(s.current,r.current)),o.current&&i.current&&h.push(n.register(i.current,o.current)),s.current&&n.requestFocus(s.current),()=>h.forEach(I=>I())},[n,u]),useEffect(()=>{if(n)return n.onFocusChange(h=>{h===s.current?l("ok"):h===i.current&&l("cancel");})},[n]),Le(h=>{if(h.name==="return"||h.name==="space"){e.type==="alert"?t(e.id,true):t(e.id,c==="ok");return}if(h.name==="escape"){t(e.id,false);return}e.type==="confirm"&&n&&(h.name==="left"||h.name==="right")&&(c==="ok"&&i.current?n.requestFocus(i.current):s.current&&n.requestFocus(s.current));},[e,c,n,t]);let m=typeof e.content=="string",S=m?e.content.length:0,v={minWidth:Math.max(20,m?Math.min(S+6,50):30),maxWidth:50,bg:"black",border:"round",borderColor:"white",padding:1,flexDirection:"column",gap:1,...e.style},a=(h,I)=>{let P={paddingX:2,bg:"blackBright",color:"white"},j={bg:"white",color:"black",bold:true},K=h==="ok"?e.okButtonStyle:e.cancelButtonStyle;return {...P,...e.buttonStyle,...K,...I?{...j,...e.focusedButtonStyle}:{}}},p={position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999,...e.backdropStyle};return te.createElement(ft,{trap:true},te.createElement("box",{style:p}),te.createElement("box",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,justifyContent:"center",alignItems:"center",zIndex:1e3}},te.createElement("box",{style:v},te.createElement("box",{style:{flexDirection:"column"}},typeof e.content=="string"?te.createElement("text",null,e.content):e.content),te.createElement("box",{style:{flexDirection:"row",justifyContent:"flex-end",gap:1}},e.type==="confirm"&&te.createElement("box",{style:a("cancel",c==="cancel"),focusable:true,ref:h=>{h&&h.focusId&&!i.current&&(o.current=h,i.current=h.focusId,f(I=>I+1));}},te.createElement("text",null,e.cancelText)),te.createElement("box",{style:a("ok",c==="ok"),focusable:true,ref:h=>{h&&h.focusId&&!s.current&&(r.current=h,s.current=h.focusId,f(I=>I+1));}},te.createElement("text",null,e.okText))))))}function ho(e,t){let n=[],r=t.split("");if(e<=r.length)for(let o=0;o<e;o++)n.push(r[o]);else for(let o=0;o<r.length&&n.length<e;o++)for(let s=0;s<r.length&&n.length<e;s++)n.push(r[o]+r[s]);return n}function go({children:e,activationKey:t="ctrl+o",hintStyle:n,hintBg:r="yellow",hintFg:o="black",hintChars:s="asdfghjklqwertyuiopzxcvbnm",enabled:i=true,debug:c=false}){let l=c?(...b)=>console.error("[JumpNav]",...b):()=>{},[u,f]=useState(false),[m,S]=useState(""),[R,v]=useState([]),a=useContext(Z),p=useContext(q),h=useContext(oe);useEffect(()=>{l("Mounted, inputCtx:",!!a,"focusCtx:",!!p,"enabled:",i);},[]);let P=useCallback(b=>{let y=b.toLowerCase().split("+");return {ctrl:y.includes("ctrl"),alt:y.includes("alt"),shift:y.includes("shift"),meta:y.includes("meta"),name:y[y.length-1]??""}},[])(t),j=useCallback(()=>{if(!p?.getActiveElements){l("refreshElements: no getActiveElements");return}let b=p.getActiveElements();l("getActiveElements returned",b.length,"elements");let y=b.map(({id:C,node:x})=>({id:C,node:x,layout:h?.getLayout(x)??x.layout}));y.sort((C,x)=>C.layout.y!==x.layout.y?C.layout.y-x.layout.y:C.layout.x-x.layout.x),v(y);},[p,h,l]),K=useRef(false);useEffect(()=>{u&&!K.current&&(l("Activated! Refreshing elements..."),j()),K.current=u;},[u,j,l]);let E=R.filter(b=>b.layout.width>0&&b.layout.height>0),G=ho(E.length,s),T=useMemo(()=>{let b=new Map;return E.forEach((y,C)=>{G[C]&&b.set(G[C],y.id);}),b},[E,G]);useEffect(()=>{if(!a||!i){l("Not subscribing - inputCtx:",!!a,"enabled:",i);return}l("Subscribing to priority input, activation key:",t);let b=y=>{let C=y.name===P.name,x=!!y.ctrl===P.ctrl,V=!!y.alt===P.alt,z=!!y.shift===P.shift,O=!!y.meta===P.meta;if(!u&&C&&x&&V&&z&&O)return l("Activation key matched! Activating..."),f(true),S(""),true;if(u){if(y.name==="escape")return l("Escape pressed, deactivating"),f(false),S(""),true;if(y.name==="backspace")return S(""),true;if(y.sequence&&y.sequence.length===1&&/[a-z]/i.test(y.sequence)){let W=m+y.sequence.toLowerCase();l("Buffer:",W);let Y=T.get(W);return Y?(l("Jumping to",Y),p?.requestFocus(Y),f(false),S(""),true):[...T.keys()].some(_=>_.startsWith(W))?(S(W),true):(S(""),true)}return true}return false};return a.subscribePriority(b)},[a,i,u,P,m,T,p,t,l]);let M=u?te.createElement("box",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:99998}},...E.map((b,y)=>{let C=G[y];if(!C)return null;let{x,y:V}=b.layout,z=C.startsWith(m)&&m.length>0;return te.createElement("box",{key:b.id,style:{position:"absolute",top:V,left:Math.max(0,x-C.length-2),bg:z?"cyan":r,color:o,paddingX:1,zIndex:99999,...n}},te.createElement("text",{style:{bold:true,color:o}},C))}),te.createElement("box",{style:{position:"absolute",bottom:0,left:0,right:0,bg:"blackBright",paddingX:1,zIndex:99999}},te.createElement("text",{style:{color:"white"}},m?`Jump: ${m}_`:"Press a key to jump \u2022 ESC to cancel"))):null;return te.createElement(te.Fragment,null,e,M)}function So(e){let t=useContext(q),[n]=useState(()=>`focus-${Math.random().toString(36).slice(2,9)}`),r=t?t.focusedId===n:false;useEffect(()=>{if(!(!t||!e?.current))return e.current.focusId=n,t.register(n,e.current)},[t,n,e]);let o=useMemo(()=>()=>{t?.requestFocus(n);},[t,n]);return {focused:r,focus:o}}function Ro(e={}){let{disabled:t,onFocus:n,onBlur:r,onKeyPress:o}=e,s=useContext(q),i=useContext(Z),c=useRef(null),l=useRef(null),[u,f]=useState(false),m=useRef(n),S=useRef(r),R=useRef(o);m.current=n,S.current=r,R.current=o;let v=useCallback(p=>{c.current=p,p?l.current=p.focusId??null:l.current=null;},[]);useEffect(()=>{if(!(!s||!l.current||!c.current))return s.register(l.current,c.current)},[s]),useEffect(()=>{!s||!l.current||s.setSkippable(l.current,!!t);},[s,t]),useEffect(()=>{if(!s||!l.current)return;let p=l.current,h=s.focusedId===p;return f(h),s.onFocusChange(I=>{let P=I===p;f(j=>(P&&!j?m.current?.():!P&&j&&S.current?.(),P));})},[s]),useEffect(()=>{if(!i||!l.current||t)return;let p=l.current,h=I=>s?.focusedId!==p?false:R.current?.(I)===true;return i.registerInputHandler(p,h)},[i,s,t]);let a=useCallback(()=>{s&&l.current&&s.requestFocus(l.current);},[s]);return {ref:v,isFocused:u,focus:a,focusId:l.current}}function Io(){let e=useContext(Ce);if(!e)throw new Error("useApp must be used within a Glyph render tree");return {exit:e.exit,get columns(){return e.columns},get rows(){return e.rows}}}function Eo(){let e=useContext(q),t=useContext(oe),[n,r]=useState([]),o=useRef(()=>{}),s=useCallback(()=>{if(!e)return;let c=(e.getActiveElements?.()??e.getRegisteredElements?.()??[]).map(({id:l,node:u})=>({id:l,node:u,layout:t?.getLayout(u)??u.layout,type:u.type}));c.sort((l,u)=>l.layout.y!==u.layout.y?l.layout.y-u.layout.y:l.layout.x-u.layout.x),r(c);},[e,t]);return o.current=s,useEffect(()=>{if(!e)return;s();let i=e.onFocusChange(()=>{s();}),c=setTimeout(s,50);return ()=>{i(),clearTimeout(c);}},[e,t,s]),e?{elements:n,focusedId:e.focusedId,requestFocus:e.requestFocus,focusNext:e.focusNext,focusPrev:e.focusPrev,refresh:()=>o.current()}:null}function Fo(e){let t=[];for(let n of e)switch(n){case "9":t.push({type:"digit",char:n});break;case "a":t.push({type:"letter",char:n});break;case "*":t.push({type:"alphanumeric",char:n});break;default:t.push({type:"literal",char:n});break}return t}function Go(e,t){switch(t){case "digit":return /\d/.test(e);case "letter":return /[a-zA-Z]/.test(e);case "alphanumeric":return /[a-zA-Z0-9]/.test(e);case "literal":return true}}function ne(e){let t=typeof e=="string"?{mask:e}:e,{mask:n,placeholder:r="_",showPlaceholder:o=false}=t,s=Fo(n);return (i,c)=>{let l=[];for(let m of i)(m!==r&&!/[\s\-\(\)\/\.\:]/.test(m)||/[a-zA-Z0-9]/.test(m))&&/[a-zA-Z0-9]/.test(m)&&l.push(m);let u="",f=0;for(let m of s)if(m.type==="literal")(f<l.length||o)&&(u+=m.char);else if(f<l.length){let S=l[f];if(Go(S,m.type))u+=S,f++;else {f++;continue}}else o&&(u+=r);return u}}var Bo={usPhone:ne("(999) 999-9999"),intlPhone:ne("+9 999 999 9999"),dateUS:ne("99/99/9999"),dateEU:ne("99/99/9999"),dateISO:ne("9999-99-99"),time:ne("99:99"),timeFull:ne("99:99:99"),creditCard:ne("9999 9999 9999 9999"),ssn:ne("999-99-9999"),zip:ne("99999"),zipPlus4:ne("99999-9999"),ipv4:ne("999.999.999.999"),mac:ne("**:**:**:**:**:**")};export{pr as Box,Pr as Button,so as Checkbox,ao as DialogHost,ft as FocusScope,xr as Input,go as JumpNav,Ir as Keybind,Ct as List,jr as Menu,kr as Portal,Wr as Progress,lo as Radio,Ar as ScrollView,oo as Select,Rr as Spacer,zr as Spinner,gr as Text,no as ToastHost,ne as createMask,Bo as masks,ar as render,Io as useApp,uo as useDialog,So as useFocus,Eo as useFocusRegistry,Ro as useFocusable,Le as useInput,de as useLayout,eo as useToast};//# sourceMappingURL=index.js.map
|
|
15
15
|
//# sourceMappingURL=index.js.map
|