clerc 0.29.0 → 0.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -298,7 +298,6 @@ interface ParseOptions {
298
298
  argv?: string[];
299
299
  run?: boolean;
300
300
  }
301
- type PossibleInputKind = string | number | boolean | Dict<any>;
302
301
  interface HandlerContext<C extends CommandRecord = CommandRecord, N extends keyof C = keyof C> {
303
302
  name?: LiteralUnion<N, string>;
304
303
  called?: string | RootType;
@@ -387,7 +386,7 @@ declare class Clerc<C extends CommandRecord = {}> {
387
386
  version(version: string): this;
388
387
  /**
389
388
  * Set the Locale
390
- * It's recommended to call this method once after you created the Clerc instance.
389
+ * You must call this method once after you created the Clerc instance.
391
390
  * @param locale
392
391
  * @returns
393
392
  * @example
@@ -400,7 +399,7 @@ declare class Clerc<C extends CommandRecord = {}> {
400
399
  locale(locale: string): this;
401
400
  /**
402
401
  * Set the fallback Locale
403
- * It's recommended to call this method once after you created the Clerc instance.
402
+ * You must call this method once after you created the Clerc instance.
404
403
  * @param fallbackLocale
405
404
  * @returns
406
405
  * @example
@@ -411,6 +410,17 @@ declare class Clerc<C extends CommandRecord = {}> {
411
410
  * ```
412
411
  */
413
412
  fallbackLocale(fallbackLocale: string): this;
413
+ /**
414
+ * Register a error handler
415
+ * @param handler
416
+ * @returns
417
+ * @example
418
+ * ```ts
419
+ * Clerc.create()
420
+ * .errorHandler((err) => { console.log(err); })
421
+ * ```
422
+ */
423
+ errorHandler(handler: (err: any) => void): this;
414
424
  /**
415
425
  * Register a command
416
426
  * @param name
@@ -557,7 +567,7 @@ declare const resolveRootCommands: (commands: CommandRecord) => Command<string,
557
567
  declare function resolveParametersBeforeFlag(argv: string[]): string[];
558
568
  declare const resolveArgv: () => string[];
559
569
  declare function compose(inspectors: Inspector[]): (getCtx: () => InspectorContext) => void;
560
- declare const isInvalidName: (name: CommandType) => boolean;
570
+ declare const isValidName: (name: CommandType) => boolean;
561
571
  declare const withBrackets: (s: string, isOptional?: boolean) => string;
562
572
  declare const formatCommandName: (name: string | string[] | RootType) => string;
563
573
  declare const detectLocale: () => string;
@@ -567,6 +577,31 @@ interface CompletionsPluginOptions {
567
577
  }
568
578
  declare const completionsPlugin: (options?: CompletionsPluginOptions) => Plugin<Clerc<{}>, Clerc<{}>>;
569
579
 
580
+ interface BlockSection {
581
+ type?: "block";
582
+ title: string;
583
+ body: string[];
584
+ }
585
+ interface InlineSection {
586
+ type: "inline";
587
+ items: {
588
+ title: string;
589
+ body: string;
590
+ }[];
591
+ }
592
+ type Section = BlockSection | InlineSection;
593
+ interface Renderers {
594
+ renderSections?: (sections: Section[]) => Section[];
595
+ renderFlagName?: (name: string) => string;
596
+ renderType?: (type: any, hasDefault: boolean) => string;
597
+ renderDefault?: (default_: any) => string;
598
+ }
599
+
600
+ declare module "@clerc/core" {
601
+ interface CommandCustomProperties {
602
+ help?: Renderers;
603
+ }
604
+ }
570
605
  interface HelpPluginOptions {
571
606
  /**
572
607
  * Whether to registr the help command.
@@ -590,12 +625,8 @@ interface HelpPluginOptions {
590
625
  * Banner
591
626
  */
592
627
  banner?: string;
593
- /**
594
- * Render type
595
- */
596
- renderer?: "cliffy";
597
628
  }
598
- declare const helpPlugin: ({ command, showHelpWhenNoCommand, notes, examples, banner, renderer, }?: HelpPluginOptions) => Plugin<Clerc<{}>, Clerc<{}>>;
629
+ declare const helpPlugin: ({ command, showHelpWhenNoCommand, notes, examples, banner, }?: HelpPluginOptions) => Plugin<Clerc<{}>, Clerc<{}>>;
599
630
 
600
631
  declare const notFoundPlugin: () => Plugin<Clerc<{}>, Clerc<{}>>;
601
632
 
@@ -609,4 +640,4 @@ declare const versionPlugin: ({ alias, command, }?: VersionPluginOptions) => Plu
609
640
 
610
641
  declare const friendlyErrorPlugin: () => Plugin<Clerc<{}>, Clerc<{}>>;
611
642
 
612
- export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandRecord, CommandType, CommandWithHandler, CompletionsPluginOptions, DescriptionNotSetError, FallbackType, Flag, FlagOptions, Flags, Handler, HandlerContext, HandlerInCommand, HelpPluginOptions, I18N, Inspector, InspectorContext, InspectorFn, InspectorObject, InvalidCommandNameError, LocaleNotCalledFirstError, Locales, MakeEventMap, NameNotSetError, NoCommandGivenError, NoSuchCommandError, ParseOptions, Plugin, PossibleInputKind, Root, RootType, TranslateFn, VersionNotSetError, completionsPlugin, compose, defineCommand, defineHandler, defineInspector, definePlugin, detectLocale, formatCommandName, friendlyErrorPlugin, helpPlugin, isInvalidName, notFoundPlugin, resolveArgv, resolveCommand, resolveCommandStrict, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent, strictFlagsPlugin, versionPlugin, withBrackets };
643
+ export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandRecord, CommandType, CommandWithHandler, CompletionsPluginOptions, DescriptionNotSetError, FallbackType, Flag, FlagOptions, Flags, Handler, HandlerContext, HandlerInCommand, HelpPluginOptions, I18N, Inspector, InspectorContext, InspectorFn, InspectorObject, InvalidCommandNameError, LocaleNotCalledFirstError, Locales, MakeEventMap, NameNotSetError, NoCommandGivenError, NoSuchCommandError, ParseOptions, Plugin, Root, RootType, TranslateFn, VersionNotSetError, completionsPlugin, compose, defineCommand, defineHandler, defineInspector, definePlugin, detectLocale, formatCommandName, friendlyErrorPlugin, helpPlugin, isValidName, notFoundPlugin, resolveArgv, resolveCommand, resolveCommandStrict, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent, strictFlagsPlugin, versionPlugin, withBrackets };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import{format as Te}from"node:util";import pe from"tty";class At{constructor(){this.listenerMap={},this.wildcardListeners=new Set}on(t,n){return t==="*"?(this.wildcardListeners.add(n),this):(this.listenerMap[t]||(this.listenerMap[t]=new Set),this.listenerMap[t].add(n),this)}emit(t,...n){return this.listenerMap[t]&&(this.wildcardListeners.forEach(r=>r(t,...n)),this.listenerMap[t].forEach(r=>r(...n))),this}off(t,n){var r,s;return t==="**"?(this.listenerMap={},this.wildcardListeners.clear(),this):t==="*"?(n?this.wildcardListeners.delete(n):this.wildcardListeners.clear(),this):(n?(r=this.listenerMap[t])==null||r.delete(n):(s=this.listenerMap[t])==null||s.clear(),this)}}const Dt="known-flag",Ot="unknown-flag",_t="argument",{stringify:V}=JSON,Tt=/\B([A-Z])/g,Mt=e=>e.replace(Tt,"-$1").toLowerCase(),{hasOwnProperty:Nt}=Object.prototype,Z=(e,t)=>Nt.call(e,t),Lt=e=>Array.isArray(e),Me=e=>typeof e=="function"?[e,!1]:Lt(e)?[e[0],!0]:Me(e.type),It=(e,t)=>e===Boolean?t!=="false":t,kt=(e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),Rt=/[\s.:=]/,jt=e=>{const t=`Flag name ${V(e)}`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const n=e.match(Rt);if(n)throw new Error(`${t} cannot contain ${V(n==null?void 0:n[0])}`)},Wt=e=>{const t={},n=(r,s)=>{if(Z(t,r))throw new Error(`Duplicate flags named ${V(r)}`);t[r]=s};for(const r in e){if(!Z(e,r))continue;jt(r);const s=e[r],o=[[],...Me(s),s];n(r,o);const i=Mt(r);if(r!==i&&n(i,o),"alias"in s&&typeof s.alias=="string"){const{alias:u}=s,a=`Flag alias ${V(u)} for flag ${V(r)}`;if(u.length===0)throw new Error(`${a} cannot be empty`);if(u.length>1)throw new Error(`${a} must be a single character`);n(u,o)}}return t},Pt=(e,t)=>{const n={};for(const r in e){if(!Z(e,r))continue;const[s,,o,i]=t[r];if(s.length===0&&"default"in i){let{default:u}=i;typeof u=="function"&&(u=u()),n[r]=u}else n[r]=o?s:s.pop()}return n},ne="--",Ht=/[.:=]/,Ut=/^-{1,2}\w/,Yt=e=>{if(!Ut.test(e))return;const t=!e.startsWith(ne);let n=e.slice(t?1:2),r;const s=n.match(Ht);if(s){const{index:o}=s;r=n.slice(o+1),n=n.slice(0,o)}return[n,r,t]},Gt=(e,{onFlag:t,onArgument:n})=>{let r;const s=(o,i)=>{if(typeof r!="function")return!0;r(o,i),r=void 0};for(let o=0;o<e.length;o+=1){const i=e[o];if(i===ne){s();const a=e.slice(o+1);n==null||n(a,[o],!0);break}const u=Yt(i);if(u){if(s(),!t)continue;const[a,l,m]=u;if(m)for(let c=0;c<a.length;c+=1){s();const h=c===a.length-1;r=t(a[c],h?l:void 0,[o,c+1,h])}else r=t(a,l,[o])}else s(i,[o])&&(n==null||n([i],[o]))}s()},zt=(e,t)=>{for(const[n,r,s]of t.reverse()){if(r){const o=e[n];let i=o.slice(0,r);if(s||(i+=o.slice(r+1)),i!=="-"){e[n]=i;continue}}e.splice(n,1)}},Vt=(e,t=process.argv.slice(2),{ignore:n}={})=>{const r=[],s=Wt(e),o={},i=[];return i[ne]=[],Gt(t,{onFlag(u,a,l){const m=Z(s,u);if(!(n!=null&&n(m?Dt:Ot,u,a))){if(m){const[c,h]=s[u],d=It(h,a),p=(g,x)=>{r.push(l),x&&r.push(x),c.push(kt(h,g||""))};return d===void 0?p:p(d)}Z(o,u)||(o[u]=[]),o[u].push(a===void 0?!0:a),r.push(l)}},onArgument(u,a,l){n!=null&&n(_t,t[a[0]])||(i.push(...u),l?(i[ne]=u,t.splice(a[0])):r.push(a))}}),zt(t,r),{flags:Pt(e,s),unknownFlags:o,_:i}};function de(e){return e!==null&&typeof e=="object"}function ge(e,t,n=".",r){if(!de(t))return ge(e,{},n,r);const s=Object.assign({},t);for(const o in e){if(o==="__proto__"||o==="constructor")continue;const i=e[o];i!=null&&(r&&r(s,o,i,n)||(Array.isArray(i)&&Array.isArray(s[o])?s[o]=[...i,...s[o]]:de(i)&&de(s[o])?s[o]=ge(i,s[o],(n?`${n}.`:"")+o.toString(),r):s[o]=i))}return s}function Zt(e){return(...t)=>t.reduce((n,r)=>ge(n,r,"",e),{})}const qt=Zt(),re=e=>Array.isArray(e)?e:[e],Jt=e=>e.replace(/[-_ ](\w)/g,(t,n)=>n.toUpperCase()),Ne=(e,t)=>t.length!==e.length?!1:e.every((n,r)=>n===t[r]),Le=(e,t)=>t.length>e.length?!1:Ne(e.slice(0,t.length),t);class Ie extends Error{constructor(t,n){super(n("core.commandExists",t)),this.commandName=t}}class oe extends Error{constructor(t,n){super(n("core.noSuchCommand",t)),this.commandName=t}}class se extends Error{constructor(t){super(t("core.noCommandGiven"))}}class ke extends Error{constructor(t,n,r){super(r("core.commandNameConflict",t,n)),this.n1=t,this.n2=n}}class Re extends Error{constructor(t){super(t("core.nameNotSet"))}}class je extends Error{constructor(t){super(t("core.descriptionNotSet"))}}class We extends Error{constructor(t){super(t("core.versionNotSet"))}}class Pe extends Error{constructor(t,n){super(n("core.badNameFormat",t)),this.commandName=t}}class fe extends Error{constructor(t){super(t("core.localeMustBeCalledFirst"))}}const He=typeof Deno!="undefined",Kt=typeof process!="undefined"&&!He,Qt=process.versions.electron&&!process.defaultApp;function Ue(e,t,n,r){if(n.alias){const s=re(n.alias);for(const o of s){if(o in t)throw new ke(t[o].name,n.name,r);e.set(typeof o=="symbol"?o:o.split(" "),{...n,__isAlias:!0})}}}function xe(e,t){const n=new Map;e[C]&&(n.set(C,e[C]),Ue(n,e,e[C],t));for(const r of Object.values(e))Ue(n,e,r,t),n.set(r.name.split(" "),r);return n}function Ye(e,t,n){if(t===C)return[e[C],C];const r=re(t),s=xe(e,n);let o,i;return s.forEach((u,a)=>{if(a===C){o=e[C],i=C;return}Le(r,a)&&(!i||i===C||a.length>i.length)&&(o=u,i=a)}),[o,i]}function Ge(e,t,n){if(t===C)return[e[C],C];const r=re(t),s=xe(e,n);let o,i;return s.forEach((u,a)=>{a===C||i===C||Ne(r,a)&&(o=u,i=a)}),[o,i]}function ze(e,t,n=1/0){const r=t===""?[]:Array.isArray(t)?t:t.split(" ");return Object.values(e).filter(s=>{const o=s.name.split(" ");return Le(o,r)&&o.length-r.length<=n})}const Xt=e=>ze(e,"",1);function Ve(e){const t=[];for(const n of e){if(n.startsWith("-"))break;t.push(n)}return t}const Ce=()=>Kt?process.argv.slice(Qt?1:2):He?Deno.args:[];function Ze(e){const t={pre:[],normal:[],post:[]};for(const r of e){const s=typeof r=="object"?r:{fn:r},{enforce:o,fn:i}=s;o==="post"||o==="pre"?t[o].push(i):t.normal.push(i)}const n=[...t.pre,...t.normal,...t.post];return r=>{return s(0);function s(o){const i=n[o];return i(r(),s.bind(null,o+1))}}}const qe=e=>typeof e=="string"&&(e.startsWith(" ")||e.endsWith(" ")),Je=(e,t)=>t?`[${e}]`:`<${e}>`,en="<Root>",H=e=>Array.isArray(e)?e.join(" "):typeof e=="string"?e:en,Ke=()=>process.env.CLERC_LOCALE?process.env.CLERC_LOCALE:Intl.DateTimeFormat().resolvedOptions().locale,{stringify:U}=JSON;function Be(e){const t=[];let n,r;for(const s of e){if(r)throw new Error(`Invalid parameter: Spread parameter ${U(r)} must be last`);const o=s[0],i=s[s.length-1];let u;if(o==="<"&&i===">"&&(u=!0,n))throw new Error(`Invalid parameter: Required parameter ${U(s)} cannot come after optional parameter ${U(n)}`);if(o==="["&&i==="]"&&(u=!1,n=s),u===void 0)throw new Error(`Invalid parameter: ${U(s)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let a=s.slice(1,-1);const l=a.slice(-3)==="...";l&&(r=s,a=a.slice(0,-3)),t.push({name:a,required:u,spread:l})}return t}function $e(e,t,n){for(let r=0;r<t.length;r+=1){const{name:s,required:o,spread:i}=t[r],u=Jt(s);if(u in e)return new Error(`Invalid parameter: ${U(s)} is used more than once.`);const a=i?n.slice(r):n[r];if(i&&(r=t.length),o&&(!a||i&&a.length===0))return new Error(`Error: Missing required parameter ${U(s)}`);e[u]=a}}const tn={en:{"core.commandExists":'Command "%s" exists.',"core.noSuchCommand":"No such command: %s.","core.noCommandGiven":"No command given.","core.commandNameConflict":"Command name %s conflicts with %s. Maybe caused by alias.","core.nameNotSet":"Name not set.","core.descriptionNotSet":"Description not set.","core.versionNotSet":"Version not set.","core.badNameFormat":"Bad name format: %s.","core.localeMustBeCalledFirst":"locale() or fallbackLocale() must be called at first."},"zh-CN":{"core.commandExists":'\u547D\u4EE4 "%s" \u5DF2\u5B58\u5728\u3002',"core.noSuchCommand":"\u627E\u4E0D\u5230\u547D\u4EE4: %s\u3002","core.noCommandGiven":"\u6CA1\u6709\u8F93\u5165\u547D\u4EE4\u3002","core.commandNameConflict":"\u547D\u4EE4\u540D\u79F0 %s \u548C %s \u51B2\u7A81\u3002 \u53EF\u80FD\u662F\u7531\u4E8E\u522B\u540D\u5BFC\u81F4\u7684\u3002","core.nameNotSet":"\u672A\u8BBE\u7F6ECLI\u540D\u79F0\u3002","core.descriptionNotSet":"\u672A\u8BBE\u7F6ECLI\u63CF\u8FF0\u3002","core.versionNotSet":"\u672A\u8BBE\u7F6ECLI\u7248\u672C\u3002","core.badNameFormat":"\u9519\u8BEF\u7684\u547D\u4EE4\u540D\u5B57\u683C\u5F0F: %s\u3002","core.localeMustBeCalledFirst":"locale() \u6216 fallbackLocale() \u5FC5\u987B\u5728\u6700\u5F00\u59CB\u8C03\u7528\u3002"}};var Ee=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},f=(e,t,n)=>(Ee(e,t,"read from private field"),n?n.call(e):t.get(e)),w=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},D=(e,t,n,r)=>(Ee(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),_=(e,t,n)=>(Ee(e,t,"access private method"),n),k,R,j,q,J,ie,Y,ae,K,Q,X,W,Se,Qe,we,Xe,ye,et,T,N,be,tt;const C=Symbol("Root"),nt=class{constructor(e,t,n){w(this,Se),w(this,we),w(this,ye),w(this,T),w(this,be),w(this,k,""),w(this,R,""),w(this,j,""),w(this,q,[]),w(this,J,{}),w(this,ie,new At),w(this,Y,new Set),w(this,ae,void 0),w(this,K,!1),w(this,Q,"en"),w(this,X,"en"),w(this,W,{}),this.i18n={add:r=>{D(this,W,qt(f(this,W),r))},t:(r,...s)=>{const o=f(this,W)[f(this,X)]||f(this,W)[f(this,Q)],i=f(this,W)[f(this,Q)];return o[r]?Te(o[r],...s):i[r]?Te(i[r],...s):void 0}},D(this,k,e||f(this,k)),D(this,R,t||f(this,R)),D(this,j,n||f(this,j)),D(this,X,Ke()),_(this,ye,et).call(this)}get _name(){return f(this,k)}get _description(){return f(this,R)}get _version(){return f(this,j)}get _inspectors(){return f(this,q)}get _commands(){return f(this,J)}static create(e,t,n){return new nt(e,t,n)}name(e){return _(this,T,N).call(this),D(this,k,e),this}description(e){return _(this,T,N).call(this),D(this,R,e),this}version(e){return _(this,T,N).call(this),D(this,j,e),this}locale(e){if(f(this,K))throw new fe(this.i18n.t);return D(this,X,e),this}fallbackLocale(e){if(f(this,K))throw new fe(this.i18n.t);return D(this,Q,e),this}command(e,t,n={}){_(this,T,N).call(this);const{t:r}=this.i18n,s=(m=>!(typeof m=="string"||m===C))(e),o=s?e.name:e;if(qe(o))throw new Pe(o,r);const{handler:i=void 0,...u}=s?e:{name:o,description:t,...n},a=[u.name],l=u.alias?re(u.alias):[];u.alias&&a.push(...l);for(const m of a)if(f(this,Y).has(m))throw new Ie(H(m),r);return f(this,J)[o]=u,f(this,Y).add(u.name),l.forEach(m=>f(this,Y).add(m)),s&&i&&this.on(e.name,i),this}on(e,t){return f(this,ie).on(e,t),this}use(e){return _(this,T,N).call(this),e.setup(this)}inspector(e){return _(this,T,N).call(this),f(this,q).push(e),this}parse(e=Ce()){_(this,T,N).call(this);const{argv:t,run:n}=Array.isArray(e)?{argv:e,run:!0}:{argv:Ce(),...e};return D(this,ae,t),_(this,be,tt).call(this),n&&this.runMatchedCommand(),this}runMatchedCommand(){_(this,T,N).call(this);const{t:e}=this.i18n,t=f(this,ae);if(!t)throw new Error("cli.parse() must be called.");const n=Ve(t),r=n.join(" "),s=()=>Ye(f(this,J),n,e),o=[],i=()=>{o.length=0;const[l,m]=s(),c=!!l,h=Vt((l==null?void 0:l.flags)||{},[...t]),{_:d,flags:p,unknownFlags:g}=h;let x=!c||l.name===C?d:d.slice(l.name.split(" ").length),y=(l==null?void 0:l.parameters)||[];const B=y.indexOf("--"),M=y.slice(B+1)||[],b=Object.create(null);if(B>-1&&M.length>0){y=y.slice(0,B);const G=d["--"];x=x.slice(0,-G.length||void 0),o.push($e(b,Be(y),x)),o.push($e(b,Be(M),G))}else o.push($e(b,Be(y),x));const A={...p,...g};return{name:l==null?void 0:l.name,called:Array.isArray(m)?m.join(" "):m,resolved:c,hasRootOrAlias:f(this,Se,Qe),hasRoot:f(this,we,Xe),raw:{...h,parameters:x,mergedFlags:A},parameters:b,flags:p,unknownFlags:g,cli:this}},u={enforce:"post",fn:()=>{const[l]=s(),m=i(),c=o.filter(Boolean);if(c.length>0)throw c[0];if(!l)throw r?new oe(r,e):new se(e);f(this,ie).emit(l.name,m)}},a=[...f(this,q),u];return Ze(a)(i),this}};let nn=nt;k=new WeakMap,R=new WeakMap,j=new WeakMap,q=new WeakMap,J=new WeakMap,ie=new WeakMap,Y=new WeakMap,ae=new WeakMap,K=new WeakMap,Q=new WeakMap,X=new WeakMap,W=new WeakMap,Se=new WeakSet,Qe=function(){return f(this,Y).has(C)},we=new WeakSet,Xe=function(){return Object.prototype.hasOwnProperty.call(this._commands,C)},ye=new WeakSet,et=function(){this.i18n.add(tn)},T=new WeakSet,N=function(){D(this,K,!0)},be=new WeakSet,tt=function(){const{t:e}=this.i18n;if(!f(this,k))throw new Re(e);if(!f(this,R))throw new je(e);if(!f(this,j))throw new We(e)};const P=e=>e,rn=(e,t,n)=>n,on=(e,t)=>t,sn=(e,t)=>({...e,handler:t}),an=e=>`
2
- ${e})
3
- cmd+="__${e}"
4
- ;;`,un=e=>{const{cli:t}=e,{_name:n,_commands:r}=t;return`_${n}() {
1
+ import{format as Wu}from"node:util";import hu from"tty";class WD{constructor(){this.listenerMap={},this.wildcardListeners=new Set}on(e,t){return e==="*"?(this.wildcardListeners.add(t),this):(this.listenerMap[e]||(this.listenerMap[e]=new Set),this.listenerMap[e].add(t),this)}emit(e,...t){return this.listenerMap[e]&&(this.wildcardListeners.forEach(n=>n(e,...t)),this.listenerMap[e].forEach(n=>n(...t))),this}off(e,t){var n,o;return e==="**"?(this.listenerMap={},this.wildcardListeners.clear(),this):e==="*"?(t?this.wildcardListeners.delete(t):this.wildcardListeners.clear(),this):(t?(n=this.listenerMap[e])==null||n.delete(t):(o=this.listenerMap[e])==null||o.clear(),this)}}const PD="known-flag",HD="unknown-flag",UD="argument",{stringify:V}=JSON,YD=/\B([A-Z])/g,GD=D=>D.replace(YD,"-$1").toLowerCase(),{hasOwnProperty:zD}=Object.prototype,Z=(D,e)=>zD.call(D,e),VD=D=>Array.isArray(D),Pu=D=>typeof D=="function"?[D,!1]:VD(D)?[D[0],!0]:Pu(D.type),ZD=(D,e)=>D===Boolean?e!=="false":e,qD=(D,e)=>typeof e=="boolean"?e:D===Number&&e===""?Number.NaN:D(e),JD=/[\s.:=]/,KD=D=>{const e=`Flag name ${V(D)}`;if(D.length===0)throw new Error(`${e} cannot be empty`);if(D.length===1)throw new Error(`${e} must be longer than a character`);const t=D.match(JD);if(t)throw new Error(`${e} cannot contain ${V(t==null?void 0:t[0])}`)},QD=D=>{const e={},t=(n,o)=>{if(Z(e,n))throw new Error(`Duplicate flags named ${V(n)}`);e[n]=o};for(const n in D){if(!Z(D,n))continue;KD(n);const o=D[n],r=[[],...Pu(o),o];t(n,r);const u=GD(n);if(n!==u&&t(u,r),"alias"in o&&typeof o.alias=="string"){const{alias:i}=o,s=`Flag alias ${V(i)} for flag ${V(n)}`;if(i.length===0)throw new Error(`${s} cannot be empty`);if(i.length>1)throw new Error(`${s} must be a single character`);t(i,r)}}return e},XD=(D,e)=>{const t={};for(const n in D){if(!Z(D,n))continue;const[o,,r,u]=e[n];if(o.length===0&&"default"in u){let{default:i}=u;typeof i=="function"&&(i=i()),t[n]=i}else t[n]=r?o:o.pop()}return t},ru="--",ue=/[.:=]/,De=/^-{1,2}\w/,ee=D=>{if(!De.test(D))return;const e=!D.startsWith(ru);let t=D.slice(e?1:2),n;const o=t.match(ue);if(o){const{index:r}=o;n=t.slice(r+1),t=t.slice(0,r)}return[t,n,e]},te=(D,{onFlag:e,onArgument:t})=>{let n;const o=(r,u)=>{if(typeof n!="function")return!0;n(r,u),n=void 0};for(let r=0;r<D.length;r+=1){const u=D[r];if(u===ru){o();const s=D.slice(r+1);t==null||t(s,[r],!0);break}const i=ee(u);if(i){if(o(),!e)continue;const[s,F,a]=i;if(a)for(let c=0;c<s.length;c+=1){o();const C=c===s.length-1;n=e(s[c],C?F:void 0,[r,c+1,C])}else n=e(s,F,[r])}else o(u,[r])&&(t==null||t([u],[r]))}o()},ne=(D,e)=>{for(const[t,n,o]of e.reverse()){if(n){const r=D[t];let u=r.slice(0,n);if(o||(u+=r.slice(n+1)),u!=="-"){D[t]=u;continue}}D.splice(t,1)}},re=(D,e=process.argv.slice(2),{ignore:t}={})=>{const n=[],o=QD(D),r={},u=[];return u[ru]=[],te(e,{onFlag(i,s,F){const a=Z(o,i);if(!(t!=null&&t(a?PD:HD,i,s))){if(a){const[c,C]=o[i],E=ZD(C,s),l=(h,p)=>{n.push(F),p&&n.push(p),c.push(qD(C,h||""))};return E===void 0?l:l(E)}Z(r,i)||(r[i]=[]),r[i].push(s===void 0?!0:s),n.push(F)}},onArgument(i,s,F){t!=null&&t(UD,e[s[0]])||(u.push(...i),F?(u[ru]=i,e.splice(s[0])):n.push(s))}}),ne(e,n),{flags:XD(D,o),unknownFlags:r,_:u}};function Bu(D){return D!==null&&typeof D=="object"}function pu(D,e,t=".",n){if(!Bu(e))return pu(D,{},t,n);const o=Object.assign({},e);for(const r in D){if(r==="__proto__"||r==="constructor")continue;const u=D[r];u!=null&&(n&&n(o,r,u,t)||(Array.isArray(u)&&Array.isArray(o[r])?o[r]=[...u,...o[r]]:Bu(u)&&Bu(o[r])?o[r]=pu(u,o[r],(t?`${t}.`:"")+r.toString(),n):o[r]=u))}return o}function oe(D){return(...e)=>e.reduce((t,n)=>pu(t,n,"",D),{})}const se=oe(),ou=D=>Array.isArray(D)?D:[D],ie=D=>D.replace(/[-_ ](\w)/g,(e,t)=>t.toUpperCase()),Hu=(D,e)=>e.length!==D.length?!1:D.every((t,n)=>t===e[n]),Uu=(D,e)=>e.length>D.length?!1:Hu(D.slice(0,e.length),e),q=JSON.stringify;class Yu extends Error{constructor(e,t){super(t("core.commandExists",q(e))),this.commandName=e}}class su extends Error{constructor(e,t){super(t("core.noSuchCommand",q(e))),this.commandName=e}}class iu extends Error{constructor(e){super(e("core.noCommandGiven"))}}class Gu extends Error{constructor(e,t,n){super(n("core.commandNameConflict",q(e),q(t))),this.n1=e,this.n2=t}}class zu extends Error{constructor(e){super(e("core.nameNotSet"))}}class Vu extends Error{constructor(e){super(e("core.descriptionNotSet"))}}class Zu extends Error{constructor(e){super(e("core.versionNotSet"))}}class qu extends Error{constructor(e,t){super(t("core.badNameFormat",q(e))),this.commandName=e}}class du extends Error{constructor(e){super(e("core.localeMustBeCalledFirst"))}}const Ju=typeof Deno!="undefined",Fe=typeof process!="undefined"&&!Ju,ae=process.versions.electron&&!process.defaultApp;function Ku(D,e,t,n){if(t.alias){const o=ou(t.alias);for(const r of o){if(r in e)throw new Gu(e[r].name,t.name,n);D.set(typeof r=="symbol"?r:r.split(" "),{...t,__isAlias:!0})}}}function gu(D,e){const t=new Map;D[B]&&(t.set(B,D[B]),Ku(t,D,D[B],e));for(const n of Object.values(D))Ku(t,D,n,e),t.set(n.name.split(" "),n);return t}function Qu(D,e,t){if(e===B)return[D[B],B];const n=ou(e),o=gu(D,t);let r,u;return o.forEach((i,s)=>{if(s===B){r=D[B],u=B;return}Uu(n,s)&&(!u||u===B||s.length>u.length)&&(r=i,u=s)}),[r,u]}function Xu(D,e,t){if(e===B)return[D[B],B];const n=ou(e),o=gu(D,t);let r,u;return o.forEach((i,s)=>{s===B||u===B||Hu(n,s)&&(r=i,u=s)}),[r,u]}function uD(D,e,t=1/0){const n=e===""?[]:Array.isArray(e)?e:e.split(" ");return Object.values(D).filter(o=>{const r=o.name.split(" ");return Uu(r,n)&&r.length-n.length<=t})}const Ce=D=>uD(D,"",1);function DD(D){const e=[];for(const t of D){if(t.startsWith("-"))break;e.push(t)}return e}const fu=()=>Fe?process.argv.slice(ae?1:2):Ju?Deno.args:[];function eD(D){const e={pre:[],normal:[],post:[]};for(const n of D){const o=typeof n=="object"?n:{fn:n},{enforce:r,fn:u}=o;r==="post"||r==="pre"?e[r].push(u):e.normal.push(u)}const t=[...e.pre,...e.normal,...e.post];return n=>{return o(0);function o(r){const u=t[r];return u(n(),o.bind(null,r+1))}}}const le=/\s\s+/,tD=D=>D===B?!0:!(D.startsWith(" ")||D.endsWith(" "))&&!le.test(D),nD=(D,e)=>e?`[${D}]`:`<${D}>`,ce="<Root>",U=D=>Array.isArray(D)?D.join(" "):typeof D=="string"?D:ce,rD=()=>process.env.CLERC_LOCALE?process.env.CLERC_LOCALE:Intl.DateTimeFormat().resolvedOptions().locale,{stringify:Y}=JSON;function Au(D){const e=[];let t,n;for(const o of D){if(n)throw new Error(`Invalid parameter: Spread parameter ${Y(n)} must be last`);const r=o[0],u=o[o.length-1];let i;if(r==="<"&&u===">"&&(i=!0,t))throw new Error(`Invalid parameter: Required parameter ${Y(o)} cannot come after optional parameter ${Y(t)}`);if(r==="["&&u==="]"&&(i=!1,t=o),i===void 0)throw new Error(`Invalid parameter: ${Y(o)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let s=o.slice(1,-1);const F=s.slice(-3)==="...";F&&(n=o,s=s.slice(0,-3)),e.push({name:s,required:i,spread:F})}return e}function xu(D,e,t){for(let n=0;n<e.length;n+=1){const{name:o,required:r,spread:u}=e[n],i=ie(o);if(i in D)throw new Error(`Invalid parameter: ${Y(o)} is used more than once.`);const s=u?t.slice(n):t[n];if(u&&(n=e.length),r&&(!s||u&&s.length===0))throw new Error(`Missing required parameter ${Y(o)}`);D[i]=s}}const Ee={en:{"core.commandExists":'Command "%s" exists.',"core.noSuchCommand":"No such command: %s.","core.noCommandGiven":"No command given.","core.commandNameConflict":"Command name %s conflicts with %s. Maybe caused by alias.","core.nameNotSet":"Name not set.","core.descriptionNotSet":"Description not set.","core.versionNotSet":"Version not set.","core.badNameFormat":"Bad name format: %s.","core.localeMustBeCalledFirst":"locale() or fallbackLocale() must be called at first.","core.cliParseMustBeCalled":"cli.parse() must be called."},"zh-CN":{"core.commandExists":'\u547D\u4EE4 "%s" \u5DF2\u5B58\u5728\u3002',"core.noSuchCommand":"\u627E\u4E0D\u5230\u547D\u4EE4: %s\u3002","core.noCommandGiven":"\u6CA1\u6709\u8F93\u5165\u547D\u4EE4\u3002","core.commandNameConflict":"\u547D\u4EE4\u540D\u79F0 %s \u548C %s \u51B2\u7A81\u3002 \u53EF\u80FD\u662F\u7531\u4E8E\u522B\u540D\u5BFC\u81F4\u7684\u3002","core.nameNotSet":"\u672A\u8BBE\u7F6ECLI\u540D\u79F0\u3002","core.descriptionNotSet":"\u672A\u8BBE\u7F6ECLI\u63CF\u8FF0\u3002","core.versionNotSet":"\u672A\u8BBE\u7F6ECLI\u7248\u672C\u3002","core.badNameFormat":"\u9519\u8BEF\u7684\u547D\u4EE4\u540D\u5B57\u683C\u5F0F: %s\u3002","core.localeMustBeCalledFirst":"locale() \u6216 fallbackLocale() \u5FC5\u987B\u5728\u6700\u5F00\u59CB\u8C03\u7528\u3002","core.cliParseMustBeCalled":"cli.parse() \u5FC5\u987B\u88AB\u8C03\u7528\u3002"}};var $u=(D,e,t)=>{if(!e.has(D))throw TypeError("Cannot "+t)},m=(D,e,t)=>($u(D,e,"read from private field"),t?t.call(D):e.get(D)),x=(D,e,t)=>{if(e.has(D))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(D):e.set(D,t)},w=(D,e,t,n)=>($u(D,e,"write to private field"),n?n.call(D,t):e.set(D,t),t),$=(D,e,t)=>($u(D,e,"access private method"),t),k,I,R,J,K,Fu,G,Q,X,uu,Du,eu,j,Su,oD,wu,sD,bu,iD,_,T,yu,FD,vu,aD,Ou,CD,au,_u,Nu,lD;const B=Symbol.for("Clerc.Root"),cD=class{constructor(D,e,t){x(this,Su),x(this,wu),x(this,bu),x(this,_),x(this,yu),x(this,vu),x(this,Ou),x(this,au),x(this,Nu),x(this,k,""),x(this,I,""),x(this,R,""),x(this,J,[]),x(this,K,{}),x(this,Fu,new WD),x(this,G,new Set),x(this,Q,void 0),x(this,X,[]),x(this,uu,!1),x(this,Du,"en"),x(this,eu,"en"),x(this,j,{}),this.i18n={add:n=>{w(this,j,se(m(this,j),n))},t:(n,...o)=>{const r=m(this,j)[m(this,eu)]||m(this,j)[m(this,Du)],u=m(this,j)[m(this,Du)];return r[n]?Wu(r[n],...o):u[n]?Wu(u[n],...o):void 0}},w(this,k,D||m(this,k)),w(this,I,e||m(this,I)),w(this,R,t||m(this,R)),w(this,eu,rD()),$(this,bu,iD).call(this)}get _name(){return m(this,k)}get _description(){return m(this,I)}get _version(){return m(this,R)}get _inspectors(){return m(this,J)}get _commands(){return m(this,K)}static create(D,e,t){return new cD(D,e,t)}name(D){return $(this,_,T).call(this),w(this,k,D),this}description(D){return $(this,_,T).call(this),w(this,I,D),this}version(D){return $(this,_,T).call(this),w(this,R,D),this}locale(D){if(m(this,uu))throw new du(this.i18n.t);return w(this,eu,D),this}fallbackLocale(D){if(m(this,uu))throw new du(this.i18n.t);return w(this,Du,D),this}errorHandler(D){return m(this,X).push(D),this}command(D,e,t={}){return $(this,au,_u).call(this,()=>$(this,yu,FD).call(this,D,e,t)),this}on(D,e){return m(this,Fu).on(D,e),this}use(D){return $(this,_,T).call(this),D.setup(this)}inspector(D){return $(this,_,T).call(this),m(this,J).push(D),this}parse(D=fu()){$(this,_,T).call(this);const{argv:e,run:t}=Array.isArray(D)?{argv:D,run:!0}:{argv:fu(),...D};return w(this,Q,e),$(this,vu,aD).call(this),t&&this.runMatchedCommand(),this}runMatchedCommand(){return $(this,au,_u).call(this,()=>$(this,Nu,lD).call(this)),this}};let me=cD;k=new WeakMap,I=new WeakMap,R=new WeakMap,J=new WeakMap,K=new WeakMap,Fu=new WeakMap,G=new WeakMap,Q=new WeakMap,X=new WeakMap,uu=new WeakMap,Du=new WeakMap,eu=new WeakMap,j=new WeakMap,Su=new WeakSet,oD=function(){return m(this,G).has(B)},wu=new WeakSet,sD=function(){return Object.prototype.hasOwnProperty.call(this._commands,B)},bu=new WeakSet,iD=function(){this.i18n.add(Ee)},_=new WeakSet,T=function(){w(this,uu,!0)},yu=new WeakSet,FD=function(D,e,t={}){$(this,_,T).call(this);const{t:n}=this.i18n,o=(a=>!(typeof a=="string"||a===B))(D),r=o?D.name:D;if(!tD(r))throw new qu(r,n);const{handler:u=void 0,...i}=o?D:{name:r,description:e,...t},s=[i.name],F=i.alias?ou(i.alias):[];i.alias&&s.push(...F);for(const a of s)if(m(this,G).has(a))throw new Yu(U(a),n);return m(this,K)[r]=i,m(this,G).add(i.name),F.forEach(a=>m(this,G).add(a)),o&&u&&this.on(D.name,u),this},vu=new WeakSet,aD=function(){const{t:D}=this.i18n;if(!m(this,k))throw new zu(D);if(!m(this,I))throw new Vu(D);if(!m(this,R))throw new Zu(D)},Ou=new WeakSet,CD=function(D){const e=m(this,Q),[t,n]=D(),o=!!t,r=re((t==null?void 0:t.flags)||{},[...e]),{_:u,flags:i,unknownFlags:s}=r;let F=!o||t.name===B?u:u.slice(t.name.split(" ").length),a=(t==null?void 0:t.parameters)||[];const c=a.indexOf("--"),C=a.slice(c+1)||[],E=Object.create(null);if(c>-1&&C.length>0){a=a.slice(0,c);const h=u["--"];F=F.slice(0,-h.length||void 0),xu(E,Au(a),F),xu(E,Au(C),h)}else xu(E,Au(a),F);const l={...i,...s};return{name:t==null?void 0:t.name,called:Array.isArray(n)?n.join(" "):n,resolved:o,hasRootOrAlias:m(this,Su,oD),hasRoot:m(this,wu,sD),raw:{...r,parameters:F,mergedFlags:l},parameters:E,flags:i,unknownFlags:s,cli:this}},au=new WeakSet,_u=function(D){try{D()}catch(e){if(m(this,X).length>0)m(this,X).forEach(t=>t(e));else throw e}},Nu=new WeakSet,lD=function(){$(this,_,T).call(this);const{t:D}=this.i18n,e=m(this,Q);if(!e)throw new Error(D("core.cliParseMustBeCalled"));const t=DD(e),n=t.join(" "),o=()=>Qu(m(this,K),t,D),r=()=>$(this,Ou,CD).call(this,o),u={enforce:"post",fn:()=>{const[s]=o(),F=r();if(!s)throw n?new su(n,D):new iu(D);m(this,Fu).emit(s.name,F)}},i=[...m(this,J),u];eD(i)(r)};const W=D=>D,he=(D,e,t)=>t,Be=(D,e)=>e,pe=(D,e)=>({...D,handler:e}),de=D=>`
2
+ ${D})
3
+ cmd+="__${D}"
4
+ ;;`,ge=D=>{const{cli:e}=D,{_name:t,_commands:n}=e;return`_${t}() {
5
5
  local i cur prev opts cmds
6
6
  COMPREPLY=()
7
7
  cur="\${COMP_WORDS[COMP_CWORD]}"
@@ -13,27 +13,27 @@ import{format as Te}from"node:util";import pe from"tty";class At{constructor(){t
13
13
  do
14
14
  case "\${i}" in
15
15
  "$1")
16
- cmd="${n}"
16
+ cmd="${t}"
17
17
  ;;
18
- ${Object.keys(r).map(an).join("")}
18
+ ${Object.keys(n).map(de).join("")}
19
19
  *)
20
20
  ;;
21
21
  esac
22
22
  done
23
23
  }
24
24
 
25
- complete -F _${n} -o bashdefault -o default ${n}
26
- `},rt=e=>e.replace(/([A-Z])/g,(t,n)=>`-${n.toLowerCase()}`),ot=e=>e.length<=1?`-${e}`:`--${rt(e)}`,st="(No Description)",ln=e=>`[CompletionResult]::new('${e.name}', '${e.name}', [CompletionResultType]::ParameterValue, '${e.description}')`,cn=e=>Object.entries(e.flags||{}).map(([t,n])=>{const r=[`[CompletionResult]::new('${ot(t)}', '${rt(t)}', [CompletionResultType]::ParameterName, '${e.flags[t].description||st}')`];return n!=null&&n.alias&&r.push(`[CompletionResult]::new('${ot(n.alias)}', '${n.alias}', [CompletionResultType]::ParameterName, '${e.flags[t].description||st}')`),r.join(`
25
+ complete -F _${t} -o bashdefault -o default ${t}
26
+ `},ED=D=>D.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),mD=D=>D.length<=1?`-${D}`:`--${ED(D)}`,hD="(No Description)",fe=D=>`[CompletionResult]::new('${D.name}', '${D.name}', [CompletionResultType]::ParameterValue, '${D.description}')`,Ae=D=>Object.entries(D.flags||{}).map(([e,t])=>{const n=[`[CompletionResult]::new('${mD(e)}', '${ED(e)}', [CompletionResultType]::ParameterName, '${D.flags[e].description||hD}')`];return t!=null&&t.alias&&n.push(`[CompletionResult]::new('${mD(t.alias)}', '${t.alias}', [CompletionResultType]::ParameterName, '${D.flags[e].description||hD}')`),n.join(`
27
27
  `)}).join(`
28
- `),mn=e=>{const{cli:t}=e,{_name:n,_commands:r}=t;return`using namespace System.Management.Automation
28
+ `),xe=D=>{const{cli:e}=D,{_name:t,_commands:n}=e;return`using namespace System.Management.Automation
29
29
  using namespace System.Management.Automation.Language
30
30
 
31
- Register-ArgumentCompleter -Native -CommandName '${n}' -ScriptBlock {
31
+ Register-ArgumentCompleter -Native -CommandName '${t}' -ScriptBlock {
32
32
  param($wordToComplete, $commandAst, $cursorPosition)
33
33
 
34
34
  $commandElements = $commandAst.CommandElements
35
35
  $command = @(
36
- '${n}'
36
+ '${t}'
37
37
  for ($i = 1; $i -lt $commandElements.Count; $i++) {
38
38
  $element = $commandElements[$i]
39
39
  if ($element -isnot [StringConstantExpressionAst] -or
@@ -46,13 +46,13 @@ Register-ArgumentCompleter -Native -CommandName '${n}' -ScriptBlock {
46
46
  }) -join ';'
47
47
 
48
48
  $completions = @(switch ($command) {
49
- '${n}' {
50
- ${Object.entries(r).map(([s,o])=>ln(o)).join(`
49
+ '${t}' {
50
+ ${Object.entries(n).map(([o,r])=>fe(r)).join(`
51
51
  `)}
52
52
  break
53
53
  }
54
- ${Object.entries(r).map(([s,o])=>`'${n};${s.split(" ").join(";")}' {
55
- ${cn(o)}
54
+ ${Object.entries(n).map(([o,r])=>`'${t};${o.split(" ").join(";")}' {
55
+ ${Ae(r)}
56
56
  break
57
57
  }`).join(`
58
58
  `)}
@@ -60,18 +60,18 @@ Register-ArgumentCompleter -Native -CommandName '${n}' -ScriptBlock {
60
60
 
61
61
  $completions.Where{ $_.CompletionText -like "$wordToComplete*" } |
62
62
  Sort-Object -Property ListItemText
63
- }`},it={bash:un,pwsh:mn},hn=(e={})=>P({setup:t=>{const{command:n=!0}=e;return n&&(t=t.command("completions","Print shell completions to stdout",{flags:{shell:{description:"Shell type",type:String,default:""}},parameters:["[shell]"]}).on("completions",r=>{if(!t._name)throw new Error("CLI name is not defined!");const s=String(r.parameters.shell||r.flags.shell);if(!s)throw new Error("Missing shell name");if(s in it)process.stdout.write(it[s](r));else throw new Error(`No such shell: ${s}`)})),t}}),pn=e=>Array.isArray(e)?e:[e],dn=e=>e.replace(/([A-Z])/g,(t,n)=>`-${n.toLowerCase()}`),at=e=>e.length<=1?`-${e}`:`--${dn(e)}`;var F={exports:{}};let gn=pe,fn=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||gn.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),$=(e,t,n=e)=>r=>{let s=""+r,o=s.indexOf(t,e.length);return~o?e+ut(s,t,n,o)+t:e+s+t},ut=(e,t,n,r)=>{let s=e.substring(0,r)+n,o=e.substring(r+t.length),i=o.indexOf(t);return~i?s+ut(o,t,n,i):s+o},lt=(e=fn)=>({isColorSupported:e,reset:e?t=>`\x1B[0m${t}\x1B[0m`:String,bold:e?$("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?$("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?$("\x1B[3m","\x1B[23m"):String,underline:e?$("\x1B[4m","\x1B[24m"):String,inverse:e?$("\x1B[7m","\x1B[27m"):String,hidden:e?$("\x1B[8m","\x1B[28m"):String,strikethrough:e?$("\x1B[9m","\x1B[29m"):String,black:e?$("\x1B[30m","\x1B[39m"):String,red:e?$("\x1B[31m","\x1B[39m"):String,green:e?$("\x1B[32m","\x1B[39m"):String,yellow:e?$("\x1B[33m","\x1B[39m"):String,blue:e?$("\x1B[34m","\x1B[39m"):String,magenta:e?$("\x1B[35m","\x1B[39m"):String,cyan:e?$("\x1B[36m","\x1B[39m"):String,white:e?$("\x1B[37m","\x1B[39m"):String,gray:e?$("\x1B[90m","\x1B[39m"):String,bgBlack:e?$("\x1B[40m","\x1B[49m"):String,bgRed:e?$("\x1B[41m","\x1B[49m"):String,bgGreen:e?$("\x1B[42m","\x1B[49m"):String,bgYellow:e?$("\x1B[43m","\x1B[49m"):String,bgBlue:e?$("\x1B[44m","\x1B[49m"):String,bgMagenta:e?$("\x1B[45m","\x1B[49m"):String,bgCyan:e?$("\x1B[46m","\x1B[49m"):String,bgWhite:e?$("\x1B[47m","\x1B[49m"):String});F.exports=lt(),F.exports.createColors=lt;var xn=Function.prototype.toString,Cn=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;function Bn(e){if(typeof e!="function")return null;var t="";if(typeof Function.prototype.name=="undefined"&&typeof e.name=="undefined"){var n=xn.call(e).match(Cn);n&&(t=n[1])}else t=e.name;return t}var ct=Bn,$n=function(e,t){t||(t={});var n=t.hsep===void 0?" ":t.hsep,r=t.align||[],s=t.stringLength||function(a){return String(a).length},o=ht(e,function(a,l){return pt(l,function(m,c){var h=mt(m);(!a[c]||h>a[c])&&(a[c]=h)}),a},[]),i=ue(e,function(a){return ue(a,function(l,m){var c=String(l);if(r[m]==="."){var h=mt(c),d=o[m]+(/\./.test(c)?1:2)-(s(c)-h);return c+Array(d).join(" ")}else return c})}),u=ht(i,function(a,l){return pt(l,function(m,c){var h=s(m);(!a[c]||h>a[c])&&(a[c]=h)}),a},[]);return ue(i,function(a){return ue(a,function(l,m){var c=u[m]-s(l)||0,h=Array(Math.max(c+1,1)).join(" ");return r[m]==="r"||r[m]==="."?h+l:r[m]==="c"?Array(Math.ceil(c/2+1)).join(" ")+l+Array(Math.floor(c/2+1)).join(" "):l+h}).join(n).replace(/\s+$/,"")}).join(`
64
- `)};function mt(e){var t=/\.[^.]*$/.exec(e);return t?t.index+1:e.length}function ht(e,t,n){if(e.reduce)return e.reduce(t,n);for(var r=0,s=arguments.length>=3?n:e[r++];r<e.length;r++)t(s,e[r],r);return s}function pt(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t.call(e,e[n],n)}function ue(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t.call(e,e[r],r));return n}const Fe=(...e)=>$n(e),ve=(...e)=>Fe(...e).toString().split(`
65
- `),En=e=>Array.isArray(e)?`Array<${ct(e[0])}>`:ct(e),Sn=e=>{const t=[];for(const n of e){if(n.type==="block"||!n.type){const r=" ",s=n.body.map(i=>r+i);s.unshift("");const o=s.join(`
66
- `);t.push(Fe([F.exports.bold(`${n.title}:`)],[o]).toString())}else if(n.type==="inline"){const r=n.items.map(o=>[F.exports.bold(`${o.title}:`),o.body]),s=Fe(...r);t.push(s.toString())}t.push("")}return t.join(`
67
- `)},wn={en:{"help.name":"Name","help.version":"Version","help.subcommand":"Subcommand","help.commands":"Commands","help.flags":"Flags","help.description":"Description","help.usage":"Usage","help.examples":"Examples","help.notes":"Notes","help.noDescription":"(No description)","help.notes.1":"If no command is specified, show help for the CLI.","help.notes.2":"If a command is specified, show help for the command.","help.notes.3":"-h is an alias for --help.","help.examples.1":"Show help","help.examples.2":"Show help for a specific command","help.commandDescription":"Show help"},"zh-CN":{"help.name":"\u540D\u79F0","help.version":"\u7248\u672C","help.subcommand":"\u5B50\u547D\u4EE4","help.commands":"\u547D\u4EE4","help.flags":"\u6807\u5FD7","help.description":"\u63CF\u8FF0","help.usage":"\u4F7F\u7528","help.examples":"\u793A\u4F8B","help.notes":"\u5907\u6CE8","help.noDescription":"(\u65E0\u63CF\u8FF0)","help.notes.1":"\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u5C55\u793A\u54EA\u4E2A\u547D\u4EE4\u7684\u5E2E\u52A9\u4FE1\u606F\uFF0C\u9ED8\u8BA4\u5C55\u793ACLI\u7684\u3002","help.notes.2":"\u5982\u679C\u6307\u5B9A\u4E86\u5219\u5C55\u793A\u8BE5\u547D\u4EE4\u5E2E\u52A9\u4FE1\u606F\u3002","help.notes.3":"-h \u662F --help \u7684\u4E00\u4E2A\u522B\u540D\u3002","help.examples.1":"\u5C55\u793A CLI \u7684\u5E2E\u52A9\u4FE1\u606F","help.examples.2":"\u5C55\u793A\u6307\u5B9A\u547D\u4EE4\u7684\u5E2E\u52A9\u4FE1\u606F","help.commandDescription":"\u5C55\u793A\u5E2E\u52A9\u4FE1\u606F"}},Ae=F.exports.yellow("-"),dt=e=>{process.stdout.write(e)},De=(e,t,n)=>{const{t:r}=t.i18n,s=[{title:r("help.name"),body:F.exports.red(t._name)},{title:r("help.version"),body:F.exports.yellow(t._version)}];n&&s.push({title:r("help.subcommand"),body:F.exports.green(`${t._name} ${H(n.name)}`)}),e.push({type:"inline",items:s}),e.push({title:r("help.description"),body:[(n==null?void 0:n.description)||t._description]})},gt=(e,t,n)=>{const r=t.map(([s,o])=>[s,Ae,o]);e.push({title:n("help.examples"),body:ve(...r)})},le=(e,t,n,r)=>{const{cli:s}=t,{t:o}=s.i18n,i=[];De(i,s),i.push({title:o("help.usage"),body:[F.exports.magenta(`$ ${s._name} ${Je("command",t.hasRootOrAlias)} [flags]`)]});const u=[...t.hasRoot?[s._commands[C]]:[],...Object.values(s._commands)].map(a=>{const l=[typeof a.name=="symbol"?"":a.name,...pn(a.alias||[])].sort((m,c)=>m===C?-1:c===C?1:m.length-c.length).map(m=>m===""||typeof m=="symbol"?`${s._name}`:`${s._name} ${m}`).join(", ");return[F.exports.cyan(l),Ae,a.description]});return i.push({title:o("help.commands"),body:ve(...u)}),n&&i.push({title:o("help.notes"),body:n}),r&&gt(i,r,o),e(i)},Oe=(e,t,n)=>{var r;const{cli:s}=t,{t:o}=s.i18n,[i]=Ge(s._commands,n,o);if(!i)throw new oe(H(n),o);const u=[];n===C?De(u,s):De(u,s,{...i,name:H(n)});const a=((r=i.parameters)==null?void 0:r.join(" "))||void 0,l=n===C?"":` ${H(n)}`,m=a?` ${a}`:"",c=i.flags?" [flags]":"";return u.push({title:o("help.usage"),body:[F.exports.magenta(`$ ${s._name}${l}${m}${c}`)]}),i.flags&&u.push({title:o("help.flags"),body:ve(...Object.entries(i.flags).map(([h,d])=>{const p=[at(h)];d.alias&&p.push(at(d.alias));const g=[F.exports.blue(p.join(", "))];if(g.push(Ae,d.description||o("help.noDescription")),d.type){const x=En(d.type);g.push(F.exports.gray(`(${x})`))}return g}))}),i.notes&&u.push({title:o("help.notes"),body:i.notes}),i.examples&&gt(u,i.examples,o),e(u)},yn=({command:e=!0,showHelpWhenNoCommand:t=!0,notes:n,examples:r,banner:s,renderer:o="cliffy"}={})=>P({setup:i=>{const{add:u,t:a}=i.i18n;u(wn);const l=o==="cliffy"?Sn:()=>"",m=c=>{s&&dt(`${s}
68
- `),dt(c)};return e&&(i=i.command("help",a("help.commandDescription"),{parameters:["[command...]"],notes:[a("help.notes.1"),a("help.notes.2"),a("help.notes.3")],examples:[[`$ ${i._name} help`,a("help.examples.1")],[`$ ${i._name} help <command>`,a("help.examples.2")],[`$ ${i._name} <command> --help`,a("help.examples.2")]]}).on("help",c=>{c.parameters.command.length?m(Oe(l,c,c.parameters.command)):m(le(l,c,n,r))})),i.inspector((c,h)=>{const d=c.raw.mergedFlags.h||c.raw.mergedFlags.help;if(!c.hasRootOrAlias&&!c.raw._.length&&t&&!d){let p=`${a("core.noCommandGiven")}
63
+ }`},BD={bash:ge,pwsh:xe},$e=(D={})=>W({setup:e=>{const{command:t=!0}=D;return t&&(e=e.command("completions","Print shell completions to stdout",{flags:{shell:{description:"Shell type",type:String,default:""}},parameters:["[shell]"]}).on("completions",n=>{if(!e._name)throw new Error("CLI name is not defined!");const o=String(n.parameters.shell||n.flags.shell);if(!o)throw new Error("Missing shell name");if(o in BD)process.stdout.write(BD[o](n));else throw new Error(`No such shell: ${o}`)})),e}}),Se=D=>Array.isArray(D)?D:[D],we=D=>D.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),pD=D=>D.length<=1?`-${D}`:`--${we(D)}`;var b={exports:{}};let be=hu,ye=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||be.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),d=(D,e,t=D)=>n=>{let o=""+n,r=o.indexOf(e,D.length);return~r?D+dD(o,e,t,r)+e:D+o+e},dD=(D,e,t,n)=>{let o=D.substring(0,n)+t,r=D.substring(n+e.length),u=r.indexOf(e);return~u?o+dD(r,e,t,u):o+r},gD=(D=ye)=>({isColorSupported:D,reset:D?e=>`\x1B[0m${e}\x1B[0m`:String,bold:D?d("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:D?d("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:D?d("\x1B[3m","\x1B[23m"):String,underline:D?d("\x1B[4m","\x1B[24m"):String,inverse:D?d("\x1B[7m","\x1B[27m"):String,hidden:D?d("\x1B[8m","\x1B[28m"):String,strikethrough:D?d("\x1B[9m","\x1B[29m"):String,black:D?d("\x1B[30m","\x1B[39m"):String,red:D?d("\x1B[31m","\x1B[39m"):String,green:D?d("\x1B[32m","\x1B[39m"):String,yellow:D?d("\x1B[33m","\x1B[39m"):String,blue:D?d("\x1B[34m","\x1B[39m"):String,magenta:D?d("\x1B[35m","\x1B[39m"):String,cyan:D?d("\x1B[36m","\x1B[39m"):String,white:D?d("\x1B[37m","\x1B[39m"):String,gray:D?d("\x1B[90m","\x1B[39m"):String,bgBlack:D?d("\x1B[40m","\x1B[49m"):String,bgRed:D?d("\x1B[41m","\x1B[49m"):String,bgGreen:D?d("\x1B[42m","\x1B[49m"):String,bgYellow:D?d("\x1B[43m","\x1B[49m"):String,bgBlue:D?d("\x1B[44m","\x1B[49m"):String,bgMagenta:D?d("\x1B[45m","\x1B[49m"):String,bgCyan:D?d("\x1B[46m","\x1B[49m"):String,bgWhite:D?d("\x1B[47m","\x1B[49m"):String});b.exports=gD(),b.exports.createColors=gD;var ve=function(D,e){e||(e={});var t=e.hsep===void 0?" ":e.hsep,n=e.align||[],o=e.stringLength||function(s){return String(s).length},r=AD(D,function(s,F){return xD(F,function(a,c){var C=fD(a);(!s[c]||C>s[c])&&(s[c]=C)}),s},[]),u=Cu(D,function(s){return Cu(s,function(F,a){var c=String(F);if(n[a]==="."){var C=fD(c),E=r[a]+(/\./.test(c)?1:2)-(o(c)-C);return c+Array(E).join(" ")}else return c})}),i=AD(u,function(s,F){return xD(F,function(a,c){var C=o(a);(!s[c]||C>s[c])&&(s[c]=C)}),s},[]);return Cu(u,function(s){return Cu(s,function(F,a){var c=i[a]-o(F)||0,C=Array(Math.max(c+1,1)).join(" ");return n[a]==="r"||n[a]==="."?C+F:n[a]==="c"?Array(Math.ceil(c/2+1)).join(" ")+F+Array(Math.floor(c/2+1)).join(" "):F+C}).join(t).replace(/\s+$/,"")}).join(`
64
+ `)};function fD(D){var e=/\.[^.]*$/.exec(D);return e?e.index+1:D.length}function AD(D,e,t){if(D.reduce)return D.reduce(e,t);for(var n=0,o=arguments.length>=3?t:D[n++];n<D.length;n++)e(o,D[n],n);return o}function xD(D,e){if(D.forEach)return D.forEach(e);for(var t=0;t<D.length;t++)e.call(D,D[t],t)}function Cu(D,e){if(D.map)return D.map(e);for(var t=[],n=0;n<D.length;n++)t.push(e.call(D,D[n],n));return t}function Oe({onlyFirst:D=!1}={}){const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,D?void 0:"g")}function _e(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(Oe(),"")}var $D={exports:{}};(function(D){var e={};D.exports=e,e.eastAsianWidth=function(n){var o=n.charCodeAt(0),r=n.length==2?n.charCodeAt(1):0,u=o;return 55296<=o&&o<=56319&&56320<=r&&r<=57343&&(o&=1023,r&=1023,u=o<<10|r,u+=65536),u==12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u==8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u==172||u==175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u==161||u==164||167<=u&&u<=168||u==170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u==198||u==208||215<=u&&u<=216||222<=u&&u<=225||u==230||232<=u&&u<=234||236<=u&&u<=237||u==240||242<=u&&u<=243||247<=u&&u<=250||u==252||u==254||u==257||u==273||u==275||u==283||294<=u&&u<=295||u==299||305<=u&&u<=307||u==312||319<=u&&u<=322||u==324||328<=u&&u<=331||u==333||338<=u&&u<=339||358<=u&&u<=359||u==363||u==462||u==464||u==466||u==468||u==470||u==472||u==474||u==476||u==593||u==609||u==708||u==711||713<=u&&u<=715||u==717||u==720||728<=u&&u<=731||u==733||u==735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u==1025||1040<=u&&u<=1103||u==1105||u==8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u==8240||8242<=u&&u<=8243||u==8245||u==8251||u==8254||u==8308||u==8319||8321<=u&&u<=8324||u==8364||u==8451||u==8453||u==8457||u==8467||u==8470||8481<=u&&u<=8482||u==8486||u==8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u==8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u==8658||u==8660||u==8679||u==8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u==8715||u==8719||u==8721||u==8725||u==8730||8733<=u&&u<=8736||u==8739||u==8741||8743<=u&&u<=8748||u==8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u==8776||u==8780||u==8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u==8853||u==8857||u==8869||u==8895||u==8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u==9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u==9711||9733<=u&&u<=9734||u==9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u==9756||u==9758||u==9792||u==9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u==9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u==9955||9960<=u&&u<=9983||u==10045||u==10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u==65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},e.characterLength=function(n){var o=this.eastAsianWidth(n);return o=="F"||o=="W"||o=="A"?2:1};function t(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var o=t(n),r=0,u=0;u<o.length;u++)r=r+this.characterLength(o[u]);return r},e.slice=function(n,o,r){textLen=e.length(n),o=o||0,r=r||1,o<0&&(o=textLen+o),r<0&&(r=textLen+r);for(var u="",i=0,s=t(n),F=0;F<s.length;F++){var a=s[F],c=e.length(a);if(i>=o-(c==2?1:0))if(i+c<=r)u+=a;else break;i+=c}return u}})($D);var Ne=$D.exports,Te=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};function Le(D,e={}){if(typeof D!="string"||D.length===0||(e={ambiguousIsNarrow:!0,...e},D=_e(D),D.length===0))return 0;D=D.replace(Te()," ");const t=e.ambiguousIsNarrow?1:2;let n=0;for(const o of D){const r=o.codePointAt(0);if(!(r<=31||r>=127&&r<=159||r>=768&&r<=879))switch(Ne.eastAsianWidth(o)){case"F":case"W":n+=2;break;case"A":n+=t;break;default:n+=1}}return n}const Tu=D=>ve(D,{stringLength:Le}),Lu=D=>Tu(D).split(`
65
+ `),SD=new Map([[Boolean,""],[String,"string"],[Number,"number"]]),Me=(D,e=!1)=>{const t=SD.has(D)?SD.get(D):"value";return e?`[${t}]`:`<${t}>`},P=D=>{const e=[];for(const t of D){if(t.type==="block"||!t.type){const n=" ",o=t.body.map(u=>n+u);o.unshift("");const r=o.join(`
66
+ `);e.push(Tu([[b.exports.bold(`${t.title}:`)],[r]]).toString())}else if(t.type==="inline"){const n=t.items.map(r=>[b.exports.bold(`${r.title}:`),r.body]),o=Tu(n);e.push(o.toString())}e.push("")}return e.join(`
67
+ `)},ke={renderFlagName:D=>D,renderSections:D=>D,renderType:(D,e)=>Me(D,e),renderDefault:D=>JSON.stringify(D)},Ie={en:{"help.name":"Name","help.version":"Version","help.subcommand":"Subcommand","help.commands":"Commands","help.flags":"Flags","help.description":"Description","help.usage":"Usage","help.examples":"Examples","help.notes":"Notes","help.noDescription":"(No description)","help.notes.1":"If no command is specified, show help for the CLI.","help.notes.2":"If a command is specified, show help for the command.","help.notes.3":"-h is an alias for --help.","help.examples.1":"Show help","help.examples.2":"Show help for a specific command","help.commandDescription":"Show help","help.default":"Default: "},"zh-CN":{"help.name":"\u540D\u79F0","help.version":"\u7248\u672C","help.subcommand":"\u5B50\u547D\u4EE4","help.commands":"\u547D\u4EE4","help.flags":"\u6807\u5FD7","help.description":"\u63CF\u8FF0","help.usage":"\u4F7F\u7528","help.examples":"\u793A\u4F8B","help.notes":"\u5907\u6CE8","help.noDescription":"(\u65E0\u63CF\u8FF0)","help.notes.1":"\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u5C55\u793A\u54EA\u4E2A\u547D\u4EE4\u7684\u5E2E\u52A9\u4FE1\u606F\uFF0C\u9ED8\u8BA4\u5C55\u793ACLI\u7684\u3002","help.notes.2":"\u5982\u679C\u6307\u5B9A\u4E86\u5219\u5C55\u793A\u8BE5\u547D\u4EE4\u5E2E\u52A9\u4FE1\u606F\u3002","help.notes.3":"-h \u662F --help \u7684\u4E00\u4E2A\u522B\u540D\u3002","help.examples.1":"\u5C55\u793A CLI \u7684\u5E2E\u52A9\u4FE1\u606F","help.examples.2":"\u5C55\u793A\u6307\u5B9A\u547D\u4EE4\u7684\u5E2E\u52A9\u4FE1\u606F","help.commandDescription":"\u5C55\u793A\u5E2E\u52A9\u4FE1\u606F","help.default":"\u9ED8\u8BA4\u503C: %s"}},Mu=b.exports.yellow("-"),wD=D=>{process.stdout.write(D)},ku=(D,e,t)=>{const{t:n}=e.i18n,o=[{title:n("help.name"),body:b.exports.red(e._name)},{title:n("help.version"),body:b.exports.yellow(e._version)}];t&&o.push({title:n("help.subcommand"),body:b.exports.green(`${e._name} ${U(t.name)}`)}),D.push({type:"inline",items:o}),D.push({title:n("help.description"),body:[(t==null?void 0:t.description)||e._description]})},bD=(D,e,t)=>{const n=e.map(([o,r])=>[o,Mu,r]);D.push({title:t("help.examples"),body:Lu(n)})},lu=(D,e,t,n)=>{const{cli:o}=e,{t:r}=o.i18n,u=[];ku(u,o),u.push({title:r("help.usage"),body:[b.exports.magenta(`$ ${o._name} ${nD("command",e.hasRootOrAlias)} [flags]`)]});const i=[...e.hasRoot?[o._commands[B]]:[],...Object.values(o._commands)].map(s=>{const F=[typeof s.name=="symbol"?"":s.name,...Se(s.alias||[])].sort((a,c)=>a===B?-1:c===B?1:a.length-c.length).map(a=>a===""||typeof a=="symbol"?`${o._name}`:`${o._name} ${a}`).join(", ");return[b.exports.cyan(F),Mu,s.description]});return u.push({title:r("help.commands"),body:Lu(i)}),t&&u.push({title:r("help.notes"),body:t}),n&&bD(u,n,r),D(u)},Iu=(D,e,t)=>{var n;const{cli:o}=e,{t:r}=o.i18n,[u]=Xu(o._commands,t,r);if(!u)throw new su(U(t),r);const i=Object.assign({},ke,u.help);let s=[];t===B?ku(s,o):ku(s,o,{...u,name:U(t)});const F=((n=u.parameters)==null?void 0:n.join(" "))||void 0,a=t===B?"":` ${U(t)}`,c=F?` ${F}`:"",C=u.flags?" [flags]":"";return s.push({title:r("help.usage"),body:[b.exports.magenta(`$ ${o._name}${a}${c}${C}`)]}),u.flags&&s.push({title:r("help.flags"),body:Lu(Object.entries(u.flags).map(([E,l])=>{const h=l.default!==void 0;let p=[pD(E)];l.alias&&p.push(pD(l.alias)),p=p.map(i.renderFlagName);const y=[b.exports.blue(p.join(", ")),i.renderType(l.type,h)];return y.push(Mu,l.description||r("help.noDescription")),h&&y.push(`(${r("help.default",i.renderDefault(l.default))})`),y}))}),u.notes&&s.push({title:r("help.notes"),body:u.notes}),u.examples&&bD(s,u.examples,r),s=i.renderSections(s),D(s)},Re=({command:D=!0,showHelpWhenNoCommand:e=!0,notes:t,examples:n,banner:o}={})=>W({setup:r=>{const{add:u,t:i}=r.i18n;u(Ie);const s=F=>{o&&wD(`${o}
68
+ `),wD(F)};return D&&(r=r.command("help",i("help.commandDescription"),{parameters:["[command...]"],notes:[i("help.notes.1"),i("help.notes.2"),i("help.notes.3")],examples:[[`$ ${r._name} help`,i("help.examples.1")],[`$ ${r._name} help <command>`,i("help.examples.2")],[`$ ${r._name} <command> --help`,i("help.examples.2")]]}).on("help",F=>{F.parameters.command.length?s(Iu(P,F,F.parameters.command)):s(lu(P,F,t,n))})),r.inspector((F,a)=>{const c=F.raw.mergedFlags.h||F.raw.mergedFlags.help;if(!F.hasRootOrAlias&&!F.raw._.length&&e&&!c){let C=`${i("core.noCommandGiven")}
69
69
 
70
- `;p+=le(l,c,n,r),p+=`
71
- `,m(p),process.exit(1)}else d?c.raw._.length?c.called!==C&&c.name===C?m(le(l,c,n,r)):m(Oe(l,c,c.raw._)):c.hasRootOrAlias?m(Oe(l,c,C)):m(le(l,c,n,r)):h()}),i}}),bn={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},Fn=(e,{add:t,t:n})=>(t(bn),e.length<=1?e[0]:n("utils.and",e.slice(0,-1).join(", "),e[e.length-1])),L=new Uint32Array(65536),vn=(e,t)=>{const n=e.length,r=t.length,s=1<<n-1;let o=-1,i=0,u=n,a=n;for(;a--;)L[e.charCodeAt(a)]|=1<<a;for(a=0;a<r;a++){let l=L[t.charCodeAt(a)];const m=l|i;l|=(l&o)+o^o,i|=~(l|o),o&=l,i&s&&u++,o&s&&u--,i=i<<1|1,o=o<<1|~(m|i),i&=m}for(a=n;a--;)L[e.charCodeAt(a)]=0;return u},An=(e,t)=>{const n=t.length,r=e.length,s=[],o=[],i=Math.ceil(n/32),u=Math.ceil(r/32);for(let p=0;p<i;p++)o[p]=-1,s[p]=0;let a=0;for(;a<u-1;a++){let p=0,g=-1;const x=a*32,y=Math.min(32,r)+x;for(let B=x;B<y;B++)L[e.charCodeAt(B)]|=1<<B;for(let B=0;B<n;B++){const M=L[t.charCodeAt(B)],b=o[B/32|0]>>>B&1,A=s[B/32|0]>>>B&1,G=M|p,_e=((M|A)&g)+g^g|M|A;let z=p|~(_e|g),te=g&_e;z>>>31^b&&(o[B/32|0]^=1<<B),te>>>31^A&&(s[B/32|0]^=1<<B),z=z<<1|b,te=te<<1|A,g=te|~(G|z),p=z&G}for(let B=x;B<y;B++)L[e.charCodeAt(B)]=0}let l=0,m=-1;const c=a*32,h=Math.min(32,r-c)+c;for(let p=c;p<h;p++)L[e.charCodeAt(p)]|=1<<p;let d=r;for(let p=0;p<n;p++){const g=L[t.charCodeAt(p)],x=o[p/32|0]>>>p&1,y=s[p/32|0]>>>p&1,B=g|l,M=((g|y)&m)+m^m|g|y;let b=l|~(M|m),A=m&M;d+=b>>>r-1&1,d-=A>>>r-1&1,b>>>31^x&&(o[p/32|0]^=1<<p),A>>>31^y&&(s[p/32|0]^=1<<p),b=b<<1|x,A=A<<1|y,m=A|~(B|b),l=b&B}for(let p=c;p<h;p++)L[e.charCodeAt(p)]=0;return d},ft=(e,t)=>{if(e.length<t.length){const n=t;t=e,e=n}return t.length===0?e.length:e.length<=32?vn(e,t):An(e,t)};var ce=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Dn=1/0,On="[object Symbol]",_n=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tn="\\u0300-\\u036f\\ufe20-\\ufe23",Mn="\\u20d0-\\u20f0",Nn="["+Tn+Mn+"]",Ln=RegExp(Nn,"g"),In={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},kn=typeof ce=="object"&&ce&&ce.Object===Object&&ce,Rn=typeof self=="object"&&self&&self.Object===Object&&self,jn=kn||Rn||Function("return this")();function Wn(e){return function(t){return e==null?void 0:e[t]}}var Pn=Wn(In),Hn=Object.prototype,Un=Hn.toString,xt=jn.Symbol,Ct=xt?xt.prototype:void 0,Bt=Ct?Ct.toString:void 0;function Yn(e){if(typeof e=="string")return e;if(zn(e))return Bt?Bt.call(e):"";var t=e+"";return t=="0"&&1/e==-Dn?"-0":t}function Gn(e){return!!e&&typeof e=="object"}function zn(e){return typeof e=="symbol"||Gn(e)&&Un.call(e)==On}function Vn(e){return e==null?"":Yn(e)}function Zn(e){return e=Vn(e),e&&e.replace(_n,Pn).replace(Ln,"")}var qn=Zn;let v,O;(function(e){e.ALL_CLOSEST_MATCHES="all-closest-matches",e.ALL_MATCHES="all-matches",e.ALL_SORTED_MATCHES="all-sorted-matches",e.FIRST_CLOSEST_MATCH="first-closest-match",e.FIRST_MATCH="first-match"})(v||(v={})),function(e){e.EDIT_DISTANCE="edit-distance",e.SIMILARITY="similarity"}(O||(O={}));const $t=new Error("unknown returnType"),me=new Error("unknown thresholdType"),Et=(e,t)=>{let n=e;return t.trimSpaces&&(n=n.trim().replace(/\s+/g," ")),t.deburr&&(n=qn(n)),t.caseSensitive||(n=n.toLowerCase()),n},St=(e,t)=>{const{matchPath:n}=t,r=((s,o)=>{const i=o.length>0?o.reduce((u,a)=>u==null?void 0:u[a],s):s;return typeof i!="string"?"":i})(e,n);return Et(r,t)};function Jn(e,t,n){const r=(h=>{const d={caseSensitive:!1,deburr:!0,matchPath:[],returnType:v.FIRST_CLOSEST_MATCH,thresholdType:O.SIMILARITY,trimSpaces:!0,...h};switch(d.thresholdType){case O.EDIT_DISTANCE:return{threshold:20,...d};case O.SIMILARITY:return{threshold:.4,...d};default:throw me}})(n),{returnType:s,threshold:o,thresholdType:i}=r,u=Et(e,r);let a,l;switch(i){case O.EDIT_DISTANCE:a=h=>h<=o,l=h=>ft(u,St(h,r));break;case O.SIMILARITY:a=h=>h>=o,l=h=>((d,p)=>{if(!d||!p)return 0;if(d===p)return 1;const g=ft(d,p),x=Math.max(d.length,p.length);return(x-g)/x})(u,St(h,r));break;default:throw me}const m=[],c=t.length;switch(s){case v.ALL_CLOSEST_MATCHES:case v.FIRST_CLOSEST_MATCH:{const h=[];let d;switch(i){case O.EDIT_DISTANCE:d=1/0;for(let g=0;g<c;g+=1){const x=l(t[g]);d>x&&(d=x),h.push(x)}break;case O.SIMILARITY:d=0;for(let g=0;g<c;g+=1){const x=l(t[g]);d<x&&(d=x),h.push(x)}break;default:throw me}const p=h.length;for(let g=0;g<p;g+=1){const x=h[g];a(x)&&x===d&&m.push(g)}break}case v.ALL_MATCHES:for(let h=0;h<c;h+=1)a(l(t[h]))&&m.push(h);break;case v.ALL_SORTED_MATCHES:{const h=[];for(let d=0;d<c;d+=1){const p=l(t[d]);a(p)&&h.push({score:p,index:d})}switch(i){case O.EDIT_DISTANCE:h.sort((d,p)=>d.score-p.score);break;case O.SIMILARITY:h.sort((d,p)=>p.score-d.score);break;default:throw me}for(const d of h)m.push(d.index);break}case v.FIRST_MATCH:for(let h=0;h<c;h+=1)if(a(l(t[h]))){m.push(h);break}break;default:throw $t}return((h,d,p)=>{switch(p){case v.ALL_CLOSEST_MATCHES:case v.ALL_MATCHES:case v.ALL_SORTED_MATCHES:return d.map(g=>h[g]);case v.FIRST_CLOSEST_MATCH:case v.FIRST_MATCH:return d.length?h[d[0]]:null;default:throw $t}})(t,m,s)}var he={exports:{}};let Kn=pe,Qn=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Kn.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),E=(e,t,n=e)=>r=>{let s=""+r,o=s.indexOf(t,e.length);return~o?e+wt(s,t,n,o)+t:e+s+t},wt=(e,t,n,r)=>{let s=e.substring(0,r)+n,o=e.substring(r+t.length),i=o.indexOf(t);return~i?s+wt(o,t,n,i):s+o},yt=(e=Qn)=>({isColorSupported:e,reset:e?t=>`\x1B[0m${t}\x1B[0m`:String,bold:e?E("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?E("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?E("\x1B[3m","\x1B[23m"):String,underline:e?E("\x1B[4m","\x1B[24m"):String,inverse:e?E("\x1B[7m","\x1B[27m"):String,hidden:e?E("\x1B[8m","\x1B[28m"):String,strikethrough:e?E("\x1B[9m","\x1B[29m"):String,black:e?E("\x1B[30m","\x1B[39m"):String,red:e?E("\x1B[31m","\x1B[39m"):String,green:e?E("\x1B[32m","\x1B[39m"):String,yellow:e?E("\x1B[33m","\x1B[39m"):String,blue:e?E("\x1B[34m","\x1B[39m"):String,magenta:e?E("\x1B[35m","\x1B[39m"):String,cyan:e?E("\x1B[36m","\x1B[39m"):String,white:e?E("\x1B[37m","\x1B[39m"):String,gray:e?E("\x1B[90m","\x1B[39m"):String,bgBlack:e?E("\x1B[40m","\x1B[49m"):String,bgRed:e?E("\x1B[41m","\x1B[49m"):String,bgGreen:e?E("\x1B[42m","\x1B[49m"):String,bgYellow:e?E("\x1B[43m","\x1B[49m"):String,bgBlue:e?E("\x1B[44m","\x1B[49m"):String,bgMagenta:e?E("\x1B[45m","\x1B[49m"):String,bgCyan:e?E("\x1B[46m","\x1B[49m"):String,bgWhite:e?E("\x1B[47m","\x1B[49m"):String});he.exports=yt(),he.exports.createColors=yt;const Xn={en:{"notFound.possibleCommands":"Possible commands: %s.","notFound.commandNotFound":'Command "%s" not found.',"notFound.didyoumean":'Did you mean "%s"?',"notFound.commandNotRegisteredNote":"NOTE: You haven't register any command yet."},"zh-CN":{"notFound.possibleCommands":"\u53EF\u80FD\u7684\u547D\u4EE4: %s\u3002","notFound.commandNotFound":'\u672A\u627E\u5230\u547D\u4EE4 "%s"\u3002',"notFound.didyoumean":'\u4F60\u662F\u4E0D\u662F\u6307 "%s"\uFF1F',"notFound.commandNotRegisteredNote":"\u63D0\u793A: \u4F60\u8FD8\u6CA1\u6709\u6CE8\u518C\u4EFB\u4F55\u547D\u4EE4\u3002"}},er=()=>P({setup:e=>{const{t,add:n}=e.i18n;return n(Xn),e.inspector({enforce:"pre",fn:(r,s)=>{const o=Object.keys(e._commands),i=!!o.length;try{s()}catch(u){if(!(u instanceof oe||u instanceof se))throw u;if(r.raw._.length===0||u instanceof se){console.error(t("core.noCommandGiven")),i&&console.error(t("notFound.possibleCommands",Fn(o,e.i18n)));return}const a=u.commandName,l=Jn(a,o);console.error(t("notFound.commandNotFound",he.exports.strikethrough(a))),i&&l?console.error(t("notFound.didyoumean",he.exports.bold(l))):i||console.error(t("notFound.commandNotRegisteredNote")),process.stderr.write(`
72
- `),process.exit(2)}}})}}),tr={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},bt=(e,{add:t,t:n})=>(t(tr),e.length<=1?e[0]:n("utils.and",e.slice(0,-1).join(", "),e[e.length-1])),nr={en:{"strictFlags.unexpectedSingle":"Unexpected flag: %s.","strictFlags.unexpectedMore":"Unexpected flags: %s.","strictFlags.and":"%s and %s"},"zh-CN":{"strictFlags.unexpectedSingle":"\u9884\u671F\u4E4B\u5916\u7684\u6807\u5FD7: %s\u3002","strictFlags.unexpectedMore":"\u9884\u671F\u4E4B\u5916\u7684\u6807\u5FD7: %s\u3002","strictFlags.and":"%s \u548C %s"}},rr=()=>P({setup:e=>{const{add:t,t:n}=e.i18n;return t(nr),e.inspector((r,s)=>{const o=Object.keys(r.unknownFlags);if(!r.resolved||o.length===0)s();else throw o.length>1?new Error(n("strictFlags.unexpectedMore",bt(o,e.i18n))):new Error(n("strictFlags.unexpectedSingle",bt(o,e.i18n)))})}}),or=e=>e.length===0?"":e.startsWith("v")?e:`v${e}`,sr={en:{"version.commandDescription":"Show CLI version","version.notes.1":'The version string begins with a "v".'},"zh-CN":{"version.commandDescription":"\u5C55\u793A CLI \u7248\u672C","version.notes.1":'\u7248\u672C\u53F7\u5F00\u5934\u5E26\u6709 "v"\u3002'}},ir=({alias:e=["V"],command:t=!0}={})=>P({setup:n=>{const{add:r,t:s}=n.i18n;r(sr);const o=or(n._version);return t&&(n=n.command("version",s("version.commandDescription"),{notes:[s("version.notes.1")]}).on("version",()=>{process.stdout.write(o)})),n.inspector({enforce:"pre",fn:(i,u)=>{let a=!1;const l=["version",...e];for(const m of Object.keys(i.raw.mergedFlags))if(l.includes(m)){a=!0;break}a?process.stdout.write(o):u()}})}});var I={exports:{}};let ar=pe,ur=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||ar.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),S=(e,t,n=e)=>r=>{let s=""+r,o=s.indexOf(t,e.length);return~o?e+Ft(s,t,n,o)+t:e+s+t},Ft=(e,t,n,r)=>{let s=e.substring(0,r)+n,o=e.substring(r+t.length),i=o.indexOf(t);return~i?s+Ft(o,t,n,i):s+o},vt=(e=ur)=>({isColorSupported:e,reset:e?t=>`\x1B[0m${t}\x1B[0m`:String,bold:e?S("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?S("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?S("\x1B[3m","\x1B[23m"):String,underline:e?S("\x1B[4m","\x1B[24m"):String,inverse:e?S("\x1B[7m","\x1B[27m"):String,hidden:e?S("\x1B[8m","\x1B[28m"):String,strikethrough:e?S("\x1B[9m","\x1B[29m"):String,black:e?S("\x1B[30m","\x1B[39m"):String,red:e?S("\x1B[31m","\x1B[39m"):String,green:e?S("\x1B[32m","\x1B[39m"):String,yellow:e?S("\x1B[33m","\x1B[39m"):String,blue:e?S("\x1B[34m","\x1B[39m"):String,magenta:e?S("\x1B[35m","\x1B[39m"):String,cyan:e?S("\x1B[36m","\x1B[39m"):String,white:e?S("\x1B[37m","\x1B[39m"):String,gray:e?S("\x1B[90m","\x1B[39m"):String,bgBlack:e?S("\x1B[40m","\x1B[49m"):String,bgRed:e?S("\x1B[41m","\x1B[49m"):String,bgGreen:e?S("\x1B[42m","\x1B[49m"):String,bgYellow:e?S("\x1B[43m","\x1B[49m"):String,bgBlue:e?S("\x1B[44m","\x1B[49m"):String,bgMagenta:e?S("\x1B[45m","\x1B[49m"):String,bgCyan:e?S("\x1B[46m","\x1B[49m"):String,bgWhite:e?S("\x1B[47m","\x1B[49m"):String});I.exports=vt(),I.exports.createColors=vt;function lr(e){return e.split(`
73
- `).splice(1).map(t=>t.trim().replace("file://",""))}function cr(e){return`
74
- ${lr(e).map(t=>` ${t.replace(/^at ([\s\S]+) \((.+)\)/,(n,r,s)=>I.exports.gray(`at ${r} (${I.exports.cyan(s)})`))}`).join(`
75
- `)}`}function mr(e){return e.map(t=>typeof(t==null?void 0:t.stack)=="string"?`${t.message}
76
- ${cr(t.stack)}`:t)}function hr(e,t){const n=e.toUpperCase(),r=I.exports[t];return I.exports.bold(I.exports.inverse(r(` ${n} `)))}function ee(e,t,n){const r=I.exports[t],s=n!=null&&n.textColor?I.exports[n.textColor]:r,o=(n==null?void 0:n.target)||console.log;return(...i)=>{const u=mr(i);o(`${hr(e,t)} ${s(u.join(" "))}
77
- `)}}ee("log","gray"),ee("info","blue",{target:console.info}),ee("warn","yellow",{target:console.warn}),ee("success","green");const pr=ee("error","red",{target:console.error}),dr=()=>P({setup:e=>e.inspector({enforce:"pre",fn:(t,n)=>{try{n()}catch(r){pr(r.message),process.exit(1)}}})});export{nn as Clerc,Ie as CommandExistsError,ke as CommandNameConflictError,je as DescriptionNotSetError,Pe as InvalidCommandNameError,fe as LocaleNotCalledFirstError,Re as NameNotSetError,se as NoCommandGivenError,oe as NoSuchCommandError,C as Root,We as VersionNotSetError,hn as completionsPlugin,Ze as compose,sn as defineCommand,rn as defineHandler,on as defineInspector,P as definePlugin,Ke as detectLocale,H as formatCommandName,dr as friendlyErrorPlugin,yn as helpPlugin,qe as isInvalidName,er as notFoundPlugin,Ce as resolveArgv,Ye as resolveCommand,Ge as resolveCommandStrict,xe as resolveFlattenCommands,Ve as resolveParametersBeforeFlag,Xt as resolveRootCommands,ze as resolveSubcommandsByParent,rr as strictFlagsPlugin,ir as versionPlugin,Je as withBrackets};
70
+ `;C+=lu(P,F,t,n),C+=`
71
+ `,s(C),process.exit(1)}else c?F.raw._.length?F.called!==B&&F.name===B?s(lu(P,F,t,n)):s(Iu(P,F,F.raw._)):F.hasRootOrAlias?s(Iu(P,F,B)):s(lu(P,F,t,n)):a()}),r}}),je={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},We=(D,{add:e,t})=>(e(je),D.length<=1?D[0]:t("utils.and",D.slice(0,-1).join(", "),D[D.length-1])),L=new Uint32Array(65536),Pe=(D,e)=>{const t=D.length,n=e.length,o=1<<t-1;let r=-1,u=0,i=t,s=t;for(;s--;)L[D.charCodeAt(s)]|=1<<s;for(s=0;s<n;s++){let F=L[e.charCodeAt(s)];const a=F|u;F|=(F&r)+r^r,u|=~(F|r),r&=F,u&o&&i++,r&o&&i--,u=u<<1|1,r=r<<1|~(a|u),u&=a}for(s=t;s--;)L[D.charCodeAt(s)]=0;return i},He=(D,e)=>{const t=e.length,n=D.length,o=[],r=[],u=Math.ceil(t/32),i=Math.ceil(n/32);for(let l=0;l<u;l++)r[l]=-1,o[l]=0;let s=0;for(;s<i-1;s++){let l=0,h=-1;const p=s*32,y=Math.min(32,n)+p;for(let A=p;A<y;A++)L[D.charCodeAt(A)]|=1<<A;for(let A=0;A<t;A++){const H=L[e.charCodeAt(A)],N=r[A/32|0]>>>A&1,O=o[A/32|0]>>>A&1,Ru=H|l,ju=((H|O)&h)+h^h|H|O;let z=l|~(ju|h),nu=h&ju;z>>>31^N&&(r[A/32|0]^=1<<A),nu>>>31^O&&(o[A/32|0]^=1<<A),z=z<<1|N,nu=nu<<1|O,h=nu|~(Ru|z),l=z&Ru}for(let A=p;A<y;A++)L[D.charCodeAt(A)]=0}let F=0,a=-1;const c=s*32,C=Math.min(32,n-c)+c;for(let l=c;l<C;l++)L[D.charCodeAt(l)]|=1<<l;let E=n;for(let l=0;l<t;l++){const h=L[e.charCodeAt(l)],p=r[l/32|0]>>>l&1,y=o[l/32|0]>>>l&1,A=h|F,H=((h|y)&a)+a^a|h|y;let N=F|~(H|a),O=a&H;E+=N>>>n-1&1,E-=O>>>n-1&1,N>>>31^p&&(r[l/32|0]^=1<<l),O>>>31^y&&(o[l/32|0]^=1<<l),N=N<<1|p,O=O<<1|y,a=O|~(A|N),F=N&A}for(let l=c;l<C;l++)L[D.charCodeAt(l)]=0;return E},yD=(D,e)=>{if(D.length<e.length){const t=e;e=D,D=t}return e.length===0?D.length:D.length<=32?Pe(D,e):He(D,e)};var cu=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Ue=1/0,Ye="[object Symbol]",Ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ze="\\u0300-\\u036f\\ufe20-\\ufe23",Ve="\\u20d0-\\u20f0",Ze="["+ze+Ve+"]",qe=RegExp(Ze,"g"),Je={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},Ke=typeof cu=="object"&&cu&&cu.Object===Object&&cu,Qe=typeof self=="object"&&self&&self.Object===Object&&self,Xe=Ke||Qe||Function("return this")();function ut(D){return function(e){return D==null?void 0:D[e]}}var Dt=ut(Je),et=Object.prototype,tt=et.toString,vD=Xe.Symbol,OD=vD?vD.prototype:void 0,_D=OD?OD.toString:void 0;function nt(D){if(typeof D=="string")return D;if(ot(D))return _D?_D.call(D):"";var e=D+"";return e=="0"&&1/D==-Ue?"-0":e}function rt(D){return!!D&&typeof D=="object"}function ot(D){return typeof D=="symbol"||rt(D)&&tt.call(D)==Ye}function st(D){return D==null?"":nt(D)}function it(D){return D=st(D),D&&D.replace(Ge,Dt).replace(qe,"")}var Ft=it;let S,v;(function(D){D.ALL_CLOSEST_MATCHES="all-closest-matches",D.ALL_MATCHES="all-matches",D.ALL_SORTED_MATCHES="all-sorted-matches",D.FIRST_CLOSEST_MATCH="first-closest-match",D.FIRST_MATCH="first-match"})(S||(S={})),function(D){D.EDIT_DISTANCE="edit-distance",D.SIMILARITY="similarity"}(v||(v={}));const ND=new Error("unknown returnType"),Eu=new Error("unknown thresholdType"),TD=(D,e)=>{let t=D;return e.trimSpaces&&(t=t.trim().replace(/\s+/g," ")),e.deburr&&(t=Ft(t)),e.caseSensitive||(t=t.toLowerCase()),t},LD=(D,e)=>{const{matchPath:t}=e,n=((o,r)=>{const u=r.length>0?r.reduce((i,s)=>i==null?void 0:i[s],o):o;return typeof u!="string"?"":u})(D,t);return TD(n,e)};function at(D,e,t){const n=(C=>{const E={caseSensitive:!1,deburr:!0,matchPath:[],returnType:S.FIRST_CLOSEST_MATCH,thresholdType:v.SIMILARITY,trimSpaces:!0,...C};switch(E.thresholdType){case v.EDIT_DISTANCE:return{threshold:20,...E};case v.SIMILARITY:return{threshold:.4,...E};default:throw Eu}})(t),{returnType:o,threshold:r,thresholdType:u}=n,i=TD(D,n);let s,F;switch(u){case v.EDIT_DISTANCE:s=C=>C<=r,F=C=>yD(i,LD(C,n));break;case v.SIMILARITY:s=C=>C>=r,F=C=>((E,l)=>{if(!E||!l)return 0;if(E===l)return 1;const h=yD(E,l),p=Math.max(E.length,l.length);return(p-h)/p})(i,LD(C,n));break;default:throw Eu}const a=[],c=e.length;switch(o){case S.ALL_CLOSEST_MATCHES:case S.FIRST_CLOSEST_MATCH:{const C=[];let E;switch(u){case v.EDIT_DISTANCE:E=1/0;for(let h=0;h<c;h+=1){const p=F(e[h]);E>p&&(E=p),C.push(p)}break;case v.SIMILARITY:E=0;for(let h=0;h<c;h+=1){const p=F(e[h]);E<p&&(E=p),C.push(p)}break;default:throw Eu}const l=C.length;for(let h=0;h<l;h+=1){const p=C[h];s(p)&&p===E&&a.push(h)}break}case S.ALL_MATCHES:for(let C=0;C<c;C+=1)s(F(e[C]))&&a.push(C);break;case S.ALL_SORTED_MATCHES:{const C=[];for(let E=0;E<c;E+=1){const l=F(e[E]);s(l)&&C.push({score:l,index:E})}switch(u){case v.EDIT_DISTANCE:C.sort((E,l)=>E.score-l.score);break;case v.SIMILARITY:C.sort((E,l)=>l.score-E.score);break;default:throw Eu}for(const E of C)a.push(E.index);break}case S.FIRST_MATCH:for(let C=0;C<c;C+=1)if(s(F(e[C]))){a.push(C);break}break;default:throw ND}return((C,E,l)=>{switch(l){case S.ALL_CLOSEST_MATCHES:case S.ALL_MATCHES:case S.ALL_SORTED_MATCHES:return E.map(h=>C[h]);case S.FIRST_CLOSEST_MATCH:case S.FIRST_MATCH:return E.length?C[E[0]]:null;default:throw ND}})(e,a,o)}var mu={exports:{}};let Ct=hu,lt=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Ct.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),g=(D,e,t=D)=>n=>{let o=""+n,r=o.indexOf(e,D.length);return~r?D+MD(o,e,t,r)+e:D+o+e},MD=(D,e,t,n)=>{let o=D.substring(0,n)+t,r=D.substring(n+e.length),u=r.indexOf(e);return~u?o+MD(r,e,t,u):o+r},kD=(D=lt)=>({isColorSupported:D,reset:D?e=>`\x1B[0m${e}\x1B[0m`:String,bold:D?g("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:D?g("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:D?g("\x1B[3m","\x1B[23m"):String,underline:D?g("\x1B[4m","\x1B[24m"):String,inverse:D?g("\x1B[7m","\x1B[27m"):String,hidden:D?g("\x1B[8m","\x1B[28m"):String,strikethrough:D?g("\x1B[9m","\x1B[29m"):String,black:D?g("\x1B[30m","\x1B[39m"):String,red:D?g("\x1B[31m","\x1B[39m"):String,green:D?g("\x1B[32m","\x1B[39m"):String,yellow:D?g("\x1B[33m","\x1B[39m"):String,blue:D?g("\x1B[34m","\x1B[39m"):String,magenta:D?g("\x1B[35m","\x1B[39m"):String,cyan:D?g("\x1B[36m","\x1B[39m"):String,white:D?g("\x1B[37m","\x1B[39m"):String,gray:D?g("\x1B[90m","\x1B[39m"):String,bgBlack:D?g("\x1B[40m","\x1B[49m"):String,bgRed:D?g("\x1B[41m","\x1B[49m"):String,bgGreen:D?g("\x1B[42m","\x1B[49m"):String,bgYellow:D?g("\x1B[43m","\x1B[49m"):String,bgBlue:D?g("\x1B[44m","\x1B[49m"):String,bgMagenta:D?g("\x1B[45m","\x1B[49m"):String,bgCyan:D?g("\x1B[46m","\x1B[49m"):String,bgWhite:D?g("\x1B[47m","\x1B[49m"):String});mu.exports=kD(),mu.exports.createColors=kD;const ct={en:{"notFound.possibleCommands":"Possible commands: %s.","notFound.commandNotFound":'Command "%s" not found.',"notFound.didyoumean":'Did you mean "%s"?',"notFound.commandNotRegisteredNote":"NOTE: You haven't register any command yet."},"zh-CN":{"notFound.possibleCommands":"\u53EF\u80FD\u7684\u547D\u4EE4: %s\u3002","notFound.commandNotFound":'\u672A\u627E\u5230\u547D\u4EE4 "%s"\u3002',"notFound.didyoumean":'\u4F60\u662F\u4E0D\u662F\u6307 "%s"\uFF1F',"notFound.commandNotRegisteredNote":"\u63D0\u793A: \u4F60\u8FD8\u6CA1\u6709\u6CE8\u518C\u4EFB\u4F55\u547D\u4EE4\u3002"}},Et=()=>W({setup:D=>{const{t:e,add:t}=D.i18n;return t(ct),D.inspector({enforce:"pre",fn:(n,o)=>{const r=Object.keys(D._commands),u=!!r.length;try{o()}catch(i){if(!(i instanceof su||i instanceof iu))throw i;if(n.raw._.length===0||i instanceof iu){console.error(e("core.noCommandGiven")),u&&console.error(e("notFound.possibleCommands",We(r,D.i18n)));return}const s=i.commandName,F=at(s,r);console.error(e("notFound.commandNotFound",mu.exports.strikethrough(s))),u&&F?console.error(e("notFound.didyoumean",mu.exports.bold(F))):u||console.error(e("notFound.commandNotRegisteredNote")),process.stderr.write(`
72
+ `),process.exit(2)}}})}}),mt={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},ID=(D,{add:e,t})=>(e(mt),D.length<=1?D[0]:t("utils.and",D.slice(0,-1).join(", "),D[D.length-1])),ht={en:{"strictFlags.unexpectedSingle":"Unexpected flag: %s.","strictFlags.unexpectedMore":"Unexpected flags: %s.","strictFlags.and":"%s and %s"},"zh-CN":{"strictFlags.unexpectedSingle":"\u9884\u671F\u4E4B\u5916\u7684\u6807\u5FD7: %s\u3002","strictFlags.unexpectedMore":"\u9884\u671F\u4E4B\u5916\u7684\u6807\u5FD7: %s\u3002","strictFlags.and":"%s \u548C %s"}},Bt=()=>W({setup:D=>{const{add:e,t}=D.i18n;return e(ht),D.inspector((n,o)=>{const r=Object.keys(n.unknownFlags);if(!n.resolved||r.length===0)o();else throw r.length>1?new Error(t("strictFlags.unexpectedMore",ID(r,D.i18n))):new Error(t("strictFlags.unexpectedSingle",ID(r,D.i18n)))})}}),pt=D=>D.length===0?"":D.startsWith("v")?D:`v${D}`,dt={en:{"version.commandDescription":"Show CLI version","version.notes.1":'The version string begins with a "v".'},"zh-CN":{"version.commandDescription":"\u5C55\u793A CLI \u7248\u672C","version.notes.1":'\u7248\u672C\u53F7\u5F00\u5934\u5E26\u6709 "v"\u3002'}},gt=({alias:D=["V"],command:e=!0}={})=>W({setup:t=>{const{add:n,t:o}=t.i18n;n(dt);const r=pt(t._version);return e&&(t=t.command("version",o("version.commandDescription"),{notes:[o("version.notes.1")]}).on("version",()=>{process.stdout.write(r)})),t.inspector({enforce:"pre",fn:(u,i)=>{let s=!1;const F=["version",...D];for(const a of Object.keys(u.raw.mergedFlags))if(F.includes(a)){s=!0;break}s?process.stdout.write(r):i()}})}});var M={exports:{}};let ft=hu,At=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||ft.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),f=(D,e,t=D)=>n=>{let o=""+n,r=o.indexOf(e,D.length);return~r?D+RD(o,e,t,r)+e:D+o+e},RD=(D,e,t,n)=>{let o=D.substring(0,n)+t,r=D.substring(n+e.length),u=r.indexOf(e);return~u?o+RD(r,e,t,u):o+r},jD=(D=At)=>({isColorSupported:D,reset:D?e=>`\x1B[0m${e}\x1B[0m`:String,bold:D?f("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:D?f("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:D?f("\x1B[3m","\x1B[23m"):String,underline:D?f("\x1B[4m","\x1B[24m"):String,inverse:D?f("\x1B[7m","\x1B[27m"):String,hidden:D?f("\x1B[8m","\x1B[28m"):String,strikethrough:D?f("\x1B[9m","\x1B[29m"):String,black:D?f("\x1B[30m","\x1B[39m"):String,red:D?f("\x1B[31m","\x1B[39m"):String,green:D?f("\x1B[32m","\x1B[39m"):String,yellow:D?f("\x1B[33m","\x1B[39m"):String,blue:D?f("\x1B[34m","\x1B[39m"):String,magenta:D?f("\x1B[35m","\x1B[39m"):String,cyan:D?f("\x1B[36m","\x1B[39m"):String,white:D?f("\x1B[37m","\x1B[39m"):String,gray:D?f("\x1B[90m","\x1B[39m"):String,bgBlack:D?f("\x1B[40m","\x1B[49m"):String,bgRed:D?f("\x1B[41m","\x1B[49m"):String,bgGreen:D?f("\x1B[42m","\x1B[49m"):String,bgYellow:D?f("\x1B[43m","\x1B[49m"):String,bgBlue:D?f("\x1B[44m","\x1B[49m"):String,bgMagenta:D?f("\x1B[45m","\x1B[49m"):String,bgCyan:D?f("\x1B[46m","\x1B[49m"):String,bgWhite:D?f("\x1B[47m","\x1B[49m"):String});M.exports=jD(),M.exports.createColors=jD;function xt(D){return D.split(`
73
+ `).splice(1).map(e=>e.trim().replace("file://",""))}function $t(D){return`
74
+ ${xt(D).map(e=>` ${e.replace(/^at ([\s\S]+) \((.+)\)/,(t,n,o)=>M.exports.gray(`at ${n} (${M.exports.cyan(o)})`))}`).join(`
75
+ `)}`}function St(D){return D.map(e=>typeof(e==null?void 0:e.stack)=="string"?`${e.message}
76
+ ${$t(e.stack)}`:e)}function wt(D,e){const t=D.toUpperCase(),n=M.exports[e];return M.exports.bold(M.exports.inverse(n(` ${t} `)))}function tu(D,e,t){const n=M.exports[e],o=t!=null&&t.textColor?M.exports[t.textColor]:n,r=(t==null?void 0:t.target)||console.log;return(...u)=>{const i=St(u);r(`${wt(D,e)} ${o(i.join(" "))}
77
+ `)}}tu("log","gray"),tu("info","blue",{target:console.info}),tu("warn","yellow",{target:console.warn}),tu("success","green");const bt=tu("error","red",{target:console.error}),yt=()=>W({setup:D=>D.errorHandler(e=>{bt(e.message),process.exit(1)})});export{me as Clerc,Yu as CommandExistsError,Gu as CommandNameConflictError,Vu as DescriptionNotSetError,qu as InvalidCommandNameError,du as LocaleNotCalledFirstError,zu as NameNotSetError,iu as NoCommandGivenError,su as NoSuchCommandError,B as Root,Zu as VersionNotSetError,$e as completionsPlugin,eD as compose,pe as defineCommand,he as defineHandler,Be as defineInspector,W as definePlugin,rD as detectLocale,U as formatCommandName,yt as friendlyErrorPlugin,Re as helpPlugin,tD as isValidName,Et as notFoundPlugin,fu as resolveArgv,Qu as resolveCommand,Xu as resolveCommandStrict,gu as resolveFlattenCommands,DD as resolveParametersBeforeFlag,Ce as resolveRootCommands,uD as resolveSubcommandsByParent,Bt as strictFlagsPlugin,gt as versionPlugin,nD as withBrackets};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "clerc",
3
- "version": "0.29.0",
4
- "author": "Ray <nn_201312@163.com> (https://github.com/so1ve)",
3
+ "version": "0.30.1",
4
+ "author": "Ray <i@mk1.io> (https://github.com/so1ve)",
5
5
  "description": "Clerc: The full-featured cli framework.",
6
6
  "keywords": [
7
7
  "cli",
@@ -47,13 +47,13 @@
47
47
  "access": "public"
48
48
  },
49
49
  "devDependencies": {
50
- "@clerc/core": "0.29.0",
51
- "@clerc/plugin-help": "0.29.0",
52
- "@clerc/plugin-friendly-error": "0.29.0",
53
- "@clerc/plugin-completions": "0.29.0",
54
- "@clerc/plugin-strict-flags": "0.29.0",
55
- "@clerc/plugin-version": "0.29.0",
56
- "@clerc/plugin-not-found": "0.29.0"
50
+ "@clerc/core": "0.30.1",
51
+ "@clerc/plugin-completions": "0.30.1",
52
+ "@clerc/plugin-friendly-error": "0.30.1",
53
+ "@clerc/plugin-not-found": "0.30.1",
54
+ "@clerc/plugin-help": "0.30.1",
55
+ "@clerc/plugin-strict-flags": "0.30.1",
56
+ "@clerc/plugin-version": "0.30.1"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "puild --minify",