@shadcn/registry0.3.157.7 kB
import R,{join,basename,normalize,delimiter,resolve,dirname}from'path';import C,{cwd}from'process';import nr from'readline';import Cr from'events';import Gt from'fs/promises';import {spawn}from'child_process';import {pipeline}from'stream/promises';import {PassThrough}from'stream';import He,{openSync,readSync,closeSync,statSync}from'fs';import Mr from'os';import Pr from'tty';var F=["npm","yarn","yarn@berry","pnpm","pnpm@6","bun","deno"],G={"bun.lock":"bun","bun.lockb":"bun","deno.lock":"deno","pnpm-lock.yaml":"pnpm","pnpm-workspace.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"npm"},H={"node_modules/.deno/":"deno","node_modules/.pnpm/":"pnpm","node_modules/.yarn-state.yml":"yarn","node_modules/.yarn_integrity":"yarn","node_modules/.package-lock.json":"npm",".pnp.cjs":"yarn",".pnp.js":"yarn","bun.lock":"bun","bun.lockb":"bun"},Lt={bun:"https://bun.sh",deno:"https://deno.com",pnpm:"https://pnpm.io/installation","pnpm@6":"https://pnpm.io/6.x/installation",yarn:"https://classic.yarnpkg.com/en/docs/install","yarn@berry":"https://yarnpkg.com/getting-started/install",npm:"https://docs.npmjs.com/cli/configuring-npm/install"};async function V(t,r){try{let a=await Gt.stat(t);return r==="file"?a.isFile():a.isDirectory()}catch{return false}}function*Ke(t=C.cwd()){let r=R.resolve(t),{root:a}=R.parse(r);for(;r&&r!==a;)yield r,r=R.dirname(r);}async function Ft(t,r){return !t||!V(t,"file")?null:await Ze(t,r)}async function W(t={}){let{cwd:r,strategies:a=["lockfile","packageManager-field","devEngines-field"],onUnknown:e}=t,l;if(typeof t.stopDir=="string"){let c=R.resolve(t.stopDir);l=o=>o===c;}else l=t.stopDir;for(let c of Ke(r)){for(let o of a)switch(o){case "lockfile":{for(let u of Object.keys(G))if(await V(R.join(c,u),"file")){let i=G[u],h=await Ft(R.join(c,"package.json"),e);return h||{name:i,agent:i}}break}case "packageManager-field":case "devEngines-field":{let u=await Ft(R.join(c,"package.json"),e);if(u)return u;break}case "install-metadata":{for(let u of Object.keys(H)){let i=u.endsWith("/")?"dir":"file";if(await V(R.join(c,u),i)){let h=H[u],s=h==="yarn"?Qe(u)?"yarn":"yarn@berry":h;return {name:h,agent:s}}}break}}if(l?.(c))break}return null}function Xe(t){let r=a=>a?.match(/\d+(\.\d+){0,2}/)?.[0]??a;if(typeof t.packageManager=="string"){let[a,e]=t.packageManager.replace(/^\^/,"").split("@");return {name:a,ver:r(e)}}if(typeof t.devEngines?.packageManager?.name=="string")return {name:t.devEngines.packageManager.name,ver:r(t.devEngines.packageManager.version)}}async function Ze(t,r){try{let a=JSON.parse(await Gt.readFile(t,"utf8")),e,l=Xe(a);if(l){let c=l.name,o=l.ver,u=o;return c==="yarn"&&o&&Number.parseInt(o)>1?(e="yarn@berry",u="berry",{name:c,agent:e,version:u}):c==="pnpm"&&o&&Number.parseInt(o)<7?(e="pnpm@6",{name:c,agent:e,version:u}):F.includes(c)?(e=c,{name:c,agent:e,version:u}):r?.(a.packageManager)??null}}catch{}return null}function Qe(t){return t.endsWith(".yarn_integrity")}var cr=/^path$/i,Vt={key:"PATH",value:""};function Jt(t){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!cr.test(r))continue;let a=t[r];return a?{key:r,value:a}:Vt}return Vt}function hr(t,r){let a=r.value.split(delimiter),e=[],l=t,c;do e.push(resolve(l,"node_modules",".bin")),c=l,l=dirname(l);while(l!==c);e.push(dirname(process.execPath));let o=e.concat(a).join(delimiter);return {key:r.key,value:o}}function dr(t,r,a=true){let e={...process.env,...r};if(!a)return e;let l=hr(t,Jt(e));return e[l.key]=l.value,e}var fr=t=>{let r=t.length,a=new PassThrough,e=()=>{--r===0&&a.end();};for(let l of t)pipeline(l,a,{end:false}).then(e).catch(e);return a},Y=/([()\][%!^"`<>&|;, *?])/g,pr=/^#!\s*(.+)/,mr=/\.(?:com|exe)$/i,gr=/node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i,vr=process.platform==="win32",br=[".EXE",".CMD",".BAT",".COM"];function wr(t,r=[],a={}){if(a.shell===true||!vr)return {command:t,args:r,options:a};let e=Wt(t,a),l=null;if(e!==null){let o=Buffer.alloc(150),u=null;try{u=openSync(e,"r"),readSync(u,o,0,150,0);}catch{}finally{u!==null&&closeSync(u);}let i=o.toString().match(pr);if(i!==null){let h=i[1].trim(),s=h.indexOf(" "),n=s!==-1?h.slice(0,s):h,p=s!==-1?h.slice(s+1):"",d=basename(n);l=d==="env"?p||null:d;}}if(l!==null&&e!==null&&(r=[e,...r],t=l,e=Wt(t,a)),e===null||!mr.test(e)){let c=e!==null&&gr.test(e);t=normalize(t),t=t.replace(Y,"^$1"),r=r.map(o=>(o=o.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),o=o.replace(/(?=(\\+?)?)\1$/,"$1$1"),o=`"${o}"`,o=o.replace(Y,"^$1"),c&&(o=o.replace(Y,"^$1")),o)),r=["/d","/s","/c",`"${[t,...r].join(" ")}"`],t=a.env?.comspec??"cmd.exe",a={...a,windowsVerbatimArguments:true};}return {command:t,args:r,options:a}}function Wt(t,r){let a=(r.cwd??cwd()).toString(),e=r.env??process.env,l=Jt(e).value,c=t.includes("/")||t.includes("\\")?[""]:[a,...l.split(delimiter)],o=e.PATHEXT?e.PATHEXT.split(delimiter):br;t.includes(".")&&o[0]!==""&&o.unshift("");for(let u of c){let i=resolve(a,u.startsWith('"')&&u.endsWith('"')&&u.length>1?u.slice(1,-1):u,t);for(let h of o){let s=i+h;try{if(statSync(s).isFile())return s}catch{}}}return null}var Yt=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(t,r){super(`Process exited with non-zero status (${t.exitCode})`),this.result=t,this.output=r;}};var yr={timeout:void 0,persist:false};var xr={windowsHide:true};function _r(t){let r=new AbortController;for(let a of t){if(a.aborted)return r.abort(),a;let e=()=>{r.abort(a.reason);};a.addEventListener("abort",e,{signal:r.signal});}return r.signal}async function Bt(t){let r="";try{for await(let a of t)r+=a.toString();}catch{}return r}var Er=class{_process;_aborted=false;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(t,r,a){this._options={...yr,...a},this._command=t,this._args=r??[],this._processClosed=new Promise(e=>{this._resolveClose=e;});}kill(t){return this._process?.kill(t)===true}get aborted(){return this._aborted}get killed(){return this._process?.killed===true}pipe(t,r,a){return Sr(t,r,{...a,stdin:this})}async*[Symbol.asyncIterator](){let t=this._process;if(!t)return;let r=[];this._streamErr&&r.push(this._streamErr),this._streamOut&&r.push(this._streamOut);let a=fr(r),e=nr.createInterface({input:a});for await(let l of e)yield l.toString();if(await this._processClosed,t.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new Yt(this)}async _waitForOutput(){let t=this._process;if(!t)throw new Error("No process was started");let[r,a]=await Promise.all([this._streamOut?Bt(this._streamOut):"",this._streamErr?Bt(this._streamErr):""]);await this._processClosed;let{stdin:e}=this._options;if(e&&typeof e!="string"&&await e,t.removeAllListeners(),this._thrownError)throw this._thrownError;let l={stderr:a,stdout:r,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new Yt(this,l);return l}then(t,r){return this._waitForOutput().then(t,r)}_streamOut;_streamErr;spawn(){let t=cwd(),r=this._options,a={...xr,...r.nodeOptions},e=[];this._resetState(),r.timeout!==void 0&&e.push(AbortSignal.timeout(r.timeout)),r.signal!==void 0&&e.push(r.signal),r.persist===true&&(a.detached=true),e.length>0&&(a.signal=_r(e)),a.env=dr(t,a.env,r.nodePath);let l=wr(this._command,this._args,a),c=spawn(l.command,l.args,l.options);if(c.stderr&&(this._streamErr=c.stderr),c.stdout&&(this._streamOut=c.stdout),this._process=c,c.once("error",this._onError),c.once("close",this._onClose),c.stdin){let{stdin:o}=r;typeof o=="string"?c.stdin.end(o):o?.process?.stdout?.pipe(c.stdin);}}_resetState(){this._aborted=false,this._processClosed=new Promise(t=>{this._resolveClose=t;}),this._thrownError=void 0;}_onError=t=>{if(t.name==="AbortError"&&(!(t.cause instanceof Error)||t.cause.name!=="TimeoutError")){this._aborted=true;return}this._thrownError=t;};_onClose=()=>{this._resolveClose&&this._resolveClose();}};var B=(t,r,a)=>{let e=new Er(t,r,a);return e.spawn(),e},Sr=B;function It(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var z={},J,Xt;function T(){if(Xt)return J;Xt=1;let t,r,a,e,l=true;typeof process<"u"&&({FORCE_COLOR:t,NODE_DISABLE_COLORS:r,NO_COLOR:a,TERM:e}=process.env||{},l=process.stdout&&process.stdout.isTTY);let c={enabled:!r&&a==null&&e!=="dumb"&&(t!=null&&t!=="0"||l),reset:i(0,0),bold:i(1,22),dim:i(2,22),italic:i(3,23),underline:i(4,24),inverse:i(7,27),hidden:i(8,28),strikethrough:i(9,29),black:i(30,39),red:i(31,39),green:i(32,39),yellow:i(33,39),blue:i(34,39),magenta:i(35,39),cyan:i(36,39),white:i(37,39),gray:i(90,39),grey:i(90,39),bgBlack:i(40,49),bgRed:i(41,49),bgGreen:i(42,49),bgYellow:i(43,49),bgBlue:i(44,49),bgMagenta:i(45,49),bgCyan:i(46,49),bgWhite:i(47,49)};function o(h,s){let n=0,p,d="",f="";for(;n<h.length;n++)p=h[n],d+=p.open,f+=p.close,~s.indexOf(p.close)&&(s=s.replace(p.rgx,p.close+p.open));return d+s+f}function u(h,s){let n={has:h,keys:s};return n.reset=c.reset.bind(n),n.bold=c.bold.bind(n),n.dim=c.dim.bind(n),n.italic=c.italic.bind(n),n.underline=c.underline.bind(n),n.inverse=c.inverse.bind(n),n.hidden=c.hidden.bind(n),n.strikethrough=c.strikethrough.bind(n),n.black=c.black.bind(n),n.red=c.red.bind(n),n.green=c.green.bind(n),n.yellow=c.yellow.bind(n),n.blue=c.blue.bind(n),n.magenta=c.magenta.bind(n),n.cyan=c.cyan.bind(n),n.white=c.white.bind(n),n.gray=c.gray.bind(n),n.grey=c.grey.bind(n),n.bgBlack=c.bgBlack.bind(n),n.bgRed=c.bgRed.bind(n),n.bgGreen=c.bgGreen.bind(n),n.bgYellow=c.bgYellow.bind(n),n.bgBlue=c.bgBlue.bind(n),n.bgMagenta=c.bgMagenta.bind(n),n.bgCyan=c.bgCyan.bind(n),n.bgWhite=c.bgWhite.bind(n),n}function i(h,s){let n={open:`\x1B[${h}m`,close:`\x1B[${s}m`,rgx:new RegExp(`\\x1b\\[${s}m`,"g")};return function(p){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(h)||(this.has.push(h),this.keys.push(n)),p===void 0?this:c.enabled?o(this.keys,p+""):p+""):p===void 0?u([h],[n]):c.enabled?o([n],p+""):p+""}}return J=c,J}var K,Zt;function Ir(){return Zt||(Zt=1,K=(t,r)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl)return t.name==="a"?"first":t.name==="c"||t.name==="d"?"abort":t.name==="e"?"last":t.name==="g"?"reset":t.name==="n"?"down":t.name==="p"?"up":void 0;if(r){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}}),K}var X,Qt;function qt(){return Qt||(Qt=1,X=t=>{let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),a=new RegExp(r,"g");return typeof t=="string"?t.replace(a,""):t}),X}var Z,te;function $(){if(te)return Z;te=1;let t="\x1B",r=`${t}[`,a="\x07",e={to(o,u){return u?`${r}${u+1};${o+1}H`:`${r}${o+1}G`},move(o,u){let i="";return o<0?i+=`${r}${-o}D`:o>0&&(i+=`${r}${o}C`),u<0?i+=`${r}${-u}A`:u>0&&(i+=`${r}${u}B`),i},up:(o=1)=>`${r}${o}A`,down:(o=1)=>`${r}${o}B`,forward:(o=1)=>`${r}${o}C`,backward:(o=1)=>`${r}${o}D`,nextLine:(o=1)=>`${r}E`.repeat(o),prevLine:(o=1)=>`${r}F`.repeat(o),left:`${r}G`,hide:`${r}?25l`,show:`${r}?25h`,save:`${t}7`,restore:`${t}8`},l={up:(o=1)=>`${r}S`.repeat(o),down:(o=1)=>`${r}T`.repeat(o)},c={screen:`${r}2J`,up:(o=1)=>`${r}1J`.repeat(o),down:(o=1)=>`${r}J`.repeat(o),line:`${r}2K`,lineEnd:`${r}K`,lineStart:`${r}1K`,lines(o){let u="";for(let i=0;i<o;i++)u+=this.line+(i<o-1?e.up():"");return o&&(u+=e.left),u}};return Z={cursor:e,scroll:l,erase:c,beep:a},Z}var Q,ee;function qr(){if(ee)return Q;ee=1;let t=qt(),{erase:r,cursor:a}=$(),e=l=>[...t(l)].length;return Q=function(l,c){if(!c)return r.line+a.to(0);let o=0,u=l.split(/\r?\n/);for(let i of u)o+=1+Math.floor(Math.max(e(i)-1,0)/c);return r.lines(o)},Q}var tt,re;function We(){if(re)return tt;re=1;let t={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},r={arrowUp:t.arrowUp,arrowDown:t.arrowDown,arrowLeft:t.arrowLeft,arrowRight:t.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return tt=process.platform==="win32"?r:t,tt}var et,se;function Dr(){if(se)return et;se=1;let t=T(),r=We(),a=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),e=i=>a[i]||a.default,l=Object.freeze({aborted:t.red(r.cross),done:t.green(r.tick),exited:t.yellow(r.cross),default:t.cyan("?")});return et={styles:a,render:e,symbols:l,symbol:(i,h,s)=>h?l.aborted:s?l.exited:i?l.done:l.default,delimiter:i=>t.gray(i?r.ellipsis:r.pointerSmall),item:(i,h)=>t.gray(i?h?r.pointerSmall:"+":r.line)},et}var rt,ie;function jr(){if(ie)return rt;ie=1;let t=qt();return rt=function(r,a){let e=String(t(r)||"").split(/\r?\n/);return a?e.map(l=>Math.ceil(l.length/a)).reduce((l,c)=>l+c):e.length},rt}var st,ne;function Nr(){return ne||(ne=1,st=(t,r={})=>{let a=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"",e=r.width;return (t||"").split(/\r?\n/g).map(l=>l.split(/\s+/g).reduce((c,o)=>(o.length+a.length>=e||c[c.length-1].length+o.length+1<e?c[c.length-1]+=` ${o}`:c.push(`${a}${o}`),c),[a]).join(`
`)).join(`
`)}),st}var it,oe;function Lr(){return oe||(oe=1,it=(t,r,a)=>{a=a||r;let e=Math.min(r-a,t-Math.floor(a/2));e<0&&(e=0);let l=Math.min(e+a,r);return {startIndex:e,endIndex:l}}),it}var nt,ae;function M(){return ae||(ae=1,nt={action:Ir(),clear:qr(),style:Dr(),strip:qt(),figures:We(),lines:jr(),wrap:Nr(),entriesToDisplay:Lr()}),nt}var ot,le;function k(){if(le)return ot;le=1;let t=nr,{action:r}=M(),a=Cr,{beep:e,cursor:l}=$(),c=T();class o extends a{constructor(i={}){super(),this.firstRender=true,this.in=i.stdin||process.stdin,this.out=i.stdout||process.stdout,this.onRender=(i.onRender||(()=>{})).bind(this);let h=t.createInterface({input:this.in,escapeCodeTimeout:50});t.emitKeypressEvents(this.in,h),this.in.isTTY&&this.in.setRawMode(true);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(p,d)=>{let f=r(d,s);f===false?this._&&this._(p,d):typeof this[f]=="function"?this[f](d):this.bell();};this.close=()=>{this.out.write(l.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(false),h.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",n);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(e);}render(){this.onRender(c),this.firstRender&&(this.firstRender=false);}}return ot=o,ot}var at,ue;function Fr(){if(ue)return at;ue=1;let t=T(),r=k(),{erase:a,cursor:e}=$(),{style:l,clear:c,lines:o,figures:u}=M();class i extends r{constructor(s={}){super(s),this.transform=l.render(s.style),this.scale=this.transform.scale,this.msg=s.message,this.initial=s.initial||"",this.validator=s.validate||(()=>true),this.value="",this.errorMsg=s.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=c("",this.out.columns),this.render();}set value(s){!s&&this.initial?(this.placeholder=true,this.rendered=t.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(s)),this._value=s,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
`),this.close();}async validate(){let s=await this.validator(this.value);typeof s=="string"&&(this.errorMsg=s,s=false),this.error=!s;}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=true,this.fire(),this.render();return}this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
`),this.close();}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(s){this.placeholder||(this.cursor=this.cursor+s,this.cursorOffset+=s);}_(s,n){let p=this.value.slice(0,this.cursor),d=this.value.slice(this.cursor);this.value=`${p}${s}${d}`,this.red=false,this.cursor=this.placeholder?0:p.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let s=this.value.slice(0,this.cursor-1),n=this.value.slice(this.cursor);this.value=`${s}${n}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let s=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor+1);this.value=`${s}${n}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(e.down(o(this.outputError,this.out.columns)-1)+c(this.outputError,this.out.columns)),this.out.write(c(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),t.bold(this.msg),l.delimiter(this.done),this.red?t.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((s,n,p)=>s+`
${p?" ":u.pointerSmall} ${t.red().italic(n)}`,"")),this.out.write(a.line+e.to(0)+this.outputText+e.save+this.outputError+e.restore+e.move(this.cursorOffset,0)));}}return at=i,at}var lt,ce;function Gr(){if(ce)return lt;ce=1;let t=T(),r=k(),{style:a,clear:e,figures:l,wrap:c,entriesToDisplay:o}=M(),{cursor:u}=$();class i extends r{constructor(s={}){super(s),this.msg=s.message,this.hint=s.hint||"- Use arrow-keys. Return to submit.",this.warn=s.warn||"- This option is disabled",this.cursor=s.initial||0,this.choices=s.choices.map((n,p)=>(typeof n=="string"&&(n={title:n,value:p}),{title:n&&(n.title||n.value||n),value:n&&(n.value===void 0?p:n.value),description:n&&n.description,selected:n&&n.selected,disabled:n&&n.disabled})),this.optionsPerPage=s.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=e("",this.out.columns),this.render();}moveCursor(s){this.cursor=s,this.value=this.choices[s].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
`),this.close();}submit(){this.selection.disabled?this.bell():(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
`),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(s,n){if(s===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(u.hide):this.out.write(e(this.outputText,this.out.columns)),super.render();let{startIndex:s,endIndex:n}=o(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[a.symbol(this.done,this.aborted),t.bold(this.msg),a.delimiter(false),this.done?this.selection.title:this.selection.disabled?t.yellow(this.warn):t.gray(this.hint)].join(" "),!this.done){this.outputText+=`
`;for(let p=s;p<n;p++){let d,f,g="",m=this.choices[p];p===s&&s>0?f=l.arrowUp:p===n-1&&n<this.choices.length?f=l.arrowDown:f=" ",m.disabled?(d=this.cursor===p?t.gray().underline(m.title):t.strikethrough().gray(m.title),f=(this.cursor===p?t.bold().gray(l.pointer)+" ":" ")+f):(d=this.cursor===p?t.cyan().underline(m.title):m.title,f=(this.cursor===p?t.cyan(l.pointer)+" ":" ")+f,m.description&&this.cursor===p&&(g=` - ${m.description}`,(f.length+d.length+g.length>=this.out.columns||m.description.split(/\r?\n/).length>1)&&(g=`
`+c(m.description,{margin:3,width:this.out.columns})))),this.outputText+=`${f} ${d}${t.gray(g)}
`;}}this.out.write(this.outputText);}}return lt=i,lt}var ut,he;function Hr(){if(he)return ut;he=1;let t=T(),r=k(),{style:a,clear:e}=M(),{cursor:l,erase:c}=$();class o extends r{constructor(i={}){super(i),this.msg=i.message,this.value=!!i.initial,this.active=i.active||"on",this.inactive=i.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
`),this.close();}submit(){this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
`),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(i,h){if(i===" ")this.value=!this.value;else if(i==="1")this.value=true;else if(i==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(e(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),t.bold(this.msg),a.delimiter(this.done),this.value?this.inactive:t.cyan().underline(this.inactive),t.gray("/"),this.value?t.cyan().underline(this.active):this.active].join(" "),this.out.write(c.line+l.to(0)+this.outputText));}}return ut=o,ut}var ct,de;function P(){if(de)return ct;de=1;class t{constructor({token:a,date:e,parts:l,locales:c}){this.token=a,this.date=e||new Date,this.parts=l||[this],this.locales=c||{};}up(){}down(){}next(){let a=this.parts.indexOf(this);return this.parts.find((e,l)=>l>a&&e instanceof t)}setTo(a){}prev(){let a=[].concat(this.parts).reverse(),e=a.indexOf(this);return a.find((l,c)=>c>e&&l instanceof t)}toString(){return String(this.date)}}return ct=t,ct}var ht,fe;function Vr(){if(fe)return ht;fe=1;let t=P();class r extends t{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}}return ht=r,ht}var dt,pe;function Wr(){if(pe)return dt;pe=1;let t=P(),r=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th");class a extends t{constructor(l={}){super(l);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(l){this.date.setDate(parseInt(l.substr(-2)));}toString(){let l=this.date.getDate(),c=this.date.getDay();return this.token==="DD"?String(l).padStart(2,"0"):this.token==="Do"?l+r(l):this.token==="d"?c+1:this.token==="ddd"?this.locales.weekdaysShort[c]:this.token==="dddd"?this.locales.weekdays[c]:l}}return dt=a,dt}var ft,me;function Yr(){if(me)return ft;me=1;let t=P();class r extends t{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}}return ft=r,ft}var pt,ge;function Br(){if(ge)return pt;ge=1;let t=P();class r extends t{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return pt=r,pt}var mt,ve;function Ur(){if(ve)return mt;ve=1;let t=P();class r extends t{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}}return mt=r,mt}var gt,be;function zr(){if(be)return gt;be=1;let t=P();class r extends t{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),l=this.token.length;return l===2?String(e+1).padStart(2,"0"):l===3?this.locales.monthsShort[e]:l===4?this.locales.months[e]:String(e+1)}}return gt=r,gt}var vt,we;function Jr(){if(we)return vt;we=1;let t=P();class r extends t{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}}return vt=r,vt}var bt,ye;function Kr(){if(ye)return bt;ye=1;let t=P();class r extends t{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}}return bt=r,bt}var wt,xe;function Xr(){return xe||(xe=1,wt={DatePart:P(),Meridiem:Vr(),Day:Wr(),Hours:Yr(),Milliseconds:Br(),Minutes:Ur(),Month:zr(),Seconds:Jr(),Year:Kr()}),wt}var yt,_e;function Zr(){if(_e)return yt;_e=1;let t=T(),r=k(),{style:a,clear:e,figures:l}=M(),{erase:c,cursor:o}=$(),{DatePart:u,Meridiem:i,Day:h,Hours:s,Milliseconds:n,Minutes:p,Month:d,Seconds:f,Year:g}=Xr(),m=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,w={1:({token:v})=>v.replace(/\\(.)/g,"$1"),2:v=>new h(v),3:v=>new d(v),4:v=>new g(v),5:v=>new i(v),6:v=>new s(v),7:v=>new p(v),8:v=>new f(v),9:v=>new n(v)},x={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class y extends r{constructor(b={}){super(b),this.msg=b.message,this.cursor=0,this.typed="",this.locales=Object.assign(x,b.locales),this._date=b.initial||new Date,this.errorMsg=b.error||"Please Enter A Valid Value",this.validator=b.validate||(()=>true),this.mask=b.mask||"YYYY-MM-DD HH:mm:ss",this.clear=e("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(b){b&&this._date.setTime(b.getTime());}set mask(b){let _;for(this.parts=[];_=m.exec(b);){let S=_.shift(),A=_.findIndex(ze=>ze!=null);this.parts.push(A in w?w[A]({token:_[A]||S,date:this.date,parts:this.parts,locales:this.locales}):_[A]||S);}let E=this.parts.reduce((S,A)=>(typeof A=="string"&&typeof S[S.length-1]=="string"?S[S.length-1]+=A:S.push(A),S),[]);this.parts.splice(0),this.parts.push(...E),this.reset();}moveCursor(b){this.typed="",this.cursor=b,this.fire();}reset(){this.moveCursor(this.parts.findIndex(b=>b instanceof u)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
`),this.close();}async validate(){let b=await this.validator(this.value);typeof b=="string"&&(this.errorMsg=b,b=false),this.error=!b;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
`),this.close();}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let b=this.parts[this.cursor].prev();if(b==null)return this.bell();this.moveCursor(this.parts.indexOf(b)),this.render();}right(){let b=this.parts[this.cursor].next();if(b==null)return this.bell();this.moveCursor(this.parts.indexOf(b)),this.render();}next(){let b=this.parts[this.cursor].next();this.moveCursor(b?this.parts.indexOf(b):this.parts.findIndex(_=>_ instanceof u)),this.render();}_(b){/\d/.test(b)&&(this.typed+=b,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write(o.hide):this.out.write(e(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),t.bold(this.msg),a.delimiter(false),this.parts.reduce((b,_,E)=>b.concat(E===this.cursor&&!this.done?t.cyan().underline(_.toString()):_),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((b,_,E)=>b+`
${E?" ":l.pointerSmall} ${t.red().italic(_)}`,"")),this.out.write(c.line+o.to(0)+this.outputText));}}return yt=y,yt}var xt,Ee;function Qr(){if(Ee)return xt;Ee=1;let t=T(),r=k(),{cursor:a,erase:e}=$(),{style:l,figures:c,clear:o,lines:u}=M(),i=/[0-9]/,h=p=>p!==void 0,s=(p,d)=>{let f=Math.pow(10,d);return Math.round(p*f)/f};class n extends r{constructor(d={}){super(d),this.transform=l.render(d.style),this.msg=d.message,this.initial=h(d.initial)?d.initial:"",this.float=!!d.float,this.round=d.round||2,this.inc=d.increment||1,this.min=h(d.min)?d.min:-1/0,this.max=h(d.max)?d.max:1/0,this.errorMsg=d.error||"Please Enter A Valid Value",this.validator=d.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(d){!d&&d!==0?(this.placeholder=true,this.rendered=t.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${s(d,this.round)}`),this._value=s(d,this.round)),this.fire();}get value(){return this._value}parse(d){return this.float?parseFloat(d):parseInt(d)}valid(d){return d==="-"||d==="."&&this.float||i.test(d)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let d=this.value;this.value=d!==""?d:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
`),this.close();}async validate(){let d=await this.validator(this.value);typeof d=="string"&&(this.errorMsg=d,d=false),this.error=!d;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let d=this.value;this.value=d!==""?d:this.initial,this.done=true,this.aborted=false,this.error=false,this.fire(),this.render(),this.out.write(`
`),this.close();}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let d=this.value.toString();if(d.length===0)return this.bell();this.value=this.parse(d=d.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(d,f){if(!this.valid(d))return this.bell();let g=Date.now();if(g-this.lastHit>1e3&&(this.typed=""),this.typed+=d,this.lastHit=g,this.color="cyan",d===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(a.down(u(this.outputError,this.out.columns)-1)+o(this.outputError,this.out.columns)),this.out.write(o(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),t.bold(this.msg),l.delimiter(this.done),!this.done||!this.done&&!this.placeholder?t[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((d,f,g)=>d+`
${g?" ":c.pointerSmall} ${t.red().italic(f)}`,"")),this.out.write(e.line+a.to(0)+this.outputText+a.save+this.outputError+a.restore));}}return xt=n,xt}var _t,Se;function Ye(){if(Se)return _t;Se=1;let t=T(),{cursor:r}=$(),a=k(),{clear:e,figures:l,style:c,wrap:o,entriesToDisplay:u}=M();class i extends a{constructor(s={}){super(s),this.msg=s.message,this.cursor=s.cursor||0,this.scrollIndex=s.cursor||0,this.hint=s.hint||"",this.warn=s.warn||"- This option is disabled -",this.minSelected=s.min,this.showMinError=false,this.maxChoices=s.max,this.instructions=s.instructions,this.optionsPerPage=s.optionsPerPage||10,this.value=s.choices.map((n,p)=>(typeof n=="string"&&(n={title:n,value:p}),{title:n&&(n.title||n.value||n),description:n&&n.description,value:n&&(n.value===void 0?p:n.value),selected:n&&n.selected,disabled:n&&n.disabled})),this.clear=e("",this.out.columns),s.overrideRender||this.render();}reset(){this.value.map(s=>!s.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(s=>s.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
`),this.close();}submit(){let s=this.value.filter(n=>n.selected);this.minSelected&&s.length<this.minSelected?(this.showMinError=true,this.render()):(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
`),this.close());}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.value.length,this.render();}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render();}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.value[this.cursor].selected=false,this.render();}right(){if(this.value.filter(s=>s.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true,this.render();}handleSpaceToggle(){let s=this.value[this.cursor];if(s.selected)s.selected=false,this.render();else {if(s.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();s.selected=true,this.render();}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let s=!this.value[this.cursor].selected;this.value.filter(n=>!n.disabled).forEach(n=>n.selected=s),this.render();}_(s,n){if(s===" ")this.handleSpaceToggle();else if(s==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${l.arrowUp}/${l.arrowDown}: Highlight option
${l.arrowLeft}/${l.arrowRight}/[space]: Toggle selection
`+(this.maxChoices===void 0?` a: Toggle all
`:"")+" enter/return: Complete answer":""}renderOption(s,n,p,d){let f=(n.selected?t.green(l.radioOn):l.radioOff)+" "+d+" ",g,m;return n.disabled?g=s===p?t.gray().underline(n.title):t.strikethrough().gray(n.title):(g=s===p?t.cyan().underline(n.title):n.title,s===p&&n.description&&(m=` - ${n.description}`,(f.length+g.length+m.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(m=`
`+o(n.description,{margin:f.length,width:this.out.columns})))),f+g+t.gray(m||"")}paginateOptions(s){if(s.length===0)return t.red("No matches for this query.");let{startIndex:n,endIndex:p}=u(this.cursor,s.length,this.optionsPerPage),d,f=[];for(let g=n;g<p;g++)g===n&&n>0?d=l.arrowUp:g===p-1&&p<s.length?d=l.arrowDown:d=" ",f.push(this.renderOption(this.cursor,s[g],g,d));return `
`+f.join(`
`)}renderOptions(s){return this.done?"":this.paginateOptions(s)}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let s=[t.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&s.push(t.yellow(this.warn)),s.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let s=[c.symbol(this.done,this.aborted),t.bold(this.msg),c.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(s+=t.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),s+=this.renderOptions(this.value),this.out.write(this.clear+s),this.clear=e(s,this.out.columns);}}return _t=i,_t}var Et,Oe;function ts(){if(Oe)return Et;Oe=1;let t=T(),r=k(),{erase:a,cursor:e}=$(),{style:l,clear:c,figures:o,wrap:u,entriesToDisplay:i}=M(),h=(d,f)=>d[f]&&(d[f].value||d[f].title||d[f]),s=(d,f)=>d[f]&&(d[f].title||d[f].value||d[f]),n=(d,f)=>{let g=d.findIndex(m=>m.value===f||m.title===f);return g>-1?g:void 0};class p extends r{constructor(f={}){super(f),this.msg=f.message,this.suggest=f.suggest,this.choices=f.choices,this.initial=typeof f.initial=="number"?f.initial:n(f.choices,f.initial),this.select=this.initial||f.cursor||0,this.i18n={noMatches:f.noMatches||"no matches found"},this.fallback=f.fallback||this.initial,this.clearFirst=f.clearFirst||false,this.suggestions=[],this.input="",this.limit=f.limit||10,this.cursor=0,this.transform=l.render(f.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=c("",this.out.columns),this.complete(this.render),this.render();}set fallback(f){this._fb=Number.isSafeInteger(parseInt(f))?parseInt(f):f;}get fallback(){let f;return typeof this._fb=="number"?f=this.choices[this._fb]:typeof this._fb=="string"&&(f={title:this._fb}),f||this._fb||{title:this.i18n.noMatches}}moveSelect(f){this.select=f,this.suggestions.length>0?this.value=h(this.suggestions,f):this.value=this.fallback.value,this.fire();}async complete(f){let g=this.completing=this.suggest(this.input,this.choices),m=await g;if(this.completing!==g)return;this.suggestions=m.map((x,y,v)=>({title:s(v,y),value:h(v,y),description:x.description})),this.completing=false;let w=Math.max(m.length-1,0);this.moveSelect(Math.min(w,this.select)),f&&f();}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
`),this.close());}abort(){this.done=this.aborted=true,this.exited=false,this.fire(),this.render(),this.out.write(`
`),this.close();}submit(){this.done=true,this.aborted=this.exited=false,this.fire(),this.render(),this.out.write(`
`),this.close();}_(f,g){let m=this.input.slice(0,this.cursor),w=this.input.slice(this.cursor);this.input=`${m}${f}${w}`,this.cursor=m.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let f=this.input.slice(0,this.cursor-1),g=this.input.slice(this.cursor);this.input=`${f}${g}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let f=this.input.slice(0,this.cursor),g=this.input.slice(this.cursor+1);this.input=`${f}${g}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(f,g,m,w){let x,y=m?o.arrowUp:w?o.arrowDown:" ",v=g?t.cyan().underline(f.title):f.title;return y=(g?t.cyan(o.pointer)+" ":" ")+y,f.description&&(x=` - ${f.description}`,(y.length+v.length+x.length>=this.out.columns||f.description.split(/\r?\n/).length>1)&&(x=`
`+u(f.description,{margin:3,width:this.out.columns}))),y+" "+v+t.gray(x||"")}render(){if(this.closed)return;this.firstRender?this.out.write(e.hide):this.out.write(c(this.outputText,this.out.columns)),super.render();let{startIndex:f,endIndex:g}=i(this.select,this.choices.length,this.limit);if(this.outputText=[l.symbol(this.done,this.aborted,this.exited),t.bold(this.msg),l.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let m=this.suggestions.slice(f,g).map((w,x)=>this.renderOption(w,this.select===x+f,x===0&&f>0,x+f===g-1&&g<this.choices.length)).join(`
`);this.outputText+=`
`+(m||t.gray(this.fallback.title));}this.out.write(a.line+e.to(0)+this.outputText);}}return Et=p,Et}var St,Te;function es(){if(Te)return St;Te=1;let t=T(),{cursor:r}=$(),a=Ye(),{clear:e,style:l,figures:c}=M();class o extends a{constructor(i={}){i.overrideRender=true,super(i),this.inputValue="",this.clear=e("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(i=>i.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let i=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let h=this.filteredOptions.findIndex(s=>s===i);this.cursor=h<0?0:h,this.render();}handleSpaceToggle(){let i=this.filteredOptions[this.cursor];if(i.selected)i.selected=false,this.render();else {if(i.disabled||this.value.filter(h=>h.selected).length>=this.maxChoices)return this.bell();i.selected=true,this.render();}}handleInputChange(i){this.inputValue=this.inputValue+i,this.updateFilteredOptions();}_(i,h){i===" "?this.handleSpaceToggle():this.handleInputChange(i);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${c.arrowUp}/${c.arrowDown}: Highlight option
${c.arrowLeft}/${c.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer
`:""}renderCurrentInput(){return `
Filtered results for: ${this.inputValue?this.inputValue:t.gray("Enter something to filter")}
`}renderOption(i,h,s,n){let p=(h.selected?t.green(c.radioOn):c.radioOff)+" "+n+" ",d;return h.disabled?d=i===s?t.gray().underline(h.title):t.strikethrough().gray(h.title):d=i===s?t.cyan().underline(h.title):h.title,p+d}renderDoneOrInstructions(){if(this.done)return this.value.filter(h=>h.selected).map(h=>h.title).join(", ");let i=[t.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&i.push(t.yellow(this.warn)),i.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let i=[l.symbol(this.done,this.aborted),t.bold(this.msg),l.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(i+=t.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),i+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+i),this.clear=e(i,this.out.columns);}}return St=o,St}var Ot,$e;function rs(){if($e)return Ot;$e=1;let t=T(),r=k(),{style:a,clear:e}=M(),{erase:l,cursor:c}=$();class o extends r{constructor(i={}){super(i),this.msg=i.message,this.value=i.initial,this.initialValue=!!i.initial,this.yesMsg=i.yes||"yes",this.yesOption=i.yesOption||"(Y/n)",this.noMsg=i.no||"no",this.noOption=i.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
`),this.close();}submit(){this.value=this.value||false,this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
`),this.close();}_(i,h){return i.toLowerCase()==="y"?(this.value=true,this.submit()):i.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(c.hide):this.out.write(e(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),t.bold(this.msg),a.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:t.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(l.line+c.to(0)+this.outputText));}}return Ot=o,Ot}var Tt,Ce;function ss(){return Ce||(Ce=1,Tt={TextPrompt:Fr(),SelectPrompt:Gr(),TogglePrompt:Hr(),DatePrompt:Zr(),NumberPrompt:Qr(),MultiselectPrompt:Ye(),AutocompletePrompt:ts(),AutocompleteMultiselectPrompt:es(),ConfirmPrompt:rs()}),Tt}var Me;function is(){return Me||(Me=1,(function(t){let r=t,a=ss(),e=o=>o;function l(o,u,i={}){return new Promise((h,s)=>{let n=new a[o](u),p=i.onAbort||e,d=i.onSubmit||e,f=i.onExit||e;n.on("state",u.onState||e),n.on("submit",g=>h(d(g))),n.on("exit",g=>h(f(g))),n.on("abort",g=>s(p(g)));})}r.text=o=>l("TextPrompt",o),r.password=o=>(o.style="password",r.text(o)),r.invisible=o=>(o.style="invisible",r.text(o)),r.number=o=>l("NumberPrompt",o),r.date=o=>l("DatePrompt",o),r.confirm=o=>l("ConfirmPrompt",o),r.list=o=>{let u=o.separator||",";return l("TextPrompt",o,{onSubmit:i=>i.split(u).map(h=>h.trim())})},r.toggle=o=>l("TogglePrompt",o),r.select=o=>l("SelectPrompt",o),r.multiselect=o=>{o.choices=[].concat(o.choices||[]);let u=i=>i.filter(h=>h.selected).map(h=>h.value);return l("MultiselectPrompt",o,{onAbort:u,onSubmit:u})},r.autocompleteMultiselect=o=>{o.choices=[].concat(o.choices||[]);let u=i=>i.filter(h=>h.selected).map(h=>h.value);return l("AutocompleteMultiselectPrompt",o,{onAbort:u,onSubmit:u})};let c=(o,u)=>Promise.resolve(u.filter(i=>i.title.slice(0,o.length).toLowerCase()===o.toLowerCase()));r.autocomplete=o=>(o.suggest=o.suggest||c,o.choices=[].concat(o.choices||[]),l("AutocompletePrompt",o));})(z)),z}var $t,Pe;function ns(){if(Pe)return $t;Pe=1;let t=is(),r=["suggest","format","onState","validate","onRender","type"],a=()=>{};async function e(u=[],{onSubmit:i=a,onCancel:h=a}={}){let s={},n=e._override||{};u=[].concat(u);let p,d,f,g,m,w,x=async(y,v,b=false)=>{if(!(!b&&y.validate&&y.validate(v)!==true))return y.format?await y.format(v,s):v};for(d of u)if({name:g,type:m}=d,typeof m=="function"&&(m=await m(p,{...s},d),d.type=m),!!m){for(let y in d){if(r.includes(y))continue;let v=d[y];d[y]=typeof v=="function"?await v(p,{...s},w):v;}if(w=d,typeof d.message!="string")throw new Error("prompt message is required");if({name:g,type:m}=d,t[m]===void 0)throw new Error(`prompt type (${m}) is not defined`);if(n[d.name]!==void 0&&(p=await x(d,n[d.name]),p!==void 0)){s[g]=p;continue}try{p=e._injected?l(e._injected,d.initial):await t[m](d),s[g]=p=await x(d,p,!0),f=await i(d,p,s);}catch{f=!await h(d,s);}if(f)return s}return s}function l(u,i){let h=u.shift();if(h instanceof Error)throw h;return h===void 0?i:h}function c(u){e._injected=(e._injected||[]).concat(u);}function o(u){e._override=Object.assign({},u);}return $t=Object.assign(e,{prompt:e,prompts:t,inject:c,override:o}),$t}var Ct,Ae;function os(){return Ae||(Ae=1,Ct=ns()),Ct}var as=os(),ls=It(as),Dt=globalThis.window?.document!==void 0;globalThis.process?.versions?.node;globalThis.process?.versions?.bun;globalThis.Deno?.version?.deno;globalThis.process?.versions?.electron;globalThis.navigator?.userAgent?.includes("jsdom");typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope;typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope;typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope;var L=globalThis.navigator?.userAgentData?.platform;L==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===true||globalThis.process?.platform;L==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform;L==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===true||globalThis.navigator?.userAgent?.includes(" Linux ")===true||globalThis.process?.platform;L==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===true||globalThis.process?.platform;var Re="\x1B]",ke="\x07",N=";";!Dt&&C.env.TERM_PROGRAM;!Dt&&C.platform;Dt||C.cwd;var us=(t,r)=>[Re,"8",N,N,r,ke,t,Re,"8",N,N,ke].join(""),Mt,Ie;function Be(){return Ie||(Ie=1,Mt=(t,r=process.argv)=>{let a=t.startsWith("-")?"":t.length===1?"-":"--",e=r.indexOf(a+t),l=r.indexOf("--");return e!==-1&&(l===-1||e<l)}),Mt}var Pt,qe;function cs(){if(qe)return Pt;qe=1;let t=Mr,r=Pr,a=Be(),{env:e}=process,l;a("no-color")||a("no-colors")||a("color=false")||a("color=never")?l=0:(a("color")||a("colors")||a("color=true")||a("color=always"))&&(l=1),"FORCE_COLOR"in e&&(e.FORCE_COLOR==="true"?l=1:e.FORCE_COLOR==="false"?l=0:l=e.FORCE_COLOR.length===0?1:Math.min(parseInt(e.FORCE_COLOR,10),3));function c(i){return i===0?false:{level:i,hasBasic:true,has256:i>=2,has16m:i>=3}}function o(i,h){if(l===0)return 0;if(a("color=16m")||a("color=full")||a("color=truecolor"))return 3;if(a("color=256"))return 2;if(i&&!h&&l===void 0)return 0;let s=l||0;if(e.TERM==="dumb")return s;if(process.platform==="win32"){let n=t.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in e)return ["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in e)||e.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in e)return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(e.TEAMCITY_VERSION)?1:0;if(e.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in e){let n=parseInt((e.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(e.TERM_PROGRAM){case "iTerm.app":return n>=3?3:2;case "Apple_Terminal":return 2}}return /-256(color)?$/i.test(e.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(e.TERM)||"COLORTERM"in e?1:s}function u(i){let h=o(i,i&&i.isTTY);return c(h)}return Pt={supportsColor:u,stdout:c(o(true,r.isatty(1))),stderr:c(o(true,r.isatty(2)))},Pt}var At,De;function hs(){if(De)return At;De=1;let t=cs(),r=Be();function a(l){if(/^\d{3,4}$/.test(l)){let o=/(\d{1,2})(\d{2})/.exec(l)||[];return {major:0,minor:parseInt(o[1],10),patch:parseInt(o[2],10)}}let c=(l||"").split(".").map(o=>parseInt(o,10));return {major:c[0],minor:c[1],patch:c[2]}}function e(l){let{CI:c,FORCE_HYPERLINK:o,NETLIFY:u,TEAMCITY_VERSION:i,TERM_PROGRAM:h,TERM_PROGRAM_VERSION:s,VTE_VERSION:n,TERM:p}=process.env;if(o)return !(o.length>0&&parseInt(o,10)===0);if(r("no-hyperlink")||r("no-hyperlinks")||r("hyperlink=false")||r("hyperlink=never"))return false;if(r("hyperlink=true")||r("hyperlink=always")||u)return true;if(!t.supportsColor(l)||l&&!l.isTTY)return false;if("WT_SESSION"in process.env)return true;if(process.platform==="win32"||c||i)return false;if(h){let d=a(s||"");switch(h){case "iTerm.app":return d.major===3?d.minor>=1:d.major>3;case "WezTerm":return d.major>=20200620;case "vscode":return d.major>1||d.major===1&&d.minor>=72;case "ghostty":return true}}if(n){if(n==="0.50.0")return false;let d=a(n);return d.major>0||d.minor>=50}switch(p){case "alacritty":return true}return false}return At={supportsHyperlink:e,stdout:e(process.stdout),stderr:e(process.stderr)},At}var ds=hs(),jt=It(ds);function D(t,r,{target:a="stdout",...e}={}){return jt[a]?us(t,r):e.fallback===false?t:typeof e.fallback=="function"?e.fallback(t,r):`${t} (\u200B${r}\u200B)`}D.isSupported=jt.stdout;D.stderr=(t,r,a={})=>D(t,r,{target:"stderr",...a});D.stderr.isSupported=jt.stderr;var O={},I={},je;function fs(){if(je)return I;je=1,Object.defineProperty(I,"__esModule",{value:true}),I.sync=I.isexe=void 0;let t=He,r=Gt,a=async(o,u={})=>{let{ignoreErrors:i=false}=u;try{return l(await(0,r.stat)(o),u)}catch(h){let s=h;if(i||s.code==="EACCES")return false;throw s}};I.isexe=a;let e=(o,u={})=>{let{ignoreErrors:i=false}=u;try{return l((0,t.statSync)(o),u)}catch(h){let s=h;if(i||s.code==="EACCES")return false;throw s}};I.sync=e;let l=(o,u)=>o.isFile()&&c(o,u),c=(o,u)=>{let i=u.uid??process.getuid?.(),h=u.groups??process.getgroups?.()??[],s=u.gid??process.getgid?.()??h[0];if(i===void 0||s===void 0)throw new Error("cannot get uid or gid");let n=new Set([s,...h]),p=o.mode,d=o.uid,f=o.gid,g=parseInt("100",8),m=parseInt("010",8),w=parseInt("001",8),x=g|m;return !!(p&w||p&m&&n.has(f)||p&g&&d===i||p&x&&i===0)};return I}var q={},Ne;function ps(){if(Ne)return q;Ne=1,Object.defineProperty(q,"__esModule",{value:true}),q.sync=q.isexe=void 0;let t=He,r=Gt,a=async(o,u={})=>{let{ignoreErrors:i=false}=u;try{return c(await(0,r.stat)(o),o,u)}catch(h){let s=h;if(i||s.code==="EACCES")return false;throw s}};q.isexe=a;let e=(o,u={})=>{let{ignoreErrors:i=false}=u;try{return c((0,t.statSync)(o),o,u)}catch(h){let s=h;if(i||s.code==="EACCES")return false;throw s}};q.sync=e;let l=(o,u)=>{let{pathExt:i=process.env.PATHEXT||""}=u,h=i.split(";");if(h.indexOf("")!==-1)return true;for(let s=0;s<h.length;s++){let n=h[s].toLowerCase(),p=o.substring(o.length-n.length).toLowerCase();if(n&&p===n)return true}return false},c=(o,u,i)=>o.isFile()&&l(u,i);return q}var Rt={},Le;function ms(){return Le||(Le=1,Object.defineProperty(Rt,"__esModule",{value:true})),Rt}var Fe;function gs(){return Fe||(Fe=1,(function(t){var r=O&&O.__createBinding||(Object.create?(function(h,s,n,p){p===void 0&&(p=n);var d=Object.getOwnPropertyDescriptor(s,n);(!d||("get"in d?!s.__esModule:d.writable||d.configurable))&&(d={enumerable:true,get:function(){return s[n]}}),Object.defineProperty(h,p,d);}):(function(h,s,n,p){p===void 0&&(p=n),h[p]=s[n];})),a=O&&O.__setModuleDefault||(Object.create?(function(h,s){Object.defineProperty(h,"default",{enumerable:true,value:s});}):function(h,s){h.default=s;}),e=O&&O.__importStar||function(h){if(h&&h.__esModule)return h;var s={};if(h!=null)for(var n in h)n!=="default"&&Object.prototype.hasOwnProperty.call(h,n)&&r(s,h,n);return a(s,h),s},l=O&&O.__exportStar||function(h,s){for(var n in h)n!=="default"&&!Object.prototype.hasOwnProperty.call(s,n)&&r(s,h,n);};Object.defineProperty(t,"__esModule",{value:true}),t.sync=t.isexe=t.posix=t.win32=void 0;let c=e(fs());t.posix=c;let o=e(ps());t.win32=o,l(ms(),t);let i=(process.env._ISEXE_TEST_PLATFORM_||process.platform)==="win32"?o:c;t.isexe=i.isexe,t.sync=i.sync;})(O)),O}var kt,Ge;function vs(){if(Ge)return kt;Ge=1;let{isexe:t,sync:r}=gs(),{join:a,delimiter:e,sep:l,posix:c}=R,o=process.platform==="win32",u=new RegExp(`[${c.sep}${l===c.sep?"":l}]`.replace(/(\\)/g,"\\$1")),i=new RegExp(`^\\.${u.source}`),h=f=>Object.assign(new Error(`not found: ${f}`),{code:"ENOENT"}),s=(f,{path:g=process.env.PATH,pathExt:m=process.env.PATHEXT,delimiter:w=e})=>{let x=f.match(u)?[""]:[...o?[process.cwd()]:[],...(g||"").split(w)];if(o){let y=m||[".EXE",".CMD",".BAT",".COM"].join(w),v=y.split(w).flatMap(b=>[b,b.toLowerCase()]);return f.includes(".")&&v[0]!==""&&v.unshift(""),{pathEnv:x,pathExt:v,pathExtExe:y}}return {pathEnv:x,pathExt:[""]}},n=(f,g)=>{let m=/^".*"$/.test(f)?f.slice(1,-1):f;return (!m&&i.test(g)?g.slice(0,2):"")+a(m,g)},p=async(f,g={})=>{let{pathEnv:m,pathExt:w,pathExtExe:x}=s(f,g),y=[];for(let v of m){let b=n(v,f);for(let _ of w){let E=b+_;if(await t(E,{pathExt:x,ignoreErrors:true})){if(!g.all)return E;y.push(E);}}}if(g.all&&y.length)return y;if(g.nothrow)return null;throw h(f)},d=(f,g={})=>{let{pathEnv:m,pathExt:w,pathExtExe:x}=s(f,g),y=[];for(let v of m){let b=n(v,f);for(let _ of w){let E=b+_;if(r(E,{pathExt:x,ignoreErrors:true})){if(!g.all)return E;y.push(E);}}}if(g.all&&y.length)return y;if(g.nothrow)return null;throw h(f)};return kt=p,p.sync=d,kt}var bs=vs(),ws=It(bs);join(Mr.tmpdir(),"antfu-ni");function Ue(t){return ws.sync(t,{nothrow:true})!==null}async function Nt({autoInstall:t,programmatic:r,cwd:a}={}){let{name:e,agent:l,version:c}=await W({cwd:a,onUnknown:o=>{r||console.warn("[ni] Unknown packageManager:",o);}})||{};if(e&&!Ue(e)&&!r){if(!t){console.warn(`[ni] Detected ${e} but it doesn't seem to be installed.
`),C.env.CI&&C.exit(1);let o=D(e,Lt[e]),{tryInstall:u}=await ls({name:"tryInstall",type:"confirm",message:`Would you like to globally install ${o}?`});u||C.exit(1);}await B("npm",["i","-g",`${e}${c?`@${c}`:""}`],{nodeOptions:{stdio:"inherit",cwd:a},throwOnError:true});}return l}C.env.NI_CONFIG_FILE;var xs=C.platform==="win32"?C.env.USERPROFILE:C.env.HOME;R.join(xs||"~/",".nirc");async function _s(t,{withFallback:r}={withFallback:false}){let a=await Nt({programmatic:true,cwd:t});return a==="yarn@berry"?"yarn":a==="pnpm@6"?"pnpm":a==="bun"?"bun":a==="deno"?"deno":r?Es()??"npm":a??"npm"}function Es(t=process.env.npm_config_user_agent||""){return t.startsWith("yarn")?"yarn":t.startsWith("pnpm")?"pnpm":t.startsWith("bun")?"bun":t.startsWith("deno")?"deno":t.startsWith("npm")?"npm":null}function Ss(t){return t==="pnpm"?"pnpm dlx":t==="bun"?"bunx":"npx"}async function Ui(t){let r=await _s(t);return Ss(r)}export{_s as a,Es as b,Ss as c,Ui as d};
Shown as plain text from the published tarball, after apm checked it against the version's checksum. Nothing in it runs on this page.