f0c3bf18b0
Published from npm package build Source: https://github.com/thedotmack/claude-mem-source
577 lines
685 KiB
JavaScript
Executable File
577 lines
685 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
||
import{createRequire as Gw}from"node:module";var Zw=Object.create;var{getPrototypeOf:kw,defineProperty:P4,getOwnPropertyNames:Xw}=Object;var Aw=Object.prototype.hasOwnProperty;var Oq=(q,_,j)=>{j=q!=null?Zw(kw(q)):{};let K=_||!q||!q.__esModule?P4(j,"default",{value:q,enumerable:!0}):j;for(let Y of Xw(q))if(!Aw.call(K,Y))P4(K,Y,{get:()=>q[Y],enumerable:!0});return K};var _8=(q,_)=>()=>(_||q((_={exports:{}}).exports,_),_.exports);var tq=(q,_)=>{for(var j in _)P4(q,j,{get:_[j],enumerable:!0,configurable:!0,set:(K)=>_[j]=()=>K})};var K6=(q,_)=>()=>(q&&(_=q(q=0)),_);var C6=Gw(import.meta.url);var LK=_8((uw)=>{class Y4 extends Error{constructor(q,_,j){super(j);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=_,this.exitCode=q,this.nestedError=void 0}}class f5 extends Y4{constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}uw.CommanderError=Y4;uw.InvalidArgumentError=f5});var l3=_8((Mw)=>{var{InvalidArgumentError:Cw}=LK();class $5{constructor(q,_){switch(this.description=_||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,q[0]){case"<":this.required=!0,this._name=q.slice(1,-1);break;case"[":this.required=!1,this._name=q.slice(1,-1);break;default:this.required=!0,this._name=q;break}if(this._name.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue(q,_){if(_===this.defaultValue||!Array.isArray(_))return[q];return _.concat(q)}default(q,_){return this.defaultValue=q,this.defaultValueDescription=_,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=(_,j)=>{if(!this.argChoices.includes(_))throw new Cw(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,j);return _},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Vw(q){let _=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+_+">":"["+_+"]"}Mw.Argument=$5;Mw.humanReadableArgName=Vw});var f4=_8((Ew)=>{var{humanReadableArgName:Sw}=l3();class w5{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(q){this.helpWidth=this.helpWidth??q.helpWidth??80}visibleCommands(q){let _=q.commands.filter((K)=>!K._hidden),j=q._getHelpCommand();if(j&&!j._hidden)_.push(j);if(this.sortSubcommands)_.sort((K,Y)=>{return K.name().localeCompare(Y.name())});return _}compareOptions(q,_){let j=(K)=>{return K.short?K.short.replace(/^-/,""):K.long.replace(/^--/,"")};return j(q).localeCompare(j(_))}visibleOptions(q){let _=q.options.filter((K)=>!K.hidden),j=q._getHelpOption();if(j&&!j.hidden){let K=j.short&&q._findOption(j.short),Y=j.long&&q._findOption(j.long);if(!K&&!Y)_.push(j);else if(j.long&&!Y)_.push(q.createOption(j.long,j.description));else if(j.short&&!K)_.push(q.createOption(j.short,j.description))}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let _=[];for(let j=q.parent;j;j=j.parent){let K=j.options.filter((Y)=>!Y.hidden);_.push(...K)}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach((_)=>{_.description=_.description||q._argsDescription[_.name()]||""});if(q.registeredArguments.find((_)=>_.description))return q.registeredArguments;return[]}subcommandTerm(q){let _=q.registeredArguments.map((j)=>Sw(j)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+(_?" "+_:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,_){return _.visibleCommands(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleSubcommandTerm(_.subcommandTerm(K))))},0)}longestOptionTermLength(q,_){return _.visibleOptions(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleOptionTerm(_.optionTerm(K))))},0)}longestGlobalOptionTermLength(q,_){return _.visibleGlobalOptions(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleOptionTerm(_.optionTerm(K))))},0)}longestArgumentTermLength(q,_){return _.visibleArguments(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleArgumentTerm(_.argumentTerm(K))))},0)}commandUsage(q){let _=q._name;if(q._aliases[0])_=_+"|"+q._aliases[0];let j="";for(let K=q.parent;K;K=K.parent)j=K.name()+" "+j;return j+_+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let _=[];if(q.argChoices)_.push(`choices: ${q.argChoices.map((j)=>JSON.stringify(j)).join(", ")}`);if(q.defaultValue!==void 0){if(q.required||q.optional||q.isBoolean()&&typeof q.defaultValue==="boolean")_.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)_.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)_.push(`env: ${q.envVar}`);if(_.length>0){let j=`(${_.join(", ")})`;if(q.description)return`${q.description} ${j}`;return j}return q.description}argumentDescription(q){let _=[];if(q.argChoices)_.push(`choices: ${q.argChoices.map((j)=>JSON.stringify(j)).join(", ")}`);if(q.defaultValue!==void 0)_.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if(_.length>0){let j=`(${_.join(", ")})`;if(q.description)return`${q.description} ${j}`;return j}return q.description}formatItemList(q,_,j){if(_.length===0)return[];return[j.styleTitle(q),..._,""]}groupItems(q,_,j){let K=new Map;return q.forEach((Y)=>{let f=j(Y);if(!K.has(f))K.set(f,[])}),_.forEach((Y)=>{let f=j(Y);if(!K.has(f))K.set(f,[]);K.get(f).push(Y)}),K}formatHelp(q,_){let j=_.padWidth(q,_),K=_.helpWidth??80;function Y(v,z){return _.formatItem(v,j,z,_)}let f=[`${_.styleTitle("Usage:")} ${_.styleUsage(_.commandUsage(q))}`,""],P=_.commandDescription(q);if(P.length>0)f=f.concat([_.boxWrap(_.styleCommandDescription(P),K),""]);let $=_.visibleArguments(q).map((v)=>{return Y(_.styleArgumentTerm(_.argumentTerm(v)),_.styleArgumentDescription(_.argumentDescription(v)))});if(f=f.concat(this.formatItemList("Arguments:",$,_)),this.groupItems(q.options,_.visibleOptions(q),(v)=>v.helpGroupHeading??"Options:").forEach((v,z)=>{let W=v.map((J)=>{return Y(_.styleOptionTerm(_.optionTerm(J)),_.styleOptionDescription(_.optionDescription(J)))});f=f.concat(this.formatItemList(z,W,_))}),_.showGlobalOptions){let v=_.visibleGlobalOptions(q).map((z)=>{return Y(_.styleOptionTerm(_.optionTerm(z)),_.styleOptionDescription(_.optionDescription(z)))});f=f.concat(this.formatItemList("Global Options:",v,_))}return this.groupItems(q.commands,_.visibleCommands(q),(v)=>v.helpGroup()||"Commands:").forEach((v,z)=>{let W=v.map((J)=>{return Y(_.styleSubcommandTerm(_.subcommandTerm(J)),_.styleSubcommandDescription(_.subcommandDescription(J)))});f=f.concat(this.formatItemList(z,W,_))}),f.join(`
|
||
`)}displayWidth(q){return O5(q).length}styleTitle(q){return q}styleUsage(q){return q.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_==="[command]")return this.styleSubcommandText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleCommandText(_)}).join(" ")}styleCommandDescription(q){return this.styleDescriptionText(q)}styleOptionDescription(q){return this.styleDescriptionText(q)}styleSubcommandDescription(q){return this.styleDescriptionText(q)}styleArgumentDescription(q){return this.styleDescriptionText(q)}styleDescriptionText(q){return q}styleOptionTerm(q){return this.styleOptionText(q)}styleSubcommandTerm(q){return q.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleSubcommandText(_)}).join(" ")}styleArgumentTerm(q){return this.styleArgumentText(q)}styleOptionText(q){return q}styleArgumentText(q){return q}styleSubcommandText(q){return q}styleCommandText(q){return q}padWidth(q,_){return Math.max(_.longestOptionTermLength(q,_),_.longestGlobalOptionTermLength(q,_),_.longestSubcommandTermLength(q,_),_.longestArgumentTermLength(q,_))}preformatted(q){return/\n[^\S\r\n]/.test(q)}formatItem(q,_,j,K){let f=" ".repeat(2);if(!j)return f+q;let P=q.padEnd(_+q.length-K.displayWidth(q)),$=2,O=(this.helpWidth??80)-_-$-2,v;if(O<this.minWidthToWrap||K.preformatted(j))v=j;else v=K.boxWrap(j,O).replace(/\n/g,`
|
||
`+" ".repeat(_+$));return f+P+" ".repeat($)+v.replace(/\n/g,`
|
||
${f}`)}boxWrap(q,_){if(_<this.minWidthToWrap)return q;let j=q.split(/\r\n|\n/),K=/[\s]*[^\s]+/g,Y=[];return j.forEach((f)=>{let P=f.match(K);if(P===null){Y.push("");return}let $=[P.shift()],w=this.displayWidth($[0]);P.forEach((O)=>{let v=this.displayWidth(O);if(w+v<=_){$.push(O),w+=v;return}Y.push($.join(""));let z=O.trimStart();$=[z],w=this.displayWidth(z)}),Y.push($.join(""))}),Y.join(`
|
||
`)}}function O5(q){let _=/\x1b\[\d*(;\d*)*m/g;return q.replace(_,"")}Ew.Help=w5;Ew.stripColor=O5});var $4=_8((yw)=>{var{InvalidArgumentError:Iw}=LK();class v5{constructor(q,_){this.flags=q,this.description=_||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let j=gw(q);if(this.short=j.shortFlag,this.long=j.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(q,_){return this.defaultValue=q,this.defaultValueDescription=_,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let _=q;if(typeof q==="string")_={[q]:!0};return this.implied=Object.assign(this.implied||{},_),this}env(q){return this.envVar=q,this}argParser(q){return this.parseArg=q,this}makeOptionMandatory(q=!0){return this.mandatory=!!q,this}hideHelp(q=!0){return this.hidden=!!q,this}_concatValue(q,_){if(_===this.defaultValue||!Array.isArray(_))return[q];return _.concat(q)}choices(q){return this.argChoices=q.slice(),this.parseArg=(_,j)=>{if(!this.argChoices.includes(_))throw new Iw(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,j);return _},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return z5(this.name().replace(/^no-/,""));return z5(this.name())}helpGroup(q){return this.helpGroupHeading=q,this}is(q){return this.short===q||this.long===q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class W5{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach((_)=>{if(_.negate)this.negativeOptions.set(_.attributeName(),_);else this.positiveOptions.set(_.attributeName(),_)}),this.negativeOptions.forEach((_,j)=>{if(this.positiveOptions.has(j))this.dualOptions.add(j)})}valueFromOption(q,_){let j=_.attributeName();if(!this.dualOptions.has(j))return!0;let K=this.negativeOptions.get(j).presetArg,Y=K!==void 0?K:!1;return _.negate===(Y===q)}}function z5(q){return q.split("-").reduce((_,j)=>{return _+j[0].toUpperCase()+j.slice(1)})}function gw(q){let _,j,K=/^-[^-]$/,Y=/^--[^-]/,f=q.split(/[ |,]+/).concat("guard");if(K.test(f[0]))_=f.shift();if(Y.test(f[0]))j=f.shift();if(!_&&K.test(f[0]))_=f.shift();if(!_&&Y.test(f[0]))_=j,j=f.shift();if(f[0].startsWith("-")){let P=f[0],$=`option creation failed due to '${P}' in option flags '${q}'`;if(/^-[^-][^-]/.test(P))throw new Error(`${$}
|
||
- a short flag is a single dash and a single character
|
||
- either use a single dash and a single character (for a short flag)
|
||
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(K.test(P))throw new Error(`${$}
|
||
- too many short flags`);if(Y.test(P))throw new Error(`${$}
|
||
- too many long flags`);throw new Error(`${$}
|
||
- unrecognised flag format`)}if(_===void 0&&j===void 0)throw new Error(`option creation failed due to no flags found in '${q}'.`);return{shortFlag:_,longFlag:j}}yw.Option=v5;yw.DualOptions=W5});var H5=_8((xw)=>{function pw(q,_){if(Math.abs(q.length-_.length)>3)return Math.max(q.length,_.length);let j=[];for(let K=0;K<=q.length;K++)j[K]=[K];for(let K=0;K<=_.length;K++)j[0][K]=K;for(let K=1;K<=_.length;K++)for(let Y=1;Y<=q.length;Y++){let f=1;if(q[Y-1]===_[K-1])f=0;else f=1;if(j[Y][K]=Math.min(j[Y-1][K]+1,j[Y][K-1]+1,j[Y-1][K-1]+f),Y>1&&K>1&&q[Y-1]===_[K-2]&&q[Y-2]===_[K-1])j[Y][K]=Math.min(j[Y][K],j[Y-2][K-2]+1)}return j[q.length][_.length]}function lw(q,_){if(!_||_.length===0)return"";_=Array.from(new Set(_));let j=q.startsWith("--");if(j)q=q.slice(2),_=_.map((P)=>P.slice(2));let K=[],Y=3,f=0.4;if(_.forEach((P)=>{if(P.length<=1)return;let $=pw(q,P),w=Math.max(q.length,P.length);if((w-$)/w>f){if($<Y)Y=$,K=[P];else if($===Y)K.push(P)}}),K.sort((P,$)=>P.localeCompare($)),j)K=K.map((P)=>`--${P}`);if(K.length>1)return`
|
||
(Did you mean one of ${K.join(", ")}?)`;if(K.length===1)return`
|
||
(Did you mean ${K[0]}?)`;return""}xw.suggestSimilar=lw});var k5=_8((tw)=>{var cw=C6("node:events").EventEmitter,w4=C6("node:child_process"),yq=C6("node:path"),x3=C6("node:fs"),b8=C6("node:process"),{Argument:rw,humanReadableArgName:iw}=l3(),{CommanderError:O4}=LK(),{Help:ow,stripColor:aw}=f4(),{Option:J5,DualOptions:Bw}=$4(),{suggestSimilar:T5}=H5();class v4 extends cw{constructor(q){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=q||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(_)=>b8.stdout.write(_),writeErr:(_)=>b8.stderr.write(_),outputError:(_,j)=>j(_),getOutHelpWidth:()=>b8.stdout.isTTY?b8.stdout.columns:void 0,getErrHelpWidth:()=>b8.stderr.isTTY?b8.stderr.columns:void 0,getOutHasColors:()=>z4()??(b8.stdout.isTTY&&b8.stdout.hasColors?.()),getErrHasColors:()=>z4()??(b8.stderr.isTTY&&b8.stderr.hasColors?.()),stripColor:(_)=>aw(_)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(q){return this._outputConfiguration=q._outputConfiguration,this._helpOption=q._helpOption,this._helpCommand=q._helpCommand,this._helpConfiguration=q._helpConfiguration,this._exitCallback=q._exitCallback,this._storeOptionsAsProperties=q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=q._combineFlagAndOptionalValue,this._allowExcessArguments=q._allowExcessArguments,this._enablePositionalOptions=q._enablePositionalOptions,this._showHelpAfterError=q._showHelpAfterError,this._showSuggestionAfterError=q._showSuggestionAfterError,this}_getCommandAndAncestors(){let q=[];for(let _=this;_;_=_.parent)q.push(_);return q}command(q,_,j){let K=_,Y=j;if(typeof K==="object"&&K!==null)Y=K,K=null;Y=Y||{};let[,f,P]=q.match(/([^ ]+) *(.*)/),$=this.createCommand(f);if(K)$.description(K),$._executableHandler=!0;if(Y.isDefault)this._defaultCommandName=$._name;if($._hidden=!!(Y.noHelp||Y.hidden),$._executableFile=Y.executableFile||null,P)$.arguments(P);if(this._registerCommand($),$.parent=this,$.copyInheritedSettings(this),K)return this;return $}createCommand(q){return new v4(q)}createHelp(){return Object.assign(new ow,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return this._outputConfiguration=Object.assign({},this._outputConfiguration,q),this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,_){if(!q._name)throw new Error(`Command passed to .addCommand() must have a name
|
||
- specify the name in Command constructor or using .name()`);if(_=_||{},_.isDefault)this._defaultCommandName=q._name;if(_.noHelp||_.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,_){return new rw(q,_)}argument(q,_,j,K){let Y=this.createArgument(q,_);if(typeof j==="function")Y.default(K).argParser(j);else Y.default(j);return this.addArgument(Y),this}arguments(q){return q.trim().split(/ +/).forEach((_)=>{this.argument(_)}),this}addArgument(q){let _=this.registeredArguments.slice(-1)[0];if(_&&_.variadic)throw new Error(`only the last argument can be variadic '${_.name()}'`);if(q.required&&q.defaultValue!==void 0&&q.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${q.name()}'`);return this.registeredArguments.push(q),this}helpCommand(q,_){if(typeof q==="boolean"){if(this._addImplicitHelpCommand=q,q&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let j=q??"help [command]",[,K,Y]=j.match(/([^ ]+) *(.*)/),f=_??"display help for command",P=this.createCommand(K);if(P.helpOption(!1),Y)P.arguments(Y);if(f)P.description(f);if(this._addImplicitHelpCommand=!0,this._helpCommand=P,q||_)this._initCommandGroup(P);return this}addHelpCommand(q,_){if(typeof q!=="object")return this.helpCommand(q,_),this;return this._addImplicitHelpCommand=!0,this._helpCommand=q,this._initCommandGroup(q),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(q,_){let j=["preSubcommand","preAction","postAction"];if(!j.includes(q))throw new Error(`Unexpected value for event passed to hook : '${q}'.
|
||
Expecting one of '${j.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push(_);else this._lifeCycleHooks[q]=[_];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=(_)=>{if(_.code!=="commander.executeSubCommandAsync")throw _};return this}_exit(q,_,j){if(this._exitCallback)this._exitCallback(new O4(q,_,j));b8.exit(q)}action(q){let _=(j)=>{let K=this.registeredArguments.length,Y=j.slice(0,K);if(this._storeOptionsAsProperties)Y[K]=this;else Y[K]=this.opts();return Y.push(this),q.apply(this,Y)};return this._actionHandler=_,this}createOption(q,_){return new J5(q,_)}_callParseArg(q,_,j,K){try{return q.parseArg(_,j)}catch(Y){if(Y.code==="commander.invalidArgument"){let f=`${K} ${Y.message}`;this.error(f,{exitCode:Y.exitCode,code:Y.code})}throw Y}}_registerOption(q){let _=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if(_){let j=q.long&&this._findOption(q.long)?q.long:q.short;throw new Error(`Cannot add option '${q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${j}'
|
||
- already used by option '${_.flags}'`)}this._initOptionGroup(q),this.options.push(q)}_registerCommand(q){let _=(K)=>{return[K.name()].concat(K.aliases())},j=_(q).find((K)=>this._findCommand(K));if(j){let K=_(this._findCommand(j)).join("|"),Y=_(q).join("|");throw new Error(`cannot add command '${Y}' as already have command '${K}'`)}this._initCommandGroup(q),this.commands.push(q)}addOption(q){this._registerOption(q);let _=q.name(),j=q.attributeName();if(q.negate){let Y=q.long.replace(/^--no-/,"--");if(!this._findOption(Y))this.setOptionValueWithSource(j,q.defaultValue===void 0?!0:q.defaultValue,"default")}else if(q.defaultValue!==void 0)this.setOptionValueWithSource(j,q.defaultValue,"default");let K=(Y,f,P)=>{if(Y==null&&q.presetArg!==void 0)Y=q.presetArg;let $=this.getOptionValue(j);if(Y!==null&&q.parseArg)Y=this._callParseArg(q,Y,$,f);else if(Y!==null&&q.variadic)Y=q._concatValue(Y,$);if(Y==null)if(q.negate)Y=!1;else if(q.isBoolean()||q.optional)Y=!0;else Y="";this.setOptionValueWithSource(j,Y,P)};if(this.on("option:"+_,(Y)=>{let f=`error: option '${q.flags}' argument '${Y}' is invalid.`;K(Y,f,"cli")}),q.envVar)this.on("optionEnv:"+_,(Y)=>{let f=`error: option '${q.flags}' value '${Y}' from env '${q.envVar}' is invalid.`;K(Y,f,"env")});return this}_optionEx(q,_,j,K,Y){if(typeof _==="object"&&_ instanceof J5)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let f=this.createOption(_,j);if(f.makeOptionMandatory(!!q.mandatory),typeof K==="function")f.default(Y).argParser(K);else if(K instanceof RegExp){let P=K;K=($,w)=>{let O=P.exec($);return O?O[0]:w},f.default(Y).argParser(K)}else f.default(K);return this.addOption(f)}option(q,_,j,K){return this._optionEx({},q,_,j,K)}requiredOption(q,_,j,K){return this._optionEx({mandatory:!0},q,_,j,K)}combineFlagAndOptionalValue(q=!0){return this._combineFlagAndOptionalValue=!!q,this}allowUnknownOption(q=!0){return this._allowUnknownOption=!!q,this}allowExcessArguments(q=!0){return this._allowExcessArguments=!!q,this}enablePositionalOptions(q=!0){return this._enablePositionalOptions=!!q,this}passThroughOptions(q=!0){return this._passThroughOptions=!!q,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(q=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!q,this}getOptionValue(q){if(this._storeOptionsAsProperties)return this[q];return this._optionValues[q]}setOptionValue(q,_){return this.setOptionValueWithSource(q,_,void 0)}setOptionValueWithSource(q,_,j){if(this._storeOptionsAsProperties)this[q]=_;else this._optionValues[q]=_;return this._optionValueSources[q]=j,this}getOptionValueSource(q){return this._optionValueSources[q]}getOptionValueSourceWithGlobals(q){let _;return this._getCommandAndAncestors().forEach((j)=>{if(j.getOptionValueSource(q)!==void 0)_=j.getOptionValueSource(q)}),_}_prepareUserArgs(q,_){if(q!==void 0&&!Array.isArray(q))throw new Error("first parameter to parse must be array or undefined");if(_=_||{},q===void 0&&_.from===void 0){if(b8.versions?.electron)_.from="electron";let K=b8.execArgv??[];if(K.includes("-e")||K.includes("--eval")||K.includes("-p")||K.includes("--print"))_.from="eval"}if(q===void 0)q=b8.argv;this.rawArgs=q.slice();let j;switch(_.from){case void 0:case"node":this._scriptPath=q[1],j=q.slice(2);break;case"electron":if(b8.defaultApp)this._scriptPath=q[1],j=q.slice(2);else j=q.slice(1);break;case"user":j=q.slice(0);break;case"eval":j=q.slice(1);break;default:throw new Error(`unexpected parse option { from: '${_.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",j}parse(q,_){this._prepareForParse();let j=this._prepareUserArgs(q,_);return this._parseCommand([],j),this}async parseAsync(q,_){this._prepareForParse();let j=this._prepareUserArgs(q,_);return await this._parseCommand([],j),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
||
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(q,_,j){if(x3.existsSync(q))return;let K=_?`searched for local subcommand relative to directory '${_}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",Y=`'${q}' does not exist
|
||
- if '${j}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
||
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
||
- ${K}`;throw new Error(Y)}_executeSubCommand(q,_){_=_.slice();let j=!1,K=[".js",".ts",".tsx",".mjs",".cjs"];function Y(O,v){let z=yq.resolve(O,v);if(x3.existsSync(z))return z;if(K.includes(yq.extname(v)))return;let W=K.find((J)=>x3.existsSync(`${z}${J}`));if(W)return`${z}${W}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let f=q._executableFile||`${this._name}-${q._name}`,P=this._executableDir||"";if(this._scriptPath){let O;try{O=x3.realpathSync(this._scriptPath)}catch{O=this._scriptPath}P=yq.resolve(yq.dirname(O),P)}if(P){let O=Y(P,f);if(!O&&!q._executableFile&&this._scriptPath){let v=yq.basename(this._scriptPath,yq.extname(this._scriptPath));if(v!==this._name)O=Y(P,`${v}-${q._name}`)}f=O||f}j=K.includes(yq.extname(f));let $;if(b8.platform!=="win32")if(j)_.unshift(f),_=Z5(b8.execArgv).concat(_),$=w4.spawn(b8.argv[0],_,{stdio:"inherit"});else $=w4.spawn(f,_,{stdio:"inherit"});else this._checkForMissingExecutable(f,P,q._name),_.unshift(f),_=Z5(b8.execArgv).concat(_),$=w4.spawn(b8.execPath,_,{stdio:"inherit"});if(!$.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((v)=>{b8.on(v,()=>{if($.killed===!1&&$.exitCode===null)$.kill(v)})});let w=this._exitCallback;$.on("close",(O)=>{if(O=O??1,!w)b8.exit(O);else w(new O4(O,"commander.executeSubCommandAsync","(close)"))}),$.on("error",(O)=>{if(O.code==="ENOENT")this._checkForMissingExecutable(f,P,q._name);else if(O.code==="EACCES")throw new Error(`'${f}' not executable`);if(!w)b8.exit(1);else{let v=new O4(1,"commander.executeSubCommandAsync","(error)");v.nestedError=O,w(v)}}),this.runningCommand=$}_dispatchSubcommand(q,_,j){let K=this._findCommand(q);if(!K)this.help({error:!0});K._prepareForParse();let Y;return Y=this._chainOrCallSubCommandHook(Y,K,"preSubcommand"),Y=this._chainOrCall(Y,()=>{if(K._executableHandler)this._executeSubCommand(K,_.concat(j));else return K._parseCommand(_,j)}),Y}_dispatchHelpCommand(q){if(!q)this.help();let _=this._findCommand(q);if(_&&!_._executableHandler)_.help();return this._dispatchSubcommand(q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((q,_)=>{if(q.required&&this.args[_]==null)this.missingArgument(q.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let q=(j,K,Y)=>{let f=K;if(K!==null&&j.parseArg){let P=`error: command-argument value '${K}' is invalid for argument '${j.name()}'.`;f=this._callParseArg(j,K,Y,P)}return f};this._checkNumberOfArguments();let _=[];this.registeredArguments.forEach((j,K)=>{let Y=j.defaultValue;if(j.variadic){if(K<this.args.length){if(Y=this.args.slice(K),j.parseArg)Y=Y.reduce((f,P)=>{return q(j,P,f)},j.defaultValue)}else if(Y===void 0)Y=[]}else if(K<this.args.length){if(Y=this.args[K],j.parseArg)Y=q(j,Y,j.defaultValue)}_[K]=Y}),this.processedArgs=_}_chainOrCall(q,_){if(q&&q.then&&typeof q.then==="function")return q.then(()=>_());return _()}_chainOrCallHooks(q,_){let j=q,K=[];if(this._getCommandAndAncestors().reverse().filter((Y)=>Y._lifeCycleHooks[_]!==void 0).forEach((Y)=>{Y._lifeCycleHooks[_].forEach((f)=>{K.push({hookedCommand:Y,callback:f})})}),_==="postAction")K.reverse();return K.forEach((Y)=>{j=this._chainOrCall(j,()=>{return Y.callback(Y.hookedCommand,this)})}),j}_chainOrCallSubCommandHook(q,_,j){let K=q;if(this._lifeCycleHooks[j]!==void 0)this._lifeCycleHooks[j].forEach((Y)=>{K=this._chainOrCall(K,()=>{return Y(this,_)})});return K}_parseCommand(q,_){let j=this.parseOptions(_);if(this._parseOptionsEnv(),this._parseOptionsImplied(),q=q.concat(j.operands),_=j.unknown,this.args=q.concat(_),q&&this._findCommand(q[0]))return this._dispatchSubcommand(q[0],q.slice(1),_);if(this._getHelpCommand()&&q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(_),this._dispatchSubcommand(this._defaultCommandName,q,_);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(j.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let K=()=>{if(j.unknown.length>0)this.unknownOption(j.unknown[0])},Y=`command:${this.name()}`;if(this._actionHandler){K(),this._processArguments();let f;if(f=this._chainOrCallHooks(f,"preAction"),f=this._chainOrCall(f,()=>this._actionHandler(this.processedArgs)),this.parent)f=this._chainOrCall(f,()=>{this.parent.emit(Y,q,_)});return f=this._chainOrCallHooks(f,"postAction"),f}if(this.parent&&this.parent.listenerCount(Y))K(),this._processArguments(),this.parent.emit(Y,q,_);else if(q.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",q,_);if(this.listenerCount("command:*"))this.emit("command:*",q,_);else if(this.commands.length)this.unknownCommand();else K(),this._processArguments()}else if(this.commands.length)K(),this.help({error:!0});else K(),this._processArguments()}_findCommand(q){if(!q)return;return this.commands.find((_)=>_._name===q||_._aliases.includes(q))}_findOption(q){return this.options.find((_)=>_.is(q))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((q)=>{q.options.forEach((_)=>{if(_.mandatory&&q.getOptionValue(_.attributeName())===void 0)q.missingMandatoryOptionValue(_)})})}_checkForConflictingLocalOptions(){let q=this.options.filter((j)=>{let K=j.attributeName();if(this.getOptionValue(K)===void 0)return!1;return this.getOptionValueSource(K)!=="default"});q.filter((j)=>j.conflictsWith.length>0).forEach((j)=>{let K=q.find((Y)=>j.conflictsWith.includes(Y.attributeName()));if(K)this._conflictingOption(j,K)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((q)=>{q._checkForConflictingLocalOptions()})}parseOptions(q){let _=[],j=[],K=_,Y=q.slice();function f(w){return w.length>1&&w[0]==="-"}let P=(w)=>{if(!/^-\d*\.?\d+(e[+-]?\d+)?$/.test(w))return!1;return!this._getCommandAndAncestors().some((O)=>O.options.map((v)=>v.short).some((v)=>/^-\d$/.test(v)))},$=null;while(Y.length){let w=Y.shift();if(w==="--"){if(K===j)K.push(w);K.push(...Y);break}if($&&(!f(w)||P(w))){this.emit(`option:${$.name()}`,w);continue}if($=null,f(w)){let O=this._findOption(w);if(O){if(O.required){let v=Y.shift();if(v===void 0)this.optionMissingArgument(O);this.emit(`option:${O.name()}`,v)}else if(O.optional){let v=null;if(Y.length>0&&(!f(Y[0])||P(Y[0])))v=Y.shift();this.emit(`option:${O.name()}`,v)}else this.emit(`option:${O.name()}`);$=O.variadic?O:null;continue}}if(w.length>2&&w[0]==="-"&&w[1]!=="-"){let O=this._findOption(`-${w[1]}`);if(O){if(O.required||O.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${O.name()}`,w.slice(2));else this.emit(`option:${O.name()}`),Y.unshift(`-${w.slice(2)}`);continue}}if(/^--[^=]+=/.test(w)){let O=w.indexOf("="),v=this._findOption(w.slice(0,O));if(v&&(v.required||v.optional)){this.emit(`option:${v.name()}`,w.slice(O+1));continue}}if(K===_&&f(w)&&!(this.commands.length===0&&P(w)))K=j;if((this._enablePositionalOptions||this._passThroughOptions)&&_.length===0&&j.length===0){if(this._findCommand(w)){if(_.push(w),Y.length>0)j.push(...Y);break}else if(this._getHelpCommand()&&w===this._getHelpCommand().name()){if(_.push(w),Y.length>0)_.push(...Y);break}else if(this._defaultCommandName){if(j.push(w),Y.length>0)j.push(...Y);break}}if(this._passThroughOptions){if(K.push(w),Y.length>0)K.push(...Y);break}K.push(w)}return{operands:_,unknown:j}}opts(){if(this._storeOptionsAsProperties){let q={},_=this.options.length;for(let j=0;j<_;j++){let K=this.options[j].attributeName();q[K]=K===this._versionOptionName?this._version:this[K]}return q}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((q,_)=>Object.assign(q,_.opts()),{})}error(q,_){if(this._outputConfiguration.outputError(`${q}
|
||
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
||
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
||
`),this.outputHelp({error:!0});let j=_||{},K=j.exitCode||1,Y=j.code||"commander.error";this._exit(K,Y,q)}_parseOptionsEnv(){this.options.forEach((q)=>{if(q.envVar&&q.envVar in b8.env){let _=q.attributeName();if(this.getOptionValue(_)===void 0||["default","config","env"].includes(this.getOptionValueSource(_)))if(q.required||q.optional)this.emit(`optionEnv:${q.name()}`,b8.env[q.envVar]);else this.emit(`optionEnv:${q.name()}`)}})}_parseOptionsImplied(){let q=new Bw(this.options),_=(j)=>{return this.getOptionValue(j)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(j))};this.options.filter((j)=>j.implied!==void 0&&_(j.attributeName())&&q.valueFromOption(this.getOptionValue(j.attributeName()),j)).forEach((j)=>{Object.keys(j.implied).filter((K)=>!_(K)).forEach((K)=>{this.setOptionValueWithSource(K,j.implied[K],"implied")})})}missingArgument(q){let _=`error: missing required argument '${q}'`;this.error(_,{code:"commander.missingArgument"})}optionMissingArgument(q){let _=`error: option '${q.flags}' argument missing`;this.error(_,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(q){let _=`error: required option '${q.flags}' not specified`;this.error(_,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(q,_){let j=(f)=>{let P=f.attributeName(),$=this.getOptionValue(P),w=this.options.find((v)=>v.negate&&P===v.attributeName()),O=this.options.find((v)=>!v.negate&&P===v.attributeName());if(w&&(w.presetArg===void 0&&$===!1||w.presetArg!==void 0&&$===w.presetArg))return w;return O||f},K=(f)=>{let P=j(f),$=P.attributeName();if(this.getOptionValueSource($)==="env")return`environment variable '${P.envVar}'`;return`option '${P.flags}'`},Y=`error: ${K(q)} cannot be used with ${K(_)}`;this.error(Y,{code:"commander.conflictingOption"})}unknownOption(q){if(this._allowUnknownOption)return;let _="";if(q.startsWith("--")&&this._showSuggestionAfterError){let K=[],Y=this;do{let f=Y.createHelp().visibleOptions(Y).filter((P)=>P.long).map((P)=>P.long);K=K.concat(f),Y=Y.parent}while(Y&&!Y._enablePositionalOptions);_=T5(q,K)}let j=`error: unknown option '${q}'${_}`;this.error(j,{code:"commander.unknownOption"})}_excessArguments(q){if(this._allowExcessArguments)return;let _=this.registeredArguments.length,j=_===1?"":"s",Y=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${_} argument${j} but got ${q.length}.`;this.error(Y,{code:"commander.excessArguments"})}unknownCommand(){let q=this.args[0],_="";if(this._showSuggestionAfterError){let K=[];this.createHelp().visibleCommands(this).forEach((Y)=>{if(K.push(Y.name()),Y.alias())K.push(Y.alias())}),_=T5(q,K)}let j=`error: unknown command '${q}'${_}`;this.error(j,{code:"commander.unknownCommand"})}version(q,_,j){if(q===void 0)return this._version;this._version=q,_=_||"-V, --version",j=j||"output the version number";let K=this.createOption(_,j);return this._versionOptionName=K.attributeName(),this._registerOption(K),this.on("option:"+K.name(),()=>{this._outputConfiguration.writeOut(`${q}
|
||
`),this._exit(0,"commander.version",q)}),this}description(q,_){if(q===void 0&&_===void 0)return this._description;if(this._description=q,_)this._argsDescription=_;return this}summary(q){if(q===void 0)return this._summary;return this._summary=q,this}alias(q){if(q===void 0)return this._aliases[0];let _=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)_=this.commands[this.commands.length-1];if(q===_._name)throw new Error("Command alias can't be the same as its name");let j=this.parent?._findCommand(q);if(j){let K=[j.name()].concat(j.aliases()).join("|");throw new Error(`cannot add alias '${q}' to command '${this.name()}' as already have command '${K}'`)}return _._aliases.push(q),this}aliases(q){if(q===void 0)return this._aliases;return q.forEach((_)=>this.alias(_)),this}usage(q){if(q===void 0){if(this._usage)return this._usage;let _=this.registeredArguments.map((j)=>{return iw(j)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?_:[]).join(" ")}return this._usage=q,this}name(q){if(q===void 0)return this._name;return this._name=q,this}helpGroup(q){if(q===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=q,this}commandsGroup(q){if(q===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=q,this}optionsGroup(q){if(q===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=q,this}_initOptionGroup(q){if(this._defaultOptionGroup&&!q.helpGroupHeading)q.helpGroup(this._defaultOptionGroup)}_initCommandGroup(q){if(this._defaultCommandGroup&&!q.helpGroup())q.helpGroup(this._defaultCommandGroup)}nameFromFilename(q){return this._name=yq.basename(q,yq.extname(q)),this}executableDir(q){if(q===void 0)return this._executableDir;return this._executableDir=q,this}helpInformation(q){let _=this.createHelp(),j=this._getOutputContext(q);_.prepareContext({error:j.error,helpWidth:j.helpWidth,outputHasColors:j.hasColors});let K=_.formatHelp(this,_);if(j.hasColors)return K;return this._outputConfiguration.stripColor(K)}_getOutputContext(q){q=q||{};let _=!!q.error,j,K,Y;if(_)j=(P)=>this._outputConfiguration.writeErr(P),K=this._outputConfiguration.getErrHasColors(),Y=this._outputConfiguration.getErrHelpWidth();else j=(P)=>this._outputConfiguration.writeOut(P),K=this._outputConfiguration.getOutHasColors(),Y=this._outputConfiguration.getOutHelpWidth();return{error:_,write:(P)=>{if(!K)P=this._outputConfiguration.stripColor(P);return j(P)},hasColors:K,helpWidth:Y}}outputHelp(q){let _;if(typeof q==="function")_=q,q=void 0;let j=this._getOutputContext(q),K={error:j.error,write:j.write,command:this};this._getCommandAndAncestors().reverse().forEach((f)=>f.emit("beforeAllHelp",K)),this.emit("beforeHelp",K);let Y=this.helpInformation({error:j.error});if(_){if(Y=_(Y),typeof Y!=="string"&&!Buffer.isBuffer(Y))throw new Error("outputHelp callback must return a string or a Buffer")}if(j.write(Y),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",K),this._getCommandAndAncestors().forEach((f)=>f.emit("afterAllHelp",K))}helpOption(q,_){if(typeof q==="boolean"){if(q){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(q??"-h, --help",_??"display help for command"),q||_)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(q){return this._helpOption=q,this._initOptionGroup(q),this}help(q){this.outputHelp(q);let _=Number(b8.exitCode??0);if(_===0&&q&&typeof q!=="function"&&q.error)_=1;this._exit(_,"commander.help","(outputHelp)")}addHelpText(q,_){let j=["beforeAll","before","after","afterAll"];if(!j.includes(q))throw new Error(`Unexpected value for position to addHelpText.
|
||
Expecting one of '${j.join("', '")}'`);let K=`${q}Help`;return this.on(K,(Y)=>{let f;if(typeof _==="function")f=_({error:Y.error,command:Y.command});else f=_;if(f)Y.write(`${f}
|
||
`)}),this}_outputHelpIfRequested(q){let _=this._getHelpOption();if(_&&q.find((K)=>_.is(K)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Z5(q){return q.map((_)=>{if(!_.startsWith("--inspect"))return _;let j,K="127.0.0.1",Y="9229",f;if((f=_.match(/^(--inspect(-brk)?)$/))!==null)j=f[1];else if((f=_.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(j=f[1],/^\d+$/.test(f[3]))Y=f[3];else K=f[3];else if((f=_.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)j=f[1],K=f[3],Y=f[4];if(j&&Y!=="0")return`${j}=${K}:${parseInt(Y)+1}`;return _})}function z4(){if(b8.env.NO_COLOR||b8.env.FORCE_COLOR==="0"||b8.env.FORCE_COLOR==="false")return!1;if(b8.env.FORCE_COLOR||b8.env.CLICOLOR_FORCE!==void 0)return!0;return}tw.Command=v4;tw.useColor=z4});var u5=_8((Qw)=>{var{Argument:X5}=l3(),{Command:W4}=k5(),{CommanderError:Uw,InvalidArgumentError:A5}=LK(),{Help:sw}=f4(),{Option:G5}=$4();Qw.program=new W4;Qw.createCommand=(q)=>new W4(q);Qw.createOption=(q,_)=>new G5(q,_);Qw.createArgument=(q,_)=>new X5(q,_);Qw.Command=W4;Qw.Option=G5;Qw.Argument=X5;Qw.Help=sw;Qw.CommanderError=Uw;Qw.InvalidArgumentError=A5;Qw.InvalidOptionArgumentError=A5});function J4(q){try{let _=q instanceof Date?q:new Date(q),K=new Date().getTime()-_.getTime(),Y=Math.floor(K/1000),f=Math.floor(Y/60),P=Math.floor(f/60),$=Math.floor(P/24),w=Math.floor($/7),O=Math.floor($/30);if(Y<60)return"Just now";else if(f<60)return f===1?"1 minute ago":`${f} minutes ago`;else if(P<24)return P===1?"1 hour ago":`${P} hours ago`;else if($===1)return"Yesterday";else if($<7)return`${$} days ago`;else if(w===1)return"1 week ago";else if(w<4)return`${w} weeks ago`;else if(O===1)return"1 month ago";else if(O<12)return`${O} months ago`;else{let v=Math.floor(O/12);return v===1?"1 year ago":`${v} years ago`}}catch(_){return"Recently"}}function m5(q){let _=["timestamp","created_at","date","time"];for(let j of _)if(q[j])try{let K=new Date(q[j]);if(!isNaN(K.getTime()))return K}catch{continue}return null}function n_(){let q=process.env.CLAUDE_MEM_WRAP_WIDTH;if(q){let _=parseInt(q,10);if(!Number.isNaN(_)&&_>40&&_<=200)return _}return 80}function ZO(q,_){if(!q)return"";if(/^[\-=\u2014_\u2500\u2550]{5,}$/.test(q.trim()))return q;if(q.length<=_)return q;let j=q.match(/^\s*/),K=j?j[0]:"",Y=q.slice(K.length),f=Math.max(10,_-K.length),P=Y.split(/(\s+)/),$=[],w="",O=()=>{$.push(K+w.trimEnd()),w=""};for(let v of P){if(v==="")continue;if(!/\s/.test(v)&&v.length>f){if(w.trim().length>0)O();let z=0;while(z<v.length){let W=v.slice(z,z+f);$.push(K+W),z+=f}w="";continue}if(K.length+w.length+v.length>_)O();w+=v}if(w.trim().length>0||$.length===0)O();return $.join(`
|
||
`)}function L6(q,_){if(!q)return"";return q.split(`
|
||
`).map((j)=>ZO(j,_)).join(`
|
||
`)}function T4(q="─",_=n_()){if(!q||q.length===0)q="-";return q.repeat(_).slice(0,_)}function I5(q){let _={searching:"\uD83D\uDD0D Searching previous memories...",loading:"\uD83D\uDCDA Loading relevant context...",formatting:"✨ Organizing memories for display...",compressing:"\uD83D\uDDDC️ Compressing session transcript...",archiving:"\uD83D\uDCE6 Archiving conversation..."},j=n_();return L6(_[q]||`⏳ ${q}...`,j)}function n3(q,_,j){let K=_!==void 0?` (${_} items)`:"",Y=j?`
|
||
${j}`:"",f=n_();return L6(`✅ ${q} completed successfully${K}${Y}`,f)}function c_(q,_,j){let K=j?`
|
||
|
||
\uD83D\uDCA1 ${j}`:"",Y=n_();return L6(`❌ ${q} encountered an issue: ${_}${K}`,Y)}function pK(q,..._){let j=kO[q](..._);return c_("Memory system",j.message,j.suggestion)}function g5(q){let _=typeof q==="string"?new Date(q):q,K=new Date().getTime()-_.getTime(),Y=Math.floor(K/60000),f=Math.floor(K/3600000),P=Math.floor(K/86400000);if(Y<1)return"just now";if(Y<60)return`${Y} minute${Y>1?"s":""} ago`;if(f<24)return`${f} hour${f>1?"s":""} ago`;if(P<7)return`${P} day${P>1?"s":""} ago`;return _.toLocaleDateString()}function y5(q,_){let{count:j,duration:K,details:Y}=_,f=K?` in ${K}ms`:"",P=Y?` - ${Y}`:"",$={compress:`Compressed ${j} conversation turns${f}${P}`,load:`Loaded ${j} relevant memories${f}${P}`,search:`Found ${j} matching memories${f}${P}`,archive:`Archived ${j} conversation segments${f}${P}`},w=n_();return L6(`\uD83D\uDCCA ${$[q]}`,w)}function XO(q,_=3,j){let K=q.filter((P)=>P.type==="overview");if(K.length===0)return[];let Y=K;if(j){if(Y=K.filter((P)=>P.project===j),Y.length===0)Y=K}return Y.slice(-_).map((P)=>{let $={content:P.content||"",sessionId:P.sessionId||P.session_id||"unknown"},w=m5(P);if(w)$.timestamp=w,$.timeAgo=J4(w);else $.timeAgo="Recently";return $})}function AO(q){if(q.length===0)return[];return q.filter((_)=>_.type==="memory").map((_)=>{let j={summary:_.text||"",sessionId:_.session_id||""};if(_.keywords)j.keywords=_.keywords;if(_.document_id&&!_.document_id.includes("Session:"))j.location=_.document_id;return j}).filter((_)=>_.summary.length>0)}function GO(q){let _=new Map;return q.forEach((j)=>{let K=j.sessionId;if(K){if(!_.has(K))_.set(K,[]);_.get(K).push(j)}}),Array.from(_.entries()).map(([j,K])=>{let Y=K.map((f,P)=>({...f,number:P+1}));return{sessionId:j,memories:Y}})}function uO(q){let _=new Map;return q.forEach((j)=>{let K=j.sessionId||"unknown";if(!_.has(K))_.set(K,[]);_.get(K).push(j)}),Array.from(_.entries()).map(([j,K])=>{let Y=K.map((P)=>P.timestamp).filter((P)=>P!==void 0).sort((P,$)=>P.getTime()-$.getTime()),f={sessionId:j,overviews:K};if(Y.length>0)f.earliestTimestamp=Y[0],f.timeAgo=J4(Y[0]);return f})}function d5(q){let{projectName:_,memoryCount:j,lastSessionTime:K,recentObjects:Y}=q,f=n_(),P=XO(Y,10,_),$=AO(Y),w=(O,v)=>{let z=O.includes(",")||O.includes(`
|
||
`)?O.split(/[\n,]+/):[O];for(let W of z){let J=W.trim();if(!J)continue;let T=J.toLowerCase();if(!v.has(T))v.set(T,J)}};if($.length>0){let O=GO($);console.log(""),console.log(""),console.log(L6("\uD83D\uDCDA Memories",f)),O.forEach((v)=>{console.log(T4("─",f)),console.log(""),console.log(L6(`\uD83D\uDD0D ${v.sessionId}`,f));let z=new Map;v.memories.forEach((J)=>{if(console.log(""),console.log(L6(`${J.number}. ${J.summary}`,f)),J.keywords)w(J.keywords,z)});let W=Array.from(z.values());if(W.length>0)console.log(""),console.log(L6(`\uD83C\uDFF7️ ${W.join(", ")}`,f));console.log("")})}if(P.length>0){let O=uO(P);console.log(""),console.log(L6("\uD83E\uDDE0 Overviews",f)),console.log(T4("─",f)),O.forEach((v)=>{console.log(""),console.log(L6(`\uD83D\uDD0D ${v.sessionId}`,f)),v.overviews.forEach((z,W)=>{if(console.log(""),console.log(L6(`${W+1}. ${z.content}`,f)),console.log(""),z.timeAgo)console.log(L6(`\uD83D\uDCC5 ${z.timeAgo}`,f))}),console.log(""),console.log(T4("─",f))})}else if($.length===0)console.log(L6(`\uD83E\uDDE0 No recent context found for ${_}`,f))}var kO;var Z4=K6(()=>{kO={NO_MEMORIES:(q)=>({message:`No previous memories found for ${q}`,suggestion:"This appears to be your first session. Memories will be created as you work."}),CONNECTION_FAILED:()=>({message:"Could not connect to memory system",suggestion:"Try restarting Claude Code or check if the MCP server is properly configured."}),SEARCH_FAILED:(q)=>({message:`Search for "${q}" didn't return any results`,suggestion:"Try using different keywords or check if memories exist for this project."}),LOAD_TIMEOUT:()=>({message:"Memory loading timed out",suggestion:"The operation is taking longer than expected. You can continue without loaded context."})}});import{join as n5}from"path";import{fileURLToPath as wz}from"url";import{setMaxListeners as Oz}from"events";import{spawn as vz}from"child_process";import{createInterface as Wz}from"readline";import*as J8 from"fs";import{stat as Hz}from"fs/promises";function U5(q=zz){let _=new AbortController;return Oz(q,_.signal),_}function Zz(){return Tz}class s5{options;child;childStdin;childStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(q){this.options=q,this.abortController=q.abortController||U5(),this.initialize()}initialize(){try{let{prompt:q,additionalDirectories:_=[],cwd:j,executable:K=this.isRunningWithBun()?"bun":"node",executableArgs:Y=[],extraArgs:f={},pathToClaudeCodeExecutable:P,env:$={...process.env},stderr:w,customSystemPrompt:O,appendSystemPrompt:v,maxTurns:z,model:W,fallbackModel:J,permissionMode:T,permissionPromptToolName:H,continueConversation:X,resume:A,allowedTools:G=[],disallowedTools:h=[],mcpServers:M,strictMcpConfig:I,canUseTool:N}=this.options,R=["--output-format","stream-json","--verbose"];if(O)R.push("--system-prompt",O);if(v)R.push("--append-system-prompt",v);if(z)R.push("--max-turns",z.toString());if(W)R.push("--model",W);if($.DEBUG)R.push("--debug-to-stderr");if(N){if(typeof q==="string")throw new Error("canUseTool callback requires --input-format stream-json. Please set prompt as an AsyncIterable.");if(H)throw new Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");R.push("--permission-prompt-tool","stdio")}else if(H)R.push("--permission-prompt-tool",H);if(X)R.push("--continue");if(A)R.push("--resume",A);if(G.length>0)R.push("--allowedTools",G.join(","));if(h.length>0)R.push("--disallowedTools",h.join(","));if(M&&Object.keys(M).length>0)R.push("--mcp-config",JSON.stringify({mcpServers:M}));if(I)R.push("--strict-mcp-config");if(T&&T!=="default")R.push("--permission-mode",T);if(J){if(W&&J===W)throw new Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");R.push("--fallback-model",J)}if(typeof q==="string")R.push("--print"),R.push("--",q.trim());else R.push("--input-format","stream-json");for(let p of _)R.push("--add-dir",p);for(let[p,r]of Object.entries(f))if(r===null)R.push(`--${p}`);else R.push(`--${p}`,r);if(!$.CLAUDE_CODE_ENTRYPOINT)$.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(!Zz().existsSync(P)){let p=c5(P)?`Claude Code native binary not found at ${P}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${P}. Is options.pathToClaudeCodeExecutable set?`;throw new ReferenceError(p)}let E=c5(P),L=E?P:K,d=E?R:[...Y,P,...R];this.logDebug(E?`Spawning Claude Code native binary: ${P} ${R.join(" ")}`:`Spawning Claude Code process: ${K} ${[...Y,P,...R].join(" ")}`);let V=$.DEBUG||w?"pipe":"ignore";if(this.child=vz(L,d,{cwd:j,stdio:["pipe","pipe",V],signal:this.abortController.signal,env:$}),this.childStdin=this.child.stdin,this.childStdout=this.child.stdout,typeof q==="string")this.childStdin.end(),this.childStdin=void 0;if($.DEBUG||w)this.child.stderr.on("data",(p)=>{if(this.logDebug(`Claude Code stderr: ${p.toString()}`),w)w(p.toString())});let b=()=>{if(this.child&&!this.child.killed)this.child.kill("SIGTERM")};this.processExitHandler=b,this.abortHandler=b,process.on("exit",this.processExitHandler),this.abortController.signal.addEventListener("abort",this.abortHandler),this.child.on("error",(p)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new i_("Claude Code process aborted by user");else this.exitError=new Error(`Failed to spawn Claude Code process: ${p.message}`),this.logDebug(this.exitError.message)}),this.child.on("close",(p,r)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new i_("Claude Code process aborted by user");else{let t=this.getProcessExitError(p,r);if(t)this.exitError=t,this.logDebug(t.message)}}),this.ready=!0}catch(q){throw this.ready=!1,q}}getProcessExitError(q,_){if(q!==0&&q!==null)return new Error(`Claude Code process exited with code ${q}`);else if(_)return new Error(`Claude Code process terminated by signal ${_}`);return}isRunningWithBun(){return process.versions.bun!==void 0||process.env.BUN_INSTALL!==void 0}logDebug(q){if(process.env.DEBUG)process.stderr.write(`${q}
|
||
`)}write(q){if(this.abortController.signal.aborted)throw new i_("Operation aborted");if(!this.ready||!this.childStdin)throw new Error("ProcessTransport is not ready for writing");if(this.child?.killed||this.child?.exitCode!==null)throw new Error("Cannot write to terminated process");if(this.exitError)throw new Error(`Cannot write to process that exited with error: ${this.exitError.message}`);if(process.env.DEBUG_SDK)process.stderr.write(`[ProcessTransport] Writing to stdin: ${q.substring(0,100)}
|
||
`);try{if(!this.childStdin.write(q)&&process.env.DEBUG_SDK)console.warn("[ProcessTransport] Write buffer full, data queued")}catch(_){throw this.ready=!1,new Error(`Failed to write to process stdin: ${_.message}`)}}close(){if(this.childStdin)this.childStdin.end(),this.childStdin=void 0;if(this.processExitHandler)process.off("exit",this.processExitHandler),this.processExitHandler=void 0;if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;for(let{handler:q}of this.exitListeners)this.child?.off("exit",q);if(this.exitListeners=[],this.child&&!this.child.killed)this.child.kill("SIGTERM"),setTimeout(()=>{if(this.child&&!this.child.killed)this.child.kill("SIGKILL")},5000);this.ready=!1}isReady(){return this.ready}async*readMessages(){if(!this.childStdout)throw new Error("ProcessTransport output stream not available");let q=Wz({input:this.childStdout});try{for await(let _ of q)if(_.trim())yield JSON.parse(_);await this.waitForExit()}catch(_){throw _}finally{q.close()}}endInput(){if(this.childStdin)this.childStdin.end()}getInputStream(){return this.childStdin}onExit(q){if(!this.child)return()=>{};let _=(j,K)=>{let Y=this.getProcessExitError(j,K);q(Y)};return this.child.on("exit",_),this.exitListeners.push({callback:q,handler:_}),()=>{if(this.child)this.child.off("exit",_);let j=this.exitListeners.findIndex((K)=>K.handler===_);if(j!==-1)this.exitListeners.splice(j,1)}}async waitForExit(){if(!this.child){if(this.exitError)throw this.exitError;return}if(this.child.exitCode!==null||this.child.killed){if(this.exitError)throw this.exitError;return}return new Promise((q,_)=>{let j=(Y,f)=>{if(this.abortController.signal.aborted){_(new i_("Operation aborted"));return}let P=this.getProcessExitError(Y,f);if(P)_(P);else q()};this.child.once("exit",j);let K=(Y)=>{this.child.off("exit",j),_(Y)};this.child.once("error",K),this.child.once("exit",()=>{this.child.off("error",K)})})}}function c5(q){return![".js",".mjs",".tsx",".ts",".jsx"].some((j)=>q.endsWith(j))}class q1{sendMcpMessage;isClosed=!1;constructor(q){this.sendMcpMessage=q}onclose;onerror;onmessage;async start(){}async send(q){if(this.isClosed)throw new Error("Transport is closed");this.sendMcpMessage(q)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}function Az(q){K1=q}function c3(){return K1}function U(q,_){let j=c3(),K=r3({issueData:_,data:q.data,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,j,j===B_?void 0:B_].filter((Y)=>!!Y)});q.common.issues.push(K)}class A6{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(q,_){let j=[];for(let K of _){if(K.status==="aborted")return v8;if(K.status==="dirty")q.dirty();j.push(K.value)}return{status:q.value,value:j}}static async mergeObjectAsync(q,_){let j=[];for(let K of _){let Y=await K.key,f=await K.value;j.push({key:Y,value:f})}return A6.mergeObjectSync(q,j)}static mergeObjectSync(q,_){let j={};for(let K of _){let{key:Y,value:f}=K;if(Y.status==="aborted")return v8;if(f.status==="aborted")return v8;if(Y.status==="dirty")q.dirty();if(f.status==="dirty")q.dirty();if(Y.value!=="__proto__"&&(typeof f.value!=="undefined"||K.alwaysSet))j[Y.value]=f.value}return{status:q.value,value:j}}}class Hq{constructor(q,_,j,K){this._cachedPath=[],this.parent=q,this.data=_,this._path=j,this._key=K}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function Z8(q){if(!q)return{};let{errorMap:_,invalid_type_error:j,required_error:K,description:Y}=q;if(_&&(j||K))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(_)return{errorMap:_,description:Y};return{errorMap:(P,$)=>{let{message:w}=q;if(P.code==="invalid_enum_value")return{message:w??$.defaultError};if(typeof $.data==="undefined")return{message:w??K??$.defaultError};if(P.code!=="invalid_type")return{message:$.defaultError};return{message:w??j??$.defaultError}},description:Y}}class k8{get description(){return this._def.description}_getType(q){return Lq(q.data)}_getOrReturnCtx(q,_){return _||{common:q.parent.common,data:q.data,parsedType:Lq(q.data),schemaErrorMap:this._def.errorMap,path:q.path,parent:q.parent}}_processInputParams(q){return{status:new A6,ctx:{common:q.parent.common,data:q.data,parsedType:Lq(q.data),schemaErrorMap:this._def.errorMap,path:q.path,parent:q.parent}}}_parseSync(q){let _=this._parse(q);if(lK(_))throw new Error("Synchronous parse encountered promise.");return _}_parseAsync(q){let _=this._parse(q);return Promise.resolve(_)}parse(q,_){let j=this.safeParse(q,_);if(j.success)return j.data;throw j.error}safeParse(q,_){let j={common:{issues:[],async:_?.async??!1,contextualErrorMap:_?.errorMap},path:_?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:Lq(q)},K=this._parseSync({data:q,path:j.path,parent:j});return r5(j,K)}"~validate"(q){let _={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:Lq(q)};if(!this["~standard"].async)try{let j=this._parseSync({data:q,path:[],parent:_});return v_(j)?{value:j.value}:{issues:_.common.issues}}catch(j){if(j?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;_.common={issues:[],async:!0}}return this._parseAsync({data:q,path:[],parent:_}).then((j)=>v_(j)?{value:j.value}:{issues:_.common.issues})}async parseAsync(q,_){let j=await this.safeParseAsync(q,_);if(j.success)return j.data;throw j.error}async safeParseAsync(q,_){let j={common:{issues:[],contextualErrorMap:_?.errorMap,async:!0},path:_?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:Lq(q)},K=this._parse({data:q,path:j.path,parent:j}),Y=await(lK(K)?K:Promise.resolve(K));return r5(j,Y)}refine(q,_){let j=(K)=>{if(typeof _==="string"||typeof _==="undefined")return{message:_};else if(typeof _==="function")return _(K);else return _};return this._refinement((K,Y)=>{let f=q(K),P=()=>Y.addIssue({code:e.custom,...j(K)});if(typeof Promise!=="undefined"&&f instanceof Promise)return f.then(($)=>{if(!$)return P(),!1;else return!0});if(!f)return P(),!1;else return!0})}refinement(q,_){return this._refinement((j,K)=>{if(!q(j))return K.addIssue(typeof _==="function"?_(j,K):_),!1;else return!0})}_refinement(q){return new U6({schema:this,typeName:W8.ZodEffects,effect:{type:"refinement",refinement:q}})}superRefine(q){return this._refinement(q)}constructor(q){this.spa=this.safeParseAsync,this._def=q,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(_)=>this["~validate"](_)}}optional(){return Wq.create(this,this._def)}nullable(){return pq.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vq.create(this)}promise(){return T_.create(this,this._def)}or(q){return U_.create([this,q],this._def)}and(q){return s_.create(this,q,this._def)}transform(q){return new U6({...Z8(this._def),schema:this,typeName:W8.ZodEffects,effect:{type:"transform",transform:q}})}default(q){let _=typeof q==="function"?q:()=>q;return new KK({...Z8(this._def),innerType:this,defaultValue:_,typeName:W8.ZodDefault})}brand(){return new o3({typeName:W8.ZodBranded,type:this,...Z8(this._def)})}catch(q){let _=typeof q==="function"?q:()=>q;return new jK({...Z8(this._def),innerType:this,catchValue:_,typeName:W8.ZodCatch})}describe(q){return new this.constructor({...this._def,description:q})}pipe(q){return oK.create(this,q)}readonly(){return PK.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function P1(q){let _="[0-5]\\d";if(q.precision)_=`${_}\\.\\d{${q.precision}}`;else if(q.precision==null)_=`${_}(\\.\\d+)?`;let j=q.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${_})${j}`}function Lz(q){return new RegExp(`^${P1(q)}$`)}function Y1(q){let _=`${j1}T${P1(q)}`,j=[];if(j.push(q.local?"Z?":"Z"),q.offset)j.push("([+-]\\d{2}:?\\d{2})");return _=`${_}(${j.join("|")})`,new RegExp(`^${_}$`)}function pz(q,_){if((_==="v4"||!_)&&Ez.test(q))return!0;if((_==="v6"||!_)&&mz.test(q))return!0;return!1}function lz(q,_){if(!Mz.test(q))return!1;try{let[j]=q.split(".");if(!j)return!1;let K=j.replace(/-/g,"+").replace(/_/g,"/").padEnd(j.length+(4-j.length%4)%4,"="),Y=JSON.parse(atob(K));if(typeof Y!=="object"||Y===null)return!1;if("typ"in Y&&Y?.typ!=="JWT")return!1;if(!Y.alg)return!1;if(_&&Y.alg!==_)return!1;return!0}catch{return!1}}function xz(q,_){if((_==="v4"||!_)&&Rz.test(q))return!0;if((_==="v6"||!_)&&Iz.test(q))return!0;return!1}function nz(q,_){let j=(q.toString().split(".")[1]||"").length,K=(_.toString().split(".")[1]||"").length,Y=j>K?j:K,f=Number.parseInt(q.toFixed(Y).replace(".","")),P=Number.parseInt(_.toFixed(Y).replace(".",""));return f%P/10**Y}function r_(q){if(q instanceof i8){let _={};for(let j in q.shape){let K=q.shape[j];_[j]=Wq.create(r_(K))}return new i8({...q._def,shape:()=>_})}else if(q instanceof vq)return new vq({...q._def,type:r_(q.element)});else if(q instanceof Wq)return Wq.create(r_(q.unwrap()));else if(q instanceof pq)return pq.create(r_(q.unwrap()));else if(q instanceof Vq)return Vq.create(q.items.map((_)=>r_(_)));else return q}function D4(q,_){let j=Lq(q),K=Lq(_);if(q===_)return{valid:!0,data:q};else if(j===Q.object&&K===Q.object){let Y=D8.objectKeys(_),f=D8.objectKeys(q).filter(($)=>Y.indexOf($)!==-1),P={...q,..._};for(let $ of f){let w=D4(q[$],_[$]);if(!w.valid)return{valid:!1};P[$]=w.data}return{valid:!0,data:P}}else if(j===Q.array&&K===Q.array){if(q.length!==_.length)return{valid:!1};let Y=[];for(let f=0;f<q.length;f++){let P=q[f],$=_[f],w=D4(P,$);if(!w.valid)return{valid:!1};Y.push(w.data)}return{valid:!0,data:Y}}else if(j===Q.date&&K===Q.date&&+q===+_)return{valid:!0,data:q};else return{valid:!1}}function f1(q,_){return new Qq({values:q,typeName:W8.ZodEnum,...Z8(_)})}function i5(q,_){let j=typeof q==="function"?q(_):typeof q==="string"?{message:q}:q;return typeof j==="string"?{message:j}:j}function $1(q,_={},j){if(q)return H_.create().superRefine((K,Y)=>{let f=q(K);if(f instanceof Promise)return f.then((P)=>{if(!P){let $=i5(_,K),w=$.fatal??j??!0;Y.addIssue({code:"custom",...$,fatal:w})}});if(!f){let P=i5(_,K),$=P.fatal??j??!0;Y.addIssue({code:"custom",...P,fatal:$})}return});return H_.create()}function mW(q){if(!q)return{};let{errorMap:_,invalid_type_error:j,required_error:K,description:Y}=q;if(_&&(j||K))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(_)return{errorMap:_,description:Y};return{errorMap:(P,$)=>{var w,O;let{message:v}=q;if(P.code==="invalid_enum_value")return{message:v!==null&&v!==void 0?v:$.defaultError};if(typeof $.data==="undefined")return{message:(w=v!==null&&v!==void 0?v:K)!==null&&w!==void 0?w:$.defaultError};if(P.code!=="invalid_type")return{message:$.defaultError};return{message:(O=v!==null&&v!==void 0?v:j)!==null&&O!==void 0?O:$.defaultError}},description:Y}}function lq({prompt:q,options:{abortController:_=U5(),additionalDirectories:j=[],allowedTools:K=[],appendSystemPrompt:Y,canUseTool:f,continue:P,customSystemPrompt:$,cwd:w,disallowedTools:O=[],env:v,executable:z=IW()?"bun":"node",executableArgs:W=[],extraArgs:J={},fallbackModel:T,hooks:H,maxTurns:X,mcpServers:A,model:G,pathToClaudeCodeExecutable:h,permissionMode:M="default",permissionPromptToolName:I,resume:N,stderr:R,strictMcpConfig:l}={}}){if(!v)v={...process.env};if(!v.CLAUDE_CODE_ENTRYPOINT)v.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(h===void 0){let p=wz(import.meta.url),r=n5(p,"..");h=n5(r,"cli.js")}let E={},L=new Map;if(A)for(let[p,r]of Object.entries(A))if(r.type==="sdk")L.set(p,r.instance),E[p]={type:"sdk",name:p};else E[p]=r;let d=typeof q!=="string",V=new s5({prompt:q,abortController:_,additionalDirectories:j,cwd:w,executable:z,executableArgs:W,extraArgs:J,pathToClaudeCodeExecutable:h,env:v,stderr:R,customSystemPrompt:$,appendSystemPrompt:Y,maxTurns:X,model:G,fallbackModel:T,permissionMode:M,permissionPromptToolName:I,continueConversation:P,resume:N,allowedTools:K,disallowedTools:O,mcpServers:A,strictMcpConfig:l,canUseTool:!!f,hooks:!!H}),b=new _1(V,d,f,H,_,L);if(typeof q!=="string")b.streamInput(q);return b}function IW(){return process.versions.bun!==void 0||process.env.BUN_INSTALL!==void 0}var DO,hO,X4,CO,VO,MO=(q,_,j)=>{j=q!=null?DO(hO(q)):{};let K=_||!q||!q.__esModule?X4(j,"default",{value:q,enumerable:!0}):j;for(let Y of CO(q))if(!VO.call(K,Y))X4(K,Y,{get:()=>q[Y],enumerable:!0});return K},T8=(q,_)=>()=>(_||q((_={exports:{}}).exports,_),_.exports),NO=(q,_)=>{for(var j in _)X4(q,j,{get:_[j],enumerable:!0,configurable:!0,set:(K)=>_[j]=()=>K})},bO,V4,SO,YK,B5,EO,M4,N4,t5,e5,RO,mO,IO,gO,yO,dO,LO,pO,lO,xO,nO,cO,rO,iO,L5,p5,l5,x5,oO,aO,BO,tO,eO,FO,UO,sO,QO,qz,_z,Kz,jz,F5,Pz,Yz,fz,$z,zz=50,Jz,Tz,i_,Q5,_1,k,D8,A4,Q,Lq=(q)=>{switch(typeof q){case"undefined":return Q.undefined;case"string":return Q.string;case"number":return Number.isNaN(q)?Q.nan:Q.number;case"boolean":return Q.boolean;case"function":return Q.function;case"bigint":return Q.bigint;case"symbol":return Q.symbol;case"object":if(Array.isArray(q))return Q.array;if(q===null)return Q.null;if(q.then&&typeof q.then==="function"&&q.catch&&typeof q.catch==="function")return Q.promise;if(typeof Map!=="undefined"&&q instanceof Map)return Q.map;if(typeof Set!=="undefined"&&q instanceof Set)return Q.set;if(typeof Date!=="undefined"&&q instanceof Date)return Q.date;return Q.object;default:return Q.unknown}},e,kz=(q)=>{return JSON.stringify(q,null,2).replace(/"([^"]+)":/g,"$1:")},p6,Xz=(q,_)=>{let j;switch(q.code){case e.invalid_type:if(q.received===Q.undefined)j="Required";else j=`Expected ${q.expected}, received ${q.received}`;break;case e.invalid_literal:j=`Invalid literal value, expected ${JSON.stringify(q.expected,D8.jsonStringifyReplacer)}`;break;case e.unrecognized_keys:j=`Unrecognized key(s) in object: ${D8.joinValues(q.keys,", ")}`;break;case e.invalid_union:j="Invalid input";break;case e.invalid_union_discriminator:j=`Invalid discriminator value. Expected ${D8.joinValues(q.options)}`;break;case e.invalid_enum_value:j=`Invalid enum value. Expected ${D8.joinValues(q.options)}, received '${q.received}'`;break;case e.invalid_arguments:j="Invalid function arguments";break;case e.invalid_return_type:j="Invalid function return type";break;case e.invalid_date:j="Invalid date";break;case e.invalid_string:if(typeof q.validation==="object")if("includes"in q.validation){if(j=`Invalid input: must include "${q.validation.includes}"`,typeof q.validation.position==="number")j=`${j} at one or more positions greater than or equal to ${q.validation.position}`}else if("startsWith"in q.validation)j=`Invalid input: must start with "${q.validation.startsWith}"`;else if("endsWith"in q.validation)j=`Invalid input: must end with "${q.validation.endsWith}"`;else D8.assertNever(q.validation);else if(q.validation!=="regex")j=`Invalid ${q.validation}`;else j="Invalid";break;case e.too_small:if(q.type==="array")j=`Array must contain ${q.exact?"exactly":q.inclusive?"at least":"more than"} ${q.minimum} element(s)`;else if(q.type==="string")j=`String must contain ${q.exact?"exactly":q.inclusive?"at least":"over"} ${q.minimum} character(s)`;else if(q.type==="number")j=`Number must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${q.minimum}`;else if(q.type==="bigint")j=`Number must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${q.minimum}`;else if(q.type==="date")j=`Date must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(q.minimum))}`;else j="Invalid input";break;case e.too_big:if(q.type==="array")j=`Array must contain ${q.exact?"exactly":q.inclusive?"at most":"less than"} ${q.maximum} element(s)`;else if(q.type==="string")j=`String must contain ${q.exact?"exactly":q.inclusive?"at most":"under"} ${q.maximum} character(s)`;else if(q.type==="number")j=`Number must be ${q.exact?"exactly":q.inclusive?"less than or equal to":"less than"} ${q.maximum}`;else if(q.type==="bigint")j=`BigInt must be ${q.exact?"exactly":q.inclusive?"less than or equal to":"less than"} ${q.maximum}`;else if(q.type==="date")j=`Date must be ${q.exact?"exactly":q.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(q.maximum))}`;else j="Invalid input";break;case e.custom:j="Invalid input";break;case e.invalid_intersection_types:j="Intersection results could not be merged";break;case e.not_multiple_of:j=`Number must be a multiple of ${q.multipleOf}`;break;case e.not_finite:j="Number must be finite";break;default:j=_.defaultError,D8.assertNever(q)}return{message:j}},B_,K1,r3=(q)=>{let{data:_,path:j,errorMaps:K,issueData:Y}=q,f=[...j,...Y.path||[]],P={...Y,path:f};if(Y.message!==void 0)return{...Y,path:f,message:Y.message};let $="",w=K.filter((O)=>!!O).slice().reverse();for(let O of w)$=O(P,{data:_,defaultError:$}).message;return{...Y,path:f,message:$}},Gz,v8,o_=(q)=>({status:"dirty",value:q}),V6=(q)=>({status:"valid",value:q}),G4=(q)=>q.status==="aborted",u4=(q)=>q.status==="dirty",v_=(q)=>q.status==="valid",lK=(q)=>typeof Promise!=="undefined"&&q instanceof Promise,f8,r5=(q,_)=>{if(v_(_))return{success:!0,data:_.value};else{if(!q.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let j=new p6(q.common.issues);return this._error=j,this._error}}}},uz,Dz,hz,Cz,Vz,Mz,Nz,bz,Sz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",k4,Ez,Rz,mz,Iz,gz,yz,j1="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dz,zq,Uq,sq,t_,W_,xK,e_,F_,H_,Fq,Cq,nK,vq,i8,U_,dq=(q)=>{if(q instanceof Q_)return dq(q.schema);else if(q instanceof U6)return dq(q.innerType());else if(q instanceof qK)return[q.value];else if(q instanceof Qq)return q.options;else if(q instanceof _K)return D8.objectValues(q.enum);else if(q instanceof KK)return dq(q._def.innerType);else if(q instanceof e_)return[void 0];else if(q instanceof F_)return[null];else if(q instanceof Wq)return[void 0,...dq(q.unwrap())];else if(q instanceof pq)return[null,...dq(q.unwrap())];else if(q instanceof o3)return dq(q.unwrap());else if(q instanceof PK)return dq(q.unwrap());else if(q instanceof jK)return dq(q._def.innerType);else return[]},i3,s_,Vq,cK,rK,J_,a_,Q_,qK,Qq,_K,T_,U6,Wq,pq,KK,jK,iK,cz,o3,oK,PK,rz,W8,iz=(q,_={message:`Input not instance of ${q.name}`})=>$1((j)=>j instanceof q,_),w1,O1,oz,az,z1,Bz,tz,ez,Fz,Uz,sz,Qz,qv,_v,Kv,jv,Pv,Yv,fv,$v,wv,Ov,zv,vv,Wv,Hv,Jv,Tv,Zv,o5,kv,Xv,Av,Gv,uv=()=>w1().optional(),Dv=()=>O1().optional(),hv=()=>z1().optional(),Cv,Vv,a3="2.0",v1,W1,Mv,s6,m6,aK,Mq,Q6,B3,Nv,bv,Sv,a5,Ev,yC,H1,J1,BK,T1,Rv,mv,Iv,gv,yv,Z1,dv,k1,t3,e3,X1,A1,b4,G1,u1,Lv,pv,lv,xv,nv,cv,rv,iv,ov,av,Bv,tv,ev,Fv,Uv,sv,S4,E4,R4,Qv,qW,D1,_W,KW,jW,PW,YW,fW,$W,h1,dC,wW,OW,C1,zW,vW,WW,HW,JW,TW,ZW,kW,XW,AW,GW,uW,DW,hW,CW,VW,MW,NW,bW,SW,EW,RW,LC,pC,lC,xC,nC,cC,rC,iC,oC,h4,C4;var F3=K6(()=>{DO=Object.create,hO=Object.getPrototypeOf,X4=Object.defineProperty,CO=Object.getOwnPropertyNames,VO=Object.prototype.hasOwnProperty,bO=T8((q,_)=>{(function(j,K){typeof q==="object"&&typeof _!=="undefined"?K(q):typeof define==="function"&&define.amd?define(["exports"],K):K(j.URI=j.URI||{})})(q,function(j){function K(){for(var m=arguments.length,u=Array(m),g=0;g<m;g++)u[g]=arguments[g];if(u.length>1){u[0]=u[0].slice(0,-1);var x=u.length-1;for(var c=1;c<x;++c)u[c]=u[c].slice(1,-1);return u[x]=u[x].slice(1),u.join("")}else return u[0]}function Y(m){return"(?:"+m+")"}function f(m){return m===void 0?"undefined":m===null?"null":Object.prototype.toString.call(m).split(" ").pop().split("]").shift().toLowerCase()}function P(m){return m.toUpperCase()}function $(m){return m!==void 0&&m!==null?m instanceof Array?m:typeof m.length!=="number"||m.split||m.setInterval||m.call?[m]:Array.prototype.slice.call(m):[]}function w(m,u){var g=m;if(u)for(var x in u)g[x]=u[x];return g}function O(m){var u="[A-Za-z]",g="[\\x0D]",x="[0-9]",c="[\\x22]",s=K(x,"[A-Fa-f]"),X8="[\\x0A]",C8="[\\x20]",S8=Y(Y("%[EFef]"+s+"%"+s+s+"%"+s+s)+"|"+Y("%[89A-Fa-f]"+s+"%"+s+s)+"|"+Y("%"+s+s)),q6="[\\:\\/\\?\\#\\[\\]\\@]",u8="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c8=K(q6,u8),_6=m?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",d8=m?"[\\uE000-\\uF8FF]":"[]",N8=K(u,x,"[\\-\\.\\_\\~]",_6),r8=Y(u+K(u,x,"[\\+\\-\\.]")+"*"),E8=Y(Y(S8+"|"+K(N8,u8,"[\\:]"))+"*"),w_=Y(Y("25[0-5]")+"|"+Y("2[0-4]"+x)+"|"+Y("1"+x+x)+"|"+Y("[1-9]"+x)+"|"+x),y6=Y(Y("25[0-5]")+"|"+Y("2[0-4]"+x)+"|"+Y("1"+x+x)+"|"+Y("0?[1-9]"+x)+"|0?0?"+x),e6=Y(y6+"\\."+y6+"\\."+y6+"\\."+y6),m8=Y(s+"{1,4}"),d6=Y(Y(m8+"\\:"+m8)+"|"+e6),F6=Y(Y(m8+"\\:")+"{6}"+d6),hq=Y("\\:\\:"+Y(m8+"\\:")+"{5}"+d6),O_=Y(Y(m8)+"?\\:\\:"+Y(m8+"\\:")+"{4}"+d6),mq=Y(Y(Y(m8+"\\:")+"{0,1}"+m8)+"?\\:\\:"+Y(m8+"\\:")+"{3}"+d6),mK=Y(Y(Y(m8+"\\:")+"{0,2}"+m8)+"?\\:\\:"+Y(m8+"\\:")+"{2}"+d6),d3=Y(Y(Y(m8+"\\:")+"{0,3}"+m8)+"?\\:\\:"+m8+"\\:"+d6),L3=Y(Y(Y(m8+"\\:")+"{0,4}"+m8)+"?\\:\\:"+d6),y_=Y(Y(Y(m8+"\\:")+"{0,5}"+m8)+"?\\:\\:"+m8),d_=Y(Y(Y(m8+"\\:")+"{0,6}"+m8)+"?\\:\\:"),Iq=Y([F6,hq,O_,mq,mK,d3,L3,y_,d_].join("|")),L_=Y(Y(N8+"|"+S8)+"+"),K4=Y(Iq+"\\%25"+L_),z_=Y(Iq+Y("\\%25|\\%(?!"+s+"{2})")+L_),Ow=Y("[vV]"+s+"+\\."+K(N8,u8,"[\\:]")+"+"),zw=Y("\\["+Y(z_+"|"+Iq+"|"+Ow)+"\\]"),K5=Y(Y(S8+"|"+K(N8,u8))+"*"),IK=Y(zw+"|"+e6+"(?!"+K5+")|"+K5),gK=Y(x+"*"),j5=Y(Y(E8+"@")+"?"+IK+Y("\\:"+gK)+"?"),yK=Y(S8+"|"+K(N8,u8,"[\\:\\@]")),vw=Y(yK+"*"),P5=Y(yK+"+"),Ww=Y(Y(S8+"|"+K(N8,u8,"[\\@]"))+"+"),gq=Y(Y("\\/"+vw)+"*"),p_=Y("\\/"+Y(P5+gq)+"?"),j4=Y(Ww+gq),p3=Y(P5+gq),l_="(?!"+yK+")",th=Y(gq+"|"+p_+"|"+j4+"|"+p3+"|"+l_),x_=Y(Y(yK+"|"+K("[\\/\\?]",d8))+"*"),dK=Y(Y(yK+"|[\\/\\?]")+"*"),Y5=Y(Y("\\/\\/"+j5+gq)+"|"+p_+"|"+p3+"|"+l_),Hw=Y(r8+"\\:"+Y5+Y("\\?"+x_)+"?"+Y("\\#"+dK)+"?"),Jw=Y(Y("\\/\\/"+j5+gq)+"|"+p_+"|"+j4+"|"+l_),Tw=Y(Jw+Y("\\?"+x_)+"?"+Y("\\#"+dK)+"?"),eh=Y(Hw+"|"+Tw),Fh=Y(r8+"\\:"+Y5+Y("\\?"+x_)+"?"),Uh="^("+r8+")\\:"+Y(Y("\\/\\/("+Y("("+E8+")@")+"?("+IK+")"+Y("\\:("+gK+")")+"?)")+"?("+gq+"|"+p_+"|"+p3+"|"+l_+")")+Y("\\?("+x_+")")+"?"+Y("\\#("+dK+")")+"?$",sh="^(){0}"+Y(Y("\\/\\/("+Y("("+E8+")@")+"?("+IK+")"+Y("\\:("+gK+")")+"?)")+"?("+gq+"|"+p_+"|"+j4+"|"+l_+")")+Y("\\?("+x_+")")+"?"+Y("\\#("+dK+")")+"?$",Qh="^("+r8+")\\:"+Y(Y("\\/\\/("+Y("("+E8+")@")+"?("+IK+")"+Y("\\:("+gK+")")+"?)")+"?("+gq+"|"+p_+"|"+p3+"|"+l_+")")+Y("\\?("+x_+")")+"?$",qC="^"+Y("\\#("+dK+")")+"?$",_C="^"+Y("("+E8+")@")+"?("+IK+")"+Y("\\:("+gK+")")+"?$";return{NOT_SCHEME:new RegExp(K("[^]",u,x,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(K("[^\\%\\:]",N8,u8),"g"),NOT_HOST:new RegExp(K("[^\\%\\[\\]\\:]",N8,u8),"g"),NOT_PATH:new RegExp(K("[^\\%\\/\\:\\@]",N8,u8),"g"),NOT_PATH_NOSCHEME:new RegExp(K("[^\\%\\/\\@]",N8,u8),"g"),NOT_QUERY:new RegExp(K("[^\\%]",N8,u8,"[\\:\\@\\/\\?]",d8),"g"),NOT_FRAGMENT:new RegExp(K("[^\\%]",N8,u8,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(K("[^]",N8,u8),"g"),UNRESERVED:new RegExp(N8,"g"),OTHER_CHARS:new RegExp(K("[^\\%]",N8,c8),"g"),PCT_ENCODED:new RegExp(S8,"g"),IPV4ADDRESS:new RegExp("^("+e6+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Iq+")"+Y(Y("\\%25|\\%(?!"+s+"{2})")+"("+L_+")")+"?\\]?$")}}var v=O(!1),z=O(!0),W=function(){function m(u,g){var x=[],c=!0,s=!1,X8=void 0;try{for(var C8=u[Symbol.iterator](),S8;!(c=(S8=C8.next()).done);c=!0)if(x.push(S8.value),g&&x.length===g)break}catch(q6){s=!0,X8=q6}finally{try{if(!c&&C8.return)C8.return()}finally{if(s)throw X8}}return x}return function(u,g){if(Array.isArray(u))return u;else if(Symbol.iterator in Object(u))return m(u,g);else throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),J=function(m){if(Array.isArray(m)){for(var u=0,g=Array(m.length);u<m.length;u++)g[u]=m[u];return g}else return Array.from(m)},T=2147483647,H=36,X=1,A=26,G=38,h=700,M=72,I=128,N="-",R=/^xn--/,l=/[^\0-\x7E]/,E=/[\x2E\u3002\uFF0E\uFF61]/g,L={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=H-X,V=Math.floor,b=String.fromCharCode;function p(m){throw new RangeError(L[m])}function r(m,u){var g=[],x=m.length;while(x--)g[x]=u(m[x]);return g}function t(m,u){var g=m.split("@"),x="";if(g.length>1)x=g[0]+"@",m=g[1];m=m.replace(E,".");var c=m.split("."),s=r(c,u).join(".");return x+s}function F(m){var u=[],g=0,x=m.length;while(g<x){var c=m.charCodeAt(g++);if(c>=55296&&c<=56319&&g<x){var s=m.charCodeAt(g++);if((s&64512)==56320)u.push(((c&1023)<<10)+(s&1023)+65536);else u.push(c),g--}else u.push(c)}return u}var Y8=function m(u){return String.fromCodePoint.apply(String,J(u))},q8=function m(u){if(u-48<10)return u-22;if(u-65<26)return u-65;if(u-97<26)return u-97;return H},z8=function m(u,g){return u+22+75*(u<26)-((g!=0)<<5)},w8=function m(u,g,x){var c=0;u=x?V(u/h):u>>1,u+=V(u/g);for(;u>d*A>>1;c+=H)u=V(u/d);return V(c+(d+1)*u/(u+G))},K8=function m(u){var g=[],x=u.length,c=0,s=I,X8=M,C8=u.lastIndexOf(N);if(C8<0)C8=0;for(var S8=0;S8<C8;++S8){if(u.charCodeAt(S8)>=128)p("not-basic");g.push(u.charCodeAt(S8))}for(var q6=C8>0?C8+1:0;q6<x;){var u8=c;for(var c8=1,_6=H;;_6+=H){if(q6>=x)p("invalid-input");var d8=q8(u.charCodeAt(q6++));if(d8>=H||d8>V((T-c)/c8))p("overflow");c+=d8*c8;var N8=_6<=X8?X:_6>=X8+A?A:_6-X8;if(d8<N8)break;var r8=H-N8;if(c8>V(T/r8))p("overflow");c8*=r8}var E8=g.length+1;if(X8=w8(c-u8,E8,u8==0),V(c/E8)>T-s)p("overflow");s+=V(c/E8),c%=E8,g.splice(c++,0,s)}return String.fromCodePoint.apply(String,g)},G8=function m(u){var g=[];u=F(u);var x=u.length,c=I,s=0,X8=M,C8=!0,S8=!1,q6=void 0;try{for(var u8=u[Symbol.iterator](),c8;!(C8=(c8=u8.next()).done);C8=!0){var _6=c8.value;if(_6<128)g.push(b(_6))}}catch(z_){S8=!0,q6=z_}finally{try{if(!C8&&u8.return)u8.return()}finally{if(S8)throw q6}}var d8=g.length,N8=d8;if(d8)g.push(N);while(N8<x){var r8=T,E8=!0,w_=!1,y6=void 0;try{for(var e6=u[Symbol.iterator](),m8;!(E8=(m8=e6.next()).done);E8=!0){var d6=m8.value;if(d6>=c&&d6<r8)r8=d6}}catch(z_){w_=!0,y6=z_}finally{try{if(!E8&&e6.return)e6.return()}finally{if(w_)throw y6}}var F6=N8+1;if(r8-c>V((T-s)/F6))p("overflow");s+=(r8-c)*F6,c=r8;var hq=!0,O_=!1,mq=void 0;try{for(var mK=u[Symbol.iterator](),d3;!(hq=(d3=mK.next()).done);hq=!0){var L3=d3.value;if(L3<c&&++s>T)p("overflow");if(L3==c){var y_=s;for(var d_=H;;d_+=H){var Iq=d_<=X8?X:d_>=X8+A?A:d_-X8;if(y_<Iq)break;var L_=y_-Iq,K4=H-Iq;g.push(b(z8(Iq+L_%K4,0))),y_=V(L_/K4)}g.push(b(z8(y_,0))),X8=w8(s,F6,N8==d8),s=0,++N8}}}catch(z_){O_=!0,mq=z_}finally{try{if(!hq&&mK.return)mK.return()}finally{if(O_)throw mq}}++s,++c}return g.join("")},o8=function m(u){return t(u,function(g){return R.test(g)?K8(g.slice(4).toLowerCase()):g})},e8=function m(u){return t(u,function(g){return l.test(g)?"xn--"+G8(g):g})},D={version:"2.1.0",ucs2:{decode:F,encode:Y8},decode:K8,encode:G8,toASCII:e8,toUnicode:o8},C={};function Z(m){var u=m.charCodeAt(0),g=void 0;if(u<16)g="%0"+u.toString(16).toUpperCase();else if(u<128)g="%"+u.toString(16).toUpperCase();else if(u<2048)g="%"+(u>>6|192).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase();else g="%"+(u>>12|224).toString(16).toUpperCase()+"%"+(u>>6&63|128).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase();return g}function S(m){var u="",g=0,x=m.length;while(g<x){var c=parseInt(m.substr(g+1,2),16);if(c<128)u+=String.fromCharCode(c),g+=3;else if(c>=194&&c<224){if(x-g>=6){var s=parseInt(m.substr(g+4,2),16);u+=String.fromCharCode((c&31)<<6|s&63)}else u+=m.substr(g,6);g+=6}else if(c>=224){if(x-g>=9){var X8=parseInt(m.substr(g+4,2),16),C8=parseInt(m.substr(g+7,2),16);u+=String.fromCharCode((c&15)<<12|(X8&63)<<6|C8&63)}else u+=m.substr(g,9);g+=9}else u+=m.substr(g,3),g+=3}return u}function n(m,u){function g(x){var c=S(x);return!c.match(u.UNRESERVED)?x:c}if(m.scheme)m.scheme=String(m.scheme).replace(u.PCT_ENCODED,g).toLowerCase().replace(u.NOT_SCHEME,"");if(m.userinfo!==void 0)m.userinfo=String(m.userinfo).replace(u.PCT_ENCODED,g).replace(u.NOT_USERINFO,Z).replace(u.PCT_ENCODED,P);if(m.host!==void 0)m.host=String(m.host).replace(u.PCT_ENCODED,g).toLowerCase().replace(u.NOT_HOST,Z).replace(u.PCT_ENCODED,P);if(m.path!==void 0)m.path=String(m.path).replace(u.PCT_ENCODED,g).replace(m.scheme?u.NOT_PATH:u.NOT_PATH_NOSCHEME,Z).replace(u.PCT_ENCODED,P);if(m.query!==void 0)m.query=String(m.query).replace(u.PCT_ENCODED,g).replace(u.NOT_QUERY,Z).replace(u.PCT_ENCODED,P);if(m.fragment!==void 0)m.fragment=String(m.fragment).replace(u.PCT_ENCODED,g).replace(u.NOT_FRAGMENT,Z).replace(u.PCT_ENCODED,P);return m}function o(m){return m.replace(/^0*(.*)/,"$1")||"0"}function i(m,u){var g=m.match(u.IPV4ADDRESS)||[],x=W(g,2),c=x[1];if(c)return c.split(".").map(o).join(".");else return m}function B(m,u){var g=m.match(u.IPV6ADDRESS)||[],x=W(g,3),c=x[1],s=x[2];if(c){var X8=c.toLowerCase().split("::").reverse(),C8=W(X8,2),S8=C8[0],q6=C8[1],u8=q6?q6.split(":").map(o):[],c8=S8.split(":").map(o),_6=u.IPV4ADDRESS.test(c8[c8.length-1]),d8=_6?7:8,N8=c8.length-d8,r8=Array(d8);for(var E8=0;E8<d8;++E8)r8[E8]=u8[E8]||c8[N8+E8]||"";if(_6)r8[d8-1]=i(r8[d8-1],u);var w_=r8.reduce(function(F6,hq,O_){if(!hq||hq==="0"){var mq=F6[F6.length-1];if(mq&&mq.index+mq.length===O_)mq.length++;else F6.push({index:O_,length:1})}return F6},[]),y6=w_.sort(function(F6,hq){return hq.length-F6.length})[0],e6=void 0;if(y6&&y6.length>1){var m8=r8.slice(0,y6.index),d6=r8.slice(y6.index+y6.length);e6=m8.join(":")+"::"+d6.join(":")}else e6=r8.join(":");if(s)e6+="%"+s;return e6}else return m}var P8=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,H8="".match(/(){0}/)[1]===void 0;function O8(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g={},x=u.iri!==!1?z:v;if(u.reference==="suffix")m=(u.scheme?u.scheme+":":"")+"//"+m;var c=m.match(P8);if(c){if(H8){if(g.scheme=c[1],g.userinfo=c[3],g.host=c[4],g.port=parseInt(c[5],10),g.path=c[6]||"",g.query=c[7],g.fragment=c[8],isNaN(g.port))g.port=c[5]}else if(g.scheme=c[1]||void 0,g.userinfo=m.indexOf("@")!==-1?c[3]:void 0,g.host=m.indexOf("//")!==-1?c[4]:void 0,g.port=parseInt(c[5],10),g.path=c[6]||"",g.query=m.indexOf("?")!==-1?c[7]:void 0,g.fragment=m.indexOf("#")!==-1?c[8]:void 0,isNaN(g.port))g.port=m.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?c[4]:void 0;if(g.host)g.host=B(i(g.host,x),x);if(g.scheme===void 0&&g.userinfo===void 0&&g.host===void 0&&g.port===void 0&&!g.path&&g.query===void 0)g.reference="same-document";else if(g.scheme===void 0)g.reference="relative";else if(g.fragment===void 0)g.reference="absolute";else g.reference="uri";if(u.reference&&u.reference!=="suffix"&&u.reference!==g.reference)g.error=g.error||"URI is not a "+u.reference+" reference.";var s=C[(u.scheme||g.scheme||"").toLowerCase()];if(!u.unicodeSupport&&(!s||!s.unicodeSupport)){if(g.host&&(u.domainHost||s&&s.domainHost))try{g.host=D.toASCII(g.host.replace(x.PCT_ENCODED,S).toLowerCase())}catch(X8){g.error=g.error||"Host's domain name can not be converted to ASCII via punycode: "+X8}n(g,v)}else n(g,x);if(s&&s.parse)s.parse(g,u)}else g.error=g.error||"URI can not be parsed.";return g}function A8(m,u){var g=u.iri!==!1?z:v,x=[];if(m.userinfo!==void 0)x.push(m.userinfo),x.push("@");if(m.host!==void 0)x.push(B(i(String(m.host),g),g).replace(g.IPV6ADDRESS,function(c,s,X8){return"["+s+(X8?"%25"+X8:"")+"]"}));if(typeof m.port==="number"||typeof m.port==="string")x.push(":"),x.push(String(m.port));return x.length?x.join(""):void 0}var g8=/^\.\.?\//,M8=/^\/\.(\/|$)/,H6=/^\/\.\.(\/|$)/,a8=/^\/?(?:.|\n)*?(?=\/|$)/;function h6(m){var u=[];while(m.length)if(m.match(g8))m=m.replace(g8,"");else if(m.match(M8))m=m.replace(M8,"/");else if(m.match(H6))m=m.replace(H6,"/"),u.pop();else if(m==="."||m==="..")m="";else{var g=m.match(a8);if(g){var x=g[0];m=m.slice(x.length),u.push(x)}else throw new Error("Unexpected dot segment condition")}return u.join("")}function y8(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=u.iri?z:v,x=[],c=C[(u.scheme||m.scheme||"").toLowerCase()];if(c&&c.serialize)c.serialize(m,u);if(m.host){if(g.IPV6ADDRESS.test(m.host));else if(u.domainHost||c&&c.domainHost)try{m.host=!u.iri?D.toASCII(m.host.replace(g.PCT_ENCODED,S).toLowerCase()):D.toUnicode(m.host)}catch(C8){m.error=m.error||"Host's domain name can not be converted to "+(!u.iri?"ASCII":"Unicode")+" via punycode: "+C8}}if(n(m,g),u.reference!=="suffix"&&m.scheme)x.push(m.scheme),x.push(":");var s=A8(m,u);if(s!==void 0){if(u.reference!=="suffix")x.push("//");if(x.push(s),m.path&&m.path.charAt(0)!=="/")x.push("/")}if(m.path!==void 0){var X8=m.path;if(!u.absolutePath&&(!c||!c.absolutePath))X8=h6(X8);if(s===void 0)X8=X8.replace(/^\/\//,"/%2F");x.push(X8)}if(m.query!==void 0)x.push("?"),x.push(m.query);if(m.fragment!==void 0)x.push("#"),x.push(m.fragment);return x.join("")}function $6(m,u){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x=arguments[3],c={};if(!x)m=O8(y8(m,g),g),u=O8(y8(u,g),g);if(g=g||{},!g.tolerant&&u.scheme)c.scheme=u.scheme,c.userinfo=u.userinfo,c.host=u.host,c.port=u.port,c.path=h6(u.path||""),c.query=u.query;else{if(u.userinfo!==void 0||u.host!==void 0||u.port!==void 0)c.userinfo=u.userinfo,c.host=u.host,c.port=u.port,c.path=h6(u.path||""),c.query=u.query;else{if(!u.path)if(c.path=m.path,u.query!==void 0)c.query=u.query;else c.query=m.query;else{if(u.path.charAt(0)==="/")c.path=h6(u.path);else{if((m.userinfo!==void 0||m.host!==void 0||m.port!==void 0)&&!m.path)c.path="/"+u.path;else if(!m.path)c.path=u.path;else c.path=m.path.slice(0,m.path.lastIndexOf("/")+1)+u.path;c.path=h6(c.path)}c.query=u.query}c.userinfo=m.userinfo,c.host=m.host,c.port=m.port}c.scheme=m.scheme}return c.fragment=u.fragment,c}function t6(m,u,g){var x=w({scheme:"null"},g);return y8($6(O8(m,x),O8(u,x),x,!0),x)}function g6(m,u){if(typeof m==="string")m=y8(O8(m,u),u);else if(f(m)==="object")m=O8(y8(m,u),u);return m}function y3(m,u,g){if(typeof m==="string")m=y8(O8(m,g),g);else if(f(m)==="object")m=y8(m,g);if(typeof u==="string")u=y8(O8(u,g),g);else if(f(u)==="object")u=y8(u,g);return m===u}function q4(m,u){return m&&m.toString().replace(!u||!u.iri?v.ESCAPE:z.ESCAPE,Z)}function wq(m,u){return m&&m.toString().replace(!u||!u.iri?v.PCT_ENCODED:z.PCT_ENCODED,S)}var EK={scheme:"http",domainHost:!0,parse:function m(u,g){if(!u.host)u.error=u.error||"HTTP URIs must have a host.";return u},serialize:function m(u,g){var x=String(u.scheme).toLowerCase()==="https";if(u.port===(x?443:80)||u.port==="")u.port=void 0;if(!u.path)u.path="/";return u}},t9={scheme:"https",domainHost:EK.domainHost,parse:EK.parse,serialize:EK.serialize};function e9(m){return typeof m.secure==="boolean"?m.secure:String(m.scheme).toLowerCase()==="wss"}var RK={scheme:"ws",domainHost:!0,parse:function m(u,g){var x=u;return x.secure=e9(x),x.resourceName=(x.path||"/")+(x.query?"?"+x.query:""),x.path=void 0,x.query=void 0,x},serialize:function m(u,g){if(u.port===(e9(u)?443:80)||u.port==="")u.port=void 0;if(typeof u.secure==="boolean")u.scheme=u.secure?"wss":"ws",u.secure=void 0;if(u.resourceName){var x=u.resourceName.split("?"),c=W(x,2),s=c[0],X8=c[1];u.path=s&&s!=="/"?s:void 0,u.query=X8,u.resourceName=void 0}return u.fragment=void 0,u}},F9={scheme:"wss",domainHost:RK.domainHost,parse:RK.parse,serialize:RK.serialize},U$={},s$=!0,U9="[A-Za-z0-9\\-\\.\\_\\~"+(s$?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Dq="[0-9A-Fa-f]",Q$=Y(Y("%[EFef]"+Dq+"%"+Dq+Dq+"%"+Dq+Dq)+"|"+Y("%[89A-Fa-f]"+Dq+"%"+Dq+Dq)+"|"+Y("%"+Dq+Dq)),qw="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",_w="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Kw=K(_w,"[\\\"\\\\]"),jw="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Pw=new RegExp(U9,"g"),g_=new RegExp(Q$,"g"),Yw=new RegExp(K("[^]",qw,"[\\.]","[\\\"]",Kw),"g"),s9=new RegExp(K("[^]",U9,jw),"g"),fw=s9;function _4(m){var u=S(m);return!u.match(Pw)?m:u}var Q9={scheme:"mailto",parse:function m(u,g){var x=u,c=x.to=x.path?x.path.split(","):[];if(x.path=void 0,x.query){var s=!1,X8={},C8=x.query.split("&");for(var S8=0,q6=C8.length;S8<q6;++S8){var u8=C8[S8].split("=");switch(u8[0]){case"to":var c8=u8[1].split(",");for(var _6=0,d8=c8.length;_6<d8;++_6)c.push(c8[_6]);break;case"subject":x.subject=wq(u8[1],g);break;case"body":x.body=wq(u8[1],g);break;default:s=!0,X8[wq(u8[0],g)]=wq(u8[1],g);break}}if(s)x.headers=X8}x.query=void 0;for(var N8=0,r8=c.length;N8<r8;++N8){var E8=c[N8].split("@");if(E8[0]=wq(E8[0]),!g.unicodeSupport)try{E8[1]=D.toASCII(wq(E8[1],g).toLowerCase())}catch(w_){x.error=x.error||"Email address's domain name can not be converted to ASCII via punycode: "+w_}else E8[1]=wq(E8[1],g).toLowerCase();c[N8]=E8.join("@")}return x},serialize:function m(u,g){var x=u,c=$(u.to);if(c){for(var s=0,X8=c.length;s<X8;++s){var C8=String(c[s]),S8=C8.lastIndexOf("@"),q6=C8.slice(0,S8).replace(g_,_4).replace(g_,P).replace(Yw,Z),u8=C8.slice(S8+1);try{u8=!g.iri?D.toASCII(wq(u8,g).toLowerCase()):D.toUnicode(u8)}catch(N8){x.error=x.error||"Email address's domain name can not be converted to "+(!g.iri?"ASCII":"Unicode")+" via punycode: "+N8}c[s]=q6+"@"+u8}x.path=c.join(",")}var c8=u.headers=u.headers||{};if(u.subject)c8.subject=u.subject;if(u.body)c8.body=u.body;var _6=[];for(var d8 in c8)if(c8[d8]!==U$[d8])_6.push(d8.replace(g_,_4).replace(g_,P).replace(s9,Z)+"="+c8[d8].replace(g_,_4).replace(g_,P).replace(fw,Z));if(_6.length)x.query=_6.join("&");return x}},$w=/^([^\:]+)\:(.*)/,q5={scheme:"urn",parse:function m(u,g){var x=u.path&&u.path.match($w),c=u;if(x){var s=g.scheme||c.scheme||"urn",X8=x[1].toLowerCase(),C8=x[2],S8=s+":"+(g.nid||X8),q6=C[S8];if(c.nid=X8,c.nss=C8,c.path=void 0,q6)c=q6.parse(c,g)}else c.error=c.error||"URN can not be parsed.";return c},serialize:function m(u,g){var x=g.scheme||u.scheme||"urn",c=u.nid,s=x+":"+(g.nid||c),X8=C[s];if(X8)u=X8.serialize(u,g);var C8=u,S8=u.nss;return C8.path=(c||g.nid)+":"+S8,C8}},ww=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,_5={scheme:"urn:uuid",parse:function m(u,g){var x=u;if(x.uuid=x.nss,x.nss=void 0,!g.tolerant&&(!x.uuid||!x.uuid.match(ww)))x.error=x.error||"UUID is not valid.";return x},serialize:function m(u,g){var x=u;return x.nss=(u.uuid||"").toLowerCase(),x}};C[EK.scheme]=EK,C[t9.scheme]=t9,C[RK.scheme]=RK,C[F9.scheme]=F9,C[Q9.scheme]=Q9,C[q5.scheme]=q5,C[_5.scheme]=_5,j.SCHEMES=C,j.pctEncChar=Z,j.pctDecChars=S,j.parse=O8,j.removeDotSegments=h6,j.serialize=y8,j.resolveComponents=$6,j.resolve=t6,j.normalize=g6,j.equal=y3,j.escapeComponent=q4,j.unescapeComponent=wq,Object.defineProperty(j,"__esModule",{value:!0})})}),V4=T8((q,_)=>{_.exports=function j(K,Y){if(K===Y)return!0;if(K&&Y&&typeof K=="object"&&typeof Y=="object"){if(K.constructor!==Y.constructor)return!1;var f,P,$;if(Array.isArray(K)){if(f=K.length,f!=Y.length)return!1;for(P=f;P--!==0;)if(!j(K[P],Y[P]))return!1;return!0}if(K.constructor===RegExp)return K.source===Y.source&&K.flags===Y.flags;if(K.valueOf!==Object.prototype.valueOf)return K.valueOf()===Y.valueOf();if(K.toString!==Object.prototype.toString)return K.toString()===Y.toString();if($=Object.keys(K),f=$.length,f!==Object.keys(Y).length)return!1;for(P=f;P--!==0;)if(!Object.prototype.hasOwnProperty.call(Y,$[P]))return!1;for(P=f;P--!==0;){var w=$[P];if(!j(K[w],Y[w]))return!1}return!0}return K!==K&&Y!==Y}}),SO=T8((q,_)=>{_.exports=function j(K){var Y=0,f=K.length,P=0,$;while(P<f)if(Y++,$=K.charCodeAt(P++),$>=55296&&$<=56319&&P<f){if($=K.charCodeAt(P),($&64512)==56320)P++}return Y}}),YK=T8((q,_)=>{_.exports={copy:j,checkDataType:K,checkDataTypes:Y,coerceToTypes:P,toHash:$,getProperty:v,escapeQuotes:z,equal:V4(),ucs2length:SO(),varOccurences:W,varReplace:J,schemaHasRules:T,schemaHasRulesExcept:H,schemaUnknownRules:X,toQuotedString:A,getPathExpr:G,getPath:h,getData:N,unescapeFragment:l,unescapeJsonPointer:d,escapeFragment:E,escapeJsonPointer:L};function j(V,b){b=b||{};for(var p in V)b[p]=V[p];return b}function K(V,b,p,r){var t=r?" !== ":" === ",F=r?" || ":" && ",Y8=r?"!":"",q8=r?"":"!";switch(V){case"null":return b+t+"null";case"array":return Y8+"Array.isArray("+b+")";case"object":return"("+Y8+b+F+"typeof "+b+t+'"object"'+F+q8+"Array.isArray("+b+"))";case"integer":return"(typeof "+b+t+'"number"'+F+q8+"("+b+" % 1)"+F+b+t+b+(p?F+Y8+"isFinite("+b+")":"")+")";case"number":return"(typeof "+b+t+'"'+V+'"'+(p?F+Y8+"isFinite("+b+")":"")+")";default:return"typeof "+b+t+'"'+V+'"'}}function Y(V,b,p){switch(V.length){case 1:return K(V[0],b,p,!0);default:var r="",t=$(V);if(t.array&&t.object)r=t.null?"(":"(!"+b+" || ",r+="typeof "+b+' !== "object")',delete t.null,delete t.array,delete t.object;if(t.number)delete t.integer;for(var F in t)r+=(r?" && ":"")+K(F,b,p,!0);return r}}var f=$(["string","number","integer","boolean","null"]);function P(V,b){if(Array.isArray(b)){var p=[];for(var r=0;r<b.length;r++){var t=b[r];if(f[t])p[p.length]=t;else if(V==="array"&&t==="array")p[p.length]=t}if(p.length)return p}else if(f[b])return[b];else if(V==="array"&&b==="array")return["array"]}function $(V){var b={};for(var p=0;p<V.length;p++)b[V[p]]=!0;return b}var w=/^[a-z$_][a-z$_0-9]*$/i,O=/'|\\/g;function v(V){return typeof V=="number"?"["+V+"]":w.test(V)?"."+V:"['"+z(V)+"']"}function z(V){return V.replace(O,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function W(V,b){b+="[^0-9]";var p=V.match(new RegExp(b,"g"));return p?p.length:0}function J(V,b,p){return b+="([^0-9])",p=p.replace(/\$/g,"$$$$"),V.replace(new RegExp(b,"g"),p+"$1")}function T(V,b){if(typeof V=="boolean")return!V;for(var p in V)if(b[p])return!0}function H(V,b,p){if(typeof V=="boolean")return!V&&p!="not";for(var r in V)if(r!=p&&b[r])return!0}function X(V,b){if(typeof V=="boolean")return;for(var p in V)if(!b[p])return p}function A(V){return"'"+z(V)+"'"}function G(V,b,p,r){var t=p?"'/' + "+b+(r?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):r?"'[' + "+b+" + ']'":"'[\\'' + "+b+" + '\\']'";return R(V,t)}function h(V,b,p){var r=p?A("/"+L(b)):A(v(b));return R(V,r)}var M=/^\/(?:[^~]|~0|~1)*$/,I=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function N(V,b,p){var r,t,F,Y8;if(V==="")return"rootData";if(V[0]=="/"){if(!M.test(V))throw new Error("Invalid JSON-pointer: "+V);t=V,F="rootData"}else{if(Y8=V.match(I),!Y8)throw new Error("Invalid JSON-pointer: "+V);if(r=+Y8[1],t=Y8[2],t=="#"){if(r>=b)throw new Error("Cannot access property/index "+r+" levels up, current level is "+b);return p[b-r]}if(r>b)throw new Error("Cannot access data "+r+" levels up, current level is "+b);if(F="data"+(b-r||""),!t)return F}var q8=F,z8=t.split("/");for(var w8=0;w8<z8.length;w8++){var K8=z8[w8];if(K8)F+=v(d(K8)),q8+=" && "+F}return q8}function R(V,b){if(V=='""')return b;return(V+" + "+b).replace(/([^\\])' \+ '/g,"$1")}function l(V){return d(decodeURIComponent(V))}function E(V){return encodeURIComponent(L(V))}function L(V){return V.replace(/~/g,"~0").replace(/\//g,"~1")}function d(V){return V.replace(/~1/g,"/").replace(/~0/g,"~")}}),B5=T8((q,_)=>{var j=YK();_.exports=K;function K(Y){j.copy(Y,this)}}),EO=T8((q,_)=>{var j=_.exports=function(f,P,$){if(typeof P=="function")$=P,P={};$=P.cb||$;var w=typeof $=="function"?$:$.pre||function(){},O=$.post||function(){};K(P,w,O,f,"",f)};j.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},j.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},j.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},j.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function K(f,P,$,w,O,v,z,W,J,T){if(w&&typeof w=="object"&&!Array.isArray(w)){P(w,O,v,z,W,J,T);for(var H in w){var X=w[H];if(Array.isArray(X)){if(H in j.arrayKeywords)for(var A=0;A<X.length;A++)K(f,P,$,X[A],O+"/"+H+"/"+A,v,O,H,w,A)}else if(H in j.propsKeywords){if(X&&typeof X=="object")for(var G in X)K(f,P,$,X[G],O+"/"+H+"/"+Y(G),v,O,H,w,G)}else if(H in j.keywords||f.allKeys&&!(H in j.skipKeywords))K(f,P,$,X,O+"/"+H,v,O,H,w)}$(w,O,v,z,W,J,T)}}function Y(f){return f.replace(/~/g,"~0").replace(/\//g,"~1")}}),M4=T8((q,_)=>{var j=bO(),K=V4(),Y=YK(),f=B5(),P=EO();_.exports=$,$.normalizeId=h,$.fullPath=X,$.url=M,$.ids=I,$.inlineRef=J,$.schema=w;function $(N,R,l){var E=this._refs[l];if(typeof E=="string")if(this._refs[E])E=this._refs[E];else return $.call(this,N,R,E);if(E=E||this._schemas[l],E instanceof f)return J(E.schema,this._opts.inlineRefs)?E.schema:E.validate||this._compile(E);var L=w.call(this,R,l),d,V,b;if(L)d=L.schema,R=L.root,b=L.baseId;if(d instanceof f)V=d.validate||N.call(this,d.schema,R,void 0,b);else if(d!==void 0)V=J(d,this._opts.inlineRefs)?d:N.call(this,d,R,void 0,b);return V}function w(N,R){var l=j.parse(R),E=A(l),L=X(this._getId(N.schema));if(Object.keys(N.schema).length===0||E!==L){var d=h(E),V=this._refs[d];if(typeof V=="string")return O.call(this,N,V,l);else if(V instanceof f){if(!V.validate)this._compile(V);N=V}else if(V=this._schemas[d],V instanceof f){if(!V.validate)this._compile(V);if(d==h(R))return{schema:V,root:N,baseId:L};N=V}else return;if(!N.schema)return;L=X(this._getId(N.schema))}return z.call(this,l,L,N.schema,N)}function O(N,R,l){var E=w.call(this,N,R);if(E){var{schema:L,baseId:d}=E;N=E.root;var V=this._getId(L);if(V)d=M(d,V);return z.call(this,l,d,L,N)}}var v=Y.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function z(N,R,l,E){if(N.fragment=N.fragment||"",N.fragment.slice(0,1)!="/")return;var L=N.fragment.split("/");for(var d=1;d<L.length;d++){var V=L[d];if(V){if(V=Y.unescapeFragment(V),l=l[V],l===void 0)break;var b;if(!v[V]){if(b=this._getId(l),b)R=M(R,b);if(l.$ref){var p=M(R,l.$ref),r=w.call(this,E,p);if(r)l=r.schema,E=r.root,R=r.baseId}}}}if(l!==void 0&&l!==E.schema)return{schema:l,root:E,baseId:R}}var W=Y.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function J(N,R){if(R===!1)return!1;if(R===void 0||R===!0)return T(N);else if(R)return H(N)<=R}function T(N){var R;if(Array.isArray(N)){for(var l=0;l<N.length;l++)if(R=N[l],typeof R=="object"&&!T(R))return!1}else for(var E in N){if(E=="$ref")return!1;if(R=N[E],typeof R=="object"&&!T(R))return!1}return!0}function H(N){var R=0,l;if(Array.isArray(N))for(var E=0;E<N.length;E++){if(l=N[E],typeof l=="object")R+=H(l);if(R==1/0)return 1/0}else for(var L in N){if(L=="$ref")return 1/0;if(W[L])R++;else{if(l=N[L],typeof l=="object")R+=H(l)+1;if(R==1/0)return 1/0}}return R}function X(N,R){if(R!==!1)N=h(N);var l=j.parse(N);return A(l)}function A(N){return j.serialize(N).split("#")[0]+"#"}var G=/#\/?$/;function h(N){return N?N.replace(G,""):""}function M(N,R){return R=h(R),j.resolve(N,R)}function I(N){var R=h(this._getId(N)),l={"":R},E={"":X(R,!1)},L={},d=this;return P(N,{allKeys:!0},function(V,b,p,r,t,F,Y8){if(b==="")return;var q8=d._getId(V),z8=l[r],w8=E[r]+"/"+t;if(Y8!==void 0)w8+="/"+(typeof Y8=="number"?Y8:Y.escapeFragment(Y8));if(typeof q8=="string"){q8=z8=h(z8?j.resolve(z8,q8):q8);var K8=d._refs[q8];if(typeof K8=="string")K8=d._refs[K8];if(K8&&K8.schema){if(!K(V,K8.schema))throw new Error('id "'+q8+'" resolves to more than one schema')}else if(q8!=h(w8))if(q8[0]=="#"){if(L[q8]&&!K(V,L[q8]))throw new Error('id "'+q8+'" resolves to more than one schema');L[q8]=V}else d._refs[q8]=w8}l[b]=z8,E[b]=w8}),L}}),N4=T8((q,_)=>{var j=M4();_.exports={Validation:f(K),MissingRef:f(Y)};function K(P){this.message="validation failed",this.errors=P,this.ajv=this.validation=!0}Y.message=function(P,$){return"can't resolve reference "+$+" from id "+P};function Y(P,$,w){this.message=w||Y.message(P,$),this.missingRef=j.url(P,$),this.missingSchema=j.normalizeId(j.fullPath(this.missingRef))}function f(P){return P.prototype=Object.create(Error.prototype),P.prototype.constructor=P,P}}),t5=T8((q,_)=>{_.exports=function(j,K){if(!K)K={};if(typeof K==="function")K={cmp:K};var Y=typeof K.cycles==="boolean"?K.cycles:!1,f=K.cmp&&function($){return function(w){return function(O,v){var z={key:O,value:w[O]},W={key:v,value:w[v]};return $(z,W)}}}(K.cmp),P=[];return function $(w){if(w&&w.toJSON&&typeof w.toJSON==="function")w=w.toJSON();if(w===void 0)return;if(typeof w=="number")return isFinite(w)?""+w:"null";if(typeof w!=="object")return JSON.stringify(w);var O,v;if(Array.isArray(w)){v="[";for(O=0;O<w.length;O++){if(O)v+=",";v+=$(w[O])||"null"}return v+"]"}if(w===null)return"null";if(P.indexOf(w)!==-1){if(Y)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var z=P.push(w)-1,W=Object.keys(w).sort(f&&f(w));v="";for(O=0;O<W.length;O++){var J=W[O],T=$(w[J]);if(!T)continue;if(v)v+=",";v+=JSON.stringify(J)+":"+T}return P.splice(z,1),"{"+v+"}"}(j)}}),e5=T8((q,_)=>{_.exports=function j(K,Y,f){var P="",$=K.schema.$async===!0,w=K.util.schemaHasRulesExcept(K.schema,K.RULES.all,"$ref"),O=K.self._getId(K.schema);if(K.opts.strictKeywords){var v=K.util.schemaUnknownRules(K.schema,K.RULES.keywords);if(v){var z="unknown keyword: "+v;if(K.opts.strictKeywords==="log")K.logger.warn(z);else throw new Error(z)}}if(K.isTop){if(P+=" var validate = ",$)K.async=!0,P+="async ";if(P+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",O&&(K.opts.sourceCode||K.opts.processCode))P+=" "+("/*# sourceURL="+O+" */")+" "}if(typeof K.schema=="boolean"||!(w||K.schema.$ref)){var Y="false schema",W=K.level,J=K.dataLevel,T=K.schema[Y],H=K.schemaPath+K.util.getProperty(Y),X=K.errSchemaPath+"/"+Y,R=!K.opts.allErrors,L,A="data"+(J||""),N="valid"+W;if(K.schema===!1){if(K.isTop)R=!0;else P+=" var "+N+" = false; ";var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(L||"false schema")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'boolean schema is false' ";if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var h=P;if(P=G.pop(),!K.compositeRule&&R)if(K.async)P+=" throw new ValidationError(["+h+"]); ";else P+=" validate.errors = ["+h+"]; return false; ";else P+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else if(K.isTop)if($)P+=" return data; ";else P+=" validate.errors = null; return true; ";else P+=" var "+N+" = true; ";if(K.isTop)P+=" }; return validate; ";return P}if(K.isTop){var M=K.isTop,W=K.level=0,J=K.dataLevel=0,A="data";if(K.rootId=K.resolve.fullPath(K.self._getId(K.root.schema)),K.baseId=K.baseId||K.rootId,delete K.isTop,K.dataPathArr=[""],K.schema.default!==void 0&&K.opts.useDefaults&&K.opts.strictDefaults){var I="default is ignored in the schema root";if(K.opts.strictDefaults==="log")K.logger.warn(I);else throw new Error(I)}P+=" var vErrors = null; ",P+=" var errors = 0; ",P+=" if (rootData === undefined) rootData = data; "}else{var{level:W,dataLevel:J}=K,A="data"+(J||"");if(O)K.baseId=K.resolve.url(K.baseId,O);if($&&!K.async)throw new Error("async schema in sync schema");P+=" var errs_"+W+" = errors;"}var N="valid"+W,R=!K.opts.allErrors,l="",E="",L,d=K.schema.type,V=Array.isArray(d);if(d&&K.opts.nullable&&K.schema.nullable===!0){if(V){if(d.indexOf("null")==-1)d=d.concat("null")}else if(d!="null")d=[d,"null"],V=!0}if(V&&d.length==1)d=d[0],V=!1;if(K.schema.$ref&&w){if(K.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+K.errSchemaPath+'" (see option extendRefs)');else if(K.opts.extendRefs!==!0)w=!1,K.logger.warn('$ref: keywords ignored in schema at path "'+K.errSchemaPath+'"')}if(K.schema.$comment&&K.opts.$comment)P+=" "+K.RULES.all.$comment.code(K,"$comment");if(d){if(K.opts.coerceTypes)var b=K.util.coerceToTypes(K.opts.coerceTypes,d);var p=K.RULES.types[d];if(b||V||p===!0||p&&!a8(p)){var H=K.schemaPath+".type",X=K.errSchemaPath+"/type",H=K.schemaPath+".type",X=K.errSchemaPath+"/type",r=V?"checkDataTypes":"checkDataType";if(P+=" if ("+K.util[r](d,A,K.opts.strictNumbers,!0)+") { ",b){var t="dataType"+W,F="coerced"+W;if(P+=" var "+t+" = typeof "+A+"; var "+F+" = undefined; ",K.opts.coerceTypes=="array")P+=" if ("+t+" == 'object' && Array.isArray("+A+") && "+A+".length == 1) { "+A+" = "+A+"[0]; "+t+" = typeof "+A+"; if ("+K.util.checkDataType(K.schema.type,A,K.opts.strictNumbers)+") "+F+" = "+A+"; } ";P+=" if ("+F+" !== undefined) ; ";var Y8=b;if(Y8){var q8,z8=-1,w8=Y8.length-1;while(z8<w8)if(q8=Y8[z8+=1],q8=="string")P+=" else if ("+t+" == 'number' || "+t+" == 'boolean') "+F+" = '' + "+A+"; else if ("+A+" === null) "+F+" = ''; ";else if(q8=="number"||q8=="integer"){if(P+=" else if ("+t+" == 'boolean' || "+A+" === null || ("+t+" == 'string' && "+A+" && "+A+" == +"+A+" ",q8=="integer")P+=" && !("+A+" % 1)";P+=")) "+F+" = +"+A+"; "}else if(q8=="boolean")P+=" else if ("+A+" === 'false' || "+A+" === 0 || "+A+" === null) "+F+" = false; else if ("+A+" === 'true' || "+A+" === 1) "+F+" = true; ";else if(q8=="null")P+=" else if ("+A+" === '' || "+A+" === 0 || "+A+" === false) "+F+" = null; ";else if(K.opts.coerceTypes=="array"&&q8=="array")P+=" else if ("+t+" == 'string' || "+t+" == 'number' || "+t+" == 'boolean' || "+A+" == null) "+F+" = ["+A+"]; "}P+=" else { ";var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(L||"type")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: { type: '",V)P+=""+d.join(",");else P+=""+d;if(P+="' } ",K.opts.messages!==!1){if(P+=" , message: 'should be ",V)P+=""+d.join(",");else P+=""+d;P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+H+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var h=P;if(P=G.pop(),!K.compositeRule&&R)if(K.async)P+=" throw new ValidationError(["+h+"]); ";else P+=" validate.errors = ["+h+"]; return false; ";else P+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } if ("+F+" !== undefined) { ";var K8=J?"data"+(J-1||""):"parentData",G8=J?K.dataPathArr[J]:"parentDataProperty";if(P+=" "+A+" = "+F+"; ",!J)P+="if ("+K8+" !== undefined)";P+=" "+K8+"["+G8+"] = "+F+"; } "}else{var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(L||"type")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: { type: '",V)P+=""+d.join(",");else P+=""+d;if(P+="' } ",K.opts.messages!==!1){if(P+=" , message: 'should be ",V)P+=""+d.join(",");else P+=""+d;P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+H+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var h=P;if(P=G.pop(),!K.compositeRule&&R)if(K.async)P+=" throw new ValidationError(["+h+"]); ";else P+=" validate.errors = ["+h+"]; return false; ";else P+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}P+=" } "}}if(K.schema.$ref&&!w){if(P+=" "+K.RULES.all.$ref.code(K,"$ref")+" ",R){if(P+=" } if (errors === ",M)P+="0";else P+="errs_"+W;P+=") { ",E+="}"}}else{var o8=K.RULES;if(o8){var p,e8=-1,D=o8.length-1;while(e8<D)if(p=o8[e8+=1],a8(p)){if(p.type)P+=" if ("+K.util.checkDataType(p.type,A,K.opts.strictNumbers)+") { ";if(K.opts.useDefaults){if(p.type=="object"&&K.schema.properties){var T=K.schema.properties,C=Object.keys(T),Z=C;if(Z){var S,n=-1,o=Z.length-1;while(n<o){S=Z[n+=1];var i=T[S];if(i.default!==void 0){var B=A+K.util.getProperty(S);if(K.compositeRule){if(K.opts.strictDefaults){var I="default is ignored for: "+B;if(K.opts.strictDefaults==="log")K.logger.warn(I);else throw new Error(I)}}else{if(P+=" if ("+B+" === undefined ",K.opts.useDefaults=="empty")P+=" || "+B+" === null || "+B+" === '' ";if(P+=" ) "+B+" = ",K.opts.useDefaults=="shared")P+=" "+K.useDefault(i.default)+" ";else P+=" "+JSON.stringify(i.default)+" ";P+="; "}}}}}else if(p.type=="array"&&Array.isArray(K.schema.items)){var P8=K.schema.items;if(P8){var i,z8=-1,H8=P8.length-1;while(z8<H8)if(i=P8[z8+=1],i.default!==void 0){var B=A+"["+z8+"]";if(K.compositeRule){if(K.opts.strictDefaults){var I="default is ignored for: "+B;if(K.opts.strictDefaults==="log")K.logger.warn(I);else throw new Error(I)}}else{if(P+=" if ("+B+" === undefined ",K.opts.useDefaults=="empty")P+=" || "+B+" === null || "+B+" === '' ";if(P+=" ) "+B+" = ",K.opts.useDefaults=="shared")P+=" "+K.useDefault(i.default)+" ";else P+=" "+JSON.stringify(i.default)+" ";P+="; "}}}}}var O8=p.rules;if(O8){var A8,g8=-1,M8=O8.length-1;while(g8<M8)if(A8=O8[g8+=1],h6(A8)){var H6=A8.code(K,A8.keyword,p.type);if(H6){if(P+=" "+H6+" ",R)l+="}"}}}if(R)P+=" "+l+" ",l="";if(p.type){if(P+=" } ",d&&d===p.type&&!b){P+=" else { ";var H=K.schemaPath+".type",X=K.errSchemaPath+"/type",G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(L||"type")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: { type: '",V)P+=""+d.join(",");else P+=""+d;if(P+="' } ",K.opts.messages!==!1){if(P+=" , message: 'should be ",V)P+=""+d.join(",");else P+=""+d;P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+H+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var h=P;if(P=G.pop(),!K.compositeRule&&R)if(K.async)P+=" throw new ValidationError(["+h+"]); ";else P+=" validate.errors = ["+h+"]; return false; ";else P+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } "}}if(R){if(P+=" if (errors === ",M)P+="0";else P+="errs_"+W;P+=") { ",E+="}"}}}}if(R)P+=" "+E+" ";if(M){if($)P+=" if (errors === 0) return data; ",P+=" else throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; ",P+=" return errors === 0; ";P+=" }; return validate;"}else P+=" var "+N+" = errors === errs_"+W+";";function a8($6){var t6=$6.rules;for(var g6=0;g6<t6.length;g6++)if(h6(t6[g6]))return!0}function h6($6){return K.schema[$6.keyword]!==void 0||$6.implements&&y8($6)}function y8($6){var t6=$6.implements;for(var g6=0;g6<t6.length;g6++)if(K.schema[t6[g6]]!==void 0)return!0}return P}}),RO=T8((q,_)=>{var j=M4(),K=YK(),Y=N4(),f=t5(),P=e5(),$=K.ucs2length,w=V4(),O=Y.Validation;_.exports=v;function v(h,M,I,N){var R=this,l=this._opts,E=[void 0],L={},d=[],V={},b=[],p={},r=[];M=M||{schema:h,refVal:E,refs:L};var t=z.call(this,h,M,N),F=this._compilations[t.index];if(t.compiling)return F.callValidate=K8;var Y8=this._formats,q8=this.RULES;try{var z8=G8(h,M,I,N);F.validate=z8;var w8=F.callValidate;if(w8){if(w8.schema=z8.schema,w8.errors=null,w8.refs=z8.refs,w8.refVal=z8.refVal,w8.root=z8.root,w8.$async=z8.$async,l.sourceCode)w8.source=z8.source}return z8}finally{W.call(this,h,M,N)}function K8(){var i=F.validate,B=i.apply(this,arguments);return K8.errors=i.errors,B}function G8(i,B,P8,H8){var O8=!B||B&&B.schema==i;if(B.schema!=M.schema)return v.call(R,i,B,P8,H8);var A8=i.$async===!0,g8=P({isTop:!0,schema:i,isRoot:O8,baseId:H8,root:B,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:Y.MissingRef,RULES:q8,validate:P,util:K,resolve:j,resolveRef:o8,usePattern:S,useDefault:n,useCustomRule:o,opts:l,formats:Y8,logger:R.logger,self:R});if(g8=G(E,X)+G(d,T)+G(b,H)+G(r,A)+g8,l.processCode)g8=l.processCode(g8,i);var M8;try{var H6=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",g8);M8=H6(R,q8,Y8,M,E,b,r,w,$,O),E[0]=M8}catch(a8){throw R.logger.error("Error compiling schema, function code:",g8),a8}if(M8.schema=i,M8.errors=null,M8.refs=L,M8.refVal=E,M8.root=O8?M8:B,A8)M8.$async=!0;if(l.sourceCode===!0)M8.source={code:g8,patterns:d,defaults:b};return M8}function o8(i,B,P8){B=j.url(i,B);var H8=L[B],O8,A8;if(H8!==void 0)return O8=E[H8],A8="refVal["+H8+"]",Z(O8,A8);if(!P8&&M.refs){var g8=M.refs[B];if(g8!==void 0)return O8=M.refVal[g8],A8=e8(B,O8),Z(O8,A8)}A8=e8(B);var M8=j.call(R,G8,M,B);if(M8===void 0){var H6=I&&I[B];if(H6)M8=j.inlineRef(H6,l.inlineRefs)?H6:v.call(R,H6,M,I,i)}if(M8===void 0)D(B);else return C(B,M8),Z(M8,A8)}function e8(i,B){var P8=E.length;return E[P8]=B,L[i]=P8,"refVal"+P8}function D(i){delete L[i]}function C(i,B){var P8=L[i];E[P8]=B}function Z(i,B){return typeof i=="object"||typeof i=="boolean"?{code:B,schema:i,inline:!0}:{code:B,$async:i&&!!i.$async}}function S(i){var B=V[i];if(B===void 0)B=V[i]=d.length,d[B]=i;return"pattern"+B}function n(i){switch(typeof i){case"boolean":case"number":return""+i;case"string":return K.toQuotedString(i);case"object":if(i===null)return"null";var B=f(i),P8=p[B];if(P8===void 0)P8=p[B]=b.length,b[P8]=i;return"default"+P8}}function o(i,B,P8,H8){if(R._opts.validateSchema!==!1){var O8=i.definition.dependencies;if(O8&&!O8.every(function(t6){return Object.prototype.hasOwnProperty.call(P8,t6)}))throw new Error("parent schema must have all required keywords: "+O8.join(","));var A8=i.definition.validateSchema;if(A8){var g8=A8(B);if(!g8){var M8="keyword schema is invalid: "+R.errorsText(A8.errors);if(R._opts.validateSchema=="log")R.logger.error(M8);else throw new Error(M8)}}}var H6=i.definition.compile,a8=i.definition.inline,h6=i.definition.macro,y8;if(H6)y8=H6.call(R,B,P8,H8);else if(h6){if(y8=h6.call(R,B,P8,H8),l.validateSchema!==!1)R.validateSchema(y8,!0)}else if(a8)y8=a8.call(R,H8,i.keyword,B,P8);else if(y8=i.definition.validate,!y8)return;if(y8===void 0)throw new Error('custom keyword "'+i.keyword+'"failed to compile');var $6=r.length;return r[$6]=y8,{code:"customRule"+$6,validate:y8}}}function z(h,M,I){var N=J.call(this,h,M,I);if(N>=0)return{index:N,compiling:!0};return N=this._compilations.length,this._compilations[N]={schema:h,root:M,baseId:I},{index:N,compiling:!1}}function W(h,M,I){var N=J.call(this,h,M,I);if(N>=0)this._compilations.splice(N,1)}function J(h,M,I){for(var N=0;N<this._compilations.length;N++){var R=this._compilations[N];if(R.schema==h&&R.root==M&&R.baseId==I)return N}return-1}function T(h,M){return"var pattern"+h+" = new RegExp("+K.toQuotedString(M[h])+");"}function H(h){return"var default"+h+" = defaults["+h+"];"}function X(h,M){return M[h]===void 0?"":"var refVal"+h+" = refVal["+h+"];"}function A(h){return"var customRule"+h+" = customRules["+h+"];"}function G(h,M){if(!h.length)return"";var I="";for(var N=0;N<h.length;N++)I+=M(N,h);return I}}),mO=T8((q,_)=>{var j=_.exports=function K(){this._cache={}};j.prototype.put=function K(Y,f){this._cache[Y]=f},j.prototype.get=function K(Y){return this._cache[Y]},j.prototype.del=function K(Y){delete this._cache[Y]},j.prototype.clear=function K(){this._cache={}}}),IO=T8((q,_)=>{var j=YK(),K=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Y=[0,31,28,31,30,31,30,31,31,30,31,30,31],f=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,P=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,$=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,w=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,O=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,v=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,z=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,W=/^(?:\/(?:[^~/]|~0|~1)*)*$/,J=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,T=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;_.exports=H;function H(E){return E=E=="full"?"full":"fast",j.copy(H[E])}H.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":O,url:v,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:P,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:l,uuid:z,"json-pointer":W,"json-pointer-uri-fragment":J,"relative-json-pointer":T},H.full={date:A,time:G,"date-time":M,uri:N,"uri-reference":w,"uri-template":O,url:v,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:P,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:l,uuid:z,"json-pointer":W,"json-pointer-uri-fragment":J,"relative-json-pointer":T};function X(E){return E%4===0&&(E%100!==0||E%400===0)}function A(E){var L=E.match(K);if(!L)return!1;var d=+L[1],V=+L[2],b=+L[3];return V>=1&&V<=12&&b>=1&&b<=(V==2&&X(d)?29:Y[V])}function G(E,L){var d=E.match(f);if(!d)return!1;var V=d[1],b=d[2],p=d[3],r=d[5];return(V<=23&&b<=59&&p<=59||V==23&&b==59&&p==60)&&(!L||r)}var h=/t|\s/i;function M(E){var L=E.split(h);return L.length==2&&A(L[0])&&G(L[1],!0)}var I=/\/|:/;function N(E){return I.test(E)&&$.test(E)}var R=/[^\\]\\Z/;function l(E){if(R.test(E))return!1;try{return new RegExp(E),!0}catch(L){return!1}}}),gO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.errSchemaPath+"/"+Y,z=!K.opts.allErrors,W="data"+(w||""),J="valid"+$,T,H;if(O=="#"||O=="#/")if(K.isRoot)T=K.async,H="validate";else T=K.root.schema.$async===!0,H="root.refVal[0]";else{var X=K.resolveRef(K.baseId,O,K.isRoot);if(X===void 0){var A=K.MissingRefError.message(K.baseId,O);if(K.opts.missingRefs=="fail"){K.logger.error(A);var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(v)+" , params: { ref: '"+K.util.escapeQuotes(O)+"' } ",K.opts.messages!==!1)P+=" , message: 'can\\'t resolve reference "+K.util.escapeQuotes(O)+"' ";if(K.opts.verbose)P+=" , schema: "+K.util.toQuotedString(O)+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+W+" ";P+=" } "}else P+=" {} ";var h=P;if(P=G.pop(),!K.compositeRule&&z)if(K.async)P+=" throw new ValidationError(["+h+"]); ";else P+=" validate.errors = ["+h+"]; return false; ";else P+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(z)P+=" if (false) { "}else if(K.opts.missingRefs=="ignore"){if(K.logger.warn(A),z)P+=" if (true) { "}else throw new K.MissingRefError(K.baseId,O,A)}else if(X.inline){var M=K.util.copy(K);M.level++;var I="valid"+M.level;M.schema=X.schema,M.schemaPath="",M.errSchemaPath=O;var N=K.validate(M).replace(/validate\.schema/g,X.code);if(P+=" "+N+" ",z)P+=" if ("+I+") { "}else T=X.$async===!0||K.async&&X.$async!==!1,H=X.code}if(H){var G=G||[];if(G.push(P),P="",K.opts.passContext)P+=" "+H+".call(this, ";else P+=" "+H+"( ";if(P+=" "+W+", (dataPath || '')",K.errorPath!='""')P+=" + "+K.errorPath;var R=w?"data"+(w-1||""):"parentData",l=w?K.dataPathArr[w]:"parentDataProperty";P+=" , "+R+" , "+l+", rootData) ";var E=P;if(P=G.pop(),T){if(!K.async)throw new Error("async schema referenced by sync schema");if(z)P+=" var "+J+"; ";if(P+=" try { await "+E+"; ",z)P+=" "+J+" = true; ";if(P+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",z)P+=" "+J+" = false; ";if(P+=" } ",z)P+=" if ("+J+") { "}else if(P+=" if (!"+E+") { if (vErrors === null) vErrors = "+H+".errors; else vErrors = vErrors.concat("+H+".errors); errors = vErrors.length; } ",z)P+=" else { "}return P}}),yO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.schema[Y],w=K.schemaPath+K.util.getProperty(Y),O=K.errSchemaPath+"/"+Y,v=!K.opts.allErrors,z=K.util.copy(K),W="";z.level++;var J="valid"+z.level,T=z.baseId,H=!0,X=$;if(X){var A,G=-1,h=X.length-1;while(G<h)if(A=X[G+=1],K.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:K.util.schemaHasRules(A,K.RULES.all)){if(H=!1,z.schema=A,z.schemaPath=w+"["+G+"]",z.errSchemaPath=O+"/"+G,P+=" "+K.validate(z)+" ",z.baseId=T,v)P+=" if ("+J+") { ",W+="}"}}if(v)if(H)P+=" if (true) { ";else P+=" "+W.slice(0,-1)+" ";return P}}),dO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,h=O.every(function(L){return K.opts.strictKeywords?typeof L=="object"&&Object.keys(L).length>0||L===!1:K.util.schemaHasRules(L,K.RULES.all)});if(h){var M=X.baseId;P+=" var "+H+" = errors; var "+T+" = false; ";var I=K.compositeRule;K.compositeRule=X.compositeRule=!0;var N=O;if(N){var R,l=-1,E=N.length-1;while(l<E)R=N[l+=1],X.schema=R,X.schemaPath=v+"["+l+"]",X.errSchemaPath=z+"/"+l,P+=" "+K.validate(X)+" ",X.baseId=M,P+=" "+T+" = "+T+" || "+G+"; if (!"+T+") { ",A+="}"}if(K.compositeRule=X.compositeRule=I,P+=" "+A+" if (!"+T+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should match some schema in anyOf' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+=" } else { errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ",K.opts.allErrors)P+=" } "}else if(W)P+=" if (true) { ";return P}}),LO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.schema[Y],w=K.errSchemaPath+"/"+Y,O=!K.opts.allErrors,v=K.util.toQuotedString($);if(K.opts.$comment===!0)P+=" console.log("+v+");";else if(typeof K.opts.$comment=="function")P+=" self._opts.$comment("+v+", "+K.util.toQuotedString(w)+", validate.root.schema);";return P}}),pO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H=K.opts.$data&&O&&O.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",X="schema"+$;else X=O;if(!H)P+=" var schema"+$+" = validate.schema"+v+";";P+="var "+T+" = equal("+J+", schema"+$+"); if (!"+T+") { ";var A=A||[];if(A.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'const' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { allowedValue: schema"+$+" } ",K.opts.messages!==!1)P+=" , message: 'should be equal to constant' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var G=P;if(P=A.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+G+"]); ";else P+=" validate.errors = ["+G+"]; return false; ";else P+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" }",W)P+=" else { ";return P}}),lO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,h="i"+$,M=X.dataLevel=K.dataLevel+1,I="data"+M,N=K.baseId,R=K.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:K.util.schemaHasRules(O,K.RULES.all);if(P+="var "+H+" = errors;var "+T+";",R){var l=K.compositeRule;K.compositeRule=X.compositeRule=!0,X.schema=O,X.schemaPath=v,X.errSchemaPath=z,P+=" var "+G+" = false; for (var "+h+" = 0; "+h+" < "+J+".length; "+h+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,h,K.opts.jsonPointers,!0);var E=J+"["+h+"]";X.dataPathArr[M]=h;var L=K.validate(X);if(X.baseId=N,K.util.varOccurences(L,I)<2)P+=" "+K.util.varReplace(L,I,E)+" ";else P+=" var "+I+" = "+E+"; "+L+" ";P+=" if ("+G+") break; } ",K.compositeRule=X.compositeRule=l,P+=" "+A+" if (!"+G+") {"}else P+=" if ("+J+".length == 0) {";var d=d||[];if(d.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should contain a valid item' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var V=P;if(P=d.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+V+"]); ";else P+=" validate.errors = ["+V+"]; return false; ";else P+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else { ",R)P+=" errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ";if(K.opts.allErrors)P+=" } ";return P}}),xO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="errs__"+$,H=K.util.copy(K),X="";H.level++;var A="valid"+H.level,G={},h={},M=K.opts.ownProperties;for(l in O){if(l=="__proto__")continue;var I=O[l],N=Array.isArray(I)?h:G;N[l]=I}P+="var "+T+" = errors;";var R=K.errorPath;P+="var missing"+$+";";for(var l in h)if(N=h[l],N.length){if(P+=" if ( "+J+K.util.getProperty(l)+" !== undefined ",M)P+=" && Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(l)+"') ";if(W){P+=" && ( ";var E=N;if(E){var L,d=-1,V=E.length-1;while(d<V){if(L=E[d+=1],d)P+=" || ";var b=K.util.getProperty(L),p=J+b;if(P+=" ( ( "+p+" === undefined ",M)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(L)+"') ";P+=") && (missing"+$+" = "+K.util.toQuotedString(K.opts.jsonPointers?L:b)+") ) "}}P+=")) { ";var r="missing"+$,t="' + "+r+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.opts.jsonPointers?K.util.getPathExpr(R,r,!0):R+" + "+r;var F=F||[];if(F.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { property: '"+K.util.escapeQuotes(l)+"', missingProperty: '"+t+"', depsCount: "+N.length+", deps: '"+K.util.escapeQuotes(N.length==1?N[0]:N.join(", "))+"' } ",K.opts.messages!==!1){if(P+=" , message: 'should have ",N.length==1)P+="property "+K.util.escapeQuotes(N[0]);else P+="properties "+K.util.escapeQuotes(N.join(", "));P+=" when property "+K.util.escapeQuotes(l)+" is present' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var Y8=P;if(P=F.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+Y8+"]); ";else P+=" validate.errors = ["+Y8+"]; return false; ";else P+=" var err = "+Y8+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{P+=" ) { ";var q8=N;if(q8){var L,z8=-1,w8=q8.length-1;while(z8<w8){L=q8[z8+=1];var b=K.util.getProperty(L),t=K.util.escapeQuotes(L),p=J+b;if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPath(R,L,K.opts.jsonPointers);if(P+=" if ( "+p+" === undefined ",M)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(L)+"') ";if(P+=") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { property: '"+K.util.escapeQuotes(l)+"', missingProperty: '"+t+"', depsCount: "+N.length+", deps: '"+K.util.escapeQuotes(N.length==1?N[0]:N.join(", "))+"' } ",K.opts.messages!==!1){if(P+=" , message: 'should have ",N.length==1)P+="property "+K.util.escapeQuotes(N[0]);else P+="properties "+K.util.escapeQuotes(N.join(", "));P+=" when property "+K.util.escapeQuotes(l)+" is present' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}if(P+=" } ",W)X+="}",P+=" else { "}K.errorPath=R;var K8=H.baseId;for(var l in G){var I=G[l];if(K.opts.strictKeywords?typeof I=="object"&&Object.keys(I).length>0||I===!1:K.util.schemaHasRules(I,K.RULES.all)){if(P+=" "+A+" = true; if ( "+J+K.util.getProperty(l)+" !== undefined ",M)P+=" && Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(l)+"') ";if(P+=") { ",H.schema=I,H.schemaPath=v+K.util.getProperty(l),H.errSchemaPath=z+"/"+K.util.escapeFragment(l),P+=" "+K.validate(H)+" ",H.baseId=K8,P+=" } ",W)P+=" if ("+A+") { ",X+="}"}}if(W)P+=" "+X+" if ("+T+" == errors) {";return P}}),nO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H=K.opts.$data&&O&&O.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",X="schema"+$;else X=O;var A="i"+$,G="schema"+$;if(!H)P+=" var "+G+" = validate.schema"+v+";";if(P+="var "+T+";",H)P+=" if (schema"+$+" === undefined) "+T+" = true; else if (!Array.isArray(schema"+$+")) "+T+" = false; else {";if(P+=""+T+" = false;for (var "+A+"=0; "+A+"<"+G+".length; "+A+"++) if (equal("+J+", "+G+"["+A+"])) { "+T+" = true; break; }",H)P+=" } ";P+=" if (!"+T+") { ";var h=h||[];if(h.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { allowedValues: schema"+$+" } ",K.opts.messages!==!1)P+=" , message: 'should be equal to one of the allowed values' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var M=P;if(P=h.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+M+"]); ";else P+=" validate.errors = ["+M+"]; return false; ";else P+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" }",W)P+=" else { ";return P}}),cO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||"");if(K.opts.format===!1){if(W)P+=" if (true) { ";return P}var T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;var X=K.opts.unknownFormats,A=Array.isArray(X);if(T){var G="format"+$,h="isObject"+$,M="formatType"+$;if(P+=" var "+G+" = formats["+H+"]; var "+h+" = typeof "+G+" == 'object' && !("+G+" instanceof RegExp) && "+G+".validate; var "+M+" = "+h+" && "+G+".type || 'string'; if ("+h+") { ",K.async)P+=" var async"+$+" = "+G+".async; ";if(P+=" "+G+" = "+G+".validate; } if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'string') || ";if(P+=" (",X!="ignore"){if(P+=" ("+H+" && !"+G+" ",A)P+=" && self._opts.unknownFormats.indexOf("+H+") == -1 ";P+=") || "}if(P+=" ("+G+" && "+M+" == '"+f+"' && !(typeof "+G+" == 'function' ? ",K.async)P+=" (async"+$+" ? await "+G+"("+J+") : "+G+"("+J+")) ";else P+=" "+G+"("+J+") ";P+=" : "+G+".test("+J+"))))) {"}else{var G=K.formats[O];if(!G)if(X=="ignore"){if(K.logger.warn('unknown format "'+O+'" ignored in schema at path "'+K.errSchemaPath+'"'),W)P+=" if (true) { ";return P}else if(A&&X.indexOf(O)>=0){if(W)P+=" if (true) { ";return P}else throw new Error('unknown format "'+O+'" is used in schema at path "'+K.errSchemaPath+'"');var h=typeof G=="object"&&!(G instanceof RegExp)&&G.validate,M=h&&G.type||"string";if(h){var I=G.async===!0;G=G.validate}if(M!=f){if(W)P+=" if (true) { ";return P}if(I){if(!K.async)throw new Error("async format in sync schema");var N="formats"+K.util.getProperty(O)+".validate";P+=" if (!(await "+N+"("+J+"))) { "}else{P+=" if (! ";var N="formats"+K.util.getProperty(O);if(h)N+=".validate";if(typeof G=="function")P+=" "+N+"("+J+") ";else P+=" "+N+".test("+J+") ";P+=") { "}}var R=R||[];if(R.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'format' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { format: ",T)P+=""+H;else P+=""+K.util.toQuotedString(O);if(P+=" } ",K.opts.messages!==!1){if(P+=` , message: 'should match format "`,T)P+="' + "+H+" + '";else P+=""+K.util.escapeQuotes(O);P+=`"' `}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+K.util.toQuotedString(O);P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var l=P;if(P=R.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+l+"]); ";else P+=" validate.errors = ["+l+"]; return false; ";else P+=" var err = "+l+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { ";return P}}),rO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K);X.level++;var A="valid"+X.level,G=K.schema.then,h=K.schema.else,M=G!==void 0&&(K.opts.strictKeywords?typeof G=="object"&&Object.keys(G).length>0||G===!1:K.util.schemaHasRules(G,K.RULES.all)),I=h!==void 0&&(K.opts.strictKeywords?typeof h=="object"&&Object.keys(h).length>0||h===!1:K.util.schemaHasRules(h,K.RULES.all)),N=X.baseId;if(M||I){var R;X.createErrors=!1,X.schema=O,X.schemaPath=v,X.errSchemaPath=z,P+=" var "+H+" = errors; var "+T+" = true; ";var l=K.compositeRule;if(K.compositeRule=X.compositeRule=!0,P+=" "+K.validate(X)+" ",X.baseId=N,X.createErrors=!0,P+=" errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ",K.compositeRule=X.compositeRule=l,M){if(P+=" if ("+A+") { ",X.schema=K.schema.then,X.schemaPath=K.schemaPath+".then",X.errSchemaPath=K.errSchemaPath+"/then",P+=" "+K.validate(X)+" ",X.baseId=N,P+=" "+T+" = "+A+"; ",M&&I)R="ifClause"+$,P+=" var "+R+" = 'then'; ";else R="'then'";if(P+=" } ",I)P+=" else { "}else P+=" if (!"+A+") { ";if(I){if(X.schema=K.schema.else,X.schemaPath=K.schemaPath+".else",X.errSchemaPath=K.errSchemaPath+"/else",P+=" "+K.validate(X)+" ",X.baseId=N,P+=" "+T+" = "+A+"; ",M&&I)R="ifClause"+$,P+=" var "+R+" = 'else'; ";else R="'else'";P+=" } "}if(P+=" if (!"+T+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'if' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { failingKeyword: "+R+" } ",K.opts.messages!==!1)P+=` , message: 'should match "' + `+R+` + '" schema' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+=" } ",W)P+=" else { "}else if(W)P+=" if (true) { ";return P}}),iO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,h="i"+$,M=X.dataLevel=K.dataLevel+1,I="data"+M,N=K.baseId;if(P+="var "+H+" = errors;var "+T+";",Array.isArray(O)){var R=K.schema.additionalItems;if(R===!1){P+=" "+T+" = "+J+".length <= "+O.length+"; ";var l=z;z=K.errSchemaPath+"/additionalItems",P+=" if (!"+T+") { ";var E=E||[];if(E.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+O.length+" } ",K.opts.messages!==!1)P+=" , message: 'should NOT have more than "+O.length+" items' ";if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var L=P;if(P=E.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+L+"]); ";else P+=" validate.errors = ["+L+"]; return false; ";else P+=" var err = "+L+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",z=l,W)A+="}",P+=" else { "}var d=O;if(d){var V,b=-1,p=d.length-1;while(b<p)if(V=d[b+=1],K.opts.strictKeywords?typeof V=="object"&&Object.keys(V).length>0||V===!1:K.util.schemaHasRules(V,K.RULES.all)){P+=" "+G+" = true; if ("+J+".length > "+b+") { ";var r=J+"["+b+"]";X.schema=V,X.schemaPath=v+"["+b+"]",X.errSchemaPath=z+"/"+b,X.errorPath=K.util.getPathExpr(K.errorPath,b,K.opts.jsonPointers,!0),X.dataPathArr[M]=b;var t=K.validate(X);if(X.baseId=N,K.util.varOccurences(t,I)<2)P+=" "+K.util.varReplace(t,I,r)+" ";else P+=" var "+I+" = "+r+"; "+t+" ";if(P+=" } ",W)P+=" if ("+G+") { ",A+="}"}}if(typeof R=="object"&&(K.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:K.util.schemaHasRules(R,K.RULES.all))){X.schema=R,X.schemaPath=K.schemaPath+".additionalItems",X.errSchemaPath=K.errSchemaPath+"/additionalItems",P+=" "+G+" = true; if ("+J+".length > "+O.length+") { for (var "+h+" = "+O.length+"; "+h+" < "+J+".length; "+h+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,h,K.opts.jsonPointers,!0);var r=J+"["+h+"]";X.dataPathArr[M]=h;var t=K.validate(X);if(X.baseId=N,K.util.varOccurences(t,I)<2)P+=" "+K.util.varReplace(t,I,r)+" ";else P+=" var "+I+" = "+r+"; "+t+" ";if(W)P+=" if (!"+G+") break; ";if(P+=" } } ",W)P+=" if ("+G+") { ",A+="}"}}else if(K.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:K.util.schemaHasRules(O,K.RULES.all)){X.schema=O,X.schemaPath=v,X.errSchemaPath=z,P+=" for (var "+h+" = 0; "+h+" < "+J+".length; "+h+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,h,K.opts.jsonPointers,!0);var r=J+"["+h+"]";X.dataPathArr[M]=h;var t=K.validate(X);if(X.baseId=N,K.util.varOccurences(t,I)<2)P+=" "+K.util.varReplace(t,I,r)+" ";else P+=" var "+I+" = "+r+"; "+t+" ";if(W)P+=" if (!"+G+") break; ";P+=" }"}if(W)P+=" "+A+" if ("+H+" == errors) {";return P}}),L5=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,N,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;var X=Y=="maximum",A=X?"exclusiveMaximum":"exclusiveMinimum",G=K.schema[A],h=K.opts.$data&&G&&G.$data,M=X?"<":">",I=X?">":"<",N=void 0;if(!(T||typeof O=="number"||O===void 0))throw new Error(Y+" must be number");if(!(h||G===void 0||typeof G=="number"||typeof G=="boolean"))throw new Error(A+" must be number or boolean");if(h){var R=K.util.getData(G.$data,w,K.dataPathArr),l="exclusive"+$,E="exclType"+$,L="exclIsNumber"+$,d="op"+$,V="' + "+d+" + '";P+=" var schemaExcl"+$+" = "+R+"; ",R="schemaExcl"+$,P+=" var "+l+"; var "+E+" = typeof "+R+"; if ("+E+" != 'boolean' && "+E+" != 'undefined' && "+E+" != 'number') { ";var N=A,b=b||[];if(b.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(N||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: '"+A+" should be boolean' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var p=P;if(P=b.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+p+"]); ";else P+=" validate.errors = ["+p+"]; return false; ";else P+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";if(P+=" "+E+" == 'number' ? ( ("+l+" = "+H+" === undefined || "+R+" "+M+"= "+H+") ? "+J+" "+I+"= "+R+" : "+J+" "+I+" "+H+" ) : ( ("+l+" = "+R+" === true) ? "+J+" "+I+"= "+H+" : "+J+" "+I+" "+H+" ) || "+J+" !== "+J+") { var op"+$+" = "+l+" ? '"+M+"' : '"+M+"='; ",O===void 0)N=A,z=K.errSchemaPath+"/"+A,H=R,T=h}else{var L=typeof G=="number",V=M;if(L&&T){var d="'"+V+"'";if(P+=" if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" ( "+H+" === undefined || "+G+" "+M+"= "+H+" ? "+J+" "+I+"= "+G+" : "+J+" "+I+" "+H+" ) || "+J+" !== "+J+") { "}else{if(L&&O===void 0)l=!0,N=A,z=K.errSchemaPath+"/"+A,H=G,I+="=";else{if(L)H=Math[X?"min":"max"](G,O);if(G===(L?H:!0))l=!0,N=A,z=K.errSchemaPath+"/"+A,I+="=";else l=!1,V+="="}var d="'"+V+"'";if(P+=" if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" "+J+" "+I+" "+H+" || "+J+" !== "+J+") { "}}N=N||Y;var b=b||[];if(b.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(N||"_limit")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { comparison: "+d+", limit: "+H+", exclusive: "+l+" } ",K.opts.messages!==!1)if(P+=" , message: 'should be "+V+" ",T)P+="' + "+H;else P+=""+H+"'";if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var p=P;if(P=b.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+p+"]); ";else P+=" validate.errors = ["+p+"]; return false; ";else P+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { ";return P}}),p5=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,A,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;if(!(T||typeof O=="number"))throw new Error(Y+" must be number");var X=Y=="maxItems"?">":"<";if(P+="if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" "+J+".length "+X+" "+H+") { ";var A=Y,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitItems")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+H+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT have ",Y=="maxItems")P+="more";else P+="fewer";if(P+=" than ",T)P+="' + "+H+" + '";else P+=""+O;P+=" items' "}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var h=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+h+"]); ";else P+=" validate.errors = ["+h+"]; return false; ";else P+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),l5=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,A,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;if(!(T||typeof O=="number"))throw new Error(Y+" must be number");var X=Y=="maxLength"?">":"<";if(P+="if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";if(K.opts.unicode===!1)P+=" "+J+".length ";else P+=" ucs2length("+J+") ";P+=" "+X+" "+H+") { ";var A=Y,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitLength")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+H+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT be ",Y=="maxLength")P+="longer";else P+="shorter";if(P+=" than ",T)P+="' + "+H+" + '";else P+=""+O;P+=" characters' "}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var h=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+h+"]); ";else P+=" validate.errors = ["+h+"]; return false; ";else P+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),x5=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,A,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;if(!(T||typeof O=="number"))throw new Error(Y+" must be number");var X=Y=="maxProperties"?">":"<";if(P+="if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" Object.keys("+J+").length "+X+" "+H+") { ";var A=Y,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitProperties")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+H+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT have ",Y=="maxProperties")P+="more";else P+="fewer";if(P+=" than ",T)P+="' + "+H+" + '";else P+=""+O;P+=" properties' "}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var h=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+h+"]); ";else P+=" validate.errors = ["+h+"]; return false; ";else P+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),oO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;if(!(T||typeof O=="number"))throw new Error(Y+" must be number");if(P+="var division"+$+";if (",T)P+=" "+H+" !== undefined && ( typeof "+H+" != 'number' || ";if(P+=" (division"+$+" = "+J+" / "+H+", ",K.opts.multipleOfPrecision)P+=" Math.abs(Math.round(division"+$+") - division"+$+") > 1e-"+K.opts.multipleOfPrecision+" ";else P+=" division"+$+" !== parseInt(division"+$+") ";if(P+=" ) ",T)P+=" ) ";P+=" ) { ";var X=X||[];if(X.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { multipleOf: "+H+" } ",K.opts.messages!==!1)if(P+=" , message: 'should be multiple of ",T)P+="' + "+H;else P+=""+H+"'";if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var A=P;if(P=X.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+A+"]); ";else P+=" validate.errors = ["+A+"]; return false; ";else P+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),aO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="errs__"+$,H=K.util.copy(K);H.level++;var X="valid"+H.level;if(K.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:K.util.schemaHasRules(O,K.RULES.all)){H.schema=O,H.schemaPath=v,H.errSchemaPath=z,P+=" var "+T+" = errors; ";var A=K.compositeRule;K.compositeRule=H.compositeRule=!0,H.createErrors=!1;var G;if(H.opts.allErrors)G=H.opts.allErrors,H.opts.allErrors=!1;if(P+=" "+K.validate(H)+" ",H.createErrors=!0,G)H.opts.allErrors=G;K.compositeRule=H.compositeRule=A,P+=" if ("+X+") { ";var h=h||[];if(h.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'not' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should NOT be valid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var M=P;if(P=h.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+M+"]); ";else P+=" validate.errors = ["+M+"]; return false; ";else P+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else { errors = "+T+"; if (vErrors !== null) { if ("+T+") vErrors.length = "+T+"; else vErrors = null; } ",K.opts.allErrors)P+=" } "}else{if(P+=" var err = ",K.createErrors!==!1){if(P+=" { keyword: 'not' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should NOT be valid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",W)P+=" if (false) { "}return P}}),BO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,h=X.baseId,M="prevValid"+$,I="passingSchemas"+$;P+="var "+H+" = errors , "+M+" = false , "+T+" = false , "+I+" = null; ";var N=K.compositeRule;K.compositeRule=X.compositeRule=!0;var R=O;if(R){var l,E=-1,L=R.length-1;while(E<L){if(l=R[E+=1],K.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:K.util.schemaHasRules(l,K.RULES.all))X.schema=l,X.schemaPath=v+"["+E+"]",X.errSchemaPath=z+"/"+E,P+=" "+K.validate(X)+" ",X.baseId=h;else P+=" var "+G+" = true; ";if(E)P+=" if ("+G+" && "+M+") { "+T+" = false; "+I+" = ["+I+", "+E+"]; } else { ",A+="}";P+=" if ("+G+") { "+T+" = "+M+" = true; "+I+" = "+E+"; }"}}if(K.compositeRule=X.compositeRule=N,P+=""+A+"if (!"+T+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { passingSchemas: "+I+" } ",K.opts.messages!==!1)P+=" , message: 'should match exactly one schema in oneOf' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+="} else { errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; }",K.opts.allErrors)P+=" } ";return P}}),tO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;var X=T?"(new RegExp("+H+"))":K.usePattern(O);if(P+="if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'string') || ";P+=" !"+X+".test("+J+") ) { ";var A=A||[];if(A.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { pattern: ",T)P+=""+H;else P+=""+K.util.toQuotedString(O);if(P+=" } ",K.opts.messages!==!1){if(P+=` , message: 'should match pattern "`,T)P+="' + "+H+" + '";else P+=""+K.util.escapeQuotes(O);P+=`"' `}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+K.util.toQuotedString(O);P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var G=P;if(P=A.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+G+"]); ";else P+=" validate.errors = ["+G+"]; return false; ";else P+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),eO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="errs__"+$,H=K.util.copy(K),X="";H.level++;var A="valid"+H.level,G="key"+$,h="idx"+$,M=H.dataLevel=K.dataLevel+1,I="data"+M,N="dataProperties"+$,R=Object.keys(O||{}).filter(z8),l=K.schema.patternProperties||{},E=Object.keys(l).filter(z8),L=K.schema.additionalProperties,d=R.length||E.length,V=L===!1,b=typeof L=="object"&&Object.keys(L).length,p=K.opts.removeAdditional,r=V||b||p,t=K.opts.ownProperties,F=K.baseId,Y8=K.schema.required;if(Y8&&!(K.opts.$data&&Y8.$data)&&Y8.length<K.opts.loopRequired)var q8=K.util.toHash(Y8);function z8(wq){return wq!=="__proto__"}if(P+="var "+T+" = errors;var "+A+" = true;",t)P+=" var "+N+" = undefined;";if(r){if(t)P+=" "+N+" = "+N+" || Object.keys("+J+"); for (var "+h+"=0; "+h+"<"+N+".length; "+h+"++) { var "+G+" = "+N+"["+h+"]; ";else P+=" for (var "+G+" in "+J+") { ";if(d){if(P+=" var isAdditional"+$+" = !(false ",R.length)if(R.length>8)P+=" || validate.schema"+v+".hasOwnProperty("+G+") ";else{var w8=R;if(w8){var K8,G8=-1,o8=w8.length-1;while(G8<o8)K8=w8[G8+=1],P+=" || "+G+" == "+K.util.toQuotedString(K8)+" "}}if(E.length){var e8=E;if(e8){var D,C=-1,Z=e8.length-1;while(C<Z)D=e8[C+=1],P+=" || "+K.usePattern(D)+".test("+G+") "}}P+=" ); if (isAdditional"+$+") { "}if(p=="all")P+=" delete "+J+"["+G+"]; ";else{var S=K.errorPath,n="' + "+G+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);if(V)if(p)P+=" delete "+J+"["+G+"]; ";else{P+=" "+A+" = false; ";var o=z;z=K.errSchemaPath+"/additionalProperties";var i=i||[];if(i.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { additionalProperty: '"+n+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is an invalid additional property";else P+="should NOT have additional properties";P+="' "}if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var B=P;if(P=i.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+B+"]); ";else P+=" validate.errors = ["+B+"]; return false; ";else P+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(z=o,W)P+=" break; "}else if(b)if(p=="failing"){P+=" var "+T+" = errors; ";var P8=K.compositeRule;K.compositeRule=H.compositeRule=!0,H.schema=L,H.schemaPath=K.schemaPath+".additionalProperties",H.errSchemaPath=K.errSchemaPath+"/additionalProperties",H.errorPath=K.opts._errorDataPathProperty?K.errorPath:K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);var H8=J+"["+G+"]";H.dataPathArr[M]=G;var O8=K.validate(H);if(H.baseId=F,K.util.varOccurences(O8,I)<2)P+=" "+K.util.varReplace(O8,I,H8)+" ";else P+=" var "+I+" = "+H8+"; "+O8+" ";P+=" if (!"+A+") { errors = "+T+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+J+"["+G+"]; } ",K.compositeRule=H.compositeRule=P8}else{H.schema=L,H.schemaPath=K.schemaPath+".additionalProperties",H.errSchemaPath=K.errSchemaPath+"/additionalProperties",H.errorPath=K.opts._errorDataPathProperty?K.errorPath:K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);var H8=J+"["+G+"]";H.dataPathArr[M]=G;var O8=K.validate(H);if(H.baseId=F,K.util.varOccurences(O8,I)<2)P+=" "+K.util.varReplace(O8,I,H8)+" ";else P+=" var "+I+" = "+H8+"; "+O8+" ";if(W)P+=" if (!"+A+") break; "}K.errorPath=S}if(d)P+=" } ";if(P+=" } ",W)P+=" if ("+A+") { ",X+="}"}var A8=K.opts.useDefaults&&!K.compositeRule;if(R.length){var g8=R;if(g8){var K8,M8=-1,H6=g8.length-1;while(M8<H6){K8=g8[M8+=1];var a8=O[K8];if(K.opts.strictKeywords?typeof a8=="object"&&Object.keys(a8).length>0||a8===!1:K.util.schemaHasRules(a8,K.RULES.all)){var h6=K.util.getProperty(K8),H8=J+h6,y8=A8&&a8.default!==void 0;H.schema=a8,H.schemaPath=v+h6,H.errSchemaPath=z+"/"+K.util.escapeFragment(K8),H.errorPath=K.util.getPath(K.errorPath,K8,K.opts.jsonPointers),H.dataPathArr[M]=K.util.toQuotedString(K8);var O8=K.validate(H);if(H.baseId=F,K.util.varOccurences(O8,I)<2){O8=K.util.varReplace(O8,I,H8);var $6=H8}else{var $6=I;P+=" var "+I+" = "+H8+"; "}if(y8)P+=" "+O8+" ";else{if(q8&&q8[K8]){if(P+=" if ( "+$6+" === undefined ",t)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(K8)+"') ";P+=") { "+A+" = false; ";var S=K.errorPath,o=z,t6=K.util.escapeQuotes(K8);if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPath(S,K8,K.opts.jsonPointers);z=K.errSchemaPath+"/required";var i=i||[];if(i.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+t6+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+t6+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var B=P;if(P=i.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+B+"]); ";else P+=" validate.errors = ["+B+"]; return false; ";else P+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";z=o,K.errorPath=S,P+=" } else { "}else if(W){if(P+=" if ( "+$6+" === undefined ",t)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(K8)+"') ";P+=") { "+A+" = true; } else { "}else{if(P+=" if ("+$6+" !== undefined ",t)P+=" && Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(K8)+"') ";P+=" ) { "}P+=" "+O8+" } "}}if(W)P+=" if ("+A+") { ",X+="}"}}}if(E.length){var g6=E;if(g6){var D,y3=-1,q4=g6.length-1;while(y3<q4){D=g6[y3+=1];var a8=l[D];if(K.opts.strictKeywords?typeof a8=="object"&&Object.keys(a8).length>0||a8===!1:K.util.schemaHasRules(a8,K.RULES.all)){if(H.schema=a8,H.schemaPath=K.schemaPath+".patternProperties"+K.util.getProperty(D),H.errSchemaPath=K.errSchemaPath+"/patternProperties/"+K.util.escapeFragment(D),t)P+=" "+N+" = "+N+" || Object.keys("+J+"); for (var "+h+"=0; "+h+"<"+N+".length; "+h+"++) { var "+G+" = "+N+"["+h+"]; ";else P+=" for (var "+G+" in "+J+") { ";P+=" if ("+K.usePattern(D)+".test("+G+")) { ",H.errorPath=K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);var H8=J+"["+G+"]";H.dataPathArr[M]=G;var O8=K.validate(H);if(H.baseId=F,K.util.varOccurences(O8,I)<2)P+=" "+K.util.varReplace(O8,I,H8)+" ";else P+=" var "+I+" = "+H8+"; "+O8+" ";if(W)P+=" if (!"+A+") break; ";if(P+=" } ",W)P+=" else "+A+" = true; ";if(P+=" } ",W)P+=" if ("+A+") { ",X+="}"}}}}if(W)P+=" "+X+" if ("+T+" == errors) {";return P}}),FO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="errs__"+$,H=K.util.copy(K),X="";H.level++;var A="valid"+H.level;if(P+="var "+T+" = errors;",K.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:K.util.schemaHasRules(O,K.RULES.all)){H.schema=O,H.schemaPath=v,H.errSchemaPath=z;var G="key"+$,h="idx"+$,M="i"+$,I="' + "+G+" + '",N=H.dataLevel=K.dataLevel+1,R="data"+N,l="dataProperties"+$,E=K.opts.ownProperties,L=K.baseId;if(E)P+=" var "+l+" = undefined; ";if(E)P+=" "+l+" = "+l+" || Object.keys("+J+"); for (var "+h+"=0; "+h+"<"+l+".length; "+h+"++) { var "+G+" = "+l+"["+h+"]; ";else P+=" for (var "+G+" in "+J+") { ";P+=" var startErrs"+$+" = errors; ";var d=G,V=K.compositeRule;K.compositeRule=H.compositeRule=!0;var b=K.validate(H);if(H.baseId=L,K.util.varOccurences(b,R)<2)P+=" "+K.util.varReplace(b,R,d)+" ";else P+=" var "+R+" = "+d+"; "+b+" ";if(K.compositeRule=H.compositeRule=V,P+=" if (!"+A+") { for (var "+M+"=startErrs"+$+"; "+M+"<errors; "+M+"++) { vErrors["+M+"].propertyName = "+G+"; } var err = ",K.createErrors!==!1){if(P+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { propertyName: '"+I+"' } ",K.opts.messages!==!1)P+=" , message: 'property name \\'"+I+"\\' is invalid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(W)P+=" break; ";P+=" } }"}if(W)P+=" "+X+" if ("+T+" == errors) {";return P}}),UO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H=K.opts.$data&&O&&O.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",X="schema"+$;else X=O;var A="schema"+$;if(!H)if(O.length<K.opts.loopRequired&&K.schema.properties&&Object.keys(K.schema.properties).length){var G=[],h=O;if(h){var M,I=-1,N=h.length-1;while(I<N){M=h[I+=1];var R=K.schema.properties[M];if(!(R&&(K.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:K.util.schemaHasRules(R,K.RULES.all))))G[G.length]=M}}}else var G=O;if(H||G.length){var l=K.errorPath,E=H||G.length>=K.opts.loopRequired,L=K.opts.ownProperties;if(W)if(P+=" var missing"+$+"; ",E){if(!H)P+=" var "+A+" = validate.schema"+v+"; ";var d="i"+$,V="schema"+$+"["+d+"]",b="' + "+V+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPathExpr(l,V,K.opts.jsonPointers);if(P+=" var "+T+" = true; ",H)P+=" if (schema"+$+" === undefined) "+T+" = true; else if (!Array.isArray(schema"+$+")) "+T+" = false; else {";if(P+=" for (var "+d+" = 0; "+d+" < "+A+".length; "+d+"++) { "+T+" = "+J+"["+A+"["+d+"]] !== undefined ",L)P+=" && Object.prototype.hasOwnProperty.call("+J+", "+A+"["+d+"]) ";if(P+="; if (!"+T+") break; } ",H)P+=" } ";P+=" if (!"+T+") { ";var p=p||[];if(p.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+b+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+b+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var r=P;if(P=p.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+r+"]); ";else P+=" validate.errors = ["+r+"]; return false; ";else P+=" var err = "+r+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } else { "}else{P+=" if ( ";var t=G;if(t){var F,d=-1,Y8=t.length-1;while(d<Y8){if(F=t[d+=1],d)P+=" || ";var q8=K.util.getProperty(F),z8=J+q8;if(P+=" ( ( "+z8+" === undefined ",L)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(F)+"') ";P+=") && (missing"+$+" = "+K.util.toQuotedString(K.opts.jsonPointers?F:q8)+") ) "}}P+=") { ";var V="missing"+$,b="' + "+V+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.opts.jsonPointers?K.util.getPathExpr(l,V,!0):l+" + "+V;var p=p||[];if(p.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+b+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+b+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var r=P;if(P=p.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+r+"]); ";else P+=" validate.errors = ["+r+"]; return false; ";else P+=" var err = "+r+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } else { "}else if(E){if(!H)P+=" var "+A+" = validate.schema"+v+"; ";var d="i"+$,V="schema"+$+"["+d+"]",b="' + "+V+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPathExpr(l,V,K.opts.jsonPointers);if(H){if(P+=" if ("+A+" && !Array.isArray("+A+")) { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+b+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+b+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+A+" !== undefined) { "}if(P+=" for (var "+d+" = 0; "+d+" < "+A+".length; "+d+"++) { if ("+J+"["+A+"["+d+"]] === undefined ",L)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", "+A+"["+d+"]) ";if(P+=") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+b+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+b+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",H)P+=" } "}else{var w8=G;if(w8){var F,K8=-1,G8=w8.length-1;while(K8<G8){F=w8[K8+=1];var q8=K.util.getProperty(F),b=K.util.escapeQuotes(F),z8=J+q8;if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPath(l,F,K.opts.jsonPointers);if(P+=" if ( "+z8+" === undefined ",L)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(F)+"') ";if(P+=") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+b+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+b+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}K.errorPath=l}else if(W)P+=" if (true) {";return P}}),sO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H=K.opts.$data&&O&&O.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",X="schema"+$;else X=O;if((O||H)&&K.opts.uniqueItems!==!1){if(H)P+=" var "+T+"; if ("+X+" === false || "+X+" === undefined) "+T+" = true; else if (typeof "+X+" != 'boolean') "+T+" = false; else { ";P+=" var i = "+J+".length , "+T+" = true , j; if (i > 1) { ";var A=K.schema.items&&K.schema.items.type,G=Array.isArray(A);if(!A||A=="object"||A=="array"||G&&(A.indexOf("object")>=0||A.indexOf("array")>=0))P+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+J+"[i], "+J+"[j])) { "+T+" = false; break outer; } } } ";else{P+=" var itemIndices = {}, item; for (;i--;) { var item = "+J+"[i]; ";var h="checkDataType"+(G?"s":"");if(P+=" if ("+K.util[h](A,"item",K.opts.strictNumbers,!0)+") continue; ",G)P+=` if (typeof item == 'string') item = '"' + item; `;P+=" if (typeof itemIndices[item] == 'number') { "+T+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}if(P+=" } ",H)P+=" } ";P+=" if (!"+T+") { ";var M=M||[];if(M.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { i: i, j: j } ",K.opts.messages!==!1)P+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' ";if(K.opts.verbose){if(P+=" , schema: ",H)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var I=P;if(P=M.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+I+"]); ";else P+=" validate.errors = ["+I+"]; return false; ";else P+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { "}else if(W)P+=" if (true) { ";return P}}),QO=T8((q,_)=>{_.exports={$ref:gO(),allOf:yO(),anyOf:dO(),$comment:LO(),const:pO(),contains:lO(),dependencies:xO(),enum:nO(),format:cO(),if:rO(),items:iO(),maximum:L5(),minimum:L5(),maxItems:p5(),minItems:p5(),maxLength:l5(),minLength:l5(),maxProperties:x5(),minProperties:x5(),multipleOf:oO(),not:aO(),oneOf:BO(),pattern:tO(),properties:eO(),propertyNames:FO(),required:UO(),uniqueItems:sO(),validate:e5()}}),qz=T8((q,_)=>{var j=QO(),K=YK().toHash;_.exports=function Y(){var f=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],P=["type","$comment"],$=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],w=["number","integer","string","array","object","boolean","null"];return f.all=K(P),f.types=K(w),f.forEach(function(O){if(O.rules=O.rules.map(function(v){var z;if(typeof v=="object"){var W=Object.keys(v)[0];z=v[W],v=W,z.forEach(function(T){P.push(T),f.all[T]=!0})}P.push(v);var J=f.all[v]={keyword:v,code:j[v],implements:z};return J}),f.all.$comment={keyword:"$comment",code:j.$comment},O.type)f.types[O.type]=O}),f.keywords=K(P.concat($)),f.custom={},f}}),_z=T8((q,_)=>{var j=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];_.exports=function(K,Y){for(var f=0;f<Y.length;f++){K=JSON.parse(JSON.stringify(K));var P=Y[f].split("/"),$=K,w;for(w=1;w<P.length;w++)$=$[P[w]];for(w=0;w<j.length;w++){var O=j[w],v=$[O];if(v)$[O]={anyOf:[v,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}}}return K}}),Kz=T8((q,_)=>{var j=N4().MissingRef;_.exports=K;function K(Y,f,P){var $=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");if(typeof f=="function")P=f,f=void 0;var w=O(Y).then(function(){var z=$._addSchema(Y,void 0,f);return z.validate||v(z)});if(P)w.then(function(z){P(null,z)},P);return w;function O(z){var W=z.$schema;return W&&!$.getSchema(W)?K.call($,{$ref:W},!0):Promise.resolve()}function v(z){try{return $._compile(z)}catch(J){if(J instanceof j)return W(J);throw J}function W(J){var T=J.missingSchema;if(A(T))throw new Error("Schema "+T+" is loaded but "+J.missingRef+" cannot be resolved");var H=$._loadingSchemas[T];if(!H)H=$._loadingSchemas[T]=$._opts.loadSchema(T),H.then(X,X);return H.then(function(G){if(!A(T))return O(G).then(function(){if(!A(T))$.addSchema(G,T,void 0,f)})}).then(function(){return v(z)});function X(){delete $._loadingSchemas[T]}function A(G){return $._refs[G]||$._schemas[G]}}}}}),jz=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J,T="data"+(w||""),H="valid"+$,X="errs__"+$,A=K.opts.$data&&O&&O.$data,G;if(A)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",G="schema"+$;else G=O;var h=this,M="definition"+$,I=h.definition,N="",R,l,E,L,d;if(A&&I.$data){d="keywordValidate"+$;var V=I.validateSchema;P+=" var "+M+" = RULES.custom['"+Y+"'].definition; var "+d+" = "+M+".validate;"}else{if(L=K.useCustomRule(h,O,K.schema,K),!L)return;G="validate.schema"+v,d=L.code,R=I.compile,l=I.inline,E=I.macro}var b=d+".errors",p="i"+$,r="ruleErr"+$,t=I.async;if(t&&!K.async)throw new Error("async keyword in sync schema");if(!(l||E))P+=""+b+" = null;";if(P+="var "+X+" = errors;var "+H+";",A&&I.$data){if(N+="}",P+=" if ("+G+" === undefined) { "+H+" = true; } else { ",V)N+="}",P+=" "+H+" = "+M+".validateSchema("+G+"); if ("+H+") { "}if(l)if(I.statements)P+=" "+L.validate+" ";else P+=" "+H+" = "+L.validate+"; ";else if(E){var F=K.util.copy(K),N="";F.level++;var Y8="valid"+F.level;F.schema=L.validate,F.schemaPath="";var q8=K.compositeRule;K.compositeRule=F.compositeRule=!0;var z8=K.validate(F).replace(/validate\.schema/g,d);K.compositeRule=F.compositeRule=q8,P+=" "+z8}else{var w8=w8||[];if(w8.push(P),P="",P+=" "+d+".call( ",K.opts.passContext)P+="this";else P+="self";if(R||I.schema===!1)P+=" , "+T+" ";else P+=" , "+G+" , "+T+" , validate.schema"+K.schemaPath+" ";if(P+=" , (dataPath || '')",K.errorPath!='""')P+=" + "+K.errorPath;var K8=w?"data"+(w-1||""):"parentData",G8=w?K.dataPathArr[w]:"parentDataProperty";P+=" , "+K8+" , "+G8+" , rootData ) ";var o8=P;if(P=w8.pop(),I.errors===!1){if(P+=" "+H+" = ",t)P+="await ";P+=""+o8+"; "}else if(t)b="customErrors"+$,P+=" var "+b+" = null; try { "+H+" = await "+o8+"; } catch (e) { "+H+" = false; if (e instanceof ValidationError) "+b+" = e.errors; else throw e; } ";else P+=" "+b+" = null; "+H+" = "+o8+"; "}if(I.modifying)P+=" if ("+K8+") "+T+" = "+K8+"["+G8+"];";if(P+=""+N,I.valid){if(W)P+=" if (true) { "}else{if(P+=" if ( ",I.valid===void 0)if(P+=" !",E)P+=""+Y8;else P+=""+H;else P+=" "+!I.valid+" ";P+=") { ",J=h.keyword;var w8=w8||[];w8.push(P),P="";var w8=w8||[];if(w8.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(J||"custom")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { keyword: '"+h.keyword+"' } ",K.opts.messages!==!1)P+=` , message: 'should pass "`+h.keyword+`" keyword validation' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+T+" ";P+=" } "}else P+=" {} ";var e8=P;if(P=w8.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+e8+"]); ";else P+=" validate.errors = ["+e8+"]; return false; ";else P+=" var err = "+e8+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var D=P;if(P=w8.pop(),l)if(I.errors){if(I.errors!="full"){if(P+=" for (var "+p+"="+X+"; "+p+"<errors; "+p+"++) { var "+r+" = vErrors["+p+"]; if ("+r+".dataPath === undefined) "+r+".dataPath = (dataPath || '') + "+K.errorPath+"; if ("+r+".schemaPath === undefined) { "+r+'.schemaPath = "'+z+'"; } ',K.opts.verbose)P+=" "+r+".schema = "+G+"; "+r+".data = "+T+"; ";P+=" } "}}else if(I.errors===!1)P+=" "+D+" ";else{if(P+=" if ("+X+" == errors) { "+D+" } else { for (var "+p+"="+X+"; "+p+"<errors; "+p+"++) { var "+r+" = vErrors["+p+"]; if ("+r+".dataPath === undefined) "+r+".dataPath = (dataPath || '') + "+K.errorPath+"; if ("+r+".schemaPath === undefined) { "+r+'.schemaPath = "'+z+'"; } ',K.opts.verbose)P+=" "+r+".schema = "+G+"; "+r+".data = "+T+"; ";P+=" } } "}else if(E){if(P+=" var err = ",K.createErrors!==!1){if(P+=" { keyword: '"+(J||"custom")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { keyword: '"+h.keyword+"' } ",K.opts.messages!==!1)P+=` , message: 'should pass "`+h.keyword+`" keyword validation' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+T+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; "}else if(I.errors===!1)P+=" "+D+" ";else{if(P+=" if (Array.isArray("+b+")) { if (vErrors === null) vErrors = "+b+"; else vErrors = vErrors.concat("+b+"); errors = vErrors.length; for (var "+p+"="+X+"; "+p+"<errors; "+p+"++) { var "+r+" = vErrors["+p+"]; if ("+r+".dataPath === undefined) "+r+".dataPath = (dataPath || '') + "+K.errorPath+"; "+r+'.schemaPath = "'+z+'"; ',K.opts.verbose)P+=" "+r+".schema = "+G+"; "+r+".data = "+T+"; ";P+=" } } else { "+D+" } "}if(P+=" } ",W)P+=" else { "}return P}}),F5=T8((q,_)=>{_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),Pz=T8((q,_)=>{var j=F5();_.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:j.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:j.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}}),Yz=T8((q,_)=>{var j=/^[a-z_$][a-z0-9_$-]*$/i,K=jz(),Y=Pz();_.exports={add:f,get:P,remove:$,validate:w};function f(O,v){var z=this.RULES;if(z.keywords[O])throw new Error("Keyword "+O+" is already defined");if(!j.test(O))throw new Error("Keyword "+O+" is not a valid identifier");if(v){this.validateKeyword(v,!0);var W=v.type;if(Array.isArray(W))for(var J=0;J<W.length;J++)H(O,W[J],v);else H(O,W,v);var T=v.metaSchema;if(T){if(v.$data&&this._opts.$data)T={anyOf:[T,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]};v.validateSchema=this.compile(T,!0)}}z.keywords[O]=z.all[O]=!0;function H(X,A,G){var h;for(var M=0;M<z.length;M++){var I=z[M];if(I.type==A){h=I;break}}if(!h)h={type:A,rules:[]},z.push(h);var N={keyword:X,definition:G,custom:!0,code:K,implements:G.implements};h.rules.push(N),z.custom[X]=N}return this}function P(O){var v=this.RULES.custom[O];return v?v.definition:this.RULES.keywords[O]||!1}function $(O){var v=this.RULES;delete v.keywords[O],delete v.all[O],delete v.custom[O];for(var z=0;z<v.length;z++){var W=v[z].rules;for(var J=0;J<W.length;J++)if(W[J].keyword==O){W.splice(J,1);break}}return this}function w(O,v){w.errors=null;var z=this._validateKeyword=this._validateKeyword||this.compile(Y,!0);if(z(O))return!0;if(w.errors=z.errors,v)throw new Error("custom keyword definition is invalid: "+this.errorsText(z.errors));else return!1}}),fz=T8((q,_)=>{_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),$z=T8((q,_)=>{var j=RO(),K=M4(),Y=mO(),f=B5(),P=t5(),$=IO(),w=qz(),O=_z(),v=YK();_.exports=X,X.prototype.validate=A,X.prototype.compile=G,X.prototype.addSchema=h,X.prototype.addMetaSchema=M,X.prototype.validateSchema=I,X.prototype.getSchema=R,X.prototype.removeSchema=L,X.prototype.addFormat=q8,X.prototype.errorsText=Y8,X.prototype._addSchema=V,X.prototype._compile=b,X.prototype.compileAsync=Kz();var z=Yz();X.prototype.addKeyword=z.add,X.prototype.getKeyword=z.get,X.prototype.removeKeyword=z.remove,X.prototype.validateKeyword=z.validate;var W=N4();X.ValidationError=W.Validation,X.MissingRefError=W.MissingRef,X.$dataMetaSchema=O;var J="http://json-schema.org/draft-07/schema",T=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],H=["/properties"];function X(Z){if(!(this instanceof X))return new X(Z);if(Z=this._opts=v.copy(Z)||{},D(this),this._schemas={},this._refs={},this._fragments={},this._formats=$(Z.format),this._cache=Z.cache||new Y,this._loadingSchemas={},this._compilations=[],this.RULES=w(),this._getId=p(Z),Z.loopRequired=Z.loopRequired||1/0,Z.errorDataPath=="property")Z._errorDataPathProperty=!0;if(Z.serialize===void 0)Z.serialize=P;if(this._metaOpts=e8(this),Z.formats)K8(this);if(Z.keywords)G8(this);if(z8(this),typeof Z.meta=="object")this.addMetaSchema(Z.meta);if(Z.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});w8(this)}function A(Z,S){var n;if(typeof Z=="string"){if(n=this.getSchema(Z),!n)throw new Error('no schema with key or ref "'+Z+'"')}else{var o=this._addSchema(Z);n=o.validate||this._compile(o)}var i=n(S);if(n.$async!==!0)this.errors=n.errors;return i}function G(Z,S){var n=this._addSchema(Z,void 0,S);return n.validate||this._compile(n)}function h(Z,S,n,o){if(Array.isArray(Z)){for(var i=0;i<Z.length;i++)this.addSchema(Z[i],void 0,n,o);return this}var B=this._getId(Z);if(B!==void 0&&typeof B!="string")throw new Error("schema id must be string");return S=K.normalizeId(S||B),o8(this,S),this._schemas[S]=this._addSchema(Z,n,o,!0),this}function M(Z,S,n){return this.addSchema(Z,S,n,!0),this}function I(Z,S){var n=Z.$schema;if(n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this._opts.defaultMeta||N(this),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var o=this.validate(n,Z);if(!o&&S){var i="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(i);else throw new Error(i)}return o}function N(Z){var S=Z._opts.meta;return Z._opts.defaultMeta=typeof S=="object"?Z._getId(S)||S:Z.getSchema(J)?J:void 0,Z._opts.defaultMeta}function R(Z){var S=E(this,Z);switch(typeof S){case"object":return S.validate||this._compile(S);case"string":return this.getSchema(S);case"undefined":return l(this,Z)}}function l(Z,S){var n=K.schema.call(Z,{schema:{}},S);if(n){var{schema:o,root:i,baseId:B}=n,P8=j.call(Z,o,i,void 0,B);return Z._fragments[S]=new f({ref:S,fragment:!0,schema:o,root:i,baseId:B,validate:P8}),P8}}function E(Z,S){return S=K.normalizeId(S),Z._schemas[S]||Z._refs[S]||Z._fragments[S]}function L(Z){if(Z instanceof RegExp)return d(this,this._schemas,Z),d(this,this._refs,Z),this;switch(typeof Z){case"undefined":return d(this,this._schemas),d(this,this._refs),this._cache.clear(),this;case"string":var S=E(this,Z);if(S)this._cache.del(S.cacheKey);return delete this._schemas[Z],delete this._refs[Z],this;case"object":var n=this._opts.serialize,o=n?n(Z):Z;this._cache.del(o);var i=this._getId(Z);if(i)i=K.normalizeId(i),delete this._schemas[i],delete this._refs[i]}return this}function d(Z,S,n){for(var o in S){var i=S[o];if(!i.meta&&(!n||n.test(o)))Z._cache.del(i.cacheKey),delete S[o]}}function V(Z,S,n,o){if(typeof Z!="object"&&typeof Z!="boolean")throw new Error("schema should be object or boolean");var i=this._opts.serialize,B=i?i(Z):Z,P8=this._cache.get(B);if(P8)return P8;o=o||this._opts.addUsedSchema!==!1;var H8=K.normalizeId(this._getId(Z));if(H8&&o)o8(this,H8);var O8=this._opts.validateSchema!==!1&&!S,A8;if(O8&&!(A8=H8&&H8==K.normalizeId(Z.$schema)))this.validateSchema(Z,!0);var g8=K.ids.call(this,Z),M8=new f({id:H8,schema:Z,localRefs:g8,cacheKey:B,meta:n});if(H8[0]!="#"&&o)this._refs[H8]=M8;if(this._cache.put(B,M8),O8&&A8)this.validateSchema(Z,!0);return M8}function b(Z,S){if(Z.compiling){if(Z.validate=i,i.schema=Z.schema,i.errors=null,i.root=S?S:i,Z.schema.$async===!0)i.$async=!0;return i}Z.compiling=!0;var n;if(Z.meta)n=this._opts,this._opts=this._metaOpts;var o;try{o=j.call(this,Z.schema,S,Z.localRefs)}catch(B){throw delete Z.validate,B}finally{if(Z.compiling=!1,Z.meta)this._opts=n}return Z.validate=o,Z.refs=o.refs,Z.refVal=o.refVal,Z.root=o.root,o;function i(){var B=Z.validate,P8=B.apply(this,arguments);return i.errors=B.errors,P8}}function p(Z){switch(Z.schemaId){case"auto":return F;case"id":return r;default:return t}}function r(Z){if(Z.$id)this.logger.warn("schema $id ignored",Z.$id);return Z.id}function t(Z){if(Z.id)this.logger.warn("schema id ignored",Z.id);return Z.$id}function F(Z){if(Z.$id&&Z.id&&Z.$id!=Z.id)throw new Error("schema $id is different from id");return Z.$id||Z.id}function Y8(Z,S){if(Z=Z||this.errors,!Z)return"No errors";S=S||{};var n=S.separator===void 0?", ":S.separator,o=S.dataVar===void 0?"data":S.dataVar,i="";for(var B=0;B<Z.length;B++){var P8=Z[B];if(P8)i+=o+P8.dataPath+" "+P8.message+n}return i.slice(0,-n.length)}function q8(Z,S){if(typeof S=="string")S=new RegExp(S);return this._formats[Z]=S,this}function z8(Z){var S;if(Z._opts.$data)S=fz(),Z.addMetaSchema(S,S.$id,!0);if(Z._opts.meta===!1)return;var n=F5();if(Z._opts.$data)n=O(n,H);Z.addMetaSchema(n,J,!0),Z._refs["http://json-schema.org/schema"]=J}function w8(Z){var S=Z._opts.schemas;if(!S)return;if(Array.isArray(S))Z.addSchema(S);else for(var n in S)Z.addSchema(S[n],n)}function K8(Z){for(var S in Z._opts.formats){var n=Z._opts.formats[S];Z.addFormat(S,n)}}function G8(Z){for(var S in Z._opts.keywords){var n=Z._opts.keywords[S];Z.addKeyword(S,n)}}function o8(Z,S){if(Z._schemas[S]||Z._refs[S])throw new Error('schema with key or id "'+S+'" already exists')}function e8(Z){var S=v.copy(Z._opts);for(var n=0;n<T.length;n++)delete S[T[n]];return S}function D(Z){var S=Z._opts.logger;if(S===!1)Z.logger={log:C,warn:C,error:C};else{if(S===void 0)S=console;if(!(typeof S=="object"&&S.log&&S.warn&&S.error))throw new Error("logger must implement log, warn and error methods");Z.logger=S}}function C(){}});Jz={accessSync(q,_){J8.accessSync(q,_)},cwd(){return process.cwd()},chmodSync(q,_){J8.chmodSync(q,_)},existsSync(q){return J8.existsSync(q)},async stat(q){return Hz(q)},statSync(q){return J8.statSync(q)},readFileSync(q,_){return J8.readFileSync(q,{encoding:_.encoding})},readFileBytesSync(q){return J8.readFileSync(q)},readSync(q,_){let j=void 0;try{j=J8.openSync(q,"r");let K=Buffer.alloc(_.length),Y=J8.readSync(j,K,0,_.length,0);return{buffer:K,bytesRead:Y}}finally{if(j)J8.closeSync(j)}},writeFileSync(q,_,j){if(!j.flush){J8.writeFileSync(q,_,{encoding:j.encoding});return}let K;try{K=J8.openSync(q,"w"),J8.writeFileSync(K,_,{encoding:j.encoding}),J8.fsyncSync(K)}finally{if(K)J8.closeSync(K)}},appendFileSync(q,_){J8.appendFileSync(q,_)},copyFileSync(q,_){J8.copyFileSync(q,_)},unlinkSync(q){J8.unlinkSync(q)},renameSync(q,_){J8.renameSync(q,_)},symlinkSync(q,_){J8.symlinkSync(q,_)},readlinkSync(q){return J8.readlinkSync(q)},realpathSync(q){return J8.realpathSync(q)},mkdirSync(q){if(!J8.existsSync(q))J8.mkdirSync(q,{recursive:!0})},readdirSync(q){return J8.readdirSync(q,{withFileTypes:!0})},readdirStringSync(q){return J8.readdirSync(q)},isDirEmptySync(q){return this.readdirSync(q).length===0},rmdirSync(q){J8.rmdirSync(q)},rmSync(q,_){J8.rmSync(q,_)}},Tz=Jz;i_=class i_ extends Error{};Q5=class Q5{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(q){this.returned=q}[Symbol.asyncIterator](){if(this.started)throw new Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((q,_)=>{this.readResolve=q,this.readReject=_})}enqueue(q){if(this.readResolve){let _=this.readResolve;this.readResolve=void 0,this.readReject=void 0,_({done:!1,value:q})}else this.queue.push(q)}done(){if(this.isDone=!0,this.readResolve){let q=this.readResolve;this.readResolve=void 0,this.readReject=void 0,q({done:!0,value:void 0})}}error(q){if(this.hasError=q,this.readReject){let _=this.readReject;this.readResolve=void 0,this.readReject=void 0,_(q)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}};_1=class _1{transport;isStreamingMode;canUseTool;hooks;abortController;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new Q5;intialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;pendingMcpResponses=new Map;constructor(q,_,j,K,Y,f=new Map){this.transport=q,this.isStreamingMode=_,this.canUseTool=j,this.hooks=K,this.abortController=Y;for(let[P,$]of f){let w=new q1((O)=>this.sendMcpServerMessageToCli(P,O));this.sdkMcpTransports.set(P,w),$.connect(w)}if(this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.isStreamingMode)this.intialization=this.initialize()}setError(q){this.inputStream.error(q)}cleanup(q){if(this.cleanupPerformed)return;this.cleanupPerformed=!0;try{if(this.transport.close(),this.pendingControlResponses.clear(),this.pendingMcpResponses.clear(),q)this.inputStream.error(q);else this.inputStream.done()}catch(_){}}next(...[q]){return this.sdkMessages.next(...[q])}return(q){return this.sdkMessages.return(q)}throw(q){return this.sdkMessages.throw(q)}[Symbol.asyncIterator](){return this.sdkMessages}[Symbol.asyncDispose](){return this.sdkMessages[Symbol.asyncDispose]()}async readMessages(){try{for await(let q of this.transport.readMessages()){if(q.type==="control_response"){let _=this.pendingControlResponses.get(q.response.request_id);if(_)_(q.response);continue}else if(q.type==="control_request"){this.handleControlRequest(q);continue}else if(q.type==="control_cancel_request"){this.handleControlCancelRequest(q);continue}this.inputStream.enqueue(q)}this.inputStream.done(),this.cleanup()}catch(q){this.inputStream.error(q),this.cleanup(q)}}async handleControlRequest(q){let _=new AbortController;this.cancelControllers.set(q.request_id,_);try{let j=await this.processControlRequest(q,_.signal),K={type:"control_response",response:{subtype:"success",request_id:q.request_id,response:j}};await Promise.resolve(this.transport.write(JSON.stringify(K)+`
|
||
`))}catch(j){let K={type:"control_response",response:{subtype:"error",request_id:q.request_id,error:j.message||String(j)}};await Promise.resolve(this.transport.write(JSON.stringify(K)+`
|
||
`))}finally{this.cancelControllers.delete(q.request_id)}}handleControlCancelRequest(q){let _=this.cancelControllers.get(q.request_id);if(_)_.abort(),this.cancelControllers.delete(q.request_id)}async processControlRequest(q,_){if(q.request.subtype==="can_use_tool"){if(!this.canUseTool)throw new Error("canUseTool callback is not provided.");return this.canUseTool(q.request.tool_name,q.request.input,{signal:_,suggestions:q.request.permission_suggestions})}else if(q.request.subtype==="hook_callback")return await this.handleHookCallbacks(q.request.callback_id,q.request.input,q.request.tool_use_id,_);else if(q.request.subtype==="mcp_message"){let j=q.request,K=this.sdkMcpTransports.get(j.server_name);if(!K)throw new Error(`SDK MCP server not found: ${j.server_name}`);if("method"in j.message&&"id"in j.message&&j.message.id!==null)return{mcp_response:await this.handleMcpControlRequest(j.server_name,j,K)};else{if(K.onmessage)K.onmessage(j.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}throw new Error("Unsupported control request subtype: "+q.request.subtype)}async*readSdkMessages(){for await(let q of this.inputStream)yield q}async initialize(){let q;if(this.hooks){q={};for(let[K,Y]of Object.entries(this.hooks))if(Y.length>0)q[K]=Y.map((f)=>{let P=[];for(let $ of f.hooks){let w=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(w,$),P.push(w)}return{matcher:f.matcher,hookCallbackIds:P}})}let _={subtype:"initialize",hooks:q};return(await this.request(_)).response}async interrupt(){if(!this.isStreamingMode)throw new Error("Interrupt requires --input-format stream-json");await this.request({subtype:"interrupt"})}async setPermissionMode(q){if(!this.isStreamingMode)throw new Error("setPermissionMode requires --input-format stream-json");await this.request({subtype:"set_permission_mode",mode:q})}request(q){let _=Math.random().toString(36).substring(2,15),j={request_id:_,type:"control_request",request:q};return new Promise((K,Y)=>{this.pendingControlResponses.set(_,(f)=>{if(f.subtype==="success")K(f);else Y(new Error(f.error))}),Promise.resolve(this.transport.write(JSON.stringify(j)+`
|
||
`))})}async supportedCommands(){if(!this.isStreamingMode)throw new Error("supportedCommands requires --input-format stream-json");if(!this.intialization)throw new Error("supportedCommands requires transport with bidirectional communication");return(await this.intialization).commands}async streamInput(q){try{for await(let _ of q){if(this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(JSON.stringify(_)+`
|
||
`))}this.transport.endInput()}catch(_){if(!(_ instanceof i_))throw _}}handleHookCallbacks(q,_,j,K){let Y=this.hookCallbacks.get(q);if(!Y)throw new Error(`No hook callback found for ID: ${q}`);return Y(_,j,{signal:K})}sendMcpServerMessageToCli(q,_){if("id"in _&&_.id!==null&&_.id!==void 0){let j=`${q}:${_.id}`,K=this.pendingMcpResponses.get(j);if(K){K.resolve(_),this.pendingMcpResponses.delete(j);return}}throw new Error("No pending request found")}handleMcpControlRequest(q,_,j){let K="id"in _.message?_.message.id:null,Y=`${q}:${K}`;return new Promise((f,P)=>{let $=null,w=()=>{if($)clearTimeout($);this.pendingMcpResponses.delete(Y)},O=(z)=>{w(),f(z)},v=(z)=>{w(),P(z)};if(this.pendingMcpResponses.set(Y,{resolve:O,reject:v}),j.onmessage)j.onmessage(_.message);else{w(),P(new Error("No message handler registered"));return}$=setTimeout(()=>{if(this.pendingMcpResponses.has(Y))w(),P(new Error("Request timeout"))},30000)})}};k={};NO(k,{void:()=>qv,util:()=>D8,unknown:()=>sz,union:()=>Pv,undefined:()=>ez,tuple:()=>$v,transformer:()=>o5,symbol:()=>tz,string:()=>w1,strictObject:()=>jv,setErrorMap:()=>Az,set:()=>zv,record:()=>wv,quotelessJson:()=>kz,promise:()=>Zv,preprocess:()=>Av,pipeline:()=>Gv,ostring:()=>uv,optional:()=>kv,onumber:()=>Dv,oboolean:()=>hv,objectUtil:()=>A4,object:()=>Kv,number:()=>O1,nullable:()=>Xv,null:()=>Fz,never:()=>Qz,nativeEnum:()=>Tv,nan:()=>oz,map:()=>Ov,makeIssue:()=>r3,literal:()=>Hv,lazy:()=>Wv,late:()=>rz,isValid:()=>v_,isDirty:()=>u4,isAsync:()=>lK,isAborted:()=>G4,intersection:()=>fv,instanceof:()=>iz,getParsedType:()=>Lq,getErrorMap:()=>c3,function:()=>vv,enum:()=>Jv,effect:()=>o5,discriminatedUnion:()=>Yv,defaultErrorMap:()=>B_,datetimeRegex:()=>Y1,date:()=>Bz,custom:()=>$1,coerce:()=>Cv,boolean:()=>z1,bigint:()=>az,array:()=>_v,any:()=>Uz,addIssueToContext:()=>U,ZodVoid:()=>nK,ZodUnknown:()=>Fq,ZodUnion:()=>U_,ZodUndefined:()=>e_,ZodType:()=>k8,ZodTuple:()=>Vq,ZodTransformer:()=>U6,ZodSymbol:()=>xK,ZodString:()=>zq,ZodSet:()=>J_,ZodSchema:()=>k8,ZodRecord:()=>cK,ZodReadonly:()=>PK,ZodPromise:()=>T_,ZodPipeline:()=>oK,ZodParsedType:()=>Q,ZodOptional:()=>Wq,ZodObject:()=>i8,ZodNumber:()=>Uq,ZodNullable:()=>pq,ZodNull:()=>F_,ZodNever:()=>Cq,ZodNativeEnum:()=>_K,ZodNaN:()=>iK,ZodMap:()=>rK,ZodLiteral:()=>qK,ZodLazy:()=>Q_,ZodIssueCode:()=>e,ZodIntersection:()=>s_,ZodFunction:()=>a_,ZodFirstPartyTypeKind:()=>W8,ZodError:()=>p6,ZodEnum:()=>Qq,ZodEffects:()=>U6,ZodDiscriminatedUnion:()=>i3,ZodDefault:()=>KK,ZodDate:()=>W_,ZodCatch:()=>jK,ZodBranded:()=>o3,ZodBoolean:()=>t_,ZodBigInt:()=>sq,ZodArray:()=>vq,ZodAny:()=>H_,Schema:()=>k8,ParseStatus:()=>A6,OK:()=>V6,NEVER:()=>Vv,INVALID:()=>v8,EMPTY_PATH:()=>Gz,DIRTY:()=>o_,BRAND:()=>cz});(function(q){q.assertEqual=(Y)=>{};function _(Y){}q.assertIs=_;function j(Y){throw new Error}q.assertNever=j,q.arrayToEnum=(Y)=>{let f={};for(let P of Y)f[P]=P;return f},q.getValidEnumValues=(Y)=>{let f=q.objectKeys(Y).filter(($)=>typeof Y[Y[$]]!=="number"),P={};for(let $ of f)P[$]=Y[$];return q.objectValues(P)},q.objectValues=(Y)=>{return q.objectKeys(Y).map(function(f){return Y[f]})},q.objectKeys=typeof Object.keys==="function"?(Y)=>Object.keys(Y):(Y)=>{let f=[];for(let P in Y)if(Object.prototype.hasOwnProperty.call(Y,P))f.push(P);return f},q.find=(Y,f)=>{for(let P of Y)if(f(P))return P;return},q.isInteger=typeof Number.isInteger==="function"?(Y)=>Number.isInteger(Y):(Y)=>typeof Y==="number"&&Number.isFinite(Y)&&Math.floor(Y)===Y;function K(Y,f=" | "){return Y.map((P)=>typeof P==="string"?`'${P}'`:P).join(f)}q.joinValues=K,q.jsonStringifyReplacer=(Y,f)=>{if(typeof f==="bigint")return f.toString();return f}})(D8||(D8={}));(function(q){q.mergeShapes=(_,j)=>{return{..._,...j}}})(A4||(A4={}));Q=D8.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),e=D8.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);p6=class p6 extends Error{get errors(){return this.issues}constructor(q){super();this.issues=[],this.addIssue=(j)=>{this.issues=[...this.issues,j]},this.addIssues=(j=[])=>{this.issues=[...this.issues,...j]};let _=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,_);else this.__proto__=_;this.name="ZodError",this.issues=q}format(q){let _=q||function(Y){return Y.message},j={_errors:[]},K=(Y)=>{for(let f of Y.issues)if(f.code==="invalid_union")f.unionErrors.map(K);else if(f.code==="invalid_return_type")K(f.returnTypeError);else if(f.code==="invalid_arguments")K(f.argumentsError);else if(f.path.length===0)j._errors.push(_(f));else{let P=j,$=0;while($<f.path.length){let w=f.path[$];if($!==f.path.length-1)P[w]=P[w]||{_errors:[]};else P[w]=P[w]||{_errors:[]},P[w]._errors.push(_(f));P=P[w],$++}}};return K(this),j}static assert(q){if(!(q instanceof p6))throw new Error(`Not a ZodError: ${q}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,D8.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(q=(_)=>_.message){let _={},j=[];for(let K of this.issues)if(K.path.length>0){let Y=K.path[0];_[Y]=_[Y]||[],_[Y].push(q(K))}else j.push(q(K));return{formErrors:j,fieldErrors:_}}get formErrors(){return this.flatten()}};p6.create=(q)=>{return new p6(q)};B_=Xz,K1=B_;Gz=[];v8=Object.freeze({status:"aborted"});(function(q){q.errToObj=(_)=>typeof _==="string"?{message:_}:_||{},q.toString=(_)=>typeof _==="string"?_:_?.message})(f8||(f8={}));uz=/^c[^\s-]{8,}$/i,Dz=/^[0-9a-z]+$/,hz=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Cz=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Vz=/^[a-z0-9_-]{21}$/i,Mz=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Nz=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ez=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Rz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,mz=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Iz=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yz=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dz=new RegExp(`^${j1}$`);zq=class zq extends k8{_parse(q){if(this._def.coerce)q.data=String(q.data);if(this._getType(q)!==Q.string){let Y=this._getOrReturnCtx(q);return U(Y,{code:e.invalid_type,expected:Q.string,received:Y.parsedType}),v8}let j=new A6,K=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(q.data.length<Y.value)K=this._getOrReturnCtx(q,K),U(K,{code:e.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),j.dirty()}else if(Y.kind==="max"){if(q.data.length>Y.value)K=this._getOrReturnCtx(q,K),U(K,{code:e.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),j.dirty()}else if(Y.kind==="length"){let f=q.data.length>Y.value,P=q.data.length<Y.value;if(f||P){if(K=this._getOrReturnCtx(q,K),f)U(K,{code:e.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});else if(P)U(K,{code:e.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});j.dirty()}}else if(Y.kind==="email"){if(!bz.test(q.data))K=this._getOrReturnCtx(q,K),U(K,{validation:"email",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="emoji"){if(!k4)k4=new RegExp(Sz,"u");if(!k4.test(q.data))K=this._getOrReturnCtx(q,K),U(K,{validation:"emoji",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="uuid"){if(!Cz.test(q.data))K=this._getOrReturnCtx(q,K),U(K,{validation:"uuid",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="nanoid"){if(!Vz.test(q.data))K=this._getOrReturnCtx(q,K),U(K,{validation:"nanoid",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="cuid"){if(!uz.test(q.data))K=this._getOrReturnCtx(q,K),U(K,{validation:"cuid",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="cuid2"){if(!Dz.test(q.data))K=this._getOrReturnCtx(q,K),U(K,{validation:"cuid2",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="ulid"){if(!hz.test(q.data))K=this._getOrReturnCtx(q,K),U(K,{validation:"ulid",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="url")try{new URL(q.data)}catch{K=this._getOrReturnCtx(q,K),U(K,{validation:"url",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="regex"){if(Y.regex.lastIndex=0,!Y.regex.test(q.data))K=this._getOrReturnCtx(q,K),U(K,{validation:"regex",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="trim")q.data=q.data.trim();else if(Y.kind==="includes"){if(!q.data.includes(Y.value,Y.position))K=this._getOrReturnCtx(q,K),U(K,{code:e.invalid_string,validation:{includes:Y.value,position:Y.position},message:Y.message}),j.dirty()}else if(Y.kind==="toLowerCase")q.data=q.data.toLowerCase();else if(Y.kind==="toUpperCase")q.data=q.data.toUpperCase();else if(Y.kind==="startsWith"){if(!q.data.startsWith(Y.value))K=this._getOrReturnCtx(q,K),U(K,{code:e.invalid_string,validation:{startsWith:Y.value},message:Y.message}),j.dirty()}else if(Y.kind==="endsWith"){if(!q.data.endsWith(Y.value))K=this._getOrReturnCtx(q,K),U(K,{code:e.invalid_string,validation:{endsWith:Y.value},message:Y.message}),j.dirty()}else if(Y.kind==="datetime"){if(!Y1(Y).test(q.data))K=this._getOrReturnCtx(q,K),U(K,{code:e.invalid_string,validation:"datetime",message:Y.message}),j.dirty()}else if(Y.kind==="date"){if(!dz.test(q.data))K=this._getOrReturnCtx(q,K),U(K,{code:e.invalid_string,validation:"date",message:Y.message}),j.dirty()}else if(Y.kind==="time"){if(!Lz(Y).test(q.data))K=this._getOrReturnCtx(q,K),U(K,{code:e.invalid_string,validation:"time",message:Y.message}),j.dirty()}else if(Y.kind==="duration"){if(!Nz.test(q.data))K=this._getOrReturnCtx(q,K),U(K,{validation:"duration",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="ip"){if(!pz(q.data,Y.version))K=this._getOrReturnCtx(q,K),U(K,{validation:"ip",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="jwt"){if(!lz(q.data,Y.alg))K=this._getOrReturnCtx(q,K),U(K,{validation:"jwt",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="cidr"){if(!xz(q.data,Y.version))K=this._getOrReturnCtx(q,K),U(K,{validation:"cidr",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="base64"){if(!gz.test(q.data))K=this._getOrReturnCtx(q,K),U(K,{validation:"base64",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="base64url"){if(!yz.test(q.data))K=this._getOrReturnCtx(q,K),U(K,{validation:"base64url",code:e.invalid_string,message:Y.message}),j.dirty()}else D8.assertNever(Y);return{status:j.value,value:q.data}}_regex(q,_,j){return this.refinement((K)=>q.test(K),{validation:_,code:e.invalid_string,...f8.errToObj(j)})}_addCheck(q){return new zq({...this._def,checks:[...this._def.checks,q]})}email(q){return this._addCheck({kind:"email",...f8.errToObj(q)})}url(q){return this._addCheck({kind:"url",...f8.errToObj(q)})}emoji(q){return this._addCheck({kind:"emoji",...f8.errToObj(q)})}uuid(q){return this._addCheck({kind:"uuid",...f8.errToObj(q)})}nanoid(q){return this._addCheck({kind:"nanoid",...f8.errToObj(q)})}cuid(q){return this._addCheck({kind:"cuid",...f8.errToObj(q)})}cuid2(q){return this._addCheck({kind:"cuid2",...f8.errToObj(q)})}ulid(q){return this._addCheck({kind:"ulid",...f8.errToObj(q)})}base64(q){return this._addCheck({kind:"base64",...f8.errToObj(q)})}base64url(q){return this._addCheck({kind:"base64url",...f8.errToObj(q)})}jwt(q){return this._addCheck({kind:"jwt",...f8.errToObj(q)})}ip(q){return this._addCheck({kind:"ip",...f8.errToObj(q)})}cidr(q){return this._addCheck({kind:"cidr",...f8.errToObj(q)})}datetime(q){if(typeof q==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:q});return this._addCheck({kind:"datetime",precision:typeof q?.precision==="undefined"?null:q?.precision,offset:q?.offset??!1,local:q?.local??!1,...f8.errToObj(q?.message)})}date(q){return this._addCheck({kind:"date",message:q})}time(q){if(typeof q==="string")return this._addCheck({kind:"time",precision:null,message:q});return this._addCheck({kind:"time",precision:typeof q?.precision==="undefined"?null:q?.precision,...f8.errToObj(q?.message)})}duration(q){return this._addCheck({kind:"duration",...f8.errToObj(q)})}regex(q,_){return this._addCheck({kind:"regex",regex:q,...f8.errToObj(_)})}includes(q,_){return this._addCheck({kind:"includes",value:q,position:_?.position,...f8.errToObj(_?.message)})}startsWith(q,_){return this._addCheck({kind:"startsWith",value:q,...f8.errToObj(_)})}endsWith(q,_){return this._addCheck({kind:"endsWith",value:q,...f8.errToObj(_)})}min(q,_){return this._addCheck({kind:"min",value:q,...f8.errToObj(_)})}max(q,_){return this._addCheck({kind:"max",value:q,...f8.errToObj(_)})}length(q,_){return this._addCheck({kind:"length",value:q,...f8.errToObj(_)})}nonempty(q){return this.min(1,f8.errToObj(q))}trim(){return new zq({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new zq({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new zq({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((q)=>q.kind==="datetime")}get isDate(){return!!this._def.checks.find((q)=>q.kind==="date")}get isTime(){return!!this._def.checks.find((q)=>q.kind==="time")}get isDuration(){return!!this._def.checks.find((q)=>q.kind==="duration")}get isEmail(){return!!this._def.checks.find((q)=>q.kind==="email")}get isURL(){return!!this._def.checks.find((q)=>q.kind==="url")}get isEmoji(){return!!this._def.checks.find((q)=>q.kind==="emoji")}get isUUID(){return!!this._def.checks.find((q)=>q.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((q)=>q.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((q)=>q.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((q)=>q.kind==="cuid2")}get isULID(){return!!this._def.checks.find((q)=>q.kind==="ulid")}get isIP(){return!!this._def.checks.find((q)=>q.kind==="ip")}get isCIDR(){return!!this._def.checks.find((q)=>q.kind==="cidr")}get isBase64(){return!!this._def.checks.find((q)=>q.kind==="base64")}get isBase64url(){return!!this._def.checks.find((q)=>q.kind==="base64url")}get minLength(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxLength(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value<q)q=_.value}return q}};zq.create=(q)=>{return new zq({checks:[],typeName:W8.ZodString,coerce:q?.coerce??!1,...Z8(q)})};Uq=class Uq extends k8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(q){if(this._def.coerce)q.data=Number(q.data);if(this._getType(q)!==Q.number){let Y=this._getOrReturnCtx(q);return U(Y,{code:e.invalid_type,expected:Q.number,received:Y.parsedType}),v8}let j=void 0,K=new A6;for(let Y of this._def.checks)if(Y.kind==="int"){if(!D8.isInteger(q.data))j=this._getOrReturnCtx(q,j),U(j,{code:e.invalid_type,expected:"integer",received:"float",message:Y.message}),K.dirty()}else if(Y.kind==="min"){if(Y.inclusive?q.data<Y.value:q.data<=Y.value)j=this._getOrReturnCtx(q,j),U(j,{code:e.too_small,minimum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),K.dirty()}else if(Y.kind==="max"){if(Y.inclusive?q.data>Y.value:q.data>=Y.value)j=this._getOrReturnCtx(q,j),U(j,{code:e.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),K.dirty()}else if(Y.kind==="multipleOf"){if(nz(q.data,Y.value)!==0)j=this._getOrReturnCtx(q,j),U(j,{code:e.not_multiple_of,multipleOf:Y.value,message:Y.message}),K.dirty()}else if(Y.kind==="finite"){if(!Number.isFinite(q.data))j=this._getOrReturnCtx(q,j),U(j,{code:e.not_finite,message:Y.message}),K.dirty()}else D8.assertNever(Y);return{status:K.value,value:q.data}}gte(q,_){return this.setLimit("min",q,!0,f8.toString(_))}gt(q,_){return this.setLimit("min",q,!1,f8.toString(_))}lte(q,_){return this.setLimit("max",q,!0,f8.toString(_))}lt(q,_){return this.setLimit("max",q,!1,f8.toString(_))}setLimit(q,_,j,K){return new Uq({...this._def,checks:[...this._def.checks,{kind:q,value:_,inclusive:j,message:f8.toString(K)}]})}_addCheck(q){return new Uq({...this._def,checks:[...this._def.checks,q]})}int(q){return this._addCheck({kind:"int",message:f8.toString(q)})}positive(q){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f8.toString(q)})}negative(q){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f8.toString(q)})}nonpositive(q){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f8.toString(q)})}nonnegative(q){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f8.toString(q)})}multipleOf(q,_){return this._addCheck({kind:"multipleOf",value:q,message:f8.toString(_)})}finite(q){return this._addCheck({kind:"finite",message:f8.toString(q)})}safe(q){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f8.toString(q)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f8.toString(q)})}get minValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value<q)q=_.value}return q}get isInt(){return!!this._def.checks.find((q)=>q.kind==="int"||q.kind==="multipleOf"&&D8.isInteger(q.value))}get isFinite(){let q=null,_=null;for(let j of this._def.checks)if(j.kind==="finite"||j.kind==="int"||j.kind==="multipleOf")return!0;else if(j.kind==="min"){if(_===null||j.value>_)_=j.value}else if(j.kind==="max"){if(q===null||j.value<q)q=j.value}return Number.isFinite(_)&&Number.isFinite(q)}};Uq.create=(q)=>{return new Uq({checks:[],typeName:W8.ZodNumber,coerce:q?.coerce||!1,...Z8(q)})};sq=class sq extends k8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(q){if(this._def.coerce)try{q.data=BigInt(q.data)}catch{return this._getInvalidInput(q)}if(this._getType(q)!==Q.bigint)return this._getInvalidInput(q);let j=void 0,K=new A6;for(let Y of this._def.checks)if(Y.kind==="min"){if(Y.inclusive?q.data<Y.value:q.data<=Y.value)j=this._getOrReturnCtx(q,j),U(j,{code:e.too_small,type:"bigint",minimum:Y.value,inclusive:Y.inclusive,message:Y.message}),K.dirty()}else if(Y.kind==="max"){if(Y.inclusive?q.data>Y.value:q.data>=Y.value)j=this._getOrReturnCtx(q,j),U(j,{code:e.too_big,type:"bigint",maximum:Y.value,inclusive:Y.inclusive,message:Y.message}),K.dirty()}else if(Y.kind==="multipleOf"){if(q.data%Y.value!==BigInt(0))j=this._getOrReturnCtx(q,j),U(j,{code:e.not_multiple_of,multipleOf:Y.value,message:Y.message}),K.dirty()}else D8.assertNever(Y);return{status:K.value,value:q.data}}_getInvalidInput(q){let _=this._getOrReturnCtx(q);return U(_,{code:e.invalid_type,expected:Q.bigint,received:_.parsedType}),v8}gte(q,_){return this.setLimit("min",q,!0,f8.toString(_))}gt(q,_){return this.setLimit("min",q,!1,f8.toString(_))}lte(q,_){return this.setLimit("max",q,!0,f8.toString(_))}lt(q,_){return this.setLimit("max",q,!1,f8.toString(_))}setLimit(q,_,j,K){return new sq({...this._def,checks:[...this._def.checks,{kind:q,value:_,inclusive:j,message:f8.toString(K)}]})}_addCheck(q){return new sq({...this._def,checks:[...this._def.checks,q]})}positive(q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f8.toString(q)})}negative(q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f8.toString(q)})}nonpositive(q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f8.toString(q)})}nonnegative(q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f8.toString(q)})}multipleOf(q,_){return this._addCheck({kind:"multipleOf",value:q,message:f8.toString(_)})}get minValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value<q)q=_.value}return q}};sq.create=(q)=>{return new sq({checks:[],typeName:W8.ZodBigInt,coerce:q?.coerce??!1,...Z8(q)})};t_=class t_ extends k8{_parse(q){if(this._def.coerce)q.data=Boolean(q.data);if(this._getType(q)!==Q.boolean){let j=this._getOrReturnCtx(q);return U(j,{code:e.invalid_type,expected:Q.boolean,received:j.parsedType}),v8}return V6(q.data)}};t_.create=(q)=>{return new t_({typeName:W8.ZodBoolean,coerce:q?.coerce||!1,...Z8(q)})};W_=class W_ extends k8{_parse(q){if(this._def.coerce)q.data=new Date(q.data);if(this._getType(q)!==Q.date){let Y=this._getOrReturnCtx(q);return U(Y,{code:e.invalid_type,expected:Q.date,received:Y.parsedType}),v8}if(Number.isNaN(q.data.getTime())){let Y=this._getOrReturnCtx(q);return U(Y,{code:e.invalid_date}),v8}let j=new A6,K=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(q.data.getTime()<Y.value)K=this._getOrReturnCtx(q,K),U(K,{code:e.too_small,message:Y.message,inclusive:!0,exact:!1,minimum:Y.value,type:"date"}),j.dirty()}else if(Y.kind==="max"){if(q.data.getTime()>Y.value)K=this._getOrReturnCtx(q,K),U(K,{code:e.too_big,message:Y.message,inclusive:!0,exact:!1,maximum:Y.value,type:"date"}),j.dirty()}else D8.assertNever(Y);return{status:j.value,value:new Date(q.data.getTime())}}_addCheck(q){return new W_({...this._def,checks:[...this._def.checks,q]})}min(q,_){return this._addCheck({kind:"min",value:q.getTime(),message:f8.toString(_)})}max(q,_){return this._addCheck({kind:"max",value:q.getTime(),message:f8.toString(_)})}get minDate(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q!=null?new Date(q):null}get maxDate(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value<q)q=_.value}return q!=null?new Date(q):null}};W_.create=(q)=>{return new W_({checks:[],coerce:q?.coerce||!1,typeName:W8.ZodDate,...Z8(q)})};xK=class xK extends k8{_parse(q){if(this._getType(q)!==Q.symbol){let j=this._getOrReturnCtx(q);return U(j,{code:e.invalid_type,expected:Q.symbol,received:j.parsedType}),v8}return V6(q.data)}};xK.create=(q)=>{return new xK({typeName:W8.ZodSymbol,...Z8(q)})};e_=class e_ extends k8{_parse(q){if(this._getType(q)!==Q.undefined){let j=this._getOrReturnCtx(q);return U(j,{code:e.invalid_type,expected:Q.undefined,received:j.parsedType}),v8}return V6(q.data)}};e_.create=(q)=>{return new e_({typeName:W8.ZodUndefined,...Z8(q)})};F_=class F_ extends k8{_parse(q){if(this._getType(q)!==Q.null){let j=this._getOrReturnCtx(q);return U(j,{code:e.invalid_type,expected:Q.null,received:j.parsedType}),v8}return V6(q.data)}};F_.create=(q)=>{return new F_({typeName:W8.ZodNull,...Z8(q)})};H_=class H_ extends k8{constructor(){super(...arguments);this._any=!0}_parse(q){return V6(q.data)}};H_.create=(q)=>{return new H_({typeName:W8.ZodAny,...Z8(q)})};Fq=class Fq extends k8{constructor(){super(...arguments);this._unknown=!0}_parse(q){return V6(q.data)}};Fq.create=(q)=>{return new Fq({typeName:W8.ZodUnknown,...Z8(q)})};Cq=class Cq extends k8{_parse(q){let _=this._getOrReturnCtx(q);return U(_,{code:e.invalid_type,expected:Q.never,received:_.parsedType}),v8}};Cq.create=(q)=>{return new Cq({typeName:W8.ZodNever,...Z8(q)})};nK=class nK extends k8{_parse(q){if(this._getType(q)!==Q.undefined){let j=this._getOrReturnCtx(q);return U(j,{code:e.invalid_type,expected:Q.void,received:j.parsedType}),v8}return V6(q.data)}};nK.create=(q)=>{return new nK({typeName:W8.ZodVoid,...Z8(q)})};vq=class vq extends k8{_parse(q){let{ctx:_,status:j}=this._processInputParams(q),K=this._def;if(_.parsedType!==Q.array)return U(_,{code:e.invalid_type,expected:Q.array,received:_.parsedType}),v8;if(K.exactLength!==null){let f=_.data.length>K.exactLength.value,P=_.data.length<K.exactLength.value;if(f||P)U(_,{code:f?e.too_big:e.too_small,minimum:P?K.exactLength.value:void 0,maximum:f?K.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:K.exactLength.message}),j.dirty()}if(K.minLength!==null){if(_.data.length<K.minLength.value)U(_,{code:e.too_small,minimum:K.minLength.value,type:"array",inclusive:!0,exact:!1,message:K.minLength.message}),j.dirty()}if(K.maxLength!==null){if(_.data.length>K.maxLength.value)U(_,{code:e.too_big,maximum:K.maxLength.value,type:"array",inclusive:!0,exact:!1,message:K.maxLength.message}),j.dirty()}if(_.common.async)return Promise.all([..._.data].map((f,P)=>{return K.type._parseAsync(new Hq(_,f,_.path,P))})).then((f)=>{return A6.mergeArray(j,f)});let Y=[..._.data].map((f,P)=>{return K.type._parseSync(new Hq(_,f,_.path,P))});return A6.mergeArray(j,Y)}get element(){return this._def.type}min(q,_){return new vq({...this._def,minLength:{value:q,message:f8.toString(_)}})}max(q,_){return new vq({...this._def,maxLength:{value:q,message:f8.toString(_)}})}length(q,_){return new vq({...this._def,exactLength:{value:q,message:f8.toString(_)}})}nonempty(q){return this.min(1,q)}};vq.create=(q,_)=>{return new vq({type:q,minLength:null,maxLength:null,exactLength:null,typeName:W8.ZodArray,...Z8(_)})};i8=class i8 extends k8{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let q=this._def.shape(),_=D8.objectKeys(q);return this._cached={shape:q,keys:_},this._cached}_parse(q){if(this._getType(q)!==Q.object){let w=this._getOrReturnCtx(q);return U(w,{code:e.invalid_type,expected:Q.object,received:w.parsedType}),v8}let{status:j,ctx:K}=this._processInputParams(q),{shape:Y,keys:f}=this._getCached(),P=[];if(!(this._def.catchall instanceof Cq&&this._def.unknownKeys==="strip")){for(let w in K.data)if(!f.includes(w))P.push(w)}let $=[];for(let w of f){let O=Y[w],v=K.data[w];$.push({key:{status:"valid",value:w},value:O._parse(new Hq(K,v,K.path,w)),alwaysSet:w in K.data})}if(this._def.catchall instanceof Cq){let w=this._def.unknownKeys;if(w==="passthrough")for(let O of P)$.push({key:{status:"valid",value:O},value:{status:"valid",value:K.data[O]}});else if(w==="strict"){if(P.length>0)U(K,{code:e.unrecognized_keys,keys:P}),j.dirty()}else if(w==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let w=this._def.catchall;for(let O of P){let v=K.data[O];$.push({key:{status:"valid",value:O},value:w._parse(new Hq(K,v,K.path,O)),alwaysSet:O in K.data})}}if(K.common.async)return Promise.resolve().then(async()=>{let w=[];for(let O of $){let v=await O.key,z=await O.value;w.push({key:v,value:z,alwaysSet:O.alwaysSet})}return w}).then((w)=>{return A6.mergeObjectSync(j,w)});else return A6.mergeObjectSync(j,$)}get shape(){return this._def.shape()}strict(q){return f8.errToObj,new i8({...this._def,unknownKeys:"strict",...q!==void 0?{errorMap:(_,j)=>{let K=this._def.errorMap?.(_,j).message??j.defaultError;if(_.code==="unrecognized_keys")return{message:f8.errToObj(q).message??K};return{message:K}}}:{}})}strip(){return new i8({...this._def,unknownKeys:"strip"})}passthrough(){return new i8({...this._def,unknownKeys:"passthrough"})}extend(q){return new i8({...this._def,shape:()=>({...this._def.shape(),...q})})}merge(q){return new i8({unknownKeys:q._def.unknownKeys,catchall:q._def.catchall,shape:()=>({...this._def.shape(),...q._def.shape()}),typeName:W8.ZodObject})}setKey(q,_){return this.augment({[q]:_})}catchall(q){return new i8({...this._def,catchall:q})}pick(q){let _={};for(let j of D8.objectKeys(q))if(q[j]&&this.shape[j])_[j]=this.shape[j];return new i8({...this._def,shape:()=>_})}omit(q){let _={};for(let j of D8.objectKeys(this.shape))if(!q[j])_[j]=this.shape[j];return new i8({...this._def,shape:()=>_})}deepPartial(){return r_(this)}partial(q){let _={};for(let j of D8.objectKeys(this.shape)){let K=this.shape[j];if(q&&!q[j])_[j]=K;else _[j]=K.optional()}return new i8({...this._def,shape:()=>_})}required(q){let _={};for(let j of D8.objectKeys(this.shape))if(q&&!q[j])_[j]=this.shape[j];else{let Y=this.shape[j];while(Y instanceof Wq)Y=Y._def.innerType;_[j]=Y}return new i8({...this._def,shape:()=>_})}keyof(){return f1(D8.objectKeys(this.shape))}};i8.create=(q,_)=>{return new i8({shape:()=>q,unknownKeys:"strip",catchall:Cq.create(),typeName:W8.ZodObject,...Z8(_)})};i8.strictCreate=(q,_)=>{return new i8({shape:()=>q,unknownKeys:"strict",catchall:Cq.create(),typeName:W8.ZodObject,...Z8(_)})};i8.lazycreate=(q,_)=>{return new i8({shape:q,unknownKeys:"strip",catchall:Cq.create(),typeName:W8.ZodObject,...Z8(_)})};U_=class U_ extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=this._def.options;function K(Y){for(let P of Y)if(P.result.status==="valid")return P.result;for(let P of Y)if(P.result.status==="dirty")return _.common.issues.push(...P.ctx.common.issues),P.result;let f=Y.map((P)=>new p6(P.ctx.common.issues));return U(_,{code:e.invalid_union,unionErrors:f}),v8}if(_.common.async)return Promise.all(j.map(async(Y)=>{let f={..._,common:{..._.common,issues:[]},parent:null};return{result:await Y._parseAsync({data:_.data,path:_.path,parent:f}),ctx:f}})).then(K);else{let Y=void 0,f=[];for(let $ of j){let w={..._,common:{..._.common,issues:[]},parent:null},O=$._parseSync({data:_.data,path:_.path,parent:w});if(O.status==="valid")return O;else if(O.status==="dirty"&&!Y)Y={result:O,ctx:w};if(w.common.issues.length)f.push(w.common.issues)}if(Y)return _.common.issues.push(...Y.ctx.common.issues),Y.result;let P=f.map(($)=>new p6($));return U(_,{code:e.invalid_union,unionErrors:P}),v8}}get options(){return this._def.options}};U_.create=(q,_)=>{return new U_({options:q,typeName:W8.ZodUnion,...Z8(_)})};i3=class i3 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==Q.object)return U(_,{code:e.invalid_type,expected:Q.object,received:_.parsedType}),v8;let j=this.discriminator,K=_.data[j],Y=this.optionsMap.get(K);if(!Y)return U(_,{code:e.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[j]}),v8;if(_.common.async)return Y._parseAsync({data:_.data,path:_.path,parent:_});else return Y._parseSync({data:_.data,path:_.path,parent:_})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(q,_,j){let K=new Map;for(let Y of _){let f=dq(Y.shape[q]);if(!f.length)throw new Error(`A discriminator value for key \`${q}\` could not be extracted from all schema options`);for(let P of f){if(K.has(P))throw new Error(`Discriminator property ${String(q)} has duplicate value ${String(P)}`);K.set(P,Y)}}return new i3({typeName:W8.ZodDiscriminatedUnion,discriminator:q,options:_,optionsMap:K,...Z8(j)})}};s_=class s_ extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q),K=(Y,f)=>{if(G4(Y)||G4(f))return v8;let P=D4(Y.value,f.value);if(!P.valid)return U(j,{code:e.invalid_intersection_types}),v8;if(u4(Y)||u4(f))_.dirty();return{status:_.value,value:P.data}};if(j.common.async)return Promise.all([this._def.left._parseAsync({data:j.data,path:j.path,parent:j}),this._def.right._parseAsync({data:j.data,path:j.path,parent:j})]).then(([Y,f])=>K(Y,f));else return K(this._def.left._parseSync({data:j.data,path:j.path,parent:j}),this._def.right._parseSync({data:j.data,path:j.path,parent:j}))}};s_.create=(q,_,j)=>{return new s_({left:q,right:_,typeName:W8.ZodIntersection,...Z8(j)})};Vq=class Vq extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==Q.array)return U(j,{code:e.invalid_type,expected:Q.array,received:j.parsedType}),v8;if(j.data.length<this._def.items.length)return U(j,{code:e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v8;if(!this._def.rest&&j.data.length>this._def.items.length)U(j,{code:e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_.dirty();let Y=[...j.data].map((f,P)=>{let $=this._def.items[P]||this._def.rest;if(!$)return null;return $._parse(new Hq(j,f,j.path,P))}).filter((f)=>!!f);if(j.common.async)return Promise.all(Y).then((f)=>{return A6.mergeArray(_,f)});else return A6.mergeArray(_,Y)}get items(){return this._def.items}rest(q){return new Vq({...this._def,rest:q})}};Vq.create=(q,_)=>{if(!Array.isArray(q))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vq({items:q,typeName:W8.ZodTuple,rest:null,...Z8(_)})};cK=class cK extends k8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==Q.object)return U(j,{code:e.invalid_type,expected:Q.object,received:j.parsedType}),v8;let K=[],Y=this._def.keyType,f=this._def.valueType;for(let P in j.data)K.push({key:Y._parse(new Hq(j,P,j.path,P)),value:f._parse(new Hq(j,j.data[P],j.path,P)),alwaysSet:P in j.data});if(j.common.async)return A6.mergeObjectAsync(_,K);else return A6.mergeObjectSync(_,K)}get element(){return this._def.valueType}static create(q,_,j){if(_ instanceof k8)return new cK({keyType:q,valueType:_,typeName:W8.ZodRecord,...Z8(j)});return new cK({keyType:zq.create(),valueType:q,typeName:W8.ZodRecord,...Z8(_)})}};rK=class rK extends k8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==Q.map)return U(j,{code:e.invalid_type,expected:Q.map,received:j.parsedType}),v8;let K=this._def.keyType,Y=this._def.valueType,f=[...j.data.entries()].map(([P,$],w)=>{return{key:K._parse(new Hq(j,P,j.path,[w,"key"])),value:Y._parse(new Hq(j,$,j.path,[w,"value"]))}});if(j.common.async){let P=new Map;return Promise.resolve().then(async()=>{for(let $ of f){let w=await $.key,O=await $.value;if(w.status==="aborted"||O.status==="aborted")return v8;if(w.status==="dirty"||O.status==="dirty")_.dirty();P.set(w.value,O.value)}return{status:_.value,value:P}})}else{let P=new Map;for(let $ of f){let{key:w,value:O}=$;if(w.status==="aborted"||O.status==="aborted")return v8;if(w.status==="dirty"||O.status==="dirty")_.dirty();P.set(w.value,O.value)}return{status:_.value,value:P}}}};rK.create=(q,_,j)=>{return new rK({valueType:_,keyType:q,typeName:W8.ZodMap,...Z8(j)})};J_=class J_ extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==Q.set)return U(j,{code:e.invalid_type,expected:Q.set,received:j.parsedType}),v8;let K=this._def;if(K.minSize!==null){if(j.data.size<K.minSize.value)U(j,{code:e.too_small,minimum:K.minSize.value,type:"set",inclusive:!0,exact:!1,message:K.minSize.message}),_.dirty()}if(K.maxSize!==null){if(j.data.size>K.maxSize.value)U(j,{code:e.too_big,maximum:K.maxSize.value,type:"set",inclusive:!0,exact:!1,message:K.maxSize.message}),_.dirty()}let Y=this._def.valueType;function f($){let w=new Set;for(let O of $){if(O.status==="aborted")return v8;if(O.status==="dirty")_.dirty();w.add(O.value)}return{status:_.value,value:w}}let P=[...j.data.values()].map(($,w)=>Y._parse(new Hq(j,$,j.path,w)));if(j.common.async)return Promise.all(P).then(($)=>f($));else return f(P)}min(q,_){return new J_({...this._def,minSize:{value:q,message:f8.toString(_)}})}max(q,_){return new J_({...this._def,maxSize:{value:q,message:f8.toString(_)}})}size(q,_){return this.min(q,_).max(q,_)}nonempty(q){return this.min(1,q)}};J_.create=(q,_)=>{return new J_({valueType:q,minSize:null,maxSize:null,typeName:W8.ZodSet,...Z8(_)})};a_=class a_ extends k8{constructor(){super(...arguments);this.validate=this.implement}_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==Q.function)return U(_,{code:e.invalid_type,expected:Q.function,received:_.parsedType}),v8;function j(P,$){return r3({data:P,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,c3(),B_].filter((w)=>!!w),issueData:{code:e.invalid_arguments,argumentsError:$}})}function K(P,$){return r3({data:P,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,c3(),B_].filter((w)=>!!w),issueData:{code:e.invalid_return_type,returnTypeError:$}})}let Y={errorMap:_.common.contextualErrorMap},f=_.data;if(this._def.returns instanceof T_){let P=this;return V6(async function(...$){let w=new p6([]),O=await P._def.args.parseAsync($,Y).catch((W)=>{throw w.addIssue(j($,W)),w}),v=await Reflect.apply(f,this,O);return await P._def.returns._def.type.parseAsync(v,Y).catch((W)=>{throw w.addIssue(K(v,W)),w})})}else{let P=this;return V6(function(...$){let w=P._def.args.safeParse($,Y);if(!w.success)throw new p6([j($,w.error)]);let O=Reflect.apply(f,this,w.data),v=P._def.returns.safeParse(O,Y);if(!v.success)throw new p6([K(O,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...q){return new a_({...this._def,args:Vq.create(q).rest(Fq.create())})}returns(q){return new a_({...this._def,returns:q})}implement(q){return this.parse(q)}strictImplement(q){return this.parse(q)}static create(q,_,j){return new a_({args:q?q:Vq.create([]).rest(Fq.create()),returns:_||Fq.create(),typeName:W8.ZodFunction,...Z8(j)})}};Q_=class Q_ extends k8{get schema(){return this._def.getter()}_parse(q){let{ctx:_}=this._processInputParams(q);return this._def.getter()._parse({data:_.data,path:_.path,parent:_})}};Q_.create=(q,_)=>{return new Q_({getter:q,typeName:W8.ZodLazy,...Z8(_)})};qK=class qK extends k8{_parse(q){if(q.data!==this._def.value){let _=this._getOrReturnCtx(q);return U(_,{received:_.data,code:e.invalid_literal,expected:this._def.value}),v8}return{status:"valid",value:q.data}}get value(){return this._def.value}};qK.create=(q,_)=>{return new qK({value:q,typeName:W8.ZodLiteral,...Z8(_)})};Qq=class Qq extends k8{_parse(q){if(typeof q.data!=="string"){let _=this._getOrReturnCtx(q),j=this._def.values;return U(_,{expected:D8.joinValues(j),received:_.parsedType,code:e.invalid_type}),v8}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(q.data)){let _=this._getOrReturnCtx(q),j=this._def.values;return U(_,{received:_.data,code:e.invalid_enum_value,options:j}),v8}return V6(q.data)}get options(){return this._def.values}get enum(){let q={};for(let _ of this._def.values)q[_]=_;return q}get Values(){let q={};for(let _ of this._def.values)q[_]=_;return q}get Enum(){let q={};for(let _ of this._def.values)q[_]=_;return q}extract(q,_=this._def){return Qq.create(q,{...this._def,..._})}exclude(q,_=this._def){return Qq.create(this.options.filter((j)=>!q.includes(j)),{...this._def,..._})}};Qq.create=f1;_K=class _K extends k8{_parse(q){let _=D8.getValidEnumValues(this._def.values),j=this._getOrReturnCtx(q);if(j.parsedType!==Q.string&&j.parsedType!==Q.number){let K=D8.objectValues(_);return U(j,{expected:D8.joinValues(K),received:j.parsedType,code:e.invalid_type}),v8}if(!this._cache)this._cache=new Set(D8.getValidEnumValues(this._def.values));if(!this._cache.has(q.data)){let K=D8.objectValues(_);return U(j,{received:j.data,code:e.invalid_enum_value,options:K}),v8}return V6(q.data)}get enum(){return this._def.values}};_K.create=(q,_)=>{return new _K({values:q,typeName:W8.ZodNativeEnum,...Z8(_)})};T_=class T_ extends k8{unwrap(){return this._def.type}_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==Q.promise&&_.common.async===!1)return U(_,{code:e.invalid_type,expected:Q.promise,received:_.parsedType}),v8;let j=_.parsedType===Q.promise?_.data:Promise.resolve(_.data);return V6(j.then((K)=>{return this._def.type.parseAsync(K,{path:_.path,errorMap:_.common.contextualErrorMap})}))}};T_.create=(q,_)=>{return new T_({type:q,typeName:W8.ZodPromise,...Z8(_)})};U6=class U6 extends k8{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===W8.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(q){let{status:_,ctx:j}=this._processInputParams(q),K=this._def.effect||null,Y={addIssue:(f)=>{if(U(j,f),f.fatal)_.abort();else _.dirty()},get path(){return j.path}};if(Y.addIssue=Y.addIssue.bind(Y),K.type==="preprocess"){let f=K.transform(j.data,Y);if(j.common.async)return Promise.resolve(f).then(async(P)=>{if(_.value==="aborted")return v8;let $=await this._def.schema._parseAsync({data:P,path:j.path,parent:j});if($.status==="aborted")return v8;if($.status==="dirty")return o_($.value);if(_.value==="dirty")return o_($.value);return $});else{if(_.value==="aborted")return v8;let P=this._def.schema._parseSync({data:f,path:j.path,parent:j});if(P.status==="aborted")return v8;if(P.status==="dirty")return o_(P.value);if(_.value==="dirty")return o_(P.value);return P}}if(K.type==="refinement"){let f=(P)=>{let $=K.refinement(P,Y);if(j.common.async)return Promise.resolve($);if($ instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return P};if(j.common.async===!1){let P=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(P.status==="aborted")return v8;if(P.status==="dirty")_.dirty();return f(P.value),{status:_.value,value:P.value}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then((P)=>{if(P.status==="aborted")return v8;if(P.status==="dirty")_.dirty();return f(P.value).then(()=>{return{status:_.value,value:P.value}})})}if(K.type==="transform")if(j.common.async===!1){let f=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(!v_(f))return v8;let P=K.transform(f.value,Y);if(P instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:_.value,value:P}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then((f)=>{if(!v_(f))return v8;return Promise.resolve(K.transform(f.value,Y)).then((P)=>({status:_.value,value:P}))});D8.assertNever(K)}};U6.create=(q,_,j)=>{return new U6({schema:q,typeName:W8.ZodEffects,effect:_,...Z8(j)})};U6.createWithPreprocess=(q,_,j)=>{return new U6({schema:_,effect:{type:"preprocess",transform:q},typeName:W8.ZodEffects,...Z8(j)})};Wq=class Wq extends k8{_parse(q){if(this._getType(q)===Q.undefined)return V6(void 0);return this._def.innerType._parse(q)}unwrap(){return this._def.innerType}};Wq.create=(q,_)=>{return new Wq({innerType:q,typeName:W8.ZodOptional,...Z8(_)})};pq=class pq extends k8{_parse(q){if(this._getType(q)===Q.null)return V6(null);return this._def.innerType._parse(q)}unwrap(){return this._def.innerType}};pq.create=(q,_)=>{return new pq({innerType:q,typeName:W8.ZodNullable,...Z8(_)})};KK=class KK extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;if(_.parsedType===Q.undefined)j=this._def.defaultValue();return this._def.innerType._parse({data:j,path:_.path,parent:_})}removeDefault(){return this._def.innerType}};KK.create=(q,_)=>{return new KK({innerType:q,typeName:W8.ZodDefault,defaultValue:typeof _.default==="function"?_.default:()=>_.default,...Z8(_)})};jK=class jK extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j={..._,common:{..._.common,issues:[]}},K=this._def.innerType._parse({data:j.data,path:j.path,parent:{...j}});if(lK(K))return K.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new p6(j.common.issues)},input:j.data})}});else return{status:"valid",value:K.status==="valid"?K.value:this._def.catchValue({get error(){return new p6(j.common.issues)},input:j.data})}}removeCatch(){return this._def.innerType}};jK.create=(q,_)=>{return new jK({innerType:q,typeName:W8.ZodCatch,catchValue:typeof _.catch==="function"?_.catch:()=>_.catch,...Z8(_)})};iK=class iK extends k8{_parse(q){if(this._getType(q)!==Q.nan){let j=this._getOrReturnCtx(q);return U(j,{code:e.invalid_type,expected:Q.nan,received:j.parsedType}),v8}return{status:"valid",value:q.data}}};iK.create=(q)=>{return new iK({typeName:W8.ZodNaN,...Z8(q)})};cz=Symbol("zod_brand");o3=class o3 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;return this._def.type._parse({data:j,path:_.path,parent:_})}unwrap(){return this._def.type}};oK=class oK extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.common.async)return(async()=>{let Y=await this._def.in._parseAsync({data:j.data,path:j.path,parent:j});if(Y.status==="aborted")return v8;if(Y.status==="dirty")return _.dirty(),o_(Y.value);else return this._def.out._parseAsync({data:Y.value,path:j.path,parent:j})})();else{let K=this._def.in._parseSync({data:j.data,path:j.path,parent:j});if(K.status==="aborted")return v8;if(K.status==="dirty")return _.dirty(),{status:"dirty",value:K.value};else return this._def.out._parseSync({data:K.value,path:j.path,parent:j})}}static create(q,_){return new oK({in:q,out:_,typeName:W8.ZodPipeline})}};PK=class PK extends k8{_parse(q){let _=this._def.innerType._parse(q),j=(K)=>{if(v_(K))K.value=Object.freeze(K.value);return K};return lK(_)?_.then((K)=>j(K)):j(_)}unwrap(){return this._def.innerType}};PK.create=(q,_)=>{return new PK({innerType:q,typeName:W8.ZodReadonly,...Z8(_)})};rz={object:i8.lazycreate};(function(q){q.ZodString="ZodString",q.ZodNumber="ZodNumber",q.ZodNaN="ZodNaN",q.ZodBigInt="ZodBigInt",q.ZodBoolean="ZodBoolean",q.ZodDate="ZodDate",q.ZodSymbol="ZodSymbol",q.ZodUndefined="ZodUndefined",q.ZodNull="ZodNull",q.ZodAny="ZodAny",q.ZodUnknown="ZodUnknown",q.ZodNever="ZodNever",q.ZodVoid="ZodVoid",q.ZodArray="ZodArray",q.ZodObject="ZodObject",q.ZodUnion="ZodUnion",q.ZodDiscriminatedUnion="ZodDiscriminatedUnion",q.ZodIntersection="ZodIntersection",q.ZodTuple="ZodTuple",q.ZodRecord="ZodRecord",q.ZodMap="ZodMap",q.ZodSet="ZodSet",q.ZodFunction="ZodFunction",q.ZodLazy="ZodLazy",q.ZodLiteral="ZodLiteral",q.ZodEnum="ZodEnum",q.ZodEffects="ZodEffects",q.ZodNativeEnum="ZodNativeEnum",q.ZodOptional="ZodOptional",q.ZodNullable="ZodNullable",q.ZodDefault="ZodDefault",q.ZodCatch="ZodCatch",q.ZodPromise="ZodPromise",q.ZodBranded="ZodBranded",q.ZodPipeline="ZodPipeline",q.ZodReadonly="ZodReadonly"})(W8||(W8={}));w1=zq.create,O1=Uq.create,oz=iK.create,az=sq.create,z1=t_.create,Bz=W_.create,tz=xK.create,ez=e_.create,Fz=F_.create,Uz=H_.create,sz=Fq.create,Qz=Cq.create,qv=nK.create,_v=vq.create,Kv=i8.create,jv=i8.strictCreate,Pv=U_.create,Yv=i3.create,fv=s_.create,$v=Vq.create,wv=cK.create,Ov=rK.create,zv=J_.create,vv=a_.create,Wv=Q_.create,Hv=qK.create,Jv=Qq.create,Tv=_K.create,Zv=T_.create,o5=U6.create,kv=Wq.create,Xv=pq.create,Av=U6.createWithPreprocess,Gv=oK.create,Cv={string:(q)=>zq.create({...q,coerce:!0}),number:(q)=>Uq.create({...q,coerce:!0}),boolean:(q)=>t_.create({...q,coerce:!0}),bigint:(q)=>sq.create({...q,coerce:!0}),date:(q)=>W_.create({...q,coerce:!0})},Vv=v8,v1=k.union([k.string(),k.number().int()]),W1=k.string(),Mv=k.object({progressToken:k.optional(v1)}).passthrough(),s6=k.object({_meta:k.optional(Mv)}).passthrough(),m6=k.object({method:k.string(),params:k.optional(s6)}),aK=k.object({_meta:k.optional(k.object({}).passthrough())}).passthrough(),Mq=k.object({method:k.string(),params:k.optional(aK)}),Q6=k.object({_meta:k.optional(k.object({}).passthrough())}).passthrough(),B3=k.union([k.string(),k.number().int()]),Nv=k.object({jsonrpc:k.literal(a3),id:B3}).merge(m6).strict(),bv=k.object({jsonrpc:k.literal(a3)}).merge(Mq).strict(),Sv=k.object({jsonrpc:k.literal(a3),id:B3,result:Q6}).strict();(function(q){q[q.ConnectionClosed=-32000]="ConnectionClosed",q[q.RequestTimeout=-32001]="RequestTimeout",q[q.ParseError=-32700]="ParseError",q[q.InvalidRequest=-32600]="InvalidRequest",q[q.MethodNotFound=-32601]="MethodNotFound",q[q.InvalidParams=-32602]="InvalidParams",q[q.InternalError=-32603]="InternalError"})(a5||(a5={}));Ev=k.object({jsonrpc:k.literal(a3),id:B3,error:k.object({code:k.number().int(),message:k.string(),data:k.optional(k.unknown())})}).strict(),yC=k.union([Nv,bv,Sv,Ev]),H1=Q6.strict(),J1=Mq.extend({method:k.literal("notifications/cancelled"),params:aK.extend({requestId:B3,reason:k.string().optional()})}),BK=k.object({name:k.string(),title:k.optional(k.string())}).passthrough(),T1=BK.extend({version:k.string()}),Rv=k.object({experimental:k.optional(k.object({}).passthrough()),sampling:k.optional(k.object({}).passthrough()),elicitation:k.optional(k.object({}).passthrough()),roots:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough())}).passthrough(),mv=m6.extend({method:k.literal("initialize"),params:s6.extend({protocolVersion:k.string(),capabilities:Rv,clientInfo:T1})}),Iv=k.object({experimental:k.optional(k.object({}).passthrough()),logging:k.optional(k.object({}).passthrough()),completions:k.optional(k.object({}).passthrough()),prompts:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough()),resources:k.optional(k.object({subscribe:k.optional(k.boolean()),listChanged:k.optional(k.boolean())}).passthrough()),tools:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough())}).passthrough(),gv=Q6.extend({protocolVersion:k.string(),capabilities:Iv,serverInfo:T1,instructions:k.optional(k.string())}),yv=Mq.extend({method:k.literal("notifications/initialized")}),Z1=m6.extend({method:k.literal("ping")}),dv=k.object({progress:k.number(),total:k.optional(k.number()),message:k.optional(k.string())}).passthrough(),k1=Mq.extend({method:k.literal("notifications/progress"),params:aK.merge(dv).extend({progressToken:v1})}),t3=m6.extend({params:s6.extend({cursor:k.optional(W1)}).optional()}),e3=Q6.extend({nextCursor:k.optional(W1)}),X1=k.object({uri:k.string(),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}).passthrough(),A1=X1.extend({text:k.string()}),b4=k.string().refine((q)=>{try{return atob(q),!0}catch(_){return!1}},{message:"Invalid Base64 string"}),G1=X1.extend({blob:b4}),u1=BK.extend({uri:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}),Lv=BK.extend({uriTemplate:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}),pv=t3.extend({method:k.literal("resources/list")}),lv=e3.extend({resources:k.array(u1)}),xv=t3.extend({method:k.literal("resources/templates/list")}),nv=e3.extend({resourceTemplates:k.array(Lv)}),cv=m6.extend({method:k.literal("resources/read"),params:s6.extend({uri:k.string()})}),rv=Q6.extend({contents:k.array(k.union([A1,G1]))}),iv=Mq.extend({method:k.literal("notifications/resources/list_changed")}),ov=m6.extend({method:k.literal("resources/subscribe"),params:s6.extend({uri:k.string()})}),av=m6.extend({method:k.literal("resources/unsubscribe"),params:s6.extend({uri:k.string()})}),Bv=Mq.extend({method:k.literal("notifications/resources/updated"),params:aK.extend({uri:k.string()})}),tv=k.object({name:k.string(),description:k.optional(k.string()),required:k.optional(k.boolean())}).passthrough(),ev=BK.extend({description:k.optional(k.string()),arguments:k.optional(k.array(tv)),_meta:k.optional(k.object({}).passthrough())}),Fv=t3.extend({method:k.literal("prompts/list")}),Uv=e3.extend({prompts:k.array(ev)}),sv=m6.extend({method:k.literal("prompts/get"),params:s6.extend({name:k.string(),arguments:k.optional(k.record(k.string()))})}),S4=k.object({type:k.literal("text"),text:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),E4=k.object({type:k.literal("image"),data:b4,mimeType:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),R4=k.object({type:k.literal("audio"),data:b4,mimeType:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),Qv=k.object({type:k.literal("resource"),resource:k.union([A1,G1]),_meta:k.optional(k.object({}).passthrough())}).passthrough(),qW=u1.extend({type:k.literal("resource_link")}),D1=k.union([S4,E4,R4,qW,Qv]),_W=k.object({role:k.enum(["user","assistant"]),content:D1}).passthrough(),KW=Q6.extend({description:k.optional(k.string()),messages:k.array(_W)}),jW=Mq.extend({method:k.literal("notifications/prompts/list_changed")}),PW=k.object({title:k.optional(k.string()),readOnlyHint:k.optional(k.boolean()),destructiveHint:k.optional(k.boolean()),idempotentHint:k.optional(k.boolean()),openWorldHint:k.optional(k.boolean())}).passthrough(),YW=BK.extend({description:k.optional(k.string()),inputSchema:k.object({type:k.literal("object"),properties:k.optional(k.object({}).passthrough()),required:k.optional(k.array(k.string()))}).passthrough(),outputSchema:k.optional(k.object({type:k.literal("object"),properties:k.optional(k.object({}).passthrough()),required:k.optional(k.array(k.string()))}).passthrough()),annotations:k.optional(PW),_meta:k.optional(k.object({}).passthrough())}),fW=t3.extend({method:k.literal("tools/list")}),$W=e3.extend({tools:k.array(YW)}),h1=Q6.extend({content:k.array(D1).default([]),structuredContent:k.object({}).passthrough().optional(),isError:k.optional(k.boolean())}),dC=h1.or(Q6.extend({toolResult:k.unknown()})),wW=m6.extend({method:k.literal("tools/call"),params:s6.extend({name:k.string(),arguments:k.optional(k.record(k.unknown()))})}),OW=Mq.extend({method:k.literal("notifications/tools/list_changed")}),C1=k.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),zW=m6.extend({method:k.literal("logging/setLevel"),params:s6.extend({level:C1})}),vW=Mq.extend({method:k.literal("notifications/message"),params:aK.extend({level:C1,logger:k.optional(k.string()),data:k.unknown()})}),WW=k.object({name:k.string().optional()}).passthrough(),HW=k.object({hints:k.optional(k.array(WW)),costPriority:k.optional(k.number().min(0).max(1)),speedPriority:k.optional(k.number().min(0).max(1)),intelligencePriority:k.optional(k.number().min(0).max(1))}).passthrough(),JW=k.object({role:k.enum(["user","assistant"]),content:k.union([S4,E4,R4])}).passthrough(),TW=m6.extend({method:k.literal("sampling/createMessage"),params:s6.extend({messages:k.array(JW),systemPrompt:k.optional(k.string()),includeContext:k.optional(k.enum(["none","thisServer","allServers"])),temperature:k.optional(k.number()),maxTokens:k.number().int(),stopSequences:k.optional(k.array(k.string())),metadata:k.optional(k.object({}).passthrough()),modelPreferences:k.optional(HW)})}),ZW=Q6.extend({model:k.string(),stopReason:k.optional(k.enum(["endTurn","stopSequence","maxTokens"]).or(k.string())),role:k.enum(["user","assistant"]),content:k.discriminatedUnion("type",[S4,E4,R4])}),kW=k.object({type:k.literal("boolean"),title:k.optional(k.string()),description:k.optional(k.string()),default:k.optional(k.boolean())}).passthrough(),XW=k.object({type:k.literal("string"),title:k.optional(k.string()),description:k.optional(k.string()),minLength:k.optional(k.number()),maxLength:k.optional(k.number()),format:k.optional(k.enum(["email","uri","date","date-time"]))}).passthrough(),AW=k.object({type:k.enum(["number","integer"]),title:k.optional(k.string()),description:k.optional(k.string()),minimum:k.optional(k.number()),maximum:k.optional(k.number())}).passthrough(),GW=k.object({type:k.literal("string"),title:k.optional(k.string()),description:k.optional(k.string()),enum:k.array(k.string()),enumNames:k.optional(k.array(k.string()))}).passthrough(),uW=k.union([kW,XW,AW,GW]),DW=m6.extend({method:k.literal("elicitation/create"),params:s6.extend({message:k.string(),requestedSchema:k.object({type:k.literal("object"),properties:k.record(k.string(),uW),required:k.optional(k.array(k.string()))}).passthrough()})}),hW=Q6.extend({action:k.enum(["accept","decline","cancel"]),content:k.optional(k.record(k.string(),k.unknown()))}),CW=k.object({type:k.literal("ref/resource"),uri:k.string()}).passthrough(),VW=k.object({type:k.literal("ref/prompt"),name:k.string()}).passthrough(),MW=m6.extend({method:k.literal("completion/complete"),params:s6.extend({ref:k.union([VW,CW]),argument:k.object({name:k.string(),value:k.string()}).passthrough(),context:k.optional(k.object({arguments:k.optional(k.record(k.string(),k.string()))}))})}),NW=Q6.extend({completion:k.object({values:k.array(k.string()).max(100),total:k.optional(k.number().int()),hasMore:k.optional(k.boolean())}).passthrough()}),bW=k.object({uri:k.string().startsWith("file://"),name:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}).passthrough(),SW=m6.extend({method:k.literal("roots/list")}),EW=Q6.extend({roots:k.array(bW)}),RW=Mq.extend({method:k.literal("notifications/roots/list_changed")}),LC=k.union([Z1,mv,MW,zW,sv,Fv,pv,xv,cv,ov,av,wW,fW]),pC=k.union([J1,k1,yv,RW]),lC=k.union([H1,ZW,hW,EW]),xC=k.union([Z1,TW,DW,SW]),nC=k.union([J1,k1,vW,Bv,iv,OW,jW]),cC=k.union([H1,gv,NW,KW,Uv,lv,nv,rv,h1,$W]),rC=MO($z(),1),iC=Symbol("Let zodToJsonSchema decide on which parser to use"),oC=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");(function(q){q.Completable="McpCompletable"})(h4||(h4={}));C4=class C4 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;return this._def.type._parse({data:j,path:_.path,parent:_})}unwrap(){return this._def.type}};C4.create=(q,_)=>{return new C4({type:q,typeName:h4.Completable,complete:_.complete,...mW(_)})}});var V1={};tq(V1,{version:()=>yW,type:()=>LW,scripts:()=>lW,repository:()=>rW,publishConfig:()=>aW,name:()=>gW,main:()=>pW,license:()=>cW,keywords:()=>xW,homepage:()=>iW,files:()=>UW,engines:()=>eW,devDependencies:()=>tW,description:()=>dW,dependencies:()=>BW,default:()=>sW,bugs:()=>oW,bin:()=>FW,author:()=>nW});var gW="claude-mem",yW="3.6.2",dW="Memory compression system for Claude Code - persist context across sessions",LW="module",pW="claude-mem",lW,xW,nW="Alex Newman",cW="SEE LICENSE IN LICENSE",rW,iW="https://github.com/thedotmack/claude-mem#readme",oW,aW,BW,tW,eW,FW,UW,sW;var M1=K6(()=>{lW={dev:"tsx src/bin/cli.ts","dev:install":"node dist/claude-mem.min.js install --force","dev:status":"node dist/claude-mem.min.js status","dev:compress":"node dist/claude-mem.min.js compress","dev:load":"node dist/claude-mem.min.js load-context","dev:uninstall":"node dist/claude-mem.min.js uninstall",build:"./scripts/build-minified.sh","test:watch":"npm test -- --watch",lint:"eslint 'src/**/*.ts' 'hooks/**/*.ts' 'test/**/*.ts'","lint:fix":"npm run lint -- --fix",format:"prettier --write 'src/**/*.ts' 'hooks/**/*.ts' 'test/**/*.ts'","build:npm":"./scripts/npm-publish.sh",publish:"./scripts/publish-with-changelog.sh","publish:latest":"./scripts/publish-with-changelog.sh bump","publish:github":"./scripts/github-publish.sh"},xW=["claude","claude-code","mcp","memory","compression","knowledge-graph","transcript","cli","typescript","bun"],rW={type:"git",url:"https://github.com/thedotmack/claude-mem.git"},oW={url:"https://github.com/thedotmack/claude-mem/issues"},aW={access:"public",registry:"https://registry.npmjs.org/"},BW={"@anthropic-ai/claude-code":"^1.0.88","@clack/prompts":"^0.11.0","@modelcontextprotocol/sdk":"^0.5.0",boxen:"^8.0.1",chalk:"^5.6.0",chromadb:"^3.0.14",commander:"^14.0.0",cors:"^2.8.5",express:"^5.1.0",glob:"^11.0.3","gradient-string":"^3.0.0",handlebars:"^4.7.8",http:"^0.0.1-security","oh-my-logo":"^0.3.2",open:"^10.2.0"},tW={"@types/chai":"^4.3.0","@types/handlebars":"^4.0.40","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0",chai:"^4.3.0",eslint:"^8.0.0",prettier:"^3.0.0","ts-node":"^10.0.0",tsx:"^4.20.5",typescript:"^5.0.0"},eW={node:">=18.0.0",bun:">=1.0.0"},FW={"claude-mem":"dist/claude-mem.min.js"},UW=["dist","hooks","commands","docs","CHANGELOG.md"],sW={name:gW,version:yW,description:dW,type:LW,main:pW,scripts:lW,keywords:xW,author:nW,license:cW,repository:rW,homepage:iW,bugs:oW,publishConfig:aW,dependencies:BW,devDependencies:tW,engines:eW,bin:FW,files:UW}});import{join as F8,dirname as U3,sep as QW}from"path";import{homedir as m4}from"os";import{existsSync as tK,statSync as qH}from"fs";import{execSync as _H}from"child_process";import{fileURLToPath as KH}from"url";class $8{static instance=null;_dataDirectory=null;_packageRoot=null;_claudeConfigDirectory=null;static getInstance(){if(!$8.instance)$8.instance=new $8;return $8.instance}getDataDirectory(){if(this._dataDirectory)return this._dataDirectory;return this._dataDirectory=process.env.CLAUDE_MEM_DATA_DIR||F8(m4(),".claude-mem"),this._dataDirectory}getArchivesDirectory(){return F8(this.getDataDirectory(),"archives")}getHooksDirectory(){return F8(this.getDataDirectory(),"hooks")}getLogsDirectory(){return F8(this.getDataDirectory(),"logs")}getIndexDirectory(){return this.getDataDirectory()}getIndexPath(){return F8(this.getIndexDirectory(),"claude-mem-index.jsonl")}getTrashDirectory(){return F8(this.getDataDirectory(),"trash")}getBackupsDirectory(){return F8(this.getDataDirectory(),"backups")}getChromaDirectory(){return F8(this.getDataDirectory(),"chroma")}getProjectArchiveDirectory(q){return F8(this.getArchivesDirectory(),q)}getUserSettingsPath(){return F8(this.getDataDirectory(),"settings.json")}getClaudeConfigDirectory(){if(this._claudeConfigDirectory)return this._claudeConfigDirectory;return this._claudeConfigDirectory=process.env.CLAUDE_CONFIG_DIR||F8(m4(),".claude"),this._claudeConfigDirectory}getClaudeSettingsPath(){return F8(this.getClaudeConfigDirectory(),"settings.json")}getClaudeCommandsDirectory(){return F8(this.getClaudeConfigDirectory(),"commands")}getClaudeMdPath(){return F8(this.getClaudeConfigDirectory(),"CLAUDE.md")}getMcpConfigPath(){return F8(m4(),".claude.json")}getProjectMcpConfigPath(){return F8(process.cwd(),".mcp.json")}getPackageRoot(){if(this._packageRoot)return this._packageRoot;try{let j=C6.resolve("/Users/alexnewman/Scripts/claude-mem-source/package.json");return this._packageRoot=U3(j),this._packageRoot}catch{}let q=KH(import.meta.url),_=U3(q);for(let j=0;j<10;j++){let K=F8(_,"package.json");if(tK(K))try{if(C6(K).name==="claude-mem")return this._packageRoot=_,this._packageRoot}catch{}let Y=U3(_);if(Y===_)break;_=Y}try{let j=_H("npm list -g claude-mem --json 2>/dev/null || npm list claude-mem --json 2>/dev/null",{encoding:"utf8"}),K=JSON.parse(j);if(K.dependencies?.["claude-mem"]?.resolved)return this._packageRoot=U3(K.dependencies["claude-mem"].resolved),this._packageRoot}catch{}throw new Error("Cannot locate claude-mem package root. Ensure claude-mem is properly installed.")}findPackageHooksDirectory(){let q=this.getPackageRoot(),_=F8(q,"hooks"),j=["pre-compact.js","session-start.js"];for(let K of j)if(!tK(F8(_,K)))throw new Error(`Package hooks directory missing required file: ${K}`);return _}findPackageCommandsDirectory(){let q=this.getPackageRoot(),_=F8(q,"commands"),j=["save.md"];for(let K of j)if(!tK(F8(_,K)))throw new Error(`Package commands directory missing required file: ${K}`);return _}ensureDirectory(q){if(!tK(q))C6("fs").mkdirSync(q,{recursive:!0})}ensureDirectories(q){q.forEach((_)=>this.ensureDirectory(_))}ensureAllDataDirectories(){this.ensureDirectories([this.getDataDirectory(),this.getArchivesDirectory(),this.getHooksDirectory(),this.getLogsDirectory(),this.getTrashDirectory(),this.getBackupsDirectory(),this.getChromaDirectory()])}ensureAllClaudeDirectories(){this.ensureDirectories([this.getClaudeConfigDirectory(),this.getClaudeCommandsDirectory()])}static extractProjectName(q){let _=q.split(QW),j=["src","lib","app","project","workspace"];for(let K=_.length-1;K>=0;K--)if(j.includes(_[K])&&K>0)return _[K-1];if(_.length>1)return _[_.length-2];return"unknown-project"}static getCurrentProjectName(){return C6("path").basename(process.cwd())}static createBackupFilename(q){let _=new Date().toISOString().replace(/[:.]/g,"-").replace("T","_").slice(0,19);return`${q}.backup.${_}`}static isPathAccessible(q){try{return tK(q)&&qH(q).isDirectory()}catch{return!1}}static getDataDirectory(){return $8.getInstance().getDataDirectory()}static getArchivesDirectory(){return $8.getInstance().getArchivesDirectory()}static getHooksDirectory(){return $8.getInstance().getHooksDirectory()}static getLogsDirectory(){return $8.getInstance().getLogsDirectory()}static getClaudeSettingsPath(){return $8.getInstance().getClaudeSettingsPath()}static getClaudeMdPath(){return $8.getInstance().getClaudeMdPath()}static findPackageHooksDirectory(){return $8.getInstance().findPackageHooksDirectory()}static findPackageCommandsDirectory(){return $8.getInstance().findPackageCommandsDirectory()}}var sC;var l6=K6(()=>{sC=$8.getInstance()});class xq{pathDiscovery;constructor(){this.pathDiscovery=$8.getInstance()}getConfigDir(){return this.pathDiscovery.getDataDirectory()}getIndexDir(){return this.pathDiscovery.getIndexDirectory()}getIndexPath(){return this.pathDiscovery.getIndexPath()}getArchiveDir(){return this.pathDiscovery.getArchivesDirectory()}getProjectArchiveDir(q){return this.pathDiscovery.getProjectArchiveDirectory(q)}getLogsDir(){return this.pathDiscovery.getLogsDirectory()}static ensureDirectory(q){$8.getInstance().ensureDirectory(q)}static ensureDirectories(q){$8.getInstance().ensureDirectories(q)}static extractProjectName(q){return $8.extractProjectName(q)}static getCurrentProjectPrefix(){return $8.getCurrentProjectName()}static getCurrentProjectName(){return $8.getCurrentProjectName()}}var I4=K6(()=>{l6()});var M6=_8((HH)=>{HH.__esModule=!0;HH.extend=N1;HH.indexOf=$H;HH.escapeExpression=wH;HH.isEmpty=OH;HH.createFrame=zH;HH.blockParams=vH;HH.appendContextPath=WH;var jH={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},PH=/[&<>"'`=]/g,YH=/[&<>"'`=]/;function fH(q){return jH[q]}function N1(q){for(var _=1;_<arguments.length;_++)for(var j in arguments[_])if(Object.prototype.hasOwnProperty.call(arguments[_],j))q[j]=arguments[_][j];return q}var y4=Object.prototype.toString;HH.toString=y4;var g4=function q(_){return typeof _==="function"};if(g4(/x/))HH.isFunction=g4=function(q){return typeof q==="function"&&y4.call(q)==="[object Function]"};HH.isFunction=g4;var b1=Array.isArray||function(q){return q&&typeof q==="object"?y4.call(q)==="[object Array]":!1};HH.isArray=b1;function $H(q,_){for(var j=0,K=q.length;j<K;j++)if(q[j]===_)return j;return-1}function wH(q){if(typeof q!=="string"){if(q&&q.toHTML)return q.toHTML();else if(q==null)return"";else if(!q)return q+"";q=""+q}if(!YH.test(q))return q;return q.replace(PH,fH)}function OH(q){if(!q&&q!==0)return!0;else if(b1(q)&&q.length===0)return!0;else return!1}function zH(q){var _=N1({},q);return _._parent=q,_}function vH(q,_){return q.path=_,q}function WH(q,_){return(q?q+".":"")+_}});var qq=_8((S1,E1)=>{S1.__esModule=!0;var d4=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function L4(q,_){var j=_&&_.loc,K=void 0,Y=void 0,f=void 0,P=void 0;if(j)K=j.start.line,Y=j.end.line,f=j.start.column,P=j.end.column,q+=" - "+K+":"+f;var $=Error.prototype.constructor.call(this,q);for(var w=0;w<d4.length;w++)this[d4[w]]=$[d4[w]];if(Error.captureStackTrace)Error.captureStackTrace(this,L4);try{if(j)if(this.lineNumber=K,this.endLineNumber=Y,Object.defineProperty)Object.defineProperty(this,"column",{value:f,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:P,enumerable:!0});else this.column=f,this.endColumn=P}catch(O){}}L4.prototype=new Error;S1.default=L4;E1.exports=S1.default});var I1=_8((R1,m1)=>{R1.__esModule=!0;var p4=M6();R1.default=function(q){q.registerHelper("blockHelperMissing",function(_,j){var{inverse:K,fn:Y}=j;if(_===!0)return Y(this);else if(_===!1||_==null)return K(this);else if(p4.isArray(_))if(_.length>0){if(j.ids)j.ids=[j.name];return q.helpers.each(_,j)}else return K(this);else{if(j.data&&j.ids){var f=p4.createFrame(j.data);f.contextPath=p4.appendContextPath(j.data.contextPath,j.name),j={data:f}}return Y(_,j)}})};m1.exports=R1.default});var d1=_8((g1,y1)=>{g1.__esModule=!0;function SH(q){return q&&q.__esModule?q:{default:q}}var eK=M6(),EH=qq(),RH=SH(EH);g1.default=function(q){q.registerHelper("each",function(_,j){if(!j)throw new RH.default("Must pass iterator to #each");var{fn:K,inverse:Y}=j,f=0,P="",$=void 0,w=void 0;if(j.data&&j.ids)w=eK.appendContextPath(j.data.contextPath,j.ids[0])+".";if(eK.isFunction(_))_=_.call(this);if(j.data)$=eK.createFrame(j.data);function O(T,H,X){if($){if($.key=T,$.index=H,$.first=H===0,$.last=!!X,w)$.contextPath=w+T}P=P+K(_[T],{data:$,blockParams:eK.blockParams([_[T],T],[w+T,null])})}if(_&&typeof _==="object")if(eK.isArray(_)){for(var v=_.length;f<v;f++)if(f in _)O(f,f,f===_.length-1)}else if(typeof Symbol==="function"&&_[Symbol.iterator]){var z=[],W=_[Symbol.iterator]();for(var J=W.next();!J.done;J=W.next())z.push(J.value);_=z;for(var v=_.length;f<v;f++)O(f,f,f===_.length-1)}else(function(){var T=void 0;if(Object.keys(_).forEach(function(H){if(T!==void 0)O(T,f-1);T=H,f++}),T!==void 0)O(T,f-1,!0)})();if(f===0)P=Y(this);return P})};y1.exports=g1.default});var l1=_8((L1,p1)=>{L1.__esModule=!0;function gH(q){return q&&q.__esModule?q:{default:q}}var yH=qq(),dH=gH(yH);L1.default=function(q){q.registerHelper("helperMissing",function(){if(arguments.length===1)return;else throw new dH.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};p1.exports=L1.default});var i1=_8((c1,r1)=>{c1.__esModule=!0;function lH(q){return q&&q.__esModule?q:{default:q}}var x1=M6(),xH=qq(),n1=lH(xH);c1.default=function(q){q.registerHelper("if",function(_,j){if(arguments.length!=2)throw new n1.default("#if requires exactly one argument");if(x1.isFunction(_))_=_.call(this);if(!j.hash.includeZero&&!_||x1.isEmpty(_))return j.inverse(this);else return j.fn(this)}),q.registerHelper("unless",function(_,j){if(arguments.length!=2)throw new n1.default("#unless requires exactly one argument");return q.helpers.if.call(this,_,{fn:j.inverse,inverse:j.fn,hash:j.hash})})};r1.exports=c1.default});var B1=_8((o1,a1)=>{o1.__esModule=!0;o1.default=function(q){q.registerHelper("log",function(){var _=[void 0],j=arguments[arguments.length-1];for(var K=0;K<arguments.length-1;K++)_.push(arguments[K]);var Y=1;if(j.hash.level!=null)Y=j.hash.level;else if(j.data&&j.data.level!=null)Y=j.data.level;_[0]=Y,q.log.apply(q,_)})};a1.exports=o1.default});var F1=_8((t1,e1)=>{t1.__esModule=!0;t1.default=function(q){q.registerHelper("lookup",function(_,j,K){if(!_)return _;return K.lookupProperty(_,j)})};e1.exports=t1.default});var Q1=_8((U1,s1)=>{U1.__esModule=!0;function BH(q){return q&&q.__esModule?q:{default:q}}var FK=M6(),tH=qq(),eH=BH(tH);U1.default=function(q){q.registerHelper("with",function(_,j){if(arguments.length!=2)throw new eH.default("#with requires exactly one argument");if(FK.isFunction(_))_=_.call(this);var K=j.fn;if(!FK.isEmpty(_)){var Y=j.data;if(j.data&&j.ids)Y=FK.createFrame(j.data),Y.contextPath=FK.appendContextPath(j.data.contextPath,j.ids[0]);return K(_,{data:Y,blockParams:FK.blockParams([_],[Y&&Y.contextPath])})}else return j.inverse(this)})};s1.exports=U1.default});var l4=_8((JJ)=>{JJ.__esModule=!0;JJ.registerDefaultHelpers=WJ;JJ.moveHelperToHooks=HJ;function Z_(q){return q&&q.__esModule?q:{default:q}}var sH=I1(),QH=Z_(sH),qJ=d1(),_J=Z_(qJ),KJ=l1(),jJ=Z_(KJ),PJ=i1(),YJ=Z_(PJ),fJ=B1(),$J=Z_(fJ),wJ=F1(),OJ=Z_(wJ),zJ=Q1(),vJ=Z_(zJ);function WJ(q){QH.default(q),_J.default(q),jJ.default(q),YJ.default(q),$J.default(q),OJ.default(q),vJ.default(q)}function HJ(q,_,j){if(q.helpers[_]){if(q.hooks[_]=q.helpers[_],!j)delete q.helpers[_]}}});var Kj=_8((qj,_j)=>{qj.__esModule=!0;var XJ=M6();qj.default=function(q){q.registerDecorator("inline",function(_,j,K,Y){var f=_;if(!j.partials)j.partials={},f=function(P,$){var w=K.partials;K.partials=XJ.extend({},w,j.partials);var O=_(P,$);return K.partials=w,O};return j.partials[Y.args[0]]=Y.fn,f})};_j.exports=qj.default});var jj=_8((VJ)=>{VJ.__esModule=!0;VJ.registerDefaultDecorators=CJ;function uJ(q){return q&&q.__esModule?q:{default:q}}var DJ=Kj(),hJ=uJ(DJ);function CJ(q){hJ.default(q)}});var x4=_8((Pj,Yj)=>{Pj.__esModule=!0;var bJ=M6(),fK={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function q(_){if(typeof _==="string"){var j=bJ.indexOf(fK.methodMap,_.toLowerCase());if(j>=0)_=j;else _=parseInt(_,10)}return _},log:function q(_){if(_=fK.lookupLevel(_),typeof console!=="undefined"&&fK.lookupLevel(fK.level)<=_){var j=fK.methodMap[_];if(!console[j])j="log";for(var K=arguments.length,Y=Array(K>1?K-1:0),f=1;f<K;f++)Y[f-1]=arguments[f];console[j].apply(console,Y)}}};Pj.default=fK;Yj.exports=Pj.default});var fj=_8((IJ)=>{IJ.__esModule=!0;IJ.createNewLookupObject=mJ;var RJ=M6();function mJ(){for(var q=arguments.length,_=Array(q),j=0;j<q;j++)_[j]=arguments[j];return RJ.extend.apply(void 0,[Object.create(null)].concat(_))}});var n4=_8((rJ)=>{rJ.__esModule=!0;rJ.createProtoAccessControl=lJ;rJ.resultIsAllowed=xJ;rJ.resetLoggedProperties=cJ;function dJ(q){return q&&q.__esModule?q:{default:q}}var $j=fj(),LJ=x4(),pJ=dJ(LJ),s3=Object.create(null);function lJ(q){var _=Object.create(null);_.constructor=!1,_.__defineGetter__=!1,_.__defineSetter__=!1,_.__lookupGetter__=!1;var j=Object.create(null);return j.__proto__=!1,{properties:{whitelist:$j.createNewLookupObject(j,q.allowedProtoProperties),defaultValue:q.allowProtoPropertiesByDefault},methods:{whitelist:$j.createNewLookupObject(_,q.allowedProtoMethods),defaultValue:q.allowProtoMethodsByDefault}}}function xJ(q,_,j){if(typeof q==="function")return wj(_.methods,j);else return wj(_.properties,j)}function wj(q,_){if(q.whitelist[_]!==void 0)return q.whitelist[_]===!0;if(q.defaultValue!==void 0)return q.defaultValue;return nJ(_),!1}function nJ(q){if(s3[q]!==!0)s3[q]=!0,pJ.default.log("error",'Handlebars: Access has been denied to resolve the property "'+q+`" because it is not an "own property" of its parent.
|
||
You can add a runtime option to disable the check or this warning:
|
||
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`)}function cJ(){Object.keys(s3).forEach(function(q){delete s3[q]})}});var q7=_8((PT)=>{PT.__esModule=!0;PT.HandlebarsEnvironment=i4;function Oj(q){return q&&q.__esModule?q:{default:q}}var k_=M6(),tJ=qq(),c4=Oj(tJ),eJ=l4(),FJ=jj(),UJ=x4(),Q3=Oj(UJ),sJ=n4(),QJ="4.7.8";PT.VERSION=QJ;var qT=8;PT.COMPILER_REVISION=qT;var _T=7;PT.LAST_COMPATIBLE_COMPILER_REVISION=_T;var KT={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};PT.REVISION_CHANGES=KT;var r4="[object Object]";function i4(q,_,j){this.helpers=q||{},this.partials=_||{},this.decorators=j||{},eJ.registerDefaultHelpers(this),FJ.registerDefaultDecorators(this)}i4.prototype={constructor:i4,logger:Q3.default,log:Q3.default.log,registerHelper:function q(_,j){if(k_.toString.call(_)===r4){if(j)throw new c4.default("Arg not supported with multiple helpers");k_.extend(this.helpers,_)}else this.helpers[_]=j},unregisterHelper:function q(_){delete this.helpers[_]},registerPartial:function q(_,j){if(k_.toString.call(_)===r4)k_.extend(this.partials,_);else{if(typeof j==="undefined")throw new c4.default('Attempting to register a partial called "'+_+'" as undefined');this.partials[_]=j}},unregisterPartial:function q(_){delete this.partials[_]},registerDecorator:function q(_,j){if(k_.toString.call(_)===r4){if(j)throw new c4.default("Arg not supported with multiple decorators");k_.extend(this.decorators,_)}else this.decorators[_]=j},unregisterDecorator:function q(_){delete this.decorators[_]},resetLoggedPropertyAccesses:function q(){sJ.resetLoggedProperties()}};var jT=Q3.default.log;PT.log=jT;PT.createFrame=k_.createFrame;PT.logger=Q3.default});var Wj=_8((zj,vj)=>{zj.__esModule=!0;function o4(q){this.string=q}o4.prototype.toString=o4.prototype.toHTML=function(){return""+this.string};zj.default=o4;vj.exports=zj.default});var Hj=_8((kT)=>{kT.__esModule=!0;kT.wrapHelper=ZT;function ZT(q,_){if(typeof q!=="function")return q;var j=function K(){var Y=arguments[arguments.length-1];return arguments[arguments.length-1]=_(Y),q.apply(this,arguments)};return j}});var Xj=_8((mT)=>{mT.__esModule=!0;mT.checkRevision=VT;mT.template=MT;mT.wrapProgram=_7;mT.resolvePartial=NT;mT.invokePartial=bT;mT.noop=Zj;function GT(q){return q&&q.__esModule?q:{default:q}}function uT(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}var DT=M6(),nq=uT(DT),hT=qq(),cq=GT(hT),rq=q7(),Jj=l4(),CT=Hj(),Tj=n4();function VT(q){var _=q&&q[0]||1,j=rq.COMPILER_REVISION;if(_>=rq.LAST_COMPATIBLE_COMPILER_REVISION&&_<=rq.COMPILER_REVISION)return;if(_<rq.LAST_COMPATIBLE_COMPILER_REVISION){var K=rq.REVISION_CHANGES[j],Y=rq.REVISION_CHANGES[_];throw new cq.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+K+") or downgrade your runtime to an older version ("+Y+").")}else throw new cq.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+q[1]+").")}function MT(q,_){if(!_)throw new cq.default("No environment passed to template");if(!q||!q.main)throw new cq.default("Unknown template object: "+typeof q);q.main.decorator=q.main_d,_.VM.checkRevision(q.compiler);var j=q.compiler&&q.compiler[0]===7;function K(P,$,w){if(w.hash){if($=nq.extend({},$,w.hash),w.ids)w.ids[0]=!0}P=_.VM.resolvePartial.call(this,P,$,w);var O=nq.extend({},w,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),v=_.VM.invokePartial.call(this,P,$,O);if(v==null&&_.compile)w.partials[w.name]=_.compile(P,q.compilerOptions,_),v=w.partials[w.name]($,O);if(v!=null){if(w.indent){var z=v.split(`
|
||
`);for(var W=0,J=z.length;W<J;W++){if(!z[W]&&W+1===J)break;z[W]=w.indent+z[W]}v=z.join(`
|
||
`)}return v}else throw new cq.default("The partial "+w.name+" could not be compiled when running in runtime-only mode")}var Y={strict:function P($,w,O){if(!$||!(w in $))throw new cq.default('"'+w+'" not defined in '+$,{loc:O});return Y.lookupProperty($,w)},lookupProperty:function P($,w){var O=$[w];if(O==null)return O;if(Object.prototype.hasOwnProperty.call($,w))return O;if(Tj.resultIsAllowed(O,Y.protoAccessControl,w))return O;return},lookup:function P($,w){var O=$.length;for(var v=0;v<O;v++){var z=$[v]&&Y.lookupProperty($[v],w);if(z!=null)return $[v][w]}},lambda:function P($,w){return typeof $==="function"?$.call(w):$},escapeExpression:nq.escapeExpression,invokePartial:K,fn:function P($){var w=q[$];return w.decorator=q[$+"_d"],w},programs:[],program:function P($,w,O,v,z){var W=this.programs[$],J=this.fn($);if(w||z||v||O)W=_7(this,$,J,w,O,v,z);else if(!W)W=this.programs[$]=_7(this,$,J);return W},data:function P($,w){while($&&w--)$=$._parent;return $},mergeIfNeeded:function P($,w){var O=$||w;if($&&w&&$!==w)O=nq.extend({},w,$);return O},nullContext:Object.seal({}),noop:_.VM.noop,compilerInfo:q.compiler};function f(P){var $=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],w=$.data;if(f._setup($),!$.partial&&q.useData)w=ST(P,w);var O=void 0,v=q.useBlockParams?[]:void 0;if(q.useDepths)if($.depths)O=P!=$.depths[0]?[P].concat($.depths):$.depths;else O=[P];function z(W){return""+q.main(Y,W,Y.helpers,Y.partials,w,v,O)}return z=kj(q.main,z,Y,$.depths||[],w,v),z(P,$)}return f.isTop=!0,f._setup=function(P){if(!P.partial){var $=nq.extend({},_.helpers,P.helpers);if(ET($,Y),Y.helpers=$,q.usePartial)Y.partials=Y.mergeIfNeeded(P.partials,_.partials);if(q.usePartial||q.useDecorators)Y.decorators=nq.extend({},_.decorators,P.decorators);Y.hooks={},Y.protoAccessControl=Tj.createProtoAccessControl(P);var w=P.allowCallsToHelperMissing||j;Jj.moveHelperToHooks(Y,"helperMissing",w),Jj.moveHelperToHooks(Y,"blockHelperMissing",w)}else Y.protoAccessControl=P.protoAccessControl,Y.helpers=P.helpers,Y.partials=P.partials,Y.decorators=P.decorators,Y.hooks=P.hooks},f._child=function(P,$,w,O){if(q.useBlockParams&&!w)throw new cq.default("must pass block params");if(q.useDepths&&!O)throw new cq.default("must pass parent depths");return _7(Y,P,q[P],$,0,w,O)},f}function _7(q,_,j,K,Y,f,P){function $(w){var O=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],v=P;if(P&&w!=P[0]&&!(w===q.nullContext&&P[0]===null))v=[w].concat(P);return j(q,w,q.helpers,q.partials,O.data||K,f&&[O.blockParams].concat(f),v)}return $=kj(j,$,q,P,K,f),$.program=_,$.depth=P?P.length:0,$.blockParams=Y||0,$}function NT(q,_,j){if(!q)if(j.name==="@partial-block")q=j.data["partial-block"];else q=j.partials[j.name];else if(!q.call&&!j.name)j.name=q,q=j.partials[q];return q}function bT(q,_,j){var K=j.data&&j.data["partial-block"];if(j.partial=!0,j.ids)j.data.contextPath=j.ids[0]||j.data.contextPath;var Y=void 0;if(j.fn&&j.fn!==Zj)(function(){j.data=rq.createFrame(j.data);var f=j.fn;if(Y=j.data["partial-block"]=function P($){var w=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return w.data=rq.createFrame(w.data),w.data["partial-block"]=K,f($,w)},f.partials)j.partials=nq.extend({},j.partials,f.partials)})();if(q===void 0&&Y)q=Y;if(q===void 0)throw new cq.default("The partial "+j.name+" could not be found");else if(q instanceof Function)return q(_,j)}function Zj(){return""}function ST(q,_){if(!_||!("root"in _))_=_?rq.createFrame(_):{},_.root=q;return _}function kj(q,_,j,K,Y,f){if(q.decorator){var P={};_=q.decorator(_,P,j,K&&K[0],Y,f,K),nq.extend(_,P)}return _}function ET(q,_){Object.keys(q).forEach(function(j){var K=q[j];q[j]=RT(K,_)})}function RT(q,_){var j=_.lookupProperty;return CT.wrapHelper(q,function(K){return nq.extend({lookupProperty:j},K)})}});var a4=_8((Aj,Gj)=>{Aj.__esModule=!0;Aj.default=function(q){(function(){if(typeof globalThis==="object")return;Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__})();var _=globalThis.Handlebars;q.noConflict=function(){if(globalThis.Handlebars===q)globalThis.Handlebars=_;return q}};Gj.exports=Aj.default});var Mj=_8((Cj,Vj)=>{Cj.__esModule=!0;function t4(q){return q&&q.__esModule?q:{default:q}}function e4(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}var cT=q7(),uj=e4(cT),rT=Wj(),iT=t4(rT),oT=qq(),aT=t4(oT),BT=M6(),B4=e4(BT),tT=Xj(),Dj=e4(tT),eT=a4(),FT=t4(eT);function hj(){var q=new uj.HandlebarsEnvironment;return B4.extend(q,uj),q.SafeString=iT.default,q.Exception=aT.default,q.Utils=B4,q.escapeExpression=B4.escapeExpression,q.VM=Dj,q.template=function(_){return Dj.template(_,q)},q}var UK=hj();UK.create=hj;FT.default(UK);UK.default=UK;Cj.default=UK;Vj.exports=Cj.default});var F4=_8((bj,Sj)=>{bj.__esModule=!0;var Nj={helpers:{helperExpression:function q(_){return _.type==="SubExpression"||(_.type==="MustacheStatement"||_.type==="BlockStatement")&&!!(_.params&&_.params.length||_.hash)},scopedId:function q(_){return/^\.|this\b/.test(_.original)},simpleId:function q(_){return _.parts.length===1&&!Nj.helpers.scopedId(_)&&!_.depth}}};bj.default=Nj;Sj.exports=bj.default});var mj=_8((Ej,Rj)=>{Ej.__esModule=!0;var _Z=function(){var q={trace:function K(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function K(Y,f,P,$,w,O,v){var z=O.length-1;switch(w){case 1:return O[z-1];case 2:this.$=$.prepareProgram(O[z]);break;case 3:this.$=O[z];break;case 4:this.$=O[z];break;case 5:this.$=O[z];break;case 6:this.$=O[z];break;case 7:this.$=O[z];break;case 8:this.$=O[z];break;case 9:this.$={type:"CommentStatement",value:$.stripComment(O[z]),strip:$.stripFlags(O[z],O[z]),loc:$.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:O[z],value:O[z],loc:$.locInfo(this._$)};break;case 11:this.$=$.prepareRawBlock(O[z-2],O[z-1],O[z],this._$);break;case 12:this.$={path:O[z-3],params:O[z-2],hash:O[z-1]};break;case 13:this.$=$.prepareBlock(O[z-3],O[z-2],O[z-1],O[z],!1,this._$);break;case 14:this.$=$.prepareBlock(O[z-3],O[z-2],O[z-1],O[z],!0,this._$);break;case 15:this.$={open:O[z-5],path:O[z-4],params:O[z-3],hash:O[z-2],blockParams:O[z-1],strip:$.stripFlags(O[z-5],O[z])};break;case 16:this.$={path:O[z-4],params:O[z-3],hash:O[z-2],blockParams:O[z-1],strip:$.stripFlags(O[z-5],O[z])};break;case 17:this.$={path:O[z-4],params:O[z-3],hash:O[z-2],blockParams:O[z-1],strip:$.stripFlags(O[z-5],O[z])};break;case 18:this.$={strip:$.stripFlags(O[z-1],O[z-1]),program:O[z]};break;case 19:var W=$.prepareBlock(O[z-2],O[z-1],O[z],O[z],!1,this._$),J=$.prepareProgram([W],O[z-1].loc);J.chained=!0,this.$={strip:O[z-2].strip,program:J,chain:!0};break;case 20:this.$=O[z];break;case 21:this.$={path:O[z-1],strip:$.stripFlags(O[z-2],O[z])};break;case 22:this.$=$.prepareMustache(O[z-3],O[z-2],O[z-1],O[z-4],$.stripFlags(O[z-4],O[z]),this._$);break;case 23:this.$=$.prepareMustache(O[z-3],O[z-2],O[z-1],O[z-4],$.stripFlags(O[z-4],O[z]),this._$);break;case 24:this.$={type:"PartialStatement",name:O[z-3],params:O[z-2],hash:O[z-1],indent:"",strip:$.stripFlags(O[z-4],O[z]),loc:$.locInfo(this._$)};break;case 25:this.$=$.preparePartialBlock(O[z-2],O[z-1],O[z],this._$);break;case 26:this.$={path:O[z-3],params:O[z-2],hash:O[z-1],strip:$.stripFlags(O[z-4],O[z])};break;case 27:this.$=O[z];break;case 28:this.$=O[z];break;case 29:this.$={type:"SubExpression",path:O[z-3],params:O[z-2],hash:O[z-1],loc:$.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:O[z],loc:$.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:$.id(O[z-2]),value:O[z],loc:$.locInfo(this._$)};break;case 32:this.$=$.id(O[z-1]);break;case 33:this.$=O[z];break;case 34:this.$=O[z];break;case 35:this.$={type:"StringLiteral",value:O[z],original:O[z],loc:$.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(O[z]),original:Number(O[z]),loc:$.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:O[z]==="true",original:O[z]==="true",loc:$.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:$.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:$.locInfo(this._$)};break;case 40:this.$=O[z];break;case 41:this.$=O[z];break;case 42:this.$=$.preparePath(!0,O[z],this._$);break;case 43:this.$=$.preparePath(!1,O[z],this._$);break;case 44:O[z-2].push({part:$.id(O[z]),original:O[z],separator:O[z-1]}),this.$=O[z-2];break;case 45:this.$=[{part:$.id(O[z]),original:O[z]}];break;case 46:this.$=[];break;case 47:O[z-1].push(O[z]);break;case 48:this.$=[];break;case 49:O[z-1].push(O[z]);break;case 50:this.$=[];break;case 51:O[z-1].push(O[z]);break;case 58:this.$=[];break;case 59:O[z-1].push(O[z]);break;case 64:this.$=[];break;case 65:O[z-1].push(O[z]);break;case 70:this.$=[];break;case 71:O[z-1].push(O[z]);break;case 78:this.$=[];break;case 79:O[z-1].push(O[z]);break;case 82:this.$=[];break;case 83:O[z-1].push(O[z]);break;case 86:this.$=[];break;case 87:O[z-1].push(O[z]);break;case 90:this.$=[];break;case 91:O[z-1].push(O[z]);break;case 94:this.$=[];break;case 95:O[z-1].push(O[z]);break;case 98:this.$=[O[z]];break;case 99:O[z-1].push(O[z]);break;case 100:this.$=[O[z]];break;case 101:O[z-1].push(O[z]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function K(Y,f){throw new Error(Y)},parse:function K(Y){var f=this,P=[0],$=[null],w=[],O=this.table,v="",z=0,W=0,J=0,T=2,H=1;if(this.lexer.setInput(Y),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var X=this.lexer.yylloc;w.push(X);var A=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function G(t){P.length=P.length-2*t,$.length=$.length-t,w.length=w.length-t}function h(){var t=f.lexer.lex()||1;if(typeof t!=="number")t=f.symbols_[t]||t;return t}var M,I,N,R,l,E,L={},d,V,b,p;while(!0){if(N=P[P.length-1],this.defaultActions[N])R=this.defaultActions[N];else{if(M===null||typeof M=="undefined")M=h();R=O[N]&&O[N][M]}if(typeof R==="undefined"||!R.length||!R[0]){var r="";if(!J){p=[];for(d in O[N])if(this.terminals_[d]&&d>2)p.push("'"+this.terminals_[d]+"'");if(this.lexer.showPosition)r="Parse error on line "+(z+1)+`:
|
||
`+this.lexer.showPosition()+`
|
||
Expecting `+p.join(", ")+", got '"+(this.terminals_[M]||M)+"'";else r="Parse error on line "+(z+1)+": Unexpected "+(M==1?"end of input":"'"+(this.terminals_[M]||M)+"'");this.parseError(r,{text:this.lexer.match,token:this.terminals_[M]||M,line:this.lexer.yylineno,loc:X,expected:p})}}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+M);switch(R[0]){case 1:if(P.push(M),$.push(this.lexer.yytext),w.push(this.lexer.yylloc),P.push(R[1]),M=null,!I){if(W=this.lexer.yyleng,v=this.lexer.yytext,z=this.lexer.yylineno,X=this.lexer.yylloc,J>0)J--}else M=I,I=null;break;case 2:if(V=this.productions_[R[1]][1],L.$=$[$.length-V],L._$={first_line:w[w.length-(V||1)].first_line,last_line:w[w.length-1].last_line,first_column:w[w.length-(V||1)].first_column,last_column:w[w.length-1].last_column},A)L._$.range=[w[w.length-(V||1)].range[0],w[w.length-1].range[1]];if(E=this.performAction.call(L,v,W,z,this.yy,R[1],$,w),typeof E!=="undefined")return E;if(V)P=P.slice(0,-1*V*2),$=$.slice(0,-1*V),w=w.slice(0,-1*V);P.push(this.productions_[R[1]][0]),$.push(L.$),w.push(L._$),b=O[P[P.length-2]][P[P.length-1]],P.push(b);break;case 3:return!0}}return!0}},_=function(){var K={EOF:1,parseError:function Y(f,P){if(this.yy.parser)this.yy.parser.parseError(f,P);else throw new Error(f)},setInput:function Y(f){if(this._input=f,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},input:function Y(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var P=f.match(/(?:\r\n?|\n).*/g);if(P)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),f},unput:function Y(f){var P=f.length,$=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P-1),this.offset-=P;var w=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),$.length-1)this.yylineno-=$.length-1;var O=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:$?($.length===w.length?this.yylloc.first_column:0)+w[w.length-$.length].length-$[0].length:this.yylloc.first_column-P},this.options.ranges)this.yylloc.range=[O[0],O[0]+this.yyleng-P];return this},more:function Y(){return this._more=!0,this},less:function Y(f){this.unput(this.match.slice(f))},pastInput:function Y(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},upcomingInput:function Y(){var f=this.match;if(f.length<20)f+=this._input.substr(0,20-f.length);return(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},showPosition:function Y(){var f=this.pastInput(),P=new Array(f.length+1).join("-");return f+this.upcomingInput()+`
|
||
`+P+"^"},next:function Y(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var f,P,$,w,O,v;if(!this._more)this.yytext="",this.match="";var z=this._currentRules();for(var W=0;W<z.length;W++)if($=this._input.match(this.rules[z[W]]),$&&(!P||$[0].length>P[0].length)){if(P=$,w=W,!this.options.flex)break}if(P){if(v=P[0].match(/(?:\r\n?|\n).*/g),v)this.yylineno+=v.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:v?v[v.length-1].length-v[v.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+P[0].length},this.yytext+=P[0],this.match+=P[0],this.matches=P,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._input=this._input.slice(P[0].length),this.matched+=P[0],f=this.performAction.call(this,this.yy,this,z[w],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(f)return f;else return}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
||
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function Y(){var f=this.next();if(typeof f!=="undefined")return f;else return this.lex()},begin:function Y(f){this.conditionStack.push(f)},popState:function Y(){return this.conditionStack.pop()},_currentRules:function Y(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function Y(){return this.conditionStack[this.conditionStack.length-2]},pushState:function Y(f){this.begin(f)}};return K.options={},K.performAction=function Y(f,P,$,w){function O(z,W){return P.yytext=P.yytext.substring(z,P.yyleng-W+z)}var v=w;switch($){case 0:if(P.yytext.slice(-2)==="\\\\")O(0,1),this.begin("mu");else if(P.yytext.slice(-1)==="\\")O(0,1),this.begin("emu");else this.begin("mu");if(P.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:if(this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw")return 15;else return O(5,9),"END_RAW_BLOCK";break;case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(P.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return P.yytext=O(1,2).replace(/\\"/g,'"'),80;break;case 32:return P.yytext=O(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return P.yytext=P.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},K.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],K.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},K}();q.lexer=_;function j(){this.yy={}}return j.prototype=q,q.Parser=j,new j}();Ej.default=_Z;Rj.exports=Ej.default});var P7=_8((yj,dj)=>{yj.__esModule=!0;function PZ(q){return q&&q.__esModule?q:{default:q}}var YZ=qq(),U4=PZ(YZ);function K7(){this.parents=[]}K7.prototype={constructor:K7,mutating:!1,acceptKey:function q(_,j){var K=this.accept(_[j]);if(this.mutating){if(K&&!K7.prototype[K.type])throw new U4.default('Unexpected node type "'+K.type+'" found when accepting '+j+" on "+_.type);_[j]=K}},acceptRequired:function q(_,j){if(this.acceptKey(_,j),!_[j])throw new U4.default(_.type+" requires "+j)},acceptArray:function q(_){for(var j=0,K=_.length;j<K;j++)if(this.acceptKey(_,j),!_[j])_.splice(j,1),j--,K--},accept:function q(_){if(!_)return;if(!this[_.type])throw new U4.default("Unknown type: "+_.type,_);if(this.current)this.parents.unshift(this.current);this.current=_;var j=this[_.type](_);if(this.current=this.parents.shift(),!this.mutating||j)return j;else if(j!==!1)return _},Program:function q(_){this.acceptArray(_.body)},MustacheStatement:j7,Decorator:j7,BlockStatement:Ij,DecoratorBlock:Ij,PartialStatement:gj,PartialBlockStatement:function q(_){gj.call(this,_),this.acceptKey(_,"program")},ContentStatement:function q(){},CommentStatement:function q(){},SubExpression:j7,PathExpression:function q(){},StringLiteral:function q(){},NumberLiteral:function q(){},BooleanLiteral:function q(){},UndefinedLiteral:function q(){},NullLiteral:function q(){},Hash:function q(_){this.acceptArray(_.pairs)},HashPair:function q(_){this.acceptRequired(_,"value")}};function j7(q){this.acceptRequired(q,"path"),this.acceptArray(q.params),this.acceptKey(q,"hash")}function Ij(q){j7.call(this,q),this.acceptKey(q,"program"),this.acceptKey(q,"inverse")}function gj(q){this.acceptRequired(q,"name"),this.acceptArray(q.params),this.acceptKey(q,"hash")}yj.default=K7;dj.exports=yj.default});var lj=_8((Lj,pj)=>{Lj.__esModule=!0;function wZ(q){return q&&q.__esModule?q:{default:q}}var OZ=P7(),zZ=wZ(OZ);function Nq(){var q=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=q}Nq.prototype=new zZ.default;Nq.prototype.Program=function(q){var _=!this.options.ignoreStandalone,j=!this.isRootSeen;this.isRootSeen=!0;var K=q.body;for(var Y=0,f=K.length;Y<f;Y++){var P=K[Y],$=this.accept(P);if(!$)continue;var w=s4(K,Y,j),O=Q4(K,Y,j),v=$.openStandalone&&w,z=$.closeStandalone&&O,W=$.inlineStandalone&&w&&O;if($.close)X_(K,Y,!0);if($.open)q_(K,Y,!0);if(_&&W){if(X_(K,Y),q_(K,Y)){if(P.type==="PartialStatement")P.indent=/([ \t]+$)/.exec(K[Y-1].original)[1]}}if(_&&v)X_((P.program||P.inverse).body),q_(K,Y);if(_&&z)X_(K,Y),q_((P.inverse||P.program).body)}return q};Nq.prototype.BlockStatement=Nq.prototype.DecoratorBlock=Nq.prototype.PartialBlockStatement=function(q){this.accept(q.program),this.accept(q.inverse);var _=q.program||q.inverse,j=q.program&&q.inverse,K=j,Y=j;if(j&&j.chained){K=j.body[0].program;while(Y.chained)Y=Y.body[Y.body.length-1].program}var f={open:q.openStrip.open,close:q.closeStrip.close,openStandalone:Q4(_.body),closeStandalone:s4((K||_).body)};if(q.openStrip.close)X_(_.body,null,!0);if(j){var P=q.inverseStrip;if(P.open)q_(_.body,null,!0);if(P.close)X_(K.body,null,!0);if(q.closeStrip.open)q_(Y.body,null,!0);if(!this.options.ignoreStandalone&&s4(_.body)&&Q4(K.body))q_(_.body),X_(K.body)}else if(q.closeStrip.open)q_(_.body,null,!0);return f};Nq.prototype.Decorator=Nq.prototype.MustacheStatement=function(q){return q.strip};Nq.prototype.PartialStatement=Nq.prototype.CommentStatement=function(q){var _=q.strip||{};return{inlineStandalone:!0,open:_.open,close:_.close}};function s4(q,_,j){if(_===void 0)_=q.length;var K=q[_-1],Y=q[_-2];if(!K)return j;if(K.type==="ContentStatement")return(Y||!j?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(K.original)}function Q4(q,_,j){if(_===void 0)_=-1;var K=q[_+1],Y=q[_+2];if(!K)return j;if(K.type==="ContentStatement")return(Y||!j?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(K.original)}function X_(q,_,j){var K=q[_==null?0:_+1];if(!K||K.type!=="ContentStatement"||!j&&K.rightStripped)return;var Y=K.value;K.value=K.value.replace(j?/^\s+/:/^[ \t]*\r?\n?/,""),K.rightStripped=K.value!==Y}function q_(q,_,j){var K=q[_==null?q.length-1:_-1];if(!K||K.type!=="ContentStatement"||!j&&K.leftStripped)return;var Y=K.value;return K.value=K.value.replace(j?/\s+$/:/[ \t]+$/,""),K.leftStripped=K.value!==Y,K.leftStripped}Lj.default=Nq;pj.exports=Lj.default});var xj=_8((VZ)=>{VZ.__esModule=!0;VZ.SourceLocation=TZ;VZ.id=ZZ;VZ.stripFlags=kZ;VZ.stripComment=XZ;VZ.preparePath=AZ;VZ.prepareMustache=GZ;VZ.prepareRawBlock=uZ;VZ.prepareBlock=DZ;VZ.prepareProgram=hZ;VZ.preparePartialBlock=CZ;function HZ(q){return q&&q.__esModule?q:{default:q}}var JZ=qq(),q2=HZ(JZ);function _2(q,_){if(_=_.path?_.path.original:_,q.path.original!==_){var j={loc:q.path.loc};throw new q2.default(q.path.original+" doesn't match "+_,j)}}function TZ(q,_){this.source=q,this.start={line:_.first_line,column:_.first_column},this.end={line:_.last_line,column:_.last_column}}function ZZ(q){if(/^\[.*\]$/.test(q))return q.substring(1,q.length-1);else return q}function kZ(q,_){return{open:q.charAt(2)==="~",close:_.charAt(_.length-3)==="~"}}function XZ(q){return q.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function AZ(q,_,j){j=this.locInfo(j);var K=q?"@":"",Y=[],f=0;for(var P=0,$=_.length;P<$;P++){var w=_[P].part,O=_[P].original!==w;if(K+=(_[P].separator||"")+w,!O&&(w===".."||w==="."||w==="this")){if(Y.length>0)throw new q2.default("Invalid path: "+K,{loc:j});else if(w==="..")f++}else Y.push(w)}return{type:"PathExpression",data:q,depth:f,parts:Y,original:K,loc:j}}function GZ(q,_,j,K,Y,f){var P=K.charAt(3)||K.charAt(2),$=P!=="{"&&P!=="&",w=/\*/.test(K);return{type:w?"Decorator":"MustacheStatement",path:q,params:_,hash:j,escaped:$,strip:Y,loc:this.locInfo(f)}}function uZ(q,_,j,K){_2(q,j),K=this.locInfo(K);var Y={type:"Program",body:_,strip:{},loc:K};return{type:"BlockStatement",path:q.path,params:q.params,hash:q.hash,program:Y,openStrip:{},inverseStrip:{},closeStrip:{},loc:K}}function DZ(q,_,j,K,Y,f){if(K&&K.path)_2(q,K);var P=/\*/.test(q.open);_.blockParams=q.blockParams;var $=void 0,w=void 0;if(j){if(P)throw new q2.default("Unexpected inverse block on decorator",j);if(j.chain)j.program.body[0].closeStrip=K.strip;w=j.strip,$=j.program}if(Y)Y=$,$=_,_=Y;return{type:P?"DecoratorBlock":"BlockStatement",path:q.path,params:q.params,hash:q.hash,program:_,inverse:$,openStrip:q.strip,inverseStrip:w,closeStrip:K&&K.strip,loc:this.locInfo(f)}}function hZ(q,_){if(!_&&q.length){var j=q[0].loc,K=q[q.length-1].loc;if(j&&K)_={source:j.source,start:{line:j.start.line,column:j.start.column},end:{line:K.end.line,column:K.end.column}}}return{type:"Program",body:q,strip:{},loc:_}}function CZ(q,_,j,K){return _2(q,j),{type:"PartialBlockStatement",name:q.path,params:q.params,hash:q.hash,program:_,openStrip:q.strip,closeStrip:j&&j.strip,loc:this.locInfo(K)}}});var rj=_8((oZ)=>{oZ.__esModule=!0;oZ.parseWithoutProcessing=cj;oZ.parse=iZ;function LZ(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}function nj(q){return q&&q.__esModule?q:{default:q}}var pZ=mj(),K2=nj(pZ),lZ=lj(),xZ=nj(lZ),nZ=xj(),cZ=LZ(nZ),rZ=M6();oZ.parser=K2.default;var Y7={};rZ.extend(Y7,cZ);function cj(q,_){if(q.type==="Program")return q;K2.default.yy=Y7,Y7.locInfo=function(K){return new Y7.SourceLocation(_&&_.srcName,K)};var j=K2.default.parse(q);return j}function iZ(q,_){var j=cj(q,_),K=new xZ.default(_);return K.accept(j)}});var Bj=_8((_k)=>{_k.__esModule=!0;_k.Compiler=j2;_k.precompile=QZ;_k.compile=qk;function oj(q){return q&&q.__esModule?q:{default:q}}var FZ=qq(),QK=oj(FZ),q3=M6(),UZ=F4(),sK=oj(UZ),sZ=[].slice;function j2(){}j2.prototype={compiler:j2,equals:function q(_){var j=this.opcodes.length;if(_.opcodes.length!==j)return!1;for(var K=0;K<j;K++){var Y=this.opcodes[K],f=_.opcodes[K];if(Y.opcode!==f.opcode||!aj(Y.args,f.args))return!1}j=this.children.length;for(var K=0;K<j;K++)if(!this.children[K].equals(_.children[K]))return!1;return!0},guid:0,compile:function q(_,j){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=j,this.stringParams=j.stringParams,this.trackIds=j.trackIds,j.blockParams=j.blockParams||[],j.knownHelpers=q3.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},j.knownHelpers),this.accept(_)},compileProgram:function q(_){var j=new this.compiler,K=j.compile(_,this.options),Y=this.guid++;return this.usePartial=this.usePartial||K.usePartial,this.children[Y]=K,this.useDepths=this.useDepths||K.useDepths,Y},accept:function q(_){if(!this[_.type])throw new QK.default("Unknown type: "+_.type,_);this.sourceNode.unshift(_);var j=this[_.type](_);return this.sourceNode.shift(),j},Program:function q(_){this.options.blockParams.unshift(_.blockParams);var j=_.body,K=j.length;for(var Y=0;Y<K;Y++)this.accept(j[Y]);return this.options.blockParams.shift(),this.isSimple=K===1,this.blockParams=_.blockParams?_.blockParams.length:0,this},BlockStatement:function q(_){ij(_);var{program:j,inverse:K}=_;j=j&&this.compileProgram(j),K=K&&this.compileProgram(K);var Y=this.classifySexpr(_);if(Y==="helper")this.helperSexpr(_,j,K);else if(Y==="simple")this.simpleSexpr(_),this.opcode("pushProgram",j),this.opcode("pushProgram",K),this.opcode("emptyHash"),this.opcode("blockValue",_.path.original);else this.ambiguousSexpr(_,j,K),this.opcode("pushProgram",j),this.opcode("pushProgram",K),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue");this.opcode("append")},DecoratorBlock:function q(_){var j=_.program&&this.compileProgram(_.program),K=this.setupFullMustacheParams(_,j,void 0),Y=_.path;this.useDecorators=!0,this.opcode("registerDecorator",K.length,Y.original)},PartialStatement:function q(_){this.usePartial=!0;var j=_.program;if(j)j=this.compileProgram(_.program);var K=_.params;if(K.length>1)throw new QK.default("Unsupported number of partial arguments: "+K.length,_);else if(!K.length)if(this.options.explicitPartialContext)this.opcode("pushLiteral","undefined");else K.push({type:"PathExpression",parts:[],depth:0});var Y=_.name.original,f=_.name.type==="SubExpression";if(f)this.accept(_.name);this.setupFullMustacheParams(_,j,void 0,!0);var P=_.indent||"";if(this.options.preventIndent&&P)this.opcode("appendContent",P),P="";this.opcode("invokePartial",f,Y,P),this.opcode("append")},PartialBlockStatement:function q(_){this.PartialStatement(_)},MustacheStatement:function q(_){if(this.SubExpression(_),_.escaped&&!this.options.noEscape)this.opcode("appendEscaped");else this.opcode("append")},Decorator:function q(_){this.DecoratorBlock(_)},ContentStatement:function q(_){if(_.value)this.opcode("appendContent",_.value)},CommentStatement:function q(){},SubExpression:function q(_){ij(_);var j=this.classifySexpr(_);if(j==="simple")this.simpleSexpr(_);else if(j==="helper")this.helperSexpr(_);else this.ambiguousSexpr(_)},ambiguousSexpr:function q(_,j,K){var Y=_.path,f=Y.parts[0],P=j!=null||K!=null;this.opcode("getContext",Y.depth),this.opcode("pushProgram",j),this.opcode("pushProgram",K),Y.strict=!0,this.accept(Y),this.opcode("invokeAmbiguous",f,P)},simpleSexpr:function q(_){var j=_.path;j.strict=!0,this.accept(j),this.opcode("resolvePossibleLambda")},helperSexpr:function q(_,j,K){var Y=this.setupFullMustacheParams(_,j,K),f=_.path,P=f.parts[0];if(this.options.knownHelpers[P])this.opcode("invokeKnownHelper",Y.length,P);else if(this.options.knownHelpersOnly)throw new QK.default("You specified knownHelpersOnly, but used the unknown helper "+P,_);else f.strict=!0,f.falsy=!0,this.accept(f),this.opcode("invokeHelper",Y.length,f.original,sK.default.helpers.simpleId(f))},PathExpression:function q(_){this.addDepth(_.depth),this.opcode("getContext",_.depth);var j=_.parts[0],K=sK.default.helpers.scopedId(_),Y=!_.depth&&!K&&this.blockParamIndex(j);if(Y)this.opcode("lookupBlockParam",Y,_.parts);else if(!j)this.opcode("pushContext");else if(_.data)this.options.data=!0,this.opcode("lookupData",_.depth,_.parts,_.strict);else this.opcode("lookupOnContext",_.parts,_.falsy,_.strict,K)},StringLiteral:function q(_){this.opcode("pushString",_.value)},NumberLiteral:function q(_){this.opcode("pushLiteral",_.value)},BooleanLiteral:function q(_){this.opcode("pushLiteral",_.value)},UndefinedLiteral:function q(){this.opcode("pushLiteral","undefined")},NullLiteral:function q(){this.opcode("pushLiteral","null")},Hash:function q(_){var j=_.pairs,K=0,Y=j.length;this.opcode("pushHash");for(;K<Y;K++)this.pushParam(j[K].value);while(K--)this.opcode("assignToHash",j[K].key);this.opcode("popHash")},opcode:function q(_){this.opcodes.push({opcode:_,args:sZ.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function q(_){if(!_)return;this.useDepths=!0},classifySexpr:function q(_){var j=sK.default.helpers.simpleId(_.path),K=j&&!!this.blockParamIndex(_.path.parts[0]),Y=!K&&sK.default.helpers.helperExpression(_),f=!K&&(Y||j);if(f&&!Y){var P=_.path.parts[0],$=this.options;if($.knownHelpers[P])Y=!0;else if($.knownHelpersOnly)f=!1}if(Y)return"helper";else if(f)return"ambiguous";else return"simple"},pushParams:function q(_){for(var j=0,K=_.length;j<K;j++)this.pushParam(_[j])},pushParam:function q(_){var j=_.value!=null?_.value:_.original||"";if(this.stringParams){if(j.replace)j=j.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".");if(_.depth)this.addDepth(_.depth);if(this.opcode("getContext",_.depth||0),this.opcode("pushStringParam",j,_.type),_.type==="SubExpression")this.accept(_)}else{if(this.trackIds){var K=void 0;if(_.parts&&!sK.default.helpers.scopedId(_)&&!_.depth)K=this.blockParamIndex(_.parts[0]);if(K){var Y=_.parts.slice(1).join(".");this.opcode("pushId","BlockParam",K,Y)}else{if(j=_.original||j,j.replace)j=j.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"");this.opcode("pushId",_.type,j)}}this.accept(_)}},setupFullMustacheParams:function q(_,j,K,Y){var f=_.params;if(this.pushParams(f),this.opcode("pushProgram",j),this.opcode("pushProgram",K),_.hash)this.accept(_.hash);else this.opcode("emptyHash",Y);return f},blockParamIndex:function q(_){for(var j=0,K=this.options.blockParams.length;j<K;j++){var Y=this.options.blockParams[j],f=Y&&q3.indexOf(Y,_);if(Y&&f>=0)return[j,f]}}};function QZ(q,_,j){if(q==null||typeof q!=="string"&&q.type!=="Program")throw new QK.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+q);if(_=_||{},!("data"in _))_.data=!0;if(_.compat)_.useDepths=!0;var K=j.parse(q,_),Y=new j.Compiler().compile(K,_);return new j.JavaScriptCompiler().compile(Y,_)}function qk(q,_,j){if(_===void 0)_={};if(q==null||typeof q!=="string"&&q.type!=="Program")throw new QK.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+q);if(_=q3.extend({},_),!("data"in _))_.data=!0;if(_.compat)_.useDepths=!0;var K=void 0;function Y(){var P=j.parse(q,_),$=new j.Compiler().compile(P,_),w=new j.JavaScriptCompiler().compile($,_,void 0,!0);return j.template(w)}function f(P,$){if(!K)K=Y();return K.call(this,P,$)}return f._setup=function(P){if(!K)K=Y();return K._setup(P)},f._child=function(P,$,w,O){if(!K)K=Y();return K._child(P,$,w,O)},f}function aj(q,_){if(q===_)return!0;if(q3.isArray(q)&&q3.isArray(_)&&q.length===_.length){for(var j=0;j<q.length;j++)if(!aj(q[j],_[j]))return!1;return!0}}function ij(q){if(!q.path.parts){var _=q.path;q.path={type:"PathExpression",data:!1,depth:0,parts:[_.original+""],original:_.original+"",loc:_.loc}}}});var ej=_8((fk)=>{var tj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");fk.encode=function(q){if(0<=q&&q<tj.length)return tj[q];throw new TypeError("Must be between 0 and 63: "+q)};fk.decode=function(q){var _=65,j=90,K=97,Y=122,f=48,P=57,$=43,w=47,O=26,v=52;if(_<=q&&q<=j)return q-_;if(K<=q&&q<=Y)return q-K+O;if(f<=q&&q<=P)return q-f+v;if(q==$)return 62;if(q==w)return 63;return-1}});var Y2=_8((vk)=>{var Fj=ej(),P2=5,Uj=1<<P2,sj=Uj-1,Qj=Uj;function Ok(q){return q<0?(-q<<1)+1:(q<<1)+0}function zk(q){var _=(q&1)===1,j=q>>1;return _?-j:j}vk.encode=function q(_){var j="",K,Y=Ok(_);do{if(K=Y&sj,Y>>>=P2,Y>0)K|=Qj;j+=Fj.encode(K)}while(Y>0);return j};vk.decode=function q(_,j,K){var Y=_.length,f=0,P=0,$,w;do{if(j>=Y)throw new Error("Expected more digits in base 64 VLQ value.");if(w=Fj.decode(_.charCodeAt(j++)),w===-1)throw new Error("Invalid base64 digit: "+_.charAt(j-1));$=!!(w&Qj),w&=sj,f=f+(w<<P),P+=P2}while($);K.value=zk(f),K.rest=j}});var OK=_8((Ck)=>{function Jk(q,_,j){if(_ in q)return q[_];else if(arguments.length===3)return j;else throw new Error('"'+_+'" is a required argument.')}Ck.getArg=Jk;var qP=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Tk=/^data:.+\,.+$/;function _3(q){var _=q.match(qP);if(!_)return null;return{scheme:_[1],auth:_[2],host:_[3],port:_[4],path:_[5]}}Ck.urlParse=_3;function $K(q){var _="";if(q.scheme)_+=q.scheme+":";if(_+="//",q.auth)_+=q.auth+"@";if(q.host)_+=q.host;if(q.port)_+=":"+q.port;if(q.path)_+=q.path;return _}Ck.urlGenerate=$K;function f2(q){var _=q,j=_3(q);if(j){if(!j.path)return q;_=j.path}var K=Ck.isAbsolute(_),Y=_.split(/\/+/);for(var f,P=0,$=Y.length-1;$>=0;$--)if(f=Y[$],f===".")Y.splice($,1);else if(f==="..")P++;else if(P>0)if(f==="")Y.splice($+1,P),P=0;else Y.splice($,2),P--;if(_=Y.join("/"),_==="")_=K?"/":".";if(j)return j.path=_,$K(j);return _}Ck.normalize=f2;function _P(q,_){if(q==="")q=".";if(_==="")_=".";var j=_3(_),K=_3(q);if(K)q=K.path||"/";if(j&&!j.scheme){if(K)j.scheme=K.scheme;return $K(j)}if(j||_.match(Tk))return _;if(K&&!K.host&&!K.path)return K.host=_,$K(K);var Y=_.charAt(0)==="/"?_:f2(q.replace(/\/+$/,"")+"/"+_);if(K)return K.path=Y,$K(K);return Y}Ck.join=_P;Ck.isAbsolute=function(q){return q.charAt(0)==="/"||qP.test(q)};function Zk(q,_){if(q==="")q=".";q=q.replace(/\/$/,"");var j=0;while(_.indexOf(q+"/")!==0){var K=q.lastIndexOf("/");if(K<0)return _;if(q=q.slice(0,K),q.match(/^([^\/]+:\/)?\/*$/))return _;++j}return Array(j+1).join("../")+_.substr(q.length+1)}Ck.relative=Zk;var KP=function(){var q=Object.create(null);return!("__proto__"in q)}();function jP(q){return q}function kk(q){if(PP(q))return"$"+q;return q}Ck.toSetString=KP?jP:kk;function Xk(q){if(PP(q))return q.slice(1);return q}Ck.fromSetString=KP?jP:Xk;function PP(q){if(!q)return!1;var _=q.length;if(_<9)return!1;if(q.charCodeAt(_-1)!==95||q.charCodeAt(_-2)!==95||q.charCodeAt(_-3)!==111||q.charCodeAt(_-4)!==116||q.charCodeAt(_-5)!==111||q.charCodeAt(_-6)!==114||q.charCodeAt(_-7)!==112||q.charCodeAt(_-8)!==95||q.charCodeAt(_-9)!==95)return!1;for(var j=_-10;j>=0;j--)if(q.charCodeAt(j)!==36)return!1;return!0}function Ak(q,_,j){var K=wK(q.source,_.source);if(K!==0)return K;if(K=q.originalLine-_.originalLine,K!==0)return K;if(K=q.originalColumn-_.originalColumn,K!==0||j)return K;if(K=q.generatedColumn-_.generatedColumn,K!==0)return K;if(K=q.generatedLine-_.generatedLine,K!==0)return K;return wK(q.name,_.name)}Ck.compareByOriginalPositions=Ak;function Gk(q,_,j){var K=q.generatedLine-_.generatedLine;if(K!==0)return K;if(K=q.generatedColumn-_.generatedColumn,K!==0||j)return K;if(K=wK(q.source,_.source),K!==0)return K;if(K=q.originalLine-_.originalLine,K!==0)return K;if(K=q.originalColumn-_.originalColumn,K!==0)return K;return wK(q.name,_.name)}Ck.compareByGeneratedPositionsDeflated=Gk;function wK(q,_){if(q===_)return 0;if(q===null)return 1;if(_===null)return-1;if(q>_)return 1;return-1}function uk(q,_){var j=q.generatedLine-_.generatedLine;if(j!==0)return j;if(j=q.generatedColumn-_.generatedColumn,j!==0)return j;if(j=wK(q.source,_.source),j!==0)return j;if(j=q.originalLine-_.originalLine,j!==0)return j;if(j=q.originalColumn-_.originalColumn,j!==0)return j;return wK(q.name,_.name)}Ck.compareByGeneratedPositionsInflated=uk;function Dk(q){return JSON.parse(q.replace(/^\)]}'[^\n]*\n/,""))}Ck.parseSourceMapInput=Dk;function hk(q,_,j){if(_=_||"",q){if(q[q.length-1]!=="/"&&_[0]!=="/")q+="/";_=q+_}if(j){var K=_3(j);if(!K)throw new Error("sourceMapURL could not be parsed");if(K.path){var Y=K.path.lastIndexOf("/");if(Y>=0)K.path=K.path.substring(0,Y+1)}_=_P($K(K),_)}return f2(_)}Ck.computeSourceURL=hk});var O2=_8((lk)=>{var $2=OK(),w2=Object.prototype.hasOwnProperty,A_=typeof Map!=="undefined";function iq(){this._array=[],this._set=A_?new Map:Object.create(null)}iq.fromArray=function q(_,j){var K=new iq;for(var Y=0,f=_.length;Y<f;Y++)K.add(_[Y],j);return K};iq.prototype.size=function q(){return A_?this._set.size:Object.getOwnPropertyNames(this._set).length};iq.prototype.add=function q(_,j){var K=A_?_:$2.toSetString(_),Y=A_?this.has(_):w2.call(this._set,K),f=this._array.length;if(!Y||j)this._array.push(_);if(!Y)if(A_)this._set.set(_,f);else this._set[K]=f};iq.prototype.has=function q(_){if(A_)return this._set.has(_);else{var j=$2.toSetString(_);return w2.call(this._set,j)}};iq.prototype.indexOf=function q(_){if(A_){var j=this._set.get(_);if(j>=0)return j}else{var K=$2.toSetString(_);if(w2.call(this._set,K))return this._set[K]}throw new Error('"'+_+'" is not in the set.')};iq.prototype.at=function q(_){if(_>=0&&_<this._array.length)return this._array[_];throw new Error("No element indexed by "+_)};iq.prototype.toArray=function q(){return this._array.slice()};lk.ArraySet=iq});var fP=_8((ck)=>{var YP=OK();function nk(q,_){var j=q.generatedLine,K=_.generatedLine,Y=q.generatedColumn,f=_.generatedColumn;return K>j||K==j&&f>=Y||YP.compareByGeneratedPositionsInflated(q,_)<=0}function f7(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}f7.prototype.unsortedForEach=function q(_,j){this._array.forEach(_,j)};f7.prototype.add=function q(_){if(nk(this._last,_))this._last=_,this._array.push(_);else this._sorted=!1,this._array.push(_)};f7.prototype.toArray=function q(){if(!this._sorted)this._array.sort(YP.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};ck.MappingList=f7});var z2=_8((ok)=>{var K3=Y2(),j6=OK(),$7=O2().ArraySet,ik=fP().MappingList;function _q(q){if(!q)q={};this._file=j6.getArg(q,"file",null),this._sourceRoot=j6.getArg(q,"sourceRoot",null),this._skipValidation=j6.getArg(q,"skipValidation",!1),this._sources=new $7,this._names=new $7,this._mappings=new ik,this._sourcesContents=null}_q.prototype._version=3;_q.fromSourceMap=function q(_){var j=_.sourceRoot,K=new _q({file:_.file,sourceRoot:j});return _.eachMapping(function(Y){var f={generated:{line:Y.generatedLine,column:Y.generatedColumn}};if(Y.source!=null){if(f.source=Y.source,j!=null)f.source=j6.relative(j,f.source);if(f.original={line:Y.originalLine,column:Y.originalColumn},Y.name!=null)f.name=Y.name}K.addMapping(f)}),_.sources.forEach(function(Y){var f=Y;if(j!==null)f=j6.relative(j,Y);if(!K._sources.has(f))K._sources.add(f);var P=_.sourceContentFor(Y);if(P!=null)K.setSourceContent(Y,P)}),K};_q.prototype.addMapping=function q(_){var j=j6.getArg(_,"generated"),K=j6.getArg(_,"original",null),Y=j6.getArg(_,"source",null),f=j6.getArg(_,"name",null);if(!this._skipValidation)this._validateMapping(j,K,Y,f);if(Y!=null){if(Y=String(Y),!this._sources.has(Y))this._sources.add(Y)}if(f!=null){if(f=String(f),!this._names.has(f))this._names.add(f)}this._mappings.add({generatedLine:j.line,generatedColumn:j.column,originalLine:K!=null&&K.line,originalColumn:K!=null&&K.column,source:Y,name:f})};_q.prototype.setSourceContent=function q(_,j){var K=_;if(this._sourceRoot!=null)K=j6.relative(this._sourceRoot,K);if(j!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[j6.toSetString(K)]=j}else if(this._sourcesContents){if(delete this._sourcesContents[j6.toSetString(K)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};_q.prototype.applySourceMap=function q(_,j,K){var Y=j;if(j==null){if(_.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);Y=_.file}var f=this._sourceRoot;if(f!=null)Y=j6.relative(f,Y);var P=new $7,$=new $7;this._mappings.unsortedForEach(function(w){if(w.source===Y&&w.originalLine!=null){var O=_.originalPositionFor({line:w.originalLine,column:w.originalColumn});if(O.source!=null){if(w.source=O.source,K!=null)w.source=j6.join(K,w.source);if(f!=null)w.source=j6.relative(f,w.source);if(w.originalLine=O.line,w.originalColumn=O.column,O.name!=null)w.name=O.name}}var v=w.source;if(v!=null&&!P.has(v))P.add(v);var z=w.name;if(z!=null&&!$.has(z))$.add(z)},this),this._sources=P,this._names=$,_.sources.forEach(function(w){var O=_.sourceContentFor(w);if(O!=null){if(K!=null)w=j6.join(K,w);if(f!=null)w=j6.relative(f,w);this.setSourceContent(w,O)}},this)};_q.prototype._validateMapping=function q(_,j,K,Y){if(j&&typeof j.line!=="number"&&typeof j.column!=="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(_&&"line"in _&&"column"in _&&_.line>0&&_.column>=0&&!j&&!K&&!Y)return;else if(_&&"line"in _&&"column"in _&&j&&"line"in j&&"column"in j&&_.line>0&&_.column>=0&&j.line>0&&j.column>=0&&K)return;else throw new Error("Invalid mapping: "+JSON.stringify({generated:_,source:K,original:j,name:Y}))};_q.prototype._serializeMappings=function q(){var _=0,j=1,K=0,Y=0,f=0,P=0,$="",w,O,v,z,W=this._mappings.toArray();for(var J=0,T=W.length;J<T;J++){if(O=W[J],w="",O.generatedLine!==j){_=0;while(O.generatedLine!==j)w+=";",j++}else if(J>0){if(!j6.compareByGeneratedPositionsInflated(O,W[J-1]))continue;w+=","}if(w+=K3.encode(O.generatedColumn-_),_=O.generatedColumn,O.source!=null){if(z=this._sources.indexOf(O.source),w+=K3.encode(z-P),P=z,w+=K3.encode(O.originalLine-1-Y),Y=O.originalLine-1,w+=K3.encode(O.originalColumn-K),K=O.originalColumn,O.name!=null)v=this._names.indexOf(O.name),w+=K3.encode(v-f),f=v}$+=w}return $};_q.prototype._generateSourcesContent=function q(_,j){return _.map(function(K){if(!this._sourcesContents)return null;if(j!=null)K=j6.relative(j,K);var Y=j6.toSetString(K);return Object.prototype.hasOwnProperty.call(this._sourcesContents,Y)?this._sourcesContents[Y]:null},this)};_q.prototype.toJSON=function q(){var _={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null)_.file=this._file;if(this._sourceRoot!=null)_.sourceRoot=this._sourceRoot;if(this._sourcesContents)_.sourcesContent=this._generateSourcesContent(_.sources,_.sourceRoot);return _};_q.prototype.toString=function q(){return JSON.stringify(this.toJSON())};ok.SourceMapGenerator=_q});var wP=_8((Bk)=>{Bk.GREATEST_LOWER_BOUND=1;Bk.LEAST_UPPER_BOUND=2;function v2(q,_,j,K,Y,f){var P=Math.floor((_-q)/2)+q,$=Y(j,K[P],!0);if($===0)return P;else if($>0){if(_-P>1)return v2(P,_,j,K,Y,f);if(f==Bk.LEAST_UPPER_BOUND)return _<K.length?_:-1;else return P}else{if(P-q>1)return v2(q,P,j,K,Y,f);if(f==Bk.LEAST_UPPER_BOUND)return P;else return q<0?-1:q}}Bk.search=function q(_,j,K,Y){if(j.length===0)return-1;var f=v2(-1,j.length,_,j,K,Y||Bk.GREATEST_LOWER_BOUND);if(f<0)return-1;while(f-1>=0){if(K(j[f],j[f-1],!0)!==0)break;--f}return f}});var OP=_8((Fk)=>{function H2(q,_,j){var K=q[_];q[_]=q[j],q[j]=K}function ek(q,_){return Math.round(q+Math.random()*(_-q))}function J2(q,_,j,K){if(j<K){var Y=ek(j,K),f=j-1;H2(q,Y,K);var P=q[K];for(var $=j;$<K;$++)if(_(q[$],P)<=0)f+=1,H2(q,f,$);H2(q,f+1,$);var w=f+1;J2(q,_,j,w-1),J2(q,_,w+1,K)}}Fk.quickSort=function(q,_){J2(q,_,0,q.length-1)}});var vP=_8((Qk)=>{var j8=OK(),T2=wP(),zK=O2().ArraySet,sk=Y2(),j3=OP().quickSort;function I8(q,_){var j=q;if(typeof q==="string")j=j8.parseSourceMapInput(q);return j.sections!=null?new Jq(j,_):new J6(j,_)}I8.fromSourceMap=function(q,_){return J6.fromSourceMap(q,_)};I8.prototype._version=3;I8.prototype.__generatedMappings=null;Object.defineProperty(I8.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__generatedMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__generatedMappings}});I8.prototype.__originalMappings=null;Object.defineProperty(I8.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__originalMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__originalMappings}});I8.prototype._charIsMappingSeparator=function q(_,j){var K=_.charAt(j);return K===";"||K===","};I8.prototype._parseMappings=function q(_,j){throw new Error("Subclasses must implement _parseMappings")};I8.GENERATED_ORDER=1;I8.ORIGINAL_ORDER=2;I8.GREATEST_LOWER_BOUND=1;I8.LEAST_UPPER_BOUND=2;I8.prototype.eachMapping=function q(_,j,K){var Y=j||null,f=K||I8.GENERATED_ORDER,P;switch(f){case I8.GENERATED_ORDER:P=this._generatedMappings;break;case I8.ORIGINAL_ORDER:P=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var $=this.sourceRoot;P.map(function(w){var O=w.source===null?null:this._sources.at(w.source);return O=j8.computeSourceURL($,O,this._sourceMapURL),{source:O,generatedLine:w.generatedLine,generatedColumn:w.generatedColumn,originalLine:w.originalLine,originalColumn:w.originalColumn,name:w.name===null?null:this._names.at(w.name)}},this).forEach(_,Y)};I8.prototype.allGeneratedPositionsFor=function q(_){var j=j8.getArg(_,"line"),K={source:j8.getArg(_,"source"),originalLine:j,originalColumn:j8.getArg(_,"column",0)};if(K.source=this._findSourceIndex(K.source),K.source<0)return[];var Y=[],f=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",j8.compareByOriginalPositions,T2.LEAST_UPPER_BOUND);if(f>=0){var P=this._originalMappings[f];if(_.column===void 0){var $=P.originalLine;while(P&&P.originalLine===$)Y.push({line:j8.getArg(P,"generatedLine",null),column:j8.getArg(P,"generatedColumn",null),lastColumn:j8.getArg(P,"lastGeneratedColumn",null)}),P=this._originalMappings[++f]}else{var w=P.originalColumn;while(P&&P.originalLine===j&&P.originalColumn==w)Y.push({line:j8.getArg(P,"generatedLine",null),column:j8.getArg(P,"generatedColumn",null),lastColumn:j8.getArg(P,"lastGeneratedColumn",null)}),P=this._originalMappings[++f]}}return Y};Qk.SourceMapConsumer=I8;function J6(q,_){var j=q;if(typeof q==="string")j=j8.parseSourceMapInput(q);var K=j8.getArg(j,"version"),Y=j8.getArg(j,"sources"),f=j8.getArg(j,"names",[]),P=j8.getArg(j,"sourceRoot",null),$=j8.getArg(j,"sourcesContent",null),w=j8.getArg(j,"mappings"),O=j8.getArg(j,"file",null);if(K!=this._version)throw new Error("Unsupported version: "+K);if(P)P=j8.normalize(P);Y=Y.map(String).map(j8.normalize).map(function(v){return P&&j8.isAbsolute(P)&&j8.isAbsolute(v)?j8.relative(P,v):v}),this._names=zK.fromArray(f.map(String),!0),this._sources=zK.fromArray(Y,!0),this._absoluteSources=this._sources.toArray().map(function(v){return j8.computeSourceURL(P,v,_)}),this.sourceRoot=P,this.sourcesContent=$,this._mappings=w,this._sourceMapURL=_,this.file=O}J6.prototype=Object.create(I8.prototype);J6.prototype.consumer=I8;J6.prototype._findSourceIndex=function(q){var _=q;if(this.sourceRoot!=null)_=j8.relative(this.sourceRoot,_);if(this._sources.has(_))return this._sources.indexOf(_);var j;for(j=0;j<this._absoluteSources.length;++j)if(this._absoluteSources[j]==q)return j;return-1};J6.fromSourceMap=function q(_,j){var K=Object.create(J6.prototype),Y=K._names=zK.fromArray(_._names.toArray(),!0),f=K._sources=zK.fromArray(_._sources.toArray(),!0);K.sourceRoot=_._sourceRoot,K.sourcesContent=_._generateSourcesContent(K._sources.toArray(),K.sourceRoot),K.file=_._file,K._sourceMapURL=j,K._absoluteSources=K._sources.toArray().map(function(J){return j8.computeSourceURL(K.sourceRoot,J,j)});var P=_._mappings.toArray().slice(),$=K.__generatedMappings=[],w=K.__originalMappings=[];for(var O=0,v=P.length;O<v;O++){var z=P[O],W=new zP;if(W.generatedLine=z.generatedLine,W.generatedColumn=z.generatedColumn,z.source){if(W.source=f.indexOf(z.source),W.originalLine=z.originalLine,W.originalColumn=z.originalColumn,z.name)W.name=Y.indexOf(z.name);w.push(W)}$.push(W)}return j3(K.__originalMappings,j8.compareByOriginalPositions),K};J6.prototype._version=3;Object.defineProperty(J6.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function zP(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}J6.prototype._parseMappings=function q(_,j){var K=1,Y=0,f=0,P=0,$=0,w=0,O=_.length,v=0,z={},W={},J=[],T=[],H,X,A,G,h;while(v<O)if(_.charAt(v)===";")K++,v++,Y=0;else if(_.charAt(v)===",")v++;else{H=new zP,H.generatedLine=K;for(G=v;G<O;G++)if(this._charIsMappingSeparator(_,G))break;if(X=_.slice(v,G),A=z[X],A)v+=X.length;else{A=[];while(v<G)sk.decode(_,v,W),h=W.value,v=W.rest,A.push(h);if(A.length===2)throw new Error("Found a source, but no line and column");if(A.length===3)throw new Error("Found a source and line, but no column");z[X]=A}if(H.generatedColumn=Y+A[0],Y=H.generatedColumn,A.length>1){if(H.source=$+A[1],$+=A[1],H.originalLine=f+A[2],f=H.originalLine,H.originalLine+=1,H.originalColumn=P+A[3],P=H.originalColumn,A.length>4)H.name=w+A[4],w+=A[4]}if(T.push(H),typeof H.originalLine==="number")J.push(H)}j3(T,j8.compareByGeneratedPositionsDeflated),this.__generatedMappings=T,j3(J,j8.compareByOriginalPositions),this.__originalMappings=J};J6.prototype._findMapping=function q(_,j,K,Y,f,P){if(_[K]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+_[K]);if(_[Y]<0)throw new TypeError("Column must be greater than or equal to 0, got "+_[Y]);return T2.search(_,j,f,P)};J6.prototype.computeColumnSpans=function q(){for(var _=0;_<this._generatedMappings.length;++_){var j=this._generatedMappings[_];if(_+1<this._generatedMappings.length){var K=this._generatedMappings[_+1];if(j.generatedLine===K.generatedLine){j.lastGeneratedColumn=K.generatedColumn-1;continue}}j.lastGeneratedColumn=1/0}};J6.prototype.originalPositionFor=function q(_){var j={generatedLine:j8.getArg(_,"line"),generatedColumn:j8.getArg(_,"column")},K=this._findMapping(j,this._generatedMappings,"generatedLine","generatedColumn",j8.compareByGeneratedPositionsDeflated,j8.getArg(_,"bias",I8.GREATEST_LOWER_BOUND));if(K>=0){var Y=this._generatedMappings[K];if(Y.generatedLine===j.generatedLine){var f=j8.getArg(Y,"source",null);if(f!==null)f=this._sources.at(f),f=j8.computeSourceURL(this.sourceRoot,f,this._sourceMapURL);var P=j8.getArg(Y,"name",null);if(P!==null)P=this._names.at(P);return{source:f,line:j8.getArg(Y,"originalLine",null),column:j8.getArg(Y,"originalColumn",null),name:P}}}return{source:null,line:null,column:null,name:null}};J6.prototype.hasContentsOfAllSources=function q(){if(!this.sourcesContent)return!1;return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(_){return _==null})};J6.prototype.sourceContentFor=function q(_,j){if(!this.sourcesContent)return null;var K=this._findSourceIndex(_);if(K>=0)return this.sourcesContent[K];var Y=_;if(this.sourceRoot!=null)Y=j8.relative(this.sourceRoot,Y);var f;if(this.sourceRoot!=null&&(f=j8.urlParse(this.sourceRoot))){var P=Y.replace(/^file:\/\//,"");if(f.scheme=="file"&&this._sources.has(P))return this.sourcesContent[this._sources.indexOf(P)];if((!f.path||f.path=="/")&&this._sources.has("/"+Y))return this.sourcesContent[this._sources.indexOf("/"+Y)]}if(j)return null;else throw new Error('"'+Y+'" is not in the SourceMap.')};J6.prototype.generatedPositionFor=function q(_){var j=j8.getArg(_,"source");if(j=this._findSourceIndex(j),j<0)return{line:null,column:null,lastColumn:null};var K={source:j,originalLine:j8.getArg(_,"line"),originalColumn:j8.getArg(_,"column")},Y=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",j8.compareByOriginalPositions,j8.getArg(_,"bias",I8.GREATEST_LOWER_BOUND));if(Y>=0){var f=this._originalMappings[Y];if(f.source===K.source)return{line:j8.getArg(f,"generatedLine",null),column:j8.getArg(f,"generatedColumn",null),lastColumn:j8.getArg(f,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Qk.BasicSourceMapConsumer=J6;function Jq(q,_){var j=q;if(typeof q==="string")j=j8.parseSourceMapInput(q);var K=j8.getArg(j,"version"),Y=j8.getArg(j,"sections");if(K!=this._version)throw new Error("Unsupported version: "+K);this._sources=new zK,this._names=new zK;var f={line:-1,column:0};this._sections=Y.map(function(P){if(P.url)throw new Error("Support for url field in sections not implemented.");var $=j8.getArg(P,"offset"),w=j8.getArg($,"line"),O=j8.getArg($,"column");if(w<f.line||w===f.line&&O<f.column)throw new Error("Section offsets must be ordered and non-overlapping.");return f=$,{generatedOffset:{generatedLine:w+1,generatedColumn:O+1},consumer:new I8(j8.getArg(P,"map"),_)}})}Jq.prototype=Object.create(I8.prototype);Jq.prototype.constructor=I8;Jq.prototype._version=3;Object.defineProperty(Jq.prototype,"sources",{get:function(){var q=[];for(var _=0;_<this._sections.length;_++)for(var j=0;j<this._sections[_].consumer.sources.length;j++)q.push(this._sections[_].consumer.sources[j]);return q}});Jq.prototype.originalPositionFor=function q(_){var j={generatedLine:j8.getArg(_,"line"),generatedColumn:j8.getArg(_,"column")},K=T2.search(j,this._sections,function(f,P){var $=f.generatedLine-P.generatedOffset.generatedLine;if($)return $;return f.generatedColumn-P.generatedOffset.generatedColumn}),Y=this._sections[K];if(!Y)return{source:null,line:null,column:null,name:null};return Y.consumer.originalPositionFor({line:j.generatedLine-(Y.generatedOffset.generatedLine-1),column:j.generatedColumn-(Y.generatedOffset.generatedLine===j.generatedLine?Y.generatedOffset.generatedColumn-1:0),bias:_.bias})};Jq.prototype.hasContentsOfAllSources=function q(){return this._sections.every(function(_){return _.consumer.hasContentsOfAllSources()})};Jq.prototype.sourceContentFor=function q(_,j){for(var K=0;K<this._sections.length;K++){var Y=this._sections[K],f=Y.consumer.sourceContentFor(_,!0);if(f)return f}if(j)return null;else throw new Error('"'+_+'" is not in the SourceMap.')};Jq.prototype.generatedPositionFor=function q(_){for(var j=0;j<this._sections.length;j++){var K=this._sections[j];if(K.consumer._findSourceIndex(j8.getArg(_,"source"))===-1)continue;var Y=K.consumer.generatedPositionFor(_);if(Y){var f={line:Y.line+(K.generatedOffset.generatedLine-1),column:Y.column+(K.generatedOffset.generatedLine===Y.line?K.generatedOffset.generatedColumn-1:0)};return f}}return{line:null,column:null}};Jq.prototype._parseMappings=function q(_,j){this.__generatedMappings=[],this.__originalMappings=[];for(var K=0;K<this._sections.length;K++){var Y=this._sections[K],f=Y.consumer._generatedMappings;for(var P=0;P<f.length;P++){var $=f[P],w=Y.consumer._sources.at($.source);w=j8.computeSourceURL(Y.consumer.sourceRoot,w,this._sourceMapURL),this._sources.add(w),w=this._sources.indexOf(w);var O=null;if($.name)O=Y.consumer._names.at($.name),this._names.add(O),O=this._names.indexOf(O);var v={source:w,generatedLine:$.generatedLine+(Y.generatedOffset.generatedLine-1),generatedColumn:$.generatedColumn+(Y.generatedOffset.generatedLine===$.generatedLine?Y.generatedOffset.generatedColumn-1:0),originalLine:$.originalLine,originalColumn:$.originalColumn,name:O};if(this.__generatedMappings.push(v),typeof v.originalLine==="number")this.__originalMappings.push(v)}}j3(this.__generatedMappings,j8.compareByGeneratedPositionsDeflated),j3(this.__originalMappings,j8.compareByOriginalPositions)};Qk.IndexedSourceMapConsumer=Jq});var WP=_8((fX)=>{var jX=z2().SourceMapGenerator,w7=OK(),PX=/(\r?\n)/,YX=10,vK="$$$isSourceNode$$$";function x6(q,_,j,K,Y){if(this.children=[],this.sourceContents={},this.line=q==null?null:q,this.column=_==null?null:_,this.source=j==null?null:j,this.name=Y==null?null:Y,this[vK]=!0,K!=null)this.add(K)}x6.fromStringWithSourceMap=function q(_,j,K){var Y=new x6,f=_.split(PX),P=0,$=function(){var W=T(),J=T()||"";return W+J;function T(){return P<f.length?f[P++]:void 0}},w=1,O=0,v=null;if(j.eachMapping(function(W){if(v!==null)if(w<W.generatedLine)z(v,$()),w++,O=0;else{var J=f[P]||"",T=J.substr(0,W.generatedColumn-O);f[P]=J.substr(W.generatedColumn-O),O=W.generatedColumn,z(v,T),v=W;return}while(w<W.generatedLine)Y.add($()),w++;if(O<W.generatedColumn){var J=f[P]||"";Y.add(J.substr(0,W.generatedColumn)),f[P]=J.substr(W.generatedColumn),O=W.generatedColumn}v=W},this),P<f.length){if(v)z(v,$());Y.add(f.splice(P).join(""))}return j.sources.forEach(function(W){var J=j.sourceContentFor(W);if(J!=null){if(K!=null)W=w7.join(K,W);Y.setSourceContent(W,J)}}),Y;function z(W,J){if(W===null||W.source===void 0)Y.add(J);else{var T=K?w7.join(K,W.source):W.source;Y.add(new x6(W.originalLine,W.originalColumn,T,J,W.name))}}};x6.prototype.add=function q(_){if(Array.isArray(_))_.forEach(function(j){this.add(j)},this);else if(_[vK]||typeof _==="string"){if(_)this.children.push(_)}else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+_);return this};x6.prototype.prepend=function q(_){if(Array.isArray(_))for(var j=_.length-1;j>=0;j--)this.prepend(_[j]);else if(_[vK]||typeof _==="string")this.children.unshift(_);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+_);return this};x6.prototype.walk=function q(_){var j;for(var K=0,Y=this.children.length;K<Y;K++)if(j=this.children[K],j[vK])j.walk(_);else if(j!=="")_(j,{source:this.source,line:this.line,column:this.column,name:this.name})};x6.prototype.join=function q(_){var j,K,Y=this.children.length;if(Y>0){j=[];for(K=0;K<Y-1;K++)j.push(this.children[K]),j.push(_);j.push(this.children[K]),this.children=j}return this};x6.prototype.replaceRight=function q(_,j){var K=this.children[this.children.length-1];if(K[vK])K.replaceRight(_,j);else if(typeof K==="string")this.children[this.children.length-1]=K.replace(_,j);else this.children.push("".replace(_,j));return this};x6.prototype.setSourceContent=function q(_,j){this.sourceContents[w7.toSetString(_)]=j};x6.prototype.walkSourceContents=function q(_){for(var j=0,K=this.children.length;j<K;j++)if(this.children[j][vK])this.children[j].walkSourceContents(_);var Y=Object.keys(this.sourceContents);for(var j=0,K=Y.length;j<K;j++)_(w7.fromSetString(Y[j]),this.sourceContents[Y[j]])};x6.prototype.toString=function q(){var _="";return this.walk(function(j){_+=j}),_};x6.prototype.toStringWithSourceMap=function q(_){var j={code:"",line:1,column:0},K=new jX(_),Y=!1,f=null,P=null,$=null,w=null;return this.walk(function(O,v){if(j.code+=O,v.source!==null&&v.line!==null&&v.column!==null){if(f!==v.source||P!==v.line||$!==v.column||w!==v.name)K.addMapping({source:v.source,original:{line:v.line,column:v.column},generated:{line:j.line,column:j.column},name:v.name});f=v.source,P=v.line,$=v.column,w=v.name,Y=!0}else if(Y)K.addMapping({generated:{line:j.line,column:j.column}}),f=null,Y=!1;for(var z=0,W=O.length;z<W;z++)if(O.charCodeAt(z)===YX){if(j.line++,j.column=0,z+1===W)f=null,Y=!1;else if(Y)K.addMapping({source:v.source,original:{line:v.line,column:v.column},generated:{line:j.line,column:j.column},name:v.name})}else j.column++}),this.walkSourceContents(function(O,v){K.setSourceContent(O,v)}),{code:j.code,map:K}};fX.SourceNode=x6});var HP=_8((wX)=>{wX.SourceMapGenerator=z2().SourceMapGenerator;wX.SourceMapConsumer=vP().SourceMapConsumer;wX.SourceNode=WP().SourceNode});var kP=_8((TP,ZP)=>{TP.__esModule=!0;var k2=M6(),G_=void 0;try{if(typeof define!=="function"||!define.amd)X2=HP(),G_=X2.SourceNode}catch(q){}var X2;if(!G_)G_=function(q,_,j,K){if(this.src="",K)this.add(K)},G_.prototype={add:function q(_){if(k2.isArray(_))_=_.join("");this.src+=_},prepend:function q(_){if(k2.isArray(_))_=_.join("");this.src=_+this.src},toStringWithSourceMap:function q(){return{code:this.toString()}},toString:function q(){return this.src}};function Z2(q,_,j){if(k2.isArray(q)){var K=[];for(var Y=0,f=q.length;Y<f;Y++)K.push(_.wrap(q[Y],j));return K}else if(typeof q==="boolean"||typeof q==="number")return q+"";return q}function JP(q){this.srcFile=q,this.source=[]}JP.prototype={isEmpty:function q(){return!this.source.length},prepend:function q(_,j){this.source.unshift(this.wrap(_,j))},push:function q(_,j){this.source.push(this.wrap(_,j))},merge:function q(){var _=this.empty();return this.each(function(j){_.add([" ",j,`
|
||
`])}),_},each:function q(_){for(var j=0,K=this.source.length;j<K;j++)_(this.source[j])},empty:function q(){var _=this.currentLocation||{start:{}};return new G_(_.start.line,_.start.column,this.srcFile)},wrap:function q(_){var j=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];if(_ instanceof G_)return _;return _=Z2(_,this,j),new G_(j.start.line,j.start.column,this.srcFile,_)},functionCall:function q(_,j,K){return K=this.generateList(K),this.wrap([_,j?"."+j+"(":"(",K,")"])},quotedString:function q(_){return'"'+(_+"").replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function q(_){var j=this,K=[];Object.keys(_).forEach(function(f){var P=Z2(_[f],j);if(P!=="undefined")K.push([j.quotedString(f),":",P])});var Y=this.generateList(K);return Y.prepend("{"),Y.add("}"),Y},generateList:function q(_){var j=this.empty();for(var K=0,Y=_.length;K<Y;K++){if(K)j.add(",");j.add(Z2(_[K],this))}return j},generateArray:function q(_){var j=this.generateList(_);return j.prepend("["),j.add("]"),j}};TP.default=JP;ZP.exports=TP.default});var hP=_8((uP,DP)=>{uP.__esModule=!0;function GP(q){return q&&q.__esModule?q:{default:q}}var XP=q7(),JX=qq(),A2=GP(JX),TX=M6(),ZX=kP(),AP=GP(ZX);function WK(q){this.value=q}function HK(){}HK.prototype={nameLookup:function q(_,j){return this.internalNameLookup(_,j)},depthedLookup:function q(_){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(_),")"]},compilerInfo:function q(){var _=XP.COMPILER_REVISION,j=XP.REVISION_CHANGES[_];return[_,j]},appendToBuffer:function q(_,j,K){if(!TX.isArray(_))_=[_];if(_=this.source.wrap(_,j),this.environment.isSimple)return["return ",_,";"];else if(K)return["buffer += ",_,";"];else return _.appendToBuffer=!0,_},initializeBuffer:function q(){return this.quotedString("")},internalNameLookup:function q(_,j){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",_,",",JSON.stringify(j),")"]},lookupPropertyFunctionIsUsed:!1,compile:function q(_,j,K,Y){this.environment=_,this.options=j,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!Y,this.name=this.environment.name,this.isChild=!!K,this.context=K||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(_,j),this.useDepths=this.useDepths||_.useDepths||_.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||_.useBlockParams;var f=_.opcodes,P=void 0,$=void 0,w=void 0,O=void 0;for(w=0,O=f.length;w<O;w++)P=f[w],this.source.currentLocation=P.loc,$=$||P.loc,this[P.opcode].apply(this,P.args);if(this.source.currentLocation=$,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new A2.default("Compile completed with content left on stack");if(!this.decorators.isEmpty())if(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
|
||
`]),this.decorators.push("return fn;"),Y)this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]);else this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
|
||
`),this.decorators.push(`}
|
||
`),this.decorators=this.decorators.merge();else this.decorators=void 0;var v=this.createFunctionContext(Y);if(!this.isChild){var z={compiler:this.compilerInfo(),main:v};if(this.decorators)z.main_d=this.decorators,z.useDecorators=!0;var W=this.context,J=W.programs,T=W.decorators;for(w=0,O=J.length;w<O;w++)if(J[w]){if(z[w]=J[w],T[w])z[w+"_d"]=T[w],z.useDecorators=!0}if(this.environment.usePartial)z.usePartial=!0;if(this.options.data)z.useData=!0;if(this.useDepths)z.useDepths=!0;if(this.useBlockParams)z.useBlockParams=!0;if(this.options.compat)z.compat=!0;if(!Y)if(z.compiler=JSON.stringify(z.compiler),this.source.currentLocation={start:{line:1,column:0}},z=this.objectLiteral(z),j.srcName)z=z.toStringWithSourceMap({file:j.destName}),z.map=z.map&&z.map.toString();else z=z.toString();else z.compilerOptions=this.options;return z}else return v},preamble:function q(){this.lastContext=0,this.source=new AP.default(this.options.srcName),this.decorators=new AP.default(this.options.srcName)},createFunctionContext:function q(_){var j=this,K="",Y=this.stackVars.concat(this.registers.list);if(Y.length>0)K+=", "+Y.join(", ");var f=0;if(Object.keys(this.aliases).forEach(function(w){var O=j.aliases[w];if(O.children&&O.referenceCount>1)K+=", alias"+ ++f+"="+w,O.children[0]="alias"+f}),this.lookupPropertyFunctionIsUsed)K+=", "+this.lookupPropertyFunctionVarDeclaration();var P=["container","depth0","helpers","partials","data"];if(this.useBlockParams||this.useDepths)P.push("blockParams");if(this.useDepths)P.push("depths");var $=this.mergeSource(K);if(_)return P.push($),Function.apply(this,P);else return this.source.wrap(["function(",P.join(","),`) {
|
||
`,$,"}"])},mergeSource:function q(_){var j=this.environment.isSimple,K=!this.forceBuffer,Y=void 0,f=void 0,P=void 0,$=void 0;if(this.source.each(function(w){if(w.appendToBuffer){if(P)w.prepend(" + ");else P=w;$=w}else{if(P){if(!f)Y=!0;else P.prepend("buffer += ");$.add(";"),P=$=void 0}if(f=!0,!j)K=!1}}),K){if(P)P.prepend("return "),$.add(";");else if(!f)this.source.push('return "";')}else if(_+=", buffer = "+(Y?"":this.initializeBuffer()),P)P.prepend("return buffer + "),$.add(";");else this.source.push("return buffer;");if(_)this.source.prepend("var "+_.substring(2)+(Y?"":`;
|
||
`));return this.source.merge()},lookupPropertyFunctionVarDeclaration:function q(){return`
|
||
lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
||
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
||
return parent[propertyName];
|
||
}
|
||
return undefined
|
||
}
|
||
`.trim()},blockValue:function q(_){var j=this.aliasable("container.hooks.blockHelperMissing"),K=[this.contextName(0)];this.setupHelperArgs(_,0,K);var Y=this.popStack();K.splice(1,0,Y),this.push(this.source.functionCall(j,"call",K))},ambiguousBlockValue:function q(){var _=this.aliasable("container.hooks.blockHelperMissing"),j=[this.contextName(0)];this.setupHelperArgs("",0,j,!0),this.flushInline();var K=this.topStack();j.splice(1,0,K),this.pushSource(["if (!",this.lastHelper,") { ",K," = ",this.source.functionCall(_,"call",j),"}"])},appendContent:function q(_){if(this.pendingContent)_=this.pendingContent+_;else this.pendingLocation=this.source.currentLocation;this.pendingContent=_},append:function q(){if(this.isInline())this.replaceStack(function(j){return[" != null ? ",j,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var _=this.popStack();if(this.pushSource(["if (",_," != null) { ",this.appendToBuffer(_,void 0,!0)," }"]),this.environment.isSimple)this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function q(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function q(_){this.lastContext=_},pushContext:function q(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function q(_,j,K,Y){var f=0;if(!Y&&this.options.compat&&!this.lastContext)this.push(this.depthedLookup(_[f++]));else this.pushContext();this.resolvePath("context",_,f,j,K)},lookupBlockParam:function q(_,j){this.useBlockParams=!0,this.push(["blockParams[",_[0],"][",_[1],"]"]),this.resolvePath("context",j,1)},lookupData:function q(_,j,K){if(!_)this.pushStackLiteral("data");else this.pushStackLiteral("container.data(data, "+_+")");this.resolvePath("data",j,0,!0,K)},resolvePath:function q(_,j,K,Y,f){var P=this;if(this.options.strict||this.options.assumeObjects){this.push(kX(this.options.strict&&f,this,j,K,_));return}var $=j.length;for(;K<$;K++)this.replaceStack(function(w){var O=P.nameLookup(w,j[K],_);if(!Y)return[" != null ? ",O," : ",w];else return[" && ",O]})},resolvePossibleLambda:function q(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function q(_,j){if(this.pushContext(),this.pushString(j),j!=="SubExpression")if(typeof _==="string")this.pushString(_);else this.pushStackLiteral(_)},emptyHash:function q(_){if(this.trackIds)this.push("{}");if(this.stringParams)this.push("{}"),this.push("{}");this.pushStackLiteral(_?"undefined":"{}")},pushHash:function q(){if(this.hash)this.hashes.push(this.hash);this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function q(){var _=this.hash;if(this.hash=this.hashes.pop(),this.trackIds)this.push(this.objectLiteral(_.ids));if(this.stringParams)this.push(this.objectLiteral(_.contexts)),this.push(this.objectLiteral(_.types));this.push(this.objectLiteral(_.values))},pushString:function q(_){this.pushStackLiteral(this.quotedString(_))},pushLiteral:function q(_){this.pushStackLiteral(_)},pushProgram:function q(_){if(_!=null)this.pushStackLiteral(this.programExpression(_));else this.pushStackLiteral(null)},registerDecorator:function q(_,j){var K=this.nameLookup("decorators",j,"decorator"),Y=this.setupHelperArgs(j,_);this.decorators.push(["fn = ",this.decorators.functionCall(K,"",["fn","props","container",Y])," || fn;"])},invokeHelper:function q(_,j,K){var Y=this.popStack(),f=this.setupHelper(_,j),P=[];if(K)P.push(f.name);if(P.push(Y),!this.options.strict)P.push(this.aliasable("container.hooks.helperMissing"));var $=["(",this.itemsSeparatedBy(P,"||"),")"],w=this.source.functionCall($,"call",f.callParams);this.push(w)},itemsSeparatedBy:function q(_,j){var K=[];K.push(_[0]);for(var Y=1;Y<_.length;Y++)K.push(j,_[Y]);return K},invokeKnownHelper:function q(_,j){var K=this.setupHelper(_,j);this.push(this.source.functionCall(K.name,"call",K.callParams))},invokeAmbiguous:function q(_,j){this.useRegister("helper");var K=this.popStack();this.emptyHash();var Y=this.setupHelper(0,_,j),f=this.lastHelper=this.nameLookup("helpers",_,"helper"),P=["(","(helper = ",f," || ",K,")"];if(!this.options.strict)P[0]="(helper = ",P.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"));this.push(["(",P,Y.paramsInit?["),(",Y.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",Y.callParams)," : helper))"])},invokePartial:function q(_,j,K){var Y=[],f=this.setupParams(j,1,Y);if(_)j=this.popStack(),delete f.name;if(K)f.indent=JSON.stringify(K);if(f.helpers="helpers",f.partials="partials",f.decorators="container.decorators",!_)Y.unshift(this.nameLookup("partials",j,"partial"));else Y.unshift(j);if(this.options.compat)f.depths="depths";f=this.objectLiteral(f),Y.push(f),this.push(this.source.functionCall("container.invokePartial","",Y))},assignToHash:function q(_){var j=this.popStack(),K=void 0,Y=void 0,f=void 0;if(this.trackIds)f=this.popStack();if(this.stringParams)Y=this.popStack(),K=this.popStack();var P=this.hash;if(K)P.contexts[_]=K;if(Y)P.types[_]=Y;if(f)P.ids[_]=f;P.values[_]=j},pushId:function q(_,j,K){if(_==="BlockParam")this.pushStackLiteral("blockParams["+j[0]+"].path["+j[1]+"]"+(K?" + "+JSON.stringify("."+K):""));else if(_==="PathExpression")this.pushString(j);else if(_==="SubExpression")this.pushStackLiteral("true");else this.pushStackLiteral("null")},compiler:HK,compileChildren:function q(_,j){var K=_.children,Y=void 0,f=void 0;for(var P=0,$=K.length;P<$;P++){Y=K[P],f=new this.compiler;var w=this.matchExistingProgram(Y);if(w==null){this.context.programs.push("");var O=this.context.programs.length;Y.index=O,Y.name="program"+O,this.context.programs[O]=f.compile(Y,j,this.context,!this.precompile),this.context.decorators[O]=f.decorators,this.context.environments[O]=Y,this.useDepths=this.useDepths||f.useDepths,this.useBlockParams=this.useBlockParams||f.useBlockParams,Y.useDepths=this.useDepths,Y.useBlockParams=this.useBlockParams}else Y.index=w.index,Y.name="program"+w.index,this.useDepths=this.useDepths||w.useDepths,this.useBlockParams=this.useBlockParams||w.useBlockParams}},matchExistingProgram:function q(_){for(var j=0,K=this.context.environments.length;j<K;j++){var Y=this.context.environments[j];if(Y&&Y.equals(_))return Y}},programExpression:function q(_){var j=this.environment.children[_],K=[j.index,"data",j.blockParams];if(this.useBlockParams||this.useDepths)K.push("blockParams");if(this.useDepths)K.push("depths");return"container.program("+K.join(", ")+")"},useRegister:function q(_){if(!this.registers[_])this.registers[_]=!0,this.registers.list.push(_)},push:function q(_){if(!(_ instanceof WK))_=this.source.wrap(_);return this.inlineStack.push(_),_},pushStackLiteral:function q(_){this.push(new WK(_))},pushSource:function q(_){if(this.pendingContent)this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0;if(_)this.source.push(_)},replaceStack:function q(_){var j=["("],K=void 0,Y=void 0,f=void 0;if(!this.isInline())throw new A2.default("replaceStack on non-inline");var P=this.popStack(!0);if(P instanceof WK)K=[P.value],j=["(",K],f=!0;else{Y=!0;var $=this.incrStack();j=["((",this.push($)," = ",P,")"],K=this.topStack()}var w=_.call(this,K);if(!f)this.popStack();if(Y)this.stackSlot--;this.push(j.concat(w,")"))},incrStack:function q(){if(this.stackSlot++,this.stackSlot>this.stackVars.length)this.stackVars.push("stack"+this.stackSlot);return this.topStackName()},topStackName:function q(){return"stack"+this.stackSlot},flushInline:function q(){var _=this.inlineStack;this.inlineStack=[];for(var j=0,K=_.length;j<K;j++){var Y=_[j];if(Y instanceof WK)this.compileStack.push(Y);else{var f=this.incrStack();this.pushSource([f," = ",Y,";"]),this.compileStack.push(f)}}},isInline:function q(){return this.inlineStack.length},popStack:function q(_){var j=this.isInline(),K=(j?this.inlineStack:this.compileStack).pop();if(!_&&K instanceof WK)return K.value;else{if(!j){if(!this.stackSlot)throw new A2.default("Invalid stack pop");this.stackSlot--}return K}},topStack:function q(){var _=this.isInline()?this.inlineStack:this.compileStack,j=_[_.length-1];if(j instanceof WK)return j.value;else return j},contextName:function q(_){if(this.useDepths&&_)return"depths["+_+"]";else return"depth"+_},quotedString:function q(_){return this.source.quotedString(_)},objectLiteral:function q(_){return this.source.objectLiteral(_)},aliasable:function q(_){var j=this.aliases[_];if(j)return j.referenceCount++,j;return j=this.aliases[_]=this.source.wrap(_),j.aliasable=!0,j.referenceCount=1,j},setupHelper:function q(_,j,K){var Y=[],f=this.setupHelperArgs(j,_,Y,K),P=this.nameLookup("helpers",j,"helper"),$=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:Y,paramsInit:f,name:P,callParams:[$].concat(Y)}},setupParams:function q(_,j,K){var Y={},f=[],P=[],$=[],w=!K,O=void 0;if(w)K=[];if(Y.name=this.quotedString(_),Y.hash=this.popStack(),this.trackIds)Y.hashIds=this.popStack();if(this.stringParams)Y.hashTypes=this.popStack(),Y.hashContexts=this.popStack();var v=this.popStack(),z=this.popStack();if(z||v)Y.fn=z||"container.noop",Y.inverse=v||"container.noop";var W=j;while(W--){if(O=this.popStack(),K[W]=O,this.trackIds)$[W]=this.popStack();if(this.stringParams)P[W]=this.popStack(),f[W]=this.popStack()}if(w)Y.args=this.source.generateArray(K);if(this.trackIds)Y.ids=this.source.generateArray($);if(this.stringParams)Y.types=this.source.generateArray(P),Y.contexts=this.source.generateArray(f);if(this.options.data)Y.data="data";if(this.useBlockParams)Y.blockParams="blockParams";return Y},setupHelperArgs:function q(_,j,K,Y){var f=this.setupParams(_,j,K);if(f.loc=JSON.stringify(this.source.currentLocation),f=this.objectLiteral(f),Y)return this.useRegister("options"),K.push("options"),["options=",f];else if(K)return K.push(f),"";else return f}};(function(){var q="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),_=HK.RESERVED_WORDS={};for(var j=0,K=q.length;j<K;j++)_[q[j]]=!0})();HK.isValidJavaScriptVariableName=function(q){return!HK.RESERVED_WORDS[q]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(q)};function kX(q,_,j,K,Y){var f=_.popStack(),P=j.length;if(q)P--;for(;K<P;K++)f=_.nameLookup(f,j[K],Y);if(q)return[_.aliasable("container.strict"),"(",f,", ",_.quotedString(j[K]),", ",JSON.stringify(_.source.currentLocation)," )"];else return f}uP.default=HK;DP.exports=uP.default});var NP=_8((VP,MP)=>{VP.__esModule=!0;function P3(q){return q&&q.__esModule?q:{default:q}}var GX=Mj(),uX=P3(GX),DX=F4(),hX=P3(DX),G2=rj(),u2=Bj(),CX=hP(),VX=P3(CX),MX=P7(),NX=P3(MX),bX=a4(),SX=P3(bX),EX=uX.default.create;function CP(){var q=EX();return q.compile=function(_,j){return u2.compile(_,j,q)},q.precompile=function(_,j){return u2.precompile(_,j,q)},q.AST=hX.default,q.Compiler=u2.Compiler,q.JavaScriptCompiler=VX.default,q.Parser=G2.parser,q.parse=G2.parse,q.parseWithoutProcessing=G2.parseWithoutProcessing,q}var JK=CP();JK.create=CP;SX.default(JK);JK.Visitor=NX.default;JK.default=JK;VP.default=JK;MP.exports=VP.default});var bP=_8((LX)=>{LX.__esModule=!0;LX.print=dX;LX.PrintVisitor=B8;function IX(q){return q&&q.__esModule?q:{default:q}}var gX=P7(),yX=IX(gX);function dX(q){return new B8().accept(q)}function B8(){this.padding=0}B8.prototype=new yX.default;B8.prototype.pad=function(q){var _="";for(var j=0,K=this.padding;j<K;j++)_+=" ";return _+=q+`
|
||
`,_};B8.prototype.Program=function(q){var _="",j=q.body,K=void 0,Y=void 0;if(q.blockParams){var f="BLOCK PARAMS: [";for(K=0,Y=q.blockParams.length;K<Y;K++)f+=" "+q.blockParams[K];f+=" ]",_+=this.pad(f)}for(K=0,Y=j.length;K<Y;K++)_+=this.accept(j[K]);return this.padding--,_};B8.prototype.MustacheStatement=function(q){return this.pad("{{ "+this.SubExpression(q)+" }}")};B8.prototype.Decorator=function(q){return this.pad("{{ DIRECTIVE "+this.SubExpression(q)+" }}")};B8.prototype.BlockStatement=B8.prototype.DecoratorBlock=function(q){var _="";if(_+=this.pad((q.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,_+=this.pad(this.SubExpression(q)),q.program)_+=this.pad("PROGRAM:"),this.padding++,_+=this.accept(q.program),this.padding--;if(q.inverse){if(q.program)this.padding++;if(_+=this.pad("{{^}}"),this.padding++,_+=this.accept(q.inverse),this.padding--,q.program)this.padding--}return this.padding--,_};B8.prototype.PartialStatement=function(q){var _="PARTIAL:"+q.name.original;if(q.params[0])_+=" "+this.accept(q.params[0]);if(q.hash)_+=" "+this.accept(q.hash);return this.pad("{{> "+_+" }}")};B8.prototype.PartialBlockStatement=function(q){var _="PARTIAL BLOCK:"+q.name.original;if(q.params[0])_+=" "+this.accept(q.params[0]);if(q.hash)_+=" "+this.accept(q.hash);return _+=" "+this.pad("PROGRAM:"),this.padding++,_+=this.accept(q.program),this.padding--,this.pad("{{> "+_+" }}")};B8.prototype.ContentStatement=function(q){return this.pad("CONTENT[ '"+q.value+"' ]")};B8.prototype.CommentStatement=function(q){return this.pad("{{! '"+q.value+"' }}")};B8.prototype.SubExpression=function(q){var _=q.params,j=[],K=void 0;for(var Y=0,f=_.length;Y<f;Y++)j.push(this.accept(_[Y]));return _="["+j.join(", ")+"]",K=q.hash?" "+this.accept(q.hash):"",this.accept(q.path)+" "+_+K};B8.prototype.PathExpression=function(q){var _=q.parts.join("/");return(q.data?"@":"")+"PATH:"+_};B8.prototype.StringLiteral=function(q){return'"'+q.value+'"'};B8.prototype.NumberLiteral=function(q){return"NUMBER{"+q.value+"}"};B8.prototype.BooleanLiteral=function(q){return"BOOLEAN{"+q.value+"}"};B8.prototype.UndefinedLiteral=function(){return"UNDEFINED"};B8.prototype.NullLiteral=function(){return"NULL"};B8.prototype.Hash=function(q){var _=q.pairs,j=[];for(var K=0,Y=_.length;K<Y;K++)j.push(this.accept(_[K]));return"HASH{"+j.join(", ")+"}"};B8.prototype.HashPair=function(q){return q.key+"="+this.accept(q.value)}});var mP=_8((MV,RP)=>{var O7=NP().default,EP=bP();O7.PrintVisitor=EP.PrintVisitor;O7.print=EP.print;RP.exports=O7;function SP(q,_){var j=C6("fs"),K=j.readFileSync(_,"utf8");q.exports=O7.compile(K)}if(C6.extensions)C6.extensions[".handlebars"]=SP,C6.extensions[".hbs"]=SP});function rX(q,_,j,K){let Y={projectPrefix:q,sessionId:_,timestamp:j||new Date().toISOString(),archiveFilename:K||`${_}.jsonl.archive`};return cX(Y)}function gP(q,_,j,K){let Y=rX(j,_,K),f=`
|
||
|
||
RESPONSE FORMAT:
|
||
After storing memories in Chroma, return EXACTLY this JSON structure wrapped in tags:
|
||
|
||
<JSONResponse>
|
||
{
|
||
"overview": "2-3 sentence summary of session themes and accomplishments. Write for any developer to understand by organically defining jargon.",
|
||
"summaries": [
|
||
{
|
||
"text": "What was accomplished (start with action verb)",
|
||
"document_id": "${j}_${_}_1",
|
||
"keywords": "comma, separated, terms",
|
||
"timestamp": "${K||new Date().toISOString()}",
|
||
"archive": "${_}.jsonl.archive"
|
||
}
|
||
]
|
||
}
|
||
</JSONResponse>
|
||
|
||
IMPORTANT:
|
||
- Return 3-10 summaries based on conversation complexity
|
||
- Each summary should correspond to a memory you attempted to store
|
||
- If tool calls fail, still return the JSON response with summaries
|
||
- The JSON must be valid and complete
|
||
- Place NOTHING outside the <JSONResponse> tags
|
||
- Do not include any explanatory text before or after the JSON`;return Y+`
|
||
|
||
`+q+f}var IP,nX=`You are analyzing a Claude Code conversation transcript to create memories using the Chroma MCP memory system.
|
||
|
||
YOUR TASK:
|
||
1. Extract key learnings and accomplishments as natural language memories
|
||
2. Store memories using mcp__claude-mem__chroma_add_documents
|
||
3. Return a structured JSON response with the extracted summaries
|
||
|
||
WHAT TO EXTRACT:
|
||
- Technical implementations (functions, classes, APIs, databases)
|
||
- Design patterns and architectural decisions
|
||
- Bug fixes and problem solutions
|
||
- Workflows, processes, and integrations
|
||
- Performance optimizations and improvements
|
||
|
||
STORAGE INSTRUCTIONS:
|
||
Call mcp__claude-mem__chroma_add_documents with:
|
||
- collection_name: "claude_memories"
|
||
- documents: Array of natural language descriptions
|
||
- ids: ["{{projectPrefix}}_{{sessionId}}_1", "{{projectPrefix}}_{{sessionId}}_2", ...]
|
||
- metadatas: Array with fields:
|
||
* type: component/pattern/workflow/integration/concept/decision/tool/fix
|
||
* keywords: Comma-separated search terms
|
||
* context: Brief situation description
|
||
* timestamp: "{{timestamp}}"
|
||
* session_id: "{{sessionId}}"
|
||
|
||
ERROR HANDLING:
|
||
If you get "IDs already exist" errors, use mcp__claude-mem__chroma_update_documents instead.
|
||
If any tool calls fail, continue and return the JSON response anyway.
|
||
|
||
Project: {{projectPrefix}}
|
||
Session ID: {{sessionId}}
|
||
|
||
Conversation to compress:`,cX;var yP=K6(()=>{IP=Oq(mP(),1),cX=IP.default.compile(nX,{noEscape:!0})});class D2{projectName;constructor(q="claude-mem"){this.projectName=q}createAnalysisPrompt(q){let _=new Date().toISOString();return{prompt:this.buildAnalysisPrompt(q),context:q,type:"analysis",timestamp:_}}createSessionStartPrompt(q){let _=new Date().toISOString();return{message:this.buildSessionStartMessage(q),context:q,type:"session",timestamp:_}}createHookResponse(q){let _=new Date().toISOString();return{...this.buildHookResponse(q),context:q,type:"hook",timestamp:_}}buildAnalysisPrompt(q){let{transcriptContent:_,sessionId:j,projectName:K=this.projectName}=q,Y=K.replace(/[-\s]/g,"_").toLowerCase();return gP(_,j,Y)}buildSessionStartMessage(q){let{sessionId:_,source:j,projectName:K=this.projectName,additionalContext:Y,transcriptPath:f,cwd:P}=q,$=`## Session Started (${j})
|
||
|
||
**Project**: ${K}
|
||
**Session ID**: ${_} `;if(f)$+=`**Transcript**: ${f} `;if(P)$+=`**Working Directory**: ${P} `;if(Y)$+=`
|
||
### Additional Context
|
||
${Y}`;return $+=`
|
||
|
||
Memory system is active and ready to preserve context across sessions.`,$}buildHookResponse(q){let{hookEventName:_,success:j,message:K,data:Y,shouldContinue:f=j,stopReason:P}=q,$={continue:f,suppressOutput:!1};if(!f&&P)$.stopReason=P;if(_==="SessionStart")$.hookSpecificOutput={hookEventName:"SessionStart",additionalContext:K,...Y};else if(Y)$.hookSpecificOutput=Y;return $}validateAnalysisContext(q){return!!(q.transcriptContent&&q.sessionId)}validateSessionContext(q){return!!(q.sessionId&&q.source)}validateHookContext(q){return!!(q.hookEventName&&q.sessionId&&typeof q.success==="boolean")}getProjectName(){return this.projectName}setProjectName(q){this.projectName=q}}function dP(q,_,j={}){return{transcriptContent:q,sessionId:_,...j}}var LP=K6(()=>{yP()});var u_;var pP=K6(()=>{u_={COMPRESSION_STARTED:"\uD83D\uDE80 COMPRESSION STARTED",TRANSCRIPT_PATH:(q)=>`\uD83D\uDCC1 Transcript Path: ${q}`,SESSION_ID:(q)=>`\uD83D\uDD0D Session ID: ${q}`,PROJECT_NAME:(q)=>`\uD83D\uDCDD PROJECT NAME: ${q}`,CLAUDE_SDK_CALL:"\uD83E\uDD16 Calling Claude SDK to analyze and populate memory database...",TRANSCRIPT_STATS:(q,_)=>`\uD83D\uDCCA Transcript size: ${q} characters, ${_} messages`,COMPRESSION_COMPLETE:(q)=>`✅ COMPRESSION COMPLETE
|
||
Total summaries extracted: ${q}`,CLAUDE_PATH_FOUND:(q)=>`\uD83C\uDFAF Found Claude Code at: ${q}`,MCP_CONFIG_USED:(q)=>`\uD83D\uDCCB Using MCP config: ${q}`}});class lP{level=TK.INFO;setLevel(q){this.level=TK[q]}debug(q,..._){if(this.level<=TK.DEBUG)console.debug(`[DEBUG] ${q}`,..._)}info(q,..._){if(this.level<=TK.INFO)console.info(`[INFO] ${q}`,..._)}warn(q,..._){if(this.level<=TK.WARN)console.warn(`[WARN] ${q}`,..._)}error(q,_,j){if(this.level<=TK.ERROR){if(console.error(`[ERROR] ${q}`),_)console.error(_);if(j)console.error("Context:",j)}}}var TK,t8;var xP=K6(()=>{TK={DEBUG:0,INFO:1,WARN:2,ERROR:3};t8=new lP});import{readFileSync as iX,existsSync as oX}from"fs";import{join as aX}from"path";function Tq(){return nP.getClaudePath()}var nP;var z7=K6(()=>{I4();nP=class nP{static settingsPath;static cachedSettings=null;static{let q=new xq;this.settingsPath=aX(q.getConfigDir(),"settings.json")}static readSettings(){if(this.cachedSettings!==null)return this.cachedSettings;try{if(oX(this.settingsPath)){let _=iX(this.settingsPath,"utf-8"),j=JSON.parse(_);return this.cachedSettings=j,j}}catch{}let q={};return this.cachedSettings=q,q}static getSetting(q,_){return this.readSettings()[q]??_}static getClaudePath(){return this.getSetting("claudePath","claude")}static clearCache(){this.cachedSettings=null}}});class D_{static DEFAULT_MAX_TOKENS=28000;static DEFAULT_MAX_BYTES=98000;static DEFAULT_CONTEXT_OVERLAP=2;static CHARS_PER_TOKEN_ESTIMATE=3.5;options;constructor(q={}){this.options={maxTokensPerChunk:q.maxTokensPerChunk??D_.DEFAULT_MAX_TOKENS,maxBytesPerChunk:q.maxBytesPerChunk??D_.DEFAULT_MAX_BYTES,preserveContext:q.preserveContext??!0,contextOverlap:q.contextOverlap??D_.DEFAULT_CONTEXT_OVERLAP,parallel:q.parallel??!1}}estimateTokenCount(q){return Math.ceil(q.length/D_.CHARS_PER_TOKEN_ESTIMATE)}parseFilteredOutput(q){let _=q.split(`
|
||
`).filter((K)=>K.trim()),j=[];for(let K of _)if(K.startsWith("- ")){let Y=K.substring(2);j.push({content:Y,estimatedTokens:this.estimateTokenCount(Y)})}return j}chunkTranscript(q){let _=this.parseFilteredOutput(q),j=[],K=[],Y=0,f=0,P=0;for(let $=0;$<_.length;$++){let w=_[$],O=this.formatMessage(w),v=Buffer.byteLength(O,"utf8"),z=w.estimatedTokens;if(K.length>0&&(Y+z>this.options.maxTokensPerChunk||f+v>this.options.maxBytesPerChunk)){let W=this.formatChunk(K);if(j.push({content:W,metadata:{chunkNumber:j.length+1,totalChunks:0,startIndex:P,endIndex:$-1,messageCount:K.length,estimatedTokens:Y,sizeBytes:f,hasOverlap:!1}}),K=[],Y=0,f=0,P=$,this.options.preserveContext&&j.length>0){let J=Math.max(0,$-this.options.contextOverlap);for(let T=J;T<$;T++){let H=_[T],X=this.formatMessage(H);K.push(H),Y+=H.estimatedTokens,f+=Buffer.byteLength(X,"utf8")}if(K.length>0)P=J}}K.push(w),Y+=z,f+=v}if(K.length>0){let $=this.formatChunk(K);j.push({content:$,metadata:{chunkNumber:j.length+1,totalChunks:0,startIndex:P,endIndex:_.length-1,messageCount:K.length,estimatedTokens:Y,sizeBytes:f,hasOverlap:this.options.preserveContext&&j.length>0}})}return j.forEach(($)=>{$.metadata.totalChunks=j.length}),j}formatMessage(q){return`- ${q.content}`}formatChunk(q){return q.map((_)=>this.formatMessage(_)).join(`
|
||
`)}createChunkHeader(q){let _=[];if(q.firstTimestamp&&q.lastTimestamp)_.push(`# ${q.firstTimestamp} to ${q.lastTimestamp} (chunk ${q.chunkNumber}/${q.totalChunks})`);else _.push(`# Chunk ${q.chunkNumber} of ${q.totalChunks}`);return _.join(`
|
||
`)+`
|
||
`}needsChunking(q){let _=this.estimateTokenCount(q),j=Buffer.byteLength(q,"utf8");return _>this.options.maxTokensPerChunk||j>this.options.maxBytesPerChunk}getChunkingStats(q){let _=q.reduce((Y,f)=>Y+f.metadata.messageCount,0),j=q.reduce((Y,f)=>Y+f.metadata.estimatedTokens,0),K=q.reduce((Y,f)=>Y+f.metadata.sizeBytes,0);return["\uD83D\uDCCA Chunking Statistics:",` • Total chunks: ${q.length}`,` • Total messages: ${_}`,` • Total estimated tokens: ${j.toLocaleString()}`,` • Total size: ${(K/1024).toFixed(1)} KB`,` • Average tokens per chunk: ${Math.round(j/q.length).toLocaleString()}`,` • Average size per chunk: ${(K/q.length/1024).toFixed(1)} KB`].join(`
|
||
`)}}var cP={};tq(cP,{TranscriptCompressor:()=>ZK});import n6,{createWriteStream as BX}from"fs";import v7,{join as h2}from"path";class ZK{paths;logStream=null;logFile=null;promptOrchestrator;chunkManager;constructor(q={}){this.paths=new xq,this.promptOrchestrator=new D2,this.chunkManager=new D_,this.ensureClaudeMemStructure(),this.initializeLogging(),t8.debug("\uD83E\uDD16 TranscriptCompressor initialized")}ensureClaudeMemStructure(){let q=this.paths.getConfigDir(),_=this.paths.getIndexDir(),j=this.paths.getArchiveDir(),K=this.paths.getLogsDir();xq.ensureDirectories([q,_,j,K])}initializeLogging(){let q=this.paths.getLogsDir(),_=new Date().toISOString().replace(/[:.]/g,"-");this.logFile=h2(q,`claude-mem-${_}.log`),this.logStream=BX(this.logFile,{flags:"a"}),this.debugLog("\uD83D\uDE80 DEBUG LOG STARTED"),this.debugLog(`\uD83D\uDCC1 Log file: ${this.logFile}`),this.debugLog("═".repeat(60))}debugLog(q){if(!this.logStream)return;let j=`[${new Date().toISOString()}] ${q}
|
||
`;this.logStream.write(j)}closeLogging(){if(this.logStream)this.debugLog("✅ DEBUG LOG ENDED"),this.logStream.end()}async compress(q,_,j){this.debugLog(`\uD83D\uDE80 Starting compression for: ${q}`),this.debugLog(`\uD83D\uDCCB Session ID: ${_||"auto-generated"}`);try{let K=j||xq.getCurrentProjectPrefix();t8.debug(u_.PROJECT_NAME(K)),this.debugLog(`\uD83D\uDCDD PROJECT PREFIX: ${K}`);let Y=n6.readFileSync(q,"utf-8");this.debugLog(`\uD83D\uDCD6 Reading transcript: ${Y.length} bytes`);let f=Y.trim().split(`
|
||
`).filter((X)=>X.trim()),P=[],$=0;for(let X=0;X<f.length;X++)try{let A=JSON.parse(f[X]);P.push(A)}catch(A){$++,t8.debug(`Parse error on line ${X+1}: ${A.message}`)}if(t8.debug(u_.TRANSCRIPT_STATS(Y.length,P.length)),$>0)t8.debug(`Parse errors: ${$}`);this.debugLog(`\uD83D\uDCCA Transcript loaded: ${f.length} lines, ${P.length} messages, ${$} parse errors`);let w=_||v7.basename(q,".jsonl"),O=new Date().toISOString();for(let X=P.length-1;X>=0;X--){let A=P[X];if(A.timestamp)try{let G=A.timestamp,h;if(typeof G==="string"&&G.includes("T"))h=new Date(G);else{let M=Number(G),I=M<10000000000?M*1000:M;h=new Date(I)}if(!isNaN(h.getTime())){O=h.toISOString(),this.debugLog(`\uD83D\uDCC5 Using timestamp from last message: ${O}`);break}}catch(G){this.debugLog(`⚠️ Invalid timestamp in message: ${A.timestamp}, trying earlier message`)}}let v=`${w}.jsonl.archive`,z=this.formatConversationForPrompt(P),W=this.chunkManager.needsChunking(z),J=[],T=null;if(W){let X=await this.compressInChunks(P,w,K);J=X.summaries,T=X.overview}else{let X=dP(z,w,{projectName:K,trigger:"manual"}),A=this.promptOrchestrator.createAnalysisPrompt(X);t8.debug("\uD83D\uDCE4 Analysis prompt created"),t8.debug(`\uD83D\uDCCA Prompt length: ${A.prompt.length} characters`);let G=v7.join(this.paths.getLogsDir(),`claude-prompt-${Date.now()}.txt`);n6.writeFileSync(G,`=== CLAUDE ANALYSIS PROMPT ===
|
||
${A.prompt}
|
||
`),this.debugLog(`\uD83D\uDCDD Full prompt saved to: ${G}`);let h=Tq(),M=this.findMCPConfig();if(t8.debug(u_.CLAUDE_PATH_FOUND(h)),M)t8.debug(u_.MCP_CONFIG_USED(M));this.debugLog("\uD83E\uDD16 Calling Claude SDK with MCP tools...");let I=await lq({prompt:A.prompt,options:{allowedTools:["mcp__claude-mem__chroma_list_collections","mcp__claude-mem__chroma_create_collection","mcp__claude-mem__chroma_peek_collection","mcp__claude-mem__chroma_get_collection_info","mcp__claude-mem__chroma_get_collection_count","mcp__claude-mem__chroma_modify_collection","mcp__claude-mem__chroma_fork_collection","mcp__claude-mem__chroma_delete_collection","mcp__claude-mem__chroma_add_documents","mcp__claude-mem__chroma_query_documents","mcp__claude-mem__chroma_get_documents","mcp__claude-mem__chroma_update_documents","mcp__claude-mem__chroma_delete_documents"],pathToClaudeCodeExecutable:Tq()}});this.debugLog("✅ Claude SDK response received"),this.debugLog("\uD83D\uDD04 Processing Claude JSON response...");let N=await this.processClaudeResponse(I);if(this.debugLog(`\uD83D\uDCCB Extracted ${N.summaries.length} summaries from JSON`),N.overview)this.debugLog(`\uD83D\uDCDD Overview: ${N.overview}`);J=N.summaries,T=N.overview}t8.debug(u_.COMPRESSION_COMPLETE(J.length));let H=this.createArchive(q,K,w,Y);return this.debugLog(`\uD83D\uDCE6 Archive created: ${H}`),this.appendToIndex(J,T,K,w,P,H,O),this.debugLog(`\uD83D\uDCE5 Written ${J.length} summaries to index`),t8.debug("✅ SUCCESS"),t8.debug(`Archive created: ${H}`),t8.debug(`Summaries created: ${J.length}`),this.debugLog("✅ Compression completed successfully"),this.closeLogging(),H}catch(K){throw t8.error("COMPRESSION FAILED",K,{transcriptPath:q,sessionId:_}),this.debugLog(`❌ ERROR: ${K instanceof Error?K.message:String(K)}`),this.closeLogging(),K}}findMCPConfig(){let q=$8.getInstance();return[q.getProjectMcpConfigPath(),q.getMcpConfigPath(),h2(q.getClaudeConfigDirectory(),".mcp.json")].find(n6.existsSync)||q.getMcpConfigPath()}async processClaudeResponse(q){let _="";_=await this.extractResponseContent(q,[]),this.debugLog(`\uD83D\uDD0D Claude response content length: ${_.length}`);let j=v7.join(this.paths.getLogsDir(),`claude-response-${Date.now()}.txt`);n6.writeFileSync(j,`=== CLAUDE RAW RESPONSE ===
|
||
${_}
|
||
`),this.debugLog(`\uD83D\uDCDD Raw response saved to: ${j}`);let K=this.extractJSONResponse(_);if(this.debugLog(`\uD83D\uDCCA Extracted ${K.summaries.length} summaries from JSON`),K.summaries.length===0)this.debugLog("⚠️ No summaries found in JSON response");return K}async extractResponseContent(q,_){if(q&&typeof q==="object"&&Symbol.asyncIterator in q){let j="",K=!1;for await(let Y of q){let f=this.extractMessageContent(Y);if(j+=f,f.includes("<JSONResponse>"))K=!0;if(f.includes("</JSONResponse>")){K=!1;continue}if(f&&!K)process.stdout.write(f);if(Y?.type==="result"&&Y?.result)j=Y.result}return j}if(typeof q==="string")return q;if(Array.isArray(q))return q.map((j)=>{if(typeof j==="string")return j;if(j?.text)return j.text;if(j?.content)return j.content;return""}).filter(Boolean).join(`
|
||
`);if(typeof q==="object"&&q!==null){if(q?.text)return q.text;if(q?.content)return q.content;if(q?.message)return q.message;return""}return""}extractMessageContent(q){let _="";if(q?.content)_+=q.content;if(q?.text)_+=q.text;if(q?.data)_+=q.data;if(q?.message?.content&&Array.isArray(q.message.content))q.message.content.forEach((j)=>{if(j.type==="text"&&j.text)_+=j.text});return _}extractJSONResponse(q){try{let _=q.match(/<JSONResponse>([\s\S]*?)<\/JSONResponse>/);if(!_)return this.debugLog("⚠️ No <JSONResponse> tags found in response"),{overview:null,summaries:[]};let j=_[1].trim();this.debugLog(`✅ Found JSON response: ${j.length} chars`);let K=JSON.parse(j);if(!K.summaries||!Array.isArray(K.summaries))return this.debugLog("⚠️ Invalid JSON structure: missing summaries array"),{overview:null,summaries:[]};let Y=[];if(K.summaries.forEach((f,P)=>{if(!f.text||!f.document_id){this.debugLog(`⚠️ Skipping invalid summary at index ${P}`);return}let $={text:f.text,document_id:f.document_id,keywords:f.keywords||"",timestamp:f.timestamp||new Date().toISOString(),archive:f.archive||`${f.document_id}.jsonl.archive`};Y.push($),this.debugLog(`✅ Valid summary ${P+1}: ${f.document_id}`)}),K.overview)this.debugLog(`\uD83D\uDCDD Session overview: ${K.overview}`);return{overview:K.overview||null,summaries:Y}}catch(_){return this.debugLog(`❌ Failed to parse JSON response: ${_}`),this.debugLog("\uD83D\uDD04 Attempting fallback to pipe-separated format..."),{overview:null,summaries:this.extractLegacyPipeSeparatedLines(q).map((Y,f)=>{let P=Y.split(" | ");return{text:P[0]||"",document_id:P[1]||`legacy_${Date.now()}_${f}`,keywords:P[2]||"",timestamp:P[3]||new Date().toISOString(),archive:P[4]||`legacy_${Date.now()}_${f}.jsonl.archive`}})}}}extractLegacyPipeSeparatedLines(q){let _=q.split(`
|
||
`),j=[];return _.forEach((K)=>{let Y=K.trim();if(Y&&Y.includes(" | ")&&Y.split(" | ").length>=3)j.push(Y)}),this.debugLog(`\uD83D\uDCCA Fallback extracted ${j.length} pipe-separated lines`),j}async compressInChunks(q,_,j){this.debugLog("\uD83D\uDCE6 Large transcript detected, processing in chunks...");let K=[];q.forEach((w,O)=>{let z=this.extractContent(w).replace(/\r\n/g,"\\n").replace(/\n/g,"\\n").replace(/\r/g,"\\n");K.push(`- ${z}`)});let Y=K.join(`
|
||
`),f=this.chunkManager.chunkTranscript(Y);this.debugLog(this.chunkManager.getChunkingStats(f)),console.log(`
|
||
\uD83D\uDCCA Processing ${f.length} chunks...`);let P=[];for(let w=0;w<f.length;w++){let O=f[w];console.log(`
|
||
\uD83D\uDD04 Processing chunk ${w+1}/${f.length}...`);let v=`Analyze this chunk (${w+1}/${f.length}) of a larger conversation transcript.
|
||
|
||
${O.metadata.hasOverlap?`Note: This chunk includes ${O.metadata.overlapMessages||2} messages from the previous chunk for context continuity.`:""}
|
||
|
||
Chunk contains messages ${O.metadata.startIndex+1} to ${O.metadata.endIndex+1}.
|
||
|
||
${O.content}`,z=this.promptOrchestrator.createAnalysisPrompt({transcriptContent:v,sessionId:_,projectName:j,trigger:"manual",originalTokens:O.metadata.estimatedTokens}),W=Tq(),J=this.findMCPConfig();if(J)t8.debug(u_.MCP_CONFIG_USED(J));let T=await lq({prompt:z.prompt,options:{allowedTools:["mcp__claude-mem__chroma_list_collections","mcp__claude-mem__chroma_create_collection","mcp__claude-mem__chroma_peek_collection","mcp__claude-mem__chroma_get_collection_info","mcp__claude-mem__chroma_get_collection_count","mcp__claude-mem__chroma_modify_collection","mcp__claude-mem__chroma_fork_collection","mcp__claude-mem__chroma_delete_collection","mcp__claude-mem__chroma_add_documents","mcp__claude-mem__chroma_query_documents","mcp__claude-mem__chroma_get_documents","mcp__claude-mem__chroma_update_documents","mcp__claude-mem__chroma_delete_documents"],pathToClaudeCodeExecutable:Tq()}}),H=await this.extractResponseContent(T,[]),X=this.extractJSONResponse(H);if(X.summaries.length>0)console.log(` ✅ Extracted ${X.summaries.length} memories from chunk ${w+1}`),P.push(...X.summaries);else console.log(` ⚠️ No memories extracted from chunk ${w+1}`)}console.log(`
|
||
\uD83D\uDCDD Generating overview from ${P.length} extracted memories...`);let $=await this.generateOverviewFromMemories(j,_,P);return{summaries:P,overview:$}}async generateOverviewFromMemories(q,_,j){try{let K=j.map((w)=>w.text||w).filter(Boolean);if(K.length===0)return console.log(" ⚠️ No memories available to generate overview"),null;let Y=`You have just analyzed a long conversation and extracted ${K.length} key memories.
|
||
Based on these memories, create a comprehensive overview of the entire session.
|
||
|
||
MEMORIES EXTRACTED:
|
||
${K.map((w,O)=>`${O+1}. ${w}`).join(`
|
||
`)}
|
||
|
||
PROJECT: ${q}
|
||
SESSION: ${_}
|
||
|
||
Create a 2-3 sentence overview that:
|
||
1. Summarizes the main themes and accomplishments across ALL the memories
|
||
2. Highlights the most significant technical work or decisions
|
||
3. Written for any developer to understand (define jargon organically)
|
||
|
||
Return ONLY the overview text, nothing else.`,f=await lq({prompt:Y,options:{allowedTools:[],pathToClaudeCodeExecutable:Tq()}}),P="";if(f&&typeof f==="object"&&Symbol.asyncIterator in f)for await(let w of f){let O=this.extractMessageContent(w);if(P+=O,w?.type==="result"&&w?.result)P=w.result}else if(typeof f==="string")P=f;else if(f?.text)P=f.text;else if(f?.content)P=f.content;let $=P.trim();if($)return console.log(" ✅ Overview generated successfully"),$;else return console.log(" ⚠️ No overview generated"),null}catch(K){return console.error(` ❌ Failed to generate overview: ${K}`),this.debugLog(`❌ Overview generation error: ${K}`),null}}formatConversationForPrompt(q){let _=[];return q.forEach((j,K)=>{let Y=j.type==="assistant"?"assistant":j.type==="user"?"user":j.type==="result"||j.type==="system"||j.type==="summary"?"system":j.message?.role||j.role,f=this.extractContent(j),P=j.session_id||"",$=this.normalizeTimestamp(j),w=j.uuid||"",v=`${f.replace(/\|/g,"\\|")} | ${P} | ${Y} | ${$} | ${w}`;_.push(v)}),t8.debug(`Field filtering complete: ${_.length} messages processed`),`<!-- TRANSCRIPT -->
|
||
${_.join(`
|
||
`)}
|
||
<!-- /TRANSCRIPT -->`}extractContent(q){let _="";if(q.type==="tool_result")return this.extractToolResultContent(q);if(q.type==="assistant"||q.type==="user"){let j=q.message?.content;if(Array.isArray(j))_=j.map((K)=>this.extractContentItem(K)).filter(Boolean).join(" ");else if(j)_=String(j).trim()}else if(q.type==="summary")_=q.summary||"";else if(q.type==="result"){if(q.subtype==="success"&&q.result)_=`[Result: ${q.result}]`;else if(q.subtype==="error_max_turns")_="[Error: Maximum turns reached]";else if(q.subtype==="error_during_execution")_="[Error during execution]"}else if(q.type==="system")if(q.subtype==="init")_=`[System initialized: ${q.model}, tools: ${q.tools?.length||0}, MCP servers: ${q.mcp_servers?.length||0}]`;else _=String(q.content||"").trim();if(!_){if(_=String(q.message?.content||q.content||""),Array.isArray(_))_=_.map((j)=>j.text||j.content||"").filter(Boolean).join(" ")}if(q.toolUseResult){let j=this.summarizeToolResult(q.toolUseResult,_);if(j)_=_?`${_}
|
||
|
||
${j}`:j}return String(_).trim()}extractContentItem(q){if(!q||typeof q!=="object")return String(q||"").trim();if(q.type==="text")return q.text||"";else if(q.type==="thinking")return q.thinking||"";else if(q.type==="tool_use"){let _=q.name||"unknown",j=q.id||"";return`[Tool: ${_}${j?` (${j})`:""}]`}else if(q.type==="tool_result"){let _=this.getToolResultSize(q);if(_>1048576)return`[FILTERED: Large tool result ~${Math.round(_/1048576*10)/10}MB - tool output to assistant]`;return this.extractToolResultFromItem(q)}else return q.text||q.content||q.thinking||JSON.stringify(q)}getToolResultSize(q){if(!q.content)return 0;if(Array.isArray(q.content))return q.content.reduce((_,j)=>{return _+(j.text_length||j.text?.length||j.content?.length||0)},0);if(typeof q.content==="string")return q.content.length;return JSON.stringify(q.content).length}extractToolResultContent(q){if(q.content&&Array.isArray(q.content)){let j=q.content.reduce((K,Y)=>{return K+(Y.text_length||Y.text?.length||0)},0);if(j>1048576)return`[FILTERED: Large tool result ~${Math.round(j/1048576*10)/10}MB - tool output to assistant]`;return q.content.map((K)=>this.extractToolResultFromItem(K)).filter(Boolean).join(" ")}if(q.content&&typeof q.content==="string"&&q.content.length>1048576)return`[FILTERED: Large tool result ~${Math.round(q.content.length/1048576*10)/10}MB - tool output to assistant]`;return this.extractToolResultFromItem(q)}extractToolResultFromItem(q){if(q.type==="text"&&q.text)return q.text;if(!q.content)return"[Tool result: no content]";if(Array.isArray(q.content))return q.content.map((_)=>{if(_.type==="text"&&_.text)return _.text;return _.text||_.content||""}).filter(Boolean).join(" ");if(typeof q.content==="string")return q.content;if(typeof q.content==="object")return q.content.text||q.content.content||"[Tool result: complex object]";return String(q.content||"")}createMessageFlowLabel(q,_){if(this.messageContainsToolResult(q))return`Message ${_} (tool → assistant)`;switch(q.type){case"user":return`Message ${_} (user → assistant)`;case"assistant":return`Message ${_} (assistant → user)`;case"system":return`Message ${_} (system)`;case"tool_result":return`Message ${_} (tool → assistant)`;case"summary":return`Message ${_} (session summary)`;case"result":if(q.subtype==="success")return`Message ${_} (session result)`;else if(q.subtype==="error_max_turns")return`Message ${_} (session error: max turns)`;else if(q.subtype==="error_during_execution")return`Message ${_} (session error: execution)`;return`Message ${_} (session result)`;default:return`Message ${_} (${q.type})`}}messageContainsToolResult(q){if(q.type==="user"&&q.message?.content&&Array.isArray(q.message.content))return q.message.content.some((_)=>_.type==="tool_result");if(q.type==="tool_result")return!0;if(q.content&&Array.isArray(q.content))return q.content.some((_)=>_.type==="tool_result");return!1}showFilteredOutput(q,_=!0){let K=n6.readFileSync(q,"utf-8").trim().split(`
|
||
`).filter((v)=>v.trim()),Y=[];for(let v of K)try{let z=JSON.parse(v);Y.push(z)}catch(z){continue}let f=[],P=Y.length>0?this.normalizeTimestamp(Y[0]):"",$=Y.length>0?this.normalizeTimestamp(Y[Y.length-1]):"";Y.forEach((v,z)=>{let J=this.extractContent(v).replace(/\r\n/g,"\\n").replace(/\n/g,"\\n").replace(/\r/g,"\\n");f.push(`- ${J}`)});let w=f.join(`
|
||
`),O=`/tmp/filtered-transcript-${Date.now()}`;if(_&&this.chunkManager.needsChunking(w)){console.log(`
|
||
\uD83D\uDCE6 Large transcript detected, chunking output...`);let v=this.chunkManager.chunkTranscript(w);console.log(this.chunkManager.getChunkingStats(v)),v.forEach((z,W)=>{let J=`${O}-chunk-${W+1}.txt`,T=z.metadata.startIndex,H=Math.min(z.metadata.endIndex,Y.length-1),X=Y[T]?this.normalizeTimestamp(Y[T]):"",A=Y[H]?this.normalizeTimestamp(Y[H]):"";z.metadata.firstTimestamp=X,z.metadata.lastTimestamp=A;let G=this.chunkManager.createChunkHeader(z.metadata)+z.content;n6.writeFileSync(J,G,"utf-8"),console.log(` ✅ Chunk ${W+1}/${v.length} saved to: ${J}`)}),console.log(`Processed ${Y.length} messages from transcript into ${v.length} chunks`),console.log(`\uD83D\uDCC5 Time range: ${P} to ${$}`)}else{let v=`${O}.txt`,z=`# ${P} to ${$}
|
||
${w}`;n6.writeFileSync(v,z,"utf-8"),console.log(`
|
||
Filtered output saved to: ${v}`),console.log(`Processed ${Y.length} messages from transcript`),console.log(`\uD83D\uDCC5 Time range: ${P} to ${$}`)}}summarizeToolResult(q,_){let j=[];if(q.stdout){let K=String(q.stdout);if(K.length>200){let Y=K.split(`
|
||
`).length,f=K.length,P=K.split(`
|
||
`),$=P.slice(0,3).join(`
|
||
`),w=P.length>6?`
|
||
...
|
||
${P.slice(-2).join(`
|
||
`)}`:"";j.push(`Result: ${$}${w} (${Y} lines, ${f} chars)`)}else j.push(`Result: ${K}`)}if(q.stderr&&q.stderr.trim())j.push(`Error: ${q.stderr}`);if(q.interrupted)j.push("(interrupted)");if(q.isImage)j.push("(image output)");return j.join(`
|
||
`)}normalizeTimestamp(q){let _=q.timestamp||q.message?.timestamp||q.created_at||q.message?.created_at;if(!_)return"";try{let j=new Date(_);if(isNaN(j.getTime()))return"";return j.toISOString().replace("T"," ")}catch(j){return t8.debug(`Invalid timestamp format: ${_}`),""}}createArchive(q,_,j,K){let Y=this.paths.getProjectArchiveDir(_);xq.ensureDirectory(Y);let f=h2(Y,`${j}.jsonl.archive`);return n6.writeFileSync(f,K),t8.debug(`\uD83D\uDCE6 Created archive: ${f}`),f}appendToIndex(q,_,j,K,Y,f,P){let $=this.paths.getIndexPath(),w=this.paths.getConfigDir();xq.ensureDirectory(w);let O={type:"session",session_id:K,timestamp:P,project:j};if(n6.appendFileSync($,JSON.stringify(O)+`
|
||
`),_){let v={type:"overview",content:_,session_id:K,project:j,timestamp:P};n6.appendFileSync($,JSON.stringify(v)+`
|
||
`)}if(!q||q.length===0){t8.debug("\uD83D\uDCDD No summaries extracted from JSON response");let v={type:"diagnostic",message:"NO SUMMARIES EXTRACTED - Check logs for valid JSON response",session_id:K,project:j,timestamp:P};n6.appendFileSync($,JSON.stringify(v)+`
|
||
`),this.debugLog(`⚠️ No summaries for session ${K} - Check if Claude returned valid JSON in <JSONResponse> tags`)}else q.forEach((v)=>{let z={type:"memory",text:v.text,document_id:v.document_id,keywords:v.keywords,session_id:K,project:j,timestamp:v.timestamp||P,archive:v7.basename(f)};n6.appendFileSync($,JSON.stringify(z)+`
|
||
`)}),t8.debug(`\uD83D\uDCDD Appended ${q.length} summaries to index as JSONL`);t8.debug(`Index path: ${$}`)}}var W7=K6(()=>{F3();I4();l6();LP();pP();xP();z7()});var iP={};tq(iP,{compress:()=>kK});import{basename as rP}from"path";async function kK(q,_={}){if(console.log(I5("compressing")),!q){console.log(c_("Compression","No transcript file provided","Please provide a path to a transcript file"));return}try{let j=Date.now(),{TranscriptCompressor:K}=await Promise.resolve().then(() => (W7(),cP)),Y=new K({verbose:_.verbose||!1}),f=_.sessionId||rP(q,".jsonl"),P=await Y.compress(q,f),$=Date.now()-j;console.log(n3("Compression",void 0,`Session archived as ${rP(P)}`)),console.log(y5("compress",{count:1,duration:$,details:`Session: ${f}`}))}catch(j){let K=j instanceof Error?j.message:String(j);throw console.log(c_("Compression",K,"Check that the transcript file exists and you have write permissions")),j}}var H7=K6(()=>{Z4()});var V2=_8((qM,oP)=>{var C2={to(q,_){if(!_)return`\x1B[${q+1}G`;return`\x1B[${_+1};${q+1}H`},move(q,_){let j="";if(q<0)j+=`\x1B[${-q}D`;else if(q>0)j+=`\x1B[${q}C`;if(_<0)j+=`\x1B[${-_}A`;else if(_>0)j+=`\x1B[${_}B`;return j},up:(q=1)=>`\x1B[${q}A`,down:(q=1)=>`\x1B[${q}B`,forward:(q=1)=>`\x1B[${q}C`,backward:(q=1)=>`\x1B[${q}D`,nextLine:(q=1)=>"\x1B[E".repeat(q),prevLine:(q=1)=>"\x1B[F".repeat(q),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},tX={up:(q=1)=>"\x1B[S".repeat(q),down:(q=1)=>"\x1B[T".repeat(q)},eX={screen:"\x1B[2J",up:(q=1)=>"\x1B[1J".repeat(q),down:(q=1)=>"\x1B[J".repeat(q),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(q){let _="";for(let j=0;j<q;j++)_+=this.line+(j<q-1?C2.up():"");if(q)_+=C2.left;return _}};oP.exports={cursor:C2,scroll:tX,erase:eX,beep:"\x07"}});var N2=_8((_M,M2)=>{var T7=process||{},aP=T7.argv||[],J7=T7.env||{},FX=!(!!J7.NO_COLOR||aP.includes("--no-color"))&&(!!J7.FORCE_COLOR||aP.includes("--color")||T7.platform==="win32"||(T7.stdout||{}).isTTY&&J7.TERM!=="dumb"||!!J7.CI),UX=(q,_,j=q)=>(K)=>{let Y=""+K,f=Y.indexOf(_,q.length);return~f?q+sX(Y,_,j,f)+_:q+Y+_},sX=(q,_,j,K)=>{let Y="",f=0;do Y+=q.substring(f,K)+j,f=K+_.length,K=q.indexOf(_,f);while(~K);return Y+q.substring(f)},BP=(q=FX)=>{let _=q?UX:()=>String;return{isColorSupported:q,reset:_("\x1B[0m","\x1B[0m"),bold:_("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:_("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:_("\x1B[3m","\x1B[23m"),underline:_("\x1B[4m","\x1B[24m"),inverse:_("\x1B[7m","\x1B[27m"),hidden:_("\x1B[8m","\x1B[28m"),strikethrough:_("\x1B[9m","\x1B[29m"),black:_("\x1B[30m","\x1B[39m"),red:_("\x1B[31m","\x1B[39m"),green:_("\x1B[32m","\x1B[39m"),yellow:_("\x1B[33m","\x1B[39m"),blue:_("\x1B[34m","\x1B[39m"),magenta:_("\x1B[35m","\x1B[39m"),cyan:_("\x1B[36m","\x1B[39m"),white:_("\x1B[37m","\x1B[39m"),gray:_("\x1B[90m","\x1B[39m"),bgBlack:_("\x1B[40m","\x1B[49m"),bgRed:_("\x1B[41m","\x1B[49m"),bgGreen:_("\x1B[42m","\x1B[49m"),bgYellow:_("\x1B[43m","\x1B[49m"),bgBlue:_("\x1B[44m","\x1B[49m"),bgMagenta:_("\x1B[45m","\x1B[49m"),bgCyan:_("\x1B[46m","\x1B[49m"),bgWhite:_("\x1B[47m","\x1B[49m"),blackBright:_("\x1B[90m","\x1B[39m"),redBright:_("\x1B[91m","\x1B[39m"),greenBright:_("\x1B[92m","\x1B[39m"),yellowBright:_("\x1B[93m","\x1B[39m"),blueBright:_("\x1B[94m","\x1B[39m"),magentaBright:_("\x1B[95m","\x1B[39m"),cyanBright:_("\x1B[96m","\x1B[39m"),whiteBright:_("\x1B[97m","\x1B[39m"),bgBlackBright:_("\x1B[100m","\x1B[49m"),bgRedBright:_("\x1B[101m","\x1B[49m"),bgGreenBright:_("\x1B[102m","\x1B[49m"),bgYellowBright:_("\x1B[103m","\x1B[49m"),bgBlueBright:_("\x1B[104m","\x1B[49m"),bgMagentaBright:_("\x1B[105m","\x1B[49m"),bgCyanBright:_("\x1B[106m","\x1B[49m"),bgWhiteBright:_("\x1B[107m","\x1B[49m")}};M2.exports=BP();M2.exports.createColors=BP});import{stdin as jY,stdout as PY}from"node:process";import*as __ from"node:readline";import tP from"node:readline";import{Writable as QX}from"node:stream";function qA({onlyFirst:q=!1}={}){let _=["[\\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(_,q?void 0:"g")}function fY(q){if(typeof q!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(_A,"")}function $Y(q){return q&&q.__esModule&&Object.prototype.hasOwnProperty.call(q,"default")?q.default:q}function Y3(q,_={}){if(typeof q!="string"||q.length===0||(_={ambiguousIsNarrow:!0,..._},q=fY(q),q.length===0))return 0;q=q.replace(YA()," ");let j=_.ambiguousIsNarrow?1:2,K=0;for(let Y of q){let f=Y.codePointAt(0);if(f<=31||f>=127&&f<=159||f>=768&&f<=879)continue;switch(jA.eastAsianWidth(Y)){case"F":case"W":K+=2;break;case"A":K+=j;break;default:K+=1}}return K}function wA(){let q=new Map;for(let[_,j]of Object.entries(L8)){for(let[K,Y]of Object.entries(j))L8[K]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},j[K]=L8[K],q.set(Y[0],Y[1]);Object.defineProperty(L8,_,{value:j,enumerable:!1})}return Object.defineProperty(L8,"codes",{value:q,enumerable:!1}),L8.color.close="\x1B[39m",L8.bgColor.close="\x1B[49m",L8.color.ansi=eP(),L8.color.ansi256=FP(),L8.color.ansi16m=UP(),L8.bgColor.ansi=eP(b2),L8.bgColor.ansi256=FP(b2),L8.bgColor.ansi16m=UP(b2),Object.defineProperties(L8,{rgbToAnsi256:{value:(_,j,K)=>_===j&&j===K?_<8?16:_>248?231:Math.round((_-8)/247*24)+232:16+36*Math.round(_/255*5)+6*Math.round(j/255*5)+Math.round(K/255*5),enumerable:!1},hexToRgb:{value:(_)=>{let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;K.length===3&&(K=[...K].map((f)=>f+f).join(""));let Y=Number.parseInt(K,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(_)=>L8.rgbToAnsi256(...L8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value:(_)=>{if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,Y;if(_>=232)j=((_-232)*10+8)/255,K=j,Y=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,Y=$%6/5}let f=Math.max(j,K,Y)*2;if(f===0)return 30;let P=30+(Math.round(Y)<<2|Math.round(K)<<1|Math.round(j));return f===2&&(P+=60),P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>L8.ansi256ToAnsi(L8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>L8.ansi256ToAnsi(L8.hexToAnsi256(_)),enumerable:!1}}),L8}function qY(q,_,j){return String(q).normalize().replace(/\r\n/g,`
|
||
`).split(`
|
||
`).map((K)=>JA(K,_,j)).join(`
|
||
`)}function I2(q,_){if(typeof q=="string")return k7.aliases.get(q)===_;for(let j of q)if(j!==void 0&&I2(j,_))return!0;return!1}function ZA(q,_){if(q===_)return;let j=q.split(`
|
||
`),K=_.split(`
|
||
`),Y=[];for(let f=0;f<Math.max(j.length,K.length);f++)j[f]!==K[f]&&Y.push(f);return Y}function p8(q){return q===E2}function Z7(q,_){let j=q;j.isTTY&&j.setRawMode(_)}function vY({input:q=jY,output:_=PY,overwrite:j=!0,hideCursor:K=!0}={}){let Y=__.createInterface({input:q,output:_,prompt:"",tabSize:1});__.emitKeypressEvents(q,Y),q.isTTY&&q.setRawMode(!0);let f=(P,{name:$,sequence:w})=>{let O=String(P);if(I2([O,$,w],"cancel")){K&&_.write(G6.cursor.show),process.exit(0);return}if(!j)return;__.moveCursor(_,$==="return"?0:-1,$==="return"?-1:0,()=>{__.clearLine(_,1,()=>{q.once("keypress",f)})})};return K&&_.write(G6.cursor.hide),q.once("keypress",f),()=>{q.off("keypress",f),K&&_.write(G6.cursor.show),q.isTTY&&!kA&&q.setRawMode(!1),Y.terminal=!1,Y.close()}}class f3{constructor(q,_=!0){c6(this,"input"),c6(this,"output"),c6(this,"_abortSignal"),c6(this,"rl"),c6(this,"opts"),c6(this,"_render"),c6(this,"_track",!1),c6(this,"_prevFrame",""),c6(this,"_subscribers",new Map),c6(this,"_cursor",0),c6(this,"state","initial"),c6(this,"error",""),c6(this,"value");let{input:j=jY,output:K=PY,render:Y,signal:f,...P}=q;this.opts=P,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=Y.bind(this),this._track=_,this._abortSignal=f,this.input=j,this.output=K}unsubscribe(){this._subscribers.clear()}setSubscriber(q,_){let j=this._subscribers.get(q)??[];j.push(_),this._subscribers.set(q,j)}on(q,_){this.setSubscriber(q,{cb:_})}once(q,_){this.setSubscriber(q,{cb:_,once:!0})}emit(q,..._){let j=this._subscribers.get(q)??[],K=[];for(let Y of j)Y.cb(..._),Y.once&&K.push(()=>j.splice(j.indexOf(Y),1));for(let Y of K)Y()}prompt(){return new Promise((q,_)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),q(E2);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let j=new QX;j._write=(K,Y,f)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),f()},this.input.pipe(j),this.rl=tP.createInterface({input:this.input,output:j,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),tP.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),Z7(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(G6.cursor.show),this.output.off("resize",this.render),Z7(this.input,!1),q(this.value)}),this.once("cancel",()=>{this.output.write(G6.cursor.show),this.output.off("resize",this.render),Z7(this.input,!1),q(E2)})})}onKeypress(q,_){if(this.state==="error"&&(this.state="active"),_?.name&&(!this._track&&k7.aliases.has(_.name)&&this.emit("cursor",k7.aliases.get(_.name)),k7.actions.has(_.name)&&this.emit("cursor",_.name)),q&&(q.toLowerCase()==="y"||q.toLowerCase()==="n")&&this.emit("confirm",q.toLowerCase()==="y"),q==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),q&&this.emit("key",q.toLowerCase()),_?.name==="return"){if(this.opts.validate){let j=this.opts.validate(this.value);j&&(this.error=j instanceof Error?j.message:j,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}I2([q,_?.name,_?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
||
`),Z7(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let q=qY(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
||
`).length-1;this.output.write(G6.cursor.move(-999,q*-1))}render(){let q=qY(this._render(this)??"",process.stdout.columns,{hard:!0});if(q!==this._prevFrame){if(this.state==="initial")this.output.write(G6.cursor.hide);else{let _=ZA(this._prevFrame,q);if(this.restoreCursor(),_&&_?.length===1){let j=_[0];this.output.write(G6.cursor.move(0,j)),this.output.write(G6.erase.lines(1));let K=q.split(`
|
||
`);this.output.write(K[j]),this._prevFrame=q,this.output.write(G6.cursor.move(0,K.length-j-1));return}if(_&&_?.length>1){let j=_[0];this.output.write(G6.cursor.move(0,j)),this.output.write(G6.erase.down());let K=q.split(`
|
||
`).slice(j);this.output.write(K.join(`
|
||
`)),this._prevFrame=q;return}this.output.write(G6.erase.down())}this.output.write(q),this.state==="initial"&&(this.state="active"),this._prevFrame=q}}}var G6,YY,_A,wY,KA,jA,PA=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},YA,b2=10,eP=(q=0)=>(_)=>`\x1B[${_+q}m`,FP=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,UP=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,L8,fA,$A,OA,X7,zA=39,R2="\x07",OY="[",vA="]",zY="m",m2,sP=(q)=>`${X7.values().next().value}${OY}${q}${zY}`,QP=(q)=>`${X7.values().next().value}${m2}${q}${R2}`,WA=(q)=>q.split(" ").map((_)=>Y3(_)),S2=(q,_,j)=>{let K=[..._],Y=!1,f=!1,P=Y3(fY(q[q.length-1]));for(let[$,w]of K.entries()){let O=Y3(w);if(P+O<=j?q[q.length-1]+=w:(q.push(w),P=0),X7.has(w)&&(Y=!0,f=K.slice($+1).join("").startsWith(m2)),Y){f?w===R2&&(Y=!1,f=!1):w===zY&&(Y=!1);continue}P+=O,P===j&&$<K.length-1&&(q.push(""),P=0)}!P&&q[q.length-1].length>0&&q.length>1&&(q[q.length-2]+=q.pop())},HA=(q)=>{let _=q.split(" "),j=_.length;for(;j>0&&!(Y3(_[j-1])>0);)j--;return j===_.length?q:_.slice(0,j).join(" ")+_.slice(j).join("")},JA=(q,_,j={})=>{if(j.trim!==!1&&q.trim()==="")return"";let K="",Y,f,P=WA(q),$=[""];for(let[O,v]of q.split(" ").entries()){j.trim!==!1&&($[$.length-1]=$[$.length-1].trimStart());let z=Y3($[$.length-1]);if(O!==0&&(z>=_&&(j.wordWrap===!1||j.trim===!1)&&($.push(""),z=0),(z>0||j.trim===!1)&&($[$.length-1]+=" ",z++)),j.hard&&P[O]>_){let W=_-z,J=1+Math.floor((P[O]-W-1)/_);Math.floor((P[O]-1)/_)<J&&$.push(""),S2($,v,_);continue}if(z+P[O]>_&&z>0&&P[O]>0){if(j.wordWrap===!1&&z<_){S2($,v,_);continue}$.push("")}if(z+P[O]>_&&j.wordWrap===!1){S2($,v,_);continue}$[$.length-1]+=v}j.trim!==!1&&($=$.map((O)=>HA(O)));let w=[...$.join(`
|
||
`)];for(let[O,v]of w.entries()){if(K+=v,X7.has(v)){let{groups:W}=new RegExp(`(?:\\${OY}(?<code>\\d+)m|\\${m2}(?<uri>.*)${R2})`).exec(w.slice(O).join(""))||{groups:{}};if(W.code!==void 0){let J=Number.parseFloat(W.code);Y=J===zA?void 0:J}else W.uri!==void 0&&(f=W.uri.length===0?void 0:W.uri)}let z=OA.codes.get(Number(Y));w[O+1]===`
|
||
`?(f&&(K+=QP("")),Y&&z&&(K+=sP(z))):v===`
|
||
`&&(Y&&z&&(K+=sP(Y)),f&&(K+=QP(f)))}return K},TA,k7,kA,E2,XA,AA=(q,_,j)=>(_ in q)?XA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,c6=(q,_,j)=>(AA(q,typeof _!="symbol"?_+"":_,j),j),g2,GA,uA,DA=(q,_,j)=>(_ in q)?uA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,_Y=(q,_,j)=>(DA(q,typeof _!="symbol"?_+"":_,j),j),WY,hA,CA=(q,_,j)=>(_ in q)?hA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,KY=(q,_,j)=>(CA(q,typeof _!="symbol"?_+"":_,j),j),y2,d2;var L2=K6(()=>{G6=Oq(V2(),1),YY=Oq(N2(),1);_A=qA();wY={exports:{}};(function(q){var _={};q.exports=_,_.eastAsianWidth=function(K){var Y=K.charCodeAt(0),f=K.length==2?K.charCodeAt(1):0,P=Y;return 55296<=Y&&Y<=56319&&56320<=f&&f<=57343&&(Y&=1023,f&=1023,P=Y<<10|f,P+=65536),P==12288||65281<=P&&P<=65376||65504<=P&&P<=65510?"F":P==8361||65377<=P&&P<=65470||65474<=P&&P<=65479||65482<=P&&P<=65487||65490<=P&&P<=65495||65498<=P&&P<=65500||65512<=P&&P<=65518?"H":4352<=P&&P<=4447||4515<=P&&P<=4519||4602<=P&&P<=4607||9001<=P&&P<=9002||11904<=P&&P<=11929||11931<=P&&P<=12019||12032<=P&&P<=12245||12272<=P&&P<=12283||12289<=P&&P<=12350||12353<=P&&P<=12438||12441<=P&&P<=12543||12549<=P&&P<=12589||12593<=P&&P<=12686||12688<=P&&P<=12730||12736<=P&&P<=12771||12784<=P&&P<=12830||12832<=P&&P<=12871||12880<=P&&P<=13054||13056<=P&&P<=19903||19968<=P&&P<=42124||42128<=P&&P<=42182||43360<=P&&P<=43388||44032<=P&&P<=55203||55216<=P&&P<=55238||55243<=P&&P<=55291||63744<=P&&P<=64255||65040<=P&&P<=65049||65072<=P&&P<=65106||65108<=P&&P<=65126||65128<=P&&P<=65131||110592<=P&&P<=110593||127488<=P&&P<=127490||127504<=P&&P<=127546||127552<=P&&P<=127560||127568<=P&&P<=127569||131072<=P&&P<=194367||177984<=P&&P<=196605||196608<=P&&P<=262141?"W":32<=P&&P<=126||162<=P&&P<=163||165<=P&&P<=166||P==172||P==175||10214<=P&&P<=10221||10629<=P&&P<=10630?"Na":P==161||P==164||167<=P&&P<=168||P==170||173<=P&&P<=174||176<=P&&P<=180||182<=P&&P<=186||188<=P&&P<=191||P==198||P==208||215<=P&&P<=216||222<=P&&P<=225||P==230||232<=P&&P<=234||236<=P&&P<=237||P==240||242<=P&&P<=243||247<=P&&P<=250||P==252||P==254||P==257||P==273||P==275||P==283||294<=P&&P<=295||P==299||305<=P&&P<=307||P==312||319<=P&&P<=322||P==324||328<=P&&P<=331||P==333||338<=P&&P<=339||358<=P&&P<=359||P==363||P==462||P==464||P==466||P==468||P==470||P==472||P==474||P==476||P==593||P==609||P==708||P==711||713<=P&&P<=715||P==717||P==720||728<=P&&P<=731||P==733||P==735||768<=P&&P<=879||913<=P&&P<=929||931<=P&&P<=937||945<=P&&P<=961||963<=P&&P<=969||P==1025||1040<=P&&P<=1103||P==1105||P==8208||8211<=P&&P<=8214||8216<=P&&P<=8217||8220<=P&&P<=8221||8224<=P&&P<=8226||8228<=P&&P<=8231||P==8240||8242<=P&&P<=8243||P==8245||P==8251||P==8254||P==8308||P==8319||8321<=P&&P<=8324||P==8364||P==8451||P==8453||P==8457||P==8467||P==8470||8481<=P&&P<=8482||P==8486||P==8491||8531<=P&&P<=8532||8539<=P&&P<=8542||8544<=P&&P<=8555||8560<=P&&P<=8569||P==8585||8592<=P&&P<=8601||8632<=P&&P<=8633||P==8658||P==8660||P==8679||P==8704||8706<=P&&P<=8707||8711<=P&&P<=8712||P==8715||P==8719||P==8721||P==8725||P==8730||8733<=P&&P<=8736||P==8739||P==8741||8743<=P&&P<=8748||P==8750||8756<=P&&P<=8759||8764<=P&&P<=8765||P==8776||P==8780||P==8786||8800<=P&&P<=8801||8804<=P&&P<=8807||8810<=P&&P<=8811||8814<=P&&P<=8815||8834<=P&&P<=8835||8838<=P&&P<=8839||P==8853||P==8857||P==8869||P==8895||P==8978||9312<=P&&P<=9449||9451<=P&&P<=9547||9552<=P&&P<=9587||9600<=P&&P<=9615||9618<=P&&P<=9621||9632<=P&&P<=9633||9635<=P&&P<=9641||9650<=P&&P<=9651||9654<=P&&P<=9655||9660<=P&&P<=9661||9664<=P&&P<=9665||9670<=P&&P<=9672||P==9675||9678<=P&&P<=9681||9698<=P&&P<=9701||P==9711||9733<=P&&P<=9734||P==9737||9742<=P&&P<=9743||9748<=P&&P<=9749||P==9756||P==9758||P==9792||P==9794||9824<=P&&P<=9825||9827<=P&&P<=9829||9831<=P&&P<=9834||9836<=P&&P<=9837||P==9839||9886<=P&&P<=9887||9918<=P&&P<=9919||9924<=P&&P<=9933||9935<=P&&P<=9953||P==9955||9960<=P&&P<=9983||P==10045||P==10071||10102<=P&&P<=10111||11093<=P&&P<=11097||12872<=P&&P<=12879||57344<=P&&P<=63743||65024<=P&&P<=65039||P==65533||127232<=P&&P<=127242||127248<=P&&P<=127277||127280<=P&&P<=127337||127344<=P&&P<=127386||917760<=P&&P<=917999||983040<=P&&P<=1048573||1048576<=P&&P<=1114109?"A":"N"},_.characterLength=function(K){var Y=this.eastAsianWidth(K);return Y=="F"||Y=="W"||Y=="A"?2:1};function j(K){return K.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}_.length=function(K){for(var Y=j(K),f=0,P=0;P<Y.length;P++)f=f+this.characterLength(Y[P]);return f},_.slice=function(K,Y,f){textLen=_.length(K),Y=Y||0,f=f||1,Y<0&&(Y=textLen+Y),f<0&&(f=textLen+f);for(var P="",$=0,w=j(K),O=0;O<w.length;O++){var v=w[O],z=_.length(v);if($>=Y-(z==2?1:0))if($+z<=f)P+=v;else break;$+=z}return P}})(wY);KA=wY.exports,jA=$Y(KA),YA=$Y(PA);L8={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(L8.modifier);fA=Object.keys(L8.color),$A=Object.keys(L8.bgColor);[...fA];OA=wA(),X7=new Set(["\x1B",""]),m2=`${vA}8;;`;TA=["up","down","left","right","space","enter","cancel"],k7={actions:new Set(TA),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};kA=globalThis.process.platform.startsWith("win"),E2=Symbol("clack:cancel");XA=Object.defineProperty;g2=class g2 extends f3{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(q){super(q,!1),this.value=!!q.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(_)=>{this.output.write(G6.cursor.move(0,-1)),this.value=_,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};GA=new WeakMap;uA=Object.defineProperty,WY=class extends f3{constructor(q){super(q,!1),_Y(this,"options"),_Y(this,"cursor",0),this.options=q.options,this.value=[...q.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:_})=>_===q.cursorAt),0),this.on("key",(_)=>{_==="a"&&this.toggleAll()}),this.on("cursor",(_)=>{switch(_){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let q=this.value.length===this.options.length;this.value=q?[]:this.options.map((_)=>_.value)}toggleValue(){let q=this.value.includes(this._value);this.value=q?this.value.filter((_)=>_!==this._value):[...this.value,this._value]}},hA=Object.defineProperty;y2=class y2 extends f3{constructor(q){super(q,!1),KY(this,"options"),KY(this,"cursor",0),this.options=q.options,this.cursor=this.options.findIndex(({value:_})=>_===q.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(_)=>{switch(_){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};d2=class d2 extends f3{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;let q=this.value.slice(0,this.cursor),[_,...j]=this.value.slice(this.cursor);return`${q}${YY.default.inverse(_)}${j.join("")}`}get cursor(){return this._cursor}constructor(q){super(q),this.on("finalize",()=>{this.value||(this.value=q.defaultValue)})}}});import{stripVTControlCharacters as p2}from"node:util";import Zq from"node:process";function VA(){return Zq.platform!=="win32"?Zq.env.TERM!=="linux":!!Zq.env.CI||!!Zq.env.WT_SESSION||!!Zq.env.TERMINUS_SUBLIME||Zq.env.ConEmuTask==="{cmd::Cmder}"||Zq.env.TERM_PROGRAM==="Terminus-Sublime"||Zq.env.TERM_PROGRAM==="vscode"||Zq.env.TERM==="xterm-256color"||Zq.env.TERM==="alacritty"||Zq.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var a,A7,l2,U8=(q,_)=>l2?q:_,MA,TY,ZY,G7,NA,h8,K_,x2,n2,bA,HY,SA,JM,JY,EA,RA,mA,IA,gA,yA,dA,u7=(q)=>{switch(q){case"initial":case"active":return a.default.cyan(MA);case"cancel":return a.default.red(TY);case"error":return a.default.yellow(ZY);case"submit":return a.default.green(G7)}},c2=(q)=>{let{cursor:_,options:j,style:K}=q,Y=q.maxItems??Number.POSITIVE_INFINITY,f=Math.max(process.stdout.rows-4,0),P=Math.min(f,Math.max(Y,5)),$=0;_>=$+P-3?$=Math.max(Math.min(_-P+3,j.length-P),0):_<$+2&&($=Math.max(_-2,0));let w=P<j.length&&$>0,O=P<j.length&&$+P<j.length;return j.slice($,$+P).map((v,z,W)=>{let J=z===0&&w,T=z===W.length-1&&O;return J||T?a.default.dim("..."):K(v,z+$===_)})},h_=(q)=>new d2({validate:q.validate,placeholder:q.placeholder,defaultValue:q.defaultValue,initialValue:q.initialValue,render(){let _=`${a.default.gray(h8)}
|
||
${u7(this.state)} ${q.message}
|
||
`,j=q.placeholder?a.default.inverse(q.placeholder[0])+a.default.dim(q.placeholder.slice(1)):a.default.inverse(a.default.hidden("_")),K=this.value?this.valueWithCursor:j;switch(this.state){case"error":return`${_.trim()}
|
||
${a.default.yellow(h8)} ${K}
|
||
${a.default.yellow(K_)} ${a.default.yellow(this.error)}
|
||
`;case"submit":return`${_}${a.default.gray(h8)} ${a.default.dim(this.value||q.placeholder)}`;case"cancel":return`${_}${a.default.gray(h8)} ${a.default.strikethrough(a.default.dim(this.value??""))}${this.value?.trim()?`
|
||
${a.default.gray(h8)}`:""}`;default:return`${_}${a.default.cyan(h8)} ${K}
|
||
${a.default.cyan(K_)}
|
||
`}}}).prompt(),r6=(q)=>{let _=q.active??"Yes",j=q.inactive??"No";return new g2({active:_,inactive:j,initialValue:q.initialValue??!0,render(){let K=`${a.default.gray(h8)}
|
||
${u7(this.state)} ${q.message}
|
||
`,Y=this.value?_:j;switch(this.state){case"submit":return`${K}${a.default.gray(h8)} ${a.default.dim(Y)}`;case"cancel":return`${K}${a.default.gray(h8)} ${a.default.strikethrough(a.default.dim(Y))}
|
||
${a.default.gray(h8)}`;default:return`${K}${a.default.cyan(h8)} ${this.value?`${a.default.green(x2)} ${_}`:`${a.default.dim(n2)} ${a.default.dim(_)}`} ${a.default.dim("/")} ${this.value?`${a.default.dim(n2)} ${a.default.dim(j)}`:`${a.default.green(x2)} ${j}`}
|
||
${a.default.cyan(K_)}
|
||
`}}}).prompt()},T6=(q)=>{let _=(j,K)=>{let Y=j.label??String(j.value);switch(K){case"selected":return`${a.default.dim(Y)}`;case"active":return`${a.default.green(x2)} ${Y} ${j.hint?a.default.dim(`(${j.hint})`):""}`;case"cancelled":return`${a.default.strikethrough(a.default.dim(Y))}`;default:return`${a.default.dim(n2)} ${a.default.dim(Y)}`}};return new y2({options:q.options,initialValue:q.initialValue,render(){let j=`${a.default.gray(h8)}
|
||
${u7(this.state)} ${q.message}
|
||
`;switch(this.state){case"submit":return`${j}${a.default.gray(h8)} ${_(this.options[this.cursor],"selected")}`;case"cancel":return`${j}${a.default.gray(h8)} ${_(this.options[this.cursor],"cancelled")}
|
||
${a.default.gray(h8)}`;default:return`${j}${a.default.cyan(h8)} ${c2({cursor:this.cursor,options:this.options,maxItems:q.maxItems,style:(K,Y)=>_(K,Y?"active":"inactive")}).join(`
|
||
${a.default.cyan(h8)} `)}
|
||
${a.default.cyan(K_)}
|
||
`}}}).prompt()},r2=(q)=>{let _=(j,K)=>{let Y=j.label??String(j.value);return K==="active"?`${a.default.cyan(bA)} ${Y} ${j.hint?a.default.dim(`(${j.hint})`):""}`:K==="selected"?`${a.default.green(HY)} ${a.default.dim(Y)} ${j.hint?a.default.dim(`(${j.hint})`):""}`:K==="cancelled"?`${a.default.strikethrough(a.default.dim(Y))}`:K==="active-selected"?`${a.default.green(HY)} ${Y} ${j.hint?a.default.dim(`(${j.hint})`):""}`:K==="submitted"?`${a.default.dim(Y)}`:`${a.default.dim(SA)} ${a.default.dim(Y)}`};return new WY({options:q.options,initialValues:q.initialValues,required:q.required??!0,cursorAt:q.cursorAt,validate(j){if(this.required&&j.length===0)return`Please select at least one option.
|
||
${a.default.reset(a.default.dim(`Press ${a.default.gray(a.default.bgWhite(a.default.inverse(" space ")))} to select, ${a.default.gray(a.default.bgWhite(a.default.inverse(" enter ")))} to submit`))}`},render(){let j=`${a.default.gray(h8)}
|
||
${u7(this.state)} ${q.message}
|
||
`,K=(Y,f)=>{let P=this.value.includes(Y.value);return f&&P?_(Y,"active-selected"):P?_(Y,"selected"):_(Y,f?"active":"inactive")};switch(this.state){case"submit":return`${j}${a.default.gray(h8)} ${this.options.filter(({value:Y})=>this.value.includes(Y)).map((Y)=>_(Y,"submitted")).join(a.default.dim(", "))||a.default.dim("none")}`;case"cancel":{let Y=this.options.filter(({value:f})=>this.value.includes(f)).map((f)=>_(f,"cancelled")).join(a.default.dim(", "));return`${j}${a.default.gray(h8)} ${Y.trim()?`${Y}
|
||
${a.default.gray(h8)}`:""}`}case"error":{let Y=this.error.split(`
|
||
`).map((f,P)=>P===0?`${a.default.yellow(K_)} ${a.default.yellow(f)}`:` ${f}`).join(`
|
||
`);return`${j+a.default.yellow(h8)} ${c2({options:this.options,cursor:this.cursor,maxItems:q.maxItems,style:K}).join(`
|
||
${a.default.yellow(h8)} `)}
|
||
${Y}
|
||
`}default:return`${j}${a.default.cyan(h8)} ${c2({options:this.options,cursor:this.cursor,maxItems:q.maxItems,style:K}).join(`
|
||
${a.default.cyan(h8)} `)}
|
||
${a.default.cyan(K_)}
|
||
`}}}).prompt()},i2=(q="",_="")=>{let j=`
|
||
${q}
|
||
`.split(`
|
||
`),K=p2(_).length,Y=Math.max(j.reduce((P,$)=>{let w=p2($);return w.length>P?w.length:P},0),K)+2,f=j.map((P)=>`${a.default.gray(h8)} ${a.default.dim(P)}${" ".repeat(Y-p2(P).length)}${a.default.gray(h8)}`).join(`
|
||
`);process.stdout.write(`${a.default.gray(h8)}
|
||
${a.default.green(G7)} ${a.default.reset(_)} ${a.default.gray(JY.repeat(Math.max(Y-K-1,1))+EA)}
|
||
${f}
|
||
${a.default.gray(RA+JY.repeat(Y+2)+mA)}
|
||
`)},w6=(q="")=>{process.stdout.write(`${a.default.gray(K_)} ${a.default.red(q)}
|
||
|
||
`)},D7=(q="")=>{process.stdout.write(`${a.default.gray(NA)} ${q}
|
||
`)},kq=(q="")=>{process.stdout.write(`${a.default.gray(h8)}
|
||
${a.default.gray(K_)} ${q}
|
||
|
||
`)},P6,TM,Kq=({indicator:q="dots"}={})=>{let _=l2?["◒","◐","◓","◑"]:["•","o","O","0"],j=l2?80:120,K=process.env.CI==="true",Y,f,P=!1,$="",w,O=performance.now(),v=(M)=>{let I=M>1?"Something went wrong":"Canceled";P&&h(I,M)},z=()=>v(2),W=()=>v(1),J=()=>{process.on("uncaughtExceptionMonitor",z),process.on("unhandledRejection",z),process.on("SIGINT",W),process.on("SIGTERM",W),process.on("exit",v)},T=()=>{process.removeListener("uncaughtExceptionMonitor",z),process.removeListener("unhandledRejection",z),process.removeListener("SIGINT",W),process.removeListener("SIGTERM",W),process.removeListener("exit",v)},H=()=>{if(w===void 0)return;K&&process.stdout.write(`
|
||
`);let M=w.split(`
|
||
`);process.stdout.write(A7.cursor.move(-999,M.length-1)),process.stdout.write(A7.erase.down(M.length))},X=(M)=>M.replace(/\.+$/,""),A=(M)=>{let I=(performance.now()-M)/1000,N=Math.floor(I/60),R=Math.floor(I%60);return N>0?`[${N}m ${R}s]`:`[${R}s]`},G=(M="")=>{P=!0,Y=vY(),$=X(M),O=performance.now(),process.stdout.write(`${a.default.gray(h8)}
|
||
`);let I=0,N=0;J(),f=setInterval(()=>{if(K&&$===w)return;H(),w=$;let R=a.default.magenta(_[I]);if(K)process.stdout.write(`${R} ${$}...`);else if(q==="timer")process.stdout.write(`${R} ${$} ${A(O)}`);else{let l=".".repeat(Math.floor(N)).slice(0,3);process.stdout.write(`${R} ${$}${l}`)}I=I+1<_.length?I+1:0,N=N<_.length?N+0.125:0},j)},h=(M="",I=0)=>{P=!1,clearInterval(f),H();let N=I===0?a.default.green(G7):I===1?a.default.red(TY):a.default.red(ZY);$=X(M??$),q==="timer"?process.stdout.write(`${N} ${$} ${A(O)}
|
||
`):process.stdout.write(`${N} ${$}
|
||
`),T(),Y()};return{start:G,stop:h,message:(M="")=>{$=X(M??$)}}};var j_=K6(()=>{L2();L2();a=Oq(N2(),1),A7=Oq(V2(),1);l2=VA(),MA=U8("◆","*"),TY=U8("■","x"),ZY=U8("▲","x"),G7=U8("◇","o"),NA=U8("┌","T"),h8=U8("│","|"),K_=U8("└","—"),x2=U8("●",">"),n2=U8("○"," "),bA=U8("◻","[•]"),HY=U8("◼","[+]"),SA=U8("◻","[ ]"),JM=U8("▪","•"),JY=U8("─","-"),EA=U8("╮","+"),RA=U8("├","+"),mA=U8("╯","+"),IA=U8("●","•"),gA=U8("◆","*"),yA=U8("▲","!"),dA=U8("■","x"),P6={message:(q="",{symbol:_=a.default.gray(h8)}={})=>{let j=[`${a.default.gray(h8)}`];if(q){let[K,...Y]=q.split(`
|
||
`);j.push(`${_} ${K}`,...Y.map((f)=>`${a.default.gray(h8)} ${f}`))}process.stdout.write(`${j.join(`
|
||
`)}
|
||
`)},info:(q)=>{P6.message(q,{symbol:a.default.blue(IA)})},success:(q)=>{P6.message(q,{symbol:a.default.green(gA)})},step:(q)=>{P6.message(q,{symbol:a.default.green(G7)})},warn:(q)=>{P6.message(q,{symbol:a.default.yellow(yA)})},warning:(q)=>{P6.warn(q)},error:(q)=>{P6.message(q,{symbol:a.default.red(dA)})}},TM=`${a.default.gray(h8)} `});var bY=_8((e2,F2)=>{(function(q,_){typeof e2==="object"&&typeof F2!=="undefined"?F2.exports=_():typeof define==="function"&&define.amd?define(_):(q=typeof globalThis!=="undefined"?globalThis:q||self,q.tinycolor=_())})(e2,function(){function q(D){return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},q(D)}var _=/^\s+/,j=/\s+$/;function K(D,C){if(D=D?D:"",C=C||{},D instanceof K)return D;if(!(this instanceof K))return new K(D,C);var Z=Y(D);if(this._originalInput=D,this._r=Z.r,this._g=Z.g,this._b=Z.b,this._a=Z.a,this._roundA=Math.round(100*this._a)/100,this._format=C.format||Z.format,this._gradientType=C.gradientType,this._r<1)this._r=Math.round(this._r);if(this._g<1)this._g=Math.round(this._g);if(this._b<1)this._b=Math.round(this._b);this._ok=Z.ok}K.prototype={isDark:function D(){return this.getBrightness()<128},isLight:function D(){return!this.isDark()},isValid:function D(){return this._ok},getOriginalInput:function D(){return this._originalInput},getFormat:function D(){return this._format},getAlpha:function D(){return this._a},getBrightness:function D(){var C=this.toRgb();return(C.r*299+C.g*587+C.b*114)/1000},getLuminance:function D(){var C=this.toRgb(),Z,S,n,o,i,B;if(Z=C.r/255,S=C.g/255,n=C.b/255,Z<=0.03928)o=Z/12.92;else o=Math.pow((Z+0.055)/1.055,2.4);if(S<=0.03928)i=S/12.92;else i=Math.pow((S+0.055)/1.055,2.4);if(n<=0.03928)B=n/12.92;else B=Math.pow((n+0.055)/1.055,2.4);return 0.2126*o+0.7152*i+0.0722*B},setAlpha:function D(C){return this._a=V(C),this._roundA=Math.round(100*this._a)/100,this},toHsv:function D(){var C=w(this._r,this._g,this._b);return{h:C.h*360,s:C.s,v:C.v,a:this._a}},toHsvString:function D(){var C=w(this._r,this._g,this._b),Z=Math.round(C.h*360),S=Math.round(C.s*100),n=Math.round(C.v*100);return this._a==1?"hsv("+Z+", "+S+"%, "+n+"%)":"hsva("+Z+", "+S+"%, "+n+"%, "+this._roundA+")"},toHsl:function D(){var C=P(this._r,this._g,this._b);return{h:C.h*360,s:C.s,l:C.l,a:this._a}},toHslString:function D(){var C=P(this._r,this._g,this._b),Z=Math.round(C.h*360),S=Math.round(C.s*100),n=Math.round(C.l*100);return this._a==1?"hsl("+Z+", "+S+"%, "+n+"%)":"hsla("+Z+", "+S+"%, "+n+"%, "+this._roundA+")"},toHex:function D(C){return v(this._r,this._g,this._b,C)},toHexString:function D(C){return"#"+this.toHex(C)},toHex8:function D(C){return z(this._r,this._g,this._b,this._a,C)},toHex8String:function D(C){return"#"+this.toHex8(C)},toRgb:function D(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function D(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function D(){return{r:Math.round(b(this._r,255)*100)+"%",g:Math.round(b(this._g,255)*100)+"%",b:Math.round(b(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function D(){return this._a==1?"rgb("+Math.round(b(this._r,255)*100)+"%, "+Math.round(b(this._g,255)*100)+"%, "+Math.round(b(this._b,255)*100)+"%)":"rgba("+Math.round(b(this._r,255)*100)+"%, "+Math.round(b(this._g,255)*100)+"%, "+Math.round(b(this._b,255)*100)+"%, "+this._roundA+")"},toName:function D(){if(this._a===0)return"transparent";if(this._a<1)return!1;return L[v(this._r,this._g,this._b,!0)]||!1},toFilter:function D(C){var Z="#"+W(this._r,this._g,this._b,this._a),S=Z,n=this._gradientType?"GradientType = 1, ":"";if(C){var o=K(C);S="#"+W(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+Z+",endColorstr="+S+")"},toString:function D(C){var Z=!!C;C=C||this._format;var S=!1,n=this._a<1&&this._a>=0,o=!Z&&n&&(C==="hex"||C==="hex6"||C==="hex3"||C==="hex4"||C==="hex8"||C==="name");if(o){if(C==="name"&&this._a===0)return this.toName();return this.toRgbString()}if(C==="rgb")S=this.toRgbString();if(C==="prgb")S=this.toPercentageRgbString();if(C==="hex"||C==="hex6")S=this.toHexString();if(C==="hex3")S=this.toHexString(!0);if(C==="hex4")S=this.toHex8String(!0);if(C==="hex8")S=this.toHex8String();if(C==="name")S=this.toName();if(C==="hsl")S=this.toHslString();if(C==="hsv")S=this.toHsvString();return S||this.toHexString()},clone:function D(){return K(this.toString())},_applyModification:function D(C,Z){var S=C.apply(null,[this].concat([].slice.call(Z)));return this._r=S._r,this._g=S._g,this._b=S._b,this.setAlpha(S._a),this},lighten:function D(){return this._applyModification(X,arguments)},brighten:function D(){return this._applyModification(A,arguments)},darken:function D(){return this._applyModification(G,arguments)},desaturate:function D(){return this._applyModification(J,arguments)},saturate:function D(){return this._applyModification(T,arguments)},greyscale:function D(){return this._applyModification(H,arguments)},spin:function D(){return this._applyModification(h,arguments)},_applyCombination:function D(C,Z){return C.apply(null,[this].concat([].slice.call(Z)))},analogous:function D(){return this._applyCombination(R,arguments)},complement:function D(){return this._applyCombination(M,arguments)},monochromatic:function D(){return this._applyCombination(l,arguments)},splitcomplement:function D(){return this._applyCombination(N,arguments)},triad:function D(){return this._applyCombination(I,[3])},tetrad:function D(){return this._applyCombination(I,[4])}},K.fromRatio=function(D,C){if(q(D)=="object"){var Z={};for(var S in D)if(D.hasOwnProperty(S))if(S==="a")Z[S]=D[S];else Z[S]=q8(D[S]);D=Z}return K(D,C)};function Y(D){var C={r:0,g:0,b:0},Z=1,S=null,n=null,o=null,i=!1,B=!1;if(typeof D=="string")D=o8(D);if(q(D)=="object"){if(G8(D.r)&&G8(D.g)&&G8(D.b))C=f(D.r,D.g,D.b),i=!0,B=String(D.r).substr(-1)==="%"?"prgb":"rgb";else if(G8(D.h)&&G8(D.s)&&G8(D.v))S=q8(D.s),n=q8(D.v),C=O(D.h,S,n),i=!0,B="hsv";else if(G8(D.h)&&G8(D.s)&&G8(D.l))S=q8(D.s),o=q8(D.l),C=$(D.h,S,o),i=!0,B="hsl";if(D.hasOwnProperty("a"))Z=D.a}return Z=V(Z),{ok:i,format:D.format||B,r:Math.min(255,Math.max(C.r,0)),g:Math.min(255,Math.max(C.g,0)),b:Math.min(255,Math.max(C.b,0)),a:Z}}function f(D,C,Z){return{r:b(D,255)*255,g:b(C,255)*255,b:b(Z,255)*255}}function P(D,C,Z){D=b(D,255),C=b(C,255),Z=b(Z,255);var S=Math.max(D,C,Z),n=Math.min(D,C,Z),o,i,B=(S+n)/2;if(S==n)o=i=0;else{var P8=S-n;switch(i=B>0.5?P8/(2-S-n):P8/(S+n),S){case D:o=(C-Z)/P8+(C<Z?6:0);break;case C:o=(Z-D)/P8+2;break;case Z:o=(D-C)/P8+4;break}o/=6}return{h:o,s:i,l:B}}function $(D,C,Z){var S,n,o;D=b(D,360),C=b(C,100),Z=b(Z,100);function i(H8,O8,A8){if(A8<0)A8+=1;if(A8>1)A8-=1;if(A8<0.16666666666666666)return H8+(O8-H8)*6*A8;if(A8<0.5)return O8;if(A8<0.6666666666666666)return H8+(O8-H8)*(0.6666666666666666-A8)*6;return H8}if(C===0)S=n=o=Z;else{var B=Z<0.5?Z*(1+C):Z+C-Z*C,P8=2*Z-B;S=i(P8,B,D+0.3333333333333333),n=i(P8,B,D),o=i(P8,B,D-0.3333333333333333)}return{r:S*255,g:n*255,b:o*255}}function w(D,C,Z){D=b(D,255),C=b(C,255),Z=b(Z,255);var S=Math.max(D,C,Z),n=Math.min(D,C,Z),o,i,B=S,P8=S-n;if(i=S===0?0:P8/S,S==n)o=0;else{switch(S){case D:o=(C-Z)/P8+(C<Z?6:0);break;case C:o=(Z-D)/P8+2;break;case Z:o=(D-C)/P8+4;break}o/=6}return{h:o,s:i,v:B}}function O(D,C,Z){D=b(D,360)*6,C=b(C,100),Z=b(Z,100);var S=Math.floor(D),n=D-S,o=Z*(1-C),i=Z*(1-n*C),B=Z*(1-(1-n)*C),P8=S%6,H8=[Z,i,o,o,B,Z][P8],O8=[B,Z,Z,i,o,o][P8],A8=[o,o,B,Z,Z,i][P8];return{r:H8*255,g:O8*255,b:A8*255}}function v(D,C,Z,S){var n=[Y8(Math.round(D).toString(16)),Y8(Math.round(C).toString(16)),Y8(Math.round(Z).toString(16))];if(S&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1))return n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0);return n.join("")}function z(D,C,Z,S,n){var o=[Y8(Math.round(D).toString(16)),Y8(Math.round(C).toString(16)),Y8(Math.round(Z).toString(16)),Y8(z8(S))];if(n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}function W(D,C,Z,S){var n=[Y8(z8(S)),Y8(Math.round(D).toString(16)),Y8(Math.round(C).toString(16)),Y8(Math.round(Z).toString(16))];return n.join("")}K.equals=function(D,C){if(!D||!C)return!1;return K(D).toRgbString()==K(C).toRgbString()},K.random=function(){return K.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function J(D,C){C=C===0?0:C||10;var Z=K(D).toHsl();return Z.s-=C/100,Z.s=p(Z.s),K(Z)}function T(D,C){C=C===0?0:C||10;var Z=K(D).toHsl();return Z.s+=C/100,Z.s=p(Z.s),K(Z)}function H(D){return K(D).desaturate(100)}function X(D,C){C=C===0?0:C||10;var Z=K(D).toHsl();return Z.l+=C/100,Z.l=p(Z.l),K(Z)}function A(D,C){C=C===0?0:C||10;var Z=K(D).toRgb();return Z.r=Math.max(0,Math.min(255,Z.r-Math.round(255*-(C/100)))),Z.g=Math.max(0,Math.min(255,Z.g-Math.round(255*-(C/100)))),Z.b=Math.max(0,Math.min(255,Z.b-Math.round(255*-(C/100)))),K(Z)}function G(D,C){C=C===0?0:C||10;var Z=K(D).toHsl();return Z.l-=C/100,Z.l=p(Z.l),K(Z)}function h(D,C){var Z=K(D).toHsl(),S=(Z.h+C)%360;return Z.h=S<0?360+S:S,K(Z)}function M(D){var C=K(D).toHsl();return C.h=(C.h+180)%360,K(C)}function I(D,C){if(isNaN(C)||C<=0)throw new Error("Argument to polyad must be a positive number");var Z=K(D).toHsl(),S=[K(D)],n=360/C;for(var o=1;o<C;o++)S.push(K({h:(Z.h+o*n)%360,s:Z.s,l:Z.l}));return S}function N(D){var C=K(D).toHsl(),Z=C.h;return[K(D),K({h:(Z+72)%360,s:C.s,l:C.l}),K({h:(Z+216)%360,s:C.s,l:C.l})]}function R(D,C,Z){C=C||6,Z=Z||30;var S=K(D).toHsl(),n=360/Z,o=[K(D)];for(S.h=(S.h-(n*C>>1)+720)%360;--C;)S.h=(S.h+n)%360,o.push(K(S));return o}function l(D,C){C=C||6;var Z=K(D).toHsv(),S=Z.h,n=Z.s,o=Z.v,i=[],B=1/C;while(C--)i.push(K({h:S,s:n,v:o})),o=(o+B)%1;return i}K.mix=function(D,C,Z){Z=Z===0?0:Z||50;var S=K(D).toRgb(),n=K(C).toRgb(),o=Z/100,i={r:(n.r-S.r)*o+S.r,g:(n.g-S.g)*o+S.g,b:(n.b-S.b)*o+S.b,a:(n.a-S.a)*o+S.a};return K(i)},K.readability=function(D,C){var Z=K(D),S=K(C);return(Math.max(Z.getLuminance(),S.getLuminance())+0.05)/(Math.min(Z.getLuminance(),S.getLuminance())+0.05)},K.isReadable=function(D,C,Z){var S=K.readability(D,C),n,o;switch(o=!1,n=e8(Z),n.level+n.size){case"AAsmall":case"AAAlarge":o=S>=4.5;break;case"AAlarge":o=S>=3;break;case"AAAsmall":o=S>=7;break}return o},K.mostReadable=function(D,C,Z){var S=null,n=0,o,i,B,P8;Z=Z||{},i=Z.includeFallbackColors,B=Z.level,P8=Z.size;for(var H8=0;H8<C.length;H8++)if(o=K.readability(D,C[H8]),o>n)n=o,S=K(C[H8]);if(K.isReadable(D,S,{level:B,size:P8})||!i)return S;else return Z.includeFallbackColors=!1,K.mostReadable(D,["#fff","#000"],Z)};var E=K.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},L=K.hexNames=d(E);function d(D){var C={};for(var Z in D)if(D.hasOwnProperty(Z))C[D[Z]]=Z;return C}function V(D){if(D=parseFloat(D),isNaN(D)||D<0||D>1)D=1;return D}function b(D,C){if(t(D))D="100%";var Z=F(D);if(D=Math.min(C,Math.max(0,parseFloat(D))),Z)D=parseInt(D*C,10)/100;if(Math.abs(D-C)<0.000001)return 1;return D%C/parseFloat(C)}function p(D){return Math.min(1,Math.max(0,D))}function r(D){return parseInt(D,16)}function t(D){return typeof D=="string"&&D.indexOf(".")!=-1&&parseFloat(D)===1}function F(D){return typeof D==="string"&&D.indexOf("%")!=-1}function Y8(D){return D.length==1?"0"+D:""+D}function q8(D){if(D<=1)D=D*100+"%";return D}function z8(D){return Math.round(parseFloat(D)*255).toString(16)}function w8(D){return r(D)/255}var K8=function(){var D="[-\\+]?\\d+%?",C="[-\\+]?\\d*\\.\\d+%?",Z="(?:"+C+")|(?:"+D+")",S="[\\s|\\(]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")\\s*\\)?",n="[\\s|\\(]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")\\s*\\)?";return{CSS_UNIT:new RegExp(Z),rgb:new RegExp("rgb"+S),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+S),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+S),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function G8(D){return!!K8.CSS_UNIT.exec(D)}function o8(D){D=D.replace(_,"").replace(j,"").toLowerCase();var C=!1;if(E[D])D=E[D],C=!0;else if(D=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var Z;if(Z=K8.rgb.exec(D))return{r:Z[1],g:Z[2],b:Z[3]};if(Z=K8.rgba.exec(D))return{r:Z[1],g:Z[2],b:Z[3],a:Z[4]};if(Z=K8.hsl.exec(D))return{h:Z[1],s:Z[2],l:Z[3]};if(Z=K8.hsla.exec(D))return{h:Z[1],s:Z[2],l:Z[3],a:Z[4]};if(Z=K8.hsv.exec(D))return{h:Z[1],s:Z[2],v:Z[3]};if(Z=K8.hsva.exec(D))return{h:Z[1],s:Z[2],v:Z[3],a:Z[4]};if(Z=K8.hex8.exec(D))return{r:r(Z[1]),g:r(Z[2]),b:r(Z[3]),a:w8(Z[4]),format:C?"name":"hex8"};if(Z=K8.hex6.exec(D))return{r:r(Z[1]),g:r(Z[2]),b:r(Z[3]),format:C?"name":"hex"};if(Z=K8.hex4.exec(D))return{r:r(Z[1]+""+Z[1]),g:r(Z[2]+""+Z[2]),b:r(Z[3]+""+Z[3]),a:w8(Z[4]+""+Z[4]),format:C?"name":"hex8"};if(Z=K8.hex3.exec(D))return{r:r(Z[1]+""+Z[1]),g:r(Z[2]+""+Z[2]),b:r(Z[3]+""+Z[3]),format:C?"name":"hex"};return!1}function e8(D){var C,Z;if(D=D||{level:"AA",size:"small"},C=(D.level||"AA").toUpperCase(),Z=(D.size||"small").toLowerCase(),C!=="AA"&&C!=="AAA")C="AA";if(Z!=="small"&&Z!=="large")Z="small";return{level:C,size:Z}}return K})});var yY=_8((EM,gY)=>{var z3=bY(),mY={r:256,g:256,b:256,a:1},IY={h:360,s:1,v:1,a:1};function s2(q,_,j){let K={};for(let Y in q)if(q.hasOwnProperty(Y))K[Y]=j===0?0:(_[Y]-q[Y])/j;return K}function Q2(q,_,j,K){let Y={};for(let f in _)if(_.hasOwnProperty(f))Y[f]=q[f]*j+_[f],Y[f]=Y[f]<0?Y[f]+K[f]:K[f]!==1?Y[f]%K[f]:Y[f];return Y}function U2(q,_,j){let K=q.color.toRgb(),Y=_.color.toRgb(),f=s2(K,Y,j),P=[q.color];for(let $=1;$<j;$++){let w=Q2(f,K,$,mY);P.push(z3(w))}return P}function SY(q,_,j,K){let Y=q.color.toHsv(),f=_.color.toHsv();if(Y.s===0||f.s===0)return U2(q,_,j);let P;if(typeof K==="boolean")P=K;else{let v=Y.h<f.h&&f.h-Y.h<180||Y.h>f.h&&Y.h-f.h>180;P=K==="long"&&v||K==="short"&&!v}let $=s2(Y,f,j),w=[q.color],O;if(Y.h<=f.h&&!P||Y.h>=f.h&&P)O=f.h-Y.h;else if(P)O=360-f.h+Y.h;else O=360-Y.h+f.h;$.h=Math.pow(-1,P?1:0)*Math.abs(O)/j;for(let v=1;v<j;v++){let z=Q2($,Y,v,IY);w.push(z3(z))}return w}function EY(q,_){let j=q.length;if(_=parseInt(_,10),isNaN(_)||_<2)throw new Error("Invalid number of steps (< 2)");if(_<j)throw new Error("Number of steps cannot be inferior to number of stops");let K=[];for(let f=1;f<j;f++){let P=(_-1)*(q[f].pos-q[f-1].pos);K.push(Math.max(1,Math.round(P)))}let Y=1;for(let f=j-1;f--;)Y+=K[f];while(Y!==_)if(Y<_){let f=Math.min.apply(null,K);K[K.indexOf(f)]++,Y++}else{let f=Math.max.apply(null,K);K[K.indexOf(f)]--,Y--}return K}function RY(q,_,j,K){if(_<0||_>1)throw new Error("Position must be between 0 and 1");let Y,f;for(let w=0,O=q.length;w<O-1;w++)if(_>=q[w].pos&&_<q[w+1].pos){Y=q[w],f=q[w+1];break}if(!Y)Y=f=q[q.length-1];let P=s2(Y.color[j](),f.color[j](),(f.pos-Y.pos)*100),$=Q2(P,Y.color[j](),(_-Y.pos)*100,K);return z3($)}class V7{constructor(q){if(q.length<2)throw new Error("Invalid number of stops (< 2)");let _=q[0].pos!==void 0,j=q.length,K=-1,Y=!1;if(this.stops=q.map((f,P)=>{let $=f.pos!==void 0;if(_^$)throw new Error("Cannot mix positionned and not posionned color stops");if($){let w=f.color!==void 0;if(!w&&(Y||P===0||P===j-1))throw new Error("Cannot define two consecutive position-only stops");if(Y=!w,f={color:w?z3(f.color):null,colorLess:!w,pos:f.pos},f.pos<0||f.pos>1)throw new Error("Color stops positions must be between 0 and 1");else if(f.pos<K)throw new Error("Color stops positions are not ordered");K=f.pos}else f={color:z3(f.color!==void 0?f.color:f),pos:P/(j-1)};return f}),this.stops[0].pos!==0)this.stops.unshift({color:this.stops[0].color,pos:0}),j++;if(this.stops[j-1].pos!==1)this.stops.push({color:this.stops[j-1].color,pos:1})}reverse(){let q=[];return this.stops.forEach(function(_){q.push({color:_.color,pos:1-_.pos})}),new V7(q.reverse())}loop(){let q=[],_=[];return this.stops.forEach((j)=>{q.push({color:j.color,pos:j.pos/2})}),this.stops.slice(0,-1).forEach((j)=>{_.push({color:j.color,pos:1-j.pos/2})}),new V7(q.concat(_.reverse()))}rgb(q){let _=EY(this.stops,q),j=[];this.stops.forEach((K,Y)=>{if(K.colorLess)K.color=U2(this.stops[Y-1],this.stops[Y+1],2)[1]});for(let K=0,Y=this.stops.length;K<Y-1;K++){let f=U2(this.stops[K],this.stops[K+1],_[K]);j.splice(j.length,0,...f)}return j.push(this.stops[this.stops.length-1].color),j}hsv(q,_){let j=EY(this.stops,q),K=[];this.stops.forEach((Y,f)=>{if(Y.colorLess)Y.color=SY(this.stops[f-1],this.stops[f+1],2,_)[1]});for(let Y=0,f=this.stops.length;Y<f-1;Y++){let P=SY(this.stops[Y],this.stops[Y+1],j[Y],_);K.splice(K.length,0,...P)}return K.push(this.stops[this.stops.length-1].color),K}css(q,_){q=q||"linear",_=_||(q==="linear"?"to right":"ellipse at center");let j=q+"-gradient("+_;return this.stops.forEach(function(K){j+=", "+(K.colorLess?"":K.color.toRgbString()+" ")+K.pos*100+"%"}),j+=")",j}rgbAt(q){return RY(this.stops,q,"toRgb",mY)}hsvAt(q){return RY(this.stops,q,"toHsv",IY)}}gY.exports=function(q){if(arguments.length===1){if(!Array.isArray(arguments[0]))throw new Error('"stops" is not an array');q=arguments[0]}else q=Array.prototype.slice.call(arguments);return new V7(q)}});var cY=_8((xM,nY)=>{nY.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var iY=_8((aM,kG)=>{kG.exports={single:{topLeft:"┌",top:"─",topRight:"┐",right:"│",bottomRight:"┘",bottom:"─",bottomLeft:"└",left:"│"},double:{topLeft:"╔",top:"═",topRight:"╗",right:"║",bottomRight:"╝",bottom:"═",bottomLeft:"╚",left:"║"},round:{topLeft:"╭",top:"─",topRight:"╮",right:"│",bottomRight:"╯",bottom:"─",bottomLeft:"╰",left:"│"},bold:{topLeft:"┏",top:"━",topRight:"┓",right:"┃",bottomRight:"┛",bottom:"━",bottomLeft:"┗",left:"┃"},singleDouble:{topLeft:"╓",top:"─",topRight:"╖",right:"║",bottomRight:"╜",bottom:"─",bottomLeft:"╙",left:"║"},doubleSingle:{topLeft:"╒",top:"═",topRight:"╕",right:"│",bottomRight:"╛",bottom:"═",bottomLeft:"╘",left:"│"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"↘",top:"↓",topRight:"↙",right:"←",bottomRight:"↖",bottom:"↑",bottomLeft:"↗",left:"→"}}});var Y9=_8((BM,P9)=>{var oY=iY();P9.exports=oY;P9.exports.default=oY});var UY=_8((eM,FY)=>{FY.exports=({onlyFirst:q=!1}={})=>{let _=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(_,q?void 0:"g")}});var QY=_8((FM,sY)=>{var CG=UY();sY.exports=(q)=>typeof q==="string"?q.replace(CG(),""):q});var _f=_8((UM,w9)=>{var qf=(q)=>{if(Number.isNaN(q))return!1;if(q>=4352&&(q<=4447||q===9001||q===9002||11904<=q&&q<=12871&&q!==12351||12880<=q&&q<=19903||19968<=q&&q<=42182||43360<=q&&q<=43388||44032<=q&&q<=55203||63744<=q&&q<=64255||65040<=q&&q<=65049||65072<=q&&q<=65131||65281<=q&&q<=65376||65504<=q&&q<=65510||110592<=q&&q<=110593||127488<=q&&q<=127569||131072<=q&&q<=262141))return!0;return!1};w9.exports=qf;w9.exports.default=qf});var jf=_8((sM,Kf)=>{Kf.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var Yf=_8((QM,O9)=>{var VG=QY(),MG=_f(),NG=jf(),Pf=(q)=>{if(typeof q!=="string"||q.length===0)return 0;if(q=VG(q),q.length===0)return 0;q=q.replace(NG()," ");let _=0;for(let j=0;j<q.length;j++){let K=q.codePointAt(j);if(K<=31||K>=127&&K<=159)continue;if(K>=768&&K<=879)continue;if(K>65535)j++;_+=MG(K)?2:1}return _};O9.exports=Pf;O9.exports.default=Pf});var $f=_8((q0,ff)=>{var bG=Yf();function C_(q,_){if(!q)return q;_=_||{};let j=_.align||"center";if(j==="left")return q;let K=_.split||`
|
||
`,Y=_.pad||" ",f=j!=="right"?SG:EG,P=!1;if(!Array.isArray(q))P=!0,q=String(q).split(K);let $,w=0;return q=q.map(function(O){return O=String(O),$=bG(O),w=Math.max($,w),{str:O,width:$}}).map(function(O){return new Array(f(w,O.width)+1).join(Y)+O.str}),P?q.join(K):q}C_.left=function q(_){return C_(_,{align:"left"})};C_.center=function q(_){return C_(_,{align:"center"})};C_.right=function q(_){return C_(_,{align:"right"})};ff.exports=C_;function SG(q,_){return Math.floor((q-_)/2)}function EG(q,_){return q-_}});var Vf={};tq(Vf,{status:()=>G9});import{readFileSync as A9,existsSync as T3,readdirSync as Tu,statSync as Zu}from"fs";import{join as b_,dirname as ku}from"path";import{execSync as Xu}from"child_process";import{fileURLToPath as Au}from"url";async function G9(){console.log("\uD83D\uDD0D Claude Memory System Status Check"),console.log(`=====================================
|
||
`),console.log("\uD83D\uDCC2 Installed Hook Scripts:");let q=$8.getInstance(),_=q.getHooksDirectory(),j=b_(_,"pre-compact.js"),K=b_(_,"session-start.js"),Y=b_(_,"session-end.js"),f=(J,T)=>{if(T3(J))console.log(` ✅ ${T}: Found at ${J}`);else console.log(` ❌ ${T}: Not found at ${J}`)};f(j,"pre-compact.js"),f(K,"session-start.js"),f(Y,"session-end.js"),console.log(""),console.log("⚙️ Settings Configuration:");let P=(J,T)=>{if(!T3(T)){console.log(` ⏭️ ${J}: No settings file`);return}console.log(` \uD83D\uDCCB ${J}: ${T}`);try{let H=JSON.parse(A9(T,"utf8")),X=H.hooks?.PreCompact?.some((h)=>h.hooks?.some((M)=>M.command?.includes("pre-compact.js")||M.command?.includes("claude-mem"))),A=H.hooks?.SessionStart?.some((h)=>h.hooks?.some((M)=>M.command?.includes("session-start.js")||M.command?.includes("claude-mem"))),G=H.hooks?.SessionEnd?.some((h)=>h.hooks?.some((M)=>M.command?.includes("session-end.js")||M.command?.includes("claude-mem")));console.log(` PreCompact: ${X?"✅":"❌"}`),console.log(` SessionStart: ${A?"✅":"❌"}`),console.log(` SessionEnd: ${G?"✅":"❌"}`)}catch(H){console.log(" ⚠️ Could not parse settings")}};P("Global",q.getClaudeSettingsPath()),P("Project",b_(process.cwd(),".claude","settings.json")),console.log(""),console.log("\uD83D\uDCE6 Compressed Transcripts:");let $=b_(q.getClaudeConfigDirectory(),"projects");if(T3($))try{let J=0,T=0,H=(X,A=0)=>{if(A>3)return;let G=Tu(X);for(let h of G){let M=b_(X,h);if(Zu(M).isDirectory()&&!h.startsWith("."))H(M,A+1);else if(h.endsWith(".jsonl.compressed"))J++;else if(h.endsWith(".jsonl.archive"))T++}};H($),console.log(` Compressed files: ${J}`),console.log(` Archive files: ${T}`)}catch(J){console.log(" ⚠️ Could not scan projects directory")}else console.log(" ℹ️ No Claude projects directory found");console.log(""),console.log("\uD83D\uDD27 Runtime Environment:");let w=(J,T)=>{try{let H=Xu(`${J} --version`,{encoding:"utf8"}).trim();console.log(` ✅ ${T}: ${H}`)}catch{console.log(` ❌ ${T}: Not found`)}};w("node","Node.js"),w("bun","Bun"),console.log(""),console.log("\uD83E\uDDE0 Chroma Storage Status:"),console.log(" ✅ Storage backend: Chroma MCP"),console.log(` \uD83D\uDCCD Data location: ${q.getChromaDirectory()}`),console.log(" \uD83D\uDD0D Features: Vector search, semantic similarity, document storage"),console.log(""),console.log("\uD83D\uDCCA Summary:");let O=q.getClaudeSettingsPath(),v=b_(process.cwd(),".claude","settings.json"),z=!1,W="Not installed";try{if(T3(O)){let J=JSON.parse(A9(O,"utf8"));if(J.hooks?.PreCompact||J.hooks?.SessionStart||J.hooks?.SessionEnd)z=!0,W="Global"}if(T3(v)){let J=JSON.parse(A9(v,"utf8"));if(J.hooks?.PreCompact||J.hooks?.SessionStart||J.hooks?.SessionEnd)z=!0,W=W==="Global"?"Global + Project":"Project"}}catch{}if(z)console.log(` ✅ Claude Memory System is installed (${W})`),console.log(""),console.log("\uD83D\uDCA1 To test: Use /compact in Claude Code");else console.log(" ❌ Claude Memory System is not installed"),console.log(""),console.log("\uD83D\uDCA1 To install: claude-mem install")}var x0;var u9=K6(()=>{l6();x0=ku(Au(import.meta.url))});var Nf={};tq(Nf,{logs:()=>D9});import{readFileSync as Gu,readdirSync as uu,statSync as Du}from"fs";import{join as Mf}from"path";async function hu(q,_,j){try{let f=Gu(q,"utf8").split(`
|
||
`).filter((P)=>P.trim()).slice(-j);if(console.log(`\uD83D\uDCCB ${_} Logs (last ${j} lines):`),console.log(` File: ${q}`),console.log(""),f.length===0)console.log(" No log entries found");else f.forEach((P)=>{console.log(` ${P}`)});console.log("")}catch(K){console.log(`❌ Could not read ${_.toLowerCase()} log: ${q}`)}}async function D9(q={}){let _=$8.getLogsDirectory(),j=parseInt(q.tail)||20;try{let Y=uu(_).filter((f)=>f.startsWith("claude-mem-")&&f.endsWith(".log")).map((f)=>({name:f,path:Mf(_,f),mtime:Du(Mf(_,f)).mtime})).sort((f,P)=>P.mtime.getTime()-f.mtime.getTime());if(Y.length===0){console.log("❌ No log files found in ~/.claude-mem/logs/");return}if(await hu(Y[0].path,"Most Recent",j),q.all&&Y.length>1)console.log(`\uD83D\uDCDA Found ${Y.length} total log files`)}catch(K){console.log("❌ Could not read logs directory: ~/.claude-mem/logs/"),console.log(" Run a compression first to generate logs")}if(q.follow)console.log("Following logs... (Press Ctrl+C to stop)"),setInterval(()=>{},1000)}var h9=K6(()=>{l6()});import Z3 from"fs";import{join as Cu}from"path";function Vu(q){if(q===0)return"0 B";let _=1024,j=["B","KB","MB","GB"],K=Math.floor(Math.log(q)/Math.log(_));return parseFloat((q/Math.pow(_,K)).toFixed(1))+" "+j[K]}function Mu(){let q=$8.getInstance().getTrashDirectory();if(!Z3.existsSync(q))return{folderCount:0,fileCount:0,totalSize:0,isEmpty:!0};let _=Z3.readdirSync(q);if(_.length===0)return{folderCount:0,fileCount:0,totalSize:0,isEmpty:!0};let j=0,K=0,Y=0;for(let f of _){let P=Cu(q,f),$=Z3.statSync(P);if($.isDirectory())j++;else K++;Y+=$.size}return{folderCount:j,fileCount:K,totalSize:Y,isEmpty:!1}}async function m7(q={}){let j=$8.getInstance().getIndexPath();try{if(!Z3.existsSync(j)){if(q.format==="session-start")console.log(pK("NO_MEMORIES",q.project||"this project"));return}let Y=Z3.readFileSync(j,"utf-8").trim().split(`
|
||
`).filter((z)=>z.trim());if(Y.length===0){if(q.format==="session-start")console.log(pK("NO_MEMORIES",q.project||"this project"));return}let f=[];for(let z of Y)try{if(!z.trim().startsWith("{"))continue;let W=JSON.parse(z);f.push(W)}catch(W){continue}if(f.length===0){if(q.format==="session-start")console.log(pK("NO_MEMORIES",q.project||"this project"));return}let P=f.filter((z)=>z.type==="memory"),$=f.filter((z)=>z.type==="overview"),w=f.filter((z)=>z.type==="session"),O=P,v=$;if(q.project)O=P.filter((z)=>z.project===q.project),v=$.filter((z)=>z.project===q.project);if(q.format==="session-start"){let z=O.slice(-10),W=v.slice(-5),J=[...z,...W],T="recently",H=J.map((X)=>{return X.timestamp?new Date(X.timestamp):null}).filter((X)=>X!==null).sort((X,A)=>A.getTime()-X.getTime());if(H.length>0)T=g5(H[0]);d5({projectName:q.project||"your project",memoryCount:z.length,lastSessionTime:T,recentObjects:J})}else if(q.format==="json"){let z=O.slice(-10),W=v.slice(-3),J=[...z,...W];console.log(JSON.stringify(J))}else{let z=O.slice(-10),W=v.slice(-3),J=z.length+W.length;console.log(n3("Context loading",J,"recent entries found")),z.forEach((T)=>{console.log(`${T.text} | ${T.document_id} | ${T.keywords}`)}),W.forEach((T)=>{console.log(`**Overview:** ${T.content}`)})}if(q.format!=="json"){let z=Mu();if(!z.isEmpty){let W=Vu(z.totalSize);console.log(`\uD83D\uDDD1️ Trash – ${z.folderCount} folders | ${z.fileCount} files | ${W} – use \`$ claude-mem restore\``),console.log("")}}}catch(K){let Y=K instanceof Error?K.message:String(K);if(q.format==="session-start")console.log(pK("CONNECTION_FAILED",Y));else console.log(c_("Context loading",Y,"Check file permissions and try again"))}}var C9=K6(()=>{l6();Z4()});var o$={};tq(o$,{viewTrash:()=>lh});import{readdirSync as n$,statSync as c$}from"fs";import{join as r$}from"path";function ph(q){let _=q.lastIndexOf(".");if(_===-1)return{name:q,timestamp:0};let j=parseInt(q.substring(_+1));if(isNaN(j))return{name:q,timestamp:0};return{name:q.substring(0,_),timestamp:j}}function x$(q){if(q===0)return"0 B";let _=1024,j=["B","KB","MB","GB"],K=Math.floor(Math.log(q)/Math.log(_));return parseFloat((q/Math.pow(_,K)).toFixed(2))+" "+j[K]}function i$(q){let _=0,j=n$(q);for(let K of j){let Y=r$(q,K),f=c$(Y);if(f.isDirectory())_+=i$(Y);else _+=f.size}return _}async function lh(){let q=$8.getInstance().getTrashDirectory();try{let _=n$(q);if(_.length===0){P6.info("\uD83D\uDDD1️ Trash is empty");return}let j=_.map((P)=>{let $=r$(q,P),w=c$($),{name:O,timestamp:v}=ph(P),z=w.isDirectory()?i$($):w.size;return{originalName:O,trashedName:P,size:z,trashedAt:new Date(v),isDirectory:w.isDirectory()}});j.sort((P,$)=>$.trashedAt.getTime()-P.trashedAt.getTime()),console.log(`
|
||
\uD83D\uDDD1️ Trash Contents
|
||
`),console.log("─".repeat(80));let K=0,Y=0,f=0;for(let P of j){if(K+=P.size,P.isDirectory)Y++;else f++;let $=P.isDirectory?"\uD83D\uDCC1":"\uD83D\uDCC4",w=P.trashedAt.toLocaleString(),O=x$(P.size);console.log(`${$} ${P.originalName}`),console.log(` Size: ${O} | Trashed: ${w}`),console.log(` ID: ${P.trashedName}`),console.log()}console.log("─".repeat(80)),console.log(`Total: ${Y} folders, ${f} files (${x$(K)})`),console.log(`
|
||
To restore files: claude-mem restore`),console.log("To empty trash: claude-mem trash empty")}catch(_){if(_.code==="ENOENT")P6.info("\uD83D\uDDD1️ Trash is empty");else P6.error("Failed to read trash directory"),console.error(_)}}var a$=K6(()=>{j_();l6()});var t$={};tq(t$,{emptyTrash:()=>ih});import{rmSync as xh,readdirSync as nh,existsSync as ch,statSync as rh}from"fs";import{join as B$}from"path";async function ih(q={}){let _=$8.getInstance().getTrashDirectory();if(!ch(_)){P6.info("\uD83D\uDDD1️ Trash is already empty");return}try{let j=nh(_);if(j.length===0){P6.info("\uD83D\uDDD1️ Trash is already empty");return}let K=0,Y=0;for(let P of j){let $=B$(_,P);if(rh($).isDirectory())K++;else Y++}if(!q.force){let P=await r6({message:`Permanently delete ${K} folders and ${Y} files from trash?`,initialValue:!1});if(p8(P)||!P){P6.info("Cancelled - trash not emptied");return}}let f=Kq();f.start("Emptying trash...");for(let P of j){let $=B$(_,P);xh($,{recursive:!0,force:!0})}f.stop(`\uD83D\uDDD1️ Trash emptied - permanently deleted ${K} folders and ${Y} files`)}catch(j){P6.error("Failed to empty trash"),console.error(j),process.exit(1)}}var e$=K6(()=>{j_();l6()});var s7={};tq(s7,{sessionStartHook:()=>ah,sessionEndHook:()=>Bh,preCompactHook:()=>oh});import{basename as F$}from"path";async function oh(){try{let q="";process.stdin.setEncoding("utf8");for await(let j of process.stdin)q+=j;let _;if(q)try{_=JSON.parse(q).transcript_path}catch(j){_=q.trim()}if(!_)_=process.env.TRANSCRIPT_PATH||process.argv[2];if(!_){console.log("\uD83D\uDDDC️ Compressing session transcript..."),console.log("❌ No transcript path provided to pre-compact hook"),console.log("Hook data received:",q||"none"),console.log("Environment TRANSCRIPT_PATH:",process.env.TRANSCRIPT_PATH||"not set"),console.log("Command line args:",process.argv.slice(2));return}await kK(_,{dryRun:!1})}catch(q){console.error("Pre-compact hook failed:",q.message),process.exit(1)}}async function ah(){try{let q="";process.stdin.setEncoding("utf8");for await(let j of process.stdin)q+=j;let _;if(q)try{let j=JSON.parse(q);if(j.cwd)_=F$(j.cwd)}catch(j){console.error("Failed to parse session-start hook data:",j)}if(!_)_=F$(process.cwd());await m7({format:"session-start",count:"10",project:_})}catch(q){console.error("Session-start hook failed:",q.message),process.exit(1)}}async function Bh(){try{let q="";process.stdin.setEncoding("utf8");for await(let _ of process.stdin)q+=_;if(q)try{let _=JSON.parse(q);if(_.reason==="clear"&&_.transcript_path)console.log("\uD83D\uDDDC️ Compressing current session before /clear..."),await kK(_.transcript_path,{dryRun:!1})}catch(_){console.error("Failed to parse hook data:",_)}console.log("Session ended successfully")}catch(q){console.error("Session-end hook failed:",q.message),process.exit(1)}}var Q7=K6(()=>{H7();C9()});var D5=Oq(u5(),1),{program:vC,createCommand:WC,createArgument:HC,createOption:JC,CommanderError:TC,InvalidArgumentError:ZC,InvalidOptionArgumentError:kC,Command:h5,Argument:XC,Option:AC,Help:GC}=D5.default;import{readFileSync as vO,existsSync as WO}from"fs";import{join as HO,dirname as JO}from"path";import{fileURLToPath as TO}from"url";var C5="claude-mem",V5="3.6.2",M5="Memory compression system for Claude Code - persist context across sessions",N5=C5,b5=V5,S5=M5;try{let q=TO(import.meta.url),_=JO(q),j=HO(_,"..","..","package.json");if(WO(j)){let K=JSON.parse(vO(j,"utf-8"));N5=K.name||C5,b5=K.version||V5,S5=K.description||M5}}catch{}var eq=N5,E5=b5,R5=S5;H7();j_();import{readFileSync as GK,writeFileSync as N_,existsSync as R8,chmodSync as FG,mkdirSync as DK,copyFileSync as M_,statSync as UG,readdirSync as sG}from"fs";import{join as V8,dirname as uK}from"path";import{homedir as Z9}from"os";import{execSync as V_}from"child_process";import{fileURLToPath as uf}from"url";var kY=(q=0)=>(_)=>`\x1B[${_+q}m`,XY=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,AY=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,l8={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]}},kM=Object.keys(l8.modifier),LA=Object.keys(l8.color),pA=Object.keys(l8.bgColor),XM=[...LA,...pA];function lA(){let q=new Map;for(let[_,j]of Object.entries(l8)){for(let[K,Y]of Object.entries(j))l8[K]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},j[K]=l8[K],q.set(Y[0],Y[1]);Object.defineProperty(l8,_,{value:j,enumerable:!1})}return Object.defineProperty(l8,"codes",{value:q,enumerable:!1}),l8.color.close="\x1B[39m",l8.bgColor.close="\x1B[49m",l8.color.ansi=kY(),l8.color.ansi256=XY(),l8.color.ansi16m=AY(),l8.bgColor.ansi=kY(10),l8.bgColor.ansi256=XY(10),l8.bgColor.ansi16m=AY(10),Object.defineProperties(l8,{rgbToAnsi256:{value(_,j,K){if(_===j&&j===K){if(_<8)return 16;if(_>248)return 231;return Math.round((_-8)/247*24)+232}return 16+36*Math.round(_/255*5)+6*Math.round(j/255*5)+Math.round(K/255*5)},enumerable:!1},hexToRgb:{value(_){let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;if(K.length===3)K=[...K].map((f)=>f+f).join("");let Y=Number.parseInt(K,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(_)=>l8.rgbToAnsi256(...l8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value(_){if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,Y;if(_>=232)j=((_-232)*10+8)/255,K=j,Y=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,Y=$%6/5}let f=Math.max(j,K,Y)*2;if(f===0)return 30;let P=30+(Math.round(Y)<<2|Math.round(K)<<1|Math.round(j));if(f===2)P+=60;return P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>l8.ansi256ToAnsi(l8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>l8.ansi256ToAnsi(l8.hexToAnsi256(_)),enumerable:!1}}),l8}var xA=lA(),Xq=xA;import o2 from"node:process";import nA from"node:os";import GY from"node:tty";function jq(q,_=globalThis.Deno?globalThis.Deno.args:o2.argv){let j=q.startsWith("-")?"":q.length===1?"-":"--",K=_.indexOf(j+q),Y=_.indexOf("--");return K!==-1&&(Y===-1||K<Y)}var{env:x8}=o2,h7;if(jq("no-color")||jq("no-colors")||jq("color=false")||jq("color=never"))h7=0;else if(jq("color")||jq("colors")||jq("color=true")||jq("color=always"))h7=1;function cA(){if("FORCE_COLOR"in x8){if(x8.FORCE_COLOR==="true")return 1;if(x8.FORCE_COLOR==="false")return 0;return x8.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(x8.FORCE_COLOR,10),3)}}function rA(q){if(q===0)return!1;return{level:q,hasBasic:!0,has256:q>=2,has16m:q>=3}}function iA(q,{streamIsTTY:_,sniffFlags:j=!0}={}){let K=cA();if(K!==void 0)h7=K;let Y=j?h7:K;if(Y===0)return 0;if(j){if(jq("color=16m")||jq("color=full")||jq("color=truecolor"))return 3;if(jq("color=256"))return 2}if("TF_BUILD"in x8&&"AGENT_NAME"in x8)return 1;if(q&&!_&&Y===void 0)return 0;let f=Y||0;if(x8.TERM==="dumb")return f;if(o2.platform==="win32"){let P=nA.release().split(".");if(Number(P[0])>=10&&Number(P[2])>=10586)return Number(P[2])>=14931?3:2;return 1}if("CI"in x8){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((P)=>(P in x8)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((P)=>(P in x8))||x8.CI_NAME==="codeship")return 1;return f}if("TEAMCITY_VERSION"in x8)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(x8.TEAMCITY_VERSION)?1:0;if(x8.COLORTERM==="truecolor")return 3;if(x8.TERM==="xterm-kitty")return 3;if(x8.TERM==="xterm-ghostty")return 3;if(x8.TERM==="wezterm")return 3;if("TERM_PROGRAM"in x8){let P=Number.parseInt((x8.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(x8.TERM_PROGRAM){case"iTerm.app":return P>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(x8.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(x8.TERM))return 1;if("COLORTERM"in x8)return 1;return f}function uY(q,_={}){let j=iA(q,{streamIsTTY:q&&q.isTTY,..._});return rA(j)}var oA={stdout:uY({isTTY:GY.isatty(1)}),stderr:uY({isTTY:GY.isatty(2)})},DY=oA;function hY(q,_,j){let K=q.indexOf(_);if(K===-1)return q;let Y=_.length,f=0,P="";do P+=q.slice(f,K)+_+j,f=K+Y,K=q.indexOf(_,f);while(K!==-1);return P+=q.slice(f),P}function CY(q,_,j,K){let Y=0,f="";do{let P=q[K-1]==="\r";f+=q.slice(Y,P?K-1:K)+_+(P?`\r
|
||
`:`
|
||
`)+j,Y=K+1,K=q.indexOf(`
|
||
`,Y)}while(K!==-1);return f+=q.slice(Y),f}var{stdout:VY,stderr:MY}=DY,a2=Symbol("GENERATOR"),XK=Symbol("STYLER"),w3=Symbol("IS_EMPTY"),NY=["ansi","ansi","ansi256","ansi16m"],AK=Object.create(null),aA=(q,_={})=>{if(_.level&&!(Number.isInteger(_.level)&&_.level>=0&&_.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let j=VY?VY.level:0;q.level=_.level===void 0?j:_.level};var BA=(q)=>{let _=(...j)=>j.join(" ");return aA(_,q),Object.setPrototypeOf(_,O3.prototype),_};function O3(q){return BA(q)}Object.setPrototypeOf(O3.prototype,Function.prototype);for(let[q,_]of Object.entries(Xq))AK[q]={get(){let j=C7(this,t2(_.open,_.close,this[XK]),this[w3]);return Object.defineProperty(this,q,{value:j}),j}};AK.visible={get(){let q=C7(this,this[XK],!0);return Object.defineProperty(this,"visible",{value:q}),q}};var B2=(q,_,j,...K)=>{if(q==="rgb"){if(_==="ansi16m")return Xq[j].ansi16m(...K);if(_==="ansi256")return Xq[j].ansi256(Xq.rgbToAnsi256(...K));return Xq[j].ansi(Xq.rgbToAnsi(...K))}if(q==="hex")return B2("rgb",_,j,...Xq.hexToRgb(...K));return Xq[j][q](...K)},tA=["rgb","hex","ansi256"];for(let q of tA){AK[q]={get(){let{level:j}=this;return function(...K){let Y=t2(B2(q,NY[j],"color",...K),Xq.color.close,this[XK]);return C7(this,Y,this[w3])}}};let _="bg"+q[0].toUpperCase()+q.slice(1);AK[_]={get(){let{level:j}=this;return function(...K){let Y=t2(B2(q,NY[j],"bgColor",...K),Xq.bgColor.close,this[XK]);return C7(this,Y,this[w3])}}}}var eA=Object.defineProperties(()=>{},{...AK,level:{enumerable:!0,get(){return this[a2].level},set(q){this[a2].level=q}}}),t2=(q,_,j)=>{let K,Y;if(j===void 0)K=q,Y=_;else K=j.openAll+q,Y=_+j.closeAll;return{open:q,close:_,openAll:K,closeAll:Y,parent:j}},C7=(q,_,j)=>{let K=(...Y)=>FA(K,Y.length===1?""+Y[0]:Y.join(" "));return Object.setPrototypeOf(K,eA),K[a2]=q,K[XK]=_,K[w3]=j,K},FA=(q,_)=>{if(q.level<=0||!_)return q[w3]?"":_;let j=q[XK];if(j===void 0)return _;let{openAll:K,closeAll:Y}=j;if(_.includes("\x1B"))while(j!==void 0)_=hY(_,j.close,j.open),j=j.parent;let f=_.indexOf(`
|
||
`);if(f!==-1)_=CY(_,Y,K,f);return K+_+Y};Object.defineProperties(O3.prototype,AK);var UA=O3(),bM=O3({level:MY?MY.level:0});var y=UA;var q9=Oq(yY(),1),u6=(...q)=>{let _,j;if(q.length===0)throw new Error("Missing gradient colors");if(!Array.isArray(q[0])){if(q.length===1)throw new Error(`Expected an array of colors, received ${JSON.stringify(q[0])}`);_=q9.default(...q)}else _=q9.default(q[0]),j=_9(q[1]);let K=(Y,f)=>{return sA(Y?Y.toString():"",_,f??j)};return K.multiline=(Y,f)=>QA(Y?Y.toString():"",_,f??j),K},dY=(q,_,j)=>{return _.interpolation?.toLowerCase()==="hsv"?q.hsv(j,_.hsvSpin?.toLowerCase()||!1):q.rgb(j)};function sA(q,_,j){let K=_9(j),Y=Math.max(q.replace(/\s/g,"").length,_.stops.length),f=dY(_,K,Y),P="";for(let $ of q)P+=$.match(/\s/g)?$:y.hex(f.shift()?.toHex()||"#000")($);return P}function QA(q,_,j){let K=_9(j),Y=q.split(`
|
||
`),f=Math.max(...Y.map((w)=>w.length),_.stops.length),P=dY(_,K,f),$=[];for(let w of Y){let O=P.slice(0),v="";for(let z of w)v+=y.hex(O.shift()?.toHex()||"#000")(z);$.push(v)}return $.join(`
|
||
`)}function _9(q){let _={interpolation:"rgb",hsvSpin:"short",...q};if(q!==void 0&&typeof q!=="object")throw new TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof q}\``);if(typeof _.interpolation!=="string")throw new TypeError(`Expected \`options.interpolation\` to be \`rgb\` or \`hsv\`, got \`${typeof _.interpolation}\``);if(_.interpolation.toLowerCase()==="hsv"&&typeof _.hsvSpin!=="string")throw new TypeError(`Expected \`options.hsvSpin\` to be a \`short\` or \`long\`, got \`${typeof _.hsvSpin}\``);return _}var i6={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"],options:{}},cristal:{colors:["#bdfff3","#4ac29a"],options:{}},teen:{colors:["#77a1d3","#79cbca","#e684ae"],options:{}},mind:{colors:["#473b7b","#3584a7","#30d2be"],options:{}},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"],options:{}},fruit:{colors:["#ff4e50","#f9d423"],options:{}},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"],options:{}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}},summer:{colors:["#fdbb2d","#22c1c3"],options:{}},rainbow:{colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}},pastel:{colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}}};function o6(q){let _=(j)=>u6(...q.colors)(j,q.options);return _.multiline=(j="")=>u6(...q.colors).multiline(j,q.options),_}var N6=u6,qG=o6(i6.atlas),_G=o6(i6.cristal),KG=o6(i6.teen),jG=o6(i6.mind),PG=o6(i6.morning),YG=o6(i6.vice),fG=o6(i6.passion),$G=o6(i6.fruit),wG=o6(i6.instagram),OG=o6(i6.retro),zG=o6(i6.summer),vG=o6(i6.rainbow),WG=o6(i6.pastel);u6.atlas=qG;u6.cristal=_G;u6.teen=KG;u6.mind=jG;u6.morning=PG;u6.vice=YG;u6.passion=fG;u6.fruit=$G;u6.instagram=wG;u6.retro=OG;u6.summer=zG;u6.rainbow=vG;u6.pastel=WG;import E7 from"node:process";function K9({onlyFirst:q=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",q?void 0:"g")}var HG=K9();function j9(q){if(typeof q!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(HG,"")}function LY(q){return q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109}function pY(q){return q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510}function lY(q){return q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9776&&q<=9783||q>=9800&&q<=9811||q===9855||q>=9866&&q<=9871||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12773||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101631&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q>=119552&&q<=119638||q>=119648&&q<=119670||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129673||q>=129679&&q<=129734||q>=129742&&q<=129756||q>=129759&&q<=129769||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141}function JG(q){if(!Number.isSafeInteger(q))throw new TypeError(`Expected a code point, got \`${typeof q}\`.`)}function xY(q,{ambiguousAsWide:_=!1}={}){if(JG(q),pY(q)||lY(q)||_&&LY(q))return 2;return 1}var rY=Oq(cY(),1),TG=new Intl.Segmenter,ZG=/^\p{Default_Ignorable_Code_Point}$/u;function b6(q,_={}){if(typeof q!=="string"||q.length===0)return 0;let{ambiguousIsNarrow:j=!0,countAnsiEscapeCodes:K=!1}=_;if(!K)q=j9(q);if(q.length===0)return 0;let Y=0,f={ambiguousAsWide:!j};for(let{segment:P}of TG.segment(q)){let $=P.codePointAt(0);if($<=31||$>=127&&$<=159)continue;if($>=8203&&$<=8207||$===65279)continue;if($>=768&&$<=879||$>=6832&&$<=6911||$>=7616&&$<=7679||$>=8400&&$<=8447||$>=65056&&$<=65071)continue;if($>=55296&&$<=57343)continue;if($>=65024&&$<=65039)continue;if(ZG.test(P))continue;if(rY.default().test(P)){Y+=2;continue}Y+=xY($,f)}return Y}function M7(q){let _=0;for(let j of q.split(`
|
||
`))_=Math.max(_,b6(j));return _}var Af=Oq(Y9(),1);var XG=/[\p{Lu}]/u,AG=/[\p{Ll}]/u,aY=/^[\p{Lu}](?![\p{Lu}])/gu,eY=/([\p{Alpha}\p{N}_]|$)/u,f9=/[_.\- ]+/,GG=new RegExp("^"+f9.source),BY=new RegExp(f9.source+eY.source,"gu"),tY=new RegExp("\\d+"+eY.source,"gu"),uG=(q,_,j,K)=>{let Y=!1,f=!1,P=!1,$=!1;for(let w=0;w<q.length;w++){let O=q[w];if($=w>2?q[w-3]==="-":!0,Y&&XG.test(O))q=q.slice(0,w)+"-"+q.slice(w),Y=!1,P=f,f=!0,w++;else if(f&&P&&AG.test(O)&&(!$||K))q=q.slice(0,w-1)+"-"+q.slice(w-1),P=f,f=!1,Y=!0;else Y=_(O)===O&&j(O)!==O,P=f,f=j(O)===O&&_(O)!==O}return q},DG=(q,_)=>{return aY.lastIndex=0,q.replaceAll(aY,(j)=>_(j))},hG=(q,_)=>{return BY.lastIndex=0,tY.lastIndex=0,q.replaceAll(tY,(j,K,Y)=>["_","-"].includes(q.charAt(Y+j.length))?j:_(j)).replaceAll(BY,(j,K)=>_(K))};function $9(q,_){if(!(typeof q==="string"||Array.isArray(q)))throw new TypeError("Expected the input to be `string | string[]`");if(_={pascalCase:!1,preserveConsecutiveUppercase:!1,..._},Array.isArray(q))q=q.map((f)=>f.trim()).filter((f)=>f.length).join("-");else q=q.trim();if(q.length===0)return"";let j=_.locale===!1?(f)=>f.toLowerCase():(f)=>f.toLocaleLowerCase(_.locale),K=_.locale===!1?(f)=>f.toUpperCase():(f)=>f.toLocaleUpperCase(_.locale);if(q.length===1){if(f9.test(q))return"";return _.pascalCase?K(q):j(q)}if(q!==j(q))q=uG(q,j,K,_.preserveConsecutiveUppercase);if(q=q.replace(GG,""),q=_.preserveConsecutiveUppercase?DG(q,j):j(q),_.pascalCase)q=K(q.charAt(0))+q.slice(1);return hG(q,K)}var J9=Oq($f(),1);function z9({onlyFirst:q=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",q?void 0:"g")}var RG=z9();function v9(q){if(typeof q!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(RG,"")}var wf=(q=0)=>(_)=>`\x1B[${_+q}m`,Of=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,zf=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,n8={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]}},P0=Object.keys(n8.modifier),mG=Object.keys(n8.color),IG=Object.keys(n8.bgColor),Y0=[...mG,...IG];function gG(){let q=new Map;for(let[_,j]of Object.entries(n8)){for(let[K,Y]of Object.entries(j))n8[K]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},j[K]=n8[K],q.set(Y[0],Y[1]);Object.defineProperty(n8,_,{value:j,enumerable:!1})}return Object.defineProperty(n8,"codes",{value:q,enumerable:!1}),n8.color.close="\x1B[39m",n8.bgColor.close="\x1B[49m",n8.color.ansi=wf(),n8.color.ansi256=Of(),n8.color.ansi16m=zf(),n8.bgColor.ansi=wf(10),n8.bgColor.ansi256=Of(10),n8.bgColor.ansi16m=zf(10),Object.defineProperties(n8,{rgbToAnsi256:{value:(_,j,K)=>{if(_===j&&j===K){if(_<8)return 16;if(_>248)return 231;return Math.round((_-8)/247*24)+232}return 16+36*Math.round(_/255*5)+6*Math.round(j/255*5)+Math.round(K/255*5)},enumerable:!1},hexToRgb:{value:(_)=>{let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;if(K.length===3)K=[...K].map((f)=>f+f).join("");let Y=Number.parseInt(K,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(_)=>n8.rgbToAnsi256(...n8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value:(_)=>{if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,Y;if(_>=232)j=((_-232)*10+8)/255,K=j,Y=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,Y=$%6/5}let f=Math.max(j,K,Y)*2;if(f===0)return 30;let P=30+(Math.round(Y)<<2|Math.round(K)<<1|Math.round(j));if(f===2)P+=60;return P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>n8.ansi256ToAnsi(n8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>n8.ansi256ToAnsi(n8.hexToAnsi256(_)),enumerable:!1}}),n8}var yG=gG(),vf=yG;var b7=new Set(["\x1B",""]),dG=39,H9="\x07",Jf="[",LG="]",Tf="m",N7=`${LG}8;;`,Wf=(q)=>`${b7.values().next().value}${Jf}${q}${Tf}`,Hf=(q)=>`${b7.values().next().value}${N7}${q}${H9}`,pG=(q)=>q.split(" ").map((_)=>b6(_)),W9=(q,_,j)=>{let K=[..._],Y=!1,f=!1,P=b6(v9(q.at(-1)));for(let[$,w]of K.entries()){let O=b6(w);if(P+O<=j)q[q.length-1]+=w;else q.push(w),P=0;if(b7.has(w))Y=!0,f=K.slice($+1,$+1+N7.length).join("")===N7;if(Y){if(f){if(w===H9)Y=!1,f=!1}else if(w===Tf)Y=!1;continue}if(P+=O,P===j&&$<K.length-1)q.push(""),P=0}if(!P&&q.at(-1).length>0&&q.length>1)q[q.length-2]+=q.pop()},lG=(q)=>{let _=q.split(" "),j=_.length;while(j>0){if(b6(_[j-1])>0)break;j--}if(j===_.length)return q;return _.slice(0,j).join(" ")+_.slice(j).join("")},xG=(q,_,j={})=>{if(j.trim!==!1&&q.trim()==="")return"";let K="",Y,f,P=pG(q),$=[""];for(let[z,W]of q.split(" ").entries()){if(j.trim!==!1)$[$.length-1]=$.at(-1).trimStart();let J=b6($.at(-1));if(z!==0){if(J>=_&&(j.wordWrap===!1||j.trim===!1))$.push(""),J=0;if(J>0||j.trim===!1)$[$.length-1]+=" ",J++}if(j.hard&&P[z]>_){let T=_-J,H=1+Math.floor((P[z]-T-1)/_);if(Math.floor((P[z]-1)/_)<H)$.push("");W9($,W,_);continue}if(J+P[z]>_&&J>0&&P[z]>0){if(j.wordWrap===!1&&J<_){W9($,W,_);continue}$.push("")}if(J+P[z]>_&&j.wordWrap===!1){W9($,W,_);continue}$[$.length-1]+=W}if(j.trim!==!1)$=$.map((z)=>lG(z));let w=$.join(`
|
||
`),O=[...w],v=0;for(let[z,W]of O.entries()){if(K+=W,b7.has(W)){let{groups:T}=new RegExp(`(?:\\${Jf}(?<code>\\d+)m|\\${N7}(?<uri>.*)${H9})`).exec(w.slice(v))||{groups:{}};if(T.code!==void 0){let H=Number.parseFloat(T.code);Y=H===dG?void 0:H}else if(T.uri!==void 0)f=T.uri.length===0?void 0:T.uri}let J=vf.codes.get(Number(Y));if(O[z+1]===`
|
||
`){if(f)K+=Hf("");if(Y&&J)K+=Wf(J)}else if(W===`
|
||
`){if(Y&&J)K+=Wf(Y);if(f)K+=Hf(f)}v+=W.length}return K};function S7(q,_,j){return String(q).normalize().replaceAll(`\r
|
||
`,`
|
||
`).split(`
|
||
`).map((K)=>xG(K,_,j)).join(`
|
||
`)}var eG=Oq(Y9(),1),P_=`
|
||
`,a6=" ",v3="none",Gf=()=>{let{env:q,stdout:_,stderr:j}=E7;if(_?.columns)return _.columns;if(j?.columns)return j.columns;if(q.COLUMNS)return Number.parseInt(q.COLUMNS,10);return 80},Zf=(q)=>typeof q==="number"?{top:q,right:q*3,bottom:q,left:q*3}:{top:0,right:0,bottom:0,left:0,...q},W3=(q)=>q===v3?0:2,nG=(q)=>{let _=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"],j;if(q===v3){q={};for(let K of _)q[K]=""}if(typeof q==="string"){if(j=Af.default[q],!j)throw new TypeError(`Invalid border style: ${q}`)}else{if(typeof q?.vertical==="string")q.left=q.vertical,q.right=q.vertical;if(typeof q?.horizontal==="string")q.top=q.horizontal,q.bottom=q.horizontal;for(let K of _)if(q[K]===null||typeof q[K]!=="string")throw new TypeError(`Invalid border style: ${K}`);j=q}return j},cG=(q,_,j)=>{let K="",Y=b6(q);switch(j){case"left":{K=q+_.slice(Y);break}case"right":{K=_.slice(Y)+q;break}default:{if(_=_.slice(Y),_.length%2===1)_=_.slice(Math.floor(_.length/2)),K=_.slice(1)+q+_;else _=_.slice(_.length/2),K=_+q+_;break}}return K},rG=(q,{padding:_,width:j,textAlignment:K,height:Y})=>{q=J9.default(q,{align:K});let f=q.split(P_),P=M7(q),$=j-_.left-_.right;if(P>$){let v=[];for(let z of f){let W=S7(z,$,{hard:!0}),T=J9.default(W,{align:K}).split(`
|
||
`),H=Math.max(...T.map((X)=>b6(X)));for(let X of T){let A;switch(K){case"center":{A=a6.repeat(($-H)/2)+X;break}case"right":{A=a6.repeat($-H)+X;break}default:{A=X;break}}v.push(A)}}f=v}if(K==="center"&&P<$)f=f.map((v)=>a6.repeat(($-P)/2)+v);else if(K==="right"&&P<$)f=f.map((v)=>a6.repeat($-P)+v);let w=a6.repeat(_.left),O=a6.repeat(_.right);if(f=f.map((v)=>{let z=w+v+O;return z+a6.repeat(j-b6(z))}),_.top>0)f=[...Array.from({length:_.top}).fill(a6.repeat(j)),...f];if(_.bottom>0)f=[...f,...Array.from({length:_.bottom}).fill(a6.repeat(j))];if(Y&&f.length>Y)f=f.slice(0,Y);else if(Y&&f.length<Y)f=[...f,...Array.from({length:Y-f.length}).fill(a6.repeat(j))];return f.join(P_)},iG=(q,_,j)=>{let K=(v)=>{let z=j.borderColor?BG(j.borderColor)(v):v;return j.dimBorder?y.dim(z):z},Y=(v)=>j.backgroundColor?tG(j.backgroundColor)(v):v,f=nG(j.borderStyle),P=Gf(),$=a6.repeat(j.margin.left);if(j.float==="center"){let v=Math.max((P-_-W3(j.borderStyle))/2,0);$=a6.repeat(v)}else if(j.float==="right"){let v=Math.max(P-_-j.margin.right-W3(j.borderStyle),0);$=a6.repeat(v)}let w="";if(j.margin.top)w+=P_.repeat(j.margin.top);if(j.borderStyle!==v3||j.title)w+=K($+f.topLeft+(j.title?cG(j.title,f.top.repeat(_),j.titleAlignment):f.top.repeat(_))+f.topRight)+P_;let O=q.split(P_);if(w+=O.map((v)=>$+K(f.left)+Y(v)+K(f.right)).join(P_),j.borderStyle!==v3)w+=P_+K($+f.bottomLeft+f.bottom.repeat(_)+f.bottomRight);if(j.margin.bottom)w+=P_.repeat(j.margin.bottom);return w},oG=(q)=>{if(q.fullscreen&&E7?.stdout){let _=[E7.stdout.columns,E7.stdout.rows];if(typeof q.fullscreen==="function")_=q.fullscreen(..._);q.width||=_[0],q.height||=_[1]}return q.width&&=Math.max(1,q.width-W3(q.borderStyle)),q.height&&=Math.max(1,q.height-W3(q.borderStyle)),q},kf=(q,_)=>_===v3?q:` ${q} `,aG=(q,_)=>{_=oG(_);let j=_.width!==void 0,K=Gf(),Y=W3(_.borderStyle),f=K-_.margin.left-_.margin.right-Y,P=M7(S7(q,K-Y,{hard:!0,trim:!1}))+_.padding.left+_.padding.right;if(_.title&&j)_.title=_.title.slice(0,Math.max(0,_.width-2)),_.title&&=kf(_.title,_.borderStyle);else if(_.title){if(_.title=_.title.slice(0,Math.max(0,f-2)),_.title){if(_.title=kf(_.title,_.borderStyle),b6(_.title)>P)_.width=b6(_.title)}}if(_.width||=P,!j){if(_.margin.left&&_.margin.right&&_.width>f){let w=(K-_.width-Y)/(_.margin.left+_.margin.right);_.margin.left=Math.max(0,Math.floor(_.margin.left*w)),_.margin.right=Math.max(0,Math.floor(_.margin.right*w))}_.width=Math.min(_.width,K-Y-_.margin.left-_.margin.right)}if(_.width-(_.padding.left+_.padding.right)<=0)_.padding.left=0,_.padding.right=0;if(_.height&&_.height-(_.padding.top+_.padding.bottom)<=0)_.padding.top=0,_.padding.bottom=0;return _},T9=(q)=>q.match(/^#(?:[0-f]{3}){1,2}$/i),Xf=(q)=>typeof q==="string"&&(y[q]??T9(q)),BG=(q)=>T9(q)?y.hex(q):y[q],tG=(q)=>T9(q)?y.bgHex(q):y[$9(["bg",q])];function Y_(q,_){if(_={padding:0,borderStyle:"single",dimBorder:!1,textAlignment:"left",float:"left",titleAlignment:"left",..._},_.align)_.textAlignment=_.align;if(_.borderColor&&!Xf(_.borderColor))throw new Error(`${_.borderColor} is not a valid borderColor`);if(_.backgroundColor&&!Xf(_.backgroundColor))throw new Error(`${_.backgroundColor} is not a valid backgroundColor`);return _.padding=Zf(_.padding),_.margin=Zf(_.margin),_=aG(q,_),q=rG(q,_),iG(q,_.width,_)}l6();function k9(q){let _,j=0,K=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];return{start(){_=setInterval(()=>{process.stdout.write(`\r${y.cyan(K[j%K.length])} ${q}`),j++},50)},stop(Y,f=!0){clearInterval(_);let P=f?y.green("✓"):y.red("✗");process.stdout.write(`\r${P} ${Y}
|
||
`)}}}var Z6=(q)=>new Promise((_)=>setTimeout(_,q)),H3=N6(["#ff0000","#ff4500","#ffa500","#ffff00","#00ff00","#00ffff","#0000ff","#8b00ff"]),R7=N6(["#ff006e","#fb5607","#ffbe0b","#8338ec","#3a86ff"]);async function QG(){let q=[{name:"Node.js version",check:async()=>{let j=process.versions.node,[K]=j.split(".").map(Number);return{success:K>=18,message:K>=18?"":`Node.js ${j} is below required version 18.0.0`}}},{name:"Claude Code CLI",check:async()=>{try{return V_("which claude",{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!1,message:"Claude Code CLI not found. Please install: https://docs.anthropic.com/claude/docs/claude-code"}}}},{name:"uv (Python package manager)",check:async()=>{try{return V_("which uv",{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!0,message:"",needsInstall:!0}}}},{name:"Write permissions",check:async()=>{let j=V8($8.getDataDirectory(),"test-permissions");try{return DK(j,{recursive:!0}),N_(V8(j,"test"),"test"),V_(`rm -rf ${j}`,{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!1,message:"No write permissions to claude-mem data directory"}}}}],_=!1;for(let{name:j,check:K}of q){let Y=await K();if(!Y.success)return console.log(Y_(y.red(`❌ ${j} check failed!
|
||
|
||
${Y.message}`),{padding:1,margin:1,borderStyle:"double",borderColor:"red"})),!1;if(Y.needsInstall&&j==="uv (Python package manager)")_=!0}if(_){let j=k9("Installing uv (Python package manager)...");j.start();try{V_("curl -LsSf https://astral.sh/uv/install.sh | sh",{stdio:"pipe",shell:"/bin/sh"}),process.env.PATH=`${Z9()}/.cargo/bin:${process.env.PATH}`,j.stop("uv installed successfully",!0)}catch(K){return j.stop("Failed to install uv automatically",!1),console.log(Y_(y.yellow(`⚠️ Please install uv manually:
|
||
|
||
${y.cyan("curl -LsSf https://astral.sh/uv/install.sh | sh")}
|
||
|
||
Or visit: ${y.cyan("https://docs.astral.sh/uv/getting-started/installation/")}`),{padding:1,margin:1,borderStyle:"round",borderColor:"yellow"})),!1}}return!0}function qu(){try{return V_("which claude",{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||null}catch{return null}}function _u(){let q={hasHooks:!1,hasChromaMcp:!1,hasSettings:!1,scope:void 0},_=$8.getHooksDirectory();q.hasHooks=R8(_)&&R8(V8(_,"pre-compact.js"))&&R8(V8(_,"session-start.js"));let j=$8.getInstance(),K=j.getMcpConfigPath(),Y=j.getProjectMcpConfigPath();if(R8(K))try{if(JSON.parse(GK(K,"utf8")).mcpServers?.["claude-mem"])q.hasChromaMcp=!0,q.scope="user"}catch{}if(R8(Y))try{if(JSON.parse(GK(Y,"utf8")).mcpServers?.["claude-mem"])q.hasChromaMcp=!0,q.scope="project"}catch{}let f=j.getUserSettingsPath();return q.hasSettings=R8(f),q}async function Ku(q){let _={};if(q.hasHooks||q.hasChromaMcp){let f=await r6({message:`\uD83E\uDDE0 Existing claude-mem installation detected. Your memories and data are safe!
|
||
|
||
Reinstall to update hooks and configuration?`,initialValue:!0});if(p8(f))return w6("Installation cancelled"),null;if(!f)return w6("Installation cancelled"),null;_.forceReinstall=!0}else _.forceReinstall=!1;let j=await T6({message:"Select installation scope",options:[{value:"user",label:"User (Recommended)",hint:"Install for current user (~/.claude)"},{value:"project",label:"Project",hint:"Install for current project only (./.mcp.json)"},{value:"local",label:"Local",hint:"Custom local installation"}],initialValue:q.scope||"user"});if(p8(j))return w6("Installation cancelled"),null;if(_.scope=j,j==="local"){let f=await h_({message:"Enter custom installation directory",placeholder:V8(process.cwd(),".claude-mem"),validate:(P)=>{if(!P)return"Path is required";if(!P.startsWith("/")&&!P.startsWith("~"))return"Please provide an absolute path"}});if(p8(f))return w6("Installation cancelled"),null;_.customPath=f}_.hookTimeout=180000;let K=await r6({message:'Enable Smart Trash? This creates an alias for "rm" that moves files to ~/.claude-mem/trash instead of permanently deleting them. You can restore files anytime by typing "claude-mem restore".',initialValue:!0});if(p8(K))return w6("Installation cancelled"),null;_.enableSmartTrash=K;let Y=await r6({message:`claude-mem is designed to save "memories" when you type /compact. The official compact summary + claude-mem produces the best ongoing results, but sometimes you may want to completely clear the context and still retain the "memories" from your last conversation.
|
||
|
||
Would you like to save memories when you type "/clear" in Claude Code? When running /clear with this on, it takes about a minute to save memories before your new session starts.`,initialValue:!1});if(p8(Y))return w6("Installation cancelled"),null;return _.saveMemoriesOnClear=Y,_}async function ju(){let q=$8.getInstance(),_=V8(q.getBackupsDirectory(),new Date().toISOString().replace(/[:.]/g,"-"));try{DK(_,{recursive:!0});let j=q.getHooksDirectory();if(R8(j))X9(j,V8(_,"hooks"));let K=q.getUserSettingsPath();if(R8(K))M_(K,V8(_,"settings.json"));let Y=q.getClaudeSettingsPath();if(R8(Y))M_(Y,V8(_,"claude-settings.json"));return _}catch(j){return null}}function Pu(){let q=$8.getInstance();q.ensureAllDataDirectories(),q.ensureAllClaudeDirectories();let _=V8(q.getDataDirectory(),"package.json");if(!R8(_))N_(_,JSON.stringify({name:"claude-mem-data",type:"module"},null,2))}function X9(q,_){if(UG(q).isDirectory()){if(!R8(_))DK(_,{recursive:!0});sG(q).forEach((Y)=>{X9(V8(q,Y),V8(_,Y))})}else M_(q,_)}function Yu(q=180000){let _=$8.getInstance(),j=_.getHooksDirectory(),K=uf(import.meta.url),f=uK(K),P=null;for(let W=0;W<10;W++){let J=V8(f,"hooks");if(R8(V8(J,"pre-compact.js"))){P=J;break}let T=uK(f);if(T===f)break;f=T}if(!P)try{P=_.findPackageHooksDirectory()}catch(W){throw new Error("Cannot dynamically locate hooks directory. The package may be corrupted.")}let $=["pre-compact.js","session-start.js","session-end.js"];for(let W of $){let J=V8(P,W),T=V8(j,W);if(R8(J))M_(J,T),FG(T,493)}let w=V8(P,"shared"),O=V8(j,"shared");if(R8(w))X9(w,O);let v=V8(j,"config.json");N_(v,JSON.stringify({packageName:eq,cliCommand:eq,backend:"chroma",timeout:q},null,2))}function fu(){let _=$8.getInstance().getClaudeMdPath(),j=uK(_);if(!R8(j))DK(j,{recursive:!0});let K=`
|
||
<!-- CLAUDE-MEM QUICK REFERENCE -->
|
||
## \uD83E\uDDE0 Memory System Quick Reference
|
||
|
||
### Search Your Memories (SIMPLE & POWERFUL)
|
||
- **Semantic search is king**: \`mcp__claude-mem__chroma_query_documents(["search terms"])\`
|
||
- **\uD83D\uDD12 ALWAYS include project name in query**: \`["claude-mem feature authentication"]\` not just \`["feature authentication"]\`
|
||
- **Include dates for temporal search**: \`["project-name 2025-09-09 bug fix"]\` finds memories from that date
|
||
- **Get specific memory**: \`mcp__claude-mem__chroma_get_documents(ids: ["document_id"])\`
|
||
|
||
### Search Tips That Actually Work
|
||
- **Project isolation**: Always prefix queries with project name to avoid cross-contamination
|
||
- **Temporal search**: Include dates (YYYY-MM-DD) in query text to find memories from specific times
|
||
- **Intent-based**: "implementing oauth" > "oauth implementation code function"
|
||
- **Multiple queries**: Search with different phrasings for better coverage
|
||
- **Session-specific**: Include session ID in query when you know it
|
||
|
||
### What Doesn't Work (Don't Do This!)
|
||
- ❌ Complex where filters with $and/$or - they cause errors
|
||
- ❌ Timestamp comparisons ($gte/$lt) - Chroma stores timestamps as strings
|
||
- ❌ Mixing project filters in where clause - causes "Error finding id"
|
||
|
||
### Storage
|
||
- Collection: "claude_memories"
|
||
- Archives: ~/.claude-mem/archives/
|
||
<!-- /CLAUDE-MEM QUICK REFERENCE -->`,Y="";if(R8(_)){Y=GK(_,"utf8");let f=Y.includes("<!-- CLAUDE-MEM INSTRUCTIONS -->"),P=Y.includes("<!-- CLAUDE-MEM QUICK REFERENCE -->");if(f||P){let $,w;if(f)$="<!-- CLAUDE-MEM INSTRUCTIONS -->",w="<!-- /CLAUDE-MEM INSTRUCTIONS -->";else $="<!-- CLAUDE-MEM QUICK REFERENCE -->",w="<!-- /CLAUDE-MEM QUICK REFERENCE -->";let O=Y.indexOf($),v=Y.indexOf(w)+w.length;if(O!==-1&&v!==-1)Y=Y.substring(0,O)+K.trim()+Y.substring(v)}else Y=Y.trim()+`
|
||
`+K}else Y=K.trim();N_(_,Y)}async function $u(){let q=k9("Installing Chroma MCP server...");q.start();try{await Z6(400);try{V_("claude mcp remove claude-mem",{stdio:"pipe"}),await Z6(200)}catch{}let _=`${Z9()}/.cargo/bin`;if(R8(_)&&!process.env.PATH?.includes(_))process.env.PATH=`${_}:${process.env.PATH}`;let j=`claude mcp add claude-mem -- uvx chroma-mcp --client-type persistent --data-dir ${$8.getInstance().getChromaDirectory()}`;return V_(j,{stdio:"pipe",env:process.env}),await Z6(300),q.stop(R7("Chroma MCP server installed successfully! \uD83D\uDE80"),!0),!0}catch(_){return q.stop("Chroma MCP server installation failed",!1),console.log(Y_(y.yellow(`⚠️ Manual installation required:
|
||
|
||
${y.cyan(`claude mcp add claude-mem -- uvx chroma-mcp --client-type persistent --data-dir ${$8.getInstance().getChromaDirectory()}`)}
|
||
|
||
Make sure uv is installed: ${y.cyan("https://docs.astral.sh/uv/getting-started/installation/")}`),{padding:1,margin:1,borderStyle:"round",borderColor:"yellow"})),!1}}async function wu(q,_){let K=$8.getInstance().getHooksDirectory(),Y=V8(K,"pre-compact.js"),f=V8(K,"session-start.js"),P=V8(K,"session-end.js"),$={};if(R8(q)){let O=GK(q,"utf8");$=JSON.parse(O)}let w=uK(q);if(!R8(w))DK(w,{recursive:!0});if(!$.hooks)$.hooks={};if($.hooks.PreCompact){if($.hooks.PreCompact=$.hooks.PreCompact.filter((O)=>!O.hooks?.some((v)=>v.command?.includes(eq)||v.command?.includes("pre-compact.js"))),!$.hooks.PreCompact.length)delete $.hooks.PreCompact}if($.hooks.SessionStart){if($.hooks.SessionStart=$.hooks.SessionStart.filter((O)=>!O.hooks?.some((v)=>v.command?.includes(eq)||v.command?.includes("session-start.js"))),!$.hooks.SessionStart.length)delete $.hooks.SessionStart}if($.hooks.SessionEnd){if($.hooks.SessionEnd=$.hooks.SessionEnd.filter((O)=>!O.hooks?.some((v)=>v.command?.includes(eq)||v.command?.includes("session-end.js"))),!$.hooks.SessionEnd.length)delete $.hooks.SessionEnd}if(!$.hooks.PreCompact)$.hooks.PreCompact=[];if($.hooks.PreCompact.push({hooks:[{type:"command",command:Y,timeout:180}]}),!$.hooks.SessionStart)$.hooks.SessionStart=[];if($.hooks.SessionStart.push({hooks:[{type:"command",command:f,timeout:180}]}),R8(P)){if(!$.hooks.SessionEnd)$.hooks.SessionEnd=[];$.hooks.SessionEnd.push({hooks:[{type:"command",command:P,timeout:180}]})}N_(q,JSON.stringify($,null,2))}async function Ou(){let q=Z9(),_=[V8(q,".bashrc"),V8(q,".zshrc"),V8(q,".bash_profile")],j='alias rm="claude-mem trash"',K="# claude-mem smart trash alias";for(let Y of _){if(!R8(Y))continue;try{let f=GK(Y,"utf8");if(f.includes('alias rm="claude-mem trash"'))continue;f+=`
|
||
# claude-mem smart trash alias
|
||
alias rm="claude-mem trash"
|
||
`,N_(Y,f)}catch(f){}}}function zu(q){let j=new Date().toISOString().replace(/T/,"-").replace(/:/g,"").replace(/\..+/,"").replace(/-/g,""),K=`${j.slice(0,8)}-${j.slice(8)}`;return`${q}.backup.${K}`}function vu(q=!1){let _=$8.getInstance(),j=_.getClaudeCommandsDirectory(),K=uf(import.meta.url),f=uK(K),P=null;for(let z=0;z<10;z++){let W=V8(f,"commands");if(R8(V8(W,"save.md"))){P=W;break}let J=uK(f);if(J===f)break;f=J}if(!P)try{P=_.findPackageCommandsDirectory()}catch(z){throw new Error("Cannot dynamically locate commands directory. The package may be corrupted.")}if(!R8(j))DK(j,{recursive:!0});let $=["save.md","remember.md","claude-mem.md"],w=[],O=[],v=[];for(let z of $){let W=V8(P,z),J=V8(j,z);if(R8(W))if(R8(J))if(q){let T=zu(J);M_(J,T),M_(W,J),v.push(z)}else O.push(z);else M_(W,J),w.push(z)}if(w.length>0)console.log(` ${y.green("✓")} Copied commands: ${w.join(", ")}`);if(v.length>0)console.log(` ${y.blue("\uD83D\uDCE6")} Backed up and replaced commands: ${v.join(", ")}`);if(O.length>0)console.log(` ${y.yellow("→")} Skipped existing commands: ${O.join(", ")}`)}async function Wu(){let q=Kq();q.start("Verifying installation");let _=[],K=$8.getInstance().getHooksDirectory();if(!R8(V8(K,"pre-compact.js")))_.push("Pre-compact hook not found");if(!R8(V8(K,"session-start.js")))_.push("Session-start hook not found");if(_.length>0)q.stop("Installation verification completed with issues"),P6.warn("The following issues were detected:"),_.forEach((Y)=>P6.error(` - ${Y}`)),P6.info("The installation may not work correctly. Consider reinstalling with --force flag.");else q.stop("Installation verified successfully")}async function Df(q={}){console.log(H3(`
|
||
═══════════════════════════════════════`)),console.log(H3(" CLAUDE-MEM INSTALLER ")),console.log(H3("═══════════════════════════════════════")),console.log(Y_(R7(`\uD83E\uDDE0 Persistent Memory System for Claude Code
|
||
|
||
✨ Transform your Claude experience with seamless context preservation
|
||
\uD83D\uDE80 Never lose your conversation history again`),{padding:2,margin:1,borderStyle:"double",borderColor:"magenta",textAlignment:"center"})),await Z6(500);let _=q.user||q.project||q.local||q.force,j;if(_)j={scope:q.local?"local":q.project?"project":"user",customPath:q.path,hookTimeout:q.timeout?parseInt(q.timeout):180,forceReinstall:!!q.force};else{if(!await QG())kq("Please fix the prerequisites issues and try again"),process.exit(1);let v=_u(),z=await Ku(v);if(!z)process.exit(0);j=z}if(j.forceReinstall){let O=await ju();if(O)P6.info(`Backup created at: ${O}`)}console.log(R7(`
|
||
\uD83D\uDE80 Beginning Installation Process
|
||
`));let K=[{name:"Creating directory structure",action:async()=>{await Z6(200),Pu(),await Z6(100)}},{name:"Installing Chroma MCP server",action:async()=>{if(!await $u())throw new Error("MCP installation failed")}},{name:"Adding CLAUDE.md instructions",action:async()=>{await Z6(300),fu(),await Z6(200)}},{name:"Installing Claude commands",action:async()=>{await Z6(200),vu(j.forceReinstall),await Z6(100)}},{name:"Installing memory hooks",action:async()=>{await Z6(400),Yu(j.hookTimeout),await Z6(200)}},{name:"Configuring Claude settings",action:async()=>{await Z6(300);let O;if(j.scope==="local"&&j.customPath)O=V8(j.customPath,"settings.local.json");else if(j.scope==="project")O=V8(process.cwd(),".claude","settings.json");else O=$8.getInstance().getClaudeSettingsPath();await wu(O,j);let z=$8.getInstance().getUserSettingsPath(),W={};if(R8(z))try{W=JSON.parse(GK(z,"utf8"))}catch{}W.backend="chroma",W.installed=!0,W.embedded=!0,W.saveMemoriesOnClear=j.saveMemoriesOnClear||!1;let J=qu();if(J)W.claudePath=J;else delete W.claudePath;N_(z,JSON.stringify(W,null,2)),await Z6(200)}}];if(j.enableSmartTrash)K.push({name:"Configuring Smart Trash alias",action:async()=>{await Z6(200),await Ou(),await Z6(100)}});for(let O=0;O<K.length;O++){let v=K[O],z=`[${O+1}/${K.length}]`,W=k9(`${y.gray(z)} ${v.name}...`);W.start();try{await v.action(),W.stop(`${y.gray(z)} ${v.name} ${R7("completed! ✨")}`)}catch(J){W.stop(`${y.gray(z)} ${v.name} ${y.red("failed")}`,!1),console.log(Y_(y.red(`❌ Installation failed at: ${v.name}
|
||
|
||
Error: ${J}`),{padding:1,margin:1,borderStyle:"double",borderColor:"red"})),process.exit(1)}await Z6(150)}console.log(y.gray(`
|
||
\uD83D\uDD0D Verifying Installation
|
||
`)),await Wu();let Y=H3("\uD83C\uDF89 INSTALLATION COMPLETE! \uD83C\uDF89"),f=j.saveMemoriesOnClear?`${y.cyan("/compact")} or ${y.cyan("/clear")}`:y.cyan("/compact"),P=`
|
||
${y.bold("How your new memory system works:")}
|
||
|
||
${y.green("•")} When you start Claude Code, claude-mem loads your latest memories automatically
|
||
${y.green("•")} Save your work by typing ${f} (takes ~30s to process)
|
||
${y.green("•")} Ask Claude to search your memories anytime with natural language
|
||
${y.green("•")} Instructions added to ${y.cyan("~/.claude/CLAUDE.md")} teach Claude how to use the system
|
||
|
||
${y.bold("Slash Commands Available:")}
|
||
${y.cyan("/claude-mem help")} - Show all memory commands and features
|
||
${y.cyan("/save")} - Quick save of current conversation overview
|
||
${y.cyan("/remember")} - Search your saved memories
|
||
|
||
${y.bold("Quick Start:")}
|
||
${y.yellow("1.")} Restart Claude Code to activate your memory system
|
||
${y.yellow("2.")} Start using Claude normally - memories save automatically
|
||
${y.yellow("3.")} Search memories by asking: ${y.italic('"Search my memories for X"')}`,$=j.enableSmartTrash?`
|
||
|
||
${y.blue("\uD83D\uDDD1️ Smart Trash Enabled:")}
|
||
${y.gray(" • rm commands now move files to ~/.claude-mem/trash")}
|
||
${y.gray(" • View trash:")} ${y.cyan("claude-mem trash view")}
|
||
${y.gray(" • Restore files:")} ${y.cyan("claude-mem restore")}
|
||
${y.gray(" • Empty trash:")} ${y.cyan("claude-mem trash empty")}
|
||
${y.yellow(" • Restart terminal for alias to activate")}`:"",w=j.saveMemoriesOnClear?`
|
||
|
||
${y.magenta("\uD83D\uDCBE Save-on-clear enabled:")}
|
||
${y.gray(" • /clear now saves memories automatically (takes ~1 minute)")}`:"";console.log(Y_(Y+P+$+w,{padding:2,margin:1,borderStyle:"double",borderColor:"green",backgroundColor:"#001122"})),console.log(H3(`
|
||
✨ Welcome to the future of persistent AI conversations! ✨
|
||
`))}l6();import{readFileSync as Hu,writeFileSync as hf,existsSync as Ju}from"fs";import{join as J3}from"path";async function Cf(q={}){console.log("\uD83D\uDD04 Uninstalling Claude Memory System hooks...");let _=[];if(q.all)_.push({name:"User",path:$8.getInstance().getClaudeSettingsPath()}),_.push({name:"Project",path:J3(process.cwd(),".claude","settings.json")});else{let w=q.project,O=$8.getInstance();_.push({name:w?"Project":"User",path:w?J3(process.cwd(),".claude","settings.json"):O.getClaudeSettingsPath()})}let K=$8.getInstance().getHooksDirectory(),Y=J3(K,"pre-compact.js"),f=J3(K,"session-start.js"),P=J3(K,"session-end.js"),$=0;for(let w of _){if(!Ju(w.path)){console.log(`⏭️ No settings found at ${w.name} location`);continue}try{let O=Hu(w.path,"utf8"),v=JSON.parse(O);if(!v.hooks){console.log(`⏭️ No hooks configured in ${w.name} settings`);continue}let z=!1;if(v.hooks.PreCompact){let W=v.hooks.PreCompact.filter((J)=>!J.hooks?.some((T)=>T.command===Y||T.command?.includes("pre-compact.js")||T.command?.includes("claude-mem")));if(W.length!==v.hooks.PreCompact.length)v.hooks.PreCompact=W.length?W:void 0,z=!0,console.log(`✅ Removed PreCompact hook from ${w.name} settings`)}if(v.hooks.SessionStart){let W=v.hooks.SessionStart.filter((J)=>!J.hooks?.some((T)=>T.command===f||T.command?.includes("session-start.js")||T.command?.includes("claude-mem")));if(W.length!==v.hooks.SessionStart.length)v.hooks.SessionStart=W.length?W:void 0,z=!0,console.log(`✅ Removed SessionStart hook from ${w.name} settings`)}if(v.hooks.SessionEnd){let W=v.hooks.SessionEnd.filter((J)=>!J.hooks?.some((T)=>T.command===P||T.command?.includes("session-end.js")||T.command?.includes("claude-mem")));if(W.length!==v.hooks.SessionEnd.length)v.hooks.SessionEnd=W.length?W:void 0,z=!0,console.log(`✅ Removed SessionEnd hook from ${w.name} settings`)}if(v.hooks.PreCompact===void 0)delete v.hooks.PreCompact;if(v.hooks.SessionStart===void 0)delete v.hooks.SessionStart;if(v.hooks.SessionEnd===void 0)delete v.hooks.SessionEnd;if(!Object.keys(v.hooks).length)delete v.hooks;if(z){let W=w.path+".backup."+Date.now();hf(W,O),console.log(`\uD83D\uDCCB Created backup: ${W}`),hf(w.path,JSON.stringify(v,null,2)),$++,console.log(`✅ Updated ${w.name} settings: ${w.path}`)}else console.log(`ℹ️ No Claude Memory System hooks found in ${w.name} settings`)}catch(O){console.log(`⚠️ Could not process ${w.name} settings: ${O.message}`)}}if(console.log(""),$>0)console.log("✨ Uninstallation complete!"),console.log("The Claude Memory System hooks have been removed from your settings."),console.log(""),console.log("Note: Your compressed transcripts and archives are preserved."),console.log("To reinstall: claude-mem install");else console.log("ℹ️ No Claude Memory System hooks were found to remove.")}u9();h9();C9();import{renameSync as vh,existsSync as h$,mkdirSync as Wh,statSync as Hh}from"fs";import{join as Jh,basename as Th}from"path";var V9=(q,_,j)=>{let K=q instanceof RegExp?bf(q,j):q,Y=_ instanceof RegExp?bf(_,j):_,f=K!==null&&Y!=null&&Nu(K,Y,j);return f&&{start:f[0],end:f[1],pre:j.slice(0,f[0]),body:j.slice(f[0]+K.length,f[1]),post:j.slice(f[1]+Y.length)}},bf=(q,_)=>{let j=_.match(q);return j?j[0]:null},Nu=(q,_,j)=>{let K,Y,f,P=void 0,$,w=j.indexOf(q),O=j.indexOf(_,w+1),v=w;if(w>=0&&O>0){if(q===_)return[w,O];K=[],f=j.length;while(v>=0&&!$){if(v===w)K.push(v),w=j.indexOf(q,v+1);else if(K.length===1){let z=K.pop();if(z!==void 0)$=[z,O]}else{if(Y=K.pop(),Y!==void 0&&Y<f)f=Y,P=O;O=j.indexOf(_,v+1)}v=w<O&&w>=0?w:O}if(K.length&&P!==void 0)$=[f,P]}return $};var Sf="\x00SLASH"+Math.random()+"\x00",Ef="\x00OPEN"+Math.random()+"\x00",N9="\x00CLOSE"+Math.random()+"\x00",Rf="\x00COMMA"+Math.random()+"\x00",mf="\x00PERIOD"+Math.random()+"\x00",bu=new RegExp(Sf,"g"),Su=new RegExp(Ef,"g"),Eu=new RegExp(N9,"g"),Ru=new RegExp(Rf,"g"),mu=new RegExp(mf,"g"),Iu=/\\\\/g,gu=/\\{/g,yu=/\\}/g,du=/\\,/g,Lu=/\\./g;function M9(q){return!isNaN(q)?parseInt(q,10):q.charCodeAt(0)}function pu(q){return q.replace(Iu,Sf).replace(gu,Ef).replace(yu,N9).replace(du,Rf).replace(Lu,mf)}function lu(q){return q.replace(bu,"\\").replace(Su,"{").replace(Eu,"}").replace(Ru,",").replace(mu,".")}function If(q){if(!q)return[""];let _=[],j=V9("{","}",q);if(!j)return q.split(",");let{pre:K,body:Y,post:f}=j,P=K.split(",");P[P.length-1]+="{"+Y+"}";let $=If(f);if(f.length)P[P.length-1]+=$.shift(),P.push.apply(P,$);return _.push.apply(_,P),_}function gf(q){if(!q)return[];if(q.slice(0,2)==="{}")q="\\{\\}"+q.slice(2);return k3(pu(q),!0).map(lu)}function xu(q){return"{"+q+"}"}function nu(q){return/^-?0\d/.test(q)}function cu(q,_){return q<=_}function ru(q,_){return q>=_}function k3(q,_){let j=[],K=V9("{","}",q);if(!K)return[q];let Y=K.pre,f=K.post.length?k3(K.post,!1):[""];if(/\$$/.test(K.pre))for(let P=0;P<f.length;P++){let $=Y+"{"+K.body+"}"+f[P];j.push($)}else{let P=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(K.body),$=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(K.body),w=P||$,O=K.body.indexOf(",")>=0;if(!w&&!O){if(K.post.match(/,(?!,).*\}/))return q=K.pre+"{"+K.body+N9+K.post,k3(q);return[q]}let v;if(w)v=K.body.split(/\.\./);else if(v=If(K.body),v.length===1&&v[0]!==void 0){if(v=k3(v[0],!1).map(xu),v.length===1)return f.map((W)=>K.pre+v[0]+W)}let z;if(w&&v[0]!==void 0&&v[1]!==void 0){let W=M9(v[0]),J=M9(v[1]),T=Math.max(v[0].length,v[1].length),H=v.length===3&&v[2]!==void 0?Math.abs(M9(v[2])):1,X=cu;if(J<W)H*=-1,X=ru;let G=v.some(nu);z=[];for(let h=W;X(h,J);h+=H){let M;if($){if(M=String.fromCharCode(h),M==="\\")M=""}else if(M=String(h),G){let I=T-M.length;if(I>0){let N=new Array(I+1).join("0");if(h<0)M="-"+N+M.slice(1);else M=N+M}}z.push(M)}}else{z=[];for(let W=0;W<v.length;W++)z.push.apply(z,k3(v[W],!1))}for(let W=0;W<z.length;W++)for(let J=0;J<f.length;J++){let T=Y+z[W]+f[J];if(!_||w||T)j.push(T)}}return j}var X3=(q)=>{if(typeof q!=="string")throw new TypeError("invalid pattern");if(q.length>65536)throw new TypeError("pattern is too long")};var iu={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},A3=(q)=>q.replace(/[[\]\\-]/g,"\\$&"),ou=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),yf=(q)=>q.join(""),df=(q,_)=>{let j=_;if(q.charAt(j)!=="[")throw new Error("not in a brace expression");let K=[],Y=[],f=j+1,P=!1,$=!1,w=!1,O=!1,v=j,z="";q:while(f<q.length){let H=q.charAt(f);if((H==="!"||H==="^")&&f===j+1){O=!0,f++;continue}if(H==="]"&&P&&!w){v=f+1;break}if(P=!0,H==="\\"){if(!w){w=!0,f++;continue}}if(H==="["&&!w){for(let[X,[A,G,h]]of Object.entries(iu))if(q.startsWith(X,f)){if(z)return["$.",!1,q.length-j,!0];if(f+=X.length,h)Y.push(A);else K.push(A);$=$||G;continue q}}if(w=!1,z){if(H>z)K.push(A3(z)+"-"+A3(H));else if(H===z)K.push(A3(H));z="",f++;continue}if(q.startsWith("-]",f+1)){K.push(A3(H+"-")),f+=2;continue}if(q.startsWith("-",f+1)){z=H,f+=2;continue}K.push(A3(H)),f++}if(v<f)return["",!1,0,!1];if(!K.length&&!Y.length)return["$.",!1,q.length-j,!0];if(Y.length===0&&K.length===1&&/^\\?.$/.test(K[0])&&!O){let H=K[0].length===2?K[0].slice(-1):K[0];return[ou(H),!1,v-j,!1]}let W="["+(O?"^":"")+yf(K)+"]",J="["+(O?"":"^")+yf(Y)+"]";return[K.length&&Y.length?"("+W+"|"+J+")":K.length?W:J,$,v-j,!0]};var Aq=(q,{windowsPathsNoEscape:_=!1}={})=>{return _?q.replace(/\[([^\/\\])\]/g,"$1"):q.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")};var au=new Set(["!","?","+","*","@"]),Lf=(q)=>au.has(q),Bu="(?!(?:^|/)\\.\\.?(?:$|/))",I7="(?!\\.)",tu=new Set(["[","."]),eu=new Set(["..","."]),Fu=new Set("().*{}+?[]^$\\!"),Uu=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),b9="[^/]",pf=b9+"*?",lf=b9+"+?";class k6{type;#q;#_;#Y=!1;#P=[];#f;#G;#X;#z=!1;#$;#W;#v=!1;constructor(q,_,j={}){if(this.type=q,q)this.#_=!0;if(this.#f=_,this.#q=this.#f?this.#f.#q:this,this.#$=this.#q===this?j:this.#q.#$,this.#X=this.#q===this?[]:this.#q.#X,q==="!"&&!this.#q.#z)this.#X.push(this);this.#G=this.#f?this.#f.#P.length:0}get hasMagic(){if(this.#_!==void 0)return this.#_;for(let q of this.#P){if(typeof q==="string")continue;if(q.type||q.hasMagic)return this.#_=!0}return this.#_}toString(){if(this.#W!==void 0)return this.#W;if(!this.type)return this.#W=this.#P.map((q)=>String(q)).join("");else return this.#W=this.type+"("+this.#P.map((q)=>String(q)).join("|")+")"}#w(){if(this!==this.#q)throw new Error("should only call on root");if(this.#z)return this;this.toString(),this.#z=!0;let q;while(q=this.#X.pop()){if(q.type!=="!")continue;let _=q,j=_.#f;while(j){for(let K=_.#G+1;!j.type&&K<j.#P.length;K++)for(let Y of q.#P){if(typeof Y==="string")throw new Error("string part in extglob AST??");Y.copyIn(j.#P[K])}_=j,j=_.#f}}return this}push(...q){for(let _ of q){if(_==="")continue;if(typeof _!=="string"&&!(_ instanceof k6&&_.#f===this))throw new Error("invalid part: "+_);this.#P.push(_)}}toJSON(){let q=this.type===null?this.#P.slice().map((_)=>typeof _==="string"?_:_.toJSON()):[this.type,...this.#P.map((_)=>_.toJSON())];if(this.isStart()&&!this.type)q.unshift([]);if(this.isEnd()&&(this===this.#q||this.#q.#z&&this.#f?.type==="!"))q.push({});return q}isStart(){if(this.#q===this)return!0;if(!this.#f?.isStart())return!1;if(this.#G===0)return!0;let q=this.#f;for(let _=0;_<this.#G;_++){let j=q.#P[_];if(!(j instanceof k6&&j.type==="!"))return!1}return!0}isEnd(){if(this.#q===this)return!0;if(this.#f?.type==="!")return!0;if(!this.#f?.isEnd())return!1;if(!this.type)return this.#f?.isEnd();let q=this.#f?this.#f.#P.length:0;return this.#G===q-1}copyIn(q){if(typeof q==="string")this.push(q);else this.push(q.clone(this))}clone(q){let _=new k6(this.type,q);for(let j of this.#P)_.copyIn(j);return _}static#K(q,_,j,K){let Y=!1,f=!1,P=-1,$=!1;if(_.type===null){let W=j,J="";while(W<q.length){let T=q.charAt(W++);if(Y||T==="\\"){Y=!Y,J+=T;continue}if(f){if(W===P+1){if(T==="^"||T==="!")$=!0}else if(T==="]"&&!(W===P+2&&$))f=!1;J+=T;continue}else if(T==="["){f=!0,P=W,$=!1,J+=T;continue}if(!K.noext&&Lf(T)&&q.charAt(W)==="("){_.push(J),J="";let H=new k6(T,_);W=k6.#K(q,H,W,K),_.push(H);continue}J+=T}return _.push(J),W}let w=j+1,O=new k6(null,_),v=[],z="";while(w<q.length){let W=q.charAt(w++);if(Y||W==="\\"){Y=!Y,z+=W;continue}if(f){if(w===P+1){if(W==="^"||W==="!")$=!0}else if(W==="]"&&!(w===P+2&&$))f=!1;z+=W;continue}else if(W==="["){f=!0,P=w,$=!1,z+=W;continue}if(Lf(W)&&q.charAt(w)==="("){O.push(z),z="";let J=new k6(W,O);O.push(J),w=k6.#K(q,J,w,K);continue}if(W==="|"){O.push(z),z="",v.push(O),O=new k6(null,_);continue}if(W===")"){if(z===""&&_.#P.length===0)_.#v=!0;return O.push(z),z="",_.push(...v,O),w}z+=W}return _.type=null,_.#_=void 0,_.#P=[q.substring(j-1)],w}static fromGlob(q,_={}){let j=new k6(null,void 0,_);return k6.#K(q,j,0,_),j}toMMPattern(){if(this!==this.#q)return this.#q.toMMPattern();let q=this.toString(),[_,j,K,Y]=this.toRegExpSource();if(!(K||this.#_||this.#$.nocase&&!this.#$.nocaseMagicOnly&&q.toUpperCase()!==q.toLowerCase()))return j;let P=(this.#$.nocase?"i":"")+(Y?"u":"");return Object.assign(new RegExp(`^${_}$`,P),{_src:_,_glob:q})}get options(){return this.#$}toRegExpSource(q){let _=q??!!this.#$.dot;if(this.#q===this)this.#w();if(!this.type){let $=this.isStart()&&this.isEnd(),w=this.#P.map((W)=>{let[J,T,H,X]=typeof W==="string"?k6.#u(W,this.#_,$):W.toRegExpSource(q);return this.#_=this.#_||H,this.#Y=this.#Y||X,J}).join(""),O="";if(this.isStart()){if(typeof this.#P[0]==="string"){if(!(this.#P.length===1&&eu.has(this.#P[0]))){let J=tu,T=_&&J.has(w.charAt(0))||w.startsWith("\\.")&&J.has(w.charAt(2))||w.startsWith("\\.\\.")&&J.has(w.charAt(4)),H=!_&&!q&&J.has(w.charAt(0));O=T?Bu:H?I7:""}}}let v="";if(this.isEnd()&&this.#q.#z&&this.#f?.type==="!")v="(?:$|\\/)";return[O+w+v,Aq(w),this.#_=!!this.#_,this.#Y]}let j=this.type==="*"||this.type==="+",K=this.type==="!"?"(?:(?!(?:":"(?:",Y=this.#J(_);if(this.isStart()&&this.isEnd()&&!Y&&this.type!=="!"){let $=this.toString();return this.#P=[$],this.type=null,this.#_=void 0,[$,Aq(this.toString()),!1,!1]}let f=!j||q||_||!I7?"":this.#J(!0);if(f===Y)f="";if(f)Y=`(?:${Y})(?:${f})*?`;let P="";if(this.type==="!"&&this.#v)P=(this.isStart()&&!_?I7:"")+lf;else{let $=this.type==="!"?"))"+(this.isStart()&&!_&&!q?I7:"")+pf+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&f?")":this.type==="*"&&f?")?":`)${this.type}`;P=K+Y+$}return[P,Aq(Y),this.#_=!!this.#_,this.#Y]}#J(q){return this.#P.map((_)=>{if(typeof _==="string")throw new Error("string type in extglob ast??");let[j,K,Y,f]=_.toRegExpSource(q);return this.#Y=this.#Y||f,j}).filter((_)=>!(this.isStart()&&this.isEnd())||!!_).join("|")}static#u(q,_,j=!1){let K=!1,Y="",f=!1;for(let P=0;P<q.length;P++){let $=q.charAt(P);if(K){K=!1,Y+=(Fu.has($)?"\\":"")+$;continue}if($==="\\"){if(P===q.length-1)Y+="\\\\";else K=!0;continue}if($==="["){let[w,O,v,z]=df(q,P);if(v){Y+=w,f=f||O,P+=v-1,_=_||z;continue}}if($==="*"){if(j&&q==="*")Y+=lf;else Y+=pf;_=!0;continue}if($==="?"){Y+=b9,_=!0;continue}Y+=Uu($)}return[Y,Aq(q),!!_,f]}}var hK=(q,{windowsPathsNoEscape:_=!1}={})=>{return _?q.replace(/[?*()[\]]/g,"[$&]"):q.replace(/[?*()[\]\\]/g,"\\$&")};var S6=(q,_,j={})=>{if(X3(_),!j.nocomment&&_.charAt(0)==="#")return!1;return new Yq(_,j).match(q)},su=/^\*+([^+@!?\*\[\(]*)$/,Qu=(q)=>(_)=>!_.startsWith(".")&&_.endsWith(q),qD=(q)=>(_)=>_.endsWith(q),_D=(q)=>{return q=q.toLowerCase(),(_)=>!_.startsWith(".")&&_.toLowerCase().endsWith(q)},KD=(q)=>{return q=q.toLowerCase(),(_)=>_.toLowerCase().endsWith(q)},jD=/^\*+\.\*+$/,PD=(q)=>!q.startsWith(".")&&q.includes("."),YD=(q)=>q!=="."&&q!==".."&&q.includes("."),fD=/^\.\*+$/,$D=(q)=>q!=="."&&q!==".."&&q.startsWith("."),wD=/^\*+$/,OD=(q)=>q.length!==0&&!q.startsWith("."),zD=(q)=>q.length!==0&&q!=="."&&q!=="..",vD=/^\?+([^+@!?\*\[\(]*)?$/,WD=([q,_=""])=>{let j=cf([q]);if(!_)return j;return _=_.toLowerCase(),(K)=>j(K)&&K.toLowerCase().endsWith(_)},HD=([q,_=""])=>{let j=rf([q]);if(!_)return j;return _=_.toLowerCase(),(K)=>j(K)&&K.toLowerCase().endsWith(_)},JD=([q,_=""])=>{let j=rf([q]);return!_?j:(K)=>j(K)&&K.endsWith(_)},TD=([q,_=""])=>{let j=cf([q]);return!_?j:(K)=>j(K)&&K.endsWith(_)},cf=([q])=>{let _=q.length;return(j)=>j.length===_&&!j.startsWith(".")},rf=([q])=>{let _=q.length;return(j)=>j.length===_&&j!=="."&&j!==".."},of=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",xf={win32:{sep:"\\"},posix:{sep:"/"}},ZD=of==="win32"?xf.win32.sep:xf.posix.sep;S6.sep=ZD;var X6=Symbol("globstar **");S6.GLOBSTAR=X6;var kD="[^/]",XD=kD+"*?",AD="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",GD="(?:(?!(?:\\/|^)\\.).)*?",uD=(q,_={})=>(j)=>S6(j,q,_);S6.filter=uD;var Pq=(q,_={})=>Object.assign({},q,_),DD=(q)=>{if(!q||typeof q!=="object"||!Object.keys(q).length)return S6;let _=S6;return Object.assign((K,Y,f={})=>_(K,Y,Pq(q,f)),{Minimatch:class K extends _.Minimatch{constructor(Y,f={}){super(Y,Pq(q,f))}static defaults(Y){return _.defaults(Pq(q,Y)).Minimatch}},AST:class K extends _.AST{constructor(Y,f,P={}){super(Y,f,Pq(q,P))}static fromGlob(Y,f={}){return _.AST.fromGlob(Y,Pq(q,f))}},unescape:(K,Y={})=>_.unescape(K,Pq(q,Y)),escape:(K,Y={})=>_.escape(K,Pq(q,Y)),filter:(K,Y={})=>_.filter(K,Pq(q,Y)),defaults:(K)=>_.defaults(Pq(q,K)),makeRe:(K,Y={})=>_.makeRe(K,Pq(q,Y)),braceExpand:(K,Y={})=>_.braceExpand(K,Pq(q,Y)),match:(K,Y,f={})=>_.match(K,Y,Pq(q,f)),sep:_.sep,GLOBSTAR:X6})};S6.defaults=DD;var af=(q,_={})=>{if(X3(q),_.nobrace||!/\{(?:(?!\{).)*\}/.test(q))return[q];return gf(q)};S6.braceExpand=af;var hD=(q,_={})=>new Yq(q,_).makeRe();S6.makeRe=hD;var CD=(q,_,j={})=>{let K=new Yq(_,j);if(q=q.filter((Y)=>K.match(Y)),K.options.nonull&&!q.length)q.push(_);return q};S6.match=CD;var nf=/[?*]|[+@!]\(.*?\)|\[|\]/,VD=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Yq{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(q,_={}){if(X3(q),_=_||{},this.options=_,this.pattern=q,this.platform=_.platform||of,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!_.windowsPathsNoEscape||_.allowWindowsEscape===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!_.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!_.nonegate,this.comment=!1,this.empty=!1,this.partial=!!_.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=_.windowsNoMagicRoot!==void 0?_.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let q of this.set)for(let _ of q)if(typeof _!=="string")return!0;return!1}debug(...q){}make(){let q=this.pattern,_=this.options;if(!_.nocomment&&q.charAt(0)==="#"){this.comment=!0;return}if(!q){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],_.debug)this.debug=(...Y)=>console.error(...Y);this.debug(this.pattern,this.globSet);let j=this.globSet.map((Y)=>this.slashSplit(Y));this.globParts=this.preprocess(j),this.debug(this.pattern,this.globParts);let K=this.globParts.map((Y,f,P)=>{if(this.isWindows&&this.windowsNoMagicRoot){let $=Y[0]===""&&Y[1]===""&&(Y[2]==="?"||!nf.test(Y[2]))&&!nf.test(Y[3]),w=/^[a-z]:/i.test(Y[0]);if($)return[...Y.slice(0,4),...Y.slice(4).map((O)=>this.parse(O))];else if(w)return[Y[0],...Y.slice(1).map((O)=>this.parse(O))]}return Y.map(($)=>this.parse($))});if(this.debug(this.pattern,K),this.set=K.filter((Y)=>Y.indexOf(!1)===-1),this.isWindows)for(let Y=0;Y<this.set.length;Y++){let f=this.set[Y];if(f[0]===""&&f[1]===""&&this.globParts[Y][2]==="?"&&typeof f[3]==="string"&&/^[a-z]:$/i.test(f[3]))f[2]="?"}this.debug(this.pattern,this.set)}preprocess(q){if(this.options.noglobstar){for(let j=0;j<q.length;j++)for(let K=0;K<q[j].length;K++)if(q[j][K]==="**")q[j][K]="*"}let{optimizationLevel:_=1}=this.options;if(_>=2)q=this.firstPhasePreProcess(q),q=this.secondPhasePreProcess(q);else if(_>=1)q=this.levelOneOptimize(q);else q=this.adjascentGlobstarOptimize(q);return q}adjascentGlobstarOptimize(q){return q.map((_)=>{let j=-1;while((j=_.indexOf("**",j+1))!==-1){let K=j;while(_[K+1]==="**")K++;if(K!==j)_.splice(j,K-j)}return _})}levelOneOptimize(q){return q.map((_)=>{return _=_.reduce((j,K)=>{let Y=j[j.length-1];if(K==="**"&&Y==="**")return j;if(K===".."){if(Y&&Y!==".."&&Y!=="."&&Y!=="**")return j.pop(),j}return j.push(K),j},[]),_.length===0?[""]:_})}levelTwoFileOptimize(q){if(!Array.isArray(q))q=this.slashSplit(q);let _=!1;do{if(_=!1,!this.preserveMultipleSlashes){for(let K=1;K<q.length-1;K++){let Y=q[K];if(K===1&&Y===""&&q[0]==="")continue;if(Y==="."||Y==="")_=!0,q.splice(K,1),K--}if(q[0]==="."&&q.length===2&&(q[1]==="."||q[1]===""))_=!0,q.pop()}let j=0;while((j=q.indexOf("..",j+1))!==-1){let K=q[j-1];if(K&&K!=="."&&K!==".."&&K!=="**")_=!0,q.splice(j-1,2),j-=2}}while(_);return q.length===0?[""]:q}firstPhasePreProcess(q){let _=!1;do{_=!1;for(let j of q){let K=-1;while((K=j.indexOf("**",K+1))!==-1){let f=K;while(j[f+1]==="**")f++;if(f>K)j.splice(K+1,f-K);let P=j[K+1],$=j[K+2],w=j[K+3];if(P!=="..")continue;if(!$||$==="."||$===".."||!w||w==="."||w==="..")continue;_=!0,j.splice(K,1);let O=j.slice(0);O[K]="**",q.push(O),K--}if(!this.preserveMultipleSlashes){for(let f=1;f<j.length-1;f++){let P=j[f];if(f===1&&P===""&&j[0]==="")continue;if(P==="."||P==="")_=!0,j.splice(f,1),f--}if(j[0]==="."&&j.length===2&&(j[1]==="."||j[1]===""))_=!0,j.pop()}let Y=0;while((Y=j.indexOf("..",Y+1))!==-1){let f=j[Y-1];if(f&&f!=="."&&f!==".."&&f!=="**"){_=!0;let $=Y===1&&j[Y+1]==="**"?["."]:[];if(j.splice(Y-1,2,...$),j.length===0)j.push("");Y-=2}}}}while(_);return q}secondPhasePreProcess(q){for(let _=0;_<q.length-1;_++)for(let j=_+1;j<q.length;j++){let K=this.partsMatch(q[_],q[j],!this.preserveMultipleSlashes);if(K){q[_]=[],q[j]=K;break}}return q.filter((_)=>_.length)}partsMatch(q,_,j=!1){let K=0,Y=0,f=[],P="";while(K<q.length&&Y<_.length)if(q[K]===_[Y])f.push(P==="b"?_[Y]:q[K]),K++,Y++;else if(j&&q[K]==="**"&&_[Y]===q[K+1])f.push(q[K]),K++;else if(j&&_[Y]==="**"&&q[K]===_[Y+1])f.push(_[Y]),Y++;else if(q[K]==="*"&&_[Y]&&(this.options.dot||!_[Y].startsWith("."))&&_[Y]!=="**"){if(P==="b")return!1;P="a",f.push(q[K]),K++,Y++}else if(_[Y]==="*"&&q[K]&&(this.options.dot||!q[K].startsWith("."))&&q[K]!=="**"){if(P==="a")return!1;P="b",f.push(_[Y]),K++,Y++}else return!1;return q.length===_.length&&f}parseNegate(){if(this.nonegate)return;let q=this.pattern,_=!1,j=0;for(let K=0;K<q.length&&q.charAt(K)==="!";K++)_=!_,j++;if(j)this.pattern=q.slice(j);this.negate=_}matchOne(q,_,j=!1){let K=this.options;if(this.isWindows){let T=typeof q[0]==="string"&&/^[a-z]:$/i.test(q[0]),H=!T&&q[0]===""&&q[1]===""&&q[2]==="?"&&/^[a-z]:$/i.test(q[3]),X=typeof _[0]==="string"&&/^[a-z]:$/i.test(_[0]),A=!X&&_[0]===""&&_[1]===""&&_[2]==="?"&&typeof _[3]==="string"&&/^[a-z]:$/i.test(_[3]),G=H?3:T?0:void 0,h=A?3:X?0:void 0;if(typeof G==="number"&&typeof h==="number"){let[M,I]=[q[G],_[h]];if(M.toLowerCase()===I.toLowerCase()){if(_[h]=M,h>G)_=_.slice(h);else if(G>h)q=q.slice(G)}}}let{optimizationLevel:Y=1}=this.options;if(Y>=2)q=this.levelTwoFileOptimize(q);this.debug("matchOne",this,{file:q,pattern:_}),this.debug("matchOne",q.length,_.length);for(var f=0,P=0,$=q.length,w=_.length;f<$&&P<w;f++,P++){this.debug("matchOne loop");var O=_[P],v=q[f];if(this.debug(_,O,v),O===!1)return!1;if(O===X6){this.debug("GLOBSTAR",[_,O,v]);var z=f,W=P+1;if(W===w){this.debug("** at the end");for(;f<$;f++)if(q[f]==="."||q[f]===".."||!K.dot&&q[f].charAt(0)===".")return!1;return!0}while(z<$){var J=q[z];if(this.debug(`
|
||
globstar while`,q,z,_,W,J),this.matchOne(q.slice(z),_.slice(W),j))return this.debug("globstar found match!",z,$,J),!0;else{if(J==="."||J===".."||!K.dot&&J.charAt(0)==="."){this.debug("dot detected!",q,z,_,W);break}this.debug("globstar swallow a segment, and continue"),z++}}if(j){if(this.debug(`
|
||
>>> no match, partial?`,q,z,_,W),z===$)return!0}return!1}let T;if(typeof O==="string")T=v===O,this.debug("string match",O,v,T);else T=O.test(v),this.debug("pattern match",O,v,T);if(!T)return!1}if(f===$&&P===w)return!0;else if(f===$)return j;else if(P===w)return f===$-1&&q[f]==="";else throw new Error("wtf?")}braceExpand(){return af(this.pattern,this.options)}parse(q){X3(q);let _=this.options;if(q==="**")return X6;if(q==="")return"";let j,K=null;if(j=q.match(wD))K=_.dot?zD:OD;else if(j=q.match(su))K=(_.nocase?_.dot?KD:_D:_.dot?qD:Qu)(j[1]);else if(j=q.match(vD))K=(_.nocase?_.dot?HD:WD:_.dot?JD:TD)(j);else if(j=q.match(jD))K=_.dot?YD:PD;else if(j=q.match(fD))K=$D;let Y=k6.fromGlob(q,this.options).toMMPattern();if(K&&typeof Y==="object")Reflect.defineProperty(Y,"test",{value:K});return Y}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let q=this.set;if(!q.length)return this.regexp=!1,this.regexp;let _=this.options,j=_.noglobstar?XD:_.dot?AD:GD,K=new Set(_.nocase?["i"]:[]),Y=q.map(($)=>{let w=$.map((O)=>{if(O instanceof RegExp)for(let v of O.flags.split(""))K.add(v);return typeof O==="string"?VD(O):O===X6?X6:O._src});return w.forEach((O,v)=>{let z=w[v+1],W=w[v-1];if(O!==X6||W===X6)return;if(W===void 0)if(z!==void 0&&z!==X6)w[v+1]="(?:\\/|"+j+"\\/)?"+z;else w[v]=j;else if(z===void 0)w[v-1]=W+"(?:\\/|"+j+")?";else if(z!==X6)w[v-1]=W+"(?:\\/|\\/"+j+"\\/)"+z,w[v+1]=X6}),w.filter((O)=>O!==X6).join("/")}).join("|"),[f,P]=q.length>1?["(?:",")"]:["",""];if(Y="^"+f+Y+P+"$",this.negate)Y="^(?!"+Y+").+$";try{this.regexp=new RegExp(Y,[...K].join(""))}catch($){this.regexp=!1}return this.regexp}slashSplit(q){if(this.preserveMultipleSlashes)return q.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test(q))return["",...q.split(/\/+/)];else return q.split(/\/+/)}match(q,_=this.partial){if(this.debug("match",q,this.pattern),this.comment)return!1;if(this.empty)return q==="";if(q==="/"&&_)return!0;let j=this.options;if(this.isWindows)q=q.split("\\").join("/");let K=this.slashSplit(q);this.debug(this.pattern,"split",K);let Y=this.set;this.debug(this.pattern,"set",Y);let f=K[K.length-1];if(!f)for(let P=K.length-2;!f&&P>=0;P--)f=K[P];for(let P=0;P<Y.length;P++){let $=Y[P],w=K;if(j.matchBase&&$.length===1)w=[f];if(this.matchOne(w,$,_)){if(j.flipNegate)return!0;return!this.negate}}if(j.flipNegate)return!1;return this.negate}static defaults(q){return S6.defaults(q).Minimatch}}S6.AST=k6;S6.Minimatch=Yq;S6.escape=hK;S6.unescape=Aq;import{fileURLToPath as Ph}from"node:url";var MD=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,tf=new Set,S9=typeof process==="object"&&!!process?process:{},ef=(q,_,j,K)=>{typeof S9.emitWarning==="function"?S9.emitWarning(q,_,j,K):console.error(`[${j}] ${_}: ${q}`)},g7=globalThis.AbortController,Bf=globalThis.AbortSignal;if(typeof g7==="undefined"){Bf=class j{onabort;_onabort=[];reason;aborted=!1;addEventListener(K,Y){this._onabort.push(Y)}},g7=class j{constructor(){_()}signal=new Bf;abort(K){if(this.signal.aborted)return;this.signal.reason=K,this.signal.aborted=!0;for(let Y of this.signal._onabort)Y(K);this.signal.onabort?.(K)}};let q=S9.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",_=()=>{if(!q)return;q=!1,ef("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",_)}}var ND=(q)=>!tf.has(q),JN=Symbol("type"),f_=(q)=>q&&q===Math.floor(q)&&q>0&&isFinite(q),Ff=(q)=>!f_(q)?null:q<=Math.pow(2,8)?Uint8Array:q<=Math.pow(2,16)?Uint16Array:q<=Math.pow(2,32)?Uint32Array:q<=Number.MAX_SAFE_INTEGER?G3:null;class G3 extends Array{constructor(q){super(q);this.fill(0)}}class CK{heap;length;static#q=!1;static create(q){let _=Ff(q);if(!_)return[];CK.#q=!0;let j=new CK(q,_);return CK.#q=!1,j}constructor(q,_){if(!CK.#q)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new _(q),this.length=0}push(q){this.heap[this.length++]=q}pop(){return this.heap[--this.length]}}class u3{#q;#_;#Y;#P;#f;#G;#X;#z;get perf(){return this.#z}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#$;#W;#v;#w;#K;#J;#u;#A;#T;#b;#Z;#h;#M;#k;#D;#N;#H;#j;static unsafeExposeInternals(q){return{starts:q.#M,ttls:q.#k,sizes:q.#h,keyMap:q.#v,keyList:q.#w,valList:q.#K,next:q.#J,prev:q.#u,get head(){return q.#A},get tail(){return q.#T},free:q.#b,isBackgroundFetch:(_)=>q.#O(_),backgroundFetch:(_,j,K,Y)=>q.#r(_,j,K,Y),moveToTail:(_)=>q.#L(_),indexes:(_)=>q.#E(_),rindexes:(_)=>q.#m(_),isStale:(_)=>q.#V(_)}}get max(){return this.#q}get maxSize(){return this.#_}get calculatedSize(){return this.#W}get size(){return this.#$}get fetchMethod(){return this.#G}get memoMethod(){return this.#X}get dispose(){return this.#Y}get onInsert(){return this.#P}get disposeAfter(){return this.#f}constructor(q){let{max:_=0,ttl:j,ttlResolution:K=1,ttlAutopurge:Y,updateAgeOnGet:f,updateAgeOnHas:P,allowStale:$,dispose:w,onInsert:O,disposeAfter:v,noDisposeOnSet:z,noUpdateTTL:W,maxSize:J=0,maxEntrySize:T=0,sizeCalculation:H,fetchMethod:X,memoMethod:A,noDeleteOnFetchRejection:G,noDeleteOnStaleGet:h,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:I,ignoreFetchAbort:N,perf:R}=q;if(R!==void 0){if(typeof R?.now!=="function")throw new TypeError("perf option must have a now() method if specified")}if(this.#z=R??MD,_!==0&&!f_(_))throw new TypeError("max option must be a nonnegative integer");let l=_?Ff(_):Array;if(!l)throw new Error("invalid max value: "+_);if(this.#q=_,this.#_=J,this.maxEntrySize=T||this.#_,this.sizeCalculation=H,this.sizeCalculation){if(!this.#_&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!=="function")throw new TypeError("memoMethod must be a function if defined");if(this.#X=A,X!==void 0&&typeof X!=="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#G=X,this.#N=!!X,this.#v=new Map,this.#w=new Array(_).fill(void 0),this.#K=new Array(_).fill(void 0),this.#J=new l(_),this.#u=new l(_),this.#A=0,this.#T=0,this.#b=CK.create(_),this.#$=0,this.#W=0,typeof w==="function")this.#Y=w;if(typeof O==="function")this.#P=O;if(typeof v==="function")this.#f=v,this.#Z=[];else this.#f=void 0,this.#Z=void 0;if(this.#D=!!this.#Y,this.#j=!!this.#P,this.#H=!!this.#f,this.noDisposeOnSet=!!z,this.noUpdateTTL=!!W,this.noDeleteOnFetchRejection=!!G,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!N,this.maxEntrySize!==0){if(this.#_!==0){if(!f_(this.#_))throw new TypeError("maxSize must be a positive integer if specified")}if(!f_(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#p()}if(this.allowStale=!!$,this.noDeleteOnStaleGet=!!h,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!P,this.ttlResolution=f_(K)||K===0?K:1,this.ttlAutopurge=!!Y,this.ttl=j||0,this.ttl){if(!f_(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#q===0&&this.ttl===0&&this.#_===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#q&&!this.#_){if(ND("LRU_CACHE_UNBOUNDED"))tf.add("LRU_CACHE_UNBOUNDED"),ef("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",u3)}}getRemainingTTL(q){return this.#v.has(q)?1/0:0}#I(){let q=new G3(this.#q),_=new G3(this.#q);this.#k=q,this.#M=_,this.#n=(Y,f,P=this.#z.now())=>{if(_[Y]=f!==0?P:0,q[Y]=f,f!==0&&this.ttlAutopurge){let $=setTimeout(()=>{if(this.#V(Y))this.#R(this.#w[Y],"expire")},f+1);if($.unref)$.unref()}},this.#S=(Y)=>{_[Y]=q[Y]!==0?this.#z.now():0},this.#C=(Y,f)=>{if(q[f]){let P=q[f],$=_[f];if(!P||!$)return;Y.ttl=P,Y.start=$,Y.now=j||K();let w=Y.now-$;Y.remainingTTL=P-w}};let j=0,K=()=>{let Y=this.#z.now();if(this.ttlResolution>0){j=Y;let f=setTimeout(()=>j=0,this.ttlResolution);if(f.unref)f.unref()}return Y};this.getRemainingTTL=(Y)=>{let f=this.#v.get(Y);if(f===void 0)return 0;let P=q[f],$=_[f];if(!P||!$)return 1/0;let w=(j||K())-$;return P-w},this.#V=(Y)=>{let f=_[Y],P=q[Y];return!!P&&!!f&&(j||K())-f>P}}#S=()=>{};#C=()=>{};#n=()=>{};#V=()=>!1;#p(){let q=new G3(this.#q);this.#W=0,this.#h=q,this.#g=(_)=>{this.#W-=q[_],q[_]=0},this.#y=(_,j,K,Y)=>{if(this.#O(j))return 0;if(!f_(K))if(Y){if(typeof Y!=="function")throw new TypeError("sizeCalculation must be a function");if(K=Y(j,_),!f_(K))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return K},this.#l=(_,j,K)=>{if(q[_]=j,this.#_){let Y=this.#_-q[_];while(this.#W>Y)this.#d(!0)}if(this.#W+=q[_],K)K.entrySize=j,K.totalCalculatedSize=this.#W}}#g=(q)=>{};#l=(q,_,j)=>{};#y=(q,_,j,K)=>{if(j||K)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#E({allowStale:q=this.allowStale}={}){if(this.#$)for(let _=this.#T;;){if(!this.#c(_))break;if(q||!this.#V(_))yield _;if(_===this.#A)break;else _=this.#u[_]}}*#m({allowStale:q=this.allowStale}={}){if(this.#$)for(let _=this.#A;;){if(!this.#c(_))break;if(q||!this.#V(_))yield _;if(_===this.#T)break;else _=this.#J[_]}}#c(q){return q!==void 0&&this.#v.get(this.#w[q])===q}*entries(){for(let q of this.#E())if(this.#K[q]!==void 0&&this.#w[q]!==void 0&&!this.#O(this.#K[q]))yield[this.#w[q],this.#K[q]]}*rentries(){for(let q of this.#m())if(this.#K[q]!==void 0&&this.#w[q]!==void 0&&!this.#O(this.#K[q]))yield[this.#w[q],this.#K[q]]}*keys(){for(let q of this.#E()){let _=this.#w[q];if(_!==void 0&&!this.#O(this.#K[q]))yield _}}*rkeys(){for(let q of this.#m()){let _=this.#w[q];if(_!==void 0&&!this.#O(this.#K[q]))yield _}}*values(){for(let q of this.#E())if(this.#K[q]!==void 0&&!this.#O(this.#K[q]))yield this.#K[q]}*rvalues(){for(let q of this.#m())if(this.#K[q]!==void 0&&!this.#O(this.#K[q]))yield this.#K[q]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(q,_={}){for(let j of this.#E()){let K=this.#K[j],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0)continue;if(q(Y,this.#w[j],this))return this.get(this.#w[j],_)}}forEach(q,_=this){for(let j of this.#E()){let K=this.#K[j],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0)continue;q.call(_,Y,this.#w[j],this)}}rforEach(q,_=this){for(let j of this.#m()){let K=this.#K[j],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0)continue;q.call(_,Y,this.#w[j],this)}}purgeStale(){let q=!1;for(let _ of this.#m({allowStale:!0}))if(this.#V(_))this.#R(this.#w[_],"expire"),q=!0;return q}info(q){let _=this.#v.get(q);if(_===void 0)return;let j=this.#K[_],K=this.#O(j)?j.__staleWhileFetching:j;if(K===void 0)return;let Y={value:K};if(this.#k&&this.#M){let f=this.#k[_],P=this.#M[_];if(f&&P){let $=f-(this.#z.now()-P);Y.ttl=$,Y.start=Date.now()}}if(this.#h)Y.size=this.#h[_];return Y}dump(){let q=[];for(let _ of this.#E({allowStale:!0})){let j=this.#w[_],K=this.#K[_],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0||j===void 0)continue;let f={value:Y};if(this.#k&&this.#M){f.ttl=this.#k[_];let P=this.#z.now()-this.#M[_];f.start=Math.floor(Date.now()-P)}if(this.#h)f.size=this.#h[_];q.unshift([j,f])}return q}load(q){this.clear();for(let[_,j]of q){if(j.start){let K=Date.now()-j.start;j.start=this.#z.now()-K}this.set(_,j.value,j)}}set(q,_,j={}){if(_===void 0)return this.delete(q),this;let{ttl:K=this.ttl,start:Y,noDisposeOnSet:f=this.noDisposeOnSet,sizeCalculation:P=this.sizeCalculation,status:$}=j,{noUpdateTTL:w=this.noUpdateTTL}=j,O=this.#y(q,_,j.size||0,P);if(this.maxEntrySize&&O>this.maxEntrySize){if($)$.set="miss",$.maxEntrySizeExceeded=!0;return this.#R(q,"set"),this}let v=this.#$===0?void 0:this.#v.get(q);if(v===void 0){if(v=this.#$===0?this.#T:this.#b.length!==0?this.#b.pop():this.#$===this.#q?this.#d(!1):this.#$,this.#w[v]=q,this.#K[v]=_,this.#v.set(q,v),this.#J[this.#T]=v,this.#u[v]=this.#T,this.#T=v,this.#$++,this.#l(v,O,$),$)$.set="add";if(w=!1,this.#j)this.#P?.(_,q,"add")}else{this.#L(v);let z=this.#K[v];if(_!==z){if(this.#N&&this.#O(z)){z.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:W}=z;if(W!==void 0&&!f){if(this.#D)this.#Y?.(W,q,"set");if(this.#H)this.#Z?.push([W,q,"set"])}}else if(!f){if(this.#D)this.#Y?.(z,q,"set");if(this.#H)this.#Z?.push([z,q,"set"])}if(this.#g(v),this.#l(v,O,$),this.#K[v]=_,$){$.set="replace";let W=z&&this.#O(z)?z.__staleWhileFetching:z;if(W!==void 0)$.oldValue=W}}else if($)$.set="update";if(this.#j)this.onInsert?.(_,q,_===z?"update":"replace")}if(K!==0&&!this.#k)this.#I();if(this.#k){if(!w)this.#n(v,K,Y);if($)this.#C($,v)}if(!f&&this.#H&&this.#Z){let z=this.#Z,W;while(W=z?.shift())this.#f?.(...W)}return this}pop(){try{while(this.#$){let q=this.#K[this.#A];if(this.#d(!0),this.#O(q)){if(q.__staleWhileFetching)return q.__staleWhileFetching}else if(q!==void 0)return q}}finally{if(this.#H&&this.#Z){let q=this.#Z,_;while(_=q?.shift())this.#f?.(..._)}}}#d(q){let _=this.#A,j=this.#w[_],K=this.#K[_];if(this.#N&&this.#O(K))K.__abortController.abort(new Error("evicted"));else if(this.#D||this.#H){if(this.#D)this.#Y?.(K,j,"evict");if(this.#H)this.#Z?.push([K,j,"evict"])}if(this.#g(_),q)this.#w[_]=void 0,this.#K[_]=void 0,this.#b.push(_);if(this.#$===1)this.#A=this.#T=0,this.#b.length=0;else this.#A=this.#J[_];return this.#v.delete(j),this.#$--,_}has(q,_={}){let{updateAgeOnHas:j=this.updateAgeOnHas,status:K}=_,Y=this.#v.get(q);if(Y!==void 0){let f=this.#K[Y];if(this.#O(f)&&f.__staleWhileFetching===void 0)return!1;if(!this.#V(Y)){if(j)this.#S(Y);if(K)K.has="hit",this.#C(K,Y);return!0}else if(K)K.has="stale",this.#C(K,Y)}else if(K)K.has="miss";return!1}peek(q,_={}){let{allowStale:j=this.allowStale}=_,K=this.#v.get(q);if(K===void 0||!j&&this.#V(K))return;let Y=this.#K[K];return this.#O(Y)?Y.__staleWhileFetching:Y}#r(q,_,j,K){let Y=_===void 0?void 0:this.#K[_];if(this.#O(Y))return Y;let f=new g7,{signal:P}=j;P?.addEventListener("abort",()=>f.abort(P.reason),{signal:f.signal});let $={signal:f.signal,options:j,context:K},w=(T,H=!1)=>{let{aborted:X}=f.signal,A=j.ignoreFetchAbort&&T!==void 0;if(j.status)if(X&&!H){if(j.status.fetchAborted=!0,j.status.fetchError=f.signal.reason,A)j.status.fetchAbortIgnored=!0}else j.status.fetchResolved=!0;if(X&&!A&&!H)return v(f.signal.reason);let G=W;if(this.#K[_]===W)if(T===void 0)if(G.__staleWhileFetching!==void 0)this.#K[_]=G.__staleWhileFetching;else this.#R(q,"fetch");else{if(j.status)j.status.fetchUpdated=!0;this.set(q,T,$.options)}return T},O=(T)=>{if(j.status)j.status.fetchRejected=!0,j.status.fetchError=T;return v(T)},v=(T)=>{let{aborted:H}=f.signal,X=H&&j.allowStaleOnFetchAbort,A=X||j.allowStaleOnFetchRejection,G=A||j.noDeleteOnFetchRejection,h=W;if(this.#K[_]===W){if(!G||h.__staleWhileFetching===void 0)this.#R(q,"fetch");else if(!X)this.#K[_]=h.__staleWhileFetching}if(A){if(j.status&&h.__staleWhileFetching!==void 0)j.status.returnedStale=!0;return h.__staleWhileFetching}else if(h.__returned===h)throw T},z=(T,H)=>{let X=this.#G?.(q,Y,$);if(X&&X instanceof Promise)X.then((A)=>T(A===void 0?void 0:A),H);f.signal.addEventListener("abort",()=>{if(!j.ignoreFetchAbort||j.allowStaleOnFetchAbort){if(T(void 0),j.allowStaleOnFetchAbort)T=(A)=>w(A,!0)}})};if(j.status)j.status.fetchDispatched=!0;let W=new Promise(z).then(w,O),J=Object.assign(W,{__abortController:f,__staleWhileFetching:Y,__returned:void 0});if(_===void 0)this.set(q,J,{...$.options,status:void 0}),_=this.#v.get(q);else this.#K[_]=J;return J}#O(q){if(!this.#N)return!1;let _=q;return!!_&&_ instanceof Promise&&_.hasOwnProperty("__staleWhileFetching")&&_.__abortController instanceof g7}async fetch(q,_={}){let{allowStale:j=this.allowStale,updateAgeOnGet:K=this.updateAgeOnGet,noDeleteOnStaleGet:Y=this.noDeleteOnStaleGet,ttl:f=this.ttl,noDisposeOnSet:P=this.noDisposeOnSet,size:$=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:O=this.noUpdateTTL,noDeleteOnFetchRejection:v=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:z=this.allowStaleOnFetchRejection,ignoreFetchAbort:W=this.ignoreFetchAbort,allowStaleOnFetchAbort:J=this.allowStaleOnFetchAbort,context:T,forceRefresh:H=!1,status:X,signal:A}=_;if(!this.#N){if(X)X.fetch="get";return this.get(q,{allowStale:j,updateAgeOnGet:K,noDeleteOnStaleGet:Y,status:X})}let G={allowStale:j,updateAgeOnGet:K,noDeleteOnStaleGet:Y,ttl:f,noDisposeOnSet:P,size:$,sizeCalculation:w,noUpdateTTL:O,noDeleteOnFetchRejection:v,allowStaleOnFetchRejection:z,allowStaleOnFetchAbort:J,ignoreFetchAbort:W,status:X,signal:A},h=this.#v.get(q);if(h===void 0){if(X)X.fetch="miss";let M=this.#r(q,h,G,T);return M.__returned=M}else{let M=this.#K[h];if(this.#O(M)){let E=j&&M.__staleWhileFetching!==void 0;if(X){if(X.fetch="inflight",E)X.returnedStale=!0}return E?M.__staleWhileFetching:M.__returned=M}let I=this.#V(h);if(!H&&!I){if(X)X.fetch="hit";if(this.#L(h),K)this.#S(h);if(X)this.#C(X,h);return M}let N=this.#r(q,h,G,T),l=N.__staleWhileFetching!==void 0&&j;if(X){if(X.fetch=I?"stale":"refresh",l&&I)X.returnedStale=!0}return l?N.__staleWhileFetching:N.__returned=N}}async forceFetch(q,_={}){let j=await this.fetch(q,_);if(j===void 0)throw new Error("fetch() returned undefined");return j}memo(q,_={}){let j=this.#X;if(!j)throw new Error("no memoMethod provided to constructor");let{context:K,forceRefresh:Y,...f}=_,P=this.get(q,f);if(!Y&&P!==void 0)return P;let $=j(q,P,{options:f,context:K});return this.set(q,$,f),$}get(q,_={}){let{allowStale:j=this.allowStale,updateAgeOnGet:K=this.updateAgeOnGet,noDeleteOnStaleGet:Y=this.noDeleteOnStaleGet,status:f}=_,P=this.#v.get(q);if(P!==void 0){let $=this.#K[P],w=this.#O($);if(f)this.#C(f,P);if(this.#V(P)){if(f)f.get="stale";if(!w){if(!Y)this.#R(q,"expire");if(f&&j)f.returnedStale=!0;return j?$:void 0}else{if(f&&j&&$.__staleWhileFetching!==void 0)f.returnedStale=!0;return j?$.__staleWhileFetching:void 0}}else{if(f)f.get="hit";if(w)return $.__staleWhileFetching;if(this.#L(P),K)this.#S(P);return $}}else if(f)f.get="miss"}#i(q,_){this.#u[_]=q,this.#J[q]=_}#L(q){if(q!==this.#T){if(q===this.#A)this.#A=this.#J[q];else this.#i(this.#u[q],this.#J[q]);this.#i(this.#T,q),this.#T=q}}delete(q){return this.#R(q,"delete")}#R(q,_){let j=!1;if(this.#$!==0){let K=this.#v.get(q);if(K!==void 0)if(j=!0,this.#$===1)this.#x(_);else{this.#g(K);let Y=this.#K[K];if(this.#O(Y))Y.__abortController.abort(new Error("deleted"));else if(this.#D||this.#H){if(this.#D)this.#Y?.(Y,q,_);if(this.#H)this.#Z?.push([Y,q,_])}if(this.#v.delete(q),this.#w[K]=void 0,this.#K[K]=void 0,K===this.#T)this.#T=this.#u[K];else if(K===this.#A)this.#A=this.#J[K];else{let f=this.#u[K];this.#J[f]=this.#J[K];let P=this.#J[K];this.#u[P]=this.#u[K]}this.#$--,this.#b.push(K)}}if(this.#H&&this.#Z?.length){let K=this.#Z,Y;while(Y=K?.shift())this.#f?.(...Y)}return j}clear(){return this.#x("delete")}#x(q){for(let _ of this.#m({allowStale:!0})){let j=this.#K[_];if(this.#O(j))j.__abortController.abort(new Error("deleted"));else{let K=this.#w[_];if(this.#D)this.#Y?.(j,K,q);if(this.#H)this.#Z?.push([j,K,q])}}if(this.#v.clear(),this.#K.fill(void 0),this.#w.fill(void 0),this.#k&&this.#M)this.#k.fill(0),this.#M.fill(0);if(this.#h)this.#h.fill(0);if(this.#A=0,this.#T=0,this.#b.length=0,this.#W=0,this.#$=0,this.#H&&this.#Z){let _=this.#Z,j;while(j=_?.shift())this.#f?.(...j)}}}import{posix as pD,win32 as l9}from"node:path";import{fileURLToPath as lD}from"node:url";import{lstatSync as xD,readdir as nD,readdirSync as cD,readlinkSync as rD,realpathSync as iD}from"fs";import*as oD from"node:fs";import{lstat as BD,readdir as tD,readlink as eD,realpath as FD}from"node:fs/promises";import{EventEmitter as y9}from"node:events";import _$ from"node:stream";import{StringDecoder as bD}from"node:string_decoder";var Uf=typeof process==="object"&&process?process:{stdout:null,stderr:null},SD=(q)=>!!q&&typeof q==="object"&&(q instanceof E_||q instanceof _$||ED(q)||RD(q)),ED=(q)=>!!q&&typeof q==="object"&&q instanceof y9&&typeof q.pipe==="function"&&q.pipe!==_$.Writable.prototype.pipe,RD=(q)=>!!q&&typeof q==="object"&&q instanceof y9&&typeof q.write==="function"&&typeof q.end==="function",oq=Symbol("EOF"),aq=Symbol("maybeEmitEnd"),$_=Symbol("emittedEnd"),y7=Symbol("emittingEnd"),D3=Symbol("emittedError"),d7=Symbol("closed"),sf=Symbol("read"),L7=Symbol("flush"),Qf=Symbol("flushChunk"),Gq=Symbol("encoding"),VK=Symbol("decoder"),O6=Symbol("flowing"),h3=Symbol("paused"),MK=Symbol("resume"),z6=Symbol("buffer"),E6=Symbol("pipes"),v6=Symbol("bufferLength"),E9=Symbol("bufferPush"),p7=Symbol("bufferShift"),D6=Symbol("objectMode"),s8=Symbol("destroyed"),R9=Symbol("error"),m9=Symbol("emitData"),q$=Symbol("emitEnd"),I9=Symbol("emitEnd2"),bq=Symbol("async"),g9=Symbol("abort"),l7=Symbol("aborted"),C3=Symbol("signal"),S_=Symbol("dataListeners"),B6=Symbol("discarded"),V3=(q)=>Promise.resolve().then(q),mD=(q)=>q(),ID=(q)=>q==="end"||q==="finish"||q==="prefinish",gD=(q)=>q instanceof ArrayBuffer||!!q&&typeof q==="object"&&q.constructor&&q.constructor.name==="ArrayBuffer"&&q.byteLength>=0,yD=(q)=>!Buffer.isBuffer(q)&&ArrayBuffer.isView(q);class d9{src;dest;opts;ondrain;constructor(q,_,j){this.src=q,this.dest=_,this.opts=j,this.ondrain=()=>q[MK](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(q){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class K$ extends d9{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(q,_,j){super(q,_,j);this.proxyErrors=(K)=>_.emit("error",K),q.on("error",this.proxyErrors)}}var dD=(q)=>!!q.objectMode,LD=(q)=>!q.objectMode&&!!q.encoding&&q.encoding!=="buffer";class E_ extends y9{[O6]=!1;[h3]=!1;[E6]=[];[z6]=[];[D6];[Gq];[bq];[VK];[oq]=!1;[$_]=!1;[y7]=!1;[d7]=!1;[D3]=null;[v6]=0;[s8]=!1;[C3];[l7]=!1;[S_]=0;[B6]=!1;writable=!0;readable=!0;constructor(...q){let _=q[0]||{};super();if(_.objectMode&&typeof _.encoding==="string")throw new TypeError("Encoding and objectMode may not be used together");if(dD(_))this[D6]=!0,this[Gq]=null;else if(LD(_))this[Gq]=_.encoding,this[D6]=!1;else this[D6]=!1,this[Gq]=null;if(this[bq]=!!_.async,this[VK]=this[Gq]?new bD(this[Gq]):null,_&&_.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[z6]});if(_&&_.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[E6]});let{signal:j}=_;if(j)if(this[C3]=j,j.aborted)this[g9]();else j.addEventListener("abort",()=>this[g9]())}get bufferLength(){return this[v6]}get encoding(){return this[Gq]}set encoding(q){throw new Error("Encoding must be set at instantiation time")}setEncoding(q){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[D6]}set objectMode(q){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[bq]}set["async"](q){this[bq]=this[bq]||!!q}[g9](){this[l7]=!0,this.emit("abort",this[C3]?.reason),this.destroy(this[C3]?.reason)}get aborted(){return this[l7]}set aborted(q){}write(q,_,j){if(this[l7])return!1;if(this[oq])throw new Error("write after end");if(this[s8])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof _==="function")j=_,_="utf8";if(!_)_="utf8";let K=this[bq]?V3:mD;if(!this[D6]&&!Buffer.isBuffer(q)){if(yD(q))q=Buffer.from(q.buffer,q.byteOffset,q.byteLength);else if(gD(q))q=Buffer.from(q);else if(typeof q!=="string")throw new Error("Non-contiguous data written to non-objectMode stream")}if(this[D6]){if(this[O6]&&this[v6]!==0)this[L7](!0);if(this[O6])this.emit("data",q);else this[E9](q);if(this[v6]!==0)this.emit("readable");if(j)K(j);return this[O6]}if(!q.length){if(this[v6]!==0)this.emit("readable");if(j)K(j);return this[O6]}if(typeof q==="string"&&!(_===this[Gq]&&!this[VK]?.lastNeed))q=Buffer.from(q,_);if(Buffer.isBuffer(q)&&this[Gq])q=this[VK].write(q);if(this[O6]&&this[v6]!==0)this[L7](!0);if(this[O6])this.emit("data",q);else this[E9](q);if(this[v6]!==0)this.emit("readable");if(j)K(j);return this[O6]}read(q){if(this[s8])return null;if(this[B6]=!1,this[v6]===0||q===0||q&&q>this[v6])return this[aq](),null;if(this[D6])q=null;if(this[z6].length>1&&!this[D6])this[z6]=[this[Gq]?this[z6].join(""):Buffer.concat(this[z6],this[v6])];let _=this[sf](q||null,this[z6][0]);return this[aq](),_}[sf](q,_){if(this[D6])this[p7]();else{let j=_;if(q===j.length||q===null)this[p7]();else if(typeof j==="string")this[z6][0]=j.slice(q),_=j.slice(0,q),this[v6]-=q;else this[z6][0]=j.subarray(q),_=j.subarray(0,q),this[v6]-=q}if(this.emit("data",_),!this[z6].length&&!this[oq])this.emit("drain");return _}end(q,_,j){if(typeof q==="function")j=q,q=void 0;if(typeof _==="function")j=_,_="utf8";if(q!==void 0)this.write(q,_);if(j)this.once("end",j);if(this[oq]=!0,this.writable=!1,this[O6]||!this[h3])this[aq]();return this}[MK](){if(this[s8])return;if(!this[S_]&&!this[E6].length)this[B6]=!0;if(this[h3]=!1,this[O6]=!0,this.emit("resume"),this[z6].length)this[L7]();else if(this[oq])this[aq]();else this.emit("drain")}resume(){return this[MK]()}pause(){this[O6]=!1,this[h3]=!0,this[B6]=!1}get destroyed(){return this[s8]}get flowing(){return this[O6]}get paused(){return this[h3]}[E9](q){if(this[D6])this[v6]+=1;else this[v6]+=q.length;this[z6].push(q)}[p7](){if(this[D6])this[v6]-=1;else this[v6]-=this[z6][0].length;return this[z6].shift()}[L7](q=!1){do;while(this[Qf](this[p7]())&&this[z6].length);if(!q&&!this[z6].length&&!this[oq])this.emit("drain")}[Qf](q){return this.emit("data",q),this[O6]}pipe(q,_){if(this[s8])return q;this[B6]=!1;let j=this[$_];if(_=_||{},q===Uf.stdout||q===Uf.stderr)_.end=!1;else _.end=_.end!==!1;if(_.proxyErrors=!!_.proxyErrors,j){if(_.end)q.end()}else if(this[E6].push(!_.proxyErrors?new d9(this,q,_):new K$(this,q,_)),this[bq])V3(()=>this[MK]());else this[MK]();return q}unpipe(q){let _=this[E6].find((j)=>j.dest===q);if(_){if(this[E6].length===1){if(this[O6]&&this[S_]===0)this[O6]=!1;this[E6]=[]}else this[E6].splice(this[E6].indexOf(_),1);_.unpipe()}}addListener(q,_){return this.on(q,_)}on(q,_){let j=super.on(q,_);if(q==="data"){if(this[B6]=!1,this[S_]++,!this[E6].length&&!this[O6])this[MK]()}else if(q==="readable"&&this[v6]!==0)super.emit("readable");else if(ID(q)&&this[$_])super.emit(q),this.removeAllListeners(q);else if(q==="error"&&this[D3]){let K=_;if(this[bq])V3(()=>K.call(this,this[D3]));else K.call(this,this[D3])}return j}removeListener(q,_){return this.off(q,_)}off(q,_){let j=super.off(q,_);if(q==="data"){if(this[S_]=this.listeners("data").length,this[S_]===0&&!this[B6]&&!this[E6].length)this[O6]=!1}return j}removeAllListeners(q){let _=super.removeAllListeners(q);if(q==="data"||q===void 0){if(this[S_]=0,!this[B6]&&!this[E6].length)this[O6]=!1}return _}get emittedEnd(){return this[$_]}[aq](){if(!this[y7]&&!this[$_]&&!this[s8]&&this[z6].length===0&&this[oq]){if(this[y7]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[d7])this.emit("close");this[y7]=!1}}emit(q,..._){let j=_[0];if(q!=="error"&&q!=="close"&&q!==s8&&this[s8])return!1;else if(q==="data")return!this[D6]&&!j?!1:this[bq]?(V3(()=>this[m9](j)),!0):this[m9](j);else if(q==="end")return this[q$]();else if(q==="close"){if(this[d7]=!0,!this[$_]&&!this[s8])return!1;let Y=super.emit("close");return this.removeAllListeners("close"),Y}else if(q==="error"){this[D3]=j,super.emit(R9,j);let Y=!this[C3]||this.listeners("error").length?super.emit("error",j):!1;return this[aq](),Y}else if(q==="resume"){let Y=super.emit("resume");return this[aq](),Y}else if(q==="finish"||q==="prefinish"){let Y=super.emit(q);return this.removeAllListeners(q),Y}let K=super.emit(q,..._);return this[aq](),K}[m9](q){for(let j of this[E6])if(j.dest.write(q)===!1)this.pause();let _=this[B6]?!1:super.emit("data",q);return this[aq](),_}[q$](){if(this[$_])return!1;return this[$_]=!0,this.readable=!1,this[bq]?(V3(()=>this[I9]()),!0):this[I9]()}[I9](){if(this[VK]){let _=this[VK].end();if(_){for(let j of this[E6])j.dest.write(_);if(!this[B6])super.emit("data",_)}}for(let _ of this[E6])_.end();let q=super.emit("end");return this.removeAllListeners("end"),q}async collect(){let q=Object.assign([],{dataLength:0});if(!this[D6])q.dataLength=0;let _=this.promise();return this.on("data",(j)=>{if(q.push(j),!this[D6])q.dataLength+=j.length}),await _,q}async concat(){if(this[D6])throw new Error("cannot concat in objectMode");let q=await this.collect();return this[Gq]?q.join(""):Buffer.concat(q,q.dataLength)}async promise(){return new Promise((q,_)=>{this.on(s8,()=>_(new Error("stream destroyed"))),this.on("error",(j)=>_(j)),this.on("end",()=>q())})}[Symbol.asyncIterator](){this[B6]=!1;let q=!1,_=async()=>{return this.pause(),q=!0,{value:void 0,done:!0}};return{next:()=>{if(q)return _();let K=this.read();if(K!==null)return Promise.resolve({done:!1,value:K});if(this[oq])return _();let Y,f,P=(v)=>{this.off("data",$),this.off("end",w),this.off(s8,O),_(),f(v)},$=(v)=>{this.off("error",P),this.off("end",w),this.off(s8,O),this.pause(),Y({value:v,done:!!this[oq]})},w=()=>{this.off("error",P),this.off("data",$),this.off(s8,O),_(),Y({done:!0,value:void 0})},O=()=>P(new Error("stream destroyed"));return new Promise((v,z)=>{f=z,Y=v,this.once(s8,O),this.once("error",P),this.once("end",w),this.once("data",$)})},throw:_,return:_,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[B6]=!1;let q=!1,_=()=>{return this.pause(),this.off(R9,_),this.off(s8,_),this.off("end",_),q=!0,{done:!0,value:void 0}},j=()=>{if(q)return _();let K=this.read();return K===null?_():{done:!1,value:K}};return this.once("end",_),this.once(R9,_),this.once(s8,_),{next:j,throw:_,return:_,[Symbol.iterator](){return this}}}destroy(q){if(this[s8]){if(q)this.emit("error",q);else this.emit(s8);return this}this[s8]=!0,this[B6]=!0,this[z6].length=0,this[v6]=0;let _=this;if(typeof _.close==="function"&&!this[d7])_.close();if(q)this.emit("error",q);else this.emit(s8);return this}static get isStream(){return SD}}var aD=iD.native,N3={lstatSync:xD,readdir:nD,readdirSync:cD,readlinkSync:rD,realpathSync:aD,promises:{lstat:BD,readdir:tD,readlink:eD,realpath:FD}},$$=(q)=>!q||q===N3||q===oD?N3:{...N3,...q,promises:{...N3.promises,...q.promises||{}}},w$=/^\\\\\?\\([a-z]:)\\?$/i,UD=(q)=>q.replace(/\//g,"\\").replace(w$,"$1\\"),sD=/[\\\/]/,$q=0,O$=1,z$=2,Sq=4,v$=6,W$=8,R_=10,H$=12,fq=15,M3=~fq,L9=16,j$=32,b3=64,uq=128,x7=256,c7=512,P$=b3|uq|c7,QD=1023,p9=(q)=>q.isFile()?W$:q.isDirectory()?Sq:q.isSymbolicLink()?R_:q.isCharacterDevice()?z$:q.isBlockDevice()?v$:q.isSocket()?H$:q.isFIFO()?O$:$q,Y$=new Map,S3=(q)=>{let _=Y$.get(q);if(_)return _;let j=q.normalize("NFKD");return Y$.set(q,j),j},f$=new Map,n7=(q)=>{let _=f$.get(q);if(_)return _;let j=S3(q.toLowerCase());return f$.set(q,j),j};class x9 extends u3{constructor(){super({max:256})}}class J$ extends u3{constructor(q=16384){super({maxSize:q,sizeCalculation:(_)=>_.length+1})}}var T$=Symbol("PathScurry setAsCwd");class R6{name;root;roots;parent;nocase;isCWD=!1;#q;#_;get dev(){return this.#_}#Y;get mode(){return this.#Y}#P;get nlink(){return this.#P}#f;get uid(){return this.#f}#G;get gid(){return this.#G}#X;get rdev(){return this.#X}#z;get blksize(){return this.#z}#$;get ino(){return this.#$}#W;get size(){return this.#W}#v;get blocks(){return this.#v}#w;get atimeMs(){return this.#w}#K;get mtimeMs(){return this.#K}#J;get ctimeMs(){return this.#J}#u;get birthtimeMs(){return this.#u}#A;get atime(){return this.#A}#T;get mtime(){return this.#T}#b;get ctime(){return this.#b}#Z;get birthtime(){return this.#Z}#h;#M;#k;#D;#N;#H;#j;#I;#S;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(q,_=$q,j,K,Y,f,P){if(this.name=q,this.#h=Y?n7(q):S3(q),this.#j=_&QD,this.nocase=Y,this.roots=K,this.root=j||this,this.#I=f,this.#k=P.fullpath,this.#N=P.relative,this.#H=P.relativePosix,this.parent=P.parent,this.parent)this.#q=this.parent.#q;else this.#q=$$(P.fs)}depth(){if(this.#M!==void 0)return this.#M;if(!this.parent)return this.#M=0;return this.#M=this.parent.depth()+1}childrenCache(){return this.#I}resolve(q){if(!q)return this;let _=this.getRootString(q),K=q.substring(_.length).split(this.splitSep);return _?this.getRoot(_).#n(K):this.#n(K)}#n(q){let _=this;for(let j of q)_=_.child(j);return _}children(){let q=this.#I.get(this);if(q)return q;let _=Object.assign([],{provisional:0});return this.#I.set(this,_),this.#j&=~L9,_}child(q,_){if(q===""||q===".")return this;if(q==="..")return this.parent||this;let j=this.children(),K=this.nocase?n7(q):S3(q);for(let $ of j)if($.#h===K)return $;let Y=this.parent?this.sep:"",f=this.#k?this.#k+Y+q:void 0,P=this.newChild(q,$q,{..._,parent:this,fullpath:f});if(!this.canReaddir())P.#j|=uq;return j.push(P),P}relative(){if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let q=this.name,_=this.parent;if(!_)return this.#N=this.name;let j=_.relative();return j+(!j||!_.parent?"":this.sep)+q}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#H!==void 0)return this.#H;let q=this.name,_=this.parent;if(!_)return this.#H=this.fullpathPosix();let j=_.relativePosix();return j+(!j||!_.parent?"":"/")+q}fullpath(){if(this.#k!==void 0)return this.#k;let q=this.name,_=this.parent;if(!_)return this.#k=this.name;let K=_.fullpath()+(!_.parent?"":this.sep)+q;return this.#k=K}fullpathPosix(){if(this.#D!==void 0)return this.#D;if(this.sep==="/")return this.#D=this.fullpath();if(!this.parent){let K=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(K))return this.#D=`//?/${K}`;else return this.#D=K}let q=this.parent,_=q.fullpathPosix(),j=_+(!_||!q.parent?"":"/")+this.name;return this.#D=j}isUnknown(){return(this.#j&fq)===$q}isType(q){return this[`is${q}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#j&fq)===W$}isDirectory(){return(this.#j&fq)===Sq}isCharacterDevice(){return(this.#j&fq)===z$}isBlockDevice(){return(this.#j&fq)===v$}isFIFO(){return(this.#j&fq)===O$}isSocket(){return(this.#j&fq)===H$}isSymbolicLink(){return(this.#j&R_)===R_}lstatCached(){return this.#j&j$?this:void 0}readlinkCached(){return this.#S}realpathCached(){return this.#C}readdirCached(){let q=this.children();return q.slice(0,q.provisional)}canReadlink(){if(this.#S)return!0;if(!this.parent)return!1;let q=this.#j&fq;return!(q!==$q&&q!==R_||this.#j&x7||this.#j&uq)}calledReaddir(){return!!(this.#j&L9)}isENOENT(){return!!(this.#j&uq)}isNamed(q){return!this.nocase?this.#h===S3(q):this.#h===n7(q)}async readlink(){let q=this.#S;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let _=await this.#q.promises.readlink(this.fullpath()),j=(await this.parent.realpath())?.resolve(_);if(j)return this.#S=j}catch(_){this.#c(_.code);return}}readlinkSync(){let q=this.#S;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let _=this.#q.readlinkSync(this.fullpath()),j=this.parent.realpathSync()?.resolve(_);if(j)return this.#S=j}catch(_){this.#c(_.code);return}}#V(q){this.#j|=L9;for(let _=q.provisional;_<q.length;_++){let j=q[_];if(j)j.#p()}}#p(){if(this.#j&uq)return;this.#j=(this.#j|uq)&M3,this.#g()}#g(){let q=this.children();q.provisional=0;for(let _ of q)_.#p()}#l(){this.#j|=c7,this.#y()}#y(){if(this.#j&b3)return;let q=this.#j;if((q&fq)===Sq)q&=M3;this.#j=q|b3,this.#g()}#E(q=""){if(q==="ENOTDIR"||q==="EPERM")this.#y();else if(q==="ENOENT")this.#p();else this.children().provisional=0}#m(q=""){if(q==="ENOTDIR")this.parent.#y();else if(q==="ENOENT")this.#p()}#c(q=""){let _=this.#j;if(_|=x7,q==="ENOENT")_|=uq;if(q==="EINVAL"||q==="UNKNOWN")_&=M3;if(this.#j=_,q==="ENOTDIR"&&this.parent)this.parent.#y()}#d(q,_){return this.#O(q,_)||this.#r(q,_)}#r(q,_){let j=p9(q),K=this.newChild(q.name,j,{parent:this}),Y=K.#j&fq;if(Y!==Sq&&Y!==R_&&Y!==$q)K.#j|=b3;return _.unshift(K),_.provisional++,K}#O(q,_){for(let j=_.provisional;j<_.length;j++){let K=_[j];if((this.nocase?n7(q.name):S3(q.name))!==K.#h)continue;return this.#i(q,K,j,_)}}#i(q,_,j,K){let Y=_.name;if(_.#j=_.#j&M3|p9(q),Y!==q.name)_.name=q.name;if(j!==K.provisional){if(j===K.length-1)K.pop();else K.splice(j,1);K.unshift(_)}return K.provisional++,_}async lstat(){if((this.#j&uq)===0)try{return this.#L(await this.#q.promises.lstat(this.fullpath())),this}catch(q){this.#m(q.code)}}lstatSync(){if((this.#j&uq)===0)try{return this.#L(this.#q.lstatSync(this.fullpath())),this}catch(q){this.#m(q.code)}}#L(q){let{atime:_,atimeMs:j,birthtime:K,birthtimeMs:Y,blksize:f,blocks:P,ctime:$,ctimeMs:w,dev:O,gid:v,ino:z,mode:W,mtime:J,mtimeMs:T,nlink:H,rdev:X,size:A,uid:G}=q;this.#A=_,this.#w=j,this.#Z=K,this.#u=Y,this.#z=f,this.#v=P,this.#b=$,this.#J=w,this.#_=O,this.#G=v,this.#$=z,this.#Y=W,this.#T=J,this.#K=T,this.#P=H,this.#X=X,this.#W=A,this.#f=G;let h=p9(q);if(this.#j=this.#j&M3|h|j$,h!==$q&&h!==Sq&&h!==R_)this.#j|=b3}#R=[];#x=!1;#a(q){this.#x=!1;let _=this.#R.slice();this.#R.length=0,_.forEach((j)=>j(null,q))}readdirCB(q,_=!1){if(!this.canReaddir()){if(_)q(null,[]);else queueMicrotask(()=>q(null,[]));return}let j=this.children();if(this.calledReaddir()){let Y=j.slice(0,j.provisional);if(_)q(null,Y);else queueMicrotask(()=>q(null,Y));return}if(this.#R.push(q),this.#x)return;this.#x=!0;let K=this.fullpath();this.#q.readdir(K,{withFileTypes:!0},(Y,f)=>{if(Y)this.#E(Y.code),j.provisional=0;else{for(let P of f)this.#d(P,j);this.#V(j)}this.#a(j.slice(0,j.provisional));return})}#o;async readdir(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let _=this.fullpath();if(this.#o)await this.#o;else{let j=()=>{};this.#o=new Promise((K)=>j=K);try{for(let K of await this.#q.promises.readdir(_,{withFileTypes:!0}))this.#d(K,q);this.#V(q)}catch(K){this.#E(K.code),q.provisional=0}this.#o=void 0,j()}return q.slice(0,q.provisional)}readdirSync(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let _=this.fullpath();try{for(let j of this.#q.readdirSync(_,{withFileTypes:!0}))this.#d(j,q);this.#V(q)}catch(j){this.#E(j.code),q.provisional=0}return q.slice(0,q.provisional)}canReaddir(){if(this.#j&P$)return!1;let q=fq&this.#j;if(!(q===$q||q===Sq||q===R_))return!1;return!0}shouldWalk(q,_){return(this.#j&Sq)===Sq&&!(this.#j&P$)&&!q.has(this)&&(!_||_(this))}async realpath(){if(this.#C)return this.#C;if((c7|x7|uq)&this.#j)return;try{let q=await this.#q.promises.realpath(this.fullpath());return this.#C=this.resolve(q)}catch(q){this.#l()}}realpathSync(){if(this.#C)return this.#C;if((c7|x7|uq)&this.#j)return;try{let q=this.#q.realpathSync(this.fullpath());return this.#C=this.resolve(q)}catch(q){this.#l()}}[T$](q){if(q===this)return;q.isCWD=!1,this.isCWD=!0;let _=new Set([]),j=[],K=this;while(K&&K.parent)_.add(K),K.#N=j.join(this.sep),K.#H=j.join("/"),K=K.parent,j.push("..");K=q;while(K&&K.parent&&!_.has(K))K.#N=void 0,K.#H=void 0,K=K.parent}}class r7 extends R6{sep="\\";splitSep=sD;constructor(q,_=$q,j,K,Y,f,P){super(q,_,j,K,Y,f,P)}newChild(q,_=$q,j={}){return new r7(q,_,this.root,this.roots,this.nocase,this.childrenCache(),j)}getRootString(q){return l9.parse(q).root}getRoot(q){if(q=UD(q.toUpperCase()),q===this.root.name)return this.root;for(let[_,j]of Object.entries(this.roots))if(this.sameRoot(q,_))return this.roots[q]=j;return this.roots[q]=new E3(q,this).root}sameRoot(q,_=this.root.name){return q=q.toUpperCase().replace(/\//g,"\\").replace(w$,"$1\\"),q===_}}class i7 extends R6{splitSep="/";sep="/";constructor(q,_=$q,j,K,Y,f,P){super(q,_,j,K,Y,f,P)}getRootString(q){return q.startsWith("/")?"/":""}getRoot(q){return this.root}newChild(q,_=$q,j={}){return new i7(q,_,this.root,this.roots,this.nocase,this.childrenCache(),j)}}class n9{root;rootPath;roots;cwd;#q;#_;#Y;nocase;#P;constructor(q=process.cwd(),_,j,{nocase:K,childrenCacheSize:Y=16384,fs:f=N3}={}){if(this.#P=$$(f),q instanceof URL||q.startsWith("file://"))q=lD(q);let P=_.resolve(q);this.roots=Object.create(null),this.rootPath=this.parseRootPath(P),this.#q=new x9,this.#_=new x9,this.#Y=new J$(Y);let $=P.substring(this.rootPath.length).split(j);if($.length===1&&!$[0])$.pop();if(K===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=K,this.root=this.newRoot(this.#P),this.roots[this.rootPath]=this.root;let w=this.root,O=$.length-1,v=_.sep,z=this.rootPath,W=!1;for(let J of $){let T=O--;w=w.child(J,{relative:new Array(T).fill("..").join(v),relativePosix:new Array(T).fill("..").join("/"),fullpath:z+=(W?"":v)+J}),W=!0}this.cwd=w}depth(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.depth()}childrenCache(){return this.#Y}resolve(...q){let _="";for(let Y=q.length-1;Y>=0;Y--){let f=q[Y];if(!f||f===".")continue;if(_=_?`${f}/${_}`:f,this.isAbsolute(f))break}let j=this.#q.get(_);if(j!==void 0)return j;let K=this.cwd.resolve(_).fullpath();return this.#q.set(_,K),K}resolvePosix(...q){let _="";for(let Y=q.length-1;Y>=0;Y--){let f=q[Y];if(!f||f===".")continue;if(_=_?`${f}/${_}`:f,this.isAbsolute(f))break}let j=this.#_.get(_);if(j!==void 0)return j;let K=this.cwd.resolve(_).fullpathPosix();return this.#_.set(_,K),K}relative(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relative()}relativePosix(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relativePosix()}basename(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.name}dirname(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return(q.parent||q).fullpath()}async readdir(q=this.cwd,_={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof R6))_=q,q=this.cwd;let{withFileTypes:j}=_;if(!q.canReaddir())return[];else{let K=await q.readdir();return j?K:K.map((Y)=>Y.name)}}readdirSync(q=this.cwd,_={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof R6))_=q,q=this.cwd;let{withFileTypes:j=!0}=_;if(!q.canReaddir())return[];else if(j)return q.readdirSync();else return q.readdirSync().map((K)=>K.name)}async lstat(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstat()}lstatSync(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstatSync()}async readlink(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof R6))_=q.withFileTypes,q=this.cwd;let j=await q.readlink();return _?j:j?.fullpath()}readlinkSync(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof R6))_=q.withFileTypes,q=this.cwd;let j=q.readlinkSync();return _?j:j?.fullpath()}async realpath(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof R6))_=q.withFileTypes,q=this.cwd;let j=await q.realpath();return _?j:j?.fullpath()}realpathSync(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof R6))_=q.withFileTypes,q=this.cwd;let j=q.realpathSync();return _?j:j?.fullpath()}async walk(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof R6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=[];if(!Y||Y(q))P.push(j?q:q.fullpath());let $=new Set,w=(v,z)=>{$.add(v),v.readdirCB((W,J)=>{if(W)return z(W);let T=J.length;if(!T)return z();let H=()=>{if(--T===0)z()};for(let X of J){if(!Y||Y(X))P.push(j?X:X.fullpath());if(K&&X.isSymbolicLink())X.realpath().then((A)=>A?.isUnknown()?A.lstat():A).then((A)=>A?.shouldWalk($,f)?w(A,H):H());else if(X.shouldWalk($,f))w(X,H);else H()}},!0)},O=q;return new Promise((v,z)=>{w(O,(W)=>{if(W)return z(W);v(P)})})}walkSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof R6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=[];if(!Y||Y(q))P.push(j?q:q.fullpath());let $=new Set([q]);for(let w of $){let O=w.readdirSync();for(let v of O){if(!Y||Y(v))P.push(j?v:v.fullpath());let z=v;if(v.isSymbolicLink()){if(!(K&&(z=v.realpathSync())))continue;if(z.isUnknown())z.lstatSync()}if(z.shouldWalk($,f))$.add(z)}}return P}[Symbol.asyncIterator](){return this.iterate()}iterate(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof R6))_=q,q=this.cwd;return this.stream(q,_)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof R6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_;if(!Y||Y(q))yield j?q:q.fullpath();let P=new Set([q]);for(let $ of P){let w=$.readdirSync();for(let O of w){if(!Y||Y(O))yield j?O:O.fullpath();let v=O;if(O.isSymbolicLink()){if(!(K&&(v=O.realpathSync())))continue;if(v.isUnknown())v.lstatSync()}if(v.shouldWalk(P,f))P.add(v)}}}stream(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof R6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=new E_({objectMode:!0});if(!Y||Y(q))P.write(j?q:q.fullpath());let $=new Set,w=[q],O=0,v=()=>{let z=!1;while(!z){let W=w.shift();if(!W){if(O===0)P.end();return}O++,$.add(W);let J=(H,X,A=!1)=>{if(H)return P.emit("error",H);if(K&&!A){let G=[];for(let h of X)if(h.isSymbolicLink())G.push(h.realpath().then((M)=>M?.isUnknown()?M.lstat():M));if(G.length){Promise.all(G).then(()=>J(null,X,!0));return}}for(let G of X)if(G&&(!Y||Y(G))){if(!P.write(j?G:G.fullpath()))z=!0}O--;for(let G of X){let h=G.realpathCached()||G;if(h.shouldWalk($,f))w.push(h)}if(z&&!P.flowing)P.once("drain",v);else if(!T)v()},T=!0;W.readdirCB(J,!0),T=!1}};return v(),P}streamSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof R6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=new E_({objectMode:!0}),$=new Set;if(!Y||Y(q))P.write(j?q:q.fullpath());let w=[q],O=0,v=()=>{let z=!1;while(!z){let W=w.shift();if(!W){if(O===0)P.end();return}O++,$.add(W);let J=W.readdirSync();for(let T of J)if(!Y||Y(T)){if(!P.write(j?T:T.fullpath()))z=!0}O--;for(let T of J){let H=T;if(T.isSymbolicLink()){if(!(K&&(H=T.realpathSync())))continue;if(H.isUnknown())H.lstatSync()}if(H.shouldWalk($,f))w.push(H)}}if(z&&!P.flowing)P.once("drain",v)};return v(),P}chdir(q=this.cwd){let _=this.cwd;this.cwd=typeof q==="string"?this.cwd.resolve(q):q,this.cwd[T$](_)}}class E3 extends n9{sep="\\";constructor(q=process.cwd(),_={}){let{nocase:j=!0}=_;super(q,l9,"\\",{..._,nocase:j});this.nocase=j;for(let K=this.cwd;K;K=K.parent)K.nocase=this.nocase}parseRootPath(q){return l9.parse(q).root.toUpperCase()}newRoot(q){return new r7(this.rootPath,Sq,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")||q.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(q)}}class R3 extends n9{sep="/";constructor(q=process.cwd(),_={}){let{nocase:j=!1}=_;super(q,pD,"/",{..._,nocase:j});this.nocase=j}parseRootPath(q){return"/"}newRoot(q){return new i7(this.rootPath,Sq,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")}}class o7 extends R3{constructor(q=process.cwd(),_={}){let{nocase:j=!0}=_;super(q,{..._,nocase:j})}}var MN=process.platform==="win32"?r7:i7,Z$=process.platform==="win32"?E3:process.platform==="darwin"?o7:R3;var qh=(q)=>q.length>=1,_h=(q)=>q.length>=1;class NK{#q;#_;#Y;length;#P;#f;#G;#X;#z;#$;#W=!0;constructor(q,_,j,K){if(!qh(q))throw new TypeError("empty pattern list");if(!_h(_))throw new TypeError("empty glob list");if(_.length!==q.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=q.length,j<0||j>=this.length)throw new TypeError("index out of range");if(this.#q=q,this.#_=_,this.#Y=j,this.#P=K,this.#Y===0){if(this.isUNC()){let[Y,f,P,$,...w]=this.#q,[O,v,z,W,...J]=this.#_;if(w[0]==="")w.shift(),J.shift();let T=[Y,f,P,$,""].join("/"),H=[O,v,z,W,""].join("/");this.#q=[T,...w],this.#_=[H,...J],this.length=this.#q.length}else if(this.isDrive()||this.isAbsolute()){let[Y,...f]=this.#q,[P,...$]=this.#_;if(f[0]==="")f.shift(),$.shift();let w=Y+"/",O=P+"/";this.#q=[w,...f],this.#_=[O,...$],this.length=this.#q.length}}}pattern(){return this.#q[this.#Y]}isString(){return typeof this.#q[this.#Y]==="string"}isGlobstar(){return this.#q[this.#Y]===X6}isRegExp(){return this.#q[this.#Y]instanceof RegExp}globString(){return this.#G=this.#G||(this.#Y===0?this.isAbsolute()?this.#_[0]+this.#_.slice(1).join("/"):this.#_.join("/"):this.#_.slice(this.#Y).join("/"))}hasMore(){return this.length>this.#Y+1}rest(){if(this.#f!==void 0)return this.#f;if(!this.hasMore())return this.#f=null;return this.#f=new NK(this.#q,this.#_,this.#Y+1,this.#P),this.#f.#$=this.#$,this.#f.#z=this.#z,this.#f.#X=this.#X,this.#f}isUNC(){let q=this.#q;return this.#z!==void 0?this.#z:this.#z=this.#P==="win32"&&this.#Y===0&&q[0]===""&&q[1]===""&&typeof q[2]==="string"&&!!q[2]&&typeof q[3]==="string"&&!!q[3]}isDrive(){let q=this.#q;return this.#X!==void 0?this.#X:this.#X=this.#P==="win32"&&this.#Y===0&&this.length>1&&typeof q[0]==="string"&&/^[a-z]:$/i.test(q[0])}isAbsolute(){let q=this.#q;return this.#$!==void 0?this.#$:this.#$=q[0]===""&&q.length>1||this.isDrive()||this.isUNC()}root(){let q=this.#q[0];return typeof q==="string"&&this.isAbsolute()&&this.#Y===0?q:""}checkFollowGlobstar(){return!(this.#Y===0||!this.isGlobstar()||!this.#W)}markFollowGlobstar(){if(this.#Y===0||!this.isGlobstar()||!this.#W)return!1;return this.#W=!1,!0}}var Kh=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class m3{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(q,{nobrace:_,nocase:j,noext:K,noglobstar:Y,platform:f=Kh}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=f,this.mmopts={dot:!0,nobrace:_,nocase:j,noext:K,noglobstar:Y,optimizationLevel:2,platform:f,nocomment:!0,nonegate:!0};for(let P of q)this.add(P)}add(q){let _=new Yq(q,this.mmopts);for(let j=0;j<_.set.length;j++){let K=_.set[j],Y=_.globParts[j];if(!K||!Y)throw new Error("invalid pattern object");while(K[0]==="."&&Y[0]===".")K.shift(),Y.shift();let f=new NK(K,Y,0,this.platform),P=new Yq(f.globString(),this.mmopts),$=Y[Y.length-1]==="**",w=f.isAbsolute();if(w)this.absolute.push(P);else this.relative.push(P);if($)if(w)this.absoluteChildren.push(P);else this.relativeChildren.push(P)}}ignored(q){let _=q.fullpath(),j=`${_}/`,K=q.relative()||".",Y=`${K}/`;for(let f of this.relative)if(f.match(K)||f.match(Y))return!0;for(let f of this.absolute)if(f.match(_)||f.match(j))return!0;return!1}childrenIgnored(q){let _=q.fullpath()+"/",j=(q.relative()||".")+"/";for(let K of this.relativeChildren)if(K.match(j))return!0;for(let K of this.absoluteChildren)if(K.match(_))return!0;return!1}}class c9{store;constructor(q=new Map){this.store=q}copy(){return new c9(new Map(this.store))}hasWalked(q,_){return this.store.get(q.fullpath())?.has(_.globString())}storeWalked(q,_){let j=q.fullpath(),K=this.store.get(j);if(K)K.add(_.globString());else this.store.set(j,new Set([_.globString()]))}}class k${store=new Map;add(q,_,j){let K=(_?2:0)|(j?1:0),Y=this.store.get(q);this.store.set(q,Y===void 0?K:K&Y)}entries(){return[...this.store.entries()].map(([q,_])=>[q,!!(_&2),!!(_&1)])}}class X${store=new Map;add(q,_){if(!q.canReaddir())return;let j=this.store.get(q);if(j){if(!j.find((K)=>K.globString()===_.globString()))j.push(_)}else this.store.set(q,[_])}get(q){let _=this.store.get(q);if(!_)throw new Error("attempting to walk unknown path");return _}entries(){return this.keys().map((q)=>[q,this.store.get(q)])}keys(){return[...this.store.keys()].filter((q)=>q.canReaddir())}}class I3{hasWalkedCache;matches=new k$;subwalks=new X$;patterns;follow;dot;opts;constructor(q,_){this.opts=q,this.follow=!!q.follow,this.dot=!!q.dot,this.hasWalkedCache=_?_.copy():new c9}processPatterns(q,_){this.patterns=_;let j=_.map((K)=>[q,K]);for(let[K,Y]of j){this.hasWalkedCache.storeWalked(K,Y);let f=Y.root(),P=Y.isAbsolute()&&this.opts.absolute!==!1;if(f){K=K.resolve(f==="/"&&this.opts.root!==void 0?this.opts.root:f);let v=Y.rest();if(!v){this.matches.add(K,!0,!1);continue}else Y=v}if(K.isENOENT())continue;let $,w,O=!1;while(typeof($=Y.pattern())==="string"&&(w=Y.rest()))K=K.resolve($),Y=w,O=!0;if($=Y.pattern(),w=Y.rest(),O){if(this.hasWalkedCache.hasWalked(K,Y))continue;this.hasWalkedCache.storeWalked(K,Y)}if(typeof $==="string"){let v=$===".."||$===""||$===".";this.matches.add(K.resolve($),P,v);continue}else if($===X6){if(!K.isSymbolicLink()||this.follow||Y.checkFollowGlobstar())this.subwalks.add(K,Y);let v=w?.pattern(),z=w?.rest();if(!w||(v===""||v===".")&&!z)this.matches.add(K,P,v===""||v===".");else if(v===".."){let W=K.parent||K;if(!z)this.matches.add(W,P,!0);else if(!this.hasWalkedCache.hasWalked(W,z))this.subwalks.add(W,z)}}else if($ instanceof RegExp)this.subwalks.add(K,Y)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new I3(this.opts,this.hasWalkedCache)}filterEntries(q,_){let j=this.subwalks.get(q),K=this.child();for(let Y of _)for(let f of j){let P=f.isAbsolute(),$=f.pattern(),w=f.rest();if($===X6)K.testGlobstar(Y,f,w,P);else if($ instanceof RegExp)K.testRegExp(Y,$,w,P);else K.testString(Y,$,w,P)}return K}testGlobstar(q,_,j,K){if(this.dot||!q.name.startsWith(".")){if(!_.hasMore())this.matches.add(q,K,!1);if(q.canReaddir()){if(this.follow||!q.isSymbolicLink())this.subwalks.add(q,_);else if(q.isSymbolicLink()){if(j&&_.checkFollowGlobstar())this.subwalks.add(q,j);else if(_.markFollowGlobstar())this.subwalks.add(q,_)}}}if(j){let Y=j.pattern();if(typeof Y==="string"&&Y!==".."&&Y!==""&&Y!==".")this.testString(q,Y,j.rest(),K);else if(Y===".."){let f=q.parent||q;this.subwalks.add(f,j)}else if(Y instanceof RegExp)this.testRegExp(q,Y,j.rest(),K)}}testRegExp(q,_,j,K){if(!_.test(q.name))return;if(!j)this.matches.add(q,K,!1);else this.subwalks.add(q,j)}testString(q,_,j,K){if(!q.isNamed(_))return;if(!j)this.matches.add(q,K,!1);else this.subwalks.add(q,j)}}var jh=(q,_)=>typeof q==="string"?new m3([q],_):Array.isArray(q)?new m3(q,_):q;class r9{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#q=[];#_;#Y;signal;maxDepth;includeChildMatches;constructor(q,_,j){if(this.patterns=q,this.path=_,this.opts=j,this.#Y=!j.posix&&j.platform==="win32"?"\\":"/",this.includeChildMatches=j.includeChildMatches!==!1,j.ignore||!this.includeChildMatches){if(this.#_=jh(j.ignore??[],j),!this.includeChildMatches&&typeof this.#_.add!=="function")throw new Error("cannot ignore child matches, ignore lacks add() method.")}if(this.maxDepth=j.maxDepth||1/0,j.signal)this.signal=j.signal,this.signal.addEventListener("abort",()=>{this.#q.length=0})}#P(q){return this.seen.has(q)||!!this.#_?.ignored?.(q)}#f(q){return!!this.#_?.childrenIgnored?.(q)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let q=void 0;while(!this.paused&&(q=this.#q.shift()))q()}onResume(q){if(this.signal?.aborted)return;if(!this.paused)q();else this.#q.push(q)}async matchCheck(q,_){if(_&&this.opts.nodir)return;let j;if(this.opts.realpath){if(j=q.realpathCached()||await q.realpath(),!j)return;q=j}let Y=q.isUnknown()||this.opts.stat?await q.lstat():q;if(this.opts.follow&&this.opts.nodir&&Y?.isSymbolicLink()){let f=await Y.realpath();if(f&&(f.isUnknown()||this.opts.stat))await f.lstat()}return this.matchCheckTest(Y,_)}matchCheckTest(q,_){return q&&(this.maxDepth===1/0||q.depth()<=this.maxDepth)&&(!_||q.canReaddir())&&(!this.opts.nodir||!q.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!q.isSymbolicLink()||!q.realpathCached()?.isDirectory())&&!this.#P(q)?q:void 0}matchCheckSync(q,_){if(_&&this.opts.nodir)return;let j;if(this.opts.realpath){if(j=q.realpathCached()||q.realpathSync(),!j)return;q=j}let Y=q.isUnknown()||this.opts.stat?q.lstatSync():q;if(this.opts.follow&&this.opts.nodir&&Y?.isSymbolicLink()){let f=Y.realpathSync();if(f&&(f?.isUnknown()||this.opts.stat))f.lstatSync()}return this.matchCheckTest(Y,_)}matchFinish(q,_){if(this.#P(q))return;if(!this.includeChildMatches&&this.#_?.add){let Y=`${q.relativePosix()}/**`;this.#_.add(Y)}let j=this.opts.absolute===void 0?_:this.opts.absolute;this.seen.add(q);let K=this.opts.mark&&q.isDirectory()?this.#Y:"";if(this.opts.withFileTypes)this.matchEmit(q);else if(j){let Y=this.opts.posix?q.fullpathPosix():q.fullpath();this.matchEmit(Y+K)}else{let Y=this.opts.posix?q.relativePosix():q.relative(),f=this.opts.dotRelative&&!Y.startsWith(".."+this.#Y)?"."+this.#Y:"";this.matchEmit(!Y?"."+K:f+Y+K)}}async match(q,_,j){let K=await this.matchCheck(q,j);if(K)this.matchFinish(K,_)}matchSync(q,_,j){let K=this.matchCheckSync(q,j);if(K)this.matchFinish(K,_)}walkCB(q,_,j){if(this.signal?.aborted)j();this.walkCB2(q,_,new I3(this.opts),j)}walkCB2(q,_,j,K){if(this.#f(q))return K();if(this.signal?.aborted)K();if(this.paused){this.onResume(()=>this.walkCB2(q,_,j,K));return}j.processPatterns(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,w]of j.matches.entries()){if(this.#P(P))continue;Y++,this.match(P,$,w).then(()=>f())}for(let P of j.subwalkTargets()){if(this.maxDepth!==1/0&&P.depth()>=this.maxDepth)continue;Y++;let $=P.readdirCached();if(P.calledReaddir())this.walkCB3(P,$,j,f);else P.readdirCB((w,O)=>this.walkCB3(P,O,j,f),!0)}f()}walkCB3(q,_,j,K){j=j.filterEntries(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,w]of j.matches.entries()){if(this.#P(P))continue;Y++,this.match(P,$,w).then(()=>f())}for(let[P,$]of j.subwalks.entries())Y++,this.walkCB2(P,$,j.child(),f);f()}walkCBSync(q,_,j){if(this.signal?.aborted)j();this.walkCB2Sync(q,_,new I3(this.opts),j)}walkCB2Sync(q,_,j,K){if(this.#f(q))return K();if(this.signal?.aborted)K();if(this.paused){this.onResume(()=>this.walkCB2Sync(q,_,j,K));return}j.processPatterns(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,w]of j.matches.entries()){if(this.#P(P))continue;this.matchSync(P,$,w)}for(let P of j.subwalkTargets()){if(this.maxDepth!==1/0&&P.depth()>=this.maxDepth)continue;Y++;let $=P.readdirSync();this.walkCB3Sync(P,$,j,f)}f()}walkCB3Sync(q,_,j,K){j=j.filterEntries(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,w]of j.matches.entries()){if(this.#P(P))continue;this.matchSync(P,$,w)}for(let[P,$]of j.subwalks.entries())Y++,this.walkCB2Sync(P,$,j.child(),f);f()}}class a7 extends r9{matches=new Set;constructor(q,_,j){super(q,_,j)}matchEmit(q){this.matches.add(q)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())await this.path.lstat();return await new Promise((q,_)=>{this.walkCB(this.path,this.patterns,()=>{if(this.signal?.aborted)_(this.signal.reason);else q(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}}class B7 extends r9{results;constructor(q,_,j){super(q,_,j);this.results=new E_({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(q){if(this.results.write(q),!this.results.flowing)this.pause()}stream(){let q=this.path;if(q.isUnknown())q.lstat().then(()=>{this.walkCB(q,this.patterns,()=>this.results.end())});else this.walkCB(q,this.patterns,()=>this.results.end());return this.results}streamSync(){if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}var Yh=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Eq{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(q,_){if(!_)throw new TypeError("glob options required");if(this.withFileTypes=!!_.withFileTypes,this.signal=_.signal,this.follow=!!_.follow,this.dot=!!_.dot,this.dotRelative=!!_.dotRelative,this.nodir=!!_.nodir,this.mark=!!_.mark,!_.cwd)this.cwd="";else if(_.cwd instanceof URL||_.cwd.startsWith("file://"))_.cwd=Ph(_.cwd);if(this.cwd=_.cwd||"",this.root=_.root,this.magicalBraces=!!_.magicalBraces,this.nobrace=!!_.nobrace,this.noext=!!_.noext,this.realpath=!!_.realpath,this.absolute=_.absolute,this.includeChildMatches=_.includeChildMatches!==!1,this.noglobstar=!!_.noglobstar,this.matchBase=!!_.matchBase,this.maxDepth=typeof _.maxDepth==="number"?_.maxDepth:1/0,this.stat=!!_.stat,this.ignore=_.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof q==="string")q=[q];if(this.windowsPathsNoEscape=!!_.windowsPathsNoEscape||_.allowWindowsEscape===!1,this.windowsPathsNoEscape)q=q.map(($)=>$.replace(/\\/g,"/"));if(this.matchBase){if(_.noglobstar)throw new TypeError("base matching requires globstar");q=q.map(($)=>$.includes("/")?$:`./**/${$}`)}if(this.pattern=q,this.platform=_.platform||Yh,this.opts={..._,platform:this.platform},_.scurry){if(this.scurry=_.scurry,_.nocase!==void 0&&_.nocase!==_.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let $=_.platform==="win32"?E3:_.platform==="darwin"?o7:_.platform?R3:Z$;this.scurry=new $(this.cwd,{nocase:_.nocase,fs:_.fs})}this.nocase=this.scurry.nocase;let j=this.platform==="darwin"||this.platform==="win32",K={..._,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:j,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},Y=this.pattern.map(($)=>new Yq($,K)),[f,P]=Y.reduce(($,w)=>{return $[0].push(...w.set),$[1].push(...w.globParts),$},[[],[]]);this.patterns=f.map(($,w)=>{let O=P[w];if(!O)throw new Error("invalid pattern object");return new NK($,O,0,this.platform)})}async walk(){return[...await new a7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new a7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new B7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new B7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}var i9=(q,_={})=>{if(!Array.isArray(q))q=[q];for(let j of q)if(new Yq(j,_).hasMagic())return!0;return!1};function e7(q,_={}){return new Eq(q,_).streamSync()}function G$(q,_={}){return new Eq(q,_).stream()}function u$(q,_={}){return new Eq(q,_).walkSync()}async function A$(q,_={}){return new Eq(q,_).walk()}function F7(q,_={}){return new Eq(q,_).iterateSync()}function D$(q,_={}){return new Eq(q,_).iterate()}var fh=e7,$h=Object.assign(G$,{sync:e7}),wh=F7,Oh=Object.assign(D$,{sync:F7}),zh=Object.assign(u$,{stream:e7,iterate:F7}),t7=Object.assign(A$,{glob:A$,globSync:u$,sync:zh,globStream:G$,stream:$h,globStreamSync:e7,streamSync:fh,globIterate:D$,iterate:Oh,globIterateSync:F7,iterateSync:wh,Glob:Eq,hasMagic:i9,escape:hK,unescape:Aq});t7.glob=t7;l6();async function C$(q,_={}){let j=$8.getInstance().getTrashDirectory();if(!h$(j))Wh(j,{recursive:!0});let K=Array.isArray(q)?q:[q];for(let Y of K){let f=await t7(Y),P=f.length>0?f:[Y];for(let $ of P)try{if(!h$($)){if(!_.force){console.error(`trash: ${$}: No such file or directory`);continue}continue}if(Hh($).isDirectory()&&!_.recursive){if(!_.force){console.error(`trash: ${$}: is a directory`);continue}}let O=Th($),v=Date.now(),z=Jh(j,`${O}.${v}`);vh($,z),console.log(`Moved ${O} to trash`)}catch(w){if(!_.force){let O=w instanceof Error?w.message:String(w);console.error(`trash: ${$}: ${O}`)}}}}j_();l6();import{readdirSync as Zh,renameSync as kh}from"fs";import{join as V$}from"path";async function M$(){let q=$8.getInstance().getTrashDirectory(),_=Zh(q);if(_.length===0){console.log("Trash is empty");return}let j=await T6({message:"Select file to restore:",options:_.map((K)=>({value:K,label:K}))});if(p8(j))return;kh(V$(q,j),V$(process.cwd(),j)),console.log(`Restored ${j}`)}l6();import{appendFileSync as Xh}from"fs";function Ah(q){let j=q.toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter((f)=>f.length>2).slice(0,4).join("-"),K=j.length>30?j.substring(0,27)+"...":j,Y=new Date().toISOString().substring(11,19).replace(/:/g,"");return`${K}-${Y}`}async function N$(q,_={}){if(!q||q.trim()==="")console.error("Error: Message is required"),process.exit(1);let j=$8.getInstance(),K=new Date().toISOString(),Y=$8.getCurrentProjectName(),f=Ah(q),P=`${Y}_${f}_overview`,$=j.getIndexPath(),w={type:"overview",content:q,session_id:f,project:Y,timestamp:K};j.ensureDirectory(j.getDataDirectory()),Xh($,JSON.stringify(w)+`
|
||
`,"utf8"),console.log(JSON.stringify({success:!0,document_id:P,session_id:f,project:Y,timestamp:K,suppressOutput:!0}))}j_();var W6={red:"#FF073A",pink:"#FF1053",blue:"#0077FF",green:"#00FF88",yellow:"#FFD700",purple:"#9B59B6"},b$=["\uD83C\uDFB5","\uD83C\uDFB6","\uD83C\uDFBC","\uD83C\uDFA4","\uD83C\uDFA7","\uD83D\uDD0A"],bK=["\uD83D\uDC8E","\uD83C\uDF52","\uD83C\uDF4B","\uD83D\uDD14","⭐","7️⃣","\uD83C\uDFB0","\uD83D\uDCB0"];async function R$(){D7(N6(W6.pink,W6.blue)("\uD83C\uDFB0 WELCOME TO VEGAS CASINO MEMORY GAMBLING \uD83C\uDFB0")),console.log(y.yellow("✨ Where memory compression meets Las Vegas excitement! ✨")),console.log(y.gray(`What happens in ~/.claude-mem, stays in ~/.claude-mem!
|
||
`));let q=await Gh();uh();let _=!0;while(_){let j=await T6({message:`\uD83D\uDCB0 ${q.name}, you have ${q.chips} chips. Choose your game:`,options:[{value:"slots",label:"\uD83C\uDFB0 Compression Slots - Match 3 memory patterns to win!"},{value:"blackjack",label:"\uD83C\uDCCF Memory Blackjack - Get close to 2.1MB without going over!"},{value:"poker",label:"\uD83C\uDFAD Vector Poker - Best semantic hand wins!"},{value:"roulette",label:"\uD83C\uDFB2 Trash Roulette - Bet on which memories get deleted!"},{value:"vip",label:"\uD83D\uDC51 VIP High-Stakes Room"},{value:"stats",label:"\uD83D\uDCCA View Casino Stats"},{value:"exit",label:"\uD83D\uDEAA Cash Out and Leave"}]});if(j==="exit"){_=!1;continue}switch(j){case"slots":await Dh(q);break;case"blackjack":await hh(q);break;case"poker":await Ch(q);break;case"roulette":await Vh(q);break;case"vip":await Mh(q);break;case"stats":await Sh(q);break}if(q.chips<=0)console.log(y.red(`
|
||
\uD83D\uDCB8 You're out of chips! Thanks for playing!`)),_=!1}kq(N6(W6.yellow,W6.green)("\uD83C\uDF89 Thanks for gambling at the Memory Casino! \uD83C\uDF89"))}async function Gh(){return{name:"High Roller",chips:1000,level:"Regular",wins:0,losses:0}}function uh(){console.log(y.magenta(`
|
||
\uD83C\uDF1F ═══════════════════════════════════════════════════════════ \uD83C\uDF1F`)),console.log(N6(W6.red,W6.yellow)(" ██╗ ██╗███████╗ ██████╗ █████╗ ███████╗")),console.log(N6(W6.red,W6.yellow)(" ██║ ██║██╔════╝██╔════╝ ██╔══██╗██╔════╝")),console.log(N6(W6.red,W6.yellow)(" ██║ ██║█████╗ ██║ ███╗███████║███████╗")),console.log(N6(W6.red,W6.yellow)(" ╚██╗ ██╔╝██╔══╝ ██║ ██║██╔══██║╚════██║")),console.log(N6(W6.red,W6.yellow)(" ╚████╔╝ ███████╗╚██████╔╝██║ ██║███████║")),console.log(N6(W6.red,W6.yellow)(" ╚═══╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝")),console.log(y.cyan(" \uD83C\uDFB0 MEMORY CASINO \uD83C\uDFB0")),console.log(y.magenta("\uD83C\uDF1F ═══════════════════════════════════════════════════════════ \uD83C\uDF1F")),console.log(y.blue("\uD83C\uDF78 Complimentary memory refresher cocktails at the bar!")),console.log(y.green(`${b$[Math.floor(Math.random()*b$.length)]} Smooth jazz playing in the background...`)),console.log(y.yellow("\uD83D\uDCA8 Steam rising from hot compression algorithms!")),console.log(y.magenta(`✨ Neon function signs blinking everywhere!
|
||
`))}async function Dh(q){console.log(y.cyan(`
|
||
\uD83C\uDFB0 Welcome to Compression Slots!`)),console.log(y.gray(`Match 3 symbols to compress your way to victory!
|
||
`));let _=50;if(q.chips<_){console.log(y.red("\uD83D\uDCB8 Not enough chips to play slots!"));return}let j=Kq();j.start("\uD83C\uDFB0 Spinning the reels..."),await new Promise((P)=>setTimeout(P,2000));let K=bK[Math.floor(Math.random()*bK.length)],Y=bK[Math.floor(Math.random()*bK.length)],f=bK[Math.floor(Math.random()*bK.length)];if(j.stop(),console.log(y.yellow(`
|
||
\uD83C\uDFB0 ${K} | ${Y} | ${f} \uD83C\uDFB0`)),K===Y&&Y===f){let P=_*10;q.chips+=P-_,q.wins++,console.log(y.green(`
|
||
\uD83C\uDF89 JACKPOT! Three ${K}s! You win ${P} chips!`)),console.log(y.yellow("✨ Memory compression bonus activated! ✨"))}else if(K===Y||Y===f||K===f){let P=_*2;q.chips+=P-_,q.wins++,console.log(y.green(`
|
||
\uD83C\uDF8A Two matching symbols! You win ${P} chips!`))}else q.chips-=_,q.losses++,console.log(y.red(`
|
||
\uD83D\uDCB8 No match! You lose ${_} chips.`)),console.log(y.gray("Better luck next compression cycle!"))}async function hh(q){console.log(y.cyan(`
|
||
\uD83C\uDCCF Welcome to Memory Blackjack!`)),console.log(y.gray(`Get as close to 2.1MB as possible without going over!
|
||
`));let _=await m$(),j=2.1;console.log(y.yellow(`\uD83C\uDFAF Target: ${j}MB`)),console.log(y.blue(`\uD83D\uDCCA Current memory size: ${(_.totalSize/1024/1024).toFixed(2)}MB
|
||
`));let K=100;if(q.chips<K){console.log(y.red("\uD83D\uDCB8 Not enough chips to play blackjack!"));return}let Y=Math.random()*3,f=Math.random()*3;console.log(y.green(`\uD83C\uDCCF Your memory size: ${Y.toFixed(2)}MB`));let P=!0;while(P&&Y<j)if(await T6({message:"Choose your action:",options:[{value:"hit",label:"\uD83D\uDCC8 Hit (add more memory)"},{value:"stay",label:"✋ Stay (keep current size)"}]})==="hit"){let w=Math.random()*0.8;if(Y+=w,console.log(y.blue(`\uD83D\uDCC8 +${w.toFixed(2)}MB | Total: ${Y.toFixed(2)}MB`)),Y>j){console.log(y.red("\uD83D\uDCA5 BUST! Over 2.1MB!")),q.chips-=K,q.losses++;return}}else P=!1;while(f<1.7)f+=Math.random()*0.5;if(console.log(y.yellow(`\uD83C\uDFAD Dealer total: ${f.toFixed(2)}MB`)),f>j||Y>f){let $=K*2;q.chips+=$-K,q.wins++,console.log(y.green(`\uD83C\uDF89 You win! Earned ${$} chips!`))}else if(Y===f)console.log(y.yellow("\uD83E\uDD1D Push! No chips lost."));else q.chips-=K,q.losses++,console.log(y.red(`\uD83D\uDCB8 Dealer wins! Lost ${K} chips.`))}async function Ch(q){console.log(y.cyan(`
|
||
\uD83C\uDFAD Welcome to Vector Poker!`)),console.log(y.gray(`Best semantic hand wins!
|
||
`));let _=75;if(q.chips<_){console.log(y.red("\uD83D\uDCB8 Not enough chips to play poker!"));return}let j=S$(),K=S$();console.log(y.blue("\uD83C\uDCCF Your hand:")),j.forEach((P,$)=>{console.log(y.green(` ${$+1}. ${P}`))});let Y=E$(j),f=E$(K);if(console.log(y.yellow(`
|
||
\uD83C\uDFAF Your semantic strength: ${Y}`)),console.log(y.blue(`
|
||
\uD83C\uDFAD Dealer hand:`)),K.forEach((P,$)=>{console.log(y.red(` ${$+1}. ${P}`))}),console.log(y.yellow(`\uD83C\uDFAF Dealer semantic strength: ${f}`)),Y>f){let P=_*3;q.chips+=P-_,q.wins++,console.log(y.green(`\uD83C\uDF89 Your vectors win! Earned ${P} chips!`))}else if(Y===f)console.log(y.yellow("\uD83E\uDD1D Semantic tie! No chips lost."));else q.chips-=_,q.losses++,console.log(y.red(`\uD83D\uDCB8 Dealer's vectors win! Lost ${_} chips.`))}async function Vh(q){console.log(y.cyan(`
|
||
\uD83C\uDFB2 Welcome to Trash Roulette!`)),console.log(y.gray(`Bet on which memories get deleted!
|
||
`));let _=60;if(q.chips<_){console.log(y.red("\uD83D\uDCB8 Not enough chips to play roulette!"));return}let j=await T6({message:"Place your bet:",options:[{value:"old",label:"\uD83D\uDDC2️ Old files (>30 days)"},{value:"large",label:"\uD83D\uDCCA Large files (>1MB)"},{value:"recent",label:"\uD83C\uDD95 Recent files (<7 days)"},{value:"compressed",label:"\uD83D\uDDDC️ Already compressed files"}]}),K=Kq();K.start("\uD83C\uDFB2 Spinning the deletion wheel..."),await new Promise((P)=>setTimeout(P,3000)),K.stop();let Y=["old","large","recent","compressed"],f=Y[Math.floor(Math.random()*Y.length)];if(console.log(y.yellow(`
|
||
\uD83C\uDFB2 The wheel lands on: ${Eh(f)}`)),f===j){let P=_*4;q.chips+=P-_,q.wins++,console.log(y.green(`\uD83C\uDF89 Correct prediction! You win ${P} chips!`)),console.log(y.yellow("\uD83D\uDDD1️ Memory cleanup bonus activated!"))}else q.chips-=_,q.losses++,console.log(y.red(`\uD83D\uDCB8 Wrong prediction! Lost ${_} chips.`)),console.log(y.gray("\uD83D\uDD04 The memory roulette wheel is unpredictable!"))}async function Mh(q){if(q.chips<500){console.log(y.red(`
|
||
\uD83D\uDEAB VIP Room requires 500+ chips!`)),console.log(y.yellow("\uD83D\uDCB0 Keep gambling to reach VIP status!"));return}switch(console.log(y.magenta(`
|
||
\uD83D\uDC51 Welcome to the VIP High-Stakes Room!`)),console.log(y.yellow(`✨ Where compression legends are made! ✨
|
||
`)),await T6({message:"Choose your high-stakes game:",options:[{value:"jackpot",label:"\uD83D\uDC8E Memory Compression Jackpot (500 chips)"},{value:"tournament",label:"\uD83C\uDFC6 Vector Tournament (300 chips)"},{value:"leave",label:"\uD83D\uDEAA Return to main floor"}]})){case"jackpot":await Nh(q);break;case"tournament":await bh(q);break}}async function Nh(q){if(q.chips<500){console.log(y.red("\uD83D\uDCB8 Not enough chips for the jackpot!"));return}console.log(y.magenta(`
|
||
\uD83D\uDC8E COMPRESSION JACKPOT ROUND!`));let j=Kq();j.start("\uD83D\uDC8E Compressing the ultimate memory sequence..."),await new Promise((Y)=>setTimeout(Y,4000)),j.stop();let K=Math.random();if(K<0.1)q.chips+=9500,q.wins++,console.log(N6(W6.red,W6.yellow)(`
|
||
\uD83C\uDF86 MASSIVE JACKPOT! ${1e4} CHIPS! \uD83C\uDF86`)),console.log(y.yellow("\uD83C\uDFC6 You are now a Memory Compression Legend!")),q.level="Legend";else if(K<0.3)q.chips+=2000,q.wins++,console.log(y.green(`\uD83C\uDF89 Big win! ${2500} chips!`));else q.chips-=500,q.losses++,console.log(y.red(`\uD83D\uDCB8 No jackpot this time! Lost ${500} chips.`))}async function bh(q){console.log(y.cyan(`
|
||
\uD83C\uDFC6 Vector Tournament - Battle of the Semantics!`));let _=300;if(q.chips<_){console.log(y.red("\uD83D\uDCB8 Not enough chips for the tournament!"));return}q.chips-=_;let j=Math.floor(Math.random()*8)+1;if(j===1){let K=_*6;q.chips+=K,q.wins++,console.log(y.yellow(`\uD83E\uDD47 FIRST PLACE! You win ${K} chips!`))}else if(j<=3){let K=_*2;q.chips+=K,q.wins++,console.log(y.gray(`\uD83E\uDD48 Top 3 finish! You win ${K} chips!`))}else q.losses++,console.log(y.red(`\uD83D\uDCCA Finished ${j}th place. Better luck next tournament!`))}async function Sh(q){console.log(y.cyan(`
|
||
\uD83D\uDCCA Casino Statistics`)),console.log(y.green(`\uD83D\uDCB0 Current chips: ${q.chips}`)),console.log(y.blue(`\uD83C\uDFC6 Wins: ${q.wins}`)),console.log(y.red(`\uD83D\uDCB8 Losses: ${q.losses}`)),console.log(y.yellow(`⭐ Level: ${q.level}`));let _=await m$();console.log(y.magenta(`
|
||
\uD83D\uDCC1 Memory System Stats:`)),console.log(y.green(`\uD83D\uDCC4 Total files: ${_.totalFiles}`)),console.log(y.blue(`\uD83D\uDCBE Total size: ${(_.totalSize/1024/1024).toFixed(2)}MB`)),console.log(y.yellow(`\uD83D\uDDDC️ Compression ratio: ${_.compressionRatio.toFixed(2)}%`))}function S$(){let q=["vector_embedding","neural_pathway","context_window","token_limit","semantic_similarity","attention_head","transformer_layer","gradient_flow"];return Array.from({length:5},()=>q[Math.floor(Math.random()*q.length)])}function E$(q){return q.reduce((_,j)=>_+j.length+Math.random()*10,0)}function Eh(q){return{old:"\uD83D\uDDC2️ Old files",large:"\uD83D\uDCCA Large files",recent:"\uD83C\uDD95 Recent files",compressed:"\uD83D\uDDDC️ Compressed files"}[q]||q}async function m$(){return{totalFiles:Math.floor(Math.random()*100)+50,totalSize:Math.floor(Math.random()*50*1024*1024),compressionRatio:Math.random()*30+70,oldestFile:new Date(Date.now()-Math.random()*30*24*60*60*1000),newestFile:new Date}}F3();z7();import f6 from"fs";import I6 from"path";import{execSync as I$}from"child_process";async function g$(q){try{if(q.update){await Rh(q);return}let _=I6.join(process.cwd(),"package.json"),j="unknown",K="unknown";if(f6.existsSync(_))try{let E=JSON.parse(f6.readFileSync(_,"utf-8"));j=E.version||"unknown",K=E.name||I6.basename(process.cwd())}catch(E){K=I6.basename(process.cwd())}let Y=[],f=q.historical||1;if(q.generate)Y.push(q.generate),f=1,console.log(`\uD83C\uDFAF Generating changelog for specific version: ${q.generate}`);else if(j!=="unknown"){let E=j.split(".");if(E.length===3){let L=parseInt(E[0]),d=parseInt(E[1]),V=parseInt(E[2]);for(let b=0;b<f;b++)if(Y.push(`${L}.${d}.${V}`),V===0){if(d===0)break;d--,V=9}else V--}}if(Y.length===0)console.log("⚠️ Could not determine versions to search. Please check package.json"),process.exit(1);let P=I6.join(process.env.HOME||process.env.USERPROFILE||"",".claude-mem","projects"),$=I6.join(P,`${K}-changelog.jsonl`),w=!1;if(f6.existsSync($)){let E=f6.readFileSync($,"utf-8").split(`
|
||
`).filter((L)=>L.trim());for(let L of E)try{if(JSON.parse(L).version===j)w=!0}catch(d){}if(!q.historical&&!q.generate&&f===1){if(w)console.log(`❌ Version ${j} already has changelog entries.`),console.log(`
|
||
\uD83D\uDCDD Workflow:`),console.log(" 1. Make your code updates"),console.log(" 2. Build and test: bun run build"),console.log(" 3. Bump version: npm version patch"),console.log(" 4. Generate changelog: claude-mem changelog"),console.log(` 5. Commit and push
|
||
`),console.log("\uD83D\uDCA1 Or use --historical 1 to regenerate this version's changelog"),process.exit(1)}}let O=[];if(q.start&&q.end){let E=q.generate||j;O.push({version:E,startTime:q.start,endTime:q.end}),console.log(`\uD83D\uDCC5 Using custom time range for ${E}:`),console.log(` Start: ${new Date(q.start).toLocaleString()}`),console.log(` End: ${new Date(q.end).toLocaleString()}`)}else try{let E=I$(`npm view ${K} time --json`,{encoding:"utf-8",timeout:5000}),L=JSON.parse(E),d="";if(f>1){let b=Y[Y.length-1].split("."),p=parseInt(b[0]),r=parseInt(b[1]),t=parseInt(b[2]);if(t>0)d=`${p}.${r}.${t-1}`;else if(r>0){let F=`${p}.${r-1}.`,Y8=Object.keys(L).filter((q8)=>q8.startsWith(F)).sort((q8,z8)=>{let w8=parseInt(q8.split(".")[2]||"0");return parseInt(z8.split(".")[2]||"0")-w8});if(Y8.length>0)d=Y8[0]}else if(p>0){let F=`${p-1}.`,Y8=Object.keys(L).filter((q8)=>q8.startsWith(F)).sort((q8,z8)=>{let[,w8,K8]=q8.split(".").map(Number),[,G8,o8]=z8.split(".").map(Number);if(w8!==G8)return G8-w8;return o8-K8});if(Y8.length>0)d=Y8[0]}if(q.verbose&&d&&L[d])console.log(`\uD83D\uDCCD Using ${d} as start boundary for time ranges`)}for(let V=0;V<Y.length;V++){let b=Y[V],p="2000-01-01T00:00:00Z";if(V===0){let t=b.split("."),F=parseInt(t[0]),Y8=parseInt(t[1]),q8=parseInt(t[2]),z8="";if(q8>0)z8=`${F}.${Y8}.${q8-1}`;else if(Y8>0){let w8=`${F}.${Y8-1}.`,K8=Object.keys(L).filter((G8)=>G8.startsWith(w8)).sort((G8,o8)=>{let e8=parseInt(G8.split(".")[2]||"0");return parseInt(o8.split(".")[2]||"0")-e8});if(K8.length>0)z8=K8[0]}if(L[z8])p=L[z8]}else if(V<Y.length-1){let t=Y[V+1];if(L[t])p=L[t]}else if(d&&L[d])p=L[d];let r=L[b]||new Date().toISOString();if(O.push({version:b,startTime:p,endTime:r}),q.verbose)console.log(`\uD83D\uDCC5 Version ${b}: ${new Date(p).toLocaleString()} - ${new Date(r).toLocaleString()}`)}if(f===1){let V=O[0];if(V)console.log(`\uD83D\uDCE6 Using npm time range for ${V.version}: ${new Date(V.startTime).toLocaleString()} - ${new Date(V.endTime).toLocaleString()}`)}}catch(E){console.log("❌ Could not fetch npm publish times. Cannot proceed without time ranges."),process.exit(1)}console.log(`\uD83D\uDD0D Searching memories for versions: ${Y.join(", ")}`),console.log(`\uD83D\uDCE6 Project: ${K}
|
||
`);let v=O.length>0?`You are helping generate a changelog by searching for memories within specific time ranges for multiple versions.
|
||
|
||
PROJECT: ${K}
|
||
VERSION TIME RANGES:
|
||
${O.map((E)=>`- Version ${E.version}: ${new Date(E.startTime).toLocaleDateString()} to ${new Date(E.endTime).toLocaleDateString()}`).join(`
|
||
`)}
|
||
|
||
YOUR TASK:
|
||
Use mcp__claude-mem__chroma_query_documents to search for memories for each version time range.
|
||
|
||
SEARCH STRATEGY:
|
||
${O.map((E)=>{let L=new Date(E.startTime),d=new Date(E.endTime),V=[],b=new Date(L);while(b<=d){let p=b.toISOString().split("T")[0];V.push(p),b.setDate(b.getDate()+1)}return`
|
||
Version ${E.version} (${new Date(E.startTime).toLocaleDateString()} to ${new Date(E.endTime).toLocaleDateString()}):
|
||
1. Search for memories from these dates: ${V.join(", ")}
|
||
2. Make multiple calls to mcp__claude-mem__chroma_query_documents:
|
||
- collection_name: "claude_memories"
|
||
- query_texts: Include the project name AND date in each query:
|
||
* "${K} ${V[0]} feature"
|
||
* "${K} ${V[0]} fix"
|
||
* "${K} ${V[0]} change"
|
||
* "${K} ${V[0]} improvement"
|
||
* "${K} ${V[0]} refactor"
|
||
- n_results: 50
|
||
3. The date in the query text helps semantic search find memories from that day
|
||
4. Assign memories to this version if their timestamp falls within:
|
||
- Start: ${E.startTime}
|
||
- End: ${E.endTime}`}).join(`
|
||
`)}
|
||
|
||
IMPORTANT:
|
||
- Always include project name and date in query_texts for best results
|
||
- Semantic search will naturally find memories near those dates
|
||
- Group returned memories by version based on their timestamp metadata
|
||
|
||
Return a JSON object with this structure:
|
||
{
|
||
"memories": [
|
||
{
|
||
"version": "version_number",
|
||
"text": "memory content",
|
||
"metadata": {metadata object with timestamp},
|
||
"relevance": "high/medium/low"
|
||
}
|
||
]
|
||
}
|
||
|
||
Group memories by the version they belong to based on timestamp.
|
||
Start searching now.`:"ERROR: No time ranges available. This should never happen.";if(O.length===0)console.log("❌ No time ranges available. Cannot search memories."),process.exit(1);if(q.verbose)console.log("\uD83D\uDCDD Calling Claude to search memories...");let z=await lq({prompt:v,options:{allowedTools:["mcp__claude-mem__chroma_query_documents","mcp__claude-mem__chroma_get_documents"],pathToClaudeCodeExecutable:Tq()}}),W="";if(z&&typeof z==="object"&&Symbol.asyncIterator in z){for await(let E of z)if(E?.type==="assistant"&&E?.message?.content){let L=E.message.content;if(typeof L==="string")W+=L;else if(Array.isArray(L)){for(let d of L)if(d.type==="text"&&d.text)W+=d.text}}}let J=[];try{let E=W.match(/```json\n([\s\S]*?)\n```/)||W.match(/\{[\s\S]*\}/);if(E){let L=JSON.parse(E[1]||E[0]);if(L.memories&&Array.isArray(L.memories))J=L.memories}}catch(E){console.error("⚠️ Could not parse memory search results:",E)}if(J.length===0)console.log(`
|
||
⚠️ No version-related memories found. Try compressing more sessions first.`),process.exit(1);console.log(`✅ Found ${J.length} version-related memories
|
||
`);let H=I$('date "+%Y-%m-%d %H:%M:%S %Z"').toString().trim().split(" ")[0],X=`Analyze these memories and generate changelog entries.
|
||
|
||
PROJECT: ${K}
|
||
DATE: ${H}
|
||
|
||
MEMORIES BY VERSION:
|
||
${Y.map((E)=>{let L=J.filter((d)=>d.version===E);if(L.length===0)return`### Version ${E}
|
||
No memories found.`;return`### Version ${E} (${L.length} memories):
|
||
${L.map((d,V)=>`${V+1}. ${d.text}`).join(`
|
||
`)}`}).join(`
|
||
|
||
`)}
|
||
|
||
INSTRUCTIONS:
|
||
1. Extract concrete changes, fixes, and additions from the memories
|
||
2. Categorize each change as: Added, Changed, Fixed, Removed, Deprecated, or Security
|
||
3. Write clear, user-facing descriptions
|
||
4. Start each entry with an action verb
|
||
5. Focus on what matters to users, not internal implementation details
|
||
|
||
Return ONLY a JSON array with this structure:
|
||
[
|
||
{
|
||
"version": "3.6.1",
|
||
"type": "Added",
|
||
"description": "New feature description"
|
||
},
|
||
{
|
||
"version": "3.6.1",
|
||
"type": "Fixed",
|
||
"description": "Bug fix description"
|
||
}
|
||
]`;console.log("\uD83D\uDD04 Generating changelog entries...");let A=await lq({prompt:X,options:{allowedTools:[],pathToClaudeCodeExecutable:Tq()}}),G="";if(A&&typeof A==="object"&&Symbol.asyncIterator in A){for await(let E of A)if(E?.type==="assistant"&&E?.message?.content){let L=E.message.content;if(typeof L==="string")G+=L;else if(Array.isArray(L)){for(let d of L)if(d.type==="text"&&d.text)G+=d.text}}}let h=[];try{let E=G.match(/```json\n([\s\S]*?)\n```/)||G.match(/\[[\s\S]*\]/);if(E){let L=JSON.parse(E[1]||E[0]);if(Array.isArray(L)){let d=new Date().toISOString();h=L.map((V)=>({...V,date:H,timestamp:V.timestamp||d,generatedAt:d}))}}}catch(E){console.error("⚠️ Could not parse changelog entries:",E)}if(h.length===0)console.log("⚠️ No changelog entries generated."),process.exit(1);if(!f6.existsSync(P))f6.mkdirSync(P,{recursive:!0});if(console.log(`
|
||
\uD83D\uDCBE Saving ${h.length} changelog entries to ${I6.basename($)}`),q.historical&&f>1||q.generate){let E=[];if(f6.existsSync($)){let V=f6.readFileSync($,"utf-8").split(`
|
||
`).filter((b)=>b.trim());for(let b of V)try{let p=JSON.parse(b);if(!Y.includes(p.version))E.push(p)}catch(p){}}let d=[...E,...h].map((V)=>JSON.stringify(V)).join(`
|
||
`)+`
|
||
`;f6.writeFileSync($,d),console.log(`\uD83D\uDD04 Regenerated entries for versions: ${Y.join(", ")}`)}else{let E=h.map((L)=>JSON.stringify(L)).join(`
|
||
`)+`
|
||
`;f6.appendFileSync($,E)}console.log(`
|
||
\uD83D\uDCDD Generating CHANGELOG.md from entries...`);let M=[];if(f6.existsSync($)){let E=f6.readFileSync($,"utf-8").split(`
|
||
`).filter((L)=>L.trim());for(let L of E)try{M.push(JSON.parse(L))}catch(d){}}let I=new Map;for(let E of M){if(!I.has(E.version))I.set(E.version,[]);I.get(E.version).push(E)}let N=`# Changelog
|
||
|
||
All notable changes to this project will be documented in this file.
|
||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||
|
||
`,R=Array.from(I.keys()).sort((E,L)=>{let d=E.split(".").map(Number),V=L.split(".").map(Number);for(let b=0;b<3;b++)if(d[b]!==V[b])return V[b]-d[b];return 0});for(let E of R){let L=I.get(E),d=L[0].date||H;N+=`
|
||
## [${E}] - ${d}
|
||
|
||
`;let V=["Added","Changed","Fixed","Removed","Deprecated","Security"];for(let b of V){let p=L.filter((r)=>r.type===b);if(p.length>0){N+=`### ${b}
|
||
`;for(let r of p)N+=`- ${r.description}
|
||
`;N+=`
|
||
`}}}let l=I6.join(process.cwd(),"CHANGELOG.md");if(f6.writeFileSync(l,N),console.log(`✅ Generated CHANGELOG.md with ${M.length} total entries across ${I.size} versions!`),q.preview){if(console.log(`
|
||
\uD83D\uDCC4 Preview:
|
||
`),console.log(N.split(`
|
||
`).slice(0,30).join(`
|
||
`)),N.split(`
|
||
`).length>30)console.log(`
|
||
... (truncated for preview)`)}}catch(_){if(console.error("❌ Error generating changelog:",_ instanceof Error?_.message:_),_ instanceof Error&&_.stack)console.error("Stack:",_.stack);process.exit(1)}}async function Rh(q){try{let _=I6.join(process.cwd(),"package.json"),j="unknown";if(f6.existsSync(_))try{j=JSON.parse(f6.readFileSync(_,"utf-8")).name||I6.basename(process.cwd())}catch(z){j=I6.basename(process.cwd())}let K=I6.join(process.env.HOME||process.env.USERPROFILE||"",".claude-mem","projects"),Y=I6.join(K,`${j}-changelog.jsonl`);if(!f6.existsSync(Y))console.log("❌ No changelog entries found. Generate some first with: claude-mem changelog"),process.exit(1);console.log("\uD83D\uDCDD Updating CHANGELOG.md from JSONL entries...");let f=[],P=f6.readFileSync(Y,"utf-8").split(`
|
||
`).filter((z)=>z.trim());for(let z of P)try{f.push(JSON.parse(z))}catch(W){}if(f.length===0)console.log("❌ No valid entries found in JSONL file"),process.exit(1);let $=new Map;for(let z of f){if(!$.has(z.version))$.set(z.version,[]);$.get(z.version).push(z)}let w=`# Changelog
|
||
|
||
All notable changes to this project will be documented in this file.
|
||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||
|
||
`,O=Array.from($.keys()).sort((z,W)=>{let J=z.split(".").map(Number),T=W.split(".").map(Number);for(let H=0;H<3;H++)if(J[H]!==T[H])return T[H]-J[H];return 0});for(let z of O){let W=$.get(z),J=W[0].date;w+=`
|
||
## [${z}] - ${J}
|
||
|
||
`;let T=["Added","Changed","Fixed","Removed","Deprecated","Security"];for(let H of T){let X=W.filter((A)=>A.type===H);if(X.length>0){w+=`### ${H}
|
||
`;for(let A of X)w+=`- ${A.description}
|
||
`;w+=`
|
||
`}}}let v=I6.join(process.cwd(),"CHANGELOG.md");if(f6.writeFileSync(v,w),console.log(`✅ Updated CHANGELOG.md with ${f.length} entries across ${$.size} versions!`),q.preview){if(console.log(`
|
||
\uD83D\uDCC4 Preview:
|
||
`),console.log(w.split(`
|
||
`).slice(0,30).join(`
|
||
`)),w.split(`
|
||
`).length>30)console.log(`
|
||
... (truncated for preview)`)}}catch(_){console.error("❌ Error updating changelog:",_ instanceof Error?_.message:_),process.exit(1)}}j_();import Bq from"path";import Rq from"fs";import p$ from"os";W7();F3();z7();import m_ from"fs";import y$ from"path";import mh from"os";class SK{titlesIndexPath;constructor(){this.titlesIndexPath=y$.join(mh.homedir(),".claude-mem","conversation-titles.jsonl"),this.ensureTitlesIndex()}ensureTitlesIndex(){let q=y$.dirname(this.titlesIndexPath);if(!m_.existsSync(q))m_.mkdirSync(q,{recursive:!0});if(!m_.existsSync(this.titlesIndexPath))m_.writeFileSync(this.titlesIndexPath,"","utf-8")}async generateTitle(q){let _=`Generate a 3-7 word descriptive title for this conversation based on the first message.
|
||
|
||
The title should:
|
||
- Capture the main topic or intent
|
||
- Be concise and descriptive
|
||
- Use proper capitalization
|
||
- Not include "Help with" or "Question about" prefixes
|
||
|
||
First message: "${q.substring(0,500)}"
|
||
|
||
Respond with just the title, nothing else.`,j=await lq({prompt:_,options:{model:"claude-3-5-haiku-20241022",pathToClaudeCodeExecutable:Tq()}}),K="";if(j&&typeof j==="object"&&Symbol.asyncIterator in j)for await(let Y of j){if(Y?.content)K+=Y.content;if(Y?.text)K+=Y.text}else if(typeof j==="string")K=j;return K.trim().replace(/^["']|["']$/g,"")}async batchGenerateTitles(q){let _=[];for(let j of q)try{let K=await this.generateTitle(j.firstMessage),Y={session_id:j.sessionId,generated_title:K,timestamp:new Date().toISOString(),project_name:j.projectName};_.push(Y),this.storeTitleInIndex(Y)}catch(K){console.error(`Failed to generate title for ${j.sessionId}:`,K)}return _}storeTitleInIndex(q){let _=JSON.stringify(q)+`
|
||
`;m_.appendFileSync(this.titlesIndexPath,_,"utf-8")}getExistingTitles(){let q=new Map;if(!m_.existsSync(this.titlesIndexPath))return q;let j=m_.readFileSync(this.titlesIndexPath,"utf-8").trim().split(`
|
||
`).filter(Boolean);for(let K of j)try{let Y=JSON.parse(K);q.set(Y.session_id,Y)}catch(Y){}return q}getTitleForSession(q){let j=this.getExistingTitles().get(q);return j?j.generated_title:null}}function U7(q){if(q<1024)return`${q}B`;if(q<1048576)return`${(q/1024).toFixed(1)}KB`;return`${(q/1048576).toFixed(1)}MB`}function Ih(q){let j=new Date().getTime()-q.getTime(),K=Math.floor(j/60000),Y=Math.floor(j/3600000),f=Math.floor(j/86400000);if(K<1)return"just now";if(K<60)return`${K}m ago`;if(Y<24)return`${Y}h ago`;if(f<7)return`${f}d ago`;if(f<30)return`${Math.floor(f/7)}w ago`;if(f<365)return`${Math.floor(f/30)}mo ago`;return`${Math.floor(f/365)}y ago`}function gh(q,_){try{let Y=new Date(q);if(!isNaN(Y.getTime()))return Y}catch{}let j=_.match(/(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})/);if(j){let[Y,f,P,$,w,O,v]=j;return new Date(parseInt(f),parseInt(P)-1,parseInt($),parseInt(w),parseInt(O),parseInt(v))}return Rq.statSync(_).mtime}function yh(q){try{let j=Rq.readFileSync(q,"utf-8").trim().split(`
|
||
`).filter(Boolean);for(let K of j)try{let Y=JSON.parse(K);if(Y.type==="user"&&Y.message?.content){let f=Y.message.content;if(Array.isArray(f)){let P=f.filter(($)=>$.type==="text").map(($)=>$.text).join(" ");if(P.trim())return P.trim()}else if(typeof f==="string")return f.trim()}}catch{}return"Conversation"}catch{return"Conversation"}}async function dh(){let q=new Set,_=Bq.join(p$.homedir(),".claude-mem","claude-mem-index.jsonl");if(!Rq.existsSync(_))return q;let K=Rq.readFileSync(_,"utf-8").trim().split(`
|
||
`).filter(Boolean);for(let Y of K)try{let f=JSON.parse(Y);if(f.session_id)q.add(f.session_id);else if(f.sessionId)q.add(f.sessionId)}catch{}return q}async function Lh(){let q=Bq.join(p$.homedir(),".claude","projects");if(!Rq.existsSync(q))return{conversations:[],skippedCount:0};let _=Rq.readdirSync(q).filter((f)=>Rq.statSync(Bq.join(q,f)).isDirectory()),j=[],K=await dh(),Y=0;for(let f of _){let P=Bq.join(q,f),$=Rq.readdirSync(P).filter((w)=>w.endsWith(".jsonl")).map((w)=>Bq.join(P,w));for(let w of $)try{let v=Rq.readFileSync(w,"utf-8").trim().split(`
|
||
`).filter(Boolean),z=JSON.parse(v[0]),W=v.length,J=Rq.statSync(w),T=J.size,H={sessionId:z.sessionId||Bq.basename(w,".jsonl"),timestamp:z.timestamp||J.mtime.toISOString(),messageCount:W,branch:z.branch,cwd:z.cwd||P,fileSize:T};if(K.has(H.sessionId)){Y++;continue}let X=Bq.basename(Bq.dirname(w)),A=gh(H.timestamp,w),G=Ih(A);j.push({filePath:w,...H,projectName:X,parsedDate:A,relativeDate:G})}catch{}}return{conversations:j,skippedCount:Y}}async function l$(q={}){console.clear(),D7(y.bgCyan.black(" CLAUDE-MEM IMPORT "));let _=Kq();_.start("Scanning conversation history");let{conversations:j,skippedCount:K}=await Lh();if(j.length===0){_.stop("No new conversations found");let w=K>0?`All ${K} conversation${K===1?" is":"s are"} already imported.`:"No conversations found.";kq(y.yellow(w));return}j.sort((w,O)=>O.parsedDate.getTime()-w.parsedDate.getTime());let Y=K>0?`Found ${j.length} new conversation${j.length===1?"":"s"} (${K} already imported)`:`Found ${j.length} new conversation${j.length===1?"":"s"}`;_.stop(Y);let f=j.reduce((w,O)=>{if(!w[O.projectName])w[O.projectName]=[];return w[O.projectName].push(O),w},{}),P=await T6({message:"How would you like to import?",options:[{value:"browse",label:"Browse by Project",hint:"Select project then conversations"},{value:"project",label:"Import Entire Project",hint:"Select project and import all conversations"},{value:"recent",label:"Recent Conversations",hint:"Import most recent across all projects"},{value:"search",label:"Search",hint:"Search for specific conversations"}]});if(p8(P)){w6("Import cancelled");return}let $=[];if(P==="browse"){let w=Object.entries(f).sort((T,H)=>H[1][0].parsedDate.getTime()-T[1][0].parsedDate.getTime()).map(([T,H])=>({value:T,label:T,hint:`${H.length} conversation${H.length===1?"":"s"}, latest: ${H[0].relativeDate}`})),O=await T6({message:"Select a project",options:w});if(p8(O)){w6("Import cancelled");return}let v=f[O],z=await r6({message:"Would you like to generate titles for easier browsing?",initialValue:!1});if(p8(z)){w6("Import cancelled");return}if(z)await d$(v,O);let W=new SK,J=v.map((T)=>{let H=W.getTitleForSession(T.sessionId),X=H?`"${H}" • `:"";return{value:T.sessionId,label:`${X}${T.relativeDate} • ${T.messageCount} messages • ${U7(T.fileSize)}`,hint:T.branch?`branch: ${T.branch}`:void 0}});if(q.multi){let T=await r2({message:`Select conversations from ${O} (Space to select, Enter to confirm)`,options:J,required:!1});if(p8(T)){w6("Import cancelled");return}let H=T;$=v.filter((X)=>H.includes(X.sessionId))}else{let T=!0,H=new Set;while(T&&v.length>H.size){let X=v.filter((I)=>!H.has(I.sessionId));if(X.length===0)break;let A=new SK,G=X.map((I)=>{let N=A.getTitleForSession(I.sessionId),R=N?`"${N}" • `:"";return{value:I.sessionId,label:`${R}${I.relativeDate} • ${I.messageCount} messages • ${U7(I.fileSize)}`,hint:I.branch?`branch: ${I.branch}`:void 0}}),h=await T6({message:`Select a conversation (${H.size}/${v.length} imported)`,options:[...G,{value:"done",label:"✅ Done importing",hint:"Exit import mode"}]});if(p8(h)||h==="done"){T=!1;break}let M=X.find((I)=>I.sessionId===h);if(M)$=[M],await L$($,q.verbose),H.add(M.sessionId)}if(H.size>0)kq(y.green(`✅ Imported ${H.size} conversation${H.size===1?"":"s"}`));else kq(y.yellow("No conversations imported"));return}}else if(P==="project"){let w=Object.entries(f).sort((J,T)=>T[1][0].parsedDate.getTime()-J[1][0].parsedDate.getTime()).map(([J,T])=>({value:J,label:J,hint:`${T.length} conversation${T.length===1?"":"s"}, latest: ${T[0].relativeDate}`})),O=await T6({message:"Select a project to import all conversations",options:w});if(p8(O)){w6("Import cancelled");return}let v=f[O],z=await r6({message:"Would you like to generate titles for easier browsing?",initialValue:!1});if(p8(z)){w6("Import cancelled");return}if(z)await d$(v,O);let W=await r6({message:`Import all ${v.length} conversation${v.length===1?"":"s"} from ${O}?`});if(p8(W)||!W){w6("Import cancelled");return}$=v}else if(P==="recent"){let w=await h_({message:"How many recent conversations?",placeholder:"10",initialValue:"10",validate:(v)=>{let z=parseInt(v);if(isNaN(z)||z<1)return"Please enter a valid number";if(z>j.length)return`Only ${j.length} available`}});if(p8(w)){w6("Import cancelled");return}let O=parseInt(w);$=j.slice(0,O)}else if(P==="search"){let w=await h_({message:"Search conversations (project name or session ID)",placeholder:"Enter search term"});if(p8(w)){w6("Import cancelled");return}let O=w.toLowerCase(),v=j.filter((H)=>H.projectName.toLowerCase().includes(O)||H.sessionId.toLowerCase().includes(O)||H.branch&&H.branch.toLowerCase().includes(O));if(v.length===0){kq(y.yellow("No matching conversations found"));return}let z=new SK,W=v.map((H)=>{let X=z.getTitleForSession(H.sessionId),A=X?`"${X}" • `:"";return{value:H.sessionId,label:`${A}${H.projectName} • ${H.relativeDate} • ${H.messageCount} msgs`,hint:U7(H.fileSize)}}),J=await r2({message:`Found ${v.length} matches. Select to import:`,options:W,required:!1});if(p8(J)){w6("Import cancelled");return}let T=J;$=v.filter((H)=>T.includes(H.sessionId))}if($.length>0)await L$($,q.verbose),kq(y.green(`✅ Successfully imported ${$.length} conversation${$.length===1?"":"s"}`));else kq(y.yellow("No conversations selected for import"))}async function d$(q,_){let j=new SK,K=j.getExistingTitles(),Y=q.filter(($)=>!K.has($.sessionId));if(Y.length===0){i2("All conversations already have titles!","Title Generation");return}let f=Kq();f.start(`Generating titles for ${Y.length} conversations...`);let P=Y.map(($)=>({sessionId:$.sessionId,projectName:_,firstMessage:yh($.filePath)}));try{await j.batchGenerateTitles(P),f.stop(`✅ Generated ${Y.length} titles`)}catch($){f.stop("❌ Failed to generate titles"),console.error(y.red(`Error: ${$}`))}}async function L$(q,_){let j=Kq();for(let K=0;K<q.length;K++){let Y=q[K],f=q.length>1?`[${K+1}/${q.length}] `:"";j.start(`${f}Importing ${Y.projectName} (${Y.relativeDate})`);try{let P=Bq.basename(Y.cwd);if(await new ZK().compress(Y.filePath,Y.sessionId,P),j.stop(`${f}Imported ${Y.projectName} (${Y.messageCount} messages)`),_)i2(`Session: ${Y.sessionId}
|
||
Size: ${U7(Y.fileSize)}
|
||
Branch: ${Y.branch||"main"}`,"Details")}catch(P){if(j.stop(`${f}Failed to import ${Y.projectName}`),_)console.error(y.red(`Error: ${P}`))}}}W7();class o9{options;applauseMeter=0;tomatoCount=0;constructor(q={}){this.options=q}displayCurtainRaise(){let q=`
|
||
${y.yellow("\uD83D\uDD6F️ \uD83D\uDD6F️ \uD83D\uDD6F️ GLOBE THEATRE \uD83D\uDD6F️ \uD83D\uDD6F️ \uD83D\uDD6F️")}
|
||
|
||
${N6.morning(`
|
||
╭─────────────────────────────────────╮
|
||
│ \uD83C\uDFAD MEMORY PALACE \uD83C\uDFAD │
|
||
│ "All the world's a stage" │
|
||
│ And all memory merely players │
|
||
╰─────────────────────────────────────╯
|
||
`)}
|
||
|
||
${y.dim("\uD83C\uDFBA *trumpet fanfare* \uD83C\uDFBA")}
|
||
`;console.log(q)}displayActHeader(q,_,j){if(console.log(`
|
||
`+"═".repeat(60)),console.log(y.bold.magenta(`\uD83C\uDFAD ACT ${q}: ${_.toUpperCase()}`)),j)console.log(y.italic.cyan(` "${j}"`));console.log("═".repeat(60)+`
|
||
`)}soliloquy(q,_){console.log(y.bold.yellow(`
|
||
${q.toUpperCase()}:`)),_.forEach((j,K)=>{setTimeout(()=>{console.log(y.italic(` ${j}`))},K*500)})}async presentDialogue(q,_,j){if(console.log(y.bold.blue(`
|
||
${q.toUpperCase()}:`)),console.log(y.italic(` "${_}"`)),j&&j.length>0)return console.log(y.dim(`
|
||
Choose thy response:`)),j.forEach((K,Y)=>{console.log(y.yellow(` ${Y+1}. ${K}`))}),j[0];return""}throwTomato(q){this.tomatoCount++,console.log(y.red(`\uD83C\uDF45 *SPLAT* - Tomato thrown! Reason: ${q}`)),console.log(y.dim(` Tomato count: ${this.tomatoCount}`))}addApplause(q=1){this.applauseMeter+=q;let _=this.getApplauseLevel();console.log(y.green(`\uD83D\uDC4F ${_} (${this.applauseMeter}/10)`))}getApplauseLevel(){if(this.applauseMeter>=10)return"STANDING OVATION! \uD83C\uDF89";if(this.applauseMeter>=7)return"Thunderous applause!";if(this.applauseMeter>=5)return"Hearty applause";if(this.applauseMeter>=3)return"Polite clapping";return"Scattered applause"}trumpetFanfare(){if(this.options.soundEffects)console.log(y.yellow("\uD83C\uDFBA *TA-DA-DA-DAAAA* \uD83C\uDFBA"))}dramaticError(q,_,j){if(console.log(y.red.bold(`
|
||
\uD83D\uDC80 TRAGEDY STRIKES! \uD83D\uDC80`)),console.log(y.red(`
|
||
Alas! A most grievous error in "${q}"`)),console.log(y.italic.red(` "${_}"`)),j)console.log(y.yellow(`
|
||
But fear not! The wise fool suggests:`)),console.log(y.italic.yellow(` "${j}"`));console.log(y.dim(`
|
||
*The crowd murmurs in concern*`))}displayCurtainFall(){console.log(y.yellow(`
|
||
\uD83C\uDFAD Thus ends our performance! \uD83C\uDFAD
|
||
"Exeunt, pursued by better memory"
|
||
|
||
${y.dim("*The Globe Theatre dims its candles*")}
|
||
\uD83D\uDD6F️ \uD83D\uDD6F️
|
||
`))}}class a9{static memoryMetaphors=["remembrance","reverie","recollection","reminiscence","memoir","chronicle","annals","archive"];static dramaticAdjectives=["noble","fair","gentle","worthy","beauteous","sweet","gracious","wondrous","most excellent"];static nameMemoryOperation(q){let _=this.dramaticAdjectives[Math.floor(Math.random()*this.dramaticAdjectives.length)],j=this.memoryMetaphors[Math.floor(Math.random()*this.memoryMetaphors.length)];return`${_} ${j} of ${q}`}static formatMemorySize(q){let _=q/1024;if(_<1024)return`${_.toFixed(1)} fair kilobytes`;return`${(_/1024).toFixed(1)} noble megabytes`}}j_();class I_{static instance;static getInstance(){if(!I_.instance)I_.instance=new I_;return I_.instance}async presentDialogueChoice(q,_,j){return console.log(y.bold.blue(`
|
||
${q.toUpperCase()}:`)),console.log(y.italic(` "${_}"`)),await T6({message:"Choose thy response:",options:j.map((Y)=>({value:Y.value,label:Y.label,hint:Y.hint}))})}async tomatoThrowingGame(q){if(console.log(y.red(`
|
||
\uD83C\uDF45 TOMATO THROWING TIME! \uD83C\uDF45`)),console.log(y.yellow(`Target: ${q}`)),await r6({message:"Dost thou wish to throw a tomato at this offensive code?"}))return console.log(y.red("\uD83C\uDF45 *SPLAT!* Direct hit!")),console.log(y.dim("*The audience cheers*")),!0;else return console.log(y.green("Thou art merciful this day.")),!1}async standingOvationMeter(q){console.log(y.yellow(`
|
||
\uD83D\uDC4F Rate the performance: ${q}`));let _=await T6({message:"How dost thou rate this performance?",options:[{value:"1",label:"\uD83D\uDE34 Boring as a sermon",hint:"1/10 - Tomatoes incoming"},{value:"3",label:"\uD83D\uDE10 Adequate for a provincial theatre",hint:"3/10 - Polite golf claps"},{value:"5",label:"\uD83D\uDE0A Most entertaining!",hint:"5/10 - Hearty applause"},{value:"7",label:"\uD83D\uDE0D Brilliant performance!",hint:"7/10 - Thunderous applause"},{value:"10",label:"\uD83E\uDD29 STANDING OVATION!",hint:"10/10 - Encore! Encore!"}]});return parseInt(_)}async generateSoliloquy(q,_){console.log(y.bold.magenta(`
|
||
\uD83C\uDFAD SOLILOQUY GENERATOR \uD83C\uDFAD`)),console.log(y.yellow(`${q} shall speak about: ${_}`));let j=await r6({message:"Wouldst thou contribute lines to this soliloquy?"}),K=[];if(j){console.log(y.cyan("Enter lines for the soliloquy (press Enter with empty line to finish):"));let Y=1;while(!0){let f=await h_({message:`Line ${Y}:`,placeholder:"Enter thy poetic line..."});if(!f||f.trim()==="")break;K.push(f),Y++}}else K.push(...this.getDefaultSoliloquyLines(_));return K}getDefaultSoliloquyLines(q){let _={memory:["What is memory but the echo of thoughts past?","In circuits deep, where data dreams reside,","Each byte a whisper of sessions gone by,","Compressed yet whole, like love in verse confined."],compression:["To compress, perchance to save - ay, there's the rub!","For in that compression, what data may come","When we have shuffled off this mortal coil","Of uncompressed transcripts?"],debugging:["Errors, errors everywhere, and not a fix in sight!","Each bug a riddle wrapped in mystery,","Hidden in the forest of our code,","Where fairies dance and exceptions play."],default:["All the world's a stage, and memory merely players,","They have their exits and their entrances,","And one codebase in its time plays many parts."]};return _[q]||_.default}async theatreTutorial(){console.log(y.bold.yellow(`
|
||
\uD83C\uDFAD WELCOME TO SHAKESPEARE'S MEMORY THEATRE! \uD83C\uDFAD`)),console.log(y.cyan("Let me show thee the wonders of our theatrical system...")),await this.presentDialogueChoice("GUIDE","Welcome, noble user, to our grand theatre! How shall we begin?",[{value:"explore",label:"Show me the Acts!",hint:"Learn about the five acts"},{value:"interactive",label:"Teach me interactions!",hint:"Learn interactive features"},{value:"skip",label:"Skip tutorial",hint:"Jump to the main performance"}]),console.log(y.red(`
|
||
\uD83C\uDF45 Tomato Throwing Demo:`)),await this.tomatoThrowingGame("if (x == null) return null; // Defensive programming"),await this.standingOvationMeter("Tutorial Introduction"),console.log(y.green(`
|
||
✨ Tutorial complete! Thou art ready for the grand performance!`))}async generateShakespeareanInsult(){let q=["artless","bawdy","beslubbering","bootless","churlish","cockered","clouted","craven","currish","dankish","dissembling","droning","errant","fawning","fobbing","froward","frothy","gleeking","goatish","gorbellied","impertinent","infectious","jarring","loggerheaded","lumpish","mammering","mangled","mewling","paunchy","pribbling","puking","puny","qualling","rank","reeky","roguish","ruttish","saucy","spleeny","spongy","surly","tottering","unmuzzled","vain","venomed","villainous","warped","wayward","weedy","yeasty"],_=["base-court","bat-fowling","beef-witted","beetle-headed","boil-brained","clapper-clawed","clay-brained","common-kissing","crook-pated","dismal-dreaming","dizzy-eyed","doghearted","dread-bolted","earth-vexing","elf-skinned","fat-kidneyed","fen-sucked","flap-mouthed","fly-bitten","folly-fallen","fool-born","full-gorged","guts-griping","half-faced","hasty-witted","hedge-born","hell-hated","idle-headed","ill-breeding","ill-nurtured","knotty-pated","milk-livered","motley-minded","onion-eyed","plume-plucked","pottle-deep","pox-marked","reeling-ripe","rough-hewn","rude-growing","rump-fed","shard-borne","sheep-biting","spur-galled","swag-bellied","tardy-gaited","tickle-brained","toad-spotted","unchin-snouted","weather-bitten"],j=["apple-john","baggage","barnacle","bladder","boar-pig","bugbear","bum-bailey","canker-blossom","clack-dish","clotpole","coxcomb","codpiece","death-token","dewberry","flap-dragon","flax-wench","flirt-gill","foot-licker","fustilarian","giglet","gudgeon","haggard","harpy","hedge-pig","horn-beast","hugger-mugger","joithead","lewdster","lout","maggot-pie","malt-worm","mammet","measle","minnow","miscreant","moldwarp","mumble-news","nut-hook","pigeon-egg","pignut","puttock","pumpion","ratsbane","scut","skainsmate","strumpet","varlot","vassal","whey-face","wagtail"],K=`${q[Math.floor(Math.random()*q.length)]} ${_[Math.floor(Math.random()*_.length)]} ${j[Math.floor(Math.random()*j.length)]}`;return console.log(y.red.bold(`
|
||
"Thou ${K}!"`)),console.log(y.dim("- Generated by the Bard's Insult Engine")),K}}class g3{theatre;interactive;constructor(q={}){this.theatre=new o9(q),this.interactive=I_.getInstance()}async performActI(q,_={}){if(this.theatre.displayCurtainRaise(),this.theatre.displayActHeader("I","Tragedy of Defensive Validation","To validate or not to validate"),_.interactive){if(await this.interactive.presentDialogueChoice("HAMLET_VALIDATOR","To validate, or not to validate, that is the question! What say you, noble user?",[{value:"validate",label:"Validation is essential!",hint:"The safe but verbose path"},{value:"skip",label:"Away with defensive code!",hint:"Make it work first!"},{value:"wise",label:"Validate only what fails",hint:"The wise middle path"}])==="skip")console.log('\uD83C\uDFAD Ah! A follower of the "Make It Work First" manifesto!'),this.theatre.addApplause(2)}if(await this.theatre.soliloquy("COMPRESSOR",["To compress, or not to compress, that is the question:","Whether 'tis nobler in the mind to suffer","The slings and arrows of outrageous memory bloat,","Or to take arms against this sea of data troubles,","And by compressing, end them?"]),!q){if(this.theatre.dramaticError("Missing Manuscript","Alas! No transcript provided for our noble compression!","Pray tell, provide a path to thy transcript file"),_.interactive)await this.interactive.tomatoThrowingGame("Missing required parameters");else this.theatre.throwTomato("No transcript provided");return}try{let{compress:j}=await Promise.resolve().then(() => (H7(),iP));console.log(`
|
||
\uD83C\uDFAD Beginning the compression ritual...`);let K=a9.nameMemoryOperation("compression");if(console.log(`\uD83D\uDCDC Performing: ${K}`),await j(q,_),this.theatre.addApplause(3),this.theatre.trumpetFanfare(),_.interactive){let Y=await this.interactive.standingOvationMeter("Compression Performance");this.theatre.addApplause(Math.floor(Y/2))}await this.theatre.presentDialogue("CHORUS","Behold! The transcript hath been compressed most excellently!",["Verily, 'tis a wonder!","What sorcery is this?","Most impressive, good sir!"])}catch(j){if(this.theatre.dramaticError("Compression Catastrophe",`A most grievous error: ${j}`,"Perchance restart thy magical contraption?"),_.interactive)await this.interactive.tomatoThrowingGame(`Compression error: ${j}`);else this.theatre.throwTomato("Compression failed")}}async performActII(q={}){if(this.theatre.displayActHeader("II","Romeo and Chroma_Add","What light through yonder vector breaks?"),await this.theatre.soliloquy("ROMEO_VECTOR",["But soft! What light through yonder vector breaks?","It is the memory, and the data is the sun!","Arise, fair data, and store the envious session","Who is already sick and pale with grief"]),q.interactive){if(await this.interactive.presentDialogueChoice("JULIET_CHROMA","Romeo, Romeo, wherefore art thou Romeo? Deny thy memory leaks and refuse thy overflow!",[{value:"compress",label:"Sweet Juliet, I shall compress thee gently",hint:"The romantic approach"},{value:"vectors",label:"My lady, thy vectors shine brighter than stars",hint:"The poetic approach"},{value:"join",label:"Fair maiden, let us join our data streams",hint:"The technical approach"}])==="join")console.log("\uD83D\uDC9D And thus began the greatest love story in vector space..."),this.theatre.addApplause(3)}else await this.theatre.presentDialogue("JULIET_CHROMA","Romeo, Romeo, wherefore art thou Romeo? Deny thy memory leaks and refuse thy overflow!",["Sweet Juliet, I shall compress thee gently","My lady, thy vectors shine brighter than stars","Fair maiden, let us join our data streams"]);this.theatre.addApplause(2),console.log("\uD83D\uDC9D Memory and Data live happily ever after in the vector space...")}async performActIII(q={}){this.theatre.displayActHeader("III","Tempest of Memory Leaks","We are such stuff as sessions are made on"),await this.theatre.soliloquy("PROSPERO_MEMORY",["Our revels now are ended. These our actors,","As I foretold you, were all spirits and","Are melted into air, into thin air:","And, like the baseless fabric of this vision,","The memory-soaked towers, the gorgeous palaces,","The solemn temples, the great globe itself,","Yea, all which it inherit, shall dissolve","And, like this insubstantial pageant faded,","Leave not a rack behind. We are such stuff","As sessions are made on, and our little life","Is rounded with a sleep... and garbage collection."]);try{let{status:_}=await Promise.resolve().then(() => (u9(),Vf));console.log(`
|
||
\uD83C\uDF0A Calming the tempest of memory...`),await _(),this.theatre.addApplause(2)}catch(_){this.theatre.dramaticError("Memory Storm",`${_}`,"Call upon Ariel to debug thy system")}}async performActIV(q={}){this.theatre.displayActHeader("IV","Much Ado About Compression","A comedy of errors and algorithms"),await this.theatre.presentDialogue("BENEDICK_COMPRESSOR","I had rather hear my dog bark at a crow than hear a man swear he can compress better than me!",["Challenge accepted, good sir!","Thy algorithms are weak!","Let us duel with our compression ratios!"]),await this.theatre.presentDialogue("BEATRICE_OPTIMIZER","I wonder that you will still be talking, Benedick. Nobody marks thy compression times!",["But my lady, observe these metrics!","Thy optimization is but a jest!","Together we shall compress the world!"]),console.log("\uD83D\uDE04 *Much witty banter about algorithms ensues*"),this.theatre.addApplause(3)}async performActV(q={}){this.theatre.displayActHeader("V","Midsummer Night's Debug","Through the mystical forest of troubleshooting"),await this.theatre.presentDialogue("PUCK_DEBUGGER","Lord, what fools these mortals be! Their code is tangled like the fairy paths!",["Help us, mischievous sprite!","Cast thy debugging spells!","Show us the path through this error forest!"]),await this.theatre.soliloquy("OBERON_ADMIN",["I know a bank where the wild thyme grows,","Where oxlips and the nodding violet grows,","And there the logs shall show us all errors","That mortal programmers in their folly write."]);try{let{logs:_}=await Promise.resolve().then(() => (h9(),Nf));console.log("\uD83E\uDDDA♂️ *Puck sprinkles magical debugging dust*"),await _(),this.theatre.addApplause(2)}catch(_){this.theatre.dramaticError("Forest of Confusion",`${_}`,"Follow the fairy lights to resolution")}}async performCompletePlay(q,..._){switch(this.theatre.displayCurtainRaise(),q){case"compress":await this.performActI(_[0],_[1]);break;case"status":await this.performActIII(_[0]);break;case"logs":await this.performActV(_[0]);break;default:await this.performActI(),await this.performActII(),await this.performActIII(),await this.performActIV(),await this.performActV()}this.theatre.displayCurtainFall()}}var Q8=new h5;Q8.name(eq).description(R5).version(E5);Q8.command("compress [transcript]").description("Compress a Claude Code transcript into memory").option("--output <path>","Output directory for compressed files").option("--dry-run","Show what would be compressed without doing it").option("-v, --verbose","Show detailed output").action(kK);Q8.command("install").description("Install Claude Code hooks for automatic compression").option("--user","Install for current user (default)").option("--project","Install for current project only").option("--local","Install to custom local directory").option("--path <path>","Custom installation path (with --local)").option("--timeout <ms>","Hook execution timeout in milliseconds","180000").option("--skip-mcp","Skip Chroma MCP server installation").option("--force","Force installation even if already installed").action(Df);Q8.command("uninstall").description("Remove Claude Code hooks").option("--user","Remove from user settings (default)").option("--project","Remove from project settings").option("--all","Remove from both user and project settings").action(Cf);Q8.command("status").description("Check installation status of Claude Memory System").action(G9);Q8.command("logs").description("View claude-mem operation logs").option("--debug","Show debug logs only").option("--error","Show error logs only").option("--tail [n]","Show last n lines","50").option("--follow","Follow log output").action(D9);Q8.command("load-context").description("Load compressed memories for current session").option("--project <name>","Filter by project name").option("--count <n>","Number of memories to load","10").option("--raw","Output raw JSON instead of formatted text").option("--format <type>","Output format: json, session-start, or default").action(m7);var B9=Q8.command("trash").description("Manage trash bin for safe file deletion").argument("[files...]","Files to move to trash").option("-r, --recursive","Remove directories recursively").option("-R","Remove directories recursively (same as -r)").option("-f, --force","Suppress errors for nonexistent files").action(async(q,_)=>{if(!q||q.length===0){B9.outputHelp();return}if(_.R)_.recursive=!0;await C$(q,{force:_.force,recursive:_.recursive})});B9.command("view").description("View contents of trash bin").action(async()=>{let{viewTrash:q}=await Promise.resolve().then(() => (a$(),o$));await q()});B9.command("empty").description("Permanently delete all files in trash").option("-f, --force","Skip confirmation prompt").action(async(q)=>{let{emptyTrash:_}=await Promise.resolve().then(() => (e$(),t$));await _(q)});Q8.command("restore").description("Restore files from trash interactively").action(M$);Q8.command("save <message>").description("Save a message to the memory system").action(N$);Q8.command("casino").description("\uD83C\uDFB0 Enter the Vegas Casino for memory compression gambling!").action(R$);Q8.command("changelog").description("Generate CHANGELOG.md from claude-mem memories").option("--historical <n>","Number of versions to search (default: current version only)").option("--generate <version>","Generate changelog for a specific version").option("--start <time>","Start time for memory search (ISO format)").option("--end <time>","End time for memory search (ISO format)").option("--update","Update CHANGELOG.md from JSONL entries").option("--preview","Preview the generated changelog").option("-v, --verbose","Show detailed output").action(g$);Q8.command("import-history").description("Import historical Claude Code conversations into memory").option("-v, --verbose","Show detailed output").option("-m, --multi","Enable multi-select mode (default is single-select)").action(l$);Q8.command("theatre").description("\uD83C\uDFAD Enter Shakespeare's Memory Theatre - All the world's a stage!").option("--act <number>","Perform specific act (I, II, III, IV, V)").option("--interactive","Enable interactive dialogue system").option("--sound-effects","Enable trumpet fanfares and sound effects").option("-v, --verbose","Verbose theatrical narration").action(async(q)=>{let _=new g3({verbose:q.verbose,interactive:q.interactive,soundEffects:q.soundEffects});if(q.act)switch(q.act.toUpperCase()){case"I":await _.performActI();break;case"II":await _.performActII();break;case"III":await _.performActIII();break;case"IV":await _.performActIV();break;case"V":await _.performActV();break;default:console.log("\uD83C\uDFAD Available acts: I, II, III, IV, V")}else await _.performCompletePlay("theatre")});Q8.command("compress-theatrical [transcript]").description('\uD83C\uDFAD Compress with Shakespearean flair - "To compress or not to compress"').option("--output <path>","Output directory for compressed files").option("--dry-run","Show what would be compressed without doing it").option("-v, --verbose","Show detailed theatrical output").option("--interactive","Enable dialogue options").action(async(q,_)=>{await new g3({verbose:_.verbose,interactive:_.interactive}).performActI(q,_)});Q8.command("status-theatrical").description('\uD83C\uDFAD Check system status with dramatic flair - "Tempest of Memory Leaks"').option("-v, --verbose","Verbose theatrical narration").option("--interactive","Enable dialogue options").action(async(q)=>{await new g3({verbose:q.verbose,interactive:q.interactive}).performActIII(q)});Q8.command("hook:pre-compact",{hidden:!0}).description("Internal pre-compact hook handler").action(async()=>{let{preCompactHook:q}=await Promise.resolve().then(() => (Q7(),s7));await q()});Q8.command("hook:session-start",{hidden:!0}).description("Internal session-start hook handler").action(async()=>{let{sessionStartHook:q}=await Promise.resolve().then(() => (Q7(),s7));await q()});Q8.command("hook:session-end",{hidden:!0}).description("Internal session-end hook handler").action(async()=>{let{sessionEndHook:q}=await Promise.resolve().then(() => (Q7(),s7));await q()});Q8.command("debug-filter").description("Show filtered transcript output (first 5 messages)").argument("<transcript-path>","Path to transcript file").action((q)=>{new ZK().showFilteredOutput(q)});Q8.parse();
|