@tsuga/cli 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +36 -11
  2. package/dist/cli.js +109 -40
  3. package/package.json +2 -1
package/dist/cli.js CHANGED
@@ -1,55 +1,85 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var dx=Object.create;var zs=Object.defineProperty;var fx=Object.getOwnPropertyDescriptor;var gx=Object.getOwnPropertyNames;var yx=Object.getPrototypeOf,Ex=Object.prototype.hasOwnProperty;var Hr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ot=(e,t)=>{for(var r in t)zs(e,r,{get:t[r],enumerable:!0})},Ix=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gx(t))!Ex.call(e,i)&&i!==r&&zs(e,i,{get:()=>t[i],enumerable:!(o=fx(t,i))||o.enumerable});return e};var Du=(e,t,r)=>(r=e!=null?dx(yx(e)):{},Ix(t||!e||!e.__esModule?zs(r,"default",{value:e,enumerable:!0}):r,e));var Po=Hr(Ys=>{var ma=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Vs=class extends ma{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Ys.CommanderError=ma;Ys.InvalidArgumentError=Vs});var ca=Hr(Ws=>{var{InvalidArgumentError:Tx}=Po(),Qs=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new Tx(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function _x(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Ws.Argument=Qs;Ws.humanReadableArgName=_x});var Js=Hr(Xs=>{var{humanReadableArgName:hx}=ca(),Zs=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(i=>!i._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((i,s)=>i.name().localeCompare(s.name())),r}compareOptions(t,r){let o=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(i=>!i.hidden),o=t._getHelpOption();if(o&&!o.hidden){let i=o.short&&t._findOption(o.short),s=o.long&&t._findOption(o.long);!i&&!s?r.push(o):o.long&&!s?r.push(t.createOption(o.long,o.description)):o.short&&!i&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let i=o.options.filter(s=>!s.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>hx(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let i=t.parent;i;i=i.parent)o=i.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];return t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0?`${t.description} (${r.join(", ")})`:t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatHelp(t,r){let o=r.padWidth(t,r),i=r.helpWidth??80;function s(I,P){return r.formatItem(I,o,P,r)}let m=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],u=r.commandDescription(t);u.length>0&&(m=m.concat([r.boxWrap(r.styleCommandDescription(u),i),""]));let l=r.visibleArguments(t).map(I=>s(r.styleArgumentTerm(r.argumentTerm(I)),r.styleArgumentDescription(r.argumentDescription(I))));l.length>0&&(m=m.concat([r.styleTitle("Arguments:"),...l,""]));let g=r.visibleOptions(t).map(I=>s(r.styleOptionTerm(r.optionTerm(I)),r.styleOptionDescription(r.optionDescription(I))));if(g.length>0&&(m=m.concat([r.styleTitle("Options:"),...g,""])),r.showGlobalOptions){let I=r.visibleGlobalOptions(t).map(P=>s(r.styleOptionTerm(r.optionTerm(P)),r.styleOptionDescription(r.optionDescription(P))));I.length>0&&(m=m.concat([r.styleTitle("Global Options:"),...I,""]))}let E=r.visibleCommands(t).map(I=>s(r.styleSubcommandTerm(r.subcommandTerm(I)),r.styleSubcommandDescription(r.subcommandDescription(I))));return E.length>0&&(m=m.concat([r.styleTitle("Commands:"),...E,""])),m.join(`
3
- `)}displayWidth(t){return Gu(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,i){let m=" ".repeat(2);if(!o)return m+t;let u=t.padEnd(r+t.length-i.displayWidth(t)),l=2,E=(this.helpWidth??80)-r-l-2,I;return E<this.minWidthToWrap||i.preformatted(o)?I=o:I=i.boxWrap(o,E).replace(/\n/g,`
4
- `+" ".repeat(r+l)),m+u+" ".repeat(l)+I.replace(/\n/g,`
5
- ${m}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return o.forEach(m=>{let u=m.match(i);if(u===null){s.push("");return}let l=[u.shift()],g=this.displayWidth(l[0]);u.forEach(E=>{let I=this.displayWidth(E);if(g+I<=r){l.push(E),g+=I;return}s.push(l.join(""));let P=E.trimStart();l=[P],g=this.displayWidth(P)}),s.push(l.join(""))}),s.join(`
6
- `)}};function Gu(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}Xs.Help=Zs;Xs.stripColor=Gu});var np=Hr(rp=>{var{InvalidArgumentError:Ox}=Po(),ep=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=Ax(t);this.short=o.shortFlag,this.long=o.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}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new Ox(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?vu(this.name().replace(/^no-/,"")):vu(this.name())}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},tp=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let i=this.negativeOptions.get(o).presetArg,s=i!==void 0?i:!1;return r.negate===(s===t)}};function vu(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Ax(e){let t,r,o=/^-[^-]$/,i=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(o.test(s[0])&&(t=s.shift()),i.test(s[0])&&(r=s.shift()),!t&&o.test(s[0])&&(t=s.shift()),!t&&i.test(s[0])&&(t=r,r=s.shift()),s[0].startsWith("-")){let m=s[0],u=`option creation failed due to '${m}' in option flags '${e}'`;throw/^-[^-][^-]/.test(m)?new Error(`${u}
2
+ "use strict";var iR=Object.create;var cp=Object.defineProperty;var aR=Object.getOwnPropertyDescriptor;var sR=Object.getOwnPropertyNames;var pR=Object.getPrototypeOf,cR=Object.prototype.hasOwnProperty;var Zr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bt=(e,t)=>{for(var r in t)cp(e,r,{get:t[r],enumerable:!0})},mR=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sR(t))!cR.call(e,i)&&i!==r&&cp(e,i,{get:()=>t[i],enumerable:!(o=aR(t,i))||o.enumerable});return e};var cl=(e,t,r)=>(r=e!=null?iR(pR(e)):{},mR(t||!e||!e.__esModule?cp(r,"default",{value:e,enumerable:!0}):r,e));var qo=Zr(up=>{var ha=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},mp=class extends ha{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};up.CommanderError=ha;up.InvalidArgumentError=mp});var Oa=Zr(dp=>{var{InvalidArgumentError:uR}=qo(),lp=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new uR(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function lR(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}dp.Argument=lp;dp.humanReadableArgName=lR});var yp=Zr(gp=>{var{humanReadableArgName:dR}=Oa(),fp=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(i=>!i._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((i,a)=>i.name().localeCompare(a.name())),r}compareOptions(t,r){let o=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(i=>!i.hidden),o=t._getHelpOption();if(o&&!o.hidden){let i=o.short&&t._findOption(o.short),a=o.long&&t._findOption(o.long);!i&&!a?r.push(o):o.long&&!a?r.push(t.createOption(o.long,o.description)):o.short&&!i&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let i=o.options.filter(a=>!a.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>dR(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let i=t.parent;i;i=i.parent)o=i.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];return t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0?`${t.description} (${r.join(", ")})`:t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatHelp(t,r){let o=r.padWidth(t,r),i=r.helpWidth??80;function a(I,x){return r.formatItem(I,o,x,r)}let p=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],u=r.commandDescription(t);u.length>0&&(p=p.concat([r.boxWrap(r.styleCommandDescription(u),i),""]));let l=r.visibleArguments(t).map(I=>a(r.styleArgumentTerm(r.argumentTerm(I)),r.styleArgumentDescription(r.argumentDescription(I))));l.length>0&&(p=p.concat([r.styleTitle("Arguments:"),...l,""]));let f=r.visibleOptions(t).map(I=>a(r.styleOptionTerm(r.optionTerm(I)),r.styleOptionDescription(r.optionDescription(I))));if(f.length>0&&(p=p.concat([r.styleTitle("Options:"),...f,""])),r.showGlobalOptions){let I=r.visibleGlobalOptions(t).map(x=>a(r.styleOptionTerm(r.optionTerm(x)),r.styleOptionDescription(r.optionDescription(x))));I.length>0&&(p=p.concat([r.styleTitle("Global Options:"),...I,""]))}let y=r.visibleCommands(t).map(I=>a(r.styleSubcommandTerm(r.subcommandTerm(I)),r.styleSubcommandDescription(r.subcommandDescription(I))));return y.length>0&&(p=p.concat([r.styleTitle("Commands:"),...y,""])),p.join(`
3
+ `)}displayWidth(t){return ml(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,i){let p=" ".repeat(2);if(!o)return p+t;let u=t.padEnd(r+t.length-i.displayWidth(t)),l=2,y=(this.helpWidth??80)-r-l-2,I;return y<this.minWidthToWrap||i.preformatted(o)?I=o:I=i.boxWrap(o,y).replace(/\n/g,`
4
+ `+" ".repeat(r+l)),p+u+" ".repeat(l)+I.replace(/\n/g,`
5
+ ${p}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,a=[];return o.forEach(p=>{let u=p.match(i);if(u===null){a.push("");return}let l=[u.shift()],f=this.displayWidth(l[0]);u.forEach(y=>{let I=this.displayWidth(y);if(f+I<=r){l.push(y),f+=I;return}a.push(l.join(""));let x=y.trimStart();l=[x],f=this.displayWidth(x)}),a.push(l.join(""))}),a.join(`
6
+ `)}};function ml(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}gp.Help=fp;gp.stripColor=ml});var _p=Zr(Tp=>{var{InvalidArgumentError:fR}=qo(),Ep=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=gR(t);this.short=o.shortFlag,this.long=o.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}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new fR(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?ul(this.name().replace(/^no-/,"")):ul(this.name())}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Ip=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let i=this.negativeOptions.get(o).presetArg,a=i!==void 0?i:!1;return r.negate===(a===t)}};function ul(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function gR(e){let t,r,o=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat("guard");if(o.test(a[0])&&(t=a.shift()),i.test(a[0])&&(r=a.shift()),!t&&o.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=r,r=a.shift()),a[0].startsWith("-")){let p=a[0],u=`option creation failed due to '${p}' in option flags '${e}'`;throw/^-[^-][^-]/.test(p)?new Error(`${u}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(m)?new Error(`${u}
10
- - too many short flags`):i.test(m)?new Error(`${u}
9
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(p)?new Error(`${u}
10
+ - too many short flags`):i.test(p)?new Error(`${u}
11
11
  - too many long flags`):new Error(`${u}
12
- - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}rp.Option=ep;rp.DualOptions=tp});var Fu=Hr(ju=>{function Sx(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let i=1;i<=e.length;i++){let s=1;e[i-1]===t[o-1]?s=0:s=1,r[i][o]=Math.min(r[i-1][o]+1,r[i][o-1]+1,r[i-1][o-1]+s),i>1&&o>1&&e[i-1]===t[o-2]&&e[i-2]===t[o-1]&&(r[i][o]=Math.min(r[i][o],r[i-2][o-2]+1))}return r[e.length][t.length]}function bx(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(m=>m.slice(2)));let o=[],i=3,s=.4;return t.forEach(m=>{if(m.length<=1)return;let u=Sx(e,m),l=Math.max(e.length,m.length);(l-u)/l>s&&(u<i?(i=u,o=[m]):u===i&&o.push(m))}),o.sort((m,u)=>m.localeCompare(u)),r&&(o=o.map(m=>`--${m}`)),o.length>1?`
12
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}Tp.Option=Ep;Tp.DualOptions=Ip});var dl=Zr(ll=>{function yR(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let i=1;i<=e.length;i++){let a=1;e[i-1]===t[o-1]?a=0:a=1,r[i][o]=Math.min(r[i-1][o]+1,r[i][o-1]+1,r[i-1][o-1]+a),i>1&&o>1&&e[i-1]===t[o-2]&&e[i-2]===t[o-1]&&(r[i][o]=Math.min(r[i][o],r[i-2][o-2]+1))}return r[e.length][t.length]}function ER(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(p=>p.slice(2)));let o=[],i=3,a=.4;return t.forEach(p=>{if(p.length<=1)return;let u=yR(e,p),l=Math.max(e.length,p.length);(l-u)/l>a&&(u<i?(i=u,o=[p]):u===i&&o.push(p))}),o.sort((p,u)=>p.localeCompare(u)),r&&(o=o.map(p=>`--${p}`)),o.length>1?`
13
13
  (Did you mean one of ${o.join(", ")}?)`:o.length===1?`
14
- (Did you mean ${o[0]}?)`:""}ju.suggestSimilar=bx});var Ku=Hr(pp=>{var xx=require("node:events").EventEmitter,op=require("node:child_process"),Qt=require("node:path"),ua=require("node:fs"),ne=require("node:process"),{Argument:Rx,humanReadableArgName:Cx}=ca(),{CommanderError:ip}=Po(),{Help:Px,stripColor:Ux}=Js(),{Option:Bu,DualOptions:Nx}=np(),{suggestSimilar:qu}=Fu(),ap=class e extends xx{constructor(t){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=t||"",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:r=>ne.stdout.write(r),writeErr:r=>ne.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>ne.stdout.isTTY?ne.stdout.columns:void 0,getErrHelpWidth:()=>ne.stderr.isTTY?ne.stderr.columns:void 0,getOutHasColors:()=>sp()??(ne.stdout.isTTY&&ne.stdout.hasColors?.()),getErrHasColors:()=>sp()??(ne.stderr.isTTY&&ne.stderr.hasColors?.()),stripColor:r=>Ux(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let i=r,s=o;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,m,u]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(m);return i&&(l.description(i),l._executableHandler=!0),s.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(s.noHelp||s.hidden),l._executableFile=s.executableFile||null,u&&l.arguments(u),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new Px,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new Rx(t,r)}argument(t,r,o,i){let s=this.createArgument(t,r);return typeof o=="function"?s.default(i).argParser(o):s.default(o),this.addArgument(s),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,this;t=t??"help [command]";let[,o,i]=t.match(/([^ ]+) *(.*)/),s=r??"display help for command",m=this.createCommand(o);return m.helpOption(!1),i&&m.arguments(i),s&&m.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=m,this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
- Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new ip(t,r,o)),ne.exit(t)}action(t){let r=o=>{let i=this.registeredArguments.length,s=o.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=r,this}createOption(t,r){return new Bu(t,r)}_callParseArg(t,r,o,i){try{return t.parseArg(r,o)}catch(s){if(s.code==="commander.invalidArgument"){let m=`${i} ${s.message}`;this.error(m,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
17
- - already used by option '${r.flags}'`)}this.options.push(t)}_registerCommand(t){let r=i=>[i.name()].concat(i.aliases()),o=r(t).find(i=>this._findCommand(i));if(o){let i=r(this._findCommand(o)).join("|"),s=r(t).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();if(t.negate){let s=t.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(o,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let i=(s,m,u)=>{s==null&&t.presetArg!==void 0&&(s=t.presetArg);let l=this.getOptionValue(o);s!==null&&t.parseArg?s=this._callParseArg(t,s,l,m):s!==null&&t.variadic&&(s=t._concatValue(s,l)),s==null&&(t.negate?s=!1:t.isBoolean()||t.optional?s=!0:s=""),this.setOptionValueWithSource(o,s,u)};return this.on("option:"+r,s=>{let m=`error: option '${t.flags}' argument '${s}' is invalid.`;i(s,m,"cli")}),t.envVar&&this.on("optionEnv:"+r,s=>{let m=`error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;i(s,m,"env")}),this}_optionEx(t,r,o,i,s){if(typeof r=="object"&&r instanceof Bu)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let m=this.createOption(r,o);if(m.makeOptionMandatory(!!t.mandatory),typeof i=="function")m.default(s).argParser(i);else if(i instanceof RegExp){let u=i;i=(l,g)=>{let E=u.exec(l);return E?E[0]:g},m.default(s).argParser(i)}else m.default(i);return this.addOption(m)}option(t,r,o,i){return this._optionEx({},t,r,o,i)}requiredOption(t,r,o,i){return this._optionEx({mandatory:!0},t,r,o,i)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,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(t=!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=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){ne.versions?.electron&&(r.from="electron");let i=ne.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}t===void 0&&(t=ne.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":ne.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():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.
18
- - 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(t,r,o){if(ua.existsSync(t))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${t}' does not exist
14
+ (Did you mean ${o[0]}?)`:""}ll.suggestSimilar=ER});var El=Zr(bp=>{var IR=require("node:events").EventEmitter,hp=require("node:child_process"),nr=require("node:path"),Aa=require("node:fs"),ae=require("node:process"),{Argument:TR,humanReadableArgName:_R}=Oa(),{CommanderError:Op}=qo(),{Help:hR,stripColor:OR}=yp(),{Option:fl,DualOptions:AR}=_p(),{suggestSimilar:gl}=dl(),Ap=class e extends IR{constructor(t){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=t||"",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:r=>ae.stdout.write(r),writeErr:r=>ae.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>ae.stdout.isTTY?ae.stdout.columns:void 0,getErrHelpWidth:()=>ae.stderr.isTTY?ae.stderr.columns:void 0,getOutHasColors:()=>Sp()??(ae.stdout.isTTY&&ae.stdout.hasColors?.()),getErrHasColors:()=>Sp()??(ae.stderr.isTTY&&ae.stderr.hasColors?.()),stripColor:r=>OR(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let i=r,a=o;typeof i=="object"&&i!==null&&(a=i,i=null),a=a||{};let[,p,u]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(p);return i&&(l.description(i),l._executableHandler=!0),a.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(a.noHelp||a.hidden),l._executableFile=a.executableFile||null,u&&l.arguments(u),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new hR,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new TR(t,r)}argument(t,r,o,i){let a=this.createArgument(t,r);return typeof o=="function"?a.default(i).argParser(o):a.default(o),this.addArgument(a),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,this;t=t??"help [command]";let[,o,i]=t.match(/([^ ]+) *(.*)/),a=r??"display help for command",p=this.createCommand(o);return p.helpOption(!1),i&&p.arguments(i),a&&p.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=p,this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
+ Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new Op(t,r,o)),ae.exit(t)}action(t){let r=o=>{let i=this.registeredArguments.length,a=o.slice(0,i);return this._storeOptionsAsProperties?a[i]=this:a[i]=this.opts(),a.push(this),t.apply(this,a)};return this._actionHandler=r,this}createOption(t,r){return new fl(t,r)}_callParseArg(t,r,o,i){try{return t.parseArg(r,o)}catch(a){if(a.code==="commander.invalidArgument"){let p=`${i} ${a.message}`;this.error(p,{exitCode:a.exitCode,code:a.code})}throw a}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
17
+ - already used by option '${r.flags}'`)}this.options.push(t)}_registerCommand(t){let r=i=>[i.name()].concat(i.aliases()),o=r(t).find(i=>this._findCommand(i));if(o){let i=r(this._findCommand(o)).join("|"),a=r(t).join("|");throw new Error(`cannot add command '${a}' as already have command '${i}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();if(t.negate){let a=t.long.replace(/^--no-/,"--");this._findOption(a)||this.setOptionValueWithSource(o,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let i=(a,p,u)=>{a==null&&t.presetArg!==void 0&&(a=t.presetArg);let l=this.getOptionValue(o);a!==null&&t.parseArg?a=this._callParseArg(t,a,l,p):a!==null&&t.variadic&&(a=t._concatValue(a,l)),a==null&&(t.negate?a=!1:t.isBoolean()||t.optional?a=!0:a=""),this.setOptionValueWithSource(o,a,u)};return this.on("option:"+r,a=>{let p=`error: option '${t.flags}' argument '${a}' is invalid.`;i(a,p,"cli")}),t.envVar&&this.on("optionEnv:"+r,a=>{let p=`error: option '${t.flags}' value '${a}' from env '${t.envVar}' is invalid.`;i(a,p,"env")}),this}_optionEx(t,r,o,i,a){if(typeof r=="object"&&r instanceof fl)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let p=this.createOption(r,o);if(p.makeOptionMandatory(!!t.mandatory),typeof i=="function")p.default(a).argParser(i);else if(i instanceof RegExp){let u=i;i=(l,f)=>{let y=u.exec(l);return y?y[0]:f},p.default(a).argParser(i)}else p.default(i);return this.addOption(p)}option(t,r,o,i){return this._optionEx({},t,r,o,i)}requiredOption(t,r,o,i){return this._optionEx({mandatory:!0},t,r,o,i)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,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(t=!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=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){ae.versions?.electron&&(r.from="electron");let i=ae.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}t===void 0&&(t=ae.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":ae.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():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.
18
+ - 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(t,r,o){if(Aa.existsSync(t))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",a=`'${t}' does not exist
19
19
  - if '${o}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${i}`;throw new Error(s)}_executeSubCommand(t,r){r=r.slice();let o=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function s(E,I){let P=Qt.resolve(E,I);if(ua.existsSync(P))return P;if(i.includes(Qt.extname(I)))return;let be=i.find(ve=>ua.existsSync(`${P}${ve}`));if(be)return`${P}${be}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let m=t._executableFile||`${this._name}-${t._name}`,u=this._executableDir||"";if(this._scriptPath){let E;try{E=ua.realpathSync(this._scriptPath)}catch{E=this._scriptPath}u=Qt.resolve(Qt.dirname(E),u)}if(u){let E=s(u,m);if(!E&&!t._executableFile&&this._scriptPath){let I=Qt.basename(this._scriptPath,Qt.extname(this._scriptPath));I!==this._name&&(E=s(u,`${I}-${t._name}`))}m=E||m}o=i.includes(Qt.extname(m));let l;ne.platform!=="win32"?o?(r.unshift(m),r=Hu(ne.execArgv).concat(r),l=op.spawn(ne.argv[0],r,{stdio:"inherit"})):l=op.spawn(m,r,{stdio:"inherit"}):(this._checkForMissingExecutable(m,u,t._name),r.unshift(m),r=Hu(ne.execArgv).concat(r),l=op.spawn(ne.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(I=>{ne.on(I,()=>{l.killed===!1&&l.exitCode===null&&l.kill(I)})});let g=this._exitCallback;l.on("close",E=>{E=E??1,g?g(new ip(E,"commander.executeSubCommandAsync","(close)")):ne.exit(E)}),l.on("error",E=>{if(E.code==="ENOENT")this._checkForMissingExecutable(m,u,t._name);else if(E.code==="EACCES")throw new Error(`'${m}' not executable`);if(!g)ne.exit(1);else{let I=new ip(1,"commander.executeSubCommandAsync","(error)");I.nestedError=E,g(I)}}),this.runningCommand=l}_dispatchSubcommand(t,r,o){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,i,"preSubcommand"),s=this._chainOrCall(s,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(o));else return i._parseCommand(r,o)}),s}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,i,s)=>{let m=i;if(i!==null&&o.parseArg){let u=`error: command-argument value '${i}' is invalid for argument '${o.name()}'.`;m=this._callParseArg(o,i,s,u)}return m};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,i)=>{let s=o.defaultValue;o.variadic?i<this.args.length?(s=this.args.slice(i),o.parseArg&&(s=s.reduce((m,u)=>t(o,u,m),o.defaultValue))):s===void 0&&(s=[]):i<this.args.length&&(s=this.args[i],o.parseArg&&(s=t(o,s,o.defaultValue))),r[i]=s}),this.processedArgs=r}_chainOrCall(t,r){return t&&t.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let o=t,i=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(m=>{i.push({hookedCommand:s,callback:m})})}),r==="postAction"&&i.reverse(),i.forEach(s=>{o=this._chainOrCall(o,()=>s.callback(s.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,r,o){let i=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(s=>{i=this._chainOrCall(i,()=>s(this,r))}),i}_parseCommand(t,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),r=o.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let m;return m=this._chainOrCallHooks(m,"preAction"),m=this._chainOrCall(m,()=>this._actionHandler(this.processedArgs)),this.parent&&(m=this._chainOrCall(m,()=>{this.parent.emit(s,t,r)})),m=this._chainOrCallHooks(m,"postAction"),m}if(this.parent&&this.parent.listenerCount(s))i(),this._processArguments(),this.parent.emit(s,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let i=o.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let i=t.find(s=>o.conflictsWith.includes(s.attributeName()));i&&this._conflictingOption(o,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],o=[],i=r,s=t.slice();function m(l){return l.length>1&&l[0]==="-"}let u=null;for(;s.length;){let l=s.shift();if(l==="--"){i===o&&i.push(l),i.push(...s);break}if(u&&!m(l)){this.emit(`option:${u.name()}`,l);continue}if(u=null,m(l)){let g=this._findOption(l);if(g){if(g.required){let E=s.shift();E===void 0&&this.optionMissingArgument(g),this.emit(`option:${g.name()}`,E)}else if(g.optional){let E=null;s.length>0&&!m(s[0])&&(E=s.shift()),this.emit(`option:${g.name()}`,E)}else this.emit(`option:${g.name()}`);u=g.variadic?g:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let g=this._findOption(`-${l[1]}`);if(g){g.required||g.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${g.name()}`,l.slice(2)):(this.emit(`option:${g.name()}`),s.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let g=l.indexOf("="),E=this._findOption(l.slice(0,g));if(E&&(E.required||E.optional)){this.emit(`option:${E.name()}`,l.slice(g+1));continue}}if(m(l)&&(i=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(l)){r.push(l),s.length>0&&o.push(...s);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),s.length>0&&r.push(...s);break}else if(this._defaultCommandName){o.push(l),s.length>0&&o.push(...s);break}}if(this._passThroughOptions){i.push(l),s.length>0&&i.push(...s);break}i.push(l)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let o=0;o<r;o++){let i=this.options[o].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
21
+ - ${i}`;throw new Error(a)}_executeSubCommand(t,r){r=r.slice();let o=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function a(y,I){let x=nr.resolve(y,I);if(Aa.existsSync(x))return x;if(i.includes(nr.extname(I)))return;let le=i.find(Se=>Aa.existsSync(`${x}${Se}`));if(le)return`${x}${le}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let p=t._executableFile||`${this._name}-${t._name}`,u=this._executableDir||"";if(this._scriptPath){let y;try{y=Aa.realpathSync(this._scriptPath)}catch{y=this._scriptPath}u=nr.resolve(nr.dirname(y),u)}if(u){let y=a(u,p);if(!y&&!t._executableFile&&this._scriptPath){let I=nr.basename(this._scriptPath,nr.extname(this._scriptPath));I!==this._name&&(y=a(u,`${I}-${t._name}`))}p=y||p}o=i.includes(nr.extname(p));let l;ae.platform!=="win32"?o?(r.unshift(p),r=yl(ae.execArgv).concat(r),l=hp.spawn(ae.argv[0],r,{stdio:"inherit"})):l=hp.spawn(p,r,{stdio:"inherit"}):(this._checkForMissingExecutable(p,u,t._name),r.unshift(p),r=yl(ae.execArgv).concat(r),l=hp.spawn(ae.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(I=>{ae.on(I,()=>{l.killed===!1&&l.exitCode===null&&l.kill(I)})});let f=this._exitCallback;l.on("close",y=>{y=y??1,f?f(new Op(y,"commander.executeSubCommandAsync","(close)")):ae.exit(y)}),l.on("error",y=>{if(y.code==="ENOENT")this._checkForMissingExecutable(p,u,t._name);else if(y.code==="EACCES")throw new Error(`'${p}' not executable`);if(!f)ae.exit(1);else{let I=new Op(1,"commander.executeSubCommandAsync","(error)");I.nestedError=y,f(I)}}),this.runningCommand=l}_dispatchSubcommand(t,r,o){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let a;return a=this._chainOrCallSubCommandHook(a,i,"preSubcommand"),a=this._chainOrCall(a,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(o));else return i._parseCommand(r,o)}),a}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,i,a)=>{let p=i;if(i!==null&&o.parseArg){let u=`error: command-argument value '${i}' is invalid for argument '${o.name()}'.`;p=this._callParseArg(o,i,a,u)}return p};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,i)=>{let a=o.defaultValue;o.variadic?i<this.args.length?(a=this.args.slice(i),o.parseArg&&(a=a.reduce((p,u)=>t(o,u,p),o.defaultValue))):a===void 0&&(a=[]):i<this.args.length&&(a=this.args[i],o.parseArg&&(a=t(o,a,o.defaultValue))),r[i]=a}),this.processedArgs=r}_chainOrCall(t,r){return t&&t.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let o=t,i=[];return this._getCommandAndAncestors().reverse().filter(a=>a._lifeCycleHooks[r]!==void 0).forEach(a=>{a._lifeCycleHooks[r].forEach(p=>{i.push({hookedCommand:a,callback:p})})}),r==="postAction"&&i.reverse(),i.forEach(a=>{o=this._chainOrCall(o,()=>a.callback(a.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,r,o){let i=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(a=>{i=this._chainOrCall(i,()=>a(this,r))}),i}_parseCommand(t,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),r=o.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},a=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let p;return p=this._chainOrCallHooks(p,"preAction"),p=this._chainOrCall(p,()=>this._actionHandler(this.processedArgs)),this.parent&&(p=this._chainOrCall(p,()=>{this.parent.emit(a,t,r)})),p=this._chainOrCallHooks(p,"postAction"),p}if(this.parent&&this.parent.listenerCount(a))i(),this._processArguments(),this.parent.emit(a,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let i=o.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let i=t.find(a=>o.conflictsWith.includes(a.attributeName()));i&&this._conflictingOption(o,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],o=[],i=r,a=t.slice();function p(l){return l.length>1&&l[0]==="-"}let u=null;for(;a.length;){let l=a.shift();if(l==="--"){i===o&&i.push(l),i.push(...a);break}if(u&&!p(l)){this.emit(`option:${u.name()}`,l);continue}if(u=null,p(l)){let f=this._findOption(l);if(f){if(f.required){let y=a.shift();y===void 0&&this.optionMissingArgument(f),this.emit(`option:${f.name()}`,y)}else if(f.optional){let y=null;a.length>0&&!p(a[0])&&(y=a.shift()),this.emit(`option:${f.name()}`,y)}else this.emit(`option:${f.name()}`);u=f.variadic?f:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let f=this._findOption(`-${l[1]}`);if(f){f.required||f.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${f.name()}`,l.slice(2)):(this.emit(`option:${f.name()}`),a.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let f=l.indexOf("="),y=this._findOption(l.slice(0,f));if(y&&(y.required||y.optional)){this.emit(`option:${y.name()}`,l.slice(f+1));continue}}if(p(l)&&(i=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(l)){r.push(l),a.length>0&&o.push(...a);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),a.length>0&&r.push(...a);break}else if(this._defaultCommandName){o.push(l),a.length>0&&o.push(...a);break}}if(this._passThroughOptions){i.push(l),a.length>0&&i.push(...a);break}i.push(l)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let o=0;o<r;o++){let i=this.options[o].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0}));let o=r||{},i=o.exitCode||1,s=o.code||"commander.error";this._exit(i,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in ne.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,ne.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new Nx(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,o.implied[i],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=m=>{let u=m.attributeName(),l=this.getOptionValue(u),g=this.options.find(I=>I.negate&&u===I.attributeName()),E=this.options.find(I=>!I.negate&&u===I.attributeName());return g&&(g.presetArg===void 0&&l===!1||g.presetArg!==void 0&&l===g.presetArg)?g:E||m},i=m=>{let u=o(m),l=u.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},s=`error: ${i(t)} cannot be used with ${i(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let m=s.createHelp().visibleOptions(s).filter(u=>u.long).map(u=>u.long);i=i.concat(m),s=s.parent}while(s&&!s._enablePositionalOptions);r=qu(t,i)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${o} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),r=qu(t,i)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let i=this.createOption(r,o);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
- `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let i=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>Cx(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=Qt.basename(t,Qt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let i=r.formatHelp(this,r);return o.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let r=!!t.error,o,i,s;return r?(o=u=>this._outputConfiguration.writeErr(u),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(o=u=>this._outputConfiguration.writeOut(u),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:u=>(i||(u=this._outputConfiguration.stripColor(u)),o(u)),hasColors:i,helpWidth:s}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let o=this._getOutputContext(t),i={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(m=>m.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let s=this.helpInformation({error:o.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(m=>m.emit("afterAllHelp",i))}helpOption(t,r){return typeof t=="boolean"?(t?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(t=t??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(t,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this}help(t){this.outputHelp(t);let r=Number(ne.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
- Expecting one of '${o.join("', '")}'`);let i=`${t}Help`;return this.on(i,s=>{let m;typeof r=="function"?m=r({error:s.error,command:s.command}):m=r,m&&s.write(`${m}
27
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Hu(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",i="9229",s;return(s=t.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?i=s[3]:o=s[3]):(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],o=s[3],i=s[4]),r&&i!=="0"?`${r}=${o}:${parseInt(i)+1}`:t})}function sp(){if(ne.env.NO_COLOR||ne.env.FORCE_COLOR==="0"||ne.env.FORCE_COLOR==="false")return!1;if(ne.env.FORCE_COLOR||ne.env.CLICOLOR_FORCE!==void 0)return!0}pp.Command=ap;pp.useColor=sp});var Qu=Hr(At=>{var{Argument:zu}=ca(),{Command:mp}=Ku(),{CommanderError:Lx,InvalidArgumentError:Vu}=Po(),{Help:kx}=Js(),{Option:Yu}=np();At.program=new mp;At.createCommand=e=>new mp(e);At.createOption=(e,t)=>new Yu(e,t);At.createArgument=(e,t)=>new zu(e,t);At.Command=mp;At.Option=Yu;At.Argument=zu;At.Help=kx;At.CommanderError=Lx;At.InvalidArgumentError=Vu;At.InvalidOptionArgumentError=Vu});var Wu=Du(Qu(),1),{program:cj,createCommand:uj,createArgument:lj,createOption:dj,CommanderError:fj,InvalidArgumentError:gj,InvalidOptionArgumentError:yj,Command:Zu,Argument:Ej,Option:Ij,Help:Tj}=Wu.default;function Rt(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}var f={};Ot(f,{Assign:()=>Mx,Clone:()=>No,Create:()=>$R,Discard:()=>DR,Metrics:()=>Ct,Update:()=>GR});var Ct={assign:0,create:0,clone:0,discard:0,update:0};function Mx(e,t){return Ct.assign+=1,{...e,...t}}var a={};Ot(a,{Entries:()=>nR,EntriesRegExp:()=>rR,Every:()=>Jx,EveryAll:()=>eR,GraphemeCount:()=>Wx,HasPropertyKey:()=>tR,IsArray:()=>Kr,IsAsyncIterator:()=>jx,IsBigInt:()=>Uo,IsBoolean:()=>ol,IsClassInstance:()=>Yx,IsConstructor:()=>Fx,IsDeepEqual:()=>dp,IsEqual:()=>Z,IsFunction:()=>il,IsGreaterEqualThan:()=>sl,IsGreaterThan:()=>Kx,IsInteger:()=>up,IsIterator:()=>Bx,IsLessEqualThan:()=>al,IsLessThan:()=>zx,IsMaxLength:()=>Zx,IsMinLength:()=>Xx,IsMultipleOf:()=>Vx,IsNull:()=>fa,IsNumber:()=>ga,IsObject:()=>zr,IsObjectNotArray:()=>qx,IsString:()=>gr,IsSymbol:()=>Hx,IsUndefined:()=>lp,IsValueLike:()=>Qx,Keys:()=>da,Symbols:()=>oR,Values:()=>iR});function fr(e,t,r){return e>=t&&e<=r}function Xu(e){return fr(e,127462,127487)}function wx(e){return fr(e,65024,65039)}function $x(e){return fr(e,768,879)||fr(e,6832,6911)||fr(e,7616,7679)||fr(e,65056,65071)}function la(e){return e>65535?2:1}function Ju(e,t){for(;t<e.length;){let r=e.codePointAt(t);if($x(r)||wx(r))t+=la(r);else break}return t}function cp(e,t){let r=e.codePointAt(t),o=t+la(r);for(o=Ju(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+la(i),o=Ju(e,o)}return Xu(r)&&o<e.length&&Xu(e.codePointAt(o))&&(o+=la(e.codePointAt(o))),o}function el(e){return fr(e,55296,56319)||fr(e,768,879)||e===8205}function tl(e){let t=0,r=0;for(;r<e.length;)r=cp(e,r),t++;return t}function Dx(e,t){let r=0,o=0;for(;o<e.length;)if(o=cp(e,o),r++,r>=t)return!0;return!1}function Gx(e,t){let r=0,o=0;for(;o<e.length;)if(o=cp(e,o),r++,r>t)return!1;return!0}function rl(e,t){let r=0;for(;r<e.length;){if(el(e.charCodeAt(r)))return Dx(e,t);if(r++,r>=t)return!0}return!1}function nl(e,t){let r=0;for(;r<e.length;){if(el(e.charCodeAt(r)))return Gx(e,t);if(r++,r>t)return!1}return!0}function Kr(e){return Array.isArray(e)}function jx(e){return zr(e)&&Symbol.asyncIterator in e}function Uo(e){return Z(typeof e,"bigint")}function ol(e){return Z(typeof e,"boolean")}function Fx(e){if(lp(e)||!il(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function il(e){return Z(typeof e,"function")}function up(e){return Number.isInteger(e)}function Bx(e){return zr(e)&&Symbol.iterator in e}function fa(e){return Z(e,null)}function ga(e){return Number.isFinite(e)}function qx(e){return zr(e)&&!Kr(e)}function zr(e){return Z(typeof e,"object")&&!fa(e)}function gr(e){return Z(typeof e,"string")}function Hx(e){return Z(typeof e,"symbol")}function lp(e){return Z(e,void 0)}function Z(e,t){return e===t}function Kx(e,t){return e>t}function zx(e,t){return e<t}function al(e,t){return e<=t}function sl(e,t){return e>=t}function Vx(e,t){if(Uo(e)||Uo(t))return BigInt(e)%BigInt(t)===0n;let r=1e-10;if(!ga(e)||up(e)&&1/t%1===0)return!0;let o=e%t;return Math.min(Math.abs(o),Math.abs(o-t))<r}function Yx(e){if(!zr(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return fa(t)?!1:Z(typeof t.constructor,"function")&&!(Z(t.constructor,globalThis.Object)||Z(t.constructor.name,"Object"))}function Qx(e){return Uo(e)||ol(e)||fa(e)||ga(e)||gr(e)||lp(e)}function Wx(e){return tl(e)}function Zx(e,t){return nl(e,t)}function Xx(e,t){return rl(e,t)}function Jx(e,t,r){for(let o=t;o<e.length;o++)if(!r(e[o],o))return!1;return!0}function eR(e,t,r){let o=!0;for(let i=t;i<e.length;i++)r(e[i],i)||(o=!1);return o}function tR(e,t){return Z(t,"__proto__")||Z(t,"constructor")?Object.prototype.hasOwnProperty.call(e,t):t in e}function rR(e){return da(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function nR(e){return Object.entries(e)}function da(e){return Object.getOwnPropertyNames(e)}function oR(e){return Object.getOwnPropertySymbols(e)}function iR(e){return Object.values(e)}function aR(e,t){if(!zr(t))return!1;let r=da(e);return Z(r.length,da(t).length)&&r.every(o=>dp(e[o],t[o]))}function sR(e,t){return Kr(t)&&Z(e.length,t.length)&&e.every((r,o)=>dp(e[o],t[o]))}function dp(e,t){return Kr(e)?sR(e,t):zr(e)?aR(e,t):Z(e,t)}var Qe={};Ot(Qe,{IsBigInt64Array:()=>hR,IsBigUint64Array:()=>OR,IsBoolean:()=>pR,IsDate:()=>SR,IsFloat32Array:()=>TR,IsFloat64Array:()=>_R,IsInt16Array:()=>gR,IsInt32Array:()=>ER,IsInt8Array:()=>lR,IsMap:()=>xR,IsNumber:()=>mR,IsRegExp:()=>AR,IsSet:()=>bR,IsString:()=>cR,IsTypeArray:()=>uR,IsUint16Array:()=>yR,IsUint32Array:()=>IR,IsUint8Array:()=>dR,IsUint8ClampedArray:()=>fR});function pR(e){return e instanceof Boolean}function mR(e){return e instanceof Number}function cR(e){return e instanceof String}function uR(e){return globalThis.ArrayBuffer.isView(e)}function lR(e){return e instanceof globalThis.Int8Array}function dR(e){return e instanceof globalThis.Uint8Array}function fR(e){return e instanceof globalThis.Uint8ClampedArray}function gR(e){return e instanceof globalThis.Int16Array}function yR(e){return e instanceof globalThis.Uint16Array}function ER(e){return e instanceof globalThis.Int32Array}function IR(e){return e instanceof globalThis.Uint32Array}function TR(e){return e instanceof globalThis.Float32Array}function _R(e){return e instanceof globalThis.Float64Array}function hR(e){return e instanceof globalThis.BigInt64Array}function OR(e){return e instanceof globalThis.BigUint64Array}function AR(e){return e instanceof globalThis.RegExp}function SR(e){return e instanceof globalThis.Date}function bR(e){return e instanceof globalThis.Set}function xR(e){return e instanceof globalThis.Map}function CR(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~guard")}function PR(e){return e.map(t=>fp(t))}function UR(e){let t={},r=Object.getOwnPropertyDescriptors(e);for(let o of Object.keys(r)){let i=r[o];a.HasPropertyKey(i,"value")&&Object.defineProperty(t,o,{...i,value:fp(i.value)})}return t}function NR(e){return new RegExp(e.source,e.flags)}function fp(e){return e instanceof RegExp?NR(e):CR(e)?e:a.IsArray(e)?PR(e):a.IsObject(e)?UR(e):e}function No(e){return Ct.clone+=1,fp(e)}var Et={};Ot(Et,{Get:()=>MR,Reset:()=>LR,Set:()=>kR});var Vr={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function LR(){Vr.immutableTypes=!1,Vr.maxErrors=8,Vr.useEval=!0,Vr.exactOptionalPropertyTypes=!1,Vr.enumerableKind=!1}function kR(e){for(let t of a.Keys(e)){let r=e[t];r!==void 0&&Object.defineProperty(Vr,t,{value:r})}}function MR(){return Vr}function wR(e,t,r={}){for(let o of Object.keys(t))Object.defineProperty(e,o,{configurable:!0,writable:!0,enumerable:!1,value:t[o]});return e}function pl(e,t){return{...e,...t}}function $R(e,t,r={}){Ct.create+=1;let o=Et.Get(),i=pl(t,r),s=o.enumerableKind?pl(i,e):wR(i,e);return o.immutableTypes?Object.freeze(s):s}function DR(e,t){Ct.discard+=1;let r={},o=Object.getOwnPropertyDescriptors(No(e)),i=new Set(t);for(let s of Object.keys(o))i.has(s)||Object.defineProperty(r,s,o[s]);return r}function GR(e,t,r){Ct.update+=1;let o=Et.Get(),i=No(e);for(let s of Object.keys(t))Object.defineProperty(i,s,{configurable:!0,writable:!0,enumerable:o.enumerableKind,value:t[s]});for(let s of Object.keys(r))Object.defineProperty(i,s,{configurable:!0,enumerable:!0,writable:!0,value:r[s]});return i}function h(e,t){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.IsEqual(e["~kind"],t)}function A(e){return a.IsObject(e)}function ml(e){return f.Create({"~kind":"OptionalAddAction"},{type:e},{})}function cl(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"OptionalAddAction")&&A(e.type)}function ul(e){return f.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function ll(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"OptionalRemoveAction")&&A(e.type)}function dl(e){return f.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function fl(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"ReadonlyAddAction")&&A(e.type)}function gl(e){return f.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function yl(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&A(e.type)}function R(e,t,r){return f.Create({"~kind":"Deferred"},{action:e,parameters:t,options:r},{})}function El(e){return h(e,"Deferred")}function gp(e){return f.Update(e,{"~immutable":!0},{})}function yr(e){return gp(e)}function Yr(e){return A(e)&&a.HasPropertyKey(e,"~immutable")}function Un(e){return f.Discard(e,["~optional"])}function nt(e){return f.Update(e,{"~optional":!0},{})}function ya(e){return nt(e)}function xe(e){return A(e)&&a.HasPropertyKey(e,"~optional")}function Ea(e){return f.Discard(e,["~readonly"])}function ot(e){return f.Update(e,{"~readonly":!0},{})}function Ia(e){return ot(e)}function Qr(e){return A(e)&&a.HasPropertyKey(e,"~readonly")}function Pt(e,t){return f.Create({"~kind":"Array"},{type:"array",items:e},t)}function X(e){return h(e,"Array")}function Ta(e){return f.Discard(e,["~kind","type","items"])}function wt(e,t){return f.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},t)}function ze(e){return h(e,"AsyncIterator")}function Il(e){return f.Discard(e,["~kind","type","iteratorItems"])}function Tl(e){return{enumerable:Et.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var _a=class{constructor(){globalThis.Object.defineProperty(this,"~kind",Tl("Base")),globalThis.Object.defineProperty(this,"~guard",Tl({check:t=>this.Check(t),errors:t=>this.Errors(t)}))}Check(t){return!0}Errors(t){return[]}Convert(t){return t}Clean(t){return t}Default(t){return t}Create(){throw new Error("Create not implemented")}Clone(){throw Error("Clone not implemented")}};function It(e){return h(e,"Base")}function Er(e,t,r={}){return f.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},r)}function Re(e){return h(e,"Constructor")}function _l(e){return f.Discard(e,["~kind","type","parameters","instanceType"])}function Ir(e,t,r={}){return f.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},r)}function Ce(e){return h(e,"Function")}function hl(e){return f.Discard(e,["~kind","type","parameters","returnType"])}function he(e,t){return f.Create({"~kind":"Ref"},{$ref:e},t)}function ie(e){return h(e,"Ref")}function Tr(e,t){return f.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function Nn(e){return h(e,"Generic")}var Ol="(?!)";function z(e){return f.Create({"~kind":"Never"},{not:{}},e)}function Wt(e){return h(e,"Never")}function vR(){return["(not-resolvable)",z()]}function jR(){return["(not-generic)",z()]}function FR(e,t,r){return[e,Tr(t,r)]}function BR(e,t,r){return t in e?Al(e,t,e[t],r):vR()}function Al(e,t,r,o){return Nn(r)?FR(t,r.parameters,r.expression):ie(r)?BR(e,r.$ref,o):jR()}function Sl(e,t,r){return Al(e,"(anonymous)",t,r)}function $t(e,t,r){let o=a.Keys(e).reduce((i,s)=>({...i,[s]:f.Update(e[s],{},{$id:s})}),{});return f.Create({"~kind":"Cyclic"},{$defs:o,$ref:t},r)}function ae(e){return h(e,"Cyclic")}var te={};Ot(te,{Match:()=>qR});function qR(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function je(e){return f.Create({"~kind":"Unknown"},{},e)}function it(e){return h(e,"Unknown")}function Lo(...e){let[t,r]=te.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,je(),je()]});return f.Create({"~kind":"Infer"},{type:"infer",name:t,extends:r},{})}function Ee(e){return h(e,"Infer")}function Ln(e){return f.Create({"~kind":"Any"},{},e)}function We(e){return h(e,"Any")}function bl(e){return a.IsObjectNotArray(e)}function xl(e){return a.Keys(e).filter(r=>isNaN(r)).reduce((r,o)=>[...r,e[o]],[])}function Rl(e,t){let r=bl(e)?xl(e):e;return f.Create({"~kind":"Enum"},{enum:r},t)}function Ie(e){return h(e,"Enum")}function Tt(e,t={}){return f.Create({"~kind":"Intersect"},{allOf:e},t)}function U(e){return h(e,"Intersect")}function Cl(e){return f.Discard(e,["~kind","allOf"])}function F(){throw new Error("Unreachable")}var hr={};Ot(hr,{Hash:()=>sC,HashCode:()=>wl});function HR(e){let t=new Set,r=e;for(;r&&r!==Object.prototype;){for(let o of Reflect.ownKeys(r))o!=="constructor"&&typeof o!="symbol"&&t.add(o);r=Object.getPrototypeOf(r)}return[...t]}function KR(e){return typeof e=="number"}var Ze;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(Ze||(Ze={}));var kn=BigInt("14695981039346656037"),[zR,VR]=[BigInt("1099511628211"),BigInt("18446744073709551616")],YR=Array.from({length:256}).map((e,t)=>BigInt(t)),Ll=new Float64Array(1),kl=new DataView(Ll.buffer),Ml=new Uint8Array(Ll.buffer);function Fe(e){kn=kn^YR[e],kn=kn*zR%VR}function QR(e){Fe(Ze.Array);for(let t of e)_r(t)}function WR(e){Fe(Ze.BigInt),kl.setBigInt64(0,e);for(let t of Ml)Fe(t)}function Ul(e){Fe(Ze.Boolean),Fe(e?1:0)}function ZR(e){Fe(Ze.Constructor),_r(e.toString())}function XR(e){Fe(Ze.Date),_r(e.getTime())}function JR(e){Fe(Ze.Function),_r(e.toString())}function eC(e){Fe(Ze.Null)}function Nl(e){Fe(Ze.Number),kl.setFloat64(0,e,!0);for(let t of Ml)Fe(t)}function tC(e){Fe(Ze.Object);for(let t of HR(e).sort())_r(t),_r(e[t])}function rC(e){Fe(Ze.RegExp),yp(e.toString())}var nC=new TextEncoder;function yp(e){Fe(Ze.String);for(let t of nC.encode(e))Fe(t)}function oC(e){Fe(Ze.Symbol),_r(e.toString())}function iC(e){Fe(Ze.TypeArray);let t=new Uint8Array(e.buffer);for(let r=0;r<t.length;r++)Fe(t[r])}function aC(e){return Fe(Ze.Undefined)}function _r(e){return Qe.IsTypeArray(e)?iC(e):Qe.IsDate(e)?XR(e):Qe.IsRegExp(e)?rC(e):Qe.IsBoolean(e)?Ul(e.valueOf()):Qe.IsString(e)?yp(e.valueOf()):Qe.IsNumber(e)?Nl(e.valueOf()):KR(e)?Nl(e):a.IsArray(e)?QR(e):a.IsBoolean(e)?Ul(e):a.IsBigInt(e)?WR(e):a.IsConstructor(e)?ZR(e):a.IsNull(e)?eC(e):a.IsObject(e)?tC(e):a.IsString(e)?yp(e):a.IsSymbol(e)?oC(e):a.IsUndefined(e)?aC(e):a.IsFunction(e)?JR(e):F()}function wl(e){return kn=BigInt("14695981039346656037"),_r(e),kn}function sC(e){return wl(e).toString(16).padStart(16,"0")}function $l(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~guard":return"must match check function";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var pC=$l;function Dl(){return pC}var ko=class{constructor(t,r){this.type=t,this.decode=r}Encode(t){let r=this.type,o=Wr(r)?m=>this.decode(r["~codec"].decode(m)):this.decode,i=Wr(r)?m=>r["~codec"].encode(t(m)):t,s={decode:o,encode:i};return f.Update(this.type,{"~codec":s},{})}},Mo=class{constructor(t){this.type=t}Decode(t){return new ko(this.type,t)}};function ha(e){return new Mo(e)}function vl(e,t){return ha(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function jl(e,t){return ha(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function Wr(e){return A(e)&&a.HasPropertyKey(e,"~codec")&&a.IsObject(e["~codec"])&&a.HasPropertyKey(e["~codec"],"encode")&&a.HasPropertyKey(e["~codec"],"decode")}function cC(e,t){let r=Oa(e)?[...e["~refine"],t]:[t];return f.Update(e,{"~refine":r},{})}function Fl(e,t,r="error"){return cC(e,{refine:t,message:r})}function Oa(e){return A(e)&&a.HasPropertyKey(e,"~refine")}var Bl="-?(?:0|[1-9][0-9]*)n";function wo(e){return f.Create({"~kind":"BigInt"},{type:"bigint"},e)}function ct(e){return h(e,"BigInt")}function Aa(e){return f.Create({"~kind":"Boolean"},{type:"boolean"},e)}function Xe(e){return h(e,"Boolean")}function $o(e){return f.Create({"~kind":"Identifier"},{name:e})}function ql(e){return h(e,"Identifier")}var Sa="-?(?:0|[1-9][0-9]*)";function Zr(e){return f.Create({"~kind":"Integer"},{type:"integer"},e)}function ke(e){return h(e,"Integer")}function Dt(e,t){return f.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},t)}function Ve(e){return h(e,"Iterator")}function Hl(e){return f.Discard(e,["~kind","type","iteratorItems"])}var Ep=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function uC(e){return a.IsBigInt(e)?"bigint":a.IsBoolean(e)?"boolean":a.IsNumber(e)?"number":a.IsString(e)?"string":(()=>{throw new Ep(e)})()}function q(e,t){return f.Create({"~kind":"Literal"},{type:uC(e),const:e},t)}function ba(e){return a.IsBigInt(e)||a.IsBoolean(e)||a.IsNumber(e)||a.IsString(e)}function Kl(e){return V(e)&&a.IsBigInt(e.const)}function zl(e){return V(e)&&a.IsBoolean(e.const)}function Mn(e){return V(e)&&a.IsNumber(e.const)}function wn(e){return V(e)&&a.IsString(e.const)}function V(e){return h(e,"Literal")}function Or(e){return f.Create({"~kind":"Null"},{type:"null"},e)}function Gt(e){return h(e,"Null")}var xa="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function _t(e){return f.Create({"~kind":"Number"},{type:"number"},e)}function le(e){return h(e,"Number")}function $n(e){return f.Create({"~kind":"Symbol"},{type:"symbol"},e)}function vt(e){return h(e,"Symbol")}function Vl(e){return a.Keys(e).filter(t=>!xe(e[t]))}function Yl(e){return a.Keys(e)}function Ra(e){return a.Values(e)}function lC(e,t={}){let r=Vl(e),o=r.length>0?{required:r}:{};return f.Create({"~kind":"Object"},{type:"object",...o,properties:e},t)}var N=lC;function M(e){return h(e,"Object")}function Ql(e){return f.Discard(e,["~kind","type","properties","required"])}function Xr(...e){let[t,r,o]=te.Match(e,{3:(i,s,m)=>[i,s,m],2:(i,s)=>[i,s,s],1:i=>[i,je(),je()]});return f.Create({"~kind":"Parameter"},{name:t,extends:r,equals:o},{})}function Wl(e){return h(e,"Parameter")}function jt(e,t){return f.Create({"~kind":"Promise"},{type:"promise",item:e},t)}function Be(e){return h(e,"Promise")}function Zl(e){return f.Discard(e,["~kind","type","item"])}var Ca=".*";function at(e){return f.Create({"~kind":"String"},{type:"string"},e)}function Oe(e){return h(e,"String")}function st(e,t){let r="object",o={[e]:t};return f.Create({"~kind":"Record"},{type:r,patternProperties:o})}var Dn=`^${Sa}$`,Gn=`^${xa}$`,Ft=`^${Ca}$`;function Do(e,t,r={}){return R("Record",[e,t],r)}function dC(e,t,r={}){return x({},Do(e,t,r))}function Pa(e,t,r={}){return dC(e,t,r)}function Xl(e,t){return st(e,t)}function ut(e){return a.Keys(e.patternProperties)[0]}function vn(e){let t=ut(e);return a.IsEqual(t,Dn)?Zr():a.IsEqual(t,Gn)?_t():at()}function qe(e){return e.patternProperties[ut(e)]}function de(e){return h(e,"Record")}function Jr(e){return f.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function Ar(e){return h(e,"Rest")}function Ua(e){return f.Create({"~kind":"This"},{$ref:"#"},e)}function Jl(e){return h(e,"This")}function Me(e,t={}){let[r,o,i]=[e,e.length,!1];return f.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:r,minItems:o},t)}function H(e){return h(e,"Tuple")}function ed(e){return f.Discard(e,["~kind","type","items","minItems","additionalItems"])}function jn(e){return f.Create({"~kind":"Undefined"},{type:"undefined"},e)}function Bt(e){return h(e,"Undefined")}function G(e,t={}){return f.Create({"~kind":"Union"},{anyOf:e},t)}function O(e){return h(e,"Union")}function td(e){return f.Discard(e,["~kind","anyOf"])}function rd(e){return f.Create({"~kind":"Unsafe"},{},e)}function nd(e){return h(e,"Unsafe")}function Na(e){return f.Create({"~kind":"Void"},{type:"void"},e)}function lt(e){return h(e,"Void")}function gC(e,t){return a.IsEqual(e,"Array")?Pt(t[0]):a.IsEqual(e,"AsyncIterator")?wt(t[0]):a.IsEqual(e,"Iterator")?Dt(t[0]):a.IsEqual(e,"Promise")?jt(t[0]):a.IsEqual(e,"Awaited")?ri(t[0]):a.IsEqual(e,"Capitalize")?vo(t[0]):a.IsEqual(e,"ConstructorParameters")?Ho(t[0]):a.IsEqual(e,"Evaluate")?Tp(t[0]):a.IsEqual(e,"Exclude")?Ko(t[0],t[1]):a.IsEqual(e,"Extract")?zo(t[0],t[1]):a.IsEqual(e,"Index")?qn(t[0],t[1]):a.IsEqual(e,"InstanceType")?Vo(t[0]):a.IsEqual(e,"Lowercase")?jo(t[0]):a.IsEqual(e,"NonNullable")?Yo(t[0]):a.IsEqual(e,"Omit")?Qo(t[0],t[1]):a.IsEqual(e,"Options")?Kn(t[0],t[1]):a.IsEqual(e,"Parameters")?Wo(t[0]):a.IsEqual(e,"Partial")?Zo(t[0]):a.IsEqual(e,"Pick")?Xo(t[0],t[1]):a.IsEqual(e,"Readonly")?Jo(t[0]):a.IsEqual(e,"KeyOf")?Hn(t[0]):a.IsEqual(e,"Record")?Do(t[0],t[1]):a.IsEqual(e,"Required")?ei(t[0]):a.IsEqual(e,"ReturnType")?ti(t[0]):a.IsEqual(e,"Uncapitalize")?Fo(t[0]):a.IsEqual(e,"Uppercase")?Bo(t[0]):La(he(e),t)}function en(){throw Error("Unreachable")}var yC=(e,t=[])=>e.reduce((r,o)=>a.IsArray(o)&&a.IsEqual(o.length,2)?[...r,o[0]]:[...r,o],[]),Zt=e=>{let[t,r]=e;return yC([...t,...r])};function pd(e){return Xr(e[0],e[2],e[4])}function md(e){return Xr(e[0],e[2],e[2])}function cd(e){return Xr(e[0],je(),e[2])}function ud(e){return Xr(e,je(),je())}function ld(e){return Zt(e)}function dd(e){return e[1]}function fd(e){return Zt(e)}function gd(e){return e[1]}function yd(e){return gC(e[0],e[1])}function Ed(e){return null}function Id(e){return at()}function Td(e){return _t()}function _d(e){return Aa()}function hd(e){return jn()}function Od(e){return Or()}function Ad(e){return Zr()}function Sd(e){return wo()}function bd(e){return je()}function xd(e){return Ln()}function Rd(e){return N({})}function Cd(e){return z()}function Pd(e){return $n()}function Ud(e){return Na()}function Nd(e){return Ua()}function Ld(e){return e[1]}function kd(e){return q(e)}function Md(e){return a.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function wd(e){return e[1]}function $d(e){return Go(e)}function Dd(e){return q(BigInt(e))}function Gd(e){return q(a.IsEqual(e,"true"))}function vd(e){return q(parseFloat(e))}function jd(e){return q(e)}function Fd(e){return e.length>0}function Bd(e){return e.reduce((t,r)=>a.IsEqual(r.length,3)?[...t,[r[1]]]:[...t,[]],[])}function qd(e){return a.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function Hd(e){return a.IsArray(e)&&a.IsEqual(e.length,3)?e[1]:e}var od=(e,t)=>t.reduceRight((r,o)=>{let i=o;return a.IsEqual(i.length,1)?qn(r,i[0]):a.IsEqual(i.length,0)?Pt(r):en()},e),id=(e,t)=>a.IsEqual(t.length,3)?qo(e,t[0],t[1],t[2]):e;function Kd(e){let[t,r,o,i]=e;return id(t?Hn(od(r,o)):od(r,o),i)}function Ip(e,t){return a.IsEqual(t.length,3)?(()=>{let[r,o,i]=t,s=Ip(o,i);if(a.IsEqual(r,"&"))return U(s)?Tt([e,...s.allOf]):Tt([e,s]);if(a.IsEqual(r,"|"))return O(s)?G([e,...s.anyOf]):G([e,s]);en()})():e}function zd(e){let[t,r]=e;return Ip(t,r)}function Vd(e){let[t,r]=e;return Ip(t,r)}function Yd(e){return gp(e[1])}function Qd(e){return e[1]}function Wd(e){return Tr(e[0],e[2])}function Zd(e){return a.IsEqual(e.length,4)?Lo(e[1],e[3]):a.IsEqual(e.length,2)?Lo(e[1],je()):en()}function Xd(e){return`${e}`}function Jd(e){return ke(e[3])?Dn:le(e[3])?Gn:vt(e[3])?Ft:Oe(e[3])?Ft:en()}function ef(e){return e.length>0}function tf(e){return e.length>0}function rf(e){let[t,r,o,i,s]=e;return{[r]:t&&o?ot(nt(s)):t&&!o?ot(s):!t&&o?nt(s):s}}function nf(e){return Zt(e)}function of(e){return e.reduce((t,r)=>a.HasPropertyKey(r,Dn)||a.HasPropertyKey(r,Gn)||a.HasPropertyKey(r,Ft)?[t[0],f.Assign(t[1],r)]:[f.Assign(t[0],r),t[1]],[{},{}])}function af(e){return of(e[1])}function sf(e){let[t,r]=e,o=a.IsEqual(a.Keys(r).length,0)?{}:{patternProperties:r};return N(t,o)}function pf(e){return a.IsEqual(e.length,5)?ot(nt(e[4])):a.IsEqual(e.length,3)?e[2]:a.IsEqual(e.length,4)?a.IsEqual(e[2],"readonly")?ot(e[3]):nt(e[3]):en()}function mf(e){return ot(nt(e[1]))}function cf(e){return ot(e[1])}function uf(e){return nt(e[0])}function lf(e){return a.IsEqual(e.length,2)?Jr(e[1]):a.IsEqual(e.length,1)?e[0]:en()}function df(e){return Zt(e)}function ff(e){return Me(e[1])}function gf(e){return ot(nt(e[4]))}function yf(e){return ot(e[3])}function Ef(e){return nt(e[3])}function If(e){return e[2]}function Tf(e){return a.IsEqual(e.length,2)?Jr(e[1]):a.IsEqual(e.length,1)?e[0]:en()}function _f(e){return Zt(e)}function hf(e){return Ir(e[1],e[4])}function Of(e){return Er(e[2],e[5])}function ad(e,t){return a.IsEqual(e,"remove")?gl(t):a.IsEqual(e,"add")?dl(t):t}function Af(e){return a.IsEqual(e.length,2)&&a.IsEqual(e[0],"-")?"remove":a.IsEqual(e.length,2)&&a.IsEqual(e[0],"+")||a.IsEqual(e.length,1)?"add":"none"}function sd(e,t){return a.IsEqual(e,"remove")?ul(t):a.IsEqual(e,"add")?ml(t):t}function Sf(e){return a.IsEqual(e.length,2)&&a.IsEqual(e[0],"-")?"remove":a.IsEqual(e.length,2)&&a.IsEqual(e[0],"+")||a.IsEqual(e.length,1)?"add":"none"}function bf(e){return a.IsEqual(e.length,2)?[e[1]]:[]}function xf(e){return a.IsArray(e[6])&&a.IsEqual(e[6].length,1)?Fn($o(e[3]),e[5],e[6][0],ad(e[1],sd(e[8],e[10]))):Fn($o(e[3]),e[5],he(e[3]),ad(e[1],sd(e[8],e[10])))}function Rf(e){return he(e)}function Cf(e){return Kn(e[2],e[4])}function Pf(e){return parseFloat(e)}function Uf(e){return a.IsEqual(e,"true")}function Nf(e){return null}function Lf(e){return{[e[0]]:e[2]}}function kf(e){return Zt(e)}function EC(e){return e.reduce((t,r)=>f.Assign(t,r),{})}function Mf(e){return EC(e[1])}function wf(e){return Zt(e)}function $f(e){return e[1]}function Df(e){return wo()}function Gf(e){return at()}function vf(e){return _t()}function jf(e){return Zr()}function Ff(e){return z()}function Bf(e){return q(e)}function qf(e){return G(e[1])}function Hf(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Kf(e){return[e[0],...e[1]]}function zf(e){return e[1]}function Vf(e){return Zt(e)}function Yf(e){return a.IsEqual(e.length,2)?e[1]:[]}function Qf(e){let t=e[2],r=e[3],[o,i]=e[4],s=a.IsEqual(a.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:Tr(t,Bn(r,o,s))}}function Wf(e){let t=e[2],[r,o]=e[3],i=a.IsEqual(a.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:Bn(t,r,i)}}function Zf(e){return{[e[1]]:Tr(e[2],e[4])}}function Xf(e){return{[e[1]]:e[3]}}function Jf(e){return null}function eg(e){return of(Zt(e))}function tg(e){return e[1]}function rg(e){let t=e[0],r=e[1];return _p(f.Assign(t,r[0]))}function re(e){return Kr(e)&&Z(e.length,2)}function _C(e,t){return Z(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Pe(e,t){let[r,...o]=e;return gr(r)?(()=>{let i=_C(r,t);return Z(i.length,2)?i:Pe(o,t)})():[]}function hp(e,t){return Array.from({length:t-e+1},(r,o)=>String.fromCharCode(e+o))}var ng=[...hp(97,122),...hp(65,90)],Op="0",Ap=hp(49,57),zn=[Op,...Ap],og=" ",Vn=`
28
- `;var Sr="_",ka=".",ig="$",Ma="-";var ag="//",sg="/*",OC="*/";function pg(e){let t=e.indexOf(OC);return Z(t,-1)?"":e.slice(t+2)}function mg(e){let t=e.indexOf(Vn);return Z(t,-1)?"":e.slice(t)}function AC(e){return e.replace(/^[ \t\r\f\v]+/,"")}function wa(e){let t=AC(e);return t.startsWith(sg)?wa(pg(t.slice(2))):t.startsWith(ag)?wa(mg(t.slice(2))):t}function pt(e){let t=e.trimStart();return t.startsWith(sg)?pt(pg(t.slice(2))):t.startsWith(ag)?pt(mg(t.slice(2))):t}function SC(e,t){return e.includes(t)}function Yn(e,t,r,o=""){let i=Pe(e,r);return re(i)?SC(t,i[0])?Yn(e,t,i[1],o):Yn(e,t,i[1],`${o}${i[0]}`):[o,r]}function $a(e,t){let r=Pe([e],t);return re(r)?r:["",t]}function bC(e){return $a(Ma,e)}function xC(e){return Pe(Ap,e)}var RC=[...zn,Sr];function CC(e){return Yn(RC,[Sr],e)}function PC(e){let t=bC(e);return re(t)?(()=>{let r=Pe([Op],t[1]);return re(r)?[`${t[0]}${r[0]}`,r[1]]:(()=>{let o=xC(t[1]);return re(o)?(()=>{let i=CC(o[1]);return re(i)?[`${t[0]}${o[0]}${i[0]}`,i[1]]:[]})():[]})()})():[]}function Da(e){return PC(pt(e))}function UC(e){let t=Da(e);return re(t)?(()=>{let r=Pe(["n"],t[1]);return re(r)?[`${t[0]}`,r[1]]:[]})():[]}function cg(e){return UC(e)}function Sp(e,t){return Pe([e],t)}function y(e,t){return Z(e,"")?["",t]:e.startsWith(Vn)?Sp(e,wa(t)):e.startsWith(og)?Sp(e,t):Sp(e,pt(t))}var ug=[...ng,Sr,ig];function NC(e){return Pe(ug,e)}var LC=[...ug,...zn];function lg(e,t=""){let r=Pe(LC,e);return re(r)?lg(r[1],`${t}${r[0]}`):[t,e]}function kC(e){let t=NC(e);return re(t)?(()=>{let r=lg(t[1]);return re(r)?[`${t[0]}${r[0]}`,r[1]]:[]})():[]}function fe(e){return kC(pt(e))}var MC=[...zn,Sr];function wC(e){return $a(Ma,e)}function $C(e){return re(Pe([ka],e))}function dg(e){let t=Yn(MC,[Sr],e);return re(t)?Z(t[0],"")?[]:[t[0],t[1]]:[]}function DC(e,t){let r=Pe([ka],t);return re(r)?(()=>{let o=dg(r[1]);return re(o)?[`${e}0${r[0]}${o[0]}`,o[1]]:[]})():[]}function GC(e,t){let r=Da(t);return re(r)?(()=>{let o=Pe([ka],r[1]);return re(o)?(()=>{let i=dg(o[1]);return re(i)?[`${e}${r[0]}${o[0]}${i[0]}`,i[1]]:[`${e}${r[0]}`,o[1]]})():[`${e}${r[0]}`,r[1]]})():[]}function vC(e){let t=wC(e);return re(t)?$C(t[1])?DC(t[0],t[1]):GC(t[0],t[1]):[]}function Ga(e){return vC(pt(e))}function fg(e,t){let[r,...o]=e;return gr(r)?t.startsWith(r)?!0:fg(o,t):!1}function br(e,t,r=""){return Z(t,"")?[]:fg(e,t)?[r,t]:(()=>{let[o,i]=[t.slice(0,1),t.slice(1)];return br(e,i,`${r}${o}`)})()}function jC(e,t,r){return r.startsWith(e)?(()=>{let o=br([t],r.slice(e.length));return re(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function FC(e,t,r){return r.startsWith(e)?(()=>{let o=br([Vn,t],r.slice(e.length));return re(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function gg(e,t,r,o){return r?jC(e,t,pt(o)):FC(e,t,pt(o))}function BC(e,t){return Pe(e,t)}function qC(e,t){return gg(e,e,!1,t)}function HC(e,t){let r=BC(e,t);return re(r)?qC(r[0],`${r[0]}${r[1]}`):[]}function va(e,t){return HC(e,pt(t))}function yg(e,t){let r=br(e,t);return re(r)?Z(r[0],"")?[]:r:[]}var p=(e,t,r=()=>[])=>e.length===2?t(e):r(),zC=e=>p(p(fe(e),([t,r])=>p(y("extends",r),([o,i])=>p(Y(i),([s,m])=>p(y("=",m),([u,l])=>p(Y(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[pd(t),r]),VC=e=>p(p(fe(e),([t,r])=>p(y("extends",r),([o,i])=>p(Y(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[md(t),r]),YC=e=>p(p(fe(e),([t,r])=>p(y("=",r),([o,i])=>p(Y(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[cd(t),r]),QC=e=>p(fe(e),([t,r])=>[ud(t),r]),Tg=e=>p(p(zC(e),([t,r])=>[t,r],()=>p(VC(e),([t,r])=>[t,r],()=>p(YC(e),([t,r])=>[t,r],()=>p(QC(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),_g=(e,t=[])=>p(p(Tg(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>_g(o,[...t,r]),()=>[t,e]),WC=e=>p(p(_g(e),([t,r])=>p(p(p(Tg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[ld(t),r]),Rp=e=>p(p(y("<",e),([t,r])=>p(WC(r),([o,i])=>p(y(">",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[dd(t),r]),hg=(e,t=[])=>p(p(Y(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>hg(o,[...t,r]),()=>[t,e]),ZC=e=>p(p(hg(e),([t,r])=>p(p(p(Y(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[fd(t),r]),XC=e=>p(p(y("<",e),([t,r])=>p(ZC(r),([o,i])=>p(y(">",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[gd(t),r]),JC=e=>p(p(fe(e),([t,r])=>p(XC(r),([o,i])=>[[t,o],i])),([t,r])=>[yd(t),r]),Og=e=>p(p(p(y(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Ed(t),r]),Ag=e=>p(y("string",e),([t,r])=>[Id(t),r]),Sg=e=>p(y("number",e),([t,r])=>[Td(t),r]),eP=e=>p(y("boolean",e),([t,r])=>[_d(t),r]),tP=e=>p(y("undefined",e),([t,r])=>[hd(t),r]),rP=e=>p(y("null",e),([t,r])=>[Od(t),r]),bg=e=>p(y("integer",e),([t,r])=>[Ad(t),r]),nP=e=>p(y("bigint",e),([t,r])=>[Sd(t),r]),oP=e=>p(y("unknown",e),([t,r])=>[bd(t),r]),iP=e=>p(y("any",e),([t,r])=>[xd(t),r]),aP=e=>p(y("object",e),([t,r])=>[Rd(t),r]),sP=e=>p(y("never",e),([t,r])=>[Cd(t),r]),xg=e=>p(y("symbol",e),([t,r])=>[Pd(t),r]),pP=e=>p(y("void",e),([t,r])=>[Ud(t),r]),mP=e=>p(y("this",e),([t,r])=>[Nd(t),r]),cP=e=>p(p(Ag(e),([t,r])=>[t,r],()=>p(Sg(e),([t,r])=>[t,r],()=>p(eP(e),([t,r])=>[t,r],()=>p(tP(e),([t,r])=>[t,r],()=>p(rP(e),([t,r])=>[t,r],()=>p(bg(e),([t,r])=>[t,r],()=>p(nP(e),([t,r])=>[t,r],()=>p(oP(e),([t,r])=>[t,r],()=>p(iP(e),([t,r])=>[t,r],()=>p(aP(e),([t,r])=>[t,r],()=>p(sP(e),([t,r])=>[t,r],()=>p(xg(e),([t,r])=>[t,r],()=>p(pP(e),([t,r])=>[t,r],()=>p(mP(e),([t,r])=>[t,r],()=>[])))))))))))))),([t,r])=>[t,r]),uP=e=>p(p(y("${",e),([t,r])=>p(Y(r),([o,i])=>p(y("}",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Ld(t),r]),bp=e=>p(br(["${","`"],e),([t,r])=>[kd(t),r]),Rg=e=>p(p(p(bp(e),([t,r])=>p(uP(r),([o,i])=>p(Rg(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[t,r],()=>p(p(bp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(bp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[Md(t),r]),Cp=e=>p(p(y("`",e),([t,r])=>p(Rg(r),([o,i])=>p(y("`",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[wd(t),r]),lP=e=>p(Cp(e),([t,r])=>[$d(t),r]),dP=e=>p(cg(e),([t,r])=>[Dd(t),r]),fP=e=>p(p(y("true",e),([t,r])=>[t,r],()=>p(y("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[Gd(t),r]),gP=e=>p(Ga(e),([t,r])=>[vd(t),r]),yP=e=>p(va(["'",'"'],e),([t,r])=>[jd(t),r]),EP=e=>p(p(dP(e),([t,r])=>[t,r],()=>p(fP(e),([t,r])=>[t,r],()=>p(gP(e),([t,r])=>[t,r],()=>p(yP(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),IP=e=>p(p(p(y("keyof",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Fd(t),r]),Cg=(e,t=[])=>p(p(p(y("[",e),([r,o])=>p(Y(o),([i,s])=>p(y("]",s),([m,u])=>[[r,i,m],u]))),([r,o])=>[r,o],()=>p(p(y("[",e),([r,o])=>p(y("]",o),([i,s])=>[[r,i],s])),([r,o])=>[r,o],()=>[])),([r,o])=>Cg(o,[...t,r]),()=>[t,e]),TP=e=>p(Cg(e),([t,r])=>[Bd(t),r]),_P=e=>p(p(p(y("extends",e),([t,r])=>p(Y(r),([o,i])=>p(y("?",i),([s,m])=>p(Y(m),([u,l])=>p(y(":",l),([g,E])=>p(Y(E),([I,P])=>[[t,o,s,u,g,I],P])))))),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[qd(t),r]),hP=e=>p(p(p(y("(",e),([t,r])=>p(Y(r),([o,i])=>p(y(")",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[t,r],()=>p(cP(e),([t,r])=>[t,r],()=>p(kP(e),([t,r])=>[t,r],()=>p(vP(e),([t,r])=>[t,r],()=>p(lP(e),([t,r])=>[t,r],()=>p(EP(e),([t,r])=>[t,r],()=>p(KP(e),([t,r])=>[t,r],()=>p(HP(e),([t,r])=>[t,r],()=>p(QP(e),([t,r])=>[t,r],()=>p(ZP(e),([t,r])=>[t,r],()=>p(JC(e),([t,r])=>[t,r],()=>p(WP(e),([t,r])=>[t,r],()=>[])))))))))))),([t,r])=>[Hd(t),r]),Pg=e=>p(p(IP(e),([t,r])=>p(hP(r),([o,i])=>p(TP(i),([s,m])=>p(_P(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[Kd(t),r]),Ug=e=>p(p(p(y("&",e),([t,r])=>p(Pg(r),([o,i])=>p(Ug(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Ng=e=>p(p(Pg(e),([t,r])=>p(Ug(r),([o,i])=>[[t,o],i])),([t,r])=>[zd(t),r]),Lg=e=>p(p(p(y("|",e),([t,r])=>p(Ng(r),([o,i])=>p(Lg(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),ja=e=>p(p(Ng(e),([t,r])=>p(Lg(r),([o,i])=>[[t,o],i])),([t,r])=>[Vd(t),r]),OP=e=>p(p(y("readonly",e),([t,r])=>p(ja(r),([o,i])=>[[t,o],i])),([t,r])=>[Yd(t),r]),AP=e=>p(p(y("|",e),([t,r])=>p(ja(r),([o,i])=>[[t,o],i])),([t,r])=>[Qd(t),r]),SP=e=>p(p(Rp(e),([t,r])=>p(y("=",r),([o,i])=>p(Y(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Wd(t),r]),bP=e=>p(p(p(y("infer",e),([t,r])=>p(fe(r),([o,i])=>p(y("extends",i),([s,m])=>p(ja(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[t,r],()=>p(p(y("infer",e),([t,r])=>p(fe(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>[])),([t,r])=>[Zd(t),r]),Y=e=>p(p(bP(e),([t,r])=>[t,r],()=>p(AP(e),([t,r])=>[t,r],()=>p(OP(e),([t,r])=>[t,r],()=>p(ja(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),xP=e=>p(Ga(e),([t,r])=>[Xd(t),r]),RP=e=>p(fe(e),([t,r])=>[t,r]),CP=e=>p(va(["'",'"'],e),([t,r])=>[t,r]),PP=e=>p(p(y("[",e),([t,r])=>p(fe(r),([o,i])=>p(y(":",i),([s,m])=>p(p(bg(m),([u,l])=>[u,l],()=>p(Sg(m),([u,l])=>[u,l],()=>p(Ag(m),([u,l])=>[u,l],()=>p(xg(m),([u,l])=>[u,l],()=>[])))),([u,l])=>p(y("]",l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[Jd(t),r]),kg=e=>p(p(xP(e),([t,r])=>[t,r],()=>p(RP(e),([t,r])=>[t,r],()=>p(CP(e),([t,r])=>[t,r],()=>p(PP(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),UP=e=>p(p(p(y("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[ef(t),r]),NP=e=>p(p(p(y("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[tf(t),r]),Mg=e=>p(p(UP(e),([t,r])=>p(kg(r),([o,i])=>p(NP(i),([s,m])=>p(y(":",m),([u,l])=>p(Y(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[rf(t),r]),wg=e=>p(p(p(y(",",e),([t,r])=>p(y(`
29
- `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y(";",e),([t,r])=>p(y(`
30
- `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y(",",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(y(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(y(`
31
- `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),$g=(e,t=[])=>p(p(Mg(e),([r,o])=>p(wg(o),([i,s])=>[[r,i],s])),([r,o])=>$g(o,[...t,r]),()=>[t,e]),LP=e=>p(p($g(e),([t,r])=>p(p(p(Mg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[nf(t),r]),Pp=e=>p(p(y("{",e),([t,r])=>p(LP(r),([o,i])=>p(y("}",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[af(t),r]),kP=e=>p(Pp(e),([t,r])=>[sf(t),r]),MP=e=>p(p(p(fe(e),([t,r])=>p(y("?",r),([o,i])=>p(y(":",i),([s,m])=>p(y("readonly",m),([u,l])=>p(Y(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[t,r],()=>p(p(fe(e),([t,r])=>p(y(":",r),([o,i])=>p(y("readonly",i),([s,m])=>p(Y(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[t,r],()=>p(p(fe(e),([t,r])=>p(y("?",r),([o,i])=>p(y(":",i),([s,m])=>p(Y(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[t,r],()=>p(p(fe(e),([t,r])=>p(y(":",r),([o,i])=>p(Y(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[t,r],()=>[])))),([t,r])=>[pf(t),r]),wP=e=>p(p(y("readonly",e),([t,r])=>p(Y(r),([o,i])=>p(y("?",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[mf(t),r]),$P=e=>p(p(y("readonly",e),([t,r])=>p(Y(r),([o,i])=>[[t,o],i])),([t,r])=>[cf(t),r]),DP=e=>p(p(Y(e),([t,r])=>p(y("?",r),([o,i])=>[[t,o],i])),([t,r])=>[uf(t),r]),Eg=e=>p(p(MP(e),([t,r])=>[t,r],()=>p(wP(e),([t,r])=>[t,r],()=>p($P(e),([t,r])=>[t,r],()=>p(DP(e),([t,r])=>[t,r],()=>p(Y(e),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),Dg=e=>p(p(p(y("...",e),([t,r])=>p(Eg(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(Eg(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[lf(t),r]),Gg=(e,t=[])=>p(p(Dg(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>Gg(o,[...t,r]),()=>[t,e]),GP=e=>p(p(Gg(e),([t,r])=>p(p(p(Dg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[df(t),r]),vP=e=>p(p(y("[",e),([t,r])=>p(GP(r),([o,i])=>p(y("]",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[ff(t),r]),jP=e=>p(p(fe(e),([t,r])=>p(y("?",r),([o,i])=>p(y(":",i),([s,m])=>p(y("readonly",m),([u,l])=>p(Y(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[gf(t),r]),FP=e=>p(p(fe(e),([t,r])=>p(y(":",r),([o,i])=>p(y("readonly",i),([s,m])=>p(Y(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[yf(t),r]),BP=e=>p(p(fe(e),([t,r])=>p(y("?",r),([o,i])=>p(y(":",i),([s,m])=>p(Y(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[Ef(t),r]),qP=e=>p(p(fe(e),([t,r])=>p(y(":",r),([o,i])=>p(Y(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[If(t),r]),Ig=e=>p(p(jP(e),([t,r])=>[t,r],()=>p(FP(e),([t,r])=>[t,r],()=>p(BP(e),([t,r])=>[t,r],()=>p(qP(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),vg=e=>p(p(p(y("...",e),([t,r])=>p(Ig(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(Ig(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[Tf(t),r]),jg=(e,t=[])=>p(p(vg(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>jg(o,[...t,r]),()=>[t,e]),Fg=e=>p(p(jg(e),([t,r])=>p(p(p(vg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[_f(t),r]),HP=e=>p(p(y("(",e),([t,r])=>p(Fg(r),([o,i])=>p(y(")",i),([s,m])=>p(y("=>",m),([u,l])=>p(Y(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[hf(t),r]),KP=e=>p(p(y("new",e),([t,r])=>p(y("(",r),([o,i])=>p(Fg(i),([s,m])=>p(y(")",m),([u,l])=>p(y("=>",l),([g,E])=>p(Y(E),([I,P])=>[[t,o,s,u,g,I],P])))))),([t,r])=>[Of(t),r]),zP=e=>p(p(p(y("+",e),([t,r])=>p(y("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y("-",e),([t,r])=>p(y("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[Af(t),r]),VP=e=>p(p(p(y("+",e),([t,r])=>p(y("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y("-",e),([t,r])=>p(y("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[Sf(t),r]),YP=e=>p(p(p(y("as",e),([t,r])=>p(Y(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[bf(t),r]),QP=e=>p(p(y("{",e),([t,r])=>p(zP(r),([o,i])=>p(y("[",i),([s,m])=>p(fe(m),([u,l])=>p(y("in",l),([g,E])=>p(Y(E),([I,P])=>p(YP(P),([be,ve])=>p(y("]",ve),([Co,rx])=>p(VP(rx),([nx,ox])=>p(y(":",ox),([ix,ax])=>p(Y(ax),([sx,px])=>p(Og(px),([mx,cx])=>p(y("}",cx),([ux,lx])=>[[t,o,s,u,g,I,be,Co,nx,ix,sx,mx,ux],lx]))))))))))))),([t,r])=>[xf(t),r]),WP=e=>p(fe(e),([t,r])=>[Rf(t),r]),ZP=e=>p(p(y("Options",e),([t,r])=>p(y("<",r),([o,i])=>p(Y(i),([s,m])=>p(y(",",m),([u,l])=>p(Hg(l),([g,E])=>p(y(">",E),([I,P])=>[[t,o,s,u,g,I],P])))))),([t,r])=>[Cf(t),r]),XP=e=>p(Ga(e),([t,r])=>[Pf(t),r]),JP=e=>p(p(y("true",e),([t,r])=>[t,r],()=>p(y("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[Uf(t),r]),eU=e=>p(va(['"',"'"],e),([t,r])=>[t,r]),tU=e=>p(y("null",e),([t,r])=>[Nf(t),r]),Bg=e=>p(p(kg(e),([t,r])=>p(y(":",r),([o,i])=>p(Up(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Lf(t),r]),qg=(e,t=[])=>p(p(Bg(e),([r,o])=>p(wg(o),([i,s])=>[[r,i],s])),([r,o])=>qg(o,[...t,r]),()=>[t,e]),rU=e=>p(p(qg(e),([t,r])=>p(p(p(Bg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[kf(t),r]),Hg=e=>p(p(y("{",e),([t,r])=>p(rU(r),([o,i])=>p(y("}",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Mf(t),r]),Kg=(e,t=[])=>p(p(Up(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>Kg(o,[...t,r]),()=>[t,e]),nU=e=>p(p(Kg(e),([t,r])=>p(p(p(Up(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[wf(t),r]),oU=e=>p(p(y("[",e),([t,r])=>p(nU(r),([o,i])=>p(y("]",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[$f(t),r]),Up=e=>p(p(XP(e),([t,r])=>[t,r],()=>p(JP(e),([t,r])=>[t,r],()=>p(eU(e),([t,r])=>[t,r],()=>p(tU(e),([t,r])=>[t,r],()=>p(Hg(e),([t,r])=>[t,r],()=>p(oU(e),([t,r])=>[t,r],()=>[])))))),([t,r])=>[t,r]),iU=e=>p(y("-?(?:0|[1-9][0-9]*)n",e),([t,r])=>[Df(t),r]),aU=e=>p(y(".*",e),([t,r])=>[Gf(t),r]),sU=e=>p(y("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",e),([t,r])=>[vf(t),r]),pU=e=>p(y("-?(?:0|[1-9][0-9]*)",e),([t,r])=>[jf(t),r]),mU=e=>p(y("(?!)",e),([t,r])=>[Ff(t),r]),cU=e=>p(yg(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,r])=>[Bf(t),r]),uU=e=>p(p(iU(e),([t,r])=>[t,r],()=>p(aU(e),([t,r])=>[t,r],()=>p(sU(e),([t,r])=>[t,r],()=>p(pU(e),([t,r])=>[t,r],()=>p(mU(e),([t,r])=>[t,r],()=>p(lU(e),([t,r])=>[t,r],()=>p(cU(e),([t,r])=>[t,r],()=>[]))))))),([t,r])=>[t,r]),lU=e=>p(p(y("(",e),([t,r])=>p(Np(r),([o,i])=>p(y(")",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[qf(t),r]),zg=e=>p(p(p(xp(e),([t,r])=>p(y("|",r),([o,i])=>p(zg(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[t,r],()=>p(p(xp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[]))),([t,r])=>[Hf(t),r]),xp=e=>p(p(uU(e),([t,r])=>p(Np(r),([o,i])=>[[t,o],i])),([t,r])=>[Kf(t),r]),Np=e=>p(p(zg(e),([t,r])=>[t,r],()=>p(xp(e),([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Vg=e=>p(p(y("^",e),([t,r])=>p(Np(r),([o,i])=>p(y("$",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[zf(t),r]),Yg=(e,t=[])=>p(p(Y(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>Yg(o,[...t,r]),()=>[t,e]),dU=e=>p(p(Yg(e),([t,r])=>p(p(p(Y(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Vf(t),r]),Qg=e=>p(p(p(y("extends",e),([t,r])=>p(dU(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Yf(t),r]),fU=e=>p(p(y("interface",e),([t,r])=>p(fe(r),([o,i])=>p(Rp(i),([s,m])=>p(Qg(m),([u,l])=>p(Pp(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[Qf(t),r]),gU=e=>p(p(y("interface",e),([t,r])=>p(fe(r),([o,i])=>p(Qg(i),([s,m])=>p(Pp(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[Wf(t),r]),yU=e=>p(p(y("type",e),([t,r])=>p(fe(r),([o,i])=>p(Rp(i),([s,m])=>p(y("=",m),([u,l])=>p(Y(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[Zf(t),r]),EU=e=>p(p(y("type",e),([t,r])=>p(fe(r),([o,i])=>p(y("=",i),([s,m])=>p(Y(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[Xf(t),r]),IU=e=>p(p(p(y("export",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Jf(t),r]),TU=e=>p(p(p(y(";",e),([t,r])=>p(y(`
32
- `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(y(`
33
- `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]),Wg=(e,t=[])=>p(p(Lp(e),([r,o])=>p(TU(o),([i,s])=>[[r,i],s])),([r,o])=>Wg(o,[...t,r]),()=>[t,e]),_U=e=>p(p(Wg(e),([t,r])=>p(p(p(Lp(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[eg(t),r]),Lp=e=>p(p(IU(e),([t,r])=>p(p(fU(r),([o,i])=>[o,i],()=>p(gU(r),([o,i])=>[o,i],()=>p(yU(r),([o,i])=>[o,i],()=>p(EU(r),([o,i])=>[o,i],()=>[])))),([o,i])=>p(Og(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[tg(t),r]),hU=e=>p(p(Lp(e),([t,r])=>p(_U(r),([o,i])=>[[t,o],i])),([t,r])=>[rg(t),r]),Zg=e=>p(p(hU(e),([t,r])=>[t,r],()=>p(SP(e),([t,r])=>[t,r],()=>p(Y(e),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]);function Xg(e){let t=Cp(`\`${e}\``);return a.IsEqual(t.length,2)?t[0]:F()}function Go(e,t={}){return R("TemplateLiteral",[e],t)}function Jg(e){return x({},Go(e,{}))}function AU(e){let t=Xg(e);return Jg(t)}function ey(e,t={}){let r=a.IsString(e)?AU(e):Jg(e);return f.Update(r,{},t)}function Te(e){return h(e,"TemplateLiteral")}var L={};Ot(L,{ExtendsFalse:()=>j,ExtendsTrue:()=>S,ExtendsUnion:()=>kp,IsExtendsFalse:()=>SU,IsExtendsTrue:()=>ry,IsExtendsTrueLike:()=>ge,IsExtendsUnion:()=>ty});function kp(e){return f.Create({"~kind":"ExtendsUnion"},{inferred:e})}function ty(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"inferred")&&a.IsEqual(e["~kind"],"ExtendsUnion")&&a.IsObject(e.inferred)}function S(e){return f.Create({"~kind":"ExtendsTrue"},{inferred:e})}function ry(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"inferred")&&a.IsEqual(e["~kind"],"ExtendsTrue")&&a.IsObject(e.inferred)}function j(){return f.Create({"~kind":"ExtendsFalse"},{})}function SU(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.IsEqual(e["~kind"],"ExtendsFalse")}function ge(e){return ty(e)||ry(e)}function Fa(e){let t=Vg(e);return a.IsEqual(t.length,2)?t[0]:F()}function bU(e){return!0}function ny(e){let[t,...r]=e;return A(t)?xU(t)?ny(r):!1:!0}function oy(e){return a.IsEqual(e.length,0)?!1:ny(e)}function xU(e){return O(e)?oy(e.anyOf):V(e)?bU(e.const):!1}function Ba(e){return oy(e)}function iy(e,t,r=[]){let[o,...i]=e;return a.IsString(o)?iy(i,t,[...r,`${o}${t}`]):r}function RU(e,t){return a.IsEqual(e.length,0)?[`${t}`]:iy(e,t)}function ay(e,t,r=[]){let[o,...i]=t;return A(o)?ay(e,i,[...r,...sy(e,o)]):r}function sy(e,t){return O(t)?ay(e,t.anyOf):V(t)?RU(e,t.const):F()}function py(e,t){let[r,...o]=t;return A(r)?py(sy(e,r),o):e}function CU(e){return e.map(t=>q(t))}function PU(e){let t=py([],e),r=CU(t);return G(r)}function UU(e){return a.IsEqual(e.length,0)?F():a.IsEqual(e.length,1)&&V(e[0])?e[0]:PU(e)}function He(e){let t=Fa(e);return Ba(t)?UU(t):at()}function NU(e){return a.IsString(e)||a.IsNumber(e)?q(e):a.IsNull(e)?Or():z()}function Ut(e){return e.map(r=>NU(r))}function ni(e){let t=Ut(e);return G(t)}function tn(e){return ni(e.enum)}function LU(e,t,r,o){let i=J(e,r,o);return ge(i)?S(f.Assign(f.Assign(e,i.inferred),{[t]:r})):j()}function kU(e,t){return S(e)}function MU(e,t,r){let o=ni(r);return J(e,t,o)}function my(e,t,r){let[o,...i]=r;return A(o)?(()=>{let s=J(e,t,o);return ge(s)?my(s.inferred,t,i):j()})():S(e)}function wU(e,t,r){let o=He(r);return J(e,t,o)}function cy(e,t,r){let[o,...i]=r;return A(o)?(()=>{let s=J(e,t,o);return ge(s)?S(s.inferred):cy(e,t,i)})():j()}function B(e,t,r){return We(r)?kU(e,t):Ie(r)?MU(e,t,r.enum):Ee(r)?LU(e,r.name,t,r.extends):U(r)?my(e,t,r.allOf):Te(r)?wU(e,t,r.pattern):O(r)?cy(e,t,r.anyOf):it(r)?S(e):j()}function uy(e,t,r){return Ee(r)?B(e,t,r):We(r)?S(e):it(r)?S(e):kp(e)}function $U(e,t){let r=Yr(e),o=Yr(t);return r&&o||!r&&o?!0:!(r&&!o)}function ly(e,t,r,o){return X(o)?$U(t,o)?J(e,r,o.items):j():B(e,t,o)}function dy(e,t,r){return ze(r)?J(e,t,r.iteratorItems):B(e,wt(t),r)}function fy(e,t,r){return ct(r)?S(e):B(e,t,r)}function gy(e,t,r){return Xe(r)?S(e):B(e,t,r)}function DU(e,t,r,o,i){let s=Ee(o)?t:o,m=Ee(o)?o:t,u=xe(t),l=xe(o),g=J(e,s,m);return!u&&l?j():ge(g)?oi(g.inferred,r,i):j()}function GU(e,t,r,o){let[i,...s]=o;return A(i)?DU(e,t,r,i,s):xe(t)?S(e):j()}function vU(e,t,r){let[o,...i]=t;return A(o)?GU(e,o,i,r):S(e)}function oi(e,t,r){return vU(e,t,r)}function qa(e,t,r){return lt(r)?S(e):J(e,t,r)}function yy(e,t,r,o){return Re(o)?(()=>{let i=oi(e,t,o.parameters);return ge(i)?qa(i.inferred,r,o.instanceType):j()})():j()}function Ey(e,t,r){return J(e,tn(t),r)}function Iy(e,t,r,o){return Ce(o)?(()=>{let i=oi(e,t,o.parameters);return ge(i)?qa(i.inferred,r,o.returnType):j()})():j()}function Ty(e,t,r){return ke(r)?S(e):le(r)?S(e):B(e,t,r)}var ii="equal",jU="disjoint",ai="left-inside",si="right-inside";function pi(e,t){let r=[it(e)?L.ExtendsFalse():Ke({},e,t),it(e)?L.ExtendsTrue({}):Ke({},t,e)];return L.IsExtendsTrueLike(r[0])&&L.IsExtendsTrueLike(r[1])?ii:L.IsExtendsTrueLike(r[0])&&L.IsExtendsFalse(r[1])?ai:L.IsExtendsFalse(r[0])&&L.IsExtendsTrueLike(r[1])?si:jU}function FU(e){return O(e)?qt(e.anyOf):[e]}function qt(e){return e.reduce((t,r)=>[...t,...FU(r)],[])}function Mp(e){return e.reduceRight((r,o,i)=>({[i]:o,...r}),{})}function _y(e){let t=Mp(e.items);return N(t)}function BU(e,t){return Qr(e)?!!Qr(t):!1}function qU(e,t){return xe(e)?!!xe(t):!1}function HU(e,t){let r=BU(e,t),o=qU(e,t),i=_e([e,t]),s=Ea(Un(i));return r&&o?ot(nt(s)):r&&!o?ot(s):!r&&o?nt(s):s}function KU(e,t,r){return r in e?r in t?HU(e[r],t[r]):e[r]:r in t?t[r]:z()}function zU(e,t){return[...new Set([...a.Keys(t),...a.Keys(e)])].reduce((o,i)=>({...o,[i]:KU(e,t,i)}),{})}function hy(e){return M(e)?e.properties:H(e)?Mp(e.items):F()}function Oy(e,t){let r=hy(e),o=hy(t),i=zU(r,o);return N(i)}function Ay(e,t){let r=pi(e,t);return a.IsEqual(r,ai)?e:a.IsEqual(r,si)||a.IsEqual(r,ii)?t:z()}function Sy(e){return M(e)||H(e)}function by(e){return U(e)?_e(e.allOf):e}function VU(e,t){let r=by(e),o=by(t),i=Sy(r),s=Sy(o);return i&&s?Oy(xr(r),o):i&&!s?xr(r):!i&&s?o:Ay(xr(r),o)}function xy(e,t,r=[]){let[o,...i]=t;return a.IsUndefined(o)?r.length===0?[e]:r:xy(e,i,[...r,VU(e,o)])}function Ry(e,t,r=[]){let[o,...i]=e;return A(o)?Ry(i,t,[...r,...mi([o],t)]):r}function mi(e,t=[]){let[r,...o]=e;return A(r)?O(r)?mi(o,Ry(r.anyOf,t)):mi(o,xy(r,t)):t}function _e(e){let t=mi(e);return wp(t)}function Xt(e){return wp(e)}function xr(e){return U(e)?_e(e.allOf):O(e)?Xt(e.anyOf):e}function rn(e){return a.IsEqual(e.length,1)?e[0]:a.IsEqual(e.length,0)?z():G(e)}function YU(e,t){return t.filter(r=>pi(e,r)!==si)}function QU(e,t){let r=t.some(o=>{let i=pi(e,o);return a.IsEqual(i,ai)||a.IsEqual(i,ii)});return a.IsEqual(r,!1)}function WU(e,t){let r=xr(e);return We(r)?[r]:QU(r,t)?[...YU(r,t),r]:t}function $p(e,t=[]){let[r,...o]=e;return A(r)?M(r)?$p(o,[...t,r]):$p(o,WU(r,t)):t}function wp(e){let t=$p(e),r=qt(t);return r.length===0?z():r.length===1?r[0]:G(r)}function ZU(e,t,r,o){let i=_(e,t,r);return f.Update(xr(i),{},o)}function Cy(e,t,r,o){return ZU(e,t,r,o)}function Py(e,t,r){let o=_e(t);return J(e,o,r)}function Uy(e,t,r){return Ve(r)?J(e,t,r.iteratorItems):B(e,Dt(t),r)}function Ha(e,t,r){return t===r?S(e):j()}function XU(e,t,r){return V(r)?Ha(e,t,r.const):ct(r)?S(e):B(e,q(t),r)}function JU(e,t,r){return V(r)?Ha(e,t,r.const):Xe(r)?S(e):B(e,q(t),r)}function eN(e,t,r){return V(r)?Ha(e,t,r.const):le(r)?S(e):B(e,q(t),r)}function tN(e,t,r){return V(r)?Ha(e,t,r.const):Oe(r)?S(e):B(e,q(t),r)}function Ny(e,t,r){return a.IsBigInt(t.const)?XU(e,t.const,r):a.IsBoolean(t.const)?JU(e,t.const,r):a.IsNumber(t.const)?eN(e,t.const,r):a.IsString(t.const)?tN(e,t.const,r):F()}function Ly(e,t,r){return Ee(r)?B(e,t,r):S(e)}function ky(e,t,r){return Gt(r)?S(e):B(e,t,r)}function My(e,t,r){return le(r)?S(e):B(e,t,r)}function rN(e,t,r){return xe(t)?xe(r)?S(e):j():S(e)}function nN(e,t,r){return Ee(r)&&Wt(r.extends)?j():(()=>{let o=J(e,t,r);return ge(o)?rN(o.inferred,t,r):j()})()}function oN(e,t){return e.reduce((r,o)=>o in t?ge(t[o])?{...r,...t[o].inferred}:F():F(),{})}function iN(e,t,r){let o={};for(let m of a.Keys(r))o[m]=m in t?nN({},t[m],r[m]):xe(r[m])?Ee(r[m])?S(f.Assign(e,{[r[m].name]:r[m].extends})):S(e):j();let i=a.Values(o).every(m=>ge(m)),s=i?oN(a.Keys(o),o):{};return i?S(s):j()}function aN(e,t,r){let o=iN(e,t,r);return ge(o)?S(f.Assign(e,o.inferred)):j()}function sN(e,t,r){return aN(e,t,r)}function wy(e,t,r){return M(r)?sN(e,t,r.properties):B(e,N(t),r)}function $y(e,t,r){return Be(r)?J(e,t,r.item):B(e,jt(t),r)}function Dy(e,t,r){return Oe(r)?S(e):B(e,t,r)}function Gy(e,t,r){return vt(r)?S(e):B(e,t,r)}function vy(e,t,r){let o=He(t);return J(e,o,r)}function Dp(e,t){return f.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function ci(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"name")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"Inferrable")&&a.IsString(e.name)&&a.IsObject(e.type)}function Gp(e){return Ar(e)?Ee(e.items)?X(e.items.extends)?Dp(e.items.name,e.items.extends.items):it(e.items.extends)?Dp(e.items.name,e.items.extends):void 0:F():void 0}function Ka(e){return Ee(e)?Dp(e.name,e.extends):void 0}function vp(e,t,r=[]){let[o,...i]=e;return A(o)?(()=>{let s=J({},o,t);return ge(s)?vp(i,t,[...r,o]):void 0})():r}function jy(e,t,r,o){let i=vp(r,o);return a.IsArray(i)?S(f.Assign(e,{[t]:Me(i)})):j()}function za(e,t,r,o){let i=vp(r,o);return a.IsArray(i)?S(f.Assign(e,{[t]:G(i)})):j()}function pN(e){return[...e].reverse()}function jp(e,t){return t?pN(e):e}function mN(e){let t=e.length>0?e[0]:void 0,r=A(t)?Gp(t):void 0;return A(r)}function cN(e,t,r,o,i,s){let m=J(e,r,i);return ge(m)?Fy(m.inferred,t,o,s):j()}function uN(e,t,r,o,i){let s=Gp(o);return ci(s)?jy(e,s.name,jp(r,t),s.type):(()=>{let[m,...u]=r;return A(m)?cN(e,t,m,u,o,i):j()})()}function lN(e,t,r,o){let[i,...s]=o;return A(i)?uN(e,t,r,i,s):a.IsEqual(r.length,0)?S(e):j()}function Fy(e,t,r,o){return lN(e,t,r,o)}function dN(e,t,r){let o=Va(e,{callstack:[]},r),i=mN(o);return Fy(e,i,jp(t,i),jp(o,i))}function By(e,t,r){let o=Ka(r);return ci(o)?za(e,o.name,t,o.type):(()=>{let[i,...s]=t;return A(i)?(()=>{let m=J(e,i,r);return ge(m)?By(m.inferred,s,r):j()})():S(e)})()}function qy(e,t,r){let o=Va(e,{callstack:[]},t);return H(r)?dN(e,o,r.items):X(r)?By(e,o,r.items):B(e,Me(o),r)}function Hy(e,t,r){return lt(r)?S(e):Bt(r)?S(e):B(e,t,r)}function Ky(e,t,r){let[o,...i]=r;return A(o)?(()=>{let s=J(e,t,o);return ge(s)?S(s.inferred):Ky(e,t,i)})():j()}function Fp(e,t,r){let[o,...i]=t;return A(o)?(()=>{let s=Ky(e,o,r);return ge(s)?Fp(s.inferred,i,r):j()})():S(e)}function zy(e,t,r){let o=Ka(r);return ci(o)?za(e,o.name,t,o.type):O(r)?Fp(e,t,r.anyOf):Fp(e,t,[r])}function Vy(e,t,r){return Ee(r)?B(e,t,r):We(r)?S(e):it(r)?S(e):j()}function Yy(e,t,r){return lt(r)?S(e):B(e,t,r)}function J(e,t,r){return We(t)?uy(e,t,r):X(t)?ly(e,t,t.items,r):ze(t)?dy(e,t.iteratorItems,r):ct(t)?fy(e,t,r):Xe(t)?gy(e,t,r):Re(t)?yy(e,t.parameters,t.instanceType,r):Ie(t)?Ey(e,t,r):Ce(t)?Iy(e,t.parameters,t.returnType,r):ke(t)?Ty(e,t,r):U(t)?Py(e,t.allOf,r):Ve(t)?Uy(e,t.iteratorItems,r):V(t)?Ny(e,t,r):Wt(t)?Ly(e,t,r):Gt(t)?ky(e,t,r):le(t)?My(e,t,r):M(t)?wy(e,t.properties,r):Be(t)?$y(e,t.item,r):Oe(t)?Dy(e,t,r):vt(t)?Gy(e,t,r):Te(t)?vy(e,t.pattern,r):H(t)?qy(e,t.items,r):Bt(t)?Hy(e,t,r):O(t)?zy(e,t.anyOf,r):it(t)?Vy(e,t,r):lt(t)?Yy(e,t,r):j()}function Bn(e,t,r={}){return R("Interface",[e,t],r)}function Qn(e){return A(e)&&a.HasPropertyKey(e,"action")&&a.IsEqual(e.action,"Interface")}function Qy(e,t,r={}){return x({},Bn(e,t,r))}function fN(e,t,r){return e.includes(r)?!0:Rr([...e,r],t,t[r])}function Wy(e,t,r){let o=Ra(r);return nn(e,t,o)}function nn(e,t,r){let[o,...i]=r;return A(o)?Rr(e,t,o)?!0:nn(e,t,i):!1}function Rr(e,t,r){return ie(r)?fN(e,t,r.$ref):X(r)?Rr(e,t,r.items):ze(r)?Rr(e,t,r.iteratorItems):Re(r)?nn(e,t,[...r.parameters,r.instanceType]):Ce(r)?nn(e,t,[...r.parameters,r.returnType]):Qn(r)?Wy(e,t,r.parameters[1]):U(r)?nn(e,t,r.allOf):Ve(r)?Rr(e,t,r.iteratorItems):M(r)?Wy(e,t,r.properties):Be(r)?Rr(e,t,r.item):O(r)?nn(e,t,r.anyOf):H(r)?nn(e,t,r.items):de(r)?Rr(e,t,qe(r)):!1}function Ya(e,t,r){return Rr(e,t,r)}function gN(e,t){return t.reduce((r,o)=>o in e?Ya([o],e,e[o])?[...r,o]:r:F(),[])}function Zy(e){let t=Yl(e);return gN(e,t)}function yN(e,t,r){return r.includes(t)?r:t in e?Cr(e,e[t],[...r,t]):F()}function Xy(e,t,r){let o=Ra(t);return Wn(e,o,r)}function Wn(e,t,r){return t.reduce((o,i)=>Cr(e,i,o),r)}function Cr(e,t,r){return ie(t)?yN(e,t.$ref,r):X(t)?Cr(e,t.items,r):ze(t)?Cr(e,t.iteratorItems,r):Re(t)?Wn(e,[...t.parameters,t.instanceType],r):Ce(t)?Wn(e,[...t.parameters,t.returnType],r):Qn(t)?Xy(e,t.parameters[1],r):U(t)?Wn(e,t.allOf,r):Ve(t)?Cr(e,t.iteratorItems,r):M(t)?Xy(e,t.properties,r):Be(t)?Cr(e,t.item,r):O(t)?Wn(e,t.anyOf,r):H(t)?Wn(e,t.items,r):de(t)?Cr(e,qe(t),r):r}function Jy(e,t,r){return Cr(e,r,[t])}function EN(e){return Ln()}function IN(e){return a.Keys(e).reduce((t,r)=>({...t,[r]:Ht(e[r])}),{})}function ui(e){return e.reduce((t,r)=>[...t,Ht(r)],[])}function Ht(e){return ie(e)?EN(e.$ref):X(e)?Pt(Ht(e.items),Ta(e)):ze(e)?wt(Ht(e.iteratorItems)):Re(e)?Er(ui(e.parameters),Ht(e.instanceType)):Ce(e)?Ir(ui(e.parameters),Ht(e.returnType)):U(e)?Tt(ui(e.allOf)):Ve(e)?Dt(Ht(e.iteratorItems)):M(e)?N(IN(e.properties)):Be(e)?jt(Ht(e.item)):de(e)?Pa(vn(e),Ht(qe(e))):O(e)?G(ui(e.anyOf)):H(e)?Me(ui(e.items)):e}function TN(e,t){return t in e?Ht(e[t]):je()}function eE(e){return TN(e.$defs,e.$ref)}function _N(e,t,r){let o=dt(e,{callstack:[]},t),i=li({},{callstack:[]},r);return _e([...o,N(i)])}function hN(e,t){return a.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let s=e[i],m=Qn(s)?_N(e,s.parameters[0],s.parameters[1]):s;return{...o,[i]:m}},{})}function tE(e,t,r){let o=Jy(e,t,r),i=hN(e,o);return $t(i,t)}function rE(e,t){return t in e?ie(e[t])?rE(e,e[t].$ref):e[t]:z()}function Kt(e,t){return rE(e,t)}function nE(e){return ae(e)?eE(e):e}function Ke(e,t,r){let o=nE(t),i=nE(r);return J(e,o,i)}function ON(e,t,r){if(Ee(t)||Zn(t)||L.IsExtendsTrueLike(Ke({},t,r)))return;let o={parameter:e,extends:r,received:t};throw new Error("Generic argument does not satify constraint",{cause:o})}function oE(e,t,r,o,i){let s=_(e,t,i);return ON(r,s,o),f.Assign(e,{[r]:s})}function AN(e,t,r,o,i){let s=_(e,t,r.extends),m=_(e,t,r.equals),[u,...l]=i;return A(u)?Bp(oE(e,t,r.name,s,u),t,o,l):Bp(oE(e,t,r.name,s,m),t,o,[])}function Bp(e,t,r,o){let[i,...s]=r;return A(i)?AN(e,t,i,s,o):e}function iE(e,t,r,o){return Bp(e,t,r,o)}function SN(e){return a.IsGreaterThan(e.length,0)?e[0]:""}function aE(e,t,r,o){let i=dt(e,t,o);return La(r,i)}function bN(e,t,r,o){return aE(e,t,he(r),o)}function xN(e,t,r,o,i,s){let m=dt(e,t,s),u=iE(e,t,o,m),l=_(u,{callstack:[...t.callstack,r]},i);return _(e,t,l)}function Qa(e,t,r,o){let[i,s]=Sl(e,r,o);return Nn(s)?a.IsEqual(SN(t.callstack),i)?bN(e,t,i,o):xN(e,t,i,s.parameters,s.expression,o):aE(e,t,r,o)}function La(e,t){return f.Create({"~kind":"Call"},{target:e,arguments:t},{})}function sE(e,t){return Qa({},{callstack:[]},e,t)}function Zn(e){return h(e,"Call")}function pE(e){return Be(e)?pE(e.item):e}function RN(e,t,r,o){let i=_(e,t,r);return f.Update(pE(i),{},o)}function mE(e,t,r,o){return k(e,[r])?RN(e,t,r,o):ri(r,o)}function cE(e,t){return e(t)}function uE(e,t){return a.IsString(t)?q(cE(e,t)):q(t)}function lE(e,t){let r=He(t);return Jt(e,r)}function dE(e,t){let r=t.map(o=>Jt(e,o));return G(r)}function Jt(e,t){return V(t)?uE(e,t.const):Te(t)?lE(e,t.pattern):O(t)?dE(e,t.anyOf):t}function vo(e,t={}){return R("Capitalize",[e],t)}function fE(e,t={}){return x({},vo(e,t))}function jo(e,t={}){return R("Lowercase",[e],t)}function gE(e,t={}){return x({},jo(e,t))}function Fo(e,t={}){return R("Uncapitalize",[e],t)}function yE(e,t={}){return x({},Fo(e,t))}function Bo(e,t={}){return R("Uppercase",[e],t)}function EE(e,t={}){return x({},Bo(e,t))}var CN=e=>e[0].toUpperCase()+e.slice(1),PN=e=>e.toLowerCase(),UN=e=>e[0].toLowerCase()+e.slice(1),NN=e=>e.toUpperCase();function LN(e,t,r,o){let i=_(e,t,r);return f.Update(Jt(CN,i),{},o)}function IE(e,t,r,o){return k(e,[r])?LN(e,t,r,o):vo(r,o)}function kN(e,t,r,o){let i=_(e,t,r);return f.Update(Jt(PN,i),{},o)}function TE(e,t,r,o){return k(e,[r])?kN(e,t,r,o):jo(r,o)}function MN(e,t,r,o){let i=_(e,t,r);return f.Update(Jt(UN,i),{},o)}function _E(e,t,r,o){return k(e,[r])?MN(e,t,r,o):Fo(r,o)}function wN(e,t,r,o){let i=_(e,t,r);return f.Update(Jt(NN,i),{},o)}function hE(e,t,r,o){return k(e,[r])?wN(e,t,r,o):Bo(r,o)}function qo(e,t,r,o,i={}){return R("Conditional",[e,t,r,o],i)}function OE(e,t,r,o,i={}){return x({},qo(e,t,r,o,i))}function $N(e,t,r,o,i,s,m){let u=_(e,t,r),l=_(e,t,o),g=Ke(e,u,l);return f.Update(L.IsExtendsUnion(g)?G([_(g.inferred,t,i),_(e,t,s)]):L.IsExtendsTrue(g)?_(g.inferred,t,i):_(e,t,s),{},m)}function AE(e,t,r,o,i,s,m){return k(e,[r,o])?$N(e,t,r,o,i,s,m):qo(r,o,i,s,m)}function Ho(e,t={}){return R("ConstructorParameters",[e],t)}function SE(e,t={}){return x({},Ho(e,t))}function DN(e){return Re(e)?_({},{callstack:[]},Me(e.parameters)):z()}function GN(e,t,r,o){let i=_(e,t,r);return f.Update(DN(i),{},o)}function bE(e,t,r,o){return k(e,[r])?GN(e,t,r,o):Ho(r,o)}function Ko(e,t,r={}){return R("Exclude",[e,t],r)}function xE(e,t,r={}){return x({},Ko(e,t,r))}function RE(e,t){return e.reduce((r,o)=>[...r,...CE(o,t)],[])}function CE(e,t){let r=Ke({},e,t);return L.IsExtendsTrueLike(r)?[]:[e]}function vN(e,t){let r=Ie(e)?RE(Ut(e.enum),t):O(e)?RE(qt(e.anyOf),t):CE(e,t);return Xt(r)}function jN(e,t,r,o,i){let s=_(e,t,r),m=_(e,t,o);return f.Update(vN(s,m),{},i)}function Wa(e,t,r,o,i){return k(e,[r,o])?jN(e,t,r,o,i):Ko(r,o,i)}function zo(e,t,r={}){return R("Extract",[e,t],r)}function PE(e,t,r={}){return x({},zo(e,t,r))}function UE(e,t){return e.reduce((r,o)=>[...r,...NE(o,t)],[])}function NE(e,t){let r=Ke({},e,t);return L.IsExtendsTrueLike(r)?[e]:[]}function FN(e,t){let r=Ie(e)?UE(Ut(e.enum),t):O(e)?UE(qt(e.anyOf),t):NE(e,t);return Xt(r)}function BN(e,t,r,o,i){let s=_(e,t,r),m=_(e,t,o);return f.Update(FN(s,m),{},i)}function LE(e,t,r,o,i){return k(e,[r,o])?BN(e,t,r,o,i):zo(r,o,i)}var qN=new RegExp("^(?:0|[1-9][0-9]*)$");function Xn(e){let t=`${e}`;return qN.test(t)?parseInt(t):e}function HN(e){return q(Xn(e))}function kE(e){return e.map(t=>ME(t))}function ME(e){return U(e)?Tt(kE(e.allOf)):O(e)?G(kE(e.anyOf)):V(e)?HN(e.const):e}function wE(e,t){let r=ME(t),o=Ke({},r,_t());return L.IsExtendsTrueLike(o)?e:z()}function $E(e,t){let r=Kt(e,t);return zt(r)}function Za(e){return e.reduce((t,r)=>[...t,...zt(r)],[])}function DE(e){let t=Ut(e);return Za(t)}function GE(e){let t=_e(e);return zt(t)}function vE(e){return[`${e}`]}function jE(e){let t=He(e);return zt(t)}function zt(e){return ae(e)?$E(e.$defs,e.$ref):Ie(e)?DE(e.enum):U(e)?GE(e.allOf):V(e)?vE(e.const):Te(e)?jE(e.pattern):O(e)?Za(e.anyOf):[]}function Jn(e){return zt(e)}function KN(e,t){return t in e?[e[t]]:[]}function zN(e,t){return t.reduce((r,o)=>[...r,...KN(e,o)],[])}function FE(e,t){let r=Jn(t),o=zN(e,r);return Xt(o)}function VN(e){return q(Xn(e))}function BE(e){return e.map(t=>qp(t))}function qp(e){return U(e)?Tt(BE(e.allOf)):O(e)?G(BE(e.anyOf)):V(e)?VN(e.const):e}function YN(e,t){return e.reduceRight((r,o,i)=>{let s=Ke({},q(i),t);return L.IsExtendsTrueLike(s)?[o,...r]:r},[])}function QN(e,t){let r=qp(t),o=YN(e,r);return rn(o)}function WN(e){return rn(e)}function qE(e,t){return le(t)||ke(t)?WN(e):QN(e,t)}function ZN(e){return e.reduce((t,r)=>ba(r)?[...t,q(r)]:t,[])}function eo(e){let t=ZN(e);return G(t)}function qn(e,t,r={}){return R("Index",[e,t],r)}function HE(e,t,r={}){let o=a.IsArray(t)?eo(t):t;return x({},qn(e,o,r))}function KE(e,t){let r=Kt(e,t);return Nt(r)}function XN(e,t){let r=a.Keys(e).filter(E=>!a.HasPropertyKey(t,E)),o=a.Keys(t).filter(E=>!a.HasPropertyKey(e,E)),i=a.Keys(e).filter(E=>a.HasPropertyKey(t,E)),s=r.reduce((E,I)=>({...E,[I]:e[I]}),{}),m=o.reduce((E,I)=>({...E,[I]:t[I]}),{}),u=i.reduce((E,I)=>({...E,[I]:_e([e[I],t[I]])}),{}),l=f.Assign(s,m);return f.Assign(l,u)}function zE(e){return e.reduce((t,r)=>XN(t,Nt(r)),{})}function VE(e){let t=_y(Me(e));return Nt(t)}function JN(e,t){return a.Keys(e).filter(i=>i in t).reduce((i,s)=>({...i,[s]:Xt([e[s],t[s]])}),{})}function YE(e,t){let[r,...o]=e;return A(r)?YE(o,JN(t,Nt(r))):t}function QE(e){let[t,...r]=e;return A(t)?YE(r,Nt(t)):F()}function Nt(e){return ae(e)?KE(e.$defs,e.$ref):U(e)?zE(e.allOf):O(e)?QE(e.anyOf):H(e)?VE(e.items):M(e)?e.properties:{}}function to(e){let t=Nt(e);return N(t)}function eL(e){return ae(e)||U(e)||O(e)?to(e):e}function tL(e,t){let r=eL(e);return X(r)?wE(r.items,t):M(r)?FE(r.properties,t):H(r)?qE(r.items,t):z()}function rL(e,t,r,o,i){let s=_(e,t,r),m=_(e,t,o);return f.Update(tL(s,m),{},i)}function WE(e,t,r,o,i){return k(e,[r,o])?rL(e,t,r,o,i):qn(r,o,i)}function Vo(e,t={}){return R("InstanceType",[e],t)}function ZE(e,t={}){return x({},Vo(e,t))}function nL(e){return Re(e)?e.instanceType:z()}function oL(e,t,r,o){let i=_(e,t,r);return f.Update(nL(i),{},o)}function XE(e,t,r,o={}){return k(e,[r])?oL(e,t,r,o):Vo(r,o)}function iL(e,t,r,o,i){let s=dt(e,{callstack:[]},r),m=li(e,{callstack:[]},o),u=_e([...s,N(m)]);return f.Update(u,{},i)}function JE(e,t,r,o,i){return k(e,r)?iL(e,t,r,o,i):Bn(r,o,i)}function Hn(e,t={}){return R("KeyOf",[e],t)}function eI(e,t={}){return x({},Hn(e,t))}function tI(){return G([_t(),at(),$n()])}function rI(e){return _t()}function aL(e){return e.reduce((r,o)=>ba(o)?[...r,q(Xn(o))]:F(),[])}function nI(e){let t=a.Keys(e),r=aL(t);return rn(r)}function oI(e){return vn(e)}function iI(e){let t=e.map((r,o)=>q(o));return rn(t)}function sL(e){return ae(e)||U(e)||O(e)?to(e):e}function pL(e){let t=sL(e);return We(t)?tI():X(t)?rI(t.items):M(t)?nI(t.properties):de(t)?oI(t):H(t)?iI(t.items):z()}function mL(e,t,r,o){let i=_(e,t,r);return f.Update(pL(i),{},o)}function aI(e,t,r,o){return k(e,[r])?mL(e,t,r,o):Hn(r,o)}function cL(e){let t=He(e);return Hp(t)}function sI(e){return e.reduce((t,r)=>[...t,...Hp(r)],[])}function Hp(e){return Ie(e)?sI(Ut(e.enum)):wn(e)||Mn(e)?[e]:Te(e)?cL(e.pattern):O(e)?sI(e.anyOf):[]}function pI(e){return Hp(e)}function Fn(e,t,r,o,i={}){return R("Mapped",[e,t,r,o],i)}function mI(e,t,r,o,i={}){return x({},Fn(e,t,r,o,i))}function uL(e,t,r,o,i){let s=f.Assign(e,{[r.name]:o}),m=_(s,t,i);return Te(m)?He(m.pattern):m}function lL(e,t,r,o,i){let s=f.Assign(e,{[r.name]:o});return _(s,t,i)}function dL(e,t,r,o,i,s){let m=lL(e,t,r,o,s),u=uL(e,t,r,o,i);return wn(u)||Mn(u)?{[u.const]:m}:{}}function fL(e,t,r,o,i,s){return o.reduce((m,u)=>({...m,...dL(e,t,r,u,i,s)}),{})}function gL(e,t,r,o,i,s){let m=pI(o),u=fL(e,t,r,m,i,s);return N(u)}function yL(e,t,r,o,i,s,m){let u=_(e,t,o);return f.Update(gL(e,t,r,u,i,s),{},m)}function cI(e,t,r,o,i,s,m){return k(e,[o])?yL(e,t,r,o,i,s,m):Fn(r,o,i,s,m)}function EL(e,t){return a.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>({...o,[i]:tE(e,i,e[i])}),{})}function IL(e,t){return a.Keys(e).filter(o=>!t.includes(o)).reduce((o,i)=>({...o,[i]:_(e,{callstack:[]},e[i])}),{})}function TL(e,t){let r=Zy(e),o=EL(e,r),i=IL(e,r),s={...o,...i};return f.Update(s,{},t)}function uI(e,t,r,o){let i=f.Assign(e,r);return TL(i,o)}function Yo(e,t={}){return R("NonNullable",[e],t)}function lI(e,t={}){return x({},Yo(e,t))}function _L(e){let t=G([Or(),jn()]);return Wa({},{callstack:[]},e,t,{})}function hL(e,t,r,o){let i=_(e,t,r);return f.Update(_L(i),{},o)}function dI(e,t,r,o){return k(e,[r])?hL(e,t,r,o):Yo(r,o)}function Xa(e){let t=to(e);return M(t)?t.properties:F()}function Qo(e,t,r={}){return R("Omit",[e,t],r)}function fI(e,t,r={}){let o=a.IsArray(t)?eo(t):t;return x({},Qo(e,o,r))}function OL(e,t){return a.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function AL(e,t){let r=Xa(e),o=Jn(t),i=OL(r,o);return N(i)}function SL(e,t,r,o,i){let s=_(e,t,r),m=_(e,t,o);return f.Update(AL(s,m),{},i)}function gI(e,t,r,o,i){return k(e,[r,o])?SL(e,t,r,o,i):Qo(r,o,i)}function Kn(e,t){return R("Options",[e,t],{})}function Ja(e,t){return x({},Kn(e,t))}function bL(e,t,r,o){let i=_(e,t,r);return f.Update(i,{},o)}function yI(e,t,r,o){return k(e,[r])?bL(e,t,r,o):Kn(r,o)}function Wo(e,t={}){return R("Parameters",[e],t)}function EI(e,t={}){return x({},Wo(e,t))}function xL(e){return Ce(e)?_({},{callstack:[]},Me(e.parameters)):z()}function RL(e,t,r,o){let i=_(e,t,r);return f.Update(xL(i),{},o)}function II(e,t,r,o){return k(e,[r])?RL(e,t,r,o):Wo(r,o)}function Zo(e,t={}){return R("Partial",[e],t)}function TI(e,t={}){return x({},Zo(e,t))}function _I(e,t){let r=Kt(e,t),o=Pr(r);return $t(f.Assign(e,{[t]:o}),t)}function hI(e){let t=e.map(r=>Pr(r));return _e(t)}function OI(e){let t=e.map(r=>Pr(r));return G(t)}function AI(e){let t=a.Keys(e).reduce((o,i)=>({...o,[i]:ya(e[i])}),{});return N(t)}function Pr(e){return ae(e)?_I(e.$defs,e.$ref):U(e)?hI(e.allOf):O(e)?OI(e.anyOf):M(e)?AI(e.properties):N({})}function CL(e,t,r,o){let i=_(e,t,r);return f.Update(Pr(i),{},o)}function SI(e,t,r,o){return k(e,[r])?CL(e,t,r,o):Zo(r,o)}function Xo(e,t,r={}){return R("Pick",[e,t],r)}function bI(e,t,r={}){let o=a.IsArray(t)?eo(t):t;return x({},Xo(e,o,r))}function PL(e,t){return a.Keys(e).reduce((o,i)=>t.includes(i)?f.Assign(o,{[i]:e[i]}):o,{})}function UL(e,t){let r=Xa(e),o=Jn(t),i=PL(r,o);return N(i)}function NL(e,t,r,o,i){let s=_(e,t,r),m=_(e,t,o);return f.Update(UL(s,m),{},i)}function xI(e,t,r,o,i){return k(e,[r,o])?NL(e,t,r,o,i):Xo(r,o,i)}function Jo(e,t={}){return R("ReadonlyType",[e],t)}function RI(e,t={}){return x({},Jo(e,t))}function CI(e){return yr(Pt(e))}function PI(e,t){let r=Kt(e,t),o=Ur(r);return $t(f.Assign(e,{[t]:o}),t)}function UI(e){let t=e.map(r=>Ur(r));return _e(t)}function NI(e){let t=a.Keys(e).reduce((o,i)=>({...o,[i]:Ia(e[i])}),{});return N(t)}function LI(e){return yr(Me(e))}function kI(e){let t=e.map(r=>Ur(r));return G(t)}function Ur(e){return X(e)?CI(e.items):ae(e)?PI(e.$defs,e.$ref):U(e)?UI(e.allOf):M(e)?NI(e.properties):H(e)?LI(e.items):O(e)?kI(e.anyOf):e}function LL(e,t,r,o){let i=_(e,t,r);return f.Update(Ur(i),{},o)}function MI(e,t,r,o){return k(e,[r])?LL(e,t,r,o):Jo(r,o)}function wI(e){return st(Ft,e)}function $I(e){return N({true:e,false:e})}function DI(e,t){let r=ni(e);return Nr(r,t)}function GI(e,t){return st(Dn,t)}function vI(e,t){let r=_e(e);return Nr(r,t)}function jI(e,t){return a.IsString(e)||a.IsNumber(e)?N({[e]:t}):a.IsEqual(e,!1)?N({false:t}):a.IsEqual(e,!0)?N({true:t}):N({})}function FI(e,t){return st(Gn,t)}function BI(e,t){return a.HasPropertyKey(e,"pattern")&&(a.IsString(e.pattern)||e.pattern instanceof RegExp)?st(e.pattern.toString(),t):st(Ft,t)}function qI(e,t){let r=Fa(e);return Ba(r)?Nr(He(e),t):st(e,t)}function kL(e){return e.some(t=>Oe(t)||le(t)||ke(t))}function ML(e,t){return a.IsEqual(kL(e),!0)?st(Ft,t):void 0}function wL(e,t){return e.reduce((r,o)=>V(o)&&(a.IsString(o.const)||a.IsNumber(o.const))?{...r,[o.const]:t}:r,{})}function $L(e,t){let r=wL(e,t);return N(r)}function HI(e,t){let r=qt(e),o=ML(r,t);return A(o)?o:$L(r,t)}function Nr(e,t){return We(e)?wI(t):Xe(e)?$I(t):Ie(e)?DI(e.enum,t):ke(e)?GI(e,t):U(e)?vI(e.allOf,t):V(e)?jI(e.const,t):le(e)?FI(e,t):O(e)?HI(e.anyOf,t):Oe(e)?BI(e,t):Te(e)?qI(e.pattern,t):N({})}function DL(e,t,r,o,i){let s=_(e,t,r),m=_(e,t,o);return f.Update(Nr(s,m),{},i)}function KI(e,t,r,o,i){return k(e,[r])?DL(e,t,r,o,i):Do(r,o,i)}function zI(e,t,r){return r in e?Ya([r],e,e[r])?he(r):_(e,t,e[r]):he(r)}function VI(e,t){let r=Kt(e,t),o=Lr(r);return $t(f.Assign(e,{[t]:o}),t)}function YI(e){let t=e.map(r=>Lr(r));return _e(t)}function QI(e){let t=e.map(r=>Lr(r));return G(t)}function WI(e){let t=a.Keys(e).reduce((o,i)=>({...o,[i]:Un(e[i])}),{});return N(t)}function Lr(e){return ae(e)?VI(e.$defs,e.$ref):U(e)?YI(e.allOf):O(e)?QI(e.anyOf):M(e)?WI(e.properties):N({})}function ei(e,t={}){return R("Required",[e],t)}function ZI(e,t={}){return x({},ei(e,t))}function GL(e,t,r,o){let i=_(e,t,r);return f.Update(Lr(i),{},o)}function XI(e,t,r,o){return k(e,[r])?GL(e,t,r,o):ei(r,o)}function ti(e,t={}){return R("ReturnType",[e],t)}function JI(e,t={}){return x({},ti(e,t))}function vL(e){return Ce(e)?e.returnType:z()}function jL(e,t,r,o){let i=_(e,t,r);return f.Update(vL(i),{},o)}function eT(e,t,r,o){return k(e,[r])?jL(e,t,r,o):ti(r,o)}function tT(e){return f.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function FL(e){return e.join("|")}function BL(e){return e.slice(1,e.length-1)}function qL(e,t,r){return kr(t,`${r}${e}`)}function HL(e,t){return kr(e,`${t}${Bl}`)}function KL(e,t){return kr(e,`${t}${Sa}`)}function zL(e,t){return kr(e,`${t}${xa}`)}function VL(e,t){return zp(G([q("false"),q("true")]),e,t)}function YL(e,t){return kr(e,`${t}${Ca}`)}function QL(e,t,r){return kr(t,`${r}${BL(e)}`)}function WL(e,t,r,o=[]){let i=Ut(e);return Kp(i,t,r)}function Kp(e,t,r,o=[]){let[i,...s]=e;return A(i)?Kp(s,t,r,[...o,zp(i,[],"")]):kr(t,`${r}(${FL(o)})`)}function zp(e,t,r){return Ie(e)?WL(e.enum,t,r):ke(e)?KL(t,r):V(e)?qL(e.const,t,r):ct(e)?HL(t,r):Xe(e)?VL(t,r):le(e)?zL(t,r):Oe(e)?YL(t,r):Te(e)?QL(e.pattern,t,r):O(e)?Kp(e.anyOf,t,r):Ol}function kr(e,t){let[r,...o]=e;return A(r)?zp(r,o,t):t}function ZL(e){return`^${kr(e,"")}$`}function rT(e){let t=ZL(e);return tT(t)}function XL(e,t,r,o){let i=dt(e,t,r);return f.Update(rT(i),{},o)}function nT(e,t,r,o){return k(e,r)?XL(e,t,r,o):Go(r,o)}function JL(e){return Ar(e)?H(e.items)?Vp(e.items.items):Ee(e.items)?[e]:ie(e.items)?[e]:[z()]:[e]}function Vp(e){return e.reduce((r,o)=>[...r,...JL(o)],[])}function ek(e,t){return t in e}function tk(e,t){return U(t)?k(e,t.allOf):O(t)?k(e,t.anyOf):ie(t)?ek(e,t.$ref):!0}function k(e,t){let[r,...o]=t;return A(r)?tk(e,r)?k(e,o):!1:!0}function di(e,t,r){return yl(e)?di(e.type,"remove",r):ll(e)?di(e.type,t,"remove"):fl(e)?di(e.type,"add",r):cl(e)?di(e.type,t,"add"):[e,t,r]}function rk(e,t){return a.IsEqual(e,"remove")?Ea(t):a.IsEqual(e,"add")?ot(t):t}function nk(e,t){return a.IsEqual(e,"remove")?Un(t):a.IsEqual(e,"add")?nt(t):t}function li(e,t,r){return a.Keys(r).reduce((o,i)=>({...o,[i]:_(e,t,r[i])}),{})}function Va(e,t,r){let o=dt(e,t,r);return Vp(o)}function dt(e,t,r){return r.map(o=>_(e,t,o))}function ok(e,t,r,o,i){return a.IsEqual(r,"Awaited")?mE(e,t,o[0],i):a.IsEqual(r,"Capitalize")?IE(e,t,o[0],i):a.IsEqual(r,"Conditional")?AE(e,t,o[0],o[1],o[2],o[3],i):a.IsEqual(r,"ConstructorParameters")?bE(e,t,o[0],i):a.IsEqual(r,"Evaluate")?Cy(e,t,o[0],i):a.IsEqual(r,"Exclude")?Wa(e,t,o[0],o[1],i):a.IsEqual(r,"Extract")?LE(e,t,o[0],o[1],i):a.IsEqual(r,"Index")?WE(e,t,o[0],o[1],i):a.IsEqual(r,"InstanceType")?XE(e,t,o[0],i):a.IsEqual(r,"Interface")?JE(e,t,o[0],o[1],i):a.IsEqual(r,"KeyOf")?aI(e,t,o[0],i):a.IsEqual(r,"Lowercase")?TE(e,t,o[0],i):a.IsEqual(r,"Mapped")?cI(e,t,o[0],o[1],o[2],o[3],i):a.IsEqual(r,"Module")?uI(e,t,o[0],i):a.IsEqual(r,"NonNullable")?dI(e,t,o[0],i):a.IsEqual(r,"Pick")?xI(e,t,o[0],o[1],i):a.IsEqual(r,"Options")?yI(e,t,o[0],o[1]):a.IsEqual(r,"Parameters")?II(e,t,o[0],i):a.IsEqual(r,"Partial")?SI(e,t,o[0],i):a.IsEqual(r,"Omit")?gI(e,t,o[0],o[1],i):a.IsEqual(r,"ReadonlyType")?MI(e,t,o[0],i):a.IsEqual(r,"Record")?KI(e,t,o[0],o[1],i):a.IsEqual(r,"Required")?XI(e,t,o[0],i):a.IsEqual(r,"ReturnType")?eT(e,t,o[0],i):a.IsEqual(r,"TemplateLiteral")?nT(e,t,o[0],i):a.IsEqual(r,"Uncapitalize")?_E(e,t,o[0],i):a.IsEqual(r,"Uppercase")?hE(e,t,o[0],i):R(r,o,i)}function _(e,t,r){let o=Yr(r),i=di(r,Qr(r)?"add":"none",xe(r)?"add":"none"),s=It(i[0])?i[0].Clone():i[0],m=ie(s)?zI(e,t,s.$ref):X(s)?Pt(_(e,t,s.items),Ta(s)):ze(s)?wt(_(e,t,s.iteratorItems),Il(s)):Zn(s)?Qa(e,t,s.target,s.arguments):Re(s)?Er(dt(e,t,s.parameters),_(e,t,s.instanceType),_l(s)):El(s)?ok(e,t,s.action,s.parameters,s.options):Ce(s)?Ir(dt(e,t,s.parameters),_(e,t,s.returnType),hl(s)):U(s)?Tt(dt(e,t,s.allOf),Cl(s)):Ve(s)?Dt(_(e,t,s.iteratorItems),Hl(s)):M(s)?N(li(e,t,s.properties),Ql(s)):Be(s)?jt(_(e,t,s.item),Zl(s)):de(s)?Xl(ut(s),_(e,t,qe(s))):Ar(s)?Jr(_(e,t,s.items)):H(s)?Me(Va(e,t,s.items),ed(s)):O(s)?G(dt(e,t,s.anyOf),td(s)):s,u=o?yr(m):m;return rk(i[1],nk(i[2],u))}function x(e,t){return _(e,{callstack:[]},t)}function ri(e,t={}){return R("Awaited",[e],t)}function oT(e,t={}){return x({},ri(e,t))}function Tp(e,t={}){return R("Evaluate",[e],t)}function Lt(e,t={}){return x({},Tp(e,t))}function _p(e,t={}){return R("Module",[e],t)}function iT(e,t={}){return x({},_p(e,t))}function aT(...e){let[t,r,o]=te.Match(e,{2:(m,u)=>a.IsString(m)?[{},m,u]:[m,u,{}],3:(m,u,l)=>[m,u,l],1:m=>[{},m,{}]}),i=Zg(r),s=a.IsArray(i)&&a.IsEqual(i.length,2)?_(t,{callstack:[]},i[0]):z();return f.Update(s,{},o)}var n={};Ot(n,{Any:()=>Ln,Array:()=>Pt,AsyncIterator:()=>wt,Awaited:()=>oT,Base:()=>_a,BigInt:()=>wo,Boolean:()=>Aa,Call:()=>sE,Capitalize:()=>fE,Codec:()=>ha,Conditional:()=>OE,Constructor:()=>Er,ConstructorParameters:()=>SE,Cyclic:()=>$t,Decode:()=>vl,DecodeBuilder:()=>Mo,Encode:()=>jl,EncodeBuilder:()=>ko,Enum:()=>Rl,Evaluate:()=>Lt,Exclude:()=>xE,Extends:()=>Ke,ExtendsResult:()=>L,Extract:()=>PE,Function:()=>Ir,Generic:()=>Tr,Identifier:()=>$o,Immutable:()=>yr,Index:()=>HE,Infer:()=>Lo,InstanceType:()=>ZE,Instantiate:()=>x,Integer:()=>Zr,Interface:()=>Qy,Intersect:()=>Tt,IsAny:()=>We,IsArray:()=>X,IsAsyncIterator:()=>ze,IsBase:()=>It,IsBigInt:()=>ct,IsBoolean:()=>Xe,IsCall:()=>Zn,IsCodec:()=>Wr,IsConstructor:()=>Re,IsCyclic:()=>ae,IsEnum:()=>Ie,IsFunction:()=>Ce,IsGeneric:()=>Nn,IsIdentifier:()=>ql,IsImmutable:()=>Yr,IsInfer:()=>Ee,IsInteger:()=>ke,IsIntersect:()=>U,IsIterator:()=>Ve,IsKind:()=>h,IsLiteral:()=>V,IsNever:()=>Wt,IsNull:()=>Gt,IsNumber:()=>le,IsObject:()=>M,IsOptional:()=>xe,IsParameter:()=>Wl,IsPromise:()=>Be,IsReadonly:()=>Qr,IsRecord:()=>de,IsRef:()=>ie,IsRefine:()=>Oa,IsRest:()=>Ar,IsSchema:()=>A,IsString:()=>Oe,IsSymbol:()=>vt,IsTemplateLiteral:()=>Te,IsThis:()=>Jl,IsTuple:()=>H,IsUndefined:()=>Bt,IsUnion:()=>O,IsUnknown:()=>it,IsUnsafe:()=>nd,IsVoid:()=>lt,Iterator:()=>Dt,KeyOf:()=>eI,Literal:()=>q,Lowercase:()=>gE,Mapped:()=>mI,Module:()=>iT,Never:()=>z,NonNullable:()=>lI,Null:()=>Or,Number:()=>_t,Object:()=>N,Omit:()=>fI,Optional:()=>ya,Options:()=>Ja,Parameter:()=>Xr,Parameters:()=>EI,Partial:()=>TI,Pick:()=>bI,Promise:()=>jt,Readonly:()=>Ia,ReadonlyType:()=>RI,Record:()=>Pa,RecordKey:()=>vn,RecordKeyAsPattern:()=>ut,RecordValue:()=>qe,Ref:()=>he,Refine:()=>Fl,Required:()=>ZI,Rest:()=>Jr,ReturnType:()=>JI,Script:()=>aT,String:()=>at,Symbol:()=>$n,TemplateLiteral:()=>ey,This:()=>Ua,Tuple:()=>Me,Uncapitalize:()=>yE,Undefined:()=>jn,Union:()=>G,Unknown:()=>je,Unsafe:()=>rd,Uppercase:()=>EE,Void:()=>Na});var Yp=["CLUSTER_DB_QUERY_INVALID_CONNECTION_PARAMS","CLUSTER_DB_QUERY_INVALID_CREDENTIALS","CLUSTER_DB_QUERY_PERMISSION_DENIED","CLUSTER_DB_QUERY_QUERY_SYNTAX_ERROR","CLUSTER_DB_QUERY_DATABASE_UNREACHABLE","CLUSTER_DB_QUERY_CONNECTION_FAILED","CLUSTER_DB_QUERY_QUERY_EXECUTION_FAILED","CLUSTER_DB_QUERY_QUERY_TIMEOUT"],gme=n.Enum(Yp),ik=["CLUSTER_AGGREGATION_STRUCTURE"],yme=n.Object({code:n.Enum(Yp),message:n.String()}),sT=[...Yp,...ik,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","ORG_NOT_FOUND_AUTHENTICATION_ERROR","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],pT=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var ak=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],sk=[...sT,...pT,...ak],Eme=n.Object({code:n.Optional(n.Enum(sk,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),Ime=n.Object({code:n.Optional(n.Enum(sT,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),Tme=n.Object({code:n.Optional(n.Enum(pT,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),_me=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),hme=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});var mT="lowercase-email",Qp="iana-timezone",Wp="simple-time",Zp="simple-date-time";var pk=(e,t)=>RegExp(`^${e.source}(${t.source}${e.source})*$`),mk=/[a-zA-Z0-9-_]+/,ck=/\./,Ame=pk(mk,ck);var cT="lowercase-domain";var es="kebab-case";var uT="camel-case";var uk=new Set;function b(e,t,r={}){let o=t.map(i=>{let s=i;return s.$id?(uk.add(i),n.Ref(s.$id)):i});return n.Unsafe({...r,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}var Ue={limit:n.Optional(n.Integer({minimum:1,maximum:1e3,description:"The maximum number of items to return"})),offset:n.Optional(n.Integer({minimum:0,description:"The offset of the first item to return"}))},lk=n.Object({totalCount:n.Integer({description:"The total number of items matching the query"}),pageCount:n.Integer({description:"The total number of pages available"})}),Cme=n.Object({pagination:lk},{$id:"ResponseMetadata"});function T(e={}){return n.Unsafe({...e,type:"string"})}function c({allowEmpty:e=!0,type:t="short",description:r}={}){let o=e?0:1,i=r===void 0?{}:{description:r};switch(t){case"camel-case":return n.String({format:uT,minLength:o,maxLength:250,...i});case"kebab-case":return n.String({format:es,minLength:o,maxLength:250,...i});case"email":return n.String({format:mT,minLength:o,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...i});case"lowercase-domain":return n.String({format:cT,minLength:o,maxLength:250,...i});case"tsuga-query":return n.String({format:"tsuga-query",minLength:o,maxLength:1e4,...i});case"tags-query":return n.String({format:"tags-query",minLength:o,maxLength:1e4,errorMessage:{format:"Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported. The query you provided is invalid: ${0}"},...i});case"date-time":return n.String({format:"date-time",...i});case"uri":return n.String({format:"uri",...i});case"user-password":return n.String({format:"user-password",minLength:12,maxLength:250,...i});case"long":return n.String({minLength:o,maxLength:5e4,...i});case"short":return n.String({minLength:o,maxLength:250,...i});case"tsuga-formula":return n.String({format:"tsuga-formula",minLength:o,maxLength:250,errorMessage:{format:"Must be a simple mathematical formula, and all variables in it should refer to queries (q1, q2, etc.). The formula you provided is invalid: ${0}"},...i});case"time":return n.String({format:"time",...i});case"readonly-sql-query":return n.String({format:"readonly-sql-query",minLength:o,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...i});default:Rt(t)}}function d({body:e,description:t,method:r,operationId:o,params:i,tags:s,query:m,paginated:u,response:l,url:g}){return i?{buildUrl:I=>g.replace(/:[a-zA-Z_]+/g,P=>I[P.slice(1)]),method:r,params:i,response:l,templateUrl:g,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...m===void 0?{}:{query:m},...u===void 0?{}:{paginated:u},...s===void 0?{}:{tags:s}}:{method:r,response:l,url:g,templateUrl:g,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...m===void 0?{}:{query:m},...u===void 0?{}:{paginated:u},...s===void 0?{}:{tags:s}}}function lT(e,t){if(!t||typeof t!="object")return e;let r=new URLSearchParams;return Object.entries(t).forEach(([o,i])=>{Array.isArray(i)?i.length>0&&i.forEach(s=>{s!==void 0&&(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&r.append(o,String(s))}):(typeof i=="boolean"||typeof i=="string"||typeof i=="number")&&r.append(o,String(i))}),`${e}?${r.toString()}`}var dk="x-tsuga-session-id",Xp="x-tsuga-source",Jp="x-tsuga-source-version",em="x-tsuga-source-commit",tm="x-tsuga-source-date",fk="x-request-id",Gme={[dk]:"Session identifier for request correlation",[Xp]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[Jp]:"SDK version",[em]:"SDK commit hash",[tm]:"SDK commit date",[fk]:"Unique identifier for this API request, useful for debugging and support"};var on=class e extends Error{constructor(r,o,i,s){super(r);this.statusCode=o;this.code=i;this.requestId=s;this.name="CliError"}static fromErrorResponse(r,o){return new e(r.message,r.statusCode,r.code,o)}};function dT(e){if(e instanceof on){let t=[`Error: ${e.message}`];return e.code&&t.push(`Code: ${e.code}`),e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),t.join(`
34
- `)}return e instanceof Error?`Error: ${e.message}`:String(e)}function fT(e,t,r){return async function(i,s={}){let{body:m,params:u,query:l}=s,g;if(i.url!==void 0)g=i.url;else if(i.buildUrl){if(!u)throw new on("Internal error: params required for this endpoint");g=i.buildUrl(u)}else throw new on("Internal error: endpoint has neither url nor buildUrl");let E=r===void 0?l:{clusterId:r,...l},I=lT(`${e}${g}`,E),P={Accept:"application/json",Authorization:`Bearer ${t}`,[Xp]:"cli",[Jp]:"1.0.11",[em]:"925979b",[tm]:"2026-05-25T13:28:42.878Z"};m&&(P["Content-Type"]="application/json");let ve=await(await fetch(I,{method:i.method,headers:P,body:m?JSON.stringify(m):null})).json();if(ve.error)throw on.fromErrorResponse(ve.error,ve.requestId);return ve.data}}var v=n.Object({success:n.Literal(!0,{description:"Indicates the resource was deleted successfully"})},{$id:"DeleteResponse",example:{success:!0}});var gk=["asset-change","cluster-integration-config","explorer-saved-view","crawler-integration-config","inventory","saml-config","sensitive-data-scanner-rule","service","team-remap-config","user-data","user-self","monitor-alert","monitor-debugging","retention-policy","org","allowed-domains","custom-usage-tag"],yk=["ingestion-api-key","operation-api-key","audit-log","dashboard","dashboard-report","inventory-settings","log-route","monitor","notification-integration","notification-rule","notification-silence","quality-report","slo","tag-policy","team","team-members","user-invitation","user-permissions"],Ek=["log","metric","trace"],Ik=[...yk,...Ek],Zme=[...gk,...Ik];var rs=["admin","public_editor","public_viewer","teams_only"],ro=["admin","editor","viewer"];var an="/v0/team-membership",rm=n.Object({id:n.String(),userId:n.String(),teamId:n.String(),roleKey:n.Enum(ro)}),gT=n.Object({userId:c({allowEmpty:!1}),teamId:c({allowEmpty:!1}),roleKey:n.Enum(ro)}),Tk=n.Object({userId:c({allowEmpty:!1}),teamId:c({allowEmpty:!1})}),_k=n.Optional(n.Object({userId:n.Optional(c({allowEmpty:!1})),teamId:n.Optional(c({allowEmpty:!1}))})),Xme=d({tags:["access-control"],url:an,method:"GET",query:_k,response:n.Array(rm)}),Jme=d({tags:["access-control"],url:an,method:"POST",body:gT,response:rm}),ece=d({tags:["access-control"],url:an,method:"PUT",body:gT,response:rm}),tce=d({tags:["access-control"],url:an,method:"DELETE",body:Tk,response:v}),ts=500,hk=n.Object({teamId:c({allowEmpty:!1}),members:n.Array(n.Object({userId:n.Optional(c({allowEmpty:!1})),userEmail:n.Optional(c({allowEmpty:!1,type:"email"})),roleKey:n.Enum(ro)},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:ts})}),Ok=n.Object({results:n.Array(n.Object({userId:n.String(),status:n.Enum(["added","already_member","user_not_found"])}))}),rce=d({tags:["access-control"],url:`${an}/bulk-add`,method:"POST",body:hk,response:Ok}),nce=d({tags:["access-control"],url:`${an}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(c({allowEmpty:!1}),{minItems:1,maxItems:ts}),teamId:c({allowEmpty:!1}),role:n.Enum(ro)}),response:n.Object({})}),Ak=n.Object({teamId:c({allowEmpty:!1}),userIds:n.Optional(n.Array(c({allowEmpty:!1}),{minItems:1,maxItems:ts})),userEmails:n.Optional(n.Array(c({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:ts}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}]}),Sk=n.Object({results:n.Array(n.Object({userId:n.String(),status:n.Enum(["removed","not_member","user_not_found"])}))}),oce=d({tags:["access-control"],url:`${an}/bulk-remove`,method:"DELETE",body:Ak,response:Sk});var ns="/v0/admin",we=`${ns}/clusters`,ET=n.Object({helmParameters:n.Record(n.String(),n.String()),helmVersion:n.String()}),yT=n.Record(n.String(),ET),im=["eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3","us-east-1","us-east-2","us-west-1","us-west-2","af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-1","ap-southeast-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ap-southeast-7","ca-central-1","ca-west-1","il-central-1","me-central-1","me-south-1","mx-central-1","sa-east-1"],am=["europe-west1","europe-west2","europe-west3","europe-west4","europe-west6","europe-west9","europe-central2","europe-north1","us-central1","us-east1","us-east4","us-west1","us-west2","us-west3","us-west4","northamerica-northeast1","southamerica-east1","asia-east1","asia-east2","asia-northeast1","asia-northeast2","asia-northeast3","asia-south1","asia-south2","asia-southeast1","asia-southeast2","australia-southeast1","australia-southeast2"],sm=["australiacentral","australiacentral2","australiaeast","australiasoutheast","austriaeast","belgiumcentral","brazilsouth","brazilsoutheast","canadacentral","canadaeast","centralindia","centralus","chilecentral","eastasia","eastus","eastus2","francecentral","francesouth","germanynorth","germanywestcentral","indonesiacentral","israelcentral","italynorth","japaneast","japanwest","jioindiacentral","jioindiawest","koreacentral","koreasouth","malaysiawest","mexicocentral","newzealandnorth","northcentralus","northeurope","norwayeast","norwaywest","polandcentral","qatarcentral","southafricanorth","southafricawest","southcentralus","southeastasia","southindia","spaincentral","swedencentral","switzerlandnorth","switzerlandwest","uaecentral","uaenorth","uksouth","ukwest","westcentralus","westeurope","westindia","westus","westus2","westus3"],IT=["aws","gcp","azure"],fi=["xs","s","m","l"],pm=["1.0"],bk={id:n.String(),name:n.String(),createdAt:T(),clusterCertificateExpiresAt:T(),bridgeEndpoint:n.String(),deployerEndpoint:n.String(),targetConfiguration:yT,appliedConfiguration:n.Optional(yT),automaticallyDeployLatestVersion:n.Boolean(),automatedDeploymentDisabledBy:n.Optional(n.String()),automatedDeploymentDisabledReason:n.Optional(n.String()),automatedDeploymentDisabledAt:n.Optional(T()),soakTimeMin:n.Optional(n.Number()),clusterSize:n.Optional(n.Enum(fi))},nm={...bk,orgId:n.String(),orgName:n.String()},uce=d({tags:["admin"],method:"GET",url:we,query:n.Object({orgId:n.Optional(c())}),response:n.Array(b("clusterType",[n.Object({...nm,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(pm)),clusterRegion:n.Enum(im)}),n.Object({...nm,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(am)}),n.Object({...nm,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(sm)})]))}),lce=d({tags:["admin"],method:"PUT",url:`${we}/create`,body:b("clusterType",[n.Object({clusterType:n.Literal("aws"),orgId:c(),name:c(),clusterSize:n.Enum(fi),clusterAccountId:n.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:n.Enum(pm),clusterRegion:n.Enum(im)}),n.Object({clusterType:n.Literal("gcp"),orgId:c(),name:c(),clusterSize:n.Enum(fi),clusterAccountId:c(),clusterRegion:n.Enum(am)}),n.Object({clusterType:n.Literal("azure"),orgId:c(),name:c(),clusterSize:n.Enum(fi),clusterTenantId:c(),clusterSubscriptionId:c(),clusterRegion:n.Enum(sm)})]),response:n.Object({id:n.String(),bridgeEndpoint:n.String(),deployerEndpoint:n.String()})}),dce=d({tags:["admin"],method:"DELETE",url:`${we}/:id`,params:n.Object({id:c()}),body:n.Object({orgId:c()}),response:v}),fce=d({tags:["admin"],method:"PUT",url:`${we}/add-inbounder-key`,body:n.Object({orgId:c(),clusterId:c()}),response:n.Object({orgId:c(),clusterId:c(),inbounderAuthenticationKey:n.String()})}),gce=d({tags:["admin"],method:"PUT",url:`${we}/replace-all-inbounder-keys`,body:n.Object({orgId:c(),clusterId:c()}),response:n.Object({orgId:c(),clusterId:c(),inbounderAuthenticationKey:n.String()})}),yce=d({tags:["admin"],method:"PUT",url:`${we}/replace-inbounder-key`,body:n.Object({orgId:c(),clusterId:c(),inbounderAuthenticationKeyToReplace:c()}),response:n.Object({orgId:c(),clusterId:c(),inbounderAuthenticationKey:n.String()})}),Ece=d({tags:["admin"],method:"PUT",url:`${we}/delete-inbounder-key`,body:n.Object({orgId:c(),clusterId:c(),inbounderAuthenticationKeyToDelete:c()}),response:n.Object({orgId:c(),clusterId:c(),isKeyDeleted:n.Boolean()})}),Ice=d({tags:["admin"],method:"PUT",url:`${we}/rotate-deployer-key`,body:n.Object({orgId:c(),clusterId:c(),newKey:c()}),response:n.Object({orgId:c(),clusterId:c(),isKeyUpdated:n.Boolean()})}),Tce=d({tags:["admin"],method:"PUT",url:`${we}/rotate-bridge-key`,body:n.Object({orgId:c(),clusterId:c(),newKey:c()}),response:n.Object({orgId:c(),clusterId:c(),isKeyUpdated:n.Boolean()})}),om={central:n.String(),ngrokBridgeDomain:n.String(),ngrokDeployerDomain:n.String(),clusterCertificateExpiresAt:T(),clusterName:n.String(),clusterSize:n.Optional(n.Enum(fi)),secretBridgeAuthenticationKey:n.String(),secretDeployerAuthenticationKey:n.String(),secretOutbounderAuthenticationKey:n.String(),secretMonitoringApiKey:n.String(),slackChannelEmail:n.String()},_ce=d({tags:["admin"],method:"POST",url:`${we}/:id`,body:n.Object({orgId:c()}),params:n.Object({id:c()}),response:b("clusterType",[n.Object({...om,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(pm)),clusterRegion:n.Enum(im)}),n.Object({...om,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(am)}),n.Object({...om,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(sm)})])}),hce=d({tags:["admin"],method:"POST",url:`${we}/configuration`,body:n.Object({id:c(),orgId:c(),installationName:c(),targetConfiguration:ET}),response:n.Object({status:n.String()})}),Oce=d({tags:["admin"],method:"POST",url:`${we}/automation`,body:n.Object({id:c(),orgId:c(),enableAutomatedDeployment:n.Boolean(),disabledReason:n.Optional(c())}),response:n.Object({status:n.String()})}),Ace=d({tags:["admin"],method:"POST",url:`${we}/soak-time`,body:n.Object({id:c(),orgId:c(),soakTimeMin:n.Optional(n.Number())}),response:n.Object({status:n.String()})}),Sce=d({tags:["admin"],method:"POST",url:`${we}/deploy`,body:n.Object({orgId:c(),clusterId:c(),chartName:c(),toVersion:c()}),response:n.Object({id:n.String()})}),xk=b("type",[n.Object({type:n.Literal("pending")}),n.Object({type:n.Literal("running")}),n.Object({type:n.Literal("cancelled")}),n.Object({type:n.Literal("timed_out")}),n.Object({type:n.Literal("success"),stateValue:n.Object({message:n.String()})}),n.Object({type:n.Literal("failure"),stateValue:n.Object({message:n.String()})})]),bce=d({tags:["admin"],method:"GET",url:`${we}/deploy`,query:n.Object({orgId:n.Optional(c()),clusterId:n.Optional(c())}),response:n.Array(n.Object({id:n.String(),orgId:n.String(),orgName:n.String(),clusterId:n.String(),clusterName:n.String(),fromVersion:n.Optional(n.String()),toVersion:n.String(),state:xk,updatedAt:T(),createdAt:T(),installationName:n.String(),chartName:n.String(),isAutomated:n.Boolean(),createdBy:n.Optional(n.String()),createdByName:n.Optional(n.String()),createdByEmail:n.Optional(n.String())}))}),Rk=n.Object({installations:n.Array(n.Object({installationName:n.String(),parameters:n.Record(n.String(),n.String()),version:n.Union([n.String(),n.Null()]),resources:n.Array(n.Object({id:n.Object({kind:n.String(),name:n.String()}),status:n.String(),health:n.String(),rawDetails:n.Optional(n.Any()),liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())})),deployedAt:n.Optional(n.String()),syncStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String())}))}),xce=d({tags:["admin"],method:"POST",url:`${we}/status`,body:n.Object({orgId:n.Optional(c()),clusterId:n.Optional(c())}),response:n.Array(n.Object({orgId:n.String(),clusterId:n.String(),status:Rk}))}),Rce=d({tags:["admin"],method:"POST",url:`${we}/argocd-cert-info`,body:n.Object({orgId:c(),clusterId:c()}),response:n.Object({certificateExpiresAt:n.String()})}),Ck=n.Object({kind:n.String(),name:n.String()}),Pk=n.Object({id:Ck,liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())}),Cce=d({tags:["admin"],method:"POST",url:`${we}/resource-details`,body:n.Object({orgId:c(),clusterId:c(),installationName:c()}),response:n.Object({resources:n.Array(Pk)})}),Pce=d({tags:["admin"],method:"GET",url:`${we}/versions`,query:n.Object({chartName:n.Optional(c())}),response:n.Array(n.Object({id:n.String(),chartName:n.String(),locator:n.String(),version:n.String(),repositoryArn:n.String(),type:n.Optional(n.String()),commitHash:n.Optional(n.String()),lastPulledAt:n.Optional(T()),pushedAt:n.Optional(T())}))}),Uk=n.Object({id:n.Object({name:n.String(),kind:n.String()}),previewManifest:n.Optional(n.String())}),Uce=d({tags:["admin"],method:"POST",url:`${we}/versions/render`,body:n.Object({chartName:c(),version:c(),values:c({type:"long"}),installationName:c(),namespace:c()}),response:n.Array(Uk)}),er=`${ns}/orgs`,Nce=d({tags:["admin"],url:er,method:"GET",query:n.Object({onlyDeleted:n.Optional(n.Boolean())}),response:n.Array(n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String()),createdAt:T(),updatedAt:T()}))}),Lce=d({tags:["admin"],url:er,method:"POST",body:n.Object({emailDomains:n.Array(c({type:"lowercase-domain"}),{maxItems:20}),name:c()}),response:n.Object({id:n.String(),name:n.String()})}),kce=d({tags:["admin"],url:`${er}/:id`,method:"PUT",params:n.Object({id:c()}),body:n.Object({allowedDomains:n.Optional(n.Array(c({type:"lowercase-domain"}),{maxItems:20}))}),response:n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String())})}),Mce=d({tags:["admin"],url:`${er}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),wce=d({tags:["admin"],url:`${er}/:id/restore`,method:"POST",params:n.Object({id:c()}),response:n.Object({success:n.Boolean()})}),$ce=d({tags:["admin"],url:`${er}/:id/permanent-delete`,method:"DELETE",params:n.Object({id:c()}),response:n.Object({success:n.Boolean(),hasDeletedSecret:n.Boolean(),hasDeletedTenantDb:n.Boolean(),hasDeletedOrgRow:n.Boolean()})}),Dce=d({tags:["admin"],url:`${er}/synchronize-sds-rules`,method:"POST",response:n.Object({errorOrgs:n.Optional(n.Array(n.Object({id:n.String(),name:n.String()}))),synchronizedOrgsCount:n.Number()})}),Nk=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],Lk=n.Enum(Nk),Gce=d({tags:["admin"],url:`${er}/refresh-assets`,method:"POST",body:n.Object({assetTypes:n.Array(Lk,{minItems:1}),orgId:n.Optional(c({allowEmpty:!1}))}),response:n.Array(n.Object({orgId:n.String(),orgName:n.String(),results:n.Record(n.String(),n.Object({success:n.Boolean()}))}))}),vce=d({tags:["admin"],url:`${er}/sudo`,method:"POST",body:n.Object({orgId:c()}),response:n.Object({sudoToken:n.String()})}),kk=`${ns}/users`,jce=d({tags:["admin"],url:`${kk}/invite`,method:"POST",body:n.Object({email:c({type:"email"}),orgId:c(),userRole:n.Enum(rs)}),response:n.Array(n.Object({inviteId:n.String(),email:n.String(),result:n.Union([n.Literal("success"),n.Literal("email-failed")])}))});var Fce=d({tags:["admin"],url:`${ns}/billing-data`,method:"GET",query:n.Object({orgId:c(),maxDaysFetched:n.Optional(n.Number({minimum:1,maximum:365}))}),response:n.Object({dataPoints:n.Array(n.Object({date:n.String(),telemetryKind:n.Union([n.Literal("logs"),n.Literal("metrics"),n.Literal("traces")]),totalBytes:n.Number(),clusterId:n.String(),apiKeyId:n.String(),apiKeyName:n.String(),teamName:n.String()})),availableFilters:n.Object({clusters:n.Array(n.Object({id:n.String(),name:n.String()})),apiKeys:n.Array(n.Object({id:n.String(),name:n.String()})),teamNames:n.Array(n.String())})})});var TT=n.Object({id:n.String({description:"Unique identifier of the Tsuga cluster containing your observability data"}),name:n.String({description:"Internal name of the Tsuga cluster"}),friendlyName:n.Optional(n.String({description:"Human-readable display name set by an operator"})),clusterType:n.Enum(IT,{description:"Cloud provider hosting the Tsuga cluster"}),clusterRegion:n.String({description:"Region where the Tsuga cluster is deployed"})},{$id:"Cluster",description:"A Tsuga cluster containing your observability data"}),Mk={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(TT,{examples:[Mk]});var _T=d({description:"Retrieve all clusters",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:n.Array(TT)});function mm(e){process.stdout.write(`${e}
35
- `)}function oe(e){mm(JSON.stringify(e,null,2))}var hT=["json","tsv","csv"];function OT(e){let t=hT.find(r=>r===e);if(t!==void 0)return t;throw new Error(`--output must be one of: ${hT.join(", ")} (got: ${e})`)}function AT(e){let t=e.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(t.length===0)throw new Error("--fields must contain at least one field name");return t}function ST(e,t){let r=e;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function bT(e,t){let r=Object.create(null);for(let o of t){let i=ST(e,o);if(i===void 0)continue;let s=o.split("."),m=s.pop();if(m===void 0)continue;let u=r;for(let l of s)(typeof u[l]!="object"||u[l]===null)&&(u[l]=Object.create(null)),u=u[l];u[m]=i}return r}function xT(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var wk={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function $k(e){let t=xT(e);return t===null?"":t.replace(/[\\\t\r\n]/g,r=>wk[r]??r)}function Dk(e){let t=xT(e);return t===null?"":/[,"\n\r]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function RT(e,t,r){if(t.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?Dk:$k,s=r.map(u=>i(u)).join(o),m=t.map(u=>r.map(l=>i(ST(u,l))).join(o));return[s,...m].join(`
36
- `)}function CT(e,t){e.command("cluster").description("Manage Tsuga cluster selection. A Tsuga cluster contains your observability data.").command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await t()(_T);oe(o)})}var PT=`/${"v1"}/docs`,UT=n.Object({path:n.String(),title:n.String(),content:n.String({description:"Raw markdown content of the documentation page"})},{$id:"DocPage",description:"A documentation page with its raw markdown content"}),Gk={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
37
- ...`};Object.assign(UT,{examples:[Gk]});var NT=n.Object({path:n.String(),title:n.String(),score:n.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:n.String({description:"Short snippet of matching content"}),link:n.String({description:"URL to the documentation page in the Tsuga app"})},{$id:"DocSearchResult",description:"A documentation search result"}),vk={path:"getting-started/send-your-first-logs",title:"Send your first logs",score:.9,excerpt:"...send your first logs to Tsuga using the ingestion API...",link:"https://www.app.tsuga.com/documentation/getting-started/send-your-first-logs"};Object.assign(NT,{examples:[vk]});var LT=d({description:"Retrieve the raw markdown content of a documentation page by its path",operationId:"getDocPage",tags:["docs"],url:PT,method:"GET",query:n.Object({path:c({allowEmpty:!1})}),response:UT}),kT=d({description:"Full-text search across documentation pages",operationId:"searchDocs",tags:["docs"],url:`${PT}/search`,method:"GET",query:n.Object({query:c({allowEmpty:!1})}),response:n.Array(NT)});function MT(e,t){let r=e.command("docs").description("Browse and search documentation");r.command("get <path>").description("Get a documentation page by path (e.g. 'getting-started/send-your-first-logs')").action(async o=>{let i=await t()(LT,{query:{path:o}});oe(i)}),r.command("search <query>").description("Search documentation pages").action(async o=>{let i=await t()(kT,{query:{query:o}});oe(i)})}var $T=1456444800,DT=4927737600,jk=$T*1e3,Fk=DT*1e3,os=1704067200,cm=os*1e3,GT={title:"TimeRange",description:"Time range to query",examples:[{from:os,to:os}]},vT={title:"TimeRange",description:"Time range to query",examples:[{from:cm,to:cm}]},is=e=>n.Integer({description:e,examples:[os],minimum:$T,maximum:DT,format:"int64"}),wT=e=>n.Integer({description:e,examples:[cm],minimum:jk,maximum:Fk,format:"int64"}),ft=n.Object({from:n.Optional(is("Start timestamp in seconds")),to:n.Optional(is("End timestamp in seconds"))},GT),gt=n.Object({from:is("Start timestamp in seconds"),to:is("End timestamp in seconds")},GT),pue=n.Object({from:n.Integer({description:"Start timestamp in milliseconds"}),to:n.Integer({description:"End timestamp in milliseconds"})},vT),jT=n.Object({from:wT("Start timestamp in milliseconds"),to:wT("End timestamp in milliseconds")},vT);var uue=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));var hue=60*1e3;var nle=1/1e6,Vk=1e3,Yk=60*Vk,Qk=60*Yk,ss=24*Qk,ole=7*ss,ile=30*ss;var lm=["past-5-minutes","past-15-minutes","past-30-minutes","past-1-hour","past-2-hours","past-4-hours","past-6-hours","past-12-hours","past-24-hours","past-2-days","past-3-days","past-7-days","past-30-days","past-3-months","current-day","current-week","current-month","current-year","previous-day","previous-week","previous-month","previous-3-months","previous-year"];var Wk={s:1,m:60,h:3600,d:86400};function BT(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<48||r>57)return!1}return!0}function qT(){return Math.floor(Date.now()/1e3)}function ps(e){if(typeof e=="number")return e;if(e==="now")return qT();if(e.startsWith("-")&&e.length>=3){let r=e.at(-1),o=r?Wk[r]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&BT(i))return qT()-parseInt(i,10)*o}}if(BT(e)&&e.length>0)return parseInt(e,10);let t=Date.parse(e);if(!Number.isNaN(t))return Math.floor(t/1e3);throw new Error(`Invalid time value: ${e}. Use unix seconds, relative (-30m, -1h), 'now', or ISO 8601.`)}var HT=n.Object({type:n.Literal("number"),number:n.String()}),Zk=n.Object({type:n.Literal("string"),string:n.String()}),Xk=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),dm=b("type",[HT,Zk,Xk]),Jk=n.Object({by:n.Record(n.String(),dm),computed:n.Record(n.String(),HT)}),eM=n.Object({type:n.Literal("buckets"),buckets:n.Array(Jk)}),tM=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),KT=b("type",[eM,tM]);var rM="/v0/aggregation",nM=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),oM=n.Object({parallelism:n.Number(),engine:nM,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),kt=["logs","metrics","traces"],iM={logs:"Logs",metrics:"Metrics",traces:"Traces"},aM=[...kt,"connections","log-patterns"],_le={...iM,connections:"Connections","log-patterns":"Log Patterns"},hle=n.Enum(aM,{description:"Data source being queried"}),Mr=n.Enum(kt,{description:"Data source being queried for this aggregation"}),sn=n.String({description:"Attribute containing the values to aggregate"}),pn=c({description:"Attribute containing the values to aggregate"}),sM=b("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(sn)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:sn},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:sn},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:sn},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:sn},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:sn},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:sn,percentile:n.Number()},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate"}),pM=b("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(pn)},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:pn},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:pn},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:pn},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:pn},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:pn},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:pn,percentile:n.Number()},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate"}),YT=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),QT=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),WT=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),ZT=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),XT=n.Object({type:n.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),JT=n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),e_=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),t_=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),mM=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:n.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),cM=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:c({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),uM=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),lM=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),dM=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),fM=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),gM=b("type",[YT,QT,WT,ZT,XT,mM,uM,JT,e_,t_,dM],{title:"Function"}),yM=b("type",[YT,QT,WT,ZT,XT,cM,lM,JT,e_,t_,fM],{title:"InputFunction"});var zT=n.Object({min:n.Number(),max:n.Number()}),VT=n.Integer({minimum:1}),EM=b("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:c({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(c()),bucketCount:n.Optional(VT),bounds:n.Optional(zT),percentiles:n.Optional(n.Array(n.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:c({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(c()),bucketCount:n.Optional(VT),bounds:n.Optional(zT)},{title:"Heatmap",description:"Returns a distribution per time window"})]),fm=15,IM=["zero","null"],TM=n.Enum(IM),r_=n.Object({mode:n.Object({type:TM})}),n_={aggregate:sM,functions:n.Optional(n.Array(gM,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(r_)},o_={aggregate:pM,functions:n.Optional(n.Array(yM,{maxItems:10,description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(r_)},_M={description:"Aggregations that may be combined together in the same query"},i_={maxItems:fm,description:"Aggregations that may be combined together in the same query"},a_=n.Array(n.Object({...n_,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),_M),gi=n.Array(n.Object({...o_,filter:n.Optional(c({type:"tsuga-query",description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),i_),no=n.Array(n.Object({...n_,filter:n.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery"})),oo=n.Array(n.Object({...o_,filter:c({type:"tsuga-query"})},{title:"MonitorAggregationQuery"}),i_);var s_=n.String({description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),yi=c({type:"tsuga-formula",description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),hM=n.Object({fields:n.Array(n.String()),limit:n.Number()},{title:"AggregationGroupBy"}),OM=n.Object({fields:n.Array(c(),{maxItems:1}),limit:n.Number()},{title:"AggregationGroupBy"}),AM=7;var gm=n.Array(hM,{description:"Fields used to group the results"}),io=n.Array(OM,{maxItems:AM,description:"Fields used to group the results"}),Ole=d({tags:["aggregation"],url:`${rM}/multi-query`,method:"POST",body:n.Object({timeRange:jT,queries:gi,groupBy:n.Optional(io),returnType:EM,dataSource:Mr,formula:yi,executionOptions:oM,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(c({allowEmpty:!1}))}),response:KT}),SM=["per-second","per-minute","per-hour","rate"],mn=n.Enum(SM),Ale=b("type",[n.Object({type:n.Literal("count"),count:n.Object({field:n.Optional(c()),timeNormalization:n.Optional(mn)})}),n.Object({type:n.Literal("average"),average:n.Object({field:c(),timeNormalization:n.Optional(mn)})}),n.Object({type:n.Literal("min"),min:n.Object({field:c(),timeNormalization:n.Optional(mn)})}),n.Object({type:n.Literal("max"),max:n.Object({field:c(),timeNormalization:n.Optional(mn)})}),n.Object({type:n.Literal("sum"),sum:n.Object({field:c(),timeNormalization:n.Optional(mn)})}),n.Object({type:n.Literal("percentile"),percentile:n.Object({field:c(),percentile:n.Number(),timeNormalization:n.Optional(mn)})}),n.Object({type:n.Literal("uniqueCount"),uniqueCount:n.Object({field:c(),timeNormalization:n.Optional(mn)})})]),bM=n.Object({type:n.Literal("time"),time:n.Object({interval:c()})}),xM=n.Object({type:n.Literal("histogram"),histogram:n.Object({field:c(),interval:n.Number(),bounds:n.Optional(n.Object({min:n.Number(),max:n.Number()}))})}),RM=n.Object({type:n.Literal("topList"),topList:n.Object({field:c(),size:n.Number(),orderBy:n.Optional(n.Object({computeRef:c(),order:n.Union([n.Literal("asc"),n.Literal("desc")])}))})}),Sle=b("type",[bM,xM,RM]);var p_=`/${"v1"}/aggregation`,m_=n.Object({id:n.String({description:'Query identifier (q1, q2, ...) or "formula" for formula'}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values"})}),CM={results:[{id:"q1",group:{host:"server-1"},value:123.45}]},c_=n.Object({results:n.Array(n.Object({...m_.properties,value:n.Number({description:"Aggregated value"})},{title:"ScalarResult"}),{description:"Aggregated results per query and group"})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with single values"});Object.assign(c_,{examples:[CM]});var PM={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]},ms=n.Object({series:n.Array(n.Object({...m_.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Timestamp in milliseconds"}),value:n.Number({description:"Value"})}),{description:"Array of data points"})},{title:"Series"}),{description:"Time series data per query and group"})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with points over time"});Object.assign(ms,{examples:[PM]});var u_={timeRange:gt,queries:n.Array(n.Omit(gi.items,["fill"],{title:"AggregationQuery"}),{maxItems:fm,description:"Aggregations that may be combined together in the same query"}),groupBy:n.Optional(io),dataSource:Mr,formula:n.Optional(yi),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))},UM=n.Object(u_),l_=d({description:"Run aggregation queries and return scalar results",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${p_}/multi-query/scalar`,method:"POST",body:UM,response:c_}),NM=n.Object({...u_,aggregationWindow:c({description:'Time bucket size for aggregation (e.g. "10s", "1m", "1h")'})}),d_=d({description:"Run aggregation queries and return timeseries results",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${p_}/multi-query/timeseries`,method:"POST",body:NM,response:ms});var LM=`/${"v1"}/promql`,kM=n.Object({query:c({allowEmpty:!1,description:"PromQL query string"}),timeRange:gt,step:c({allowEmpty:!1,description:'Resolution step (e.g. "15s", "1m")'}),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),f_=d({description:"Run a PromQL query and return timeseries results. Experimental: shape and behavior may change.",operationId:"queryPromql",tags:["public","promql"],url:LM,method:"POST",body:kM,response:ms});function MM(e){return a.IsObject(e)&&a.HasPropertyKey(e,"check")&&a.HasPropertyKey(e,"errors")&&a.IsFunction(e.check)&&a.IsFunction(e.errors)}function ym(e){return a.HasPropertyKey(e,"~guard")&&MM(e["~guard"])}function Em(e){return a.HasPropertyKey(e,"~refine")&&a.IsArray(e["~refine"])&&a.Every(e["~refine"],0,t=>a.IsObject(t)&&a.HasPropertyKey(t,"refine")&&a.HasPropertyKey(t,"message")&&a.IsFunction(t.refine)&&a.IsString(t.message))}function tr(e){return a.IsObject(e)&&!a.IsArray(e)}function cs(e){return a.IsBoolean(e)}function D(e){return tr(e)||cs(e)}function Im(e){return a.HasPropertyKey(e,"additionalItems")&&D(e.additionalItems)}function rr(e){return a.HasPropertyKey(e,"additionalProperties")&&D(e.additionalProperties)}function Tm(e){return a.HasPropertyKey(e,"allOf")&&a.IsArray(e.allOf)&&e.allOf.every(t=>D(t))}function Ei(e){return a.HasPropertyKey(e,"$anchor")&&a.IsString(e.$anchor)}function _m(e){return a.HasPropertyKey(e,"anyOf")&&a.IsArray(e.anyOf)&&e.anyOf.every(t=>D(t))}function hm(e){return a.HasPropertyKey(e,"const")}function cn(e){return a.HasPropertyKey(e,"contains")&&D(e.contains)}function ht(e){return a.HasPropertyKey(e,"default")}function Om(e){return a.HasPropertyKey(e,"dependencies")&&a.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>D(t)||a.IsArray(t)&&t.every(r=>a.IsString(r)))}function Am(e){return a.HasPropertyKey(e,"dependentRequired")&&a.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>a.IsArray(t)&&t.every(r=>a.IsString(r)))}function Sm(e){return a.HasPropertyKey(e,"dependentSchemas")&&a.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>D(t))}function bm(e){return a.HasPropertyKey(e,"$dynamicAnchor")&&a.IsString(e.$dynamicAnchor)}function xm(e){return a.HasPropertyKey(e,"else")&&D(e.else)}function Rm(e){return a.HasPropertyKey(e,"enum")&&a.IsArray(e.enum)}function Cm(e){return a.HasPropertyKey(e,"exclusiveMaximum")&&(a.IsNumber(e.exclusiveMaximum)||a.IsBigInt(e.exclusiveMaximum))}function nr(e){return a.HasPropertyKey(e,"exclusiveMinimum")&&(a.IsNumber(e.exclusiveMinimum)||a.IsBigInt(e.exclusiveMinimum))}function Ii(e){return a.HasPropertyKey(e,"format")&&a.IsString(e.format)}function un(e){return a.HasPropertyKey(e,"$id")&&a.IsString(e.$id)}function Pm(e){return a.HasPropertyKey(e,"if")&&D(e.if)}function ao(e){return a.HasPropertyKey(e,"items")&&(D(e.items)||a.IsArray(e.items)&&e.items.every(t=>D(t)))}function Um(e){return ao(e)&&a.IsArray(e.items)}function Nm(e){return a.HasPropertyKey(e,"maximum")&&(a.IsNumber(e.maximum)||a.IsBigInt(e.maximum))}function Lm(e){return a.HasPropertyKey(e,"maxContains")&&a.IsNumber(e.maxContains)}function us(e){return a.HasPropertyKey(e,"maxItems")&&a.IsNumber(e.maxItems)}function km(e){return a.HasPropertyKey(e,"maxLength")&&a.IsNumber(e.maxLength)}function Mm(e){return a.HasPropertyKey(e,"maxProperties")&&a.IsNumber(e.maxProperties)}function or(e){return a.HasPropertyKey(e,"minimum")&&(a.IsNumber(e.minimum)||a.IsBigInt(e.minimum))}function ln(e){return a.HasPropertyKey(e,"minContains")&&a.IsNumber(e.minContains)}function so(e){return a.HasPropertyKey(e,"minItems")&&a.IsNumber(e.minItems)}function Ti(e){return a.HasPropertyKey(e,"minLength")&&a.IsNumber(e.minLength)}function _i(e){return a.HasPropertyKey(e,"minProperties")&&a.IsNumber(e.minProperties)}function wm(e){return a.HasPropertyKey(e,"multipleOf")&&(a.IsNumber(e.multipleOf)||a.IsBigInt(e.multipleOf))}function $m(e){return a.HasPropertyKey(e,"not")&&D(e.not)}function Dm(e){return a.HasPropertyKey(e,"oneOf")&&a.IsArray(e.oneOf)&&e.oneOf.every(t=>D(t))}function hi(e){return a.HasPropertyKey(e,"pattern")&&(a.IsString(e.pattern)||e.pattern instanceof RegExp)}function Oi(e){return a.HasPropertyKey(e,"patternProperties")&&a.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>D(t))}function po(e){return a.HasPropertyKey(e,"prefixItems")&&a.IsArray(e.prefixItems)&&e.prefixItems.every(t=>D(t))}function Ai(e){return a.HasPropertyKey(e,"properties")&&a.IsObject(e.properties)&&Object.values(e.properties).every(t=>D(t))}function Gm(e){return a.HasPropertyKey(e,"propertyNames")&&(a.IsObject(e.propertyNames)||D(e.propertyNames))}function wM(e){return a.HasPropertyKey(e,"$recursiveAnchor")&&a.IsBoolean(e.$recursiveAnchor)}function ls(e){return wM(e)&&a.IsEqual(e.$recursiveAnchor,!0)}function vm(e){return a.HasPropertyKey(e,"$recursiveRef")&&a.IsString(e.$recursiveRef)}function jm(e){return a.HasPropertyKey(e,"$ref")&&a.IsString(e.$ref)}function dn(e){return a.HasPropertyKey(e,"required")&&a.IsArray(e.required)&&e.required.every(t=>a.IsString(t))}function Fm(e){return a.HasPropertyKey(e,"then")&&D(e.then)}function Bm(e){return a.HasPropertyKey(e,"type")&&(a.IsString(e.type)||a.IsArray(e.type)&&e.type.every(t=>a.IsString(t)))}function mo(e){return a.HasPropertyKey(e,"uniqueItems")&&a.IsBoolean(e.uniqueItems)}function ds(e){return a.HasPropertyKey(e,"unevaluatedItems")&&D(e.unevaluatedItems)}function fs(e){return a.HasPropertyKey(e,"unevaluatedProperties")&&D(e.unevaluatedProperties)}var et=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(t){return this.indices.add(t),!0}AddKey(t){return this.keys.add(t),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(t){for(let r of t)r.indices.forEach(o=>this.indices.add(o)),r.keys.forEach(o=>this.keys.add(o));return!0}},Si=class extends et{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}},$e=class extends Si{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}};var $M="external_",DM=0,mye={identifier:`${$M}${DM}`,variables:[]};function g_(e,t,r,o){return r["~guard"].check(o)}function y_(e,t,r,o,i,s){return i["~guard"].check(s)||t.AddError({keyword:"~guard",schemaPath:r,instancePath:o,params:{errors:i["~guard"].errors(s)}})}function E_(e,t,r,o){return a.Every(r["~refine"],0,(i,s)=>i.refine(o))}function I_(e,t,r,o,i,s){return a.EveryAll(i["~refine"],0,(m,u)=>m.refine(s)||t.AddError({keyword:"~refine",schemaPath:r,instancePath:o,params:{index:u,message:m.message}}))}function T_(e){return ao(e)&&a.IsArray(e.items)}function __(e,t,r,o){return T_(r)?o.every((s,m)=>a.IsLessThan(m,r.items.length)||$(e,t,r.additionalItems,s)&&t.AddIndex(m)):!0}function h_(e,t,r,o,i,s){return T_(i)?s.every((u,l)=>{let g=`${r}/additionalItems`,E=`${o}/${l}`;return a.IsLessThan(l,i.items.length)||K(e,t,g,E,i.additionalItems,u)&&t.AddIndex(l)}):!0}function GM(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function O_(e){let t=[];return Oi(e)&&t.push(...a.Keys(e.patternProperties)),Ai(e)&&t.push(...a.Keys(e.properties).map(GM)),a.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function A_(e,t,r,o){let i=new RegExp(O_(r));return a.Every(a.Keys(o),0,(m,u)=>i.test(m)||$(e,t,r.additionalProperties,o[m])&&t.AddKey(m))}function S_(e,t,r,o,i,s){let m=new RegExp(O_(i)),u=[];return a.EveryAll(a.Keys(s),0,(g,E)=>{let I=`${r}/additionalProperties`,P=`${o}/${g}`,be=new $e,ve=m.test(g)||K(e,be,I,P,i.additionalProperties,s[g])&&t.AddKey(g);return ve||u.push(g),ve})||t.AddError({keyword:"additionalProperties",schemaPath:r,instancePath:o,params:{additionalProperties:u}})}function b_(e,t,r,o){let i=r.allOf.reduce((s,m)=>{let u=new et;return $(e,u,m,o)?[...s,u]:s},[]);return a.IsEqual(i.length,r.allOf.length)&&t.Merge(i)}function x_(e,t,r,o,i,s){let m=[],u=i.allOf.reduce((g,E,I)=>{let P=`${r}/allOf/${I}`,be=new $e,ve=K(e,be,P,o,E,s);return ve||m.push(be),ve?[...g,be]:g},[]),l=a.IsEqual(u.length,i.allOf.length)&&t.Merge(u);return l||m.forEach(g=>g.GetErrors().forEach(E=>t.AddError(E))),l}function R_(e,t,r,o){let i=r.anyOf.reduce((s,m,u)=>{let l=new et;return $(e,l,m,o)?[...s,l]:s},[]);return a.IsGreaterThan(i.length,0)&&t.Merge(i)}function C_(e,t,r,o,i,s){let m=[],u=i.anyOf.reduce((g,E,I)=>{let P=new $e,be=`${r}/anyOf/${I}`,ve=K(e,P,be,o,E,s);return ve||m.push(P),ve?[...g,P]:g},[]),l=a.IsGreaterThan(u.length,0)&&t.Merge(u);return l||m.forEach(g=>g.GetErrors().forEach(E=>t.AddError(E))),l||t.AddError({keyword:"anyOf",schemaPath:r,instancePath:o,params:{}})}function Hm(e,t,r,o){return r}function P_(e,t,r,o,i,s){return Hm(e,t,i,s)||t.AddError({keyword:"boolean",schemaPath:r,instancePath:o,params:{}})}function Km(e,t,r,o){return a.IsValueLike(r.const)?a.IsEqual(o,r.const):a.IsDeepEqual(o,r.const)}function U_(e,t,r,o,i,s){return Km(e,t,i,s)||t.AddError({keyword:"const",schemaPath:r,instancePath:o,params:{allowedValue:i.const}})}function vM(e){return!(ln(e)&&a.IsEqual(e.minContains,0))}function zm(e,t,r,o){return vM(r)?!a.IsEqual(o.length,0)&&o.some(i=>$(e,t,r.contains,i)):!0}function N_(e,t,r,o,i,s){return zm(e,t,i,s)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:1}})}function L_(e,t,r,o){let i=a.IsEqual(a.Keys(o).length,0),s=a.Every(a.Entries(r.dependencies),0,([m,u])=>!a.HasPropertyKey(o,m)||(a.IsArray(u)?u.every(l=>a.HasPropertyKey(o,l)):$(e,t,u,o)));return i||s}function k_(e,t,r,o,i,s){let m=a.IsEqual(a.Keys(s).length,0),u=a.EveryAll(a.Entries(i.dependencies),0,([l,g])=>{let E=`${r}/dependencies/${l}`;return!a.HasPropertyKey(s,l)||(a.IsArray(g)?g.every(I=>a.HasPropertyKey(s,I)||t.AddError({keyword:"dependencies",schemaPath:r,instancePath:o,params:{property:l,dependencies:g}})):K(e,t,E,o,g,s))});return m||u}function M_(e,t,r,o){let i=a.IsEqual(a.Keys(o).length,0),s=a.Every(a.Entries(r.dependentRequired),0,([m,u])=>!a.HasPropertyKey(o,m)||u.every(l=>a.HasPropertyKey(o,l)));return i||s}function w_(e,t,r,o,i,s){let m=a.IsEqual(a.Keys(s).length,0),u=a.EveryAll(a.Entries(i.dependentRequired),0,([l,g])=>!a.HasPropertyKey(s,l)||a.EveryAll(g,0,E=>a.HasPropertyKey(s,E)||t.AddError({keyword:"dependentRequired",schemaPath:r,instancePath:o,params:{property:l,dependencies:g}})));return m||u}function $_(e,t,r,o){let i=a.IsEqual(a.Keys(o).length,0),s=a.Every(a.Entries(r.dependentSchemas),0,([m,u])=>!a.HasPropertyKey(o,m)||$(e,t,u,o));return i||s}function D_(e,t,r,o,i,s){let m=a.IsEqual(a.Keys(s).length,0),u=a.EveryAll(a.Entries(i.dependentSchemas),0,([l,g])=>{let E=`${r}/dependentSchemas/${l}`;return!a.HasPropertyKey(s,l)||K(e,t,E,o,g,s)});return m||u}function Vm(e,t,r,o){return r.enum.some(i=>a.IsValueLike(i)?a.IsEqual(o,i):a.IsDeepEqual(o,i))}function G_(e,t,r,o,i,s){return Vm(e,t,i,s)||t.AddError({keyword:"enum",schemaPath:r,instancePath:o,params:{allowedValues:i.enum}})}function Ym(e,t,r,o){return a.IsLessThan(o,r.exclusiveMaximum)}function v_(e,t,r,o,i,s){return Ym(e,t,i,s)||t.AddError({keyword:"exclusiveMaximum",schemaPath:r,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function Qm(e,t,r,o){return a.IsGreaterThan(o,r.exclusiveMinimum)}function j_(e,t,r,o,i,s){return Qm(e,t,i,s)||t.AddError({keyword:"exclusiveMinimum",schemaPath:r,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var uo={};Ot(uo,{Clear:()=>B_,Entries:()=>o0,Get:()=>s0,Has:()=>a0,IsDate:()=>bi,IsDateTime:()=>Wm,IsDuration:()=>Zm,IsEmail:()=>Xm,IsHostname:()=>Jm,IsIPv4:()=>nc,IsIPv6:()=>oc,IsIdnEmail:()=>ec,IsIdnHostname:()=>rc,IsIri:()=>ac,IsIriReference:()=>ic,IsJsonPointer:()=>pc,IsJsonPointerUriFragment:()=>sc,IsRegex:()=>mc,IsRelativeJsonPointer:()=>cc,IsTime:()=>xi,IsUri:()=>dc,IsUriReference:()=>uc,IsUriTemplate:()=>lc,IsUrl:()=>fc,IsUuid:()=>gc,Reset:()=>q_,Set:()=>i0,Test:()=>p0});var jM=[0,31,28,31,30,31,30,31,31,30,31,30,31],FM=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function BM(e){return e%4===0&&(e%100!==0||e%400===0)}function bi(e){let t=FM.exec(e);if(!t)return!1;let r=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&BM(r)?29:jM[o])}var qM=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function xi(e,t=!0){let r=qM.exec(e);if(!r)return!1;let o=+r[1],i=+r[2],s=+r[3],m=r[4]==="-"?-1:1,u=+(r[5]||0),l=+(r[6]||0);if(u>23||l>59||t&&!r[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&s<60)return!0;let g=i-l*m,E=o-u*m-(g<0?1:0);return(E===23||E===-1)&&(g===59||g===-1)&&s<61}function Wm(e,t=!0){let r=e.split(/T/i);return r.length===2&&bi(r[0])&&xi(r[1],t)}var HM=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function Zm(e){return HM.test(e)}var KM=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[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;function Xm(e){return KM.test(e)}var zM=/^(?=.{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;function Jm(e){return zM.test(e)}var VM=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function ec(e){return VM.test(e)}function tc(e){let t=e.codePointAt(0);return t===void 0?!1:t>=12352&&t<=12447||t>=12448&&t<=12543&&t!==12539||t>=19968&&t<=40959}function rc(e){if(e.length===0||e.includes(" "))return!1;let t=/[\u002E\u3002\uFF0E\uFF61]/g,r=e.normalize("NFC").replace(t,".");if(r.length>253)return!1;let o=r.split(".");if(o.some(i=>i.length===0))return!1;for(let i of o){if(i.length>63||i.startsWith("-")||i.endsWith("-"))return!1;if(/^xn--/i.test(i)){let l=i.slice(4);if(l.length<2||l.includes("---"))return!1;continue}if(/[\u302E\u302F\u3031\u3032\u3033\u3034\u3035\u303B\u0640\u07FA]/.test(i))return!1;let s=i.charAt(0);if(/[\u0903\u0300\u0488]/.test(s))return!1;for(let l=0;l<i.length;l++){let g=i.charAt(l);if(g==="\xB7"){if(l===0||l===i.length-1)return!1;let E=i.charAt(l-1),I=i.charAt(l+1);if(!/^[lL]$/.test(E)||!/^[lL]$/.test(I))return!1}if(g==="\u30FB"){if(i.length===1)return!1;if(l===0){let E=i.charAt(l+1);if(!tc(E))return!1}else{let E=i.charAt(l-1),I=i.charAt(l+1);if(!tc(E)||!tc(I))return!1}}if(g==="\u0375"){if(l===i.length-1)return!1;let E=i.charAt(l+1);if(!/[\u0370-\u03FF]/.test(E))return!1}if(g==="\u05F3"||g==="\u05F4"){if(l===0)return!1;let E=i.charAt(l-1);if(!/[\u05D0-\u05EA]/.test(E))return!1}if(g==="\u200D"&&(l===0||i.charAt(l-1)!=="\u094D"))return!1}let m=!1,u=!1;for(let l=0;l<i.length;l++){let g=i.charAt(l);/[\u0660-\u0669]/.test(g)&&(m=!0),/[\u06F0-\u06F9]/.test(g)&&(u=!0)}if(m&&u)return!1}return!0}var YM=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function nc(e){return YM.test(e)}var QM=/^((([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}))|:)))$/i;function oc(e){return QM.test(e)}function F_(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function ic(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;let t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?F_(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:F_(e)}function ac(e){try{return new URL(e),!0}catch{return!1}}var WM=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function sc(e){return WM.test(e)}var ZM=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function pc(e){return ZM.test(e)}function mc(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var XM=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function cc(e){return XM.test(e)}var JM=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function uc(e){return JM.test(e)}var e0=/^(?:(?:[^\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;function lc(e){return e0.test(e)}var t0=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function dc(e){return t0.test(e)}var r0=/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;function fc(e){return r0.test(e)}var n0=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function gc(e){return n0.test(e)}var me=new Map;function B_(){me.clear()}function o0(){return[...me.entries()]}function i0(e,t){me.set(e,t)}function a0(e){return me.has(e)}function s0(e){return me.get(e)}function p0(e,t){return me.get(e)?.(t)??!0}function q_(){B_(),me.set("date-time",Wm),me.set("date",bi),me.set("duration",Zm),me.set("email",Xm),me.set("hostname",Jm),me.set("idn-email",ec),me.set("idn-hostname",rc),me.set("ipv4",nc),me.set("ipv6",oc),me.set("iri-reference",ic),me.set("iri",ac),me.set("json-pointer-uri-fragment",sc),me.set("json-pointer",pc),me.set("regex",mc),me.set("relative-json-pointer",cc),me.set("time",xi),me.set("uri-reference",uc),me.set("uri-template",lc),me.set("uri",dc),me.set("url",fc),me.set("uuid",gc)}q_();function yc(e,t,r,o){return uo.Test(r.format,o)}function H_(e,t,r,o,i,s){return yc(e,t,i,s)||t.AddError({keyword:"format",schemaPath:r,instancePath:o,params:{format:i.format}})}function K_(e,t,r,o){let i=Fm(r)?r.then:!0,s=xm(r)?r.else:!0;return $(e,t,r.if,o)?$(e,t,i,o):$(e,t,s,o)}function z_(e,t,r,o,i,s){let m=Fm(i)?i.then:!0,u=xm(i)?i.else:!0,l=new $e,g=K(e,l,`${r}/if`,o,i.if,s)?K(e,l,`${r}/then`,o,m,s)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"then"}}):K(e,t,`${r}/else`,o,u,s)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"else"}});return g&&t.Merge([l]),g}function m0(e,t,r,o){return a.Every(r.items,0,(i,s)=>a.IsLessEqualThan(o.length,s)||$(e,t,i,o[s])&&t.AddIndex(s))}function c0(e,t,r,o,i,s){return a.EveryAll(i.items,0,(m,u)=>{let l=`${r}/items/${u}`,g=`${o}/${u}`;return a.IsLessEqualThan(s.length,u)||K(e,t,l,g,m,s[u])&&t.AddIndex(u)})}function u0(e,t,r,o){let i=po(r)?r.prefixItems.length:0;return a.Every(o,i,(s,m)=>$(e,t,r.items,s)&&t.AddIndex(m))}function l0(e,t,r,o,i,s){let m=po(i)?i.prefixItems.length:0;return a.EveryAll(s,m,(u,l)=>{let g=`${r}/items`,E=`${o}/${l}`;return K(e,t,g,E,i.items,u)&&t.AddIndex(l)})}function V_(e,t,r,o){return Um(r)?m0(e,t,r,o):u0(e,t,r,o)}function Y_(e,t,r,o,i,s){return Um(i)?c0(e,t,r,o,i,s):l0(e,t,r,o,i,s)}function d0(e){return cn(e)}function Ec(e,t,r,o){if(!d0(r))return!0;let i=o.reduce((s,m)=>$(e,t,r.contains,m)?++s:s,0);return a.IsLessEqualThan(i,r.maxContains)}function Q_(e,t,r,o,i,s){let m=ln(i)?i.minContains:1;return Ec(e,t,i,s)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:m,maxContains:i.maxContains}})}function Ic(e,t,r,o){return a.IsLessEqualThan(o,r.maximum)}function W_(e,t,r,o,i,s){return Ic(e,t,i,s)||t.AddError({keyword:"maximum",schemaPath:r,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function Tc(e,t,r,o){return a.IsLessEqualThan(o.length,r.maxItems)}function Z_(e,t,r,o,i,s){return Tc(e,t,i,s)||t.AddError({keyword:"maxItems",schemaPath:r,instancePath:o,params:{limit:i.maxItems}})}function _c(e,t,r,o){return a.IsMaxLength(o,r.maxLength)}function X_(e,t,r,o,i,s){return _c(e,t,i,s)||t.AddError({keyword:"maxLength",schemaPath:r,instancePath:o,params:{limit:i.maxLength}})}function hc(e,t,r,o){return a.IsLessEqualThan(a.Keys(o).length,r.maxProperties)}function J_(e,t,r,o,i,s){return hc(e,t,i,s)||t.AddError({keyword:"maxProperties",schemaPath:r,instancePath:o,params:{limit:i.maxProperties}})}function f0(e){return cn(e)}function Oc(e,t,r,o){if(!f0(r))return!0;let i=o.reduce((s,m)=>$(e,t,r.contains,m)?++s:s,0);return a.IsGreaterEqualThan(i,r.minContains)}function eh(e,t,r,o,i,s){return Oc(e,t,i,s)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:i.minContains}})}function Ac(e,t,r,o){return a.IsGreaterEqualThan(o,r.minimum)}function th(e,t,r,o,i,s){return Ac(e,t,i,s)||t.AddError({keyword:"minimum",schemaPath:r,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function Sc(e,t,r,o){return a.IsGreaterEqualThan(o.length,r.minItems)}function rh(e,t,r,o,i,s){return Sc(e,t,i,s)||t.AddError({keyword:"minItems",schemaPath:r,instancePath:o,params:{limit:i.minItems}})}function bc(e,t,r,o){return a.IsMinLength(o,r.minLength)}function nh(e,t,r,o,i,s){return bc(e,t,i,s)||t.AddError({keyword:"minLength",schemaPath:r,instancePath:o,params:{limit:i.minLength}})}function xc(e,t,r,o){return a.IsGreaterEqualThan(a.Keys(o).length,r.minProperties)}function oh(e,t,r,o,i,s){return xc(e,t,i,s)||t.AddError({keyword:"minProperties",schemaPath:r,instancePath:o,params:{limit:i.minProperties}})}function Rc(e,t,r,o){return a.IsMultipleOf(o,r.multipleOf)}function ih(e,t,r,o,i,s){return Rc(e,t,i,s)||t.AddError({keyword:"multipleOf",schemaPath:r,instancePath:o,params:{multipleOf:i.multipleOf}})}function Cc(e,t,r,o){let i=new et;return!$(e,i,r.not,o)&&t.Merge([i])}function ah(e,t,r,o,i,s){return Cc(e,t,i,s)||t.AddError({keyword:"not",schemaPath:r,instancePath:o,params:{}})}function sh(e,t,r,o){let i=r.oneOf.reduce((s,m)=>{let u=new et;return $(e,u,m,o)?[...s,u]:s},[]);return a.IsEqual(i.length,1)&&t.Merge(i)}function ph(e,t,r,o,i,s){let m=[],u=[],l=i.oneOf.reduce((E,I,P)=>{let be=new $e,ve=`${r}/oneOf/${P}`,Co=K(e,be,ve,o,I,s);return Co&&u.push(P),Co||m.push(be),Co?[...E,be]:E},[]),g=a.IsEqual(l.length,1)&&t.Merge(l);return!g&&a.IsEqual(u.length,0)&&m.forEach(E=>E.GetErrors().forEach(I=>t.AddError(I))),g||t.AddError({keyword:"oneOf",schemaPath:r,instancePath:o,params:{passingSchemas:u}})}function Pc(e,t,r,o){return(a.IsString(r.pattern)?new RegExp(r.pattern):r.pattern).test(o)}function mh(e,t,r,o,i,s){return Pc(e,t,i,s)||t.AddError({keyword:"pattern",schemaPath:r,instancePath:o,params:{pattern:i.pattern}})}function ch(e,t,r,o){return a.Every(a.Entries(r.patternProperties),0,([i,s])=>{let m=new RegExp(i);return a.Every(a.Entries(o),0,([u,l])=>!m.test(u)||$(e,t,s,l)&&t.AddKey(u))})}function uh(e,t,r,o,i,s){return a.EveryAll(a.Entries(i.patternProperties),0,([m,u])=>{let l=`${r}/patternProperties/${m}`,g=new RegExp(m);return a.EveryAll(a.Entries(s),0,([E,I])=>{let P=`${o}/${E}`;return!g.test(E)||K(e,t,l,P,u,I)&&t.AddKey(E)})})}function lh(e,t,r,o){return a.IsEqual(o.length,0)||a.Every(r.prefixItems,0,(i,s)=>a.IsLessEqualThan(o.length,s)||$(e,t,i,o[s])&&t.AddIndex(s))}function dh(e,t,r,o,i,s){return a.IsEqual(s.length,0)||a.EveryAll(i.prefixItems,0,(m,u)=>{let l=`${r}/prefixItems/${u}`,g=`${o}/${u}`;return a.IsLessEqualThan(s.length,u)||K(e,t,l,g,m,s[u])&&t.AddIndex(u)})}function Uc(e,t){return e.includes(t)||Et.Get().exactOptionalPropertyTypes}function Nc(e,t){return a.IsUndefined(e[t])}function fh(e,t,r,o){let i=dn(r)?r.required:[];return a.Every(a.Entries(r.properties),0,([m,u])=>{let l=!a.HasPropertyKey(o,m)||$(e,t,u,o[m])&&t.AddKey(m);return Uc(i,m)?l:Nc(o,m)||l})}function gh(e,t,r,o,i,s){let m=dn(i)?i.required:[];return a.EveryAll(a.Entries(i.properties),0,([l,g])=>{let E=`${r}/properties/${l}`,I=`${o}/${l}`,P=()=>!a.HasPropertyKey(s,l)||K(e,t,E,I,g,s[l])&&t.AddKey(l);return Uc(m,l)?P():Nc(s,l)||P()})}function yh(e,t,r,o){return a.Every(a.Keys(o),0,(i,s)=>$(e,t,r.propertyNames,i))}function Eh(e,t,r,o,i,s){let m=[];return a.EveryAll(a.Keys(s),0,(l,g)=>{let E=`${o}/${l}`,I=`${r}/propertyNames`,P=new $e,be=K(e,P,I,E,i.propertyNames,l);return be||m.push(l),be})||t.AddError({keyword:"propertyNames",schemaPath:r,instancePath:o,params:{propertyNames:m}})}function Ih(e,t,r,o){let i=e.RecursiveRef(r.$recursiveRef)??!1;return D(i)&&$(e,t,i,o)}function Th(e,t,r,o,i,s){let m=e.RecursiveRef(i.$recursiveRef)??!1;return D(m)&&K(e,t,"#",o,m,s)}function Oh(e,t,r,o){let i=e.Ref(r.$ref)??!1,s=new et,m=D(i)&&$(e,s,i,o);return m&&t.Merge([s]),m}function Ah(e,t,r,o,i,s){let m=e.Ref(i.$ref)??!1,u=new $e,l=D(m)&&K(e,u,"#",o,m,s);return l&&t.Merge([u]),l||u.GetErrors().forEach(g=>t.AddError(g)),l}function Sh(e,t,r,o){return a.Every(r.required,0,i=>a.HasPropertyKey(o,i))}function bh(e,t,r,o,i,s){let m=[];return a.EveryAll(i.required,0,l=>{let g=a.HasPropertyKey(s,l);return g||m.push(l),g})||t.AddError({keyword:"required",schemaPath:r,instancePath:o,params:{requiredProperties:m}})}function Lc(e,t,r,o,i){return a.IsEqual(r,"object")?a.IsObjectNotArray(i):a.IsEqual(r,"array")?a.IsArray(i):a.IsEqual(r,"boolean")?a.IsBoolean(i):a.IsEqual(r,"integer")?a.IsInteger(i):a.IsEqual(r,"number")?a.IsNumber(i):a.IsEqual(r,"null")?a.IsNull(i):a.IsEqual(r,"string")?a.IsString(i):a.IsEqual(r,"asyncIterator")?a.IsAsyncIterator(i):a.IsEqual(r,"bigint")?a.IsBigInt(i):a.IsEqual(r,"constructor")?a.IsConstructor(i):a.IsEqual(r,"function")?a.IsFunction(i):a.IsEqual(r,"iterator")?a.IsIterator(i):a.IsEqual(r,"symbol")?a.IsSymbol(i):a.IsEqual(r,"undefined")?a.IsUndefined(i):a.IsEqual(r,"void")?a.IsUndefined(i):!0}function xh(e,t,r,o,i){return r.some(s=>Lc(e,t,s,o,i))}function Rh(e,t,r,o){return a.IsArray(r.type)?xh(e,t,r.type,r,o):Lc(e,t,r.type,r,o)}function Ch(e,t,r,o,i,s){return(a.IsArray(i.type)?xh(e,t,i.type,i,s):Lc(e,t,i.type,i,s))||t.AddError({keyword:"type",schemaPath:r,instancePath:o,params:{type:i.type}})}function Ph(e,t,r,o){let i=t.GetIndices();return a.Every(o,0,(s,m)=>(i.has(m)||$(e,t,r.unevaluatedItems,s))&&t.AddIndex(m))}function Uh(e,t,r,o,i,s){let m=t.GetIndices(),u=[];return a.EveryAll(s,0,(g,E)=>{let I=new $e,P=(m.has(E)||K(e,I,r,o,i.unevaluatedItems,g))&&t.AddIndex(E);return P||u.push(E),P})||t.AddError({keyword:"unevaluatedItems",schemaPath:r,instancePath:o,params:{unevaluatedItems:u}})}function Nh(e,t,r,o){let i=t.GetKeys();return a.Every(a.Entries(o),0,([s,m])=>i.has(s)||$(e,t,r.unevaluatedProperties,m)&&t.AddKey(s))}function Lh(e,t,r,o,i,s){let m=t.GetKeys(),u=[];return a.EveryAll(a.Entries(s),0,([g,E])=>{let I=new $e,P=m.has(g)||K(e,I,r,o,i.unevaluatedProperties,E)&&t.AddKey(g);return P||u.push(g),P})||t.AddError({keyword:"unevaluatedProperties",schemaPath:r,instancePath:o,params:{unevaluatedProperties:u}})}function kh(e){return!a.IsEqual(e.uniqueItems,!1)}function Mh(e,t,r,o){if(!kh(r))return!0;let i=new Set(o.map(hr.Hash)).size,s=o.length;return a.IsEqual(i,s)}function wh(e,t,r,o,i,s){if(!kh(i))return!0;let m=new Set,u=s.reduce((g,E,I)=>{let P=hr.Hash(E);return m.has(P)?[...g,I]:(m.add(P),g)},[]);return a.IsEqual(u.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:r,instancePath:o,params:{duplicateItems:u}})}function $(e,t,r,o){e.Push(r);let i=cs(r)?Hm(e,t,r,o):(!Bm(r)||Rh(e,t,r,o))&&(!(a.IsObject(o)&&!a.IsArray(o))||(!dn(r)||Sh(e,t,r,o))&&(!rr(r)||A_(e,t,r,o))&&(!Om(r)||L_(e,t,r,o))&&(!Am(r)||M_(e,t,r,o))&&(!Sm(r)||$_(e,t,r,o))&&(!Oi(r)||ch(e,t,r,o))&&(!Ai(r)||fh(e,t,r,o))&&(!Gm(r)||yh(e,t,r,o))&&(!_i(r)||xc(e,t,r,o))&&(!Mm(r)||hc(e,t,r,o)))&&(!a.IsArray(o)||(!Im(r)||__(e,t,r,o))&&(!cn(r)||zm(e,t,r,o))&&(!ao(r)||V_(e,t,r,o))&&(!Lm(r)||Ec(e,t,r,o))&&(!us(r)||Tc(e,t,r,o))&&(!ln(r)||Oc(e,t,r,o))&&(!so(r)||Sc(e,t,r,o))&&(!po(r)||lh(e,t,r,o))&&(!mo(r)||Mh(e,t,r,o)))&&(!a.IsString(o)||(!Ii(r)||yc(e,t,r,o))&&(!km(r)||_c(e,t,r,o))&&(!Ti(r)||bc(e,t,r,o))&&(!hi(r)||Pc(e,t,r,o)))&&(!(a.IsNumber(o)||a.IsBigInt(o))||(!Cm(r)||Ym(e,t,r,o))&&(!nr(r)||Qm(e,t,r,o))&&(!Nm(r)||Ic(e,t,r,o))&&(!or(r)||Ac(e,t,r,o))&&(!wm(r)||Rc(e,t,r,o)))&&(!vm(r)||Ih(e,t,r,o))&&(!jm(r)||Oh(e,t,r,o))&&(!ym(r)||g_(e,t,r,o))&&(!hm(r)||Km(e,t,r,o))&&(!Rm(r)||Vm(e,t,r,o))&&(!Pm(r)||K_(e,t,r,o))&&(!$m(r)||Cc(e,t,r,o))&&(!Tm(r)||b_(e,t,r,o))&&(!_m(r)||R_(e,t,r,o))&&(!Dm(r)||sh(e,t,r,o))&&(!ds(r)||!a.IsArray(o)||Ph(e,t,r,o))&&(!fs(r)||!a.IsObject(o)||Nh(e,t,r,o))&&(!Em(r)||E_(e,t,r,o));return e.Pop(r),i}function K(e,t,r,o,i,s){e.Push(i);let m=cs(i)?P_(e,t,r,o,i,s):!!(+(!Bm(i)||Ch(e,t,r,o,i,s))&+(!(a.IsObject(s)&&!a.IsArray(s))||!!(+(!dn(i)||bh(e,t,r,o,i,s))&+(!rr(i)||S_(e,t,r,o,i,s))&+(!Om(i)||k_(e,t,r,o,i,s))&+(!Am(i)||w_(e,t,r,o,i,s))&+(!Sm(i)||D_(e,t,r,o,i,s))&+(!Oi(i)||uh(e,t,r,o,i,s))&+(!Ai(i)||gh(e,t,r,o,i,s))&+(!Gm(i)||Eh(e,t,r,o,i,s))&+(!_i(i)||oh(e,t,r,o,i,s))&+(!Mm(i)||J_(e,t,r,o,i,s))))&+(!a.IsArray(s)||!!(+(!Im(i)||h_(e,t,r,o,i,s))&+(!cn(i)||N_(e,t,r,o,i,s))&+(!ao(i)||Y_(e,t,r,o,i,s))&+(!Lm(i)||Q_(e,t,r,o,i,s))&+(!us(i)||Z_(e,t,r,o,i,s))&+(!ln(i)||eh(e,t,r,o,i,s))&+(!so(i)||rh(e,t,r,o,i,s))&+(!po(i)||dh(e,t,r,o,i,s))&+(!mo(i)||wh(e,t,r,o,i,s))))&+(!a.IsString(s)||!!(+(!Ii(i)||H_(e,t,r,o,i,s))&+(!km(i)||X_(e,t,r,o,i,s))&+(!Ti(i)||nh(e,t,r,o,i,s))&+(!hi(i)||mh(e,t,r,o,i,s))))&+(!(a.IsNumber(s)||a.IsBigInt(s))||!!(+(!Cm(i)||v_(e,t,r,o,i,s))&+(!nr(i)||j_(e,t,r,o,i,s))&+(!Nm(i)||W_(e,t,r,o,i,s))&+(!or(i)||th(e,t,r,o,i,s))&+(!wm(i)||ih(e,t,r,o,i,s))))&+(!vm(i)||Th(e,t,r,o,i,s))&+(!jm(i)||Ah(e,t,r,o,i,s))&+(!ym(i)||y_(e,t,r,o,i,s))&+(!hm(i)||U_(e,t,r,o,i,s))&+(!Rm(i)||G_(e,t,r,o,i,s))&+(!Pm(i)||z_(e,t,r,o,i,s))&+(!$m(i)||ah(e,t,r,o,i,s))&+(!Tm(i)||x_(e,t,r,o,i,s))&+(!_m(i)||C_(e,t,r,o,i,s))&+(!Dm(i)||ph(e,t,r,o,i,s))&+(!ds(i)||!a.IsArray(s)||Uh(e,t,r,o,i,s))&+(!fs(i)||!a.IsObject(s)||Lh(e,t,r,o,i,s)))&&(!Em(i)||I_(e,t,r,o,i,s));return e.Pop(i),m}var gn={};Ot(gn,{Ref:()=>R0});var ir={};Ot(ir,{Delete:()=>h0,Get:()=>T0,Has:()=>I0,Indices:()=>Ri,Set:()=>_0});function $h(e){if(e.length===0)throw Error("Cannot set root")}function Dh(e){if(!a.IsObject(e))throw Error("Cannot set value")}function g0(e){return/^(0|[1-9]\d*)$/.test(e)}function Gh(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function y0(e,t){return a.IsObject(t)&&a.HasPropertyKey(t,e)}function E0(e,t){return a.IsObject(t)?t[e]:void 0}function kc(e,t){return e.reduce((r,o)=>E0(o,r),t)}function Ri(e){if(a.IsEqual(e.length,0))return[];let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function I0(e,t){let r=e;return Ri(t).every(o=>y0(o,r)?(r=r[o],!0):!1)}function T0(e,t){let r=Ri(t);return kc(r,e)}function _0(e,t,r){let o=Ri(t);$h(o);let[i,s]=Gh(o),m=kc(i,e);return Dh(m),m[s]=r,e}function h0(e,t){let r=Ri(t);$h(r);let[o,i]=Gh(r),s=kc(o,e);return Dh(s),a.IsArray(s)&&g0(i)?s.splice(+i,1):delete s[i],e}function O0(e,t,r){if(e.$id===r.hash)return e;let o=new URL(e.$id,t.href),i=new URL(r.href,t.href);if(a.IsEqual(o.pathname,i.pathname))return r.hash.startsWith("#")?vh(e,t,r):e}function A0(e,t,r){let o=new URL(`#${e.$anchor}`,t.href),i=new URL(r.href,t.href);if(a.IsEqual(o.href,i.href))return e}function vh(e,t,r){return r.href.endsWith("#")?e:r.hash.startsWith("#")?ir.Get(e,decodeURIComponent(r.hash.slice(1))):void 0}function S0(e,t,r){if(un(e)){let o=O0(e,t,r);if(!a.IsUndefined(o))return o}if(Ei(e)){let o=A0(e,t,r);if(!a.IsUndefined(o))return o}return vh(e,t,r)}function b0(e,t,r){return e.reduce((o,i)=>{let s=Mc(i,t,r);return a.IsUndefined(s)?o:s},void 0)}function x0(e,t,r){return a.Keys(e).reduce((o,i)=>{let s=Mc(e[i],t,r);return a.IsUndefined(s)?o:s},void 0)}function Mc(e,t,r){if(t=tr(e)&&un(e)?new URL(e.$id,t.href):t,tr(e)){let o=S0(e,t,r);if(!a.IsUndefined(o))return o}if(a.IsArray(e))return b0(e,t,r);if(a.IsObject(e))return x0(e,t,r)}function R0(e,t){let r=new URL("http://unknown"),o=un(e)?new URL(e.$id,r.href):r,i=new URL(t,o.href);return Mc(e,o,i)}var yn=class{constructor(t,r){this.context=t,this.schema=r,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,r)=>new URL(r.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){tr(t)&&(un(t)&&this.ids.push(t),Ei(t)&&this.anchors.push(t),ls(t)&&this.recursiveAnchors.push(t),bm(t)&&this.dynamicAnchors.push(t))}Pop(t){tr(t)&&(un(t)&&this.ids.pop(),Ei(t)&&this.anchors.pop(),ls(t)&&this.recursiveAnchors.pop(),bm(t)&&this.dynamicAnchors.pop())}FromContext(t){return a.HasPropertyKey(this.context,t)?this.context[t]:void 0}FromRef(t){return t.startsWith("#")?gn.Ref(this.Base(),t):gn.Ref(this.schema,t)}Ref(t){return this.FromContext(t)??this.FromRef(t)}RecursiveRef(t){return ls(this.Base())?gn.Ref(this.recursiveAnchors[0],t):gn.Ref(this.Base(),t)}};function jh(...e){let[t,r,o]=te.Match(e,{3:(m,u,l)=>[m,u,l],2:(m,u)=>[{},m,u]}),i=new yn(t,r),s=new et;return $(i,s,r,o)}function Fh(...e){let[t,r,o]=te.Match(e,{3:(E,I,P)=>[E,I,P],2:(E,I)=>[{},E,I]}),i=Et.Get(),s=Dl(),m=[],u=new yn(t,r),l=new Si(E=>{if(!a.IsGreaterEqualThan(m.length,i.maxErrors))return m.push({...E,message:s(E)})});return[K(u,l,"#","",r,o),m]}function se(...e){let[t,r,o]=te.Match(e,{3:(i,s,m)=>[i,s,m],2:(i,s)=>[{},i,s]});return jh(t,r,o)}function $r(...e){let[t,r,o]=te.Match(e,{3:(m,u,l)=>[m,u,l],2:(m,u)=>[{},m,u]}),[i,s]=Fh(t,r,o);return s}var Dr=class extends Error{constructor(t,r,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:r},writable:!1,configurable:!1,enumerable:!1})}};function Bh(e,t,r){return a.IsArray(r)?r.map(o=>Ge(e,t.items,o)):r}function qh(e,t,r){return t.Clean(r)}function Hh(e,t,r){return Ge({...e,...t.$defs},he(t.$ref),r)}function P0(e){let t=a.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},r=Lt(e);return M(r)?Ja(r,t):r}function Kh(e,t,r){let o=P0(t);return Ge(e,o,r)}function gs(e){return a.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function zh(e,t,r){if(!a.IsObject(r)||a.IsArray(r))return r;let o=gs(t);for(let i of a.Keys(r)){if(a.HasPropertyKey(t.properties,i)){r[i]=Ge(e,t.properties[i],r[i]);continue}if(a.IsBoolean(o)&&a.IsEqual(o,!0)||A(o)&&se(e,o,r[i])){r[i]=Ge(e,o,r[i]);continue}delete r[i]}return r}function Vh(e,t,r){if(!a.IsObject(r))return r;let o=gs(t),[i,s]=[new RegExp(ut(t)),qe(t)];for(let m of a.Keys(r)){if(i.test(m)){r[m]=Ge(e,s,r[m]);continue}if(a.IsBoolean(o)&&a.IsEqual(o,!0)||A(o)&&se(e,o,r[m])){r[m]=Ge(e,o,r[m]);continue}delete r[m]}return r}function Yh(e,t,r){return a.HasPropertyKey(e,t.$ref)?Ge(e,e[t.$ref],r):r}function Qh(e,t,r){if(!a.IsArray(r))return r;let o=Math.min(r.length,t.items.length);for(let i=0;i<o;i++)r[i]=Ge(e,t.items[i],r[i]);return a.IsGreaterThan(r.length,o)?r.slice(0,o):r}function U0(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=pe(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=pe(e[r]);return t}function N0(e){return a.IsClassInstance(e)?e:U0(e)}function L0(e){return e.map(t=>pe(t))}function k0(e){return e.slice()}function M0(e){return new Map(pe([...e.entries()]))}function w0(e){return new Set(pe([...e.values()]))}function pe(e){return Qe.IsTypeArray(e)?k0(e):Qe.IsMap(e)?M0(e):Qe.IsSet(e)?w0(e):a.IsArray(e)?L0(e):a.IsObject(e)?N0(e):e}function Wh(e,t,r){for(let o of t.anyOf){let i=Ge(e,o,pe(r));if(se(e,o,i))return i}return r}function Ge(e,t,r){return X(t)?Bh(e,t,r):It(t)?qh(e,t,r):ae(t)?Hh(e,t,r):U(t)?Kh(e,t,r):M(t)?zh(e,t,r):de(t)?Vh(e,t,r):ie(t)?Yh(e,t,r):H(t)?Qh(e,t,r):O(t)?Wh(e,t,r):r}function In(...e){let[t,r,o]=te.Match(e,{3:(i,s,m)=>[i,s,m],2:(i,s)=>[{},i,s]});return Ge(t,r,o)}function Zh(e,t,r){return a.IsArray(r)?r.map(o=>Ae(e,t.items,o)):r}function Xh(e,t,r){return t.Convert(r)}var ee={};Ot(ee,{Fail:()=>Tn,IsOk:()=>$c,Ok:()=>C,TryBigInt:()=>Dc,TryBoolean:()=>ew,TryNull:()=>sw,TryNumber:()=>yw,TryString:()=>Aw,TryUndefined:()=>Uw});function $c(e){return a.IsObject(e)&&a.HasPropertyKey(e,"value")}function C(e){return{value:e}}function Tn(){}function $0(e){return C(e)}function D0(e){return a.IsEqual(e,!0)?C(BigInt(1)):C(BigInt(0))}function G0(e){return C(BigInt(Math.trunc(e)))}function v0(e){return C(BigInt(0))}var j0=/^-?(0|[1-9]\d*)n$/,F0=/^-?(0|[1-9]\d*)\.\d+$/,B0=/^-?(0|[1-9]\d*)$/;function q0(e){return j0.test(e)}function H0(e){return F0.test(e)}function K0(e){return B0.test(e)}function z0(e){let t=e.toLowerCase();return q0(e)?C(BigInt(e.slice(0,e.length-1))):H0(e)?C(BigInt(e.split(".")[0])):K0(e)?C(BigInt(e)):a.IsEqual(t,"false")?C(BigInt(0)):a.IsEqual(t,"true")?C(BigInt(1)):void 0}function V0(e){return C(BigInt(0))}function Dc(e){return a.IsBigInt(e)?$0(e):a.IsBoolean(e)?D0(e):a.IsNumber(e)?G0(e):a.IsNull(e)?v0(e):a.IsString(e)?z0(e):a.IsUndefined(e)?V0(e):void 0}function Y0(e){return a.IsEqual(e,BigInt(0))?C(!1):a.IsEqual(e,BigInt(1))?C(!0):void 0}function Q0(e){return C(e)}function W0(e){return a.IsEqual(e,0)?C(!1):a.IsEqual(e,1)?C(!0):void 0}function Z0(e){return C(!1)}function X0(e){return a.IsEqual(e.toLowerCase(),"false")?C(!1):a.IsEqual(e.toLowerCase(),"true")?C(!0):a.IsEqual(e,"0")?C(!1):a.IsEqual(e,"1")?C(!0):void 0}function J0(e){return C(!1)}function ew(e){return a.IsBigInt(e)?Y0(e):a.IsBoolean(e)?Q0(e):a.IsNumber(e)?W0(e):a.IsNull(e)?Z0(e):a.IsString(e)?X0(e):a.IsUndefined(e)?J0(e):void 0}function tw(e){return a.IsEqual(e,BigInt(0))?C(null):void 0}function rw(e){return a.IsEqual(e,!1)?C(null):void 0}function nw(e){return a.IsEqual(e,0)?C(null):void 0}function ow(e){return C(null)}function iw(e){let t=e.toLowerCase();return a.IsEqual(t,"undefined")||a.IsEqual(t,"null")||a.IsEqual(e,"")||a.IsEqual(e,"0")?C(null):void 0}function aw(e){return C(null)}function sw(e){return a.IsBigInt(e)?tw(e):a.IsBoolean(e)?rw(e):a.IsNumber(e)?nw(e):a.IsNull(e)?ow(e):a.IsString(e)?iw(e):a.IsUndefined(e)?aw(e):void 0}var pw=BigInt(Number.MAX_SAFE_INTEGER),mw=BigInt(Number.MIN_SAFE_INTEGER);function cw(e){return e<=pw&&e>=mw}function Jh(e){return cw(e)?C(Number(e)):void 0}function uw(e){return e?C(1):C(0)}function lw(e){return C(e)}function dw(e){return C(0)}function fw(e){let t=+e;if(a.IsNumber(t))return C(t);let r=e.toLowerCase();if(a.IsEqual(r,"false"))return C(0);if(a.IsEqual(r,"true"))return C(1);let o=Dc(e);return $c(o)?Jh(o.value):void 0}function gw(e){return C(0)}function yw(e){return a.IsBigInt(e)?Jh(e):a.IsBoolean(e)?uw(e):a.IsNumber(e)?lw(e):a.IsNull(e)?dw(e):a.IsString(e)?fw(e):a.IsUndefined(e)?gw(e):void 0}function Ew(e){return C(e.toString())}function Iw(e){return C(e.toString())}function Tw(e){return C(e.toString())}function _w(e){return C("null")}function hw(e){return C(e)}function Ow(e){return C("")}function Aw(e){return a.IsBigInt(e)?Ew(e):a.IsBoolean(e)?Iw(e):a.IsNumber(e)?Tw(e):a.IsNull(e)?_w(e):a.IsString(e)?hw(e):a.IsUndefined(e)?Ow(e):void 0}function Sw(e){return a.IsEqual(e,BigInt(0))?C(void 0):void 0}function bw(e){return a.IsEqual(e,!1)?C(void 0):void 0}function xw(e){return a.IsEqual(e,0)?C(void 0):void 0}function Rw(e){return C(void 0)}function Cw(e){let t=e.toLowerCase();return a.IsEqual(t,"undefined")||a.IsEqual(t,"null")||a.IsEqual(e,"")||a.IsEqual(e,"0")?C(void 0):void 0}function Pw(e){return C(void 0)}function Uw(e){return a.IsBigInt(e)?Sw(e):a.IsBoolean(e)?bw(e):a.IsNumber(e)?xw(e):a.IsNull(e)?Rw(e):a.IsString(e)?Cw(e):a.IsUndefined(e)?Pw(e):void 0}function eO(e,t,r){if(a.IsBigInt(r))return r;let o=ee.TryBigInt(r);return ee.IsOk(o)?o.value:r}function tO(e,t,r){if(a.IsBoolean(r))return r;let o=ee.TryBoolean(r);return ee.IsOk(o)?o.value:r}function rO(e,t,r){return Ae({...e,...t.$defs},he(t.$ref),r)}function ys(e,t,r){if(t.anyOf.some(m=>se(e,m,r)))return r;let s=t.anyOf.map(m=>Ae(e,m,pe(r))).find(m=>se(e,t,m));return a.IsUndefined(s)?r:s}function nO(e,t,r){let o=tn(t);return ys(e,o,r)}function oO(e,t,r){if(a.IsInteger(r))return r;let o=ee.TryNumber(r);return ee.IsOk(o)?Math.trunc(o.value):r}function iO(e,t,r){let o=Lt(t);return Ae(e,o,r)}function Nw(e,t,r){let o=ee.TryBigInt(r);return ee.IsOk(o)&&a.IsEqual(t.const,o.value)?o.value:r}function Lw(e,t,r){let o=ee.TryBoolean(r);return ee.IsOk(o)&&a.IsEqual(t.const,o.value)?o.value:r}function kw(e,t,r){let o=ee.TryNumber(r);return ee.IsOk(o)&&a.IsEqual(t.const,o.value)?o.value:r}function Mw(e,t,r){let o=ee.TryString(r);return ee.IsOk(o)&&a.IsEqual(t.const,o.value)?o.value:r}function aO(e,t,r){return a.IsEqual(t.const,r)?r:Kl(t)?Nw(e,t,r):zl(t)?Lw(e,t,r):Mn(t)?kw(e,t,r):wn(t)?Mw(e,t,r):F()}function sO(e,t,r){if(a.IsNull(r))return r;let o=ee.TryNull(r);return ee.IsOk(o)?o.value:r}function pO(e,t,r){if(a.IsNumber(r))return r;let o=ee.TryNumber(r);return ee.IsOk(o)?o.value:r}function Es(e,t,r,o){let i=a.Keys(o);for(let[s,m]of t)for(let u of i)s.test(u)||(o[u]=Ae(e,r,o[u]));return o}function Ci(e,t,r){return xe(e)&&a.IsUndefined(r[t])}function ww(e,t,r){let o=a.EntriesRegExp(t.properties),i=a.Keys(r);for(let[s,m]of o)for(let u of i)!s.test(u)||Ci(m,u,r)||(r[u]=Ae(e,m,r[u]));return a.HasPropertyKey(t,"additionalProperties")&&a.IsObject(t.additionalProperties)?Es(e,o,t.additionalProperties,r):r}function mO(e,t,r){return a.IsObjectNotArray(r)?ww(e,t,r):r}function $w(e,t,r){let o=a.EntriesRegExp(t.patternProperties),i=a.Keys(r);for(let[s,m]of o)for(let u of i)s.test(u)&&(r[u]=Ae(e,m,r[u]));return a.HasPropertyKey(t,"additionalProperties")&&a.IsObject(t.additionalProperties)?Es(e,o,t.additionalProperties,r):r}function cO(e,t,r){return a.IsObjectNotArray(r)?$w(e,t,r):r}function uO(e,t,r){return a.HasPropertyKey(e,t.$ref)?Ae(e,e[t.$ref],r):r}function lO(e,t,r){if(a.IsString(r))return r;let o=ee.TryString(r);return ee.IsOk(o)?o.value:r}function dO(e,t,r){let o=He(t.pattern);return Ae(e,o,r)}function fO(e,t,r){if(!a.IsArray(r))return r;for(let o=0;o<Math.min(t.items.length,r.length);o++)r[o]=Ae(e,t.items[o],r[o]);return r}function gO(e,t,r){if(a.IsUndefined(r))return r;let o=ee.TryUndefined(r);return ee.IsOk(o)?o.value:r}function yO(e,t,r){if(a.IsUndefined(r))return r;let o=ee.TryUndefined(r);return ee.IsOk(o)?void 0:r}function Ae(e,t,r){return X(t)?Zh(e,t,r):It(t)?Xh(e,t,r):ct(t)?eO(e,t,r):Xe(t)?tO(e,t,r):ae(t)?rO(e,t,r):Ie(t)?nO(e,t,r):ke(t)?oO(e,t,r):U(t)?iO(e,t,r):V(t)?aO(e,t,r):Gt(t)?sO(e,t,r):le(t)?pO(e,t,r):M(t)?mO(e,t,r):de(t)?cO(e,t,r):ie(t)?uO(e,t,r):Oe(t)?lO(e,t,r):Te(t)?dO(e,t,r):H(t)?fO(e,t,r):Bt(t)?gO(e,t,r):O(t)?ys(e,t,r):lt(t)?yO(e,t,r):r}function Gr(...e){let[t,r,o]=te.Match(e,{3:(i,s,m)=>[i,s,m],2:(i,s)=>[{},i,s]});return Ae(t,r,o)}function EO(e,t,r){if(!a.IsArray(r))return r;for(let o=0;o<r.length;o++)r[o]=Ne(e,t.items,r[o]);return r}function IO(e,t,r){return t.Default(r)}function TO(e,t,r){return Ne({...e,...t.$defs},he(t.$ref),r)}function _O(e,t){return a.IsUndefined(t)?a.IsFunction(e.default)?e.default():pe(e.default):t}function hO(e,t,r){let o=Lt(t);return Ne(e,o,r)}function OO(e,t,r){if(!a.IsObject(r))return r;let o=a.Keys(t.properties);for(let i of o){let s=Ne(e,t.properties[i],r[i]);a.IsUndefined(s)&&(xe(t.properties[i])||!a.HasPropertyKey(t.properties[i],"default"))||(r[i]=Ne(e,t.properties[i],r[i]))}if(!rr(t)||a.IsBoolean(t.additionalProperties))return r;for(let i of a.Keys(r))o.includes(i)||(r[i]=Ne(e,t.additionalProperties,r[i]));return r}function AO(e,t,r){if(!a.IsObject(r))return r;let[o,i]=[new RegExp(ut(t)),qe(t)];for(let s of a.Keys(r))o.test(s)&&ht(i)&&(r[s]=Ne(e,i,r[s]));if(!rr(t))return r;for(let s of a.Keys(r))o.test(s)||(r[s]=Ne(e,t.additionalProperties,r[s]));return r}function SO(e,t,r){return a.HasPropertyKey(e,t.$ref)?Ne(e,e[t.$ref],r):r}function bO(e,t,r){if(!a.IsArray(r))return r;let[o,i]=[t.items,Math.max(t.items.length,r.length)];for(let s=0;s<i;s++)s<o.length&&(r[s]=Ne(e,o[s],r[s]));return r}function xO(e,t,r){for(let o of t.anyOf){let i=Ne(e,o,pe(r));if(se(e,o,i))return i}return r}function Ne(e,t,r){let o=ht(t)?_O(t,r):r;return X(t)?EO(e,t,o):It(t)?IO(e,t,o):ae(t)?TO(e,t,o):U(t)?hO(e,t,o):M(t)?OO(e,t,o):de(t)?AO(e,t,o):ie(t)?SO(e,t,o):H(t)?bO(e,t,o):O(t)?xO(e,t,o):o}function _n(...e){let[t,r,o]=te.Match(e,{3:(i,s,m)=>[i,s,m],2:(i,s)=>[{},i,s]});return Ne(t,r,o)}function lo(e){return(...t)=>{let[r,o,i]=te.Match(t,{3:(s,m,u)=>[s,m,u],2:(s,m)=>[{},s,m]});return e.reduce((s,m)=>m(r,o,s),i)}}function Dw(e,t,r){return t["~codec"].decode(r)}function Gw(e,t,r){return t["~codec"].encode(r)}function ye(e,t,r,o){return Wr(r)?a.IsEqual(e,"Decode")?Dw(t,r,o):Gw(t,r,o):o}function vw(e,t,r,o){if(!a.IsArray(o))return F();for(let i=0;i<o.length;i++)o[i]=ce(e,t,r.items,o[i]);return ye(e,t,r,o)}function jw(e,t,r,o){let i=ye(e,t,r,o);if(!a.IsArray(i))return i;for(let s=0;s<i.length;s++)i[s]=ce(e,t,r.items,i[s]);return i}function RO(e,t,r,o){return a.IsEqual(e,"Decode")?vw(e,t,r,o):jw(e,t,r,o)}function CO(e,t,r,o){return o=ce(e,{...t,...r.$defs},he(r.$ref),o),ye(e,t,r,o)}function Fw(e,t,r,o){for(let i of r.allOf)o=ce(e,t,i,o);return ye(e,t,r,o)}function Bw(e,t,r,o){let i=ye(e,t,r,o);for(let s of r.allOf)i=ce(e,t,s,i);return i}function PO(e,t,r,o){return a.IsEqual(e,"Decode")?Fw(e,t,r,o):Bw(e,t,r,o)}function qw(e,t,r,o){if(!a.IsObjectNotArray(o))return F();for(let i of a.Keys(r.properties))!a.HasPropertyKey(o,i)||Ci(r.properties[i],i,o)||(o[i]=ce(e,t,r.properties[i],o[i]));return ye(e,t,r,o)}function Hw(e,t,r,o){let i=ye(e,t,r,o);if(!a.IsObjectNotArray(i))return i;for(let s of a.Keys(r.properties))!a.HasPropertyKey(i,s)||Ci(r.properties[s],s,i)||(i[s]=ce(e,t,r.properties[s],i[s]));return i}function UO(e,t,r,o){return a.IsEqual(e,"Decode")?qw(e,t,r,o):Hw(e,t,r,o)}function Kw(e,t,r,o){if(!a.IsObjectNotArray(o))return F();let i=new RegExp(ut(r));for(let s of a.Keys(o))i.test(s)||F(),o[s]=ce(e,t,qe(r),o[s]);return ye(e,t,r,o)}function zw(e,t,r,o){let i=ye(e,t,r,o);if(!a.IsObjectNotArray(i))return i;let s=new RegExp(ut(r));for(let m of a.Keys(i))s.test(m)&&(i[m]=ce(e,t,qe(r),i[m]));return i}function NO(e,t,r,o){return a.IsEqual(e,"Decode")?Kw(e,t,r,o):zw(e,t,r,o)}function LO(e,t,r,o){return o=a.HasPropertyKey(t,r.$ref)?ce(e,t,t[r.$ref],o):o,ye(e,t,r,o)}function Vw(e,t,r,o){if(!a.IsArray(o))return F();for(let i=0;i<Math.min(r.items.length,o.length);i++)o[i]=ce(e,t,r.items[i],o[i]);return ye(e,t,r,o)}function Yw(e,t,r,o){let i=ye(e,t,r,o);if(!a.IsArray(i))return o;for(let s=0;s<Math.min(r.items.length,i.length);s++)i[s]=ce(e,t,r.items[s],i[s]);return i}function kO(e,t,r,o){return a.IsEqual(e,"Decode")?Vw(e,t,r,o):Yw(e,t,r,o)}function Qw(e,t,r,o){for(let i of r.anyOf){if(!se(t,i,o))continue;let s=ce(e,t,i,o);return ye(e,t,r,s)}return F()}function Ww(e,t,r,o){let i=ye(e,t,r,o);for(let s of r.anyOf){let m=ce(e,t,s,pe(i));if(se(t,s,m))return m}return i}function MO(e,t,r,o){return a.IsEqual(e,"Decode")?Qw(e,t,r,o):Ww(e,t,r,o)}function ce(e,t,r,o){return X(r)?RO(e,t,r,o):ae(r)?CO(e,t,r,o):U(r)?PO(e,t,r,o):M(r)?UO(e,t,r,o):de(r)?NO(e,t,r,o):ie(r)?LO(e,t,r,o):H(r)?kO(e,t,r,o):O(r)?MO(e,t,r,o):ye(e,t,r,o)}var Gc=class extends Dr{constructor(t,r){super("Decode",t,r)}};function Zw(e,t,r){if(!se(e,t,r))throw new Gc(r,$r(e,t,r));return r}function Xw(e,t,r){return ce("Decode",e,t,r)}var IPe=lo([(e,t,r)=>pe(r),(e,t,r)=>_n(e,t,r),(e,t,r)=>Gr(e,t,r),(e,t,r)=>In(e,t,r),(e,t,r)=>Zw(e,t,r),(e,t,r)=>Xw(e,t,r)]);var vc=class extends Dr{constructor(t,r){super("Encode",t,r)}};function Jw(e,t,r){if(!se(e,t,r))throw new vc(r,$r(e,t,r));return r}function e$(e,t,r){return ce("Encode",e,t,r)}var UPe=lo([(e,t,r)=>pe(r),(e,t,r)=>e$(e,t,r),(e,t,r)=>_n(e,t,r),(e,t,r)=>Gr(e,t,r),(e,t,r)=>In(e,t,r),(e,t,r)=>Jw(e,t,r)]);var St=class extends Error{constructor(t,r){super(r),this.type=t}};function wO(e,t){return a.IsFunction(t.default)?t.default(t):a.IsObject(t.default)?pe(t.default):t.default}function $O(e,t){if(mo(t)&&!ht(t))throw new St(t,"Arrays with uniqueItems constraints must specify a default annotation");let r=so(t)?t.minItems:0;return Array.from({length:r},()=>ue(e,t.items))}async function*t$(){}function DO(e,t){return t$()}function GO(e,t){return t.Create()}function vO(e,t){return nr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):or(t)?BigInt(t.minimum):BigInt(0)}function jO(e,t){return!1}function FO(e,t){let r=ue(e,t.instanceType);return class{constructor(){Object.assign(this,r)}}}function BO(e,t){return ue({...e,...t.$defs},he(t.$ref))}function qO(e,t){return ue(e,tn(t))}function HO(e,t){let r=ue(e,t.returnType);return()=>r}function KO(e,t){return nr(t)&&a.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:or(t)?t.minimum:0}function zO(e,t){return ue(e,Lt(t))}function*r$(){}function VO(e,t){return r$()}function YO(e,t){return t.const}function QO(e,t){throw new St(t,"Cannot create TNever types")}function WO(e,t){return null}function ZO(e,t){return nr(t)&&a.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:or(t)?t.minimum:0}function XO(e,t){return(a.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:ue(e,t.properties[i])}),{})}function JO(e,t){return Promise.resolve(ue(e,t.item))}function eA(e,t){if(_i(t)&&!ht(t))throw new St(t,"Record with the minProperties constraint must have a default annotation");return{}}function tA(e,t){return a.HasPropertyKey(e,t.$ref)?ue(e,e[t.$ref]):(()=>{throw new St(t,"Unable to deref Ref")})()}function rA(e,t){if((hi(t)||Ii(t))&&!ht(t))throw Error("Strings with format or pattern constraints must specify default");let o=Ti(t)?t.minLength:0;return"".padEnd(o)}function nA(e,t){return Symbol()}function oA(e,t){let r=He(t.pattern);if(Oe(r))throw new St(t,"Unable to create TemplateLiteral due to infinite type expansion");return ue(e,r)}function iA(e,t){return Array.from({length:t.minItems},(r,o)=>ue(e,t.items[o]))}function aA(e,t){if(a.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return ue(e,t.anyOf[0])}function ue(e,t){return ht(t)?wO(e,t):X(t)?$O(e,t):ze(t)?DO(e,t):It(t)?GO(e,t):ct(t)?vO(e,t):Xe(t)?jO(e,t):Re(t)?FO(e,t):ae(t)?BO(e,t):Ie(t)?qO(e,t):Ce(t)?HO(e,t):ke(t)?KO(e,t):U(t)?zO(e,t):Ve(t)?VO(e,t):V(t)?YO(e,t):Wt(t)?QO(e,t):Gt(t)?WO(e,t):le(t)?ZO(e,t):M(t)?XO(e,t):Be(t)?JO(e,t):de(t)?eA(e,t):ie(t)?tA(e,t):Oe(t)?rA(e,t):vt(t)?nA(e,t):Te(t)?oA(e,t):H(t)?iA(e,t):Bt(t)?void 0:O(t)?aA(e,t):lt(t)?void 0:void 0}function Vt(...e){let[t,r]=te.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return ue(t,r)}var jc=class extends Dr{constructor(t,r){super("Parse",t,r)}};function n$(e,t,r){if(!se(e,t,r))throw new jc(r,$r(e,t,r));return r}var wLe=lo([(e,t,r)=>pe(r),(e,t,r)=>_n(e,t,r),(e,t,r)=>Gr(e,t,r),(e,t,r)=>In(e,t,r),(e,t,r)=>n$(e,t,r)]);var i$=N({type:q("insert"),path:at(),value:je()}),a$=Object({type:q("update"),path:at(),value:je()}),s$=N({type:q("delete"),path:at()}),BLe=G([i$,a$,s$]);function fo(e){if(!e.body)throw new Error("This command does not accept a request body");let t=e.body;return t.examples?.length?t.examples[0]:Vt(t)}var mA=Du(require("node:fs"));function go(e){if(e.file){let t=mA.default.readFileSync(e.file==="-"?0:e.file,"utf-8");return JSON.parse(t)}if(e.data)return JSON.parse(e.data);throw new Error("Provide a request body with -f <file> or -d <json>. Use --generate-skeleton to get a template.")}function Pi(e,t,r,o,i){e.command(t).description(r).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async s=>{if(s.generateSkeleton){oe(fo(o));return}let m=go(s),u=await i()(o,{body:m});oe(u)})}function cA(e,t){let r=e.command("experimental").description("Experimental commands \u2014 unstable, subject to change without notice");Pi(r,"promql","Run a PromQL query (experimental)",f_,t)}var W="context";var P0e=`${W}.team`,U0e=`${W}.env`,N0e=`${W}.api_key_id`,L0e=`${W}.service.name`,k0e=`${W}.service.version`;var u$=`${W}.host.name`,l$=`${W}.instance`,d$=`${W}.instanceid`,f$=`${W}.instance_name`,M0e=`${W}.telemetry.sdk.language`,w0e=`${W}.k8s.cluster.name`,$0e=`${W}.k8s.cluster.uid`,D0e=`${W}.k8s.namespace.name`,G0e=`${W}.k8s.pod.name`,v0e=`${W}.k8s.pod.uid`,j0e=`${W}.k8s.container.name`,F0e=`${W}.k8s.node.name`,B0e=`${W}.k8s.node.uid`,q0e=`${W}.k8s.deployment.name`,H0e=`${W}.k8s.deployment.uid`,K0e=`${W}.k8s.replicaset.name`,z0e=`${W}.k8s.replicaset.uid`,V0e=`${W}.k8s.statefulset.name`,Y0e=`${W}.k8s.statefulset.uid`,Q0e=`${W}.k8s.daemonset.name`,W0e=`${W}.k8s.daemonset.uid`,Z0e=`${W}.k8s.job.name`,X0e=`${W}.k8s.job.uid`,J0e=`${W}.k8s.cronjob.name`,ewe=`${W}.k8s.cronjob.uid`;var twe={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${W}.tag_policy_id`,dataSource:`${W}.data_source`}};var rwe={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${W}.batch_kind`,batchKindMetricsFilter:`${W}.batch_kind:metrics`,sourceApiKeyId:`${W}.source_api_key_id`,sourceEnv:`${W}.source_env`,sourceTeam:`${W}.source_team`}},g$="__tsuga_metadata__",nwe=`${g$}.signature`;var hn="/v0/service-catalog";var uA=n.Object({team:n.String(),lastSeenAt:T()}),y$=n.Object({ingestionApiKey:n.String(),lastSeenAt:T()}),lA=n.Object({version:n.String(),firstSeenAt:T(),lastSeenAt:T(),faulty:n.Optional(n.Boolean())}),E$=n.Object({language:n.String(),lastSeenAt:T()}),Is=n.Object({id:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(uA),ingestionApiKeys:n.Array(y$),versions:n.Array(lA),languages:n.Array(E$),lastSeenAt:T(),firstSeenAt:T(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),logsCount24h:n.Number(),errorLogsCount24h:n.Number(),tracesCount24h:n.Number(),errorTracesCount24h:n.Number(),createdAt:T(),updatedAt:T()}),cwe=d({tags:["service-catalog"],query:n.Object({...Ue,clusterId:n.Optional(c())}),method:"GET",paginated:!0,url:`${hn}/services`,response:n.Array(Is)}),uwe=d({tags:["service-catalog"],method:"GET",url:`${hn}/services/:serviceId`,params:n.Object({serviceId:c()}),response:Is}),I$=n.Object({id:n.String(),endpointName:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(uA),versions:n.Array(lA),lastSeenAt:T(),firstSeenAt:T(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),createdAt:T(),updatedAt:T()}),lwe=d({tags:["service-catalog"],method:"GET",url:`${hn}/endpoints`,response:n.Array(I$)}),T$=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var dA=n.Object({id:n.String(),hostName:n.String(),env:n.Optional(n.String()),cpuUtilizationAverage:n.Number(),hostType:n.Enum(T$),teams:n.Array(n.String()),tags:n.Array(n.String()),firstSeenAt:T(),lastSeenAt:T(),clusterId:n.String()}),dwe=d({tags:["service-catalog"],method:"GET",url:`${hn}/hosts`,response:n.Array(dA)}),fwe=d({tags:["service-catalog"],method:"GET",url:`${hn}/hosts/:hostId`,params:n.Object({hostId:c()}),response:dA}),_$=n.Object({serviceName:n.String(),id:n.Union([n.String(),n.Null()]),namespace:n.Union([n.String(),n.Null()]),cluster:n.String(),env:n.Union([n.String(),n.Null()])}),h$=n.Object({from:n.String(),to:n.String(),count:n.Number()}),gwe=d({tags:["service-catalog"],url:`${hn}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:c()}),query:n.Object({...ft.properties,query:n.Optional(c({type:"tsuga-query"}))}),response:n.Object({nodes:n.Array(_$),edges:n.Array(h$)})}),ywe=d({tags:["service-catalog"],method:"GET",url:`${hn}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var Bc=`/${"v1"}/services`,qc=n.Pick(Is,["id","serviceName","serviceNamespace","env","teams","versions","languages","lastSeenAt","firstSeenAt","sources","logsCount24h","errorLogsCount24h","tracesCount24h","errorTracesCount24h"],{$id:"Service",description:"Observed telemetry service with metadata, activity stats and version signals"}),O$={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!1}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",sources:["logs","metrics","traces"],logsCount24h:12e3,errorLogsCount24h:42,tracesCount24h:8500,errorTracesCount24h:17};Object.assign(qc,{examples:[O$]});var fA=d({description:"Retrieve all services",operationId:"listServices",tags:["services"],url:Bc,method:"GET",paginated:!0,query:n.Object({...Ue,clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:n.Array(qc)}),gA=d({description:"Retrieve a service by its id",operationId:"getService",tags:["services"],url:`${Bc}/:serviceId`,method:"GET",params:n.Object({serviceId:c({allowEmpty:!1})}),response:qc}),A$=n.Object({serviceName:n.String({description:"Service name"}),id:n.Union([n.String(),n.Null()],{description:"Service ID from catalog, null if unknown"}),namespace:n.Union([n.String(),n.Null()],{description:"Service namespace from catalog, null if unknown"}),cluster:n.String({description:"Cluster ID"}),env:n.Union([n.String(),n.Null()],{description:"Environment observed from spans"})}),yA=d({description:"Retrieve the dependency graph for a service, showing which services call each other",operationId:"getServiceGraph",tags:["services"],url:`${Bc}/:serviceId/graph`,method:"GET",params:n.Object({serviceId:c({allowEmpty:!1})}),query:n.Object({...ft.properties,query:n.Optional(c({type:"tsuga-query"}))}),response:n.Object({nodes:n.Array(A$),edges:n.Array(n.Object({from:n.String(),to:n.String(),count:n.Number()}))})});var sr=require("node:fs"),EA=require("node:os"),Hc=require("node:path"),IA=(0,Hc.join)((0,EA.homedir)(),".config","tsuga"),yo=(0,Hc.join)(IA,"config.json"),S$="https://api.tsuga.com";function On(){if(!(0,sr.existsSync)(yo))return{};try{return JSON.parse((0,sr.readFileSync)(yo,"utf-8"))}catch{throw new Error(`Config file corrupted: ${yo}
38
- Re-run: tsuga auth <token>`)}}function Kc(e){(0,sr.mkdirSync)(IA,{recursive:!0,mode:448}),(0,sr.writeFileSync)(yo,`${JSON.stringify(e,null,2)}
39
- `,{mode:384})}function zc(e){let t=On(),r=e.operationApiKey??process.env.TSUGA_OPERATION_API_KEY??t.operationApiKey,o=e.clusterId?.trim()||process.env.TSUGA_CLUSTER_ID?.trim()||t.defaults?.cluster?.trim()||void 0;return{apiUrl:process.env.TSUGA_API_URL?.trim()||S$,operationApiKey:r,clusterId:o}}function Vc(e){let t={};try{t=On()}catch{}Kc({...t,...e})}function TA(){return(0,sr.existsSync)(yo)||!!process.env.TSUGA_OPERATION_API_KEY}function Yc(){return yo}var Qc={from:"-30m",to:"now",query:"*","max-results":"100"};function _A(){return On().defaults??{}}function pr(e){return(On().defaults??{})[e]??Qc[e]}function hA(e,t){let r={};try{r=On()}catch{}let o={...r.defaults??{},[e]:t};Kc({...r,defaults:o})}function OA(){let e={};try{e=On()}catch{}let{defaults:t,...r}=e;Kc(r)}function AA(){return On().lastUpdateCheck}function SA(e){Vc({lastUpdateCheck:e})}function bA(e,t){let r=t??pr(e);return r===void 0?void 0:ps(r)}function Wc(e){let t=pr(e);return t===void 0?"":` (default: ${t})`}function xA(e,t){e.command("service-graph").description("Inspect service dependency graphs").command("get <serviceId>").description("Retrieve the dependency graph for a service").option("--from <timestamp>",`Start of time range${Wc("from")}`).option("--to <timestamp>",`End of time range${Wc("to")}`).option("--query <query>",`Search query${Wc("query")}`).action(async(o,i)=>{let s={},m=bA("from",i.from),u=bA("to",i.to);m!==void 0&&(s.from=m),u!==void 0&&(s.to=u),i.query!==void 0&&(s.query=i.query);let l=await t()(yA,{params:{serviceId:o},query:s});oe(l)})}var Zc=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],Xc=["light","dark"];var b$={light:{red:{text:"foreground.red",background:"avatar.background.red"},orange:{text:"foreground.orange",background:"avatar.background.orange"},amber:{text:"foreground.amber",background:"avatar.background.amber"},yellow:{text:"foreground.yellow",background:"avatar.background.yellow"},green:{text:"foreground.green",background:"avatar.background.green"},emerald:{text:"foreground.emerald",background:"avatar.background.emerald"},teal:{text:"foreground.teal",background:"avatar.background.teal"},cyan:{text:"foreground.cyan",background:"avatar.background.cyan"},sky:{text:"foreground.sky",background:"avatar.background.sky"},blue:{text:"foreground.blue",background:"avatar.background.blue"},indigo:{text:"foreground.indigo",background:"avatar.background.indigo"},purple:{text:"foreground.purple",background:"avatar.background.purple"},pink:{text:"foreground.pink",background:"avatar.background.pink"}},dark:{red:{text:"avatar.foreground.foreground",background:"avatar.solid-background.red"},orange:{text:"avatar.foreground.foreground",background:"avatar.solid-background.orange"},amber:{text:"avatar.foreground.foreground",background:"avatar.solid-background.amber"},yellow:{text:"avatar.foreground.foreground",background:"avatar.solid-background.yellow"},green:{text:"avatar.foreground.foreground",background:"avatar.solid-background.green"},emerald:{text:"avatar.foreground.foreground",background:"avatar.solid-background.emerald"},teal:{text:"avatar.foreground.foreground",background:"avatar.solid-background.teal"},cyan:{text:"avatar.foreground.foreground",background:"avatar.solid-background.cyan"},sky:{text:"avatar.foreground.foreground",background:"avatar.solid-background.sky"},blue:{text:"avatar.foreground.foreground",background:"avatar.solid-background.blue"},indigo:{text:"avatar.foreground.foreground",background:"avatar.solid-background.indigo"},purple:{text:"avatar.foreground.foreground",background:"avatar.solid-background.purple"},pink:{text:"avatar.foreground.foreground",background:"avatar.solid-background.pink"}},gradient:{red:"var(--chakra-colors-gradient-red)",orange:"var(--chakra-colors-gradient-orange)",amber:"var(--chakra-colors-gradient-amber)",yellow:"var(--chakra-colors-gradient-yellow)",green:"var(--chakra-colors-gradient-green)",emerald:"var(--chakra-colors-gradient-emerald)",teal:"var(--chakra-colors-gradient-teal)",cyan:"var(--chakra-colors-gradient-cyan)",sky:"var(--chakra-colors-gradient-sky)",blue:"var(--chakra-colors-gradient-blue)",indigo:"var(--chakra-colors-gradient-indigo)",purple:"var(--chakra-colors-gradient-purple)",pink:"var(--chakra-colors-gradient-pink)"}},RA=["activity-heart","activity","airplay","airpods","alarm-clock","anchor","annotation-dots","annotation-heart","annotation-question","annotation","announcement-03","asterisk-01","atom-01","atom-02","award-03","award-04","award-05","backpack","bank-note-01","bank-note-02","bank-note-03","battery-charging-01","beaker-01","beaker-02","bell-03","bell-04","bell-ringing-03","bell-ringing-04","bluetooth-connect","bluetooth-on","book-closed","book-open-01","book-open-02","bookmark","briefcase-01","briefcase-02","brush-01","brush-02","brush-03","building-01","building-02","building-03","building-08","bus","calculator","calendar-check-01","calendar-date","calendar-heart-01","calendar","camera-01","camera-lens","car-01","certificate-01","certificate-02","check-heart","clipboard-attachment","clipboard-check","clipboard-download","clipboard","clock-snooze","clock-stopwatch","cloud-01","cloud-lightning","cloud-moon","cloud-raining-01","cloud-raining-03","cloud-raining-05","cloud-raining-06","cloud-snowing-01","cloud-sun-01","cloud-sun-02","cloud-sun-03","code-browser","code-circle-01","code-circle-02","code-circle-03","code-square-01","code-square-02","coins-hand","coins-stacked-01","colors","compass-01","compass-02","compass-03","compass","credit-card-01","credit-card-02","cube-02","cube-04","cube-outline","currency-bitcoin-circle","currency-dollar-circle","currency-ethereum-circle","currency-euro-circle","currency-pound-circle","currency-ruble-circle","currency-rupee-circle","currency-yen-circle","cursor-click-01","cursor-click-02","diamond-01","diamond-02","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc-01","disc-02","droplets-01","droplets-02","droplets-03","dropper","face-content","face-frown","face-happy","face-neutral","face-sad","face-smile","face-wink","feather","file-02","file-05","file-06","file-heart-01","file-heart-02","file-search-01","file-search-02","file-search-03","film-01","film-02","fingerprint-03","fingerprint-04","flag-01","flag-04","flash-off","flash","gaming-pad-01","gaming-pad-02","gift-01","glasses-01","glasses-02","globe-03","globe-04","globe-05","globe-06","globe-slated-01","globe-slated-02","graduation-hat-01","graduation-hat-02","hash-01","hash-02","headphones-01","headphones-02","heart-circle","heart-hand","heart-hexagon","heart-octagon","heart-rounded","heart-square","hearts","hexagon-01","hexagon-02","home-03","home-smile","hourglass-01","hourglass-02","hourglass-03","hurricane-01","hurricane-02","hurricane-03","image-01","image-02","image-03","image-04","image-05","keyboard-01","laptop-01","life-buoy-01","life-buoy-02","lightbulb-02","lightbulb-03","lightbulb-04","lock-keyhole-circle","lock-keyhole-square","luggage-01","luggage-02","luggage-03","magic-wand-01","magic-wand-02","map-01","map-02","mark","marker-pin-01","marker-pin-04","marker-pin-05","marker-pin-06","medical-circle","medical-cross","medical-square","message-chat-square","message-notification-square","message-smile-square","message-text-square-02","microphone-01","microphone-02","microscope","modem-01","modem-02","monitor-03","monitor-04","monitor-05","moon-01","moon-eclipse","moon-star","music-note-01","music-note-02","music-note-plus","octagon","palette","paperclip","pentagon","phone-01","phone-02","phone-call-01","phone","piggy-bank-01","pin-01","pin-02","plane","play-circle","play-square","podcast","power-02","presentation-chart-01","printer","receipt","recording-01","recording-02","recording-03","rocket-01","rocket-02","roller-brush","rss-01","rss-02","ruler","scales-01","scales-02","server-06","shield-01","shield-02","shield-03","shield-dollar","shield-zap","shopping-bag-01","shopping-cart-01","signal-01","signal-02","signal-03","simcard","sliders-01","sliders-02","snowflake-01","snowflake-02","speaker-01","speaker-02","speaker-03","speedometer-01","speedometer-02","speedometer-03","speedometer-04","square","stand","star-03","star-07","sticker-circle","sticker-square","sun-setting-01","sun-setting-02","sun-setting-03","sun","sunrise","sunset","tablet-01","tag-01","tag-02","tag-03","target-01","target-02","target-03","target-04","target-05","terminal-browser","terminal-circle","terminal-square","thermometer-02","thermometer-03","thermometer-cold","thermometer-warm","thumbs-down","thumbs-up","ticket-01","tool-01","tool-02","train","tram","translate-01","triangle","trophy-01","trophy-02","truck-01","truck-02","tv-02","umbrella-01","umbrella-02","umbrella-03","virus","voicemail","wallet-01","wallet-02","wallet-05","watch-circle","watch-square","waves","webcam-01","webcam-02","wind-01","wind-02","wind-03","youtube","zap-circle","zap-fast","zap"];var Nwe=b$.light.red.background;var x$="^\\S(.*\\S)?$",R$=128,C$=256,P$=n.Object({key:n.String(),value:n.String()},{title:"Tag"}),U$=n.Object({key:n.String({maxLength:R$}),value:n.String({maxLength:C$,pattern:x$})},{title:"Tag"}),Jc=n.Array(P$,{title:"Tags",description:"List of key/value tags applied to the resource"}),Ui=n.Array(U$,{title:"Tags",maxItems:50,description:"List of key/value tags applied to the resource"}),Ye=n.Optional(Jc),mt=n.Optional(Ui);var vr="/v0/teams",_s=["public","private"],Ts={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},N$=n.Enum([Ts.NAME,Ts.CREATED_AT,Ts.MEMBER_COUNT,Ts.VISIBILITY]),CA=n.Object({color:n.Enum(Zc),mode:n.Enum(Xc),iconName:n.Enum(RA)}),eu=n.Object({color:n.Enum(Zc),mode:n.Enum(Xc)}),L$=100,k$=250,Eo=n.Object({id:n.String({description:"Identifier of the team"}),name:n.String({description:"Human readable team name displayed throughout the app"}),description:n.Optional(n.String()),visibility:n.Enum(_s,{description:"Controls whether the resources of the team are discoverable by users"}),tags:Ye,createdAt:T(),updatedAt:T(),memberCount:n.Optional(n.Number({description:"Number of members currently in the team"})),avatar:n.Optional(CA)}),hs=n.Object({name:n.String({minLength:1,maxLength:L$,description:"Name to assign to the team"}),description:n.Optional(n.String({maxLength:k$})),visibility:n.Enum(_s,{description:"Controls whether the resources of the team are discoverable by users"}),tags:mt,avatar:n.Optional(CA)}),M$=n.Object({id:n.String(),name:n.String(),email:n.String(),role:n.Enum(ro),joinedTeamAt:T(),orgRole:n.Enum(rs),avatar:n.Optional(eu)}),Bwe=d({tags:["teams"],url:vr,method:"GET",paginated:!0,response:n.Array(Eo),query:n.Object({...Ue,includeMemberCount:n.Optional(n.Boolean()),searchQuery:n.Optional(c()),visibility:n.Optional(n.Enum(_s)),myTeamsOnly:n.Optional(n.Boolean()),sortBy:n.Optional(N$),sortDirection:n.Optional(n.Enum(["asc","desc"]))})}),qwe=d({tags:["teams"],url:`${vr}/:id`,method:"GET",params:n.Object({id:c()}),response:Eo}),Hwe=d({tags:["teams"],url:`${vr}/:id/members`,method:"GET",params:n.Object({id:c()}),response:n.Array(M$)}),Kwe=d({tags:["teams"],url:`${vr}/:id/assets`,method:"GET",params:n.Object({id:c()}),response:n.Object({apiKeyCount:n.Number(),logRouteCount:n.Number(),monitorCount:n.Number(),notificationRuleCount:n.Number(),dashboardCount:n.Number()})}),zwe=d({tags:["teams"],url:vr,method:"POST",body:hs,response:Eo}),Vwe=d({tags:["teams"],url:`${vr}/:id`,method:"PUT",params:n.Object({id:c()}),body:hs,response:Eo}),Ywe=d({tags:["teams"],url:`${vr}/bulk-update`,method:"POST",body:n.Object({teamIds:n.Array(c(),{maxItems:100}),config:n.Object({visibility:n.Enum(_s)})}),response:n.Object({})}),Qwe=d({tags:["teams"],url:`${vr}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v});var w$=n.Enum(["terraform-provider","web-frontend","mcp-server","cli"]),Se=b("type",[n.Object({type:n.Literal("user"),id:n.String(),name:n.String(),avatar:n.Optional(eu)}),n.Object({type:n.Literal("operation-api-key"),id:n.String(),name:n.String(),source:n.Optional(w$)})]);var jr="/v0/dashboards",PA=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],$$=["bar","bar-connection","distribution","list-connection","list-log-patterns","list","pie","pie-connection","query-value","query-value-connection","table","timeseries-connection","timeseries","top-list-connection","top-list"],c$e=[...$$,"note"];var D$=["ns","us","ms","s","m","h","days"];var G$=["B","KB","MB","GB","TB","PB"];var v$=20;var UA=n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(D$,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),NA=n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:n.Enum(G$,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),LA=n.Object({type:n.Literal("percent",{description:"Format values as percentages"})},{$id:"DataNormalizerPercent",title:"Percent"}),kA=n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),MA=n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),j$=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),F$=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit",maxLength:v$})},{$id:"InputDataNormalizerCustom",title:"Custom"}),mr=b("type",[UA,NA,LA,kA,MA,j$],{title:"Normalizer"}),cr=b("type",[UA,NA,LA,kA,MA,F$],{title:"Normalizer"}),wA=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(mr)},{title:"WidgetListColumn"}),$A=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(cr)},{title:"WidgetListColumn"}),Ss=["background","no-background"],B$=["table","legend-only","no-legend"];var q$=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],DA=["alert","warning","success"],Io=n.Object({operator:n.Enum(q$,{description:"Comparator used to evaluate the metric value"}),value:n.Number({description:"Threshold value used when evaluating the operator"}),color:n.Enum(DA,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting"}),H$=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(DA,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker"}),K$=["sec","min","hour","day"],bs=n.Object({time:n.Number({description:"Number of units that make up each bar bucket"}),metric:n.Enum(K$,{description:"Unit used to measure the bucket width"})});var Os=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),z$=n.Object({formula:n.Optional(n.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),n.String({description:"Optional alias for a query (only used for display in the UI)"})))}),V$=n.Object({formula:n.Optional(c({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),c({type:"short",description:"Optional alias for a query (only used for display in the UI)"})))}),tu={source:Mr,queries:a_,formula:n.Optional(s_),aliases:n.Optional(z$),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},ru={source:Mr,queries:gi,formula:n.Optional(yi),aliases:n.Optional(V$),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Ni={...tu,groupBy:n.Optional(gm)},Li={...ru,groupBy:n.Optional(io)},tt=n.Enum(B$,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),rt=n.Optional(n.Number({description:"Number of decimal places to display in the value"})),Fr=n.Optional(n.Array(H$,{description:"Threshold markers displayed on the chart"})),Y$=n.Object({name:n.String({description:"Display name of the table column"}),...tu,source:Mr,normalizer:n.Optional(mr),precision:rt},{title:"TableColumn"}),Q$=n.Object({name:c({description:"Display name of the table column"}),...ru,source:Mr,normalizer:n.Optional(cr),precision:rt},{title:"TableColumn"}),W$=n.Array(n.Object({id:n.String({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),Z$=n.Array(n.Object({id:c({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),GA=["horizontal","vertical"],X$=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:n.String({description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(wA,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"GraphVisualizationList",title:"List"}),J$=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:c({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array($A,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"InputGraphVisualizationList",title:"List"}),As=b("type",[n.Object({type:n.Literal("auto")}),n.Object({type:n.Literal("number"),value:n.Number()})]),xs=n.Object({min:As,max:As,scale:b("type",[n.Object({type:n.Literal("pow"),exponent:n.Number()}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()}),Rs=n.Object({min:As,max:As,scale:b("type",[n.Object({type:n.Literal("pow"),exponent:n.Number({minimum:0})}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()}),eD=n.Array(n.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),tD=n.Array(n.Integer({minimum:0,maximum:100,description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"});var rD=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(tt),thresholds:Fr,yAxisSettings:n.Optional(xs)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),nD=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:c({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(c({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(tt),thresholds:Fr,yAxisSettings:n.Optional(Rs)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),oD=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),query:n.String({description:"The read-only SQL query to execute against the connection."}),listColumns:n.Optional(n.Array(wA,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),iD=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:c({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:c({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:n.Optional(n.Array($A,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),aD=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),sD=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:c({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(c({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),pD=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(tt)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),mD=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:c({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(c({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(tt)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),cD=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(tt),thresholds:Fr,yAxisSettings:n.Optional(xs)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),uD=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:c({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(c({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(tt),thresholds:Fr,yAxisSettings:n.Optional(Rs)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),lD=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:n.Optional(n.Enum(Ss,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Io,{description:"Conditional formatting rules applied to the displayed value"})),precision:rt,normalizer:n.Optional(mr),legendMode:n.Optional(tt)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),dD=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:c({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(c({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:n.Optional(n.Enum(Ss,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Io,{description:"Conditional formatting rules applied to the displayed value"})),precision:rt,normalizer:n.Optional(cr),legendMode:n.Optional(tt)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),fD=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:n.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(GA,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),gD=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:c({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(GA,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),yD=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Ni,timeBucket:n.Optional(bs),normalizer:n.Optional(mr),precision:rt,legendMode:n.Optional(tt),thresholds:Fr,yAxisSettings:n.Optional(xs)},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),ED=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Li,timeBucket:n.Optional(bs),normalizer:n.Optional(cr),precision:rt,legendMode:n.Optional(tt),thresholds:Fr,yAxisSettings:n.Optional(Rs)},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),ID=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Ni,normalizer:n.Optional(mr),precision:rt,conditions:n.Optional(n.Array(Io,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),TD=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Li,normalizer:n.Optional(cr),precision:rt,conditions:n.Optional(n.Array(Io,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),_D=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Ni,normalizer:n.Optional(mr),precision:rt,legendMode:n.Optional(tt)},{$id:"GraphVisualizationPie",title:"Pie"}),hD=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Li,normalizer:n.Optional(cr),precision:rt,legendMode:n.Optional(tt)},{$id:"InputGraphVisualizationPie",title:"Pie"}),OD=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...tu,backgroundMode:n.Optional(n.Enum(Ss,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Io,{description:"Conditional formatting rules applied to the displayed value"})),precision:rt,normalizer:n.Optional(mr),legendMode:n.Optional(tt)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),AD=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...ru,backgroundMode:n.Optional(n.Enum(Ss,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Io,{description:"Conditional formatting rules applied to the displayed value"})),precision:rt,normalizer:n.Optional(cr),legendMode:n.Optional(tt)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),SD=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Ni,timeBucket:n.Optional(bs),precision:rt,normalizer:n.Optional(mr),thresholds:Fr,legendMode:n.Optional(tt),yAxisSettings:n.Optional(xs)},{$id:"GraphVisualizationBar",title:"Bar"}),bD=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Li,timeBucket:n.Optional(bs),precision:rt,normalizer:n.Optional(cr),thresholds:Fr,legendMode:n.Optional(tt),yAxisSettings:n.Optional(Rs)},{$id:"InputGraphVisualizationBar",title:"Bar"}),xD=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Ni,precision:rt,normalizer:n.Optional(mr),percentileMarkers:n.Optional(eD)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),RD=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Li,precision:rt,normalizer:n.Optional(cr),percentileMarkers:n.Optional(tD)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),CD=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(Y$,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(gm),defaultSorting:n.Optional(W$)},{$id:"GraphVisualizationTable",title:"Table"}),PD=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(Q$,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(io),defaultSorting:n.Optional(Z$)},{$id:"InputGraphVisualizationTable",title:"Table"}),UD=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(n.String({description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(PA,{description:"Background color used to render the note"})),noteAlign:n.Optional(Os),noteJustifyContent:n.Optional(Os)},{$id:"GraphVisualizationNote",title:"Note"}),ND=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(c({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(PA,{description:"Background color used to render the note"})),noteAlign:n.Optional(Os),noteJustifyContent:n.Optional(Os)},{$id:"InputGraphVisualizationNote",title:"Note"}),LD=b("type",[rD,oD,aD,pD,cD,lD,yD,ID,_D,OD,SD,xD,CD,X$,UD,fD]),kD=b("type",[nD,iD,sD,mD,uD,dD,ED,TD,hD,AD,bD,RD,PD,J$,ND,gD]),Cs=n.Object({id:n.String({description:"Identifier of the graph widget"}),name:n.Optional(n.String({description:"Display name of the graph widget"})),description:n.Optional(n.String({description:"Description of the graph widget"})),visualization:LD,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),Ps=n.Object({id:c({description:"Identifier of the graph widget"}),name:n.Optional(c({description:"Display name of the graph widget"})),description:n.Optional(n.String({minLength:1,maxLength:800,description:"Description of the graph widget"})),visualization:kD,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),MD=10,wD=n.Array(n.Object({key:n.String({description:"Filter key"}),values:n.Array(n.String({description:"Filter value"}))}),{description:"Filters applied to every widget on the dashboard"}),$D=n.Array(n.Object({key:c({description:"Filter key"}),values:n.Array(c({description:"Filter value"}))}),{maxItems:MD,description:"Filters applied to every widget on the dashboard"}),To=n.Object({id:n.String({description:"Identifier of the dashboard"}),name:n.String({description:"Display name of the dashboard"}),owner:n.String({description:"Team ID that owns and manages the dashboard"}),graphs:n.Array(Cs,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(wD),createdAt:T(),updatedAt:T(),creator:n.Optional(Se),updater:n.Optional(Se),tags:Ye,timePreset:n.Optional(n.Enum(lm))}),Us=n.Object({name:c({description:"Display name of the dashboard"}),owner:c({allowEmpty:!1,description:"Team ID that owns and manages the dashboard"}),graphs:n.Array(Ps,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional($D),tags:mt,timePreset:n.Optional(n.Enum(lm))}),nu=n.Object({...Ue,owners:n.Optional(n.Array(c({allowEmpty:!1}),{description:"Filter by owner team IDs"}))}),u$e=d({tags:["dashboards"],url:jr,method:"GET",query:nu,paginated:!0,response:n.Array(To)}),l$e=d({tags:["dashboards"],url:`${jr}/:id`,method:"GET",params:n.Object({id:c()}),response:To}),d$e=d({tags:["dashboards"],url:jr,method:"POST",body:Us,response:To}),f$e=d({tags:["dashboards"],url:`${jr}/:id`,method:"PUT",params:n.Object({id:c()}),body:n.Partial(Us),response:To}),g$e=d({tags:["dashboards"],url:`${jr}/bulk-update`,method:"PUT",body:n.Object({dashboardIds:n.Array(c()),owner:c({allowEmpty:!1})}),response:n.Object({})}),y$e=d({tags:["dashboards"],url:`${jr}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),E$e=d({tags:["dashboards"],url:`${jr}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:c({allowEmpty:!1}),graphId:c({allowEmpty:!1})}),body:n.Omit(Ps,["id"]),response:Cs}),I$e=d({tags:["dashboards"],url:`${jr}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(c())}),response:n.Object({})});var _o=`/${"v1"}/dashboards`,ki=n.Pick(To,["id","name","owner","graphs","filters","tags","timePreset"],{$id:"Dashboard",description:"Visualization of telemetry data with customizable graphs and filters"}),DD={id:"123-456-abc",name:"API Performance Overview",owner:"abc-123-def",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(ki,{examples:[DD]});var GD=n.Pick(nu,["limit","offset","owners"]),vA=d({description:"Retrieve all dashboards",operationId:"listDashboards",tags:["dashboards"],url:_o,method:"GET",paginated:!0,query:GD,response:n.Array(ki)}),jA=d({description:"Retrieve a dashboard by its id",operationId:"getDashboard",tags:["dashboards"],url:`${_o}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:ki}),ou=n.Pick(Us,["name","owner","graphs","filters","tags","timePreset"]),vD={name:"API Performance Overview",owner:"abc-123-def",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(ou,{examples:[vD]});var FA=d({description:"Create a new dashboard",operationId:"createDashboard",tags:["dashboards"],url:_o,method:"POST",body:ou,response:ki}),BA=d({description:"Update a dashboard by its id",operationId:"updateDashboard",tags:["dashboards"],url:`${_o}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:n.Partial(ou),response:ki}),jD=n.Object({id:c({allowEmpty:!1,description:"The dashboard ID to delete"})}),qA=d({description:"Delete a dashboard by its id",operationId:"deleteDashboard",tags:["dashboards"],url:`${_o}/:id`,method:"DELETE",params:jD,response:v}),x$e=d({description:"Update a single graph within a dashboard by ID.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${_o}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:c({allowEmpty:!1,description:"The dashboard ID containing the graph"}),graphId:c({allowEmpty:!1,description:"The graph ID to update"})}),body:n.Omit(Ps,["id"]),response:Cs});var FD=100,BD=3,ho=n.Object({id:n.String(),name:n.String(),keyLastCharacters:n.String(),owner:n.String(),tags:Jc,teamOverrideFields:n.Optional(n.Array(n.String())),updatedAt:T(),createdAt:T(),creator:n.Optional(Se),updater:n.Optional(Se),assetUpdatedAt:T()}),Mi=n.Object({name:n.String({format:es,minLength:1,maxLength:FD}),owner:c({allowEmpty:!1}),tags:Ui,teamOverrideFields:n.Optional(n.Array(c({allowEmpty:!1}),{minItems:1,maxItems:BD}))}),wi="/v0/ingestion-api-keys",w$e=d({tags:["ingestion-api-keys"],url:wi,method:"POST",body:Mi,response:n.Intersect([ho,n.Object({key:n.String()})])}),$$e=d({tags:["ingestion-api-keys"],url:wi,method:"GET",response:n.Array(ho)}),D$e=d({tags:["ingestion-api-keys"],url:`${wi}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:ho}),G$e=d({tags:["ingestion-api-keys"],url:`${wi}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:Mi,response:ho}),v$e=d({tags:["ingestion-api-keys"],url:`${wi}/:id`,method:"DELETE",params:n.Object({id:c({allowEmpty:!1})}),response:v});var $i=`/${"v1"}/ingestion-api-keys`,Di=n.Pick(ho,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga"}),HA={id:"123-456-abc",name:"Production Logs Ingestion",keyLastCharacters:"x7Qm",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Di,{examples:[HA]});var KA=n.Pick(Mi,["name","owner","tags","teamOverrideFields"],{$id:"CreateIngestionApiKeyRequest"}),zA=n.Pick(Mi,["name","owner","tags","teamOverrideFields"],{$id:"UpdateIngestionApiKeyRequest"}),VA={name:"Production Logs Ingestion",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(KA,{examples:[VA]});Object.assign(zA,{examples:[VA]});var qD={...HA,key:"tsuga_in:v1:abc123xyx7Qm"},YA=d({description:"Retrieve all ingestion API keys",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:$i,method:"GET",response:n.Array(Di)}),V$e=d({description:"Retrieve an ingestion API key by its id",operationId:"getIngestionApiKey",tags:["ingestion-api-keys"],url:`${$i}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:Di}),HD=n.Intersect([n.Pick(Di,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),n.Object({key:n.String({description:"The full API key value, returned only at creation time"})})],{title:"IngestionApiKeyCreated",example:qD}),QA=d({description:"Create a new ingestion API key",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:$i,method:"POST",body:KA,response:HD}),WA=d({description:"Update an ingestion API key by its id",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${$i}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:zA,response:Di}),ZA=d({description:"Delete an ingestion API key by its id",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${$i}/:id`,method:"DELETE",params:n.Object({id:c({allowEmpty:!1})}),response:v});var KD={application:{webService:["azure_web_app","gcp_app_engine_service"]},data:{bucket:["aws_s3_bucket","gcp_bucket","azure_blob_storage_container"],messagingService:["aws_kinesis_data_stream","aws_sqs_queue","aws_sns_topic","azure_service_bus_namespace","azure_service_bus_queue","gcp_pubsub_topic","azure_event_grid_topic","azure_event_hub_namespace","azure_event_hub"],fileSystem:["aws_efs","azure_file_share"],contentDeliveryNetwork:["aws_cloudfront_distribution","gcp_cloud_cdn_configuration"],database:["aws_dynamodb_table","aws_elasticache","aws_rds_instance","azure_database_for_mysql_server","azure_database_for_postgres_server","azure_sql_database_server","azure_sql_database","gcp_bigtable_instance","gcp_cloud_sql_instance","gcp_firestore_database","gcp_spanner_instance","azure_cosmos_db_account"],storageAccount:["azure_storage_account"],volume:["aws_ebs_volume","gcp_compute_disk","azure_disk"]},compute:{virtualMachine:["aws_ec2_instance","gcp_compute_instance","azure_compute_virtual_machine"],serverless:["aws_lambda_function","gcp_cloud_run_function","gcp_cloud_run_job","gcp_cloud_run_service","azure_function_app"]},container:{kubernetesCluster:["aws_eks_cluster","gcp_gke_cluster","azure_aks_cluster"],containerRepository:["aws_ecr_repository","gcp_artifact_registry_repository","azure_container_registry"],containerCluster:["aws_ecs_cluster"],containerServiceTask:["aws_ecs_task"],containerService:["aws_ecs_service","azure_container_instance_group"],containerImage:["aws_ecr_image","gcp_artifact_registry_docker_image","azure_container_registry_image"]},network:{virtualNetwork:["aws_vpc","gcp_vpc","azure_virtual_network"],loadBalancer:["aws_elastic_load_balancer","gcp_forwarding_rule","azure_load_balancer","azure_traffic_manager_profile"],targetGroup:["aws_target_group"],certificate:["aws_acm_certificate","gcp_certificate_manager_certificate","azure_app_service_certificate"]}},[Z$e,X$e,J$e]=zD(KD);function zD(e){let t=[],r=[],o=[],i=Object.keys(e);for(let s of i){t.push(s);let m=e[s];for(let u in m){r.push(u);let l=m[u];Array.isArray(l)&&o.push(...l)}}return[iu(t),iu(r),iu(o)]}function iu(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var au=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),VD=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),YD=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),QD=n.Object({allocatedStorageGib:n.Optional(n.Number()),encryptedAtRest:n.Optional(n.Boolean()),engine:n.Optional(n.String()),dynamoDbItemCount:n.Optional(n.Number()),dynamoDbActualSizeGib:n.Optional(n.Number())}),WD=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),ZD=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),XD=n.Object({status:n.Optional(n.String()),activeServices:n.Optional(n.Number()),pendingTasks:n.Optional(n.Number()),runningTasks:n.Optional(n.Number()),registeredContainerInstances:n.Optional(n.Number()),capacityProviders:n.Optional(n.Array(n.String()))}),JD=n.Object({status:n.Optional(n.String()),desiredStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String()),availabilityZone:n.Optional(n.String()),startedAt:n.Optional(T())}),eG=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),tG=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),rG=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(T()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),nG=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),oG=n.Object({runtime:n.Optional(n.String()),memoryAllocationMib:n.Optional(n.Number()),timeoutMs:n.Optional(n.Number()),codeSha256:n.Optional(n.String())}),iG=n.Object({kind:n.Optional(n.String())}),aG=n.Object({instanceId:n.String(),architecture:n.Optional(n.String()),instanceType:n.Optional(n.String()),operatingSystem:n.Optional(n.String()),memoryMib:n.Optional(n.Number()),vCpus:n.Optional(n.Number()),vpcId:n.Optional(n.String()),k8sClusterId:n.Optional(n.String())}),sG=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),pG=n.Object({protocol:n.Optional(au),port:n.Optional(n.Number()),instanceProtocol:n.Optional(au),instancePort:n.Optional(n.Number())}),mG=n.Object({protocol:n.Optional(n.String()),ports:n.Optional(n.Array(n.String())),portRange:n.Optional(n.String()),allPorts:n.Optional(n.Boolean())}),cG=n.Object({name:n.String(),ip:n.Optional(n.String()),type:n.Enum(["public","private"])}),uG=n.Object({type:n.String(),name:n.String()}),lG=n.Object({frontendIp:n.Optional(cG),backendIpPools:n.Array(uG)}),dG=n.Object({targetId:n.String(),targetPort:n.Optional(n.Number()),targetType:n.Optional(n.Enum(["instance","ip","lambda","alb"])),healthState:n.Optional(n.String()),healthReason:n.Optional(n.String()),healthDescription:n.Optional(n.String()),availabilityZone:n.Optional(n.String())}),fG=n.Object({protocol:n.Optional(au),port:n.Optional(n.Number()),type:n.Optional(n.Enum(["alb","lambda","instance","ip"])),name:n.Optional(n.String()),targetGroupArn:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),healthCheckProtocol:n.Optional(n.String()),healthCheckPort:n.Optional(n.String()),healthCheckPath:n.Optional(n.String()),healthCheckIntervalSeconds:n.Optional(n.Number()),healthCheckTimeoutSeconds:n.Optional(n.Number()),healthyThresholdCount:n.Optional(n.Number()),unhealthyThresholdCount:n.Optional(n.Number()),targets:n.Optional(n.Array(dG)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),gG=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),yG=n.Object({type:n.Optional(n.String()),name:n.Optional(n.String()),alwaysServe:n.Optional(n.Boolean()),subnets:n.Optional(n.Array(n.Union([n.Number(),gG]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),EG=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),IG=n.Object({loadBalancerType:n.Optional(n.String()),dnsName:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnetIds:n.Array(n.String()),scheme:n.Optional(n.String()),listeners:n.Optional(n.Union([n.Array(pG),n.Array(mG)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array(EG),n.Array(yG)])),azureLoadBalancingRules:n.Optional(n.Array(lG))}),TG=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(T()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(T()),status:n.Optional(n.String()),type:n.Optional(n.String())}),_G=n.Object({state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:n.Optional(n.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),hG=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),OG=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),AG=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([_G,OG,hG])]),SG=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),Ns=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(SG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(VD)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(nG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(eG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(YD)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(QD)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(iG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(AG)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(aG)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(oG)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(WD)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(ZD)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(XD)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerServiceTask"),attributes:n.Optional(JD)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerService"),attributes:n.Optional(tG)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(rG)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(sG)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:IG}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(fG)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(TG)})]);var Gi="/v0/inventory",su=["aws","gcp","azure"],XA=["scan_in_progress","success","failure"],pu=n.Object({id:n.String({description:"Identifier of the inventory resource"}),cloudPlatform:n.Enum(su,{description:"Cloud platform that hosts this resource"}),cloudAccount:n.String({description:"Cloud-native account identifier the resource was discovered in"}),cloudRegion:n.Optional(n.String({description:"Cloud region the resource was discovered in, when applicable"})),fullyQualifiedResourceId:n.String({description:"Cloud-native unique identifier for this resource (for example an AWS ARN or GCP resource name)"}),displayName:n.String({description:"Human-readable name shown in the Tsuga UI"}),nativeResourceType:n.String({description:"Cloud-native resource type, for example aws_ec2_instance or gcp_bucket"}),resourceCreatedAt:n.Optional(T({description:"When the resource was created in the cloud, when known"})),resourceUpdatedAt:n.Optional(T({description:"When the resource was last updated in the cloud, when known"})),resourceLastSeenAt:T({description:"When this resource was last observed during an inventory scan"}),tags:Ye,nativeAttributes:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),covered:n.Optional(n.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),sDe=d({tags:["inventory"],method:"GET",url:`${Gi}/resources`,response:n.Array(n.Intersect([pu,Ns]))}),bG=b("type",[n.Object({type:n.Literal("aws"),accountId:n.String(),externalId:n.String(),roleArn:n.String()}),n.Object({type:n.Literal("gcp"),projectId:n.String(),serviceAccountId:n.String(),workloadIdentityProvider:n.String()}),n.Object({type:n.Literal("azure"),clientId:n.String(),subscriptionId:n.String(),tenantId:n.String()})]),xG=n.Object({type:n.Literal("aws"),accountId:c(),externalId:c(),roleArn:c()}),RG=n.Object({type:n.Literal("gcp"),projectId:c(),serviceAccountId:c(),workloadIdentityProvider:c()}),CG=n.Object({type:n.Literal("azure"),clientId:c(),subscriptionId:c(),tenantId:c()}),JA=b("type",[xG,RG,CG]),Ls=n.Object({id:n.String(),cloudType:n.Enum(su),cloudAccountId:n.String(),accountFriendlyName:n.Optional(n.String()),organizationId:n.Optional(n.String()),connectionSettings:bG,createdBy:n.Optional(n.String()),createdAt:T(),lastScanStartedAt:n.Optional(T()),lastScanFinishedAt:n.Optional(T()),lastScanStatus:n.Optional(n.Enum(XA))}),PG=n.Object({cloudType:n.Enum(su),cloudAccountId:c(),accountFriendlyName:n.Optional(c()),organizationId:n.Optional(c()),connectionSettings:JA,lastScanStatus:n.Optional(n.Enum(XA))}),An=`${Gi}/cloud-accounts`,pDe=d({tags:["inventory"],url:An,method:"GET",response:n.Array(Ls)}),mDe=d({tags:["inventory"],url:`${An}/:id`,method:"GET",params:n.Object({id:c()}),response:Ls}),cDe=d({tags:["inventory"],url:An,method:"POST",body:PG,response:Ls}),uDe=d({tags:["inventory"],url:`${An}/:id`,method:"PUT",params:n.Object({id:c()}),body:n.Object({accountFriendlyName:c()}),response:Ls}),lDe=d({tags:["inventory"],url:`${An}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),dDe=d({tags:["inventory"],url:`${Gi}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),fDe=d({tags:["inventory"],url:`${An}/azure/onboarding`,method:"POST",body:n.Object({tenantId:c()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),gDe=d({tags:["inventory"],method:"POST",url:`${An}/validate/:type`,params:n.Object({type:c()}),body:n.Object({data:JA,id:n.Optional(c())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),eS=`${Gi}/settings`,yDe=d({tags:["inventory"],url:eS,method:"GET",response:n.Object({settings:n.Optional(n.Object({id:n.String(),infrastructureIdentifiers:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))}))})}),EDe=d({tags:["inventory"],url:eS,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:c({allowEmpty:!1}),value:n.Optional(c({allowEmpty:!1}))}),{maxItems:50})}),response:n.Object({})}),IDe=d({tags:["inventory"],url:`${Gi}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var UG=`/${"v1"}/inventory`,NG=n.Omit(pu,["nativeAttributes","covered"],{$id:"InventoryResourceBase",description:"Base fields of a cloud resource discovered by an inventory scan"}),tS=n.Intersect([NG,Ns],{$id:"InventoryResource",description:"A cloud resource discovered by an inventory scan, together with its category, type and category-specific attributes"}),LG={id:"123-456-abc",cloudPlatform:"aws",cloudAccount:"123456789012",cloudRegion:"us-east-1",fullyQualifiedResourceId:"arn:aws:s3:::tsuga-example-bucket",displayName:"tsuga-example-bucket",nativeResourceType:"aws_s3_bucket",resourceCreatedAt:"2024-01-01T08:00:00.000Z",resourceLastSeenAt:"2024-01-15T12:34:56.000Z",tags:[{key:"team",value:"platform"}],category:"data",resourceType:"bucket",attributes:{versioningStatus:"Enabled"}};Object.assign(tS,{examples:[LG]});var rS=d({description:"Retrieve all cloud resources discovered by inventory scans",operationId:"listInventoryResources",tags:["inventory"],url:`${UG}/resources`,method:"GET",response:n.Array(tS)});var kG={"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"crawler-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["admin"]},"asset-change":{read:["public_viewer","public_editor","admin"],write:[]},"inventory-settings":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-members":{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]}},MG={"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"asset-change":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"crawler-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"inventory-settings":{read:["viewer","editor","admin"],write:["editor","admin"]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:[]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:["admin"],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]}},wG={user:kG,team:MG};function mu(e){return nS(e,"team")}function cu(e){return nS(e,"user")}function nS(e,t){let r=[],o=wG[t];for(let[i,s]of Object.entries(o))for(let[m,u]of Object.entries(s))u.includes(e)&&r.push({actionType:m,resourceType:i});return r}var UDe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:cu("admin"),roleKey:"admin"},public_editor:{name:"Public editor",description:"Can view and edit assets in public teams, but not access private teams or critical settings.",permissions:cu("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:cu("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},NDe={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:mu("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:mu("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:mu("viewer"),roleKey:"viewer"}};var oS=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757119",isUsingLuhnAlgorithm:!1,regexp:"([12])\\s*[0-9]{2}\\s*(0[1-9]|1[0-2])\\s*(2[AB]|[0-9]{2})\\s*([0-9]{3})\\s*([0-9]{3})(\\s*[0-9]{2})?"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
24
+ `),this.outputHelp({error:!0}));let o=r||{},i=o.exitCode||1,a=o.code||"commander.error";this._exit(i,a,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in ae.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,ae.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new AR(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,o.implied[i],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=p=>{let u=p.attributeName(),l=this.getOptionValue(u),f=this.options.find(I=>I.negate&&u===I.attributeName()),y=this.options.find(I=>!I.negate&&u===I.attributeName());return f&&(f.presetArg===void 0&&l===!1||f.presetArg!==void 0&&l===f.presetArg)?f:y||p},i=p=>{let u=o(p),l=u.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},a=`error: ${i(t)} cannot be used with ${i(r)}`;this.error(a,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],a=this;do{let p=a.createHelp().visibleOptions(a).filter(u=>u.long).map(u=>u.long);i=i.concat(p),a=a.parent}while(a&&!a._enablePositionalOptions);r=gl(t,i)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",a=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${o} but got ${t.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(a=>{i.push(a.name()),a.alias()&&i.push(a.alias())}),r=gl(t,i)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let i=this.createOption(r,o);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
+ `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let i=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>_R(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=nr.basename(t,nr.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let i=r.formatHelp(this,r);return o.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let r=!!t.error,o,i,a;return r?(o=u=>this._outputConfiguration.writeErr(u),i=this._outputConfiguration.getErrHasColors(),a=this._outputConfiguration.getErrHelpWidth()):(o=u=>this._outputConfiguration.writeOut(u),i=this._outputConfiguration.getOutHasColors(),a=this._outputConfiguration.getOutHelpWidth()),{error:r,write:u=>(i||(u=this._outputConfiguration.stripColor(u)),o(u)),hasColors:i,helpWidth:a}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let o=this._getOutputContext(t),i={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(p=>p.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let a=this.helpInformation({error:o.error});if(r&&(a=r(a),typeof a!="string"&&!Buffer.isBuffer(a)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(a),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(p=>p.emit("afterAllHelp",i))}helpOption(t,r){return typeof t=="boolean"?(t?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(t=t??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(t,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this}help(t){this.outputHelp(t);let r=Number(ae.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
+ Expecting one of '${o.join("', '")}'`);let i=`${t}Help`;return this.on(i,a=>{let p;typeof r=="function"?p=r({error:a.error,command:a.command}):p=r,p&&a.write(`${p}
27
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function yl(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",i="9229",a;return(a=t.match(/^(--inspect(-brk)?)$/))!==null?r=a[1]:(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=a[1],/^\d+$/.test(a[3])?i=a[3]:o=a[3]):(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=a[1],o=a[3],i=a[4]),r&&i!=="0"?`${r}=${o}:${parseInt(i)+1}`:t})}function Sp(){if(ae.env.NO_COLOR||ae.env.FORCE_COLOR==="0"||ae.env.FORCE_COLOR==="false")return!1;if(ae.env.FORCE_COLOR||ae.env.CLICOLOR_FORCE!==void 0)return!0}bp.Command=Ap;bp.useColor=Sp});var hl=Zr(xt=>{var{Argument:Il}=Oa(),{Command:xp}=El(),{CommanderError:SR,InvalidArgumentError:Tl}=qo(),{Help:bR}=yp(),{Option:_l}=_p();xt.program=new xp;xt.createCommand=e=>new xp(e);xt.createOption=(e,t)=>new _l(e,t);xt.createArgument=(e,t)=>new Il(e,t);xt.Command=xp;xt.Option=_l;xt.Argument=Il;xt.Help=bR;xt.CommanderError=SR;xt.InvalidArgumentError=Tl;xt.InvalidOptionArgumentError=Tl});var Ol=cl(hl(),1),{program:wF,createCommand:MF,createArgument:$F,createOption:DF,CommanderError:GF,InvalidArgumentError:vF,InvalidOptionArgumentError:jF,Command:Al,Argument:FF,Option:Rp,Help:BF}=Ol.default;function Rt(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}var g={};bt(g,{Assign:()=>xR,Clone:()=>Ko,Create:()=>CC,Discard:()=>PC,Metrics:()=>Nt,Update:()=>UC});var Nt={assign:0,create:0,clone:0,discard:0,update:0};function xR(e,t){return Nt.assign+=1,{...e,...t}}var s={};bt(s,{Entries:()=>QR,EntriesRegExp:()=>YR,Every:()=>KR,EveryAll:()=>zR,GraphemeCount:()=>BR,HasPropertyKey:()=>VR,IsArray:()=>Xr,IsAsyncIterator:()=>LR,IsBigInt:()=>Ho,IsBoolean:()=>Ul,IsClassInstance:()=>jR,IsConstructor:()=>kR,IsDeepEqual:()=>Np,IsEqual:()=>X,IsFunction:()=>Nl,IsGreaterEqualThan:()=>kl,IsGreaterThan:()=>DR,IsInteger:()=>Pp,IsIterator:()=>wR,IsLessEqualThan:()=>Ll,IsLessThan:()=>GR,IsMaxLength:()=>qR,IsMinLength:()=>HR,IsMultipleOf:()=>vR,IsNull:()=>xa,IsNumber:()=>Ra,IsObject:()=>Jr,IsObjectNotArray:()=>MR,IsString:()=>Ar,IsSymbol:()=>$R,IsUndefined:()=>Up,IsValueLike:()=>FR,Keys:()=>ba,Symbols:()=>WR,Values:()=>ZR});function Or(e,t,r){return e>=t&&e<=r}function Sl(e){return Or(e,127462,127487)}function RR(e){return Or(e,65024,65039)}function CR(e){return Or(e,768,879)||Or(e,6832,6911)||Or(e,7616,7679)||Or(e,65056,65071)}function Sa(e){return e>65535?2:1}function bl(e,t){for(;t<e.length;){let r=e.codePointAt(t);if(CR(r)||RR(r))t+=Sa(r);else break}return t}function Cp(e,t){let r=e.codePointAt(t),o=t+Sa(r);for(o=bl(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+Sa(i),o=bl(e,o)}return Sl(r)&&o<e.length&&Sl(e.codePointAt(o))&&(o+=Sa(e.codePointAt(o))),o}function xl(e){return Or(e,55296,56319)||Or(e,768,879)||e===8205}function Rl(e){let t=0,r=0;for(;r<e.length;)r=Cp(e,r),t++;return t}function PR(e,t){let r=0,o=0;for(;o<e.length;)if(o=Cp(e,o),r++,r>=t)return!0;return!1}function UR(e,t){let r=0,o=0;for(;o<e.length;)if(o=Cp(e,o),r++,r>t)return!1;return!0}function Cl(e,t){let r=0;for(;r<e.length;){if(xl(e.charCodeAt(r)))return PR(e,t);if(r++,r>=t)return!0}return!1}function Pl(e,t){let r=0;for(;r<e.length;){if(xl(e.charCodeAt(r)))return UR(e,t);if(r++,r>t)return!1}return!0}function Xr(e){return Array.isArray(e)}function LR(e){return Jr(e)&&Symbol.asyncIterator in e}function Ho(e){return X(typeof e,"bigint")}function Ul(e){return X(typeof e,"boolean")}function kR(e){if(Up(e)||!Nl(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Nl(e){return X(typeof e,"function")}function Pp(e){return Number.isInteger(e)}function wR(e){return Jr(e)&&Symbol.iterator in e}function xa(e){return X(e,null)}function Ra(e){return Number.isFinite(e)}function MR(e){return Jr(e)&&!Xr(e)}function Jr(e){return X(typeof e,"object")&&!xa(e)}function Ar(e){return X(typeof e,"string")}function $R(e){return X(typeof e,"symbol")}function Up(e){return X(e,void 0)}function X(e,t){return e===t}function DR(e,t){return e>t}function GR(e,t){return e<t}function Ll(e,t){return e<=t}function kl(e,t){return e>=t}function vR(e,t){if(Ho(e)||Ho(t))return BigInt(e)%BigInt(t)===0n;let r=1e-10;if(!Ra(e)||Pp(e)&&1/t%1===0)return!0;let o=e%t;return Math.min(Math.abs(o),Math.abs(o-t))<r}function jR(e){if(!Jr(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return xa(t)?!1:X(typeof t.constructor,"function")&&!(X(t.constructor,globalThis.Object)||X(t.constructor.name,"Object"))}function FR(e){return Ho(e)||Ul(e)||xa(e)||Ra(e)||Ar(e)||Up(e)}function BR(e){return Rl(e)}function qR(e,t){return Pl(e,t)}function HR(e,t){return Cl(e,t)}function KR(e,t,r){for(let o=t;o<e.length;o++)if(!r(e[o],o))return!1;return!0}function zR(e,t,r){let o=!0;for(let i=t;i<e.length;i++)r(e[i],i)||(o=!1);return o}function VR(e,t){return X(t,"__proto__")||X(t,"constructor")?Object.prototype.hasOwnProperty.call(e,t):t in e}function YR(e){return ba(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function QR(e){return Object.entries(e)}function ba(e){return Object.getOwnPropertyNames(e)}function WR(e){return Object.getOwnPropertySymbols(e)}function ZR(e){return Object.values(e)}function XR(e,t){if(!Jr(t))return!1;let r=ba(e);return X(r.length,ba(t).length)&&r.every(o=>Np(e[o],t[o]))}function JR(e,t){return Xr(t)&&X(e.length,t.length)&&e.every((r,o)=>Np(e[o],t[o]))}function Np(e,t){return Xr(e)?JR(e,t):Jr(e)?XR(e,t):X(e,t)}var Ze={};bt(Ze,{IsBigInt64Array:()=>dC,IsBigUint64Array:()=>fC,IsBoolean:()=>eC,IsDate:()=>yC,IsFloat32Array:()=>uC,IsFloat64Array:()=>lC,IsInt16Array:()=>sC,IsInt32Array:()=>cC,IsInt8Array:()=>oC,IsMap:()=>IC,IsNumber:()=>tC,IsRegExp:()=>gC,IsSet:()=>EC,IsString:()=>rC,IsTypeArray:()=>nC,IsUint16Array:()=>pC,IsUint32Array:()=>mC,IsUint8Array:()=>iC,IsUint8ClampedArray:()=>aC});function eC(e){return e instanceof Boolean}function tC(e){return e instanceof Number}function rC(e){return e instanceof String}function nC(e){return globalThis.ArrayBuffer.isView(e)}function oC(e){return e instanceof globalThis.Int8Array}function iC(e){return e instanceof globalThis.Uint8Array}function aC(e){return e instanceof globalThis.Uint8ClampedArray}function sC(e){return e instanceof globalThis.Int16Array}function pC(e){return e instanceof globalThis.Uint16Array}function cC(e){return e instanceof globalThis.Int32Array}function mC(e){return e instanceof globalThis.Uint32Array}function uC(e){return e instanceof globalThis.Float32Array}function lC(e){return e instanceof globalThis.Float64Array}function dC(e){return e instanceof globalThis.BigInt64Array}function fC(e){return e instanceof globalThis.BigUint64Array}function gC(e){return e instanceof globalThis.RegExp}function yC(e){return e instanceof globalThis.Date}function EC(e){return e instanceof globalThis.Set}function IC(e){return e instanceof globalThis.Map}function _C(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~guard")}function hC(e){return e.map(t=>Lp(t))}function OC(e){let t={},r=Object.getOwnPropertyDescriptors(e);for(let o of Object.keys(r)){let i=r[o];s.HasPropertyKey(i,"value")&&Object.defineProperty(t,o,{...i,value:Lp(i.value)})}return t}function AC(e){return new RegExp(e.source,e.flags)}function Lp(e){return e instanceof RegExp?AC(e):_C(e)?e:s.IsArray(e)?hC(e):s.IsObject(e)?OC(e):e}function Ko(e){return Nt.clone+=1,Lp(e)}var Tt={};bt(Tt,{Get:()=>xC,Reset:()=>SC,Set:()=>bC});var en={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function SC(){en.immutableTypes=!1,en.maxErrors=8,en.useEval=!0,en.exactOptionalPropertyTypes=!1,en.enumerableKind=!1}function bC(e){for(let t of s.Keys(e)){let r=e[t];r!==void 0&&Object.defineProperty(en,t,{value:r})}}function xC(){return en}function RC(e,t,r={}){for(let o of Object.keys(t))Object.defineProperty(e,o,{configurable:!0,writable:!0,enumerable:!1,value:t[o]});return e}function wl(e,t){return{...e,...t}}function CC(e,t,r={}){Nt.create+=1;let o=Tt.Get(),i=wl(t,r),a=o.enumerableKind?wl(i,e):RC(i,e);return o.immutableTypes?Object.freeze(a):a}function PC(e,t){Nt.discard+=1;let r={},o=Object.getOwnPropertyDescriptors(Ko(e)),i=new Set(t);for(let a of Object.keys(o))i.has(a)||Object.defineProperty(r,a,o[a]);return r}function UC(e,t,r){Nt.update+=1;let o=Tt.Get(),i=Ko(e);for(let a of Object.keys(t))Object.defineProperty(i,a,{configurable:!0,writable:!0,enumerable:o.enumerableKind,value:t[a]});for(let a of Object.keys(r))Object.defineProperty(i,a,{configurable:!0,enumerable:!0,writable:!0,value:r[a]});return i}function h(e,t){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],t)}function A(e){return s.IsObject(e)}function Ml(e){return g.Create({"~kind":"OptionalAddAction"},{type:e},{})}function $l(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalAddAction")&&A(e.type)}function Dl(e){return g.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function Gl(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalRemoveAction")&&A(e.type)}function vl(e){return g.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function jl(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyAddAction")&&A(e.type)}function Fl(e){return g.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function Bl(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&A(e.type)}function C(e,t,r){return g.Create({"~kind":"Deferred"},{action:e,parameters:t,options:r},{})}function ql(e){return h(e,"Deferred")}function kp(e){return g.Update(e,{"~immutable":!0},{})}function Sr(e){return kp(e)}function tn(e){return A(e)&&s.HasPropertyKey(e,"~immutable")}function Bn(e){return g.Discard(e,["~optional"])}function it(e){return g.Update(e,{"~optional":!0},{})}function Ca(e){return it(e)}function Pe(e){return A(e)&&s.HasPropertyKey(e,"~optional")}function Pa(e){return g.Discard(e,["~readonly"])}function at(e){return g.Update(e,{"~readonly":!0},{})}function Ua(e){return at(e)}function rn(e){return A(e)&&s.HasPropertyKey(e,"~readonly")}function Lt(e,t){return g.Create({"~kind":"Array"},{type:"array",items:e},t)}function J(e){return h(e,"Array")}function Na(e){return g.Discard(e,["~kind","type","items"])}function vt(e,t){return g.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},t)}function Ye(e){return h(e,"AsyncIterator")}function Hl(e){return g.Discard(e,["~kind","type","iteratorItems"])}function Kl(e){return{enumerable:Tt.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var La=class{constructor(){globalThis.Object.defineProperty(this,"~kind",Kl("Base")),globalThis.Object.defineProperty(this,"~guard",Kl({check:t=>this.Check(t),errors:t=>this.Errors(t)}))}Check(t){return!0}Errors(t){return[]}Convert(t){return t}Clean(t){return t}Default(t){return t}Create(){throw new Error("Create not implemented")}Clone(){throw Error("Clone not implemented")}};function _t(e){return h(e,"Base")}function br(e,t,r={}){return g.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},r)}function Ue(e){return h(e,"Constructor")}function zl(e){return g.Discard(e,["~kind","type","parameters","instanceType"])}function xr(e,t,r={}){return g.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},r)}function Ne(e){return h(e,"Function")}function Vl(e){return g.Discard(e,["~kind","type","parameters","returnType"])}function be(e,t){return g.Create({"~kind":"Ref"},{$ref:e},t)}function se(e){return h(e,"Ref")}function Rr(e,t){return g.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function qn(e){return h(e,"Generic")}var Yl="(?!)";function Y(e){return g.Create({"~kind":"Never"},{not:{}},e)}function or(e){return h(e,"Never")}function NC(){return["(not-resolvable)",Y()]}function LC(){return["(not-generic)",Y()]}function kC(e,t,r){return[e,Rr(t,r)]}function wC(e,t,r){return t in e?Ql(e,t,e[t],r):NC()}function Ql(e,t,r,o){return qn(r)?kC(t,r.parameters,r.expression):se(r)?wC(e,r.$ref,o):LC()}function Wl(e,t,r){return Ql(e,"(anonymous)",t,r)}function jt(e,t,r){let o=s.Keys(e).reduce((i,a)=>({...i,[a]:g.Update(e[a],{},{$id:a})}),{});return g.Create({"~kind":"Cyclic"},{$defs:o,$ref:t},r)}function pe(e){return h(e,"Cyclic")}var ne={};bt(ne,{Match:()=>MC});function MC(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function Fe(e){return g.Create({"~kind":"Unknown"},{},e)}function st(e){return h(e,"Unknown")}function zo(...e){let[t,r]=ne.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,Fe(),Fe()]});return g.Create({"~kind":"Infer"},{type:"infer",name:t,extends:r},{})}function _e(e){return h(e,"Infer")}function Hn(e){return g.Create({"~kind":"Any"},{},e)}function Xe(e){return h(e,"Any")}function Zl(e){return s.IsObjectNotArray(e)}function Xl(e){return s.Keys(e).filter(r=>isNaN(r)).reduce((r,o)=>[...r,e[o]],[])}function Jl(e,t){let r=Zl(e)?Xl(e):e;return g.Create({"~kind":"Enum"},{enum:r},t)}function he(e){return h(e,"Enum")}function ht(e,t={}){return g.Create({"~kind":"Intersect"},{allOf:e},t)}function U(e){return h(e,"Intersect")}function ed(e){return g.Discard(e,["~kind","allOf"])}function F(){throw new Error("Unreachable")}var Pr={};bt(Pr,{Hash:()=>JC,HashCode:()=>sd});function $C(e){let t=new Set,r=e;for(;r&&r!==Object.prototype;){for(let o of Reflect.ownKeys(r))o!=="constructor"&&typeof o!="symbol"&&t.add(o);r=Object.getPrototypeOf(r)}return[...t]}function DC(e){return typeof e=="number"}var Je;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(Je||(Je={}));var Kn=BigInt("14695981039346656037"),[GC,vC]=[BigInt("1099511628211"),BigInt("18446744073709551616")],jC=Array.from({length:256}).map((e,t)=>BigInt(t)),od=new Float64Array(1),id=new DataView(od.buffer),ad=new Uint8Array(od.buffer);function Be(e){Kn=Kn^jC[e],Kn=Kn*GC%vC}function FC(e){Be(Je.Array);for(let t of e)Cr(t)}function BC(e){Be(Je.BigInt),id.setBigInt64(0,e);for(let t of ad)Be(t)}function rd(e){Be(Je.Boolean),Be(e?1:0)}function qC(e){Be(Je.Constructor),Cr(e.toString())}function HC(e){Be(Je.Date),Cr(e.getTime())}function KC(e){Be(Je.Function),Cr(e.toString())}function zC(e){Be(Je.Null)}function nd(e){Be(Je.Number),id.setFloat64(0,e,!0);for(let t of ad)Be(t)}function VC(e){Be(Je.Object);for(let t of $C(e).sort())Cr(t),Cr(e[t])}function YC(e){Be(Je.RegExp),wp(e.toString())}var QC=new TextEncoder;function wp(e){Be(Je.String);for(let t of QC.encode(e))Be(t)}function WC(e){Be(Je.Symbol),Cr(e.toString())}function ZC(e){Be(Je.TypeArray);let t=new Uint8Array(e.buffer);for(let r=0;r<t.length;r++)Be(t[r])}function XC(e){return Be(Je.Undefined)}function Cr(e){return Ze.IsTypeArray(e)?ZC(e):Ze.IsDate(e)?HC(e):Ze.IsRegExp(e)?YC(e):Ze.IsBoolean(e)?rd(e.valueOf()):Ze.IsString(e)?wp(e.valueOf()):Ze.IsNumber(e)?nd(e.valueOf()):DC(e)?nd(e):s.IsArray(e)?FC(e):s.IsBoolean(e)?rd(e):s.IsBigInt(e)?BC(e):s.IsConstructor(e)?qC(e):s.IsNull(e)?zC(e):s.IsObject(e)?VC(e):s.IsString(e)?wp(e):s.IsSymbol(e)?WC(e):s.IsUndefined(e)?XC(e):s.IsFunction(e)?KC(e):F()}function sd(e){return Kn=BigInt("14695981039346656037"),Cr(e),Kn}function JC(e){return sd(e).toString(16).padStart(16,"0")}function pd(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~guard":return"must match check function";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var eP=pd;function cd(){return eP}var Vo=class{constructor(t,r){this.type=t,this.decode=r}Encode(t){let r=this.type,o=nn(r)?p=>this.decode(r["~codec"].decode(p)):this.decode,i=nn(r)?p=>r["~codec"].encode(t(p)):t,a={decode:o,encode:i};return g.Update(this.type,{"~codec":a},{})}},Yo=class{constructor(t){this.type=t}Decode(t){return new Vo(this.type,t)}};function ka(e){return new Yo(e)}function ud(e,t){return ka(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function ld(e,t){return ka(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function nn(e){return A(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function rP(e,t){let r=wa(e)?[...e["~refine"],t]:[t];return g.Update(e,{"~refine":r},{})}function dd(e,t,r="error"){return rP(e,{refine:t,message:r})}function wa(e){return A(e)&&s.HasPropertyKey(e,"~refine")}var fd="-?(?:0|[1-9][0-9]*)n";function Qo(e){return g.Create({"~kind":"BigInt"},{type:"bigint"},e)}function lt(e){return h(e,"BigInt")}function Ma(e){return g.Create({"~kind":"Boolean"},{type:"boolean"},e)}function et(e){return h(e,"Boolean")}function Wo(e){return g.Create({"~kind":"Identifier"},{name:e})}function gd(e){return h(e,"Identifier")}var $a="-?(?:0|[1-9][0-9]*)";function on(e){return g.Create({"~kind":"Integer"},{type:"integer"},e)}function Me(e){return h(e,"Integer")}function Ft(e,t){return g.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},t)}function Qe(e){return h(e,"Iterator")}function yd(e){return g.Discard(e,["~kind","type","iteratorItems"])}var Mp=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function nP(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new Mp(e)})()}function H(e,t){return g.Create({"~kind":"Literal"},{type:nP(e),const:e},t)}function Da(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function Ed(e){return W(e)&&s.IsBigInt(e.const)}function Id(e){return W(e)&&s.IsBoolean(e.const)}function zn(e){return W(e)&&s.IsNumber(e.const)}function Vn(e){return W(e)&&s.IsString(e.const)}function W(e){return h(e,"Literal")}function Ur(e){return g.Create({"~kind":"Null"},{type:"null"},e)}function Bt(e){return h(e,"Null")}var Ga="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function Ot(e){return g.Create({"~kind":"Number"},{type:"number"},e)}function ge(e){return h(e,"Number")}function Yn(e){return g.Create({"~kind":"Symbol"},{type:"symbol"},e)}function qt(e){return h(e,"Symbol")}function Td(e){return s.Keys(e).filter(t=>!Pe(e[t]))}function _d(e){return s.Keys(e)}function va(e){return s.Values(e)}function oP(e,t={}){let r=Td(e),o=r.length>0?{required:r}:{};return g.Create({"~kind":"Object"},{type:"object",...o,properties:e},t)}var N=oP;function w(e){return h(e,"Object")}function hd(e){return g.Discard(e,["~kind","type","properties","required"])}function an(...e){let[t,r,o]=ne.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[i,a,a],1:i=>[i,Fe(),Fe()]});return g.Create({"~kind":"Parameter"},{name:t,extends:r,equals:o},{})}function Od(e){return h(e,"Parameter")}function Ht(e,t){return g.Create({"~kind":"Promise"},{type:"promise",item:e},t)}function qe(e){return h(e,"Promise")}function Ad(e){return g.Discard(e,["~kind","type","item"])}var ja=".*";function pt(e){return g.Create({"~kind":"String"},{type:"string"},e)}function xe(e){return h(e,"String")}function ct(e,t){let r="object",o={[e]:t};return g.Create({"~kind":"Record"},{type:r,patternProperties:o})}var Qn=`^${$a}$`,Wn=`^${Ga}$`,Kt=`^${ja}$`;function Zo(e,t,r={}){return C("Record",[e,t],r)}function iP(e,t,r={}){return R({},Zo(e,t,r))}function Fa(e,t,r={}){return iP(e,t,r)}function Sd(e,t){return ct(e,t)}function dt(e){return s.Keys(e.patternProperties)[0]}function Zn(e){let t=dt(e);return s.IsEqual(t,Qn)?on():s.IsEqual(t,Wn)?Ot():pt()}function He(e){return e.patternProperties[dt(e)]}function ye(e){return h(e,"Record")}function sn(e){return g.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function Nr(e){return h(e,"Rest")}function Ba(e){return g.Create({"~kind":"This"},{$ref:"#"},e)}function bd(e){return h(e,"This")}function $e(e,t={}){let[r,o,i]=[e,e.length,!1];return g.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:r,minItems:o},t)}function K(e){return h(e,"Tuple")}function xd(e){return g.Discard(e,["~kind","type","items","minItems","additionalItems"])}function Xn(e){return g.Create({"~kind":"Undefined"},{type:"undefined"},e)}function zt(e){return h(e,"Undefined")}function G(e,t={}){return g.Create({"~kind":"Union"},{anyOf:e},t)}function O(e){return h(e,"Union")}function Rd(e){return g.Discard(e,["~kind","anyOf"])}function Cd(e){return g.Create({"~kind":"Unsafe"},{},e)}function Pd(e){return h(e,"Unsafe")}function qa(e){return g.Create({"~kind":"Void"},{type:"void"},e)}function ft(e){return h(e,"Void")}function sP(e,t){return s.IsEqual(e,"Array")?Lt(t[0]):s.IsEqual(e,"AsyncIterator")?vt(t[0]):s.IsEqual(e,"Iterator")?Ft(t[0]):s.IsEqual(e,"Promise")?Ht(t[0]):s.IsEqual(e,"Awaited")?yi(t[0]):s.IsEqual(e,"Capitalize")?Jo(t[0]):s.IsEqual(e,"ConstructorParameters")?oi(t[0]):s.IsEqual(e,"Evaluate")?Dp(t[0]):s.IsEqual(e,"Exclude")?ii(t[0],t[1]):s.IsEqual(e,"Extract")?ai(t[0],t[1]):s.IsEqual(e,"Index")?to(t[0],t[1]):s.IsEqual(e,"InstanceType")?si(t[0]):s.IsEqual(e,"Lowercase")?ei(t[0]):s.IsEqual(e,"NonNullable")?pi(t[0]):s.IsEqual(e,"Omit")?ci(t[0],t[1]):s.IsEqual(e,"Options")?no(t[0],t[1]):s.IsEqual(e,"Parameters")?mi(t[0]):s.IsEqual(e,"Partial")?ui(t[0]):s.IsEqual(e,"Pick")?li(t[0],t[1]):s.IsEqual(e,"Readonly")?di(t[0]):s.IsEqual(e,"KeyOf")?ro(t[0]):s.IsEqual(e,"Record")?Zo(t[0],t[1]):s.IsEqual(e,"Required")?fi(t[0]):s.IsEqual(e,"ReturnType")?gi(t[0]):s.IsEqual(e,"Uncapitalize")?ti(t[0]):s.IsEqual(e,"Uppercase")?ri(t[0]):Ha(be(e),t)}function pn(){throw Error("Unreachable")}var pP=(e,t=[])=>e.reduce((r,o)=>s.IsArray(o)&&s.IsEqual(o.length,2)?[...r,o[0]]:[...r,o],[]),ir=e=>{let[t,r]=e;return pP([...t,...r])};function wd(e){return an(e[0],e[2],e[4])}function Md(e){return an(e[0],e[2],e[2])}function $d(e){return an(e[0],Fe(),e[2])}function Dd(e){return an(e,Fe(),Fe())}function Gd(e){return ir(e)}function vd(e){return e[1]}function jd(e){return ir(e)}function Fd(e){return e[1]}function Bd(e){return sP(e[0],e[1])}function qd(e){return null}function Hd(e){return pt()}function Kd(e){return Ot()}function zd(e){return Ma()}function Vd(e){return Xn()}function Yd(e){return Ur()}function Qd(e){return on()}function Wd(e){return Qo()}function Zd(e){return Fe()}function Xd(e){return Hn()}function Jd(e){return N({})}function ef(e){return Y()}function tf(e){return Yn()}function rf(e){return qa()}function nf(e){return Ba()}function of(e){return e[1]}function af(e){return H(e)}function sf(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function pf(e){return e[1]}function cf(e){return Xo(e)}function mf(e){return H(BigInt(e))}function uf(e){return H(s.IsEqual(e,"true"))}function lf(e){return H(parseFloat(e))}function df(e){return H(e)}function ff(e){return e.length>0}function gf(e){return e.reduce((t,r)=>s.IsEqual(r.length,3)?[...t,[r[1]]]:[...t,[]],[])}function yf(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function Ef(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}var Ud=(e,t)=>t.reduceRight((r,o)=>{let i=o;return s.IsEqual(i.length,1)?to(r,i[0]):s.IsEqual(i.length,0)?Lt(r):pn()},e),Nd=(e,t)=>s.IsEqual(t.length,3)?ni(e,t[0],t[1],t[2]):e;function If(e){let[t,r,o,i]=e;return Nd(t?ro(Ud(r,o)):Ud(r,o),i)}function $p(e,t){return s.IsEqual(t.length,3)?(()=>{let[r,o,i]=t,a=$p(o,i);if(s.IsEqual(r,"&"))return U(a)?ht([e,...a.allOf]):ht([e,a]);if(s.IsEqual(r,"|"))return O(a)?G([e,...a.anyOf]):G([e,a]);pn()})():e}function Tf(e){let[t,r]=e;return $p(t,r)}function _f(e){let[t,r]=e;return $p(t,r)}function hf(e){return kp(e[1])}function Of(e){return e[1]}function Af(e){return Rr(e[0],e[2])}function Sf(e){return s.IsEqual(e.length,4)?zo(e[1],e[3]):s.IsEqual(e.length,2)?zo(e[1],Fe()):pn()}function bf(e){return`${e}`}function xf(e){return Me(e[3])?Qn:ge(e[3])?Wn:qt(e[3])?Kt:xe(e[3])?Kt:pn()}function Rf(e){return e.length>0}function Cf(e){return e.length>0}function Pf(e){let[t,r,o,i,a]=e;return{[r]:t&&o?at(it(a)):t&&!o?at(a):!t&&o?it(a):a}}function Uf(e){return ir(e)}function Nf(e){return e.reduce((t,r)=>s.HasPropertyKey(r,Qn)||s.HasPropertyKey(r,Wn)||s.HasPropertyKey(r,Kt)?[t[0],g.Assign(t[1],r)]:[g.Assign(t[0],r),t[1]],[{},{}])}function Lf(e){return Nf(e[1])}function kf(e){let[t,r]=e,o=s.IsEqual(s.Keys(r).length,0)?{}:{patternProperties:r};return N(t,o)}function wf(e){return s.IsEqual(e.length,5)?at(it(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?at(e[3]):it(e[3]):pn()}function Mf(e){return at(it(e[1]))}function $f(e){return at(e[1])}function Df(e){return it(e[0])}function Gf(e){return s.IsEqual(e.length,2)?sn(e[1]):s.IsEqual(e.length,1)?e[0]:pn()}function vf(e){return ir(e)}function jf(e){return $e(e[1])}function Ff(e){return at(it(e[4]))}function Bf(e){return at(e[3])}function qf(e){return it(e[3])}function Hf(e){return e[2]}function Kf(e){return s.IsEqual(e.length,2)?sn(e[1]):s.IsEqual(e.length,1)?e[0]:pn()}function zf(e){return ir(e)}function Vf(e){return xr(e[1],e[4])}function Yf(e){return br(e[2],e[5])}function Ld(e,t){return s.IsEqual(e,"remove")?Fl(t):s.IsEqual(e,"add")?vl(t):t}function Qf(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function kd(e,t){return s.IsEqual(e,"remove")?Dl(t):s.IsEqual(e,"add")?Ml(t):t}function Wf(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function Zf(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function Xf(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?Jn(Wo(e[3]),e[5],e[6][0],Ld(e[1],kd(e[8],e[10]))):Jn(Wo(e[3]),e[5],be(e[3]),Ld(e[1],kd(e[8],e[10])))}function Jf(e){return be(e)}function eg(e){return no(e[2],e[4])}function tg(e){return parseFloat(e)}function rg(e){return s.IsEqual(e,"true")}function ng(e){return null}function og(e){return{[e[0]]:e[2]}}function ig(e){return ir(e)}function cP(e){return e.reduce((t,r)=>g.Assign(t,r),{})}function ag(e){return cP(e[1])}function sg(e){return ir(e)}function pg(e){return e[1]}function cg(e){return Qo()}function mg(e){return pt()}function ug(e){return Ot()}function lg(e){return on()}function dg(e){return Y()}function fg(e){return H(e)}function gg(e){return G(e[1])}function yg(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Eg(e){return[e[0],...e[1]]}function Ig(e){return e[1]}function Tg(e){return ir(e)}function _g(e){return s.IsEqual(e.length,2)?e[1]:[]}function hg(e){let t=e[2],r=e[3],[o,i]=e[4],a=s.IsEqual(s.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:Rr(t,eo(r,o,a))}}function Og(e){let t=e[2],[r,o]=e[3],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:eo(t,r,i)}}function Ag(e){return{[e[1]]:Rr(e[2],e[4])}}function Sg(e){return{[e[1]]:e[3]}}function bg(e){return null}function xg(e){return Nf(ir(e))}function Rg(e){return e[1]}function Cg(e){let t=e[0],r=e[1];return Gp(g.Assign(t,r[0]))}function oe(e){return Xr(e)&&X(e.length,2)}function lP(e,t){return X(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Le(e,t){let[r,...o]=e;return Ar(r)?(()=>{let i=lP(r,t);return X(i.length,2)?i:Le(o,t)})():[]}function vp(e,t){return Array.from({length:t-e+1},(r,o)=>String.fromCharCode(e+o))}var Pg=[...vp(97,122),...vp(65,90)],jp="0",Fp=vp(49,57),oo=[jp,...Fp],Ug=" ",io=`
28
+ `;var Lr="_",Ka=".",Ng="$",za="-";var Lg="//",kg="/*",fP="*/";function wg(e){let t=e.indexOf(fP);return X(t,-1)?"":e.slice(t+2)}function Mg(e){let t=e.indexOf(io);return X(t,-1)?"":e.slice(t)}function gP(e){return e.replace(/^[ \t\r\f\v]+/,"")}function Va(e){let t=gP(e);return t.startsWith(kg)?Va(wg(t.slice(2))):t.startsWith(Lg)?Va(Mg(t.slice(2))):t}function mt(e){let t=e.trimStart();return t.startsWith(kg)?mt(wg(t.slice(2))):t.startsWith(Lg)?mt(Mg(t.slice(2))):t}function yP(e,t){return e.includes(t)}function ao(e,t,r,o=""){let i=Le(e,r);return oe(i)?yP(t,i[0])?ao(e,t,i[1],o):ao(e,t,i[1],`${o}${i[0]}`):[o,r]}function Ya(e,t){let r=Le([e],t);return oe(r)?r:["",t]}function EP(e){return Ya(za,e)}function IP(e){return Le(Fp,e)}var TP=[...oo,Lr];function _P(e){return ao(TP,[Lr],e)}function hP(e){let t=EP(e);return oe(t)?(()=>{let r=Le([jp],t[1]);return oe(r)?[`${t[0]}${r[0]}`,r[1]]:(()=>{let o=IP(t[1]);return oe(o)?(()=>{let i=_P(o[1]);return oe(i)?[`${t[0]}${o[0]}${i[0]}`,i[1]]:[]})():[]})()})():[]}function Qa(e){return hP(mt(e))}function OP(e){let t=Qa(e);return oe(t)?(()=>{let r=Le(["n"],t[1]);return oe(r)?[`${t[0]}`,r[1]]:[]})():[]}function $g(e){return OP(e)}function Bp(e,t){return Le([e],t)}function E(e,t){return X(e,"")?["",t]:e.startsWith(io)?Bp(e,Va(t)):e.startsWith(Ug)?Bp(e,t):Bp(e,mt(t))}var Dg=[...Pg,Lr,Ng];function AP(e){return Le(Dg,e)}var SP=[...Dg,...oo];function Gg(e,t=""){let r=Le(SP,e);return oe(r)?Gg(r[1],`${t}${r[0]}`):[t,e]}function bP(e){let t=AP(e);return oe(t)?(()=>{let r=Gg(t[1]);return oe(r)?[`${t[0]}${r[0]}`,r[1]]:[]})():[]}function Ee(e){return bP(mt(e))}var xP=[...oo,Lr];function RP(e){return Ya(za,e)}function CP(e){return oe(Le([Ka],e))}function vg(e){let t=ao(xP,[Lr],e);return oe(t)?X(t[0],"")?[]:[t[0],t[1]]:[]}function PP(e,t){let r=Le([Ka],t);return oe(r)?(()=>{let o=vg(r[1]);return oe(o)?[`${e}0${r[0]}${o[0]}`,o[1]]:[]})():[]}function UP(e,t){let r=Qa(t);return oe(r)?(()=>{let o=Le([Ka],r[1]);return oe(o)?(()=>{let i=vg(o[1]);return oe(i)?[`${e}${r[0]}${o[0]}${i[0]}`,i[1]]:[`${e}${r[0]}`,o[1]]})():[`${e}${r[0]}`,r[1]]})():[]}function NP(e){let t=RP(e);return oe(t)?CP(t[1])?PP(t[0],t[1]):UP(t[0],t[1]):[]}function Wa(e){return NP(mt(e))}function jg(e,t){let[r,...o]=e;return Ar(r)?t.startsWith(r)?!0:jg(o,t):!1}function kr(e,t,r=""){return X(t,"")?[]:jg(e,t)?[r,t]:(()=>{let[o,i]=[t.slice(0,1),t.slice(1)];return kr(e,i,`${r}${o}`)})()}function LP(e,t,r){return r.startsWith(e)?(()=>{let o=kr([t],r.slice(e.length));return oe(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function kP(e,t,r){return r.startsWith(e)?(()=>{let o=kr([io,t],r.slice(e.length));return oe(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function Fg(e,t,r,o){return r?LP(e,t,mt(o)):kP(e,t,mt(o))}function wP(e,t){return Le(e,t)}function MP(e,t){return Fg(e,e,!1,t)}function $P(e,t){let r=wP(e,t);return oe(r)?MP(r[0],`${r[0]}${r[1]}`):[]}function Za(e,t){return $P(e,mt(t))}function Bg(e,t){let r=kr(e,t);return oe(r)?X(r[0],"")?[]:r:[]}var c=(e,t,r=()=>[])=>e.length===2?t(e):r(),GP=e=>c(c(Ee(e),([t,r])=>c(E("extends",r),([o,i])=>c(Z(i),([a,p])=>c(E("=",p),([u,l])=>c(Z(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[wd(t),r]),vP=e=>c(c(Ee(e),([t,r])=>c(E("extends",r),([o,i])=>c(Z(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Md(t),r]),jP=e=>c(c(Ee(e),([t,r])=>c(E("=",r),([o,i])=>c(Z(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[$d(t),r]),FP=e=>c(Ee(e),([t,r])=>[Dd(t),r]),Kg=e=>c(c(GP(e),([t,r])=>[t,r],()=>c(vP(e),([t,r])=>[t,r],()=>c(jP(e),([t,r])=>[t,r],()=>c(FP(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),zg=(e,t=[])=>c(c(Kg(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>zg(o,[...t,r]),()=>[t,e]),BP=e=>c(c(zg(e),([t,r])=>c(c(c(Kg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Gd(t),r]),Kp=e=>c(c(E("<",e),([t,r])=>c(BP(r),([o,i])=>c(E(">",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[vd(t),r]),Vg=(e,t=[])=>c(c(Z(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>Vg(o,[...t,r]),()=>[t,e]),qP=e=>c(c(Vg(e),([t,r])=>c(c(c(Z(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[jd(t),r]),HP=e=>c(c(E("<",e),([t,r])=>c(qP(r),([o,i])=>c(E(">",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Fd(t),r]),KP=e=>c(c(Ee(e),([t,r])=>c(HP(r),([o,i])=>[[t,o],i])),([t,r])=>[Bd(t),r]),Yg=e=>c(c(c(E(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[qd(t),r]),Qg=e=>c(E("string",e),([t,r])=>[Hd(t),r]),Wg=e=>c(E("number",e),([t,r])=>[Kd(t),r]),zP=e=>c(E("boolean",e),([t,r])=>[zd(t),r]),VP=e=>c(E("undefined",e),([t,r])=>[Vd(t),r]),YP=e=>c(E("null",e),([t,r])=>[Yd(t),r]),Zg=e=>c(E("integer",e),([t,r])=>[Qd(t),r]),QP=e=>c(E("bigint",e),([t,r])=>[Wd(t),r]),WP=e=>c(E("unknown",e),([t,r])=>[Zd(t),r]),ZP=e=>c(E("any",e),([t,r])=>[Xd(t),r]),XP=e=>c(E("object",e),([t,r])=>[Jd(t),r]),JP=e=>c(E("never",e),([t,r])=>[ef(t),r]),Xg=e=>c(E("symbol",e),([t,r])=>[tf(t),r]),eU=e=>c(E("void",e),([t,r])=>[rf(t),r]),tU=e=>c(E("this",e),([t,r])=>[nf(t),r]),rU=e=>c(c(Qg(e),([t,r])=>[t,r],()=>c(Wg(e),([t,r])=>[t,r],()=>c(zP(e),([t,r])=>[t,r],()=>c(VP(e),([t,r])=>[t,r],()=>c(YP(e),([t,r])=>[t,r],()=>c(Zg(e),([t,r])=>[t,r],()=>c(QP(e),([t,r])=>[t,r],()=>c(WP(e),([t,r])=>[t,r],()=>c(ZP(e),([t,r])=>[t,r],()=>c(XP(e),([t,r])=>[t,r],()=>c(JP(e),([t,r])=>[t,r],()=>c(Xg(e),([t,r])=>[t,r],()=>c(eU(e),([t,r])=>[t,r],()=>c(tU(e),([t,r])=>[t,r],()=>[])))))))))))))),([t,r])=>[t,r]),nU=e=>c(c(E("${",e),([t,r])=>c(Z(r),([o,i])=>c(E("}",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[of(t),r]),qp=e=>c(kr(["${","`"],e),([t,r])=>[af(t),r]),Jg=e=>c(c(c(qp(e),([t,r])=>c(nU(r),([o,i])=>c(Jg(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c(c(qp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c(c(qp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[sf(t),r]),zp=e=>c(c(E("`",e),([t,r])=>c(Jg(r),([o,i])=>c(E("`",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[pf(t),r]),oU=e=>c(zp(e),([t,r])=>[cf(t),r]),iU=e=>c($g(e),([t,r])=>[mf(t),r]),aU=e=>c(c(E("true",e),([t,r])=>[t,r],()=>c(E("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[uf(t),r]),sU=e=>c(Wa(e),([t,r])=>[lf(t),r]),pU=e=>c(Za(["'",'"'],e),([t,r])=>[df(t),r]),cU=e=>c(c(iU(e),([t,r])=>[t,r],()=>c(aU(e),([t,r])=>[t,r],()=>c(sU(e),([t,r])=>[t,r],()=>c(pU(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),mU=e=>c(c(c(E("keyof",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[ff(t),r]),ey=(e,t=[])=>c(c(c(E("[",e),([r,o])=>c(Z(o),([i,a])=>c(E("]",a),([p,u])=>[[r,i,p],u]))),([r,o])=>[r,o],()=>c(c(E("[",e),([r,o])=>c(E("]",o),([i,a])=>[[r,i],a])),([r,o])=>[r,o],()=>[])),([r,o])=>ey(o,[...t,r]),()=>[t,e]),uU=e=>c(ey(e),([t,r])=>[gf(t),r]),lU=e=>c(c(c(E("extends",e),([t,r])=>c(Z(r),([o,i])=>c(E("?",i),([a,p])=>c(Z(p),([u,l])=>c(E(":",l),([f,y])=>c(Z(y),([I,x])=>[[t,o,a,u,f,I],x])))))),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[yf(t),r]),dU=e=>c(c(c(E("(",e),([t,r])=>c(Z(r),([o,i])=>c(E(")",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c(rU(e),([t,r])=>[t,r],()=>c(bU(e),([t,r])=>[t,r],()=>c(NU(e),([t,r])=>[t,r],()=>c(oU(e),([t,r])=>[t,r],()=>c(cU(e),([t,r])=>[t,r],()=>c(DU(e),([t,r])=>[t,r],()=>c($U(e),([t,r])=>[t,r],()=>c(FU(e),([t,r])=>[t,r],()=>c(qU(e),([t,r])=>[t,r],()=>c(KP(e),([t,r])=>[t,r],()=>c(BU(e),([t,r])=>[t,r],()=>[])))))))))))),([t,r])=>[Ef(t),r]),ty=e=>c(c(mU(e),([t,r])=>c(dU(r),([o,i])=>c(uU(i),([a,p])=>c(lU(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[If(t),r]),ry=e=>c(c(c(E("&",e),([t,r])=>c(ty(r),([o,i])=>c(ry(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),ny=e=>c(c(ty(e),([t,r])=>c(ry(r),([o,i])=>[[t,o],i])),([t,r])=>[Tf(t),r]),oy=e=>c(c(c(E("|",e),([t,r])=>c(ny(r),([o,i])=>c(oy(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Xa=e=>c(c(ny(e),([t,r])=>c(oy(r),([o,i])=>[[t,o],i])),([t,r])=>[_f(t),r]),fU=e=>c(c(E("readonly",e),([t,r])=>c(Xa(r),([o,i])=>[[t,o],i])),([t,r])=>[hf(t),r]),gU=e=>c(c(E("|",e),([t,r])=>c(Xa(r),([o,i])=>[[t,o],i])),([t,r])=>[Of(t),r]),yU=e=>c(c(Kp(e),([t,r])=>c(E("=",r),([o,i])=>c(Z(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Af(t),r]),EU=e=>c(c(c(E("infer",e),([t,r])=>c(Ee(r),([o,i])=>c(E("extends",i),([a,p])=>c(Xa(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[t,r],()=>c(c(E("infer",e),([t,r])=>c(Ee(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>[])),([t,r])=>[Sf(t),r]),Z=e=>c(c(EU(e),([t,r])=>[t,r],()=>c(gU(e),([t,r])=>[t,r],()=>c(fU(e),([t,r])=>[t,r],()=>c(Xa(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),IU=e=>c(Wa(e),([t,r])=>[bf(t),r]),TU=e=>c(Ee(e),([t,r])=>[t,r]),_U=e=>c(Za(["'",'"'],e),([t,r])=>[t,r]),hU=e=>c(c(E("[",e),([t,r])=>c(Ee(r),([o,i])=>c(E(":",i),([a,p])=>c(c(Zg(p),([u,l])=>[u,l],()=>c(Wg(p),([u,l])=>[u,l],()=>c(Qg(p),([u,l])=>[u,l],()=>c(Xg(p),([u,l])=>[u,l],()=>[])))),([u,l])=>c(E("]",l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[xf(t),r]),iy=e=>c(c(IU(e),([t,r])=>[t,r],()=>c(TU(e),([t,r])=>[t,r],()=>c(_U(e),([t,r])=>[t,r],()=>c(hU(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),OU=e=>c(c(c(E("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Rf(t),r]),AU=e=>c(c(c(E("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Cf(t),r]),ay=e=>c(c(OU(e),([t,r])=>c(iy(r),([o,i])=>c(AU(i),([a,p])=>c(E(":",p),([u,l])=>c(Z(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Pf(t),r]),sy=e=>c(c(c(E(",",e),([t,r])=>c(E(`
29
+ `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E(";",e),([t,r])=>c(E(`
30
+ `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E(",",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c(c(E(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c(c(E(`
31
+ `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),py=(e,t=[])=>c(c(ay(e),([r,o])=>c(sy(o),([i,a])=>[[r,i],a])),([r,o])=>py(o,[...t,r]),()=>[t,e]),SU=e=>c(c(py(e),([t,r])=>c(c(c(ay(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Uf(t),r]),Vp=e=>c(c(E("{",e),([t,r])=>c(SU(r),([o,i])=>c(E("}",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Lf(t),r]),bU=e=>c(Vp(e),([t,r])=>[kf(t),r]),xU=e=>c(c(c(Ee(e),([t,r])=>c(E("?",r),([o,i])=>c(E(":",i),([a,p])=>c(E("readonly",p),([u,l])=>c(Z(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[t,r],()=>c(c(Ee(e),([t,r])=>c(E(":",r),([o,i])=>c(E("readonly",i),([a,p])=>c(Z(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[t,r],()=>c(c(Ee(e),([t,r])=>c(E("?",r),([o,i])=>c(E(":",i),([a,p])=>c(Z(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[t,r],()=>c(c(Ee(e),([t,r])=>c(E(":",r),([o,i])=>c(Z(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>[])))),([t,r])=>[wf(t),r]),RU=e=>c(c(E("readonly",e),([t,r])=>c(Z(r),([o,i])=>c(E("?",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Mf(t),r]),CU=e=>c(c(E("readonly",e),([t,r])=>c(Z(r),([o,i])=>[[t,o],i])),([t,r])=>[$f(t),r]),PU=e=>c(c(Z(e),([t,r])=>c(E("?",r),([o,i])=>[[t,o],i])),([t,r])=>[Df(t),r]),qg=e=>c(c(xU(e),([t,r])=>[t,r],()=>c(RU(e),([t,r])=>[t,r],()=>c(CU(e),([t,r])=>[t,r],()=>c(PU(e),([t,r])=>[t,r],()=>c(Z(e),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),cy=e=>c(c(c(E("...",e),([t,r])=>c(qg(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(qg(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[Gf(t),r]),my=(e,t=[])=>c(c(cy(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>my(o,[...t,r]),()=>[t,e]),UU=e=>c(c(my(e),([t,r])=>c(c(c(cy(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[vf(t),r]),NU=e=>c(c(E("[",e),([t,r])=>c(UU(r),([o,i])=>c(E("]",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[jf(t),r]),LU=e=>c(c(Ee(e),([t,r])=>c(E("?",r),([o,i])=>c(E(":",i),([a,p])=>c(E("readonly",p),([u,l])=>c(Z(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Ff(t),r]),kU=e=>c(c(Ee(e),([t,r])=>c(E(":",r),([o,i])=>c(E("readonly",i),([a,p])=>c(Z(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Bf(t),r]),wU=e=>c(c(Ee(e),([t,r])=>c(E("?",r),([o,i])=>c(E(":",i),([a,p])=>c(Z(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[qf(t),r]),MU=e=>c(c(Ee(e),([t,r])=>c(E(":",r),([o,i])=>c(Z(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Hf(t),r]),Hg=e=>c(c(LU(e),([t,r])=>[t,r],()=>c(kU(e),([t,r])=>[t,r],()=>c(wU(e),([t,r])=>[t,r],()=>c(MU(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),uy=e=>c(c(c(E("...",e),([t,r])=>c(Hg(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(Hg(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[Kf(t),r]),ly=(e,t=[])=>c(c(uy(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>ly(o,[...t,r]),()=>[t,e]),dy=e=>c(c(ly(e),([t,r])=>c(c(c(uy(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[zf(t),r]),$U=e=>c(c(E("(",e),([t,r])=>c(dy(r),([o,i])=>c(E(")",i),([a,p])=>c(E("=>",p),([u,l])=>c(Z(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Vf(t),r]),DU=e=>c(c(E("new",e),([t,r])=>c(E("(",r),([o,i])=>c(dy(i),([a,p])=>c(E(")",p),([u,l])=>c(E("=>",l),([f,y])=>c(Z(y),([I,x])=>[[t,o,a,u,f,I],x])))))),([t,r])=>[Yf(t),r]),GU=e=>c(c(c(E("+",e),([t,r])=>c(E("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E("-",e),([t,r])=>c(E("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[Qf(t),r]),vU=e=>c(c(c(E("+",e),([t,r])=>c(E("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E("-",e),([t,r])=>c(E("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[Wf(t),r]),jU=e=>c(c(c(E("as",e),([t,r])=>c(Z(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Zf(t),r]),FU=e=>c(c(E("{",e),([t,r])=>c(GU(r),([o,i])=>c(E("[",i),([a,p])=>c(Ee(p),([u,l])=>c(E("in",l),([f,y])=>c(Z(y),([I,x])=>c(jU(x),([le,Se])=>c(E("]",Se),([hr,pl])=>c(vU(pl),([Fn,Wx])=>c(E(":",Wx),([Zx,Xx])=>c(Z(Xx),([Jx,eR])=>c(Yg(eR),([tR,rR])=>c(E("}",rR),([nR,oR])=>[[t,o,a,u,f,I,le,hr,Fn,Zx,Jx,tR,nR],oR]))))))))))))),([t,r])=>[Xf(t),r]),BU=e=>c(Ee(e),([t,r])=>[Jf(t),r]),qU=e=>c(c(E("Options",e),([t,r])=>c(E("<",r),([o,i])=>c(Z(i),([a,p])=>c(E(",",p),([u,l])=>c(yy(l),([f,y])=>c(E(">",y),([I,x])=>[[t,o,a,u,f,I],x])))))),([t,r])=>[eg(t),r]),HU=e=>c(Wa(e),([t,r])=>[tg(t),r]),KU=e=>c(c(E("true",e),([t,r])=>[t,r],()=>c(E("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[rg(t),r]),zU=e=>c(Za(['"',"'"],e),([t,r])=>[t,r]),VU=e=>c(E("null",e),([t,r])=>[ng(t),r]),fy=e=>c(c(iy(e),([t,r])=>c(E(":",r),([o,i])=>c(Yp(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[og(t),r]),gy=(e,t=[])=>c(c(fy(e),([r,o])=>c(sy(o),([i,a])=>[[r,i],a])),([r,o])=>gy(o,[...t,r]),()=>[t,e]),YU=e=>c(c(gy(e),([t,r])=>c(c(c(fy(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[ig(t),r]),yy=e=>c(c(E("{",e),([t,r])=>c(YU(r),([o,i])=>c(E("}",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[ag(t),r]),Ey=(e,t=[])=>c(c(Yp(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>Ey(o,[...t,r]),()=>[t,e]),QU=e=>c(c(Ey(e),([t,r])=>c(c(c(Yp(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[sg(t),r]),WU=e=>c(c(E("[",e),([t,r])=>c(QU(r),([o,i])=>c(E("]",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[pg(t),r]),Yp=e=>c(c(HU(e),([t,r])=>[t,r],()=>c(KU(e),([t,r])=>[t,r],()=>c(zU(e),([t,r])=>[t,r],()=>c(VU(e),([t,r])=>[t,r],()=>c(yy(e),([t,r])=>[t,r],()=>c(WU(e),([t,r])=>[t,r],()=>[])))))),([t,r])=>[t,r]),ZU=e=>c(E("-?(?:0|[1-9][0-9]*)n",e),([t,r])=>[cg(t),r]),XU=e=>c(E(".*",e),([t,r])=>[mg(t),r]),JU=e=>c(E("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",e),([t,r])=>[ug(t),r]),eN=e=>c(E("-?(?:0|[1-9][0-9]*)",e),([t,r])=>[lg(t),r]),tN=e=>c(E("(?!)",e),([t,r])=>[dg(t),r]),rN=e=>c(Bg(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,r])=>[fg(t),r]),nN=e=>c(c(ZU(e),([t,r])=>[t,r],()=>c(XU(e),([t,r])=>[t,r],()=>c(JU(e),([t,r])=>[t,r],()=>c(eN(e),([t,r])=>[t,r],()=>c(tN(e),([t,r])=>[t,r],()=>c(oN(e),([t,r])=>[t,r],()=>c(rN(e),([t,r])=>[t,r],()=>[]))))))),([t,r])=>[t,r]),oN=e=>c(c(E("(",e),([t,r])=>c(Qp(r),([o,i])=>c(E(")",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[gg(t),r]),Iy=e=>c(c(c(Hp(e),([t,r])=>c(E("|",r),([o,i])=>c(Iy(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c(c(Hp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[]))),([t,r])=>[yg(t),r]),Hp=e=>c(c(nN(e),([t,r])=>c(Qp(r),([o,i])=>[[t,o],i])),([t,r])=>[Eg(t),r]),Qp=e=>c(c(Iy(e),([t,r])=>[t,r],()=>c(Hp(e),([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Ty=e=>c(c(E("^",e),([t,r])=>c(Qp(r),([o,i])=>c(E("$",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Ig(t),r]),_y=(e,t=[])=>c(c(Z(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>_y(o,[...t,r]),()=>[t,e]),iN=e=>c(c(_y(e),([t,r])=>c(c(c(Z(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Tg(t),r]),hy=e=>c(c(c(E("extends",e),([t,r])=>c(iN(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[_g(t),r]),aN=e=>c(c(E("interface",e),([t,r])=>c(Ee(r),([o,i])=>c(Kp(i),([a,p])=>c(hy(p),([u,l])=>c(Vp(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[hg(t),r]),sN=e=>c(c(E("interface",e),([t,r])=>c(Ee(r),([o,i])=>c(hy(i),([a,p])=>c(Vp(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Og(t),r]),pN=e=>c(c(E("type",e),([t,r])=>c(Ee(r),([o,i])=>c(Kp(i),([a,p])=>c(E("=",p),([u,l])=>c(Z(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Ag(t),r]),cN=e=>c(c(E("type",e),([t,r])=>c(Ee(r),([o,i])=>c(E("=",i),([a,p])=>c(Z(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Sg(t),r]),mN=e=>c(c(c(E("export",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[bg(t),r]),uN=e=>c(c(c(E(";",e),([t,r])=>c(E(`
32
+ `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c(c(E(`
33
+ `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]),Oy=(e,t=[])=>c(c(Wp(e),([r,o])=>c(uN(o),([i,a])=>[[r,i],a])),([r,o])=>Oy(o,[...t,r]),()=>[t,e]),lN=e=>c(c(Oy(e),([t,r])=>c(c(c(Wp(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[xg(t),r]),Wp=e=>c(c(mN(e),([t,r])=>c(c(aN(r),([o,i])=>[o,i],()=>c(sN(r),([o,i])=>[o,i],()=>c(pN(r),([o,i])=>[o,i],()=>c(cN(r),([o,i])=>[o,i],()=>[])))),([o,i])=>c(Yg(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Rg(t),r]),dN=e=>c(c(Wp(e),([t,r])=>c(lN(r),([o,i])=>[[t,o],i])),([t,r])=>[Cg(t),r]),Ay=e=>c(c(dN(e),([t,r])=>[t,r],()=>c(yU(e),([t,r])=>[t,r],()=>c(Z(e),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]);function Sy(e){let t=zp(`\`${e}\``);return s.IsEqual(t.length,2)?t[0]:F()}function Xo(e,t={}){return C("TemplateLiteral",[e],t)}function by(e){return R({},Xo(e,{}))}function gN(e){let t=Sy(e);return by(t)}function xy(e,t={}){let r=s.IsString(e)?gN(e):by(e);return g.Update(r,{},t)}function Oe(e){return h(e,"TemplateLiteral")}var L={};bt(L,{ExtendsFalse:()=>j,ExtendsTrue:()=>S,ExtendsUnion:()=>Zp,IsExtendsFalse:()=>yN,IsExtendsTrue:()=>Cy,IsExtendsTrueLike:()=>Ie,IsExtendsUnion:()=>Ry});function Zp(e){return g.Create({"~kind":"ExtendsUnion"},{inferred:e})}function Ry(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsUnion")&&s.IsObject(e.inferred)}function S(e){return g.Create({"~kind":"ExtendsTrue"},{inferred:e})}function Cy(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsTrue")&&s.IsObject(e.inferred)}function j(){return g.Create({"~kind":"ExtendsFalse"},{})}function yN(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function Ie(e){return Ry(e)||Cy(e)}function Ja(e){let t=Ty(e);return s.IsEqual(t.length,2)?t[0]:F()}function EN(e){return!0}function Py(e){let[t,...r]=e;return A(t)?IN(t)?Py(r):!1:!0}function Uy(e){return s.IsEqual(e.length,0)?!1:Py(e)}function IN(e){return O(e)?Uy(e.anyOf):W(e)?EN(e.const):!1}function es(e){return Uy(e)}function Ny(e,t,r=[]){let[o,...i]=e;return s.IsString(o)?Ny(i,t,[...r,`${o}${t}`]):r}function TN(e,t){return s.IsEqual(e.length,0)?[`${t}`]:Ny(e,t)}function Ly(e,t,r=[]){let[o,...i]=t;return A(o)?Ly(e,i,[...r,...ky(e,o)]):r}function ky(e,t){return O(t)?Ly(e,t.anyOf):W(t)?TN(e,t.const):F()}function wy(e,t){let[r,...o]=t;return A(r)?wy(ky(e,r),o):e}function _N(e){return e.map(t=>H(t))}function hN(e){let t=wy([],e),r=_N(t);return G(r)}function ON(e){return s.IsEqual(e.length,0)?F():s.IsEqual(e.length,1)&&W(e[0])?e[0]:hN(e)}function Ke(e){let t=Ja(e);return es(t)?ON(t):pt()}function AN(e){return s.IsString(e)||s.IsNumber(e)?H(e):s.IsNull(e)?Ur():Y()}function kt(e){return e.map(r=>AN(r))}function Ei(e){let t=kt(e);return G(t)}function cn(e){return Ei(e.enum)}function SN(e,t,r,o){let i=ee(e,r,o);return Ie(i)?S(g.Assign(g.Assign(e,i.inferred),{[t]:r})):j()}function bN(e,t){return S(e)}function xN(e,t,r){let o=Ei(r);return ee(e,t,o)}function My(e,t,r){let[o,...i]=r;return A(o)?(()=>{let a=ee(e,t,o);return Ie(a)?My(a.inferred,t,i):j()})():S(e)}function RN(e,t,r){let o=Ke(r);return ee(e,t,o)}function $y(e,t,r){let[o,...i]=r;return A(o)?(()=>{let a=ee(e,t,o);return Ie(a)?S(a.inferred):$y(e,t,i)})():j()}function B(e,t,r){return Xe(r)?bN(e,t):he(r)?xN(e,t,r.enum):_e(r)?SN(e,r.name,t,r.extends):U(r)?My(e,t,r.allOf):Oe(r)?RN(e,t,r.pattern):O(r)?$y(e,t,r.anyOf):st(r)?S(e):j()}function Dy(e,t,r){return _e(r)?B(e,t,r):Xe(r)?S(e):st(r)?S(e):Zp(e)}function CN(e,t){let r=tn(e),o=tn(t);return r&&o||!r&&o?!0:!(r&&!o)}function Gy(e,t,r,o){return J(o)?CN(t,o)?ee(e,r,o.items):j():B(e,t,o)}function vy(e,t,r){return Ye(r)?ee(e,t,r.iteratorItems):B(e,vt(t),r)}function jy(e,t,r){return lt(r)?S(e):B(e,t,r)}function Fy(e,t,r){return et(r)?S(e):B(e,t,r)}function PN(e,t,r,o,i){let a=_e(o)?t:o,p=_e(o)?o:t,u=Pe(t),l=Pe(o),f=ee(e,a,p);return!u&&l?j():Ie(f)?Ii(f.inferred,r,i):j()}function UN(e,t,r,o){let[i,...a]=o;return A(i)?PN(e,t,r,i,a):Pe(t)?S(e):j()}function NN(e,t,r){let[o,...i]=t;return A(o)?UN(e,o,i,r):S(e)}function Ii(e,t,r){return NN(e,t,r)}function ts(e,t,r){return ft(r)?S(e):ee(e,t,r)}function By(e,t,r,o){return Ue(o)?(()=>{let i=Ii(e,t,o.parameters);return Ie(i)?ts(i.inferred,r,o.instanceType):j()})():j()}function qy(e,t,r){return ee(e,cn(t),r)}function Hy(e,t,r,o){return Ne(o)?(()=>{let i=Ii(e,t,o.parameters);return Ie(i)?ts(i.inferred,r,o.returnType):j()})():j()}function Ky(e,t,r){return Me(r)?S(e):ge(r)?S(e):B(e,t,r)}var Ti="equal",LN="disjoint",_i="left-inside",hi="right-inside";function Oi(e,t){let r=[st(e)?L.ExtendsFalse():ze({},e,t),st(e)?L.ExtendsTrue({}):ze({},t,e)];return L.IsExtendsTrueLike(r[0])&&L.IsExtendsTrueLike(r[1])?Ti:L.IsExtendsTrueLike(r[0])&&L.IsExtendsFalse(r[1])?_i:L.IsExtendsFalse(r[0])&&L.IsExtendsTrueLike(r[1])?hi:LN}function kN(e){return O(e)?Vt(e.anyOf):[e]}function Vt(e){return e.reduce((t,r)=>[...t,...kN(r)],[])}function Xp(e){return e.reduceRight((r,o,i)=>({[i]:o,...r}),{})}function zy(e){let t=Xp(e.items);return N(t)}function wN(e,t){return rn(e)?!!rn(t):!1}function MN(e,t){return Pe(e)?!!Pe(t):!1}function $N(e,t){let r=wN(e,t),o=MN(e,t),i=Ae([e,t]),a=Pa(Bn(i));return r&&o?at(it(a)):r&&!o?at(a):!r&&o?it(a):a}function DN(e,t,r){return r in e?r in t?$N(e[r],t[r]):e[r]:r in t?t[r]:Y()}function GN(e,t){return[...new Set([...s.Keys(t),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:DN(e,t,i)}),{})}function Vy(e){return w(e)?e.properties:K(e)?Xp(e.items):F()}function Yy(e,t){let r=Vy(e),o=Vy(t),i=GN(r,o);return N(i)}function Qy(e,t){let r=Oi(e,t);return s.IsEqual(r,_i)?e:s.IsEqual(r,hi)||s.IsEqual(r,Ti)?t:Y()}function Wy(e){return w(e)||K(e)}function Zy(e){return U(e)?Ae(e.allOf):e}function vN(e,t){let r=Zy(e),o=Zy(t),i=Wy(r),a=Wy(o);return i&&a?Yy(wr(r),o):i&&!a?wr(r):!i&&a?o:Qy(wr(r),o)}function Xy(e,t,r=[]){let[o,...i]=t;return s.IsUndefined(o)?r.length===0?[e]:r:Xy(e,i,[...r,vN(e,o)])}function Jy(e,t,r=[]){let[o,...i]=e;return A(o)?Jy(i,t,[...r,...Ai([o],t)]):r}function Ai(e,t=[]){let[r,...o]=e;return A(r)?O(r)?Ai(o,Jy(r.anyOf,t)):Ai(o,Xy(r,t)):t}function Ae(e){let t=Ai(e);return Jp(t)}function ar(e){return Jp(e)}function wr(e){return U(e)?Ae(e.allOf):O(e)?ar(e.anyOf):e}function mn(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?Y():G(e)}function jN(e,t){return t.filter(r=>Oi(e,r)!==hi)}function FN(e,t){let r=t.some(o=>{let i=Oi(e,o);return s.IsEqual(i,_i)||s.IsEqual(i,Ti)});return s.IsEqual(r,!1)}function BN(e,t){let r=wr(e);return Xe(r)?[r]:FN(r,t)?[...jN(r,t),r]:t}function ec(e,t=[]){let[r,...o]=e;return A(r)?w(r)?ec(o,[...t,r]):ec(o,BN(r,t)):t}function Jp(e){let t=ec(e),r=Vt(t);return r.length===0?Y():r.length===1?r[0]:G(r)}function qN(e,t,r,o){let i=_(e,t,r);return g.Update(wr(i),{},o)}function eE(e,t,r,o){return qN(e,t,r,o)}function tE(e,t,r){let o=Ae(t);return ee(e,o,r)}function rE(e,t,r){return Qe(r)?ee(e,t,r.iteratorItems):B(e,Ft(t),r)}function rs(e,t,r){return t===r?S(e):j()}function HN(e,t,r){return W(r)?rs(e,t,r.const):lt(r)?S(e):B(e,H(t),r)}function KN(e,t,r){return W(r)?rs(e,t,r.const):et(r)?S(e):B(e,H(t),r)}function zN(e,t,r){return W(r)?rs(e,t,r.const):ge(r)?S(e):B(e,H(t),r)}function VN(e,t,r){return W(r)?rs(e,t,r.const):xe(r)?S(e):B(e,H(t),r)}function nE(e,t,r){return s.IsBigInt(t.const)?HN(e,t.const,r):s.IsBoolean(t.const)?KN(e,t.const,r):s.IsNumber(t.const)?zN(e,t.const,r):s.IsString(t.const)?VN(e,t.const,r):F()}function oE(e,t,r){return _e(r)?B(e,t,r):S(e)}function iE(e,t,r){return Bt(r)?S(e):B(e,t,r)}function aE(e,t,r){return ge(r)?S(e):B(e,t,r)}function YN(e,t,r){return Pe(t)?Pe(r)?S(e):j():S(e)}function QN(e,t,r){return _e(r)&&or(r.extends)?j():(()=>{let o=ee(e,t,r);return Ie(o)?YN(o.inferred,t,r):j()})()}function WN(e,t){return e.reduce((r,o)=>o in t?Ie(t[o])?{...r,...t[o].inferred}:F():F(),{})}function ZN(e,t,r){let o={};for(let p of s.Keys(r))o[p]=p in t?QN({},t[p],r[p]):Pe(r[p])?_e(r[p])?S(g.Assign(e,{[r[p].name]:r[p].extends})):S(e):j();let i=s.Values(o).every(p=>Ie(p)),a=i?WN(s.Keys(o),o):{};return i?S(a):j()}function XN(e,t,r){let o=ZN(e,t,r);return Ie(o)?S(g.Assign(e,o.inferred)):j()}function JN(e,t,r){return XN(e,t,r)}function sE(e,t,r){return w(r)?JN(e,t,r.properties):B(e,N(t),r)}function pE(e,t,r){return qe(r)?ee(e,t,r.item):B(e,Ht(t),r)}function cE(e,t,r){return xe(r)?S(e):B(e,t,r)}function mE(e,t,r){return qt(r)?S(e):B(e,t,r)}function uE(e,t,r){let o=Ke(t);return ee(e,o,r)}function tc(e,t){return g.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function Si(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"name")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"Inferrable")&&s.IsString(e.name)&&s.IsObject(e.type)}function rc(e){return Nr(e)?_e(e.items)?J(e.items.extends)?tc(e.items.name,e.items.extends.items):st(e.items.extends)?tc(e.items.name,e.items.extends):void 0:F():void 0}function ns(e){return _e(e)?tc(e.name,e.extends):void 0}function nc(e,t,r=[]){let[o,...i]=e;return A(o)?(()=>{let a=ee({},o,t);return Ie(a)?nc(i,t,[...r,o]):void 0})():r}function lE(e,t,r,o){let i=nc(r,o);return s.IsArray(i)?S(g.Assign(e,{[t]:$e(i)})):j()}function os(e,t,r,o){let i=nc(r,o);return s.IsArray(i)?S(g.Assign(e,{[t]:G(i)})):j()}function eL(e){return[...e].reverse()}function oc(e,t){return t?eL(e):e}function tL(e){let t=e.length>0?e[0]:void 0,r=A(t)?rc(t):void 0;return A(r)}function rL(e,t,r,o,i,a){let p=ee(e,r,i);return Ie(p)?dE(p.inferred,t,o,a):j()}function nL(e,t,r,o,i){let a=rc(o);return Si(a)?lE(e,a.name,oc(r,t),a.type):(()=>{let[p,...u]=r;return A(p)?rL(e,t,p,u,o,i):j()})()}function oL(e,t,r,o){let[i,...a]=o;return A(i)?nL(e,t,r,i,a):s.IsEqual(r.length,0)?S(e):j()}function dE(e,t,r,o){return oL(e,t,r,o)}function iL(e,t,r){let o=is(e,{callstack:[]},r),i=tL(o);return dE(e,i,oc(t,i),oc(o,i))}function fE(e,t,r){let o=ns(r);return Si(o)?os(e,o.name,t,o.type):(()=>{let[i,...a]=t;return A(i)?(()=>{let p=ee(e,i,r);return Ie(p)?fE(p.inferred,a,r):j()})():S(e)})()}function gE(e,t,r){let o=is(e,{callstack:[]},t);return K(r)?iL(e,o,r.items):J(r)?fE(e,o,r.items):B(e,$e(o),r)}function yE(e,t,r){return ft(r)?S(e):zt(r)?S(e):B(e,t,r)}function EE(e,t,r){let[o,...i]=r;return A(o)?(()=>{let a=ee(e,t,o);return Ie(a)?S(a.inferred):EE(e,t,i)})():j()}function ic(e,t,r){let[o,...i]=t;return A(o)?(()=>{let a=EE(e,o,r);return Ie(a)?ic(a.inferred,i,r):j()})():S(e)}function IE(e,t,r){let o=ns(r);return Si(o)?os(e,o.name,t,o.type):O(r)?ic(e,t,r.anyOf):ic(e,t,[r])}function TE(e,t,r){return _e(r)?B(e,t,r):Xe(r)?S(e):st(r)?S(e):j()}function _E(e,t,r){return ft(r)?S(e):B(e,t,r)}function ee(e,t,r){return Xe(t)?Dy(e,t,r):J(t)?Gy(e,t,t.items,r):Ye(t)?vy(e,t.iteratorItems,r):lt(t)?jy(e,t,r):et(t)?Fy(e,t,r):Ue(t)?By(e,t.parameters,t.instanceType,r):he(t)?qy(e,t,r):Ne(t)?Hy(e,t.parameters,t.returnType,r):Me(t)?Ky(e,t,r):U(t)?tE(e,t.allOf,r):Qe(t)?rE(e,t.iteratorItems,r):W(t)?nE(e,t,r):or(t)?oE(e,t,r):Bt(t)?iE(e,t,r):ge(t)?aE(e,t,r):w(t)?sE(e,t.properties,r):qe(t)?pE(e,t.item,r):xe(t)?cE(e,t,r):qt(t)?mE(e,t,r):Oe(t)?uE(e,t.pattern,r):K(t)?gE(e,t.items,r):zt(t)?yE(e,t,r):O(t)?IE(e,t.anyOf,r):st(t)?TE(e,t,r):ft(t)?_E(e,t,r):j()}function eo(e,t,r={}){return C("Interface",[e,t],r)}function so(e){return A(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function hE(e,t,r={}){return R({},eo(e,t,r))}function aL(e,t,r){return e.includes(r)?!0:Mr([...e,r],t,t[r])}function OE(e,t,r){let o=va(r);return un(e,t,o)}function un(e,t,r){let[o,...i]=r;return A(o)?Mr(e,t,o)?!0:un(e,t,i):!1}function Mr(e,t,r){return se(r)?aL(e,t,r.$ref):J(r)?Mr(e,t,r.items):Ye(r)?Mr(e,t,r.iteratorItems):Ue(r)?un(e,t,[...r.parameters,r.instanceType]):Ne(r)?un(e,t,[...r.parameters,r.returnType]):so(r)?OE(e,t,r.parameters[1]):U(r)?un(e,t,r.allOf):Qe(r)?Mr(e,t,r.iteratorItems):w(r)?OE(e,t,r.properties):qe(r)?Mr(e,t,r.item):O(r)?un(e,t,r.anyOf):K(r)?un(e,t,r.items):ye(r)?Mr(e,t,He(r)):!1}function as(e,t,r){return Mr(e,t,r)}function sL(e,t){return t.reduce((r,o)=>o in e?as([o],e,e[o])?[...r,o]:r:F(),[])}function AE(e){let t=_d(e);return sL(e,t)}function pL(e,t,r){return r.includes(t)?r:t in e?$r(e,e[t],[...r,t]):F()}function SE(e,t,r){let o=va(t);return po(e,o,r)}function po(e,t,r){return t.reduce((o,i)=>$r(e,i,o),r)}function $r(e,t,r){return se(t)?pL(e,t.$ref,r):J(t)?$r(e,t.items,r):Ye(t)?$r(e,t.iteratorItems,r):Ue(t)?po(e,[...t.parameters,t.instanceType],r):Ne(t)?po(e,[...t.parameters,t.returnType],r):so(t)?SE(e,t.parameters[1],r):U(t)?po(e,t.allOf,r):Qe(t)?$r(e,t.iteratorItems,r):w(t)?SE(e,t.properties,r):qe(t)?$r(e,t.item,r):O(t)?po(e,t.anyOf,r):K(t)?po(e,t.items,r):ye(t)?$r(e,He(t),r):r}function bE(e,t,r){return $r(e,r,[t])}function cL(e){return Hn()}function mL(e){return s.Keys(e).reduce((t,r)=>({...t,[r]:Yt(e[r])}),{})}function bi(e){return e.reduce((t,r)=>[...t,Yt(r)],[])}function Yt(e){return se(e)?cL(e.$ref):J(e)?Lt(Yt(e.items),Na(e)):Ye(e)?vt(Yt(e.iteratorItems)):Ue(e)?br(bi(e.parameters),Yt(e.instanceType)):Ne(e)?xr(bi(e.parameters),Yt(e.returnType)):U(e)?ht(bi(e.allOf)):Qe(e)?Ft(Yt(e.iteratorItems)):w(e)?N(mL(e.properties)):qe(e)?Ht(Yt(e.item)):ye(e)?Fa(Zn(e),Yt(He(e))):O(e)?G(bi(e.anyOf)):K(e)?$e(bi(e.items)):e}function uL(e,t){return t in e?Yt(e[t]):Fe()}function xE(e){return uL(e.$defs,e.$ref)}function lL(e,t,r){let o=gt(e,{callstack:[]},t),i=xi({},{callstack:[]},r);return Ae([...o,N(i)])}function dL(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let a=e[i],p=so(a)?lL(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:p}},{})}function RE(e,t,r){let o=bE(e,t,r),i=dL(e,o);return jt(i,t)}function CE(e,t){return t in e?se(e[t])?CE(e,e[t].$ref):e[t]:Y()}function Qt(e,t){return CE(e,t)}function PE(e){return pe(e)?xE(e):e}function ze(e,t,r){let o=PE(t),i=PE(r);return ee(e,o,i)}function fL(e,t,r){if(_e(t)||co(t)||L.IsExtendsTrueLike(ze({},t,r)))return;let o={parameter:e,extends:r,received:t};throw new Error("Generic argument does not satify constraint",{cause:o})}function UE(e,t,r,o,i){let a=_(e,t,i);return fL(r,a,o),g.Assign(e,{[r]:a})}function gL(e,t,r,o,i){let a=_(e,t,r.extends),p=_(e,t,r.equals),[u,...l]=i;return A(u)?ac(UE(e,t,r.name,a,u),t,o,l):ac(UE(e,t,r.name,a,p),t,o,[])}function ac(e,t,r,o){let[i,...a]=r;return A(i)?gL(e,t,i,a,o):e}function NE(e,t,r,o){return ac(e,t,r,o)}function yL(e){return s.IsGreaterThan(e.length,0)?e[0]:""}function LE(e,t,r,o){let i=gt(e,t,o);return Ha(r,i)}function EL(e,t,r,o){return LE(e,t,be(r),o)}function IL(e,t,r,o,i,a){let p=gt(e,t,a),u=NE(e,t,o,p),l=_(u,{callstack:[...t.callstack,r]},i);return _(e,t,l)}function ss(e,t,r,o){let[i,a]=Wl(e,r,o);return qn(a)?s.IsEqual(yL(t.callstack),i)?EL(e,t,i,o):IL(e,t,i,a.parameters,a.expression,o):LE(e,t,r,o)}function Ha(e,t){return g.Create({"~kind":"Call"},{target:e,arguments:t},{})}function kE(e,t){return ss({},{callstack:[]},e,t)}function co(e){return h(e,"Call")}function wE(e){return qe(e)?wE(e.item):e}function TL(e,t,r,o){let i=_(e,t,r);return g.Update(wE(i),{},o)}function ME(e,t,r,o){return k(e,[r])?TL(e,t,r,o):yi(r,o)}function $E(e,t){return e(t)}function DE(e,t){return s.IsString(t)?H($E(e,t)):H(t)}function GE(e,t){let r=Ke(t);return sr(e,r)}function vE(e,t){let r=t.map(o=>sr(e,o));return G(r)}function sr(e,t){return W(t)?DE(e,t.const):Oe(t)?GE(e,t.pattern):O(t)?vE(e,t.anyOf):t}function Jo(e,t={}){return C("Capitalize",[e],t)}function jE(e,t={}){return R({},Jo(e,t))}function ei(e,t={}){return C("Lowercase",[e],t)}function FE(e,t={}){return R({},ei(e,t))}function ti(e,t={}){return C("Uncapitalize",[e],t)}function BE(e,t={}){return R({},ti(e,t))}function ri(e,t={}){return C("Uppercase",[e],t)}function qE(e,t={}){return R({},ri(e,t))}var _L=e=>e[0].toUpperCase()+e.slice(1),hL=e=>e.toLowerCase(),OL=e=>e[0].toLowerCase()+e.slice(1),AL=e=>e.toUpperCase();function SL(e,t,r,o){let i=_(e,t,r);return g.Update(sr(_L,i),{},o)}function HE(e,t,r,o){return k(e,[r])?SL(e,t,r,o):Jo(r,o)}function bL(e,t,r,o){let i=_(e,t,r);return g.Update(sr(hL,i),{},o)}function KE(e,t,r,o){return k(e,[r])?bL(e,t,r,o):ei(r,o)}function xL(e,t,r,o){let i=_(e,t,r);return g.Update(sr(OL,i),{},o)}function zE(e,t,r,o){return k(e,[r])?xL(e,t,r,o):ti(r,o)}function RL(e,t,r,o){let i=_(e,t,r);return g.Update(sr(AL,i),{},o)}function VE(e,t,r,o){return k(e,[r])?RL(e,t,r,o):ri(r,o)}function ni(e,t,r,o,i={}){return C("Conditional",[e,t,r,o],i)}function YE(e,t,r,o,i={}){return R({},ni(e,t,r,o,i))}function CL(e,t,r,o,i,a,p){let u=_(e,t,r),l=_(e,t,o),f=ze(e,u,l);return g.Update(L.IsExtendsUnion(f)?G([_(f.inferred,t,i),_(e,t,a)]):L.IsExtendsTrue(f)?_(f.inferred,t,i):_(e,t,a),{},p)}function QE(e,t,r,o,i,a,p){return k(e,[r,o])?CL(e,t,r,o,i,a,p):ni(r,o,i,a,p)}function oi(e,t={}){return C("ConstructorParameters",[e],t)}function WE(e,t={}){return R({},oi(e,t))}function PL(e){return Ue(e)?_({},{callstack:[]},$e(e.parameters)):Y()}function UL(e,t,r,o){let i=_(e,t,r);return g.Update(PL(i),{},o)}function ZE(e,t,r,o){return k(e,[r])?UL(e,t,r,o):oi(r,o)}function ii(e,t,r={}){return C("Exclude",[e,t],r)}function XE(e,t,r={}){return R({},ii(e,t,r))}function JE(e,t){return e.reduce((r,o)=>[...r,...eI(o,t)],[])}function eI(e,t){let r=ze({},e,t);return L.IsExtendsTrueLike(r)?[]:[e]}function NL(e,t){let r=he(e)?JE(kt(e.enum),t):O(e)?JE(Vt(e.anyOf),t):eI(e,t);return ar(r)}function LL(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(NL(a,p),{},i)}function ps(e,t,r,o,i){return k(e,[r,o])?LL(e,t,r,o,i):ii(r,o,i)}function ai(e,t,r={}){return C("Extract",[e,t],r)}function tI(e,t,r={}){return R({},ai(e,t,r))}function rI(e,t){return e.reduce((r,o)=>[...r,...nI(o,t)],[])}function nI(e,t){let r=ze({},e,t);return L.IsExtendsTrueLike(r)?[e]:[]}function kL(e,t){let r=he(e)?rI(kt(e.enum),t):O(e)?rI(Vt(e.anyOf),t):nI(e,t);return ar(r)}function wL(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(kL(a,p),{},i)}function oI(e,t,r,o,i){return k(e,[r,o])?wL(e,t,r,o,i):ai(r,o,i)}var ML=new RegExp("^(?:0|[1-9][0-9]*)$");function mo(e){let t=`${e}`;return ML.test(t)?parseInt(t):e}function $L(e){return H(mo(e))}function iI(e){return e.map(t=>aI(t))}function aI(e){return U(e)?ht(iI(e.allOf)):O(e)?G(iI(e.anyOf)):W(e)?$L(e.const):e}function sI(e,t){let r=aI(t),o=ze({},r,Ot());return L.IsExtendsTrueLike(o)?e:Y()}function pI(e,t){let r=Qt(e,t);return Wt(r)}function cs(e){return e.reduce((t,r)=>[...t,...Wt(r)],[])}function cI(e){let t=kt(e);return cs(t)}function mI(e){let t=Ae(e);return Wt(t)}function uI(e){return[`${e}`]}function lI(e){let t=Ke(e);return Wt(t)}function Wt(e){return pe(e)?pI(e.$defs,e.$ref):he(e)?cI(e.enum):U(e)?mI(e.allOf):W(e)?uI(e.const):Oe(e)?lI(e.pattern):O(e)?cs(e.anyOf):[]}function uo(e){return Wt(e)}function DL(e,t){return t in e?[e[t]]:[]}function GL(e,t){return t.reduce((r,o)=>[...r,...DL(e,o)],[])}function dI(e,t){let r=uo(t),o=GL(e,r);return ar(o)}function vL(e){return H(mo(e))}function fI(e){return e.map(t=>sc(t))}function sc(e){return U(e)?ht(fI(e.allOf)):O(e)?G(fI(e.anyOf)):W(e)?vL(e.const):e}function jL(e,t){return e.reduceRight((r,o,i)=>{let a=ze({},H(i),t);return L.IsExtendsTrueLike(a)?[o,...r]:r},[])}function FL(e,t){let r=sc(t),o=jL(e,r);return mn(o)}function BL(e){return mn(e)}function gI(e,t){return ge(t)||Me(t)?BL(e):FL(e,t)}function qL(e){return e.reduce((t,r)=>Da(r)?[...t,H(r)]:t,[])}function lo(e){let t=qL(e);return G(t)}function to(e,t,r={}){return C("Index",[e,t],r)}function yI(e,t,r={}){let o=s.IsArray(t)?lo(t):t;return R({},to(e,o,r))}function EI(e,t){let r=Qt(e,t);return wt(r)}function HL(e,t){let r=s.Keys(e).filter(y=>!s.HasPropertyKey(t,y)),o=s.Keys(t).filter(y=>!s.HasPropertyKey(e,y)),i=s.Keys(e).filter(y=>s.HasPropertyKey(t,y)),a=r.reduce((y,I)=>({...y,[I]:e[I]}),{}),p=o.reduce((y,I)=>({...y,[I]:t[I]}),{}),u=i.reduce((y,I)=>({...y,[I]:Ae([e[I],t[I]])}),{}),l=g.Assign(a,p);return g.Assign(l,u)}function II(e){return e.reduce((t,r)=>HL(t,wt(r)),{})}function TI(e){let t=zy($e(e));return wt(t)}function KL(e,t){return s.Keys(e).filter(i=>i in t).reduce((i,a)=>({...i,[a]:ar([e[a],t[a]])}),{})}function _I(e,t){let[r,...o]=e;return A(r)?_I(o,KL(t,wt(r))):t}function hI(e){let[t,...r]=e;return A(t)?_I(r,wt(t)):F()}function wt(e){return pe(e)?EI(e.$defs,e.$ref):U(e)?II(e.allOf):O(e)?hI(e.anyOf):K(e)?TI(e.items):w(e)?e.properties:{}}function fo(e){let t=wt(e);return N(t)}function zL(e){return pe(e)||U(e)||O(e)?fo(e):e}function VL(e,t){let r=zL(e);return J(r)?sI(r.items,t):w(r)?dI(r.properties,t):K(r)?gI(r.items,t):Y()}function YL(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(VL(a,p),{},i)}function OI(e,t,r,o,i){return k(e,[r,o])?YL(e,t,r,o,i):to(r,o,i)}function si(e,t={}){return C("InstanceType",[e],t)}function AI(e,t={}){return R({},si(e,t))}function QL(e){return Ue(e)?e.instanceType:Y()}function WL(e,t,r,o){let i=_(e,t,r);return g.Update(QL(i),{},o)}function SI(e,t,r,o={}){return k(e,[r])?WL(e,t,r,o):si(r,o)}function ZL(e,t,r,o,i){let a=gt(e,{callstack:[]},r),p=xi(e,{callstack:[]},o),u=Ae([...a,N(p)]);return g.Update(u,{},i)}function bI(e,t,r,o,i){return k(e,r)?ZL(e,t,r,o,i):eo(r,o,i)}function ro(e,t={}){return C("KeyOf",[e],t)}function xI(e,t={}){return R({},ro(e,t))}function RI(){return G([Ot(),pt(),Yn()])}function CI(e){return Ot()}function XL(e){return e.reduce((r,o)=>Da(o)?[...r,H(mo(o))]:F(),[])}function PI(e){let t=s.Keys(e),r=XL(t);return mn(r)}function UI(e){return Zn(e)}function NI(e){let t=e.map((r,o)=>H(o));return mn(t)}function JL(e){return pe(e)||U(e)||O(e)?fo(e):e}function ek(e){let t=JL(e);return Xe(t)?RI():J(t)?CI(t.items):w(t)?PI(t.properties):ye(t)?UI(t):K(t)?NI(t.items):Y()}function tk(e,t,r,o){let i=_(e,t,r);return g.Update(ek(i),{},o)}function LI(e,t,r,o){return k(e,[r])?tk(e,t,r,o):ro(r,o)}function rk(e){let t=Ke(e);return pc(t)}function kI(e){return e.reduce((t,r)=>[...t,...pc(r)],[])}function pc(e){return he(e)?kI(kt(e.enum)):Vn(e)||zn(e)?[e]:Oe(e)?rk(e.pattern):O(e)?kI(e.anyOf):[]}function wI(e){return pc(e)}function Jn(e,t,r,o,i={}){return C("Mapped",[e,t,r,o],i)}function MI(e,t,r,o,i={}){return R({},Jn(e,t,r,o,i))}function nk(e,t,r,o,i){let a=g.Assign(e,{[r.name]:o}),p=_(a,t,i);return Oe(p)?Ke(p.pattern):p}function ok(e,t,r,o,i){let a=g.Assign(e,{[r.name]:o});return _(a,t,i)}function ik(e,t,r,o,i,a){let p=ok(e,t,r,o,a),u=nk(e,t,r,o,i);return Vn(u)||zn(u)?{[u.const]:p}:{}}function ak(e,t,r,o,i,a){return o.reduce((p,u)=>({...p,...ik(e,t,r,u,i,a)}),{})}function sk(e,t,r,o,i,a){let p=wI(o),u=ak(e,t,r,p,i,a);return N(u)}function pk(e,t,r,o,i,a,p){let u=_(e,t,o);return g.Update(sk(e,t,r,u,i,a),{},p)}function $I(e,t,r,o,i,a,p){return k(e,[o])?pk(e,t,r,o,i,a,p):Jn(r,o,i,a,p)}function ck(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>({...o,[i]:RE(e,i,e[i])}),{})}function mk(e,t){return s.Keys(e).filter(o=>!t.includes(o)).reduce((o,i)=>({...o,[i]:_(e,{callstack:[]},e[i])}),{})}function uk(e,t){let r=AE(e),o=ck(e,r),i=mk(e,r),a={...o,...i};return g.Update(a,{},t)}function DI(e,t,r,o){let i=g.Assign(e,r);return uk(i,o)}function pi(e,t={}){return C("NonNullable",[e],t)}function GI(e,t={}){return R({},pi(e,t))}function lk(e){let t=G([Ur(),Xn()]);return ps({},{callstack:[]},e,t,{})}function dk(e,t,r,o){let i=_(e,t,r);return g.Update(lk(i),{},o)}function vI(e,t,r,o){return k(e,[r])?dk(e,t,r,o):pi(r,o)}function ms(e){let t=fo(e);return w(t)?t.properties:F()}function ci(e,t,r={}){return C("Omit",[e,t],r)}function jI(e,t,r={}){let o=s.IsArray(t)?lo(t):t;return R({},ci(e,o,r))}function fk(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function gk(e,t){let r=ms(e),o=uo(t),i=fk(r,o);return N(i)}function yk(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(gk(a,p),{},i)}function FI(e,t,r,o,i){return k(e,[r,o])?yk(e,t,r,o,i):ci(r,o,i)}function no(e,t){return C("Options",[e,t],{})}function us(e,t){return R({},no(e,t))}function Ek(e,t,r,o){let i=_(e,t,r);return g.Update(i,{},o)}function BI(e,t,r,o){return k(e,[r])?Ek(e,t,r,o):no(r,o)}function mi(e,t={}){return C("Parameters",[e],t)}function qI(e,t={}){return R({},mi(e,t))}function Ik(e){return Ne(e)?_({},{callstack:[]},$e(e.parameters)):Y()}function Tk(e,t,r,o){let i=_(e,t,r);return g.Update(Ik(i),{},o)}function HI(e,t,r,o){return k(e,[r])?Tk(e,t,r,o):mi(r,o)}function ui(e,t={}){return C("Partial",[e],t)}function KI(e,t={}){return R({},ui(e,t))}function zI(e,t){let r=Qt(e,t),o=Dr(r);return jt(g.Assign(e,{[t]:o}),t)}function VI(e){let t=e.map(r=>Dr(r));return Ae(t)}function YI(e){let t=e.map(r=>Dr(r));return G(t)}function QI(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Ca(e[i])}),{});return N(t)}function Dr(e){return pe(e)?zI(e.$defs,e.$ref):U(e)?VI(e.allOf):O(e)?YI(e.anyOf):w(e)?QI(e.properties):N({})}function _k(e,t,r,o){let i=_(e,t,r);return g.Update(Dr(i),{},o)}function WI(e,t,r,o){return k(e,[r])?_k(e,t,r,o):ui(r,o)}function li(e,t,r={}){return C("Pick",[e,t],r)}function ZI(e,t,r={}){let o=s.IsArray(t)?lo(t):t;return R({},li(e,o,r))}function hk(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?g.Assign(o,{[i]:e[i]}):o,{})}function Ok(e,t){let r=ms(e),o=uo(t),i=hk(r,o);return N(i)}function Ak(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(Ok(a,p),{},i)}function XI(e,t,r,o,i){return k(e,[r,o])?Ak(e,t,r,o,i):li(r,o,i)}function di(e,t={}){return C("ReadonlyType",[e],t)}function JI(e,t={}){return R({},di(e,t))}function eT(e){return Sr(Lt(e))}function tT(e,t){let r=Qt(e,t),o=Gr(r);return jt(g.Assign(e,{[t]:o}),t)}function rT(e){let t=e.map(r=>Gr(r));return Ae(t)}function nT(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Ua(e[i])}),{});return N(t)}function oT(e){return Sr($e(e))}function iT(e){let t=e.map(r=>Gr(r));return G(t)}function Gr(e){return J(e)?eT(e.items):pe(e)?tT(e.$defs,e.$ref):U(e)?rT(e.allOf):w(e)?nT(e.properties):K(e)?oT(e.items):O(e)?iT(e.anyOf):e}function Sk(e,t,r,o){let i=_(e,t,r);return g.Update(Gr(i),{},o)}function aT(e,t,r,o){return k(e,[r])?Sk(e,t,r,o):di(r,o)}function sT(e){return ct(Kt,e)}function pT(e){return N({true:e,false:e})}function cT(e,t){let r=Ei(e);return vr(r,t)}function mT(e,t){return ct(Qn,t)}function uT(e,t){let r=Ae(e);return vr(r,t)}function lT(e,t){return s.IsString(e)||s.IsNumber(e)?N({[e]:t}):s.IsEqual(e,!1)?N({false:t}):s.IsEqual(e,!0)?N({true:t}):N({})}function dT(e,t){return ct(Wn,t)}function fT(e,t){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?ct(e.pattern.toString(),t):ct(Kt,t)}function gT(e,t){let r=Ja(e);return es(r)?vr(Ke(e),t):ct(e,t)}function bk(e){return e.some(t=>xe(t)||ge(t)||Me(t))}function xk(e,t){return s.IsEqual(bk(e),!0)?ct(Kt,t):void 0}function Rk(e,t){return e.reduce((r,o)=>W(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...r,[o.const]:t}:r,{})}function Ck(e,t){let r=Rk(e,t);return N(r)}function yT(e,t){let r=Vt(e),o=xk(r,t);return A(o)?o:Ck(r,t)}function vr(e,t){return Xe(e)?sT(t):et(e)?pT(t):he(e)?cT(e.enum,t):Me(e)?mT(e,t):U(e)?uT(e.allOf,t):W(e)?lT(e.const,t):ge(e)?dT(e,t):O(e)?yT(e.anyOf,t):xe(e)?fT(e,t):Oe(e)?gT(e.pattern,t):N({})}function Pk(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(vr(a,p),{},i)}function ET(e,t,r,o,i){return k(e,[r])?Pk(e,t,r,o,i):Zo(r,o,i)}function IT(e,t,r){return r in e?as([r],e,e[r])?be(r):_(e,t,e[r]):be(r)}function TT(e,t){let r=Qt(e,t),o=jr(r);return jt(g.Assign(e,{[t]:o}),t)}function _T(e){let t=e.map(r=>jr(r));return Ae(t)}function hT(e){let t=e.map(r=>jr(r));return G(t)}function OT(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Bn(e[i])}),{});return N(t)}function jr(e){return pe(e)?TT(e.$defs,e.$ref):U(e)?_T(e.allOf):O(e)?hT(e.anyOf):w(e)?OT(e.properties):N({})}function fi(e,t={}){return C("Required",[e],t)}function AT(e,t={}){return R({},fi(e,t))}function Uk(e,t,r,o){let i=_(e,t,r);return g.Update(jr(i),{},o)}function ST(e,t,r,o){return k(e,[r])?Uk(e,t,r,o):fi(r,o)}function gi(e,t={}){return C("ReturnType",[e],t)}function bT(e,t={}){return R({},gi(e,t))}function Nk(e){return Ne(e)?e.returnType:Y()}function Lk(e,t,r,o){let i=_(e,t,r);return g.Update(Nk(i),{},o)}function xT(e,t,r,o){return k(e,[r])?Lk(e,t,r,o):gi(r,o)}function RT(e){return g.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function kk(e){return e.join("|")}function wk(e){return e.slice(1,e.length-1)}function Mk(e,t,r){return Fr(t,`${r}${e}`)}function $k(e,t){return Fr(e,`${t}${fd}`)}function Dk(e,t){return Fr(e,`${t}${$a}`)}function Gk(e,t){return Fr(e,`${t}${Ga}`)}function vk(e,t){return mc(G([H("false"),H("true")]),e,t)}function jk(e,t){return Fr(e,`${t}${ja}`)}function Fk(e,t,r){return Fr(t,`${r}${wk(e)}`)}function Bk(e,t,r,o=[]){let i=kt(e);return cc(i,t,r)}function cc(e,t,r,o=[]){let[i,...a]=e;return A(i)?cc(a,t,r,[...o,mc(i,[],"")]):Fr(t,`${r}(${kk(o)})`)}function mc(e,t,r){return he(e)?Bk(e.enum,t,r):Me(e)?Dk(t,r):W(e)?Mk(e.const,t,r):lt(e)?$k(t,r):et(e)?vk(t,r):ge(e)?Gk(t,r):xe(e)?jk(t,r):Oe(e)?Fk(e.pattern,t,r):O(e)?cc(e.anyOf,t,r):Yl}function Fr(e,t){let[r,...o]=e;return A(r)?mc(r,o,t):t}function qk(e){return`^${Fr(e,"")}$`}function CT(e){let t=qk(e);return RT(t)}function Hk(e,t,r,o){let i=gt(e,t,r);return g.Update(CT(i),{},o)}function PT(e,t,r,o){return k(e,r)?Hk(e,t,r,o):Xo(r,o)}function Kk(e){return Nr(e)?K(e.items)?uc(e.items.items):_e(e.items)?[e]:se(e.items)?[e]:[Y()]:[e]}function uc(e){return e.reduce((r,o)=>[...r,...Kk(o)],[])}function zk(e,t){return t in e}function Vk(e,t){return U(t)?k(e,t.allOf):O(t)?k(e,t.anyOf):se(t)?zk(e,t.$ref):!0}function k(e,t){let[r,...o]=t;return A(r)?Vk(e,r)?k(e,o):!1:!0}function Ri(e,t,r){return Bl(e)?Ri(e.type,"remove",r):Gl(e)?Ri(e.type,t,"remove"):jl(e)?Ri(e.type,"add",r):$l(e)?Ri(e.type,t,"add"):[e,t,r]}function Yk(e,t){return s.IsEqual(e,"remove")?Pa(t):s.IsEqual(e,"add")?at(t):t}function Qk(e,t){return s.IsEqual(e,"remove")?Bn(t):s.IsEqual(e,"add")?it(t):t}function xi(e,t,r){return s.Keys(r).reduce((o,i)=>({...o,[i]:_(e,t,r[i])}),{})}function is(e,t,r){let o=gt(e,t,r);return uc(o)}function gt(e,t,r){return r.map(o=>_(e,t,o))}function Wk(e,t,r,o,i){return s.IsEqual(r,"Awaited")?ME(e,t,o[0],i):s.IsEqual(r,"Capitalize")?HE(e,t,o[0],i):s.IsEqual(r,"Conditional")?QE(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(r,"ConstructorParameters")?ZE(e,t,o[0],i):s.IsEqual(r,"Evaluate")?eE(e,t,o[0],i):s.IsEqual(r,"Exclude")?ps(e,t,o[0],o[1],i):s.IsEqual(r,"Extract")?oI(e,t,o[0],o[1],i):s.IsEqual(r,"Index")?OI(e,t,o[0],o[1],i):s.IsEqual(r,"InstanceType")?SI(e,t,o[0],i):s.IsEqual(r,"Interface")?bI(e,t,o[0],o[1],i):s.IsEqual(r,"KeyOf")?LI(e,t,o[0],i):s.IsEqual(r,"Lowercase")?KE(e,t,o[0],i):s.IsEqual(r,"Mapped")?$I(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(r,"Module")?DI(e,t,o[0],i):s.IsEqual(r,"NonNullable")?vI(e,t,o[0],i):s.IsEqual(r,"Pick")?XI(e,t,o[0],o[1],i):s.IsEqual(r,"Options")?BI(e,t,o[0],o[1]):s.IsEqual(r,"Parameters")?HI(e,t,o[0],i):s.IsEqual(r,"Partial")?WI(e,t,o[0],i):s.IsEqual(r,"Omit")?FI(e,t,o[0],o[1],i):s.IsEqual(r,"ReadonlyType")?aT(e,t,o[0],i):s.IsEqual(r,"Record")?ET(e,t,o[0],o[1],i):s.IsEqual(r,"Required")?ST(e,t,o[0],i):s.IsEqual(r,"ReturnType")?xT(e,t,o[0],i):s.IsEqual(r,"TemplateLiteral")?PT(e,t,o[0],i):s.IsEqual(r,"Uncapitalize")?zE(e,t,o[0],i):s.IsEqual(r,"Uppercase")?VE(e,t,o[0],i):C(r,o,i)}function _(e,t,r){let o=tn(r),i=Ri(r,rn(r)?"add":"none",Pe(r)?"add":"none"),a=_t(i[0])?i[0].Clone():i[0],p=se(a)?IT(e,t,a.$ref):J(a)?Lt(_(e,t,a.items),Na(a)):Ye(a)?vt(_(e,t,a.iteratorItems),Hl(a)):co(a)?ss(e,t,a.target,a.arguments):Ue(a)?br(gt(e,t,a.parameters),_(e,t,a.instanceType),zl(a)):ql(a)?Wk(e,t,a.action,a.parameters,a.options):Ne(a)?xr(gt(e,t,a.parameters),_(e,t,a.returnType),Vl(a)):U(a)?ht(gt(e,t,a.allOf),ed(a)):Qe(a)?Ft(_(e,t,a.iteratorItems),yd(a)):w(a)?N(xi(e,t,a.properties),hd(a)):qe(a)?Ht(_(e,t,a.item),Ad(a)):ye(a)?Sd(dt(a),_(e,t,He(a))):Nr(a)?sn(_(e,t,a.items)):K(a)?$e(is(e,t,a.items),xd(a)):O(a)?G(gt(e,t,a.anyOf),Rd(a)):a,u=o?Sr(p):p;return Yk(i[1],Qk(i[2],u))}function R(e,t){return _(e,{callstack:[]},t)}function yi(e,t={}){return C("Awaited",[e],t)}function UT(e,t={}){return R({},yi(e,t))}function Dp(e,t={}){return C("Evaluate",[e],t)}function Mt(e,t={}){return R({},Dp(e,t))}function Gp(e,t={}){return C("Module",[e],t)}function NT(e,t={}){return R({},Gp(e,t))}function LT(...e){let[t,r,o]=ne.Match(e,{2:(p,u)=>s.IsString(p)?[{},p,u]:[p,u,{}],3:(p,u,l)=>[p,u,l],1:p=>[{},p,{}]}),i=Ay(r),a=s.IsArray(i)&&s.IsEqual(i.length,2)?_(t,{callstack:[]},i[0]):Y();return g.Update(a,{},o)}var n={};bt(n,{Any:()=>Hn,Array:()=>Lt,AsyncIterator:()=>vt,Awaited:()=>UT,Base:()=>La,BigInt:()=>Qo,Boolean:()=>Ma,Call:()=>kE,Capitalize:()=>jE,Codec:()=>ka,Conditional:()=>YE,Constructor:()=>br,ConstructorParameters:()=>WE,Cyclic:()=>jt,Decode:()=>ud,DecodeBuilder:()=>Yo,Encode:()=>ld,EncodeBuilder:()=>Vo,Enum:()=>Jl,Evaluate:()=>Mt,Exclude:()=>XE,Extends:()=>ze,ExtendsResult:()=>L,Extract:()=>tI,Function:()=>xr,Generic:()=>Rr,Identifier:()=>Wo,Immutable:()=>Sr,Index:()=>yI,Infer:()=>zo,InstanceType:()=>AI,Instantiate:()=>R,Integer:()=>on,Interface:()=>hE,Intersect:()=>ht,IsAny:()=>Xe,IsArray:()=>J,IsAsyncIterator:()=>Ye,IsBase:()=>_t,IsBigInt:()=>lt,IsBoolean:()=>et,IsCall:()=>co,IsCodec:()=>nn,IsConstructor:()=>Ue,IsCyclic:()=>pe,IsEnum:()=>he,IsFunction:()=>Ne,IsGeneric:()=>qn,IsIdentifier:()=>gd,IsImmutable:()=>tn,IsInfer:()=>_e,IsInteger:()=>Me,IsIntersect:()=>U,IsIterator:()=>Qe,IsKind:()=>h,IsLiteral:()=>W,IsNever:()=>or,IsNull:()=>Bt,IsNumber:()=>ge,IsObject:()=>w,IsOptional:()=>Pe,IsParameter:()=>Od,IsPromise:()=>qe,IsReadonly:()=>rn,IsRecord:()=>ye,IsRef:()=>se,IsRefine:()=>wa,IsRest:()=>Nr,IsSchema:()=>A,IsString:()=>xe,IsSymbol:()=>qt,IsTemplateLiteral:()=>Oe,IsThis:()=>bd,IsTuple:()=>K,IsUndefined:()=>zt,IsUnion:()=>O,IsUnknown:()=>st,IsUnsafe:()=>Pd,IsVoid:()=>ft,Iterator:()=>Ft,KeyOf:()=>xI,Literal:()=>H,Lowercase:()=>FE,Mapped:()=>MI,Module:()=>NT,Never:()=>Y,NonNullable:()=>GI,Null:()=>Ur,Number:()=>Ot,Object:()=>N,Omit:()=>jI,Optional:()=>Ca,Options:()=>us,Parameter:()=>an,Parameters:()=>qI,Partial:()=>KI,Pick:()=>ZI,Promise:()=>Ht,Readonly:()=>Ua,ReadonlyType:()=>JI,Record:()=>Fa,RecordKey:()=>Zn,RecordKeyAsPattern:()=>dt,RecordValue:()=>He,Ref:()=>be,Refine:()=>dd,Required:()=>AT,Rest:()=>sn,ReturnType:()=>bT,Script:()=>LT,String:()=>pt,Symbol:()=>Yn,TemplateLiteral:()=>xy,This:()=>Ba,Tuple:()=>$e,Uncapitalize:()=>BE,Undefined:()=>Xn,Union:()=>G,Unknown:()=>Fe,Unsafe:()=>Cd,Uppercase:()=>qE,Void:()=>qa});var lc=["CLUSTER_DB_QUERY_INVALID_CONNECTION_PARAMS","CLUSTER_DB_QUERY_INVALID_CREDENTIALS","CLUSTER_DB_QUERY_PERMISSION_DENIED","CLUSTER_DB_QUERY_QUERY_SYNTAX_ERROR","CLUSTER_DB_QUERY_DATABASE_UNREACHABLE","CLUSTER_DB_QUERY_CONNECTION_FAILED","CLUSTER_DB_QUERY_QUERY_EXECUTION_FAILED","CLUSTER_DB_QUERY_QUERY_TIMEOUT"],Gme=n.Enum(lc),Zk=["CLUSTER_AGGREGATION_STRUCTURE"],vme=n.Object({code:n.Enum(lc),message:n.String()}),kT=[...lc,...Zk,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","ORG_NOT_FOUND_AUTHENTICATION_ERROR","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],wT=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var Xk=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],Jk=[...kT,...wT,...Xk],jme=n.Object({code:n.Optional(n.Enum(Jk,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),Fme=n.Object({code:n.Optional(n.Enum(kT,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),Bme=n.Object({code:n.Optional(n.Enum(wT,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),qme=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),Hme=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});var MT="lowercase-email",dc="iana-timezone",fc="simple-time",gc="simple-date-time";var e0=(e,t)=>RegExp(`^${e.source}(${t.source}${e.source})*$`),t0=/[a-zA-Z0-9-_]+/,r0=/\./,zme=e0(t0,r0);var $T="lowercase-domain";var ls="kebab-case";var DT="camel-case";var n0=new Set;function b(e,t,r={}){let o=t.map(i=>{let a=i;return a.$id?(n0.add(i),n.Ref(a.$id)):i});return n.Unsafe({...r,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function pr(e,t){return n.Object({values:n.Array(e,{maxItems:t.maxItems}),exclude:n.Optional(n.Boolean({description:"If true, exclude rows matching these values instead of including them"}))},{description:t.description})}var ie={limit:n.Optional(n.Integer({minimum:1,maximum:1e3,description:"The maximum number of items to return"})),offset:n.Optional(n.Integer({minimum:0,description:"The offset of the first item to return"}))},o0=n.Object({totalCount:n.Integer({description:"The total number of items matching the query"}),pageCount:n.Integer({description:"The total number of pages available"})}),Zme=n.Object({pagination:o0},{$id:"ResponseMetadata"});function T(e={}){return n.Unsafe({...e,type:"string"})}function m({allowEmpty:e=!0,type:t="short",description:r}={}){let o=e?0:1,i=r===void 0?{}:{description:r};switch(t){case"camel-case":return n.String({format:DT,minLength:o,maxLength:250,...i});case"kebab-case":return n.String({format:ls,minLength:o,maxLength:250,...i});case"email":return n.String({format:MT,minLength:o,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...i});case"lowercase-domain":return n.String({format:$T,minLength:o,maxLength:250,...i});case"tsuga-query":return n.String({format:"tsuga-query",minLength:o,maxLength:1e4,...i});case"tags-query":return n.String({format:"tags-query",minLength:o,maxLength:1e4,errorMessage:{format:"Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported. The query you provided is invalid: ${0}"},...i});case"date-time":return n.String({format:"date-time",...i});case"uri":return n.String({format:"uri",...i});case"user-password":return n.String({format:"user-password",minLength:12,maxLength:250,...i});case"long":return n.String({minLength:o,maxLength:5e4,...i});case"short":return n.String({minLength:o,maxLength:250,...i});case"tsuga-formula":return n.String({format:"tsuga-formula",minLength:o,maxLength:250,errorMessage:{format:"Must be a simple mathematical formula, and all variables in it should refer to queries (q1, q2, etc.). The formula you provided is invalid: ${0}"},...i});case"time":return n.String({format:"time",...i});case"readonly-sql-query":return n.String({format:"readonly-sql-query",minLength:o,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...i});default:Rt(t)}}function d({body:e,description:t,method:r,operationId:o,params:i,tags:a,query:p,paginated:u,response:l,url:f}){return i?{buildUrl:I=>f.replace(/:[a-zA-Z_]+/g,x=>I[x.slice(1)]),method:r,params:i,response:l,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...p===void 0?{}:{query:p},...u===void 0?{}:{paginated:u},...a===void 0?{}:{tags:a}}:{method:r,response:l,url:f,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...p===void 0?{}:{query:p},...u===void 0?{}:{paginated:u},...a===void 0?{}:{tags:a}}}function GT(e,t){if(!t||typeof t!="object")return e;let r=new URLSearchParams;return Object.entries(t).forEach(([o,i])=>{Array.isArray(i)?i.length>0&&i.forEach(a=>{a!==void 0&&(typeof a=="string"||typeof a=="number"||typeof a=="boolean")&&r.append(o,String(a))}):(typeof i=="boolean"||typeof i=="string"||typeof i=="number")&&r.append(o,String(i))}),`${e}?${r.toString()}`}var i0="x-tsuga-session-id",yc="x-tsuga-source",Ec="x-tsuga-source-version",Ic="x-tsuga-source-commit",Tc="x-tsuga-source-date",_c="x-tsuga-rationale",a0="x-request-id",sue={[i0]:"Session identifier for request correlation",[yc]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[Ec]:"SDK version",[Ic]:"SDK commit hash",[Tc]:"SDK commit date",[_c]:"Optional caller-supplied rationale for this request, recorded for telemetry",[a0]:"Unique identifier for this API request, useful for debugging and support"};var ln=class e extends Error{constructor(r,o,i,a){super(r);this.statusCode=o;this.code=i;this.requestId=a;this.name="CliError"}static fromErrorResponse(r,o){return new e(r.message,r.statusCode,r.code,o)}};function vT(e){if(e instanceof ln){let t=[`Error: ${e.message}`];return e.code&&t.push(`Code: ${e.code}`),e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),t.join(`
34
+ `)}return e instanceof Error?`Error: ${e.message}`:String(e)}function s0(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function jT(e,t,r,o){return async function(a,p={}){let{body:u,params:l,query:f}=p,y;if(a.url!==void 0)y=a.url;else if(a.buildUrl){if(!l)throw new ln("Internal error: params required for this endpoint");y=a.buildUrl(l)}else throw new ln("Internal error: endpoint has neither url nor buildUrl");let I=r===void 0?f:{clusterId:r,...f},x=GT(`${e}${y}`,I),le={Accept:"application/json",Authorization:`Bearer ${t}`,[yc]:"cli",[Ec]:"1.0.13",[Ic]:"6bc3a6b",[Tc]:"2026-05-28T16:22:13.515Z"};u&&(le["Content-Type"]="application/json");let Se=o?.(),hr=Se?s0(Se):"";hr&&(le[_c]=hr);let Fn=await(await fetch(x,{method:a.method,headers:le,body:u?JSON.stringify(u):null})).json();if(Fn.error)throw ln.fromErrorResponse(Fn.error,Fn.requestId);return Fn.data}}var v=n.Object({success:n.Literal(!0,{description:"Indicates the resource was deleted successfully"})},{$id:"DeleteResponse",example:{success:!0}});var p0=["asset-change","cluster-integration-config","explorer-saved-view","crawler-integration-config","inventory","saml-config","sensitive-data-scanner-rule","service","team-remap-config","user-self","monitor-alert","monitor-debugging","retention-policy","org","allowed-domains","custom-usage-tag"],c0=["ingestion-api-key","operation-api-key","audit-log","dashboard","dashboard-report","inventory-settings","log-route","monitor","notification-integration","notification-rule","notification-silence","quality-report","slo","tag-policy","team","team-members","user-data","user-invitation","user-permissions"],m0=["log","metric","trace"],u0=[...c0,...m0],_ue=[...p0,...u0];var fs=["admin","public_editor","public_viewer","teams_only"],go=["admin","editor","viewer"];var dn="/v0/team-membership",hc=n.Object({id:n.String(),userId:n.String(),teamId:n.String(),roleKey:n.Enum(go)}),FT=n.Object({userId:m({allowEmpty:!1}),teamId:m({allowEmpty:!1}),roleKey:n.Enum(go)}),l0=n.Object({userId:m({allowEmpty:!1}),teamId:m({allowEmpty:!1})}),d0=n.Optional(n.Object({userId:n.Optional(m({allowEmpty:!1})),teamId:n.Optional(m({allowEmpty:!1}))})),hue=d({tags:["access-control"],url:dn,method:"GET",query:d0,response:n.Array(hc)}),Oue=d({tags:["access-control"],url:dn,method:"POST",body:FT,response:hc}),Aue=d({tags:["access-control"],url:dn,method:"PUT",body:FT,response:hc}),Sue=d({tags:["access-control"],url:dn,method:"DELETE",body:l0,response:v}),ds=500,f0=n.Object({teamId:m({allowEmpty:!1}),members:n.Array(n.Object({userId:n.Optional(m({allowEmpty:!1})),userEmail:n.Optional(m({allowEmpty:!1,type:"email"})),roleKey:n.Enum(go)},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:ds})}),g0=n.Object({results:n.Array(n.Object({userId:n.String(),status:n.Enum(["added","already_member","user_not_found"])}))}),bue=d({tags:["access-control"],url:`${dn}/bulk-add`,method:"POST",body:f0,response:g0}),xue=d({tags:["access-control"],url:`${dn}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:ds}),teamId:m({allowEmpty:!1}),role:n.Enum(go)}),response:n.Object({})}),y0=n.Object({teamId:m({allowEmpty:!1}),userIds:n.Optional(n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:ds})),userEmails:n.Optional(n.Array(m({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:ds}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}]}),E0=n.Object({results:n.Array(n.Object({userId:n.String(),status:n.Enum(["removed","not_member","user_not_found"])}))}),Rue=d({tags:["access-control"],url:`${dn}/bulk-remove`,method:"DELETE",body:y0,response:E0});var gs="/v0/admin",De=`${gs}/clusters`,qT=n.Object({helmParameters:n.Record(n.String(),n.String()),helmVersion:n.String()}),BT=n.Record(n.String(),qT),Sc=["eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3","us-east-1","us-east-2","us-west-1","us-west-2","af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-1","ap-southeast-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ap-southeast-7","ca-central-1","ca-west-1","il-central-1","me-central-1","me-south-1","mx-central-1","sa-east-1"],bc=["europe-west1","europe-west2","europe-west3","europe-west4","europe-west6","europe-west9","europe-central2","europe-north1","us-central1","us-east1","us-east4","us-west1","us-west2","us-west3","us-west4","northamerica-northeast1","southamerica-east1","asia-east1","asia-east2","asia-northeast1","asia-northeast2","asia-northeast3","asia-south1","asia-south2","asia-southeast1","asia-southeast2","australia-southeast1","australia-southeast2"],xc=["australiacentral","australiacentral2","australiaeast","australiasoutheast","austriaeast","belgiumcentral","brazilsouth","brazilsoutheast","canadacentral","canadaeast","centralindia","centralus","chilecentral","eastasia","eastus","eastus2","francecentral","francesouth","germanynorth","germanywestcentral","indonesiacentral","israelcentral","italynorth","japaneast","japanwest","jioindiacentral","jioindiawest","koreacentral","koreasouth","malaysiawest","mexicocentral","newzealandnorth","northcentralus","northeurope","norwayeast","norwaywest","polandcentral","qatarcentral","southafricanorth","southafricawest","southcentralus","southeastasia","southindia","spaincentral","swedencentral","switzerlandnorth","switzerlandwest","uaecentral","uaenorth","uksouth","ukwest","westcentralus","westeurope","westindia","westus","westus2","westus3"],HT=["aws","gcp","azure"],Ci=["xs","s","m","l"],Rc=["1.0"],I0={id:n.String(),name:n.String(),createdAt:T(),clusterCertificateExpiresAt:T(),bridgeEndpoint:n.String(),deployerEndpoint:n.String(),targetConfiguration:BT,appliedConfiguration:n.Optional(BT),automaticallyDeployLatestVersion:n.Boolean(),automatedDeploymentDisabledBy:n.Optional(n.String()),automatedDeploymentDisabledReason:n.Optional(n.String()),automatedDeploymentDisabledAt:n.Optional(T()),soakTimeMin:n.Optional(n.Number()),clusterSize:n.Optional(n.Enum(Ci))},Oc={...I0,orgId:n.String(),orgName:n.String()},wue=d({tags:["admin"],method:"GET",url:De,query:n.Object({orgId:n.Optional(m())}),response:n.Array(b("clusterType",[n.Object({...Oc,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(Rc)),clusterRegion:n.Enum(Sc)}),n.Object({...Oc,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(bc)}),n.Object({...Oc,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(xc)})]))}),Mue=d({tags:["admin"],method:"PUT",url:`${De}/create`,body:b("clusterType",[n.Object({clusterType:n.Literal("aws"),orgId:m(),name:m(),clusterSize:n.Enum(Ci),clusterAccountId:n.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:n.Enum(Rc),clusterRegion:n.Enum(Sc)}),n.Object({clusterType:n.Literal("gcp"),orgId:m(),name:m(),clusterSize:n.Enum(Ci),clusterAccountId:m(),clusterRegion:n.Enum(bc)}),n.Object({clusterType:n.Literal("azure"),orgId:m(),name:m(),clusterSize:n.Enum(Ci),clusterTenantId:m(),clusterSubscriptionId:m(),clusterRegion:n.Enum(xc)})]),response:n.Object({id:n.String(),bridgeEndpoint:n.String(),deployerEndpoint:n.String()})}),$ue=d({tags:["admin"],method:"DELETE",url:`${De}/:id`,params:n.Object({id:m()}),body:n.Object({orgId:m()}),response:v}),Due=d({tags:["admin"],method:"PUT",url:`${De}/add-inbounder-key`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),Gue=d({tags:["admin"],method:"PUT",url:`${De}/replace-all-inbounder-keys`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),vue=d({tags:["admin"],method:"PUT",url:`${De}/replace-inbounder-key`,body:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKeyToReplace:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),jue=d({tags:["admin"],method:"PUT",url:`${De}/delete-inbounder-key`,body:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKeyToDelete:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyDeleted:n.Boolean()})}),Fue=d({tags:["admin"],method:"PUT",url:`${De}/rotate-deployer-key`,body:n.Object({orgId:m(),clusterId:m(),newKey:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyUpdated:n.Boolean()})}),Bue=d({tags:["admin"],method:"PUT",url:`${De}/rotate-bridge-key`,body:n.Object({orgId:m(),clusterId:m(),newKey:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyUpdated:n.Boolean()})}),Ac={central:n.String(),ngrokBridgeDomain:n.String(),ngrokDeployerDomain:n.String(),clusterCertificateExpiresAt:T(),clusterName:n.String(),clusterSize:n.Optional(n.Enum(Ci)),secretBridgeAuthenticationKey:n.String(),secretDeployerAuthenticationKey:n.String(),secretOutbounderAuthenticationKey:n.String(),secretMonitoringApiKey:n.String(),slackChannelEmail:n.String()},que=d({tags:["admin"],method:"POST",url:`${De}/:id`,body:n.Object({orgId:m()}),params:n.Object({id:m()}),response:b("clusterType",[n.Object({...Ac,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(Rc)),clusterRegion:n.Enum(Sc)}),n.Object({...Ac,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(bc)}),n.Object({...Ac,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(xc)})])}),Hue=d({tags:["admin"],method:"POST",url:`${De}/configuration`,body:n.Object({id:m(),orgId:m(),installationName:m(),targetConfiguration:qT}),response:n.Object({status:n.String()})}),Kue=d({tags:["admin"],method:"POST",url:`${De}/automation`,body:n.Object({id:m(),orgId:m(),enableAutomatedDeployment:n.Boolean(),disabledReason:n.Optional(m())}),response:n.Object({status:n.String()})}),zue=d({tags:["admin"],method:"POST",url:`${De}/soak-time`,body:n.Object({id:m(),orgId:m(),soakTimeMin:n.Optional(n.Number())}),response:n.Object({status:n.String()})}),Vue=d({tags:["admin"],method:"POST",url:`${De}/deploy`,body:n.Object({orgId:m(),clusterId:m(),chartName:m(),toVersion:m()}),response:n.Object({id:n.String()})}),T0=b("type",[n.Object({type:n.Literal("pending")}),n.Object({type:n.Literal("running")}),n.Object({type:n.Literal("cancelled")}),n.Object({type:n.Literal("timed_out")}),n.Object({type:n.Literal("success"),stateValue:n.Object({message:n.String()})}),n.Object({type:n.Literal("failure"),stateValue:n.Object({message:n.String()})})]),Yue=d({tags:["admin"],method:"GET",url:`${De}/deploy`,query:n.Object({orgId:n.Optional(m()),clusterId:n.Optional(m())}),response:n.Array(n.Object({id:n.String(),orgId:n.String(),orgName:n.String(),clusterId:n.String(),clusterName:n.String(),fromVersion:n.Optional(n.String()),toVersion:n.String(),state:T0,updatedAt:T(),createdAt:T(),installationName:n.String(),chartName:n.String(),isAutomated:n.Boolean(),createdBy:n.Optional(n.String()),createdByName:n.Optional(n.String()),createdByEmail:n.Optional(n.String())}))}),_0=n.Object({installations:n.Array(n.Object({installationName:n.String(),parameters:n.Record(n.String(),n.String()),version:n.Union([n.String(),n.Null()]),resources:n.Array(n.Object({id:n.Object({kind:n.String(),name:n.String()}),status:n.String(),health:n.String(),rawDetails:n.Optional(n.Any()),liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())})),deployedAt:n.Optional(n.String()),syncStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String())}))}),Que=d({tags:["admin"],method:"POST",url:`${De}/status`,body:n.Object({orgId:n.Optional(m()),clusterId:n.Optional(m())}),response:n.Array(n.Object({orgId:n.String(),clusterId:n.String(),status:_0}))}),Wue=d({tags:["admin"],method:"POST",url:`${De}/argocd-cert-info`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({certificateExpiresAt:n.String()})}),h0=n.Object({kind:n.String(),name:n.String()}),O0=n.Object({id:h0,liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())}),Zue=d({tags:["admin"],method:"POST",url:`${De}/resource-details`,body:n.Object({orgId:m(),clusterId:m(),installationName:m()}),response:n.Object({resources:n.Array(O0)})}),Xue=d({tags:["admin"],method:"GET",url:`${De}/versions`,query:n.Object({chartName:n.Optional(m())}),response:n.Array(n.Object({id:n.String(),chartName:n.String(),locator:n.String(),version:n.String(),repositoryArn:n.String(),type:n.Optional(n.String()),commitHash:n.Optional(n.String()),lastPulledAt:n.Optional(T()),pushedAt:n.Optional(T())}))}),A0=n.Object({id:n.Object({name:n.String(),kind:n.String()}),previewManifest:n.Optional(n.String())}),Jue=d({tags:["admin"],method:"POST",url:`${De}/versions/render`,body:n.Object({chartName:m(),version:m(),values:m({type:"long"}),installationName:m(),namespace:m()}),response:n.Array(A0)}),cr=`${gs}/orgs`,ele=d({tags:["admin"],url:cr,method:"GET",query:n.Object({onlyDeleted:n.Optional(n.Boolean())}),response:n.Array(n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String()),createdAt:T(),updatedAt:T()}))}),tle=d({tags:["admin"],url:cr,method:"POST",body:n.Object({emailDomains:n.Array(m({type:"lowercase-domain"}),{maxItems:20}),name:m()}),response:n.Object({id:n.String(),name:n.String()})}),rle=d({tags:["admin"],url:`${cr}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Object({allowedDomains:n.Optional(n.Array(m({type:"lowercase-domain"}),{maxItems:20}))}),response:n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String())})}),nle=d({tags:["admin"],url:`${cr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),ole=d({tags:["admin"],url:`${cr}/:id/restore`,method:"POST",params:n.Object({id:m()}),response:n.Object({success:n.Boolean()})}),ile=d({tags:["admin"],url:`${cr}/:id/permanent-delete`,method:"DELETE",params:n.Object({id:m()}),response:n.Object({success:n.Boolean(),hasDeletedSecret:n.Boolean(),hasDeletedTenantDb:n.Boolean(),hasDeletedOrgRow:n.Boolean()})}),ale=d({tags:["admin"],url:`${cr}/synchronize-sds-rules`,method:"POST",response:n.Object({errorOrgs:n.Optional(n.Array(n.Object({id:n.String(),name:n.String()}))),synchronizedOrgsCount:n.Number()})}),S0=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],b0=n.Enum(S0),sle=d({tags:["admin"],url:`${cr}/refresh-assets`,method:"POST",body:n.Object({assetTypes:n.Array(b0,{minItems:1}),orgId:n.Optional(m({allowEmpty:!1}))}),response:n.Array(n.Object({orgId:n.String(),orgName:n.String(),results:n.Record(n.String(),n.Object({success:n.Boolean()}))}))}),ple=d({tags:["admin"],url:`${cr}/sudo`,method:"POST",body:n.Object({orgId:m()}),response:n.Object({sudoToken:n.String()})}),x0=`${gs}/users`,cle=d({tags:["admin"],url:`${x0}/invite`,method:"POST",body:n.Object({email:m({type:"email"}),orgId:m(),userRole:n.Enum(fs)}),response:n.Array(n.Object({inviteId:n.String(),email:n.String(),result:n.Union([n.Literal("success"),n.Literal("email-failed")])}))});var mle=d({tags:["admin"],url:`${gs}/billing-data`,method:"GET",query:n.Object({orgId:m(),maxDaysFetched:n.Optional(n.Number({minimum:1,maximum:365}))}),response:n.Object({dataPoints:n.Array(n.Object({date:n.String(),telemetryKind:n.Union([n.Literal("logs"),n.Literal("metrics"),n.Literal("traces")]),totalBytes:n.Number(),clusterId:n.String(),apiKeyId:n.String(),apiKeyName:n.String(),teamName:n.String()})),availableFilters:n.Object({clusters:n.Array(n.Object({id:n.String(),name:n.String()})),apiKeys:n.Array(n.Object({id:n.String(),name:n.String()})),teamNames:n.Array(n.String())})})});var KT=n.Object({id:n.String({description:"Unique identifier of the Tsuga cluster containing your observability data"}),name:n.String({description:"Internal name of the Tsuga cluster"}),friendlyName:n.Optional(n.String({description:"Human-readable display name set by an operator"})),clusterType:n.Enum(HT,{description:"Cloud provider hosting the Tsuga cluster"}),clusterRegion:n.String({description:"Region where the Tsuga cluster is deployed"})},{$id:"Cluster",description:"A Tsuga cluster containing your observability data"}),R0={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(KT,{examples:[R0]});var zT=d({description:"Retrieve all clusters",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:n.Array(KT)});function $t(e){process.stdout.write(`${e}
35
+ `)}function re(e){$t(JSON.stringify(e,null,2))}var VT=["json","tsv","csv"];function Cc(e){let t=VT.find(r=>r===e);if(t!==void 0)return t;throw new Error(`--output must be one of: ${VT.join(", ")} (got: ${e})`)}function Pc(e){let t=e.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(t.length===0)throw new Error("--fields must contain at least one field name");return t}function YT(e,t){let r=e;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function Uc(e,t){let r=Object.create(null);for(let o of t){let i=YT(e,o);if(i===void 0)continue;let a=o.split("."),p=a.pop();if(p===void 0)continue;let u=r;for(let l of a)(typeof u[l]!="object"||u[l]===null)&&(u[l]=Object.create(null)),u=u[l];u[p]=i}return r}function QT(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var C0={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function P0(e){let t=QT(e);return t===null?"":t.replace(/[\\\t\r\n]/g,r=>C0[r]??r)}function U0(e){let t=QT(e);return t===null?"":/[,"\n\r]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function Nc(e,t,r){if(t.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?U0:P0,a=r.map(u=>i(u)).join(o),p=t.map(u=>r.map(l=>i(YT(u,l))).join(o));return[a,...p].join(`
36
+ `)}function WT(e,t){e.command("cluster").description("Manage Tsuga cluster selection. A Tsuga cluster contains your observability data.").command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await t()(zT);re(o)})}var ZT=`/${"v1"}/docs`,XT=n.Object({path:n.String(),title:n.String(),content:n.String({description:"Raw markdown content of the documentation page"})},{$id:"DocPage",description:"A documentation page with its raw markdown content"}),N0={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
37
+ ...`};Object.assign(XT,{examples:[N0]});var JT=n.Object({path:n.String(),title:n.String(),score:n.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:n.String({description:"Short snippet of matching content"}),link:n.String({description:"URL to the documentation page in the Tsuga app"})},{$id:"DocSearchResult",description:"A documentation search result"}),L0={path:"getting-started/send-your-first-logs",title:"Send your first logs",score:.9,excerpt:"...send your first logs to Tsuga using the ingestion API...",link:"https://www.app.tsuga.com/documentation/getting-started/send-your-first-logs"};Object.assign(JT,{examples:[L0]});var e_=d({description:"Retrieve the raw markdown content of a documentation page by its path",operationId:"getDocPage",tags:["docs"],url:ZT,method:"GET",query:n.Object({path:m({allowEmpty:!1})}),response:XT}),t_=d({description:"Full-text search across documentation pages",operationId:"searchDocs",tags:["docs"],url:`${ZT}/search`,method:"GET",query:n.Object({query:m({allowEmpty:!1})}),response:n.Array(JT)});function r_(e,t){let r=e.command("docs").description("Browse and search documentation");r.command("get <path>").description("Get a documentation page by path (e.g. 'getting-started/send-your-first-logs')").action(async o=>{let i=await t()(e_,{query:{path:o}});re(i)}),r.command("search <query>").description("Search documentation pages").action(async o=>{let i=await t()(t_,{query:{query:o}});re(i)})}var o_=1456444800,i_=4927737600,k0=o_*1e3,w0=i_*1e3,ys=1704067200,Lc=ys*1e3,a_={title:"TimeRange",description:"Time range to query",examples:[{from:ys,to:ys}]},s_={title:"TimeRange",description:"Time range to query",examples:[{from:Lc,to:Lc}]},Es=e=>n.Integer({description:e,examples:[ys],minimum:o_,maximum:i_,format:"int64"}),n_=e=>n.Integer({description:e,examples:[Lc],minimum:k0,maximum:w0,format:"int64"}),yt=n.Object({from:n.Optional(Es("Start timestamp in seconds")),to:n.Optional(Es("End timestamp in seconds"))},a_),Et=n.Object({from:Es("Start timestamp in seconds"),to:Es("End timestamp in seconds")},a_),Nle=n.Object({from:n.Integer({description:"Start timestamp in milliseconds"}),to:n.Integer({description:"End timestamp in milliseconds"})},s_),p_=n.Object({from:n_("Start timestamp in milliseconds"),to:n_("End timestamp in milliseconds")},s_);var wle=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));var Hle=60*1e3;var xde=1/1e6,j0=1e3,F0=60*j0,B0=60*F0,Ts=24*B0,Rde=7*Ts,Cde=30*Ts;var wc=["past-5-minutes","past-15-minutes","past-30-minutes","past-1-hour","past-2-hours","past-4-hours","past-6-hours","past-12-hours","past-24-hours","past-2-days","past-3-days","past-7-days","past-30-days","past-3-months","current-day","current-week","current-month","current-year","previous-day","previous-week","previous-month","previous-3-months","previous-year"];var q0={s:1,m:60,h:3600,d:86400};function m_(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<48||r>57)return!1}return!0}function u_(){return Math.floor(Date.now()/1e3)}function _s(e){if(typeof e=="number")return e;if(e==="now")return u_();if(e.startsWith("-")&&e.length>=3){let r=e.at(-1),o=r?q0[r]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&m_(i))return u_()-parseInt(i,10)*o}}if(m_(e)&&e.length>0)return parseInt(e,10);let t=Date.parse(e);if(!Number.isNaN(t))return Math.floor(t/1e3);throw new Error(`Invalid time value: ${e}. Use unix seconds, relative (-30m, -1h), 'now', or ISO 8601.`)}var l_=n.Object({type:n.Literal("number"),number:n.String()}),H0=n.Object({type:n.Literal("string"),string:n.String()}),K0=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),Mc=b("type",[l_,H0,K0]),z0=n.Object({by:n.Record(n.String(),Mc),computed:n.Record(n.String(),l_)}),V0=n.Object({type:n.Literal("buckets"),buckets:n.Array(z0)}),Y0=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),d_=b("type",[V0,Y0]);var Q0="/v0/aggregation",W0=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),Z0=n.Object({parallelism:n.Number(),engine:W0,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),Dt=["logs","metrics","traces"],X0={logs:"Logs",metrics:"Metrics",traces:"Traces"},J0=[...Dt,"connections","log-patterns"],qde={...X0,connections:"Connections","log-patterns":"Log Patterns"},Hde=n.Enum(J0,{description:"Data source being queried"}),Br=n.Enum(Dt,{description:"Data source being queried for this aggregation"}),fn=n.String({description:"Attribute containing the values to aggregate"}),gn=m({description:"Attribute containing the values to aggregate"}),ew=b("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(fn)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:fn},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:fn},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:fn},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:fn},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:fn},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:fn,percentile:n.Number()},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate"}),tw=b("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(gn)},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:gn},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:gn},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:gn},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:gn},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:gn},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:gn,percentile:n.Number()},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate"}),y_=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),E_=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),I_=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),T_=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),__=n.Object({type:n.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),h_=n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),O_=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),A_=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),rw=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:n.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),nw=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:m({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),ow=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),iw=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),aw=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),sw=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),pw=b("type",[y_,E_,I_,T_,__,rw,ow,h_,O_,A_,aw],{title:"Function"}),cw=b("type",[y_,E_,I_,T_,__,nw,iw,h_,O_,A_,sw],{title:"InputFunction"});var f_=n.Object({min:n.Number(),max:n.Number()}),g_=n.Integer({minimum:1}),mw=b("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:m({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(m()),bucketCount:n.Optional(g_),bounds:n.Optional(f_),percentiles:n.Optional(n.Array(n.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:m({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(m()),bucketCount:n.Optional(g_),bounds:n.Optional(f_)},{title:"Heatmap",description:"Returns a distribution per time window"})]),$c=15,uw=["zero","null"],lw=n.Enum(uw),S_=n.Object({mode:n.Object({type:lw})}),b_={aggregate:ew,functions:n.Optional(n.Array(pw,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(S_)},x_={aggregate:tw,functions:n.Optional(n.Array(cw,{maxItems:10,description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(S_)},dw={description:"Aggregations that may be combined together in the same query"},R_={maxItems:$c,description:"Aggregations that may be combined together in the same query"},C_=n.Array(n.Object({...b_,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),dw),Pi=n.Array(n.Object({...x_,filter:n.Optional(m({type:"tsuga-query",description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),R_),yo=n.Array(n.Object({...b_,filter:n.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery"})),Eo=n.Array(n.Object({...x_,filter:m({type:"tsuga-query"})},{title:"MonitorAggregationQuery"}),R_);var P_=n.String({description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),Ui=m({type:"tsuga-formula",description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),fw=n.Object({fields:n.Array(n.String()),limit:n.Number()},{title:"AggregationGroupBy"}),gw=n.Object({fields:n.Array(m(),{maxItems:1}),limit:n.Number()},{title:"AggregationGroupBy"}),yw=7;var Dc=n.Array(fw,{description:"Fields used to group the results"}),Io=n.Array(gw,{maxItems:yw,description:"Fields used to group the results"}),Kde=d({tags:["aggregation"],url:`${Q0}/multi-query`,method:"POST",body:n.Object({timeRange:p_,queries:Pi,groupBy:n.Optional(Io),returnType:mw,dataSource:Br,formula:Ui,executionOptions:Z0,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(m({allowEmpty:!1}))}),response:d_}),Ew=["per-second","per-minute","per-hour","rate"],yn=n.Enum(Ew),zde=b("type",[n.Object({type:n.Literal("count"),count:n.Object({field:n.Optional(m()),timeNormalization:n.Optional(yn)})}),n.Object({type:n.Literal("average"),average:n.Object({field:m(),timeNormalization:n.Optional(yn)})}),n.Object({type:n.Literal("min"),min:n.Object({field:m(),timeNormalization:n.Optional(yn)})}),n.Object({type:n.Literal("max"),max:n.Object({field:m(),timeNormalization:n.Optional(yn)})}),n.Object({type:n.Literal("sum"),sum:n.Object({field:m(),timeNormalization:n.Optional(yn)})}),n.Object({type:n.Literal("percentile"),percentile:n.Object({field:m(),percentile:n.Number(),timeNormalization:n.Optional(yn)})}),n.Object({type:n.Literal("uniqueCount"),uniqueCount:n.Object({field:m(),timeNormalization:n.Optional(yn)})})]),Iw=n.Object({type:n.Literal("time"),time:n.Object({interval:m()})}),Tw=n.Object({type:n.Literal("histogram"),histogram:n.Object({field:m(),interval:n.Number(),bounds:n.Optional(n.Object({min:n.Number(),max:n.Number()}))})}),_w=n.Object({type:n.Literal("topList"),topList:n.Object({field:m(),size:n.Number(),orderBy:n.Optional(n.Object({computeRef:m(),order:n.Union([n.Literal("asc"),n.Literal("desc")])}))})}),Vde=b("type",[Iw,Tw,_w]);var U_=`/${"v1"}/aggregation`,N_=n.Object({id:n.String({description:'Query identifier (q1, q2, ...) or "formula" for formula'}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values"})}),hw={results:[{id:"q1",group:{host:"server-1"},value:123.45}]},L_=n.Object({results:n.Array(n.Object({...N_.properties,value:n.Number({description:"Aggregated value"})},{title:"ScalarResult"}),{description:"Aggregated results per query and group"})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with single values"});Object.assign(L_,{examples:[hw]});var Ow={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]},hs=n.Object({series:n.Array(n.Object({...N_.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Timestamp in milliseconds"}),value:n.Number({description:"Value"})}),{description:"Array of data points"})},{title:"Series"}),{description:"Time series data per query and group"})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with points over time"});Object.assign(hs,{examples:[Ow]});var k_={timeRange:Et,queries:n.Array(n.Omit(Pi.items,["fill"],{title:"AggregationQuery"}),{maxItems:$c,description:"Aggregations that may be combined together in the same query"}),groupBy:n.Optional(Io),dataSource:Br,formula:n.Optional(Ui),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))},Aw=n.Object(k_),w_=d({description:"Run aggregation queries and return scalar results",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${U_}/multi-query/scalar`,method:"POST",body:Aw,response:L_}),Sw=n.Object({...k_,aggregationWindow:m({description:'Time bucket size for aggregation (e.g. "10s", "1m", "1h")'})}),M_=d({description:"Run aggregation queries and return timeseries results",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${U_}/multi-query/timeseries`,method:"POST",body:Sw,response:hs});var bw=`/${"v1"}/promql`,xw=n.Object({query:m({allowEmpty:!1,description:"PromQL query string"}),timeRange:Et,step:m({allowEmpty:!1,description:'Resolution step (e.g. "15s", "1m")'}),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),$_=d({description:"Run a PromQL query and return timeseries results. Experimental: shape and behavior may change.",operationId:"queryPromql",tags:["public","promql"],url:bw,method:"POST",body:xw,response:hs});function Rw(e){return s.IsObject(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"errors")&&s.IsFunction(e.check)&&s.IsFunction(e.errors)}function Gc(e){return s.HasPropertyKey(e,"~guard")&&Rw(e["~guard"])}function vc(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>s.IsObject(t)&&s.HasPropertyKey(t,"refine")&&s.HasPropertyKey(t,"message")&&s.IsFunction(t.refine)&&s.IsString(t.message))}function mr(e){return s.IsObject(e)&&!s.IsArray(e)}function Os(e){return s.IsBoolean(e)}function D(e){return mr(e)||Os(e)}function jc(e){return s.HasPropertyKey(e,"additionalItems")&&D(e.additionalItems)}function ur(e){return s.HasPropertyKey(e,"additionalProperties")&&D(e.additionalProperties)}function Fc(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(t=>D(t))}function Ni(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function Bc(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(t=>D(t))}function qc(e){return s.HasPropertyKey(e,"const")}function En(e){return s.HasPropertyKey(e,"contains")&&D(e.contains)}function At(e){return s.HasPropertyKey(e,"default")}function Hc(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>D(t)||s.IsArray(t)&&t.every(r=>s.IsString(r)))}function Kc(e){return s.HasPropertyKey(e,"dependentRequired")&&s.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>s.IsArray(t)&&t.every(r=>s.IsString(r)))}function zc(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>D(t))}function Vc(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function Yc(e){return s.HasPropertyKey(e,"else")&&D(e.else)}function Qc(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function Wc(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function lr(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function Li(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function In(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function Zc(e){return s.HasPropertyKey(e,"if")&&D(e.if)}function To(e){return s.HasPropertyKey(e,"items")&&(D(e.items)||s.IsArray(e.items)&&e.items.every(t=>D(t)))}function Xc(e){return To(e)&&s.IsArray(e.items)}function Jc(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function em(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function As(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function tm(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function rm(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function dr(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function Tn(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function _o(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function ki(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function wi(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function nm(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function om(e){return s.HasPropertyKey(e,"not")&&D(e.not)}function im(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(t=>D(t))}function Mi(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function $i(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>D(t))}function ho(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(t=>D(t))}function Di(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(t=>D(t))}function am(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||D(e.propertyNames))}function Cw(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function Ss(e){return Cw(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function sm(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function pm(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function _n(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(t=>s.IsString(t))}function cm(e){return s.HasPropertyKey(e,"then")&&D(e.then)}function mm(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(t=>s.IsString(t)))}function Oo(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function bs(e){return s.HasPropertyKey(e,"unevaluatedItems")&&D(e.unevaluatedItems)}function xs(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&D(e.unevaluatedProperties)}var rt=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(t){return this.indices.add(t),!0}AddKey(t){return this.keys.add(t),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(t){for(let r of t)r.indices.forEach(o=>this.indices.add(o)),r.keys.forEach(o=>this.keys.add(o));return!0}},Gi=class extends rt{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}},Ge=class extends Gi{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}};var Pw="external_",Uw=0,LEe={identifier:`${Pw}${Uw}`,variables:[]};function D_(e,t,r,o){return r["~guard"].check(o)}function G_(e,t,r,o,i,a){return i["~guard"].check(a)||t.AddError({keyword:"~guard",schemaPath:r,instancePath:o,params:{errors:i["~guard"].errors(a)}})}function v_(e,t,r,o){return s.Every(r["~refine"],0,(i,a)=>i.refine(o))}function j_(e,t,r,o,i,a){return s.EveryAll(i["~refine"],0,(p,u)=>p.refine(a)||t.AddError({keyword:"~refine",schemaPath:r,instancePath:o,params:{index:u,message:p.message}}))}function F_(e){return To(e)&&s.IsArray(e.items)}function B_(e,t,r,o){return F_(r)?o.every((a,p)=>s.IsLessThan(p,r.items.length)||$(e,t,r.additionalItems,a)&&t.AddIndex(p)):!0}function q_(e,t,r,o,i,a){return F_(i)?a.every((u,l)=>{let f=`${r}/additionalItems`,y=`${o}/${l}`;return s.IsLessThan(l,i.items.length)||V(e,t,f,y,i.additionalItems,u)&&t.AddIndex(l)}):!0}function Nw(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function H_(e){let t=[];return $i(e)&&t.push(...s.Keys(e.patternProperties)),Di(e)&&t.push(...s.Keys(e.properties).map(Nw)),s.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function K_(e,t,r,o){let i=new RegExp(H_(r));return s.Every(s.Keys(o),0,(p,u)=>i.test(p)||$(e,t,r.additionalProperties,o[p])&&t.AddKey(p))}function z_(e,t,r,o,i,a){let p=new RegExp(H_(i)),u=[];return s.EveryAll(s.Keys(a),0,(f,y)=>{let I=`${r}/additionalProperties`,x=`${o}/${f}`,le=new Ge,Se=p.test(f)||V(e,le,I,x,i.additionalProperties,a[f])&&t.AddKey(f);return Se||u.push(f),Se})||t.AddError({keyword:"additionalProperties",schemaPath:r,instancePath:o,params:{additionalProperties:u}})}function V_(e,t,r,o){let i=r.allOf.reduce((a,p)=>{let u=new rt;return $(e,u,p,o)?[...a,u]:a},[]);return s.IsEqual(i.length,r.allOf.length)&&t.Merge(i)}function Y_(e,t,r,o,i,a){let p=[],u=i.allOf.reduce((f,y,I)=>{let x=`${r}/allOf/${I}`,le=new Ge,Se=V(e,le,x,o,y,a);return Se||p.push(le),Se?[...f,le]:f},[]),l=s.IsEqual(u.length,i.allOf.length)&&t.Merge(u);return l||p.forEach(f=>f.GetErrors().forEach(y=>t.AddError(y))),l}function Q_(e,t,r,o){let i=r.anyOf.reduce((a,p,u)=>{let l=new rt;return $(e,l,p,o)?[...a,l]:a},[]);return s.IsGreaterThan(i.length,0)&&t.Merge(i)}function W_(e,t,r,o,i,a){let p=[],u=i.anyOf.reduce((f,y,I)=>{let x=new Ge,le=`${r}/anyOf/${I}`,Se=V(e,x,le,o,y,a);return Se||p.push(x),Se?[...f,x]:f},[]),l=s.IsGreaterThan(u.length,0)&&t.Merge(u);return l||p.forEach(f=>f.GetErrors().forEach(y=>t.AddError(y))),l||t.AddError({keyword:"anyOf",schemaPath:r,instancePath:o,params:{}})}function lm(e,t,r,o){return r}function Z_(e,t,r,o,i,a){return lm(e,t,i,a)||t.AddError({keyword:"boolean",schemaPath:r,instancePath:o,params:{}})}function dm(e,t,r,o){return s.IsValueLike(r.const)?s.IsEqual(o,r.const):s.IsDeepEqual(o,r.const)}function X_(e,t,r,o,i,a){return dm(e,t,i,a)||t.AddError({keyword:"const",schemaPath:r,instancePath:o,params:{allowedValue:i.const}})}function Lw(e){return!(Tn(e)&&s.IsEqual(e.minContains,0))}function fm(e,t,r,o){return Lw(r)?!s.IsEqual(o.length,0)&&o.some(i=>$(e,t,r.contains,i)):!0}function J_(e,t,r,o,i,a){return fm(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:1}})}function eh(e,t,r,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(r.dependencies),0,([p,u])=>!s.HasPropertyKey(o,p)||(s.IsArray(u)?u.every(l=>s.HasPropertyKey(o,l)):$(e,t,u,o)));return i||a}function th(e,t,r,o,i,a){let p=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependencies),0,([l,f])=>{let y=`${r}/dependencies/${l}`;return!s.HasPropertyKey(a,l)||(s.IsArray(f)?f.every(I=>s.HasPropertyKey(a,I)||t.AddError({keyword:"dependencies",schemaPath:r,instancePath:o,params:{property:l,dependencies:f}})):V(e,t,y,o,f,a))});return p||u}function rh(e,t,r,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(r.dependentRequired),0,([p,u])=>!s.HasPropertyKey(o,p)||u.every(l=>s.HasPropertyKey(o,l)));return i||a}function nh(e,t,r,o,i,a){let p=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependentRequired),0,([l,f])=>!s.HasPropertyKey(a,l)||s.EveryAll(f,0,y=>s.HasPropertyKey(a,y)||t.AddError({keyword:"dependentRequired",schemaPath:r,instancePath:o,params:{property:l,dependencies:f}})));return p||u}function oh(e,t,r,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(r.dependentSchemas),0,([p,u])=>!s.HasPropertyKey(o,p)||$(e,t,u,o));return i||a}function ih(e,t,r,o,i,a){let p=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependentSchemas),0,([l,f])=>{let y=`${r}/dependentSchemas/${l}`;return!s.HasPropertyKey(a,l)||V(e,t,y,o,f,a)});return p||u}function gm(e,t,r,o){return r.enum.some(i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function ah(e,t,r,o,i,a){return gm(e,t,i,a)||t.AddError({keyword:"enum",schemaPath:r,instancePath:o,params:{allowedValues:i.enum}})}function ym(e,t,r,o){return s.IsLessThan(o,r.exclusiveMaximum)}function sh(e,t,r,o,i,a){return ym(e,t,i,a)||t.AddError({keyword:"exclusiveMaximum",schemaPath:r,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function Em(e,t,r,o){return s.IsGreaterThan(o,r.exclusiveMinimum)}function ph(e,t,r,o,i,a){return Em(e,t,i,a)||t.AddError({keyword:"exclusiveMinimum",schemaPath:r,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var So={};bt(So,{Clear:()=>mh,Entries:()=>Zw,Get:()=>eM,Has:()=>Jw,IsDate:()=>vi,IsDateTime:()=>Im,IsDuration:()=>Tm,IsEmail:()=>_m,IsHostname:()=>hm,IsIPv4:()=>bm,IsIPv6:()=>xm,IsIdnEmail:()=>Om,IsIdnHostname:()=>Sm,IsIri:()=>Cm,IsIriReference:()=>Rm,IsJsonPointer:()=>Um,IsJsonPointerUriFragment:()=>Pm,IsRegex:()=>Nm,IsRelativeJsonPointer:()=>Lm,IsTime:()=>ji,IsUri:()=>Mm,IsUriReference:()=>km,IsUriTemplate:()=>wm,IsUrl:()=>$m,IsUuid:()=>Dm,Reset:()=>uh,Set:()=>Xw,Test:()=>tM});var kw=[0,31,28,31,30,31,30,31,31,30,31,30,31],ww=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Mw(e){return e%4===0&&(e%100!==0||e%400===0)}function vi(e){let t=ww.exec(e);if(!t)return!1;let r=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&Mw(r)?29:kw[o])}var $w=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function ji(e,t=!0){let r=$w.exec(e);if(!r)return!1;let o=+r[1],i=+r[2],a=+r[3],p=r[4]==="-"?-1:1,u=+(r[5]||0),l=+(r[6]||0);if(u>23||l>59||t&&!r[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&a<60)return!0;let f=i-l*p,y=o-u*p-(f<0?1:0);return(y===23||y===-1)&&(f===59||f===-1)&&a<61}function Im(e,t=!0){let r=e.split(/T/i);return r.length===2&&vi(r[0])&&ji(r[1],t)}var Dw=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function Tm(e){return Dw.test(e)}var Gw=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[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;function _m(e){return Gw.test(e)}var vw=/^(?=.{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;function hm(e){return vw.test(e)}var jw=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function Om(e){return jw.test(e)}function Am(e){let t=e.codePointAt(0);return t===void 0?!1:t>=12352&&t<=12447||t>=12448&&t<=12543&&t!==12539||t>=19968&&t<=40959}function Sm(e){if(e.length===0||e.includes(" "))return!1;let t=/[\u002E\u3002\uFF0E\uFF61]/g,r=e.normalize("NFC").replace(t,".");if(r.length>253)return!1;let o=r.split(".");if(o.some(i=>i.length===0))return!1;for(let i of o){if(i.length>63||i.startsWith("-")||i.endsWith("-"))return!1;if(/^xn--/i.test(i)){let l=i.slice(4);if(l.length<2||l.includes("---"))return!1;continue}if(/[\u302E\u302F\u3031\u3032\u3033\u3034\u3035\u303B\u0640\u07FA]/.test(i))return!1;let a=i.charAt(0);if(/[\u0903\u0300\u0488]/.test(a))return!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);if(f==="\xB7"){if(l===0||l===i.length-1)return!1;let y=i.charAt(l-1),I=i.charAt(l+1);if(!/^[lL]$/.test(y)||!/^[lL]$/.test(I))return!1}if(f==="\u30FB"){if(i.length===1)return!1;if(l===0){let y=i.charAt(l+1);if(!Am(y))return!1}else{let y=i.charAt(l-1),I=i.charAt(l+1);if(!Am(y)||!Am(I))return!1}}if(f==="\u0375"){if(l===i.length-1)return!1;let y=i.charAt(l+1);if(!/[\u0370-\u03FF]/.test(y))return!1}if(f==="\u05F3"||f==="\u05F4"){if(l===0)return!1;let y=i.charAt(l-1);if(!/[\u05D0-\u05EA]/.test(y))return!1}if(f==="\u200D"&&(l===0||i.charAt(l-1)!=="\u094D"))return!1}let p=!1,u=!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);/[\u0660-\u0669]/.test(f)&&(p=!0),/[\u06F0-\u06F9]/.test(f)&&(u=!0)}if(p&&u)return!1}return!0}var Fw=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function bm(e){return Fw.test(e)}var Bw=/^((([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}))|:)))$/i;function xm(e){return Bw.test(e)}function ch(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function Rm(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;let t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?ch(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:ch(e)}function Cm(e){try{return new URL(e),!0}catch{return!1}}var qw=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function Pm(e){return qw.test(e)}var Hw=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function Um(e){return Hw.test(e)}function Nm(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var Kw=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Lm(e){return Kw.test(e)}var zw=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function km(e){return zw.test(e)}var Vw=/^(?:(?:[^\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;function wm(e){return Vw.test(e)}var Yw=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function Mm(e){return Yw.test(e)}var Qw=/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;function $m(e){return Qw.test(e)}var Ww=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Dm(e){return Ww.test(e)}var ue=new Map;function mh(){ue.clear()}function Zw(){return[...ue.entries()]}function Xw(e,t){ue.set(e,t)}function Jw(e){return ue.has(e)}function eM(e){return ue.get(e)}function tM(e,t){return ue.get(e)?.(t)??!0}function uh(){mh(),ue.set("date-time",Im),ue.set("date",vi),ue.set("duration",Tm),ue.set("email",_m),ue.set("hostname",hm),ue.set("idn-email",Om),ue.set("idn-hostname",Sm),ue.set("ipv4",bm),ue.set("ipv6",xm),ue.set("iri-reference",Rm),ue.set("iri",Cm),ue.set("json-pointer-uri-fragment",Pm),ue.set("json-pointer",Um),ue.set("regex",Nm),ue.set("relative-json-pointer",Lm),ue.set("time",ji),ue.set("uri-reference",km),ue.set("uri-template",wm),ue.set("uri",Mm),ue.set("url",$m),ue.set("uuid",Dm)}uh();function Gm(e,t,r,o){return So.Test(r.format,o)}function lh(e,t,r,o,i,a){return Gm(e,t,i,a)||t.AddError({keyword:"format",schemaPath:r,instancePath:o,params:{format:i.format}})}function dh(e,t,r,o){let i=cm(r)?r.then:!0,a=Yc(r)?r.else:!0;return $(e,t,r.if,o)?$(e,t,i,o):$(e,t,a,o)}function fh(e,t,r,o,i,a){let p=cm(i)?i.then:!0,u=Yc(i)?i.else:!0,l=new Ge,f=V(e,l,`${r}/if`,o,i.if,a)?V(e,l,`${r}/then`,o,p,a)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"then"}}):V(e,t,`${r}/else`,o,u,a)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"else"}});return f&&t.Merge([l]),f}function rM(e,t,r,o){return s.Every(r.items,0,(i,a)=>s.IsLessEqualThan(o.length,a)||$(e,t,i,o[a])&&t.AddIndex(a))}function nM(e,t,r,o,i,a){return s.EveryAll(i.items,0,(p,u)=>{let l=`${r}/items/${u}`,f=`${o}/${u}`;return s.IsLessEqualThan(a.length,u)||V(e,t,l,f,p,a[u])&&t.AddIndex(u)})}function oM(e,t,r,o){let i=ho(r)?r.prefixItems.length:0;return s.Every(o,i,(a,p)=>$(e,t,r.items,a)&&t.AddIndex(p))}function iM(e,t,r,o,i,a){let p=ho(i)?i.prefixItems.length:0;return s.EveryAll(a,p,(u,l)=>{let f=`${r}/items`,y=`${o}/${l}`;return V(e,t,f,y,i.items,u)&&t.AddIndex(l)})}function gh(e,t,r,o){return Xc(r)?rM(e,t,r,o):oM(e,t,r,o)}function yh(e,t,r,o,i,a){return Xc(i)?nM(e,t,r,o,i,a):iM(e,t,r,o,i,a)}function aM(e){return En(e)}function vm(e,t,r,o){if(!aM(r))return!0;let i=o.reduce((a,p)=>$(e,t,r.contains,p)?++a:a,0);return s.IsLessEqualThan(i,r.maxContains)}function Eh(e,t,r,o,i,a){let p=Tn(i)?i.minContains:1;return vm(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:p,maxContains:i.maxContains}})}function jm(e,t,r,o){return s.IsLessEqualThan(o,r.maximum)}function Ih(e,t,r,o,i,a){return jm(e,t,i,a)||t.AddError({keyword:"maximum",schemaPath:r,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function Fm(e,t,r,o){return s.IsLessEqualThan(o.length,r.maxItems)}function Th(e,t,r,o,i,a){return Fm(e,t,i,a)||t.AddError({keyword:"maxItems",schemaPath:r,instancePath:o,params:{limit:i.maxItems}})}function Bm(e,t,r,o){return s.IsMaxLength(o,r.maxLength)}function _h(e,t,r,o,i,a){return Bm(e,t,i,a)||t.AddError({keyword:"maxLength",schemaPath:r,instancePath:o,params:{limit:i.maxLength}})}function qm(e,t,r,o){return s.IsLessEqualThan(s.Keys(o).length,r.maxProperties)}function hh(e,t,r,o,i,a){return qm(e,t,i,a)||t.AddError({keyword:"maxProperties",schemaPath:r,instancePath:o,params:{limit:i.maxProperties}})}function sM(e){return En(e)}function Hm(e,t,r,o){if(!sM(r))return!0;let i=o.reduce((a,p)=>$(e,t,r.contains,p)?++a:a,0);return s.IsGreaterEqualThan(i,r.minContains)}function Oh(e,t,r,o,i,a){return Hm(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:i.minContains}})}function Km(e,t,r,o){return s.IsGreaterEqualThan(o,r.minimum)}function Ah(e,t,r,o,i,a){return Km(e,t,i,a)||t.AddError({keyword:"minimum",schemaPath:r,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function zm(e,t,r,o){return s.IsGreaterEqualThan(o.length,r.minItems)}function Sh(e,t,r,o,i,a){return zm(e,t,i,a)||t.AddError({keyword:"minItems",schemaPath:r,instancePath:o,params:{limit:i.minItems}})}function Vm(e,t,r,o){return s.IsMinLength(o,r.minLength)}function bh(e,t,r,o,i,a){return Vm(e,t,i,a)||t.AddError({keyword:"minLength",schemaPath:r,instancePath:o,params:{limit:i.minLength}})}function Ym(e,t,r,o){return s.IsGreaterEqualThan(s.Keys(o).length,r.minProperties)}function xh(e,t,r,o,i,a){return Ym(e,t,i,a)||t.AddError({keyword:"minProperties",schemaPath:r,instancePath:o,params:{limit:i.minProperties}})}function Qm(e,t,r,o){return s.IsMultipleOf(o,r.multipleOf)}function Rh(e,t,r,o,i,a){return Qm(e,t,i,a)||t.AddError({keyword:"multipleOf",schemaPath:r,instancePath:o,params:{multipleOf:i.multipleOf}})}function Wm(e,t,r,o){let i=new rt;return!$(e,i,r.not,o)&&t.Merge([i])}function Ch(e,t,r,o,i,a){return Wm(e,t,i,a)||t.AddError({keyword:"not",schemaPath:r,instancePath:o,params:{}})}function Ph(e,t,r,o){let i=r.oneOf.reduce((a,p)=>{let u=new rt;return $(e,u,p,o)?[...a,u]:a},[]);return s.IsEqual(i.length,1)&&t.Merge(i)}function Uh(e,t,r,o,i,a){let p=[],u=[],l=i.oneOf.reduce((y,I,x)=>{let le=new Ge,Se=`${r}/oneOf/${x}`,hr=V(e,le,Se,o,I,a);return hr&&u.push(x),hr||p.push(le),hr?[...y,le]:y},[]),f=s.IsEqual(l.length,1)&&t.Merge(l);return!f&&s.IsEqual(u.length,0)&&p.forEach(y=>y.GetErrors().forEach(I=>t.AddError(I))),f||t.AddError({keyword:"oneOf",schemaPath:r,instancePath:o,params:{passingSchemas:u}})}function Zm(e,t,r,o){return(s.IsString(r.pattern)?new RegExp(r.pattern):r.pattern).test(o)}function Nh(e,t,r,o,i,a){return Zm(e,t,i,a)||t.AddError({keyword:"pattern",schemaPath:r,instancePath:o,params:{pattern:i.pattern}})}function Lh(e,t,r,o){return s.Every(s.Entries(r.patternProperties),0,([i,a])=>{let p=new RegExp(i);return s.Every(s.Entries(o),0,([u,l])=>!p.test(u)||$(e,t,a,l)&&t.AddKey(u))})}function kh(e,t,r,o,i,a){return s.EveryAll(s.Entries(i.patternProperties),0,([p,u])=>{let l=`${r}/patternProperties/${p}`,f=new RegExp(p);return s.EveryAll(s.Entries(a),0,([y,I])=>{let x=`${o}/${y}`;return!f.test(y)||V(e,t,l,x,u,I)&&t.AddKey(y)})})}function wh(e,t,r,o){return s.IsEqual(o.length,0)||s.Every(r.prefixItems,0,(i,a)=>s.IsLessEqualThan(o.length,a)||$(e,t,i,o[a])&&t.AddIndex(a))}function Mh(e,t,r,o,i,a){return s.IsEqual(a.length,0)||s.EveryAll(i.prefixItems,0,(p,u)=>{let l=`${r}/prefixItems/${u}`,f=`${o}/${u}`;return s.IsLessEqualThan(a.length,u)||V(e,t,l,f,p,a[u])&&t.AddIndex(u)})}function Xm(e,t){return e.includes(t)||Tt.Get().exactOptionalPropertyTypes}function Jm(e,t){return s.IsUndefined(e[t])}function $h(e,t,r,o){let i=_n(r)?r.required:[];return s.Every(s.Entries(r.properties),0,([p,u])=>{let l=!s.HasPropertyKey(o,p)||$(e,t,u,o[p])&&t.AddKey(p);return Xm(i,p)?l:Jm(o,p)||l})}function Dh(e,t,r,o,i,a){let p=_n(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([l,f])=>{let y=`${r}/properties/${l}`,I=`${o}/${l}`,x=()=>!s.HasPropertyKey(a,l)||V(e,t,y,I,f,a[l])&&t.AddKey(l);return Xm(p,l)?x():Jm(a,l)||x()})}function Gh(e,t,r,o){return s.Every(s.Keys(o),0,(i,a)=>$(e,t,r.propertyNames,i))}function vh(e,t,r,o,i,a){let p=[];return s.EveryAll(s.Keys(a),0,(l,f)=>{let y=`${o}/${l}`,I=`${r}/propertyNames`,x=new Ge,le=V(e,x,I,y,i.propertyNames,l);return le||p.push(l),le})||t.AddError({keyword:"propertyNames",schemaPath:r,instancePath:o,params:{propertyNames:p}})}function jh(e,t,r,o){let i=e.RecursiveRef(r.$recursiveRef)??!1;return D(i)&&$(e,t,i,o)}function Fh(e,t,r,o,i,a){let p=e.RecursiveRef(i.$recursiveRef)??!1;return D(p)&&V(e,t,"#",o,p,a)}function Hh(e,t,r,o){let i=e.Ref(r.$ref)??!1,a=new rt,p=D(i)&&$(e,a,i,o);return p&&t.Merge([a]),p}function Kh(e,t,r,o,i,a){let p=e.Ref(i.$ref)??!1,u=new Ge,l=D(p)&&V(e,u,"#",o,p,a);return l&&t.Merge([u]),l||u.GetErrors().forEach(f=>t.AddError(f)),l}function zh(e,t,r,o){return s.Every(r.required,0,i=>s.HasPropertyKey(o,i))}function Vh(e,t,r,o,i,a){let p=[];return s.EveryAll(i.required,0,l=>{let f=s.HasPropertyKey(a,l);return f||p.push(l),f})||t.AddError({keyword:"required",schemaPath:r,instancePath:o,params:{requiredProperties:p}})}function eu(e,t,r,o,i){return s.IsEqual(r,"object")?s.IsObjectNotArray(i):s.IsEqual(r,"array")?s.IsArray(i):s.IsEqual(r,"boolean")?s.IsBoolean(i):s.IsEqual(r,"integer")?s.IsInteger(i):s.IsEqual(r,"number")?s.IsNumber(i):s.IsEqual(r,"null")?s.IsNull(i):s.IsEqual(r,"string")?s.IsString(i):s.IsEqual(r,"asyncIterator")?s.IsAsyncIterator(i):s.IsEqual(r,"bigint")?s.IsBigInt(i):s.IsEqual(r,"constructor")?s.IsConstructor(i):s.IsEqual(r,"function")?s.IsFunction(i):s.IsEqual(r,"iterator")?s.IsIterator(i):s.IsEqual(r,"symbol")?s.IsSymbol(i):s.IsEqual(r,"undefined")?s.IsUndefined(i):s.IsEqual(r,"void")?s.IsUndefined(i):!0}function Yh(e,t,r,o,i){return r.some(a=>eu(e,t,a,o,i))}function Qh(e,t,r,o){return s.IsArray(r.type)?Yh(e,t,r.type,r,o):eu(e,t,r.type,r,o)}function Wh(e,t,r,o,i,a){return(s.IsArray(i.type)?Yh(e,t,i.type,i,a):eu(e,t,i.type,i,a))||t.AddError({keyword:"type",schemaPath:r,instancePath:o,params:{type:i.type}})}function Zh(e,t,r,o){let i=t.GetIndices();return s.Every(o,0,(a,p)=>(i.has(p)||$(e,t,r.unevaluatedItems,a))&&t.AddIndex(p))}function Xh(e,t,r,o,i,a){let p=t.GetIndices(),u=[];return s.EveryAll(a,0,(f,y)=>{let I=new Ge,x=(p.has(y)||V(e,I,r,o,i.unevaluatedItems,f))&&t.AddIndex(y);return x||u.push(y),x})||t.AddError({keyword:"unevaluatedItems",schemaPath:r,instancePath:o,params:{unevaluatedItems:u}})}function Jh(e,t,r,o){let i=t.GetKeys();return s.Every(s.Entries(o),0,([a,p])=>i.has(a)||$(e,t,r.unevaluatedProperties,p)&&t.AddKey(a))}function eO(e,t,r,o,i,a){let p=t.GetKeys(),u=[];return s.EveryAll(s.Entries(a),0,([f,y])=>{let I=new Ge,x=p.has(f)||V(e,I,r,o,i.unevaluatedProperties,y)&&t.AddKey(f);return x||u.push(f),x})||t.AddError({keyword:"unevaluatedProperties",schemaPath:r,instancePath:o,params:{unevaluatedProperties:u}})}function tO(e){return!s.IsEqual(e.uniqueItems,!1)}function rO(e,t,r,o){if(!tO(r))return!0;let i=new Set(o.map(Pr.Hash)).size,a=o.length;return s.IsEqual(i,a)}function nO(e,t,r,o,i,a){if(!tO(i))return!0;let p=new Set,u=a.reduce((f,y,I)=>{let x=Pr.Hash(y);return p.has(x)?[...f,I]:(p.add(x),f)},[]);return s.IsEqual(u.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:r,instancePath:o,params:{duplicateItems:u}})}function $(e,t,r,o){e.Push(r);let i=Os(r)?lm(e,t,r,o):(!mm(r)||Qh(e,t,r,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!_n(r)||zh(e,t,r,o))&&(!ur(r)||K_(e,t,r,o))&&(!Hc(r)||eh(e,t,r,o))&&(!Kc(r)||rh(e,t,r,o))&&(!zc(r)||oh(e,t,r,o))&&(!$i(r)||Lh(e,t,r,o))&&(!Di(r)||$h(e,t,r,o))&&(!am(r)||Gh(e,t,r,o))&&(!wi(r)||Ym(e,t,r,o))&&(!rm(r)||qm(e,t,r,o)))&&(!s.IsArray(o)||(!jc(r)||B_(e,t,r,o))&&(!En(r)||fm(e,t,r,o))&&(!To(r)||gh(e,t,r,o))&&(!em(r)||vm(e,t,r,o))&&(!As(r)||Fm(e,t,r,o))&&(!Tn(r)||Hm(e,t,r,o))&&(!_o(r)||zm(e,t,r,o))&&(!ho(r)||wh(e,t,r,o))&&(!Oo(r)||rO(e,t,r,o)))&&(!s.IsString(o)||(!Li(r)||Gm(e,t,r,o))&&(!tm(r)||Bm(e,t,r,o))&&(!ki(r)||Vm(e,t,r,o))&&(!Mi(r)||Zm(e,t,r,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!Wc(r)||ym(e,t,r,o))&&(!lr(r)||Em(e,t,r,o))&&(!Jc(r)||jm(e,t,r,o))&&(!dr(r)||Km(e,t,r,o))&&(!nm(r)||Qm(e,t,r,o)))&&(!sm(r)||jh(e,t,r,o))&&(!pm(r)||Hh(e,t,r,o))&&(!Gc(r)||D_(e,t,r,o))&&(!qc(r)||dm(e,t,r,o))&&(!Qc(r)||gm(e,t,r,o))&&(!Zc(r)||dh(e,t,r,o))&&(!om(r)||Wm(e,t,r,o))&&(!Fc(r)||V_(e,t,r,o))&&(!Bc(r)||Q_(e,t,r,o))&&(!im(r)||Ph(e,t,r,o))&&(!bs(r)||!s.IsArray(o)||Zh(e,t,r,o))&&(!xs(r)||!s.IsObject(o)||Jh(e,t,r,o))&&(!vc(r)||v_(e,t,r,o));return e.Pop(r),i}function V(e,t,r,o,i,a){e.Push(i);let p=Os(i)?Z_(e,t,r,o,i,a):!!(+(!mm(i)||Wh(e,t,r,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!_n(i)||Vh(e,t,r,o,i,a))&+(!ur(i)||z_(e,t,r,o,i,a))&+(!Hc(i)||th(e,t,r,o,i,a))&+(!Kc(i)||nh(e,t,r,o,i,a))&+(!zc(i)||ih(e,t,r,o,i,a))&+(!$i(i)||kh(e,t,r,o,i,a))&+(!Di(i)||Dh(e,t,r,o,i,a))&+(!am(i)||vh(e,t,r,o,i,a))&+(!wi(i)||xh(e,t,r,o,i,a))&+(!rm(i)||hh(e,t,r,o,i,a))))&+(!s.IsArray(a)||!!(+(!jc(i)||q_(e,t,r,o,i,a))&+(!En(i)||J_(e,t,r,o,i,a))&+(!To(i)||yh(e,t,r,o,i,a))&+(!em(i)||Eh(e,t,r,o,i,a))&+(!As(i)||Th(e,t,r,o,i,a))&+(!Tn(i)||Oh(e,t,r,o,i,a))&+(!_o(i)||Sh(e,t,r,o,i,a))&+(!ho(i)||Mh(e,t,r,o,i,a))&+(!Oo(i)||nO(e,t,r,o,i,a))))&+(!s.IsString(a)||!!(+(!Li(i)||lh(e,t,r,o,i,a))&+(!tm(i)||_h(e,t,r,o,i,a))&+(!ki(i)||bh(e,t,r,o,i,a))&+(!Mi(i)||Nh(e,t,r,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!Wc(i)||sh(e,t,r,o,i,a))&+(!lr(i)||ph(e,t,r,o,i,a))&+(!Jc(i)||Ih(e,t,r,o,i,a))&+(!dr(i)||Ah(e,t,r,o,i,a))&+(!nm(i)||Rh(e,t,r,o,i,a))))&+(!sm(i)||Fh(e,t,r,o,i,a))&+(!pm(i)||Kh(e,t,r,o,i,a))&+(!Gc(i)||G_(e,t,r,o,i,a))&+(!qc(i)||X_(e,t,r,o,i,a))&+(!Qc(i)||ah(e,t,r,o,i,a))&+(!Zc(i)||fh(e,t,r,o,i,a))&+(!om(i)||Ch(e,t,r,o,i,a))&+(!Fc(i)||Y_(e,t,r,o,i,a))&+(!Bc(i)||W_(e,t,r,o,i,a))&+(!im(i)||Uh(e,t,r,o,i,a))&+(!bs(i)||!s.IsArray(a)||Xh(e,t,r,o,i,a))&+(!xs(i)||!s.IsObject(a)||eO(e,t,r,o,i,a)))&&(!vc(i)||j_(e,t,r,o,i,a));return e.Pop(i),p}var On={};bt(On,{Ref:()=>_M});var fr={};bt(fr,{Delete:()=>fM,Get:()=>lM,Has:()=>uM,Indices:()=>Fi,Set:()=>dM});function oO(e){if(e.length===0)throw Error("Cannot set root")}function iO(e){if(!s.IsObject(e))throw Error("Cannot set value")}function pM(e){return/^(0|[1-9]\d*)$/.test(e)}function aO(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function cM(e,t){return s.IsObject(t)&&s.HasPropertyKey(t,e)}function mM(e,t){return s.IsObject(t)?t[e]:void 0}function tu(e,t){return e.reduce((r,o)=>mM(o,r),t)}function Fi(e){if(s.IsEqual(e.length,0))return[];let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function uM(e,t){let r=e;return Fi(t).every(o=>cM(o,r)?(r=r[o],!0):!1)}function lM(e,t){let r=Fi(t);return tu(r,e)}function dM(e,t,r){let o=Fi(t);oO(o);let[i,a]=aO(o),p=tu(i,e);return iO(p),p[a]=r,e}function fM(e,t){let r=Fi(t);oO(r);let[o,i]=aO(r),a=tu(o,e);return iO(a),s.IsArray(a)&&pM(i)?a.splice(+i,1):delete a[i],e}function gM(e,t,r){if(e.$id===r.hash)return e;let o=new URL(e.$id,t.href),i=new URL(r.href,t.href);if(s.IsEqual(o.pathname,i.pathname))return r.hash.startsWith("#")?sO(e,t,r):e}function yM(e,t,r){let o=new URL(`#${e.$anchor}`,t.href),i=new URL(r.href,t.href);if(s.IsEqual(o.href,i.href))return e}function sO(e,t,r){return r.href.endsWith("#")?e:r.hash.startsWith("#")?fr.Get(e,decodeURIComponent(r.hash.slice(1))):void 0}function EM(e,t,r){if(In(e)){let o=gM(e,t,r);if(!s.IsUndefined(o))return o}if(Ni(e)){let o=yM(e,t,r);if(!s.IsUndefined(o))return o}return sO(e,t,r)}function IM(e,t,r){return e.reduce((o,i)=>{let a=ru(i,t,r);return s.IsUndefined(a)?o:a},void 0)}function TM(e,t,r){return s.Keys(e).reduce((o,i)=>{let a=ru(e[i],t,r);return s.IsUndefined(a)?o:a},void 0)}function ru(e,t,r){if(t=mr(e)&&In(e)?new URL(e.$id,t.href):t,mr(e)){let o=EM(e,t,r);if(!s.IsUndefined(o))return o}if(s.IsArray(e))return IM(e,t,r);if(s.IsObject(e))return TM(e,t,r)}function _M(e,t){let r=new URL("http://unknown"),o=In(e)?new URL(e.$id,r.href):r,i=new URL(t,o.href);return ru(e,o,i)}var An=class{constructor(t,r){this.context=t,this.schema=r,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,r)=>new URL(r.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){mr(t)&&(In(t)&&this.ids.push(t),Ni(t)&&this.anchors.push(t),Ss(t)&&this.recursiveAnchors.push(t),Vc(t)&&this.dynamicAnchors.push(t))}Pop(t){mr(t)&&(In(t)&&this.ids.pop(),Ni(t)&&this.anchors.pop(),Ss(t)&&this.recursiveAnchors.pop(),Vc(t)&&this.dynamicAnchors.pop())}FromContext(t){return s.HasPropertyKey(this.context,t)?this.context[t]:void 0}FromRef(t){return t.startsWith("#")?On.Ref(this.Base(),t):On.Ref(this.schema,t)}Ref(t){return this.FromContext(t)??this.FromRef(t)}RecursiveRef(t){return Ss(this.Base())?On.Ref(this.recursiveAnchors[0],t):On.Ref(this.Base(),t)}};function pO(...e){let[t,r,o]=ne.Match(e,{3:(p,u,l)=>[p,u,l],2:(p,u)=>[{},p,u]}),i=new An(t,r),a=new rt;return $(i,a,r,o)}function cO(...e){let[t,r,o]=ne.Match(e,{3:(y,I,x)=>[y,I,x],2:(y,I)=>[{},y,I]}),i=Tt.Get(),a=cd(),p=[],u=new An(t,r),l=new Gi(y=>{if(!s.IsGreaterEqualThan(p.length,i.maxErrors))return p.push({...y,message:a(y)})});return[V(u,l,"#","",r,o),p]}function ce(...e){let[t,r,o]=ne.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[{},i,a]});return pO(t,r,o)}function Hr(...e){let[t,r,o]=ne.Match(e,{3:(p,u,l)=>[p,u,l],2:(p,u)=>[{},p,u]}),[i,a]=cO(t,r,o);return a}var Kr=class extends Error{constructor(t,r,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:r},writable:!1,configurable:!1,enumerable:!1})}};function mO(e,t,r){return s.IsArray(r)?r.map(o=>je(e,t.items,o)):r}function uO(e,t,r){return t.Clean(r)}function lO(e,t,r){return je({...e,...t.$defs},be(t.$ref),r)}function OM(e){let t=s.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},r=Mt(e);return w(r)?us(r,t):r}function dO(e,t,r){let o=OM(t);return je(e,o,r)}function Rs(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function fO(e,t,r){if(!s.IsObject(r)||s.IsArray(r))return r;let o=Rs(t);for(let i of s.Keys(r)){if(s.HasPropertyKey(t.properties,i)){r[i]=je(e,t.properties[i],r[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||A(o)&&ce(e,o,r[i])){r[i]=je(e,o,r[i]);continue}delete r[i]}return r}function gO(e,t,r){if(!s.IsObject(r))return r;let o=Rs(t),[i,a]=[new RegExp(dt(t)),He(t)];for(let p of s.Keys(r)){if(i.test(p)){r[p]=je(e,a,r[p]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||A(o)&&ce(e,o,r[p])){r[p]=je(e,o,r[p]);continue}delete r[p]}return r}function yO(e,t,r){return s.HasPropertyKey(e,t.$ref)?je(e,e[t.$ref],r):r}function EO(e,t,r){if(!s.IsArray(r))return r;let o=Math.min(r.length,t.items.length);for(let i=0;i<o;i++)r[i]=je(e,t.items[i],r[i]);return s.IsGreaterThan(r.length,o)?r.slice(0,o):r}function AM(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=me(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=me(e[r]);return t}function SM(e){return s.IsClassInstance(e)?e:AM(e)}function bM(e){return e.map(t=>me(t))}function xM(e){return e.slice()}function RM(e){return new Map(me([...e.entries()]))}function CM(e){return new Set(me([...e.values()]))}function me(e){return Ze.IsTypeArray(e)?xM(e):Ze.IsMap(e)?RM(e):Ze.IsSet(e)?CM(e):s.IsArray(e)?bM(e):s.IsObject(e)?SM(e):e}function IO(e,t,r){for(let o of t.anyOf){let i=je(e,o,me(r));if(ce(e,o,i))return i}return r}function je(e,t,r){return J(t)?mO(e,t,r):_t(t)?uO(e,t,r):pe(t)?lO(e,t,r):U(t)?dO(e,t,r):w(t)?fO(e,t,r):ye(t)?gO(e,t,r):se(t)?yO(e,t,r):K(t)?EO(e,t,r):O(t)?IO(e,t,r):r}function bn(...e){let[t,r,o]=ne.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[{},i,a]});return je(t,r,o)}function TO(e,t,r){return s.IsArray(r)?r.map(o=>Re(e,t.items,o)):r}function _O(e,t,r){return t.Convert(r)}var te={};bt(te,{Fail:()=>xn,IsOk:()=>ou,Ok:()=>P,TryBigInt:()=>iu,TryBoolean:()=>VM,TryNull:()=>e$,TryNumber:()=>c$,TryString:()=>y$,TryUndefined:()=>A$});function ou(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function P(e){return{value:e}}function xn(){}function PM(e){return P(e)}function UM(e){return s.IsEqual(e,!0)?P(BigInt(1)):P(BigInt(0))}function NM(e){return P(BigInt(Math.trunc(e)))}function LM(e){return P(BigInt(0))}var kM=/^-?(0|[1-9]\d*)n$/,wM=/^-?(0|[1-9]\d*)\.\d+$/,MM=/^-?(0|[1-9]\d*)$/;function $M(e){return kM.test(e)}function DM(e){return wM.test(e)}function GM(e){return MM.test(e)}function vM(e){let t=e.toLowerCase();return $M(e)?P(BigInt(e.slice(0,e.length-1))):DM(e)?P(BigInt(e.split(".")[0])):GM(e)?P(BigInt(e)):s.IsEqual(t,"false")?P(BigInt(0)):s.IsEqual(t,"true")?P(BigInt(1)):void 0}function jM(e){return P(BigInt(0))}function iu(e){return s.IsBigInt(e)?PM(e):s.IsBoolean(e)?UM(e):s.IsNumber(e)?NM(e):s.IsNull(e)?LM(e):s.IsString(e)?vM(e):s.IsUndefined(e)?jM(e):void 0}function FM(e){return s.IsEqual(e,BigInt(0))?P(!1):s.IsEqual(e,BigInt(1))?P(!0):void 0}function BM(e){return P(e)}function qM(e){return s.IsEqual(e,0)?P(!1):s.IsEqual(e,1)?P(!0):void 0}function HM(e){return P(!1)}function KM(e){return s.IsEqual(e.toLowerCase(),"false")?P(!1):s.IsEqual(e.toLowerCase(),"true")?P(!0):s.IsEqual(e,"0")?P(!1):s.IsEqual(e,"1")?P(!0):void 0}function zM(e){return P(!1)}function VM(e){return s.IsBigInt(e)?FM(e):s.IsBoolean(e)?BM(e):s.IsNumber(e)?qM(e):s.IsNull(e)?HM(e):s.IsString(e)?KM(e):s.IsUndefined(e)?zM(e):void 0}function YM(e){return s.IsEqual(e,BigInt(0))?P(null):void 0}function QM(e){return s.IsEqual(e,!1)?P(null):void 0}function WM(e){return s.IsEqual(e,0)?P(null):void 0}function ZM(e){return P(null)}function XM(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?P(null):void 0}function JM(e){return P(null)}function e$(e){return s.IsBigInt(e)?YM(e):s.IsBoolean(e)?QM(e):s.IsNumber(e)?WM(e):s.IsNull(e)?ZM(e):s.IsString(e)?XM(e):s.IsUndefined(e)?JM(e):void 0}var t$=BigInt(Number.MAX_SAFE_INTEGER),r$=BigInt(Number.MIN_SAFE_INTEGER);function n$(e){return e<=t$&&e>=r$}function hO(e){return n$(e)?P(Number(e)):void 0}function o$(e){return e?P(1):P(0)}function i$(e){return P(e)}function a$(e){return P(0)}function s$(e){let t=+e;if(s.IsNumber(t))return P(t);let r=e.toLowerCase();if(s.IsEqual(r,"false"))return P(0);if(s.IsEqual(r,"true"))return P(1);let o=iu(e);return ou(o)?hO(o.value):void 0}function p$(e){return P(0)}function c$(e){return s.IsBigInt(e)?hO(e):s.IsBoolean(e)?o$(e):s.IsNumber(e)?i$(e):s.IsNull(e)?a$(e):s.IsString(e)?s$(e):s.IsUndefined(e)?p$(e):void 0}function m$(e){return P(e.toString())}function u$(e){return P(e.toString())}function l$(e){return P(e.toString())}function d$(e){return P("null")}function f$(e){return P(e)}function g$(e){return P("")}function y$(e){return s.IsBigInt(e)?m$(e):s.IsBoolean(e)?u$(e):s.IsNumber(e)?l$(e):s.IsNull(e)?d$(e):s.IsString(e)?f$(e):s.IsUndefined(e)?g$(e):void 0}function E$(e){return s.IsEqual(e,BigInt(0))?P(void 0):void 0}function I$(e){return s.IsEqual(e,!1)?P(void 0):void 0}function T$(e){return s.IsEqual(e,0)?P(void 0):void 0}function _$(e){return P(void 0)}function h$(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?P(void 0):void 0}function O$(e){return P(void 0)}function A$(e){return s.IsBigInt(e)?E$(e):s.IsBoolean(e)?I$(e):s.IsNumber(e)?T$(e):s.IsNull(e)?_$(e):s.IsString(e)?h$(e):s.IsUndefined(e)?O$(e):void 0}function OO(e,t,r){if(s.IsBigInt(r))return r;let o=te.TryBigInt(r);return te.IsOk(o)?o.value:r}function AO(e,t,r){if(s.IsBoolean(r))return r;let o=te.TryBoolean(r);return te.IsOk(o)?o.value:r}function SO(e,t,r){return Re({...e,...t.$defs},be(t.$ref),r)}function Cs(e,t,r){if(t.anyOf.some(p=>ce(e,p,r)))return r;let a=t.anyOf.map(p=>Re(e,p,me(r))).find(p=>ce(e,t,p));return s.IsUndefined(a)?r:a}function bO(e,t,r){let o=cn(t);return Cs(e,o,r)}function xO(e,t,r){if(s.IsInteger(r))return r;let o=te.TryNumber(r);return te.IsOk(o)?Math.trunc(o.value):r}function RO(e,t,r){let o=Mt(t);return Re(e,o,r)}function S$(e,t,r){let o=te.TryBigInt(r);return te.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function b$(e,t,r){let o=te.TryBoolean(r);return te.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function x$(e,t,r){let o=te.TryNumber(r);return te.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function R$(e,t,r){let o=te.TryString(r);return te.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function CO(e,t,r){return s.IsEqual(t.const,r)?r:Ed(t)?S$(e,t,r):Id(t)?b$(e,t,r):zn(t)?x$(e,t,r):Vn(t)?R$(e,t,r):F()}function PO(e,t,r){if(s.IsNull(r))return r;let o=te.TryNull(r);return te.IsOk(o)?o.value:r}function UO(e,t,r){if(s.IsNumber(r))return r;let o=te.TryNumber(r);return te.IsOk(o)?o.value:r}function Ps(e,t,r,o){let i=s.Keys(o);for(let[a,p]of t)for(let u of i)a.test(u)||(o[u]=Re(e,r,o[u]));return o}function Bi(e,t,r){return Pe(e)&&s.IsUndefined(r[t])}function C$(e,t,r){let o=s.EntriesRegExp(t.properties),i=s.Keys(r);for(let[a,p]of o)for(let u of i)!a.test(u)||Bi(p,u,r)||(r[u]=Re(e,p,r[u]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?Ps(e,o,t.additionalProperties,r):r}function NO(e,t,r){return s.IsObjectNotArray(r)?C$(e,t,r):r}function P$(e,t,r){let o=s.EntriesRegExp(t.patternProperties),i=s.Keys(r);for(let[a,p]of o)for(let u of i)a.test(u)&&(r[u]=Re(e,p,r[u]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?Ps(e,o,t.additionalProperties,r):r}function LO(e,t,r){return s.IsObjectNotArray(r)?P$(e,t,r):r}function kO(e,t,r){return s.HasPropertyKey(e,t.$ref)?Re(e,e[t.$ref],r):r}function wO(e,t,r){if(s.IsString(r))return r;let o=te.TryString(r);return te.IsOk(o)?o.value:r}function MO(e,t,r){let o=Ke(t.pattern);return Re(e,o,r)}function $O(e,t,r){if(!s.IsArray(r))return r;for(let o=0;o<Math.min(t.items.length,r.length);o++)r[o]=Re(e,t.items[o],r[o]);return r}function DO(e,t,r){if(s.IsUndefined(r))return r;let o=te.TryUndefined(r);return te.IsOk(o)?o.value:r}function GO(e,t,r){if(s.IsUndefined(r))return r;let o=te.TryUndefined(r);return te.IsOk(o)?void 0:r}function Re(e,t,r){return J(t)?TO(e,t,r):_t(t)?_O(e,t,r):lt(t)?OO(e,t,r):et(t)?AO(e,t,r):pe(t)?SO(e,t,r):he(t)?bO(e,t,r):Me(t)?xO(e,t,r):U(t)?RO(e,t,r):W(t)?CO(e,t,r):Bt(t)?PO(e,t,r):ge(t)?UO(e,t,r):w(t)?NO(e,t,r):ye(t)?LO(e,t,r):se(t)?kO(e,t,r):xe(t)?wO(e,t,r):Oe(t)?MO(e,t,r):K(t)?$O(e,t,r):zt(t)?DO(e,t,r):O(t)?Cs(e,t,r):ft(t)?GO(e,t,r):r}function zr(...e){let[t,r,o]=ne.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[{},i,a]});return Re(t,r,o)}function vO(e,t,r){if(!s.IsArray(r))return r;for(let o=0;o<r.length;o++)r[o]=ke(e,t.items,r[o]);return r}function jO(e,t,r){return t.Default(r)}function FO(e,t,r){return ke({...e,...t.$defs},be(t.$ref),r)}function BO(e,t){return s.IsUndefined(t)?s.IsFunction(e.default)?e.default():me(e.default):t}function qO(e,t,r){let o=Mt(t);return ke(e,o,r)}function HO(e,t,r){if(!s.IsObject(r))return r;let o=s.Keys(t.properties);for(let i of o){let a=ke(e,t.properties[i],r[i]);s.IsUndefined(a)&&(Pe(t.properties[i])||!s.HasPropertyKey(t.properties[i],"default"))||(r[i]=ke(e,t.properties[i],r[i]))}if(!ur(t)||s.IsBoolean(t.additionalProperties))return r;for(let i of s.Keys(r))o.includes(i)||(r[i]=ke(e,t.additionalProperties,r[i]));return r}function KO(e,t,r){if(!s.IsObject(r))return r;let[o,i]=[new RegExp(dt(t)),He(t)];for(let a of s.Keys(r))o.test(a)&&At(i)&&(r[a]=ke(e,i,r[a]));if(!ur(t))return r;for(let a of s.Keys(r))o.test(a)||(r[a]=ke(e,t.additionalProperties,r[a]));return r}function zO(e,t,r){return s.HasPropertyKey(e,t.$ref)?ke(e,e[t.$ref],r):r}function VO(e,t,r){if(!s.IsArray(r))return r;let[o,i]=[t.items,Math.max(t.items.length,r.length)];for(let a=0;a<i;a++)a<o.length&&(r[a]=ke(e,o[a],r[a]));return r}function YO(e,t,r){for(let o of t.anyOf){let i=ke(e,o,me(r));if(ce(e,o,i))return i}return r}function ke(e,t,r){let o=At(t)?BO(t,r):r;return J(t)?vO(e,t,o):_t(t)?jO(e,t,o):pe(t)?FO(e,t,o):U(t)?qO(e,t,o):w(t)?HO(e,t,o):ye(t)?KO(e,t,o):se(t)?zO(e,t,o):K(t)?VO(e,t,o):O(t)?YO(e,t,o):o}function Rn(...e){let[t,r,o]=ne.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[{},i,a]});return ke(t,r,o)}function bo(e){return(...t)=>{let[r,o,i]=ne.Match(t,{3:(a,p,u)=>[a,p,u],2:(a,p)=>[{},a,p]});return e.reduce((a,p)=>p(r,o,a),i)}}function U$(e,t,r){return t["~codec"].decode(r)}function N$(e,t,r){return t["~codec"].encode(r)}function Te(e,t,r,o){return nn(r)?s.IsEqual(e,"Decode")?U$(t,r,o):N$(t,r,o):o}function L$(e,t,r,o){if(!s.IsArray(o))return F();for(let i=0;i<o.length;i++)o[i]=de(e,t,r.items,o[i]);return Te(e,t,r,o)}function k$(e,t,r,o){let i=Te(e,t,r,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=de(e,t,r.items,i[a]);return i}function QO(e,t,r,o){return s.IsEqual(e,"Decode")?L$(e,t,r,o):k$(e,t,r,o)}function WO(e,t,r,o){return o=de(e,{...t,...r.$defs},be(r.$ref),o),Te(e,t,r,o)}function w$(e,t,r,o){for(let i of r.allOf)o=de(e,t,i,o);return Te(e,t,r,o)}function M$(e,t,r,o){let i=Te(e,t,r,o);for(let a of r.allOf)i=de(e,t,a,i);return i}function ZO(e,t,r,o){return s.IsEqual(e,"Decode")?w$(e,t,r,o):M$(e,t,r,o)}function $$(e,t,r,o){if(!s.IsObjectNotArray(o))return F();for(let i of s.Keys(r.properties))!s.HasPropertyKey(o,i)||Bi(r.properties[i],i,o)||(o[i]=de(e,t,r.properties[i],o[i]));return Te(e,t,r,o)}function D$(e,t,r,o){let i=Te(e,t,r,o);if(!s.IsObjectNotArray(i))return i;for(let a of s.Keys(r.properties))!s.HasPropertyKey(i,a)||Bi(r.properties[a],a,i)||(i[a]=de(e,t,r.properties[a],i[a]));return i}function XO(e,t,r,o){return s.IsEqual(e,"Decode")?$$(e,t,r,o):D$(e,t,r,o)}function G$(e,t,r,o){if(!s.IsObjectNotArray(o))return F();let i=new RegExp(dt(r));for(let a of s.Keys(o))i.test(a)||F(),o[a]=de(e,t,He(r),o[a]);return Te(e,t,r,o)}function v$(e,t,r,o){let i=Te(e,t,r,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(dt(r));for(let p of s.Keys(i))a.test(p)&&(i[p]=de(e,t,He(r),i[p]));return i}function JO(e,t,r,o){return s.IsEqual(e,"Decode")?G$(e,t,r,o):v$(e,t,r,o)}function eA(e,t,r,o){return o=s.HasPropertyKey(t,r.$ref)?de(e,t,t[r.$ref],o):o,Te(e,t,r,o)}function j$(e,t,r,o){if(!s.IsArray(o))return F();for(let i=0;i<Math.min(r.items.length,o.length);i++)o[i]=de(e,t,r.items[i],o[i]);return Te(e,t,r,o)}function F$(e,t,r,o){let i=Te(e,t,r,o);if(!s.IsArray(i))return o;for(let a=0;a<Math.min(r.items.length,i.length);a++)i[a]=de(e,t,r.items[a],i[a]);return i}function tA(e,t,r,o){return s.IsEqual(e,"Decode")?j$(e,t,r,o):F$(e,t,r,o)}function B$(e,t,r,o){for(let i of r.anyOf){if(!ce(t,i,o))continue;let a=de(e,t,i,o);return Te(e,t,r,a)}return F()}function q$(e,t,r,o){let i=Te(e,t,r,o);for(let a of r.anyOf){let p=de(e,t,a,me(i));if(ce(t,a,p))return p}return i}function rA(e,t,r,o){return s.IsEqual(e,"Decode")?B$(e,t,r,o):q$(e,t,r,o)}function de(e,t,r,o){return J(r)?QO(e,t,r,o):pe(r)?WO(e,t,r,o):U(r)?ZO(e,t,r,o):w(r)?XO(e,t,r,o):ye(r)?JO(e,t,r,o):se(r)?eA(e,t,r,o):K(r)?tA(e,t,r,o):O(r)?rA(e,t,r,o):Te(e,t,r,o)}var au=class extends Kr{constructor(t,r){super("Decode",t,r)}};function H$(e,t,r){if(!ce(e,t,r))throw new au(r,Hr(e,t,r));return r}function K$(e,t,r){return de("Decode",e,t,r)}var FUe=bo([(e,t,r)=>me(r),(e,t,r)=>Rn(e,t,r),(e,t,r)=>zr(e,t,r),(e,t,r)=>bn(e,t,r),(e,t,r)=>H$(e,t,r),(e,t,r)=>K$(e,t,r)]);var su=class extends Kr{constructor(t,r){super("Encode",t,r)}};function z$(e,t,r){if(!ce(e,t,r))throw new su(r,Hr(e,t,r));return r}function V$(e,t,r){return de("Encode",e,t,r)}var JUe=bo([(e,t,r)=>me(r),(e,t,r)=>V$(e,t,r),(e,t,r)=>Rn(e,t,r),(e,t,r)=>zr(e,t,r),(e,t,r)=>bn(e,t,r),(e,t,r)=>z$(e,t,r)]);var Ct=class extends Error{constructor(t,r){super(r),this.type=t}};function nA(e,t){return s.IsFunction(t.default)?t.default(t):s.IsObject(t.default)?me(t.default):t.default}function oA(e,t){if(Oo(t)&&!At(t))throw new Ct(t,"Arrays with uniqueItems constraints must specify a default annotation");let r=_o(t)?t.minItems:0;return Array.from({length:r},()=>fe(e,t.items))}async function*Y$(){}function iA(e,t){return Y$()}function aA(e,t){return t.Create()}function sA(e,t){return lr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):dr(t)?BigInt(t.minimum):BigInt(0)}function pA(e,t){return!1}function cA(e,t){let r=fe(e,t.instanceType);return class{constructor(){Object.assign(this,r)}}}function mA(e,t){return fe({...e,...t.$defs},be(t.$ref))}function uA(e,t){return fe(e,cn(t))}function lA(e,t){let r=fe(e,t.returnType);return()=>r}function dA(e,t){return lr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:dr(t)?t.minimum:0}function fA(e,t){return fe(e,Mt(t))}function*Q$(){}function gA(e,t){return Q$()}function yA(e,t){return t.const}function EA(e,t){throw new Ct(t,"Cannot create TNever types")}function IA(e,t){return null}function TA(e,t){return lr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:dr(t)?t.minimum:0}function _A(e,t){return(s.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:fe(e,t.properties[i])}),{})}function hA(e,t){return Promise.resolve(fe(e,t.item))}function OA(e,t){if(wi(t)&&!At(t))throw new Ct(t,"Record with the minProperties constraint must have a default annotation");return{}}function AA(e,t){return s.HasPropertyKey(e,t.$ref)?fe(e,e[t.$ref]):(()=>{throw new Ct(t,"Unable to deref Ref")})()}function SA(e,t){if((Mi(t)||Li(t))&&!At(t))throw Error("Strings with format or pattern constraints must specify default");let o=ki(t)?t.minLength:0;return"".padEnd(o)}function bA(e,t){return Symbol()}function xA(e,t){let r=Ke(t.pattern);if(xe(r))throw new Ct(t,"Unable to create TemplateLiteral due to infinite type expansion");return fe(e,r)}function RA(e,t){return Array.from({length:t.minItems},(r,o)=>fe(e,t.items[o]))}function CA(e,t){if(s.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return fe(e,t.anyOf[0])}function fe(e,t){return At(t)?nA(e,t):J(t)?oA(e,t):Ye(t)?iA(e,t):_t(t)?aA(e,t):lt(t)?sA(e,t):et(t)?pA(e,t):Ue(t)?cA(e,t):pe(t)?mA(e,t):he(t)?uA(e,t):Ne(t)?lA(e,t):Me(t)?dA(e,t):U(t)?fA(e,t):Qe(t)?gA(e,t):W(t)?yA(e,t):or(t)?EA(e,t):Bt(t)?IA(e,t):ge(t)?TA(e,t):w(t)?_A(e,t):qe(t)?hA(e,t):ye(t)?OA(e,t):se(t)?AA(e,t):xe(t)?SA(e,t):qt(t)?bA(e,t):Oe(t)?xA(e,t):K(t)?RA(e,t):zt(t)?void 0:O(t)?CA(e,t):ft(t)?void 0:void 0}function Zt(...e){let[t,r]=ne.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return fe(t,r)}var pu=class extends Kr{constructor(t,r){super("Parse",t,r)}};function W$(e,t,r){if(!ce(e,t,r))throw new pu(r,Hr(e,t,r));return r}var o0e=bo([(e,t,r)=>me(r),(e,t,r)=>Rn(e,t,r),(e,t,r)=>zr(e,t,r),(e,t,r)=>bn(e,t,r),(e,t,r)=>W$(e,t,r)]);var X$=N({type:H("insert"),path:pt(),value:Fe()}),J$=Object({type:H("update"),path:pt(),value:Fe()}),eD=N({type:H("delete"),path:pt()}),u0e=G([X$,J$,eD]);function xo(e){if(!e.body)throw new Error("This command does not accept a request body");let t=e.body;return t.examples?.length?t.examples[0]:Zt(t)}var NA=cl(require("node:fs"));function Ro(e){if(e.file){let t=NA.default.readFileSync(e.file==="-"?0:e.file,"utf-8");return JSON.parse(t)}if(e.data)return JSON.parse(e.data);throw new Error("Provide a request body with -f <file> or -d <json>. Use --generate-skeleton to get a template.")}function qi(e,t,r,o,i){e.command(t).description(r).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async a=>{if(a.generateSkeleton){re(xo(o));return}let p=Ro(a),u=await i()(o,{body:p});re(u)})}function LA(e,t){let r=e.command("experimental").description("Experimental commands \u2014 unstable, subject to change without notice");qi(r,"promql","Run a PromQL query (experimental)",$_,t)}var oD=`/${"v1"}/feedback`,iD=n.Object({id:n.String({description:"Identifier of the recorded feedback (matches the API request ID)."})},{$id:"Feedback",description:"A recorded piece of feedback"}),aD=n.Object({content:m({allowEmpty:!1,type:"long",description:"The feedback message."})}),kA=d({description:"Submit free-text feedback about Tsuga tools or APIs, e.g. a tool that failed, returned unusable output, or was confusing to use. Feedback is recorded for the Tsuga team to review and improve tooling.",operationId:"createFeedback",tags:["feedback"],url:oD,method:"POST",body:aD,response:iD});function wA(e,t){e.command("feedback <message...>").description("Send feedback about Tsuga tools or APIs (e.g. a tool that failed or was confusing)").action(async r=>{let o=await t()(kA,{body:{content:r.join(" ")}});re(o)})}var Q="context";var a$e=`${Q}.team`,s$e=`${Q}.env`,p$e=`${Q}.api_key_id`,c$e=`${Q}.service.name`,m$e=`${Q}.service.version`;var sD=`${Q}.host.name`,pD=`${Q}.instance`,cD=`${Q}.instanceid`,mD=`${Q}.instance_name`,u$e=`${Q}.telemetry.sdk.language`,l$e=`${Q}.process.runtime.name`,d$e=`${Q}.k8s.cluster.name`,f$e=`${Q}.k8s.cluster.uid`,g$e=`${Q}.k8s.namespace.name`,y$e=`${Q}.k8s.pod.name`,E$e=`${Q}.k8s.pod.uid`,I$e=`${Q}.k8s.container.name`,T$e=`${Q}.k8s.node.name`,_$e=`${Q}.k8s.node.uid`,h$e=`${Q}.k8s.deployment.name`,O$e=`${Q}.k8s.deployment.uid`,A$e=`${Q}.k8s.replicaset.name`,S$e=`${Q}.k8s.replicaset.uid`,b$e=`${Q}.k8s.statefulset.name`,x$e=`${Q}.k8s.statefulset.uid`,R$e=`${Q}.k8s.daemonset.name`,C$e=`${Q}.k8s.daemonset.uid`,P$e=`${Q}.k8s.job.name`,U$e=`${Q}.k8s.job.uid`,N$e=`${Q}.k8s.cronjob.name`,L$e=`${Q}.k8s.cronjob.uid`;var k$e={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${Q}.tag_policy_id`,dataSource:`${Q}.data_source`}};var w$e={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${Q}.batch_kind`,batchKindMetricsFilter:`${Q}.batch_kind:metrics`,sourceApiKeyId:`${Q}.source_api_key_id`,sourceEnv:`${Q}.source_env`,sourceTeam:`${Q}.source_team`}},uD="__tsuga_metadata__",M$e=`${uD}.signature`;var Cn="/v0/service-catalog";var MA=n.Object({team:n.String(),lastSeenAt:T()}),lD=n.Object({ingestionApiKey:n.String(),lastSeenAt:T()}),$A=n.Object({version:n.String(),firstSeenAt:T(),lastSeenAt:T(),faulty:n.Optional(n.Boolean())}),dD=n.Object({language:n.String(),lastSeenAt:T()}),fD=n.Object({runtime:n.String(),lastSeenAt:T()}),Us=n.Object({id:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(MA),ingestionApiKeys:n.Array(lD),versions:n.Array($A),languages:n.Array(dD),runtimes:n.Array(fD),lastSeenAt:T(),firstSeenAt:T(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),logsCount24h:n.Number(),errorLogsCount24h:n.Number(),tracesCount24h:n.Number(),errorTracesCount24h:n.Number(),createdAt:T(),updatedAt:T()}),B$e=d({tags:["service-catalog"],query:n.Object({...ie,clusterId:n.Optional(m())}),method:"GET",paginated:!0,url:`${Cn}/services`,response:n.Array(Us)}),q$e=d({tags:["service-catalog"],method:"GET",url:`${Cn}/services/:serviceId`,params:n.Object({serviceId:m()}),response:Us}),gD=n.Object({id:n.String(),endpointName:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(MA),versions:n.Array($A),lastSeenAt:T(),firstSeenAt:T(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),createdAt:T(),updatedAt:T()}),H$e=d({tags:["service-catalog"],method:"GET",url:`${Cn}/endpoints`,response:n.Array(gD)}),yD=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var DA=n.Object({id:n.String(),hostName:n.String(),env:n.Optional(n.String()),cpuUtilizationAverage:n.Number(),hostType:n.Enum(yD),teams:n.Array(n.String()),tags:n.Array(n.String()),firstSeenAt:T(),lastSeenAt:T(),clusterId:n.String()}),K$e=d({tags:["service-catalog"],method:"GET",url:`${Cn}/hosts`,response:n.Array(DA)}),z$e=d({tags:["service-catalog"],method:"GET",url:`${Cn}/hosts/:hostId`,params:n.Object({hostId:m()}),response:DA}),ED=n.Object({serviceName:n.String(),id:n.Union([n.String(),n.Null()]),namespace:n.Union([n.String(),n.Null()]),cluster:n.String(),env:n.Union([n.String(),n.Null()])}),ID=n.Object({from:n.String(),to:n.String(),count:n.Number()}),V$e=d({tags:["service-catalog"],url:`${Cn}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:m()}),query:n.Object({...yt.properties,query:n.Optional(m({type:"tsuga-query"}))}),response:n.Object({nodes:n.Array(ED),edges:n.Array(ID)})}),Y$e=d({tags:["service-catalog"],method:"GET",url:`${Cn}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var mu=`/${"v1"}/services`,uu=n.Pick(Us,["id","serviceName","serviceNamespace","env","teams","versions","languages","runtimes","lastSeenAt","firstSeenAt","sources","logsCount24h","errorLogsCount24h","tracesCount24h","errorTracesCount24h"],{$id:"Service",description:"Observed telemetry service with metadata, activity stats and version signals"}),TD={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!1}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],runtimes:[{runtime:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",sources:["logs","metrics","traces"],logsCount24h:12e3,errorLogsCount24h:42,tracesCount24h:8500,errorTracesCount24h:17};Object.assign(uu,{examples:[TD]});var GA=d({description:"Retrieve all services",operationId:"listServices",tags:["services"],url:mu,method:"GET",paginated:!0,query:n.Object({...ie,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:n.Array(uu)}),vA=d({description:"Retrieve a service by its id",operationId:"getService",tags:["services"],url:`${mu}/:serviceId`,method:"GET",params:n.Object({serviceId:m({allowEmpty:!1})}),response:uu}),_D=n.Object({serviceName:n.String({description:"Service name"}),id:n.Union([n.String(),n.Null()],{description:"Service ID from catalog, null if unknown"}),namespace:n.Union([n.String(),n.Null()],{description:"Service namespace from catalog, null if unknown"}),cluster:n.String({description:"Cluster ID"}),env:n.Union([n.String(),n.Null()],{description:"Environment observed from spans"})}),jA=d({description:"Retrieve the dependency graph for a service, showing which services call each other",operationId:"getServiceGraph",tags:["services"],url:`${mu}/:serviceId/graph`,method:"GET",params:n.Object({serviceId:m({allowEmpty:!1})}),query:n.Object({...yt.properties,query:n.Optional(m({type:"tsuga-query"}))}),response:n.Object({nodes:n.Array(_D),edges:n.Array(n.Object({from:n.String(),to:n.String(),count:n.Number()}))})});var yr=require("node:fs"),FA=require("node:os"),lu=require("node:path"),BA=(0,lu.join)((0,FA.homedir)(),".config","tsuga"),Co=(0,lu.join)(BA,"config.json"),hD="https://api.tsuga.com";function Po(){if(!(0,yr.existsSync)(Co))return{};try{return JSON.parse((0,yr.readFileSync)(Co,"utf-8"))}catch{throw new Error(`Config file corrupted: ${Co}
38
+ Re-run: tsuga auth <token>`)}}function du(e){(0,yr.mkdirSync)(BA,{recursive:!0,mode:448}),(0,yr.writeFileSync)(Co,`${JSON.stringify(e,null,2)}
39
+ `,{mode:384})}function fu(e){let t=Po(),r=e.operationApiKey??process.env.TSUGA_OPERATION_API_KEY??t.operationApiKey,o=t.defaults??{},i=e.clusterId?.trim()||process.env.TSUGA_CLUSTER_ID?.trim()||o.cluster?.trim()||void 0;return{apiUrl:process.env.TSUGA_API_URL?.trim()||hD,operationApiKey:r,clusterId:i,defaults:o}}function gu(e){let t={};try{t=Po()}catch{}du({...t,...e})}function qA(){return(0,yr.existsSync)(Co)||!!process.env.TSUGA_OPERATION_API_KEY}function yu(){return Co}var HA={from:"-30m",to:"now",query:"*","max-results":"100"};function Er(e){return(Po().defaults??{})[e]??HA[e]}function KA(e,t){let r={};try{r=Po()}catch{}let o={...r.defaults??{},[e]:t};du({...r,defaults:o})}function zA(){let e={};try{e=Po()}catch{}let{defaults:t,...r}=e;du(r)}function VA(e,t){let r=[`API URL: ${e.apiUrl}`];e.operationApiKey?r.push(`Operation API key: ${e.operationApiKey.slice(0,12)}...${e.operationApiKey.slice(-4)}`):r.push("Operation API key: (not set)"),r.push(`Config: ${t}`),r.push(""),r.push("Defaults (custom overrides marked with *):");let o={...HA,...e.defaults};for(let[i,a]of Object.entries(o)){let p=i in e.defaults?" *":"";r.push(` ${i}: ${a}${p}`)}return`${r.join(`
40
+ `)}
41
+ `}function YA(){return Po().lastUpdateCheck}function QA(e){gu({lastUpdateCheck:e})}function WA(e,t){let r=t??Er(e);return r===void 0?void 0:_s(r)}function Eu(e){let t=Er(e);return t===void 0?"":` (default: ${t})`}function ZA(e,t){e.command("service-graph").description("Inspect service dependency graphs").command("get <serviceId>").description("Retrieve the dependency graph for a service").option("--from <timestamp>",`Start of time range${Eu("from")}`).option("--to <timestamp>",`End of time range${Eu("to")}`).option("--query <query>",`Search query${Eu("query")}`).action(async(o,i)=>{let a={},p=WA("from",i.from),u=WA("to",i.to);p!==void 0&&(a.from=p),u!==void 0&&(a.to=u),i.query!==void 0&&(a.query=i.query);let l=await t()(jA,{params:{serviceId:o},query:a});re(l)})}var Iu=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],Tu=["light","dark"];var OD={light:{red:{text:"foreground.red",background:"avatar.background.red"},orange:{text:"foreground.orange",background:"avatar.background.orange"},amber:{text:"foreground.amber",background:"avatar.background.amber"},yellow:{text:"foreground.yellow",background:"avatar.background.yellow"},green:{text:"foreground.green",background:"avatar.background.green"},emerald:{text:"foreground.emerald",background:"avatar.background.emerald"},teal:{text:"foreground.teal",background:"avatar.background.teal"},cyan:{text:"foreground.cyan",background:"avatar.background.cyan"},sky:{text:"foreground.sky",background:"avatar.background.sky"},blue:{text:"foreground.blue",background:"avatar.background.blue"},indigo:{text:"foreground.indigo",background:"avatar.background.indigo"},purple:{text:"foreground.purple",background:"avatar.background.purple"},pink:{text:"foreground.pink",background:"avatar.background.pink"}},dark:{red:{text:"avatar.foreground.foreground",background:"avatar.solid-background.red"},orange:{text:"avatar.foreground.foreground",background:"avatar.solid-background.orange"},amber:{text:"avatar.foreground.foreground",background:"avatar.solid-background.amber"},yellow:{text:"avatar.foreground.foreground",background:"avatar.solid-background.yellow"},green:{text:"avatar.foreground.foreground",background:"avatar.solid-background.green"},emerald:{text:"avatar.foreground.foreground",background:"avatar.solid-background.emerald"},teal:{text:"avatar.foreground.foreground",background:"avatar.solid-background.teal"},cyan:{text:"avatar.foreground.foreground",background:"avatar.solid-background.cyan"},sky:{text:"avatar.foreground.foreground",background:"avatar.solid-background.sky"},blue:{text:"avatar.foreground.foreground",background:"avatar.solid-background.blue"},indigo:{text:"avatar.foreground.foreground",background:"avatar.solid-background.indigo"},purple:{text:"avatar.foreground.foreground",background:"avatar.solid-background.purple"},pink:{text:"avatar.foreground.foreground",background:"avatar.solid-background.pink"}},gradient:{red:"var(--chakra-colors-gradient-red)",orange:"var(--chakra-colors-gradient-orange)",amber:"var(--chakra-colors-gradient-amber)",yellow:"var(--chakra-colors-gradient-yellow)",green:"var(--chakra-colors-gradient-green)",emerald:"var(--chakra-colors-gradient-emerald)",teal:"var(--chakra-colors-gradient-teal)",cyan:"var(--chakra-colors-gradient-cyan)",sky:"var(--chakra-colors-gradient-sky)",blue:"var(--chakra-colors-gradient-blue)",indigo:"var(--chakra-colors-gradient-indigo)",purple:"var(--chakra-colors-gradient-purple)",pink:"var(--chakra-colors-gradient-pink)"}},XA=["activity-heart","activity","airplay","airpods","alarm-clock","anchor","annotation-dots","annotation-heart","annotation-question","annotation","announcement-03","asterisk-01","atom-01","atom-02","award-03","award-04","award-05","backpack","bank-note-01","bank-note-02","bank-note-03","battery-charging-01","beaker-01","beaker-02","bell-03","bell-04","bell-ringing-03","bell-ringing-04","bluetooth-connect","bluetooth-on","book-closed","book-open-01","book-open-02","bookmark","briefcase-01","briefcase-02","brush-01","brush-02","brush-03","building-01","building-02","building-03","building-08","bus","calculator","calendar-check-01","calendar-date","calendar-heart-01","calendar","camera-01","camera-lens","car-01","certificate-01","certificate-02","check-heart","clipboard-attachment","clipboard-check","clipboard-download","clipboard","clock-snooze","clock-stopwatch","cloud-01","cloud-lightning","cloud-moon","cloud-raining-01","cloud-raining-03","cloud-raining-05","cloud-raining-06","cloud-snowing-01","cloud-sun-01","cloud-sun-02","cloud-sun-03","code-browser","code-circle-01","code-circle-02","code-circle-03","code-square-01","code-square-02","coins-hand","coins-stacked-01","colors","compass-01","compass-02","compass-03","compass","credit-card-01","credit-card-02","cube-02","cube-04","cube-outline","currency-bitcoin-circle","currency-dollar-circle","currency-ethereum-circle","currency-euro-circle","currency-pound-circle","currency-ruble-circle","currency-rupee-circle","currency-yen-circle","cursor-click-01","cursor-click-02","diamond-01","diamond-02","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc-01","disc-02","droplets-01","droplets-02","droplets-03","dropper","face-content","face-frown","face-happy","face-neutral","face-sad","face-smile","face-wink","feather","file-02","file-05","file-06","file-heart-01","file-heart-02","file-search-01","file-search-02","file-search-03","film-01","film-02","fingerprint-03","fingerprint-04","flag-01","flag-04","flash-off","flash","gaming-pad-01","gaming-pad-02","gift-01","glasses-01","glasses-02","globe-03","globe-04","globe-05","globe-06","globe-slated-01","globe-slated-02","graduation-hat-01","graduation-hat-02","hash-01","hash-02","headphones-01","headphones-02","heart-circle","heart-hand","heart-hexagon","heart-octagon","heart-rounded","heart-square","hearts","hexagon-01","hexagon-02","home-03","home-smile","hourglass-01","hourglass-02","hourglass-03","hurricane-01","hurricane-02","hurricane-03","image-01","image-02","image-03","image-04","image-05","keyboard-01","laptop-01","life-buoy-01","life-buoy-02","lightbulb-02","lightbulb-03","lightbulb-04","lock-keyhole-circle","lock-keyhole-square","luggage-01","luggage-02","luggage-03","magic-wand-01","magic-wand-02","map-01","map-02","mark","marker-pin-01","marker-pin-04","marker-pin-05","marker-pin-06","medical-circle","medical-cross","medical-square","message-chat-square","message-notification-square","message-smile-square","message-text-square-02","microphone-01","microphone-02","microscope","modem-01","modem-02","monitor-03","monitor-04","monitor-05","moon-01","moon-eclipse","moon-star","music-note-01","music-note-02","music-note-plus","octagon","palette","paperclip","pentagon","phone-01","phone-02","phone-call-01","phone","piggy-bank-01","pin-01","pin-02","plane","play-circle","play-square","podcast","power-02","presentation-chart-01","printer","receipt","recording-01","recording-02","recording-03","rocket-01","rocket-02","roller-brush","rss-01","rss-02","ruler","scales-01","scales-02","server-06","shield-01","shield-02","shield-03","shield-dollar","shield-zap","shopping-bag-01","shopping-cart-01","signal-01","signal-02","signal-03","simcard","sliders-01","sliders-02","snowflake-01","snowflake-02","speaker-01","speaker-02","speaker-03","speedometer-01","speedometer-02","speedometer-03","speedometer-04","square","stand","star-03","star-07","sticker-circle","sticker-square","sun-setting-01","sun-setting-02","sun-setting-03","sun","sunrise","sunset","tablet-01","tag-01","tag-02","tag-03","target-01","target-02","target-03","target-04","target-05","terminal-browser","terminal-circle","terminal-square","thermometer-02","thermometer-03","thermometer-cold","thermometer-warm","thumbs-down","thumbs-up","ticket-01","tool-01","tool-02","train","tram","translate-01","triangle","trophy-01","trophy-02","truck-01","truck-02","tv-02","umbrella-01","umbrella-02","umbrella-03","virus","voicemail","wallet-01","wallet-02","wallet-05","watch-circle","watch-square","waves","webcam-01","webcam-02","wind-01","wind-02","wind-03","youtube","zap-circle","zap-fast","zap"];var cDe=OD.light.red.background;var AD="^\\S(.*\\S)?$",SD=128,bD=256,xD=n.Object({key:n.String(),value:n.String()},{title:"Tag"}),RD=n.Object({key:n.String({maxLength:SD}),value:n.String({maxLength:bD,pattern:AD})},{title:"Tag"}),Pn=n.Array(xD,{title:"Tags",description:"List of key/value tags applied to the resource"}),Un=n.Array(RD,{title:"Tags",maxItems:50,description:"List of key/value tags applied to the resource"}),We=n.Optional(Pn),ut=n.Optional(Un);var Vr="/v0/teams",Ls=["public","private"],Ns={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},CD=n.Enum([Ns.NAME,Ns.CREATED_AT,Ns.MEMBER_COUNT,Ns.VISIBILITY]),JA=n.Object({color:n.Enum(Iu),mode:n.Enum(Tu),iconName:n.Enum(XA)}),_u=n.Object({color:n.Enum(Iu),mode:n.Enum(Tu)}),PD=100,UD=250,Uo=n.Object({id:n.String({description:"Identifier of the team"}),name:n.String({description:"Human readable team name displayed throughout the app"}),description:n.Optional(n.String()),visibility:n.Enum(Ls,{description:"Controls whether the resources of the team are discoverable by users"}),tags:We,createdAt:T(),updatedAt:T(),memberCount:n.Optional(n.Number({description:"Number of members currently in the team"})),avatar:n.Optional(JA)}),ks=n.Object({name:n.String({minLength:1,maxLength:PD,description:"Name to assign to the team"}),description:n.Optional(n.String({maxLength:UD})),visibility:n.Enum(Ls,{description:"Controls whether the resources of the team are discoverable by users"}),tags:ut,avatar:n.Optional(JA)}),ND=n.Object({id:n.String(),name:n.String(),email:n.String(),role:n.Enum(go),joinedTeamAt:T(),orgRole:n.Enum(fs),avatar:n.Optional(_u)}),_De=d({tags:["teams"],url:Vr,method:"GET",paginated:!0,response:n.Array(Uo),query:n.Object({...ie,includeMemberCount:n.Optional(n.Boolean()),searchQuery:n.Optional(m()),visibility:n.Optional(n.Enum(Ls)),myTeamsOnly:n.Optional(n.Boolean()),sortBy:n.Optional(CD),sortDirection:n.Optional(n.Enum(["asc","desc"]))})}),hDe=d({tags:["teams"],url:`${Vr}/:id`,method:"GET",params:n.Object({id:m()}),response:Uo}),ODe=d({tags:["teams"],url:`${Vr}/:id/members`,method:"GET",params:n.Object({id:m()}),response:n.Array(ND)}),ADe=d({tags:["teams"],url:`${Vr}/:id/assets`,method:"GET",params:n.Object({id:m()}),response:n.Object({apiKeyCount:n.Number(),logRouteCount:n.Number(),monitorCount:n.Number(),notificationRuleCount:n.Number(),dashboardCount:n.Number()})}),SDe=d({tags:["teams"],url:Vr,method:"POST",body:ks,response:Uo}),bDe=d({tags:["teams"],url:`${Vr}/:id`,method:"PUT",params:n.Object({id:m()}),body:ks,response:Uo}),xDe=d({tags:["teams"],url:`${Vr}/bulk-update`,method:"POST",body:n.Object({teamIds:n.Array(m(),{maxItems:100}),config:n.Object({visibility:n.Enum(Ls)})}),response:n.Object({})}),RDe=d({tags:["teams"],url:`${Vr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v});var LD=n.Enum(["terraform-provider","web-frontend","mcp-server","cli"]),Ce=b("type",[n.Object({type:n.Literal("user"),id:n.String(),name:n.String(),avatar:n.Optional(_u)}),n.Object({type:n.Literal("operation-api-key"),id:n.String(),name:n.String(),source:n.Optional(LD)})]);var Xt="/v0/dashboards",eS=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],kD=["bar","bar-connection","distribution","heatmap","list-connection","list-log-patterns","list","pie","pie-connection","query-value","query-value-connection","table","timeseries-connection","timeseries","top-list-connection","top-list"],BDe=[...kD,"note"];var wD=["ns","us","ms","s","m","h","days"];var MD=["B","KB","MB","GB","TB","PB"];var $D=20;var tS=n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(wD,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),rS=n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:n.Enum(MD,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),nS=n.Object({type:n.Literal("percent",{description:"Format values as percentages"})},{$id:"DataNormalizerPercent",title:"Percent"}),oS=n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),iS=n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),DD=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),GD=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit",maxLength:$D})},{$id:"InputDataNormalizerCustom",title:"Custom"}),Jt=b("type",[tS,rS,nS,oS,iS,DD],{title:"Normalizer"}),er=b("type",[tS,rS,nS,oS,iS,GD],{title:"Normalizer"}),aS=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(Jt)},{title:"WidgetListColumn"}),sS=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(er)},{title:"WidgetListColumn"}),$s=["background","no-background"],vD=["table","legend-only","no-legend"];var jD=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],pS=["alert","warning","success"],No=n.Object({operator:n.Enum(jD,{description:"Comparator used to evaluate the metric value"}),value:n.Number({description:"Threshold value used when evaluating the operator"}),color:n.Enum(pS,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting"}),FD=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(pS,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker"}),BD=["sec","min","hour","day"],Ds=n.Object({time:n.Number({description:"Number of units that make up each bar bucket"}),metric:n.Enum(BD,{description:"Unit used to measure the bucket width"})});var ws=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),qD=n.Object({formula:n.Optional(n.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),n.String({description:"Optional alias for a query (only used for display in the UI)"})))}),HD=n.Object({formula:n.Optional(m({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),m({type:"short",description:"Optional alias for a query (only used for display in the UI)"})))}),hu={source:Br,queries:C_,formula:n.Optional(P_),aliases:n.Optional(qD),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Ou={source:Br,queries:Pi,formula:n.Optional(Ui),aliases:n.Optional(HD),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Lo={...hu,groupBy:n.Optional(Dc)},ko={...Ou,groupBy:n.Optional(Io)},nt=n.Enum(vD,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),Ve=n.Optional(n.Number({description:"Number of decimal places to display in the value"})),Yr=n.Optional(n.Array(FD,{description:"Threshold markers displayed on the chart"})),KD=n.Object({name:n.String({description:"Display name of the table column"}),...hu,source:Br,normalizer:n.Optional(Jt),precision:Ve},{title:"TableColumn"}),zD=n.Object({name:m({description:"Display name of the table column"}),...Ou,source:Br,normalizer:n.Optional(er),precision:Ve},{title:"TableColumn"}),VD=n.Array(n.Object({id:n.String({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),YD=n.Array(n.Object({id:m({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),cS=["horizontal","vertical"],QD=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:n.String({description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(aS,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"GraphVisualizationList",title:"List"}),WD=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:m({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(sS,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"InputGraphVisualizationList",title:"List"}),Ms=b("type",[n.Object({type:n.Literal("auto")}),n.Object({type:n.Literal("number"),value:n.Number()})]),Gs=n.Object({min:Ms,max:Ms,scale:b("type",[n.Object({type:n.Literal("pow"),exponent:n.Number()}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()}),vs=n.Object({min:Ms,max:Ms,scale:b("type",[n.Object({type:n.Literal("pow"),exponent:n.Number({minimum:0})}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()}),ZD=n.Array(n.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),XD=n.Array(n.Integer({minimum:0,maximum:100,description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"});var JD=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(nt),thresholds:Yr,yAxisSettings:n.Optional(Gs)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),eG=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(nt),thresholds:Yr,yAxisSettings:n.Optional(vs)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),tG=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),query:n.String({description:"The read-only SQL query to execute against the connection."}),listColumns:n.Optional(n.Array(aS,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),rG=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:n.Optional(n.Array(sS,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),nG=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),oG=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),iG=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(nt)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),aG=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(nt)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),sG=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(nt),thresholds:Yr,yAxisSettings:n.Optional(Gs)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),pG=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(nt),thresholds:Yr,yAxisSettings:n.Optional(vs)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),cG=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:n.Optional(n.Enum($s,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(No,{description:"Conditional formatting rules applied to the displayed value"})),precision:Ve,normalizer:n.Optional(Jt),legendMode:n.Optional(nt)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),mG=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:n.Optional(n.Enum($s,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(No,{description:"Conditional formatting rules applied to the displayed value"})),precision:Ve,normalizer:n.Optional(er),legendMode:n.Optional(nt)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),uG=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:n.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(cS,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),lG=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:m({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(cS,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),dG=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Lo,timeBucket:n.Optional(Ds),normalizer:n.Optional(Jt),precision:Ve,legendMode:n.Optional(nt),thresholds:Yr,yAxisSettings:n.Optional(Gs),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),fG=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...ko,timeBucket:n.Optional(Ds),normalizer:n.Optional(er),precision:Ve,legendMode:n.Optional(nt),thresholds:Yr,yAxisSettings:n.Optional(vs),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),gG=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Lo,normalizer:n.Optional(Jt),precision:Ve,conditions:n.Optional(n.Array(No,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),yG=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...ko,normalizer:n.Optional(er),precision:Ve,conditions:n.Optional(n.Array(No,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),EG=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Lo,normalizer:n.Optional(Jt),precision:Ve,legendMode:n.Optional(nt)},{$id:"GraphVisualizationPie",title:"Pie"}),IG=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...ko,normalizer:n.Optional(er),precision:Ve,legendMode:n.Optional(nt)},{$id:"InputGraphVisualizationPie",title:"Pie"}),TG=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...hu,backgroundMode:n.Optional(n.Enum($s,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(No,{description:"Conditional formatting rules applied to the displayed value"})),precision:Ve,normalizer:n.Optional(Jt),legendMode:n.Optional(nt)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),_G=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...Ou,backgroundMode:n.Optional(n.Enum($s,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(No,{description:"Conditional formatting rules applied to the displayed value"})),precision:Ve,normalizer:n.Optional(er),legendMode:n.Optional(nt)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),hG=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Lo,timeBucket:n.Optional(Ds),precision:Ve,normalizer:n.Optional(Jt),thresholds:Yr,legendMode:n.Optional(nt),yAxisSettings:n.Optional(Gs)},{$id:"GraphVisualizationBar",title:"Bar"}),OG=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...ko,timeBucket:n.Optional(Ds),precision:Ve,normalizer:n.Optional(er),thresholds:Yr,legendMode:n.Optional(nt),yAxisSettings:n.Optional(vs)},{$id:"InputGraphVisualizationBar",title:"Bar"}),AG=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Lo,precision:Ve,normalizer:n.Optional(Jt),percentileMarkers:n.Optional(ZD)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),SG=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...ko,precision:Ve,normalizer:n.Optional(er),percentileMarkers:n.Optional(XD)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),bG=["red","pink","violet","blue","cyan","green","yellow","orange"],mS=n.Enum(bG,{description:"Color palette used to render the heatmap intensity gradient"}),xG=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Lo,precision:Ve,normalizer:n.Optional(Jt),palette:n.Optional(mS)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),RG=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...ko,precision:Ve,normalizer:n.Optional(er),palette:n.Optional(mS)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),CG=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(KD,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Dc),defaultSorting:n.Optional(VD)},{$id:"GraphVisualizationTable",title:"Table"}),PG=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(zD,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Io),defaultSorting:n.Optional(YD)},{$id:"InputGraphVisualizationTable",title:"Table"}),UG=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(n.String({description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(eS,{description:"Background color used to render the note"})),noteAlign:n.Optional(ws),noteJustifyContent:n.Optional(ws)},{$id:"GraphVisualizationNote",title:"Note"}),NG=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(m({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(eS,{description:"Background color used to render the note"})),noteAlign:n.Optional(ws),noteJustifyContent:n.Optional(ws)},{$id:"InputGraphVisualizationNote",title:"Note"}),LG=b("type",[JD,tG,nG,iG,sG,cG,dG,gG,EG,TG,hG,AG,xG,CG,QD,UG,uG]),kG=b("type",[eG,rG,oG,aG,pG,mG,fG,yG,IG,_G,OG,SG,RG,PG,WD,NG,lG]),js=n.Object({id:n.String({description:"Identifier of the graph widget"}),name:n.Optional(n.String({description:"Display name of the graph widget"})),description:n.Optional(n.String({description:"Description of the graph widget"})),visualization:LG,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),Fs=n.Object({id:m({description:"Identifier of the graph widget"}),name:n.Optional(m({description:"Display name of the graph widget"})),description:n.Optional(n.String({minLength:1,maxLength:800,description:"Description of the graph widget"})),visualization:kG,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),wG=10,MG=n.Array(n.Object({key:n.String({description:"Filter key"}),values:n.Array(n.String({description:"Filter value"}))}),{description:"Filters applied to every widget on the dashboard"}),$G=n.Array(n.Object({key:m({description:"Filter key"}),values:n.Array(m({description:"Filter value"}))}),{maxItems:wG,description:"Filters applied to every widget on the dashboard"}),Nn=n.Object({id:n.String({description:"Identifier of the dashboard"}),name:n.String({description:"Display name of the dashboard"}),owner:n.String({description:"Team ID that owns and manages the dashboard"}),graphs:n.Array(js,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(MG),createdAt:T(),updatedAt:T(),creator:n.Optional(Ce),updater:n.Optional(Ce),tags:We,timePreset:n.Optional(n.Enum(wc))}),Bs=n.Object({name:m({description:"Display name of the dashboard"}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the dashboard"}),graphs:n.Array(Fs,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional($G),tags:ut,timePreset:n.Optional(n.Enum(wc))}),Au=n.Object({...ie,owners:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Filter by owner team IDs"}))}),qDe=d({tags:["dashboards"],url:Xt,method:"GET",query:Au,paginated:!0,response:n.Array(Nn)}),Gt={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},uS=[Gt.OWNER,Gt.TAGS,Gt.WIDGET_COUNT,Gt.UPDATED_AT,Gt.NAME],qs=n.Partial(n.Object({owners:pr(m({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:m({allowEmpty:!1}),exclude:n.Optional(n.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Substring matched against the dashboard name"}),tags:pr(Un.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50})},{description:"Optional filters applied to narrow the returned dashboards"})),DG=n.Partial(n.Object({...ie,filters:qs,sort:n.Object({by:n.Enum([Gt.IS_FAVORITE,Gt.OWNER,Gt.TAGS,Gt.WIDGET_COUNT,Gt.UPDATED_AT,Gt.NAME],{description:"Field to sort the returned dashboards by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),HDe=d({tags:["dashboards"],url:`${Xt}/query`,method:"POST",paginated:!0,response:n.Array(Nn),body:DG}),KDe=d({tags:["dashboards"],url:`${Xt}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(qs,["tags"]))}),response:Pn}),zDe=d({tags:["dashboards"],url:`${Xt}/:id`,method:"GET",params:n.Object({id:m()}),response:Nn}),VDe=d({tags:["dashboards"],url:Xt,method:"POST",body:Bs,response:Nn}),YDe=d({tags:["dashboards"],url:`${Xt}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Partial(Bs),response:Nn}),QDe=d({tags:["dashboards"],url:`${Xt}/bulk-update`,method:"PUT",body:n.Object({dashboardIds:n.Array(m()),owner:m({allowEmpty:!1})}),response:n.Object({})}),WDe=d({tags:["dashboards"],url:`${Xt}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),ZDe=d({tags:["dashboards"],url:`${Xt}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:m({allowEmpty:!1}),graphId:m({allowEmpty:!1})}),body:n.Omit(Fs,["id"]),response:js}),XDe=d({tags:["dashboards"],url:`${Xt}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(m())}),response:n.Object({})});var Ln=`/${"v1"}/dashboards`,wo=n.Pick(Nn,["id","name","owner","graphs","filters","tags","timePreset"],{$id:"Dashboard",description:"Visualization of telemetry data with customizable graphs and filters"}),GG={id:"123-456-abc",name:"API Performance Overview",owner:"abc-123-def",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(wo,{examples:[GG]});var vG=n.Pick(Au,["limit","offset","owners"]),lS=d({description:"Retrieve all dashboards",operationId:"listDashboards",tags:["dashboards"],url:Ln,method:"GET",paginated:!0,query:vG,response:n.Array(wo)}),dS=n.Partial(n.Object({...ie,filters:qs,sort:n.Object({by:n.Enum([...uS],{description:"Field to sort the returned dashboards by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),jG={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},tags:{values:[{key:"service",value:"api-gateway"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(dS,{examples:[jG]});var aGe=d({description:"Query dashboards with filters, sorting, and pagination",operationId:"queryDashboards",tags:["dashboards"],url:`${Ln}/query`,method:"POST",paginated:!0,body:dS,response:n.Array(wo)}),fS=d({description:"Retrieve a dashboard by its id",operationId:"getDashboard",tags:["dashboards"],url:`${Ln}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:wo}),Su=n.Pick(Bs,["name","owner","graphs","filters","tags","timePreset"]),FG={name:"API Performance Overview",owner:"abc-123-def",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(Su,{examples:[FG]});var gS=d({description:"Create a new dashboard",operationId:"createDashboard",tags:["dashboards"],url:Ln,method:"POST",body:Su,response:wo}),yS=d({description:"Update a dashboard by its id",operationId:"updateDashboard",tags:["dashboards"],url:`${Ln}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:n.Partial(Su),response:wo}),BG=n.Object({id:m({allowEmpty:!1,description:"The dashboard ID to delete"})}),ES=d({description:"Delete a dashboard by its id",operationId:"deleteDashboard",tags:["dashboards"],url:`${Ln}/:id`,method:"DELETE",params:BG,response:v}),sGe=d({description:"Update a single graph within a dashboard by ID.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${Ln}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:m({allowEmpty:!1,description:"The dashboard ID containing the graph"}),graphId:m({allowEmpty:!1,description:"The graph ID to update"})}),body:n.Omit(Fs,["id"]),response:js});var qG=100,HG=3,Mo=n.Object({id:n.String(),name:n.String(),keyLastCharacters:n.String(),owner:n.String(),tags:Pn,teamOverrideFields:n.Optional(n.Array(n.String())),updatedAt:T(),createdAt:T(),creator:n.Optional(Ce),updater:n.Optional(Ce),assetUpdatedAt:T()}),Hi=n.Object({name:n.String({format:ls,minLength:1,maxLength:qG}),owner:m({allowEmpty:!1}),tags:Un,teamOverrideFields:n.Optional(n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:HG}))}),Ki="/v0/ingestion-api-keys",yGe=d({tags:["ingestion-api-keys"],url:Ki,method:"POST",body:Hi,response:n.Intersect([Mo,n.Object({key:n.String()})])}),EGe=d({tags:["ingestion-api-keys"],url:Ki,method:"GET",paginated:!0,query:n.Object(ie),response:n.Array(Mo)}),IGe=d({tags:["ingestion-api-keys"],url:`${Ki}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Mo}),TGe=d({tags:["ingestion-api-keys"],url:`${Ki}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Hi,response:Mo}),_Ge=d({tags:["ingestion-api-keys"],url:`${Ki}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var zi=`/${"v1"}/ingestion-api-keys`,Vi=n.Pick(Mo,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga"}),IS={id:"123-456-abc",name:"Production Logs Ingestion",keyLastCharacters:"x7Qm",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Vi,{examples:[IS]});var TS=n.Pick(Hi,["name","owner","tags","teamOverrideFields"],{$id:"CreateIngestionApiKeyRequest"}),_S=n.Pick(Hi,["name","owner","tags","teamOverrideFields"],{$id:"UpdateIngestionApiKeyRequest"}),hS={name:"Production Logs Ingestion",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(TS,{examples:[hS]});Object.assign(_S,{examples:[hS]});var KG={...IS,key:"tsuga_in:v1:abc123xyx7Qm"},OS=d({description:"Retrieve all ingestion API keys",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:zi,method:"GET",paginated:!0,query:n.Object(ie),response:n.Array(Vi)}),CGe=d({description:"Retrieve an ingestion API key by its id",operationId:"getIngestionApiKey",tags:["ingestion-api-keys"],url:`${zi}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Vi}),zG=n.Intersect([n.Pick(Vi,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),n.Object({key:n.String({description:"The full API key value, returned only at creation time"})})],{title:"IngestionApiKeyCreated",example:KG}),AS=d({description:"Create a new ingestion API key",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:zi,method:"POST",body:TS,response:zG}),SS=d({description:"Update an ingestion API key by its id",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${zi}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:_S,response:Vi}),bS=d({description:"Delete an ingestion API key by its id",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${zi}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var VG={application:{webService:["azure_web_app","gcp_app_engine_service"]},data:{bucket:["aws_s3_bucket","gcp_bucket","azure_blob_storage_container"],messagingService:["aws_kinesis_data_stream","aws_sqs_queue","aws_sns_topic","azure_service_bus_namespace","azure_service_bus_queue","gcp_pubsub_topic","azure_event_grid_topic","azure_event_hub_namespace","azure_event_hub"],fileSystem:["aws_efs","azure_file_share"],contentDeliveryNetwork:["aws_cloudfront_distribution","gcp_cloud_cdn_configuration"],database:["aws_dynamodb_table","aws_elasticache","aws_rds_instance","azure_database_for_mysql_server","azure_database_for_postgres_server","azure_sql_database_server","azure_sql_database","gcp_bigtable_instance","gcp_cloud_sql_instance","gcp_firestore_database","gcp_spanner_instance","azure_cosmos_db_account"],storageAccount:["azure_storage_account"],volume:["aws_ebs_volume","gcp_compute_disk","azure_disk"]},compute:{virtualMachine:["aws_ec2_instance","gcp_compute_instance","azure_compute_virtual_machine"],serverless:["aws_lambda_function","gcp_cloud_run_function","gcp_cloud_run_job","gcp_cloud_run_service","azure_function_app"]},container:{kubernetesCluster:["aws_eks_cluster","gcp_gke_cluster","azure_aks_cluster"],containerRepository:["aws_ecr_repository","gcp_artifact_registry_repository","azure_container_registry"],containerCluster:["aws_ecs_cluster"],containerServiceTask:["aws_ecs_task"],containerService:["aws_ecs_service","azure_container_instance_group"],containerImage:["aws_ecr_image","gcp_artifact_registry_docker_image","azure_container_registry_image"]},network:{virtualNetwork:["aws_vpc","gcp_vpc","azure_virtual_network"],loadBalancer:["aws_elastic_load_balancer","gcp_forwarding_rule","azure_load_balancer","azure_traffic_manager_profile"],targetGroup:["aws_target_group"],certificate:["aws_acm_certificate","gcp_certificate_manager_certificate","azure_app_service_certificate"]}},[LGe,kGe,wGe]=YG(VG);function YG(e){let t=[],r=[],o=[],i=Object.keys(e);for(let a of i){t.push(a);let p=e[a];for(let u in p){r.push(u);let l=p[u];Array.isArray(l)&&o.push(...l)}}return[bu(t),bu(r),bu(o)]}function bu(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var xu=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),QG=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),WG=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),ZG=n.Object({allocatedStorageGib:n.Optional(n.Number()),encryptedAtRest:n.Optional(n.Boolean()),engine:n.Optional(n.String()),dynamoDbItemCount:n.Optional(n.Number()),dynamoDbActualSizeGib:n.Optional(n.Number())}),XG=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),JG=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),ev=n.Object({status:n.Optional(n.String()),activeServices:n.Optional(n.Number()),pendingTasks:n.Optional(n.Number()),runningTasks:n.Optional(n.Number()),registeredContainerInstances:n.Optional(n.Number()),capacityProviders:n.Optional(n.Array(n.String()))}),tv=n.Object({status:n.Optional(n.String()),desiredStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String()),availabilityZone:n.Optional(n.String()),startedAt:n.Optional(T())}),rv=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),nv=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),ov=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(T()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),iv=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),av=n.Object({runtime:n.Optional(n.String()),memoryAllocationMib:n.Optional(n.Number()),timeoutMs:n.Optional(n.Number()),codeSha256:n.Optional(n.String())}),sv=n.Object({kind:n.Optional(n.String())}),pv=n.Object({instanceId:n.String(),architecture:n.Optional(n.String()),instanceType:n.Optional(n.String()),operatingSystem:n.Optional(n.String()),memoryMib:n.Optional(n.Number()),vCpus:n.Optional(n.Number()),vpcId:n.Optional(n.String()),k8sClusterId:n.Optional(n.String())}),cv=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),mv=n.Object({protocol:n.Optional(xu),port:n.Optional(n.Number()),instanceProtocol:n.Optional(xu),instancePort:n.Optional(n.Number())}),uv=n.Object({protocol:n.Optional(n.String()),ports:n.Optional(n.Array(n.String())),portRange:n.Optional(n.String()),allPorts:n.Optional(n.Boolean())}),lv=n.Object({name:n.String(),ip:n.Optional(n.String()),type:n.Enum(["public","private"])}),dv=n.Object({type:n.String(),name:n.String()}),fv=n.Object({frontendIp:n.Optional(lv),backendIpPools:n.Array(dv)}),gv=n.Object({targetId:n.String(),targetPort:n.Optional(n.Number()),targetType:n.Optional(n.Enum(["instance","ip","lambda","alb"])),healthState:n.Optional(n.String()),healthReason:n.Optional(n.String()),healthDescription:n.Optional(n.String()),availabilityZone:n.Optional(n.String())}),yv=n.Object({protocol:n.Optional(xu),port:n.Optional(n.Number()),type:n.Optional(n.Enum(["alb","lambda","instance","ip"])),name:n.Optional(n.String()),targetGroupArn:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),healthCheckProtocol:n.Optional(n.String()),healthCheckPort:n.Optional(n.String()),healthCheckPath:n.Optional(n.String()),healthCheckIntervalSeconds:n.Optional(n.Number()),healthCheckTimeoutSeconds:n.Optional(n.Number()),healthyThresholdCount:n.Optional(n.Number()),unhealthyThresholdCount:n.Optional(n.Number()),targets:n.Optional(n.Array(gv)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),Ev=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),Iv=n.Object({type:n.Optional(n.String()),name:n.Optional(n.String()),alwaysServe:n.Optional(n.Boolean()),subnets:n.Optional(n.Array(n.Union([n.Number(),Ev]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),Tv=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),_v=n.Object({loadBalancerType:n.Optional(n.String()),dnsName:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnetIds:n.Array(n.String()),scheme:n.Optional(n.String()),listeners:n.Optional(n.Union([n.Array(mv),n.Array(uv)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array(Tv),n.Array(Iv)])),azureLoadBalancingRules:n.Optional(n.Array(fv))}),hv=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(T()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(T()),status:n.Optional(n.String()),type:n.Optional(n.String())}),Ov=n.Object({state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:n.Optional(n.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),Av=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),Sv=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),bv=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([Ov,Sv,Av])]),xv=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),Hs=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(xv)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(QG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(iv)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(rv)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(WG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(ZG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(sv)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(bv)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(pv)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(av)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(XG)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(JG)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(ev)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerServiceTask"),attributes:n.Optional(tv)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerService"),attributes:n.Optional(nv)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(ov)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(cv)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:_v}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(yv)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(hv)})]);var Yi="/v0/inventory",Ru=["aws","gcp","azure"],xS=["scan_in_progress","success","failure"],Cu=n.Object({id:n.String({description:"Identifier of the inventory resource"}),cloudPlatform:n.Enum(Ru,{description:"Cloud platform that hosts this resource"}),cloudAccount:n.String({description:"Cloud-native account identifier the resource was discovered in"}),cloudRegion:n.Optional(n.String({description:"Cloud region the resource was discovered in, when applicable"})),fullyQualifiedResourceId:n.String({description:"Cloud-native unique identifier for this resource (for example an AWS ARN or GCP resource name)"}),displayName:n.String({description:"Human-readable name shown in the Tsuga UI"}),nativeResourceType:n.String({description:"Cloud-native resource type, for example aws_ec2_instance or gcp_bucket"}),resourceCreatedAt:n.Optional(T({description:"When the resource was created in the cloud, when known"})),resourceUpdatedAt:n.Optional(T({description:"When the resource was last updated in the cloud, when known"})),resourceLastSeenAt:T({description:"When this resource was last observed during an inventory scan"}),tags:We,nativeAttributes:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),covered:n.Optional(n.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),BGe=d({tags:["inventory"],method:"GET",url:`${Yi}/resources`,paginated:!0,query:n.Object(ie),response:n.Array(n.Intersect([Cu,Hs]))}),Rv=b("type",[n.Object({type:n.Literal("aws"),accountId:n.String(),externalId:n.String(),roleArn:n.String()}),n.Object({type:n.Literal("gcp"),projectId:n.String(),serviceAccountId:n.String(),workloadIdentityProvider:n.String()}),n.Object({type:n.Literal("azure"),clientId:n.String(),subscriptionId:n.String(),tenantId:n.String()})]),Cv=n.Object({type:n.Literal("aws"),accountId:m(),externalId:m(),roleArn:m()}),Pv=n.Object({type:n.Literal("gcp"),projectId:m(),serviceAccountId:m(),workloadIdentityProvider:m()}),Uv=n.Object({type:n.Literal("azure"),clientId:m(),subscriptionId:m(),tenantId:m()}),RS=b("type",[Cv,Pv,Uv]),Ks=n.Object({id:n.String(),cloudType:n.Enum(Ru),cloudAccountId:n.String(),accountFriendlyName:n.Optional(n.String()),organizationId:n.Optional(n.String()),connectionSettings:Rv,createdBy:n.Optional(n.String()),createdAt:T(),lastScanStartedAt:n.Optional(T()),lastScanFinishedAt:n.Optional(T()),lastScanStatus:n.Optional(n.Enum(xS))}),Nv=n.Object({cloudType:n.Enum(Ru),cloudAccountId:m(),accountFriendlyName:n.Optional(m()),organizationId:n.Optional(m()),connectionSettings:RS,lastScanStatus:n.Optional(n.Enum(xS))}),kn=`${Yi}/cloud-accounts`,qGe=d({tags:["inventory"],url:kn,method:"GET",response:n.Array(Ks)}),HGe=d({tags:["inventory"],url:`${kn}/:id`,method:"GET",params:n.Object({id:m()}),response:Ks}),KGe=d({tags:["inventory"],url:kn,method:"POST",body:Nv,response:Ks}),zGe=d({tags:["inventory"],url:`${kn}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Object({accountFriendlyName:m()}),response:Ks}),VGe=d({tags:["inventory"],url:`${kn}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),YGe=d({tags:["inventory"],url:`${Yi}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),QGe=d({tags:["inventory"],url:`${kn}/azure/onboarding`,method:"POST",body:n.Object({tenantId:m()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),WGe=d({tags:["inventory"],method:"POST",url:`${kn}/validate/:type`,params:n.Object({type:m()}),body:n.Object({data:RS,id:n.Optional(m())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),CS=`${Yi}/settings`,ZGe=d({tags:["inventory"],url:CS,method:"GET",response:n.Object({settings:n.Optional(n.Object({id:n.String(),infrastructureIdentifiers:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))}))})}),XGe=d({tags:["inventory"],url:CS,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:m({allowEmpty:!1}),value:n.Optional(m({allowEmpty:!1}))}),{maxItems:50})}),response:n.Object({})}),JGe=d({tags:["inventory"],url:`${Yi}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var Lv=`/${"v1"}/inventory`,kv=n.Omit(Cu,["nativeAttributes","covered"],{$id:"InventoryResourceBase",description:"Base fields of a cloud resource discovered by an inventory scan"}),PS=n.Intersect([kv,Hs],{$id:"InventoryResource",description:"A cloud resource discovered by an inventory scan, together with its category, type and category-specific attributes"}),wv={id:"123-456-abc",cloudPlatform:"aws",cloudAccount:"123456789012",cloudRegion:"us-east-1",fullyQualifiedResourceId:"arn:aws:s3:::tsuga-example-bucket",displayName:"tsuga-example-bucket",nativeResourceType:"aws_s3_bucket",resourceCreatedAt:"2024-01-01T08:00:00.000Z",resourceLastSeenAt:"2024-01-15T12:34:56.000Z",tags:[{key:"team",value:"platform"}],category:"data",resourceType:"bucket",attributes:{versioningStatus:"Enabled"}};Object.assign(PS,{examples:[wv]});var US=d({description:"Retrieve all cloud resources discovered by inventory scans",operationId:"listInventoryResources",tags:["inventory"],url:`${Lv}/resources`,method:"GET",paginated:!0,query:n.Object(ie),response:n.Array(PS)});var Mv={"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"crawler-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["admin"]},"asset-change":{read:["public_viewer","public_editor","admin"],write:[]},"inventory-settings":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-members":{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]}},$v={"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"asset-change":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"crawler-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"inventory-settings":{read:["viewer","editor","admin"],write:["editor","admin"]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:[]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:["admin"],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]}},Dv={user:Mv,team:$v};function Pu(e){return NS(e,"team")}function Uu(e){return NS(e,"user")}function NS(e,t){let r=[],o=Dv[t];for(let[i,a]of Object.entries(o))for(let[p,u]of Object.entries(a))u.includes(e)&&r.push({actionType:p,resourceType:i});return r}var lve={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:Uu("admin"),roleKey:"admin"},public_editor:{name:"Public editor",description:"Can view and edit assets in public teams, but not access private teams or critical settings.",permissions:Uu("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:Uu("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},dve={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:Pu("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:Pu("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:Pu("viewer"),roleKey:"viewer"}};var LS=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757119",isUsingLuhnAlgorithm:!1,regexp:"([12])\\s*[0-9]{2}\\s*(0[1-9]|1[0-2])\\s*(2[AB]|[0-9]{2})\\s*([0-9]{3})\\s*([0-9]{3})(\\s*[0-9]{2})?"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
40
42
  MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
41
43
  Ks14IReLcYgADhoXk56ZzXI=
42
- -----END PRIVATE KEY-----`,isUsingLuhnAlgorithm:!1,regexp:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[ \\r\\n\\t\\f\\v\\S-]{64,}?KEY(?: BLOCK)?-----"},{key:"pulumi_api_token",name:"Pulumi API token",category:"credential",example:"pul-b77e6bff9fddebbc2bb8eca94e3f29a41f6da70a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pul-[a-f0-9]{40})"},{key:"pypi_upload_token",name:"PyPI upload token",category:"credential",example:"pypi-AgEIcHlwaS5vcmc128fd9e0b47dde39cfecad3a997273458e6392f6aac649ae38864bdd7ff12836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)pypi-AgEIcHlwaS5vcmc[a-zA-Z0-9_-]{50}"},{key:"rapidapi_access_token",name:"RapidAPI access token",category:"credential",example:"g4x40h94pi_-zlklfz3-qvhiiu5zankyrqqwmsl60decihbqvl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{50})"},{key:"readme_api_token",name:"ReadMe API token",category:"credential",example:"rdme_k38kau741xa5lw03mdkvcd4vn6s6hdhvhg1wxa4ls7dp8h58r0yxq65nsqwndn056pxsc4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rdme_[a-z0-9]{70})"},{key:"rubygems_api_token",name:"RubyGems API token",category:"credential",example:"rubygems_7790aaa8102395704a64594a11f6de4941a27f86bc3fc9d4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rubygems_[a-f0-9]{48})"},{key:"scalingo_api_token",name:"Scalingo API token",category:"credential",example:"tk-us-4fhmqrg-rl4416b3oij_qx3q284wbhbqpk7r3te4r14lafou",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:tk-us-[a-zA-Z0-9_-]{48})"},{key:"sendbird_access_id",name:"SendBird access ID",category:"credential",example:"7e7801fd-c25d-50ab-a723-01b94c8d6c5f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sendbird_access_token",name:"SendBird access token",category:"credential",example:"305f75f04e3afa65360c25d9944fdae91138328d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{40})"},{key:"sendgrid_api_token",name:"SendGrid API token",category:"credential",example:"SG.--ed-fvdeffijnle7575jp1sh24wq_9y9hcjua5w3dnqh5-wyegkpzenziy1_qr=hf",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:SG\\.[a-z0-9=_\\-\\.]{66})"},{key:"sendinblue_api_token",name:"Sendinblue API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:xkeysib-[a-f0-9]{64}\\-[a-z0-9]{16})"},{key:"sentry_access_token",name:"Sentry access token",category:"credential",example:"1ad463398f40a52bb94a3795762f4003d51b03b8a788cba55e3a81de81c72940",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"sentry_org_token",name:"Sentry org token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)sntrys_eyJpYXQiO[a-zA-Z0-9+/]{10}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\\z)"},{key:"sentry_user_token",name:"Sentry user token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sntryu_[a-f0-9]{64})"},{key:"settlemint_application_access_token",name:"Settlemint application access token",category:"credential",example:"sm_aat_gshgzsv353m5yb9s",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_aat_[a-zA-Z0-9]{16})"},{key:"settlemint_personal_access_token",name:"Settlemint personal access token",category:"credential",example:"sm_pat_1yhza49gsle0trg8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_pat_[a-zA-Z0-9]{16})"},{key:"settlemint_service_access_token",name:"Settlemint service access token",category:"credential",example:"sm_sat_cha543e6lb19llli",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_sat_[a-zA-Z0-9]{16})"},{key:"shippo_api_token",name:"Shippo API token",category:"credential",example:"shippo_live_1d0f80d04e7788c1edb8fc2b8076bbf8f59b84b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:shippo_(?:live|test)_[a-fA-F0-9]{40})"},{key:"shopify_access_token",name:"Shopify access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpat_[a-fA-F0-9]{32}"},{key:"shopify_custom_access_token",name:"Shopify custom access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpca_[a-fA-F0-9]{32}"},{key:"shopify_private_app_access_token",name:"Shopify private app access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shppa_[a-fA-F0-9]{32}"},{key:"shopify_shared_secret",name:"Shopify shared secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpss_[a-fA-F0-9]{32}"},{key:"sidekiq_secret",name:"Sidekiq secret",category:"credential",example:"aa8d3915:64fb5cb5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{8}:[a-f0-9]{8})"},{key:"sidekiq_sensitive_url",name:"Sidekiq sensitive URL",category:"credential",example:"https://cafebabe:deadbeef@gems.contribsys.com/",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https?://(?:[a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)"},{key:"slack_bot_token",name:"Slack bot token",category:"credential",example:"xoxb-781236542736-2364535789652-GkwFDQoHqzXDVsC6GzqYUypD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*"},{key:"slack_user_token",name:"Slack user token",category:"credential",example:"xoxp-41684372915-1320496754-45609968301-e708ba56e1517a99f6b5fb07349476ef",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}"},{key:"slack_app_token",name:"Slack app token",category:"credential",example:"xapp-1-A052FGTS2DL-5171572773297-610b6a11f4b7eb819e87b767d80e6575a3634791acb9a9ead051da879eb5b55e",isUsingLuhnAlgorithm:!1,regexp:"xapp-[0-9]-[A-Z0-9]+-[0-9]+-[a-z0-9]+"},{key:"slack_config_access_token",name:"Slack config access token",category:"credential",example:"xoxe.xoxp-1-Mi0yLTM0MTQwNDE0MDE3Ni0zNjU5NDY0Njg4MTctNTE4MjA3NTQ5NjA4MC01NDEyOTYyODY5NzUxLThhMTBjZmI1ZWIzMGIwNTg0ZDdmMDI5Y2UxNzVlZWVhYzU2ZWQyZTZiODNjNDZiMGUxMzRlNmNjNDEwYmQxMjQ",isUsingLuhnAlgorithm:!1,regexp:"xoxe.xox[bp]-[0-9]-[A-Z0-9]{50}"},{key:"slack_config_refresh_token",name:"Slack config refresh token",category:"credential",example:"xoxe-1-My0xLTMxNzcwMjQ0MTcxMy01MTU4MTUyNjkxNzE0LTUxODE4NDI0MDY3MzYtMjA5MGFkOTFlZThkZWE2OGFlZDYwYWJjODNhYzAxYjA5ZjVmODBhYjgzN2QyNDdjOTNlOGY5NTg2YWM1OGM4Mg",isUsingLuhnAlgorithm:!1,regexp:"xoxe-[0-9]-[A-Z0-9]{50}"},{key:"slack_legacy_bot_token",name:"Slack legacy bot token",category:"credential",example:"xoxb-263594206564-FGqddMF8t08v8N7Oq4i57vs1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}"},{key:"slack_legacy_workspace_token",name:"Slack legacy workspace token",category:"credential",example:"xoxa-2-511111111-31111111111-3111111111111-e039d02840a0b9379c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[ar]-(?:[0-9]-)?[0-9a-zA-Z]{8,48}"},{key:"slack_legacy_token",name:"Slack legacy token",category:"credential",example:"xoxs-416843729158-132049654-5609968301-e708ba56e1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[os]-[0-9]+-[0-9]+-[0-9]+-[a-fA-F0-9]+"},{key:"slack_webhook_url",name:"Slack webhook URL",category:"credential",example:"hooks.slack.com/services/z6cvbfngk3h7i0vts4akmbxidtb8o3b4pq2sbbd6o86g",isUsingLuhnAlgorithm:!1,regexp:"(?:https?://)?hooks.slack.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}"},{key:"snyk_api_token",name:"Snyk API token",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sonar_api_token",name:"Sonar API token",category:"credential",example:"12345678ABCDEFH1234567890ABCDEFH12345678",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:(?:squ_|sqp_|sqa_)?[a-z0-9=_-]{40})"},{key:"stripe_access_token",name:"Stripe access token",category:"credential",example:"sk_test_cyge9m4s1kxiqdkszz0a57nyx6wk73",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})"},{key:"square_access_token",name:"Square access token",category:"credential",example:"sq0atp-OQUxovdrj3tfFpSd66r3sY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:EAAA|sq0atp-)[a-zA-Z0-9_-]{22,60})"},{key:"squarespace_access_token",name:"Squarespace access token",category:"credential",example:"86447eab-140f-2563-3572-bb016dafd692",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sumologic_access_id",name:"SumoLogic access ID",category:"credential",example:"suJS4ZsaD5bQTt",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:su[a-zA-Z0-9]{12})"},{key:"sumologic_access_token",name:"SumoLogic access token",category:"credential",example:"1xohkwr8lpvm4osygkpe5zbd16c3376ver2qed1bssuko4uy4tij1bnf4dnwy7o4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"microsoft_teams_webhook",name:"Microsoft Teams webhook URL",category:"credential",example:"https://mycompany.webhook.office.com/webhookb2/767lrnj6-okh8-dnh8-jey2-y2iteohrwz75@6igi6oz6-ud9w-wior-2zva-5vx0wp6wuiqk/IncomingWebhook/o1zox92ssprrppjtnvcjqq0q09k2wnc3/qwox5p9d-x4zr-3yis-t1on-s67zj50tmyht",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https://[a-z0-9]+\\.webhook\\.office\\.com/webhookb2/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}"},{key:"telegram_bot_api_token",name:"Telegram bot API token",category:"credential",example:"59015865:A12o5wu6f78zofs0udypf9ti23u82g-qkfz",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{5,16}:(?-i:A)[a-z0-9_\\-]{34})"},{key:"travisci_access_token",name:"Travis CI access token",category:"credential",example:"zjgfo5fhshd5c60hpz22wh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{22})"},{key:"twilio_api_key",name:"Twilio API key",category:"credential",example:"SKa585fd034fcd16cdd741f7df9b57fb3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)SK[0-9a-fA-F]{32}"},{key:"twitch_api_token",name:"Twitch API token",category:"credential",example:"1hm9gcychlkpf93jdjnwdu0uaamu6d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"twitter_api_key",name:"Twitter API key",category:"credential",example:"m8zqu4etx07bjt7tyeacc6pox",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"twitter_api_secret",name:"Twitter API secret",category:"credential",example:"7f4gxkubw9qs346ik99zk3z8b6kk3d7g8toi7zujgvgbt8q0yv",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{50})"},{key:"twitter_access_token",name:"Twitter access token",category:"credential",example:"465616696186918-96B1NCD5CH0uyi7zUHiS",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{15,25}-[a-zA-Z0-9]{20,40})"},{key:"twitter_access_secret",name:"Twitter access secret",category:"credential",example:"vyuo5peybdzznr7z0ua5wamhogusans4m29uzi25w4jgj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{45})"},{key:"twitter_bearer_token",name:"Twitter bearer token",category:"credential",example:"AAAAAAAAAAAAAAAAAAAAAAWRGWFGlfwyqNrrIa3pewqNNLX0jQMj2sR6M2cZUfBdqXDtkt7Nsb56F4tCz7Pt8ujbosrLxnRqYgwI0b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:A{22}[a-zA-Z0-9%]{80})"},{key:"typeform_api_token",name:"Typeform API token",category:"credential",example:"tfp_o-nsn=6eg2ios=4g652xhf933qor4jj7ort2qh_uw_5jdsuffp31ln=e-2a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:tfp_[a-z0-9\\-_\\.=]{59})"},{key:"vault_batch_token",name:"Vault batch token",category:"credential",example:"hvb.x84j4cl53mzvhvb1nfc3mfi721gh5i-92f96lt0gns5lpksfu5f0199j-gw4ycxg6au4ser86mczcr_nx6ur2elbpazfrybo80fxjv3bghxshml3g261l6qi03yrz03qup84jk-fc2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hvb\\.[a-zA-Z0-9_-]{50})"},{key:"vault_service_token",name:"Vault service token",category:"credential",example:"s.8QH9knZV94f0IjBZismfOPD0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:hvs\\.[a-zA-Z0-9_-]{90}|s\\.(?i:[a-z0-9]{24})))"},{key:"yandex_api_key",name:"Yandex API key",category:"credential",example:"AQVN9wiAh8pyz3lmB5WTo_KUuPDXlxtzkA5-YFG",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:AQVN[A-Za-z0-9_\\-]{35,38})"},{key:"yandex_aws_access_token",name:"Yandex AWS access token",category:"credential",example:"YCZ6DHVrZONPNtgwWLZPrIGyviSrudRVSr8w0b1S",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:YC[a-zA-Z0-9_\\-]{38})"},{key:"yandex_access_token",name:"Yandex access token",category:"credential",example:"t1.L=.WJ9CYVI5eeLkTOrMM_dgaPgdmpen48R8RYsL4VJqelVKDmrqYsSHkH6QyVVhJkuHSQFTd0NOhClEDyCz7eEbh5=",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})"},{key:"zendesk_secret_key",name:"Zendesk secret key",category:"credential",example:"iydgm2jofftb2xu7niv55qnfxdwbwmqt2s561bgc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"infracost_api_token",name:"Infracost API token",category:"credential",example:"ico-fNZw8jjy6TugMUHKWX4l9iSP3i95SPNH",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ico-[a-zA-Z0-9]{32})"},{key:"iban",name:"Iban",category:"financial-data",example:"FR7630006000011234567890189",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{11,30}(?-u:\\b)"},{key:"aikido_token",name:"Aikido token",category:"credential",example:"AIK_SECRET_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_SECRET_[A-Za-z0-9]{64}"},{key:"aikido_ci_token",name:"Aikido CI secret",category:"credential",example:"AIK_CI_US_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_CI_(US_|ME_)?[A-Za-z0-9]{64}"},{key:"tsuga_ingestion_key",name:"Tsuga ingestion key",category:"credential",example:"tsuga_in:v1:OUvrwavCG//ixL08HEds9OAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_in:v1:[A-Za-z0-9+/]{24}"},{key:"tsuga_operation_key",name:"Tsuga operation key",category:"credential",example:"tsuga_op:v1:zz3-LWv-sLy:0k7Skt255M0yXe/ZLBoiSamb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_op:v1:[A-Za-z0-9_-]+:[A-Za-z0-9+/]{24}"}],$G=oS.map(e=>e.key),qDe=new Set($G),HDe=oS.map(e=>e.key);function iS(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var DG=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","alert_previous_status","alert_priority","alert_query","alert_start_time","alert_status","alert_tags","alert_threshold","alert_timeframe","alert_title","alert_transition","alert_triggered_by","alert_value","dashboard_url","monitor_url"],GG=["alert_event_name","alert_message"],dGe=[...DG,...GG];var vG=["all","owning-team-and-public","owning-team-only"],uu=n.Enum(vG,{description:"This controls which data the resource can see"});var Mt="/v0/monitors",Oo=["alert","resolve","keep_last_status","consider_zero"],ks=["alert","resolve","keep_last_status"];var sS=["no_aggregation","all","any","each","proportion"],pS=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var jG=n.Object({formula:n.String(),operator:n.Enum(pS),threshold:n.Number()}),FG=n.Object({formula:c({type:"tsuga-formula"}),operator:n.Enum(pS),threshold:n.Number()}),lu=n.Array(jG),du=n.Array(FG),mS=n.Object({formula:n.String(),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"])}),cS=n.Object({formula:c({type:"tsuga-formula"}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"])}),nve=n.Enum(["rate","error","cpu","general"]),bt=[1,2,3,4,5];var ji={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(n.String(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(sS)),proportionAlertThreshold:n.Optional(n.Integer())},Fi={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(c(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{maxItems:1,description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(sS)),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99}))},uS=n.Object({type:n.Literal("metric"),conditions:lu,noDataBehavior:n.Enum(Oo),...ji,queries:no},{$id:"MonitorConfigurationMetric"}),lS=n.Object({type:n.Literal("metric"),conditions:du,noDataBehavior:n.Enum(Oo),...Fi,queries:oo},{$id:"InputMonitorConfigurationMetric"}),dS=n.Object({type:n.Literal("log"),conditions:lu,noDataBehavior:n.Enum(Oo),...ji,queries:no},{$id:"MonitorConfigurationLog"}),fS=n.Object({type:n.Literal("log"),conditions:du,noDataBehavior:n.Enum(Oo),...Fi,queries:oo},{$id:"InputMonitorConfigurationLog"}),gS=n.Object({type:n.Literal("trace"),conditions:lu,noDataBehavior:n.Enum(Oo),...ji,queries:no},{$id:"MonitorConfigurationTrace"}),BG=n.Object({type:n.Literal("trace"),conditions:du,noDataBehavior:n.Enum(Oo),...Fi,queries:oo},{$id:"InputMonitorConfigurationTrace"}),yS=n.Object({type:n.Literal("anomaly-log"),condition:mS,noDataBehavior:n.Enum(ks),...ji,queries:no},{$id:"MonitorConfigurationAnomalyLog"}),ES=n.Object({type:n.Literal("anomaly-log"),condition:cS,noDataBehavior:n.Enum(ks),...Fi,queries:oo},{$id:"InputMonitorConfigurationAnomalyLog"}),IS=n.Object({type:n.Literal("anomaly-metric"),condition:mS,noDataBehavior:n.Enum(ks),...ji,queries:no},{$id:"MonitorConfigurationAnomalyMetric"}),TS=n.Object({type:n.Literal("anomaly-metric"),condition:cS,noDataBehavior:n.Enum(ks),...Fi,queries:oo},{$id:"InputMonitorConfigurationAnomalyMetric"}),_S=n.Object({type:n.Literal("certificate-expiry"),warnBeforeInDays:n.Integer(),cloudAccounts:n.Optional(n.Array(n.String())),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("resolve")},{$id:"MonitorConfigurationCertificateExpiry"}),qG=n.Object({type:n.Literal("certificate-expiry"),warnBeforeInDays:n.Integer({minimum:1,maximum:365}),cloudAccounts:n.Optional(n.Array(n.String(),{minItems:1})),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("resolve")},{$id:"InputMonitorConfigurationCertificateExpiry"}),hS=n.Object({type:n.Literal("log-error-pattern"),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("keep_last_status"),filter:n.Object({teamIds:n.Array(n.String()),env:n.String(),service:n.Optional(n.String())})},{$id:"MonitorConfigurationLogErrorPattern"}),HG=b("type",[uS,dS,gS,yS,IS,hS,_S]),KG=b("type",[lS,fS,BG,ES,TS,hS,qG]);var ur=n.Object({id:n.String({description:"Identifier of the monitor"}),name:n.String({description:"Display name of the monitor"}),owner:n.String({description:"Team ID that owns and manages the monitor"}),message:n.Optional(n.String({description:"Message to be displayed if a notification is triggered"})),tags:Ye,configuration:HG,priority:n.Enum(bt,{description:"Priority of the monitor"}),permissions:uu,dashboardId:n.Optional(n.String({description:"Identifier of a dashboard related to the monitor"})),pauseUntil:n.Optional(T()),creator:n.Optional(Se),updater:n.Optional(Se),createdAt:T(),updatedAt:T(),assetUpdatedAt:T(),clusterIds:n.Array(n.String())},{title:"Monitor"}),zG=b("type",[uS,dS,gS,yS,IS,_S]),ove=n.Object({...ur.properties,configuration:zG},{title:"Monitor"}),ive=n.Object({...ur.properties,configuration:b("type",[lS,fS,ES,TS])},{title:"Monitor"}),Bi=n.Object({name:c(),message:n.Optional(c({type:"long"})),tags:mt,configuration:KG,priority:n.Enum(bt),owner:c({allowEmpty:!1}),dashboardId:n.Optional(c()),pauseUntil:n.Optional(c({allowEmpty:!1,type:"date-time"})),permissions:uu,clusterIds:n.Optional(n.Array(c({allowEmpty:!1})))}),aS=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],Br={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};function vi(e,t){return n.Object({values:n.Array(e,{maxItems:t.maxItems}),exclude:n.Optional(n.Boolean({description:"If true, exclude monitors matching these values instead of including them"}))},{description:t.description})}var fu=n.Partial(n.Object({...Ue,filters:n.Partial(n.Object({owners:vi(c({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:c({allowEmpty:!1}),exclude:n.Optional(n.Boolean({description:"If true, exclude monitors matching this value instead of including them"}))},{description:"Substring matched against monitor name and configuration"}),tags:vi(Ui.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:vi(n.Enum(bt),{description:"Restrict results to monitors with one of these priorities",maxItems:bt.length}),types:vi(n.Enum(aS),{description:"Restrict results to monitors with these types",maxItems:aS.length}),activity:n.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:vi(c({allowEmpty:!1}),{description:"Restrict results to monitors deployed to any of these cluster IDs (monitors with no cluster restriction are always included)",maxItems:50})},{description:"Optional filters applied to narrow the returned monitors"})),sort:n.Object({by:n.Enum([Br.PRIORITY,Br.TYPE,Br.NAME,Br.OWNER,Br.TAGS,Br.CLUSTER_IDS,Br.PAUSE_UNTIL,Br.ASSET_UPDATED_AT],{description:"Field to sort the returned monitors by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned monitors"})})),ave=d({tags:["monitors"],url:`${Mt}/query`,method:"POST",paginated:!0,response:n.Array(ur),body:fu}),sve=d({tags:["monitors"],url:`${Mt}/:id`,method:"GET",params:n.Object({id:c()}),response:ur}),pve=d({tags:["monitors"],url:Mt,method:"POST",body:Bi,response:ur}),mve=d({tags:["monitors"],url:`${Mt}/:id`,method:"PUT",params:n.Object({id:c()}),body:Bi,response:ur}),cve=d({tags:["monitors"],url:`${Mt}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),uve=d({tags:["monitors"],url:`${Mt}/:id/snooze`,method:"POST",params:n.Object({id:c()}),body:n.Object({pauseUntil:c({allowEmpty:!1,type:"date-time"})}),response:ur}),VG=["alert","ok","alert_consider_zero","ok_consider_zero","alert_no_data","ok_no_data","keep_last_status_ok","keep_last_status_alert"],Sn=n.Enum(VG),YG=b("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([Sn,n.Null()]),lastChangedAt:T()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(Sn)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(Sn)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(Sn)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(Sn)})]),QG=n.Object({monitorId:n.String(),currentState:YG,lastChangedAt:n.Optional(T())}),lve=d({tags:["monitors"],url:`${Mt}/states/:id`,method:"GET",params:n.Object({id:c()}),response:QG}),dve=d({tags:["monitors"],url:`${Mt}/:id/transitions`,method:"GET",params:n.Object({id:c()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:T(),fromState:n.Optional(Sn),toState:n.Optional(Sn),dimension:n.Optional(n.String())}))}),WG=["unprocessed","processed","failed-to-process"],fve=d({tags:["monitors"],url:`${Mt}/:id/results`,method:"GET",params:n.Object({id:c()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:T(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),dm),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:T(),status:n.Enum(WG)}))})});var qi=`/${"v1"}/monitors`,Hi=n.Pick(ur,["id","name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],{$id:"Monitor",description:"Monitor allowing to send alerts based on telemetry data"}),ZG={id:"123-456-abc",name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},XG={id:"456-789-def",name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(Hi,{examples:[ZG,XG]});var OS=n.Pick(fu,["filters","sort","limit","offset"]),JG={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(OS,{examples:[JG]});var AS=d({description:"Query monitors with filters, sorting, and pagination",operationId:"queryMonitors",tags:["monitors"],url:`${qi}/query`,method:"POST",paginated:!0,body:OS,response:n.Array(Hi)}),SS=d({description:"Retrieve a monitor by its id",operationId:"getMonitor",tags:["monitors"],url:`${qi}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:Hi}),bS=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],xS=n.Pick(Bi,bS,{$id:"CreateMonitorRequest"}),RS=n.Pick(Bi,bS,{$id:"UpdateMonitorRequest"}),CS={name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},PS={name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(xS,{examples:[CS,PS]});Object.assign(RS,{examples:[CS,PS]});var US=d({description:"Create a new monitor",operationId:"createMonitor",tags:["monitors"],url:qi,method:"POST",body:xS,response:Hi}),NS=d({description:"Update a monitor by its id",operationId:"updateMonitor",tags:["monitors"],url:`${qi}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:RS,response:Hi}),ev=n.Object({id:c({allowEmpty:!1,description:"The monitor ID to delete"})}),LS=d({description:"Delete a monitor by its id",operationId:"deleteMonitor",tags:["monitors"],url:`${qi}/:id`,method:"DELETE",params:ev,response:v});var Ki="/v0/notifications",xn=`${Ki}/rules`,kS=`${Ki}/slack/setup`,Ms=`${Ki}/integrations`,bn=["triggered","resolved","no-data"],tv=["sent","stale","pending","rate-limited","failed","silenced"],rv=n.Optional(n.Object({maxMessages:n.Integer({description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),nv=n.Optional(n.Object({maxMessages:n.Integer({minimum:1,description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({minimum:1,description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),ov=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),iv=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({minimum:1,description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),av=n.Object({id:n.String({description:"Identifier of the notification target"}),rateLimit:rv,renotifyConfig:ov,config:b("type",[n.Object({type:n.Literal("slack"),channel:n.String({description:"Slack channel ID that receives the notification"}),integrationId:n.String({description:"Slack workspace ID that receives the notification"}),integrationName:n.String({description:"Human readable name of the Slack integration"})},{$id:"RuleTargetConfigSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:n.String({description:"Identifier of the incident.io integration to use"}),integrationName:n.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),n.Object({type:n.Literal("email"),addresses:n.Array(n.String(),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:n.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:n.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),n.Object({type:n.Literal("pagerduty"),integrationId:n.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:n.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:n.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:n.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:n.String({description:"Identifier of the webhook integration to use"}),integrationName:n.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:n.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:n.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:n.String({description:"Identifier of the Google Chat integration to use"}),integrationName:n.String({description:"Human readable name of the Google Chat integration"})},{$id:"RuleTargetConfigGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:n.String({description:"Identifier of the Squadcast integration to use"}),integrationName:n.String({description:"Human readable name of the Squadcast integration"})},{$id:"RuleTargetConfigSquadcast"})],{description:"Configuration describing how the alert was delivered"})}),sv=n.Object({id:c({description:"Identifier of the notification target"}),rateLimit:nv,config:b("type",[n.Object({type:n.Literal("slack"),channel:c({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:c({allowEmpty:!1,description:"Slack workspace ID that receives the notification"})},{$id:"RuleTargetInputSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:c({allowEmpty:!1,description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty"),integrationId:c({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),n.Object({type:n.Literal("email"),addresses:n.Array(c({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:c({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:c({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:c({allowEmpty:!1,description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:c({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:c({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"})},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:c({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"})},{$id:"RuleTargetInputSquadcast"})],{description:"Configuration describing how the alert should be delivered"}),renotifyConfig:iv}),gu=b("type",[n.Object({type:n.Literal("specific-teams"),teams:n.Array(n.String(),{description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams")}),n.Object({type:n.Literal("all-public-teams")})]),yu=b("type",[n.Object({type:n.Literal("specific-teams"),teams:n.Array(c(),{minItems:1,maxItems:100,description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams")}),n.Object({type:n.Literal("all-public-teams")})]),Ao=n.Object({id:n.String({description:"Identifier of the notification rule"}),name:n.String({description:"Display name of the notification rule"}),queryString:n.Optional(n.String({description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:gu,prioritiesFilter:n.Array(n.Enum(bt),{description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(bn),{description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Array(n.String(),{description:"Cluster IDs that can trigger a notification"}),owner:n.String({description:"Team ID that owns and manages the rule"}),createdAt:T(),updatedAt:T(),isActive:n.Boolean(),tags:Ye,targets:n.Array(av,{description:"Notification targets that can receive notifications when the rule matches"}),creator:n.Optional(Se),updater:n.Optional(Se)}),zi=n.Object({name:c({description:"Display name of the notification rule"}),queryString:n.Optional(c({type:"tags-query",description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:yu,prioritiesFilter:n.Array(n.Enum(bt),{maxItems:bt.length,description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(bn),{maxItems:bn.length,description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Optional(n.Array(c({allowEmpty:!1}),{description:"Cluster IDs that can trigger a notification"})),owner:c({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:mt,isActive:n.Boolean(),targets:n.Array(sv,{minItems:1,description:"Notification targets that can receive notifications when the rule matches"})}),Uve=d({tags:["notification-rules"],url:xn,method:"GET",paginated:!0,query:n.Object(Ue),response:n.Array(Ao)}),Nve=d({tags:["notification-rules"],url:`${xn}/:id`,params:n.Object({id:c()}),method:"GET",response:Ao}),Lve=d({tags:["notification-rules"],url:xn,method:"POST",body:zi,response:Ao}),kve=d({tags:["notification-rules"],url:`${xn}/:id`,method:"PUT",params:n.Object({id:c()}),body:zi,response:Ao}),Mve=d({tags:["notification-rules"],url:`${xn}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),wve=d({tags:["notification-integrations"],url:`${kS}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),pv=n.Object({id:n.String(),name:n.String(),type:n.Enum(["slack","incident-io","grafana-irm","pagerduty","microsoft-teams","webhook","servicenow","google-chat","squadcast"]),createdAt:T(),ruleCount:n.Number(),creator:n.Optional(Se)}),$ve=d({tags:["notification-integrations"],url:`${xn}/integrations`,method:"GET",paginated:!0,query:n.Object(Ue),response:n.Array(pv)}),Dve=d({tags:["notification-integrations"],url:`${kS}/callback`,method:"GET",query:n.Object({code:c()}),response:n.Object({success:n.Boolean()})}),Eu=["POST","PUT"],mv=n.Record(n.String(),n.String()),cv=n.Record(n.String(),n.Unknown()),uv=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),lv=b("type",[n.Object({type:n.Literal("json"),value:cv}),n.Object({type:n.Literal("form"),value:uv})]),dv=n.Object({ok:n.String(),alert:n.String()}),Iu=n.Object({id:n.String(),name:n.String(),setting:b("type",[n.Object({type:n.Literal("incident-io"),alertSourceConfigId:n.String(),tokenLastChars:n.String()}),n.Object({type:n.Literal("grafana-irm"),urlLastChars:n.String()}),n.Object({type:n.Literal("pagerduty"),integrationKeyLastChars:n.String()}),n.Object({type:n.Literal("microsoft-teams"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("webhook"),urlLastChars:n.String(),method:n.Enum(Eu),authentication:b("type",[n.Object({type:n.Literal("bearer"),tokenLastChars:n.String()}),n.Object({type:n.Literal("basic"),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("custom-header"),key:n.String(),valueLastChars:n.String()}),n.Object({type:n.Literal("none")})]),customHeaders:n.Optional(mv),payloadTemplate:lv,eventNameMapping:n.Optional(dv)}),n.Object({type:n.Literal("servicenow"),instanceName:n.String(),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("google-chat"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("squadcast"),webhookUrlLastChars:n.String()})]),tags:Ye}),fv=n.Object({type:n.Literal("webhook"),url:c({type:"uri"}),method:n.Enum(Eu),authentication:b("type",[n.Object({type:n.Literal("bearer"),token:c({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:c({allowEmpty:!1}),password:c({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:c({allowEmpty:!1}),value:c({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),customHeaders:n.Record(c({allowEmpty:!1}),c()),payloadTemplate:b("type",[n.Object({type:n.Literal("json"),value:n.Record(c({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(c({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})]),eventNameMapping:n.Optional(n.Object({ok:c({allowEmpty:!1}),alert:c({allowEmpty:!1})}))}),MS=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:c(),token:c()}),wS=n.Object({type:n.Literal("grafana-irm"),url:c({type:"uri"})}),$S=n.Object({type:n.Literal("pagerduty"),integrationKey:c()}),DS=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:c({type:"uri"})}),gv=n.Object({type:n.Literal("servicenow"),instanceName:c({allowEmpty:!1,description:'Instance name of the ServiceNow instance. This corresponds to the subdomain part of the instance URL, like "my-instance" in "my-instance.service-now.com"'}),username:c({allowEmpty:!1}),password:c({allowEmpty:!1})}),yv=n.Object({type:n.Literal("google-chat"),webhookUrl:c({type:"uri"})}),Ev=n.Object({type:n.Literal("squadcast"),webhookUrl:c({type:"uri"})}),Iv=n.Object({name:c(),setting:b("type",[MS,wS,$S,DS,fv,gv,yv,Ev]),tags:mt}),Tv=n.Object({type:n.Literal("webhook"),url:n.Optional(c({type:"uri"})),method:n.Optional(n.Enum(Eu)),authentication:n.Optional(b("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(c({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(c({allowEmpty:!1})),password:n.Optional(c({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(c({allowEmpty:!1})),value:n.Optional(c({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})])),customHeaders:n.Optional(n.Record(c({allowEmpty:!1}),c())),payloadTemplate:n.Optional(b("type",[n.Object({type:n.Literal("json"),value:n.Record(c({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(c({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:n.Optional(n.Object({ok:n.Optional(c({allowEmpty:!1})),alert:n.Optional(c({allowEmpty:!1}))}))}),_v=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(c({allowEmpty:!1})),username:n.Optional(c({allowEmpty:!1})),password:n.Optional(c({allowEmpty:!1}))}),hv=n.Object({type:n.Literal("google-chat"),webhookUrl:c({type:"uri"})}),Ov=n.Object({type:n.Literal("squadcast"),webhookUrl:c({type:"uri"})}),Av=n.Object({name:n.Optional(c()),setting:n.Optional(b("type",[MS,wS,$S,DS,Tv,_v,hv,Ov]))}),Gve=d({tags:["notification-integrations"],url:Ms,method:"POST",body:Iv,response:Iu}),vve=d({tags:["notification-integrations"],url:`${Ms}/:id`,method:"GET",params:n.Object({id:c()}),response:Iu}),jve=d({tags:["notification-integrations"],url:`${Ms}/:id`,method:"PUT",params:n.Object({id:c()}),body:Av,response:Iu}),Fve=d({tags:["notification-integrations"],url:`${Ms}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),Bve=d({tags:["notification-rules"],url:`${Mt}/:id/notifications`,method:"GET",params:n.Object({id:c()}),query:n.Optional(n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number())})),response:n.Object({notifications:n.Array(n.Object({id:n.String(),monitorId:n.String(),monitorResultId:n.String(),ruleId:n.Optional(n.String()),targetId:n.Optional(n.String()),status:n.Enum(tv),tryCount:n.Number(),nextTryAt:T(),createdAt:T(),updatedAt:T(),sentAt:n.Optional(T())})),isTruncated:n.Boolean()})}),Sv=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast"],qve=d({tags:["notification-rules"],url:`${xn}/test`,method:"POST",body:n.Object({notificationRule:zi,targetIds:n.Optional(n.Array(c({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:n.Union([n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(Sv,{description:"The type of the target (e.g., slack, webhook)"}),status:n.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:n.Optional(n.String({description:"Message if the notification failed for this specific target"}))}))})])});var Vi=`/${"v1"}/notification-rules`,Yi=n.Pick(Ao,["id","name","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Rules to trigger notifications to targets based on alert events"}),bv={id:"123-456-abc",name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(Yi,{examples:[bv]});var GS=d({description:"Retrieve all notification rules",operationId:"listNotificationRules",tags:["notification-rules"],url:Vi,method:"GET",paginated:!0,query:n.Object(Ue),response:n.Array(Yi)}),vS=d({description:"Retrieve a notification rule by its id",operationId:"getNotificationRule",tags:["notification-rules"],url:`${Vi}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:Yi}),Tu=n.Pick(zi,["name","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"]),xv={name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(Tu,{examples:[xv]});var jS=d({description:"Create a new notification rule",operationId:"createNotificationRule",tags:["notification-rules"],url:Vi,method:"POST",body:Tu,response:Yi}),FS=d({description:"Update a notification rule by its id",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${Vi}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:Tu,response:Yi}),Rv=n.Object({id:c({allowEmpty:!1,description:"The notification rule ID to delete"})}),BS=d({description:"Delete a notification rule by its id",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${Vi}/:id`,method:"DELETE",params:Rv,response:v});var So=`${Ki}/silences`,qS=n.Union([n.Literal("monday"),n.Literal("tuesday"),n.Literal("wednesday"),n.Literal("thursday"),n.Literal("friday"),n.Literal("saturday"),n.Literal("sunday")]),Cv=n.Partial(n.Record(qS,n.Array(n.Object({startTime:n.String({format:Wp}),endTime:n.String({format:Wp})},{title:"SilenceTimeRange"}),{minItems:1,description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),Pv=n.Partial(n.Record(qS,n.Array(n.Object({startTime:n.String(),endTime:n.String()},{title:"SilenceTimeRange"}),{description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),ws='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',HS="One-time silence schedule with specific start and end times",KS="Recurring weekly silence schedule",Uv=b("type",[n.Object({type:n.Literal("one-time"),startTime:n.String({format:Zp}),endTime:n.String({format:Zp}),timeZone:n.Optional(n.String({format:Qp,description:ws}))},{$id:"InputSilenceScheduleOneTime",description:HS}),n.Object({type:n.Literal("recurring"),weeklySchedule:Cv,timeZone:n.Optional(n.String({format:Qp,description:ws}))},{$id:"InputSilenceScheduleRecurring",description:KS})],{description:"Schedule defining when the silence is active"}),Nv=b("type",[n.Object({type:n.Literal("one-time"),startTime:n.String(),endTime:n.String(),timeZone:n.Optional(n.String({description:ws}))},{$id:"OutputSilenceScheduleOneTime",description:HS}),n.Object({type:n.Literal("recurring"),weeklySchedule:Pv,timeZone:n.Optional(n.String({description:ws}))},{$id:"OutputSilenceScheduleRecurring",description:KS})],{description:"Schedule defining when the silence is active"}),$s=n.Object({name:c({description:"Display name of the silence"}),reason:c({allowEmpty:!1,description:"Reason for the silence"}),owner:c({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:mt,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:Uv,notificationRuleIds:n.Optional(n.Array(c(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(c({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:yu,prioritiesFilter:n.Array(n.Enum(bt),{maxItems:bt.length,description:"Monitor priorities to filter which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(bn),{maxItems:bn.length,description:"Transition types to filter which alerts this silence applies to"})}),bo=n.Object({id:n.String({description:"Unique identifier of the silence"}),name:n.String({description:"Display name of the silence"}),reason:n.String({description:"Reason for the silence"}),owner:n.String({description:"Team ID that owns and manages the silence"}),tags:Ye,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:Nv,notificationRuleIds:n.Optional(n.Array(n.String(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(n.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:gu,prioritiesFilter:n.Array(n.Enum(bt),{description:"Monitor priorities filtering which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(bn),{description:"Transition types filtering which alerts this silence applies to"}),createdAt:T(),updatedAt:T(),creator:n.Optional(Se),updater:n.Optional(Se)}),s1e=d({tags:["notification-silences"],url:So,method:"GET",response:n.Array(bo)}),p1e=d({tags:["notification-silences"],url:`${So}/:id`,params:n.Object({id:c()}),method:"GET",response:bo}),m1e=d({tags:["notification-silences"],url:So,method:"POST",body:$s,response:bo}),c1e=d({tags:["notification-silences"],url:`${So}/:id`,method:"PUT",params:n.Object({id:c()}),body:$s,response:bo}),u1e=d({tags:["notification-silences"],url:`${So}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),l1e=d({tags:["notification-silences"],url:`${So}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(c())}),response:n.Object({})});var Qi=`/${"v1"}/notification-silences`,Ds=n.Pick(bo,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Silences to suppress notifications based on schedules and filters"}),zS=d({description:"Retrieve all notification silences",operationId:"listNotificationSilences",tags:["notification-silences"],url:Qi,method:"GET",response:n.Array(Ds)}),VS=d({description:"Retrieve a notification silence by its id",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${Qi}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:Ds}),YS=n.Pick($s,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"]),QS=d({description:"Create a new notification silence",operationId:"createNotificationSilence",tags:["notification-silences"],url:Qi,method:"POST",body:YS,response:Ds}),WS=d({description:"Update a notification silence by its id",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${Qi}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:YS,response:Ds}),Lv=n.Object({id:c({allowEmpty:!1,description:"The notification silence ID to delete"})}),ZS=d({description:"Delete a notification silence by its id",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${Qi}/:id`,method:"DELETE",params:Lv,response:v});var kv=["passed","failed","ignored"],Mv=n.Enum(kv),XS=["unrouted-logs","team-has-route","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","inconsistent-attribute-naming","no-duplicate-attr-values","no-debug-logs-in-prod","no-multiline-logs","no-empty-dashboards","monitor-has-notification","no-future-dated-logs","metric-usage","no-stale-dashboards","no-unused-dashboards","no-orphan-monitors","no-flapping-monitors","no-noisy-group-monitors","no-long-alert-monitors","no-redundant-monitors","no-absent-log-fields","k8s-recommended-attributes","k8s-recommended-metrics","k8s-recommended-change-events","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys"],wv=n.Enum(XS),$v=["log","metric","resource","span"],Dv=["team","global"],hu=n.Object({key:n.Enum(XS),title:n.String(),summary:n.String(),rationale:n.String(),objectType:n.Enum($v),category:n.Enum(["hygiene","routing","integrity","consistency","redundancy","cost"]),impact:n.Object({label:n.Enum(["critical","important","normal"]),weight:n.Number()}),recommendation:n.String(),scope:n.Optional(n.Enum(Dv))}),_u=n.Intersect([hu,n.Object({status:Mv,normalizedScore:n.Number(),details:n.Optional(n.Record(n.String(),n.Unknown())),recommendation:n.Optional(n.String()),examples:n.Optional(n.Array(n.Object({type:n.String(),label:n.String(),link:n.Object({to:n.String(),search:n.Optional(n.Unknown()),params:n.Optional(n.Unknown())})})))})]),Gs=n.Object({generatedAt:n.String(),overallScore:n.Optional(n.Number()),rules:n.Array(hu),teamResults:n.Array(n.Object({teamId:n.String(),teamName:n.String(),teamWeight:n.Number(),score:n.Number(),weightedScore:n.Number(),totalWeight:n.Number(),ruleResults:n.Array(_u)})),globalResults:n.Optional(n.Object({score:n.Optional(n.Number()),ruleResults:n.Array(_u)}))}),S1e=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:Gs}),b1e=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:n.Object({clusterId:n.Optional(c({allowEmpty:!1}))}),response:n.Object({report:n.Optional(Gs)})}),x1e=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:n.Object({ruleKey:wv,teamId:c(),lookbackMinutes:n.Optional(n.Integer({minimum:1,maximum:60})),clusterId:n.Optional(c({allowEmpty:!1}))}),response:n.Object({rule:hu,result:_u,teamId:n.String(),teamName:n.String()})});var Gv=`/${"v1"}/quality-reports`,JS=n.Pick(Gs,["generatedAt","overallScore","rules","teamResults","globalResults"],{$id:"QualityReport",description:"Aggregated quality report with per-team rule evaluations and scores"}),vv={generatedAt:"2026-02-26T12:00:00.000Z",overallScore:.85,rules:[{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"resource",category:"routing",impact:{label:"important",weight:2},recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."}],teamResults:[{teamId:"abc-123-def",teamName:"platform",teamWeight:1,score:.85,weightedScore:.85,totalWeight:2,ruleResults:[{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"resource",category:"routing",impact:{label:"important",weight:2},recommendation:"Ensure every team manages a dedicated route scoped to its context.team value.",status:"passed",normalizedScore:1}]}]};Object.assign(JS,{examples:[vv]});var jv=n.Object({clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),eb=d({description:"Retrieve the latest quality report",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${Gv}/latest`,method:"GET",query:jv,response:n.Object({report:n.Optional(JS)})});var Wi="/v0/admin-center";var Yt=`${Wi}/retention-policies`,Fv=3650,Bv=n.Integer(),tb=n.Integer({minimum:1,maximum:Fv}),lr=n.Object({id:n.String(),env:n.Optional(n.String()),teamId:n.Optional(n.String()),dataSource:n.Enum(kt),durationDays:Bv,isEnabled:n.Boolean(),createdAt:T(),updatedAt:T()}),vs=n.Object({env:n.Optional(c()),teamId:n.Optional(c()),dataSource:n.Enum(kt),durationDays:tb,isEnabled:n.Boolean()}),rb=n.Array(n.Object({env:c(),dataSource:n.Enum(kt),durationDays:n.Union([tb,n.Null()]),isEnabled:n.Boolean()})),nb=n.Object({inserted:n.Array(lr),updated:n.Array(lr),deleted:n.Array(lr)}),F1e=d({tags:["retention-policies"],url:Yt,method:"POST",body:vs,response:lr}),B1e=d({tags:["retention-policies"],url:Yt,method:"GET",response:n.Array(lr)}),q1e=d({tags:["retention-policies"],url:`${Yt}/:id`,method:"GET",params:n.Object({id:c()}),response:lr}),H1e=d({tags:["retention-policies"],url:`${Yt}/:id`,method:"PUT",params:n.Object({id:c()}),body:vs,response:lr}),K1e=d({tags:["retention-policies"],url:`${Yt}/bulk-update`,method:"POST",body:rb,response:nb}),z1e=d({tags:["retention-policies"],url:`${Yt}/bulk-update-for-team`,method:"POST",body:n.Object({teamId:c(),policies:rb}),response:nb}),V1e=d({tags:["retention-policies"],url:`${Yt}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),Zi=["past-24-hours","past-7-days","past-30-days"],Y1e=d({tags:["retention-policies"],url:`${Yt}/requested-history-percentile/:teamId`,method:"POST",params:n.Object({teamId:c()}),body:n.Object({percentile:n.Number({minimum:0,maximum:1}),observationWindow:n.Enum(Zi),dataSource:n.Enum(kt)}),response:n.Object({percentile:n.Number(),observationWindow:n.Enum(Zi),dataSource:n.Enum(kt),teamId:n.String(),requestedHistoryDays:n.Number()})}),qv=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var Hv=n.Array(n.Object({bucket:n.Enum(qv),count:n.Number()})),Q1e=d({tags:["retention-policies"],url:`${Yt}/requested-history-histogram/:teamId`,method:"POST",params:n.Object({teamId:c()}),body:n.Object({observationWindow:n.Enum(Zi),dataSource:n.Enum(kt)}),response:n.Object({observationWindow:n.Enum(Zi),dataSource:n.Enum(kt),teamId:n.String(),histogram:Hv})}),W1e=d({tags:["retention-policies"],url:`${Yt}/top-teams-with-retention-surplus`,method:"POST",body:n.Object({dataSource:n.Enum(kt),observationWindow:n.Enum(Zi),percentile:n.Number({minimum:0,maximum:1}),topN:n.Optional(n.Number({minimum:1,maximum:20}))}),response:n.Array(n.Object({teamId:n.String(),retentionSurplusDays:n.Number()}))});var Xi=`/${"v1"}/retention-policies`,Ji=n.Pick(lr,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Data retention rule for a data source within an environment"}),Kv={id:"123-456-abc",env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(Ji,{examples:[Kv]});var ob=d({description:"Retrieve all retention policies",operationId:"listRetentionPolicies",tags:["retention-policies"],url:Xi,method:"GET",response:n.Array(Ji)}),ib=d({description:"Retrieve a retention policy by its id",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${Xi}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:Ji}),Ou=n.Pick(vs,["env","teamId","dataSource","durationDays","isEnabled"]),zv={env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(Ou,{examples:[zv]});var ab=d({description:"Create a new retention policy",operationId:"createRetentionPolicy",tags:["retention-policies"],url:Xi,method:"POST",body:Ou,response:Ji}),sb=d({description:"Update a retention policy by its id",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${Xi}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:Ou,response:Ji}),pb=d({description:"Delete a retention policy by its id",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${Xi}/:id`,method:"DELETE",params:n.Object({id:c({allowEmpty:!1})}),response:v});var js={id:n.String({description:"Identifier of the processor"}),description:n.Optional(n.String()),tags:Ye,updatedAt:n.Optional(T())},Fs={id:c({allowEmpty:!1,description:"Identifier of the processor"}),description:n.Optional(c({type:"long"})),tags:mt,updatedAt:n.Optional(T())},Vv={...js,type:n.Literal("creator")},Yv={...Fs,type:n.Literal("creator")},Qv=b("subtype",[n.Object({targetAttribute:n.String({description:"Attribute that will receive the formatted value"}),formatString:n.String({description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean()),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean())},{$id:"ProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the computed value"}),formula:n.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean()),subtype:n.Literal("math-formula"),replaceMissingBy0:n.Optional(n.Boolean())},{$id:"ProcessorParamsCreatorMathFormula"})]),Wv=b("subtype",[n.Object({targetAttribute:c({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:c({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean())},{$id:"InputProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:c({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:c({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("math-formula"),replaceMissingBy0:n.Optional(n.Boolean())},{$id:"InputProcessorParamsCreatorMathFormula"})]),Zv=n.Object({...Vv,params:Qv}),Xv=n.Object({...Yv,params:Wv}),Jv={...js,type:n.Literal("mapper")},e1={...Fs,type:n.Literal("mapper")},t1=b("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:n.String({description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean()),overrideTarget:n.Optional(n.Boolean()),targetAttribute:n.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")},{$id:"ProcessorParamsMapperMapAttributes"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level")},{$id:"ProcessorParamsMapperMapLevel"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp")},{$id:"ProcessorParamsMapperMapTimestamp"})]),r1=b("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:c({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:c({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")},{$id:"InputProcessorParamsMapperMapAttributes"}),n.Object({attributeName:c({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level")},{$id:"InputProcessorParamsMapperMapLevel"}),n.Object({attributeName:c({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp")},{$id:"InputProcessorParamsMapperMapTimestamp"})]),n1=n.Object({...e1,params:r1}),o1=n.Object({...Jv,params:t1}),i1={...js,type:n.Literal("parse-attribute")},a1={...Fs,type:n.Literal("parse-attribute")},s1=5,p1=b("subtype",[n.Object({attributeName:n.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(n.String({description:"Grok rule applied to parse text"}),{description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(n.String(),{description:"Example log lines for validation"})),subtype:n.Literal("grok")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the URL to parse"}),subtype:n.Literal("url")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:n.String({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:n.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:n.String({description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean(),subtype:n.Literal("key-value")})]),m1=b("subtype",[n.Object({attributeName:c({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(c({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text"}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(c({type:"long"}),{maxItems:s1,description:"Example log lines for validation"})),subtype:n.Literal("grok")}),n.Object({sourceAttribute:c({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:n.Literal("url")}),n.Object({sourceAttribute:c({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent")}),n.Object({sourceAttribute:c({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:c({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:c({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:c({allowEmpty:!0,description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean(),subtype:n.Literal("key-value")})]),c1=n.Object({...i1,params:p1}),u1=n.Object({...a1,params:m1}),l1=11,mb=n.Cyclic({OutputProcessor:n.Union([o1,c1,Zv,n.Object({...js,params:n.Object({items:n.Array(n.Object({query:n.String({description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split")})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),cb=n.Cyclic({InputProcessor:n.Union([n1,u1,Xv,n.Object({...Fs,params:n.Object({items:n.Array(n.Object({query:c({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:l1,description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split")})])},"InputProcessor",{description:"Processing step executed sequentially on route logs"});var d1="/v0/logs",qr=`${d1}/routes`,Rn=n.Object({id:n.String({description:"Identifier of the log route"}),name:n.String({description:"Human readable name shown for the route"}),description:n.Optional(n.String()),isEnabled:n.Boolean(),query:n.String({description:"Query that selects which logs should enter the route"}),rank:n.Number(),tags:Ye,owner:n.String({description:"Team ID owning and managing the route"}),processors:n.Array(mb,{description:"Ordered processors applied to logs that match the route"}),creator:n.Optional(Se),updater:n.Optional(Se),updatedAt:T(),createdAt:T(),assetUpdatedAt:T()},{title:"Route"}),ea=n.Object({name:c({allowEmpty:!1,description:"Human readable name shown for the route"}),description:n.Optional(c({type:"long"})),isEnabled:n.Boolean(),query:c({type:"tsuga-query",description:"Query that selects which logs should enter the route"}),tags:mt,owner:c({allowEmpty:!1,description:"Team ID owning and managing the route"}),processors:n.Array(cb,{maxItems:50,description:"Ordered processors applied to logs that match the route"})}),Eje=d({tags:["routes"],url:qr,method:"GET",paginated:!0,query:n.Object(Ue),response:n.Array(Rn)}),Ije=d({tags:["routes"],url:`${qr}/:id`,params:n.Object({id:c()}),method:"GET",response:Rn}),Tje=d({tags:["routes"],url:qr,method:"POST",body:ea,response:Rn}),_je=d({tags:["routes"],url:`${qr}/:id`,method:"PUT",body:ea,params:n.Object({id:c()}),response:Rn}),hje=d({tags:["routes"],url:`${qr}/:id/clone`,method:"POST",params:n.Object({id:c()}),body:ea,response:Rn}),Oje=d({tags:["routes"],url:`${qr}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),Aje=d({tags:["routes"],url:`${qr}/:id/modify-ranking`,method:"PUT",params:n.Object({id:c()}),body:n.Object({rank:n.Number()}),response:n.Object({})}),Sje=d({tags:["routes"],url:`${qr}/:id/enable`,method:"PUT",params:n.Object({id:c()}),body:n.Object({enable:n.Boolean()}),response:n.Object({})});var ta=`/${"v1"}/routes`,ra=n.Pick(Rn,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Log route allowing to standardize logs and enrich them with additional data"}),f1={id:"123-456-abc",name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(ra,{examples:[f1]});var ub=d({description:"Retrieve all routes",operationId:"listRoutes",tags:["routes"],url:ta,method:"GET",paginated:!0,query:n.Object(Ue),response:n.Array(ra)}),lb=d({description:"Retrieve a route by its id",operationId:"getRoute",tags:["routes"],url:`${ta}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:ra}),Au=n.Pick(ea,["name","description","isEnabled","query","tags","owner","processors"]),g1={name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(Au,{examples:[g1]});var db=d({description:"Create a new route",operationId:"createRoute",tags:["routes"],url:ta,method:"POST",body:Au,response:ra}),fb=d({description:"Update a route by its id",operationId:"updateRoute",tags:["routes"],url:`${ta}/:id`,method:"PUT",body:Au,params:n.Object({id:c({allowEmpty:!1})}),response:ra}),gb=d({description:"Delete a route by its id",operationId:"deleteRoute",tags:["routes"],url:`${ta}/:id`,method:"DELETE",params:n.Object({id:c({allowEmpty:!1})}),response:v});var Cn=`${Wi}/tag-policies`;var yb=["ingestion-api-key","operation-api-key","dashboard","log-route","monitor","notification-rule","notification-silence","slo"],y1=["logs","metrics","traces"],Su=n.Array(n.Enum(yb)),bu=n.Array(n.Enum(y1)),E1=n.Union([Su,bu]),I1=n.Object({teamIds:n.Array(n.String()),mode:n.Enum(["include","exclude"])}),T1=b("type",[n.Object({type:n.Literal("telemetry"),assetTypes:bu,shouldInsertWarning:n.Boolean(),dropSample:n.Optional(n.Number())}),n.Object({type:n.Literal("tsuga_asset"),assetTypes:Su})]),_1=b("type",[n.Object({type:n.Literal("telemetry"),assetTypes:bu,shouldInsertWarning:n.Boolean(),dropSample:n.Optional(n.Number({minimum:0,maximum:100}))}),n.Object({type:n.Literal("tsuga_asset"),assetTypes:Su})]),xo=n.Object({id:n.String(),name:n.String(),description:n.Optional(n.String()),isActive:n.Boolean(),tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean(),teamScope:n.Optional(I1),configuration:T1,creator:n.Optional(Se),updater:n.Optional(Se),owner:n.Optional(n.String()),createdAt:T(),updatedAt:T(),assetUpdatedAt:T()});var na=n.Object({name:c(),description:n.Optional(c()),isActive:n.Boolean(),tagKey:c({allowEmpty:!1}),allowedTagValues:n.Array(c({allowEmpty:!1}),{maxItems:1e3}),isRequired:n.Boolean(),teamScope:n.Optional(n.Object({teamIds:n.Array(c(),{minItems:1,maxItems:100}),mode:n.Enum(["include","exclude"])})),configuration:_1,owner:c({allowEmpty:!1})}),vje=d({tags:["tag-policies"],url:Cn,method:"GET",query:n.Object({teamIds:n.Optional(n.Array(c(),{maxItems:100})),assetTypes:n.Optional(E1),searchQuery:n.Optional(c())}),response:n.Array(xo)}),jje=d({tags:["tag-policies"],url:`${Cn}/:id`,method:"GET",params:n.Object({id:c()}),response:xo}),Fje=d({tags:["tag-policies"],url:Cn,method:"POST",body:na,response:xo}),Bje=d({tags:["tag-policies"],url:`${Cn}/:id`,method:"PUT",params:n.Object({id:c()}),body:na,response:xo}),qje=d({tags:["tag-policies"],url:`${Cn}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),Hje=d({tags:["tag-policies"],url:`${Wi}/applicable-tag-rules`,method:"GET",query:n.Object({assetType:n.Enum(yb),teamId:c()}),response:n.Array(n.Object({tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean()}))}),Eb=n.Object({total:n.Number(),totalNonCompliant:n.Number(),idsNonCompliant:n.Array(n.String())}),Ib=n.Union([n.Literal("ingestion-api-key"),n.Literal("operation-api-key"),n.Literal("dashboard"),n.Literal("log-route"),n.Literal("monitor"),n.Literal("notification-rule"),n.Literal("notification-silence"),n.Literal("slo")]),h1=n.Object({total:n.Number(),totalNonCompliant:n.Number(),byAssetType:n.Record(Ib,Eb)}),O1=n.Omit(Eb,["total"]),A1=n.Object({totalNonCompliant:n.Number(),byAssetType:n.Record(Ib,O1)}),Tb=n.Object({totals:h1,byTeam:n.Record(n.String(),A1)}),Kje=d({tags:["tag-policies"],url:`${Cn}/:id/stats`,method:"GET",params:n.Object({id:c()}),response:Tb}),zje=d({tags:["tag-policies"],url:`${Cn}/new-policy-stats`,method:"POST",body:na,response:Tb});var oa=`/${"v1"}/tag-policies`,Bs=n.Pick(xo,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga assets or telemetry data"}),_b=n.Pick(na,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"]),hb=d({description:"Retrieve all tag policies",operationId:"listTagPolicies",tags:["tag-policies"],url:oa,method:"GET",response:n.Array(Bs)}),Ob=d({description:"Retrieve a tag policy by its id",operationId:"getTagPolicy",tags:["tag-policies"],url:`${oa}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:Bs}),Ab=d({description:"Create a new tag policy",operationId:"createTagPolicy",tags:["tag-policies"],url:oa,method:"POST",body:_b,response:Bs}),Sb=d({description:"Update a tag policy by its id",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${oa}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:_b,response:Bs}),bb=d({description:"Delete a tag policy by its id",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${oa}/:id`,method:"DELETE",params:n.Object({id:c({allowEmpty:!1})}),response:v});var ia=`/${"v1"}/teams`,aa=n.Pick(Eo,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership and access to resources"}),S1={id:"abc-123-def",name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(aa,{examples:[S1]});var xb=d({description:"Retrieve all teams",operationId:"listTeams",tags:["teams"],url:ia,method:"GET",paginated:!0,query:n.Object(Ue),response:n.Array(aa)}),Rb=d({description:"Retrieve a team by its id",operationId:"getTeam",tags:["teams"],url:`${ia}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:aa}),xu=n.Pick(hs,["name","description","visibility","tags"]),b1={name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(xu,{examples:[b1]});var Cb=d({description:"Create a new team",operationId:"createTeam",tags:["teams"],url:ia,method:"POST",body:xu,response:aa}),Pb=d({description:"Update a team by its id",operationId:"updateTeam",tags:["teams"],url:`${ia}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:xu,response:aa}),Ub=d({description:"Delete a team by its id",operationId:"deleteTeam",tags:["teams"],url:`${ia}/:id`,method:"DELETE",params:n.Object({id:c({allowEmpty:!1})}),response:v});function Ru(e){let t=e.params;if(t?.properties){let r=Object.keys(t.properties);if(r.length===1&&r[0])return r[0]}return"id"}function Nb(e,t,r){let o=e.command(t.commandName).description(t.description),i=iS(t.commandName).replace(/-/g," "),s=o.command("list").description(`List all ${t.commandName}`);if(t.listOptions)for(let m of t.listOptions)s.option(m.flag,m.description);if(t.enableListBody?s.option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async m=>{if(m.generateSkeleton){oe(fo(t.endpoints.list));return}let u=await r()(t.endpoints.list,{body:m.data?go({data:m.data}):{}});oe(u)}):s.action(async m=>{let u={};if(t.listOptions)for(let g of t.listOptions){let E=m[g.queryParam];E!==void 0&&(u[g.queryParam]=E)}let l=await r()(t.endpoints.list,Object.keys(u).length>0?{query:u}:void 0);oe(l)}),t.endpoints.get){let m=t.endpoints.get,u=Ru(m);o.command("get <id>").description(`Get a ${i} by ID`).action(async l=>{let g=await r()(m,{params:{[u]:l}});oe(g)})}if(t.endpoints.create){let m=t.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async u=>{if(u.generateSkeleton){oe(fo(m));return}let l=go(u),g=await r()(m,{body:l});oe(g)})}if(t.endpoints.update){let m=t.endpoints.update,u=Ru(m);o.command("update <id>").description(`Update a ${i} by ID`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async(l,g)=>{if(g.generateSkeleton){oe(fo(m));return}let E=go(g),I=await r()(m,{params:{[u]:l},body:E});oe(I)})}if(t.endpoints.delete){let m=t.endpoints.delete,u=Ru(m);o.command("delete <id>").description(`Delete a ${i} by ID`).action(async l=>{let g=await r()(m,{params:{[u]:l}});oe(g)})}}var x1=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:rS}},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:vA,get:jA,create:FA,update:BA,delete:qA},listOptions:[{flag:"--owners <ids...>",description:"Filter by owner team IDs",queryParam:"owners"}]},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:YA,create:QA,update:WA,delete:ZA}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:AS,get:SS,create:US,update:NS,delete:LS},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:GS,get:vS,create:jS,update:FS,delete:BS}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:zS,get:VS,create:QS,update:WS,delete:ZS}},{commandName:"quality-reports",description:"Manage quality reports",endpoints:{list:eb}},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:ob,get:ib,create:ab,update:sb,delete:pb}},{commandName:"routes",description:"Manage routes",endpoints:{list:ub,get:lb,create:db,update:fb,delete:gb}},{commandName:"services",description:"Manage services",endpoints:{list:fA,get:gA}},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:hb,get:Ob,create:Ab,update:Sb,delete:bb}},{commandName:"teams",description:"Manage teams",endpoints:{list:xb,get:Rb,create:Cb,update:Pb,delete:Ub}}];function Lb(e,t){for(let r of x1)Nb(e,r,t)}var qs="/v0/logs";var sa=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var R1=0,C1=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String()),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String()))},{additionalProperties:!0})),message:n.Optional(n.Unknown()),timestamp:n.Number(),level:n.Enum(sa)},{additionalProperties:!0});var P1="log_timestamp",U1=n.Union([n.Literal(P1)]),Pn={...ft.properties,query:n.Optional(c({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e3})),shouldRecommendAttributes:n.Optional(n.Boolean()),defaultAttributesToHighlight:n.Optional(n.Array(c(),{maxItems:50})),triggeredBy:n.Optional(n.Literal("refresh")),startOffset:n.Optional(n.Number({minimum:R1})),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."})),sortBy:n.Optional(U1),sortDirection:n.Optional(n.Union([n.Literal("asc"),n.Literal("desc")]))},NFe=d({tags:["logs"],url:`${qs}/count`,method:"GET",query:n.Pick(n.Object(Pn),["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),Cu=n.Object({value:n.String(),priority:n.Number()}),LFe=d({tags:["logs"],url:`${qs}/search`,method:"GET",query:n.Object(Pn),response:n.Object({logs:n.Optional(n.Array(C1)),attributesToHighlight:n.Optional(n.Array(Cu))},{additionalProperties:!0})}),Pu=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),N1=n.Object({id:n.String(),pattern:n.Array(Pu),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),kFe=d({tags:["logs"],url:`${qs}/patterns`,method:"GET",query:n.Object({...ft.properties,query:c({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(c({allowEmpty:!1}))}),response:n.Object({patterns:n.Array(N1),sampleSize:n.Number()})}),MFe=d({tags:["logs"],url:`${qs}/attributes`,method:"GET",query:n.Object({...ft.properties,clusterId:n.Optional(c({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({attributes:n.Array(n.String())})});var pa=`/${"v1"}/logs`,Uu=n.Object({context:n.Optional(n.Object({team:n.Optional(n.String())},{additionalProperties:!0,$id:"LogContext"})),message:n.Optional(n.Unknown()),timestamp:n.Number(),level:n.Enum(sa)},{additionalProperties:!0,$id:"LogEvent"}),L1={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(Uu,{examples:[L1]});var k1={query:"level:ERROR",maxResults:100,from:1704067200,to:1704067200},kb=n.Object({...n.Pick(n.Object(Pn),["query","maxResults","clusterId"]).properties,...gt.properties});Object.assign(kb,{examples:[k1]});var Mb=d({description:"Search logs",operationId:"searchLogs",tags:["public","logs"],url:`${pa}/search`,method:"GET",query:kb,response:n.Object({logs:n.Array(Uu)})}),M1=n.Object({pattern:n.Array(Pu),size:n.Integer({description:"Number of logs that matched the pattern"}),groups:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),wb=n.Object({patterns:n.Array(M1),sampleSize:n.Number()}),w1={patterns:[{pattern:[{type:"text",value:"Resolved"},{type:"text",value:" "},{type:"text",value:"segment"},{type:"text",value:" "},{type:"text",value:"SegmentId("},{type:"range",min:0,max:1},{type:"text",value:")"},{type:"text",value:" "},{type:"text",value:"from"},{type:"text",value:" "},{type:"text",value:"cache"}],size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(wb,{examples:[w1]});var $b=d({description:"Get log patterns",operationId:"getLogPatterns",tags:["public","logs"],url:`${pa}/patterns`,method:"GET",query:n.Object({...gt.properties,query:c({type:"tsuga-query"}),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:wb}),$1=n.Object({exampleLog:n.Optional(Uu),team:n.String(),env:n.String(),service:n.String(),firstSeen:n.Number({description:"Timestamp in milliseconds when this pattern was first seen"}),lastSeen:n.Number({description:"Timestamp in milliseconds when this pattern was last seen"})}),Db=n.Object({newErrorPatterns:n.Array($1)}),D1={newErrorPatterns:[{team:"platform",env:"production",service:"api-gateway",firstSeen:17040672e5,lastSeen:17041536e5,exampleLog:{message:"ConnectionError: Failed to connect to database",timestamp:17041536e5,level:"ERROR"}}]};Object.assign(Db,{examples:[D1]});var Gb=d({description:"Get new error patterns",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${pa}/patterns/new`,method:"GET",query:n.Object({...gt.properties,team:n.Optional(c()),env:n.Optional(c()),service:n.Optional(c()),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:Db}),G1=n.Object({team:n.String(),env:n.String(),pattern:n.String({description:"The error pattern formatted"}),increaseTimestamps:n.Array(n.Number({description:"Timestamps in milliseconds when there were increases in this pattern"}))}),vb=n.Object({errorPatternIncreases:n.Array(G1)}),v1={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(vb,{examples:[v1]});var jb=d({description:"Get error pattern increases for a given team",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${pa}/patterns/increase`,method:"GET",query:n.Object({...gt.properties,team:c(),env:n.Optional(c()),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:vb}),Fb=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})}),j1={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(Fb,{examples:[j1]});var F1=n.Object({...gt.properties,clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),Bb=d({description:"Get log attributes",operationId:"getLogAttributes",tags:["public","logs"],url:`${pa}/attributes`,method:"GET",query:F1,response:Fb});var dr="/v0/metrics",B1=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(sa)},{additionalProperties:!0}),YFe=d({tags:["metrics"],url:`${dr}/count`,method:"GET",query:n.Pick(n.Object(Pn),["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),QFe=d({tags:["metrics"],url:`${dr}/search`,method:"GET",query:n.Object(Pn),response:n.Object({logs:n.Optional(n.Array(B1)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(Cu))},{additionalProperties:!0})}),Hs=n.Enum(["counter","gauge","histogram","summary"]),Nu=n.Enum(["delta","cumulative","none"]),q1=n.Object({capabilities:n.Optional(n.Array(n.String())),description:n.Optional(n.String()),tags:n.Optional(n.Array(n.String())),temporality:n.Optional(Nu),type:n.Optional(Hs),unit:n.Optional(n.String())}),WFe=d({url:`${dr}/metadata`,method:"GET",query:n.Object({...ft.properties,metricName:c({allowEmpty:!1}),clusterId:n.Optional(c({allowEmpty:!1,description:"Cluster ID"}))}),response:q1}),ZFe=d({tags:["metrics"],url:dr,method:"GET",query:n.Object({...ft.properties,clusterId:n.Optional(c({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),Lu=n.Array(n.Object({name:n.String(),type:Hs}),{description:"List of metric names and their types"}),XFe=d({tags:["metrics"],url:`${dr}/names-and-types`,method:"GET",query:n.Object({...ft.properties,clusterId:n.Optional(c({allowEmpty:!1,description:"Cluster ID"}))}),response:Lu}),Ks=n.Array(n.String(),{description:"List of attribute names"}),JFe=d({tags:["metrics"],url:`${dr}/attributes`,method:"GET",query:n.Object({...ft.properties,metricName:c({allowEmpty:!1}),clusterId:n.Optional(c({allowEmpty:!1,description:"Cluster ID"}))}),response:Ks}),eBe=d({tags:["metrics"],url:`${dr}/attributes/batch`,method:"GET",query:n.Object({...ft.properties,metricNames:n.Array(c({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(c({allowEmpty:!1,description:"Cluster ID"}))}),response:Ks}),ku=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"]),id:n.String(),name:n.String(),owner:n.String()},{description:"An asset that uses a metric"}),{description:"List of assets (dashboards and monitors) using this metric"})}),tBe=d({tags:["metrics"],url:`${dr}/assets-usage`,method:"GET",query:n.Object({metricName:c({allowEmpty:!1})}),response:ku}),rBe=d({url:`${dr}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:c(),clusterId:n.Optional(c({allowEmpty:!1}))}),response:n.Array(n.String())});var Mu=`/${"v1"}/metrics`,H1=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(Lu,{examples:[H1]});var wu=n.Object({name:n.String({description:"Name of the metric"}),type:Hs,description:n.Optional(n.String({description:"Human-readable description of the metric"})),unit:n.Optional(n.String({description:"Unit of the metric"})),temporality:n.Optional(Nu),capabilities:n.Optional(n.Array(n.String(),{description:"Supported capabilities, an empty array means all capabilities are supported"})),attributes:n.Optional(n.Array(n.String(),{description:"Metric attributes"}))}),K1={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"]};Object.assign(wu,{examples:[K1]});var qb=n.Object({...gt.properties,clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),Hb=d({description:"Get all metrics with their metadata",operationId:"listMetrics",tags:["public","metrics"],url:Mu,method:"GET",query:qb,response:n.Array(wu)}),Kb=d({description:"Retrieve a metric by name with its metadata",operationId:"getMetric",tags:["public","metrics"],url:`${Mu}/:name`,method:"GET",params:n.Object({name:c({allowEmpty:!1,description:"The metric name"})}),query:qb,response:wu}),z1=["service","env","host","method","status_code"];Object.assign(Ks,{examples:[z1]});var zb=n.Pick(ku,["assets"]),V1={assets:[{type:"dashboard",id:"dash-123-abc",name:"API Performance Overview",owner:"user-456-def"},{type:"monitor",id:"mon-789-ghi",name:"High Latency Alert",owner:"user-456-def"}]};Object.assign(zb,{examples:[V1]});var Vb=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${Mu}/assets-usage`,method:"GET",query:n.Object({metricName:c({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:zb});var Y1=`/${"v1"}/traces`,Yb=n.Object({context:n.Optional(n.Object({service:n.Optional(n.Object({name:n.Optional(n.String()),version:n.Optional(n.String())},{additionalProperties:!0}))},{additionalProperties:!0})),parentSpanId:n.Optional(n.String()),resourceAttributes:n.Object({},{additionalProperties:!0}),spanAttributes:n.Object({},{additionalProperties:!0}),duration:n.Number({description:"In milliseconds."}),startTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),endTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:n.Optional(n.Object({message:n.String()})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0}),event_name:n.String(),event_timestamp_nanos:n.String()}))),spanId:n.String(),span:n.Object({kind:n.String(),name:n.String()}),statusCode:n.Optional(n.String()),traceId:n.String()},{additionalProperties:!0,$id:"SpanEvent"}),Q1={context:{service:{name:"my-service",version:"1.0.0"}},parentSpanId:"187a47da1b2560f8",resourceAttributes:{},spanAttributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,startTime:"1770923469995353600",endTime:"1770923470019349500",spanId:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},statusCode:"ok",traceId:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(Yb,{examples:[Q1]});var W1={from:1704067200,to:1704067200,query:"context.service.name:my-service",maxResults:100},Qb=n.Object({...gt.properties,query:n.Optional(c({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4})),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))});Object.assign(Qb,{examples:[W1]});var Wb=d({description:"Search spans",operationId:"searchSpans",tags:["public","traces"],url:`${Y1}/search`,method:"GET",query:Qb,response:n.Object({spans:n.Array(Yb)})});var Xb=["timestamp","level","message"];function yt(e,t){let r=t??pr(e);if(!r)throw new Error(`--${e} is required`);return ps(r)}function Zb(e){let t={from:yt("from",e.from),to:yt("to",e.to)},r=e.query??pr("query");r!==void 0&&(t.query=r);let o=e.maxResults??pr("max-results");if(o!==void 0){let i=Number(o);if(Number.isNaN(i))throw new Error(`--max-results must be a number (got: ${o})`);t.maxResults=i}return t}function Le(e){let t=pr(e);return t===void 0?"":` (default: ${t})`}function Z1(e){let t=OT(e.output),r=e.fields===void 0?void 0:AT(e.fields);return t==="json"?{format:t,fields:r}:{format:t,fields:r??Xb}}function X1(e,t){if(t.format==="json"){if(t.fields===void 0){oe(e);return}let{fields:o}=t;oe({logs:e.logs.map(i=>bT(i,o))});return}let r=RT(t.format,e.logs,t.fields);r.length>0&&mm(r)}function Jb(e,t){let r=e.command("logs").description("Search and analyze logs");r.command("search").description("Search logs").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).option("--query <query>",`Search query${Le("query")}`).option("--max-results <n>",`Maximum number of results${Le("max-results")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${Xb.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async m=>{let u=Z1(m),l=await t()(Mb,{query:Zb(m)});X1(l,u)}),r.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).action(async m=>{let u=await t()(Bb,{query:{from:yt("from",m.from),to:yt("to",m.to)}});oe(u)}),r.command("patterns").description("List log patterns").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).option("--query <query>",`Search query${Le("query")}`).action(async m=>{let u={from:yt("from",m.from),to:yt("to",m.to)},l=m.query??pr("query");l!==void 0&&(u.query=l);let g=await t()($b,{query:u});oe(g)}),r.command("new-error-patterns").description("List new error patterns").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).option("--team <team>","Filter by team").option("--env <env>","Filter by environment").option("--service <service>","Filter by service").action(async m=>{let u={from:yt("from",m.from),to:yt("to",m.to)};m.team!==void 0&&(u.team=m.team),m.env!==void 0&&(u.env=m.env),m.service!==void 0&&(u.service=m.service);let l=await t()(Gb,{query:u});oe(l)}),r.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).requiredOption("--team <team>","Team to query").option("--env <env>","Filter by environment").action(async m=>{let u={from:yt("from",m.from),to:yt("to",m.to),team:m.team};m.env!==void 0&&(u.env=m.env);let l=await t()(jb,{query:u});oe(l)});let o=e.command("metrics").description("List and inspect metrics");o.command("list").description("List all metrics with their metadata").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).action(async m=>{let u=await t()(Hb,{query:{from:yt("from",m.from),to:yt("to",m.to)}});oe(u)}),o.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).action(async(m,u)=>{let l=await t()(Kb,{params:{name:m},query:{from:yt("from",u.from),to:yt("to",u.to)}});oe(l)}),o.command("assets-usage <name>").description("List dashboards and monitors that use a specific metric").action(async m=>{let u=await t()(Vb,{query:{metricName:m}});oe(u)}),e.command("traces").description("Search traces").command("search").description("Search spans").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).option("--query <query>",`Search query${Le("query")}`).option("--max-results <n>",`Maximum number of results${Le("max-results")}`).action(async m=>{let u=await t()(Wb,{query:Zb(m)});oe(u)});let s=e.command("aggregation").description("Run aggregation queries");Pi(s,"scalar","Run aggregation queries and return scalar results",l_,t),Pi(s,"timeseries","Run aggregation queries and return timeseries results",d_,t)}var J1=3e3,ej="https://registry.npmjs.org/@tsuga/cli/latest";function tj(e,t){let r=e.split(".").map(Number),o=t.split(".").map(Number);for(let i=0;i<Math.max(r.length,o.length);i++){let s=r[i]??0,m=o[i]??0;if(s>m)return!0;if(s<m)return!1}return!1}async function ex(e){try{let t=AA();if(t&&Date.now()-t<ss)return;let r=await fetch(ej,{signal:AbortSignal.timeout(J1)});if(!r.ok)return;let i=(await r.json()).version;tj(i,e)&&(process.stderr.write(`
44
+ -----END PRIVATE KEY-----`,isUsingLuhnAlgorithm:!1,regexp:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[ \\r\\n\\t\\f\\v\\S-]{64,}?KEY(?: BLOCK)?-----"},{key:"pulumi_api_token",name:"Pulumi API token",category:"credential",example:"pul-b77e6bff9fddebbc2bb8eca94e3f29a41f6da70a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pul-[a-f0-9]{40})"},{key:"pypi_upload_token",name:"PyPI upload token",category:"credential",example:"pypi-AgEIcHlwaS5vcmc128fd9e0b47dde39cfecad3a997273458e6392f6aac649ae38864bdd7ff12836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)pypi-AgEIcHlwaS5vcmc[a-zA-Z0-9_-]{50}"},{key:"rapidapi_access_token",name:"RapidAPI access token",category:"credential",example:"g4x40h94pi_-zlklfz3-qvhiiu5zankyrqqwmsl60decihbqvl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{50})"},{key:"readme_api_token",name:"ReadMe API token",category:"credential",example:"rdme_k38kau741xa5lw03mdkvcd4vn6s6hdhvhg1wxa4ls7dp8h58r0yxq65nsqwndn056pxsc4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rdme_[a-z0-9]{70})"},{key:"rubygems_api_token",name:"RubyGems API token",category:"credential",example:"rubygems_7790aaa8102395704a64594a11f6de4941a27f86bc3fc9d4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rubygems_[a-f0-9]{48})"},{key:"scalingo_api_token",name:"Scalingo API token",category:"credential",example:"tk-us-4fhmqrg-rl4416b3oij_qx3q284wbhbqpk7r3te4r14lafou",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:tk-us-[a-zA-Z0-9_-]{48})"},{key:"sendbird_access_id",name:"SendBird access ID",category:"credential",example:"7e7801fd-c25d-50ab-a723-01b94c8d6c5f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sendbird_access_token",name:"SendBird access token",category:"credential",example:"305f75f04e3afa65360c25d9944fdae91138328d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{40})"},{key:"sendgrid_api_token",name:"SendGrid API token",category:"credential",example:"SG.--ed-fvdeffijnle7575jp1sh24wq_9y9hcjua5w3dnqh5-wyegkpzenziy1_qr=hf",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:SG\\.[a-z0-9=_\\-\\.]{66})"},{key:"sendinblue_api_token",name:"Sendinblue API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:xkeysib-[a-f0-9]{64}\\-[a-z0-9]{16})"},{key:"sentry_access_token",name:"Sentry access token",category:"credential",example:"1ad463398f40a52bb94a3795762f4003d51b03b8a788cba55e3a81de81c72940",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"sentry_org_token",name:"Sentry org token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)sntrys_eyJpYXQiO[a-zA-Z0-9+/]{10}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\\z)"},{key:"sentry_user_token",name:"Sentry user token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sntryu_[a-f0-9]{64})"},{key:"settlemint_application_access_token",name:"Settlemint application access token",category:"credential",example:"sm_aat_gshgzsv353m5yb9s",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_aat_[a-zA-Z0-9]{16})"},{key:"settlemint_personal_access_token",name:"Settlemint personal access token",category:"credential",example:"sm_pat_1yhza49gsle0trg8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_pat_[a-zA-Z0-9]{16})"},{key:"settlemint_service_access_token",name:"Settlemint service access token",category:"credential",example:"sm_sat_cha543e6lb19llli",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_sat_[a-zA-Z0-9]{16})"},{key:"shippo_api_token",name:"Shippo API token",category:"credential",example:"shippo_live_1d0f80d04e7788c1edb8fc2b8076bbf8f59b84b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:shippo_(?:live|test)_[a-fA-F0-9]{40})"},{key:"shopify_access_token",name:"Shopify access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpat_[a-fA-F0-9]{32}"},{key:"shopify_custom_access_token",name:"Shopify custom access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpca_[a-fA-F0-9]{32}"},{key:"shopify_private_app_access_token",name:"Shopify private app access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shppa_[a-fA-F0-9]{32}"},{key:"shopify_shared_secret",name:"Shopify shared secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpss_[a-fA-F0-9]{32}"},{key:"sidekiq_secret",name:"Sidekiq secret",category:"credential",example:"aa8d3915:64fb5cb5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{8}:[a-f0-9]{8})"},{key:"sidekiq_sensitive_url",name:"Sidekiq sensitive URL",category:"credential",example:"https://cafebabe:deadbeef@gems.contribsys.com/",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https?://(?:[a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)"},{key:"slack_bot_token",name:"Slack bot token",category:"credential",example:"xoxb-781236542736-2364535789652-GkwFDQoHqzXDVsC6GzqYUypD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*"},{key:"slack_user_token",name:"Slack user token",category:"credential",example:"xoxp-41684372915-1320496754-45609968301-e708ba56e1517a99f6b5fb07349476ef",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}"},{key:"slack_app_token",name:"Slack app token",category:"credential",example:"xapp-1-A052FGTS2DL-5171572773297-610b6a11f4b7eb819e87b767d80e6575a3634791acb9a9ead051da879eb5b55e",isUsingLuhnAlgorithm:!1,regexp:"xapp-[0-9]-[A-Z0-9]+-[0-9]+-[a-z0-9]+"},{key:"slack_config_access_token",name:"Slack config access token",category:"credential",example:"xoxe.xoxp-1-Mi0yLTM0MTQwNDE0MDE3Ni0zNjU5NDY0Njg4MTctNTE4MjA3NTQ5NjA4MC01NDEyOTYyODY5NzUxLThhMTBjZmI1ZWIzMGIwNTg0ZDdmMDI5Y2UxNzVlZWVhYzU2ZWQyZTZiODNjNDZiMGUxMzRlNmNjNDEwYmQxMjQ",isUsingLuhnAlgorithm:!1,regexp:"xoxe.xox[bp]-[0-9]-[A-Z0-9]{50}"},{key:"slack_config_refresh_token",name:"Slack config refresh token",category:"credential",example:"xoxe-1-My0xLTMxNzcwMjQ0MTcxMy01MTU4MTUyNjkxNzE0LTUxODE4NDI0MDY3MzYtMjA5MGFkOTFlZThkZWE2OGFlZDYwYWJjODNhYzAxYjA5ZjVmODBhYjgzN2QyNDdjOTNlOGY5NTg2YWM1OGM4Mg",isUsingLuhnAlgorithm:!1,regexp:"xoxe-[0-9]-[A-Z0-9]{50}"},{key:"slack_legacy_bot_token",name:"Slack legacy bot token",category:"credential",example:"xoxb-263594206564-FGqddMF8t08v8N7Oq4i57vs1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}"},{key:"slack_legacy_workspace_token",name:"Slack legacy workspace token",category:"credential",example:"xoxa-2-511111111-31111111111-3111111111111-e039d02840a0b9379c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[ar]-(?:[0-9]-)?[0-9a-zA-Z]{8,48}"},{key:"slack_legacy_token",name:"Slack legacy token",category:"credential",example:"xoxs-416843729158-132049654-5609968301-e708ba56e1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[os]-[0-9]+-[0-9]+-[0-9]+-[a-fA-F0-9]+"},{key:"slack_webhook_url",name:"Slack webhook URL",category:"credential",example:"hooks.slack.com/services/z6cvbfngk3h7i0vts4akmbxidtb8o3b4pq2sbbd6o86g",isUsingLuhnAlgorithm:!1,regexp:"(?:https?://)?hooks.slack.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}"},{key:"snyk_api_token",name:"Snyk API token",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sonar_api_token",name:"Sonar API token",category:"credential",example:"12345678ABCDEFH1234567890ABCDEFH12345678",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:(?:squ_|sqp_|sqa_)?[a-z0-9=_-]{40})"},{key:"stripe_access_token",name:"Stripe access token",category:"credential",example:"sk_test_cyge9m4s1kxiqdkszz0a57nyx6wk73",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})"},{key:"square_access_token",name:"Square access token",category:"credential",example:"sq0atp-OQUxovdrj3tfFpSd66r3sY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:EAAA|sq0atp-)[a-zA-Z0-9_-]{22,60})"},{key:"squarespace_access_token",name:"Squarespace access token",category:"credential",example:"86447eab-140f-2563-3572-bb016dafd692",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sumologic_access_id",name:"SumoLogic access ID",category:"credential",example:"suJS4ZsaD5bQTt",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:su[a-zA-Z0-9]{12})"},{key:"sumologic_access_token",name:"SumoLogic access token",category:"credential",example:"1xohkwr8lpvm4osygkpe5zbd16c3376ver2qed1bssuko4uy4tij1bnf4dnwy7o4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"microsoft_teams_webhook",name:"Microsoft Teams webhook URL",category:"credential",example:"https://mycompany.webhook.office.com/webhookb2/767lrnj6-okh8-dnh8-jey2-y2iteohrwz75@6igi6oz6-ud9w-wior-2zva-5vx0wp6wuiqk/IncomingWebhook/o1zox92ssprrppjtnvcjqq0q09k2wnc3/qwox5p9d-x4zr-3yis-t1on-s67zj50tmyht",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https://[a-z0-9]+\\.webhook\\.office\\.com/webhookb2/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}"},{key:"telegram_bot_api_token",name:"Telegram bot API token",category:"credential",example:"59015865:A12o5wu6f78zofs0udypf9ti23u82g-qkfz",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{5,16}:(?-i:A)[a-z0-9_\\-]{34})"},{key:"travisci_access_token",name:"Travis CI access token",category:"credential",example:"zjgfo5fhshd5c60hpz22wh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{22})"},{key:"twilio_api_key",name:"Twilio API key",category:"credential",example:"SKa585fd034fcd16cdd741f7df9b57fb3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)SK[0-9a-fA-F]{32}"},{key:"twitch_api_token",name:"Twitch API token",category:"credential",example:"1hm9gcychlkpf93jdjnwdu0uaamu6d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"twitter_api_key",name:"Twitter API key",category:"credential",example:"m8zqu4etx07bjt7tyeacc6pox",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"twitter_api_secret",name:"Twitter API secret",category:"credential",example:"7f4gxkubw9qs346ik99zk3z8b6kk3d7g8toi7zujgvgbt8q0yv",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{50})"},{key:"twitter_access_token",name:"Twitter access token",category:"credential",example:"465616696186918-96B1NCD5CH0uyi7zUHiS",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{15,25}-[a-zA-Z0-9]{20,40})"},{key:"twitter_access_secret",name:"Twitter access secret",category:"credential",example:"vyuo5peybdzznr7z0ua5wamhogusans4m29uzi25w4jgj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{45})"},{key:"twitter_bearer_token",name:"Twitter bearer token",category:"credential",example:"AAAAAAAAAAAAAAAAAAAAAAWRGWFGlfwyqNrrIa3pewqNNLX0jQMj2sR6M2cZUfBdqXDtkt7Nsb56F4tCz7Pt8ujbosrLxnRqYgwI0b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:A{22}[a-zA-Z0-9%]{80})"},{key:"typeform_api_token",name:"Typeform API token",category:"credential",example:"tfp_o-nsn=6eg2ios=4g652xhf933qor4jj7ort2qh_uw_5jdsuffp31ln=e-2a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:tfp_[a-z0-9\\-_\\.=]{59})"},{key:"vault_batch_token",name:"Vault batch token",category:"credential",example:"hvb.x84j4cl53mzvhvb1nfc3mfi721gh5i-92f96lt0gns5lpksfu5f0199j-gw4ycxg6au4ser86mczcr_nx6ur2elbpazfrybo80fxjv3bghxshml3g261l6qi03yrz03qup84jk-fc2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hvb\\.[a-zA-Z0-9_-]{50})"},{key:"vault_service_token",name:"Vault service token",category:"credential",example:"s.8QH9knZV94f0IjBZismfOPD0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:hvs\\.[a-zA-Z0-9_-]{90}|s\\.(?i:[a-z0-9]{24})))"},{key:"yandex_api_key",name:"Yandex API key",category:"credential",example:"AQVN9wiAh8pyz3lmB5WTo_KUuPDXlxtzkA5-YFG",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:AQVN[A-Za-z0-9_\\-]{35,38})"},{key:"yandex_aws_access_token",name:"Yandex AWS access token",category:"credential",example:"YCZ6DHVrZONPNtgwWLZPrIGyviSrudRVSr8w0b1S",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:YC[a-zA-Z0-9_\\-]{38})"},{key:"yandex_access_token",name:"Yandex access token",category:"credential",example:"t1.L=.WJ9CYVI5eeLkTOrMM_dgaPgdmpen48R8RYsL4VJqelVKDmrqYsSHkH6QyVVhJkuHSQFTd0NOhClEDyCz7eEbh5=",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})"},{key:"zendesk_secret_key",name:"Zendesk secret key",category:"credential",example:"iydgm2jofftb2xu7niv55qnfxdwbwmqt2s561bgc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"infracost_api_token",name:"Infracost API token",category:"credential",example:"ico-fNZw8jjy6TugMUHKWX4l9iSP3i95SPNH",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ico-[a-zA-Z0-9]{32})"},{key:"iban",name:"Iban",category:"financial-data",example:"FR7630006000011234567890189",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{11,30}(?-u:\\b)"},{key:"aikido_token",name:"Aikido token",category:"credential",example:"AIK_SECRET_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_SECRET_[A-Za-z0-9]{64}"},{key:"aikido_ci_token",name:"Aikido CI secret",category:"credential",example:"AIK_CI_US_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_CI_(US_|ME_)?[A-Za-z0-9]{64}"},{key:"tsuga_ingestion_key",name:"Tsuga ingestion key",category:"credential",example:"tsuga_in:v1:OUvrwavCG//ixL08HEds9OAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_in:v1:[A-Za-z0-9+/]{24}"},{key:"tsuga_operation_key",name:"Tsuga operation key",category:"credential",example:"tsuga_op:v1:zz3-LWv-sLy:0k7Skt255M0yXe/ZLBoiSamb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_op:v1:[A-Za-z0-9_-]+:[A-Za-z0-9+/]{24}"}],Gv=LS.map(e=>e.key),bve=new Set(Gv),xve=LS.map(e=>e.key);function kS(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var vv=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","alert_previous_status","alert_priority","alert_query","alert_start_time","alert_status","alert_tags","alert_threshold","alert_timeframe","alert_title","alert_transition","alert_triggered_by","alert_value","dashboard_url","monitor_url"],jv=["alert_event_name","alert_message"],Wve=[...vv,...jv];var Fv=["all","owning-team-and-public","owning-team-only"],Nu=n.Enum(Fv,{description:"This controls which data the resource can see"});var Ut="/v0/monitors",$o=["alert","resolve","keep_last_status","consider_zero"],zs=["alert","resolve","keep_last_status"];var MS=["no_aggregation","all","any","each","proportion"],$S=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var Bv=n.Object({formula:n.String(),operator:n.Enum($S),threshold:n.Number()}),qv=n.Object({formula:m({type:"tsuga-formula"}),operator:n.Enum($S),threshold:n.Number()}),Lu=n.Array(Bv),ku=n.Array(qv),DS=n.Object({formula:n.String(),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"])}),GS=n.Object({formula:m({type:"tsuga-formula"}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"])}),j1e=n.Enum(["rate","error","cpu","general"]),Pt=[1,2,3,4,5];var Qi={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(n.String(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(MS)),proportionAlertThreshold:n.Optional(n.Integer())},Wi={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(m(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{maxItems:1,description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(MS)),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99}))},vS=n.Object({type:n.Literal("metric"),conditions:Lu,noDataBehavior:n.Enum($o),...Qi,queries:yo},{$id:"MonitorConfigurationMetric"}),jS=n.Object({type:n.Literal("metric"),conditions:ku,noDataBehavior:n.Enum($o),...Wi,queries:Eo},{$id:"InputMonitorConfigurationMetric"}),FS=n.Object({type:n.Literal("log"),conditions:Lu,noDataBehavior:n.Enum($o),...Qi,queries:yo},{$id:"MonitorConfigurationLog"}),BS=n.Object({type:n.Literal("log"),conditions:ku,noDataBehavior:n.Enum($o),...Wi,queries:Eo},{$id:"InputMonitorConfigurationLog"}),qS=n.Object({type:n.Literal("trace"),conditions:Lu,noDataBehavior:n.Enum($o),...Qi,queries:yo},{$id:"MonitorConfigurationTrace"}),Hv=n.Object({type:n.Literal("trace"),conditions:ku,noDataBehavior:n.Enum($o),...Wi,queries:Eo},{$id:"InputMonitorConfigurationTrace"}),HS=n.Object({type:n.Literal("anomaly-log"),condition:DS,noDataBehavior:n.Enum(zs),...Qi,queries:yo},{$id:"MonitorConfigurationAnomalyLog"}),KS=n.Object({type:n.Literal("anomaly-log"),condition:GS,noDataBehavior:n.Enum(zs),...Wi,queries:Eo},{$id:"InputMonitorConfigurationAnomalyLog"}),zS=n.Object({type:n.Literal("anomaly-metric"),condition:DS,noDataBehavior:n.Enum(zs),...Qi,queries:yo},{$id:"MonitorConfigurationAnomalyMetric"}),VS=n.Object({type:n.Literal("anomaly-metric"),condition:GS,noDataBehavior:n.Enum(zs),...Wi,queries:Eo},{$id:"InputMonitorConfigurationAnomalyMetric"}),YS=n.Object({type:n.Literal("certificate-expiry"),warnBeforeInDays:n.Integer(),cloudAccounts:n.Optional(n.Array(n.String())),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("resolve")},{$id:"MonitorConfigurationCertificateExpiry"}),Kv=n.Object({type:n.Literal("certificate-expiry"),warnBeforeInDays:n.Integer({minimum:1,maximum:365}),cloudAccounts:n.Optional(n.Array(n.String(),{minItems:1})),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("resolve")},{$id:"InputMonitorConfigurationCertificateExpiry"}),QS=n.Object({type:n.Literal("log-error-pattern"),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("keep_last_status"),filter:n.Object({teamIds:n.Array(n.String()),env:n.String(),service:n.Optional(n.String())})},{$id:"MonitorConfigurationLogErrorPattern"}),zv=b("type",[vS,FS,qS,HS,zS,QS,YS]),Vv=b("type",[jS,BS,Hv,KS,VS,QS,Kv]);var Ir=n.Object({id:n.String({description:"Identifier of the monitor"}),name:n.String({description:"Display name of the monitor"}),owner:n.String({description:"Team ID that owns and manages the monitor"}),message:n.Optional(n.String({description:"Message to be displayed if a notification is triggered"})),tags:We,configuration:zv,priority:n.Enum(Pt,{description:"Priority of the monitor"}),permissions:Nu,dashboardId:n.Optional(n.String({description:"Identifier of a dashboard related to the monitor"})),pauseUntil:n.Optional(T()),creator:n.Optional(Ce),updater:n.Optional(Ce),createdAt:T(),updatedAt:T(),assetUpdatedAt:T(),clusterIds:n.Array(n.String())},{title:"Monitor"}),Yv=b("type",[vS,FS,qS,HS,zS,YS]),F1e=n.Object({...Ir.properties,configuration:Yv},{title:"Monitor"}),B1e=n.Object({...Ir.properties,configuration:b("type",[jS,BS,KS,VS])},{title:"Monitor"}),Zi=n.Object({name:m(),message:n.Optional(m({type:"long"})),tags:ut,configuration:Vv,priority:n.Enum(Pt),owner:m({allowEmpty:!1}),dashboardId:n.Optional(m()),pauseUntil:n.Optional(m({allowEmpty:!1,type:"date-time"})),permissions:Nu,clusterIds:n.Optional(n.Array(m({allowEmpty:!1})))}),wS=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],Qr={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var WS=n.Object({owners:pr(m({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:m({allowEmpty:!1}),exclude:n.Optional(n.Boolean({description:"If true, exclude monitors matching this value instead of including them"}))},{description:"Substring matched against monitor name and configuration"}),tags:pr(Un.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:pr(n.Enum(Pt),{description:"Restrict results to monitors with one of these priorities",maxItems:Pt.length}),types:pr(n.Enum(wS),{description:"Restrict results to monitors with these types",maxItems:wS.length}),activity:n.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:pr(m({allowEmpty:!1}),{description:"Restrict results to monitors deployed to any of these cluster IDs (monitors with no cluster restriction are always included)",maxItems:50})},{description:"Optional filters applied to narrow the returned monitors"}),wu=n.Partial(n.Object({...ie,filters:n.Partial(WS),sort:n.Object({by:n.Enum([Qr.PRIORITY,Qr.TYPE,Qr.NAME,Qr.OWNER,Qr.TAGS,Qr.CLUSTER_IDS,Qr.PAUSE_UNTIL,Qr.ASSET_UPDATED_AT],{description:"Field to sort the returned monitors by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned monitors"})})),q1e=d({tags:["monitors"],url:`${Ut}/query`,method:"POST",paginated:!0,response:n.Array(Ir),body:wu}),H1e=d({tags:["monitors"],url:`${Ut}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(WS,["tags"])))}),response:Pn}),K1e=d({tags:["monitors"],url:`${Ut}/:id`,method:"GET",params:n.Object({id:m()}),response:Ir}),z1e=d({tags:["monitors"],url:Ut,method:"POST",body:Zi,response:Ir}),V1e=d({tags:["monitors"],url:`${Ut}/:id`,method:"PUT",params:n.Object({id:m()}),body:Zi,response:Ir}),Y1e=d({tags:["monitors"],url:`${Ut}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),Q1e=d({tags:["monitors"],url:`${Ut}/:id/snooze`,method:"POST",params:n.Object({id:m()}),body:n.Object({pauseUntil:m({allowEmpty:!1,type:"date-time"})}),response:Ir}),Qv=["alert","ok","alert_consider_zero","ok_consider_zero","alert_no_data","ok_no_data","keep_last_status_ok","keep_last_status_alert"],wn=n.Enum(Qv),Wv=b("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([wn,n.Null()]),lastChangedAt:T()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(wn)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(wn)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(wn)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(wn)})]),Zv=n.Object({monitorId:n.String(),currentState:Wv,lastChangedAt:n.Optional(T())}),W1e=d({tags:["monitors"],url:`${Ut}/states/:id`,method:"GET",params:n.Object({id:m()}),response:Zv}),Z1e=d({tags:["monitors"],url:`${Ut}/:id/transitions`,method:"GET",params:n.Object({id:m()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:T(),fromState:n.Optional(wn),toState:n.Optional(wn),dimension:n.Optional(n.String())}))}),Xv=["unprocessed","processed","failed-to-process"],X1e=d({tags:["monitors"],url:`${Ut}/:id/results`,method:"GET",params:n.Object({id:m()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:T(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),Mc),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:T(),status:n.Enum(Xv)}))})});var Xi=`/${"v1"}/monitors`,Ji=n.Pick(Ir,["id","name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],{$id:"Monitor",description:"Monitor allowing to send alerts based on telemetry data"}),Jv={id:"123-456-abc",name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},e1={id:"456-789-def",name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(Ji,{examples:[Jv,e1]});var ZS=n.Pick(wu,["filters","sort","limit","offset"]),t1={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(ZS,{examples:[t1]});var XS=d({description:"Query monitors with filters, sorting, and pagination",operationId:"queryMonitors",tags:["monitors"],url:`${Xi}/query`,method:"POST",paginated:!0,body:ZS,response:n.Array(Ji)}),JS=d({description:"Retrieve a monitor by its id",operationId:"getMonitor",tags:["monitors"],url:`${Xi}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Ji}),eb=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],tb=n.Pick(Zi,eb,{$id:"CreateMonitorRequest"}),rb=n.Pick(Zi,eb,{$id:"UpdateMonitorRequest"}),nb={name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},ob={name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(tb,{examples:[nb,ob]});Object.assign(rb,{examples:[nb,ob]});var ib=d({description:"Create a new monitor",operationId:"createMonitor",tags:["monitors"],url:Xi,method:"POST",body:tb,response:Ji}),ab=d({description:"Update a monitor by its id",operationId:"updateMonitor",tags:["monitors"],url:`${Xi}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:rb,response:Ji}),r1=n.Object({id:m({allowEmpty:!1,description:"The monitor ID to delete"})}),sb=d({description:"Delete a monitor by its id",operationId:"deleteMonitor",tags:["monitors"],url:`${Xi}/:id`,method:"DELETE",params:r1,response:v});var ea="/v0/notifications",$n=`${ea}/rules`,pb=`${ea}/slack/setup`,Vs=`${ea}/integrations`,Mn=["triggered","resolved","no-data"],n1=["sent","stale","pending","rate-limited","failed","silenced"],o1=n.Optional(n.Object({maxMessages:n.Integer({description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),i1=n.Optional(n.Object({maxMessages:n.Integer({minimum:1,description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({minimum:1,description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),a1=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),s1=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({minimum:1,description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),p1=n.Object({id:n.String({description:"Identifier of the notification target"}),rateLimit:o1,renotifyConfig:a1,config:b("type",[n.Object({type:n.Literal("slack"),channel:n.String({description:"Slack channel ID that receives the notification"}),integrationId:n.String({description:"Slack workspace ID that receives the notification"}),integrationName:n.String({description:"Human readable name of the Slack integration"})},{$id:"RuleTargetConfigSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:n.String({description:"Identifier of the incident.io integration to use"}),integrationName:n.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),n.Object({type:n.Literal("email"),addresses:n.Array(n.String(),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:n.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:n.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),n.Object({type:n.Literal("pagerduty"),integrationId:n.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:n.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:n.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:n.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:n.String({description:"Identifier of the webhook integration to use"}),integrationName:n.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:n.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:n.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:n.String({description:"Identifier of the Google Chat integration to use"}),integrationName:n.String({description:"Human readable name of the Google Chat integration"})},{$id:"RuleTargetConfigGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:n.String({description:"Identifier of the Squadcast integration to use"}),integrationName:n.String({description:"Human readable name of the Squadcast integration"})},{$id:"RuleTargetConfigSquadcast"})],{description:"Configuration describing how the alert was delivered"})}),c1=n.Object({id:m({description:"Identifier of the notification target"}),rateLimit:i1,config:b("type",[n.Object({type:n.Literal("slack"),channel:m({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:m({allowEmpty:!1,description:"Slack workspace ID that receives the notification"})},{$id:"RuleTargetInputSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:m({allowEmpty:!1,description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty"),integrationId:m({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),n.Object({type:n.Literal("email"),addresses:n.Array(m({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:m({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:m({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:m({allowEmpty:!1,description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:m({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:m({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"})},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:m({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"})},{$id:"RuleTargetInputSquadcast"})],{description:"Configuration describing how the alert should be delivered"}),renotifyConfig:s1}),Mu=b("type",[n.Object({type:n.Literal("specific-teams"),teams:n.Array(n.String(),{description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams")}),n.Object({type:n.Literal("all-public-teams")})]),$u=b("type",[n.Object({type:n.Literal("specific-teams"),teams:n.Array(m(),{minItems:1,maxItems:100,description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams")}),n.Object({type:n.Literal("all-public-teams")})]),Do=n.Object({id:n.String({description:"Identifier of the notification rule"}),name:n.String({description:"Display name of the notification rule"}),queryString:n.Optional(n.String({description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:Mu,prioritiesFilter:n.Array(n.Enum(Pt),{description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(Mn),{description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Array(n.String(),{description:"Cluster IDs that can trigger a notification"}),owner:n.String({description:"Team ID that owns and manages the rule"}),createdAt:T(),updatedAt:T(),isActive:n.Boolean(),tags:We,targets:n.Array(p1,{description:"Notification targets that can receive notifications when the rule matches"}),creator:n.Optional(Ce),updater:n.Optional(Ce)}),ta=n.Object({name:m({description:"Display name of the notification rule"}),queryString:n.Optional(m({type:"tags-query",description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:$u,prioritiesFilter:n.Array(n.Enum(Pt),{maxItems:Pt.length,description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(Mn),{maxItems:Mn.length,description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Cluster IDs that can trigger a notification"})),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:ut,isActive:n.Boolean(),targets:n.Array(c1,{minItems:1,description:"Notification targets that can receive notifications when the rule matches"})}),fje=d({tags:["notification-rules"],url:$n,method:"GET",paginated:!0,query:n.Object(ie),response:n.Array(Do)}),gje=d({tags:["notification-rules"],url:`${$n}/:id`,params:n.Object({id:m()}),method:"GET",response:Do}),yje=d({tags:["notification-rules"],url:$n,method:"POST",body:ta,response:Do}),Eje=d({tags:["notification-rules"],url:`${$n}/:id`,method:"PUT",params:n.Object({id:m()}),body:ta,response:Do}),Ije=d({tags:["notification-rules"],url:`${$n}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),Tje=d({tags:["notification-integrations"],url:`${pb}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),m1=n.Object({id:n.String(),name:n.String(),type:n.Enum(["slack","incident-io","grafana-irm","pagerduty","microsoft-teams","webhook","servicenow","google-chat","squadcast"]),createdAt:T(),ruleCount:n.Number(),creator:n.Optional(Ce)}),_je=d({tags:["notification-integrations"],url:`${$n}/integrations`,method:"GET",paginated:!0,query:n.Object(ie),response:n.Array(m1)}),hje=d({tags:["notification-integrations"],url:`${pb}/callback`,method:"GET",query:n.Object({code:m()}),response:n.Object({success:n.Boolean()})}),Du=["POST","PUT"],u1=n.Record(n.String(),n.String()),l1=n.Record(n.String(),n.Unknown()),d1=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),f1=b("type",[n.Object({type:n.Literal("json"),value:l1}),n.Object({type:n.Literal("form"),value:d1})]),g1=n.Object({ok:n.String(),alert:n.String()}),Gu=n.Object({id:n.String(),name:n.String(),setting:b("type",[n.Object({type:n.Literal("incident-io"),alertSourceConfigId:n.String(),tokenLastChars:n.String()}),n.Object({type:n.Literal("grafana-irm"),urlLastChars:n.String()}),n.Object({type:n.Literal("pagerduty"),integrationKeyLastChars:n.String()}),n.Object({type:n.Literal("microsoft-teams"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("webhook"),urlLastChars:n.String(),method:n.Enum(Du),authentication:b("type",[n.Object({type:n.Literal("bearer"),tokenLastChars:n.String()}),n.Object({type:n.Literal("basic"),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("custom-header"),key:n.String(),valueLastChars:n.String()}),n.Object({type:n.Literal("none")})]),customHeaders:n.Optional(u1),payloadTemplate:f1,eventNameMapping:n.Optional(g1)}),n.Object({type:n.Literal("servicenow"),instanceName:n.String(),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("google-chat"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("squadcast"),webhookUrlLastChars:n.String()})]),tags:We}),y1=n.Object({type:n.Literal("webhook"),url:m({type:"uri"}),method:n.Enum(Du),authentication:b("type",[n.Object({type:n.Literal("bearer"),token:m({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:m({allowEmpty:!1}),password:m({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:m({allowEmpty:!1}),value:m({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),customHeaders:n.Record(m({allowEmpty:!1}),m()),payloadTemplate:b("type",[n.Object({type:n.Literal("json"),value:n.Record(m({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(m({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})]),eventNameMapping:n.Optional(n.Object({ok:m({allowEmpty:!1}),alert:m({allowEmpty:!1})}))}),cb=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:m(),token:m()}),mb=n.Object({type:n.Literal("grafana-irm"),url:m({type:"uri"})}),ub=n.Object({type:n.Literal("pagerduty"),integrationKey:m()}),lb=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:m({type:"uri"})}),E1=n.Object({type:n.Literal("servicenow"),instanceName:m({allowEmpty:!1,description:'Instance name of the ServiceNow instance. This corresponds to the subdomain part of the instance URL, like "my-instance" in "my-instance.service-now.com"'}),username:m({allowEmpty:!1}),password:m({allowEmpty:!1})}),I1=n.Object({type:n.Literal("google-chat"),webhookUrl:m({type:"uri"})}),T1=n.Object({type:n.Literal("squadcast"),webhookUrl:m({type:"uri"})}),_1=n.Object({name:m(),setting:b("type",[cb,mb,ub,lb,y1,E1,I1,T1]),tags:ut}),h1=n.Object({type:n.Literal("webhook"),url:n.Optional(m({type:"uri"})),method:n.Optional(n.Enum(Du)),authentication:n.Optional(b("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(m({allowEmpty:!1})),password:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(m({allowEmpty:!1})),value:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})])),customHeaders:n.Optional(n.Record(m({allowEmpty:!1}),m())),payloadTemplate:n.Optional(b("type",[n.Object({type:n.Literal("json"),value:n.Record(m({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(m({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:n.Optional(n.Object({ok:n.Optional(m({allowEmpty:!1})),alert:n.Optional(m({allowEmpty:!1}))}))}),O1=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(m({allowEmpty:!1})),username:n.Optional(m({allowEmpty:!1})),password:n.Optional(m({allowEmpty:!1}))}),A1=n.Object({type:n.Literal("google-chat"),webhookUrl:m({type:"uri"})}),S1=n.Object({type:n.Literal("squadcast"),webhookUrl:m({type:"uri"})}),b1=n.Object({name:n.Optional(m()),setting:n.Optional(b("type",[cb,mb,ub,lb,h1,O1,A1,S1]))}),Oje=d({tags:["notification-integrations"],url:Vs,method:"POST",body:_1,response:Gu}),Aje=d({tags:["notification-integrations"],url:`${Vs}/:id`,method:"GET",params:n.Object({id:m()}),response:Gu}),Sje=d({tags:["notification-integrations"],url:`${Vs}/:id`,method:"PUT",params:n.Object({id:m()}),body:b1,response:Gu}),bje=d({tags:["notification-integrations"],url:`${Vs}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),xje=d({tags:["notification-rules"],url:`${Ut}/:id/notifications`,method:"GET",params:n.Object({id:m()}),query:n.Optional(n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number())})),response:n.Object({notifications:n.Array(n.Object({id:n.String(),monitorId:n.String(),monitorResultId:n.String(),ruleId:n.Optional(n.String()),targetId:n.Optional(n.String()),status:n.Enum(n1),tryCount:n.Number(),nextTryAt:T(),createdAt:T(),updatedAt:T(),sentAt:n.Optional(T())})),isTruncated:n.Boolean()})}),x1=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast"],Rje=d({tags:["notification-rules"],url:`${$n}/test`,method:"POST",body:n.Object({notificationRule:ta,targetIds:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:n.Union([n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(x1,{description:"The type of the target (e.g., slack, webhook)"}),status:n.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:n.Optional(n.String({description:"Message if the notification failed for this specific target"}))}))})])});var ra=`/${"v1"}/notification-rules`,na=n.Pick(Do,["id","name","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Rules to trigger notifications to targets based on alert events"}),R1={id:"123-456-abc",name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(na,{examples:[R1]});var db=d({description:"Retrieve all notification rules",operationId:"listNotificationRules",tags:["notification-rules"],url:ra,method:"GET",paginated:!0,query:n.Object(ie),response:n.Array(na)}),fb=d({description:"Retrieve a notification rule by its id",operationId:"getNotificationRule",tags:["notification-rules"],url:`${ra}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:na}),vu=n.Pick(ta,["name","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"]),C1={name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(vu,{examples:[C1]});var gb=d({description:"Create a new notification rule",operationId:"createNotificationRule",tags:["notification-rules"],url:ra,method:"POST",body:vu,response:na}),yb=d({description:"Update a notification rule by its id",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${ra}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:vu,response:na}),P1=n.Object({id:m({allowEmpty:!1,description:"The notification rule ID to delete"})}),Eb=d({description:"Delete a notification rule by its id",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${ra}/:id`,method:"DELETE",params:P1,response:v});var Go=`${ea}/silences`,Ib=n.Union([n.Literal("monday"),n.Literal("tuesday"),n.Literal("wednesday"),n.Literal("thursday"),n.Literal("friday"),n.Literal("saturday"),n.Literal("sunday")]),U1=n.Partial(n.Record(Ib,n.Array(n.Object({startTime:n.String({format:fc}),endTime:n.String({format:fc})},{title:"SilenceTimeRange"}),{minItems:1,description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),N1=n.Partial(n.Record(Ib,n.Array(n.Object({startTime:n.String(),endTime:n.String()},{title:"SilenceTimeRange"}),{description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),Ys='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',Tb="One-time silence schedule with specific start and end times",_b="Recurring weekly silence schedule",L1=b("type",[n.Object({type:n.Literal("one-time"),startTime:n.String({format:gc}),endTime:n.String({format:gc}),timeZone:n.Optional(n.String({format:dc,description:Ys}))},{$id:"InputSilenceScheduleOneTime",description:Tb}),n.Object({type:n.Literal("recurring"),weeklySchedule:U1,timeZone:n.Optional(n.String({format:dc,description:Ys}))},{$id:"InputSilenceScheduleRecurring",description:_b})],{description:"Schedule defining when the silence is active"}),k1=b("type",[n.Object({type:n.Literal("one-time"),startTime:n.String(),endTime:n.String(),timeZone:n.Optional(n.String({description:Ys}))},{$id:"OutputSilenceScheduleOneTime",description:Tb}),n.Object({type:n.Literal("recurring"),weeklySchedule:N1,timeZone:n.Optional(n.String({description:Ys}))},{$id:"OutputSilenceScheduleRecurring",description:_b})],{description:"Schedule defining when the silence is active"}),Qs=n.Object({name:m({description:"Display name of the silence"}),reason:m({allowEmpty:!1,description:"Reason for the silence"}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:ut,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:L1,notificationRuleIds:n.Optional(n.Array(m(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(m({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:$u,prioritiesFilter:n.Array(n.Enum(Pt),{maxItems:Pt.length,description:"Monitor priorities to filter which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(Mn),{maxItems:Mn.length,description:"Transition types to filter which alerts this silence applies to"})}),vo=n.Object({id:n.String({description:"Unique identifier of the silence"}),name:n.String({description:"Display name of the silence"}),reason:n.String({description:"Reason for the silence"}),owner:n.String({description:"Team ID that owns and manages the silence"}),tags:We,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:k1,notificationRuleIds:n.Optional(n.Array(n.String(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(n.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:Mu,prioritiesFilter:n.Array(n.Enum(Pt),{description:"Monitor priorities filtering which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(Mn),{description:"Transition types filtering which alerts this silence applies to"}),createdAt:T(),updatedAt:T(),creator:n.Optional(Ce),updater:n.Optional(Ce)}),Kje=d({tags:["notification-silences"],url:Go,method:"GET",response:n.Array(vo)}),zje=d({tags:["notification-silences"],url:`${Go}/:id`,params:n.Object({id:m()}),method:"GET",response:vo}),Vje=d({tags:["notification-silences"],url:Go,method:"POST",body:Qs,response:vo}),Yje=d({tags:["notification-silences"],url:`${Go}/:id`,method:"PUT",params:n.Object({id:m()}),body:Qs,response:vo}),Qje=d({tags:["notification-silences"],url:`${Go}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),Wje=d({tags:["notification-silences"],url:`${Go}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(m())}),response:n.Object({})});var oa=`/${"v1"}/notification-silences`,Ws=n.Pick(vo,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Silences to suppress notifications based on schedules and filters"}),hb=d({description:"Retrieve all notification silences",operationId:"listNotificationSilences",tags:["notification-silences"],url:oa,method:"GET",response:n.Array(Ws)}),Ob=d({description:"Retrieve a notification silence by its id",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${oa}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Ws}),Ab=n.Pick(Qs,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"]),Sb=d({description:"Create a new notification silence",operationId:"createNotificationSilence",tags:["notification-silences"],url:oa,method:"POST",body:Ab,response:Ws}),bb=d({description:"Update a notification silence by its id",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${oa}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Ab,response:Ws}),w1=n.Object({id:m({allowEmpty:!1,description:"The notification silence ID to delete"})}),xb=d({description:"Delete a notification silence by its id",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${oa}/:id`,method:"DELETE",params:w1,response:v});var M1=["passed","failed","ignored"],$1=n.Enum(M1),Rb=["unrouted-logs","team-has-route","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","inconsistent-attribute-naming","no-duplicate-attr-values","no-debug-logs-in-prod","no-multiline-logs","no-empty-dashboards","monitor-has-notification","no-future-dated-logs","metric-usage","no-stale-dashboards","no-unused-dashboards","no-orphan-monitors","no-flapping-monitors","no-noisy-group-monitors","no-long-alert-monitors","no-redundant-monitors","no-absent-log-fields","k8s-recommended-attributes","k8s-recommended-metrics","k8s-recommended-change-events","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys"],D1=n.Enum(Rb),G1=["log","metric","resource","span"],v1=["team","global"],Fu=n.Object({key:n.Enum(Rb),title:n.String(),summary:n.String(),rationale:n.String(),objectType:n.Enum(G1),category:n.Enum(["hygiene","routing","integrity","consistency","redundancy","cost"]),impact:n.Object({label:n.Enum(["critical","important","normal"]),weight:n.Number()}),recommendation:n.String(),scope:n.Optional(n.Enum(v1))}),ju=n.Intersect([Fu,n.Object({status:$1,normalizedScore:n.Number(),details:n.Optional(n.Record(n.String(),n.Unknown())),recommendation:n.Optional(n.String()),examples:n.Optional(n.Array(n.Object({type:n.String(),label:n.String(),link:n.Object({to:n.String(),search:n.Optional(n.Unknown()),params:n.Optional(n.Unknown())})})))})]),Zs=n.Object({generatedAt:n.String(),overallScore:n.Optional(n.Number()),rules:n.Array(Fu),teamResults:n.Array(n.Object({teamId:n.String(),teamName:n.String(),teamWeight:n.Number(),score:n.Number(),weightedScore:n.Number(),totalWeight:n.Number(),ruleResults:n.Array(ju)})),globalResults:n.Optional(n.Object({score:n.Optional(n.Number()),ruleResults:n.Array(ju)}))}),pFe=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:Zs}),cFe=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:n.Object({clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({report:n.Optional(Zs)})}),mFe=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:n.Object({ruleKey:D1,teamId:m(),lookbackMinutes:n.Optional(n.Integer({minimum:1,maximum:60})),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({rule:Fu,result:ju,teamId:n.String(),teamName:n.String()})});var j1=`/${"v1"}/quality-reports`,Cb=n.Pick(Zs,["generatedAt","overallScore","rules","teamResults","globalResults"],{$id:"QualityReport",description:"Aggregated quality report with per-team rule evaluations and scores"}),F1={generatedAt:"2026-02-26T12:00:00.000Z",overallScore:.85,rules:[{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"resource",category:"routing",impact:{label:"important",weight:2},recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."}],teamResults:[{teamId:"abc-123-def",teamName:"platform",teamWeight:1,score:.85,weightedScore:.85,totalWeight:2,ruleResults:[{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"resource",category:"routing",impact:{label:"important",weight:2},recommendation:"Ensure every team manages a dedicated route scoped to its context.team value.",status:"passed",normalizedScore:1}]}]};Object.assign(Cb,{examples:[F1]});var B1=n.Object({clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),Pb=d({description:"Retrieve the latest quality report",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${j1}/latest`,method:"GET",query:B1,response:n.Object({report:n.Optional(Cb)})});var ia="/v0/admin-center";var tr=`${ia}/retention-policies`,q1=3650,H1=n.Integer(),Ub=n.Integer({minimum:1,maximum:q1}),Tr=n.Object({id:n.String(),env:n.Optional(n.String()),teamId:n.Optional(n.String()),dataSource:n.Enum(Dt),durationDays:H1,isEnabled:n.Boolean(),createdAt:T(),updatedAt:T()}),Xs=n.Object({env:n.Optional(m()),teamId:n.Optional(m()),dataSource:n.Enum(Dt),durationDays:Ub,isEnabled:n.Boolean()}),Nb=n.Array(n.Object({env:m(),dataSource:n.Enum(Dt),durationDays:n.Union([Ub,n.Null()]),isEnabled:n.Boolean()})),Lb=n.Object({inserted:n.Array(Tr),updated:n.Array(Tr),deleted:n.Array(Tr)}),bFe=d({tags:["retention-policies"],url:tr,method:"POST",body:Xs,response:Tr}),xFe=d({tags:["retention-policies"],url:tr,method:"GET",response:n.Array(Tr)}),RFe=d({tags:["retention-policies"],url:`${tr}/:id`,method:"GET",params:n.Object({id:m()}),response:Tr}),CFe=d({tags:["retention-policies"],url:`${tr}/:id`,method:"PUT",params:n.Object({id:m()}),body:Xs,response:Tr}),PFe=d({tags:["retention-policies"],url:`${tr}/bulk-update`,method:"POST",body:Nb,response:Lb}),UFe=d({tags:["retention-policies"],url:`${tr}/bulk-update-for-team`,method:"POST",body:n.Object({teamId:m(),policies:Nb}),response:Lb}),NFe=d({tags:["retention-policies"],url:`${tr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),aa=["past-24-hours","past-7-days","past-30-days"],LFe=d({tags:["retention-policies"],url:`${tr}/requested-history-percentile/:teamId`,method:"POST",params:n.Object({teamId:m()}),body:n.Object({percentile:n.Number({minimum:0,maximum:1}),observationWindow:n.Enum(aa),dataSource:n.Enum(Dt)}),response:n.Object({percentile:n.Number(),observationWindow:n.Enum(aa),dataSource:n.Enum(Dt),teamId:n.String(),requestedHistoryDays:n.Number()})}),K1=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var z1=n.Array(n.Object({bucket:n.Enum(K1),count:n.Number()})),kFe=d({tags:["retention-policies"],url:`${tr}/requested-history-histogram/:teamId`,method:"POST",params:n.Object({teamId:m()}),body:n.Object({observationWindow:n.Enum(aa),dataSource:n.Enum(Dt)}),response:n.Object({observationWindow:n.Enum(aa),dataSource:n.Enum(Dt),teamId:n.String(),histogram:z1})}),wFe=d({tags:["retention-policies"],url:`${tr}/top-teams-with-retention-surplus`,method:"POST",body:n.Object({dataSource:n.Enum(Dt),observationWindow:n.Enum(aa),percentile:n.Number({minimum:0,maximum:1}),topN:n.Optional(n.Number({minimum:1,maximum:20}))}),response:n.Array(n.Object({teamId:n.String(),retentionSurplusDays:n.Number()}))});var sa=`/${"v1"}/retention-policies`,pa=n.Pick(Tr,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Data retention rule for a data source within an environment"}),V1={id:"123-456-abc",env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(pa,{examples:[V1]});var kb=d({description:"Retrieve all retention policies",operationId:"listRetentionPolicies",tags:["retention-policies"],url:sa,method:"GET",response:n.Array(pa)}),wb=d({description:"Retrieve a retention policy by its id",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${sa}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:pa}),Bu=n.Pick(Xs,["env","teamId","dataSource","durationDays","isEnabled"]),Y1={env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(Bu,{examples:[Y1]});var Mb=d({description:"Create a new retention policy",operationId:"createRetentionPolicy",tags:["retention-policies"],url:sa,method:"POST",body:Bu,response:pa}),$b=d({description:"Update a retention policy by its id",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${sa}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Bu,response:pa}),Db=d({description:"Delete a retention policy by its id",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${sa}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var Js={id:n.String({description:"Identifier of the processor"}),description:n.Optional(n.String()),tags:We,updatedAt:n.Optional(T())},ep={id:m({allowEmpty:!1,description:"Identifier of the processor"}),description:n.Optional(m({type:"long"})),tags:ut,updatedAt:n.Optional(T())},Q1={...Js,type:n.Literal("creator")},W1={...ep,type:n.Literal("creator")},Z1=b("subtype",[n.Object({targetAttribute:n.String({description:"Attribute that will receive the formatted value"}),formatString:n.String({description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean()),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean())},{$id:"ProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the computed value"}),formula:n.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean()),subtype:n.Literal("math-formula"),replaceMissingBy0:n.Optional(n.Boolean())},{$id:"ProcessorParamsCreatorMathFormula"})]),X1=b("subtype",[n.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:m({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean())},{$id:"InputProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:m({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("math-formula"),replaceMissingBy0:n.Optional(n.Boolean())},{$id:"InputProcessorParamsCreatorMathFormula"})]),J1=n.Object({...Q1,params:Z1}),ej=n.Object({...W1,params:X1}),tj={...Js,type:n.Literal("mapper")},rj={...ep,type:n.Literal("mapper")},nj=b("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:n.String({description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean()),overrideTarget:n.Optional(n.Boolean()),targetAttribute:n.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")},{$id:"ProcessorParamsMapperMapAttributes"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level")},{$id:"ProcessorParamsMapperMapLevel"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp")},{$id:"ProcessorParamsMapperMapTimestamp"})]),oj=b("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:m({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:m({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")},{$id:"InputProcessorParamsMapperMapAttributes"}),n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level")},{$id:"InputProcessorParamsMapperMapLevel"}),n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp")},{$id:"InputProcessorParamsMapperMapTimestamp"})]),ij=n.Object({...rj,params:oj}),aj=n.Object({...tj,params:nj}),sj={...Js,type:n.Literal("parse-attribute")},pj={...ep,type:n.Literal("parse-attribute")},cj=5,mj=b("subtype",[n.Object({attributeName:n.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(n.String({description:"Grok rule applied to parse text"}),{description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(n.String(),{description:"Example log lines for validation"})),subtype:n.Literal("grok")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the URL to parse"}),subtype:n.Literal("url")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:n.String({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:n.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:n.String({description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean(),subtype:n.Literal("key-value")})]),uj=b("subtype",[n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(m({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text"}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(m({type:"long"}),{maxItems:cj,description:"Example log lines for validation"})),subtype:n.Literal("grok")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:n.Literal("url")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:m({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:m({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:m({allowEmpty:!0,description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean(),subtype:n.Literal("key-value")})]),lj=n.Object({...sj,params:mj}),dj=n.Object({...pj,params:uj}),fj=11,Gb=n.Cyclic({OutputProcessor:n.Union([aj,lj,J1,n.Object({...Js,params:n.Object({items:n.Array(n.Object({query:n.String({description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split")})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),vb=n.Cyclic({InputProcessor:n.Union([ij,dj,ej,n.Object({...ep,params:n.Object({items:n.Array(n.Object({query:m({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:fj,description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split")})])},"InputProcessor",{description:"Processing step executed sequentially on route logs"});var gj="/v0/logs",Wr=`${gj}/routes`,Dn=n.Object({id:n.String({description:"Identifier of the log route"}),name:n.String({description:"Human readable name shown for the route"}),description:n.Optional(n.String()),isEnabled:n.Boolean(),query:n.String({description:"Query that selects which logs should enter the route"}),rank:n.Number(),tags:We,owner:n.String({description:"Team ID owning and managing the route"}),processors:n.Array(Gb,{description:"Ordered processors applied to logs that match the route"}),creator:n.Optional(Ce),updater:n.Optional(Ce),updatedAt:T(),createdAt:T(),assetUpdatedAt:T()},{title:"Route"}),ca=n.Object({name:m({allowEmpty:!1,description:"Human readable name shown for the route"}),description:n.Optional(m({type:"long"})),isEnabled:n.Boolean(),query:m({type:"tsuga-query",description:"Query that selects which logs should enter the route"}),tags:ut,owner:m({allowEmpty:!1,description:"Team ID owning and managing the route"}),processors:n.Array(vb,{maxItems:50,description:"Ordered processors applied to logs that match the route"})}),tBe=d({tags:["routes"],url:Wr,method:"GET",paginated:!0,query:n.Object(ie),response:n.Array(Dn)}),rBe=d({tags:["routes"],url:`${Wr}/:id`,params:n.Object({id:m()}),method:"GET",response:Dn}),nBe=d({tags:["routes"],url:Wr,method:"POST",body:ca,response:Dn}),oBe=d({tags:["routes"],url:`${Wr}/:id`,method:"PUT",body:ca,params:n.Object({id:m()}),response:Dn}),iBe=d({tags:["routes"],url:`${Wr}/:id/clone`,method:"POST",params:n.Object({id:m()}),body:ca,response:Dn}),aBe=d({tags:["routes"],url:`${Wr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),sBe=d({tags:["routes"],url:`${Wr}/:id/modify-ranking`,method:"PUT",params:n.Object({id:m()}),body:n.Object({rank:n.Number()}),response:n.Object({})}),pBe=d({tags:["routes"],url:`${Wr}/:id/enable`,method:"PUT",params:n.Object({id:m()}),body:n.Object({enable:n.Boolean()}),response:n.Object({})});var ma=`/${"v1"}/routes`,ua=n.Pick(Dn,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Log route allowing to standardize logs and enrich them with additional data"}),yj={id:"123-456-abc",name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(ua,{examples:[yj]});var jb=d({description:"Retrieve all routes",operationId:"listRoutes",tags:["routes"],url:ma,method:"GET",paginated:!0,query:n.Object(ie),response:n.Array(ua)}),Fb=d({description:"Retrieve a route by its id",operationId:"getRoute",tags:["routes"],url:`${ma}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:ua}),qu=n.Pick(ca,["name","description","isEnabled","query","tags","owner","processors"]),Ej={name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(qu,{examples:[Ej]});var Bb=d({description:"Create a new route",operationId:"createRoute",tags:["routes"],url:ma,method:"POST",body:qu,response:ua}),qb=d({description:"Update a route by its id",operationId:"updateRoute",tags:["routes"],url:`${ma}/:id`,method:"PUT",body:qu,params:n.Object({id:m({allowEmpty:!1})}),response:ua}),Hb=d({description:"Delete a route by its id",operationId:"deleteRoute",tags:["routes"],url:`${ma}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var Gn=`${ia}/tag-policies`;var Kb=["ingestion-api-key","operation-api-key","dashboard","log-route","monitor","notification-rule","notification-silence","slo"],Ij=["logs","metrics","traces"],Hu=n.Array(n.Enum(Kb)),Ku=n.Array(n.Enum(Ij)),Tj=n.Union([Hu,Ku]),_j=n.Object({teamIds:n.Array(n.String()),mode:n.Enum(["include","exclude"])}),hj=b("type",[n.Object({type:n.Literal("telemetry"),assetTypes:Ku,shouldInsertWarning:n.Boolean(),dropSample:n.Optional(n.Number())}),n.Object({type:n.Literal("tsuga_asset"),assetTypes:Hu})]),Oj=b("type",[n.Object({type:n.Literal("telemetry"),assetTypes:Ku,shouldInsertWarning:n.Boolean(),dropSample:n.Optional(n.Number({minimum:0,maximum:100}))}),n.Object({type:n.Literal("tsuga_asset"),assetTypes:Hu})]),jo=n.Object({id:n.String(),name:n.String(),description:n.Optional(n.String()),isActive:n.Boolean(),tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean(),teamScope:n.Optional(_j),configuration:hj,creator:n.Optional(Ce),updater:n.Optional(Ce),owner:n.Optional(n.String()),createdAt:T(),updatedAt:T(),assetUpdatedAt:T()});var la=n.Object({name:m(),description:n.Optional(m()),isActive:n.Boolean(),tagKey:m({allowEmpty:!1}),allowedTagValues:n.Array(m({allowEmpty:!1}),{maxItems:1e3}),isRequired:n.Boolean(),teamScope:n.Optional(n.Object({teamIds:n.Array(m(),{minItems:1,maxItems:100}),mode:n.Enum(["include","exclude"])})),configuration:Oj,owner:m({allowEmpty:!1})}),ABe=d({tags:["tag-policies"],url:Gn,method:"GET",query:n.Object({teamIds:n.Optional(n.Array(m(),{maxItems:100})),assetTypes:n.Optional(Tj),searchQuery:n.Optional(m())}),response:n.Array(jo)}),SBe=d({tags:["tag-policies"],url:`${Gn}/:id`,method:"GET",params:n.Object({id:m()}),response:jo}),bBe=d({tags:["tag-policies"],url:Gn,method:"POST",body:la,response:jo}),xBe=d({tags:["tag-policies"],url:`${Gn}/:id`,method:"PUT",params:n.Object({id:m()}),body:la,response:jo}),RBe=d({tags:["tag-policies"],url:`${Gn}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),CBe=d({tags:["tag-policies"],url:`${ia}/applicable-tag-rules`,method:"GET",query:n.Object({assetType:n.Enum(Kb),teamId:m()}),response:n.Array(n.Object({tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean()}))}),zb=n.Object({total:n.Number(),totalNonCompliant:n.Number(),idsNonCompliant:n.Array(n.String())}),Vb=n.Union([n.Literal("ingestion-api-key"),n.Literal("operation-api-key"),n.Literal("dashboard"),n.Literal("log-route"),n.Literal("monitor"),n.Literal("notification-rule"),n.Literal("notification-silence"),n.Literal("slo")]),Aj=n.Object({total:n.Number(),totalNonCompliant:n.Number(),byAssetType:n.Record(Vb,zb)}),Sj=n.Omit(zb,["total"]),bj=n.Object({totalNonCompliant:n.Number(),byAssetType:n.Record(Vb,Sj)}),Yb=n.Object({totals:Aj,byTeam:n.Record(n.String(),bj)}),PBe=d({tags:["tag-policies"],url:`${Gn}/:id/stats`,method:"GET",params:n.Object({id:m()}),response:Yb}),UBe=d({tags:["tag-policies"],url:`${Gn}/new-policy-stats`,method:"POST",body:la,response:Yb});var da=`/${"v1"}/tag-policies`,tp=n.Pick(jo,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga assets or telemetry data"}),Qb=n.Pick(la,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"]),Wb=d({description:"Retrieve all tag policies",operationId:"listTagPolicies",tags:["tag-policies"],url:da,method:"GET",response:n.Array(tp)}),Zb=d({description:"Retrieve a tag policy by its id",operationId:"getTagPolicy",tags:["tag-policies"],url:`${da}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:tp}),Xb=d({description:"Create a new tag policy",operationId:"createTagPolicy",tags:["tag-policies"],url:da,method:"POST",body:Qb,response:tp}),Jb=d({description:"Update a tag policy by its id",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${da}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Qb,response:tp}),ex=d({description:"Delete a tag policy by its id",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${da}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var fa=`/${"v1"}/teams`,ga=n.Pick(Uo,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership and access to resources"}),xj={id:"abc-123-def",name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(ga,{examples:[xj]});var tx=d({description:"Retrieve all teams",operationId:"listTeams",tags:["teams"],url:fa,method:"GET",paginated:!0,query:n.Object(ie),response:n.Array(ga)}),rx=d({description:"Retrieve a team by its id",operationId:"getTeam",tags:["teams"],url:`${fa}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:ga}),zu=n.Pick(ks,["name","description","visibility","tags"]),Rj={name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(zu,{examples:[Rj]});var nx=d({description:"Create a new team",operationId:"createTeam",tags:["teams"],url:fa,method:"POST",body:zu,response:ga}),ox=d({description:"Update a team by its id",operationId:"updateTeam",tags:["teams"],url:`${fa}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:zu,response:ga}),ix=d({description:"Delete a team by its id",operationId:"deleteTeam",tags:["teams"],url:`${fa}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});function Vu(e){let t=e.params;if(t?.properties){let r=Object.keys(t.properties);if(r.length===1&&r[0])return r[0]}return"id"}function ax(e,t,r){let o=e.command(t.commandName).description(t.description),i=kS(t.commandName).replace(/-/g," "),a=o.command("list").description(`List all ${t.commandName}`);if(t.listOptions)for(let p of t.listOptions)a.option(p.flag,p.description);if(t.enableListBody?a.option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async p=>{if(p.generateSkeleton){re(xo(t.endpoints.list));return}let u=await r()(t.endpoints.list,{body:p.data?Ro({data:p.data}):{}});re(u)}):a.action(async p=>{let u={};if(t.listOptions)for(let f of t.listOptions){let y=p[f.queryParam];y!==void 0&&(u[f.queryParam]=y)}let l=await r()(t.endpoints.list,Object.keys(u).length>0?{query:u}:void 0);re(l)}),t.endpoints.get){let p=t.endpoints.get,u=Vu(p);o.command("get <id>").description(`Get a ${i} by ID`).action(async l=>{let f=await r()(p,{params:{[u]:l}});re(f)})}if(t.endpoints.create){let p=t.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async u=>{if(u.generateSkeleton){re(xo(p));return}let l=Ro(u),f=await r()(p,{body:l});re(f)})}if(t.endpoints.update){let p=t.endpoints.update,u=Vu(p);o.command("update <id>").description(`Update a ${i} by ID`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async(l,f)=>{if(f.generateSkeleton){re(xo(p));return}let y=Ro(f),I=await r()(p,{params:{[u]:l},body:y});re(I)})}if(t.endpoints.delete){let p=t.endpoints.delete,u=Vu(p);o.command("delete <id>").description(`Delete a ${i} by ID`).action(async l=>{let f=await r()(p,{params:{[u]:l}});re(f)})}}var Cj=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:US}},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:lS,get:fS,create:gS,update:yS,delete:ES},listOptions:[{flag:"--owners <ids...>",description:"Filter by owner team IDs",queryParam:"owners"}]},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:OS,create:AS,update:SS,delete:bS}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:XS,get:JS,create:ib,update:ab,delete:sb},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:db,get:fb,create:gb,update:yb,delete:Eb}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:hb,get:Ob,create:Sb,update:bb,delete:xb}},{commandName:"quality-reports",description:"Manage quality reports",endpoints:{list:Pb}},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:kb,get:wb,create:Mb,update:$b,delete:Db}},{commandName:"routes",description:"Manage routes",endpoints:{list:jb,get:Fb,create:Bb,update:qb,delete:Hb}},{commandName:"services",description:"Manage services",endpoints:{list:GA,get:vA}},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:Wb,get:Zb,create:Xb,update:Jb,delete:ex}},{commandName:"teams",description:"Manage teams",endpoints:{list:tx,get:rx,create:nx,update:ox,delete:ix}}];function sx(e,t){for(let r of Cj)ax(e,r,t)}var rr=require("node:fs"),Ju=require("node:os"),Bo=require("node:path");function Pj(e,t){let r=e.slice(0,t).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}function Uj(e,t,r){let o=e.split(/\r\n|\n|\r/g),i="",a=(Math.log10(t+1)|0)+1;for(let p=t-1;p<=t+1;p++){let u=o[p-1];u&&(i+=p.toString().padEnd(a," "),i+=": ",i+=u,i+=`
45
+ `,p===t&&(i+=" ".repeat(a+r+2),i+=`^
46
+ `))}return i}var q=class extends Error{line;column;codeblock;constructor(t,r){let[o,i]=Pj(r.toml,r.ptr),a=Uj(r.toml,o,i);super(`Invalid TOML document: ${t}
47
+
48
+ ${a}`,r),this.line=o,this.column=i,this.codeblock=a}};function Nj(e,t){let r=0;for(;e[t-++r]==="\\";);return--r&&r%2}function rp(e,t=0,r=e.length){let o=e.indexOf(`
49
+ `,t);return e[o-1]==="\r"&&o--,o<=r?o:-1}function Fo(e,t){for(let r=t;r<e.length;r++){let o=e[r];if(o===`
50
+ `)return r;if(o==="\r"&&e[r+1]===`
51
+ `)return r+1;if(o<" "&&o!==" "||o==="\x7F")throw new q("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function St(e,t,r,o){let i;for(;;){for(;(i=e[t])===" "||i===" "||!r&&(i===`
52
+ `||i==="\r"&&e[t+1]===`
53
+ `);)t++;if(o||i!=="#")break;t=Fo(e,t)}return t}function px(e,t,r,o,i=!1){if(!o)return t=rp(e,t),t<0?e.length:t;for(let a=t;a<e.length;a++){let p=e[a];if(p==="#")a=rp(e,a);else{if(p===r)return a+1;if(p===o||i&&(p===`
54
+ `||p==="\r"&&e[a+1]===`
55
+ `))return a}}throw new q("cannot find end of structure",{toml:e,ptr:t})}function np(e,t){let r=e[t],o=r===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):r;t+=o.length-1;do t=e.indexOf(o,++t);while(t>-1&&r!=="'"&&Nj(e,t));return t>-1&&(t+=o.length,o.length>1&&(e[t]===r&&t++,e[t]===r&&t++)),t}var Lj=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,ya=class e extends Date{#t=!1;#r=!1;#e=null;constructor(t){let r=!0,o=!0,i="Z";if(typeof t=="string"){let a=t.match(Lj);a?(a[1]||(r=!1,t=`0000-01-01T${t}`),o=!!a[2],o&&t[10]===" "&&(t=t.replace(" ","T")),a[2]&&+a[2]>23?t="":(i=a[3]||null,t=t.toUpperCase(),!i&&o&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=r,this.#r=o,this.#e=i)}isDateTime(){return this.#t&&this.#r}isLocal(){return!this.#t||!this.#r||!this.#e}isDate(){return this.#t&&!this.#r}isTime(){return this.#r&&!this.#t}isValid(){return this.#t||this.#r}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let r=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return r=this.#e[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,r="Z"){let o=new e(t);return o.#e=r,o}static wrapAsLocalDateTime(t){let r=new e(t);return r.#e=null,r}static wrapAsLocalDate(t){let r=new e(t);return r.#r=!1,r.#e=null,r}static wrapAsLocalTime(t){let r=new e(t);return r.#t=!1,r.#e=null,r}};var kj=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,wj=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,Mj=/^[+-]?0[0-9_]/,$j=/^[0-9a-f]{2,8}$/i,cx={b:"\b",t:" ",n:`
56
+ `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function op(e,t=0,r=e.length){let o=e[t]==="'",i=e[t++]===e[t]&&e[t]===e[t+1];i&&(r-=2,e[t+=2]==="\r"&&t++,e[t]===`
57
+ `&&t++);let a=0,p,u="",l=t;for(;t<r-1;){let f=e[t++];if(f===`
58
+ `||f==="\r"&&e[t]===`
59
+ `){if(!i)throw new q("newlines are not allowed in strings",{toml:e,ptr:t-1})}else if(f<" "&&f!==" "||f==="\x7F")throw new q("control characters are not allowed in strings",{toml:e,ptr:t-1});if(p){if(p=!1,f==="x"||f==="u"||f==="U"){let y=e.slice(t,t+=f==="x"?2:f==="u"?4:8);if(!$j.test(y))throw new q("invalid unicode escape",{toml:e,ptr:a});try{u+=String.fromCodePoint(parseInt(y,16))}catch{throw new q("invalid unicode escape",{toml:e,ptr:a})}}else if(i&&(f===`
60
+ `||f===" "||f===" "||f==="\r")){if(t=St(e,t-1,!0),e[t]!==`
61
+ `&&e[t]!=="\r")throw new q("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});t=St(e,t)}else if(f in cx)u+=cx[f];else throw new q("unrecognized escape sequence",{toml:e,ptr:a});l=t}else!o&&f==="\\"&&(a=t-1,p=!0,u+=e.slice(l,a))}return u+e.slice(l,r-1)}function mx(e,t,r,o){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return o?0n:0;let i=kj.test(e);if(i||wj.test(e)){if(Mj.test(e))throw new q("leading zeroes are not allowed",{toml:t,ptr:r});e=e.replace(/_/g,"");let p=+e;if(isNaN(p))throw new q("invalid number",{toml:t,ptr:r});if(i){if((i=!Number.isSafeInteger(p))&&!o)throw new q("integer value cannot be represented losslessly",{toml:t,ptr:r});(i||o===!0)&&(p=BigInt(e))}return p}let a=new ya(e);if(!a.isValid())throw new q("invalid value",{toml:t,ptr:r});return a}function Dj(e,t,r){let o=e.slice(t,r),i=o.indexOf("#");return i>-1&&(Fo(e,i),o=o.slice(0,i)),[o.trimEnd(),i]}function Ea(e,t,r,o,i){if(o===0)throw new q("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let a=e[t];if(a==="["||a==="{"){let[l,f]=a==="["?lx(e,t,o,i):ux(e,t,o,i);if(r){if(f=St(e,f),e[f]===",")f++;else if(e[f]!==r)throw new q("expected comma or end of structure",{toml:e,ptr:f})}return[l,f]}let p;if(a==='"'||a==="'"){p=np(e,t);let l=op(e,t,p);if(r){if(p=St(e,p),e[p]&&e[p]!==","&&e[p]!==r&&e[p]!==`
62
+ `&&e[p]!=="\r")throw new q("unexpected character encountered",{toml:e,ptr:p});p+=+(e[p]===",")}return[l,p]}p=px(e,t,",",r);let u=Dj(e,t,p-+(e[p-1]===","));if(!u[0])throw new q("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return r&&u[1]>-1&&(p=St(e,t+u[1]),p+=+(e[p]===",")),[mx(u[0],e,t,i),p]}var Gj=/^[a-zA-Z0-9-_]+[ \t]*$/;function ip(e,t,r="="){let o=t-1,i=[],a=e.indexOf(r,t);if(a<0)throw new q("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let p=e[t=++o];if(p!==" "&&p!==" ")if(p==='"'||p==="'"){if(p===e[t+1]&&p===e[t+2])throw new q("multiline strings are not allowed in keys",{toml:e,ptr:t});let u=np(e,t);if(u<0)throw new q("unfinished string encountered",{toml:e,ptr:t});o=e.indexOf(".",u);let l=e.slice(u,o<0||o>a?a:o),f=rp(l);if(f>-1)throw new q("newlines are not allowed in keys",{toml:e,ptr:t+o+f});if(l.trimStart())throw new q("found extra tokens after the string part",{toml:e,ptr:u});if(a<u&&(a=e.indexOf(r,u),a<0))throw new q("incomplete key-value: cannot find end of key",{toml:e,ptr:t});i.push(op(e,t,u))}else{o=e.indexOf(".",t);let u=e.slice(t,o<0||o>a?a:o);if(!Gj.test(u))throw new q("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});i.push(u.trimEnd())}}while(o+1&&o<a);return[i,St(e,a+1,!0,!0)]}function ux(e,t,r,o){let i={},a=new Set,p;for(t++;(p=e[t++])!=="}"&&p;){if(p===",")throw new q("expected value, found comma",{toml:e,ptr:t-1});if(p==="#")t=Fo(e,t);else if(p!==" "&&p!==" "&&p!==`
63
+ `&&p!=="\r"){let u,l=i,f=!1,[y,I]=ip(e,t-1);for(let Se=0;Se<y.length;Se++){if(Se&&(l=f?l[u]:l[u]={}),u=y[Se],(f=Object.hasOwn(l,u))&&(typeof l[u]!="object"||a.has(l[u])))throw new q("trying to redefine an already defined value",{toml:e,ptr:t});!f&&u==="__proto__"&&Object.defineProperty(l,u,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new q("trying to redefine an already defined value",{toml:e,ptr:t});let[x,le]=Ea(e,I,"}",r-1,o);a.add(x),l[u]=x,t=le}}if(!p)throw new q("unfinished table encountered",{toml:e,ptr:t});return[i,t]}function lx(e,t,r,o){let i=[],a;for(t++;(a=e[t++])!=="]"&&a;){if(a===",")throw new q("expected value, found comma",{toml:e,ptr:t-1});if(a==="#")t=Fo(e,t);else if(a!==" "&&a!==" "&&a!==`
64
+ `&&a!=="\r"){let p=Ea(e,t-1,"]",r-1,o);i.push(p[0]),t=p[1]}}if(!a)throw new q("unfinished array encountered",{toml:e,ptr:t});return[i,t]}function dx(e,t,r,o){let i=t,a=r,p,u=!1,l;for(let f=0;f<e.length;f++){if(f){if(i=u?i[p]:i[p]={},a=(l=a[p]).c,o===0&&(l.t===1||l.t===2))return null;if(l.t===2){let y=i.length-1;i=i[y],a=a[y].c}}if(p=e[f],(u=Object.hasOwn(i,p))&&a[p]?.t===0&&a[p]?.d)return null;u||(p==="__proto__"&&(Object.defineProperty(i,p,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,p,{enumerable:!0,configurable:!0,writable:!0})),a[p]={t:f<e.length-1&&o===2?3:o,d:!1,i:0,c:{}})}if(l=a[p],l.t!==o&&!(o===1&&l.t===3)||(o===2&&(l.d||(l.d=!0,i[p]=[]),i[p].push(i={}),l.c[l.i++]=l={t:1,d:!1,i:0,c:{}}),l.d))return null;if(l.d=!0,o===1)i=u?i[p]:i[p]={};else if(o===0&&u)return null;return[p,i,l.c]}function Yu(e,{maxDepth:t=1e3,integersAsBigInt:r}={}){let o={},i={},a=o,p=i;for(let u=St(e,0);u<e.length;){if(e[u]==="["){let l=e[++u]==="[",f=ip(e,u+=+l,"]");if(l){if(e[f[1]-1]!=="]")throw new q("expected end of table declaration",{toml:e,ptr:f[1]-1});f[1]++}let y=dx(f[0],o,i,l?2:1);if(!y)throw new q("trying to redefine an already defined table or value",{toml:e,ptr:u});p=y[2],a=y[1],u=f[1]}else{let l=ip(e,u),f=dx(l[0],a,p,0);if(!f)throw new q("trying to redefine an already defined table or value",{toml:e,ptr:u});let y=Ea(e,l[1],void 0,t,r);f[1][f[0]]=y[0],u=y[1]}if(u=St(e,u,!0),e[u]&&e[u]!==`
65
+ `&&e[u]!=="\r")throw new q("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:u});u=St(e,u)}return o}var fx=/^[a-z0-9-_]+$/i;function Ia(e){let t=typeof e;if(t==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return t}function vj(e){for(let t=0;t<e.length;t++)if(Ia(e[t])!=="object")return!1;return e.length!=0}function Qu(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function Wu(e,t,r,o){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");if(t==="number")return isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":o&&Number.isInteger(e)?e.toFixed(1):e.toString();if(t==="bigint"||t==="boolean")return e.toString();if(t==="string")return Qu(e);if(t==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(t==="object")return jj(e,r,o);if(t==="array")return Fj(e,r,o)}function jj(e,t,r){let o=Object.keys(e);if(o.length===0)return"{}";let i="{ ";for(let a=0;a<o.length;a++){let p=o[a];a&&(i+=", "),i+=fx.test(p)?p:Qu(p),i+=" = ",i+=Wu(e[p],Ia(e[p]),t-1,r)}return i+" }"}function Fj(e,t,r){if(e.length===0)return"[]";let o="[ ";for(let i=0;i<e.length;i++){if(i&&(o+=", "),e[i]===null||e[i]===void 0)throw new TypeError("arrays cannot contain null or undefined values");o+=Wu(e[i],Ia(e[i]),t-1,r)}return o+" ]"}function Bj(e,t,r,o){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let i="";for(let a=0;a<e.length;a++)i+=`${i&&`
66
+ `}[[${t}]]
67
+ `,i+=Zu(0,e[a],t,r,o);return i}function Zu(e,t,r,o,i){if(o===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let a="",p="",u=Object.keys(t);for(let l=0;l<u.length;l++){let f=u[l];if(t[f]!==null&&t[f]!==void 0){let y=Ia(t[f]);if(y==="symbol"||y==="function")throw new TypeError(`cannot serialize values of type '${y}'`);let I=fx.test(f)?f:Qu(f);if(y==="array"&&vj(t[f]))p+=(p&&`
68
+ `)+Bj(t[f],r?`${r}.${I}`:I,o-1,i);else if(y==="object"){let x=r?`${r}.${I}`:I;p+=(p&&`
69
+ `)+Zu(x,t[f],x,o-1,i)}else a+=I,a+=" = ",a+=Wu(t[f],y,o,i),a+=`
70
+ `}}return e&&(a||!p)&&(a=a?`[${e}]
71
+ ${a}`:`[${e}]`),a&&p?`${a}
72
+ ${p}`:a||p}function Xu(e,{maxDepth:t=1e3,numbersAsFloat:r=!1}={}){if(Ia(e)!=="object")throw new TypeError("stringify can only be called with an object");let o=Zu(0,e,"",t,r);return o[o.length-1]!==`
73
+ `?o+`
74
+ `:o}function Tx(e,t){let r=`${e}.tmp.${process.pid}`;(0,rr.writeFileSync)(r,t),(0,rr.renameSync)(r,e)}function _x(e){try{return(0,rr.readFileSync)(e,"utf8")}catch(t){if(t.code==="ENOENT")return;throw t}}function hx(e,t){if(t===void 0)return;let r=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,rr.writeFileSync)(r,t),r}function gx(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var qj={CLAUDE_CODE_ENABLE_TELEMETRY:"1",CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:"1",OTEL_METRICS_EXPORTER:"otlp",OTEL_LOGS_EXPORTER:"otlp",OTEL_TRACES_EXPORTER:"otlp",OTEL_EXPORTER_OTLP_PROTOCOL:"http/json",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"delta"};function Hj(e,t,r,o){let i=(0,Bo.join)(e,".claude","settings.json");$t(`Claude Code \u2192 ${i}`),(0,rr.mkdirSync)((0,Bo.dirname)(i),{recursive:!0});let a=_x(i),p;try{p=JSON.parse(a??"{}")}catch{throw new Error(`${i} is not valid JSON. Fix or remove it before re-running.`)}if(!gx(p))throw new Error(`${i} must contain a JSON object at the top level.`);let u=p.env??{};if(!gx(u))throw new Error(`${i} "env" must be a JSON object.`);let l=o?"1":"0";p.env={...u,...qj,OTEL_EXPORTER_OTLP_ENDPOINT:t,OTEL_LOG_USER_PROMPTS:l,OTEL_LOG_TOOL_DETAILS:l,OTEL_LOG_TOOL_CONTENT:l,OTEL_EXPORTER_OTLP_HEADERS:`Authorization=Bearer ${r}`};let f=hx(i,a);Tx(i,`${JSON.stringify(p,null,2)}
75
+ `),$t(f===void 0?" created":` patched (backup: ${f})`)}function Kj(e,t,r){return{environment:"dev",log_user_prompt:r,exporter:{"otlp-http":{endpoint:`${e}/v1/logs`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}},trace_exporter:{"otlp-http":{endpoint:`${e}/v1/traces`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}}}}function zj(e,t,r,o){let i=(0,Bo.join)(e,".codex"),a=(0,Bo.join)(i,"config.toml");$t(`Codex \u2192 ${a}`),(0,rr.mkdirSync)(i,{recursive:!0});let p=_x(a),u=p===void 0?{}:Yu(p),l="otel"in u;delete u.otel,u.otel=Kj(t,r,o);let f=hx(a,p);Tx(a,Xu(u)),$t(f===void 0?" created":l?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function yx(){return new Rp("--endpoint <url>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function Ex(){return new Rp("--ingestion-api-key <key>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var Ix="Restart your claude / codex session to load the new config.";function Ox(e){let t=e.command("setup").description("Configure local LLM CLIs to ship OTEL telemetry to Tsuga");t.command("claude-code").description("Patch ~/.claude/settings.json with Tsuga OTEL env").addOption(yx()).addOption(Ex()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(r=>{Hj((0,Ju.homedir)(),r.endpoint.replace(/\/+$/,""),r.ingestionApiKey,r.includePrompts),$t(Ix)}),t.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings").addOption(yx()).addOption(Ex()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(r=>{zj((0,Ju.homedir)(),r.endpoint.replace(/\/+$/,""),r.ingestionApiKey,r.includePrompts),$t(Ix)})}var ap="/v0/logs";var Ta=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var Vj=0,Yj=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String()),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String()))},{additionalProperties:!0})),message:n.Optional(n.Unknown()),timestamp:n.Number(),level:n.Enum(Ta)},{additionalProperties:!0});var Qj="log_timestamp",Wj=n.Union([n.Literal(Qj)]),vn={...yt.properties,query:n.Optional(m({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e3})),shouldRecommendAttributes:n.Optional(n.Boolean()),triggeredBy:n.Optional(n.Literal("refresh")),startOffset:n.Optional(n.Number({minimum:Vj})),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."})),sortBy:n.Optional(Wj),sortDirection:n.Optional(n.Union([n.Literal("asc"),n.Literal("desc")]))},Yqe=d({tags:["logs"],url:`${ap}/count`,method:"GET",query:n.Pick(n.Object(vn),["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),el=n.Object({value:n.String(),priority:n.Number()}),Qqe=d({tags:["logs"],url:`${ap}/search`,method:"GET",query:n.Object(vn),response:n.Object({logs:n.Optional(n.Array(Yj)),attributesToHighlight:n.Optional(n.Array(el))},{additionalProperties:!0})}),Zj=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),Xj=n.Object({id:n.String(),pattern:n.Array(Zj),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),Wqe=d({tags:["logs"],url:`${ap}/patterns`,method:"GET",query:n.Object({...yt.properties,query:m({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({patterns:n.Array(Xj),sampleSize:n.Number()})}),Zqe=d({tags:["logs"],url:`${ap}/attributes`,method:"GET",query:n.Object({...yt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({attributes:n.Array(n.String())})});var _a=`/${"v1"}/logs`,tl=n.Object({context:n.Optional(n.Object({team:n.Optional(n.String())},{additionalProperties:!0,$id:"LogContext"})),message:n.Optional(n.Unknown()),timestamp:n.Number(),level:n.Enum(Ta)},{additionalProperties:!0,$id:"LogEvent"}),Jj={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(tl,{examples:[Jj]});var eF={query:"level:ERROR",maxResults:100,from:1704067200,to:1704067200},Ax=n.Object({...n.Pick(n.Object(vn),["query","maxResults","clusterId"]).properties,...Et.properties});Object.assign(Ax,{examples:[eF]});var Sx=d({description:"Search logs",operationId:"searchLogs",tags:["public","logs"],url:`${_a}/search`,method:"GET",query:Ax,response:n.Object({logs:n.Array(tl)})}),tF=n.Object({pattern:n.String({description:"The pattern formatted as a string"}),size:n.Integer({description:"Number of logs that matched the pattern"}),groups:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),bx=n.Object({patterns:n.Array(tF),sampleSize:n.Number()}),rF={patterns:[{pattern:"Resolved segment SegmentId([0:1]) from cache",size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(bx,{examples:[rF]});var xx=d({description:"Get log patterns",operationId:"getLogPatterns",tags:["public","logs"],url:`${_a}/patterns`,method:"GET",query:n.Object({...Et.properties,query:m({type:"tsuga-query"}),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:bx}),nF=n.Object({exampleLog:n.Optional(tl),team:n.String(),env:n.String(),service:n.String(),firstSeen:n.Number({description:"Timestamp in milliseconds when this pattern was first seen"}),lastSeen:n.Number({description:"Timestamp in milliseconds when this pattern was last seen"})}),Rx=n.Object({newErrorPatterns:n.Array(nF)}),oF={newErrorPatterns:[{team:"platform",env:"production",service:"api-gateway",firstSeen:17040672e5,lastSeen:17041536e5,exampleLog:{message:"ConnectionError: Failed to connect to database",timestamp:17041536e5,level:"ERROR"}}]};Object.assign(Rx,{examples:[oF]});var Cx=d({description:"Get new error patterns",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${_a}/patterns/new`,method:"GET",query:n.Object({...Et.properties,team:n.Optional(m()),env:n.Optional(m()),service:n.Optional(m()),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:Rx}),iF=n.Object({team:n.String(),env:n.String(),pattern:n.String({description:"The error pattern formatted"}),increaseTimestamps:n.Array(n.Number({description:"Timestamps in milliseconds when there were increases in this pattern"}))}),Px=n.Object({errorPatternIncreases:n.Array(iF)}),aF={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(Px,{examples:[aF]});var Ux=d({description:"Get error pattern increases for a given team",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${_a}/patterns/increase`,method:"GET",query:n.Object({...Et.properties,team:m(),env:n.Optional(m()),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:Px}),Nx=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})}),sF={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(Nx,{examples:[sF]});var pF=n.Object({...Et.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),Lx=d({description:"Get log attributes",operationId:"getLogAttributes",tags:["public","logs"],url:`${_a}/attributes`,method:"GET",query:pF,response:Nx});var _r="/v0/metrics",cF=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(Ta)},{additionalProperties:!0}),uHe=d({tags:["metrics"],url:`${_r}/count`,method:"GET",query:n.Pick(n.Object(vn),["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),lHe=d({tags:["metrics"],url:`${_r}/search`,method:"GET",query:n.Object(vn),response:n.Object({logs:n.Optional(n.Array(cF)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(el))},{additionalProperties:!0})}),sp=n.Enum(["counter","gauge","histogram","summary"]),rl=n.Enum(["delta","cumulative","none"]),mF=n.Object({capabilities:n.Optional(n.Array(n.String())),description:n.Optional(n.String()),tags:n.Optional(n.Array(n.String())),temporality:n.Optional(rl),type:n.Optional(sp),unit:n.Optional(n.String())}),dHe=d({url:`${_r}/metadata`,method:"GET",query:n.Object({...yt.properties,metricName:m({allowEmpty:!1}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:mF}),fHe=d({tags:["metrics"],url:_r,method:"GET",query:n.Object({...yt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),nl=n.Array(n.Object({name:n.String(),type:sp}),{description:"List of metric names and their types"}),gHe=d({tags:["metrics"],url:`${_r}/names-and-types`,method:"GET",query:n.Object({...yt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:nl}),pp=n.Array(n.String(),{description:"List of attribute names"}),yHe=d({tags:["metrics"],url:`${_r}/attributes`,method:"GET",query:n.Object({...yt.properties,metricName:m({allowEmpty:!1}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:pp}),EHe=d({tags:["metrics"],url:`${_r}/attributes/batch`,method:"GET",query:n.Object({...yt.properties,metricNames:n.Array(m({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:pp}),ol=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"]),id:n.String(),name:n.String(),owner:n.String()},{description:"An asset that uses a metric"}),{description:"List of assets (dashboards and monitors) using this metric"})}),IHe=d({tags:["metrics"],url:`${_r}/assets-usage`,method:"GET",query:n.Object({metricName:m({allowEmpty:!1})}),response:ol}),THe=d({url:`${_r}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:m(),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Array(n.String())});var il=`/${"v1"}/metrics`,uF=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(nl,{examples:[uF]});var al=n.Object({name:n.String({description:"Name of the metric"}),type:sp,description:n.Optional(n.String({description:"Human-readable description of the metric"})),unit:n.Optional(n.String({description:"Unit of the metric"})),temporality:n.Optional(rl),capabilities:n.Optional(n.Array(n.String(),{description:"Supported capabilities, an empty array means all capabilities are supported"})),attributes:n.Optional(n.Array(n.String(),{description:"Metric attributes"}))}),lF={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"]};Object.assign(al,{examples:[lF]});var kx=n.Object({...Et.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),wx=d({description:"Get all metrics with their metadata",operationId:"listMetrics",tags:["public","metrics"],url:il,method:"GET",query:kx,response:n.Array(al)}),Mx=d({description:"Retrieve a metric by name with its metadata",operationId:"getMetric",tags:["public","metrics"],url:`${il}/:name`,method:"GET",params:n.Object({name:m({allowEmpty:!1,description:"The metric name"})}),query:kx,response:al}),dF=["service","env","host","method","status_code"];Object.assign(pp,{examples:[dF]});var $x=n.Pick(ol,["assets"]),fF={assets:[{type:"dashboard",id:"dash-123-abc",name:"API Performance Overview",owner:"user-456-def"},{type:"monitor",id:"mon-789-ghi",name:"High Latency Alert",owner:"user-456-def"}]};Object.assign($x,{examples:[fF]});var Dx=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${il}/assets-usage`,method:"GET",query:n.Object({metricName:m({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:$x});var gF=`/${"v1"}/traces`,Gx=n.Object({context:n.Optional(n.Object({service:n.Optional(n.Object({name:n.Optional(n.String()),version:n.Optional(n.String())},{additionalProperties:!0}))},{additionalProperties:!0})),parentSpanId:n.Optional(n.String()),resourceAttributes:n.Object({},{additionalProperties:!0}),spanAttributes:n.Object({},{additionalProperties:!0}),duration:n.Number({description:"In milliseconds."}),startTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),endTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:n.Optional(n.Object({message:n.String()})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0}),event_name:n.String(),event_timestamp_nanos:n.String()}))),spanId:n.String(),span:n.Object({kind:n.String(),name:n.String()}),statusCode:n.Optional(n.String()),traceId:n.String()},{additionalProperties:!0,$id:"SpanEvent"}),yF={context:{service:{name:"my-service",version:"1.0.0"}},parentSpanId:"187a47da1b2560f8",resourceAttributes:{},spanAttributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,startTime:"1770923469995353600",endTime:"1770923470019349500",spanId:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},statusCode:"ok",traceId:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(Gx,{examples:[yF]});var EF={from:1704067200,to:1704067200,query:"context.service.name:my-service",maxResults:100},vx=n.Object({...Et.properties,query:n.Optional(m({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4})),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))});Object.assign(vx,{examples:[EF]});var jx=d({description:"Search spans",operationId:"searchSpans",tags:["public","traces"],url:`${gF}/search`,method:"GET",query:vx,response:n.Object({spans:n.Array(Gx)})});var qx=["timestamp","level","message"],Hx=["count","ratio","team","level","pattern"];function It(e,t){let r=t??Er(e);if(!r)throw new Error(`--${e} is required`);return _s(r)}function Fx(e){let t={from:It("from",e.from),to:It("to",e.to)},r=e.query??Er("query");r!==void 0&&(t.query=r);let o=e.maxResults??Er("max-results");if(o!==void 0){let i=Number(o);if(Number.isNaN(i))throw new Error(`--max-results must be a number (got: ${o})`);t.maxResults=i}return t}function we(e){let t=Er(e);return t===void 0?"":` (default: ${t})`}function IF(e){let t=Cc(e.output),r=e.fields===void 0?void 0:Pc(e.fields);return t==="json"?{format:t,fields:r}:{format:t,fields:r??qx}}function TF(e){let t=Cc(e.output),r=e.fields===void 0?void 0:Pc(e.fields);return t==="json"?{format:t,fields:r}:{format:t,fields:r??Hx}}function Bx(e,t){let r={count:e.size,ratio:t>0?e.size/t:0,pattern:e.pattern};for(let{key:o,value:i}of e.groups)o==="context.team"?r.team=i:r[o]=i;return r}function _F(e,t){if(t.format==="json"){if(t.fields===void 0){re(e);return}let{fields:i}=t;re({patterns:e.patterns.map(a=>Bx(a,e.sampleSize)).map(a=>Uc(a,i)),sampleSize:e.sampleSize});return}let r=e.patterns.map(i=>Bx(i,e.sampleSize)),o=Nc(t.format,r,t.fields);o.length>0&&$t(o)}function hF(e,t){if(t.format==="json"){if(t.fields===void 0){re(e);return}let{fields:o}=t;re({logs:e.logs.map(i=>Uc(i,o))});return}let r=Nc(t.format,e.logs,t.fields);r.length>0&&$t(r)}function Kx(e,t){let r=e.command("logs").description("Search and analyze logs");r.command("search").description("Search logs").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).option("--query <query>",`Search query${we("query")}`).option("--max-results <n>",`Maximum number of results${we("max-results")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${qx.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async p=>{let u=IF(p),l=await t()(Sx,{query:Fx(p)});hF(l,u)}),r.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).action(async p=>{let u=await t()(Lx,{query:{from:It("from",p.from),to:It("to",p.to)}});re(u)}),r.command("patterns").description("List log patterns").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).option("--query <query>",`Search query${we("query")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each pattern (default for --output=tsv|csv: ${Hx.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async p=>{let u=TF(p),l={from:It("from",p.from),to:It("to",p.to)},f=p.query??Er("query");f!==void 0&&(l.query=f);let y=await t()(xx,{query:l});_F(y,u)}),r.command("new-error-patterns").description("List new error patterns").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).option("--team <team>","Filter by team").option("--env <env>","Filter by environment").option("--service <service>","Filter by service").action(async p=>{let u={from:It("from",p.from),to:It("to",p.to)};p.team!==void 0&&(u.team=p.team),p.env!==void 0&&(u.env=p.env),p.service!==void 0&&(u.service=p.service);let l=await t()(Cx,{query:u});re(l)}),r.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).requiredOption("--team <team>","Team to query").option("--env <env>","Filter by environment").action(async p=>{let u={from:It("from",p.from),to:It("to",p.to),team:p.team};p.env!==void 0&&(u.env=p.env);let l=await t()(Ux,{query:u});re(l)});let o=e.command("metrics").description("List and inspect metrics");o.command("list").description("List all metrics with their metadata").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).action(async p=>{let u=await t()(wx,{query:{from:It("from",p.from),to:It("to",p.to)}});re(u)}),o.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).action(async(p,u)=>{let l=await t()(Mx,{params:{name:p},query:{from:It("from",u.from),to:It("to",u.to)}});re(l)}),o.command("assets-usage <name>").description("List dashboards and monitors that use a specific metric").action(async p=>{let u=await t()(Dx,{query:{metricName:p}});re(u)}),e.command("traces").description("Search traces").command("search").description("Search spans").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).option("--query <query>",`Search query${we("query")}`).option("--max-results <n>",`Maximum number of results${we("max-results")}`).action(async p=>{let u=await t()(jx,{query:Fx(p)});re(u)});let a=e.command("aggregation").description("Run aggregation queries");qi(a,"scalar","Run aggregation queries and return scalar results",w_,t),qi(a,"timeseries","Run aggregation queries and return timeseries results",M_,t)}var OF=3e3,AF="https://registry.npmjs.org/@tsuga/cli/latest";function SF(e,t){let r=e.split(".").map(Number),o=t.split(".").map(Number);for(let i=0;i<Math.max(r.length,o.length);i++){let a=r[i]??0,p=o[i]??0;if(a>p)return!0;if(a<p)return!1}return!1}async function zx(e){try{let t=YA();if(t&&Date.now()-t<Ts)return;let r=await fetch(AF,{signal:AbortSignal.timeout(OF)});if(!r.ok)return;let i=(await r.json()).version;SF(i,e)&&(process.stderr.write(`
43
76
  Update available: ${e} \u2192 ${i}
44
- `),process.stderr.write("Run `npm install -g @tsuga/cli` to update\n")),SA(Date.now())}catch{}}var xt=new Zu().name("tsuga").description("Tsuga CLI - manage resources from the command line").version("1.0.11").option("--operation-api-key <operation-api-key>","Operation API key").option("--cluster <cluster-id>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),$u;function Ro(){if(!$u){let e=xt.opts(),t=zc({operationApiKey:e.operationApiKey,clusterId:e.cluster});t.operationApiKey||(console.error("Error: Operation API key is required. Set it with one of:"),console.error(" tsuga auth <operation-api-key>"),console.error(" export TSUGA_OPERATION_API_KEY=<operation-api-key>"),console.error(" tsuga --operation-api-key <operation-api-key> <command>"),process.exit(1)),$u=fT(t.apiUrl,t.operationApiKey,t.clusterId)}return $u}xt.command("auth <operation-api-key>").description("Save Operation API key to ~/.config/tsuga/config.json").action(e=>{Vc({operationApiKey:e}),process.stdout.write(`Operation API key saved to ${Yc()}
45
- `)});xt.command("config").description("Show current configuration").action(()=>{if(!TA()){process.stdout.write(`No config found. Run: tsuga auth <operation-api-key>
46
- `);return}let e=xt.opts(),t=zc({operationApiKey:e.operationApiKey,clusterId:e.cluster}),r=[`API URL: ${t.apiUrl}`];t.operationApiKey?r.push(`Operation API key: ${t.operationApiKey.slice(0,12)}...${t.operationApiKey.slice(-4)}`):r.push("Operation API key: (not set)"),r.push(`Cluster: ${t.clusterId??"(not set)"}`),r.push(`Config: ${Yc()}`),process.stdout.write(`${r.join(`
47
- `)}
48
- `)});var tx=xt.command("defaults").description("Show or manage default values for command flags").action(()=>{let e=_A(),t={...Qc,...e},r=["Defaults (custom overrides marked with *):"];for(let[o,i]of Object.entries(t)){let s=o in e?" *":"";r.push(` ${o}: ${i}${s}`)}process.stdout.write(`${r.join(`
49
- `)}
50
- `)});tx.command("set <key> <value>").description("Set a custom default value").action((e,t)=>{hA(e,t),process.stdout.write(`Default set: ${e} = ${t}
51
- `)});tx.command("reset").description("Clear all custom defaults").action(()=>{OA(),process.stdout.write(`Custom defaults cleared
52
- `)});Lb(xt,Ro);Jb(xt,Ro);xA(xt,Ro);MT(xt,Ro);CT(xt,Ro);cA(xt,Ro);xt.parseAsync().then(()=>ex("1.0.11")).catch(e=>{console.error(dT(e)),process.exitCode=1});
77
+ `),process.stderr.write("Run `npm install -g @tsuga/cli` to update\n")),QA(Date.now())}catch{}}var ot=new Al().name("tsuga").description("Tsuga CLI - manage resources from the command line").version("1.0.13").option("--operation-api-key <operation-api-key>","Operation API key").option("--cluster <cluster-id>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),sl,Vx;function jn(){if(!sl){let e=ot.opts(),t=fu({operationApiKey:e.operationApiKey,clusterId:e.cluster});t.operationApiKey||(console.error("Error: Operation API key is required. Set it with one of:"),console.error(" tsuga auth <operation-api-key>"),console.error(" export TSUGA_OPERATION_API_KEY=<operation-api-key>"),console.error(" tsuga --operation-api-key <operation-api-key> <command>"),process.exit(1)),sl=jT(t.apiUrl,t.operationApiKey,t.clusterId,()=>Vx)}return sl}ot.command("auth <operation-api-key>").description("Save Operation API key to ~/.config/tsuga/config.json").action(e=>{gu({operationApiKey:e}),process.stdout.write(`Operation API key saved to ${yu()}
78
+ `)});var Yx=ot.command("config").description("Show or manage configuration").action(()=>{let e=ot.opts(),t=fu({operationApiKey:e.operationApiKey,clusterId:e.cluster});qA()||process.stdout.write(`No saved config. Run: tsuga auth <operation-api-key>
79
+
80
+ `),process.stdout.write(VA(t,yu()))});Yx.command("set").description("Set a configuration value").command("default <key> <value>").description("Set a custom default value for a command flag").allowUnknownOption(!0).action((e,t)=>{KA(e,t),process.stdout.write(`Default set: ${e} = ${t}
81
+ `)});Yx.command("reset").description("Reset configuration values").command("defaults").description("Clear all custom defaults").action(()=>{zA(),process.stdout.write(`Custom defaults cleared
82
+ `)});var bF=new Set(ot.commands);sx(ot,jn);Kx(ot,jn);ZA(ot,jn);r_(ot,jn);wA(ot,jn);WT(ot,jn);LA(ot,jn);Ox(ot);function Qx(e){for(let t of e.commands)t.commands.length===0&&t.option("--rationale <text>",'Why you are making this call, e.g. "confirming the deploy caused the error spike". Recorded to explain intent; does not affect the result.'),Qx(t)}for(let e of ot.commands)bF.has(e)||Qx(e);ot.hook("preAction",(e,t)=>{let{rationale:r}=t.opts();Vx=r});ot.parseAsync().then(()=>zx("1.0.13")).catch(e=>{console.error(vT(e)),process.exitCode=1});
53
83
  /**
54
84
  * The following is a list of HTTP status codes and their meanings.
55
85
  *
@@ -57,3 +87,42 @@ Update available: ${e} \u2192 ${i}
57
87
  * @see https://www.npmjs.com/package/http-status-codes
58
88
  * @license MIT
59
89
  */
90
+ /*! Bundled license information:
91
+
92
+ smol-toml/dist/error.js:
93
+ smol-toml/dist/util.js:
94
+ smol-toml/dist/date.js:
95
+ smol-toml/dist/primitive.js:
96
+ smol-toml/dist/extract.js:
97
+ smol-toml/dist/struct.js:
98
+ smol-toml/dist/parse.js:
99
+ smol-toml/dist/stringify.js:
100
+ smol-toml/dist/index.js:
101
+ (*!
102
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
103
+ * SPDX-License-Identifier: BSD-3-Clause
104
+ *
105
+ * Redistribution and use in source and binary forms, with or without
106
+ * modification, are permitted provided that the following conditions are met:
107
+ *
108
+ * 1. Redistributions of source code must retain the above copyright notice, this
109
+ * list of conditions and the following disclaimer.
110
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
111
+ * this list of conditions and the following disclaimer in the
112
+ * documentation and/or other materials provided with the distribution.
113
+ * 3. Neither the name of the copyright holder nor the names of its contributors
114
+ * may be used to endorse or promote products derived from this software without
115
+ * specific prior written permission.
116
+ *
117
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
118
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
119
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
120
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
121
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
122
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
123
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
124
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
125
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
126
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
127
+ *)
128
+ */