cdk-insights 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -77,7 +77,7 @@ ${JSON.stringify(J)}`}).join(`
77
77
  `)!=-1,n=this._styles,r=n.length;r--;){var i=Js[n[r]];t=i.open+t.replace(i.closeRe,i.open)+i.close,s&&(t=t.replace(ZI,function(o){return i.close+o+i.open}))}return t}ue.setTheme=function(e){if(typeof e=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var t in e)(function(s){ue[s]=function(n){if(typeof e[s]=="object"){var r=n;for(var i in e[s])r=ue[e[s][i]](r);return r}return ue[e[s]](n)}})(t)};function eT(){var e={};return Object.keys(xb).forEach(function(t){e[t]={get:function(){return Cb([t])}}}),e}var tT=function(t,s){var n=s.split("");return n=n.map(t),n.join("")};ue.trap=ub();ue.zalgo=pb();ue.maps={};ue.maps.america=mb()(ue);ue.maps.zebra=gb()(ue);ue.maps.rainbow=yb()(ue);ue.maps.random=bb()(ue);for(vb in ue.maps)(function(e){ue[e]=function(t){return tT(ue.maps[e],t)}})(vb);var vb;Sb(ue,eT())});var Rb=R((O8,Eb)=>{var sT=Fb();Eb.exports=sT});var kb=R((B8,bo)=>{var{info:nT,debug:Tb}=yo(),ut=hu(),bu=class e{constructor(t){this.setOptions(t),this.x=null,this.y=null}setOptions(t){["boolean","number","bigint","string"].indexOf(typeof t)!==-1&&(t={content:""+t}),t=t||{},this.options=t;let s=t.content;if(["boolean","number","bigint","string"].indexOf(typeof s)!==-1)this.content=String(s);else if(!s)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof s);this.colSpan=t.colSpan||1,this.rowSpan=t.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(t,s){this.cells=s;let n=this.options.chars||{},r=t.chars,i=this.chars={};iT.forEach(function(c){Du(n,r,c,i)}),this.truncate=this.options.truncate||t.truncate;let o=this.options.style=this.options.style||{},a=t.style;Du(o,a,"padding-left",this),Du(o,a,"padding-right",this),this.head=o.head||a.head,this.border=o.border||a.border,this.fixedWidth=t.colWidths[this.x],this.lines=this.computeLines(t),this.desiredWidth=ut.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(t){let s=t.wordWrap||t.textWrap,{wordWrap:n=s}=this.options;if(this.fixedWidth&&n){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let o=1;for(;o<this.colSpan;)this.fixedWidth+=t.colWidths[this.x+o],o++}let{wrapOnWordBoundary:r=!0}=t,{wrapOnWordBoundary:i=r}=this.options;return this.wrapLines(ut.wordWrap(this.fixedWidth,this.content,i))}return this.wrapLines(this.content.split(`
