@longzai-intelligence-docs/cli 0.0.17 → 0.0.18

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -144,7 +144,7 @@ function Zo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...N(n)})}//
144
144
  function Qo(e,t){let n=/* @__PURE__ */ $o(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(ln(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(ln(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
145
145
  function $o(e,t){let n=new Fr({check:`custom`,...N(t)});return n._zod.check=e,n}function es(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&bt(e,t,n[t]);return e}function ts(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Ja,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function ns(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function R(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,R(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&es(o.schema,c),t.io===`input`&&z(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function rs(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function is(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${rs(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+rs(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
146
146
 
147
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function as(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;as(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const os=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),ss=[`oneOf`,`anyOf`];function cs(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function ls(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!os.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??cs(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}bt(n,r,e.length===1?e[0]:ls(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=cs(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function us(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of os)if(t in e)return;let n=t.filter(e=>ss.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ls(t);else{let e=n[0],i=ss.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>ls([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,es(e,r))}function ds(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):es(i,s),es(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())as(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])us(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}es(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,bt(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ps(t,`input`,e.processors),output:ps(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function z(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return z(r.element,n);if(r.type===`set`)return z(r.valueType,n);if(r.type===`lazy`)return z(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return z(r.innerType,n);if(r.type===`intersection`)return z(r.left,n)||z(r.right,n);if(r.type===`record`||r.type===`map`)return z(r.keyType,n)||z(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:z(r.in,n)||z(r.out,n);if(r.type===`object`){for(let e in r.shape)if(z(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(z(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(z(e,n))return!0;return!!(r.rest&&z(r.rest,n))}return!1}const fs=(e,t={})=>n=>{let r=ts({...n,processors:t});return R(e,r),is(r,e),ds(r,e)},ps=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ts({...i??{},target:a,io:t,processors:n});return R(e,o),is(o,e),ds(o,e)},ms=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},hs=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},gs=(e,t)=>{ms(e,`minimum`,t),hs(e,`maximum`,t)},_s=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},vs=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},ys=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},bs=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},xs=(e,t)=>ms(e,`minimum`,t.minimum),Ss=(e,t)=>hs(e,`maximum`,t.maximum),Cs=e=>(t,n)=>{bs(t,n.format);let[r,i]=e[n.format];ms(t,`minimum`,r),hs(t,`maximum`,i)},ws={greater_than:(e,t)=>ms(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>hs(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>_s(e,t.value),number_format:Cs(Bt),bigint_format:Cs(Vt),min_length:xs,max_length:Ss,length_equals:(e,t)=>gs(e,t.length),min_size:xs,max_size:Ss,size_equals:(e,t)=>gs(e,t.size),string_format:(e,t)=>{bs(e,t.format),t.pattern&&vs(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>ys(e,t.mime)};function Ts(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ws[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&ms(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&ms(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&hs(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&hs(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&_s(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ys(t,i.mime);for(let e of i.patterns??[])vs(t,e);return t}const Es={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ds=/* @__PURE__ */ new Map([[Fi,yr],[Li,br]]),Os=e=>Ds.get(e)??e,ks=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Ts(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Es[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Os);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},As=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Ts(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):ns(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},js=(e,t,n,r)=>{n.type=`boolean`},Ms=(e,t,n,r)=>{n.not={}},Ns=(e,t,n,r)=>{let i=e._zod.def,a=ft(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Ps=(e,t,n,r)=>{ns(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Fs=(e,t,n,r)=>{ns(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Is=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Ts(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=R(a.element,t,{...r,path:[...r.path,`items`]})};function Ls(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Ls(t.out):t.type===`catch`?Ls(t.innerType):e._zod.optin}const Rs=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&ns(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)bt(i.properties,e,R(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Ls(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=R(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},zs=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>R(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Bs=(e,t,n,r)=>{let i=e._zod.def,a=R(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=R(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Vs(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Vs(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Vs(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?jr:Ar).source)),p}const Hs=/* @__PURE__ */ new WeakMap;function Us(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of Hs.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Vs(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const Ws=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Ts(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=R(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)bt(i.patternProperties,Os(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=R(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Hs.get(t);n||(n=[],Hs.set(t,n),t.deferred.push(()=>Us(t))),n.push(e)}i.additionalProperties=R(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Ls(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Gs=(e,t,n,r)=>{let i=e._zod.def,a=R(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ks=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qs=Symbol();function Js(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(ns(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),qs):JSON.parse(o)}const Ys=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Js(i.defaultValue,e,t,n,r);o!==qs&&(n.default=o)},Xs=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Js(i.defaultValue,e,t,n,r);o!==qs&&(n._prefault=o)},Zs=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{ns(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Qs=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;R(o,t,r);let s=t.seen.get(e);s.ref=o},$s=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ec=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},tc=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function nc(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const rc=/*@__PURE__*/ F(`ZodError`,(e,t)=>{Pn.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);tc.has(n)||(tc.add(n),nc(n,`format`,e=>t=>Ln(e,t)),nc(n,`flatten`,e=>t=>In(e,t)),nc(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,mt,2)}),nc(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,mt,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ic=/* @__PURE__ */ zn(rc),ac=/* @__PURE__ */ Bn(rc),oc=/* @__PURE__ */ Vn(rc),sc=/* @__PURE__ */ Un(rc),cc=/* @__PURE__ */ Yn(rc),lc=/* @__PURE__ */ Xn(rc),uc=/* @__PURE__ */ Zn(rc),dc=/* @__PURE__ */ Qn(rc),fc=/* @__PURE__ */ $n(rc),pc=/* @__PURE__ */ er(rc),mc=/* @__PURE__ */ tr(rc),hc=/* @__PURE__ */ nr(rc);function gc(){Dn.localeError||On(Wa())}function _c(){Dn.memoizer||On({memoizer:Va()})}const B=/*@__PURE__*/ F(`ZodType`,(e,t)=>(gc(),I.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Dt(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Lt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ml(e,t))},superRefine(e,t){return this.check(Nl(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Uo(e))},optional(){return pl(this)},exactOptional(){return hl(this)},nullable(){return _l(this)},nullish(){return pl(_l(this))},nonoptional(e){return Cl(this,e)},array(){return U(this)},or(e){return rl([this,e])},and(e){return al(this,e)},transform(e){return Dl(this,dl(e))},default(e){return yl(this,e)},prefault(e){return xl(this,e)},catch(e){return Tl(this,e)},pipe(e){return Dl(this,e)},readonly(){return kl(this)},describe(e){let t=this.clone();return Ja.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ja.get(this);let t=this.clone();return Ja.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return fn(this,`~standard`,{...ri(this),jsonSchema:{input:ps(this,`input`),output:ps(this,`output`)}})},set"~standard"(e){dn(this,`~standard`,e)},parse:function e(t,n){return ic(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ac(this,t,n,{callee:e})},safeParse(e,t){return oc(this,e,t)},async safeParseAsync(e,t){return sc(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){dn(this,`spa`,e)},validate(e,t){return Kn(this,e,t)},validateAsync(e,t){return Jn(this,e,t)},encode:function e(t,n){return cc(this,t,n,{callee:e})},decode:function e(t,n){return lc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await uc(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await dc(this,t,n,{callee:e})},safeEncode(e,t){return fc(this,e,t)},safeDecode(e,t){return pc(this,e,t)},async safeEncodeAsync(e,t){return mc(this,e,t)},async safeDecodeAsync(e,t){return hc(this,e,t)},toJSONSchema(e){return fs(this,{})(e)},get description(){return Ja.get(this)?.description},get _def(){return this._zod.def}}),vc=/*@__PURE__*/ F(`_ZodString`,(e,t)=>{ii.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ks(e,t,n,r)},/*@__PURE__*/ pn({format:e=>Ts(e).format??null,minLength:e=>Ts(e).minimum??null,maxLength:e=>Ts(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Lo(...e))},includes(...e){return this.check(/* @__PURE__ */ Bo(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Vo(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Ho(...e))},min(...e){return this.check(/* @__PURE__ */ Fo(...e))},max(...e){return this.check(/* @__PURE__ */ Po(...e))},length(...e){return this.check(/* @__PURE__ */ Io(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Fo(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Ro(e))},uppercase(e){return this.check(/* @__PURE__ */ zo(e))},trim(){return this.check(/* @__PURE__ */ Go())},normalize(...e){return this.check(/* @__PURE__ */ Wo(...e))},toLowerCase(){return this.check(/* @__PURE__ */ Ko())},toUpperCase(){return this.check(/* @__PURE__ */ qo())},slugify(){return this.check(/* @__PURE__ */ Jo())}})),yc=/*@__PURE__*/ F(`ZodString`,(e,t)=>{ii.init(e,t),vc.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Za(wc,e))},url(e){return this.check(/* @__PURE__ */ ro(Dc,e))},jwt(e){return this.check(/* @__PURE__ */ yo(Hc,e))},emoji(e){return this.check(/* @__PURE__ */ io(Oc,e))},guid(e){return this.check(/* @__PURE__ */ Qa(Tc,e))},uuid(e){return this.check(/* @__PURE__ */ $a(Ec,e))},uuidv4(e){return this.check(/* @__PURE__ */ eo(Ec,e))},uuidv6(e){return this.check(/* @__PURE__ */ to(Ec,e))},uuidv7(e){return this.check(/* @__PURE__ */ no(Ec,e))},nanoid(e){return this.check(/* @__PURE__ */ ao(kc,e))},cuid(e){return this.check(/* @__PURE__ */ oo(Ac,e))},cuid2(e){return this.check(/* @__PURE__ */ so(jc,e))},ulid(e){return this.check(/* @__PURE__ */ co(Mc,e))},base64(e){return this.check(/* @__PURE__ */ go(zc,e))},base64url(e){return this.check(/* @__PURE__ */ _o(Bc,e))},xid(e){return this.check(/* @__PURE__ */ lo(Nc,e))},ksuid(e){return this.check(/* @__PURE__ */ uo(Pc,e))},ipv4(e){return this.check(/* @__PURE__ */ fo(Fc,e))},ipv6(e){return this.check(/* @__PURE__ */ po(Ic,e))},cidrv4(e){return this.check(/* @__PURE__ */ mo(Lc,e))},cidrv6(e){return this.check(/* @__PURE__ */ ho(Rc,e))},e164(e){return this.check(/* @__PURE__ */ vo(Vc,e))},datetime(e){return this.check(/* @__PURE__ */ bo(bc,e))},date(e){return this.check(/* @__PURE__ */ xo(xc,e))},time(e){return this.check(/* @__PURE__ */ So(Sc,e))},duration(e){return this.check(/* @__PURE__ */ Co(Cc,e))}});function V(e){return/* @__PURE__ */ Xa(yc,e)}const H=/*@__PURE__*/ F(`ZodStringFormat`,(e,t)=>{L.init(e,t),vc.init(e,t)}),bc=/*@__PURE__*/ F(`ZodISODateTime`,(e,t)=>{Ci.init(e,t),H.init(e,t)}),xc=/*@__PURE__*/ F(`ZodISODate`,(e,t)=>{wi.init(e,t),H.init(e,t)}),Sc=/*@__PURE__*/ F(`ZodISOTime`,(e,t)=>{Ti.init(e,t),H.init(e,t)}),Cc=/*@__PURE__*/ F(`ZodISODuration`,(e,t)=>{Ei.init(e,t),H.init(e,t)}),wc=/*@__PURE__*/ F(`ZodEmail`,(e,t)=>{si.init(e,t),H.init(e,t)}),Tc=/*@__PURE__*/ F(`ZodGUID`,(e,t)=>{ai.init(e,t),H.init(e,t)}),Ec=/*@__PURE__*/ F(`ZodUUID`,(e,t)=>{oi.init(e,t),H.init(e,t)}),Dc=/*@__PURE__*/ F(`ZodURL`,(e,t)=>{hi.init(e,t),H.init(e,t)}),Oc=/*@__PURE__*/ F(`ZodEmoji`,(e,t)=>{gi.init(e,t),H.init(e,t)}),kc=/*@__PURE__*/ F(`ZodNanoID`,(e,t)=>{_i.init(e,t),H.init(e,t)}),Ac=/*@__PURE__*/ F(`ZodCUID`,(e,t)=>{vi.init(e,t),H.init(e,t)}),jc=/*@__PURE__*/ F(`ZodCUID2`,(e,t)=>{yi.init(e,t),H.init(e,t)}),Mc=/*@__PURE__*/ F(`ZodULID`,(e,t)=>{bi.init(e,t),H.init(e,t)}),Nc=/*@__PURE__*/ F(`ZodXID`,(e,t)=>{xi.init(e,t),H.init(e,t)}),Pc=/*@__PURE__*/ F(`ZodKSUID`,(e,t)=>{Si.init(e,t),H.init(e,t)}),Fc=/*@__PURE__*/ F(`ZodIPv4`,(e,t)=>{Di.init(e,t),H.init(e,t)}),Ic=/*@__PURE__*/ F(`ZodIPv6`,(e,t)=>{Ai.init(e,t),H.init(e,t)}),Lc=/*@__PURE__*/ F(`ZodCIDRv4`,(e,t)=>{ji.init(e,t),H.init(e,t)}),Rc=/*@__PURE__*/ F(`ZodCIDRv6`,(e,t)=>{Ni.init(e,t),H.init(e,t)}),zc=/*@__PURE__*/ F(`ZodBase64`,(e,t)=>{Ii.init(e,t),H.init(e,t)}),Bc=/*@__PURE__*/ F(`ZodBase64URL`,(e,t)=>{zi.init(e,t),H.init(e,t)}),Vc=/*@__PURE__*/ F(`ZodE164`,(e,t)=>{Bi.init(e,t),H.init(e,t)}),Hc=/*@__PURE__*/ F(`ZodJWT`,(e,t)=>{Hi.init(e,t),H.init(e,t)}),Uc=/*@__PURE__*/ F(`ZodNumber`,(e,t)=>{Ui.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>As(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ pn({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Ts(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Ts(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Ts(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Ts(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ jo(e,t))},gte(e,t){return this.check(/* @__PURE__ */ Mo(e,t))},min(e,t){return this.check(/* @__PURE__ */ Mo(e,t))},lt(e,t){return this.check(/* @__PURE__ */ ko(e,t))},lte(e,t){return this.check(/* @__PURE__ */ Ao(e,t))},max(e,t){return this.check(/* @__PURE__ */ Ao(e,t))},int(e){return this.check(Kc(e))},safe(e){return this.check(Kc(e))},positive(e){return this.check(/* @__PURE__ */ jo(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ Mo(0,e))},negative(e){return this.check(/* @__PURE__ */ ko(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ Ao(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ No(e,t))},step(e,t){return this.check(/* @__PURE__ */ No(e,t))},finite(){return this}}));function Wc(e){return/* @__PURE__ */ wo(Uc,e)}const Gc=/*@__PURE__*/ F(`ZodNumberFormat`,(e,t)=>{Wi.init(e,t),Uc.init(e,t)});function Kc(e){return/* @__PURE__ */ To(Gc,e)}const qc=/*@__PURE__*/ F(`ZodBoolean`,(e,t)=>{Gi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r)});function Jc(e){return/* @__PURE__ */ Eo(qc,e)}const Yc=/*@__PURE__*/ F(`ZodUnknown`,(e,t)=>{Ki.init(e,t),B.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Xc(){return/* @__PURE__ */ Do(Yc)}const Zc=/*@__PURE__*/ F(`ZodNever`,(e,t)=>{qi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r)});function Qc(e){return/* @__PURE__ */ Oo(Zc,e)}const $c=/*@__PURE__*/ F(`ZodArray`,(e,t)=>{_c(),Zi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Fo(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Fo(1,e))},max(e,t){return this.check(/* @__PURE__ */ Po(e,t))},length(e,t){return this.check(/* @__PURE__ */ Io(e,t))},unwrap(){return this.element}});function U(e,t){return/* @__PURE__ */ Yo($c,e,t)}const el=/*@__PURE__*/ F(`ZodObject`,(e,t)=>{_c(),ra.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),yn(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return ll(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Dt(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Dt(this._zod.def,{catchall:Xc()}))},loose(){return this.clone(Dt(this._zod.def,{catchall:Xc()}))},strict(){return this.clone(Dt(this._zod.def,{catchall:Qc()}))},strip(){return this.clone(Dt(this._zod.def,{catchall:void 0}))},extend(e){return Gt(this,e)},safeExtend(e){return qt(this,e)},merge(e){return Jt(this,e)},pick(e){return Ht(this,e)},omit(e){return Wt(this,e)},partial(...e){return Yt(fl,this,e[0])},exactPartial(...e){return Yt(ml,this,e[0],`exactPartial`)},required(...e){return Xt(Sl,this,e[0])}});function W(e,t){let n={type:`object`,shape:e??{},...N(t)};return new el(n)}function tl(e,t){return new el({type:`object`,shape:e,catchall:Qc(),...N(t)})}const nl=/*@__PURE__*/ F(`ZodUnion`,(e,t)=>{aa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zs(e,t,n,r),e.options=t.options});function rl(e,t){return new nl({type:`union`,options:e,...N(t)})}const il=/*@__PURE__*/ F(`ZodIntersection`,(e,t)=>{oa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(e,t,n,r)});function al(e,t){return new il({type:`intersection`,left:e,right:t})}const ol=/*@__PURE__*/ F(`ZodRecord`,(e,t)=>{_c(),la.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ws(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function sl(e,t,n){return!t||!t._zod?new ol({type:`record`,keyType:V(),valueType:e,...N(t)}):new ol({type:`record`,keyType:e,valueType:t,...N(n)})}const cl=/*@__PURE__*/ F(`ZodEnum`,(e,t)=>{ua.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ns(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new cl({...t,checks:[],...N(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new cl({...t,checks:[],...N(r),entries:i})}});function ll(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new cl({type:`enum`,entries:n,...N(t)})}const ul=/*@__PURE__*/ F(`ZodTransform`,(e,t)=>{_c(),da.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fs(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new En(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ln(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(ln(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function dl(e){return new ul({type:`transform`,transform:e})}const fl=/*@__PURE__*/ F(`ZodOptional`,(e,t)=>{pa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ec(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pl(e){return new fl({type:`optional`,innerType:e})}const ml=/*@__PURE__*/ F(`ZodExactOptional`,(e,t)=>{ma.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ec(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hl(e){return new ml({type:`optional`,innerType:e})}const gl=/*@__PURE__*/ F(`ZodNullable`,(e,t)=>{ha.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _l(e){return new gl({type:`nullable`,innerType:e})}const vl=/*@__PURE__*/ F(`ZodDefault`,(e,t)=>{ga.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ys(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function yl(e,t){return new vl({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pt(t)}})}const bl=/*@__PURE__*/ F(`ZodPrefault`,(e,t)=>{va.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xl(e,t){return new bl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pt(t)}})}const Sl=/*@__PURE__*/ F(`ZodNonOptional`,(e,t)=>{ya.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ks(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cl(e,t){return new Sl({type:`nonoptional`,innerType:e,...N(t)})}const wl=/*@__PURE__*/ F(`ZodCatch`,(e,t)=>{Sa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Tl(e,t){return new wl({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:bn(t)})}const El=/*@__PURE__*/ F(`ZodPipe`,(e,t)=>{Ca.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qs(e,t,n,r),e.in=t.in,e.out=t.out});function Dl(e,t){return new El({type:`pipe`,in:e,out:t})}const Ol=/*@__PURE__*/ F(`ZodReadonly`,(e,t)=>{Ta.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kl(e){return new Ol({type:`readonly`,innerType:e})}const Al=/*@__PURE__*/ F(`ZodCustom`,(e,t)=>{Da.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ps(e,t,n,r)});function jl(e,t){return/* @__PURE__ */ Xo(Al,e??(()=>!0),t)}function Ml(e,t={}){return/* @__PURE__ */ Zo(Al,e,t)}function Nl(e,t){return/* @__PURE__ */ Qo(e,t)}const Pl=Je(`@longzai-intelligence-cli/core/provider`),Fl={red:e=>e,green:e=>e,yellow:e=>e,blue:e=>e,cyan:e=>e,magenta:e=>e,gray:e=>e,bold:e=>e,dim:e=>e};let Il={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>Pl.info(e),stop:e=>Pl.info(e)}),note:(e,t)=>{t?Pl.info(`${t}: ${e}`):Pl.info(e)},log:{info:e=>Pl.info(e),success:e=>Pl.info(e),warn:e=>Pl.warn(e),error:e=>Pl.error(e),step:e=>Pl.info(e)}},Ll=Fl;function Rl(e){Il=e}function zl(e){Ll=e}function Bl(){return Il}function Vl(){return Ll}const Hl=()=>`0.0.17`;function Ul(e){let t=e.version??Hl();e.interaction&&Rl(e.interaction),e.color&&zl(e.color);let n=new ct;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}Je(`@longzai-intelligence-cli/core/output`),Je(`@longzai-intelligence-cli/core/progress`);const Wl=Je(`@longzai-intelligence-cli/core/define-command`);function Gl(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function Kl(e,t){if(t.length===1){let n=t[0];if(n===void 0)throw Error(`defineCommand: segments 为空,无法解析命令名`);return e.command(n)}let[n,...r]=t;if(n===void 0)throw Error(`defineCommand: segments 首段为空,无法解析父命令名`);let i=r.pop();if(i===void 0)throw Error(`defineCommand: segments 末段为空,无法解析子命令名`);let a=Gl(e,n);for(let e of r)a=Gl(a,e);return a.command(i)}function ql(e,t){let n=Kl(e,t.name.split(` `).filter(e=>e.length>0));t.description&&n.description(t.description);for(let e of t.arguments??[])e.description?n.argument(e.signature,e.description):n.argument(e.signature);for(let e of t.options??[])e.defaultValue===void 0?n.option(e.flags,e.description??``):n.option(e.flags,e.description??``,e.defaultValue);n.action(async(...e)=>{let n=e[e.length-1];if(!(n instanceof ct))return;let r=n.opts(),i=n.args,a=t.schema.safeParse(r);if(!a.success){let e=a.error.issues.map(e=>e.message).join(`, `);Wl.error(Vl().red(`参数校验失败: ${e}`)),Bl().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var Jl=/* @__PURE__ */ A(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),Yl=/* @__PURE__ */ A(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),G=Jl(),K=/* @__PURE__ */ re(Yl(),1);function Xl({onlyFirst:e=!1}={}){let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}const Zl=Xl();function Ql(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Zl,``)}function $l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var eu={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(e){var t=e.charCodeAt(0),n=e.length==2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`},t.characterLength=function(e){var t=this.eastAsianWidth(e);return t==`F`||t==`W`||t==`A`?2:1};function n(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(e){for(var t=n(e),r=0,i=0;i<t.length;i++)r+=this.characterLength(t[i]);return r},t.slice=function(e,r,i){textLen=t.length(e),r||=0,i||=1,r<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var a=``,o=0,s=n(e),c=0;c<s.length;c++){var l=s[c],u=t.length(l);if(o>=r-+(u==2)){if(o+u<=i)a+=l;else break}o+=u}return a}})(eu);var tu=eu.exports;const nu=$l(tu),ru=$l(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 iu(e,t={}){if(typeof e!=`string`||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=Ql(e),e.length===0))return 0;e=e.replace(ru(),` `);let n=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159||e>=768&&e<=879))switch(nu.eastAsianWidth(t)){case`F`:case`W`:r+=2;break;case`A`:r+=n;break;default:r+=1}}return r}const au=(e=0)=>t=>`\x1B[${t+e}m`,ou=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,su=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,q={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(q.modifier);const cu=Object.keys(q.color),lu=Object.keys(q.bgColor);[...cu,...lu];function uu(){let e=/* @__PURE__ */ new Map;for(let[t,n]of Object.entries(q)){for(let[t,r]of Object.entries(n))q[t]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[t]=q[t],e.set(r[0],r[1]);Object.defineProperty(q,t,{value:n,enumerable:!1})}return Object.defineProperty(q,"codes",{value:e,enumerable:!1}),q.color.close=`\x1B[39m`,q.bgColor.close=`\x1B[49m`,q.color.ansi=au(),q.color.ansi256=ou(),q.color.ansi16m=su(),q.bgColor.ansi=au(10),q.bgColor.ansi256=ou(10),q.bgColor.ansi16m=su(10),Object.defineProperties(q,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>q.rgbToAnsi256(...q.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>q.ansi256ToAnsi(q.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>q.ansi256ToAnsi(q.hexToAnsi256(e)),enumerable:!1}}),q}const du=uu(),fu=/* @__PURE__ */ new Set([`\x1B`,`›`]),pu=`]8;;`,mu=e=>`${fu.values().next().value}[${e}m`,hu=e=>`${fu.values().next().value}${pu}${e}`,gu=e=>e.split(` `).map(e=>iu(e)),_u=(e,t,n)=>{let r=[...t],i=!1,a=!1,o=iu(Ql(e[e.length-1]));for(let[t,s]of r.entries()){let c=iu(s);o+c<=n?e[e.length-1]+=s:(e.push(s),o=0),fu.has(s)&&(i=!0,a=r.slice(t+1).join(``).startsWith(pu)),i?a?s===`\x07`&&(i=!1,a=!1):s===`m`&&(i=!1):(o+=c,o===n&&t<r.length-1&&(e.push(``),o=0))}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},vu=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(iu(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},yu=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=gu(e),s=[``];for(let[r,i]of e.split(` `).entries()){n.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let e=iu(s[s.length-1]);if(r!==0&&(e>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),e=0),(e>0||n.trim===!1)&&(s[s.length-1]+=` `,e++)),n.hard&&o[r]>t){let n=t-e,a=1+Math.floor((o[r]-n-1)/t);Math.floor((o[r]-1)/t)<a&&s.push(``),_u(s,i,t)}else{if(e+o[r]>t&&e>0&&o[r]>0){if(n.wordWrap===!1&&e<t){_u(s,i,t);continue}s.push(``)}e+o[r]>t&&n.wordWrap===!1?_u(s,i,t):s[s.length-1]+=i}}n.trim!==!1&&(s=s.map(e=>vu(e)));let c=[...s.join(`
147
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function as(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;as(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const os=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),ss=[`oneOf`,`anyOf`];function cs(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function ls(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!os.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??cs(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}bt(n,r,e.length===1?e[0]:ls(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=cs(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function us(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of os)if(t in e)return;let n=t.filter(e=>ss.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ls(t);else{let e=n[0],i=ss.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>ls([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,es(e,r))}function ds(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):es(i,s),es(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())as(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])us(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}es(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,bt(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ps(t,`input`,e.processors),output:ps(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function z(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return z(r.element,n);if(r.type===`set`)return z(r.valueType,n);if(r.type===`lazy`)return z(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return z(r.innerType,n);if(r.type===`intersection`)return z(r.left,n)||z(r.right,n);if(r.type===`record`||r.type===`map`)return z(r.keyType,n)||z(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:z(r.in,n)||z(r.out,n);if(r.type===`object`){for(let e in r.shape)if(z(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(z(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(z(e,n))return!0;return!!(r.rest&&z(r.rest,n))}return!1}const fs=(e,t={})=>n=>{let r=ts({...n,processors:t});return R(e,r),is(r,e),ds(r,e)},ps=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ts({...i??{},target:a,io:t,processors:n});return R(e,o),is(o,e),ds(o,e)},ms=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},hs=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},gs=(e,t)=>{ms(e,`minimum`,t),hs(e,`maximum`,t)},_s=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},vs=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},ys=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},bs=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},xs=(e,t)=>ms(e,`minimum`,t.minimum),Ss=(e,t)=>hs(e,`maximum`,t.maximum),Cs=e=>(t,n)=>{bs(t,n.format);let[r,i]=e[n.format];ms(t,`minimum`,r),hs(t,`maximum`,i)},ws={greater_than:(e,t)=>ms(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>hs(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>_s(e,t.value),number_format:Cs(Bt),bigint_format:Cs(Vt),min_length:xs,max_length:Ss,length_equals:(e,t)=>gs(e,t.length),min_size:xs,max_size:Ss,size_equals:(e,t)=>gs(e,t.size),string_format:(e,t)=>{bs(e,t.format),t.pattern&&vs(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>ys(e,t.mime)};function Ts(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ws[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&ms(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&ms(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&hs(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&hs(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&_s(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ys(t,i.mime);for(let e of i.patterns??[])vs(t,e);return t}const Es={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ds=/* @__PURE__ */ new Map([[Fi,yr],[Li,br]]),Os=e=>Ds.get(e)??e,ks=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Ts(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Es[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Os);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},As=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Ts(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):ns(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},js=(e,t,n,r)=>{n.type=`boolean`},Ms=(e,t,n,r)=>{n.not={}},Ns=(e,t,n,r)=>{let i=e._zod.def,a=ft(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Ps=(e,t,n,r)=>{ns(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Fs=(e,t,n,r)=>{ns(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Is=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Ts(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=R(a.element,t,{...r,path:[...r.path,`items`]})};function Ls(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Ls(t.out):t.type===`catch`?Ls(t.innerType):e._zod.optin}const Rs=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&ns(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)bt(i.properties,e,R(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Ls(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=R(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},zs=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>R(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Bs=(e,t,n,r)=>{let i=e._zod.def,a=R(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=R(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Vs(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Vs(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Vs(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?jr:Ar).source)),p}const Hs=/* @__PURE__ */ new WeakMap;function Us(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of Hs.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Vs(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const Ws=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Ts(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=R(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)bt(i.patternProperties,Os(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=R(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Hs.get(t);n||(n=[],Hs.set(t,n),t.deferred.push(()=>Us(t))),n.push(e)}i.additionalProperties=R(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Ls(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Gs=(e,t,n,r)=>{let i=e._zod.def,a=R(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ks=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qs=Symbol();function Js(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(ns(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),qs):JSON.parse(o)}const Ys=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Js(i.defaultValue,e,t,n,r);o!==qs&&(n.default=o)},Xs=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Js(i.defaultValue,e,t,n,r);o!==qs&&(n._prefault=o)},Zs=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{ns(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Qs=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;R(o,t,r);let s=t.seen.get(e);s.ref=o},$s=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ec=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},tc=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function nc(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const rc=/*@__PURE__*/ F(`ZodError`,(e,t)=>{Pn.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);tc.has(n)||(tc.add(n),nc(n,`format`,e=>t=>Ln(e,t)),nc(n,`flatten`,e=>t=>In(e,t)),nc(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,mt,2)}),nc(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,mt,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ic=/* @__PURE__ */ zn(rc),ac=/* @__PURE__ */ Bn(rc),oc=/* @__PURE__ */ Vn(rc),sc=/* @__PURE__ */ Un(rc),cc=/* @__PURE__ */ Yn(rc),lc=/* @__PURE__ */ Xn(rc),uc=/* @__PURE__ */ Zn(rc),dc=/* @__PURE__ */ Qn(rc),fc=/* @__PURE__ */ $n(rc),pc=/* @__PURE__ */ er(rc),mc=/* @__PURE__ */ tr(rc),hc=/* @__PURE__ */ nr(rc);function gc(){Dn.localeError||On(Wa())}function _c(){Dn.memoizer||On({memoizer:Va()})}const B=/*@__PURE__*/ F(`ZodType`,(e,t)=>(gc(),I.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Dt(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Lt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ml(e,t))},superRefine(e,t){return this.check(Nl(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Uo(e))},optional(){return pl(this)},exactOptional(){return hl(this)},nullable(){return _l(this)},nullish(){return pl(_l(this))},nonoptional(e){return Cl(this,e)},array(){return U(this)},or(e){return rl([this,e])},and(e){return al(this,e)},transform(e){return Dl(this,dl(e))},default(e){return yl(this,e)},prefault(e){return xl(this,e)},catch(e){return Tl(this,e)},pipe(e){return Dl(this,e)},readonly(){return kl(this)},describe(e){let t=this.clone();return Ja.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ja.get(this);let t=this.clone();return Ja.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return fn(this,`~standard`,{...ri(this),jsonSchema:{input:ps(this,`input`),output:ps(this,`output`)}})},set"~standard"(e){dn(this,`~standard`,e)},parse:function e(t,n){return ic(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ac(this,t,n,{callee:e})},safeParse(e,t){return oc(this,e,t)},async safeParseAsync(e,t){return sc(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){dn(this,`spa`,e)},validate(e,t){return Kn(this,e,t)},validateAsync(e,t){return Jn(this,e,t)},encode:function e(t,n){return cc(this,t,n,{callee:e})},decode:function e(t,n){return lc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await uc(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await dc(this,t,n,{callee:e})},safeEncode(e,t){return fc(this,e,t)},safeDecode(e,t){return pc(this,e,t)},async safeEncodeAsync(e,t){return mc(this,e,t)},async safeDecodeAsync(e,t){return hc(this,e,t)},toJSONSchema(e){return fs(this,{})(e)},get description(){return Ja.get(this)?.description},get _def(){return this._zod.def}}),vc=/*@__PURE__*/ F(`_ZodString`,(e,t)=>{ii.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ks(e,t,n,r)},/*@__PURE__*/ pn({format:e=>Ts(e).format??null,minLength:e=>Ts(e).minimum??null,maxLength:e=>Ts(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Lo(...e))},includes(...e){return this.check(/* @__PURE__ */ Bo(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Vo(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Ho(...e))},min(...e){return this.check(/* @__PURE__ */ Fo(...e))},max(...e){return this.check(/* @__PURE__ */ Po(...e))},length(...e){return this.check(/* @__PURE__ */ Io(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Fo(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Ro(e))},uppercase(e){return this.check(/* @__PURE__ */ zo(e))},trim(){return this.check(/* @__PURE__ */ Go())},normalize(...e){return this.check(/* @__PURE__ */ Wo(...e))},toLowerCase(){return this.check(/* @__PURE__ */ Ko())},toUpperCase(){return this.check(/* @__PURE__ */ qo())},slugify(){return this.check(/* @__PURE__ */ Jo())}})),yc=/*@__PURE__*/ F(`ZodString`,(e,t)=>{ii.init(e,t),vc.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Za(wc,e))},url(e){return this.check(/* @__PURE__ */ ro(Dc,e))},jwt(e){return this.check(/* @__PURE__ */ yo(Hc,e))},emoji(e){return this.check(/* @__PURE__ */ io(Oc,e))},guid(e){return this.check(/* @__PURE__ */ Qa(Tc,e))},uuid(e){return this.check(/* @__PURE__ */ $a(Ec,e))},uuidv4(e){return this.check(/* @__PURE__ */ eo(Ec,e))},uuidv6(e){return this.check(/* @__PURE__ */ to(Ec,e))},uuidv7(e){return this.check(/* @__PURE__ */ no(Ec,e))},nanoid(e){return this.check(/* @__PURE__ */ ao(kc,e))},cuid(e){return this.check(/* @__PURE__ */ oo(Ac,e))},cuid2(e){return this.check(/* @__PURE__ */ so(jc,e))},ulid(e){return this.check(/* @__PURE__ */ co(Mc,e))},base64(e){return this.check(/* @__PURE__ */ go(zc,e))},base64url(e){return this.check(/* @__PURE__ */ _o(Bc,e))},xid(e){return this.check(/* @__PURE__ */ lo(Nc,e))},ksuid(e){return this.check(/* @__PURE__ */ uo(Pc,e))},ipv4(e){return this.check(/* @__PURE__ */ fo(Fc,e))},ipv6(e){return this.check(/* @__PURE__ */ po(Ic,e))},cidrv4(e){return this.check(/* @__PURE__ */ mo(Lc,e))},cidrv6(e){return this.check(/* @__PURE__ */ ho(Rc,e))},e164(e){return this.check(/* @__PURE__ */ vo(Vc,e))},datetime(e){return this.check(/* @__PURE__ */ bo(bc,e))},date(e){return this.check(/* @__PURE__ */ xo(xc,e))},time(e){return this.check(/* @__PURE__ */ So(Sc,e))},duration(e){return this.check(/* @__PURE__ */ Co(Cc,e))}});function V(e){return/* @__PURE__ */ Xa(yc,e)}const H=/*@__PURE__*/ F(`ZodStringFormat`,(e,t)=>{L.init(e,t),vc.init(e,t)}),bc=/*@__PURE__*/ F(`ZodISODateTime`,(e,t)=>{Ci.init(e,t),H.init(e,t)}),xc=/*@__PURE__*/ F(`ZodISODate`,(e,t)=>{wi.init(e,t),H.init(e,t)}),Sc=/*@__PURE__*/ F(`ZodISOTime`,(e,t)=>{Ti.init(e,t),H.init(e,t)}),Cc=/*@__PURE__*/ F(`ZodISODuration`,(e,t)=>{Ei.init(e,t),H.init(e,t)}),wc=/*@__PURE__*/ F(`ZodEmail`,(e,t)=>{si.init(e,t),H.init(e,t)}),Tc=/*@__PURE__*/ F(`ZodGUID`,(e,t)=>{ai.init(e,t),H.init(e,t)}),Ec=/*@__PURE__*/ F(`ZodUUID`,(e,t)=>{oi.init(e,t),H.init(e,t)}),Dc=/*@__PURE__*/ F(`ZodURL`,(e,t)=>{hi.init(e,t),H.init(e,t)}),Oc=/*@__PURE__*/ F(`ZodEmoji`,(e,t)=>{gi.init(e,t),H.init(e,t)}),kc=/*@__PURE__*/ F(`ZodNanoID`,(e,t)=>{_i.init(e,t),H.init(e,t)}),Ac=/*@__PURE__*/ F(`ZodCUID`,(e,t)=>{vi.init(e,t),H.init(e,t)}),jc=/*@__PURE__*/ F(`ZodCUID2`,(e,t)=>{yi.init(e,t),H.init(e,t)}),Mc=/*@__PURE__*/ F(`ZodULID`,(e,t)=>{bi.init(e,t),H.init(e,t)}),Nc=/*@__PURE__*/ F(`ZodXID`,(e,t)=>{xi.init(e,t),H.init(e,t)}),Pc=/*@__PURE__*/ F(`ZodKSUID`,(e,t)=>{Si.init(e,t),H.init(e,t)}),Fc=/*@__PURE__*/ F(`ZodIPv4`,(e,t)=>{Di.init(e,t),H.init(e,t)}),Ic=/*@__PURE__*/ F(`ZodIPv6`,(e,t)=>{Ai.init(e,t),H.init(e,t)}),Lc=/*@__PURE__*/ F(`ZodCIDRv4`,(e,t)=>{ji.init(e,t),H.init(e,t)}),Rc=/*@__PURE__*/ F(`ZodCIDRv6`,(e,t)=>{Ni.init(e,t),H.init(e,t)}),zc=/*@__PURE__*/ F(`ZodBase64`,(e,t)=>{Ii.init(e,t),H.init(e,t)}),Bc=/*@__PURE__*/ F(`ZodBase64URL`,(e,t)=>{zi.init(e,t),H.init(e,t)}),Vc=/*@__PURE__*/ F(`ZodE164`,(e,t)=>{Bi.init(e,t),H.init(e,t)}),Hc=/*@__PURE__*/ F(`ZodJWT`,(e,t)=>{Hi.init(e,t),H.init(e,t)}),Uc=/*@__PURE__*/ F(`ZodNumber`,(e,t)=>{Ui.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>As(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ pn({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Ts(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Ts(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Ts(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Ts(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ jo(e,t))},gte(e,t){return this.check(/* @__PURE__ */ Mo(e,t))},min(e,t){return this.check(/* @__PURE__ */ Mo(e,t))},lt(e,t){return this.check(/* @__PURE__ */ ko(e,t))},lte(e,t){return this.check(/* @__PURE__ */ Ao(e,t))},max(e,t){return this.check(/* @__PURE__ */ Ao(e,t))},int(e){return this.check(Kc(e))},safe(e){return this.check(Kc(e))},positive(e){return this.check(/* @__PURE__ */ jo(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ Mo(0,e))},negative(e){return this.check(/* @__PURE__ */ ko(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ Ao(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ No(e,t))},step(e,t){return this.check(/* @__PURE__ */ No(e,t))},finite(){return this}}));function Wc(e){return/* @__PURE__ */ wo(Uc,e)}const Gc=/*@__PURE__*/ F(`ZodNumberFormat`,(e,t)=>{Wi.init(e,t),Uc.init(e,t)});function Kc(e){return/* @__PURE__ */ To(Gc,e)}const qc=/*@__PURE__*/ F(`ZodBoolean`,(e,t)=>{Gi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r)});function Jc(e){return/* @__PURE__ */ Eo(qc,e)}const Yc=/*@__PURE__*/ F(`ZodUnknown`,(e,t)=>{Ki.init(e,t),B.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Xc(){return/* @__PURE__ */ Do(Yc)}const Zc=/*@__PURE__*/ F(`ZodNever`,(e,t)=>{qi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r)});function Qc(e){return/* @__PURE__ */ Oo(Zc,e)}const $c=/*@__PURE__*/ F(`ZodArray`,(e,t)=>{_c(),Zi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Fo(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Fo(1,e))},max(e,t){return this.check(/* @__PURE__ */ Po(e,t))},length(e,t){return this.check(/* @__PURE__ */ Io(e,t))},unwrap(){return this.element}});function U(e,t){return/* @__PURE__ */ Yo($c,e,t)}const el=/*@__PURE__*/ F(`ZodObject`,(e,t)=>{_c(),ra.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),yn(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return ll(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Dt(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Dt(this._zod.def,{catchall:Xc()}))},loose(){return this.clone(Dt(this._zod.def,{catchall:Xc()}))},strict(){return this.clone(Dt(this._zod.def,{catchall:Qc()}))},strip(){return this.clone(Dt(this._zod.def,{catchall:void 0}))},extend(e){return Gt(this,e)},safeExtend(e){return qt(this,e)},merge(e){return Jt(this,e)},pick(e){return Ht(this,e)},omit(e){return Wt(this,e)},partial(...e){return Yt(fl,this,e[0])},exactPartial(...e){return Yt(ml,this,e[0],`exactPartial`)},required(...e){return Xt(Sl,this,e[0])}});function W(e,t){let n={type:`object`,shape:e??{},...N(t)};return new el(n)}function tl(e,t){return new el({type:`object`,shape:e,catchall:Qc(),...N(t)})}const nl=/*@__PURE__*/ F(`ZodUnion`,(e,t)=>{aa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zs(e,t,n,r),e.options=t.options});function rl(e,t){return new nl({type:`union`,options:e,...N(t)})}const il=/*@__PURE__*/ F(`ZodIntersection`,(e,t)=>{oa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(e,t,n,r)});function al(e,t){return new il({type:`intersection`,left:e,right:t})}const ol=/*@__PURE__*/ F(`ZodRecord`,(e,t)=>{_c(),la.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ws(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function sl(e,t,n){return!t||!t._zod?new ol({type:`record`,keyType:V(),valueType:e,...N(t)}):new ol({type:`record`,keyType:e,valueType:t,...N(n)})}const cl=/*@__PURE__*/ F(`ZodEnum`,(e,t)=>{ua.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ns(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new cl({...t,checks:[],...N(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new cl({...t,checks:[],...N(r),entries:i})}});function ll(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new cl({type:`enum`,entries:n,...N(t)})}const ul=/*@__PURE__*/ F(`ZodTransform`,(e,t)=>{_c(),da.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fs(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new En(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ln(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(ln(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function dl(e){return new ul({type:`transform`,transform:e})}const fl=/*@__PURE__*/ F(`ZodOptional`,(e,t)=>{pa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ec(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pl(e){return new fl({type:`optional`,innerType:e})}const ml=/*@__PURE__*/ F(`ZodExactOptional`,(e,t)=>{ma.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ec(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hl(e){return new ml({type:`optional`,innerType:e})}const gl=/*@__PURE__*/ F(`ZodNullable`,(e,t)=>{ha.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _l(e){return new gl({type:`nullable`,innerType:e})}const vl=/*@__PURE__*/ F(`ZodDefault`,(e,t)=>{ga.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ys(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function yl(e,t){return new vl({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pt(t)}})}const bl=/*@__PURE__*/ F(`ZodPrefault`,(e,t)=>{va.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xl(e,t){return new bl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pt(t)}})}const Sl=/*@__PURE__*/ F(`ZodNonOptional`,(e,t)=>{ya.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ks(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cl(e,t){return new Sl({type:`nonoptional`,innerType:e,...N(t)})}const wl=/*@__PURE__*/ F(`ZodCatch`,(e,t)=>{Sa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Tl(e,t){return new wl({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:bn(t)})}const El=/*@__PURE__*/ F(`ZodPipe`,(e,t)=>{Ca.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qs(e,t,n,r),e.in=t.in,e.out=t.out});function Dl(e,t){return new El({type:`pipe`,in:e,out:t})}const Ol=/*@__PURE__*/ F(`ZodReadonly`,(e,t)=>{Ta.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kl(e){return new Ol({type:`readonly`,innerType:e})}const Al=/*@__PURE__*/ F(`ZodCustom`,(e,t)=>{Da.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ps(e,t,n,r)});function jl(e,t){return/* @__PURE__ */ Xo(Al,e??(()=>!0),t)}function Ml(e,t={}){return/* @__PURE__ */ Zo(Al,e,t)}function Nl(e,t){return/* @__PURE__ */ Qo(e,t)}const Pl=Je(`@longzai-intelligence-cli/core/provider`),Fl={red:e=>e,green:e=>e,yellow:e=>e,blue:e=>e,cyan:e=>e,magenta:e=>e,gray:e=>e,bold:e=>e,dim:e=>e};let Il={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>Pl.info(e),stop:e=>Pl.info(e)}),note:(e,t)=>{t?Pl.info(`${t}: ${e}`):Pl.info(e)},log:{info:e=>Pl.info(e),success:e=>Pl.info(e),warn:e=>Pl.warn(e),error:e=>Pl.error(e),step:e=>Pl.info(e)}},Ll=Fl;function Rl(e){Il=e}function zl(e){Ll=e}function Bl(){return Il}function Vl(){return Ll}const Hl=()=>`0.0.18`;function Ul(e){let t=e.version??Hl();e.interaction&&Rl(e.interaction),e.color&&zl(e.color);let n=new ct;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}Je(`@longzai-intelligence-cli/core/output`),Je(`@longzai-intelligence-cli/core/progress`);const Wl=Je(`@longzai-intelligence-cli/core/define-command`);function Gl(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function Kl(e,t){if(t.length===1){let n=t[0];if(n===void 0)throw Error(`defineCommand: segments 为空,无法解析命令名`);return e.command(n)}let[n,...r]=t;if(n===void 0)throw Error(`defineCommand: segments 首段为空,无法解析父命令名`);let i=r.pop();if(i===void 0)throw Error(`defineCommand: segments 末段为空,无法解析子命令名`);let a=Gl(e,n);for(let e of r)a=Gl(a,e);return a.command(i)}function ql(e,t){let n=Kl(e,t.name.split(` `).filter(e=>e.length>0));t.description&&n.description(t.description);for(let e of t.arguments??[])e.description?n.argument(e.signature,e.description):n.argument(e.signature);for(let e of t.options??[])e.defaultValue===void 0?n.option(e.flags,e.description??``):n.option(e.flags,e.description??``,e.defaultValue);n.action(async(...e)=>{let n=e[e.length-1];if(!(n instanceof ct))return;let r=n.opts(),i=n.args,a=t.schema.safeParse(r);if(!a.success){let e=a.error.issues.map(e=>e.message).join(`, `);Wl.error(Vl().red(`参数校验失败: ${e}`)),Bl().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var Jl=/* @__PURE__ */ A(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),Yl=/* @__PURE__ */ A(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),G=Jl(),K=/* @__PURE__ */ re(Yl(),1);function Xl({onlyFirst:e=!1}={}){let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}const Zl=Xl();function Ql(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Zl,``)}function $l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var eu={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(e){var t=e.charCodeAt(0),n=e.length==2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`},t.characterLength=function(e){var t=this.eastAsianWidth(e);return t==`F`||t==`W`||t==`A`?2:1};function n(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(e){for(var t=n(e),r=0,i=0;i<t.length;i++)r+=this.characterLength(t[i]);return r},t.slice=function(e,r,i){textLen=t.length(e),r||=0,i||=1,r<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var a=``,o=0,s=n(e),c=0;c<s.length;c++){var l=s[c],u=t.length(l);if(o>=r-+(u==2)){if(o+u<=i)a+=l;else break}o+=u}return a}})(eu);var tu=eu.exports;const nu=$l(tu),ru=$l(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 iu(e,t={}){if(typeof e!=`string`||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=Ql(e),e.length===0))return 0;e=e.replace(ru(),` `);let n=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159||e>=768&&e<=879))switch(nu.eastAsianWidth(t)){case`F`:case`W`:r+=2;break;case`A`:r+=n;break;default:r+=1}}return r}const au=(e=0)=>t=>`\x1B[${t+e}m`,ou=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,su=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,q={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(q.modifier);const cu=Object.keys(q.color),lu=Object.keys(q.bgColor);[...cu,...lu];function uu(){let e=/* @__PURE__ */ new Map;for(let[t,n]of Object.entries(q)){for(let[t,r]of Object.entries(n))q[t]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[t]=q[t],e.set(r[0],r[1]);Object.defineProperty(q,t,{value:n,enumerable:!1})}return Object.defineProperty(q,"codes",{value:e,enumerable:!1}),q.color.close=`\x1B[39m`,q.bgColor.close=`\x1B[49m`,q.color.ansi=au(),q.color.ansi256=ou(),q.color.ansi16m=su(),q.bgColor.ansi=au(10),q.bgColor.ansi256=ou(10),q.bgColor.ansi16m=su(10),Object.defineProperties(q,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>q.rgbToAnsi256(...q.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>q.ansi256ToAnsi(q.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>q.ansi256ToAnsi(q.hexToAnsi256(e)),enumerable:!1}}),q}const du=uu(),fu=/* @__PURE__ */ new Set([`\x1B`,`›`]),pu=`]8;;`,mu=e=>`${fu.values().next().value}[${e}m`,hu=e=>`${fu.values().next().value}${pu}${e}`,gu=e=>e.split(` `).map(e=>iu(e)),_u=(e,t,n)=>{let r=[...t],i=!1,a=!1,o=iu(Ql(e[e.length-1]));for(let[t,s]of r.entries()){let c=iu(s);o+c<=n?e[e.length-1]+=s:(e.push(s),o=0),fu.has(s)&&(i=!0,a=r.slice(t+1).join(``).startsWith(pu)),i?a?s===`\x07`&&(i=!1,a=!1):s===`m`&&(i=!1):(o+=c,o===n&&t<r.length-1&&(e.push(``),o=0))}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},vu=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(iu(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},yu=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=gu(e),s=[``];for(let[r,i]of e.split(` `).entries()){n.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let e=iu(s[s.length-1]);if(r!==0&&(e>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),e=0),(e>0||n.trim===!1)&&(s[s.length-1]+=` `,e++)),n.hard&&o[r]>t){let n=t-e,a=1+Math.floor((o[r]-n-1)/t);Math.floor((o[r]-1)/t)<a&&s.push(``),_u(s,i,t)}else{if(e+o[r]>t&&e>0&&o[r]>0){if(n.wordWrap===!1&&e<t){_u(s,i,t);continue}s.push(``)}e+o[r]>t&&n.wordWrap===!1?_u(s,i,t):s[s.length-1]+=i}}n.trim!==!1&&(s=s.map(e=>vu(e)));let c=[...s.join(`
148
148
  `)];for(let[e,t]of c.entries()){if(r+=t,fu.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${pu}(?<uri>.*))`).exec(c.slice(e).join(``))||{groups:{}};if(t.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}let n=du.codes.get(Number(i));c[e+1]===`
149
149
  `?(a&&(r+=hu(``)),i&&n&&(r+=mu(n))):t===`
150
150
  `&&(i&&n&&(r+=mu(i)),a&&(r+=hu(a)))}return r};function bu(e,t,n){return String(e).normalize().replace(/\r\n/g,`
@@ -209,7 +209,7 @@ ${K.default.gray(Xu+Ju.repeat(a+2)+Zu)}
209
209
  `),options:c,commands:l}},mf=async(e,t)=>{try{let n=Bun.spawn({cmd:[...e],cwd:t,stdout:`pipe`,stderr:`pipe`});return{exitCode:await n.exited,stdout:await new Response(n.stdout).text(),stderr:await new Response(n.stderr).text()}}catch(e){return{exitCode:null,stdout:``,stderr:e instanceof Error?e.message:String(e)}}},hf=async e=>{let t=await mf([...e.invocation,`--help`],e.root),n=t.stdout===``?t.stderr:t.stdout;if(t.exitCode!==0)return{bin:e.bin,degraded:!0,raw:n,reason:`运行退出码 ${String(t.exitCode)}`};let r=pf(n);if(r.usage===null)return{bin:e.bin,degraded:!0,raw:n,reason:`帮助输出未含 Usage 行即非 commander 形态`};let i=[];for(let t of r.commands){let n=await mf([...e.invocation,t.name,`--help`],e.root),r=n.stdout===``?n.stderr:n.stdout,a=n.exitCode===0?pf(r):null;i.push({name:t.name,invocation:t.invocation,summary:t.summary,detailDescription:a?.description??``,options:a?.options??[],detailParsed:a!==null&&a.usage!==null})}return{bin:e.bin,degraded:!1,usage:r.usage,description:r.description,options:r.options,commands:i}},gf=async e=>{let t=[];for(let n of e.bins)t.push(await hf({bin:n,invocation:e.invocations[n]??[n],root:e.root}));return t},_f=e=>{let t=e.split(`/`).at(-1)??e;return t.endsWith(`.md`)?t.slice(0,-3):t},vf=async(e,t)=>{let n=await uf(e),r=t.toolFace.bins??n.bins,i=r.length>0?await gf({bins:r,invocations:t.toolFace.invocations,root:e}):[],a=[];for(let n of t.documents){let r=_f(n.output),i=await cf({documentDir:d(e,t.sourceRoot,r),documentName:r,sourceRootLabel:t.sourceRoot,exclude:n.exclude});a.push({document:r,output:n.output,title:n.title??r,toolFace:n.toolFace,items:i})}return{root:e,sourceRootLabel:t.sourceRoot,manifest:n,toolFace:i,documents:a}},yf=e=>{let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return[RegExp(`name\\s*[:=]\\s*(['"\`])${t}\\1`),RegExp(`\\.command\\(\\s*(['"\`])${t}\\1`)]},bf=async e=>{let t=[];for(let n of e.documents)for(let r of n.items){let i=`${e.sourceRootLabel}/${n.document}/${r.fileName}`;if(r.meta.anchor===null&&r.meta.command===null)continue;if(r.meta.anchor===null){t.push({kind:`anchor-missing`,message:`条目 ${i} 声明了 command 而无 anchor,命令锚定需要 anchor 指向命令定义所在源码文件`});continue}let a=d(e.root,r.meta.anchor);if(!await Bun.file(a).exists()){t.push({kind:`anchor-missing`,message:`条目 ${i} 的 anchor 指向的文件不存在:${r.meta.anchor}`});continue}if(r.meta.command===null)continue;let o=await Bun.file(a).text();yf(r.meta.command).some(e=>e.test(o))||t.push({kind:`command-not-found`,message:`条目 ${i} 的 command '${r.meta.command}' 在锚点源码 ${r.meta.anchor} 中未命中命令定义,命令可能已改名`})}return t},xf=async(e,t)=>{let n=await vf(e,t),r=Zd(n),i=/* @__PURE__ */ new Map;for(let t of r){let n=d(e,t.output);if(!await Bun.file(n).exists()){i.set(t.document,{status:`missing`,expected:t.markdown});continue}let r=await Bun.file(n).text();i.set(t.document,{status:r===t.markdown?`fresh`:`stale`,expected:t.markdown})}return i},Sf=async(e,t)=>{let n=await vf(e,t),r=[...await bf(n)];for(let t of Zd(n)){let n=d(e,t.output);await Bun.file(n).exists()?await Bun.file(n).text()!==t.markdown&&r.push({kind:`snapshot-stale`,message:`文档 ${t.document} 的产物过期:${t.output} 与真源合成结果不一致,执行 compile-derive 重建`}):r.push({kind:`snapshot-missing`,message:`文档 ${t.document} 的产物缺失:${t.output},执行 compile-derive 生成`})}return r},Cf=async(e,t)=>{let n=await xf(e.root,t),r=0,i=0;for(let t of e.documents)for(let e of t.items)r+=1,(e.meta.id!==null||e.meta.type!==null||e.meta.title!==null||e.meta.anchor!==null||e.meta.command!==null)&&(i+=1);return{repo:e.manifest.name??``,itemCount:r,metadataCoverage:r===0?1:i/r,documents:e.documents.map(e=>({document:e.document,output:e.output,itemCount:e.items.length,freshness:n.get(e.document)?.status??`missing`})),toolFace:e.toolFace.map(e=>({bin:e.bin,degraded:e.degraded,commandCount:e.degraded?0:e.commands.length}))}},wf=e=>e===`fresh`?`新鲜`:e===`stale`?`过期`:`缺失`,Tf=e=>{let t=e.documents.map(e=>`| ${e.document} | \`${e.output}\` | ${e.itemCount} | ${wf(e.freshness)} |`),n=e.toolFace.map(e=>`| \`${e.bin}\` | ${e.degraded?`是`:`否`} | ${e.commandCount} |`);return[`# compile inventory:${e.repo===``?`未识别包名`:e.repo}`,``,`- 条目总数:${e.itemCount}`,`- 元数据覆盖率:${(e.metadataCoverage*100).toFixed(0)}%`,``,`## 文档`,``,`| 文档 | 产物 | 条目数 | 新鲜度 |`,`| --- | --- | --- | --- |`,...t.length>0?t:[`| 无 | 无 | 0 | 缺失 |`],``,`## 工具面`,``,`| bin | 降级 | 命令数 |`,`| --- | --- | --- |`,...n.length>0?n:[`| 无 | 是 | 0 |`],``].join(`
210
210
  `)},Ef=e=>e.documents.length===0,Df=async(e,t)=>{let n=await vf(e,t);return{manifest:n.manifest,toolFace:n.toolFace,documents:n.documents.map(e=>({document:e.document,output:e.output,items:e.items.map(e=>({file:e.fileName,order:e.order,metadata:[[`id`,e.meta.id],[`type`,e.meta.type],[`title`,e.meta.title],[`anchor`,e.meta.anchor],[`command`,e.meta.command]].filter(([,e])=>e!==null).map(([e])=>e)}))}))}},Of=async(e,t,n)=>{if(Ef(t))throw Error(`plugins.compile.options 未配置任何文档,请在 lzi-docs.config.ts 的 documents 节配置后重试`);let r=await vf(e,t),i=Zd(r);for(let t of i)if(!n){let n=d(e,t.output);await S(u(n),{recursive:!0}),await T(n,t.markdown,`utf-8`)}return i.map(e=>({document:e.document,output:e.output,itemCount:r.documents.find(t=>t.document===e.document)?.items.length??0}))},kf=async(e,t)=>{if(Ef(t))throw Error(`plugins.compile.options 未配置任何文档,请在 lzi-docs.config.ts 的 documents 节配置后重试`);return{findings:await Sf(e,t),documentCount:t.documents.length}},Af=async(e,t)=>{let n=await vf(e,t),r=await Cf(n,t);return{markdown:Tf(r),data:r}},jf=W({}),Mf=W({dryRun:Jc().default(!1)}),Nf=W({}),Pf=W({json:Jc().default(!1)}),Ff=_d({name:`compile`,version:`0.0.1`,configSchema:Vd,commands:[e=>If(e),e=>Lf(e),e=>Rf(e),e=>zf(e)]});function If(e){return X({name:`compile-scan`,description:`扫描真源面出清单:文档条目、manifest 面与工具面帮助抽取`,schema:jf,action:async()=>{try{let t=await Df(process.cwd(),Ud(e.pluginConfig));process.stdout.write(`${JSON.stringify(t,null,2)}\n`)}catch(e){process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}}})}function Lf(e){return X({name:`compile-derive`,description:`建模并派生文档产物写盘,同输入逐字节相同输出`,options:[{flags:`--dry-run`,description:`只打印合成结果不写盘`}],schema:Mf,action:async t=>{try{let n=await Of(process.cwd(),Ud(e.pluginConfig),t.dryRun);for(let e of n)process.stdout.write(`${t.dryRun?`预览`:`已写入`} ${e.output},文档 ${e.document},条目 ${e.itemCount}\n`)}catch(e){process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}}})}function Rf(e){return X({name:`compile-check`,description:`只读校验:快照新鲜度逐字节比对与锚点命令定义命中`,schema:Nf,action:async()=>{try{let t=await kf(process.cwd(),Ud(e.pluginConfig));for(let e of t.findings)process.stderr.write(`[compile:${e.kind}] ${e.message}\n`);t.findings.length>0&&process.exit(1),process.stdout.write(`校验通过,文档 ${t.documentCount} 份全绿\n`)}catch(e){process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}}})}function zf(e){return X({name:`compile-report`,description:`单仓 inventory 上报:文档计数、条目数、元数据覆盖率与产物新鲜度`,options:[{flags:`--json`,description:`以 JSON 形态输出`}],schema:Pf,action:async t=>{try{let n=await Af(process.cwd(),Ud(e.pluginConfig));process.stdout.write(`${t.json?JSON.stringify(n.data,null,2):n.markdown}\n`)}catch(e){process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}}})}const Bf=`^\\d{1,4}[-._]`,Vf=[`docs`],Hf=/^\d+$/,Uf=W({number:V().regex(Hf),reason:V().min(1)}),Wf=W({glob:V().min(1),reason:V().min(1)}),Gf=W({key:V().regex(hd),title:V().min(1),paths:U(V().min(1)).min(1),registryDir:V().min(1),numbering:W({reserved:U(Uf)}).default({reserved:[]}),slugDigitPolicy:ll(gd).optional()}),Kf=W({allowlist:U(W({scopeKey:V().min(1),number:V().regex(Hf),files:U(V().min(1)).min(2),status:ll([`待清偿`,`维持现状`]),reason:V().min(1)})).default([]),globalExclusions:U(Wf).default([]),audit:W({roots:U(V().min(1)).min(1).default([...Vf]),numberishPattern:V().min(1).default(Bf),pending:U(Wf).default([])}).default({roots:[...Vf],numberishPattern:Bf,pending:[]})}),qf=W({scopes:U(Gf).min(1),numbering:Kf.default({allowlist:[],globalExclusions:[],audit:{roots:[...Vf],numberishPattern:Bf,pending:[]}})});function Jf(e){let t=qf.safeParse(e);if(!t.success)throw Error(`numbering 插件配置非法:${t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);return t.data}var Yf=class extends Error{constructor(e,t){super(`glob 模式「${e}」非法:${t}`),this.name=`MiniGlobError`}};const Xf=/* @__PURE__ */ new Set([`.`,`^`,`$`,`+`,`(`,`)`,`|`,`\\`,`]`]),Zf=/* @__PURE__ */ new Map;function Qf(e){return Xf.has(e)?`\\${e}`:e}function $f(e,t){let n=``,r=0;for(;r<t.length;){let i=t[r]??``;if(i===`[`)throw new Yf(e,`不支持字符类 [(与既有生态对齐,显式抛错不静默误配)`);if(i===`*`){let e=0;for(;(t[r+e]??``)===`*`;)e+=1;if(e>=2&&(t[r+e]??``)===`/`){n+=`(?:.*/)?`,r+=e+1;continue}if(e>=2){n+=`[\\s\\S]*`,r+=e;continue}n+=`[^/]*`,r+=1}else i===`?`?(n+=`[^/]`,r+=1):(n+=Qf(i),r+=1)}return n}function ep(e,t){let n=t.indexOf(`{`);if(n===-1)return $f(e,t);let r=t.indexOf(`}`,n+1);if(r===-1)throw new Yf(e,`大括号未闭合`);let i=t.slice(0,n),a=t.slice(n+1,r);if(a.includes(`{`))throw new Yf(e,`不支持嵌套大括号`);let o=a.split(`,`),s=t.slice(r+1);return`(?:${o.map(t=>ep(e,`${i}${t}${s}`)).join(`|`)})`}function tp(e){let t=Zf.get(e);if(t!==void 0)return t;let n=RegExp(`^${ep(e,e)}$`);return Zf.set(e,n),n}function np(e,t){return tp(e).test(t)}function rp(e,t){if(t.kind===`numericPrefix`)return/^(\d+)(?=[-._ ]|$)/.exec(e)?.[1]??null;if(t.kind===`compositePrefix`)return RegExp(`^(\\d+(?:[-._ ]\\d+){${t.groups-1}})(?=[-._ ]|$)`).exec(e)?.[1]??null;if(t.kind===`numericSuffix`){let t=e.replace(/\.[^.]+$/,``);return/(\d+)$/.exec(t)?.[1]??null}return new RegExp(t.pattern).exec(e)?.groups?.key??null}function ip(e){let t=/^\d+/.exec(e);return t===null?null:Number.parseInt(t[0]??``,10)}function ap(e){let t=/* @__PURE__ */ new Set;for(let n of e.basenames){let r=rp(n,e.rule);r!==null&&t.add(r)}if(t.size===0)return{ok:!1,error:`该范围当前无编号文件,无法推断位数——请人工定号后落盘`};let n=``;for(let e of t)(ip(e)??0)>(ip(n)||0)&&(n=e);if(n===``)return{ok:!1,error:`该范围无数字前缀键,无法取号`};let r=n.length,i=new Set(e.reserved),a=0,o=0,s=(ip(n)??0)+1;for(;;){let e=String(s).padStart(r,`0`);if(t.has(e))a+=1,s+=1;else if(i.has(e))o+=1,s+=1;else return{ok:!0,number:e,skippedOccupied:a,skippedReserved:o}}}function op(e,t){if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((e,t)=>e===r[t])}function sp(e){let t=[],n=/* @__PURE__ */ new Map;for(let t of e.basenames){let r=rp(t,e.rule);r!==null&&n.set(r,[...n.get(r)??[],t])}let r=new Map(e.reserved.map(e=>[e.number,e.reason])),i=/* @__PURE__ */ new Set;for(let[a,o]of n){if(o.length>=2){let n=e.allowlist.findIndex((t,n)=>!i.has(n)&&t.number===a&&op(t.files,o.map(t=>e.toRepoRelative(t))));n===-1?t.push({kind:`duplicate`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」编号 ${a} 撞号:${o.join(`、`)}——先入库者保号,后到线顺延清偿`}):i.add(n);continue}let n=r.get(a);n!==void 0&&t.push({kind:`reservedOccupied`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」保留号 ${a} 被占用(${o.join(`、`)};保留理由:${n}——保留号不回收复用,请让号重编`})}if([...n.keys()].some(e=>e.length>1&&e.startsWith(`0`))){let r=new Set([...n.keys()].map(e=>e.length));r.size>1&&t.push({kind:`widthInconsistent`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」零填充位数混用(族内键长 ${[...r].sort((e,t)=>e-t).join(`/`)}):${[...n.keys()].slice(0,6).join(`、`)}`})}if(e.allowlist.forEach((r,a)=>{if(i.has(a))return;let o=r.files.filter(e=>{let t=e.split(`/`).pop()??``;return(n.get(r.number)??[]).includes(t)});t.push({kind:`allowlistStale`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」豁免条目(${r.number},${r.status})已无对应现行撞号组——棘轮只许缩短,须同步删除该条目(登记集:${r.files.join(`、`)};磁盘现状:${o.length>0?o.join(`、`):`无`})`})}),e.slugDigitPolicy!==`allow`)for(let n of e.basenames){let r=Sd(n);r!==null&&r!==``&&xd(r)&&t.push({kind:`slugContainsDigit`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」slug 段含数字:${n}——禁数字域无逐条豁免,处置为改名或该域声明政策 allow`})}return{findings:t}}function cp(e){let t=[],n=new RegExp(e.numberishPattern),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set;for(let t of e.files){let a=t.split(`/`).pop()??``;if(!n.test(a)||e.registryDirs.some(e=>t===e||t.startsWith(`${e}/`))||e.pending.find(e=>np(e.glob,t)?(i.add(e.glob),!0):!1)!==void 0)continue;let o=t.split(`/`).slice(0,-1).join(`/`);r.set(o,[...r.get(o)??[],a])}for(let e of[...r.keys()].sort((e,t)=>e.localeCompare(t)))t.push({kind:`coverageGap`,message:`未登记编号区:目录 ${e===``?`(仓库根)`:e} 有 ${r.get(e)?.length??0} 个编号文件未被任何 scope/pending 覆盖——${(r.get(e)??[]).join(`、`)}(请在 numbering 插件配置登记 scope 或 pending 并注明理由)`});for(let n of e.pending)i.has(n.glob)||t.push({kind:`pendingStale`,message:`pending 条目「${n.glob}」已匹配不到任何编号文件——棘轮只许缩短,须同步删除该条目(登记理由:${n.reason})`});return t}function lp(e,t){return e.some(e=>np(e,t)||np(e,`${t}/`)||np(e,`${t}/**`))}function up(e,t){return e.some(e=>np(e,t))}function dp(e,t){return e.some(e=>e===``||t===e||t.startsWith(`${e}/`)||e.startsWith(`${t}/`))}function fp(e,t){return e.some(e=>e===``||t.startsWith(`${e}/`))}const pp=/* @__PURE__ */ new Set([`.git`,`node_modules`,`dist`,`build`,`out`,`.turbo`,`coverage`,`.nyc_output`,`.lzi`]);function mp(e,t,n,r,a,s){if(!i(e)){if(a)throw Error(`扫描面目录缺失:${e}(严格模式防扫描面静默缩水)`);return}let c=o(e,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name));for(let i of c){let o=t===``?i.name:`${t}/${i.name}`;if(i.isDirectory()){if(pp.has(i.name)||lp(r,o)||!dp(n,o))continue;mp(d(e,i.name),o,n,r,a,s)}else if(i.isFile()){if(up(r,o)||!fp(n,o))continue;s.push(f.normalize(o))}}}function hp(e,t,n={}){let r=[];return mp(e,``,t,n.excludeGlobs??[],!1,r),r.sort((e,t)=>e.localeCompare(t))}function gp(e,t={}){let n=[];return mp(e,``,[``],t.excludeGlobs??[],!0,n),n.sort((e,t)=>e.localeCompare(t))}const _p={kind:`numericPrefix`};function vp(e,t){return hp(e,[t]).map(e=>e.split(`/`).pop()??``)}function yp(e){let t=e.scopeKey!==void 0&&e.dirRel!==void 0,n=e.scopeKey===void 0&&e.dirRel===void 0;if(t||n)return{ok:!1,error:`取号须且仅须指定 --scope <key> 或 --dir <目录> 之一`};if(e.scopeKey!==void 0){let t=e.config.scopes.find(t=>t.key===e.scopeKey);if(t===void 0)return{ok:!1,error:`scope「${e.scopeKey}」未登记(请在 numbering 插件配置注册)`};let n=ap({basenames:vp(e.root,t.registryDir),rule:_p,reserved:t.numbering.reserved.map(e=>e.number)});return n.ok?{ok:!0,number:n.number,target:t.key,skippedOccupied:n.skippedOccupied,skippedReserved:n.skippedReserved}:n}let r=e.config.scopes.filter(t=>t.registryDir===e.dirRel);if(r.length===0)return{ok:!1,error:`目录「${e.dirRel}」未登记为任何 scope 的注册表(请在 numbering 插件配置注册后再取号)`};let i=[...new Set(r.flatMap(e=>e.numbering.reserved.map(e=>e.number)))],a=ap({basenames:vp(e.root,e.dirRel??``),rule:_p,reserved:i});return a.ok?{ok:!0,number:a.number,target:e.dirRel??``,skippedOccupied:a.skippedOccupied,skippedReserved:a.skippedReserved}:a}function bp(e){let t=e.dirRel===void 0?e.config.scopes:e.config.scopes.filter(t=>t.registryDir===e.dirRel),n=[],r=0;for(let i of t){let t=vp(e.root,i.registryDir);r+=t.length;let a=e.dirRel===void 0?e.config.numbering.allowlist.filter(e=>e.scopeKey===i.key).map(e=>({...e,files:[...e.files]})):e.config.numbering.allowlist.filter(t=>t.scopeKey===i.key&&t.files.some(t=>t.startsWith(`${e.dirRel}/`))).map(e=>({...e,files:[...e.files]})),o=sp({scopeKey:i.key,basenames:t,rule:_p,reserved:i.numbering.reserved,allowlist:a,slugDigitPolicy:i.slugDigitPolicy,toRepoRelative:e=>`${i.registryDir}/${e}`});n.push(...o.findings)}return{findings:n,scopeCount:t.length,scannedFiles:r}}function xp(e){let t=[];for(let n of e.config.numbering.audit.roots)t.push(...gp(d(e.root,n),{excludeGlobs:e.config.numbering.globalExclusions.map(e=>e.glob)}).map(e=>n===``?e:`${n}/${e}`));return{findings:cp({files:t,numberishPattern:e.config.numbering.audit.numberishPattern,registryDirs:e.config.scopes.map(e=>e.registryDir),pending:e.config.numbering.audit.pending}),scannedFiles:t.length}}const Sp=W({scope:V().min(1),dir:V().min(1).optional()}),Cp=W({dir:V().min(1).optional()}),wp=W({});function Tp(e){return Jf(e)}const Ep=_d({name:`numbering`,version:`0.0.1`,configSchema:qf,provides:{numbering:{next:e=>yp(e)}},commands:[e=>Dp(e),e=>Op(e),e=>kp(e)]});function Dp(e){return X({name:`numbering-next`,description:`取号:max+1 顺延跳已占与保留,宽度随最大键`,options:[{flags:`--scope <key>`,description:`scope key`},{flags:`--dir <dir>`,description:`目录增量定向(可选)`}],schema:Sp,action:async t=>{let n=Tp(e.pluginConfig),r=yp({root:process.cwd(),config:n,scopeKey:t.scope});r.ok?process.stdout.write(`${JSON.stringify(r,null,2)}\n`):(process.stderr.write(`错误: ${r.error}\n`),process.exit(1))}})}function Op(e){return X({name:`numbering-check`,description:`编号违例判定:撞号、保留号占用、零填充混用、豁免陈旧、slug 数字策略`,options:[{flags:`--dir <dir>`,description:`目录增量定向(可选)`}],schema:Cp,action:async t=>{let n=Tp(e.pluginConfig),r=bp({root:process.cwd(),config:n,dirRel:t.dir});for(let e of r.findings)process.stderr.write(`[numbering:${e.kind}] ${e.message}\n`);r.findings.length>0&&process.exit(1)}})}function kp(e){return X({name:`numbering-audit`,description:`覆盖面审计:形似编号文件必须被 scope、排除、pending 之一覆盖`,schema:wp,action:async()=>{let t=Tp(e.pluginConfig),n=xp({root:process.cwd(),config:t});for(let e of n.findings)process.stderr.write(`[numbering:${e.kind}] ${e.message}\n`);n.findings.length>0&&process.exit(1)}})}const Ap=`.lzi/docs/revisions`,jp=W({revisionsRoot:V().min(1).refine(e=>!e.startsWith(`/`),`真源根须为仓库根相对路径`).default(Ap)}).default({revisionsRoot:Ap}),Mp=e=>{let t=jp.safeParse(e);if(!t.success)throw Error(`revisions 插件配置非法:${t.error.issues.map(e=>`${e.path.join(`.`)||`根节`}——${e.message}`).join(`,`)}`);return t.data},Np=/^(\d{3})-([^/]+)$/,Pp=/^[^/].*\.md$/,Fp=e=>{if(e.startsWith(`/`)||e.includes(`../`)||e===`..`||!Pp.test(e))throw Error(`目标文档路径非法:${e},合法形态为仓内相对 md 路径`);let t=e.slice(0,-3).toLowerCase().split(`/`).map(e=>e.replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)).filter(e=>e.length>0).join(`-`);if(!pd.test(t)||t.length===0)throw Error(`目标文档路径派生不出合法组名:${e}`);return t},Ip=e=>{let t=e.endsWith(`.md`)?e.slice(0,-3):e,n=Np.exec(t);return n===null?null:{number:Number(n[1]??``),slug:n[2]??``}},Lp=e=>{let t=e.slug??Cd(e.title);if(!pd.test(t))throw Error(`事件 slug 非法:${t||`空`},请修正标题或显式提供 --slug,形态为 ASCII kebab`);return t},Rp=(e,t,n)=>[`# ${String(t).padStart(3,`0`)}. ${e.title}`,``,`- 目标文档:\`${e.targetPath}\``,`- 日期:${n}`,`- 关联:按需补 commit 或 ADR 或 record 指针`,``,`## 动机`,``,`待填写`,``,`## 变更内容`,``,`待填写`,``,`## 波及面`,``,`待填写`,``,`## 指针`,``,`按需补 commit 与 ADR 与 record 指针,无则删除本节`,``].join(`
211
211
  `),zp=async(e,t,n,r)=>{let i=Fp(r.targetPath),a=Lp(r),o=(n.groups.find(e=>e.dirName===i)?.entries.reduce((e,t)=>Math.max(e,t.number??0),0)??0)+1;if(o>999)throw Error(`组 ${i} 编号已达三位上限,无法续编`);let s=String(o).padStart(3,`0`),c=r.date??(/* @__PURE__ */ new Date()).toISOString().slice(0,10),l=d(e,t,i),u=d(l,`${s}-${a}.md`);return await S(l,{recursive:!0}),await T(u,Rp(r,o,c),`utf8`),{groupName:i,number:o,entryPath:`${t}/${i}/${s}-${a}.md`}},Bp=/^\d{4}-\d{2}-\d{2}$/,Vp=async e=>{try{return await w(e),!0}catch{return!1}},Hp=async(e,t,n)=>{let r=`${t.dirName}/`;for(let e of t.strays)n.push({kind:`group-stray`,message:`${r}${e} 组内散文件违规,组目录只收纳条目 md 文件`});let i=/* @__PURE__ */ new Map,a=/* @__PURE__ */ new Set;for(let e of t.entries){if(e.number===null||e.slug===null)n.push({kind:`entry-prefix-invalid`,message:`${r}${e.fileName} 前缀违规,条目文件名须为三位数值前缀即 NNN-事件slug.md`});else{pd.test(e.slug)||n.push({kind:`entry-slug-invalid`,message:`${r}${e.fileName} slug 违规,事件 slug 须为 ASCII kebab 形态`});let t=i.get(e.number);t===void 0?i.set(e.number,e.fileName):n.push({kind:`number-conflict`,message:`${r}${e.fileName} 与 ${t} 组内重号,编号即修订计数不得重复`}),e.target!==null&&a.add(e.target)}e.target===null&&n.push({kind:`metadata-missing`,message:`${r}${e.fileName} 缺目标文档声明行,形态为 - 目标文档:加反引号路径`}),e.date===null?n.push({kind:`metadata-missing`,message:`${r}${e.fileName} 缺日期声明行,形态为 - 日期:YYYY-MM-DD`}):Bp.test(e.date)||n.push({kind:`date-invalid`,message:`${r}${e.fileName} 日期形态违规,须为 YYYY-MM-DD`}),(!e.hasMotivationSection||!e.hasChangesSection)&&n.push({kind:`section-missing`,message:`${r}${e.fileName} 必备章节缺失,动机与变更内容两节不得缺位`})}if(i.size>0){let e=Math.max(...i.keys());for(let t=1;t<=e;t+=1)i.has(t)||n.push({kind:`number-gap`,message:`${r}编号 ${String(t).padStart(3,`0`)} 缺位,组内编号即修订计数须自 001 连续`})}a.size>1&&n.push({kind:`target-conflict`,message:`${r}组内目标文档声明冲突,${[...a].join(` 与 `)},一组只承载一个目标文档的修订史`});let o=t.entries.find(e=>e.target!==null)?.target??null;if(o!==null){try{let e=Fp(o);e!==t.dirName&&n.push({kind:`group-name-mismatch`,message:`${r}组名失配,声明目标 ${o} 的派生组名为 ${e}`})}catch(e){n.push({kind:`group-name-mismatch`,message:`${r}声明目标 ${o} 派生失败,${e instanceof Error?e.message:String(e)}`})}await Vp(d(e,o))||n.push({kind:`target-missing`,message:`${r}目标文档 ${o} 不存在`})}},Up=async(e,t)=>{let n=[];for(let e of t.rootStrays)n.push({kind:`root-stray`,message:`${e} 真源根散文件违规,真源根只收纳组目录`});for(let r of t.groups)await Hp(e,r,n);return{groupCount:t.groups.length,entryCount:t.groups.reduce((e,t)=>e+t.entries.length,0),findings:n}},Wp=e=>{let t=e.groups.map(e=>({group:e.dirName,entryCount:e.entries.length,latestNumber:e.entries.reduce((e,t)=>Math.max(e,t.number??0),0)||null,latestDate:e.entries.reduce((e,t)=>t.date!==null&&(e===null||t.date>e)?t.date:e,null)}));return{groupCount:t.length,entryCount:t.reduce((e,t)=>e+t.entryCount,0),groups:t}},Gp=e=>{let t=e.groups.map(e=>`| ${e.group} | ${e.entryCount} | ${e.latestNumber===null?`—`:String(e.latestNumber).padStart(3,`0`)} | ${e.latestDate??`—`} |`);return[`组 ${e.groupCount},条目 ${e.entryCount}`,``,`| 组 | 条目数 | 最新编号 | 最新日期 |`,`| --- | --- | --- | --- |`,...t].join(`
212
- `)},Kp=/^-\s*目标文档:\s*`([^`]+)`\s*$/m,qp=/^-\s*日期:\s*(\S+)\s*$/m,Jp=/^##\s*动机\s*$/m,Yp=/^##\s*变更内容\s*$/m,Xp=async e=>{try{return await w(e),!0}catch{return!1}},Zp=e=>{let t=Kp.exec(e),n=qp.exec(e);return{target:t?.[1]??null,date:n?.[1]??null,hasMotivationSection:Jp.test(e),hasChangesSection:Yp.test(e)}},Qp=async(e,t)=>{let n=await C(e,{withFileTypes:!0}),r=[],i=[];for(let t of n){if(!t.isFile()||!t.name.endsWith(`.md`)){i.push(t.name);continue}let n=Ip(t.name),a=await Bun.file(d(e,t.name)).text();r.push({fileName:t.name,number:n?.number??null,slug:n?.slug??null,...Zp(a)})}return r.sort((e,t)=>e.fileName.localeCompare(t.fileName)),{dirName:t,entries:r,strays:i}},$p=async(e,t)=>{let n=d(e,t);if(!await Xp(n))return{rootExists:!1,rootStrays:[],groups:[]};let r=await C(n,{withFileTypes:!0}),i=[],a=[];for(let e of r)e.isDirectory()?i.push(await Qp(d(n,e.name),e.name)):a.push(e.name);return i.sort((e,t)=>e.dirName.localeCompare(t.dirName)),{rootExists:!0,rootStrays:a,groups:i}},em=async(e,t)=>{let n=await $p(e,t.revisionsRoot);return{rootExists:n.rootExists,rootStrays:n.rootStrays,groups:n.groups.map(e=>({group:e.dirName,entryCount:e.entries.length,nextNumber:e.entries.reduce((e,t)=>Math.max(e,t.number??0),0)+1}))}},tm=async(e,t,n)=>{let r=await $p(e,t.revisionsRoot);return zp(e,t.revisionsRoot,r,n)},nm=async(e,t)=>{let n=await $p(e,t.revisionsRoot);return Up(e,n)},rm=async(e,t)=>{let n=await $p(e,t.revisionsRoot),r=Wp(n);return{data:r,markdown:Gp(r)}},im=W({}),am=W({target:V().min(1),title:V().min(1),slug:V().min(1).optional(),date:V().regex(/^\d{4}-\d{2}-\d{2}$/,`日期须为 YYYY-MM-DD 形态`).optional()}),om=W({}),sm=W({json:Jc().default(!1)}),cm=_d({name:`revisions`,version:`0.0.1`,configSchema:jp,commands:[e=>lm(e),e=>um(e),e=>dm(e),e=>fm(e)]});function lm(e){return X({name:`revisions-scan`,description:`扫描修订记注册表出清单:组、条目计数与下号预览`,schema:im,action:async()=>{try{let t=await em(process.cwd(),Mp(e.pluginConfig));process.stdout.write(`${JSON.stringify(t,null,2)}\n`)}catch(e){process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}}})}function um(e){return X({name:`revisions-add`,description:`为目标文档脚手架下一条修订记:定位或建组、组内取号、模板落盘`,options:[{flags:`--target <path>`,description:`被修订文档的仓内相对路径`},{flags:`--title <title>`,description:`修订标题即条目标题`},{flags:`--slug <slug>`,description:`显式事件 slug,中文标题时提供`},{flags:`--date <date>`,description:`条目日期,缺省当日`}],schema:am,action:async t=>{try{let n=await tm(process.cwd(),Mp(e.pluginConfig),{targetPath:t.target,title:t.title,slug:t.slug,date:t.date});process.stdout.write(`已建档 ${n.entryPath},组 ${n.groupName},编号 ${String(n.number).padStart(3,`0`)}\n`)}catch(e){process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}}})}function dm(e){return X({name:`revisions-check`,description:`只读校验:组名派生一致、目标实存、编号连续、必备节齐备`,schema:om,action:async()=>{try{let t=await nm(process.cwd(),Mp(e.pluginConfig));for(let e of t.findings)process.stderr.write(`[revisions:${e.kind}] ${e.message}\n`);t.findings.length>0&&process.exit(1),process.stdout.write(`校验通过,组 ${t.groupCount} 条目 ${t.entryCount} 全绿\n`)}catch(e){process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}}})}function fm(e){return X({name:`revisions-report`,description:`单仓修订记聚合上报:组计数、条目数、逐组最新动态`,options:[{flags:`--json`,description:`以 JSON 形态输出`}],schema:sm,action:async t=>{try{let n=await rm(process.cwd(),Mp(e.pluginConfig));process.stdout.write(`${t.json?JSON.stringify(n.data,null,2):n.markdown}\n`)}catch(e){process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}}})}var pm=class extends Error{configPath;constructor(e,t){super(e),this.name=`SharedConfigError`,this.configPath=t}},mm=class extends pm{searchFrom;constructor(e){super(`未在 ${e} 找到配置文件`,e),this.name=`SharedConfigNotFoundError`,this.searchFrom=e}},hm=class extends pm{issues;constructor(e,t){super(`配置校验失败,共 ${e.length} 个问题`,t),this.name=`SharedConfigValidationError`,this.issues=e}};function gm(e,t,n,r){let i=e;if(r.schema!==void 0){let e=r.schema.safeParse(i);if(!e.success)throw new hm(e.error.issues,t);i=e.data}return r.transform!==void 0&&(i=r.transform(i,n)),i}var _m=class extends pm{cause;constructor(e,t){super(`加载配置文件 ${e} 失败`,e),this.name=`SharedConfigLoadError`,this.cause=t}};function vm(e){return typeof e==`object`&&!!e}function ym(e){return typeof e==`object`&&!!e}async function bm(e,t={}){let n=p(e);if(!i(n))throw new mm(n);let r;try{let e=await import(n);r=vm(e)?e.default:void 0}catch(e){throw new _m(n,e)}if(r===void 0)throw new _m(n,TypeError(`配置文件缺少默认导出`));if(!ym(r))throw new _m(n,TypeError(`配置文件的默认导出必须是对象`));return{config:gm(r,n,u(n),t),configFilePath:n}}function xm(e=process.cwd()){let t=p(e);for(;;){let e=d(t,`lzi.config.ts`);if(i(e))return e;let n=u(t);if(n===t)return null;t=n}}async function Sm(e={}){let t=e.cwd??process.cwd(),n=xm(t);if(n===null)throw new mm(t);let r=p(n,`..`),{config:i}=await bm(n);return{config:i,configPath:r,configFilePath:n}}function Cm(e){return typeof e==`object`&&!!e}async function wm(e){let t;try{t=await C(e)}catch(t){throw new _m(e,t)}let n=t.filter(e=>e.endsWith(`.config.ts`)).sort();if(n.length===0)throw new _m(e,Error(`配置目录内没有 .config.ts 分片文件`));let r={};for(let t of n){let n=await bm(d(e,t));r={...r,...n.config}}let i=r;if(!Cm(i))throw new _m(e,Error(`配置目录合并结果不是对象形态`));return i}function Tm(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=p(t);for(;;){for(let e of n){let t=d(r,e);if(Em(t))return t}let e=u(r);if(e===r)return null;r=e}}function Em(e){try{return c(e).isDirectory()}catch{return!1}}function Dm(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=p(t);for(;;){for(let e of n){let t=d(r,e);if(i(t))return t}let e=u(r);if(e===r)return null;r=e}}function Om(e){return typeof e==`object`&&!!e}function km(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function Am(e={}){let t=e.cwd??p(process.cwd());if(e.explicitPath!==void 0){let t=await bm(e.explicitPath,{schema:e.schema,transform:e.transform});return{success:!0,config:t.config,source:`explicit`,configFilePath:t.configFilePath}}if(e.standaloneFile!==void 0){let n=Dm(e.standaloneFile,t);if(n!==null){let{config:t}=await bm(n);return{success:!0,config:gm(t,n,u(n),e),source:`standalone`,configFilePath:n}}}if(e.standaloneDir!==void 0){let n=Tm(e.standaloneDir,t);if(n!==null)return{success:!0,config:gm(await wm(n),n,n,e),source:`standalone`,configFilePath:n}}if(e.unifiedField!==void 0){let n,r;try{let{config:i,configFilePath:a}=await Sm({cwd:t}),o=i;n=km(o)?o[e.unifiedField]:void 0,r=a}catch{}if(r!==void 0&&n!==void 0&&Om(n))return{success:!0,config:gm(n,r,u(r),e),source:`unified`,configFilePath:r}}return{success:!1,configFilePath:null}}async function jm(e){let t=await Am({standaloneFile:`lzi-docs.config.ts`,unifiedField:`docs`,cwd:e});if(!t.success)throw Error(`未在 ${e} 及其上级目录找到 lzi-docs.config.ts 或 lzi.config.ts 的 docs 字段,请先创建工具专属配置`);let n=t.config;return{source:n.source??`git@gitcode.com:longzai-tech/longzai-intelligence-docs.git`,namespace:n.namespace??`longzai-intelligence`,base:n.base??`docs`,docs:n.docs,packages:n.packages,plugins:n.plugins}}async function Mm(e){try{return await jm(e)}catch(e){if(e instanceof Error&&e.message.includes(`lzi-docs.config.ts`))return;throw e}}async function Nm(e,t,n){let r=[],i=[...t],a=Object.fromEntries(Object.entries(n?.plugins??{}).filter(([,e])=>e.entry===void 0).map(([e,t])=>[e,t.options])),o=new Set(i.map(e=>e.name));for(let[t,s]of Object.entries(n?.plugins??{}))if(s.enabled!==!1){if(o.has(t)){if(s.entry===void 0)continue;r.push(`插件名「${t}」与已装载插件重名(内置或先装载者保留,如需覆盖请移除内置声明)`)}else try{let t=await Od(s.entry,e);i.push(t),o.add(t.name),a[t.name]=s.options}catch(e){let n=e instanceof Error?e.message:String(e);r.push(`插件「${t}」装载失败:${n}`)}}return{plugins:i,pluginOptions:a,errors:r}}function Pm(e,t,n){let{services:r,errors:i}=vd(t);if(i.length>0)return i;let a=t.map(e=>e.hooks??{});for(let i of t){let t;if(i.configSchema!==void 0){let e=i.configSchema.safeParse(n[i.name]);e.success||(t=e.error.issues.map(e=>e.message).join(`;`))}if(t!==void 0)return[`插件「${i.name}」配置节校验失败:${t}`];let o={services:yd(i,r),pluginConfig:n[i.name],allHooks:a};for(let t of i.commands)ql(e,t(o))}return[]}function Fm(e,t){let n=[],r=new Map(t.map(e=>[e.category,new Set(e.names)]));for(let[t,i]of Object.entries(e??{})){let e=r.get(t);if(e===void 0)n.push(`${t}/*(目录中无此分类)`);else for(let r of Object.keys(i))e.has(r)||n.push(`${t}/${r}`)}return n}function Im(e,t){let n=[];for(let i of t){let t;try{t=new Set(r.readdirSync(l.join(e,`library`,i.category),{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name))}catch{n.push(`${i.category}/*(library 下无此分类目录)`);continue}for(let e of i.names)t.has(e)||n.push(`${i.category}/${e}(library 缺此目录)`);for(let e of t)i.names.includes(e)||n.push(`${i.category}/${e}(library 有而目录未登记)`)}return n}const Lm=RegExp(`^(${md})\\.plugin\\.ts$`),Rm=RegExp(`^(${md})\\.docs\\.ts$`),zm=RegExp(`^(${md})\\.source\\.ts$`);function Bm(e){let t=l.join(e,Ld);try{return o(t),t}catch{return null}}function Vm(e){let t=process.env.LZI_DOCS_REGISTRY_ROOT;if(t!==void 0&&t.trim()!==``&&Bm(t)!==null)return t;let n=e;for(;;){let e=l.join(n,`longzai-intelligence-docs-registry`);if(Bm(e)!==null)return e;let t=l.dirname(n);if(t===n)return null;n=t}}function Hm(e,t,n){try{return o(l.join(e,Ld,t)).filter(e=>n.test(e)).sort()}catch{return[]}}async function Um(e){let t=Hm(e,`plugins`,Lm),n=Hm(e,`docs`,Rm),r=Hm(e,`sources`,zm);if(t.length===0&&n.length===0&&r.length===0)throw Error(`docs-registry 声明域为空(${e})——至少须有一个插件登记档、目录档或真源档`);let i=[];for(let n of t){let t=Lm.exec(n)?.[1]??``,r=await Gm(l.join(e,Ld,`plugins`,n)),a=kd.safeParse(r);if(!a.success)throw Error(`插件登记档 ${n} 非法:${a.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);if(a.data.name!==t)throw Error(`插件登记档 ${n} 的 name「${a.data.name}」与文件名不符`);i.push(a.data)}let a=[];for(let t of n){let n=Rm.exec(t)?.[1]??``,r=await Gm(l.join(e,Ld,`docs`,t)),i=Ad.safeParse(r);if(!i.success)throw Error(`文档目录档 ${t} 非法:${i.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);if(i.data.category!==n)throw Error(`文档目录档 ${t} 的 category「${i.data.category}」与文件名不符`);a.push(i.data)}let o=[];for(let t of r){let n=zm.exec(t)?.[1]??``,r=await Gm(l.join(e,Ld,`sources`,t)),i=Id.safeParse(r);if(!i.success)throw Error(`真源登记档 ${t} 非法:${i.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);if(i.data.name!==n)throw Error(`真源登记档 ${t} 的 name「${i.data.name}」与文件名不符`);o.push(i.data)}if(new Set(i.map(e=>e.name)).size!==i.length)throw Error(`docs-registry 插件登记名重复`);if(new Set(a.map(e=>e.category)).size!==a.length)throw Error(`docs-registry 文档分类名重复`);if(new Set(o.map(e=>e.name)).size!==o.length)throw Error(`docs-registry 真源登记名重复`);return{root:e,plugins:i,docCategories:a,sources:o}}async function Wm(e){let t=Vm(e);return t===null?null:Um(t)}async function Gm(e){let t=await import(m(s(e)).href);return Km(t)?t.default:t}function Km(e){return typeof e==`object`&&!!e&&`default`in e}const qm=`lzi-docs.lock`;function Jm(e){let t=l.join(e,qm);if(!r.existsSync(t))return null;let n=r.readFileSync(t,`utf-8`),i=JSON.parse(n);if(!Ym(i))throw Error(`lzi-docs.lock 内容非法(期望:包路径 -> 文档类型/名称 -> 版本字符串)`);return i}function Ym(e){return typeof e!=`object`||!e?!1:Object.values(e).every(e=>typeof e!=`object`||!e?!1:Object.values(e).every(e=>typeof e==`string`))}function Xm(e,t){let n=l.join(e,qm),i=Zm(t);r.writeFileSync(n,JSON.stringify(i,null,2)+`
212
+ `)},Kp=/^-\s*目标文档:\s*`([^`]+)`\s*$/m,qp=/^-\s*日期:\s*(\S+)\s*$/m,Jp=/^##\s*动机\s*$/m,Yp=/^##\s*变更内容\s*$/m,Xp=async e=>{try{return await w(e),!0}catch{return!1}},Zp=e=>{let t=Kp.exec(e),n=qp.exec(e);return{target:t?.[1]??null,date:n?.[1]??null,hasMotivationSection:Jp.test(e),hasChangesSection:Yp.test(e)}},Qp=async(e,t)=>{let n=await C(e,{withFileTypes:!0}),r=[],i=[];for(let t of n){if(!t.isFile()||!t.name.endsWith(`.md`)){i.push(t.name);continue}let n=Ip(t.name),a=await Bun.file(d(e,t.name)).text();r.push({fileName:t.name,number:n?.number??null,slug:n?.slug??null,...Zp(a)})}return r.sort((e,t)=>e.fileName.localeCompare(t.fileName)),{dirName:t,entries:r,strays:i}},$p=async(e,t)=>{let n=d(e,t);if(!await Xp(n))return{rootExists:!1,rootStrays:[],groups:[]};let r=await C(n,{withFileTypes:!0}),i=[],a=[];for(let e of r)e.isDirectory()?i.push(await Qp(d(n,e.name),e.name)):a.push(e.name);return i.sort((e,t)=>e.dirName.localeCompare(t.dirName)),{rootExists:!0,rootStrays:a,groups:i}},em=async(e,t)=>{let n=await $p(e,t.revisionsRoot);return{rootExists:n.rootExists,rootStrays:n.rootStrays,groups:n.groups.map(e=>({group:e.dirName,entryCount:e.entries.length,nextNumber:e.entries.reduce((e,t)=>Math.max(e,t.number??0),0)+1}))}},tm=async(e,t,n)=>{let r=await $p(e,t.revisionsRoot);return zp(e,t.revisionsRoot,r,n)},nm=async(e,t)=>{let n=await $p(e,t.revisionsRoot);return Up(e,n)},rm=async(e,t)=>{let n=await $p(e,t.revisionsRoot),r=Wp(n);return{data:r,markdown:Gp(r)}},im=W({}),am=W({target:V().min(1),title:V().min(1),slug:V().min(1).optional(),date:V().regex(/^\d{4}-\d{2}-\d{2}$/,`日期须为 YYYY-MM-DD 形态`).optional()}),om=W({}),sm=W({json:Jc().default(!1)}),cm=_d({name:`revisions`,version:`0.0.1`,configSchema:jp,commands:[e=>lm(e),e=>um(e),e=>dm(e),e=>fm(e)]});function lm(e){return X({name:`revisions-scan`,description:`扫描修订记注册表出清单:组、条目计数与下号预览`,schema:im,action:async()=>{try{let t=await em(process.cwd(),Mp(e.pluginConfig));process.stdout.write(`${JSON.stringify(t,null,2)}\n`)}catch(e){process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}}})}function um(e){return X({name:`revisions-add`,description:`为目标文档脚手架下一条修订记:定位或建组、组内取号、模板落盘`,options:[{flags:`--target <path>`,description:`被修订文档的仓内相对路径`},{flags:`--title <title>`,description:`修订标题即条目标题`},{flags:`--slug <slug>`,description:`显式事件 slug,中文标题时提供`},{flags:`--date <date>`,description:`条目日期,缺省当日`}],schema:am,action:async t=>{try{let n=await tm(process.cwd(),Mp(e.pluginConfig),{targetPath:t.target,title:t.title,slug:t.slug,date:t.date});process.stdout.write(`已建档 ${n.entryPath},组 ${n.groupName},编号 ${String(n.number).padStart(3,`0`)}\n`)}catch(e){process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}}})}function dm(e){return X({name:`revisions-check`,description:`只读校验:组名派生一致、目标实存、编号连续、必备节齐备`,schema:om,action:async()=>{try{let t=await nm(process.cwd(),Mp(e.pluginConfig));for(let e of t.findings)process.stderr.write(`[revisions:${e.kind}] ${e.message}\n`);t.findings.length>0&&process.exit(1),process.stdout.write(`校验通过,组 ${t.groupCount} 条目 ${t.entryCount} 全绿\n`)}catch(e){process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}}})}function fm(e){return X({name:`revisions-report`,description:`单仓修订记聚合上报:组计数、条目数、逐组最新动态`,options:[{flags:`--json`,description:`以 JSON 形态输出`}],schema:sm,action:async t=>{try{let n=await rm(process.cwd(),Mp(e.pluginConfig));process.stdout.write(`${t.json?JSON.stringify(n.data,null,2):n.markdown}\n`)}catch(e){process.stderr.write(`错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}}})}var pm=class extends Error{configPath;constructor(e,t){super(e),this.name=`SharedConfigError`,this.configPath=t}},mm=class extends pm{searchFrom;constructor(e){super(`未在 ${e} 找到配置文件`,e),this.name=`SharedConfigNotFoundError`,this.searchFrom=e}},hm=class extends pm{issues;constructor(e,t){super(`配置校验失败,共 ${e.length} 个问题`,t),this.name=`SharedConfigValidationError`,this.issues=e}};function gm(e,t,n,r){let i=e;if(r.schema!==void 0){let e=r.schema.safeParse(i);if(!e.success)throw new hm(e.error.issues,t);i=e.data}return r.transform!==void 0&&(i=r.transform(i,n)),i}var _m=class extends pm{cause;constructor(e,t){super(`加载配置文件 ${e} 失败`,e),this.name=`SharedConfigLoadError`,this.cause=t}};function vm(e){return typeof e==`object`&&!!e}function ym(e){return typeof e==`object`&&!!e}async function bm(e,t={}){let n=p(e);if(!i(n))throw new mm(n);let r;try{let e=await import(n);r=vm(e)?e.default:void 0}catch(e){throw new _m(n,e)}if(r===void 0)throw new _m(n,TypeError(`配置文件缺少默认导出`));if(!ym(r))throw new _m(n,TypeError(`配置文件的默认导出必须是对象`));return{config:gm(r,n,u(n),t),configFilePath:n}}function xm(e=process.cwd()){let t=p(e);for(;;){let e=d(t,`lzi.config.ts`);if(i(e))return e;let n=u(t);if(n===t)return null;t=n}}async function Sm(e={}){let t=e.cwd??process.cwd(),n=xm(t);if(n===null)throw new mm(t);let r=p(n,`..`),{config:i}=await bm(n);return{config:i,configPath:r,configFilePath:n}}function Cm(e){return typeof e==`object`&&!!e}async function wm(e){let t;try{t=await C(e)}catch(t){throw new _m(e,t)}let n=t.filter(e=>e.endsWith(`.config.ts`)).sort();if(n.length===0)throw new _m(e,Error(`配置目录内没有 .config.ts 分片文件`));let r={};for(let t of n){let n=await bm(d(e,t));r={...r,...n.config}}let i=r;if(!Cm(i))throw new _m(e,Error(`配置目录合并结果不是对象形态`));return i}function Tm(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=p(t);for(;;){for(let e of n){let t=d(r,e);if(Em(t))return t}let e=u(r);if(e===r)return null;r=e}}function Em(e){try{return c(e).isDirectory()}catch{return!1}}function Dm(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=p(t);for(;;){for(let e of n){let t=d(r,e);if(i(t))return t}let e=u(r);if(e===r)return null;r=e}}function Om(e){return typeof e==`object`&&!!e}function km(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function Am(e={}){let t=e.cwd??p(process.cwd());if(e.explicitPath!==void 0){let t=await bm(e.explicitPath,{schema:e.schema,transform:e.transform});return{success:!0,config:t.config,source:`explicit`,configFilePath:t.configFilePath}}if(e.standaloneFile!==void 0){let n=Dm(e.standaloneFile,t);if(n!==null){let{config:t}=await bm(n);return{success:!0,config:gm(t,n,u(n),e),source:`standalone`,configFilePath:n}}}if(e.standaloneDir!==void 0){let n=Tm(e.standaloneDir,t);if(n!==null)return{success:!0,config:gm(await wm(n),n,n,e),source:`standalone`,configFilePath:n}}if(e.unifiedField!==void 0){let n,r;try{let{config:i,configFilePath:a}=await Sm({cwd:t}),o=i;n=km(o)?o[e.unifiedField]:void 0,r=a}catch{}if(r!==void 0&&n!==void 0&&Om(n))return{success:!0,config:gm(n,r,u(r),e),source:`unified`,configFilePath:r}}return{success:!1,configFilePath:null}}async function jm(e){let t=await Am({standaloneFile:`lzi-docs.config.ts`,unifiedField:`docs`,cwd:e});if(!t.success)throw Error(`未在 ${e} 及其上级目录找到 lzi-docs.config.ts 或 lzi.config.ts 的 docs 字段,请先创建工具专属配置`);let n=t.config;return{source:n.source??`git@gitcode.com:longzai-tech/longzai-intelligence-docs.git`,namespace:n.namespace??`longzai-intelligence`,base:n.base??`docs`,docs:n.docs,packages:n.packages,plugins:n.plugins}}async function Mm(e){try{return await jm(e)}catch(e){if(e instanceof Error&&e.message.includes(`lzi-docs.config.ts`))return;throw e}}async function Nm(e,t,n){let r=[],i=[...t],a=Object.fromEntries(Object.entries(n?.plugins??{}).filter(([,e])=>e.entry===void 0).map(([e,t])=>[e,t.options])),o=new Set(i.map(e=>e.name));for(let[t,s]of Object.entries(n?.plugins??{}))if(s.enabled!==!1&&s.entry!==void 0){if(o.has(t))r.push(`插件名「${t}」与已装载插件重名(内置或先装载者保留,如需覆盖请移除内置声明)`);else try{let t=await Od(s.entry,e);i.push(t),o.add(t.name),a[t.name]=s.options}catch(e){let n=e instanceof Error?e.message:String(e);r.push(`插件「${t}」装载失败:${n}`)}}return{plugins:i,pluginOptions:a,errors:r}}function Pm(e,t,n){let{services:r,errors:i}=vd(t);if(i.length>0)return i;let a=t.map(e=>e.hooks??{});for(let i of t){let t;if(i.configSchema!==void 0){let e=i.configSchema.safeParse(n[i.name]);e.success||(t=e.error.issues.map(e=>e.message).join(`;`))}if(t!==void 0)return[`插件「${i.name}」配置节校验失败:${t}`];let o={services:yd(i,r),pluginConfig:n[i.name],allHooks:a};for(let t of i.commands)ql(e,t(o))}return[]}function Fm(e,t){let n=[],r=new Map(t.map(e=>[e.category,new Set(e.names)]));for(let[t,i]of Object.entries(e??{})){let e=r.get(t);if(e===void 0)n.push(`${t}/*(目录中无此分类)`);else for(let r of Object.keys(i))e.has(r)||n.push(`${t}/${r}`)}return n}function Im(e,t){let n=[];for(let i of t){let t;try{t=new Set(r.readdirSync(l.join(e,`library`,i.category),{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name))}catch{n.push(`${i.category}/*(library 下无此分类目录)`);continue}for(let e of i.names)t.has(e)||n.push(`${i.category}/${e}(library 缺此目录)`);for(let e of t)i.names.includes(e)||n.push(`${i.category}/${e}(library 有而目录未登记)`)}return n}const Lm=RegExp(`^(${md})\\.plugin\\.ts$`),Rm=RegExp(`^(${md})\\.docs\\.ts$`),zm=RegExp(`^(${md})\\.source\\.ts$`);function Bm(e){let t=l.join(e,Ld);try{return o(t),t}catch{return null}}function Vm(e){let t=process.env.LZI_DOCS_REGISTRY_ROOT;if(t!==void 0&&t.trim()!==``&&Bm(t)!==null)return t;let n=e;for(;;){let e=l.join(n,`longzai-intelligence-docs-registry`);if(Bm(e)!==null)return e;let t=l.dirname(n);if(t===n)return null;n=t}}function Hm(e,t,n){try{return o(l.join(e,Ld,t)).filter(e=>n.test(e)).sort()}catch{return[]}}async function Um(e){let t=Hm(e,`plugins`,Lm),n=Hm(e,`docs`,Rm),r=Hm(e,`sources`,zm);if(t.length===0&&n.length===0&&r.length===0)throw Error(`docs-registry 声明域为空(${e})——至少须有一个插件登记档、目录档或真源档`);let i=[];for(let n of t){let t=Lm.exec(n)?.[1]??``,r=await Gm(l.join(e,Ld,`plugins`,n)),a=kd.safeParse(r);if(!a.success)throw Error(`插件登记档 ${n} 非法:${a.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);if(a.data.name!==t)throw Error(`插件登记档 ${n} 的 name「${a.data.name}」与文件名不符`);i.push(a.data)}let a=[];for(let t of n){let n=Rm.exec(t)?.[1]??``,r=await Gm(l.join(e,Ld,`docs`,t)),i=Ad.safeParse(r);if(!i.success)throw Error(`文档目录档 ${t} 非法:${i.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);if(i.data.category!==n)throw Error(`文档目录档 ${t} 的 category「${i.data.category}」与文件名不符`);a.push(i.data)}let o=[];for(let t of r){let n=zm.exec(t)?.[1]??``,r=await Gm(l.join(e,Ld,`sources`,t)),i=Id.safeParse(r);if(!i.success)throw Error(`真源登记档 ${t} 非法:${i.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);if(i.data.name!==n)throw Error(`真源登记档 ${t} 的 name「${i.data.name}」与文件名不符`);o.push(i.data)}if(new Set(i.map(e=>e.name)).size!==i.length)throw Error(`docs-registry 插件登记名重复`);if(new Set(a.map(e=>e.category)).size!==a.length)throw Error(`docs-registry 文档分类名重复`);if(new Set(o.map(e=>e.name)).size!==o.length)throw Error(`docs-registry 真源登记名重复`);return{root:e,plugins:i,docCategories:a,sources:o}}async function Wm(e){let t=Vm(e);return t===null?null:Um(t)}async function Gm(e){let t=await import(m(s(e)).href);return Km(t)?t.default:t}function Km(e){return typeof e==`object`&&!!e&&`default`in e}const qm=`lzi-docs.lock`;function Jm(e){let t=l.join(e,qm);if(!r.existsSync(t))return null;let n=r.readFileSync(t,`utf-8`),i=JSON.parse(n);if(!Ym(i))throw Error(`lzi-docs.lock 内容非法(期望:包路径 -> 文档类型/名称 -> 版本字符串)`);return i}function Ym(e){return typeof e!=`object`||!e?!1:Object.values(e).every(e=>typeof e!=`object`||!e?!1:Object.values(e).every(e=>typeof e==`string`))}function Xm(e,t){let n=l.join(e,qm),i=Zm(t);r.writeFileSync(n,JSON.stringify(i,null,2)+`
213
213
  `,`utf-8`)}function Zm(e){let t={};for(let n of e){let e=$m(n.dest),r=`${n.category}/${n.name}`;t[e]||(t[e]={}),t[e][r]=n.version}return t}function Qm(e,t){if(!t)return{added:e,removed:[],changed:[]};let n=[],r=[],i=[],a=/* @__PURE__ */ new Map;for(let t of e){let e=`${$m(t.dest)}::${t.category}/${t.name}`;a.set(e,t)}let o=/* @__PURE__ */ new Map;for(let[e,n]of Object.entries(t))for(let[t,r]of Object.entries(n)){let n=`${e}::${t}`,[i=``,a=``]=t.split(`/`);o.set(n,{packagePath:e,category:i,name:a,version:r})}for(let[e,t]of a){let r=o.get(e);r?r.version!==t.version&&i.push(t):n.push(t)}for(let[e,t]of o)a.has(e)||r.push({category:t.category,name:t.name,version:t.version,dest:``});return{added:n,removed:r,changed:i}}function $m(e){let t=e.split(l.sep),[n=``,r=``]=t;return t.length>=2&&n===`packages`?l.join(n,r):`.`}const eh={docs:{standards:{nextjs:`1.1.0`,tsconfig:`1.0.0`}}},th={docs:{standards:{react:`2.0.0`,tsconfig:`1.0.0`}}},nh={docs:{standards:{tsconfig:`1.0.0`},guides:{"code-review":`1.0.0`}}};var rh=/* @__PURE__ */ ne({nextjs:()=>eh,node:()=>nh,react:()=>th});function ih(e){return typeof e==`object`&&!!e&&`docs`in e&&typeof e.docs==`object`}const ah=Object.fromEntries(Object.entries(rh).filter(([,e])=>ih(e)));function oh(e,t){let n={...e};for(let r of Object.keys(t)){let i=t[r];i&&(n[r]={...e[r],...i})}return n}function sh(e){return e.packages||e.docs,e}function ch(e){let t={};for(let n of e){let e=ah[n];e?.docs&&(t=oh(t,e.docs))}return t}async function lh(e){if(!e)throw Error(`未配置 source`);let n=l.isAbsolute(e)?e:l.resolve(e);if(r.existsSync(n))return n;let i=l.join(t.tmpdir(),`lzi-docs-cache`);r.existsSync(i)||r.mkdirSync(i,{recursive:!0});let a=uh(e),o=l.join(i,a);if(r.existsSync(o)){let{execSync:e}=await import(`node:child_process`);e(`git pull`,{cwd:o,stdio:`pipe`})}else{let{execSync:t}=await import(`node:child_process`);t(`git clone ${e} ${o}`,{stdio:`pipe`})}return o}function uh(e){return`lzi-docs-${l.basename(e,`.git`)}`}var dh=/* @__PURE__ */ A(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||
214
214
  /* istanbul ignore next */9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),fh=/* @__PURE__ */ A(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),ph=/* @__PURE__ */ A(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=dh(),a=fh();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),mh=/* @__PURE__ */ A(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),hh=/* @__PURE__ */ A(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),Z=/* @__PURE__ */ A(((e,t)=>{let n=fh(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=dh(),{safeRe:a,t:o}=ph(),s=mh(),{compareIdentifiers:c}=hh(),l=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(c(e[t],n[t])!==0)return!1;return!0};t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=l[4]?l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),l(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),gh=/* @__PURE__ */ A(((e,t)=>{let n=Z();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),_h=/* @__PURE__ */ A(((e,t)=>{let n=gh();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),vh=/* @__PURE__ */ A(((e,t)=>{let n=gh();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),yh=/* @__PURE__ */ A(((e,t)=>{let n=Z();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),bh=/* @__PURE__ */ A(((e,t)=>{let n=gh();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),xh=/* @__PURE__ */ A(((e,t)=>{let n=Z();t.exports=(e,t)=>new n(e,t).major})),Sh=/* @__PURE__ */ A(((e,t)=>{let n=Z();t.exports=(e,t)=>new n(e,t).minor})),Ch=/* @__PURE__ */ A(((e,t)=>{let n=Z();t.exports=(e,t)=>new n(e,t).patch})),wh=/* @__PURE__ */ A(((e,t)=>{let n=gh();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),Th=/* @__PURE__ */ A(((e,t)=>{let n=Z();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Eh=/* @__PURE__ */ A(((e,t)=>{let n=Th();t.exports=(e,t,r)=>n(t,e,r)})),Dh=/* @__PURE__ */ A(((e,t)=>{let n=Th();t.exports=(e,t)=>n(e,t,!0)})),Oh=/* @__PURE__ */ A(((e,t)=>{let n=Z();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),kh=/* @__PURE__ */ A(((e,t)=>{let n=Oh();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),Ah=/* @__PURE__ */ A(((e,t)=>{let n=Oh();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),jh=/* @__PURE__ */ A(((e,t)=>{let n=Th();t.exports=(e,t,r)=>n(e,t,r)>0})),Mh=/* @__PURE__ */ A(((e,t)=>{let n=Th();t.exports=(e,t,r)=>n(e,t,r)<0})),Nh=/* @__PURE__ */ A(((e,t)=>{let n=Th();t.exports=(e,t,r)=>n(e,t,r)===0})),Ph=/* @__PURE__ */ A(((e,t)=>{let n=Th();t.exports=(e,t,r)=>n(e,t,r)!==0})),Fh=/* @__PURE__ */ A(((e,t)=>{let n=Th();t.exports=(e,t,r)=>n(e,t,r)>=0})),Ih=/* @__PURE__ */ A(((e,t)=>{let n=Th();t.exports=(e,t,r)=>n(e,t,r)<=0})),Lh=/* @__PURE__ */ A(((e,t)=>{let n=Nh(),r=Ph(),i=jh(),a=Fh(),o=Mh(),s=Ih();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),Rh=/* @__PURE__ */ A(((e,t)=>{let n=Z(),r=gh(),{safeRe:i,t:a}=ph();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2],c=o[3]||`0`,l=o[4]||`0`,u=t.includePrerelease&&o[5]?`-${o[5]}`:``,d=t.includePrerelease&&o[6]?`+${o[6]}`:``;return r(`${s}.${c}.${l}${u}${d}`,t)}})),zh=/* @__PURE__ */ A(((e,t)=>{let n=gh(),r=dh(),i=Z(),a=(e,t,n)=>{if(!r.RELEASE_TYPES.includes(t))return null;let i=o(e,n);return i&&s(i,t)},o=(e,t)=>{let r=e instanceof i?e.version:e;return n(r,t)},s=(e,t)=>{if(c(t))return e.version;switch(e.prerelease=[],t){case`major`:e.minor=0,e.patch=0;break;case`minor`:e.patch=0}return e.format()},c=e=>e.startsWith(`pre`);t.exports=a})),Bh=/* @__PURE__ */ A(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),Vh=/* @__PURE__ */ A(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!_(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(g,``);let t=((this.options.includePrerelease&&m)|(this.options.loose&&h))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(s,k(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[u.COMPARATORTRIM],d),o(`comparator trim`,e),e=e.replace(c[u.TILDETRIM],f),o(`tilde trim`,e),e=e.replace(c[u.CARETTRIM],p),o(`caret trim`,e);let l=e.split(` `).map(e=>b(e,this.options)).join(` `).split(/\s+/).map(e=>O(e,this.options));i&&(l=l.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),o(`range list`,l);let v=/* @__PURE__ */ new Map,y=l.map(e=>new a(e,this.options));for(let e of y){if(_(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let x=[...v.values()];return r.set(t,x),x}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>y(e,n)&&t.set.some(t=>y(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(A(this.set[t],e,this.options))return!0;return!1}};let r=new(Bh()),i=mh(),a=Hh(),o=fh(),s=Z(),{safeRe:c,src:l,t:u,comparatorTrimReplace:d,tildeTrimReplace:f,caretTrimReplace:p}=ph(),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:h}=dh(),g=new RegExp(l[u.BUILD],`g`),_=e=>e.value===`<0.0.0-0`,v=e=>e.value===``,y=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},b=(e,t)=>(e=e.replace(c[u.BUILD],``),o(`comp`,e,t),e=T(e,t),o(`caret`,e),e=C(e,t),o(`tildes`,e),e=E(e,t),o(`xrange`,e),e=D(e,t),o(`stars`,e),e),x=e=>!e||e.toLowerCase()===`x`||e===`*`,S=(e,t,n)=>x(e)&&!x(t)||x(t)&&n&&!x(n),C=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(` `),w=(e,t)=>{let n=t.loose?c[u.TILDELOOSE]:c[u.TILDE],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`tilde`,e,t,n,i,a,s);let c;return x(n)?c=``:x(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?c=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:s?(o(`replaceTilde pr`,s),c=`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`):c=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,o(`tilde return`,c),c})},T=(e,t)=>e.trim().split(/\s+/).map(e=>ee(e,t)).join(` `),ee=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[u.CARETLOOSE]:c[u.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return x(n)?c=``:x(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},E=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>te(e,t)).join(` `)),te=(e,t)=>{e=e.trim();let n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{if(o(`xRange`,e,n,r,i,a,s,c),S(i,a,s))return e;let l=x(i),u=l||x(a),d=u||x(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},D=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[u.STAR],``)),O=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],``)),k=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=x(r)?``:x(i)?`>=${r}.0.0${e?`-0`:``}`:x(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=x(l)?``:x(u)?`<${+l+1}.0.0-0`:x(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),A=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),Hh=/* @__PURE__ */ A(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.value=this.semver===n?``:this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),this.semver=r[2]?new c(r[2],this.options.loose):n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new l(t.value,n).test(this.value):t.operator===``?t.value===``||new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=mh(),{safeRe:i,t:a}=ph(),o=Lh(),s=fh(),c=Z(),l=Vh()})),Uh=/* @__PURE__ */ A(((e,t)=>{let n=Vh();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),Wh=/* @__PURE__ */ A(((e,t)=>{let n=Vh();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),Gh=/* @__PURE__ */ A(((e,t)=>{let n=Z(),r=Vh();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),Kh=/* @__PURE__ */ A(((e,t)=>{let n=Z(),r=Vh();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),qh=/* @__PURE__ */ A(((e,t)=>{let n=Z(),r=Vh(),i=jh();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;
215
215
  /* istanbul ignore next */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longzai-intelligence-docs/cli",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "Longzai Intelligence Docs 文档同步 CLI",
5
5
  "keywords": [
6
6
  "cli",
@@ -39,11 +39,11 @@
39
39
  "dependencies": {
40
40
  "@longzai-intelligence-cli/core": "^0.0.11",
41
41
  "@longzai-intelligence-cli/standard": "^0.0.11",
42
- "@longzai-intelligence-docs/compile-plugin": "0.0.17",
43
- "@longzai-intelligence-docs/config": "0.0.17",
44
- "@longzai-intelligence-docs/core": "0.0.17",
45
- "@longzai-intelligence-docs/numbering-plugin": "0.0.17",
46
- "@longzai-intelligence-docs/revisions-plugin": "0.0.17",
42
+ "@longzai-intelligence-docs/compile-plugin": "0.0.18",
43
+ "@longzai-intelligence-docs/config": "0.0.18",
44
+ "@longzai-intelligence-docs/core": "0.0.18",
45
+ "@longzai-intelligence-docs/numbering-plugin": "0.0.18",
46
+ "@longzai-intelligence-docs/revisions-plugin": "0.0.18",
47
47
  "@longzai-intelligence-logger/node": "^0.1.0",
48
48
  "@longzai-intelligence-shared-config/core": "^0.0.9",
49
49
  "semver": "^7.7.2",