78
78
  `))}wrapLines(t){let s=ut.colorizeLines(t);return this.href?s.map(n=>ut.hyperlink(this.href,n)):s}init(t){let s=this.x,n=this.y;this.widths=t.colWidths.slice(s,s+this.colSpan),this.heights=t.rowHeights.slice(n,n+this.rowSpan),this.width=this.widths.reduce(Ib,-1),this.height=this.heights.reduce(Ib,-1),this.hAlign=this.options.hAlign||t.colAligns[s],this.vAlign=this.options.vAlign||t.rowAligns[n],this.drawRight=s+this.colSpan==t.colWidths.length}draw(t,s){if(t=="top")return this.drawTop(this.drawRight);if(t=="bottom")return this.drawBottom(this.drawRight);let n=ut.truncate(this.content,10,this.truncate);t||nT(`${this.y}-${this.x}: ${this.rowSpan-t}x${this.colSpan} Cell ${n}`);let r=Math.max(this.height-this.lines.length,0),i;switch(this.vAlign){case"center":i=Math.ceil(r/2);break;case"bottom":i=r;break;default:i=0}if(t<i||t>=i+this.lines.length)return this.drawEmpty(this.drawRight,s);let o=this.lines.length>this.height&&t+1>=this.height;return this.drawLine(t-i,this.drawRight,o,s)}drawTop(t){let s=[];return this.cells?this.widths.forEach(function(n,r){s.push(this._topLeftChar(r)),s.push(ut.repeat(this.chars[this.y==0?"top":"mid"],n))},this):(s.push(this._topLeftChar(0)),s.push(ut.repeat(this.chars[this.y==0?"top":"mid"],this.width))),t&&s.push(this.chars[this.y==0?"topRight":"rightMid"]),this.wrapWithStyleColors("border",s.join(""))}_topLeftChar(t){let s=this.x+t,n;if(this.y==0)n=s==0?"topLeft":t==0?"topMid":"top";else if(s==0)n="leftMid";else if(n=t==0?"midMid":"bottomMid",this.cells&&(this.cells[this.y-1][s]instanceof e.ColSpanCell&&(n=t==0?"topMid":"mid"),t==0)){let i=1;for(;this.cells[this.y][s-i]instanceof e.ColSpanCell;)i++;this.cells[this.y][s-i]instanceof e.RowSpanCell&&(n="leftMid")}return this.chars[n]}wrapWithStyleColors(t,s){if(this[t]&&this[t].length)try{let n=Rb();for(let r=this[t].length-1;r>=0;r--)n=n[this[t][r]];return n(s)}catch{return s}else return s}drawLine(t,s,n,r){let i=this.chars[this.x==0?"left":"middle"];if(this.x&&r&&this.cells){let d=this.cells[this.y+r][this.x-1];for(;d instanceof Mr;)d=this.cells[d.y][d.x-1];d instanceof Nr||(i=this.chars.rightMid)}let o=ut.repeat(" ",this.paddingLeft),a=s?this.chars.right:"",c=ut.repeat(" ",this.paddingRight),u=this.lines[t],l=this.width-(this.paddingLeft+this.paddingRight);n&&(u+=this.truncate||"\u2026");let p=ut.truncate(u,l,this.truncate);return p=ut.pad(p,l," ",this.hAlign),p=o+p+c,this.stylizeLine(i,p,a)}stylizeLine(t,s,n){return t=this.wrapWithStyleColors("border",t),n=this.wrapWithStyleColors("border",n),this.y===0&&(s=this.wrapWithStyleColors("head",s)),t+s+n}drawBottom(t){let s=this.chars[this.x==0?"bottomLeft":"bottomMid"],n=ut.repeat(this.chars.bottom,this.width),r=t?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",s+n+r)}drawEmpty(t,s){let n=this.chars[this.x==0?"left":"middle"];if(this.x&&s&&this.cells){let o=this.cells[this.y+s][this.x-1];for(;o instanceof Mr;)o=this.cells[o.y][o.x-1];o instanceof Nr||(n=this.chars.rightMid)}let r=t?this.chars.right:"",i=ut.repeat(" ",this.width);return this.stylizeLine(n,i,r)}},Mr=class{constructor(){}draw(t){return typeof t=="number"&&Tb(`${this.y}-${this.x}: 1x1 ColSpanCell`),""}init(){}mergeTableOptions(){}},Nr=class{constructor(t){this.originalCell=t}init(t){let s=this.y,n=this.originalCell.y;this.cellOffset=s-n,this.offset=rT(t.rowHeights,n,this.cellOffset)}draw(t){return t=="top"?this.originalCell.draw(this.offset,this.cellOffset):t=="bottom"?this.originalCell.draw("bottom"):(Tb(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+t))}mergeTableOptions(){}};function wb(...e){return e.filter(t=>t!=null).shift()}function Du(e,t,s,n){let r=s.split("-");r.length>1?(r[1]=r[1].charAt(0).toUpperCase()+r[1].substr(1),r=r.join(""),n[r]=wb(e[r],e[s],t[r],t[s])):n[s]=wb(e[s],t[s])}function rT(e,t,s){let n=e[t];for(let r=1;r<s;r++)n+=1+e[t+r];return n}function Ib(e,t){return e+t+1}var iT=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];bo.exports=bu;bo.exports.ColSpanCell=Mr;bo.exports.RowSpanCell=Nr});var Pb=R((M8,Lb)=>{var{warn:oT,debug:aT}=yo(),vu=kb(),{ColSpanCell:cT,RowSpanCell:uT}=vu;(function(){function e(f,m){return f[m]>0?e(f,m+1):m}function t(f){let m={};f.forEach(function(g,h){let y=0;g.forEach(function(D){D.y=h,D.x=h?e(m,y):y;let A=D.rowSpan||1,b=D.colSpan||1;if(A>1)for(let E=0;E<b;E++)m[D.x+E]=A;y=D.x+b}),Object.keys(m).forEach(D=>{m[D]--,m[D]<1&&delete m[D]})})}function s(f){let m=0;return f.forEach(function(g){g.forEach(function(h){m=Math.max(m,h.x+(h.colSpan||1))})}),m}function n(f){return f.length}function r(f,m){let g=f.y,h=f.y-1+(f.rowSpan||1),y=m.y,D=m.y-1+(m.rowSpan||1),A=!(g>D||y>h),b=f.x,E=f.x-1+(f.colSpan||1),T=m.x,k=m.x-1+(m.colSpan||1),S=!(b>k||T>E);return A&&S}function i(f,m,g){let h=Math.min(f.length-1,g),y={x:m,y:g};for(let D=0;D<=h;D++){let A=f[D];for(let b=0;b<A.length;b++)if(r(y,A[b]))return!0}return!1}function o(f,m,g,h){for(let y=g;y<h;y++)if(i(f,y,m))return!1;return!0}function a(f){f.forEach(function(m,g){m.forEach(function(h){for(let y=1;y<h.rowSpan;y++){let D=new uT(h);D.x=h.x,D.y=h.y+y,D.colSpan=h.colSpan,u(D,f[g+y])}})})}function c(f){for(let m=f.length-1;m>=0;m--){let g=f[m];for(let h=0;h<g.length;h++){let y=g[h];for(let D=1;D<y.colSpan;D++){let A=new cT;A.x=y.x+D,A.y=y.y,g.splice(h+1,0,A)}}}}function u(f,m){let g=0;for(;g<m.length&&m[g].x<f.x;)g++;m.splice(g,0,f)}function l(f){let m=n(f),g=s(f);aT(`Max rows: ${m}; Max cols: ${g}`);for(let h=0;h<m;h++)for(let y=0;y<g;y++)if(!i(f,y,h)){let D={x:y,y:h,colSpan:1,rowSpan:1};for(y++;y<g&&!i(f,y,h);)D.colSpan++,y++;let A=h+1;for(;A<m&&o(f,A,D.x,D.x+D.colSpan);)D.rowSpan++,A++;let b=new vu(D);b.x=D.x,b.y=D.y,oT(`Missing cell at ${b.y}-${b.x}.`),u(b,f[h])}}function p(f){return f.map(function(m){if(!Array.isArray(m)){let g=Object.keys(m)[0];m=m[g],Array.isArray(m)?(m=m.slice(),m.unshift(g)):m=[g,m]}return m.map(function(g){return new vu(g)})})}function d(f){let m=p(f);return t(m),l(m),a(m),c(m),m}Lb.exports={makeTableLayout:d,layoutTable:t,addRowSpanCells:a,maxWidth:s,fillInTable:l,computeWidths:_b("colSpan","desiredWidth","x",1),computeHeights:_b("rowSpan","desiredHeight","y",1)}})();function _b(e,t,s,n){return function(r,i){let o=[],a=[],c={};i.forEach(function(u){u.forEach(function(l){(l[e]||1)>1?a.push(l):o[l[s]]=Math.max(o[l[s]]||0,l[t]||0,n)})}),r.forEach(function(u,l){typeof u=="number"&&(o[l]=u)});for(let u=a.length-1;u>=0;u--){let l=a[u],p=l[e],d=l[s],f=o[d],m=typeof r[d]=="number"?0:1;if(typeof f=="number")for(let g=1;g<p;g++)f+=1+o[d+g],typeof r[d+g]!="number"&&m++;else f=t==="desiredWidth"?l.desiredWidth-1:1,(!c[d]||c[d]<f)&&(c[d]=f);if(l[t]>f){let g=0;for(;m>0&&l[t]>f;){if(typeof r[d+g]!="number"){let h=Math.round((l[t]-f)/m);f+=h,o[d+g]+=h,m--}g++}}}Object.assign(r,o,c);for(let u=0;u<r.length;u++)r[u]=Math.max(n,r[u]||0)}}});var Bb=R((N8,Ob)=>{var Xt=yo(),lT=hu(),Su=Pb(),vo=class extends Array{constructor(t){super();let s=lT.mergeOptions(t);if(Object.defineProperty(this,"options",{value:s,enumerable:s.debug}),s.debug){switch(typeof s.debug){case"boolean":Xt.setDebugLevel(Xt.WARN);break;case"number":Xt.setDebugLevel(s.debug);break;case"string":Xt.setDebugLevel(parseInt(s.debug,10));break;default:Xt.setDebugLevel(Xt.WARN),Xt.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof s.debug}`)}Object.defineProperty(this,"messages",{get(){return Xt.debugMessages()}})}}toString(){let t=this,s=this.options.head&&this.options.head.length;s?(t=[this.options.head],this.length&&t.push.apply(t,this)):this.options.style.head=[];let n=Su.makeTableLayout(t);n.forEach(function(i){i.forEach(function(o){o.mergeTableOptions(this.options,n)},this)},this),Su.computeWidths(this.options.colWidths,n),Su.computeHeights(this.options.rowHeights,n),n.forEach(function(i){i.forEach(function(o){o.init(this.options)},this)},this);let r=[];for(let i=0;i<n.length;i++){let o=n[i],a=this.options.rowHeights[i];(i===0||!this.options.style.compact||i==1&&s)&&Cu(o,"top",r);for(let c=0;c<a;c++)Cu(o,c,r);i+1==n.length&&Cu(o,"bottom",r)}return r.join(`
79
79
  `)}get width(){return this.toString().split(`
80
- `)[0].length}};vo.reset=()=>Xt.reset();function Cu(e,t,s){let n=[];e.forEach(function(i){n.push(i.draw(t))});let r=n.join("");r.length&&s.push(r)}Ob.exports=vo});var Nb=R((W8,Mb)=>{Mb.exports=Bb()});var xu=R(($8,fT)=>{fT.exports={name:"cdk-insights",version:"1.2.0",description:"AWS CDK security and cost analysis tool with AI-powered insights",main:"dist/index.js",types:"dist/index.d.ts",bin:{"cdk-insights":"dist/entry.js"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.js"}},files:["dist/**/*","README.md","LICENSE"],scripts:{test:"vitest --run",lint:"biome lint src/",format:"biome format --write src/",check:"biome check src/",build:"ts-node scripts/build.ts","build:dev":"CDK_INSIGHTS_ENVIRONMENT=dev CDK_INSIGHTS_API_URL=https://s2zhmjbwlj.execute-api.eu-west-2.amazonaws.com/v1 ts-node scripts/build.ts",start:"node dist/index.js",dev:"ts-node src/index.ts",prepare:"husky install && npm run build","start:dev":"CDK_ENV=local ts-node src/index.ts","ai-run":"ts-node src/index.ts",unlink:"npm unlink -g cdk-insights",link:"npm link","prepare:test":"npm run unlink && npm run build && npm run link","prepare:dev":"npm run unlink && npm run build:dev && npm run link","deploy:dev":"STAGE=dev cdk deploy","destroy:dev":"STAGE=dev cdk destroy","release:patch":"bumper release patch","release:minor":"bumper release minor","release:major":"bumper release major","release:dry-run":"bumper release patch --dry-run","changelog:preview":"bumper preview","changelog:generate":"bumper generate","validate:commits":"bumper validate","release:check":"npm run validate:commits && npm run test && npm run build","release:full":"npm run release:check && npm run changelog:generate","setup:bumper":"bumper setup","publish:beta":"npm run build && npm publish --tag beta && npm dist-tag add cdk-insights@$npm_package_version latest","publish:alpha":"npm run build && npm publish --tag alpha","publish:canary":"npm run build && npm publish --tag canary","publish:latest":"npm run build && npm publish --tag latest","version:beta":"npm version prerelease --preid=beta","version:alpha":"npm version prerelease --preid=alpha","version:rc":"npm version prerelease --preid=rc","cdk-insights":"node scripts/cdk-insights-wrapper.js",scan:"node scripts/cdk-insights-wrapper.js scan","scan:all":"node scripts/cdk-insights-wrapper.js scan --all","scan:json":"node scripts/cdk-insights-wrapper.js scan --format json","scan:markdown":"node scripts/cdk-insights-wrapper.js scan --format markdown","scan:summary":"node scripts/cdk-insights-wrapper.js scan --format summary","scan:with-issues":"node scripts/cdk-insights-wrapper.js scan --withIssue","cache:clear":"node scripts/cdk-insights-wrapper.js cache clear","cache:status":"node scripts/cdk-insights-wrapper.js cache status","demo:progress":"ts-node src/examples/progress-demo.ts","demo:single-line":"ts-node src/examples/single-line-progress-demo.ts","test:line-clearing":"ts-node src/examples/line-clearing-test.ts"},publishConfig:{access:"public"},keywords:["aws","cdk","cloudformation","analysis","security","cost-optimization","static-analysis","devops","infrastructure","aws-cdk","cloud-security","compliance"],author:"Lee Priest <lee@cdkinsights.dev>",license:"BUSL-1.1",homepage:"https://github.com/instancelabs/cdk-insights",bugs:"https://github.com/instancelabs/cdk-insights/issues",repository:{type:"git",url:"git+https://github.com/instancelabs/cdk-insights.git"},dependencies:{"@inquirer/prompts":"^7.4.1","@middy/core":"^6.1.6","@types/glob":"^8.1.0",axios:"^1.8.4",chalk:"^5.4.1","cli-progress":"^3.12.0","cli-table3":"^0.6.5",dotenv:"^16.5.0",envolution:"^1.4.1",glob:"^11.0.3",ora:"^8.2.0",strogger:"^2.0.3",yargs:"^17.7.2",zod:"^3.23.8"},devDependencies:{"@aws-sdk/client-dynamodb":"^3.788.0","@biomejs/biome":"^2.0.6","@commitlint/cli":"^19.8.1","@commitlint/config-conventional":"^19.8.1","@types/cli-progress":"^3.11.6","@types/jsonwebtoken":"^9.0.9","@types/node":"^22.14.1","@types/yargs":"^17.0.33","aws-cdk":"^2.1010.0","bumper-cli":"^1.6.0",esbuild:"^0.25.2",husky:"^8.0.3","ts-node":"^10.9.2",typescript:"^5.8.3",vitest:"^3.1.1"},peerDependencies:{"aws-cdk-lib":"^2.190.0","cdk-nag":"^2.35.73",constructs:"^10.4.2"},optionalDependencies:{"@aws-solutions-constructs/aws-apigateway-lambda":"^2.0.0","@aws-solutions-constructs/aws-lambda-stepfunctions":"^2.0.0","@aws-solutions-constructs/aws-s3-lambda":"^2.0.0"}}});var yk={};qu(yk,{CDK_INSIGHTS_ANNOTATION_PREFIX:()=>Mu,CDK_INSIGHTS_METADATA_VERSION:()=>Bu,CdkInsightsAspect:()=>Io,ExtremelyHelpfulConsoleLogger:()=>Ur,clearCaches:()=>lv,createCdkInsightsAspect:()=>uv,createCdkInsightsLogger:()=>av,createExtremelyHelpfulConsoleLogger:()=>cv,getCacheStats:()=>pv,isCdkDebugEnabled:()=>Nu,runAnalysis:()=>hk});module.exports=Cv(yk);var fv=H(require("node:fs"));function qn(e,t){return function(){return e.apply(t,arguments)}}var{toString:xv}=Object.prototype,{getPrototypeOf:Lo}=Object,{iterator:Hr,toStringTag:Ku}=Symbol,Vr=(e=>t=>{let s=xv.call(t);return e[s]||(e[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),Ct=e=>(e=e.toLowerCase(),t=>Vr(t)===e),Kr=e=>t=>typeof t===e,{isArray:tn}=Array,en=Kr("undefined");function Hn(e){return e!==null&&!en(e)&&e.constructor!==null&&!en(e.constructor)&&Ye(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Zu=Ct("ArrayBuffer");function Av(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Zu(e.buffer),t}var Fv=Kr("string"),Ye=Kr("function"),Yu=Kr("number"),Vn=e=>e!==null&&typeof e=="object",Ev=e=>e===!0||e===!1,qr=e=>{if(Vr(e)!=="object")return!1;let t=Lo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ku in e)&&!(Hr in e)},Rv=e=>{if(!Vn(e)||Hn(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},wv=Ct("Date"),Iv=Ct("File"),Tv=Ct("Blob"),kv=Ct("FileList"),_v=e=>Vn(e)&&Ye(e.pipe),Lv=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ye(e.append)&&((t=Vr(e))==="formdata"||t==="object"&&Ye(e.toString)&&e.toString()==="[object FormData]"))},Pv=Ct("URLSearchParams"),[Ov,Bv,Mv,Nv]=["ReadableStream","Request","Response","Headers"].map(Ct),Wv=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Kn(e,t,{allOwnKeys:s=!1}={}){if(e===null||typeof e>"u")return;let n,r;if(typeof e!="object"&&(e=[e]),tn(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(Hn(e))return;let i=s?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length,a;for(n=0;n<o;n++)a=i[n],t.call(null,e[a],a,e)}}function Ju(e,t){if(Hn(e))return null;t=t.toLowerCase();let s=Object.keys(e),n=s.length,r;for(;n-- >0;)if(r=s[n],t===r.toLowerCase())return r;return null}var hs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Qu=e=>!en(e)&&e!==hs;function _o(){let{caseless:e,skipUndefined:t}=Qu(this)&&this||{},s={},n=(r,i)=>{let o=e&&Ju(s,i)||i;qr(s[o])&&qr(r)?s[o]=_o(s[o],r):qr(r)?s[o]=_o({},r):tn(r)?s[o]=r.slice():(!t||!en(r))&&(s[o]=r)};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Kn(arguments[r],n);return s}var jv=(e,t,s,{allOwnKeys:n}={})=>(Kn(t,(r,i)=>{s&&Ye(r)?e[i]=qn(r,s):e[i]=r},{allOwnKeys:n}),e),$v=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Uv=(e,t,s,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),s&&Object.assign(e.prototype,s)},Gv=(e,t,s,n)=>{let r,i,o,a={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)o=r[i],(!n||n(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=s!==!1&&Lo(e)}while(e&&(!s||s(e,t))&&e!==Object.prototype);return t},zv=(e,t,s)=>{e=String(e),(s===void 0||s>e.length)&&(s=e.length),s-=t.length;let n=e.indexOf(t,s);return n!==-1&&n===s},qv=e=>{if(!e)return null;if(tn(e))return e;let t=e.length;if(!Yu(t))return null;let s=new Array(t);for(;t-- >0;)s[t]=e[t];return s},Hv=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Lo(Uint8Array)),Vv=(e,t)=>{let n=(e&&e[Hr]).call(e),r;for(;(r=n.next())&&!r.done;){let i=r.value;t.call(e,i[0],i[1])}},Kv=(e,t)=>{let s,n=[];for(;(s=e.exec(t))!==null;)n.push(s);return n},Zv=Ct("HTMLFormElement"),Yv=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,n,r){return n.toUpperCase()+r}),Vu=(({hasOwnProperty:e})=>(t,s)=>e.call(t,s))(Object.prototype),Jv=Ct("RegExp"),Xu=(e,t)=>{let s=Object.getOwnPropertyDescriptors(e),n={};Kn(s,(r,i)=>{let o;(o=t(r,i,e))!==!1&&(n[i]=o||r)}),Object.defineProperties(e,n)},Qv=e=>{Xu(e,(t,s)=>{if(Ye(e)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;let n=e[s];if(Ye(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},Xv=(e,t)=>{let s={},n=r=>{r.forEach(i=>{s[i]=!0})};return tn(e)?n(e):n(String(e).split(t)),s},eS=()=>{},tS=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function sS(e){return!!(e&&Ye(e.append)&&e[Ku]==="FormData"&&e[Hr])}var nS=e=>{let t=new Array(10),s=(n,r)=>{if(Vn(n)){if(t.indexOf(n)>=0)return;if(Hn(n))return n;if(!("toJSON"in n)){t[r]=n;let i=tn(n)?[]:{};return Kn(n,(o,a)=>{let c=s(o,r+1);!en(c)&&(i[a]=c)}),t[r]=void 0,i}}return n};return s(e,0)},rS=Ct("AsyncFunction"),iS=e=>e&&(Vn(e)||Ye(e))&&Ye(e.then)&&Ye(e.catch),el=((e,t)=>e?setImmediate:t?((s,n)=>(hs.addEventListener("message",({source:r,data:i})=>{r===hs&&i===s&&n.length&&n.shift()()},!1),r=>{n.push(r),hs.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",Ye(hs.postMessage)),oS=typeof queueMicrotask<"u"?queueMicrotask.bind(hs):typeof process<"u"&&process.nextTick||el,aS=e=>e!=null&&Ye(e[Hr]),v={isArray:tn,isArrayBuffer:Zu,isBuffer:Hn,isFormData:Lv,isArrayBufferView:Av,isString:Fv,isNumber:Yu,isBoolean:Ev,isObject:Vn,isPlainObject:qr,isEmptyObject:Rv,isReadableStream:Ov,isRequest:Bv,isResponse:Mv,isHeaders:Nv,isUndefined:en,isDate:wv,isFile:Iv,isBlob:Tv,isRegExp:Jv,isFunction:Ye,isStream:_v,isURLSearchParams:Pv,isTypedArray:Hv,isFileList:kv,forEach:Kn,merge:_o,extend:jv,trim:Wv,stripBOM:$v,inherits:Uv,toFlatObject:Gv,kindOf:Vr,kindOfTest:Ct,endsWith:zv,toArray:qv,forEachEntry:Vv,matchAll:Kv,isHTMLForm:Zv,hasOwnProperty:Vu,hasOwnProp:Vu,reduceDescriptors:Xu,freezeMethods:Qv,toObjectSet:Xv,toCamelCase:Yv,noop:eS,toFiniteNumber:tS,findKey:Ju,global:hs,isContextDefined:Qu,isSpecCompliantForm:sS,toJSONObject:nS,isAsyncFn:rS,isThenable:iS,setImmediate:el,asap:oS,isIterable:aS};function sn(e,t,s,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),s&&(this.config=s),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}v.inherits(sn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:v.toJSONObject(this.config),code:this.code,status:this.status}}});var tl=sn.prototype,sl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{sl[e]={value:e}});Object.defineProperties(sn,sl);Object.defineProperty(tl,"isAxiosError",{value:!0});sn.from=(e,t,s,n,r,i)=>{let o=Object.create(tl);v.toFlatObject(e,o,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");let a=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return sn.call(o,a,c,s,n,r),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};var N=sn;var od=H(id(),1),ii=od.default;function Xo(e){return v.isPlainObject(e)||v.isArray(e)}function cd(e){return v.endsWith(e,"[]")?e.slice(0,-2):e}function ad(e,t,s){return e?e.concat(t).map(function(r,i){return r=cd(r),!s&&i?"["+r+"]":r}).join(s?".":""):t}function HC(e){return v.isArray(e)&&!e.some(Xo)}var VC=v.toFlatObject(v,{},null,function(t){return/^is[A-Z]/.test(t)});function KC(e,t,s){if(!v.isObject(e))throw new TypeError("target must be an object");t=t||new(ii||FormData),s=v.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,h){return!v.isUndefined(h[g])});let n=s.metaTokens,r=s.visitor||l,i=s.dots,o=s.indexes,c=(s.Blob||typeof Blob<"u"&&Blob)&&v.isSpecCompliantForm(t);if(!v.isFunction(r))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(v.isDate(m))return m.toISOString();if(v.isBoolean(m))return m.toString();if(!c&&v.isBlob(m))throw new N("Blob is not supported. Use a Buffer instead.");return v.isArrayBuffer(m)||v.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,g,h){let y=m;if(m&&!h&&typeof m=="object"){if(v.endsWith(g,"{}"))g=n?g:g.slice(0,-2),m=JSON.stringify(m);else if(v.isArray(m)&&HC(m)||(v.isFileList(m)||v.endsWith(g,"[]"))&&(y=v.toArray(m)))return g=cd(g),y.forEach(function(A,b){!(v.isUndefined(A)||A===null)&&t.append(o===!0?ad([g],b,i):o===null?g:g+"[]",u(A))}),!1}return Xo(m)?!0:(t.append(ad(h,g,i),u(m)),!1)}let p=[],d=Object.assign(VC,{defaultVisitor:l,convertValue:u,isVisitable:Xo});function f(m,g){if(!v.isUndefined(m)){if(p.indexOf(m)!==-1)throw Error("Circular reference detected in "+g.join("."));p.push(m),v.forEach(m,function(y,D){(!(v.isUndefined(y)||y===null)&&r.call(t,y,v.isString(D)?D.trim():D,g,d))===!0&&f(y,g?g.concat(D):[D])}),p.pop()}}if(!v.isObject(e))throw new TypeError("data must be an object");return f(e),t}var ss=KC;function ud(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ld(e,t){this._pairs=[],e&&ss(e,this,t)}var pd=ld.prototype;pd.append=function(t,s){this._pairs.push([t,s])};pd.toString=function(t){let s=t?function(n){return t.call(this,n,ud)}:ud;return this._pairs.map(function(r){return s(r[0])+"="+s(r[1])},"").join("&")};var dd=ld;function ZC(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ds(e,t,s){if(!t)return e;let n=s&&s.encode||ZC;v.isFunction(s)&&(s={serialize:s});let r=s&&s.serialize,i;if(r?i=r(t,s):i=v.isURLSearchParams(t)?t.toString():new dd(t,s).toString(n),i){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}var ea=class{constructor(){this.handlers=[]}use(t,s,n){return this.handlers.push({fulfilled:t,rejected:s,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){v.forEach(this.handlers,function(n){n!==null&&t(n)})}},ta=ea;var cn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var hd=H(require("crypto"),1);var md=H(require("url"),1),fd=md.default.URLSearchParams;var sa="abcdefghijklmnopqrstuvwxyz",gd="0123456789",yd={DIGIT:gd,ALPHA:sa,ALPHA_DIGIT:sa+sa.toUpperCase()+gd},YC=(e=16,t=yd.ALPHA_DIGIT)=>{let s="",{length:n}=t,r=new Uint32Array(e);hd.default.randomFillSync(r);for(let i=0;i<e;i++)s+=t[r[i]%n];return s},Dd={isNode:!0,classes:{URLSearchParams:fd,FormData:ii,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:yd,generateString:YC,protocols:["http","https","file","data"]};var ia={};qu(ia,{hasBrowserEnv:()=>ra,hasStandardBrowserEnv:()=>JC,hasStandardBrowserWebWorkerEnv:()=>QC,navigator:()=>na,origin:()=>XC});var ra=typeof window<"u"&&typeof document<"u",na=typeof navigator=="object"&&navigator||void 0,JC=ra&&(!na||["ReactNative","NativeScript","NS"].indexOf(na.product)<0),QC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",XC=ra&&window.location.href||"http://localhost";var he={...ia,...Dd};function oa(e,t){return ss(e,new he.classes.URLSearchParams,{visitor:function(s,n,r,i){return he.isNode&&v.isBuffer(s)?(this.append(n,s.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function ex(e){return v.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function tx(e){let t={},s=Object.keys(e),n,r=s.length,i;for(n=0;n<r;n++)i=s[n],t[i]=e[i];return t}function sx(e){function t(s,n,r,i){let o=s[i++];if(o==="__proto__")return!0;let a=Number.isFinite(+o),c=i>=s.length;return o=!o&&v.isArray(r)?r.length:o,c?(v.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):((!r[o]||!v.isObject(r[o]))&&(r[o]=[]),t(s,n,r[o],i)&&v.isArray(r[o])&&(r[o]=tx(r[o])),!a)}if(v.isFormData(e)&&v.isFunction(e.entries)){let s={};return v.forEachEntry(e,(n,r)=>{t(ex(n),r,s,0)}),s}return null}var oi=sx;function nx(e,t,s){if(v.isString(e))try{return(t||JSON.parse)(e),v.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(s||JSON.stringify)(e)}var aa={transitional:cn,adapter:["xhr","http","fetch"],transformRequest:[function(t,s){let n=s.getContentType()||"",r=n.indexOf("application/json")>-1,i=v.isObject(t);if(i&&v.isHTMLForm(t)&&(t=new FormData(t)),v.isFormData(t))return r?JSON.stringify(oi(t)):t;if(v.isArrayBuffer(t)||v.isBuffer(t)||v.isStream(t)||v.isFile(t)||v.isBlob(t)||v.isReadableStream(t))return t;if(v.isArrayBufferView(t))return t.buffer;if(v.isURLSearchParams(t))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return oa(t,this.formSerializer).toString();if((a=v.isFileList(t))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return ss(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||r?(s.setContentType("application/json",!1),nx(t)):t}],transformResponse:[function(t){let s=this.transitional||aa.transitional,n=s&&s.forcedJSONParsing,r=this.responseType==="json";if(v.isResponse(t)||v.isReadableStream(t))return t;if(t&&v.isString(t)&&(n&&!this.responseType||r)){let o=!(s&&s.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?N.from(a,N.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:he.classes.FormData,Blob:he.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};v.forEach(["delete","get","head","post","put","patch"],e=>{aa.headers[e]={}});var un=aa;var rx=v.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),bd=e=>{let t={},s,n,r;return e&&e.split(`
80
+ `)[0].length}};vo.reset=()=>Xt.reset();function Cu(e,t,s){let n=[];e.forEach(function(i){n.push(i.draw(t))});let r=n.join("");r.length&&s.push(r)}Ob.exports=vo});var Nb=R((W8,Mb)=>{Mb.exports=Bb()});var xu=R(($8,fT)=>{fT.exports={name:"cdk-insights",version:"1.2.2",description:"AWS CDK security and cost analysis tool with AI-powered insights",main:"dist/index.js",types:"dist/index.d.ts",bin:{"cdk-insights":"dist/entry.js"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.js"}},files:["dist/**/*","README.md","LICENSE"],scripts:{test:"vitest --run",lint:"biome lint src/",format:"biome format --write src/",check:"biome check src/",build:"ts-node scripts/build.ts","build:dev":"CDK_INSIGHTS_ENVIRONMENT=dev CDK_INSIGHTS_API_URL=https://s2zhmjbwlj.execute-api.eu-west-2.amazonaws.com/v1 ts-node scripts/build.ts",start:"node dist/index.js",dev:"ts-node src/index.ts",prepare:"husky install && npm run build","start:dev":"CDK_ENV=local ts-node src/index.ts","ai-run":"ts-node src/index.ts",unlink:"npm unlink -g cdk-insights",link:"npm link","prepare:test":"npm run unlink && npm run build && npm run link","prepare:dev":"npm run unlink && npm run build:dev && npm run link","deploy:dev":"STAGE=dev cdk deploy","destroy:dev":"STAGE=dev cdk destroy","release:patch":"bumper release patch","release:minor":"bumper release minor","release:major":"bumper release major","release:dry-run":"bumper release patch --dry-run","changelog:preview":"bumper preview","changelog:generate":"bumper generate","validate:commits":"bumper validate","release:check":"npm run validate:commits && npm run test && npm run build","release:full":"npm run release:check && npm run changelog:generate","setup:bumper":"bumper setup","publish:beta":"npm run build && npm publish --tag beta && npm dist-tag add cdk-insights@$npm_package_version latest","publish:alpha":"npm run build && npm publish --tag alpha","publish:canary":"npm run build && npm publish --tag canary","publish:latest":"npm run build && npm publish --tag latest","version:beta":"npm version prerelease --preid=beta","version:alpha":"npm version prerelease --preid=alpha","version:rc":"npm version prerelease --preid=rc","cdk-insights":"node scripts/cdk-insights-wrapper.js",scan:"node scripts/cdk-insights-wrapper.js scan","scan:all":"node scripts/cdk-insights-wrapper.js scan --all","scan:json":"node scripts/cdk-insights-wrapper.js scan --format json","scan:markdown":"node scripts/cdk-insights-wrapper.js scan --format markdown","scan:summary":"node scripts/cdk-insights-wrapper.js scan --format summary","scan:with-issues":"node scripts/cdk-insights-wrapper.js scan --withIssue","cache:clear":"node scripts/cdk-insights-wrapper.js cache clear","cache:status":"node scripts/cdk-insights-wrapper.js cache status","demo:progress":"ts-node src/examples/progress-demo.ts","demo:single-line":"ts-node src/examples/single-line-progress-demo.ts","test:line-clearing":"ts-node src/examples/line-clearing-test.ts"},publishConfig:{access:"public"},keywords:["aws","cdk","cloudformation","analysis","security","cost-optimization","static-analysis","devops","infrastructure","aws-cdk","cloud-security","compliance"],author:"Lee Priest <lee@cdkinsights.dev>",license:"BUSL-1.1",homepage:"https://github.com/instancelabs/cdk-insights",bugs:"https://github.com/instancelabs/cdk-insights/issues",repository:{type:"git",url:"git+https://github.com/instancelabs/cdk-insights.git"},dependencies:{"@inquirer/prompts":"^7.4.1","@middy/core":"^6.1.6","@types/glob":"^8.1.0",axios:"^1.8.4",chalk:"^5.4.1","cli-progress":"^3.12.0","cli-table3":"^0.6.5",dotenv:"^16.5.0",envolution:"^1.4.1",glob:"^11.0.3",ora:"^8.2.0",strogger:"^2.0.3",yargs:"^17.7.2",zod:"^3.23.8"},devDependencies:{"@aws-sdk/client-dynamodb":"^3.788.0","@biomejs/biome":"^2.0.6","@commitlint/cli":"^19.8.1","@commitlint/config-conventional":"^19.8.1","@types/cli-progress":"^3.11.6","@types/jsonwebtoken":"^9.0.9","@types/node":"^22.14.1","@types/yargs":"^17.0.33","aws-cdk":"^2.1010.0","bumper-cli":"^1.6.0",esbuild:"^0.25.2",husky:"^8.0.3","ts-node":"^10.9.2",typescript:"^5.8.3",vitest:"^3.1.1"},peerDependencies:{"aws-cdk-lib":"^2.190.0","cdk-nag":"^2.35.73",constructs:"^10.4.2"},optionalDependencies:{"@aws-solutions-constructs/aws-apigateway-lambda":"^2.0.0","@aws-solutions-constructs/aws-lambda-stepfunctions":"^2.0.0","@aws-solutions-constructs/aws-s3-lambda":"^2.0.0"}}});var yk={};qu(yk,{CDK_INSIGHTS_ANNOTATION_PREFIX:()=>Mu,CDK_INSIGHTS_METADATA_VERSION:()=>Bu,CdkInsightsAspect:()=>Io,ExtremelyHelpfulConsoleLogger:()=>Ur,clearCaches:()=>lv,createCdkInsightsAspect:()=>uv,createCdkInsightsLogger:()=>av,createExtremelyHelpfulConsoleLogger:()=>cv,getCacheStats:()=>pv,isCdkDebugEnabled:()=>Nu,runAnalysis:()=>hk});module.exports=Cv(yk);var fv=H(require("node:fs"));function qn(e,t){return function(){return e.apply(t,arguments)}}var{toString:xv}=Object.prototype,{getPrototypeOf:Lo}=Object,{iterator:Hr,toStringTag:Ku}=Symbol,Vr=(e=>t=>{let s=xv.call(t);return e[s]||(e[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),Ct=e=>(e=e.toLowerCase(),t=>Vr(t)===e),Kr=e=>t=>typeof t===e,{isArray:tn}=Array,en=Kr("undefined");function Hn(e){return e!==null&&!en(e)&&e.constructor!==null&&!en(e.constructor)&&Ye(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Zu=Ct("ArrayBuffer");function Av(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Zu(e.buffer),t}var Fv=Kr("string"),Ye=Kr("function"),Yu=Kr("number"),Vn=e=>e!==null&&typeof e=="object",Ev=e=>e===!0||e===!1,qr=e=>{if(Vr(e)!=="object")return!1;let t=Lo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ku in e)&&!(Hr in e)},Rv=e=>{if(!Vn(e)||Hn(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},wv=Ct("Date"),Iv=Ct("File"),Tv=Ct("Blob"),kv=Ct("FileList"),_v=e=>Vn(e)&&Ye(e.pipe),Lv=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ye(e.append)&&((t=Vr(e))==="formdata"||t==="object"&&Ye(e.toString)&&e.toString()==="[object FormData]"))},Pv=Ct("URLSearchParams"),[Ov,Bv,Mv,Nv]=["ReadableStream","Request","Response","Headers"].map(Ct),Wv=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Kn(e,t,{allOwnKeys:s=!1}={}){if(e===null||typeof e>"u")return;let n,r;if(typeof e!="object"&&(e=[e]),tn(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(Hn(e))return;let i=s?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length,a;for(n=0;n<o;n++)a=i[n],t.call(null,e[a],a,e)}}function Ju(e,t){if(Hn(e))return null;t=t.toLowerCase();let s=Object.keys(e),n=s.length,r;for(;n-- >0;)if(r=s[n],t===r.toLowerCase())return r;return null}var hs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Qu=e=>!en(e)&&e!==hs;function _o(){let{caseless:e,skipUndefined:t}=Qu(this)&&this||{},s={},n=(r,i)=>{let o=e&&Ju(s,i)||i;qr(s[o])&&qr(r)?s[o]=_o(s[o],r):qr(r)?s[o]=_o({},r):tn(r)?s[o]=r.slice():(!t||!en(r))&&(s[o]=r)};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Kn(arguments[r],n);return s}var jv=(e,t,s,{allOwnKeys:n}={})=>(Kn(t,(r,i)=>{s&&Ye(r)?e[i]=qn(r,s):e[i]=r},{allOwnKeys:n}),e),$v=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Uv=(e,t,s,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),s&&Object.assign(e.prototype,s)},Gv=(e,t,s,n)=>{let r,i,o,a={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)o=r[i],(!n||n(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=s!==!1&&Lo(e)}while(e&&(!s||s(e,t))&&e!==Object.prototype);return t},zv=(e,t,s)=>{e=String(e),(s===void 0||s>e.length)&&(s=e.length),s-=t.length;let n=e.indexOf(t,s);return n!==-1&&n===s},qv=e=>{if(!e)return null;if(tn(e))return e;let t=e.length;if(!Yu(t))return null;let s=new Array(t);for(;t-- >0;)s[t]=e[t];return s},Hv=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Lo(Uint8Array)),Vv=(e,t)=>{let n=(e&&e[Hr]).call(e),r;for(;(r=n.next())&&!r.done;){let i=r.value;t.call(e,i[0],i[1])}},Kv=(e,t)=>{let s,n=[];for(;(s=e.exec(t))!==null;)n.push(s);return n},Zv=Ct("HTMLFormElement"),Yv=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,n,r){return n.toUpperCase()+r}),Vu=(({hasOwnProperty:e})=>(t,s)=>e.call(t,s))(Object.prototype),Jv=Ct("RegExp"),Xu=(e,t)=>{let s=Object.getOwnPropertyDescriptors(e),n={};Kn(s,(r,i)=>{let o;(o=t(r,i,e))!==!1&&(n[i]=o||r)}),Object.defineProperties(e,n)},Qv=e=>{Xu(e,(t,s)=>{if(Ye(e)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;let n=e[s];if(Ye(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},Xv=(e,t)=>{let s={},n=r=>{r.forEach(i=>{s[i]=!0})};return tn(e)?n(e):n(String(e).split(t)),s},eS=()=>{},tS=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function sS(e){return!!(e&&Ye(e.append)&&e[Ku]==="FormData"&&e[Hr])}var nS=e=>{let t=new Array(10),s=(n,r)=>{if(Vn(n)){if(t.indexOf(n)>=0)return;if(Hn(n))return n;if(!("toJSON"in n)){t[r]=n;let i=tn(n)?[]:{};return Kn(n,(o,a)=>{let c=s(o,r+1);!en(c)&&(i[a]=c)}),t[r]=void 0,i}}return n};return s(e,0)},rS=Ct("AsyncFunction"),iS=e=>e&&(Vn(e)||Ye(e))&&Ye(e.then)&&Ye(e.catch),el=((e,t)=>e?setImmediate:t?((s,n)=>(hs.addEventListener("message",({source:r,data:i})=>{r===hs&&i===s&&n.length&&n.shift()()},!1),r=>{n.push(r),hs.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",Ye(hs.postMessage)),oS=typeof queueMicrotask<"u"?queueMicrotask.bind(hs):typeof process<"u"&&process.nextTick||el,aS=e=>e!=null&&Ye(e[Hr]),v={isArray:tn,isArrayBuffer:Zu,isBuffer:Hn,isFormData:Lv,isArrayBufferView:Av,isString:Fv,isNumber:Yu,isBoolean:Ev,isObject:Vn,isPlainObject:qr,isEmptyObject:Rv,isReadableStream:Ov,isRequest:Bv,isResponse:Mv,isHeaders:Nv,isUndefined:en,isDate:wv,isFile:Iv,isBlob:Tv,isRegExp:Jv,isFunction:Ye,isStream:_v,isURLSearchParams:Pv,isTypedArray:Hv,isFileList:kv,forEach:Kn,merge:_o,extend:jv,trim:Wv,stripBOM:$v,inherits:Uv,toFlatObject:Gv,kindOf:Vr,kindOfTest:Ct,endsWith:zv,toArray:qv,forEachEntry:Vv,matchAll:Kv,isHTMLForm:Zv,hasOwnProperty:Vu,hasOwnProp:Vu,reduceDescriptors:Xu,freezeMethods:Qv,toObjectSet:Xv,toCamelCase:Yv,noop:eS,toFiniteNumber:tS,findKey:Ju,global:hs,isContextDefined:Qu,isSpecCompliantForm:sS,toJSONObject:nS,isAsyncFn:rS,isThenable:iS,setImmediate:el,asap:oS,isIterable:aS};function sn(e,t,s,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),s&&(this.config=s),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}v.inherits(sn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:v.toJSONObject(this.config),code:this.code,status:this.status}}});var tl=sn.prototype,sl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{sl[e]={value:e}});Object.defineProperties(sn,sl);Object.defineProperty(tl,"isAxiosError",{value:!0});sn.from=(e,t,s,n,r,i)=>{let o=Object.create(tl);v.toFlatObject(e,o,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");let a=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return sn.call(o,a,c,s,n,r),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};var N=sn;var od=H(id(),1),ii=od.default;function Xo(e){return v.isPlainObject(e)||v.isArray(e)}function cd(e){return v.endsWith(e,"[]")?e.slice(0,-2):e}function ad(e,t,s){return e?e.concat(t).map(function(r,i){return r=cd(r),!s&&i?"["+r+"]":r}).join(s?".":""):t}function HC(e){return v.isArray(e)&&!e.some(Xo)}var VC=v.toFlatObject(v,{},null,function(t){return/^is[A-Z]/.test(t)});function KC(e,t,s){if(!v.isObject(e))throw new TypeError("target must be an object");t=t||new(ii||FormData),s=v.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,h){return!v.isUndefined(h[g])});let n=s.metaTokens,r=s.visitor||l,i=s.dots,o=s.indexes,c=(s.Blob||typeof Blob<"u"&&Blob)&&v.isSpecCompliantForm(t);if(!v.isFunction(r))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(v.isDate(m))return m.toISOString();if(v.isBoolean(m))return m.toString();if(!c&&v.isBlob(m))throw new N("Blob is not supported. Use a Buffer instead.");return v.isArrayBuffer(m)||v.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,g,h){let y=m;if(m&&!h&&typeof m=="object"){if(v.endsWith(g,"{}"))g=n?g:g.slice(0,-2),m=JSON.stringify(m);else if(v.isArray(m)&&HC(m)||(v.isFileList(m)||v.endsWith(g,"[]"))&&(y=v.toArray(m)))return g=cd(g),y.forEach(function(A,b){!(v.isUndefined(A)||A===null)&&t.append(o===!0?ad([g],b,i):o===null?g:g+"[]",u(A))}),!1}return Xo(m)?!0:(t.append(ad(h,g,i),u(m)),!1)}let p=[],d=Object.assign(VC,{defaultVisitor:l,convertValue:u,isVisitable:Xo});function f(m,g){if(!v.isUndefined(m)){if(p.indexOf(m)!==-1)throw Error("Circular reference detected in "+g.join("."));p.push(m),v.forEach(m,function(y,D){(!(v.isUndefined(y)||y===null)&&r.call(t,y,v.isString(D)?D.trim():D,g,d))===!0&&f(y,g?g.concat(D):[D])}),p.pop()}}if(!v.isObject(e))throw new TypeError("data must be an object");return f(e),t}var ss=KC;function ud(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ld(e,t){this._pairs=[],e&&ss(e,this,t)}var pd=ld.prototype;pd.append=function(t,s){this._pairs.push([t,s])};pd.toString=function(t){let s=t?function(n){return t.call(this,n,ud)}:ud;return this._pairs.map(function(r){return s(r[0])+"="+s(r[1])},"").join("&")};var dd=ld;function ZC(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ds(e,t,s){if(!t)return e;let n=s&&s.encode||ZC;v.isFunction(s)&&(s={serialize:s});let r=s&&s.serialize,i;if(r?i=r(t,s):i=v.isURLSearchParams(t)?t.toString():new dd(t,s).toString(n),i){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}var ea=class{constructor(){this.handlers=[]}use(t,s,n){return this.handlers.push({fulfilled:t,rejected:s,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){v.forEach(this.handlers,function(n){n!==null&&t(n)})}},ta=ea;var cn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var hd=H(require("crypto"),1);var md=H(require("url"),1),fd=md.default.URLSearchParams;var sa="abcdefghijklmnopqrstuvwxyz",gd="0123456789",yd={DIGIT:gd,ALPHA:sa,ALPHA_DIGIT:sa+sa.toUpperCase()+gd},YC=(e=16,t=yd.ALPHA_DIGIT)=>{let s="",{length:n}=t,r=new Uint32Array(e);hd.default.randomFillSync(r);for(let i=0;i<e;i++)s+=t[r[i]%n];return s},Dd={isNode:!0,classes:{URLSearchParams:fd,FormData:ii,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:yd,generateString:YC,protocols:["http","https","file","data"]};var ia={};qu(ia,{hasBrowserEnv:()=>ra,hasStandardBrowserEnv:()=>JC,hasStandardBrowserWebWorkerEnv:()=>QC,navigator:()=>na,origin:()=>XC});var ra=typeof window<"u"&&typeof document<"u",na=typeof navigator=="object"&&navigator||void 0,JC=ra&&(!na||["ReactNative","NativeScript","NS"].indexOf(na.product)<0),QC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",XC=ra&&window.location.href||"http://localhost";var he={...ia,...Dd};function oa(e,t){return ss(e,new he.classes.URLSearchParams,{visitor:function(s,n,r,i){return he.isNode&&v.isBuffer(s)?(this.append(n,s.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function ex(e){return v.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function tx(e){let t={},s=Object.keys(e),n,r=s.length,i;for(n=0;n<r;n++)i=s[n],t[i]=e[i];return t}function sx(e){function t(s,n,r,i){let o=s[i++];if(o==="__proto__")return!0;let a=Number.isFinite(+o),c=i>=s.length;return o=!o&&v.isArray(r)?r.length:o,c?(v.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):((!r[o]||!v.isObject(r[o]))&&(r[o]=[]),t(s,n,r[o],i)&&v.isArray(r[o])&&(r[o]=tx(r[o])),!a)}if(v.isFormData(e)&&v.isFunction(e.entries)){let s={};return v.forEachEntry(e,(n,r)=>{t(ex(n),r,s,0)}),s}return null}var oi=sx;function nx(e,t,s){if(v.isString(e))try{return(t||JSON.parse)(e),v.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(s||JSON.stringify)(e)}var aa={transitional:cn,adapter:["xhr","http","fetch"],transformRequest:[function(t,s){let n=s.getContentType()||"",r=n.indexOf("application/json")>-1,i=v.isObject(t);if(i&&v.isHTMLForm(t)&&(t=new FormData(t)),v.isFormData(t))return r?JSON.stringify(oi(t)):t;if(v.isArrayBuffer(t)||v.isBuffer(t)||v.isStream(t)||v.isFile(t)||v.isBlob(t)||v.isReadableStream(t))return t;if(v.isArrayBufferView(t))return t.buffer;if(v.isURLSearchParams(t))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return oa(t,this.formSerializer).toString();if((a=v.isFileList(t))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return ss(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||r?(s.setContentType("application/json",!1),nx(t)):t}],transformResponse:[function(t){let s=this.transitional||aa.transitional,n=s&&s.forcedJSONParsing,r=this.responseType==="json";if(v.isResponse(t)||v.isReadableStream(t))return t;if(t&&v.isString(t)&&(n&&!this.responseType||r)){let o=!(s&&s.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?N.from(a,N.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:he.classes.FormData,Blob:he.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};v.forEach(["delete","get","head","post","put","patch"],e=>{aa.headers[e]={}});var un=aa;var rx=v.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),bd=e=>{let t={},s,n,r;return e&&e.split(`
81
81
  `).forEach(function(o){r=o.indexOf(":"),s=o.substring(0,r).trim().toLowerCase(),n=o.substring(r+1).trim(),!(!s||t[s]&&rx[s])&&(s==="set-cookie"?t[s]?t[s].push(n):t[s]=[n]:t[s]=t[s]?t[s]+", "+n:n)}),t};var vd=Symbol("internals");function Xn(e){return e&&String(e).trim().toLowerCase()}function ai(e){return e===!1||e==null?e:v.isArray(e)?e.map(ai):String(e)}function ix(e){let t=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=s.exec(e);)t[n[1]]=n[2];return t}var ox=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ca(e,t,s,n,r){if(v.isFunction(n))return n.call(this,t,s);if(r&&(t=s),!!v.isString(t)){if(v.isString(n))return t.indexOf(n)!==-1;if(v.isRegExp(n))return n.test(t)}}function ax(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,s,n)=>s.toUpperCase()+n)}function cx(e,t){let s=v.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+s,{value:function(r,i,o){return this[n].call(this,t,r,i,o)},configurable:!0})})}var ln=class{constructor(t){t&&this.set(t)}set(t,s,n){let r=this;function i(a,c,u){let l=Xn(c);if(!l)throw new Error("header name must be a non-empty string");let p=v.findKey(r,l);(!p||r[p]===void 0||u===!0||u===void 0&&r[p]!==!1)&&(r[p||c]=ai(a))}let o=(a,c)=>v.forEach(a,(u,l)=>i(u,l,c));if(v.isPlainObject(t)||t instanceof this.constructor)o(t,s);else if(v.isString(t)&&(t=t.trim())&&!ox(t))o(bd(t),s);else if(v.isObject(t)&&v.isIterable(t)){let a={},c,u;for(let l of t){if(!v.isArray(l))throw TypeError("Object iterator must return a key-value pair");a[u=l[0]]=(c=a[u])?v.isArray(c)?[...c,l[1]]:[c,l[1]]:l[1]}o(a,s)}else t!=null&&i(s,t,n);return this}get(t,s){if(t=Xn(t),t){let n=v.findKey(this,t);if(n){let r=this[n];if(!s)return r;if(s===!0)return ix(r);if(v.isFunction(s))return s.call(this,r,n);if(v.isRegExp(s))return s.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,s){if(t=Xn(t),t){let n=v.findKey(this,t);return!!(n&&this[n]!==void 0&&(!s||ca(this,this[n],n,s)))}return!1}delete(t,s){let n=this,r=!1;function i(o){if(o=Xn(o),o){let a=v.findKey(n,o);a&&(!s||ca(n,n[a],a,s))&&(delete n[a],r=!0)}}return v.isArray(t)?t.forEach(i):i(t),r}clear(t){let s=Object.keys(this),n=s.length,r=!1;for(;n--;){let i=s[n];(!t||ca(this,this[i],i,t,!0))&&(delete this[i],r=!0)}return r}normalize(t){let s=this,n={};return v.forEach(this,(r,i)=>{let o=v.findKey(n,i);if(o){s[o]=ai(r),delete s[i];return}let a=t?ax(i):String(i).trim();a!==i&&delete s[i],s[a]=ai(r),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let s=Object.create(null);return v.forEach(this,(n,r)=>{n!=null&&n!==!1&&(s[r]=t&&v.isArray(n)?n.join(", "):n)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,s])=>t+": "+s).join(`
82
82
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...s){let n=new this(t);return s.forEach(r=>n.set(r)),n}static accessor(t){let n=(this[vd]=this[vd]={accessors:{}}).accessors,r=this.prototype;function i(o){let a=Xn(o);n[a]||(cx(r,o),n[a]=!0)}return v.isArray(t)?t.forEach(i):i(t),this}};ln.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);v.reduceDescriptors(ln.prototype,({value:e},t)=>{let s=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[s]=n}}});v.freezeMethods(ln);var we=ln;function er(e,t){let s=this||un,n=t||s,r=we.from(n.headers),i=n.data;return v.forEach(e,function(a){i=a.call(s,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function tr(e){return!!(e&&e.__CANCEL__)}function Sd(e,t,s){N.call(this,e??"canceled",N.ERR_CANCELED,t,s),this.name="CanceledError"}v.inherits(Sd,N,{__CANCEL__:!0});var nt=Sd;function Pt(e,t,s){let n=s.config.validateStatus;!s.status||!n||n(s.status)?e(s):t(new N("Request failed with status code "+s.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function ua(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function la(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function bs(e,t,s){let n=!ua(t);return e&&(n||s==!1)?la(e,t):t}var rm=H(xd(),1),im=H(require("http"),1),om=H(require("https"),1),Oa=H(require("http2"),1),Ba=H(require("util"),1),am=H(Ud(),1),Gt=H(require("zlib"),1);var xs="1.13.2";function or(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var Vx=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Ra(e,t,s){let n=s&&s.Blob||he.classes.Blob,r=or(e);if(t===void 0&&n&&(t=!0),r==="data"){e=r.length?e.slice(r.length+1):e;let i=Vx.exec(e);if(!i)throw new N("Invalid URL",N.ERR_INVALID_URL);let o=i[1],a=i[2],c=i[3],u=Buffer.from(decodeURIComponent(c),a?"base64":"utf8");if(t){if(!n)throw new N("Blob is not supported",N.ERR_NOT_SUPPORT);return new n([u],{type:o})}return u}throw new N("Unsupported protocol "+r,N.ERR_NOT_SUPPORT)}var Ut=H(require("stream"),1);var Gd=H(require("stream"),1);var wa=Symbol("internals"),Ia=class extends Gd.default.Transform{constructor(t){t=v.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,r)=>!v.isUndefined(r[n])),super({readableHighWaterMark:t.chunkSize});let s=this[wa]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",n=>{n==="progress"&&(s.isCaptured||(s.isCaptured=!0))})}_read(t){let s=this[wa];return s.onReadCallback&&s.onReadCallback(),super._read(t)}_transform(t,s,n){let r=this[wa],i=r.maxRate,o=this.readableHighWaterMark,a=r.timeWindow,c=1e3/a,u=i/c,l=r.minChunkSize!==!1?Math.max(r.minChunkSize,u*.01):0,p=(f,m)=>{let g=Buffer.byteLength(f);r.bytesSeen+=g,r.bytes+=g,r.isCaptured&&this.emit("progress",r.bytesSeen),this.push(f)?process.nextTick(m):r.onReadCallback=()=>{r.onReadCallback=null,process.nextTick(m)}},d=(f,m)=>{let g=Buffer.byteLength(f),h=null,y=o,D,A=0;if(i){let b=Date.now();(!r.ts||(A=b-r.ts)>=a)&&(r.ts=b,D=u-r.bytes,r.bytes=D<0?-D:0,A=0),D=u-r.bytes}if(i){if(D<=0)return setTimeout(()=>{m(null,f)},a-A);D<y&&(y=D)}y&&g>y&&g-y>l&&(h=f.subarray(y),f=f.subarray(0,y)),p(f,h?()=>{process.nextTick(m,null,h)}:m)};d(t,function f(m,g){if(m)return n(m);g?d(g,f):n(null)})}},Ta=Ia;var cm=require("events");var qd=H(require("util"),1),Hd=require("stream");var{asyncIterator:zd}=Symbol,Kx=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[zd]?yield*e[zd]():yield e},di=Kx;var Zx=he.ALPHABET.ALPHA_DIGIT+"-_",ar=typeof TextEncoder=="function"?new TextEncoder:new qd.default.TextEncoder,As=`\r
83
83
  `,Yx=ar.encode(As),Jx=2,ka=class{constructor(t,s){let{escapeName:n}=this.constructor,r=v.isString(s),i=`Content-Disposition: form-data; name="${n(t)}"${!r&&s.name?`; filename="${n(s.name)}"`:""}${As}`;r?s=ar.encode(String(s).replace(/\r?\n|\r\n?/g,As)):i+=`Content-Type: ${s.type||"application/octet-stream"}${As}`,this.headers=ar.encode(i+As),this.contentLength=r?s.byteLength:s.size,this.size=this.headers.byteLength+this.contentLength+Jx,this.name=t,this.value=s}async*encode(){yield this.headers;let{value:t}=this;v.isTypedArray(t)?yield t:yield*di(t),yield Yx}static escapeName(t){return String(t).replace(/[\r\n"]/g,s=>({"\r":"%0D","\n":"%0A",'"':"%22"})[s])}},Qx=(e,t,s)=>{let{tag:n="form-data-boundary",size:r=25,boundary:i=n+"-"+he.generateString(r,Zx)}=s||{};if(!v.isFormData(e))throw TypeError("FormData instance required");if(i.length<1||i.length>70)throw Error("boundary must be 10-70 characters long");let o=ar.encode("--"+i+As),a=ar.encode("--"+i+"--"+As),c=a.byteLength,u=Array.from(e.entries()).map(([p,d])=>{let f=new ka(p,d);return c+=f.size,f});c+=o.byteLength*u.length,c=v.toFiniteNumber(c);let l={"Content-Type":`multipart/form-data; boundary=${i}`};return Number.isFinite(c)&&(l["Content-Length"]=c),t&&t(l),Hd.Readable.from(async function*(){for(let p of u)yield o,yield*p.encode();yield a}())},Vd=Qx;var Kd=H(require("stream"),1),_a=class extends Kd.default.Transform{__transform(t,s,n){this.push(t),n()}_transform(t,s,n){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let r=Buffer.alloc(2);r[0]=120,r[1]=156,this.push(r,s)}this.__transform(t,s,n)}},Zd=_a;var Xx=(e,t)=>v.isAsyncFn(e)?function(...s){let n=s.pop();e.apply(this,s).then(r=>{try{t?n(null,...t(r)):n(null,r)}catch(i){n(i)}},n)}:e,Yd=Xx;function e0(e,t){e=e||10;let s=new Array(e),n=new Array(e),r=0,i=0,o;return t=t!==void 0?t:1e3,function(c){let u=Date.now(),l=n[i];o||(o=u),s[r]=c,n[r]=u;let p=i,d=0;for(;p!==r;)d+=s[p++],p=p%e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),u-o<t)return;let f=l&&u-l;return f?Math.round(d*1e3/f):void 0}}var Jd=e0;function t0(e,t){let s=0,n=1e3/t,r,i,o=(u,l=Date.now())=>{s=l,r=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{let l=Date.now(),p=l-s;p>=n?o(u,l):(r=u,i||(i=setTimeout(()=>{i=null,o(r)},n-p)))},()=>r&&o(r)]}var Qd=t0;var $t=(e,t,s=3)=>{let n=0,r=Jd(50,250);return Qd(i=>{let o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-n,u=r(c),l=o<=a;n=o;let p={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&l?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(p)},s)},gn=(e,t)=>{let s=e!=null;return[n=>t[0]({lengthComputable:s,total:e,loaded:n}),t[1]]},hn=e=>(...t)=>v.asap(()=>e(...t));function La(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let s=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(s)){let i=n.length,o=n.length;for(let d=0;d<o;d++)if(n.charCodeAt(d)===37&&d+2<o){let f=n.charCodeAt(d+1),m=n.charCodeAt(d+2);(f>=48&&f<=57||f>=65&&f<=70||f>=97&&f<=102)&&(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102)&&(i-=2,d+=2)}let a=0,c=o-1,u=d=>d>=2&&n.charCodeAt(d-2)===37&&n.charCodeAt(d-1)===51&&(n.charCodeAt(d)===68||n.charCodeAt(d)===100);c>=0&&(n.charCodeAt(c)===61?(a++,c--):u(c)&&(a++,c-=3)),a===1&&c>=0&&(n.charCodeAt(c)===61||u(c))&&a++;let p=Math.floor(i/4)*3-(a||0);return p>0?p:0}return Buffer.byteLength(n,"utf8")}var Xd={flush:Gt.default.constants.Z_SYNC_FLUSH,finishFlush:Gt.default.constants.Z_SYNC_FLUSH},s0={flush:Gt.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Gt.default.constants.BROTLI_OPERATION_FLUSH},em=v.isFunction(Gt.default.createBrotliDecompress),{http:n0,https:r0}=am.default,i0=/https:?/,tm=he.protocols.map(e=>e+":"),sm=(e,[t,s])=>(e.on("end",s).on("error",s),t),Pa=class{constructor(){this.sessions=Object.create(null)}getSession(t,s){s=Object.assign({sessionTimeout:1e3},s);let n=this.sessions[t];if(n){let l=n.length;for(let p=0;p<l;p++){let[d,f]=n[p];if(!d.destroyed&&!d.closed&&Ba.default.isDeepStrictEqual(f,s))return d}}let r=Oa.default.connect(t,s),i,o=()=>{if(i)return;i=!0;let l=n,p=l.length,d=p;for(;d--;)if(l[d][0]===r){p===1?delete this.sessions[t]:l.splice(d,1);return}},a=r.request,{sessionTimeout:c}=s;if(c!=null){let l,p=0;r.request=function(){let d=a.apply(this,arguments);return p++,l&&(clearTimeout(l),l=null),d.once("close",()=>{--p||(l=setTimeout(()=>{l=null,o()},c))}),d}}r.once("close",o);let u=[r,s];return n?n.push(u):n=this.sessions[t]=[u],r}},o0=new Pa;function a0(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function um(e,t,s){let n=t;if(!n&&n!==!1){let r=rm.default.getProxyForUrl(s);r&&(n=new URL(r))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let i=Buffer.from(n.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+i}e.headers.host=e.hostname+(e.port?":"+e.port:"");let r=n.hostname||n.host;e.hostname=r,e.host=r,e.port=n.port,e.path=s,n.protocol&&(e.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}e.beforeRedirects.proxy=function(i){um(i,t,i.href)}}var c0=typeof process<"u"&&v.kindOf(process)==="process",u0=e=>new Promise((t,s)=>{let n,r,i=(c,u)=>{r||(r=!0,n&&n(c,u))},o=c=>{i(c),t(c)},a=c=>{i(c,!0),s(c)};e(o,a,c=>n=c).catch(a)}),l0=({address:e,family:t})=>{if(!v.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},nm=(e,t)=>l0(v.isObject(e)?e:{address:e,family:t}),p0={request(e,t){let s=e.protocol+"//"+e.hostname+":"+(e.port||80),{http2Options:n,headers:r}=e,i=o0.getSession(s,n),{HTTP2_HEADER_SCHEME:o,HTTP2_HEADER_METHOD:a,HTTP2_HEADER_PATH:c,HTTP2_HEADER_STATUS:u}=Oa.default.constants,l={[o]:e.protocol.replace(":",""),[a]:e.method,[c]:e.path};v.forEach(r,(d,f)=>{f.charAt(0)!==":"&&(l[f]=d)});let p=i.request(l);return p.once("response",d=>{let f=p;d=Object.assign({},d);let m=d[u];delete d[u],f.headers=d,f.statusCode=+m,t(f)}),p}},lm=c0&&function(t){return u0(async function(n,r,i){let{data:o,lookup:a,family:c,httpVersion:u=1,http2Options:l}=t,{responseType:p,responseEncoding:d}=t,f=t.method.toUpperCase(),m,g=!1,h;if(u=+u,Number.isNaN(u))throw TypeError(`Invalid protocol version: '${t.httpVersion}' is not a number`);if(u!==1&&u!==2)throw TypeError(`Unsupported protocol version '${u}'`);let y=u===2;if(a){let G=Yd(a,W=>v.isArray(W)?W:[W]);a=(W,se,Ee)=>{G(W,se,(De,ie,de)=>{if(De)return Ee(De);let ge=v.isArray(ie)?ie.map(Lt=>nm(Lt)):[nm(ie,de)];se.all?Ee(De,ge):Ee(De,ge[0].address,ge[0].family)})}}let D=new cm.EventEmitter;function A(G){try{D.emit("abort",!G||G.type?new nt(null,t,h):G)}catch(W){console.warn("emit error",W)}}D.once("abort",r);let b=()=>{t.cancelToken&&t.cancelToken.unsubscribe(A),t.signal&&t.signal.removeEventListener("abort",A),D.removeAllListeners()};(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(A),t.signal&&(t.signal.aborted?A():t.signal.addEventListener("abort",A))),i((G,W)=>{if(m=!0,W){g=!0,b();return}let{data:se}=G;if(se instanceof Ut.default.Readable||se instanceof Ut.default.Duplex){let Ee=Ut.default.finished(se,()=>{Ee(),b()})}else b()});let E=bs(t.baseURL,t.url,t.allowAbsoluteUrls),T=new URL(E,he.hasBrowserEnv?he.origin:void 0),k=T.protocol||tm[0];if(k==="data:"){if(t.maxContentLength>-1){let W=String(t.url||E||"");if(La(W)>t.maxContentLength)return r(new N("maxContentLength size of "+t.maxContentLength+" exceeded",N.ERR_BAD_RESPONSE,t))}let G;if(f!=="GET")return Pt(n,r,{status:405,statusText:"method not allowed",headers:{},config:t});try{G=Ra(t.url,p==="blob",{Blob:t.env&&t.env.Blob})}catch(W){throw N.from(W,N.ERR_BAD_REQUEST,t)}return p==="text"?(G=G.toString(d),(!d||d==="utf8")&&(G=v.stripBOM(G))):p==="stream"&&(G=Ut.default.Readable.from(G)),Pt(n,r,{data:G,status:200,statusText:"OK",headers:new we,config:t})}if(tm.indexOf(k)===-1)return r(new N("Unsupported protocol "+k,N.ERR_BAD_REQUEST,t));let S=we.from(t.headers).normalize();S.set("User-Agent","axios/"+xs,!1);let{onUploadProgress:$,onDownloadProgress:K}=t,J=t.maxRate,V,Z;if(v.isSpecCompliantForm(o)){let G=S.getContentType(/boundary=([-_\w\d]{10,70})/i);o=Vd(o,W=>{S.set(W)},{tag:`axios-${xs}-boundary`,boundary:G&&G[1]||void 0})}else if(v.isFormData(o)&&v.isFunction(o.getHeaders)){if(S.set(o.getHeaders()),!S.hasContentLength())try{let G=await Ba.default.promisify(o.getLength).call(o);Number.isFinite(G)&&G>=0&&S.setContentLength(G)}catch{}}else if(v.isBlob(o)||v.isFile(o))o.size&&S.setContentType(o.type||"application/octet-stream"),S.setContentLength(o.size||0),o=Ut.default.Readable.from(di(o));else if(o&&!v.isStream(o)){if(!Buffer.isBuffer(o))if(v.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(v.isString(o))o=Buffer.from(o,"utf-8");else return r(new N("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",N.ERR_BAD_REQUEST,t));if(S.setContentLength(o.length,!1),t.maxBodyLength>-1&&o.length>t.maxBodyLength)return r(new N("Request body larger than maxBodyLength limit",N.ERR_BAD_REQUEST,t))}let O=v.toFiniteNumber(S.getContentLength());v.isArray(J)?(V=J[0],Z=J[1]):V=Z=J,o&&($||V)&&(v.isStream(o)||(o=Ut.default.Readable.from(o,{objectMode:!1})),o=Ut.default.pipeline([o,new Ta({maxRate:v.toFiniteNumber(V)})],v.noop),$&&o.on("progress",sm(o,gn(O,$t(hn($),!1,3)))));let I;if(t.auth){let G=t.auth.username||"",W=t.auth.password||"";I=G+":"+W}if(!I&&T.username){let G=T.username,W=T.password;I=G+":"+W}I&&S.delete("authorization");let _;try{_=Ds(T.pathname+T.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(G){let W=new Error(G.message);return W.config=t,W.url=t.url,W.exists=!0,r(W)}S.set("Accept-Encoding","gzip, compress, deflate"+(em?", br":""),!1);let B={path:_,method:f,headers:S.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:I,protocol:k,family:c,beforeRedirect:a0,beforeRedirects:{},http2Options:l};!v.isUndefined(a)&&(B.lookup=a),t.socketPath?B.socketPath=t.socketPath:(B.hostname=T.hostname.startsWith("[")?T.hostname.slice(1,-1):T.hostname,B.port=T.port,um(B,t.proxy,k+"//"+T.hostname+(T.port?":"+T.port:"")+B.path));let U,le=i0.test(B.protocol);if(B.agent=le?t.httpsAgent:t.httpAgent,y?U=p0:t.transport?U=t.transport:t.maxRedirects===0?U=le?om.default:im.default:(t.maxRedirects&&(B.maxRedirects=t.maxRedirects),t.beforeRedirect&&(B.beforeRedirects.config=t.beforeRedirect),U=le?r0:n0),t.maxBodyLength>-1?B.maxBodyLength=t.maxBodyLength:B.maxBodyLength=1/0,t.insecureHTTPParser&&(B.insecureHTTPParser=t.insecureHTTPParser),h=U.request(B,function(W){if(h.destroyed)return;let se=[W],Ee=v.toFiniteNumber(W.headers["content-length"]);if(K||Z){let ge=new Ta({maxRate:v.toFiniteNumber(Z)});K&&ge.on("progress",sm(ge,gn(Ee,$t(hn(K),!0,3)))),se.push(ge)}let De=W,ie=W.req||h;if(t.decompress!==!1&&W.headers["content-encoding"])switch((f==="HEAD"||W.statusCode===204)&&delete W.headers["content-encoding"],(W.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":se.push(Gt.default.createUnzip(Xd)),delete W.headers["content-encoding"];break;case"deflate":se.push(new Zd),se.push(Gt.default.createUnzip(Xd)),delete W.headers["content-encoding"];break;case"br":em&&(se.push(Gt.default.createBrotliDecompress(s0)),delete W.headers["content-encoding"])}De=se.length>1?Ut.default.pipeline(se,v.noop):se[0];let de={status:W.statusCode,statusText:W.statusMessage,headers:new we(W.headers),config:t,request:ie};if(p==="stream")de.data=De,Pt(n,r,de);else{let ge=[],Lt=0;De.on("data",function(Ue){ge.push(Ue),Lt+=Ue.length,t.maxContentLength>-1&&Lt>t.maxContentLength&&(g=!0,De.destroy(),A(new N("maxContentLength size of "+t.maxContentLength+" exceeded",N.ERR_BAD_RESPONSE,t,ie)))}),De.on("aborted",function(){if(g)return;let Ue=new N("stream has been aborted",N.ERR_BAD_RESPONSE,t,ie);De.destroy(Ue),r(Ue)}),De.on("error",function(Ue){h.destroyed||r(N.from(Ue,null,t,ie))}),De.on("end",function(){try{let Ue=ge.length===1?ge[0]:Buffer.concat(ge);p!=="arraybuffer"&&(Ue=Ue.toString(d),(!d||d==="utf8")&&(Ue=v.stripBOM(Ue))),de.data=Ue}catch(Ue){return r(N.from(Ue,null,t,de.request,de))}Pt(n,r,de)})}D.once("abort",ge=>{De.destroyed||(De.emit("error",ge),De.destroy())})}),D.once("abort",G=>{h.close?h.close():h.destroy(G)}),h.on("error",function(W){r(N.from(W,null,t,h))}),h.on("socket",function(W){W.setKeepAlive(!0,1e3*60)}),t.timeout){let G=parseInt(t.timeout,10);if(Number.isNaN(G)){A(new N("error trying to parse `config.timeout` to int",N.ERR_BAD_OPTION_VALUE,t,h));return}h.setTimeout(G,function(){if(m)return;let se=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",Ee=t.transitional||cn;t.timeoutErrorMessage&&(se=t.timeoutErrorMessage),A(new N(se,Ee.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,t,h))})}else h.setTimeout(0);if(v.isStream(o)){let G=!1,W=!1;o.on("end",()=>{G=!0}),o.once("error",se=>{W=!0,h.destroy(se)}),o.on("close",()=>{!G&&!W&&A(new nt("Request stream has been aborted",t,h))}),o.pipe(h)}else o&&h.write(o),h.end()})};var pm=he.hasStandardBrowserEnv?((e,t)=>s=>(s=new URL(s,he.origin),e.protocol===s.protocol&&e.host===s.host&&(t||e.port===s.port)))(new URL(he.origin),he.navigator&&/(msie|trident)/i.test(he.navigator.userAgent)):()=>!0;var dm=he.hasStandardBrowserEnv?{write(e,t,s,n,r,i,o){if(typeof document>"u")return;let a=[`${e}=${encodeURIComponent(t)}`];v.isNumber(s)&&a.push(`expires=${new Date(s).toUTCString()}`),v.isString(n)&&a.push(`path=${n}`),v.isString(r)&&a.push(`domain=${r}`),i===!0&&a.push("secure"),v.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;let t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};var mm=e=>e instanceof we?{...e}:e;function At(e,t){t=t||{};let s={};function n(u,l,p,d){return v.isPlainObject(u)&&v.isPlainObject(l)?v.merge.call({caseless:d},u,l):v.isPlainObject(l)?v.merge({},l):v.isArray(l)?l.slice():l}function r(u,l,p,d){if(v.isUndefined(l)){if(!v.isUndefined(u))return n(void 0,u,p,d)}else return n(u,l,p,d)}function i(u,l){if(!v.isUndefined(l))return n(void 0,l)}function o(u,l){if(v.isUndefined(l)){if(!v.isUndefined(u))return n(void 0,u)}else return n(void 0,l)}function a(u,l,p){if(p in t)return n(u,l);if(p in e)return n(void 0,u)}let c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,l,p)=>r(mm(u),mm(l),p,!0)};return v.forEach(Object.keys({...e,...t}),function(l){let p=c[l]||r,d=p(e[l],t[l],l);v.isUndefined(d)&&p!==a||(s[l]=d)}),s}var mi=e=>{let t=At({},e),{data:s,withXSRFToken:n,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=t;if(t.headers=o=we.from(o),t.url=Ds(bs(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),v.isFormData(s)){if(he.hasStandardBrowserEnv||he.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(v.isFunction(s.getHeaders)){let c=s.getHeaders(),u=["content-type","content-length"];Object.entries(c).forEach(([l,p])=>{u.includes(l.toLowerCase())&&o.set(l,p)})}}if(he.hasStandardBrowserEnv&&(n&&v.isFunction(n)&&(n=n(t)),n||n!==!1&&pm(t.url))){let c=r&&i&&dm.read(i);c&&o.set(r,c)}return t};var d0=typeof XMLHttpRequest<"u",fm=d0&&function(e){return new Promise(function(s,n){let r=mi(e),i=r.data,o=we.from(r.headers).normalize(),{responseType:a,onUploadProgress:c,onDownloadProgress:u}=r,l,p,d,f,m;function g(){f&&f(),m&&m(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function y(){if(!h)return;let A=we.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:A,config:e,request:h};Pt(function(k){s(k),g()},function(k){n(k),g()},E),h=null}"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(y)},h.onabort=function(){h&&(n(new N("Request aborted",N.ECONNABORTED,e,h)),h=null)},h.onerror=function(b){let E=b&&b.message?b.message:"Network Error",T=new N(E,N.ERR_NETWORK,e,h);T.event=b||null,n(T),h=null},h.ontimeout=function(){let b=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",E=r.transitional||cn;r.timeoutErrorMessage&&(b=r.timeoutErrorMessage),n(new N(b,E.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,e,h)),h=null},i===void 0&&o.setContentType(null),"setRequestHeader"in h&&v.forEach(o.toJSON(),function(b,E){h.setRequestHeader(E,b)}),v.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),a&&a!=="json"&&(h.responseType=r.responseType),u&&([d,m]=$t(u,!0),h.addEventListener("progress",d)),c&&h.upload&&([p,f]=$t(c),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",f)),(r.cancelToken||r.signal)&&(l=A=>{h&&(n(!A||A.type?new nt(null,e,h):A),h.abort(),h=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));let D=or(r.url);if(D&&he.protocols.indexOf(D)===-1){n(new N("Unsupported protocol "+D+":",N.ERR_BAD_REQUEST,e));return}h.send(i||null)})};var m0=(e,t)=>{let{length:s}=e=e?e.filter(Boolean):[];if(t||s){let n=new AbortController,r,i=function(u){if(!r){r=!0,a();let l=u instanceof Error?u:this.reason;n.abort(l instanceof N?l:new nt(l instanceof Error?l.message:l))}},o=t&&setTimeout(()=>{o=null,i(new N(`timeout ${t} of ms exceeded`,N.ETIMEDOUT))},t),a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));let{signal:c}=n;return c.unsubscribe=()=>v.asap(a),c}},gm=m0;var f0=function*(e,t){let s=e.byteLength;if(!t||s<t){yield e;return}let n=0,r;for(;n<s;)r=n+t,yield e.slice(n,r),n=r},g0=async function*(e,t){for await(let s of h0(e))yield*f0(s,t)},h0=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:s,value:n}=await t.read();if(s)break;yield n}}finally{await t.cancel()}},Ma=(e,t,s,n)=>{let r=g0(e,t),i=0,o,a=c=>{o||(o=!0,n&&n(c))};return new ReadableStream({async pull(c){try{let{done:u,value:l}=await r.next();if(u){a(),c.close();return}let p=l.byteLength;if(s){let d=i+=p;s(d)}c.enqueue(new Uint8Array(l))}catch(u){throw a(u),u}},cancel(c){return a(c),r.return()}},{highWaterMark:2})};var hm=64*1024,{isFunction:fi}=v,y0=(({Request:e,Response:t})=>({Request:e,Response:t}))(v.global),{ReadableStream:ym,TextEncoder:Dm}=v.global,bm=(e,...t)=>{try{return!!e(...t)}catch{return!1}},D0=e=>{e=v.merge.call({skipUndefined:!0},y0,e);let{fetch:t,Request:s,Response:n}=e,r=t?fi(t):typeof fetch=="function",i=fi(s),o=fi(n);if(!r)return!1;let a=r&&fi(ym),c=r&&(typeof Dm=="function"?(m=>g=>m.encode(g))(new Dm):async m=>new Uint8Array(await new s(m).arrayBuffer())),u=i&&a&&bm(()=>{let m=!1,g=new s(he.origin,{body:new ym,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!g}),l=o&&a&&bm(()=>v.isReadableStream(new n("").body)),p={stream:l&&(m=>m.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!p[m]&&(p[m]=(g,h)=>{let y=g&&g[m];if(y)return y.call(g);throw new N(`Response type '${m}' is not supported`,N.ERR_NOT_SUPPORT,h)})});let d=async m=>{if(m==null)return 0;if(v.isBlob(m))return m.size;if(v.isSpecCompliantForm(m))return(await new s(he.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(v.isArrayBufferView(m)||v.isArrayBuffer(m))return m.byteLength;if(v.isURLSearchParams(m)&&(m=m+""),v.isString(m))return(await c(m)).byteLength},f=async(m,g)=>{let h=v.toFiniteNumber(m.getContentLength());return h??d(g)};return async m=>{let{url:g,method:h,data:y,signal:D,cancelToken:A,timeout:b,onDownloadProgress:E,onUploadProgress:T,responseType:k,headers:S,withCredentials:$="same-origin",fetchOptions:K}=mi(m),J=t||fetch;k=k?(k+"").toLowerCase():"text";let V=gm([D,A&&A.toAbortSignal()],b),Z=null,O=V&&V.unsubscribe&&(()=>{V.unsubscribe()}),I;try{if(T&&u&&h!=="get"&&h!=="head"&&(I=await f(S,y))!==0){let W=new s(g,{method:"POST",body:y,duplex:"half"}),se;if(v.isFormData(y)&&(se=W.headers.get("content-type"))&&S.setContentType(se),W.body){let[Ee,De]=gn(I,$t(hn(T)));y=Ma(W.body,hm,Ee,De)}}v.isString($)||($=$?"include":"omit");let _=i&&"credentials"in s.prototype,B={...K,signal:V,method:h.toUpperCase(),headers:S.normalize().toJSON(),body:y,duplex:"half",credentials:_?$:void 0};Z=i&&new s(g,B);let U=await(i?J(Z,K):J(g,B)),le=l&&(k==="stream"||k==="response");if(l&&(E||le&&O)){let W={};["status","statusText","headers"].forEach(ie=>{W[ie]=U[ie]});let se=v.toFiniteNumber(U.headers.get("content-length")),[Ee,De]=E&&gn(se,$t(hn(E),!0))||[];U=new n(Ma(U.body,hm,Ee,()=>{De&&De(),O&&O()}),W)}k=k||"text";let G=await p[v.findKey(p,k)||"text"](U,m);return!le&&O&&O(),await new Promise((W,se)=>{Pt(W,se,{data:G,headers:we.from(U.headers),status:U.status,statusText:U.statusText,config:m,request:Z})})}catch(_){throw O&&O(),_&&_.name==="TypeError"&&/Load failed|fetch/i.test(_.message)?Object.assign(new N("Network Error",N.ERR_NETWORK,m,Z),{cause:_.cause||_}):N.from(_,_&&_.code,m,Z)}}},b0=new Map,Na=e=>{let t=e&&e.env||{},{fetch:s,Request:n,Response:r}=t,i=[n,r,s],o=i.length,a=o,c,u,l=b0;for(;a--;)c=i[a],u=l.get(c),u===void 0&&l.set(c,u=a?new Map:D0(t)),l=u;return u},o2=Na();var Wa={http:lm,xhr:fm,fetch:{get:Na}};v.forEach(Wa,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var vm=e=>`- ${e}`,S0=e=>v.isFunction(e)||e===null||e===!1;function C0(e,t){e=v.isArray(e)?e:[e];let{length:s}=e,n,r,i={};for(let o=0;o<s;o++){n=e[o];let a;if(r=n,!S0(n)&&(r=Wa[(a=String(n)).toLowerCase()],r===void 0))throw new N(`Unknown adapter '${a}'`);if(r&&(v.isFunction(r)||(r=r.get(t))))break;i[a||"#"+o]=r}if(!r){let o=Object.entries(i).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build")),a=s?o.length>1?`since :
@@ -118,7 +118,7 @@ ${j.comment("\u{1F4A1} Next Steps:")}`),le?(e.log(j.error(" \u274C Trial expir
118
118
  `)},displayQuotaWarning:I=>{let{currentResourcesAnalyzed:_,maxResources:B,requestedResources:U,isTrial:le}=I;if(!le)return;_+U>B&&(e.log(`
119
119
  ${j.warning.bold("\u26A0\uFE0F Trial Limit Exceeded")}`),e.log(j.comment("\u2500".repeat(40))),e.log(j.warning(` You've analyzed ${_}/${B} resources`)),e.log(j.warning(` This analysis would add ${U} more resources`)),e.log(j.warning(` Total would be ${_+U}/${B}`)),e.log(`
120
120
  ${j.info("\u{1F4CB} Falling back to static analysis only")}`),e.log(j.comment("\u{1F4A1} Upgrade to Pro for unlimited AI analysis: https://cdkinsights.dev/pricing")),e.log(`${j.comment("\u2500".repeat(40))}
121
- `))}}},q=lI();var RD=e=>e&&(e.Name||e.ResourceName||e.FunctionName)||"Unnamed";var ou=null,wD=e=>{ou=e};var au=()=>{if(ou&&!process.env.CI)try{ou.saveToDisk(),Ve.info("\u{1F4BE} Cache saved to disk on exit")}catch(e){Ve.warn("\u26A0\uFE0F Could not save cache on exit",{error:e instanceof Error?e.message:String(e)})}};process.on("exit",au);process.on("SIGINT",()=>{au(),process.exit(0)});process.on("SIGTERM",()=>{au(),process.exit(0)});var pI={maxConcurrent:Cr.DEFAULT_MAX_CONCURRENT,retryAttempts:Cr.DEFAULT_RETRY_ATTEMPTS,retryDelay:Cr.DEFAULT_RETRY_DELAY_MS,timeoutMs:Cr.DEFAULT_TIMEOUT_MS},dI=e=>{if(!(e instanceof Error))return!1;let t=e.message??"";return t.startsWith("Polling timed out")||t==="Analysis timeout"||t.toLowerCase().includes("timeout")},mI=e=>{let t=dr({ttl:6e4,maxSize:1e3});return({analysisError:s,redactedId:n})=>{let r=s instanceof Error?s.message:"unknown",i=`${n}:${r}`,o=t.get(i)||0;return dI(s)?{status:"timeout",redactedId:n}:(t.set(i,o+1),o>e.retryAttempts?{status:"skipped",redactedId:n}:{status:"fail",redactedId:n,error:s})}},fI=({analyzeResource:e,redactionMapping:t,aggregatedResult:s,errorHandler:n,config:r,authToken:i,fingerprint:o,stackName:a,analysisCache:c,originalResources:u,relationships:l})=>async({redactedId:p,redactedResources:d,findingsByResource:f,progressTracker:m})=>{let g=f.get(p)||[],h=d[p];if(!h)return{status:"skipped",redactedId:p};let D=uy(p,h,i,o,[]),A=ly(D),b=t[p];if(!b)return{status:"skipped",redactedId:p};let E=b,T=()=>(s[E]||(s[E]={issues:[]}),s[E]),k=c.get(A);if(k){let J=(k.issues||[]).map(Z=>({...Z,resource:E,resourceId:E})),V=T();return V.issues.push(...Fr({existing:V.issues,incoming:J})),V.resourceName=k.resourceName,{status:"success",redactedId:p,resourceKey:E,remappedIssues:J,resourceName:k.resourceName}}let S=gy(a,b),$=qa(b,l,u),K={dependencies:$.dependencies,dependents:$.dependents,usageDescription:$.usageDescription};for(let J=1;J<=r.retryAttempts;J++)try{let V=await Promise.race([e(a,S,h,h.Type,i,o,g,m,K),new Promise((I,_)=>setTimeout(()=>_(new Error("Analysis timeout")),r.timeoutMs))]);V.resourceId=E;let Z=(V.issues||[]).map(I=>({...I,resource:E,resourceId:E})),O=T();return O.issues.push(...Fr({existing:O.issues,incoming:Z})),O.resourceName=V.resourceName,c.set(A,V,D),{status:"success",redactedId:p,resourceKey:E,remappedIssues:Z,resourceName:V.resourceName}}catch(V){if(J===r.retryAttempts)return n({analysisError:V,redactedId:p});await new Promise(Z=>setTimeout(Z,r.retryDelay*2**(J-1)))}return{status:"fail",redactedId:p,error:new Error("Max retries exceeded")}},gI=async(e,t,s)=>{let n=Math.max(1,Math.floor(t)),r=0,i=Array.from({length:Math.min(n,e.length)}).map(async()=>{for(;r<e.length;){let o=r;r+=1;let a=e[o];await s(a)}});await Promise.allSettled(i)},ID=({analyzeResource:e,redactResources:t,config:s=pI})=>async({stackName:n,resources:r,authToken:i,existingFindingsMap:o,pathToLogicalId:a,fingerprint:c,noCache:u=!1,cacheConfig:l})=>{let p={},d=[],f={startTime:Date.now(),processedCount:0,successCount:0,failureCount:0,timeoutCount:0},{redactedResources:m,mapping:g}=t(r),h=yy(o,g,a),y=new Map;for(let O of h){let I=y.get(O.resourceId);I?I.push(O):y.set(O.resourceId,[O])}let D=Object.keys(m),A=D.length,b=Fs(r),E=new Ji({ttl:l?.ttl||3e5,maxSize:l?.maxSize||5e3,disabled:u||!l?.enabled});wD(E);let T=mI(s),k=fI({analyzeResource:e,redactionMapping:g,aggregatedResult:p,errorHandler:T,config:s,authToken:i,fingerprint:c,stackName:n,analysisCache:E,originalResources:r,relationships:b}),S=lo.createSingleLineProgressTracker(A,"Analyzing resources with AI");await gI(D,s.maxConcurrent,async O=>{Ve.debug(`Starting analysis for resource ${O}`,{redactedId:O,maxConcurrent:s.maxConcurrent});let I=await k({redactedId:O,redactedResources:m,findingsByResource:y,progressTracker:S});switch(f.processedCount++,Ve.debug(`Resource ${O} analysis result: ${I.status}`,{redactedId:O,status:I.status,hasProgressTracker:!!S}),I.status){case"success":f.successCount++,Ve.debug(`Resource ${O} completed successfully`,{redactedId:O,resourceKey:I.resourceKey});break;case"timeout":f.timeoutCount++,Ve.warn(`Resource ${O} timed out`,{redactedId:O}),d.push({redactedId:O,resourceData:m[O],resourceType:m[O].Type,existingFindings:y.get(O)||[]});break;case"fail":case"skipped":f.failureCount++,Ve.warn(`Resource ${O} failed or was skipped`,{redactedId:O,status:I.status});break}}),S.showSummary();let $=Date.now()-f.startTime,K=S.getStats();if(Ve.debug("Analysis completed with progress tracker stats",{progressTrackerStats:K,performanceMetrics:f,totalTime:$,totalResources:A,maxConcurrent:s.maxConcurrent}),q.analysisComplete($,f.successCount,f.failureCount,f.timeoutCount),f.failureCount>0||f.timeoutCount>0){q.newline(),q.info("\u{1F4CA} Performance Analysis:");let O=f.successCount>0?Math.round($/1e3/f.successCount):0;q.comment(` \u23F1\uFE0F Average completion time: ${O}s`),q.comment(` \u{1F4CA} Success rate: ${(f.successCount/A*100).toFixed(1)}%`)}if(d.length>0){q.newline(),q.warning("\u23F0 Timed Out Resources:"),q.comment(` \u{1F4CB} Total timed out: ${d.length}`);for(let O of d){if(q.comment(` \u274C ${O.resourceType}: ${O.redactedId}`),O.resourceData?.Properties){let _=O.resourceData.Properties,B=RD(_);q.comment(` \u{1F4DD} Name: ${B}`)}O.existingFindings.length>0&&q.comment(` \u{1F50D} Existing findings: ${O.existingFindings.length}`),O.resourceData?.Metadata&&q.comment(" \u{1F4CD} Has metadata: Yes"),["AWS::CloudFormation::Stack","AWS::Serverless::Application","AWS::ECS::Service"].includes(O.resourceType)&&q.comment(" \u26A0\uFE0F Complex resource type - may require extended analysis time")}q.newline(),q.info("\u{1F4A1} Tip: Some resources are taking longer to analyze than expected."),q.comment(" This is normal for complex resources. The analysis will continue with the remaining resources."),q.warning(`Retrying ${d.length} resource${d.length===1?"":"s"} that need a little more time...`)}let J=new Set(Object.keys(p)),V=new Set(Object.values(g)),Z=Array.from(V).filter(O=>!J.has(O)||!p[O]?.issues?.length);if(Z.length>0){let O=E.getCachedResultsForResources(Z),I=0;for(let[_,B]of Array.from(O.entries())){if(p[_]?.issues?.length>0)continue;let U=(B.issues||[]).map(le=>({...le,resource:_,resourceId:_}));U.length>0&&(p[_]||(p[_]={issues:[]}),p[_].issues.push(...U),p[_].resourceName=B.resourceName,I+=U.length)}I>0}return p};var cu=require("node:child_process"),$e=H(require("node:fs")),uu=H(require("node:os")),Lr=H(require("node:path"));var _D="1.2.0",hI={Security:"https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/",Reliability:"https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/","Performance Efficiency":"https://docs.aws.amazon.com/wellarchitected/latest/performance-efficiency-pillar/","Cost Optimization":"https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/","Operational Excellence":"https://docs.aws.amazon.com/wellarchitected/latest/operational-excellence-pillar/",Sustainability:"https://docs.aws.amazon.com/wellarchitected/latest/sustainability-pillar/"},TD=e=>e.toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/\s+/g,"-").replace(/-+/g,"-"),yI=(e,t)=>{let s=0;if(s+=2e3,t){let n=Object.values(e).filter(r=>{let i=r.sources.cdkInsights?.issues??[],o=r.sources.cdkNag?.issues??[];return i.length>0||o.length>0});s+=n.length*100}for(let[,n]of Object.entries(e)){let r=n.sources.cdkInsights?.issues??[],i=n.sources.cdkNag?.issues??[];for(let o of[...r,...i])s+=o.issue.length,s+=o.recommendation?.length||0,s+=o.codeSnippet?.length||0,s+=500}return s},DI=e=>e?e.split(`
121
+ `))}}},q=lI();var RD=e=>e&&(e.Name||e.ResourceName||e.FunctionName)||"Unnamed";var ou=null,wD=e=>{ou=e};var au=()=>{if(ou&&!process.env.CI)try{ou.saveToDisk(),Ve.info("\u{1F4BE} Cache saved to disk on exit")}catch(e){Ve.warn("\u26A0\uFE0F Could not save cache on exit",{error:e instanceof Error?e.message:String(e)})}};process.on("exit",au);process.on("SIGINT",()=>{au(),process.exit(0)});process.on("SIGTERM",()=>{au(),process.exit(0)});var pI={maxConcurrent:Cr.DEFAULT_MAX_CONCURRENT,retryAttempts:Cr.DEFAULT_RETRY_ATTEMPTS,retryDelay:Cr.DEFAULT_RETRY_DELAY_MS,timeoutMs:Cr.DEFAULT_TIMEOUT_MS},dI=e=>{if(!(e instanceof Error))return!1;let t=e.message??"";return t.startsWith("Polling timed out")||t==="Analysis timeout"||t.toLowerCase().includes("timeout")},mI=e=>{let t=dr({ttl:6e4,maxSize:1e3});return({analysisError:s,redactedId:n})=>{let r=s instanceof Error?s.message:"unknown",i=`${n}:${r}`,o=t.get(i)||0;return dI(s)?{status:"timeout",redactedId:n}:(t.set(i,o+1),o>e.retryAttempts?{status:"skipped",redactedId:n}:{status:"fail",redactedId:n,error:s})}},fI=({analyzeResource:e,redactionMapping:t,aggregatedResult:s,errorHandler:n,config:r,authToken:i,fingerprint:o,stackName:a,analysisCache:c,originalResources:u,relationships:l})=>async({redactedId:p,redactedResources:d,findingsByResource:f,progressTracker:m})=>{let g=f.get(p)||[],h=d[p];if(!h)return{status:"skipped",redactedId:p};let D=uy(p,h,i,o,[]),A=ly(D),b=t[p];if(!b)return{status:"skipped",redactedId:p};let E=b,T=()=>(s[E]||(s[E]={issues:[]}),s[E]),k=c.get(A);if(k){let J=(k.issues||[]).map(Z=>({...Z,resource:E,resourceId:E})),V=T();return V.issues.push(...Fr({existing:V.issues,incoming:J})),V.resourceName=k.resourceName,{status:"success",redactedId:p,resourceKey:E,remappedIssues:J,resourceName:k.resourceName}}let S=gy(a,b),$=qa(b,l,u),K={dependencies:$.dependencies,dependents:$.dependents,usageDescription:$.usageDescription};for(let J=1;J<=r.retryAttempts;J++)try{let V=await Promise.race([e(a,S,h,h.Type,i,o,g,m,K),new Promise((I,_)=>setTimeout(()=>_(new Error("Analysis timeout")),r.timeoutMs))]);V.resourceId=E;let Z=(V.issues||[]).map(I=>({...I,resource:E,resourceId:E})),O=T();return O.issues.push(...Fr({existing:O.issues,incoming:Z})),O.resourceName=V.resourceName,c.set(A,V,D),{status:"success",redactedId:p,resourceKey:E,remappedIssues:Z,resourceName:V.resourceName}}catch(V){if(J===r.retryAttempts)return n({analysisError:V,redactedId:p});await new Promise(Z=>setTimeout(Z,r.retryDelay*2**(J-1)))}return{status:"fail",redactedId:p,error:new Error("Max retries exceeded")}},gI=async(e,t,s)=>{let n=Math.max(1,Math.floor(t)),r=0,i=Array.from({length:Math.min(n,e.length)}).map(async()=>{for(;r<e.length;){let o=r;r+=1;let a=e[o];await s(a)}});await Promise.allSettled(i)},ID=({analyzeResource:e,redactResources:t,config:s=pI})=>async({stackName:n,resources:r,authToken:i,existingFindingsMap:o,pathToLogicalId:a,fingerprint:c,noCache:u=!1,cacheConfig:l})=>{let p={},d=[],f={startTime:Date.now(),processedCount:0,successCount:0,failureCount:0,timeoutCount:0},{redactedResources:m,mapping:g}=t(r),h=yy(o,g,a),y=new Map;for(let O of h){let I=y.get(O.resourceId);I?I.push(O):y.set(O.resourceId,[O])}let D=Object.keys(m),A=D.length,b=Fs(r),E=new Ji({ttl:l?.ttl||3e5,maxSize:l?.maxSize||5e3,disabled:u||!l?.enabled});wD(E);let T=mI(s),k=fI({analyzeResource:e,redactionMapping:g,aggregatedResult:p,errorHandler:T,config:s,authToken:i,fingerprint:c,stackName:n,analysisCache:E,originalResources:r,relationships:b}),S=lo.createSingleLineProgressTracker(A,"Analyzing resources with AI");await gI(D,s.maxConcurrent,async O=>{Ve.debug(`Starting analysis for resource ${O}`,{redactedId:O,maxConcurrent:s.maxConcurrent});let I=await k({redactedId:O,redactedResources:m,findingsByResource:y,progressTracker:S});switch(f.processedCount++,Ve.debug(`Resource ${O} analysis result: ${I.status}`,{redactedId:O,status:I.status,hasProgressTracker:!!S}),I.status){case"success":f.successCount++,Ve.debug(`Resource ${O} completed successfully`,{redactedId:O,resourceKey:I.resourceKey});break;case"timeout":f.timeoutCount++,Ve.warn(`Resource ${O} timed out`,{redactedId:O}),d.push({redactedId:O,resourceData:m[O],resourceType:m[O].Type,existingFindings:y.get(O)||[]});break;case"fail":case"skipped":f.failureCount++,Ve.warn(`Resource ${O} failed or was skipped`,{redactedId:O,status:I.status});break}}),S.showSummary();let $=Date.now()-f.startTime,K=S.getStats();if(Ve.debug("Analysis completed with progress tracker stats",{progressTrackerStats:K,performanceMetrics:f,totalTime:$,totalResources:A,maxConcurrent:s.maxConcurrent}),q.analysisComplete($,f.successCount,f.failureCount,f.timeoutCount),f.failureCount>0||f.timeoutCount>0){q.newline(),q.info("\u{1F4CA} Performance Analysis:");let O=f.successCount>0?Math.round($/1e3/f.successCount):0;q.comment(` \u23F1\uFE0F Average completion time: ${O}s`),q.comment(` \u{1F4CA} Success rate: ${(f.successCount/A*100).toFixed(1)}%`)}if(d.length>0){q.newline(),q.warning("\u23F0 Timed Out Resources:"),q.comment(` \u{1F4CB} Total timed out: ${d.length}`);for(let O of d){if(q.comment(` \u274C ${O.resourceType}: ${O.redactedId}`),O.resourceData?.Properties){let _=O.resourceData.Properties,B=RD(_);q.comment(` \u{1F4DD} Name: ${B}`)}O.existingFindings.length>0&&q.comment(` \u{1F50D} Existing findings: ${O.existingFindings.length}`),O.resourceData?.Metadata&&q.comment(" \u{1F4CD} Has metadata: Yes"),["AWS::CloudFormation::Stack","AWS::Serverless::Application","AWS::ECS::Service"].includes(O.resourceType)&&q.comment(" \u26A0\uFE0F Complex resource type - may require extended analysis time")}q.newline(),q.info("\u{1F4A1} Tip: Some resources are taking longer to analyze than expected."),q.comment(" This is normal for complex resources. The analysis will continue with the remaining resources."),q.warning(`Retrying ${d.length} resource${d.length===1?"":"s"} that need a little more time...`)}let J=new Set(Object.keys(p)),V=new Set(Object.values(g)),Z=Array.from(V).filter(O=>!J.has(O)||!p[O]?.issues?.length);if(Z.length>0){let O=E.getCachedResultsForResources(Z),I=0;for(let[_,B]of Array.from(O.entries())){if(p[_]?.issues?.length>0)continue;let U=(B.issues||[]).map(le=>({...le,resource:_,resourceId:_}));U.length>0&&(p[_]||(p[_]={issues:[]}),p[_].issues.push(...U),p[_].resourceName=B.resourceName,I+=U.length)}I>0}return p};var cu=require("node:child_process"),$e=H(require("node:fs")),uu=H(require("node:os")),Lr=H(require("node:path"));var _D="1.2.2",hI={Security:"https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/",Reliability:"https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/","Performance Efficiency":"https://docs.aws.amazon.com/wellarchitected/latest/performance-efficiency-pillar/","Cost Optimization":"https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/","Operational Excellence":"https://docs.aws.amazon.com/wellarchitected/latest/operational-excellence-pillar/",Sustainability:"https://docs.aws.amazon.com/wellarchitected/latest/sustainability-pillar/"},TD=e=>e.toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/\s+/g,"-").replace(/-+/g,"-"),yI=(e,t)=>{let s=0;if(s+=2e3,t){let n=Object.values(e).filter(r=>{let i=r.sources.cdkInsights?.issues??[],o=r.sources.cdkNag?.issues??[];return i.length>0||o.length>0});s+=n.length*100}for(let[,n]of Object.entries(e)){let r=n.sources.cdkInsights?.issues??[],i=n.sources.cdkNag?.issues??[];for(let o of[...r,...i])s+=o.issue.length,s+=o.recommendation?.length||0,s+=o.codeSnippet?.length||0,s+=500}return s},DI=e=>e?e.split(`
122
122
  `).map(t=>t.trim()).filter(Boolean).join(`
123
123
  `):"",kD=e=>{let t=`- **Issue:** ${e.issue}`;if(e.recommendation&&(t+=`
124
124
  - **Recommendation:** ${DI(e.recommendation)}`),e.sourceLocation){let{filePath:s,line:n,column:r,confidence:i}=e.sourceLocation;t+=`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdk-insights",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "AWS CDK security and cost analysis tool with AI-powered insights",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",