cdk-insights 1.2.2 → 1.2.4

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
@@ -1,14 +1,14 @@
1
1
  "use strict";var yv=Object.create;var zr=Object.defineProperty;var Dv=Object.getOwnPropertyDescriptor;var bv=Object.getOwnPropertyNames;var vv=Object.getPrototypeOf,Sv=Object.prototype.hasOwnProperty;var R=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qu=(e,t)=>{for(var s in t)zr(e,s,{get:t[s],enumerable:!0})},Hu=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of bv(t))!Sv.call(e,r)&&r!==s&&zr(e,r,{get:()=>t[r],enumerable:!(n=Dv(t,r))||n.enumerable});return e};var H=(e,t,s)=>(s=e!=null?yv(vv(e)):{},Hu(t||!e||!e.__esModule?zr(s,"default",{value:e,enumerable:!0}):s,e)),Cv=e=>Hu(zr({},"__esModule",{value:!0}),e);var il=R((Ak,rl)=>{var nl=require("stream").Stream,cS=require("util");rl.exports=xt;function xt(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}cS.inherits(xt,nl);xt.create=function(e,t){var s=new this;t=t||{};for(var n in t)s[n]=t[n];s.source=e;var r=e.emit;return e.emit=function(){return s._handleEmit(arguments),r.apply(e,arguments)},e.on("error",function(){}),s.pauseStream&&e.pause(),s};Object.defineProperty(xt.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});xt.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};xt.prototype.resume=function(){this._released||this.release(),this.source.resume()};xt.prototype.pause=function(){this.source.pause()};xt.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};xt.prototype.pipe=function(){var e=nl.prototype.pipe.apply(this,arguments);return this.resume(),e};xt.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};xt.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var ul=R((Fk,cl)=>{var uS=require("util"),al=require("stream").Stream,ol=il();cl.exports=Ie;function Ie(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}uS.inherits(Ie,al);Ie.create=function(e){var t=new this;e=e||{};for(var s in e)t[s]=e[s];return t};Ie.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};Ie.prototype.append=function(e){var t=Ie.isStreamLike(e);if(t){if(!(e instanceof ol)){var s=ol.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=s}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};Ie.prototype.pipe=function(e,t){return al.prototype.pipe.call(this,e,t),this.resume(),e};Ie.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};Ie.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(s){var n=Ie.isStreamLike(s);n&&(s.on("data",this._checkDataSize.bind(this)),this._handleErrors(s)),this._pipeNext(s)}.bind(this))};Ie.prototype._pipeNext=function(e){this._currentStream=e;var t=Ie.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var s=e;this.write(s),this._getNext()};Ie.prototype._handleErrors=function(e){var t=this;e.on("error",function(s){t._emitError(s)})};Ie.prototype.write=function(e){this.emit("data",e)};Ie.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};Ie.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};Ie.prototype.end=function(){this._reset(),this.emit("end")};Ie.prototype.destroy=function(){this._reset(),this.emit("close")};Ie.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};Ie.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};Ie.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};Ie.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ll=R((Ek,lS)=>{lS.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var dl=R((Rk,pl)=>{pl.exports=ll()});var gl=R(Je=>{"use strict";var Zr=dl(),pS=require("path").extname,ml=/^\s*([^;\s]*)(?:;|\s|$)/,dS=/^text\//i;Je.charset=fl;Je.charsets={lookup:fl};Je.contentType=mS;Je.extension=fS;Je.extensions=Object.create(null);Je.lookup=gS;Je.types=Object.create(null);hS(Je.extensions,Je.types);function fl(e){if(!e||typeof e!="string")return!1;var t=ml.exec(e),s=t&&Zr[t[1].toLowerCase()];return s&&s.charset?s.charset:t&&dS.test(t[1])?"UTF-8":!1}function mS(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Je.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var s=Je.charset(t);s&&(t+="; charset="+s.toLowerCase())}return t}function fS(e){if(!e||typeof e!="string")return!1;var t=ml.exec(e),s=t&&Je.extensions[t[1].toLowerCase()];return!s||!s.length?!1:s[0]}function gS(e){if(!e||typeof e!="string")return!1;var t=pS("x."+e).toLowerCase().substr(1);return t&&Je.types[t]||!1}function hS(e,t){var s=["nginx","apache",void 0,"iana"];Object.keys(Zr).forEach(function(r){var i=Zr[r],o=i.extensions;if(!(!o||!o.length)){e[r]=o;for(var a=0;a<o.length;a++){var c=o[a];if(t[c]){var u=s.indexOf(Zr[t[c]].source),l=s.indexOf(i.source);if(t[c]!=="application/octet-stream"&&(u>l||u===l&&t[c].substr(0,12)==="application/"))continue}t[c]=r}}})}});var yl=R((Ik,hl)=>{hl.exports=yS;function yS(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}});var Po=R((Tk,bl)=>{var Dl=yl();bl.exports=DS;function DS(e){var t=!1;return Dl(function(){t=!0}),function(n,r){t?e(n,r):Dl(function(){e(n,r)})}}});var Oo=R((kk,vl)=>{vl.exports=bS;function bS(e){Object.keys(e.jobs).forEach(vS.bind(e)),e.jobs={}}function vS(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}});var Bo=R((_k,Cl)=>{var Sl=Po(),SS=Oo();Cl.exports=CS;function CS(e,t,s,n){var r=s.keyedList?s.keyedList[s.index]:s.index;s.jobs[r]=xS(t,r,e[r],function(i,o){r in s.jobs&&(delete s.jobs[r],i?SS(s):s.results[r]=o,n(i,s.results))})}function xS(e,t,s,n){var r;return e.length==2?r=e(s,Sl(n)):r=e(s,t,Sl(n)),r}});var Mo=R((Lk,xl)=>{xl.exports=AS;function AS(e,t){var s=!Array.isArray(e),n={index:0,keyedList:s||t?Object.keys(e):null,jobs:{},results:s?{}:[],size:s?Object.keys(e).length:e.length};return t&&n.keyedList.sort(s?t:function(r,i){return t(e[r],e[i])}),n}});var No=R((Pk,Al)=>{var FS=Oo(),ES=Po();Al.exports=RS;function RS(e){Object.keys(this.jobs).length&&(this.index=this.size,FS(this),ES(e)(null,this.results))}});var El=R((Ok,Fl)=>{var wS=Bo(),IS=Mo(),TS=No();Fl.exports=kS;function kS(e,t,s){for(var n=IS(e);n.index<(n.keyedList||e).length;)wS(e,t,n,function(r,i){if(r){s(r,i);return}if(Object.keys(n.jobs).length===0){s(null,n.results);return}}),n.index++;return TS.bind(n,s)}});var Wo=R((Bk,Yr)=>{var Rl=Bo(),_S=Mo(),LS=No();Yr.exports=PS;Yr.exports.ascending=wl;Yr.exports.descending=OS;function PS(e,t,s,n){var r=_S(e,s);return Rl(e,t,r,function i(o,a){if(o){n(o,a);return}if(r.index++,r.index<(r.keyedList||e).length){Rl(e,t,r,i);return}n(null,r.results)}),LS.bind(r,n)}function wl(e,t){return e<t?-1:e>t?1:0}function OS(e,t){return-1*wl(e,t)}});var Tl=R((Mk,Il)=>{var BS=Wo();Il.exports=MS;function MS(e,t,s){return BS(e,t,null,s)}});var _l=R((Nk,kl)=>{kl.exports={parallel:El(),serial:Tl(),serialOrdered:Wo()}});var jo=R((Wk,Ll)=>{"use strict";Ll.exports=Object});var Ol=R((jk,Pl)=>{"use strict";Pl.exports=Error});var Ml=R(($k,Bl)=>{"use strict";Bl.exports=EvalError});var Wl=R((Uk,Nl)=>{"use strict";Nl.exports=RangeError});var $l=R((Gk,jl)=>{"use strict";jl.exports=ReferenceError});var Gl=R((zk,Ul)=>{"use strict";Ul.exports=SyntaxError});var Jr=R((qk,zl)=>{"use strict";zl.exports=TypeError});var Hl=R((Hk,ql)=>{"use strict";ql.exports=URIError});var Kl=R((Vk,Vl)=>{"use strict";Vl.exports=Math.abs});var Yl=R((Kk,Zl)=>{"use strict";Zl.exports=Math.floor});var Ql=R((Zk,Jl)=>{"use strict";Jl.exports=Math.max});var ep=R((Yk,Xl)=>{"use strict";Xl.exports=Math.min});var sp=R((Jk,tp)=>{"use strict";tp.exports=Math.pow});var rp=R((Qk,np)=>{"use strict";np.exports=Math.round});var op=R((Xk,ip)=>{"use strict";ip.exports=Number.isNaN||function(t){return t!==t}});var cp=R((e_,ap)=>{"use strict";var NS=op();ap.exports=function(t){return NS(t)||t===0?t:t<0?-1:1}});var lp=R((t_,up)=>{"use strict";up.exports=Object.getOwnPropertyDescriptor});var $o=R((s_,pp)=>{"use strict";var Qr=lp();if(Qr)try{Qr([],"length")}catch{Qr=null}pp.exports=Qr});var mp=R((n_,dp)=>{"use strict";var Xr=Object.defineProperty||!1;if(Xr)try{Xr({},"a",{value:1})}catch{Xr=!1}dp.exports=Xr});var Uo=R((r_,fp)=>{"use strict";fp.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},s=Symbol("test"),n=Object(s);if(typeof s=="string"||Object.prototype.toString.call(s)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var r=42;t[s]=r;for(var i in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==s||!Object.prototype.propertyIsEnumerable.call(t,s))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,s);if(a.value!==r||a.enumerable!==!0)return!1}return!0}});var yp=R((i_,hp)=>{"use strict";var gp=typeof Symbol<"u"&&Symbol,WS=Uo();hp.exports=function(){return typeof gp!="function"||typeof Symbol!="function"||typeof gp("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:WS()}});var Go=R((o_,Dp)=>{"use strict";Dp.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var zo=R((a_,bp)=>{"use strict";var jS=jo();bp.exports=jS.getPrototypeOf||null});var Cp=R((c_,Sp)=>{"use strict";var $S="Function.prototype.bind called on incompatible ",US=Object.prototype.toString,GS=Math.max,zS="[object Function]",vp=function(t,s){for(var n=[],r=0;r<t.length;r+=1)n[r]=t[r];for(var i=0;i<s.length;i+=1)n[i+t.length]=s[i];return n},qS=function(t,s){for(var n=[],r=s||0,i=0;r<t.length;r+=1,i+=1)n[i]=t[r];return n},HS=function(e,t){for(var s="",n=0;n<e.length;n+=1)s+=e[n],n+1<e.length&&(s+=t);return s};Sp.exports=function(t){var s=this;if(typeof s!="function"||US.apply(s)!==zS)throw new TypeError($S+s);for(var n=qS(arguments,1),r,i=function(){if(this instanceof r){var l=s.apply(this,vp(n,arguments));return Object(l)===l?l:this}return s.apply(t,vp(n,arguments))},o=GS(0,s.length-n.length),a=[],c=0;c<o;c++)a[c]="$"+c;if(r=Function("binder","return function ("+HS(a,",")+"){ return binder.apply(this,arguments); }")(i),s.prototype){var u=function(){};u.prototype=s.prototype,r.prototype=new u,u.prototype=null}return r}});var Zn=R((u_,xp)=>{"use strict";var VS=Cp();xp.exports=Function.prototype.bind||VS});var ei=R((l_,Ap)=>{"use strict";Ap.exports=Function.prototype.call});var qo=R((p_,Fp)=>{"use strict";Fp.exports=Function.prototype.apply});var Rp=R((d_,Ep)=>{"use strict";Ep.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ip=R((m_,wp)=>{"use strict";var KS=Zn(),ZS=qo(),YS=ei(),JS=Rp();wp.exports=JS||KS.call(YS,ZS)});var kp=R((f_,Tp)=>{"use strict";var QS=Zn(),XS=Jr(),eC=ei(),tC=Ip();Tp.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new XS("a function is required");return tC(QS,eC,t)}});var Mp=R((g_,Bp)=>{"use strict";var sC=kp(),_p=$o(),Pp;try{Pp=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Ho=!!Pp&&_p&&_p(Object.prototype,"__proto__"),Op=Object,Lp=Op.getPrototypeOf;Bp.exports=Ho&&typeof Ho.get=="function"?sC([Ho.get]):typeof Lp=="function"?function(t){return Lp(t==null?t:Op(t))}:!1});var Up=R((h_,$p)=>{"use strict";var Np=Go(),Wp=zo(),jp=Mp();$p.exports=Np?function(t){return Np(t)}:Wp?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Wp(t)}:jp?function(t){return jp(t)}:null});var ti=R((y_,Gp)=>{"use strict";var nC=Function.prototype.call,rC=Object.prototype.hasOwnProperty,iC=Zn();Gp.exports=iC.call(nC,rC)});var Yp=R((D_,Zp)=>{"use strict";var ce,oC=jo(),aC=Ol(),cC=Ml(),uC=Wl(),lC=$l(),an=Gl(),on=Jr(),pC=Hl(),dC=Kl(),mC=Yl(),fC=Ql(),gC=ep(),hC=sp(),yC=rp(),DC=cp(),Vp=Function,Vo=function(e){try{return Vp('"use strict"; return ('+e+").constructor;")()}catch{}},Yn=$o(),bC=mp(),Ko=function(){throw new on},vC=Yn?function(){try{return arguments.callee,Ko}catch{try{return Yn(arguments,"callee").get}catch{return Ko}}}():Ko,nn=yp()(),Me=Up(),SC=zo(),CC=Go(),Kp=qo(),Jn=ei(),rn={},xC=typeof Uint8Array>"u"||!Me?ce:Me(Uint8Array),ys={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ce:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ce:ArrayBuffer,"%ArrayIteratorPrototype%":nn&&Me?Me([][Symbol.iterator]()):ce,"%AsyncFromSyncIteratorPrototype%":ce,"%AsyncFunction%":rn,"%AsyncGenerator%":rn,"%AsyncGeneratorFunction%":rn,"%AsyncIteratorPrototype%":rn,"%Atomics%":typeof Atomics>"u"?ce:Atomics,"%BigInt%":typeof BigInt>"u"?ce:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ce:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ce:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ce:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":aC,"%eval%":eval,"%EvalError%":cC,"%Float16Array%":typeof Float16Array>"u"?ce:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ce:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ce:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ce:FinalizationRegistry,"%Function%":Vp,"%GeneratorFunction%":rn,"%Int8Array%":typeof Int8Array>"u"?ce:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ce:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ce:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nn&&Me?Me(Me([][Symbol.iterator]())):ce,"%JSON%":typeof JSON=="object"?JSON:ce,"%Map%":typeof Map>"u"?ce:Map,"%MapIteratorPrototype%":typeof Map>"u"||!nn||!Me?ce:Me(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":oC,"%Object.getOwnPropertyDescriptor%":Yn,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ce:Promise,"%Proxy%":typeof Proxy>"u"?ce:Proxy,"%RangeError%":uC,"%ReferenceError%":lC,"%Reflect%":typeof Reflect>"u"?ce:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ce:Set,"%SetIteratorPrototype%":typeof Set>"u"||!nn||!Me?ce:Me(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ce:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nn&&Me?Me(""[Symbol.iterator]()):ce,"%Symbol%":nn?Symbol:ce,"%SyntaxError%":an,"%ThrowTypeError%":vC,"%TypedArray%":xC,"%TypeError%":on,"%Uint8Array%":typeof Uint8Array>"u"?ce:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ce:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ce:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ce:Uint32Array,"%URIError%":pC,"%WeakMap%":typeof WeakMap>"u"?ce:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ce:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ce:WeakSet,"%Function.prototype.call%":Jn,"%Function.prototype.apply%":Kp,"%Object.defineProperty%":bC,"%Object.getPrototypeOf%":SC,"%Math.abs%":dC,"%Math.floor%":mC,"%Math.max%":fC,"%Math.min%":gC,"%Math.pow%":hC,"%Math.round%":yC,"%Math.sign%":DC,"%Reflect.getPrototypeOf%":CC};if(Me)try{null.error}catch(e){zp=Me(Me(e)),ys["%Error.prototype%"]=zp}var zp,AC=function e(t){var s;if(t==="%AsyncFunction%")s=Vo("async function () {}");else if(t==="%GeneratorFunction%")s=Vo("function* () {}");else if(t==="%AsyncGeneratorFunction%")s=Vo("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(s=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var r=e("%AsyncGenerator%");r&&Me&&(s=Me(r.prototype))}return ys[t]=s,s},qp={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Qn=Zn(),si=ti(),FC=Qn.call(Jn,Array.prototype.concat),EC=Qn.call(Kp,Array.prototype.splice),Hp=Qn.call(Jn,String.prototype.replace),ni=Qn.call(Jn,String.prototype.slice),RC=Qn.call(Jn,RegExp.prototype.exec),wC=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,IC=/\\(\\)?/g,TC=function(t){var s=ni(t,0,1),n=ni(t,-1);if(s==="%"&&n!=="%")throw new an("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&s!=="%")throw new an("invalid intrinsic syntax, expected opening `%`");var r=[];return Hp(t,wC,function(i,o,a,c){r[r.length]=a?Hp(c,IC,"$1"):o||i}),r},kC=function(t,s){var n=t,r;if(si(qp,n)&&(r=qp[n],n="%"+r[0]+"%"),si(ys,n)){var i=ys[n];if(i===rn&&(i=AC(n)),typeof i>"u"&&!s)throw new on("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new an("intrinsic "+t+" does not exist!")};Zp.exports=function(t,s){if(typeof t!="string"||t.length===0)throw new on("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof s!="boolean")throw new on('"allowMissing" argument must be a boolean');if(RC(/^%?[^%]*%?$/,t)===null)throw new an("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=TC(t),r=n.length>0?n[0]:"",i=kC("%"+r+"%",s),o=i.name,a=i.value,c=!1,u=i.alias;u&&(r=u[0],EC(n,FC([0,1],u)));for(var l=1,p=!0;l<n.length;l+=1){var d=n[l],f=ni(d,0,1),m=ni(d,-1);if((f==='"'||f==="'"||f==="`"||m==='"'||m==="'"||m==="`")&&f!==m)throw new an("property names with quotes must have matching quotes");if((d==="constructor"||!p)&&(c=!0),r+="."+d,o="%"+r+"%",si(ys,o))a=ys[o];else if(a!=null){if(!(d in a)){if(!s)throw new on("base intrinsic for "+t+" exists, but the property is not available.");return}if(Yn&&l+1>=n.length){var g=Yn(a,d);p=!!g,p&&"get"in g&&!("originalValue"in g.get)?a=g.get:a=a[d]}else p=si(a,d),a=a[d];p&&!c&&(ys[o]=a)}}return a}});var Qp=R((b_,Jp)=>{"use strict";var _C=Uo();Jp.exports=function(){return _C()&&!!Symbol.toStringTag}});var td=R((v_,ed)=>{"use strict";var LC=Yp(),Xp=LC("%Object.defineProperty%",!0),PC=Qp()(),OC=ti(),BC=Jr(),ri=PC?Symbol.toStringTag:null;ed.exports=function(t,s){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,r=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof r<"u"&&typeof r!="boolean")throw new BC("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ri&&(n||!OC(t,ri))&&(Xp?Xp(t,ri,{configurable:!r,enumerable:!1,value:s,writable:!1}):t[ri]=s)}});var nd=R((S_,sd)=>{"use strict";sd.exports=function(e,t){return Object.keys(t).forEach(function(s){e[s]=e[s]||t[s]}),e}});var id=R((C_,rd)=>{"use strict";var Qo=ul(),MC=require("util"),Zo=require("path"),NC=require("http"),WC=require("https"),jC=require("url").parse,$C=require("fs"),UC=require("stream").Stream,GC=require("crypto"),Yo=gl(),zC=_l(),qC=td(),ts=ti(),Jo=nd();function me(e){if(!(this instanceof me))return new me(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Qo.call(this),e=e||{};for(var t in e)this[t]=e[t]}MC.inherits(me,Qo);me.LINE_BREAK=`\r
2
- `;me.DEFAULT_CONTENT_TYPE="application/octet-stream";me.prototype.append=function(e,t,s){s=s||{},typeof s=="string"&&(s={filename:s});var n=Qo.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var r=this._multiPartHeader(e,t,s),i=this._multiPartFooter();n(r),n(t),n(i),this._trackLength(r,t,s)};me.prototype._trackLength=function(e,t,s){var n=0;s.knownLength!=null?n+=Number(s.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+me.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ts(t,"httpVersion"))&&!(t instanceof UC))&&(s.knownLength||this._valuesToMeasure.push(t))};me.prototype._lengthRetriever=function(e,t){ts(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):$C.stat(e.path,function(s,n){if(s){t(s);return}var r=n.size-(e.start?e.start:0);t(null,r)}):ts(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ts(e,"httpModule")?(e.on("response",function(s){e.pause(),t(null,Number(s.headers["content-length"]))}),e.resume()):t("Unknown stream")};me.prototype._multiPartHeader=function(e,t,s){if(typeof s.header=="string")return s.header;var n=this._getContentDisposition(t,s),r=this._getContentType(t,s),i="",o={"Content-Disposition":["form-data",'name="'+e+'"'].concat(n||[]),"Content-Type":[].concat(r||[])};typeof s.header=="object"&&Jo(o,s.header);var a;for(var c in o)if(ts(o,c)){if(a=o[c],a==null)continue;Array.isArray(a)||(a=[a]),a.length&&(i+=c+": "+a.join("; ")+me.LINE_BREAK)}return"--"+this.getBoundary()+me.LINE_BREAK+i+me.LINE_BREAK};me.prototype._getContentDisposition=function(e,t){var s;if(typeof t.filepath=="string"?s=Zo.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?s=Zo.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ts(e,"httpVersion")&&(s=Zo.basename(e.client._httpMessage.path||"")),s)return'filename="'+s+'"'};me.prototype._getContentType=function(e,t){var s=t.contentType;return!s&&e&&e.name&&(s=Yo.lookup(e.name)),!s&&e&&e.path&&(s=Yo.lookup(e.path)),!s&&e&&e.readable&&ts(e,"httpVersion")&&(s=e.headers["content-type"]),!s&&(t.filepath||t.filename)&&(s=Yo.lookup(t.filepath||t.filename)),!s&&e&&typeof e=="object"&&(s=me.DEFAULT_CONTENT_TYPE),s};me.prototype._multiPartFooter=function(){return function(e){var t=me.LINE_BREAK,s=this._streams.length===0;s&&(t+=this._lastBoundary()),e(t)}.bind(this)};me.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+me.LINE_BREAK};me.prototype.getHeaders=function(e){var t,s={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ts(e,t)&&(s[t.toLowerCase()]=e[t]);return s};me.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};me.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};me.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),s=0,n=this._streams.length;s<n;s++)typeof this._streams[s]!="function"&&(Buffer.isBuffer(this._streams[s])?e=Buffer.concat([e,this._streams[s]]):e=Buffer.concat([e,Buffer.from(this._streams[s])]),(typeof this._streams[s]!="string"||this._streams[s].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(me.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};me.prototype._generateBoundary=function(){this._boundary="--------------------------"+GC.randomBytes(12).toString("hex")};me.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};me.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};me.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}zC.parallel(this._valuesToMeasure,this._lengthRetriever,function(s,n){if(s){e(s);return}n.forEach(function(r){t+=r}),e(null,t)})};me.prototype.submit=function(e,t){var s,n,r={method:"post"};return typeof e=="string"?(e=jC(e),n=Jo({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},r)):(n=Jo(e,r),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?s=WC.request(n):s=NC.request(n),this.getLength(function(i,o){if(i&&i!=="Unknown stream"){this._error(i);return}if(o&&s.setHeader("Content-Length",o),this.pipe(s),t){var a,c=function(u,l){return s.removeListener("error",c),s.removeListener("response",a),t.call(this,u,l)};a=c.bind(this,null),s.on("error",c),s.on("response",a)}}.bind(this)),s};me.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};me.prototype.toString=function(){return"[object FormData]"};qC(me.prototype,"FormData");rd.exports=me});var xd=R(Cd=>{"use strict";var ux=require("url").parse,lx={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},px=String.prototype.endsWith||function(e){return e.length<=this.length&&this.indexOf(e,this.length-e.length)!==-1};function dx(e){var t=typeof e=="string"?ux(e):e||{},s=t.protocol,n=t.host,r=t.port;if(typeof n!="string"||!n||typeof s!="string"||(s=s.split(":",1)[0],n=n.replace(/:\d*$/,""),r=parseInt(r)||lx[s]||0,!mx(n,r)))return"";var i=pn("npm_config_"+s+"_proxy")||pn(s+"_proxy")||pn("npm_config_proxy")||pn("all_proxy");return i&&i.indexOf("://")===-1&&(i=s+"://"+i),i}function mx(e,t){var s=(pn("npm_config_no_proxy")||pn("no_proxy")).toLowerCase();return s?s==="*"?!1:s.split(/[,\s]/).every(function(n){if(!n)return!0;var r=n.match(/^(.+):(\d+)$/),i=r?r[1]:n,o=r?parseInt(r[2]):0;return o&&o!==t?!0:/^[.*]/.test(i)?(i.charAt(0)==="*"&&(i=i.slice(1)),!px.call(e,i)):e!==i}):!0}function pn(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}Cd.getProxyForUrl=dx});var Fd=R((xL,Ad)=>{var dn=1e3,mn=dn*60,fn=mn*60,vs=fn*24,fx=vs*7,gx=vs*365.25;Ad.exports=function(e,t){t=t||{};var s=typeof e;if(s==="string"&&e.length>0)return hx(e);if(s==="number"&&isFinite(e))return t.long?Dx(e):yx(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function hx(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var s=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return s*gx;case"weeks":case"week":case"w":return s*fx;case"days":case"day":case"d":return s*vs;case"hours":case"hour":case"hrs":case"hr":case"h":return s*fn;case"minutes":case"minute":case"mins":case"min":case"m":return s*mn;case"seconds":case"second":case"secs":case"sec":case"s":return s*dn;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function yx(e){var t=Math.abs(e);return t>=vs?Math.round(e/vs)+"d":t>=fn?Math.round(e/fn)+"h":t>=mn?Math.round(e/mn)+"m":t>=dn?Math.round(e/dn)+"s":e+"ms"}function Dx(e){var t=Math.abs(e);return t>=vs?ci(e,t,vs,"day"):t>=fn?ci(e,t,fn,"hour"):t>=mn?ci(e,t,mn,"minute"):t>=dn?ci(e,t,dn,"second"):e+" ms"}function ci(e,t,s,n){var r=t>=s*1.5;return Math.round(e/s)+" "+n+(r?"s":"")}});var pa=R((AL,Ed)=>{function bx(e){s.debug=s,s.default=s,s.coerce=c,s.disable=o,s.enable=r,s.enabled=a,s.humanize=Fd(),s.destroy=u,Object.keys(e).forEach(l=>{s[l]=e[l]}),s.names=[],s.skips=[],s.formatters={};function t(l){let p=0;for(let d=0;d<l.length;d++)p=(p<<5)-p+l.charCodeAt(d),p|=0;return s.colors[Math.abs(p)%s.colors.length]}s.selectColor=t;function s(l){let p,d=null,f,m;function g(...h){if(!g.enabled)return;let y=g,D=Number(new Date),A=D-(p||D);y.diff=A,y.prev=p,y.curr=D,p=D,h[0]=s.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let b=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(T,k)=>{if(T==="%%")return"%";b++;let S=s.formatters[k];if(typeof S=="function"){let $=h[b];T=S.call(y,$),h.splice(b,1),b--}return T}),s.formatArgs.call(y,h),(y.log||s.log).apply(y,h)}return g.namespace=l,g.useColors=s.useColors(),g.color=s.selectColor(l),g.extend=n,g.destroy=s.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(f!==s.namespaces&&(f=s.namespaces,m=s.enabled(l)),m),set:h=>{d=h}}),typeof s.init=="function"&&s.init(g),g}function n(l,p){let d=s(this.namespace+(typeof p>"u"?":":p)+l);return d.log=this.log,d}function r(l){s.save(l),s.namespaces=l,s.names=[],s.skips=[];let p=(typeof l=="string"?l:"").trim().replace(" ",",").split(",").filter(Boolean);for(let d of p)d[0]==="-"?s.skips.push(d.slice(1)):s.names.push(d)}function i(l,p){let d=0,f=0,m=-1,g=0;for(;d<l.length;)if(f<p.length&&(p[f]===l[d]||p[f]==="*"))p[f]==="*"?(m=f,g=d,f++):(d++,f++);else if(m!==-1)f=m+1,g++,d=g;else return!1;for(;f<p.length&&p[f]==="*";)f++;return f===p.length}function o(){let l=[...s.names,...s.skips.map(p=>"-"+p)].join(",");return s.enable(""),l}function a(l){for(let p of s.skips)if(i(l,p))return!1;for(let p of s.names)if(i(l,p))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}Ed.exports=bx});var Rd=R((rt,ui)=>{rt.formatArgs=Sx;rt.save=Cx;rt.load=xx;rt.useColors=vx;rt.storage=Ax();rt.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();rt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function vx(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Sx(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+ui.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let s=0,n=0;e[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(s++,r==="%c"&&(n=s))}),e.splice(n,0,t)}rt.log=console.debug||console.log||(()=>{});function Cx(e){try{e?rt.storage.setItem("debug",e):rt.storage.removeItem("debug")}catch{}}function xx(){let e;try{e=rt.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Ax(){try{return localStorage}catch{}}ui.exports=pa()(rt);var{formatters:Fx}=ui.exports;Fx.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Id=R((FL,wd)=>{"use strict";wd.exports=(e,t=process.argv)=>{let s=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(s+e),r=t.indexOf("--");return n!==-1&&(r===-1||n<r)}});var _d=R((EL,kd)=>{"use strict";var Ex=require("os"),Td=require("tty"),pt=Id(),{env:Ne}=process,ns;pt("no-color")||pt("no-colors")||pt("color=false")||pt("color=never")?ns=0:(pt("color")||pt("colors")||pt("color=true")||pt("color=always"))&&(ns=1);"FORCE_COLOR"in Ne&&(Ne.FORCE_COLOR==="true"?ns=1:Ne.FORCE_COLOR==="false"?ns=0:ns=Ne.FORCE_COLOR.length===0?1:Math.min(parseInt(Ne.FORCE_COLOR,10),3));function da(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ma(e,t){if(ns===0)return 0;if(pt("color=16m")||pt("color=full")||pt("color=truecolor"))return 3;if(pt("color=256"))return 2;if(e&&!t&&ns===void 0)return 0;let s=ns||0;if(Ne.TERM==="dumb")return s;if(process.platform==="win32"){let n=Ex.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Ne)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in Ne)||Ne.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Ne)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ne.TEAMCITY_VERSION)?1:0;if(Ne.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ne){let n=parseInt((Ne.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ne.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ne.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ne.TERM)||"COLORTERM"in Ne?1:s}function Rx(e){let t=ma(e,e&&e.isTTY);return da(t)}kd.exports={supportsColor:Rx,stdout:da(ma(!0,Td.isatty(1))),stderr:da(ma(!0,Td.isatty(2)))}});var Pd=R((We,pi)=>{var wx=require("tty"),li=require("util");We.init=Ox;We.log=_x;We.formatArgs=Tx;We.save=Lx;We.load=Px;We.useColors=Ix;We.destroy=li.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");We.colors=[6,2,3,4,5,1];try{let e=_d();e&&(e.stderr||e).level>=2&&(We.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}We.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let s=t.substring(6).toLowerCase().replace(/_([a-z])/g,(r,i)=>i.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[s]=n,e},{});function Ix(){return"colors"in We.inspectOpts?!!We.inspectOpts.colors:wx.isatty(process.stderr.fd)}function Tx(e){let{namespace:t,useColors:s}=this;if(s){let n=this.color,r="\x1B[3"+(n<8?n:"8;5;"+n),i=` ${r};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
2
+ `;me.DEFAULT_CONTENT_TYPE="application/octet-stream";me.prototype.append=function(e,t,s){s=s||{},typeof s=="string"&&(s={filename:s});var n=Qo.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var r=this._multiPartHeader(e,t,s),i=this._multiPartFooter();n(r),n(t),n(i),this._trackLength(r,t,s)};me.prototype._trackLength=function(e,t,s){var n=0;s.knownLength!=null?n+=Number(s.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+me.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ts(t,"httpVersion"))&&!(t instanceof UC))&&(s.knownLength||this._valuesToMeasure.push(t))};me.prototype._lengthRetriever=function(e,t){ts(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):$C.stat(e.path,function(s,n){if(s){t(s);return}var r=n.size-(e.start?e.start:0);t(null,r)}):ts(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ts(e,"httpModule")?(e.on("response",function(s){e.pause(),t(null,Number(s.headers["content-length"]))}),e.resume()):t("Unknown stream")};me.prototype._multiPartHeader=function(e,t,s){if(typeof s.header=="string")return s.header;var n=this._getContentDisposition(t,s),r=this._getContentType(t,s),i="",o={"Content-Disposition":["form-data",'name="'+e+'"'].concat(n||[]),"Content-Type":[].concat(r||[])};typeof s.header=="object"&&Jo(o,s.header);var a;for(var c in o)if(ts(o,c)){if(a=o[c],a==null)continue;Array.isArray(a)||(a=[a]),a.length&&(i+=c+": "+a.join("; ")+me.LINE_BREAK)}return"--"+this.getBoundary()+me.LINE_BREAK+i+me.LINE_BREAK};me.prototype._getContentDisposition=function(e,t){var s;if(typeof t.filepath=="string"?s=Zo.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?s=Zo.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ts(e,"httpVersion")&&(s=Zo.basename(e.client._httpMessage.path||"")),s)return'filename="'+s+'"'};me.prototype._getContentType=function(e,t){var s=t.contentType;return!s&&e&&e.name&&(s=Yo.lookup(e.name)),!s&&e&&e.path&&(s=Yo.lookup(e.path)),!s&&e&&e.readable&&ts(e,"httpVersion")&&(s=e.headers["content-type"]),!s&&(t.filepath||t.filename)&&(s=Yo.lookup(t.filepath||t.filename)),!s&&e&&typeof e=="object"&&(s=me.DEFAULT_CONTENT_TYPE),s};me.prototype._multiPartFooter=function(){return function(e){var t=me.LINE_BREAK,s=this._streams.length===0;s&&(t+=this._lastBoundary()),e(t)}.bind(this)};me.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+me.LINE_BREAK};me.prototype.getHeaders=function(e){var t,s={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ts(e,t)&&(s[t.toLowerCase()]=e[t]);return s};me.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};me.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};me.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),s=0,n=this._streams.length;s<n;s++)typeof this._streams[s]!="function"&&(Buffer.isBuffer(this._streams[s])?e=Buffer.concat([e,this._streams[s]]):e=Buffer.concat([e,Buffer.from(this._streams[s])]),(typeof this._streams[s]!="string"||this._streams[s].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(me.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};me.prototype._generateBoundary=function(){this._boundary="--------------------------"+GC.randomBytes(12).toString("hex")};me.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};me.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};me.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}zC.parallel(this._valuesToMeasure,this._lengthRetriever,function(s,n){if(s){e(s);return}n.forEach(function(r){t+=r}),e(null,t)})};me.prototype.submit=function(e,t){var s,n,r={method:"post"};return typeof e=="string"?(e=jC(e),n=Jo({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},r)):(n=Jo(e,r),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?s=WC.request(n):s=NC.request(n),this.getLength(function(i,o){if(i&&i!=="Unknown stream"){this._error(i);return}if(o&&s.setHeader("Content-Length",o),this.pipe(s),t){var a,c=function(u,l){return s.removeListener("error",c),s.removeListener("response",a),t.call(this,u,l)};a=c.bind(this,null),s.on("error",c),s.on("response",a)}}.bind(this)),s};me.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};me.prototype.toString=function(){return"[object FormData]"};qC(me.prototype,"FormData");rd.exports=me});var xd=R(Cd=>{"use strict";var ux=require("url").parse,lx={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},px=String.prototype.endsWith||function(e){return e.length<=this.length&&this.indexOf(e,this.length-e.length)!==-1};function dx(e){var t=typeof e=="string"?ux(e):e||{},s=t.protocol,n=t.host,r=t.port;if(typeof n!="string"||!n||typeof s!="string"||(s=s.split(":",1)[0],n=n.replace(/:\d*$/,""),r=parseInt(r)||lx[s]||0,!mx(n,r)))return"";var i=pn("npm_config_"+s+"_proxy")||pn(s+"_proxy")||pn("npm_config_proxy")||pn("all_proxy");return i&&i.indexOf("://")===-1&&(i=s+"://"+i),i}function mx(e,t){var s=(pn("npm_config_no_proxy")||pn("no_proxy")).toLowerCase();return s?s==="*"?!1:s.split(/[,\s]/).every(function(n){if(!n)return!0;var r=n.match(/^(.+):(\d+)$/),i=r?r[1]:n,o=r?parseInt(r[2]):0;return o&&o!==t?!0:/^[.*]/.test(i)?(i.charAt(0)==="*"&&(i=i.slice(1)),!px.call(e,i)):e!==i}):!0}function pn(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}Cd.getProxyForUrl=dx});var Fd=R((xL,Ad)=>{var dn=1e3,mn=dn*60,fn=mn*60,vs=fn*24,fx=vs*7,gx=vs*365.25;Ad.exports=function(e,t){t=t||{};var s=typeof e;if(s==="string"&&e.length>0)return hx(e);if(s==="number"&&isFinite(e))return t.long?Dx(e):yx(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function hx(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var s=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return s*gx;case"weeks":case"week":case"w":return s*fx;case"days":case"day":case"d":return s*vs;case"hours":case"hour":case"hrs":case"hr":case"h":return s*fn;case"minutes":case"minute":case"mins":case"min":case"m":return s*mn;case"seconds":case"second":case"secs":case"sec":case"s":return s*dn;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function yx(e){var t=Math.abs(e);return t>=vs?Math.round(e/vs)+"d":t>=fn?Math.round(e/fn)+"h":t>=mn?Math.round(e/mn)+"m":t>=dn?Math.round(e/dn)+"s":e+"ms"}function Dx(e){var t=Math.abs(e);return t>=vs?ci(e,t,vs,"day"):t>=fn?ci(e,t,fn,"hour"):t>=mn?ci(e,t,mn,"minute"):t>=dn?ci(e,t,dn,"second"):e+" ms"}function ci(e,t,s,n){var r=t>=s*1.5;return Math.round(e/s)+" "+n+(r?"s":"")}});var pa=R((AL,Ed)=>{function bx(e){s.debug=s,s.default=s,s.coerce=c,s.disable=o,s.enable=r,s.enabled=a,s.humanize=Fd(),s.destroy=u,Object.keys(e).forEach(l=>{s[l]=e[l]}),s.names=[],s.skips=[],s.formatters={};function t(l){let p=0;for(let d=0;d<l.length;d++)p=(p<<5)-p+l.charCodeAt(d),p|=0;return s.colors[Math.abs(p)%s.colors.length]}s.selectColor=t;function s(l){let p,d=null,f,m;function g(...h){if(!g.enabled)return;let b=g,y=Number(new Date),S=y-(p||y);b.diff=S,b.prev=p,b.curr=y,p=y,h[0]=s.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let D=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(T,k)=>{if(T==="%%")return"%";D++;let C=s.formatters[k];if(typeof C=="function"){let $=h[D];T=C.call(b,$),h.splice(D,1),D--}return T}),s.formatArgs.call(b,h),(b.log||s.log).apply(b,h)}return g.namespace=l,g.useColors=s.useColors(),g.color=s.selectColor(l),g.extend=n,g.destroy=s.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(f!==s.namespaces&&(f=s.namespaces,m=s.enabled(l)),m),set:h=>{d=h}}),typeof s.init=="function"&&s.init(g),g}function n(l,p){let d=s(this.namespace+(typeof p>"u"?":":p)+l);return d.log=this.log,d}function r(l){s.save(l),s.namespaces=l,s.names=[],s.skips=[];let p=(typeof l=="string"?l:"").trim().replace(" ",",").split(",").filter(Boolean);for(let d of p)d[0]==="-"?s.skips.push(d.slice(1)):s.names.push(d)}function i(l,p){let d=0,f=0,m=-1,g=0;for(;d<l.length;)if(f<p.length&&(p[f]===l[d]||p[f]==="*"))p[f]==="*"?(m=f,g=d,f++):(d++,f++);else if(m!==-1)f=m+1,g++,d=g;else return!1;for(;f<p.length&&p[f]==="*";)f++;return f===p.length}function o(){let l=[...s.names,...s.skips.map(p=>"-"+p)].join(",");return s.enable(""),l}function a(l){for(let p of s.skips)if(i(l,p))return!1;for(let p of s.names)if(i(l,p))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}Ed.exports=bx});var Rd=R((rt,ui)=>{rt.formatArgs=Sx;rt.save=Cx;rt.load=xx;rt.useColors=vx;rt.storage=Ax();rt.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();rt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function vx(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Sx(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+ui.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let s=0,n=0;e[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(s++,r==="%c"&&(n=s))}),e.splice(n,0,t)}rt.log=console.debug||console.log||(()=>{});function Cx(e){try{e?rt.storage.setItem("debug",e):rt.storage.removeItem("debug")}catch{}}function xx(){let e;try{e=rt.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Ax(){try{return localStorage}catch{}}ui.exports=pa()(rt);var{formatters:Fx}=ui.exports;Fx.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Id=R((FL,wd)=>{"use strict";wd.exports=(e,t=process.argv)=>{let s=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(s+e),r=t.indexOf("--");return n!==-1&&(r===-1||n<r)}});var _d=R((EL,kd)=>{"use strict";var Ex=require("os"),Td=require("tty"),pt=Id(),{env:Ne}=process,ns;pt("no-color")||pt("no-colors")||pt("color=false")||pt("color=never")?ns=0:(pt("color")||pt("colors")||pt("color=true")||pt("color=always"))&&(ns=1);"FORCE_COLOR"in Ne&&(Ne.FORCE_COLOR==="true"?ns=1:Ne.FORCE_COLOR==="false"?ns=0:ns=Ne.FORCE_COLOR.length===0?1:Math.min(parseInt(Ne.FORCE_COLOR,10),3));function da(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ma(e,t){if(ns===0)return 0;if(pt("color=16m")||pt("color=full")||pt("color=truecolor"))return 3;if(pt("color=256"))return 2;if(e&&!t&&ns===void 0)return 0;let s=ns||0;if(Ne.TERM==="dumb")return s;if(process.platform==="win32"){let n=Ex.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Ne)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in Ne)||Ne.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Ne)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ne.TEAMCITY_VERSION)?1:0;if(Ne.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ne){let n=parseInt((Ne.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ne.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ne.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ne.TERM)||"COLORTERM"in Ne?1:s}function Rx(e){let t=ma(e,e&&e.isTTY);return da(t)}kd.exports={supportsColor:Rx,stdout:da(ma(!0,Td.isatty(1))),stderr:da(ma(!0,Td.isatty(2)))}});var Pd=R((We,pi)=>{var wx=require("tty"),li=require("util");We.init=Ox;We.log=_x;We.formatArgs=Tx;We.save=Lx;We.load=Px;We.useColors=Ix;We.destroy=li.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");We.colors=[6,2,3,4,5,1];try{let e=_d();e&&(e.stderr||e).level>=2&&(We.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}We.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let s=t.substring(6).toLowerCase().replace(/_([a-z])/g,(r,i)=>i.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[s]=n,e},{});function Ix(){return"colors"in We.inspectOpts?!!We.inspectOpts.colors:wx.isatty(process.stderr.fd)}function Tx(e){let{namespace:t,useColors:s}=this;if(s){let n=this.color,r="\x1B[3"+(n<8?n:"8;5;"+n),i=` ${r};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
3
3
  `).join(`
4
4
  `+i),e.push(r+"m+"+pi.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=kx()+t+" "+e[0]}function kx(){return We.inspectOpts.hideDate?"":new Date().toISOString()+" "}function _x(...e){return process.stderr.write(li.formatWithOptions(We.inspectOpts,...e)+`
5
5
  `)}function Lx(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function Px(){return process.env.DEBUG}function Ox(e){e.inspectOpts={};let t=Object.keys(We.inspectOpts);for(let s=0;s<t.length;s++)e.inspectOpts[t[s]]=We.inspectOpts[t[s]]}pi.exports=pa()(We);var{formatters:Ld}=pi.exports;Ld.o=function(e){return this.inspectOpts.colors=this.useColors,li.inspect(e,this.inspectOpts).split(`
6
- `).map(t=>t.trim()).join(" ")};Ld.O=function(e){return this.inspectOpts.colors=this.useColors,li.inspect(e,this.inspectOpts)}});var Od=R((RL,fa)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?fa.exports=Rd():fa.exports=Pd()});var Md=R((wL,Bd)=>{var sr;Bd.exports=function(){if(!sr){try{sr=Od()("follow-redirects")}catch{}typeof sr!="function"&&(sr=function(){})}sr.apply(null,arguments)}});var Ud=R((IL,Ea)=>{var rr=require("url"),nr=rr.URL,Bx=require("http"),Mx=require("https"),ba=require("stream").Writable,va=require("assert"),Nd=Md();(function(){var t=typeof process<"u",s=typeof window<"u"&&typeof document<"u",n=Cs(Error.captureStackTrace);!t&&(s||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var Sa=!1;try{va(new nr(""))}catch(e){Sa=e.code==="ERR_INVALID_URL"}var Nx=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Ca=["abort","aborted","connect","error","socket","timeout"],xa=Object.create(null);Ca.forEach(function(e){xa[e]=function(t,s,n){this._redirectable.emit(e,t,s,n)}});var ha=ir("ERR_INVALID_URL","Invalid URL",TypeError),ya=ir("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Wx=ir("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",ya),jx=ir("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),$x=ir("ERR_STREAM_WRITE_AFTER_END","write after end"),Ux=ba.prototype.destroy||jd;function Qe(e,t){ba.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var s=this;this._onNativeResponse=function(n){try{s._processResponse(n)}catch(r){s.emit("error",r instanceof ya?r:new ya({cause:r}))}},this._performRequest()}Qe.prototype=Object.create(ba.prototype);Qe.prototype.abort=function(){Fa(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Qe.prototype.destroy=function(e){return Fa(this._currentRequest,e),Ux.call(this,e),this};Qe.prototype.write=function(e,t,s){if(this._ending)throw new $x;if(!Ss(e)&&!qx(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Cs(t)&&(s=t,t=null),e.length===0){s&&s();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,s)):(this.emit("error",new jx),this.abort())};Qe.prototype.end=function(e,t,s){if(Cs(e)?(s=e,e=t=null):Cs(t)&&(s=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,s);else{var n=this,r=this._currentRequest;this.write(e,t,function(){n._ended=!0,r.end(null,null,s)}),this._ending=!0}};Qe.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};Qe.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};Qe.prototype.setTimeout=function(e,t){var s=this;function n(o){o.setTimeout(e),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function r(o){s._timeout&&clearTimeout(s._timeout),s._timeout=setTimeout(function(){s.emit("timeout"),i()},e),n(o)}function i(){s._timeout&&(clearTimeout(s._timeout),s._timeout=null),s.removeListener("abort",i),s.removeListener("error",i),s.removeListener("response",i),s.removeListener("close",i),t&&s.removeListener("timeout",t),s.socket||s._currentRequest.removeListener("socket",r)}return t&&this.on("timeout",t),this.socket?r(this.socket):this._currentRequest.once("socket",r),this.on("socket",n),this.on("abort",i),this.on("error",i),this.on("response",i),this.on("close",i),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){Qe.prototype[e]=function(t,s){return this._currentRequest[e](t,s)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Qe.prototype,e,{get:function(){return this._currentRequest[e]}})});Qe.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};Qe.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var s=e.slice(0,-1);this._options.agent=this._options.agents[s]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);n._redirectable=this;for(var r of Ca)n.on(r,xa[r]);if(this._currentUrl=/^\//.test(this._options.path)?rr.format(this._options):this._options.path,this._isRedirect){var i=0,o=this,a=this._requestBodyBuffers;(function c(u){if(n===o._currentRequest)if(u)o.emit("error",u);else if(i<a.length){var l=a[i++];n.finished||n.write(l.data,l.encoding,c)}else o._ended&&n.end()})()}};Qe.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var s=e.headers.location;if(!s||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(Fa(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Wx;var n,r=this._options.beforeRedirect;r&&(n=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var i=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],ga(/^content-/i,this._options.headers));var o=ga(/^host$/i,this._options.headers),a=Aa(this._currentUrl),c=o||a.host,u=/^\w+:/.test(s)?this._currentUrl:rr.format(Object.assign(a,{host:c})),l=Gx(s,u);if(Nd("redirecting to",l.href),this._isRedirect=!0,Da(l,this._options),(l.protocol!==a.protocol&&l.protocol!=="https:"||l.host!==c&&!zx(l.host,c))&&ga(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Cs(r)){var p={headers:e.headers,statusCode:t},d={url:u,method:i,headers:n};r(this._options,p,d),this._sanitizeOptions(this._options)}this._performRequest()};function Wd(e){var t={maxRedirects:21,maxBodyLength:10485760},s={};return Object.keys(e).forEach(function(n){var r=n+":",i=s[r]=e[n],o=t[n]=Object.create(i);function a(u,l,p){return Hx(u)?u=Da(u):Ss(u)?u=Da(Aa(u)):(p=l,l=$d(u),u={protocol:r}),Cs(l)&&(p=l,l=null),l=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},u,l),l.nativeProtocols=s,!Ss(l.host)&&!Ss(l.hostname)&&(l.hostname="::1"),va.equal(l.protocol,r,"protocol mismatch"),Nd("options",l),new Qe(l,p)}function c(u,l,p){var d=o.request(u,l,p);return d.end(),d}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),t}function jd(){}function Aa(e){var t;if(Sa)t=new nr(e);else if(t=$d(rr.parse(e)),!Ss(t.protocol))throw new ha({input:e});return t}function Gx(e,t){return Sa?new nr(e,t):Aa(rr.resolve(t,e))}function $d(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new ha({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new ha({input:e.href||e});return e}function Da(e,t){var s=t||{};for(var n of Nx)s[n]=e[n];return s.hostname.startsWith("[")&&(s.hostname=s.hostname.slice(1,-1)),s.port!==""&&(s.port=Number(s.port)),s.path=s.search?s.pathname+s.search:s.pathname,s}function ga(e,t){var s;for(var n in t)e.test(n)&&(s=t[n],delete t[n]);return s===null||typeof s>"u"?void 0:String(s).trim()}function ir(e,t,s){function n(r){Cs(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,r||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return n.prototype=new(s||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),n}function Fa(e,t){for(var s of Ca)e.removeListener(s,xa[s]);e.on("error",jd),e.destroy(t)}function zx(e,t){va(Ss(e)&&Ss(t));var s=e.length-t.length-1;return s>0&&e[s]==="."&&e.endsWith(t)}function Ss(e){return typeof e=="string"||e instanceof String}function Cs(e){return typeof e=="function"}function qx(e){return typeof e=="object"&&"length"in e}function Hx(e){return nr&&e instanceof nr}Ea.exports=Wd({http:Bx,https:Mx});Ea.exports.wrap=Wd});var Va=R(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.createJsonFormatter=void 0;var Q0=e=>{switch(e){case 0:return"DEBUG";case 1:return"INFO";case 2:return"WARN";case 3:return"ERROR";case 4:return"FATAL";default:return"UNKNOWN"}},X0=()=>({format:e=>JSON.stringify({timestamp:e.timestamp,level:Q0(e.level),message:e.message,...e.context,...e.error&&{error:{name:e.error.name,message:e.error.message,stack:e.error.stack}},...e.metadata&&{metadata:e.metadata}})});Ci.createJsonFormatter=X0});var Ft=R(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.LogLevel=void 0;var yg;(function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.FATAL=4]="FATAL"})(yg||(xi.LogLevel=yg={}))});var qt=R(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.shouldLog=bn.BaseTransport=void 0;var eA=Ft(),Ka=class{constructor(){this.level=eA.LogLevel.INFO}setLevel(t){this.level=t}getLevel(){return this.level}shouldLog(t){return t>=this.level}};bn.BaseTransport=Ka;var tA=(e,t)=>e>=t;bn.shouldLog=tA});var Fi=R(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.createConsoleTransport=void 0;var vn=Ft(),sA=qt(),nA=(e={})=>{let t=e.level??vn.LogLevel.INFO,s=e.formatter||{format:n=>JSON.stringify(n)};return{log:n=>{if(!(0,sA.shouldLog)(n.level,t))return;let r=s.format(n);switch(n.level){case vn.LogLevel.DEBUG:console.debug(r);break;case vn.LogLevel.INFO:console.info(r);break;case vn.LogLevel.WARN:console.warn(r);break;case vn.LogLevel.ERROR:case vn.LogLevel.FATAL:console.error(r);break}},setLevel:n=>{t=n},getLevel:()=>t}};Ai.createConsoleTransport=nA});var Za=R(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.createBatchedLogger=Es.createBatchedTransport=void 0;var rA=(e,t={maxSize:100,maxWaitTime:5e3,maxBatchSize:1024*1024})=>{let s={logs:[],currentSize:0,lastFlush:Date.now()},n={totalLogs:0,totalBatches:0,averageBatchSize:0,lastFlushTime:0,pendingLogs:0},r=p=>p.reduce((d,f)=>d+JSON.stringify(f).length,0),i=async()=>{if(s.logs.length===0)return;let p=[...s.logs];s.logs=[],s.currentSize=0,s.lastFlush=Date.now(),s.flushTimer&&(clearTimeout(s.flushTimer),s.flushTimer=void 0);try{await Promise.allSettled(p.map(d=>e.log(d))),n.totalLogs+=p.length,n.totalBatches+=1,n.averageBatchSize=n.totalLogs/n.totalBatches,n.lastFlushTime=Date.now(),n.pendingLogs=s.logs.length}catch(d){console.error("Batch flush failed:",d),s.logs.unshift(...p),s.currentSize=r(s.logs)}},o=()=>{s.flushTimer||(s.flushTimer=setTimeout(()=>{i().catch(console.error)},t.maxWaitTime))};return{log:async p=>{let d=JSON.stringify(p).length;(s.logs.length>=t.maxSize||s.currentSize+d>=t.maxBatchSize)&&await i(),s.logs.push(p),s.currentSize+=d,n.pendingLogs=s.logs.length,s.logs.length===1&&o()},setLevel:p=>{e.setLevel(p)},getLevel:()=>e.getLevel(),flush:i,getStats:()=>({...n,pendingLogs:s.logs.length})}};Es.createBatchedTransport=rA;var iA=(e,t={maxSize:50,maxWaitTime:2e3,maxBatchSize:512*1024})=>{let s=e.map(c=>(0,Es.createBatchedTransport)(c,t));return{log:async c=>{await Promise.allSettled(s.map(u=>u.log(c)))},setLevel:c=>{for(let u of s)u.setLevel(c)},getLevel:()=>Math.min(...s.map(c=>c.getLevel())),flush:async()=>{await Promise.allSettled(s.map(c=>c.flush()))},getStats:()=>s.map(c=>c.getStats())}};Es.createBatchedLogger=iA});var Ya=R(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.createDefaultEnrichmentMiddleware=ye.createEnrichmentMiddleware=ye.createLoggerInstanceEnricher=ye.createUserEnricher=ye.createEnvironmentEnricher=ye.createSessionEnricher=ye.createCorrelationEnricher=ye.generateLoggerInstanceId=ye.generateSpanId=ye.generateTraceId=ye.generateCorrelationId=void 0;var oA=()=>`corr_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;ye.generateCorrelationId=oA;var aA=()=>Math.random().toString(16).substr(2,32);ye.generateTraceId=aA;var cA=()=>Math.random().toString(16).substr(2,16);ye.generateSpanId=cA;var uA=()=>{let e=Date.now(),t=Math.random().toString(36).substr(2,9),s=process.pid||0;return`logger_${e}_${t}_${s}`};ye.generateLoggerInstanceId=uA;var lA=()=>{let e,t,s;return{name:"correlation",enrich:n=>(n.correlationId||(e=e||(0,ye.generateCorrelationId)(),n.correlationId=e),n.traceId||(t=t||(0,ye.generateTraceId)(),n.traceId=t),n.spanId||(s=s||(0,ye.generateSpanId)(),n.spanId=s),n)}};ye.createCorrelationEnricher=lA;var pA=e=>{let t=e||`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;return{name:"session",enrich:s=>(s.sessionId||(s.sessionId=t),s)}};ye.createSessionEnricher=pA;var dA=(e,t)=>({name:"environment",enrich:s=>(e&&!s.serviceName&&(s.serviceName=e),t&&!s.stage&&(s.stage=t),s)});ye.createEnvironmentEnricher=dA;var mA=e=>({name:"user",enrich:t=>(e&&!t.userId&&(t.userId=e),t)});ye.createUserEnricher=mA;var fA=e=>({name:"loggerInstance",enrich:t=>(t.instanceId||(t.instanceId=e),t)});ye.createLoggerInstanceEnricher=fA;var gA=e=>t=>e.reduce((s,n)=>n.enrich(s),{...t});ye.createEnrichmentMiddleware=gA;var hA=(e,t,s,n)=>{let r=[(0,ye.createCorrelationEnricher)(),(0,ye.createSessionEnricher)(s),(0,ye.createEnvironmentEnricher)(e,t)];return n&&r.push((0,ye.createLoggerInstanceEnricher)(n)),(0,ye.createEnrichmentMiddleware)(r)};ye.createDefaultEnrichmentMiddleware=hA});var fr=R(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.getParsedType=Ae.ZodParsedType=Ae.objectUtil=Ae.util=void 0;var Ja;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function s(r){throw new Error}e.assertNever=s,e.arrayToEnum=r=>{let i={};for(let o of r)i[o]=o;return i},e.getValidEnumValues=r=>{let i=e.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),o={};for(let a of i)o[a]=r[a];return e.objectValues(o)},e.objectValues=r=>e.objectKeys(r).map(function(i){return r[i]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let i=[];for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&i.push(o);return i},e.find=(r,i)=>{for(let o of r)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,i=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(Ja||(Ae.util=Ja={}));var Dg;(function(e){e.mergeShapes=(t,s)=>({...t,...s})})(Dg||(Ae.objectUtil=Dg={}));Ae.ZodParsedType=Ja.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var yA=e=>{switch(typeof e){case"undefined":return Ae.ZodParsedType.undefined;case"string":return Ae.ZodParsedType.string;case"number":return Number.isNaN(e)?Ae.ZodParsedType.nan:Ae.ZodParsedType.number;case"boolean":return Ae.ZodParsedType.boolean;case"function":return Ae.ZodParsedType.function;case"bigint":return Ae.ZodParsedType.bigint;case"symbol":return Ae.ZodParsedType.symbol;case"object":return Array.isArray(e)?Ae.ZodParsedType.array:e===null?Ae.ZodParsedType.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ae.ZodParsedType.promise:typeof Map<"u"&&e instanceof Map?Ae.ZodParsedType.map:typeof Set<"u"&&e instanceof Set?Ae.ZodParsedType.set:typeof Date<"u"&&e instanceof Date?Ae.ZodParsedType.date:Ae.ZodParsedType.object;default:return Ae.ZodParsedType.unknown}};Ae.getParsedType=yA});var Ei=R(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.ZodError=rs.quotelessJson=rs.ZodIssueCode=void 0;var bg=fr();rs.ZodIssueCode=bg.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var DA=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");rs.quotelessJson=DA;var gr=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=t}format(t){let s=t||function(i){return i.message},n={_errors:[]},r=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)n._errors.push(s(o));else{let a=n,c=0;for(;c<o.path.length;){let u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(s(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,bg.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=s=>s.message){let s={},n=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];s[i]=s[i]||[],s[i].push(t(r))}else n.push(t(r));return{formErrors:n,fieldErrors:s}}get formErrors(){return this.flatten()}};rs.ZodError=gr;gr.create=e=>new gr(e)});var Xa=R(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});var qe=Ei(),Rs=fr(),bA=(e,t)=>{let s;switch(e.code){case qe.ZodIssueCode.invalid_type:e.received===Rs.ZodParsedType.undefined?s="Required":s=`Expected ${e.expected}, received ${e.received}`;break;case qe.ZodIssueCode.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,Rs.util.jsonStringifyReplacer)}`;break;case qe.ZodIssueCode.unrecognized_keys:s=`Unrecognized key(s) in object: ${Rs.util.joinValues(e.keys,", ")}`;break;case qe.ZodIssueCode.invalid_union:s="Invalid input";break;case qe.ZodIssueCode.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${Rs.util.joinValues(e.options)}`;break;case qe.ZodIssueCode.invalid_enum_value:s=`Invalid enum value. Expected ${Rs.util.joinValues(e.options)}, received '${e.received}'`;break;case qe.ZodIssueCode.invalid_arguments:s="Invalid function arguments";break;case qe.ZodIssueCode.invalid_return_type:s="Invalid function return type";break;case qe.ZodIssueCode.invalid_date:s="Invalid date";break;case qe.ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:Rs.util.assertNever(e.validation):e.validation!=="regex"?s=`Invalid ${e.validation}`:s="Invalid";break;case qe.ZodIssueCode.too_small:e.type==="array"?s=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?s=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?s=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?s=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?s=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:s="Invalid input";break;case qe.ZodIssueCode.too_big:e.type==="array"?s=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?s=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?s=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?s=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?s=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:s="Invalid input";break;case qe.ZodIssueCode.custom:s="Invalid input";break;case qe.ZodIssueCode.invalid_intersection_types:s="Intersection results could not be merged";break;case qe.ZodIssueCode.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case qe.ZodIssueCode.not_finite:s="Number must be finite";break;default:s=t.defaultError,Rs.util.assertNever(e)}return{message:s}};Qa.default=bA});var Ri=R(is=>{"use strict";var vA=is&&is.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(is,"__esModule",{value:!0});is.defaultErrorMap=void 0;is.setErrorMap=SA;is.getErrorMap=CA;var vg=vA(Xa());is.defaultErrorMap=vg.default;var Sg=vg.default;function SA(e){Sg=e}function CA(){return Sg}});var tc=R(Se=>{"use strict";var xA=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Se,"__esModule",{value:!0});Se.isAsync=Se.isValid=Se.isDirty=Se.isAborted=Se.OK=Se.DIRTY=Se.INVALID=Se.ParseStatus=Se.EMPTY_PATH=Se.makeIssue=void 0;Se.addIssueToContext=EA;var AA=Ri(),Cg=xA(Xa()),FA=e=>{let{data:t,path:s,errorMaps:n,issueData:r}=e,i=[...s,...r.path||[]],o={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(o,{data:t,defaultError:a}).message;return{...r,path:i,message:a}};Se.makeIssue=FA;Se.EMPTY_PATH=[];function EA(e,t){let s=(0,AA.getErrorMap)(),n=(0,Se.makeIssue)({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===Cg.default?void 0:Cg.default].filter(r=>!!r)});e.common.issues.push(n)}var ec=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,s){let n=[];for(let r of s){if(r.status==="aborted")return Se.INVALID;r.status==="dirty"&&t.dirty(),n.push(r.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,s){let n=[];for(let r of s){let i=await r.key,o=await r.value;n.push({key:i,value:o})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,s){let n={};for(let r of s){let{key:i,value:o}=r;if(i.status==="aborted"||o.status==="aborted")return Se.INVALID;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}};Se.ParseStatus=ec;Se.INVALID=Object.freeze({status:"aborted"});var RA=e=>({status:"dirty",value:e});Se.DIRTY=RA;var wA=e=>({status:"valid",value:e});Se.OK=wA;var IA=e=>e.status==="aborted";Se.isAborted=IA;var TA=e=>e.status==="dirty";Se.isDirty=TA;var kA=e=>e.status==="valid";Se.isValid=kA;var _A=e=>typeof Promise<"u"&&e instanceof Promise;Se.isAsync=_A});var Ag=R(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0})});var Eg=R(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.errorUtil=void 0;var Fg;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Fg||(wi.errorUtil=Fg={}))});var Ng=R(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.discriminatedUnion=C.date=C.boolean=C.bigint=C.array=C.any=C.coerce=C.ZodFirstPartyTypeKind=C.late=C.ZodSchema=C.Schema=C.ZodReadonly=C.ZodPipeline=C.ZodBranded=C.BRAND=C.ZodNaN=C.ZodCatch=C.ZodDefault=C.ZodNullable=C.ZodOptional=C.ZodTransformer=C.ZodEffects=C.ZodPromise=C.ZodNativeEnum=C.ZodEnum=C.ZodLiteral=C.ZodLazy=C.ZodFunction=C.ZodSet=C.ZodMap=C.ZodRecord=C.ZodTuple=C.ZodIntersection=C.ZodDiscriminatedUnion=C.ZodUnion=C.ZodObject=C.ZodArray=C.ZodVoid=C.ZodNever=C.ZodUnknown=C.ZodAny=C.ZodNull=C.ZodUndefined=C.ZodSymbol=C.ZodDate=C.ZodBoolean=C.ZodBigInt=C.ZodNumber=C.ZodString=C.ZodType=void 0;C.NEVER=C.void=C.unknown=C.union=C.undefined=C.tuple=C.transformer=C.symbol=C.string=C.strictObject=C.set=C.record=C.promise=C.preprocess=C.pipeline=C.ostring=C.optional=C.onumber=C.oboolean=C.object=C.number=C.nullable=C.null=C.never=C.nativeEnum=C.nan=C.map=C.literal=C.lazy=C.intersection=C.instanceof=C.function=C.enum=C.effect=void 0;C.datetimeRegex=kg;C.custom=Lg;var P=Ei(),Ii=Ri(),z=Eg(),x=tc(),M=fr(),mt=class{constructor(t,s,n,r){this._cachedPath=[],this.parent=t,this.data=s,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Rg=(e,t)=>{if((0,x.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let s=new P.ZodError(e.common.issues);return this._error=s,this._error}}};function ee(e){if(!e)return{};let{errorMap:t,invalid_type_error:s,required_error:n,description:r}=e;if(t&&(s||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(o,a)=>{let{message:c}=e;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:c??s??a.defaultError}},description:r}}var te=class{get description(){return this._def.description}_getType(t){return(0,M.getParsedType)(t.data)}_getOrReturnCtx(t,s){return s||{common:t.parent.common,data:t.data,parsedType:(0,M.getParsedType)(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new x.ParseStatus,ctx:{common:t.parent.common,data:t.data,parsedType:(0,M.getParsedType)(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let s=this._parse(t);if((0,x.isAsync)(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(t){let s=this._parse(t);return Promise.resolve(s)}parse(t,s){let n=this.safeParse(t,s);if(n.success)return n.data;throw n.error}safeParse(t,s){let n={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:(0,M.getParsedType)(t)},r=this._parseSync({data:t,path:n.path,parent:n});return Rg(n,r)}"~validate"(t){let s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:(0,M.getParsedType)(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:s});return(0,x.isValid)(n)?{value:n.value}:{issues:s.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(n=>(0,x.isValid)(n)?{value:n.value}:{issues:s.common.issues})}async parseAsync(t,s){let n=await this.safeParseAsync(t,s);if(n.success)return n.data;throw n.error}async safeParseAsync(t,s){let n={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:(0,M.getParsedType)(t)},r=this._parse({data:t,path:n.path,parent:n}),i=await((0,x.isAsync)(r)?r:Promise.resolve(r));return Rg(n,i)}refine(t,s){let n=r=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(r):s;return this._refinement((r,i)=>{let o=t(r),a=()=>i.addIssue({code:P.ZodIssueCode.custom,...n(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,s){return this._refinement((n,r)=>t(n)?!0:(r.addIssue(typeof s=="function"?s(n,r):s),!1))}_refinement(t){return new it({schema:this,typeName:Y.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return dt.create(this,this._def)}nullable(){return Mt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kt.create(this)}promise(){return cs.create(this,this._def)}or(t){return Ps.create([this,t],this._def)}and(t){return Os.create(this,t,this._def)}transform(t){return new it({...ee(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let s=typeof t=="function"?t:()=>t;return new js({...ee(this._def),innerType:this,defaultValue:s,typeName:Y.ZodDefault})}brand(){return new hr({typeName:Y.ZodBranded,type:this,...ee(this._def)})}catch(t){let s=typeof t=="function"?t:()=>t;return new $s({...ee(this._def),innerType:this,catchValue:s,typeName:Y.ZodCatch})}describe(t){let s=this.constructor;return new s({...this._def,description:t})}pipe(t){return yr.create(this,t)}readonly(){return Us.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};C.ZodType=te;C.Schema=te;C.ZodSchema=te;var LA=/^c[^\s-]{8,}$/i,PA=/^[0-9a-z]+$/,OA=/^[0-9A-HJKMNP-TV-Z]{26}$/i,BA=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,MA=/^[a-z0-9_-]{21}$/i,NA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,WA=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,jA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$A="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",sc,UA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,GA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,zA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,qA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,HA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,VA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ig="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",KA=new RegExp(`^${Ig}$`);function Tg(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let s=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${s}`}function ZA(e){return new RegExp(`^${Tg(e)}$`)}function kg(e){let t=`${Ig}T${Tg(e)}`,s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function YA(e,t){return!!((t==="v4"||!t)&&UA.test(e)||(t==="v6"||!t)&&zA.test(e))}function JA(e,t){if(!NA.test(e))return!1;try{let[s]=e.split(".");if(!s)return!1;let n=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function QA(e,t){return!!((t==="v4"||!t)&&GA.test(e)||(t==="v6"||!t)&&qA.test(e))}var os=class e extends te{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==M.ZodParsedType.string){let i=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(i,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.string,received:i.parsedType}),x.INVALID}let n=new x.ParseStatus,r;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{code:P.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{code:P.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=t.data.length>i.value,a=t.data.length<i.value;(o||a)&&(r=this._getOrReturnCtx(t,r),o?(0,x.addIssueToContext)(r,{code:P.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&(0,x.addIssueToContext)(r,{code:P.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")jA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"email",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")sc||(sc=new RegExp($A,"u")),sc.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"emoji",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")BA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"uuid",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")MA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"nanoid",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")LA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"cuid",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")PA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"cuid2",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")OA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"ulid",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"url",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"regex",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?kg(i).test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?KA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?ZA(i).test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?WA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"duration",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?YA(t.data,i.version)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"ip",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?JA(t.data,i.alg)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"jwt",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?QA(t.data,i.version)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"cidr",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?HA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"base64",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?VA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{validation:"base64url",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):M.util.assertNever(i);return{status:n.value,value:t.data}}_regex(t,s,n){return this.refinement(r=>t.test(r),{validation:s,code:P.ZodIssueCode.invalid_string,...z.errorUtil.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...z.errorUtil.errToObj(t)})}url(t){return this._addCheck({kind:"url",...z.errorUtil.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...z.errorUtil.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...z.errorUtil.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...z.errorUtil.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...z.errorUtil.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...z.errorUtil.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...z.errorUtil.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...z.errorUtil.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...z.errorUtil.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...z.errorUtil.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...z.errorUtil.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...z.errorUtil.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...z.errorUtil.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...z.errorUtil.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...z.errorUtil.errToObj(t)})}regex(t,s){return this._addCheck({kind:"regex",regex:t,...z.errorUtil.errToObj(s)})}includes(t,s){return this._addCheck({kind:"includes",value:t,position:s?.position,...z.errorUtil.errToObj(s?.message)})}startsWith(t,s){return this._addCheck({kind:"startsWith",value:t,...z.errorUtil.errToObj(s)})}endsWith(t,s){return this._addCheck({kind:"endsWith",value:t,...z.errorUtil.errToObj(s)})}min(t,s){return this._addCheck({kind:"min",value:t,...z.errorUtil.errToObj(s)})}max(t,s){return this._addCheck({kind:"max",value:t,...z.errorUtil.errToObj(s)})}length(t,s){return this._addCheck({kind:"length",value:t,...z.errorUtil.errToObj(s)})}nonempty(t){return this.min(1,z.errorUtil.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxLength(){let t=null;for(let s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}};C.ZodString=os;os.create=e=>new os({checks:[],typeName:Y.ZodString,coerce:e?.coerce??!1,...ee(e)});function XA(e,t){let s=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=s>n?s:n,i=Number.parseInt(e.toFixed(r).replace(".","")),o=Number.parseInt(t.toFixed(r).replace(".",""));return i%o/10**r}var ws=class e extends te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==M.ZodParsedType.number){let i=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(i,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.number,received:i.parsedType}),x.INVALID}let n,r=new x.ParseStatus;for(let i of this._def.checks)i.kind==="int"?M.util.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?XA(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.not_finite,message:i.message}),r.dirty()):M.util.assertNever(i);return{status:r.value,value:t.data}}gte(t,s){return this.setLimit("min",t,!0,z.errorUtil.toString(s))}gt(t,s){return this.setLimit("min",t,!1,z.errorUtil.toString(s))}lte(t,s){return this.setLimit("max",t,!0,z.errorUtil.toString(s))}lt(t,s){return this.setLimit("max",t,!1,z.errorUtil.toString(s))}setLimit(t,s,n,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:n,message:z.errorUtil.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:z.errorUtil.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:z.errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:z.errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:z.errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:z.errorUtil.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:z.errorUtil.toString(s)})}finite(t){return this._addCheck({kind:"finite",message:z.errorUtil.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:z.errorUtil.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:z.errorUtil.toString(t)})}get minValue(){let t=null;for(let s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(let s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&M.util.isInteger(t.value))}get isFinite(){let t=null,s=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(s===null||n.value>s)&&(s=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(s)&&Number.isFinite(t)}};C.ZodNumber=ws;ws.create=e=>new ws({checks:[],typeName:Y.ZodNumber,coerce:e?.coerce||!1,...ee(e)});var Is=class e extends te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==M.ZodParsedType.bigint)return this._getInvalidInput(t);let n,r=new x.ParseStatus;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):M.util.assertNever(i);return{status:r.value,value:t.data}}_getInvalidInput(t){let s=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.bigint,received:s.parsedType}),x.INVALID}gte(t,s){return this.setLimit("min",t,!0,z.errorUtil.toString(s))}gt(t,s){return this.setLimit("min",t,!1,z.errorUtil.toString(s))}lte(t,s){return this.setLimit("max",t,!0,z.errorUtil.toString(s))}lt(t,s){return this.setLimit("max",t,!1,z.errorUtil.toString(s))}setLimit(t,s,n,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:n,message:z.errorUtil.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:z.errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:z.errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:z.errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:z.errorUtil.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:z.errorUtil.toString(s)})}get minValue(){let t=null;for(let s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(let s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}};C.ZodBigInt=Is;Is.create=e=>new Is({checks:[],typeName:Y.ZodBigInt,coerce:e?.coerce??!1,...ee(e)});var Ts=class extends te{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==M.ZodParsedType.boolean){let n=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.boolean,received:n.parsedType}),x.INVALID}return(0,x.OK)(t.data)}};C.ZodBoolean=Ts;Ts.create=e=>new Ts({typeName:Y.ZodBoolean,coerce:e?.coerce||!1,...ee(e)});var ks=class e extends te{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==M.ZodParsedType.date){let i=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(i,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.date,received:i.parsedType}),x.INVALID}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(i,{code:P.ZodIssueCode.invalid_date}),x.INVALID}let n=new x.ParseStatus,r;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{code:P.ZodIssueCode.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(r=this._getOrReturnCtx(t,r),(0,x.addIssueToContext)(r,{code:P.ZodIssueCode.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):M.util.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,s){return this._addCheck({kind:"min",value:t.getTime(),message:z.errorUtil.toString(s)})}max(t,s){return this._addCheck({kind:"max",value:t.getTime(),message:z.errorUtil.toString(s)})}get minDate(){let t=null;for(let s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t!=null?new Date(t):null}};C.ZodDate=ks;ks.create=e=>new ks({checks:[],coerce:e?.coerce||!1,typeName:Y.ZodDate,...ee(e)});var Cn=class extends te{_parse(t){if(this._getType(t)!==M.ZodParsedType.symbol){let n=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.symbol,received:n.parsedType}),x.INVALID}return(0,x.OK)(t.data)}};C.ZodSymbol=Cn;Cn.create=e=>new Cn({typeName:Y.ZodSymbol,...ee(e)});var _s=class extends te{_parse(t){if(this._getType(t)!==M.ZodParsedType.undefined){let n=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.undefined,received:n.parsedType}),x.INVALID}return(0,x.OK)(t.data)}};C.ZodUndefined=_s;_s.create=e=>new _s({typeName:Y.ZodUndefined,...ee(e)});var Ls=class extends te{_parse(t){if(this._getType(t)!==M.ZodParsedType.null){let n=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.null,received:n.parsedType}),x.INVALID}return(0,x.OK)(t.data)}};C.ZodNull=Ls;Ls.create=e=>new Ls({typeName:Y.ZodNull,...ee(e)});var as=class extends te{constructor(){super(...arguments),this._any=!0}_parse(t){return(0,x.OK)(t.data)}};C.ZodAny=as;as.create=e=>new as({typeName:Y.ZodAny,...ee(e)});var Vt=class extends te{constructor(){super(...arguments),this._unknown=!0}_parse(t){return(0,x.OK)(t.data)}};C.ZodUnknown=Vt;Vt.create=e=>new Vt({typeName:Y.ZodUnknown,...ee(e)});var Et=class extends te{_parse(t){let s=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.never,received:s.parsedType}),x.INVALID}};C.ZodNever=Et;Et.create=e=>new Et({typeName:Y.ZodNever,...ee(e)});var xn=class extends te{_parse(t){if(this._getType(t)!==M.ZodParsedType.undefined){let n=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.void,received:n.parsedType}),x.INVALID}return(0,x.OK)(t.data)}};C.ZodVoid=xn;xn.create=e=>new xn({typeName:Y.ZodVoid,...ee(e)});var Kt=class e extends te{_parse(t){let{ctx:s,status:n}=this._processInputParams(t),r=this._def;if(s.parsedType!==M.ZodParsedType.array)return(0,x.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.array,received:s.parsedType}),x.INVALID;if(r.exactLength!==null){let o=s.data.length>r.exactLength.value,a=s.data.length<r.exactLength.value;(o||a)&&((0,x.addIssueToContext)(s,{code:o?P.ZodIssueCode.too_big:P.ZodIssueCode.too_small,minimum:a?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&s.data.length<r.minLength.value&&((0,x.addIssueToContext)(s,{code:P.ZodIssueCode.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&s.data.length>r.maxLength.value&&((0,x.addIssueToContext)(s,{code:P.ZodIssueCode.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),s.common.async)return Promise.all([...s.data].map((o,a)=>r.type._parseAsync(new mt(s,o,s.path,a)))).then(o=>x.ParseStatus.mergeArray(n,o));let i=[...s.data].map((o,a)=>r.type._parseSync(new mt(s,o,s.path,a)));return x.ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(t,s){return new e({...this._def,minLength:{value:t,message:z.errorUtil.toString(s)}})}max(t,s){return new e({...this._def,maxLength:{value:t,message:z.errorUtil.toString(s)}})}length(t,s){return new e({...this._def,exactLength:{value:t,message:z.errorUtil.toString(s)}})}nonempty(t){return this.min(1,t)}};C.ZodArray=Kt;Kt.create=(e,t)=>new Kt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...ee(t)});function Sn(e){if(e instanceof Xe){let t={};for(let s in e.shape){let n=e.shape[s];t[s]=dt.create(Sn(n))}return new Xe({...e._def,shape:()=>t})}else return e instanceof Kt?new Kt({...e._def,type:Sn(e.element)}):e instanceof dt?dt.create(Sn(e.unwrap())):e instanceof Mt?Mt.create(Sn(e.unwrap())):e instanceof Bt?Bt.create(e.items.map(t=>Sn(t))):e}var Xe=class e extends te{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),s=M.util.objectKeys(t);return this._cached={shape:t,keys:s},this._cached}_parse(t){if(this._getType(t)!==M.ZodParsedType.object){let u=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(u,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.object,received:u.parsedType}),x.INVALID}let{status:n,ctx:r}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Et&&this._def.unknownKeys==="strip"))for(let u in r.data)o.includes(u)||a.push(u);let c=[];for(let u of o){let l=i[u],p=r.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new mt(r,p,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof Et){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(u==="strict")a.length>0&&((0,x.addIssueToContext)(r,{code:P.ZodIssueCode.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let p=r.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new mt(r,p,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let p=await l.key,d=await l.value;u.push({key:p,value:d,alwaysSet:l.alwaysSet})}return u}).then(u=>x.ParseStatus.mergeObjectSync(n,u)):x.ParseStatus.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return z.errorUtil.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(s,n)=>{let r=this._def.errorMap?.(s,n).message??n.defaultError;return s.code==="unrecognized_keys"?{message:z.errorUtil.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Y.ZodObject})}setKey(t,s){return this.augment({[t]:s})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let s={};for(let n of M.util.objectKeys(t))t[n]&&this.shape[n]&&(s[n]=this.shape[n]);return new e({...this._def,shape:()=>s})}omit(t){let s={};for(let n of M.util.objectKeys(this.shape))t[n]||(s[n]=this.shape[n]);return new e({...this._def,shape:()=>s})}deepPartial(){return Sn(this)}partial(t){let s={};for(let n of M.util.objectKeys(this.shape)){let r=this.shape[n];t&&!t[n]?s[n]=r:s[n]=r.optional()}return new e({...this._def,shape:()=>s})}required(t){let s={};for(let n of M.util.objectKeys(this.shape))if(t&&!t[n])s[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof dt;)i=i._def.innerType;s[n]=i}return new e({...this._def,shape:()=>s})}keyof(){return _g(M.util.objectKeys(this.shape))}};C.ZodObject=Xe;Xe.create=(e,t)=>new Xe({shape:()=>e,unknownKeys:"strip",catchall:Et.create(),typeName:Y.ZodObject,...ee(t)});Xe.strictCreate=(e,t)=>new Xe({shape:()=>e,unknownKeys:"strict",catchall:Et.create(),typeName:Y.ZodObject,...ee(t)});Xe.lazycreate=(e,t)=>new Xe({shape:e,unknownKeys:"strip",catchall:Et.create(),typeName:Y.ZodObject,...ee(t)});var Ps=class extends te{_parse(t){let{ctx:s}=this._processInputParams(t),n=this._def.options;function r(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return s.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(a=>new P.ZodError(a.ctx.common.issues));return(0,x.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_union,unionErrors:o}),x.INVALID}if(s.common.async)return Promise.all(n.map(async i=>{let o={...s,common:{...s.common,issues:[]},parent:null};return{result:await i._parseAsync({data:s.data,path:s.path,parent:o}),ctx:o}})).then(r);{let i,o=[];for(let c of n){let u={...s,common:{...s.common,issues:[]},parent:null},l=c._parseSync({data:s.data,path:s.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!i&&(i={result:l,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return s.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(c=>new P.ZodError(c));return(0,x.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_union,unionErrors:a}),x.INVALID}}get options(){return this._def.options}};C.ZodUnion=Ps;Ps.create=(e,t)=>new Ps({options:e,typeName:Y.ZodUnion,...ee(t)});var Ht=e=>e instanceof Bs?Ht(e.schema):e instanceof it?Ht(e.innerType()):e instanceof Ms?[e.value]:e instanceof Ns?e.options:e instanceof Ws?M.util.objectValues(e.enum):e instanceof js?Ht(e._def.innerType):e instanceof _s?[void 0]:e instanceof Ls?[null]:e instanceof dt?[void 0,...Ht(e.unwrap())]:e instanceof Mt?[null,...Ht(e.unwrap())]:e instanceof hr||e instanceof Us?Ht(e.unwrap()):e instanceof $s?Ht(e._def.innerType):[],Ti=class e extends te{_parse(t){let{ctx:s}=this._processInputParams(t);if(s.parsedType!==M.ZodParsedType.object)return(0,x.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.object,received:s.parsedType}),x.INVALID;let n=this.discriminator,r=s.data[n],i=this.optionsMap.get(r);return i?s.common.async?i._parseAsync({data:s.data,path:s.path,parent:s}):i._parseSync({data:s.data,path:s.path,parent:s}):((0,x.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),x.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,s,n){let r=new Map;for(let i of s){let o=Ht(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of o){if(r.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,i)}}return new e({typeName:Y.ZodDiscriminatedUnion,discriminator:t,options:s,optionsMap:r,...ee(n)})}};C.ZodDiscriminatedUnion=Ti;function nc(e,t){let s=(0,M.getParsedType)(e),n=(0,M.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(s===M.ZodParsedType.object&&n===M.ZodParsedType.object){let r=M.util.objectKeys(t),i=M.util.objectKeys(e).filter(a=>r.indexOf(a)!==-1),o={...e,...t};for(let a of i){let c=nc(e[a],t[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(s===M.ZodParsedType.array&&n===M.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=t[i],c=nc(o,a);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return s===M.ZodParsedType.date&&n===M.ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Os=class extends te{_parse(t){let{status:s,ctx:n}=this._processInputParams(t),r=(i,o)=>{if((0,x.isAborted)(i)||(0,x.isAborted)(o))return x.INVALID;let a=nc(i.value,o.value);return a.valid?(((0,x.isDirty)(i)||(0,x.isDirty)(o))&&s.dirty(),{status:s.value,value:a.data}):((0,x.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_intersection_types}),x.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>r(i,o)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};C.ZodIntersection=Os;Os.create=(e,t,s)=>new Os({left:e,right:t,typeName:Y.ZodIntersection,...ee(s)});var Bt=class e extends te{_parse(t){let{status:s,ctx:n}=this._processInputParams(t);if(n.parsedType!==M.ZodParsedType.array)return(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.array,received:n.parsedType}),x.INVALID;if(n.data.length<this._def.items.length)return(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,x.addIssueToContext)(n,{code:P.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let i=[...n.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new mt(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>x.ParseStatus.mergeArray(s,o)):x.ParseStatus.mergeArray(s,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};C.ZodTuple=Bt;Bt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bt({items:e,typeName:Y.ZodTuple,rest:null,...ee(t)})};var ki=class e extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:s,ctx:n}=this._processInputParams(t);if(n.parsedType!==M.ZodParsedType.object)return(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.object,received:n.parsedType}),x.INVALID;let r=[],i=this._def.keyType,o=this._def.valueType;for(let a in n.data)r.push({key:i._parse(new mt(n,a,n.path,a)),value:o._parse(new mt(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?x.ParseStatus.mergeObjectAsync(s,r):x.ParseStatus.mergeObjectSync(s,r)}get element(){return this._def.valueType}static create(t,s,n){return s instanceof te?new e({keyType:t,valueType:s,typeName:Y.ZodRecord,...ee(n)}):new e({keyType:os.create(),valueType:t,typeName:Y.ZodRecord,...ee(s)})}};C.ZodRecord=ki;var An=class extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:s,ctx:n}=this._processInputParams(t);if(n.parsedType!==M.ZodParsedType.map)return(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.map,received:n.parsedType}),x.INVALID;let r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,c],u)=>({key:r._parse(new mt(n,a,n.path,[u,"key"])),value:i._parse(new mt(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return x.INVALID;(u.status==="dirty"||l.status==="dirty")&&s.dirty(),a.set(u.value,l.value)}return{status:s.value,value:a}})}else{let a=new Map;for(let c of o){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return x.INVALID;(u.status==="dirty"||l.status==="dirty")&&s.dirty(),a.set(u.value,l.value)}return{status:s.value,value:a}}}};C.ZodMap=An;An.create=(e,t,s)=>new An({valueType:t,keyType:e,typeName:Y.ZodMap,...ee(s)});var Fn=class e extends te{_parse(t){let{status:s,ctx:n}=this._processInputParams(t);if(n.parsedType!==M.ZodParsedType.set)return(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.set,received:n.parsedType}),x.INVALID;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&((0,x.addIssueToContext)(n,{code:P.ZodIssueCode.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),s.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&((0,x.addIssueToContext)(n,{code:P.ZodIssueCode.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),s.dirty());let i=this._def.valueType;function o(c){let u=new Set;for(let l of c){if(l.status==="aborted")return x.INVALID;l.status==="dirty"&&s.dirty(),u.add(l.value)}return{status:s.value,value:u}}let a=[...n.data.values()].map((c,u)=>i._parse(new mt(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(t,s){return new e({...this._def,minSize:{value:t,message:z.errorUtil.toString(s)}})}max(t,s){return new e({...this._def,maxSize:{value:t,message:z.errorUtil.toString(s)}})}size(t,s){return this.min(t,s).max(t,s)}nonempty(t){return this.min(1,t)}};C.ZodSet=Fn;Fn.create=(e,t)=>new Fn({valueType:e,minSize:null,maxSize:null,typeName:Y.ZodSet,...ee(t)});var _i=class e extends te{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:s}=this._processInputParams(t);if(s.parsedType!==M.ZodParsedType.function)return(0,x.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.function,received:s.parsedType}),x.INVALID;function n(a,c){return(0,x.makeIssue)({data:a,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,(0,Ii.getErrorMap)(),Ii.defaultErrorMap].filter(u=>!!u),issueData:{code:P.ZodIssueCode.invalid_arguments,argumentsError:c}})}function r(a,c){return(0,x.makeIssue)({data:a,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,(0,Ii.getErrorMap)(),Ii.defaultErrorMap].filter(u=>!!u),issueData:{code:P.ZodIssueCode.invalid_return_type,returnTypeError:c}})}let i={errorMap:s.common.contextualErrorMap},o=s.data;if(this._def.returns instanceof cs){let a=this;return(0,x.OK)(async function(...c){let u=new P.ZodError([]),l=await a._def.args.parseAsync(c,i).catch(f=>{throw u.addIssue(n(c,f)),u}),p=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(p,i).catch(f=>{throw u.addIssue(r(p,f)),u})})}else{let a=this;return(0,x.OK)(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new P.ZodError([n(c,u.error)]);let l=Reflect.apply(o,this,u.data),p=a._def.returns.safeParse(l,i);if(!p.success)throw new P.ZodError([r(l,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Bt.create(t).rest(Vt.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,s,n){return new e({args:t||Bt.create([]).rest(Vt.create()),returns:s||Vt.create(),typeName:Y.ZodFunction,...ee(n)})}};C.ZodFunction=_i;var Bs=class extends te{get schema(){return this._def.getter()}_parse(t){let{ctx:s}=this._processInputParams(t);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};C.ZodLazy=Bs;Bs.create=(e,t)=>new Bs({getter:e,typeName:Y.ZodLazy,...ee(t)});var Ms=class extends te{_parse(t){if(t.data!==this._def.value){let s=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(s,{received:s.data,code:P.ZodIssueCode.invalid_literal,expected:this._def.value}),x.INVALID}return{status:"valid",value:t.data}}get value(){return this._def.value}};C.ZodLiteral=Ms;Ms.create=(e,t)=>new Ms({value:e,typeName:Y.ZodLiteral,...ee(t)});function _g(e,t){return new Ns({values:e,typeName:Y.ZodEnum,...ee(t)})}var Ns=class e extends te{_parse(t){if(typeof t.data!="string"){let s=this._getOrReturnCtx(t),n=this._def.values;return(0,x.addIssueToContext)(s,{expected:M.util.joinValues(n),received:s.parsedType,code:P.ZodIssueCode.invalid_type}),x.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let s=this._getOrReturnCtx(t),n=this._def.values;return(0,x.addIssueToContext)(s,{received:s.data,code:P.ZodIssueCode.invalid_enum_value,options:n}),x.INVALID}return(0,x.OK)(t.data)}get options(){return this._def.values}get enum(){let t={};for(let s of this._def.values)t[s]=s;return t}get Values(){let t={};for(let s of this._def.values)t[s]=s;return t}get Enum(){let t={};for(let s of this._def.values)t[s]=s;return t}extract(t,s=this._def){return e.create(t,{...this._def,...s})}exclude(t,s=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...s})}};C.ZodEnum=Ns;Ns.create=_g;var Ws=class extends te{_parse(t){let s=M.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==M.ZodParsedType.string&&n.parsedType!==M.ZodParsedType.number){let r=M.util.objectValues(s);return(0,x.addIssueToContext)(n,{expected:M.util.joinValues(r),received:n.parsedType,code:P.ZodIssueCode.invalid_type}),x.INVALID}if(this._cache||(this._cache=new Set(M.util.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=M.util.objectValues(s);return(0,x.addIssueToContext)(n,{received:n.data,code:P.ZodIssueCode.invalid_enum_value,options:r}),x.INVALID}return(0,x.OK)(t.data)}get enum(){return this._def.values}};C.ZodNativeEnum=Ws;Ws.create=(e,t)=>new Ws({values:e,typeName:Y.ZodNativeEnum,...ee(t)});var cs=class extends te{unwrap(){return this._def.type}_parse(t){let{ctx:s}=this._processInputParams(t);if(s.parsedType!==M.ZodParsedType.promise&&s.common.async===!1)return(0,x.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.promise,received:s.parsedType}),x.INVALID;let n=s.parsedType===M.ZodParsedType.promise?s.data:Promise.resolve(s.data);return(0,x.OK)(n.then(r=>this._def.type.parseAsync(r,{path:s.path,errorMap:s.common.contextualErrorMap})))}};C.ZodPromise=cs;cs.create=(e,t)=>new cs({type:e,typeName:Y.ZodPromise,...ee(t)});var it=class extends te{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:s,ctx:n}=this._processInputParams(t),r=this._def.effect||null,i={addIssue:o=>{(0,x.addIssueToContext)(n,o),o.fatal?s.abort():s.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){let o=r.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(s.value==="aborted")return x.INVALID;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?x.INVALID:c.status==="dirty"||s.value==="dirty"?(0,x.DIRTY)(c.value):c});{if(s.value==="aborted")return x.INVALID;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?x.INVALID:a.status==="dirty"||s.value==="dirty"?(0,x.DIRTY)(a.value):a}}if(r.type==="refinement"){let o=a=>{let c=r.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?x.INVALID:(a.status==="dirty"&&s.dirty(),o(a.value),{status:s.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?x.INVALID:(a.status==="dirty"&&s.dirty(),o(a.value).then(()=>({status:s.value,value:a.value}))))}if(r.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,x.isValid)(o))return x.INVALID;let a=r.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>(0,x.isValid)(o)?Promise.resolve(r.transform(o.value,i)).then(a=>({status:s.value,value:a})):x.INVALID);M.util.assertNever(r)}};C.ZodEffects=it;C.ZodTransformer=it;it.create=(e,t,s)=>new it({schema:e,typeName:Y.ZodEffects,effect:t,...ee(s)});it.createWithPreprocess=(e,t,s)=>new it({schema:t,effect:{type:"preprocess",transform:e},typeName:Y.ZodEffects,...ee(s)});var dt=class extends te{_parse(t){return this._getType(t)===M.ZodParsedType.undefined?(0,x.OK)(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};C.ZodOptional=dt;dt.create=(e,t)=>new dt({innerType:e,typeName:Y.ZodOptional,...ee(t)});var Mt=class extends te{_parse(t){return this._getType(t)===M.ZodParsedType.null?(0,x.OK)(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};C.ZodNullable=Mt;Mt.create=(e,t)=>new Mt({innerType:e,typeName:Y.ZodNullable,...ee(t)});var js=class extends te{_parse(t){let{ctx:s}=this._processInputParams(t),n=s.data;return s.parsedType===M.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};C.ZodDefault=js;js.create=(e,t)=>new js({innerType:e,typeName:Y.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ee(t)});var $s=class extends te{_parse(t){let{ctx:s}=this._processInputParams(t),n={...s,common:{...s.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,x.isAsync)(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new P.ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new P.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};C.ZodCatch=$s;$s.create=(e,t)=>new $s({innerType:e,typeName:Y.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ee(t)});var En=class extends te{_parse(t){if(this._getType(t)!==M.ZodParsedType.nan){let n=this._getOrReturnCtx(t);return(0,x.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.nan,received:n.parsedType}),x.INVALID}return{status:"valid",value:t.data}}};C.ZodNaN=En;En.create=e=>new En({typeName:Y.ZodNaN,...ee(e)});C.BRAND=Symbol("zod_brand");var hr=class extends te{_parse(t){let{ctx:s}=this._processInputParams(t),n=s.data;return this._def.type._parse({data:n,path:s.path,parent:s})}unwrap(){return this._def.type}};C.ZodBranded=hr;var yr=class e extends te{_parse(t){let{status:s,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?x.INVALID:i.status==="dirty"?(s.dirty(),(0,x.DIRTY)(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?x.INVALID:r.status==="dirty"?(s.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(t,s){return new e({in:t,out:s,typeName:Y.ZodPipeline})}};C.ZodPipeline=yr;var Us=class extends te{_parse(t){let s=this._def.innerType._parse(t),n=r=>((0,x.isValid)(r)&&(r.value=Object.freeze(r.value)),r);return(0,x.isAsync)(s)?s.then(r=>n(r)):n(s)}unwrap(){return this._def.innerType}};C.ZodReadonly=Us;Us.create=(e,t)=>new Us({innerType:e,typeName:Y.ZodReadonly,...ee(t)});function wg(e,t){let s=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof s=="string"?{message:s}:s}function Lg(e,t={},s){return e?as.create().superRefine((n,r)=>{let i=e(n);if(i instanceof Promise)return i.then(o=>{if(!o){let a=wg(t,n),c=a.fatal??s??!0;r.addIssue({code:"custom",...a,fatal:c})}});if(!i){let o=wg(t,n),a=o.fatal??s??!0;r.addIssue({code:"custom",...o,fatal:a})}}):as.create()}C.late={object:Xe.lazycreate};var Y;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Y||(C.ZodFirstPartyTypeKind=Y={}));var eF=(e,t={message:`Input not instance of ${e.name}`})=>Lg(s=>s instanceof e,t);C.instanceof=eF;var Pg=os.create;C.string=Pg;var Og=ws.create;C.number=Og;var tF=En.create;C.nan=tF;var sF=Is.create;C.bigint=sF;var Bg=Ts.create;C.boolean=Bg;var nF=ks.create;C.date=nF;var rF=Cn.create;C.symbol=rF;var iF=_s.create;C.undefined=iF;var oF=Ls.create;C.null=oF;var aF=as.create;C.any=aF;var cF=Vt.create;C.unknown=cF;var uF=Et.create;C.never=uF;var lF=xn.create;C.void=lF;var pF=Kt.create;C.array=pF;var dF=Xe.create;C.object=dF;var mF=Xe.strictCreate;C.strictObject=mF;var fF=Ps.create;C.union=fF;var gF=Ti.create;C.discriminatedUnion=gF;var hF=Os.create;C.intersection=hF;var yF=Bt.create;C.tuple=yF;var DF=ki.create;C.record=DF;var bF=An.create;C.map=bF;var vF=Fn.create;C.set=vF;var SF=_i.create;C.function=SF;var CF=Bs.create;C.lazy=CF;var xF=Ms.create;C.literal=xF;var AF=Ns.create;C.enum=AF;var FF=Ws.create;C.nativeEnum=FF;var EF=cs.create;C.promise=EF;var Mg=it.create;C.effect=Mg;C.transformer=Mg;var RF=dt.create;C.optional=RF;var wF=Mt.create;C.nullable=wF;var IF=it.createWithPreprocess;C.preprocess=IF;var TF=yr.create;C.pipeline=TF;var kF=()=>Pg().optional();C.ostring=kF;var _F=()=>Og().optional();C.onumber=_F;var LF=()=>Bg().optional();C.oboolean=LF;C.coerce={string:e=>os.create({...e,coerce:!0}),number:e=>ws.create({...e,coerce:!0}),boolean:e=>Ts.create({...e,coerce:!0}),bigint:e=>Is.create({...e,coerce:!0}),date:e=>ks.create({...e,coerce:!0})};C.NEVER=x.INVALID});var rc=R(ft=>{"use strict";var PF=ft&&ft.__createBinding||(Object.create?function(e,t,s,n){n===void 0&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===void 0&&(n=s),e[n]=t[s]}),Rn=ft&&ft.__exportStar||function(e,t){for(var s in e)s!=="default"&&!Object.prototype.hasOwnProperty.call(t,s)&&PF(t,e,s)};Object.defineProperty(ft,"__esModule",{value:!0});Rn(Ri(),ft);Rn(tc(),ft);Rn(Ag(),ft);Rn(fr(),ft);Rn(Ng(),ft);Rn(Ei(),ft)});var $g=R(et=>{"use strict";var Wg=et&&et.__createBinding||(Object.create?function(e,t,s,n){n===void 0&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===void 0&&(n=s),e[n]=t[s]}),OF=et&&et.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),BF=et&&et.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s in e)s!=="default"&&Object.prototype.hasOwnProperty.call(e,s)&&Wg(t,e,s);return OF(t,e),t},MF=et&&et.__exportStar||function(e,t){for(var s in e)s!=="default"&&!Object.prototype.hasOwnProperty.call(t,s)&&Wg(t,e,s)};Object.defineProperty(et,"__esModule",{value:!0});et.z=void 0;var jg=BF(rc());et.z=jg;MF(rc(),et);et.default=jg});var ic=R(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.getEnvironment=void 0;var Zt=$g(),NF=Zt.z.object({LOG_LEVEL:Zt.z.enum(["DEBUG","INFO","WARN","ERROR","FATAL"]).optional(),STAGE:Zt.z.enum(["dev","prod","test"]).default("dev"),SERVICE_NAME:Zt.z.string().optional(),ENABLE_STRUCTURED_LOGGING:Zt.z.string().transform(e=>e==="true").optional(),CLOUDWATCH_LOG_GROUP:Zt.z.string().optional(),CLOUDWATCH_LOG_STREAM:Zt.z.string().optional(),AWS_REGION:Zt.z.string().optional()}),WF=(e=process.env)=>{let t;try{t=NF.parse(e)}catch(s){s instanceof Zt.z.ZodError&&console.warn("Environment validation failed, using defaults:",s.errors),t={STAGE:"dev"}}return{...t,isProduction:t.STAGE==="prod",isDevelopment:t.STAGE==="dev",logLevel:t.LOG_LEVEL??void 0,serviceName:t.SERVICE_NAME??void 0,enableStructuredLogging:t.ENABLE_STRUCTURED_LOGGING??!0,stage:t.STAGE}};Li.getEnvironment=WF});var oc=R(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.createLogFilter=Nt.createSampler=Nt.createRateLimiter=void 0;var jF=(e,t)=>{let s={tokens:t,lastRefill:Date.now(),maxTokens:t,refillRate:e},n=()=>{let i=Date.now(),a=(i-s.lastRefill)/1e3*s.refillRate;s.tokens=Math.min(s.maxTokens,s.tokens+a),s.lastRefill=i};return{tryConsume:(i=1)=>(n(),s.tokens>=i?(s.tokens-=i,!0):!1),getState:()=>({...s})}};Nt.createRateLimiter=jF;var $F=e=>{let t={totalLogs:0,sampledLogs:0};return{shouldSample:()=>(t.totalLogs++,e>=1?(t.sampledLogs++,!0):e<=0?!1:Math.random()<=e?(t.sampledLogs++,!0):!1),getStats:()=>({totalLogs:t.totalLogs,sampledLogs:t.sampledLogs,samplingRate:t.totalLogs>0?t.sampledLogs/t.totalLogs:0,configuredRate:e})}};Nt.createSampler=$F;var UF=e=>{let t=e.rateLimit?(0,Nt.createRateLimiter)(e.rateLimit.maxLogsPerSecond,e.rateLimit.burstSize):null,s=e.samplingRate!==void 0?(0,Nt.createSampler)(e.samplingRate):null;return{shouldLog:()=>!t&&!s?!0:!(t&&!t.tryConsume()||s&&!s.shouldSample()),getStats:()=>({rateLimit:t?.getState(),sampling:s?.getStats()})}};Nt.createLogFilter=UF});var ac=R(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.printLoggerConfig=gt.createStrogger=gt.strogger=gt.createLogger=void 0;var GF=Va(),zF=Fi(),Ce=Ft(),qF=Za(),Ug=Ya(),HF=ic(),VF=oc(),Gg=e=>{if(!e||typeof e!="object")return console.warn("[strogger] No environment provided, defaulting to DEBUG"),Ce.LogLevel.DEBUG;switch(e.LOG_LEVEL?.toUpperCase()){case"DEBUG":return Ce.LogLevel.DEBUG;case"INFO":return Ce.LogLevel.INFO;case"WARN":return Ce.LogLevel.WARN;case"ERROR":return Ce.LogLevel.ERROR;case"FATAL":return Ce.LogLevel.FATAL;case void 0:return e.STAGE==="prod"?Ce.LogLevel.INFO:Ce.LogLevel.DEBUG;default:return console.warn(`[strogger] Invalid LOG_LEVEL '${e.LOG_LEVEL}' provided. Defaulting to ${e.STAGE==="prod"?"INFO":"DEBUG"}.`),e.STAGE==="prod"?Ce.LogLevel.INFO:Ce.LogLevel.DEBUG}},KF=(e,t)=>e>=(t.level!==void 0?t.level:Ce.LogLevel.INFO),ZF=(e,t,s,n,r,i)=>({timestamp:new Date().toISOString(),level:t,message:s,context:{...e.stage&&{stage:e.stage},...e.serviceName&&{serviceName:e.serviceName},...n},error:r?{name:r.name,message:r.message,stack:r.stack}:void 0,metadata:i}),YF=({config:e={},transports:t=[],formatter:s,env:n})=>{let r=e.instanceId||(0,Ug.generateLoggerInstanceId)(),i={level:Gg(n),serviceName:n.SERVICE_NAME||void 0,stage:n.STAGE||"dev",enableStructuredLogging:n.ENABLE_STRUCTURED_LOGGING??!0,includeTimestamp:!0,includeLogLevel:!0,instanceId:r,...e};if(typeof i.level=="string")switch(i.level.toUpperCase()){case"DEBUG":i.level=Ce.LogLevel.DEBUG;break;case"INFO":i.level=Ce.LogLevel.INFO;break;case"WARN":i.level=Ce.LogLevel.WARN;break;case"ERROR":i.level=Ce.LogLevel.ERROR;break;case"FATAL":i.level=Ce.LogLevel.FATAL;break;default:i.level=Ce.LogLevel.INFO}e.level!==void 0&&(i.level=e.level);let o=(0,VF.createLogFilter)(i),a=(0,Ug.createDefaultEnrichmentMiddleware)(i.serviceName,i.stage,void 0,r),u=e.batching===!0?t.map(p=>(0,qF.createBatchedTransport)(p,{maxSize:50,maxWaitTime:2e3,maxBatchSize:512*1024})):t,l=async(p,d,f,m,g)=>{if(!KF(p,i)||(i.samplingRate!==void 0||i.rateLimit)&&!o.shouldLog())return;let h=a(f||{}),y=ZF(i,p,d,h,m,g),D=y;if(typeof i.redact=="function"&&(D=i.redact(y)),typeof i.validate=="function")try{i.validate(D)}catch(b){console.error("[LOGGER ERROR] Log entry validation failed:",b);return}if(Array.isArray(i.hooks))for(let b of i.hooks)try{let E=b(D);E&&typeof E.then=="function"&&await E}catch(E){console.error("[LOGGER ERROR] Log hook failed:",E)}let A=await Promise.allSettled(u.map(b=>b.log(D)));for(let b of A)b.status==="rejected"&&console.error(b.reason)};return{debug:(p,d,f)=>l(Ce.LogLevel.DEBUG,p,d,void 0,f),info:(p,d,f)=>l(Ce.LogLevel.INFO,p,d,void 0,f),warn:(p,d,f,m)=>l(Ce.LogLevel.WARN,p,d,f,m),error:(p,d,f,m)=>l(Ce.LogLevel.ERROR,p,d,f,m),fatal:(p,d,f,m)=>l(Ce.LogLevel.FATAL,p,d,f,m),logFunctionStart:(p,d,f)=>l(Ce.LogLevel.INFO,`Function ${p} started`,{...d,functionName:p},void 0,f),logFunctionEnd:(p,d,f,m)=>l(Ce.LogLevel.INFO,`Function ${p} completed in ${d}ms`,{...f,functionName:p,duration:d},void 0,m),logDatabaseOperation:(p,d,f,m)=>l(Ce.LogLevel.DEBUG,`Database operation: ${p} on table ${d}`,{...f,operation:p,table:d},void 0,m),logApiRequest:(p,d,f,m,g)=>l(Ce.LogLevel.INFO,`API ${p} ${d} - ${f}`,{...m,method:p,path:d,statusCode:f},void 0,g),setLevel:p=>{i.level=p;for(let d of t)d.setLevel?.(p)},getLevel:()=>i.level!==void 0?i.level:Ce.LogLevel.INFO,getInstanceId:()=>r,addTransport:p=>t.push(p),removeTransport:p=>{let d=t.indexOf(p);d>-1&&t.splice(d,1)},setFormatter:p=>{},getSamplingStats:()=>o.getStats(),flush:async()=>{await Promise.allSettled(u.map(p=>p.flush?.()||Promise.resolve()))},getBatchStats:()=>u.map(p=>p.getStats?.()||{})}};gt.createLogger=YF;var JF=(0,HF.getEnvironment)(),zg=(0,GF.createJsonFormatter)(),QF=(0,zF.createConsoleTransport)({formatter:zg});gt.strogger=(0,gt.createLogger)({config:{},transports:[QF],formatter:zg,env:JF});gt.createStrogger=gt.createLogger;var XF=e=>{let t=Gg(e);console.log("--- Strogger Logger Configuration ---"),console.log("LOG_LEVEL:",e.LOG_LEVEL??"(default)"),console.log("STAGE:",e.STAGE??"dev"),console.log("SERVICE_NAME:",e.SERVICE_NAME??"(none)"),console.log("ENABLE_STRUCTURED_LOGGING:",e.ENABLE_STRUCTURED_LOGGING??!0),console.log("Effective log level:",t),console.log("--------------------------------------")};gt.printLoggerConfig=XF});var ls=R(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.handleTransportError=ke.validateTransportConfig=ke.validateEnvironmentVariable=ke.createDetailedError=ke.ERROR_MESSAGES=ke.ValidationError=ke.ConfigurationError=ke.TransportError=ke.LoggerError=void 0;var us=class extends Error{constructor(t,s,n){super(t),this.code=s,this.details=n,this.name="LoggerError"}};ke.LoggerError=us;var Gs=class extends us{constructor(t,s,n){super(t,"TRANSPORT_ERROR",{transportName:s,...n}),this.transportName=s,this.name="TransportError"}};ke.TransportError=Gs;var Pi=class extends us{constructor(t,s){super(t,"CONFIGURATION_ERROR",s),this.name="ConfigurationError"}};ke.ConfigurationError=Pi;var cc=class extends us{constructor(t,s){super(t,"VALIDATION_ERROR",s),this.name="ValidationError"}};ke.ValidationError=cc;ke.ERROR_MESSAGES={NEW_RELIC_MISSING_API_KEY:{message:"New Relic transport requires NEW_RELIC_LICENSE_KEY environment variable",solution:"Set NEW_RELIC_LICENSE_KEY in your environment variables or pass apiKey option",example:"NEW_RELIC_LICENSE_KEY=your-license-key-here"},NEW_RELIC_MISSING_ACCOUNT_ID:{message:"New Relic transport requires NEW_RELIC_ACCOUNT_ID environment variable",solution:"Set NEW_RELIC_ACCOUNT_ID in your environment variables or pass accountId option",example:"NEW_RELIC_ACCOUNT_ID=your-account-id-here"},NEW_RELIC_API_ERROR:{message:"Failed to send logs to New Relic API",solution:"Check your API key, account ID, and network connectivity"},DATADOG_MISSING_API_KEY:{message:"DataDog transport requires DATADOG_API_KEY environment variable",solution:"Set DATADOG_API_KEY in your environment variables",example:"DATADOG_API_KEY=your-api-key-here"},DATADOG_API_ERROR:{message:"Failed to send logs to DataDog API",solution:"Check your API key and network connectivity"},CLOUDWATCH_MISSING_CREDENTIALS:{message:"CloudWatch transport requires AWS credentials",solution:"Configure AWS credentials via environment variables, IAM role, or AWS credentials file",example:`AWS_ACCESS_KEY_ID=your-key
7
- AWS_SECRET_ACCESS_KEY=your-secret`},CLOUDWATCH_MISSING_LOG_GROUP:{message:"CloudWatch transport requires logGroupName option",solution:"Provide logGroupName in transport options or set CLOUDWATCH_LOG_GROUP environment variable",example:'logGroupName: "/aws/lambda/my-function"'},CLOUDWATCH_LOG_GROUP_NOT_FOUND:{message:"CloudWatch log group does not exist",solution:"Create the log group in CloudWatch before using this transport",example:'aws logs create-log-group --log-group-name "/aws/lambda/my-function"'},CLOUDWATCH_API_ERROR:{message:"Failed to send logs to CloudWatch",solution:"Check your AWS credentials, region, and network connectivity"},TRANSPORT_INITIALIZATION_FAILED:{message:"Failed to initialize transport",solution:"Check transport configuration and required dependencies"},TRANSPORT_SEND_FAILED:{message:"Failed to send log entry to transport",solution:"Check transport configuration and network connectivity"},MISSING_SERVICE_NAME:{message:"Logger configuration requires serviceName",solution:"Set SERVICE_NAME environment variable or provide serviceName in config",example:"SERVICE_NAME=my-service"},INVALID_LOG_LEVEL:{message:"Invalid log level specified",solution:"Use one of: DEBUG, INFO, WARN, ERROR, FATAL",example:"LOG_LEVEL=INFO"},ENVIRONMENT_VALIDATION_FAILED:{message:"Environment configuration validation failed",solution:"Check your environment variables and configuration"},FORMATTER_MISSING:{message:"Logger requires a formatter",solution:"Provide a formatter object with a format(entry) method",example:"formatter: createJsonFormatter()"},PERFORMANCE_MONITOR_INITIALIZATION_FAILED:{message:"Failed to initialize performance monitor",solution:"Check performance monitor configuration"},SPLUNK_MISSING_HEC_URL:{message:"Splunk transport requires SPLUNK_HEC_URL environment variable",solution:"Set SPLUNK_HEC_URL in your environment variables",example:"SPLUNK_HEC_URL=https://your-splunk-instance:8088/services/collector"},SPLUNK_MISSING_HEC_TOKEN:{message:"Splunk transport requires SPLUNK_HEC_TOKEN environment variable",solution:"Set SPLUNK_HEC_TOKEN in your environment variables",example:"SPLUNK_HEC_TOKEN=your-hec-token-here"},SPLUNK_API_ERROR:{message:"Failed to send logs to Splunk HEC",solution:"Check your HEC URL, token, and network connectivity"},ELASTICSEARCH_MISSING_AUTH:{message:"Elasticsearch transport requires authentication",solution:"Set ELASTICSEARCH_API_KEY or ELASTICSEARCH_USERNAME/PASSWORD",example:"ELASTICSEARCH_API_KEY=your-api-key-here"},ELASTICSEARCH_MISSING_DATE:{message:"Date string is missing for Elasticsearch index pattern",solution:"Check date generation logic and ensure valid date string is produced"},ELASTICSEARCH_API_ERROR:{message:"Failed to send logs to Elasticsearch",solution:"Check your connection URL, authentication, and network connectivity"}};var eE=(e,t,s)=>{let n=ke.ERROR_MESSAGES[e],r=`${n.message}${t?` (${t})`:""}`,i={...n,...s,...t&&{transportName:t}};return t?new Gs(r,t,i):new us(r,"LOGGER_ERROR",i)};ke.createDetailedError=eE;var tE=(e,t,s=!1)=>{if(s&&!t)throw new Pi(`Required environment variable ${e} is not set`,{missingVariable:e,message:`Required environment variable ${e} is not set`})};ke.validateEnvironmentVariable=tE;var sE=(e,t,s)=>{let n=s.filter(r=>!t[r]);if(n.length>0)throw new Gs(`Missing required configuration fields: ${n.join(", ")}`,e,{missingFields:n,message:`Missing required configuration fields: ${n.join(", ")}`})};ke.validateTransportConfig=sE;var nE=(e,t,s=!0)=>{let n;if(e instanceof us?n=e:e instanceof Error?n=new Gs(`Unexpected error in ${t}: ${e.message}`,t,{originalError:e.message,stack:e.stack}):n=new Gs(`Unknown error in ${t}`,t,{originalError:e}),s&&(console.error(`[LOGGER ERROR] ${n.message}`),n.details?.solution&&console.error(`[LOGGER SOLUTION] ${n.details.solution}`),n.details?.example&&console.error(`[LOGGER EXAMPLE] ${n.details.example}`)),!s)throw n};ke.handleTransportError=nE});var uc=R(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.createDataDogTransport=void 0;var wn=Ft(),In=ls(),rE=qt(),iE=(e={})=>{let t="DataDog";try{let s=e.level??wn.LogLevel.INFO,n=e.apiKey||process.env.DATADOG_API_KEY,r=e.serviceName||process.env.DD_SERVICE||process.env.SERVICE_NAME,i=e.source||"nodejs",o=e.tags||[],a=e.batchSize||10,c=e.flushInterval||5e3,u=e.region||process.env.DD_SITE||"us";(0,In.validateEnvironmentVariable)("DATADOG_API_KEY",n,!0),(0,In.validateTransportConfig)(t,{apiKey:n},["apiKey"]);let p=[...[`env:${process.env.NODE_ENV||"dev"}`,`service:${r||"unknown"}`,`source:${i}`],...o].join(","),d=[],f=null,m=async D=>{try{let A=`https://http-intake.logs.${u==="eu"?"eu.":""}datadoghq.com/api/v2/logs`,b=D.map(T=>({message:T.message,level:g(T.level),timestamp:new Date(T.timestamp).getTime(),ddsource:i,ddtags:p,service:r,...T.context,...T.error&&{error_name:T.error.name,error_message:T.error.message,error_stack:T.error.stack},...T.metadata&&{metadata:T.metadata}})),E=await fetch(A,{method:"POST",headers:{"Content-Type":"application/json","DD-API-KEY":n},body:JSON.stringify(b)});if(!E.ok)throw(0,In.createDetailedError)("DATADOG_API_ERROR",t,{status:E.status,statusText:E.statusText,url:A,responseBody:await E.text().catch(()=>"Unable to read response body")})}catch(A){(0,In.handleTransportError)(A,t,!0)}},g=D=>{switch(D){case wn.LogLevel.DEBUG:return"debug";case wn.LogLevel.INFO:return"info";case wn.LogLevel.WARN:return"warning";case wn.LogLevel.ERROR:return"error";case wn.LogLevel.FATAL:return"critical";default:return"info"}},h=async()=>{if(d.length===0)return;let D=[...d];d=[],await m(D)};return(()=>{f||(f=setInterval(()=>{h().catch(D=>{(0,In.handleTransportError)(D,t,!0)})},c))})(),{log:async D=>{(0,rE.shouldLog)(D.level,s)&&(d.push(D),d.length>=a&&await h())},setLevel:D=>{s=D},getLevel:()=>s,flush:async()=>{await h()},close:async()=>{f&&(clearInterval(f),f=null),await h()},addTags:D=>{o.push(...D)},getConfig:()=>({serviceName:r,source:i,tags:[...o],region:u,batchSize:a,flushInterval:c})}}catch(s){throw(0,In.handleTransportError)(s,t,!1),s}};Oi.createDataDogTransport=iE});var lc=R(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.createSplunkTransport=void 0;var Tn=Ft(),zs=ls(),oE=qt(),aE=(e={})=>{let t="Splunk";try{let s=e.level??Tn.LogLevel.INFO,n=e.hecUrl||process.env.SPLUNK_HEC_URL,r=e.hecToken||process.env.SPLUNK_HEC_TOKEN,i=e.source||"nodejs-logger",o=e.sourcetype||"_json",a=e.index||process.env.SPLUNK_INDEX,c=e.batchSize||10,u=e.flushInterval||5e3,l=e.channel||process.env.SPLUNK_CHANNEL;(0,zs.validateEnvironmentVariable)("SPLUNK_HEC_URL",n,!0),(0,zs.validateEnvironmentVariable)("SPLUNK_HEC_TOKEN",r,!0),(0,zs.validateTransportConfig)(t,{hecUrl:n,hecToken:r},["hecUrl","hecToken"]);let p=[],d=null,f=async y=>{try{let D=y.map(b=>({event:{message:b.message,level:m(b.level),timestamp:new Date(b.timestamp).getTime(),...b.context,...b.error&&{error_name:b.error.name,error_message:b.error.message,error_stack:b.error.stack},...b.metadata&&{metadata:b.metadata}},sourcetype:o,source:i,...a&&{index:a},...l&&{channel:l}})),A=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Splunk ${r}`},body:JSON.stringify(D)});if(!A.ok)throw(0,zs.createDetailedError)("SPLUNK_API_ERROR",t,{status:A.status,statusText:A.statusText,url:n,responseBody:await A.text().catch(()=>"Unable to read response body")})}catch(D){(0,zs.handleTransportError)(D,t,!0)}},m=y=>{switch(y){case Tn.LogLevel.DEBUG:return"DEBUG";case Tn.LogLevel.INFO:return"INFO";case Tn.LogLevel.WARN:return"WARN";case Tn.LogLevel.ERROR:return"ERROR";case Tn.LogLevel.FATAL:return"FATAL";default:return"INFO"}},g=async()=>{if(p.length===0)return;let y=[...p];p=[],await f(y)};return(()=>{d||(d=setInterval(()=>{g().catch(y=>{(0,zs.handleTransportError)(y,t,!0)})},u))})(),{log:async y=>{(0,oE.shouldLog)(y.level,s)&&(p.push(y),p.length>=c&&await g())},setLevel:y=>{s=y},getLevel:()=>s,flush:async()=>{await g()},close:async()=>{d&&(clearInterval(d),d=null),await g()},getConfig:()=>({hecUrl:n,source:i,sourcetype:o,index:a,channel:l,batchSize:c,flushInterval:u})}}catch(s){throw(0,zs.handleTransportError)(s,t,!1),s}};Bi.createSplunkTransport=aE});var pc=R(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.createElasticsearchTransport=void 0;var kn=Ft(),_n=ls(),cE=qt(),uE=(e={})=>{let t="Elasticsearch";try{let s=e.level??kn.LogLevel.INFO,n=e.url||process.env.ELASTICSEARCH_URL||"http://localhost:9200",r=e.username||process.env.ELASTICSEARCH_USERNAME,i=e.password||process.env.ELASTICSEARCH_PASSWORD,o=e.apiKey||process.env.ELASTICSEARCH_API_KEY,a=e.index||process.env.ELASTICSEARCH_INDEX||"logs",c=e.indexPattern||process.env.ELASTICSEARCH_INDEX_PATTERN||"logs-{YYYY.MM.DD}",u=e.batchSize||10,l=e.flushInterval||5e3,p=e.timeout||3e4;if(!o&&(!r||!i))throw(0,_n.createDetailedError)("ELASTICSEARCH_MISSING_AUTH",t,{message:"Elasticsearch transport requires either API key or username/password"});let d=[],f=null,m=()=>{if(c?.includes("{YYYY.MM.DD}")){let E=new Date().toISOString().split("T")[0]?.replace(/-/g,".");if(!E)throw(0,_n.createDetailedError)("ELASTICSEARCH_MISSING_DATE",t,{message:"Date string is missing"});return c.replace("{YYYY.MM.DD}",E)}return typeof a=="string"&&a.length>0?a:"logs"},g=()=>o?{Authorization:`ApiKey ${o}`}:r&&i?{Authorization:`Basic ${Buffer.from(`${r}:${i}`).toString("base64")}`}:{},h=async b=>{try{let E=m(),T=`${n}/_bulk`,k=`${b.map(K=>{let J={message:K.message,level:y(K.level),timestamp:new Date(K.timestamp).toISOString(),service:process.env.SERVICE_NAME||"unknown",...K.context,...K.error&&{error_name:K.error.name,error_message:K.error.message,error_stack:K.error.stack},...K.metadata&&{metadata:K.metadata}};return`${JSON.stringify({index:{_index:E}})}
6
+ `).map(t=>t.trim()).join(" ")};Ld.O=function(e){return this.inspectOpts.colors=this.useColors,li.inspect(e,this.inspectOpts)}});var Od=R((RL,fa)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?fa.exports=Rd():fa.exports=Pd()});var Md=R((wL,Bd)=>{var sr;Bd.exports=function(){if(!sr){try{sr=Od()("follow-redirects")}catch{}typeof sr!="function"&&(sr=function(){})}sr.apply(null,arguments)}});var Ud=R((IL,Ea)=>{var rr=require("url"),nr=rr.URL,Bx=require("http"),Mx=require("https"),ba=require("stream").Writable,va=require("assert"),Nd=Md();(function(){var t=typeof process<"u",s=typeof window<"u"&&typeof document<"u",n=Cs(Error.captureStackTrace);!t&&(s||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var Sa=!1;try{va(new nr(""))}catch(e){Sa=e.code==="ERR_INVALID_URL"}var Nx=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Ca=["abort","aborted","connect","error","socket","timeout"],xa=Object.create(null);Ca.forEach(function(e){xa[e]=function(t,s,n){this._redirectable.emit(e,t,s,n)}});var ha=ir("ERR_INVALID_URL","Invalid URL",TypeError),ya=ir("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Wx=ir("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",ya),jx=ir("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),$x=ir("ERR_STREAM_WRITE_AFTER_END","write after end"),Ux=ba.prototype.destroy||jd;function Qe(e,t){ba.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var s=this;this._onNativeResponse=function(n){try{s._processResponse(n)}catch(r){s.emit("error",r instanceof ya?r:new ya({cause:r}))}},this._performRequest()}Qe.prototype=Object.create(ba.prototype);Qe.prototype.abort=function(){Fa(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Qe.prototype.destroy=function(e){return Fa(this._currentRequest,e),Ux.call(this,e),this};Qe.prototype.write=function(e,t,s){if(this._ending)throw new $x;if(!Ss(e)&&!qx(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Cs(t)&&(s=t,t=null),e.length===0){s&&s();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,s)):(this.emit("error",new jx),this.abort())};Qe.prototype.end=function(e,t,s){if(Cs(e)?(s=e,e=t=null):Cs(t)&&(s=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,s);else{var n=this,r=this._currentRequest;this.write(e,t,function(){n._ended=!0,r.end(null,null,s)}),this._ending=!0}};Qe.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};Qe.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};Qe.prototype.setTimeout=function(e,t){var s=this;function n(o){o.setTimeout(e),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function r(o){s._timeout&&clearTimeout(s._timeout),s._timeout=setTimeout(function(){s.emit("timeout"),i()},e),n(o)}function i(){s._timeout&&(clearTimeout(s._timeout),s._timeout=null),s.removeListener("abort",i),s.removeListener("error",i),s.removeListener("response",i),s.removeListener("close",i),t&&s.removeListener("timeout",t),s.socket||s._currentRequest.removeListener("socket",r)}return t&&this.on("timeout",t),this.socket?r(this.socket):this._currentRequest.once("socket",r),this.on("socket",n),this.on("abort",i),this.on("error",i),this.on("response",i),this.on("close",i),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){Qe.prototype[e]=function(t,s){return this._currentRequest[e](t,s)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Qe.prototype,e,{get:function(){return this._currentRequest[e]}})});Qe.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};Qe.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var s=e.slice(0,-1);this._options.agent=this._options.agents[s]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);n._redirectable=this;for(var r of Ca)n.on(r,xa[r]);if(this._currentUrl=/^\//.test(this._options.path)?rr.format(this._options):this._options.path,this._isRedirect){var i=0,o=this,a=this._requestBodyBuffers;(function c(u){if(n===o._currentRequest)if(u)o.emit("error",u);else if(i<a.length){var l=a[i++];n.finished||n.write(l.data,l.encoding,c)}else o._ended&&n.end()})()}};Qe.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var s=e.headers.location;if(!s||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(Fa(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Wx;var n,r=this._options.beforeRedirect;r&&(n=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var i=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],ga(/^content-/i,this._options.headers));var o=ga(/^host$/i,this._options.headers),a=Aa(this._currentUrl),c=o||a.host,u=/^\w+:/.test(s)?this._currentUrl:rr.format(Object.assign(a,{host:c})),l=Gx(s,u);if(Nd("redirecting to",l.href),this._isRedirect=!0,Da(l,this._options),(l.protocol!==a.protocol&&l.protocol!=="https:"||l.host!==c&&!zx(l.host,c))&&ga(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Cs(r)){var p={headers:e.headers,statusCode:t},d={url:u,method:i,headers:n};r(this._options,p,d),this._sanitizeOptions(this._options)}this._performRequest()};function Wd(e){var t={maxRedirects:21,maxBodyLength:10485760},s={};return Object.keys(e).forEach(function(n){var r=n+":",i=s[r]=e[n],o=t[n]=Object.create(i);function a(u,l,p){return Hx(u)?u=Da(u):Ss(u)?u=Da(Aa(u)):(p=l,l=$d(u),u={protocol:r}),Cs(l)&&(p=l,l=null),l=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},u,l),l.nativeProtocols=s,!Ss(l.host)&&!Ss(l.hostname)&&(l.hostname="::1"),va.equal(l.protocol,r,"protocol mismatch"),Nd("options",l),new Qe(l,p)}function c(u,l,p){var d=o.request(u,l,p);return d.end(),d}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),t}function jd(){}function Aa(e){var t;if(Sa)t=new nr(e);else if(t=$d(rr.parse(e)),!Ss(t.protocol))throw new ha({input:e});return t}function Gx(e,t){return Sa?new nr(e,t):Aa(rr.resolve(t,e))}function $d(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new ha({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new ha({input:e.href||e});return e}function Da(e,t){var s=t||{};for(var n of Nx)s[n]=e[n];return s.hostname.startsWith("[")&&(s.hostname=s.hostname.slice(1,-1)),s.port!==""&&(s.port=Number(s.port)),s.path=s.search?s.pathname+s.search:s.pathname,s}function ga(e,t){var s;for(var n in t)e.test(n)&&(s=t[n],delete t[n]);return s===null||typeof s>"u"?void 0:String(s).trim()}function ir(e,t,s){function n(r){Cs(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,r||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return n.prototype=new(s||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),n}function Fa(e,t){for(var s of Ca)e.removeListener(s,xa[s]);e.on("error",jd),e.destroy(t)}function zx(e,t){va(Ss(e)&&Ss(t));var s=e.length-t.length-1;return s>0&&e[s]==="."&&e.endsWith(t)}function Ss(e){return typeof e=="string"||e instanceof String}function Cs(e){return typeof e=="function"}function qx(e){return typeof e=="object"&&"length"in e}function Hx(e){return nr&&e instanceof nr}Ea.exports=Wd({http:Bx,https:Mx});Ea.exports.wrap=Wd});var Va=R(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.createJsonFormatter=void 0;var Q0=e=>{switch(e){case 0:return"DEBUG";case 1:return"INFO";case 2:return"WARN";case 3:return"ERROR";case 4:return"FATAL";default:return"UNKNOWN"}},X0=()=>({format:e=>JSON.stringify({timestamp:e.timestamp,level:Q0(e.level),message:e.message,...e.context,...e.error&&{error:{name:e.error.name,message:e.error.message,stack:e.error.stack}},...e.metadata&&{metadata:e.metadata}})});Ci.createJsonFormatter=X0});var Ft=R(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.LogLevel=void 0;var yg;(function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.FATAL=4]="FATAL"})(yg||(xi.LogLevel=yg={}))});var qt=R(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.shouldLog=bn.BaseTransport=void 0;var eA=Ft(),Ka=class{constructor(){this.level=eA.LogLevel.INFO}setLevel(t){this.level=t}getLevel(){return this.level}shouldLog(t){return t>=this.level}};bn.BaseTransport=Ka;var tA=(e,t)=>e>=t;bn.shouldLog=tA});var Fi=R(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.createConsoleTransport=void 0;var vn=Ft(),sA=qt(),nA=(e={})=>{let t=e.level??vn.LogLevel.INFO,s=e.formatter||{format:n=>JSON.stringify(n)};return{log:n=>{if(!(0,sA.shouldLog)(n.level,t))return;let r=s.format(n);switch(n.level){case vn.LogLevel.DEBUG:console.debug(r);break;case vn.LogLevel.INFO:console.info(r);break;case vn.LogLevel.WARN:console.warn(r);break;case vn.LogLevel.ERROR:case vn.LogLevel.FATAL:console.error(r);break}},setLevel:n=>{t=n},getLevel:()=>t}};Ai.createConsoleTransport=nA});var Za=R(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.createBatchedLogger=Es.createBatchedTransport=void 0;var rA=(e,t={maxSize:100,maxWaitTime:5e3,maxBatchSize:1024*1024})=>{let s={logs:[],currentSize:0,lastFlush:Date.now()},n={totalLogs:0,totalBatches:0,averageBatchSize:0,lastFlushTime:0,pendingLogs:0},r=p=>p.reduce((d,f)=>d+JSON.stringify(f).length,0),i=async()=>{if(s.logs.length===0)return;let p=[...s.logs];s.logs=[],s.currentSize=0,s.lastFlush=Date.now(),s.flushTimer&&(clearTimeout(s.flushTimer),s.flushTimer=void 0);try{await Promise.allSettled(p.map(d=>e.log(d))),n.totalLogs+=p.length,n.totalBatches+=1,n.averageBatchSize=n.totalLogs/n.totalBatches,n.lastFlushTime=Date.now(),n.pendingLogs=s.logs.length}catch(d){console.error("Batch flush failed:",d),s.logs.unshift(...p),s.currentSize=r(s.logs)}},o=()=>{s.flushTimer||(s.flushTimer=setTimeout(()=>{i().catch(console.error)},t.maxWaitTime))};return{log:async p=>{let d=JSON.stringify(p).length;(s.logs.length>=t.maxSize||s.currentSize+d>=t.maxBatchSize)&&await i(),s.logs.push(p),s.currentSize+=d,n.pendingLogs=s.logs.length,s.logs.length===1&&o()},setLevel:p=>{e.setLevel(p)},getLevel:()=>e.getLevel(),flush:i,getStats:()=>({...n,pendingLogs:s.logs.length})}};Es.createBatchedTransport=rA;var iA=(e,t={maxSize:50,maxWaitTime:2e3,maxBatchSize:512*1024})=>{let s=e.map(c=>(0,Es.createBatchedTransport)(c,t));return{log:async c=>{await Promise.allSettled(s.map(u=>u.log(c)))},setLevel:c=>{for(let u of s)u.setLevel(c)},getLevel:()=>Math.min(...s.map(c=>c.getLevel())),flush:async()=>{await Promise.allSettled(s.map(c=>c.flush()))},getStats:()=>s.map(c=>c.getStats())}};Es.createBatchedLogger=iA});var Ya=R(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.createDefaultEnrichmentMiddleware=ye.createEnrichmentMiddleware=ye.createLoggerInstanceEnricher=ye.createUserEnricher=ye.createEnvironmentEnricher=ye.createSessionEnricher=ye.createCorrelationEnricher=ye.generateLoggerInstanceId=ye.generateSpanId=ye.generateTraceId=ye.generateCorrelationId=void 0;var oA=()=>`corr_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;ye.generateCorrelationId=oA;var aA=()=>Math.random().toString(16).substr(2,32);ye.generateTraceId=aA;var cA=()=>Math.random().toString(16).substr(2,16);ye.generateSpanId=cA;var uA=()=>{let e=Date.now(),t=Math.random().toString(36).substr(2,9),s=process.pid||0;return`logger_${e}_${t}_${s}`};ye.generateLoggerInstanceId=uA;var lA=()=>{let e,t,s;return{name:"correlation",enrich:n=>(n.correlationId||(e=e||(0,ye.generateCorrelationId)(),n.correlationId=e),n.traceId||(t=t||(0,ye.generateTraceId)(),n.traceId=t),n.spanId||(s=s||(0,ye.generateSpanId)(),n.spanId=s),n)}};ye.createCorrelationEnricher=lA;var pA=e=>{let t=e||`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;return{name:"session",enrich:s=>(s.sessionId||(s.sessionId=t),s)}};ye.createSessionEnricher=pA;var dA=(e,t)=>({name:"environment",enrich:s=>(e&&!s.serviceName&&(s.serviceName=e),t&&!s.stage&&(s.stage=t),s)});ye.createEnvironmentEnricher=dA;var mA=e=>({name:"user",enrich:t=>(e&&!t.userId&&(t.userId=e),t)});ye.createUserEnricher=mA;var fA=e=>({name:"loggerInstance",enrich:t=>(t.instanceId||(t.instanceId=e),t)});ye.createLoggerInstanceEnricher=fA;var gA=e=>t=>e.reduce((s,n)=>n.enrich(s),{...t});ye.createEnrichmentMiddleware=gA;var hA=(e,t,s,n)=>{let r=[(0,ye.createCorrelationEnricher)(),(0,ye.createSessionEnricher)(s),(0,ye.createEnvironmentEnricher)(e,t)];return n&&r.push((0,ye.createLoggerInstanceEnricher)(n)),(0,ye.createEnrichmentMiddleware)(r)};ye.createDefaultEnrichmentMiddleware=hA});var fr=R(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.getParsedType=Ae.ZodParsedType=Ae.objectUtil=Ae.util=void 0;var Ja;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function s(r){throw new Error}e.assertNever=s,e.arrayToEnum=r=>{let i={};for(let o of r)i[o]=o;return i},e.getValidEnumValues=r=>{let i=e.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),o={};for(let a of i)o[a]=r[a];return e.objectValues(o)},e.objectValues=r=>e.objectKeys(r).map(function(i){return r[i]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let i=[];for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&i.push(o);return i},e.find=(r,i)=>{for(let o of r)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,i=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(Ja||(Ae.util=Ja={}));var Dg;(function(e){e.mergeShapes=(t,s)=>({...t,...s})})(Dg||(Ae.objectUtil=Dg={}));Ae.ZodParsedType=Ja.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var yA=e=>{switch(typeof e){case"undefined":return Ae.ZodParsedType.undefined;case"string":return Ae.ZodParsedType.string;case"number":return Number.isNaN(e)?Ae.ZodParsedType.nan:Ae.ZodParsedType.number;case"boolean":return Ae.ZodParsedType.boolean;case"function":return Ae.ZodParsedType.function;case"bigint":return Ae.ZodParsedType.bigint;case"symbol":return Ae.ZodParsedType.symbol;case"object":return Array.isArray(e)?Ae.ZodParsedType.array:e===null?Ae.ZodParsedType.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ae.ZodParsedType.promise:typeof Map<"u"&&e instanceof Map?Ae.ZodParsedType.map:typeof Set<"u"&&e instanceof Set?Ae.ZodParsedType.set:typeof Date<"u"&&e instanceof Date?Ae.ZodParsedType.date:Ae.ZodParsedType.object;default:return Ae.ZodParsedType.unknown}};Ae.getParsedType=yA});var Ei=R(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.ZodError=rs.quotelessJson=rs.ZodIssueCode=void 0;var bg=fr();rs.ZodIssueCode=bg.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var DA=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");rs.quotelessJson=DA;var gr=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=t}format(t){let s=t||function(i){return i.message},n={_errors:[]},r=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)n._errors.push(s(o));else{let a=n,c=0;for(;c<o.path.length;){let u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(s(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,bg.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=s=>s.message){let s={},n=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];s[i]=s[i]||[],s[i].push(t(r))}else n.push(t(r));return{formErrors:n,fieldErrors:s}}get formErrors(){return this.flatten()}};rs.ZodError=gr;gr.create=e=>new gr(e)});var Xa=R(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});var qe=Ei(),Rs=fr(),bA=(e,t)=>{let s;switch(e.code){case qe.ZodIssueCode.invalid_type:e.received===Rs.ZodParsedType.undefined?s="Required":s=`Expected ${e.expected}, received ${e.received}`;break;case qe.ZodIssueCode.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,Rs.util.jsonStringifyReplacer)}`;break;case qe.ZodIssueCode.unrecognized_keys:s=`Unrecognized key(s) in object: ${Rs.util.joinValues(e.keys,", ")}`;break;case qe.ZodIssueCode.invalid_union:s="Invalid input";break;case qe.ZodIssueCode.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${Rs.util.joinValues(e.options)}`;break;case qe.ZodIssueCode.invalid_enum_value:s=`Invalid enum value. Expected ${Rs.util.joinValues(e.options)}, received '${e.received}'`;break;case qe.ZodIssueCode.invalid_arguments:s="Invalid function arguments";break;case qe.ZodIssueCode.invalid_return_type:s="Invalid function return type";break;case qe.ZodIssueCode.invalid_date:s="Invalid date";break;case qe.ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:Rs.util.assertNever(e.validation):e.validation!=="regex"?s=`Invalid ${e.validation}`:s="Invalid";break;case qe.ZodIssueCode.too_small:e.type==="array"?s=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?s=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?s=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?s=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?s=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:s="Invalid input";break;case qe.ZodIssueCode.too_big:e.type==="array"?s=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?s=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?s=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?s=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?s=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:s="Invalid input";break;case qe.ZodIssueCode.custom:s="Invalid input";break;case qe.ZodIssueCode.invalid_intersection_types:s="Intersection results could not be merged";break;case qe.ZodIssueCode.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case qe.ZodIssueCode.not_finite:s="Number must be finite";break;default:s=t.defaultError,Rs.util.assertNever(e)}return{message:s}};Qa.default=bA});var Ri=R(is=>{"use strict";var vA=is&&is.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(is,"__esModule",{value:!0});is.defaultErrorMap=void 0;is.setErrorMap=SA;is.getErrorMap=CA;var vg=vA(Xa());is.defaultErrorMap=vg.default;var Sg=vg.default;function SA(e){Sg=e}function CA(){return Sg}});var tc=R(Se=>{"use strict";var xA=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Se,"__esModule",{value:!0});Se.isAsync=Se.isValid=Se.isDirty=Se.isAborted=Se.OK=Se.DIRTY=Se.INVALID=Se.ParseStatus=Se.EMPTY_PATH=Se.makeIssue=void 0;Se.addIssueToContext=EA;var AA=Ri(),Cg=xA(Xa()),FA=e=>{let{data:t,path:s,errorMaps:n,issueData:r}=e,i=[...s,...r.path||[]],o={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(o,{data:t,defaultError:a}).message;return{...r,path:i,message:a}};Se.makeIssue=FA;Se.EMPTY_PATH=[];function EA(e,t){let s=(0,AA.getErrorMap)(),n=(0,Se.makeIssue)({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===Cg.default?void 0:Cg.default].filter(r=>!!r)});e.common.issues.push(n)}var ec=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,s){let n=[];for(let r of s){if(r.status==="aborted")return Se.INVALID;r.status==="dirty"&&t.dirty(),n.push(r.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,s){let n=[];for(let r of s){let i=await r.key,o=await r.value;n.push({key:i,value:o})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,s){let n={};for(let r of s){let{key:i,value:o}=r;if(i.status==="aborted"||o.status==="aborted")return Se.INVALID;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}};Se.ParseStatus=ec;Se.INVALID=Object.freeze({status:"aborted"});var RA=e=>({status:"dirty",value:e});Se.DIRTY=RA;var wA=e=>({status:"valid",value:e});Se.OK=wA;var IA=e=>e.status==="aborted";Se.isAborted=IA;var TA=e=>e.status==="dirty";Se.isDirty=TA;var kA=e=>e.status==="valid";Se.isValid=kA;var _A=e=>typeof Promise<"u"&&e instanceof Promise;Se.isAsync=_A});var Ag=R(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0})});var Eg=R(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.errorUtil=void 0;var Fg;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Fg||(wi.errorUtil=Fg={}))});var Ng=R(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.discriminatedUnion=x.date=x.boolean=x.bigint=x.array=x.any=x.coerce=x.ZodFirstPartyTypeKind=x.late=x.ZodSchema=x.Schema=x.ZodReadonly=x.ZodPipeline=x.ZodBranded=x.BRAND=x.ZodNaN=x.ZodCatch=x.ZodDefault=x.ZodNullable=x.ZodOptional=x.ZodTransformer=x.ZodEffects=x.ZodPromise=x.ZodNativeEnum=x.ZodEnum=x.ZodLiteral=x.ZodLazy=x.ZodFunction=x.ZodSet=x.ZodMap=x.ZodRecord=x.ZodTuple=x.ZodIntersection=x.ZodDiscriminatedUnion=x.ZodUnion=x.ZodObject=x.ZodArray=x.ZodVoid=x.ZodNever=x.ZodUnknown=x.ZodAny=x.ZodNull=x.ZodUndefined=x.ZodSymbol=x.ZodDate=x.ZodBoolean=x.ZodBigInt=x.ZodNumber=x.ZodString=x.ZodType=void 0;x.NEVER=x.void=x.unknown=x.union=x.undefined=x.tuple=x.transformer=x.symbol=x.string=x.strictObject=x.set=x.record=x.promise=x.preprocess=x.pipeline=x.ostring=x.optional=x.onumber=x.oboolean=x.object=x.number=x.nullable=x.null=x.never=x.nativeEnum=x.nan=x.map=x.literal=x.lazy=x.intersection=x.instanceof=x.function=x.enum=x.effect=void 0;x.datetimeRegex=kg;x.custom=Lg;var P=Ei(),Ii=Ri(),z=Eg(),A=tc(),M=fr(),mt=class{constructor(t,s,n,r){this._cachedPath=[],this.parent=t,this.data=s,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Rg=(e,t)=>{if((0,A.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let s=new P.ZodError(e.common.issues);return this._error=s,this._error}}};function ee(e){if(!e)return{};let{errorMap:t,invalid_type_error:s,required_error:n,description:r}=e;if(t&&(s||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(o,a)=>{let{message:c}=e;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:c??s??a.defaultError}},description:r}}var te=class{get description(){return this._def.description}_getType(t){return(0,M.getParsedType)(t.data)}_getOrReturnCtx(t,s){return s||{common:t.parent.common,data:t.data,parsedType:(0,M.getParsedType)(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new A.ParseStatus,ctx:{common:t.parent.common,data:t.data,parsedType:(0,M.getParsedType)(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let s=this._parse(t);if((0,A.isAsync)(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(t){let s=this._parse(t);return Promise.resolve(s)}parse(t,s){let n=this.safeParse(t,s);if(n.success)return n.data;throw n.error}safeParse(t,s){let n={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:(0,M.getParsedType)(t)},r=this._parseSync({data:t,path:n.path,parent:n});return Rg(n,r)}"~validate"(t){let s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:(0,M.getParsedType)(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:s});return(0,A.isValid)(n)?{value:n.value}:{issues:s.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(n=>(0,A.isValid)(n)?{value:n.value}:{issues:s.common.issues})}async parseAsync(t,s){let n=await this.safeParseAsync(t,s);if(n.success)return n.data;throw n.error}async safeParseAsync(t,s){let n={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:(0,M.getParsedType)(t)},r=this._parse({data:t,path:n.path,parent:n}),i=await((0,A.isAsync)(r)?r:Promise.resolve(r));return Rg(n,i)}refine(t,s){let n=r=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(r):s;return this._refinement((r,i)=>{let o=t(r),a=()=>i.addIssue({code:P.ZodIssueCode.custom,...n(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,s){return this._refinement((n,r)=>t(n)?!0:(r.addIssue(typeof s=="function"?s(n,r):s),!1))}_refinement(t){return new it({schema:this,typeName:Y.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return dt.create(this,this._def)}nullable(){return Mt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kt.create(this)}promise(){return cs.create(this,this._def)}or(t){return Ps.create([this,t],this._def)}and(t){return Os.create(this,t,this._def)}transform(t){return new it({...ee(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let s=typeof t=="function"?t:()=>t;return new js({...ee(this._def),innerType:this,defaultValue:s,typeName:Y.ZodDefault})}brand(){return new hr({typeName:Y.ZodBranded,type:this,...ee(this._def)})}catch(t){let s=typeof t=="function"?t:()=>t;return new $s({...ee(this._def),innerType:this,catchValue:s,typeName:Y.ZodCatch})}describe(t){let s=this.constructor;return new s({...this._def,description:t})}pipe(t){return yr.create(this,t)}readonly(){return Us.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};x.ZodType=te;x.Schema=te;x.ZodSchema=te;var LA=/^c[^\s-]{8,}$/i,PA=/^[0-9a-z]+$/,OA=/^[0-9A-HJKMNP-TV-Z]{26}$/i,BA=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,MA=/^[a-z0-9_-]{21}$/i,NA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,WA=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,jA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$A="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",sc,UA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,GA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,zA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,qA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,HA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,VA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ig="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",KA=new RegExp(`^${Ig}$`);function Tg(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let s=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${s}`}function ZA(e){return new RegExp(`^${Tg(e)}$`)}function kg(e){let t=`${Ig}T${Tg(e)}`,s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function YA(e,t){return!!((t==="v4"||!t)&&UA.test(e)||(t==="v6"||!t)&&zA.test(e))}function JA(e,t){if(!NA.test(e))return!1;try{let[s]=e.split(".");if(!s)return!1;let n=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function QA(e,t){return!!((t==="v4"||!t)&&GA.test(e)||(t==="v6"||!t)&&qA.test(e))}var os=class e extends te{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==M.ZodParsedType.string){let i=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(i,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.string,received:i.parsedType}),A.INVALID}let n=new A.ParseStatus,r;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{code:P.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{code:P.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=t.data.length>i.value,a=t.data.length<i.value;(o||a)&&(r=this._getOrReturnCtx(t,r),o?(0,A.addIssueToContext)(r,{code:P.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&(0,A.addIssueToContext)(r,{code:P.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")jA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"email",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")sc||(sc=new RegExp($A,"u")),sc.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"emoji",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")BA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"uuid",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")MA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"nanoid",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")LA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"cuid",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")PA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"cuid2",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")OA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"ulid",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"url",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"regex",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?kg(i).test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?KA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?ZA(i).test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?WA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"duration",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?YA(t.data,i.version)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"ip",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?JA(t.data,i.alg)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"jwt",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?QA(t.data,i.version)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"cidr",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?HA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"base64",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?VA.test(t.data)||(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{validation:"base64url",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):M.util.assertNever(i);return{status:n.value,value:t.data}}_regex(t,s,n){return this.refinement(r=>t.test(r),{validation:s,code:P.ZodIssueCode.invalid_string,...z.errorUtil.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...z.errorUtil.errToObj(t)})}url(t){return this._addCheck({kind:"url",...z.errorUtil.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...z.errorUtil.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...z.errorUtil.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...z.errorUtil.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...z.errorUtil.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...z.errorUtil.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...z.errorUtil.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...z.errorUtil.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...z.errorUtil.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...z.errorUtil.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...z.errorUtil.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...z.errorUtil.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...z.errorUtil.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...z.errorUtil.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...z.errorUtil.errToObj(t)})}regex(t,s){return this._addCheck({kind:"regex",regex:t,...z.errorUtil.errToObj(s)})}includes(t,s){return this._addCheck({kind:"includes",value:t,position:s?.position,...z.errorUtil.errToObj(s?.message)})}startsWith(t,s){return this._addCheck({kind:"startsWith",value:t,...z.errorUtil.errToObj(s)})}endsWith(t,s){return this._addCheck({kind:"endsWith",value:t,...z.errorUtil.errToObj(s)})}min(t,s){return this._addCheck({kind:"min",value:t,...z.errorUtil.errToObj(s)})}max(t,s){return this._addCheck({kind:"max",value:t,...z.errorUtil.errToObj(s)})}length(t,s){return this._addCheck({kind:"length",value:t,...z.errorUtil.errToObj(s)})}nonempty(t){return this.min(1,z.errorUtil.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxLength(){let t=null;for(let s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}};x.ZodString=os;os.create=e=>new os({checks:[],typeName:Y.ZodString,coerce:e?.coerce??!1,...ee(e)});function XA(e,t){let s=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=s>n?s:n,i=Number.parseInt(e.toFixed(r).replace(".","")),o=Number.parseInt(t.toFixed(r).replace(".",""));return i%o/10**r}var ws=class e extends te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==M.ZodParsedType.number){let i=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(i,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.number,received:i.parsedType}),A.INVALID}let n,r=new A.ParseStatus;for(let i of this._def.checks)i.kind==="int"?M.util.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?XA(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.not_finite,message:i.message}),r.dirty()):M.util.assertNever(i);return{status:r.value,value:t.data}}gte(t,s){return this.setLimit("min",t,!0,z.errorUtil.toString(s))}gt(t,s){return this.setLimit("min",t,!1,z.errorUtil.toString(s))}lte(t,s){return this.setLimit("max",t,!0,z.errorUtil.toString(s))}lt(t,s){return this.setLimit("max",t,!1,z.errorUtil.toString(s))}setLimit(t,s,n,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:n,message:z.errorUtil.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:z.errorUtil.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:z.errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:z.errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:z.errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:z.errorUtil.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:z.errorUtil.toString(s)})}finite(t){return this._addCheck({kind:"finite",message:z.errorUtil.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:z.errorUtil.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:z.errorUtil.toString(t)})}get minValue(){let t=null;for(let s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(let s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&M.util.isInteger(t.value))}get isFinite(){let t=null,s=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(s===null||n.value>s)&&(s=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(s)&&Number.isFinite(t)}};x.ZodNumber=ws;ws.create=e=>new ws({checks:[],typeName:Y.ZodNumber,coerce:e?.coerce||!1,...ee(e)});var Is=class e extends te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==M.ZodParsedType.bigint)return this._getInvalidInput(t);let n,r=new A.ParseStatus;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):M.util.assertNever(i);return{status:r.value,value:t.data}}_getInvalidInput(t){let s=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.bigint,received:s.parsedType}),A.INVALID}gte(t,s){return this.setLimit("min",t,!0,z.errorUtil.toString(s))}gt(t,s){return this.setLimit("min",t,!1,z.errorUtil.toString(s))}lte(t,s){return this.setLimit("max",t,!0,z.errorUtil.toString(s))}lt(t,s){return this.setLimit("max",t,!1,z.errorUtil.toString(s))}setLimit(t,s,n,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:n,message:z.errorUtil.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:z.errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:z.errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:z.errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:z.errorUtil.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:z.errorUtil.toString(s)})}get minValue(){let t=null;for(let s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(let s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}};x.ZodBigInt=Is;Is.create=e=>new Is({checks:[],typeName:Y.ZodBigInt,coerce:e?.coerce??!1,...ee(e)});var Ts=class extends te{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==M.ZodParsedType.boolean){let n=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.boolean,received:n.parsedType}),A.INVALID}return(0,A.OK)(t.data)}};x.ZodBoolean=Ts;Ts.create=e=>new Ts({typeName:Y.ZodBoolean,coerce:e?.coerce||!1,...ee(e)});var ks=class e extends te{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==M.ZodParsedType.date){let i=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(i,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.date,received:i.parsedType}),A.INVALID}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(i,{code:P.ZodIssueCode.invalid_date}),A.INVALID}let n=new A.ParseStatus,r;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{code:P.ZodIssueCode.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(r=this._getOrReturnCtx(t,r),(0,A.addIssueToContext)(r,{code:P.ZodIssueCode.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):M.util.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,s){return this._addCheck({kind:"min",value:t.getTime(),message:z.errorUtil.toString(s)})}max(t,s){return this._addCheck({kind:"max",value:t.getTime(),message:z.errorUtil.toString(s)})}get minDate(){let t=null;for(let s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t!=null?new Date(t):null}};x.ZodDate=ks;ks.create=e=>new ks({checks:[],coerce:e?.coerce||!1,typeName:Y.ZodDate,...ee(e)});var Cn=class extends te{_parse(t){if(this._getType(t)!==M.ZodParsedType.symbol){let n=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.symbol,received:n.parsedType}),A.INVALID}return(0,A.OK)(t.data)}};x.ZodSymbol=Cn;Cn.create=e=>new Cn({typeName:Y.ZodSymbol,...ee(e)});var _s=class extends te{_parse(t){if(this._getType(t)!==M.ZodParsedType.undefined){let n=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.undefined,received:n.parsedType}),A.INVALID}return(0,A.OK)(t.data)}};x.ZodUndefined=_s;_s.create=e=>new _s({typeName:Y.ZodUndefined,...ee(e)});var Ls=class extends te{_parse(t){if(this._getType(t)!==M.ZodParsedType.null){let n=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.null,received:n.parsedType}),A.INVALID}return(0,A.OK)(t.data)}};x.ZodNull=Ls;Ls.create=e=>new Ls({typeName:Y.ZodNull,...ee(e)});var as=class extends te{constructor(){super(...arguments),this._any=!0}_parse(t){return(0,A.OK)(t.data)}};x.ZodAny=as;as.create=e=>new as({typeName:Y.ZodAny,...ee(e)});var Vt=class extends te{constructor(){super(...arguments),this._unknown=!0}_parse(t){return(0,A.OK)(t.data)}};x.ZodUnknown=Vt;Vt.create=e=>new Vt({typeName:Y.ZodUnknown,...ee(e)});var Et=class extends te{_parse(t){let s=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.never,received:s.parsedType}),A.INVALID}};x.ZodNever=Et;Et.create=e=>new Et({typeName:Y.ZodNever,...ee(e)});var xn=class extends te{_parse(t){if(this._getType(t)!==M.ZodParsedType.undefined){let n=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.void,received:n.parsedType}),A.INVALID}return(0,A.OK)(t.data)}};x.ZodVoid=xn;xn.create=e=>new xn({typeName:Y.ZodVoid,...ee(e)});var Kt=class e extends te{_parse(t){let{ctx:s,status:n}=this._processInputParams(t),r=this._def;if(s.parsedType!==M.ZodParsedType.array)return(0,A.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.array,received:s.parsedType}),A.INVALID;if(r.exactLength!==null){let o=s.data.length>r.exactLength.value,a=s.data.length<r.exactLength.value;(o||a)&&((0,A.addIssueToContext)(s,{code:o?P.ZodIssueCode.too_big:P.ZodIssueCode.too_small,minimum:a?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&s.data.length<r.minLength.value&&((0,A.addIssueToContext)(s,{code:P.ZodIssueCode.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&s.data.length>r.maxLength.value&&((0,A.addIssueToContext)(s,{code:P.ZodIssueCode.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),s.common.async)return Promise.all([...s.data].map((o,a)=>r.type._parseAsync(new mt(s,o,s.path,a)))).then(o=>A.ParseStatus.mergeArray(n,o));let i=[...s.data].map((o,a)=>r.type._parseSync(new mt(s,o,s.path,a)));return A.ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(t,s){return new e({...this._def,minLength:{value:t,message:z.errorUtil.toString(s)}})}max(t,s){return new e({...this._def,maxLength:{value:t,message:z.errorUtil.toString(s)}})}length(t,s){return new e({...this._def,exactLength:{value:t,message:z.errorUtil.toString(s)}})}nonempty(t){return this.min(1,t)}};x.ZodArray=Kt;Kt.create=(e,t)=>new Kt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...ee(t)});function Sn(e){if(e instanceof Xe){let t={};for(let s in e.shape){let n=e.shape[s];t[s]=dt.create(Sn(n))}return new Xe({...e._def,shape:()=>t})}else return e instanceof Kt?new Kt({...e._def,type:Sn(e.element)}):e instanceof dt?dt.create(Sn(e.unwrap())):e instanceof Mt?Mt.create(Sn(e.unwrap())):e instanceof Bt?Bt.create(e.items.map(t=>Sn(t))):e}var Xe=class e extends te{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),s=M.util.objectKeys(t);return this._cached={shape:t,keys:s},this._cached}_parse(t){if(this._getType(t)!==M.ZodParsedType.object){let u=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(u,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.object,received:u.parsedType}),A.INVALID}let{status:n,ctx:r}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Et&&this._def.unknownKeys==="strip"))for(let u in r.data)o.includes(u)||a.push(u);let c=[];for(let u of o){let l=i[u],p=r.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new mt(r,p,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof Et){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(u==="strict")a.length>0&&((0,A.addIssueToContext)(r,{code:P.ZodIssueCode.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let p=r.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new mt(r,p,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let p=await l.key,d=await l.value;u.push({key:p,value:d,alwaysSet:l.alwaysSet})}return u}).then(u=>A.ParseStatus.mergeObjectSync(n,u)):A.ParseStatus.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return z.errorUtil.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(s,n)=>{let r=this._def.errorMap?.(s,n).message??n.defaultError;return s.code==="unrecognized_keys"?{message:z.errorUtil.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Y.ZodObject})}setKey(t,s){return this.augment({[t]:s})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let s={};for(let n of M.util.objectKeys(t))t[n]&&this.shape[n]&&(s[n]=this.shape[n]);return new e({...this._def,shape:()=>s})}omit(t){let s={};for(let n of M.util.objectKeys(this.shape))t[n]||(s[n]=this.shape[n]);return new e({...this._def,shape:()=>s})}deepPartial(){return Sn(this)}partial(t){let s={};for(let n of M.util.objectKeys(this.shape)){let r=this.shape[n];t&&!t[n]?s[n]=r:s[n]=r.optional()}return new e({...this._def,shape:()=>s})}required(t){let s={};for(let n of M.util.objectKeys(this.shape))if(t&&!t[n])s[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof dt;)i=i._def.innerType;s[n]=i}return new e({...this._def,shape:()=>s})}keyof(){return _g(M.util.objectKeys(this.shape))}};x.ZodObject=Xe;Xe.create=(e,t)=>new Xe({shape:()=>e,unknownKeys:"strip",catchall:Et.create(),typeName:Y.ZodObject,...ee(t)});Xe.strictCreate=(e,t)=>new Xe({shape:()=>e,unknownKeys:"strict",catchall:Et.create(),typeName:Y.ZodObject,...ee(t)});Xe.lazycreate=(e,t)=>new Xe({shape:e,unknownKeys:"strip",catchall:Et.create(),typeName:Y.ZodObject,...ee(t)});var Ps=class extends te{_parse(t){let{ctx:s}=this._processInputParams(t),n=this._def.options;function r(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return s.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(a=>new P.ZodError(a.ctx.common.issues));return(0,A.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_union,unionErrors:o}),A.INVALID}if(s.common.async)return Promise.all(n.map(async i=>{let o={...s,common:{...s.common,issues:[]},parent:null};return{result:await i._parseAsync({data:s.data,path:s.path,parent:o}),ctx:o}})).then(r);{let i,o=[];for(let c of n){let u={...s,common:{...s.common,issues:[]},parent:null},l=c._parseSync({data:s.data,path:s.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!i&&(i={result:l,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return s.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(c=>new P.ZodError(c));return(0,A.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_union,unionErrors:a}),A.INVALID}}get options(){return this._def.options}};x.ZodUnion=Ps;Ps.create=(e,t)=>new Ps({options:e,typeName:Y.ZodUnion,...ee(t)});var Ht=e=>e instanceof Bs?Ht(e.schema):e instanceof it?Ht(e.innerType()):e instanceof Ms?[e.value]:e instanceof Ns?e.options:e instanceof Ws?M.util.objectValues(e.enum):e instanceof js?Ht(e._def.innerType):e instanceof _s?[void 0]:e instanceof Ls?[null]:e instanceof dt?[void 0,...Ht(e.unwrap())]:e instanceof Mt?[null,...Ht(e.unwrap())]:e instanceof hr||e instanceof Us?Ht(e.unwrap()):e instanceof $s?Ht(e._def.innerType):[],Ti=class e extends te{_parse(t){let{ctx:s}=this._processInputParams(t);if(s.parsedType!==M.ZodParsedType.object)return(0,A.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.object,received:s.parsedType}),A.INVALID;let n=this.discriminator,r=s.data[n],i=this.optionsMap.get(r);return i?s.common.async?i._parseAsync({data:s.data,path:s.path,parent:s}):i._parseSync({data:s.data,path:s.path,parent:s}):((0,A.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),A.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,s,n){let r=new Map;for(let i of s){let o=Ht(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of o){if(r.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,i)}}return new e({typeName:Y.ZodDiscriminatedUnion,discriminator:t,options:s,optionsMap:r,...ee(n)})}};x.ZodDiscriminatedUnion=Ti;function nc(e,t){let s=(0,M.getParsedType)(e),n=(0,M.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(s===M.ZodParsedType.object&&n===M.ZodParsedType.object){let r=M.util.objectKeys(t),i=M.util.objectKeys(e).filter(a=>r.indexOf(a)!==-1),o={...e,...t};for(let a of i){let c=nc(e[a],t[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(s===M.ZodParsedType.array&&n===M.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=t[i],c=nc(o,a);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return s===M.ZodParsedType.date&&n===M.ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Os=class extends te{_parse(t){let{status:s,ctx:n}=this._processInputParams(t),r=(i,o)=>{if((0,A.isAborted)(i)||(0,A.isAborted)(o))return A.INVALID;let a=nc(i.value,o.value);return a.valid?(((0,A.isDirty)(i)||(0,A.isDirty)(o))&&s.dirty(),{status:s.value,value:a.data}):((0,A.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_intersection_types}),A.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>r(i,o)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};x.ZodIntersection=Os;Os.create=(e,t,s)=>new Os({left:e,right:t,typeName:Y.ZodIntersection,...ee(s)});var Bt=class e extends te{_parse(t){let{status:s,ctx:n}=this._processInputParams(t);if(n.parsedType!==M.ZodParsedType.array)return(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.array,received:n.parsedType}),A.INVALID;if(n.data.length<this._def.items.length)return(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,A.addIssueToContext)(n,{code:P.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let i=[...n.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new mt(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>A.ParseStatus.mergeArray(s,o)):A.ParseStatus.mergeArray(s,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};x.ZodTuple=Bt;Bt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bt({items:e,typeName:Y.ZodTuple,rest:null,...ee(t)})};var ki=class e extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:s,ctx:n}=this._processInputParams(t);if(n.parsedType!==M.ZodParsedType.object)return(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.object,received:n.parsedType}),A.INVALID;let r=[],i=this._def.keyType,o=this._def.valueType;for(let a in n.data)r.push({key:i._parse(new mt(n,a,n.path,a)),value:o._parse(new mt(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?A.ParseStatus.mergeObjectAsync(s,r):A.ParseStatus.mergeObjectSync(s,r)}get element(){return this._def.valueType}static create(t,s,n){return s instanceof te?new e({keyType:t,valueType:s,typeName:Y.ZodRecord,...ee(n)}):new e({keyType:os.create(),valueType:t,typeName:Y.ZodRecord,...ee(s)})}};x.ZodRecord=ki;var An=class extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:s,ctx:n}=this._processInputParams(t);if(n.parsedType!==M.ZodParsedType.map)return(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.map,received:n.parsedType}),A.INVALID;let r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,c],u)=>({key:r._parse(new mt(n,a,n.path,[u,"key"])),value:i._parse(new mt(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return A.INVALID;(u.status==="dirty"||l.status==="dirty")&&s.dirty(),a.set(u.value,l.value)}return{status:s.value,value:a}})}else{let a=new Map;for(let c of o){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return A.INVALID;(u.status==="dirty"||l.status==="dirty")&&s.dirty(),a.set(u.value,l.value)}return{status:s.value,value:a}}}};x.ZodMap=An;An.create=(e,t,s)=>new An({valueType:t,keyType:e,typeName:Y.ZodMap,...ee(s)});var Fn=class e extends te{_parse(t){let{status:s,ctx:n}=this._processInputParams(t);if(n.parsedType!==M.ZodParsedType.set)return(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.set,received:n.parsedType}),A.INVALID;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&((0,A.addIssueToContext)(n,{code:P.ZodIssueCode.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),s.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&((0,A.addIssueToContext)(n,{code:P.ZodIssueCode.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),s.dirty());let i=this._def.valueType;function o(c){let u=new Set;for(let l of c){if(l.status==="aborted")return A.INVALID;l.status==="dirty"&&s.dirty(),u.add(l.value)}return{status:s.value,value:u}}let a=[...n.data.values()].map((c,u)=>i._parse(new mt(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(t,s){return new e({...this._def,minSize:{value:t,message:z.errorUtil.toString(s)}})}max(t,s){return new e({...this._def,maxSize:{value:t,message:z.errorUtil.toString(s)}})}size(t,s){return this.min(t,s).max(t,s)}nonempty(t){return this.min(1,t)}};x.ZodSet=Fn;Fn.create=(e,t)=>new Fn({valueType:e,minSize:null,maxSize:null,typeName:Y.ZodSet,...ee(t)});var _i=class e extends te{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:s}=this._processInputParams(t);if(s.parsedType!==M.ZodParsedType.function)return(0,A.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.function,received:s.parsedType}),A.INVALID;function n(a,c){return(0,A.makeIssue)({data:a,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,(0,Ii.getErrorMap)(),Ii.defaultErrorMap].filter(u=>!!u),issueData:{code:P.ZodIssueCode.invalid_arguments,argumentsError:c}})}function r(a,c){return(0,A.makeIssue)({data:a,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,(0,Ii.getErrorMap)(),Ii.defaultErrorMap].filter(u=>!!u),issueData:{code:P.ZodIssueCode.invalid_return_type,returnTypeError:c}})}let i={errorMap:s.common.contextualErrorMap},o=s.data;if(this._def.returns instanceof cs){let a=this;return(0,A.OK)(async function(...c){let u=new P.ZodError([]),l=await a._def.args.parseAsync(c,i).catch(f=>{throw u.addIssue(n(c,f)),u}),p=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(p,i).catch(f=>{throw u.addIssue(r(p,f)),u})})}else{let a=this;return(0,A.OK)(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new P.ZodError([n(c,u.error)]);let l=Reflect.apply(o,this,u.data),p=a._def.returns.safeParse(l,i);if(!p.success)throw new P.ZodError([r(l,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Bt.create(t).rest(Vt.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,s,n){return new e({args:t||Bt.create([]).rest(Vt.create()),returns:s||Vt.create(),typeName:Y.ZodFunction,...ee(n)})}};x.ZodFunction=_i;var Bs=class extends te{get schema(){return this._def.getter()}_parse(t){let{ctx:s}=this._processInputParams(t);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};x.ZodLazy=Bs;Bs.create=(e,t)=>new Bs({getter:e,typeName:Y.ZodLazy,...ee(t)});var Ms=class extends te{_parse(t){if(t.data!==this._def.value){let s=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(s,{received:s.data,code:P.ZodIssueCode.invalid_literal,expected:this._def.value}),A.INVALID}return{status:"valid",value:t.data}}get value(){return this._def.value}};x.ZodLiteral=Ms;Ms.create=(e,t)=>new Ms({value:e,typeName:Y.ZodLiteral,...ee(t)});function _g(e,t){return new Ns({values:e,typeName:Y.ZodEnum,...ee(t)})}var Ns=class e extends te{_parse(t){if(typeof t.data!="string"){let s=this._getOrReturnCtx(t),n=this._def.values;return(0,A.addIssueToContext)(s,{expected:M.util.joinValues(n),received:s.parsedType,code:P.ZodIssueCode.invalid_type}),A.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let s=this._getOrReturnCtx(t),n=this._def.values;return(0,A.addIssueToContext)(s,{received:s.data,code:P.ZodIssueCode.invalid_enum_value,options:n}),A.INVALID}return(0,A.OK)(t.data)}get options(){return this._def.values}get enum(){let t={};for(let s of this._def.values)t[s]=s;return t}get Values(){let t={};for(let s of this._def.values)t[s]=s;return t}get Enum(){let t={};for(let s of this._def.values)t[s]=s;return t}extract(t,s=this._def){return e.create(t,{...this._def,...s})}exclude(t,s=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...s})}};x.ZodEnum=Ns;Ns.create=_g;var Ws=class extends te{_parse(t){let s=M.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==M.ZodParsedType.string&&n.parsedType!==M.ZodParsedType.number){let r=M.util.objectValues(s);return(0,A.addIssueToContext)(n,{expected:M.util.joinValues(r),received:n.parsedType,code:P.ZodIssueCode.invalid_type}),A.INVALID}if(this._cache||(this._cache=new Set(M.util.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=M.util.objectValues(s);return(0,A.addIssueToContext)(n,{received:n.data,code:P.ZodIssueCode.invalid_enum_value,options:r}),A.INVALID}return(0,A.OK)(t.data)}get enum(){return this._def.values}};x.ZodNativeEnum=Ws;Ws.create=(e,t)=>new Ws({values:e,typeName:Y.ZodNativeEnum,...ee(t)});var cs=class extends te{unwrap(){return this._def.type}_parse(t){let{ctx:s}=this._processInputParams(t);if(s.parsedType!==M.ZodParsedType.promise&&s.common.async===!1)return(0,A.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.promise,received:s.parsedType}),A.INVALID;let n=s.parsedType===M.ZodParsedType.promise?s.data:Promise.resolve(s.data);return(0,A.OK)(n.then(r=>this._def.type.parseAsync(r,{path:s.path,errorMap:s.common.contextualErrorMap})))}};x.ZodPromise=cs;cs.create=(e,t)=>new cs({type:e,typeName:Y.ZodPromise,...ee(t)});var it=class extends te{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:s,ctx:n}=this._processInputParams(t),r=this._def.effect||null,i={addIssue:o=>{(0,A.addIssueToContext)(n,o),o.fatal?s.abort():s.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){let o=r.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(s.value==="aborted")return A.INVALID;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?A.INVALID:c.status==="dirty"||s.value==="dirty"?(0,A.DIRTY)(c.value):c});{if(s.value==="aborted")return A.INVALID;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?A.INVALID:a.status==="dirty"||s.value==="dirty"?(0,A.DIRTY)(a.value):a}}if(r.type==="refinement"){let o=a=>{let c=r.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?A.INVALID:(a.status==="dirty"&&s.dirty(),o(a.value),{status:s.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?A.INVALID:(a.status==="dirty"&&s.dirty(),o(a.value).then(()=>({status:s.value,value:a.value}))))}if(r.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,A.isValid)(o))return A.INVALID;let a=r.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>(0,A.isValid)(o)?Promise.resolve(r.transform(o.value,i)).then(a=>({status:s.value,value:a})):A.INVALID);M.util.assertNever(r)}};x.ZodEffects=it;x.ZodTransformer=it;it.create=(e,t,s)=>new it({schema:e,typeName:Y.ZodEffects,effect:t,...ee(s)});it.createWithPreprocess=(e,t,s)=>new it({schema:t,effect:{type:"preprocess",transform:e},typeName:Y.ZodEffects,...ee(s)});var dt=class extends te{_parse(t){return this._getType(t)===M.ZodParsedType.undefined?(0,A.OK)(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};x.ZodOptional=dt;dt.create=(e,t)=>new dt({innerType:e,typeName:Y.ZodOptional,...ee(t)});var Mt=class extends te{_parse(t){return this._getType(t)===M.ZodParsedType.null?(0,A.OK)(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};x.ZodNullable=Mt;Mt.create=(e,t)=>new Mt({innerType:e,typeName:Y.ZodNullable,...ee(t)});var js=class extends te{_parse(t){let{ctx:s}=this._processInputParams(t),n=s.data;return s.parsedType===M.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};x.ZodDefault=js;js.create=(e,t)=>new js({innerType:e,typeName:Y.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ee(t)});var $s=class extends te{_parse(t){let{ctx:s}=this._processInputParams(t),n={...s,common:{...s.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,A.isAsync)(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new P.ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new P.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};x.ZodCatch=$s;$s.create=(e,t)=>new $s({innerType:e,typeName:Y.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ee(t)});var En=class extends te{_parse(t){if(this._getType(t)!==M.ZodParsedType.nan){let n=this._getOrReturnCtx(t);return(0,A.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:M.ZodParsedType.nan,received:n.parsedType}),A.INVALID}return{status:"valid",value:t.data}}};x.ZodNaN=En;En.create=e=>new En({typeName:Y.ZodNaN,...ee(e)});x.BRAND=Symbol("zod_brand");var hr=class extends te{_parse(t){let{ctx:s}=this._processInputParams(t),n=s.data;return this._def.type._parse({data:n,path:s.path,parent:s})}unwrap(){return this._def.type}};x.ZodBranded=hr;var yr=class e extends te{_parse(t){let{status:s,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?A.INVALID:i.status==="dirty"?(s.dirty(),(0,A.DIRTY)(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?A.INVALID:r.status==="dirty"?(s.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(t,s){return new e({in:t,out:s,typeName:Y.ZodPipeline})}};x.ZodPipeline=yr;var Us=class extends te{_parse(t){let s=this._def.innerType._parse(t),n=r=>((0,A.isValid)(r)&&(r.value=Object.freeze(r.value)),r);return(0,A.isAsync)(s)?s.then(r=>n(r)):n(s)}unwrap(){return this._def.innerType}};x.ZodReadonly=Us;Us.create=(e,t)=>new Us({innerType:e,typeName:Y.ZodReadonly,...ee(t)});function wg(e,t){let s=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof s=="string"?{message:s}:s}function Lg(e,t={},s){return e?as.create().superRefine((n,r)=>{let i=e(n);if(i instanceof Promise)return i.then(o=>{if(!o){let a=wg(t,n),c=a.fatal??s??!0;r.addIssue({code:"custom",...a,fatal:c})}});if(!i){let o=wg(t,n),a=o.fatal??s??!0;r.addIssue({code:"custom",...o,fatal:a})}}):as.create()}x.late={object:Xe.lazycreate};var Y;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Y||(x.ZodFirstPartyTypeKind=Y={}));var eF=(e,t={message:`Input not instance of ${e.name}`})=>Lg(s=>s instanceof e,t);x.instanceof=eF;var Pg=os.create;x.string=Pg;var Og=ws.create;x.number=Og;var tF=En.create;x.nan=tF;var sF=Is.create;x.bigint=sF;var Bg=Ts.create;x.boolean=Bg;var nF=ks.create;x.date=nF;var rF=Cn.create;x.symbol=rF;var iF=_s.create;x.undefined=iF;var oF=Ls.create;x.null=oF;var aF=as.create;x.any=aF;var cF=Vt.create;x.unknown=cF;var uF=Et.create;x.never=uF;var lF=xn.create;x.void=lF;var pF=Kt.create;x.array=pF;var dF=Xe.create;x.object=dF;var mF=Xe.strictCreate;x.strictObject=mF;var fF=Ps.create;x.union=fF;var gF=Ti.create;x.discriminatedUnion=gF;var hF=Os.create;x.intersection=hF;var yF=Bt.create;x.tuple=yF;var DF=ki.create;x.record=DF;var bF=An.create;x.map=bF;var vF=Fn.create;x.set=vF;var SF=_i.create;x.function=SF;var CF=Bs.create;x.lazy=CF;var xF=Ms.create;x.literal=xF;var AF=Ns.create;x.enum=AF;var FF=Ws.create;x.nativeEnum=FF;var EF=cs.create;x.promise=EF;var Mg=it.create;x.effect=Mg;x.transformer=Mg;var RF=dt.create;x.optional=RF;var wF=Mt.create;x.nullable=wF;var IF=it.createWithPreprocess;x.preprocess=IF;var TF=yr.create;x.pipeline=TF;var kF=()=>Pg().optional();x.ostring=kF;var _F=()=>Og().optional();x.onumber=_F;var LF=()=>Bg().optional();x.oboolean=LF;x.coerce={string:e=>os.create({...e,coerce:!0}),number:e=>ws.create({...e,coerce:!0}),boolean:e=>Ts.create({...e,coerce:!0}),bigint:e=>Is.create({...e,coerce:!0}),date:e=>ks.create({...e,coerce:!0})};x.NEVER=A.INVALID});var rc=R(ft=>{"use strict";var PF=ft&&ft.__createBinding||(Object.create?function(e,t,s,n){n===void 0&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===void 0&&(n=s),e[n]=t[s]}),Rn=ft&&ft.__exportStar||function(e,t){for(var s in e)s!=="default"&&!Object.prototype.hasOwnProperty.call(t,s)&&PF(t,e,s)};Object.defineProperty(ft,"__esModule",{value:!0});Rn(Ri(),ft);Rn(tc(),ft);Rn(Ag(),ft);Rn(fr(),ft);Rn(Ng(),ft);Rn(Ei(),ft)});var $g=R(et=>{"use strict";var Wg=et&&et.__createBinding||(Object.create?function(e,t,s,n){n===void 0&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===void 0&&(n=s),e[n]=t[s]}),OF=et&&et.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),BF=et&&et.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s in e)s!=="default"&&Object.prototype.hasOwnProperty.call(e,s)&&Wg(t,e,s);return OF(t,e),t},MF=et&&et.__exportStar||function(e,t){for(var s in e)s!=="default"&&!Object.prototype.hasOwnProperty.call(t,s)&&Wg(t,e,s)};Object.defineProperty(et,"__esModule",{value:!0});et.z=void 0;var jg=BF(rc());et.z=jg;MF(rc(),et);et.default=jg});var ic=R(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.getEnvironment=void 0;var Zt=$g(),NF=Zt.z.object({LOG_LEVEL:Zt.z.enum(["DEBUG","INFO","WARN","ERROR","FATAL"]).optional(),STAGE:Zt.z.enum(["dev","prod","test"]).default("dev"),SERVICE_NAME:Zt.z.string().optional(),ENABLE_STRUCTURED_LOGGING:Zt.z.string().transform(e=>e==="true").optional(),CLOUDWATCH_LOG_GROUP:Zt.z.string().optional(),CLOUDWATCH_LOG_STREAM:Zt.z.string().optional(),AWS_REGION:Zt.z.string().optional()}),WF=(e=process.env)=>{let t;try{t=NF.parse(e)}catch(s){s instanceof Zt.z.ZodError&&console.warn("Environment validation failed, using defaults:",s.errors),t={STAGE:"dev"}}return{...t,isProduction:t.STAGE==="prod",isDevelopment:t.STAGE==="dev",logLevel:t.LOG_LEVEL??void 0,serviceName:t.SERVICE_NAME??void 0,enableStructuredLogging:t.ENABLE_STRUCTURED_LOGGING??!0,stage:t.STAGE}};Li.getEnvironment=WF});var oc=R(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.createLogFilter=Nt.createSampler=Nt.createRateLimiter=void 0;var jF=(e,t)=>{let s={tokens:t,lastRefill:Date.now(),maxTokens:t,refillRate:e},n=()=>{let i=Date.now(),a=(i-s.lastRefill)/1e3*s.refillRate;s.tokens=Math.min(s.maxTokens,s.tokens+a),s.lastRefill=i};return{tryConsume:(i=1)=>(n(),s.tokens>=i?(s.tokens-=i,!0):!1),getState:()=>({...s})}};Nt.createRateLimiter=jF;var $F=e=>{let t={totalLogs:0,sampledLogs:0};return{shouldSample:()=>(t.totalLogs++,e>=1?(t.sampledLogs++,!0):e<=0?!1:Math.random()<=e?(t.sampledLogs++,!0):!1),getStats:()=>({totalLogs:t.totalLogs,sampledLogs:t.sampledLogs,samplingRate:t.totalLogs>0?t.sampledLogs/t.totalLogs:0,configuredRate:e})}};Nt.createSampler=$F;var UF=e=>{let t=e.rateLimit?(0,Nt.createRateLimiter)(e.rateLimit.maxLogsPerSecond,e.rateLimit.burstSize):null,s=e.samplingRate!==void 0?(0,Nt.createSampler)(e.samplingRate):null;return{shouldLog:()=>!t&&!s?!0:!(t&&!t.tryConsume()||s&&!s.shouldSample()),getStats:()=>({rateLimit:t?.getState(),sampling:s?.getStats()})}};Nt.createLogFilter=UF});var ac=R(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.printLoggerConfig=gt.createStrogger=gt.strogger=gt.createLogger=void 0;var GF=Va(),zF=Fi(),Ce=Ft(),qF=Za(),Ug=Ya(),HF=ic(),VF=oc(),Gg=e=>{if(!e||typeof e!="object")return console.warn("[strogger] No environment provided, defaulting to DEBUG"),Ce.LogLevel.DEBUG;switch(e.LOG_LEVEL?.toUpperCase()){case"DEBUG":return Ce.LogLevel.DEBUG;case"INFO":return Ce.LogLevel.INFO;case"WARN":return Ce.LogLevel.WARN;case"ERROR":return Ce.LogLevel.ERROR;case"FATAL":return Ce.LogLevel.FATAL;case void 0:return e.STAGE==="prod"?Ce.LogLevel.INFO:Ce.LogLevel.DEBUG;default:return console.warn(`[strogger] Invalid LOG_LEVEL '${e.LOG_LEVEL}' provided. Defaulting to ${e.STAGE==="prod"?"INFO":"DEBUG"}.`),e.STAGE==="prod"?Ce.LogLevel.INFO:Ce.LogLevel.DEBUG}},KF=(e,t)=>e>=(t.level!==void 0?t.level:Ce.LogLevel.INFO),ZF=(e,t,s,n,r,i)=>({timestamp:new Date().toISOString(),level:t,message:s,context:{...e.stage&&{stage:e.stage},...e.serviceName&&{serviceName:e.serviceName},...n},error:r?{name:r.name,message:r.message,stack:r.stack}:void 0,metadata:i}),YF=({config:e={},transports:t=[],formatter:s,env:n})=>{let r=e.instanceId||(0,Ug.generateLoggerInstanceId)(),i={level:Gg(n),serviceName:n.SERVICE_NAME||void 0,stage:n.STAGE||"dev",enableStructuredLogging:n.ENABLE_STRUCTURED_LOGGING??!0,includeTimestamp:!0,includeLogLevel:!0,instanceId:r,...e};if(typeof i.level=="string")switch(i.level.toUpperCase()){case"DEBUG":i.level=Ce.LogLevel.DEBUG;break;case"INFO":i.level=Ce.LogLevel.INFO;break;case"WARN":i.level=Ce.LogLevel.WARN;break;case"ERROR":i.level=Ce.LogLevel.ERROR;break;case"FATAL":i.level=Ce.LogLevel.FATAL;break;default:i.level=Ce.LogLevel.INFO}e.level!==void 0&&(i.level=e.level);let o=(0,VF.createLogFilter)(i),a=(0,Ug.createDefaultEnrichmentMiddleware)(i.serviceName,i.stage,void 0,r),u=e.batching===!0?t.map(p=>(0,qF.createBatchedTransport)(p,{maxSize:50,maxWaitTime:2e3,maxBatchSize:512*1024})):t,l=async(p,d,f,m,g)=>{if(!KF(p,i)||(i.samplingRate!==void 0||i.rateLimit)&&!o.shouldLog())return;let h=a(f||{}),b=ZF(i,p,d,h,m,g),y=b;if(typeof i.redact=="function"&&(y=i.redact(b)),typeof i.validate=="function")try{i.validate(y)}catch(D){console.error("[LOGGER ERROR] Log entry validation failed:",D);return}if(Array.isArray(i.hooks))for(let D of i.hooks)try{let E=D(y);E&&typeof E.then=="function"&&await E}catch(E){console.error("[LOGGER ERROR] Log hook failed:",E)}let S=await Promise.allSettled(u.map(D=>D.log(y)));for(let D of S)D.status==="rejected"&&console.error(D.reason)};return{debug:(p,d,f)=>l(Ce.LogLevel.DEBUG,p,d,void 0,f),info:(p,d,f)=>l(Ce.LogLevel.INFO,p,d,void 0,f),warn:(p,d,f,m)=>l(Ce.LogLevel.WARN,p,d,f,m),error:(p,d,f,m)=>l(Ce.LogLevel.ERROR,p,d,f,m),fatal:(p,d,f,m)=>l(Ce.LogLevel.FATAL,p,d,f,m),logFunctionStart:(p,d,f)=>l(Ce.LogLevel.INFO,`Function ${p} started`,{...d,functionName:p},void 0,f),logFunctionEnd:(p,d,f,m)=>l(Ce.LogLevel.INFO,`Function ${p} completed in ${d}ms`,{...f,functionName:p,duration:d},void 0,m),logDatabaseOperation:(p,d,f,m)=>l(Ce.LogLevel.DEBUG,`Database operation: ${p} on table ${d}`,{...f,operation:p,table:d},void 0,m),logApiRequest:(p,d,f,m,g)=>l(Ce.LogLevel.INFO,`API ${p} ${d} - ${f}`,{...m,method:p,path:d,statusCode:f},void 0,g),setLevel:p=>{i.level=p;for(let d of t)d.setLevel?.(p)},getLevel:()=>i.level!==void 0?i.level:Ce.LogLevel.INFO,getInstanceId:()=>r,addTransport:p=>t.push(p),removeTransport:p=>{let d=t.indexOf(p);d>-1&&t.splice(d,1)},setFormatter:p=>{},getSamplingStats:()=>o.getStats(),flush:async()=>{await Promise.allSettled(u.map(p=>p.flush?.()||Promise.resolve()))},getBatchStats:()=>u.map(p=>p.getStats?.()||{})}};gt.createLogger=YF;var JF=(0,HF.getEnvironment)(),zg=(0,GF.createJsonFormatter)(),QF=(0,zF.createConsoleTransport)({formatter:zg});gt.strogger=(0,gt.createLogger)({config:{},transports:[QF],formatter:zg,env:JF});gt.createStrogger=gt.createLogger;var XF=e=>{let t=Gg(e);console.log("--- Strogger Logger Configuration ---"),console.log("LOG_LEVEL:",e.LOG_LEVEL??"(default)"),console.log("STAGE:",e.STAGE??"dev"),console.log("SERVICE_NAME:",e.SERVICE_NAME??"(none)"),console.log("ENABLE_STRUCTURED_LOGGING:",e.ENABLE_STRUCTURED_LOGGING??!0),console.log("Effective log level:",t),console.log("--------------------------------------")};gt.printLoggerConfig=XF});var ls=R(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.handleTransportError=ke.validateTransportConfig=ke.validateEnvironmentVariable=ke.createDetailedError=ke.ERROR_MESSAGES=ke.ValidationError=ke.ConfigurationError=ke.TransportError=ke.LoggerError=void 0;var us=class extends Error{constructor(t,s,n){super(t),this.code=s,this.details=n,this.name="LoggerError"}};ke.LoggerError=us;var Gs=class extends us{constructor(t,s,n){super(t,"TRANSPORT_ERROR",{transportName:s,...n}),this.transportName=s,this.name="TransportError"}};ke.TransportError=Gs;var Pi=class extends us{constructor(t,s){super(t,"CONFIGURATION_ERROR",s),this.name="ConfigurationError"}};ke.ConfigurationError=Pi;var cc=class extends us{constructor(t,s){super(t,"VALIDATION_ERROR",s),this.name="ValidationError"}};ke.ValidationError=cc;ke.ERROR_MESSAGES={NEW_RELIC_MISSING_API_KEY:{message:"New Relic transport requires NEW_RELIC_LICENSE_KEY environment variable",solution:"Set NEW_RELIC_LICENSE_KEY in your environment variables or pass apiKey option",example:"NEW_RELIC_LICENSE_KEY=your-license-key-here"},NEW_RELIC_MISSING_ACCOUNT_ID:{message:"New Relic transport requires NEW_RELIC_ACCOUNT_ID environment variable",solution:"Set NEW_RELIC_ACCOUNT_ID in your environment variables or pass accountId option",example:"NEW_RELIC_ACCOUNT_ID=your-account-id-here"},NEW_RELIC_API_ERROR:{message:"Failed to send logs to New Relic API",solution:"Check your API key, account ID, and network connectivity"},DATADOG_MISSING_API_KEY:{message:"DataDog transport requires DATADOG_API_KEY environment variable",solution:"Set DATADOG_API_KEY in your environment variables",example:"DATADOG_API_KEY=your-api-key-here"},DATADOG_API_ERROR:{message:"Failed to send logs to DataDog API",solution:"Check your API key and network connectivity"},CLOUDWATCH_MISSING_CREDENTIALS:{message:"CloudWatch transport requires AWS credentials",solution:"Configure AWS credentials via environment variables, IAM role, or AWS credentials file",example:`AWS_ACCESS_KEY_ID=your-key
7
+ AWS_SECRET_ACCESS_KEY=your-secret`},CLOUDWATCH_MISSING_LOG_GROUP:{message:"CloudWatch transport requires logGroupName option",solution:"Provide logGroupName in transport options or set CLOUDWATCH_LOG_GROUP environment variable",example:'logGroupName: "/aws/lambda/my-function"'},CLOUDWATCH_LOG_GROUP_NOT_FOUND:{message:"CloudWatch log group does not exist",solution:"Create the log group in CloudWatch before using this transport",example:'aws logs create-log-group --log-group-name "/aws/lambda/my-function"'},CLOUDWATCH_API_ERROR:{message:"Failed to send logs to CloudWatch",solution:"Check your AWS credentials, region, and network connectivity"},TRANSPORT_INITIALIZATION_FAILED:{message:"Failed to initialize transport",solution:"Check transport configuration and required dependencies"},TRANSPORT_SEND_FAILED:{message:"Failed to send log entry to transport",solution:"Check transport configuration and network connectivity"},MISSING_SERVICE_NAME:{message:"Logger configuration requires serviceName",solution:"Set SERVICE_NAME environment variable or provide serviceName in config",example:"SERVICE_NAME=my-service"},INVALID_LOG_LEVEL:{message:"Invalid log level specified",solution:"Use one of: DEBUG, INFO, WARN, ERROR, FATAL",example:"LOG_LEVEL=INFO"},ENVIRONMENT_VALIDATION_FAILED:{message:"Environment configuration validation failed",solution:"Check your environment variables and configuration"},FORMATTER_MISSING:{message:"Logger requires a formatter",solution:"Provide a formatter object with a format(entry) method",example:"formatter: createJsonFormatter()"},PERFORMANCE_MONITOR_INITIALIZATION_FAILED:{message:"Failed to initialize performance monitor",solution:"Check performance monitor configuration"},SPLUNK_MISSING_HEC_URL:{message:"Splunk transport requires SPLUNK_HEC_URL environment variable",solution:"Set SPLUNK_HEC_URL in your environment variables",example:"SPLUNK_HEC_URL=https://your-splunk-instance:8088/services/collector"},SPLUNK_MISSING_HEC_TOKEN:{message:"Splunk transport requires SPLUNK_HEC_TOKEN environment variable",solution:"Set SPLUNK_HEC_TOKEN in your environment variables",example:"SPLUNK_HEC_TOKEN=your-hec-token-here"},SPLUNK_API_ERROR:{message:"Failed to send logs to Splunk HEC",solution:"Check your HEC URL, token, and network connectivity"},ELASTICSEARCH_MISSING_AUTH:{message:"Elasticsearch transport requires authentication",solution:"Set ELASTICSEARCH_API_KEY or ELASTICSEARCH_USERNAME/PASSWORD",example:"ELASTICSEARCH_API_KEY=your-api-key-here"},ELASTICSEARCH_MISSING_DATE:{message:"Date string is missing for Elasticsearch index pattern",solution:"Check date generation logic and ensure valid date string is produced"},ELASTICSEARCH_API_ERROR:{message:"Failed to send logs to Elasticsearch",solution:"Check your connection URL, authentication, and network connectivity"}};var eE=(e,t,s)=>{let n=ke.ERROR_MESSAGES[e],r=`${n.message}${t?` (${t})`:""}`,i={...n,...s,...t&&{transportName:t}};return t?new Gs(r,t,i):new us(r,"LOGGER_ERROR",i)};ke.createDetailedError=eE;var tE=(e,t,s=!1)=>{if(s&&!t)throw new Pi(`Required environment variable ${e} is not set`,{missingVariable:e,message:`Required environment variable ${e} is not set`})};ke.validateEnvironmentVariable=tE;var sE=(e,t,s)=>{let n=s.filter(r=>!t[r]);if(n.length>0)throw new Gs(`Missing required configuration fields: ${n.join(", ")}`,e,{missingFields:n,message:`Missing required configuration fields: ${n.join(", ")}`})};ke.validateTransportConfig=sE;var nE=(e,t,s=!0)=>{let n;if(e instanceof us?n=e:e instanceof Error?n=new Gs(`Unexpected error in ${t}: ${e.message}`,t,{originalError:e.message,stack:e.stack}):n=new Gs(`Unknown error in ${t}`,t,{originalError:e}),s&&(console.error(`[LOGGER ERROR] ${n.message}`),n.details?.solution&&console.error(`[LOGGER SOLUTION] ${n.details.solution}`),n.details?.example&&console.error(`[LOGGER EXAMPLE] ${n.details.example}`)),!s)throw n};ke.handleTransportError=nE});var uc=R(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.createDataDogTransport=void 0;var wn=Ft(),In=ls(),rE=qt(),iE=(e={})=>{let t="DataDog";try{let s=e.level??wn.LogLevel.INFO,n=e.apiKey||process.env.DATADOG_API_KEY,r=e.serviceName||process.env.DD_SERVICE||process.env.SERVICE_NAME,i=e.source||"nodejs",o=e.tags||[],a=e.batchSize||10,c=e.flushInterval||5e3,u=e.region||process.env.DD_SITE||"us";(0,In.validateEnvironmentVariable)("DATADOG_API_KEY",n,!0),(0,In.validateTransportConfig)(t,{apiKey:n},["apiKey"]);let p=[...[`env:${process.env.NODE_ENV||"dev"}`,`service:${r||"unknown"}`,`source:${i}`],...o].join(","),d=[],f=null,m=async y=>{try{let S=`https://http-intake.logs.${u==="eu"?"eu.":""}datadoghq.com/api/v2/logs`,D=y.map(T=>({message:T.message,level:g(T.level),timestamp:new Date(T.timestamp).getTime(),ddsource:i,ddtags:p,service:r,...T.context,...T.error&&{error_name:T.error.name,error_message:T.error.message,error_stack:T.error.stack},...T.metadata&&{metadata:T.metadata}})),E=await fetch(S,{method:"POST",headers:{"Content-Type":"application/json","DD-API-KEY":n},body:JSON.stringify(D)});if(!E.ok)throw(0,In.createDetailedError)("DATADOG_API_ERROR",t,{status:E.status,statusText:E.statusText,url:S,responseBody:await E.text().catch(()=>"Unable to read response body")})}catch(S){(0,In.handleTransportError)(S,t,!0)}},g=y=>{switch(y){case wn.LogLevel.DEBUG:return"debug";case wn.LogLevel.INFO:return"info";case wn.LogLevel.WARN:return"warning";case wn.LogLevel.ERROR:return"error";case wn.LogLevel.FATAL:return"critical";default:return"info"}},h=async()=>{if(d.length===0)return;let y=[...d];d=[],await m(y)};return(()=>{f||(f=setInterval(()=>{h().catch(y=>{(0,In.handleTransportError)(y,t,!0)})},c))})(),{log:async y=>{(0,rE.shouldLog)(y.level,s)&&(d.push(y),d.length>=a&&await h())},setLevel:y=>{s=y},getLevel:()=>s,flush:async()=>{await h()},close:async()=>{f&&(clearInterval(f),f=null),await h()},addTags:y=>{o.push(...y)},getConfig:()=>({serviceName:r,source:i,tags:[...o],region:u,batchSize:a,flushInterval:c})}}catch(s){throw(0,In.handleTransportError)(s,t,!1),s}};Oi.createDataDogTransport=iE});var lc=R(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.createSplunkTransport=void 0;var Tn=Ft(),zs=ls(),oE=qt(),aE=(e={})=>{let t="Splunk";try{let s=e.level??Tn.LogLevel.INFO,n=e.hecUrl||process.env.SPLUNK_HEC_URL,r=e.hecToken||process.env.SPLUNK_HEC_TOKEN,i=e.source||"nodejs-logger",o=e.sourcetype||"_json",a=e.index||process.env.SPLUNK_INDEX,c=e.batchSize||10,u=e.flushInterval||5e3,l=e.channel||process.env.SPLUNK_CHANNEL;(0,zs.validateEnvironmentVariable)("SPLUNK_HEC_URL",n,!0),(0,zs.validateEnvironmentVariable)("SPLUNK_HEC_TOKEN",r,!0),(0,zs.validateTransportConfig)(t,{hecUrl:n,hecToken:r},["hecUrl","hecToken"]);let p=[],d=null,f=async b=>{try{let y=b.map(D=>({event:{message:D.message,level:m(D.level),timestamp:new Date(D.timestamp).getTime(),...D.context,...D.error&&{error_name:D.error.name,error_message:D.error.message,error_stack:D.error.stack},...D.metadata&&{metadata:D.metadata}},sourcetype:o,source:i,...a&&{index:a},...l&&{channel:l}})),S=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Splunk ${r}`},body:JSON.stringify(y)});if(!S.ok)throw(0,zs.createDetailedError)("SPLUNK_API_ERROR",t,{status:S.status,statusText:S.statusText,url:n,responseBody:await S.text().catch(()=>"Unable to read response body")})}catch(y){(0,zs.handleTransportError)(y,t,!0)}},m=b=>{switch(b){case Tn.LogLevel.DEBUG:return"DEBUG";case Tn.LogLevel.INFO:return"INFO";case Tn.LogLevel.WARN:return"WARN";case Tn.LogLevel.ERROR:return"ERROR";case Tn.LogLevel.FATAL:return"FATAL";default:return"INFO"}},g=async()=>{if(p.length===0)return;let b=[...p];p=[],await f(b)};return(()=>{d||(d=setInterval(()=>{g().catch(b=>{(0,zs.handleTransportError)(b,t,!0)})},u))})(),{log:async b=>{(0,oE.shouldLog)(b.level,s)&&(p.push(b),p.length>=c&&await g())},setLevel:b=>{s=b},getLevel:()=>s,flush:async()=>{await g()},close:async()=>{d&&(clearInterval(d),d=null),await g()},getConfig:()=>({hecUrl:n,source:i,sourcetype:o,index:a,channel:l,batchSize:c,flushInterval:u})}}catch(s){throw(0,zs.handleTransportError)(s,t,!1),s}};Bi.createSplunkTransport=aE});var pc=R(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.createElasticsearchTransport=void 0;var kn=Ft(),_n=ls(),cE=qt(),uE=(e={})=>{let t="Elasticsearch";try{let s=e.level??kn.LogLevel.INFO,n=e.url||process.env.ELASTICSEARCH_URL||"http://localhost:9200",r=e.username||process.env.ELASTICSEARCH_USERNAME,i=e.password||process.env.ELASTICSEARCH_PASSWORD,o=e.apiKey||process.env.ELASTICSEARCH_API_KEY,a=e.index||process.env.ELASTICSEARCH_INDEX||"logs",c=e.indexPattern||process.env.ELASTICSEARCH_INDEX_PATTERN||"logs-{YYYY.MM.DD}",u=e.batchSize||10,l=e.flushInterval||5e3,p=e.timeout||3e4;if(!o&&(!r||!i))throw(0,_n.createDetailedError)("ELASTICSEARCH_MISSING_AUTH",t,{message:"Elasticsearch transport requires either API key or username/password"});let d=[],f=null,m=()=>{if(c?.includes("{YYYY.MM.DD}")){let E=new Date().toISOString().split("T")[0]?.replace(/-/g,".");if(!E)throw(0,_n.createDetailedError)("ELASTICSEARCH_MISSING_DATE",t,{message:"Date string is missing"});return c.replace("{YYYY.MM.DD}",E)}return typeof a=="string"&&a.length>0?a:"logs"},g=()=>o?{Authorization:`ApiKey ${o}`}:r&&i?{Authorization:`Basic ${Buffer.from(`${r}:${i}`).toString("base64")}`}:{},h=async D=>{try{let E=m(),T=`${n}/_bulk`,k=`${D.map(K=>{let J={message:K.message,level:b(K.level),timestamp:new Date(K.timestamp).toISOString(),service:process.env.SERVICE_NAME||"unknown",...K.context,...K.error&&{error_name:K.error.name,error_message:K.error.message,error_stack:K.error.stack},...K.metadata&&{metadata:K.metadata}};return`${JSON.stringify({index:{_index:E}})}
8
8
  ${JSON.stringify(J)}`}).join(`
9
9
  `)}
10
- `,S=await fetch(T,{method:"POST",headers:{"Content-Type":"application/x-ndjson",...g()},body:k,signal:AbortSignal.timeout(p)});if(!S.ok){let K=await S.text().catch(()=>"Unable to read response body");throw(0,_n.createDetailedError)("ELASTICSEARCH_API_ERROR",t,{status:S.status,statusText:S.statusText,url:T,responseBody:K})}let $=await S.json().catch(()=>null);if($?.errors&&Array.isArray($.items)){let K=$.items.filter(J=>J.index?.error).map(J=>J.index?.error).slice(0,3);K?.length>0&&console.warn("[ELASTICSEARCH] Some documents failed to index:",K)}}catch(E){(0,_n.handleTransportError)(E,t,!0)}},y=b=>{switch(b){case kn.LogLevel.DEBUG:return"debug";case kn.LogLevel.INFO:return"info";case kn.LogLevel.WARN:return"warn";case kn.LogLevel.ERROR:return"error";case kn.LogLevel.FATAL:return"fatal";default:return"info"}},D=async()=>{if(d.length===0)return;let b=[...d];d=[],await h(b)};return(()=>{f||(f=setInterval(()=>{D().catch(b=>{(0,_n.handleTransportError)(b,t,!0)})},l))})(),{log:async b=>{(0,cE.shouldLog)(b.level,s)&&(d.push(b),d.length>=u&&await D())},setLevel:b=>{s=b},getLevel:()=>s,flush:async()=>{await D()},close:async()=>{f&&(clearInterval(f),f=null),await D()},getConfig:()=>({url:n,index:a,indexPattern:c,batchSize:u,flushInterval:l,timeout:p}),getCurrentIndex:()=>m()}}catch(s){throw(0,_n.handleTransportError)(s,t,!1),s}};Mi.createElasticsearchTransport=uE});var dc=R(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.createNewRelicTransport=void 0;var lE=Ft(),qs=ls(),pE=qt(),dE=(e={})=>{let t="New Relic";try{let s=e.level??lE.LogLevel.INFO,n=e.apiKey||process.env.NEW_RELIC_LICENSE_KEY,r=e.accountId||process.env.NEW_RELIC_ACCOUNT_ID,i=e.region||process.env.NEW_RELIC_REGION||"us",o=e.serviceName||process.env.NEW_RELIC_SERVICE_NAME,a=e.batchSize||10,c=e.flushInterval||5e3;(0,qs.validateEnvironmentVariable)("NEW_RELIC_LICENSE_KEY",n,!0),(0,qs.validateEnvironmentVariable)("NEW_RELIC_ACCOUNT_ID",r,!0),(0,qs.validateTransportConfig)(t,{apiKey:n,accountId:r},["apiKey","accountId"]);let u=[],l=null,p=async m=>{try{let g=`https://log-api.${i}.newrelic.com/log/v1`,h={timestamp:Date.now(),service:o,attributes:{logtype:"application",timestamp:new Date().toISOString()},logs:m.map(D=>({message:D.message,level:D.level,timestamp:new Date(D.timestamp).getTime(),attributes:{...D.context,...D.error&&{error_name:D.error.name,error_message:D.error.message,error_stack:D.error.stack},...D.metadata&&{metadata:D.metadata}}}))},y=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json","Api-Key":n,"X-License-Key":n},body:JSON.stringify(h)});if(!y.ok)throw(0,qs.createDetailedError)("NEW_RELIC_API_ERROR",t,{status:y.status,statusText:y.statusText,url:g,responseBody:await y.text().catch(()=>"Unable to read response body")})}catch(g){(0,qs.handleTransportError)(g,t,!0)}},d=async()=>{if(u.length===0)return;let m=[...u];u=[],await p(m)};return(()=>{l||(l=setInterval(()=>{d().catch(m=>{(0,qs.handleTransportError)(m,t,!0)})},c))})(),{log:async m=>{(0,pE.shouldLog)(m.level,s)&&(u.push(m),u.length>=a&&await d())},setLevel:m=>{s=m},getLevel:()=>s,flush:async()=>{await d()},close:async()=>{l&&(clearInterval(l),l=null),await d()}}}catch(s){throw(0,qs.handleTransportError)(s,t,!1),s}};Ni.createNewRelicTransport=dE});var qg=R(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.createFileTransport=void 0;var ot=require("node:fs"),Dr=require("node:path"),mE=require("node:util"),fE=require("node:zlib"),gE=Ft(),ps=ls(),hE=qt(),yE=(0,mE.promisify)(fE.gzip),DE=(e={})=>{let t="File";try{let s=e.level??gE.LogLevel.INFO,n=e.formatter||{format:k=>JSON.stringify(k)},r=e.filePath||process.env.LOG_FILE_PATH||"./logs/app.log",i=e.maxFileSize??10*1024*1024,o=e.maxFiles??5,a=e.rotationInterval??24*60*60*1e3,c=e.compressOldFiles??!1,u=e.dateFormat??"YYYY-MM-DD",l=e.encoding??"utf8",p=e.createSymlink??!1,d=e.symlinkName??"current.log";(0,ps.validateEnvironmentVariable)("LOG_FILE_PATH",r,!1),(0,ps.validateTransportConfig)(t,{filePath:r},["filePath"]);let f={currentFile:r,currentSize:0,lastRotation:Date.now()},m=null,g=async k=>{let S=(0,Dr.dirname)(k);try{await ot.promises.access(S)}catch{await ot.promises.mkdir(S,{recursive:!0})}},h=(k,S)=>{let $=(0,Dr.extname)(k),K=k.replace($,""),J=new Date().toISOString().split("T")[0];return`${K}.${J}.${S}${$}${c?".gz":""}`},y=()=>{let k=Date.now()-f.lastRotation;return f.currentSize>=i||k>=a},D=async k=>{if(c)try{let S=await ot.promises.readFile(k,l),$=await yE(S);await ot.promises.writeFile(`${k}.gz`,$),await ot.promises.unlink(k)}catch(S){(0,ps.handleTransportError)(S,t,!0)}},A=async()=>{try{f.fileHandle&&(await f.fileHandle.close(),f.fileHandle=void 0);for(let S=o-1;S>=1;S--){let $=h(r,S),K=h(r,S+1);try{await ot.promises.access($),await ot.promises.rename($,K)}catch{}}let k=h(r,1);try{await ot.promises.access(r),await ot.promises.rename(r,k),await D(k)}catch{}if(f.currentSize=0,f.lastRotation=Date.now(),await g(r),f.fileHandle=await ot.promises.open(r,"a"),p){let S=(0,Dr.join)((0,Dr.dirname)(r),d);try{await ot.promises.unlink(S)}catch{}await ot.promises.symlink((0,Dr.basename)(r),S)}console.log(`[FILE] Rotated log file to: ${k}`)}catch(k){(0,ps.handleTransportError)(k,t,!0)}},b=async k=>{try{y()&&await A(),f.fileHandle||(await g(r),f.fileHandle=await ot.promises.open(r,"a"));let S=`${k}
11
- `;await f.fileHandle.write(S,void 0,l),f.currentSize+=S.length}catch(S){(0,ps.handleTransportError)(S,t,!0)}},E=async()=>{try{f.fileHandle&&await f.fileHandle.sync()}catch(k){(0,ps.handleTransportError)(k,t,!0)}};return(()=>{m||(m=setInterval(()=>{E().catch(k=>{(0,ps.handleTransportError)(k,t,!0)})},5e3))})(),{log:async k=>{if(!(0,hE.shouldLog)(k.level,s))return;let S=n.format(k);await b(S)},setLevel:k=>{s=k},getLevel:()=>s,rotate:async()=>{await A()},getCurrentFile:()=>f.currentFile,getCurrentSize:()=>f.currentSize,flush:async()=>{await E()},close:async()=>{m&&(clearInterval(m),m=null),f.fileHandle&&(await f.fileHandle.close(),f.fileHandle=void 0)},getConfig:()=>({filePath:r,maxFileSize:i,maxFiles:o,rotationInterval:a,compressOldFiles:c,dateFormat:u,encoding:l,createSymlink:p,symlinkName:d}),getStats:()=>({currentFile:f.currentFile,currentSize:f.currentSize,lastRotation:f.lastRotation,fileHandleOpen:!!f.fileHandle,flushTimerActive:!!m})}}catch(s){throw(0,ps.handleTransportError)(s,t,!1),s}};Wi.createFileTransport=DE});var mc=R(Wt=>{"use strict";var bE=Wt&&Wt.__createBinding||(Object.create?function(e,t,s,n){n===void 0&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===void 0&&(n=s),e[n]=t[s]}),vE=Wt&&Wt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),SE=Wt&&Wt.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(s){var n=[];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(n[n.length]=r);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var s={};if(t!=null)for(var n=e(t),r=0;r<n.length;r++)n[r]!=="default"&&bE(s,t,n[r]);return vE(s,t),s}}();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.createCloudWatchTransport=void 0;var CE=Ft(),ds=ls(),xE=qt(),AE=(e={})=>{let t="CloudWatch";try{let s=e.level??CE.LogLevel.INFO,n=e.formatter||{format:b=>JSON.stringify(b)},r=e.logGroupName||process.env.CLOUDWATCH_LOG_GROUP||"/aws/lambda/my-function",i=e.logStreamName||process.env.CLOUDWATCH_LOG_STREAM,o=e.region||process.env.AWS_REGION||"us-east-1",a=e.maxStreamSize??45*1024*1024,c=e.maxStreamAge??23*60*60*1e3,u=e.batchSize||10,l=e.flushInterval||5e3,p=e.timeout||3e4;(0,ds.validateEnvironmentVariable)("CLOUDWATCH_LOG_GROUP",r,!1),(0,ds.validateEnvironmentVariable)("AWS_REGION",o,!1),(0,ds.validateTransportConfig)(t,{logGroupName:r,region:o},["logGroupName","region"]);let d={currentStreamName:i||`${new Date().toISOString().split("T")[0]}-${Date.now()}`,currentStreamSize:0,streamStartTime:Date.now(),sequenceToken:void 0,batch:[]},f=null,m=()=>{let b=Date.now()-d.streamStartTime;return d.currentStreamSize>=a||b>=c},g=()=>{let b=new Date().toISOString().replace(/[:.]/g,"-");return i?`${i}-${b}`:`${new Date().toISOString().split("T")[0]}-${b}`},h=async b=>{try{let{CloudWatchLogsClient:E,PutLogEventsCommand:T,CreateLogStreamCommand:k}=await Promise.resolve().then(()=>SE(require("@aws-sdk/client-cloudwatch-logs"))),S=new E({region:o,requestHandler:{requestTimeout:p}});try{await S.send(new k({logGroupName:r,logStreamName:d.currentStreamName}))}catch(Z){if(Z instanceof Error&&Z.name!=="ResourceAlreadyExistsException")throw Z}let $=b.map(Z=>({timestamp:new Date(Z.timestamp).getTime(),message:n.format(Z)})),K=new T({logGroupName:r,logStreamName:d.currentStreamName,logEvents:$,sequenceToken:d.sequenceToken}),J=await S.send(K);J.nextSequenceToken&&(d.sequenceToken=J.nextSequenceToken);let V=$.reduce((Z,O)=>Z+O.message.length,0);d.currentStreamSize+=V}catch(E){if(E instanceof Error&&E.name==="InvalidSequenceTokenException"){let T=E.message.match(/sequenceToken is: (.+)/);if(T){d.sequenceToken=T[1],await h(b);return}}throw E instanceof Error&&E.name==="ResourceNotFoundException"?(0,ds.createDetailedError)("CLOUDWATCH_LOG_GROUP_NOT_FOUND",t,{logGroupName:r,region:o,message:"Log group does not exist. Create it first in CloudWatch."}):(0,ds.createDetailedError)("CLOUDWATCH_API_ERROR",t,{error:E instanceof Error?E.message:String(E),logGroupName:r,logStreamName:d.currentStreamName,region:o})}},y=async()=>{try{await D(),d.currentStreamName=g(),d.currentStreamSize=0,d.streamStartTime=Date.now(),d.sequenceToken=void 0,console.log(`[CLOUDWATCH] Rotated to stream: ${d.currentStreamName}`)}catch(b){(0,ds.handleTransportError)(b,t,!0)}},D=async()=>{if(d.batch.length===0)return;let b=[...d.batch];d.batch=[],await h(b)};return(()=>{f||(f=setInterval(()=>{D().catch(b=>{(0,ds.handleTransportError)(b,t,!0)})},l))})(),{log:async b=>{(0,xE.shouldLog)(b.level,s)&&(m()&&await y(),d.batch.push(b),d.batch.length>=u&&await D())},setLevel:b=>{s=b},getLevel:()=>s,rotateStream:async()=>{await y()},getCurrentStream:()=>d.currentStreamName,getCurrentStreamSize:()=>d.currentStreamSize,flush:async()=>{await D()},close:async()=>{f&&(clearInterval(f),f=null),await D()},getConfig:()=>({logGroupName:r,logStreamName:d.currentStreamName,region:o,maxStreamSize:a,maxStreamAge:c,batchSize:u,flushInterval:l,timeout:p}),getStats:()=>({currentStream:d.currentStreamName,currentStreamSize:d.currentStreamSize,streamAge:Date.now()-d.streamStartTime,batchSize:d.batch.length,sequenceToken:d.sequenceToken?"set":"not set",flushTimerActive:!!f})}}catch(s){throw(0,ds.handleTransportError)(s,t,!1),s}};Wt.createCloudWatchTransport=AE});var Hg=R(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.createPerformanceMonitor=void 0;var FE=e=>{let t=e||{metrics:new Map},s=(p,d)=>{t.metrics.has(p)||t.metrics.set(p,[]);let f=t.metrics.get(p);f&&f.push(d)},n=p=>{let d=performance.now();return f=>{let m=performance.now(),g=m-d,h={functionName:p,duration:g,startTime:d,endTime:m,...f&&{metadata:f}};return s(p,h),h}},r=async(p,d,f)=>{let m=performance.now();try{let g=await d(),h=performance.now(),y=h-m,D={functionName:p,duration:y,startTime:m,endTime:h,...f&&{metadata:f}};return s(p,D),g}catch(g){let h=performance.now(),y=h-m,D={functionName:p,duration:y,startTime:m,endTime:h,...f&&{metadata:{...f,error:!0}}};throw s(p,D),g}},i=(p,d,f)=>{let m=performance.now();try{let g=d(),h=performance.now(),y=h-m,D={functionName:p,duration:y,startTime:m,endTime:h,...f&&{metadata:f}};return s(p,D),g}catch(g){let h=performance.now(),y=h-m,D={functionName:p,duration:y,startTime:m,endTime:h,...f&&{metadata:{...f,error:!0}}};throw s(p,D),g}},o=p=>{if(p)return t.metrics.get(p)||[];let d=[];for(let f of t.metrics.values())d.push(...f);return d},a=p=>{let d=o(p);return d.length===0?0:d.reduce((m,g)=>m+g.duration,0)/d.length};return{state:t,startTimer:n,timeAsync:r,timeSync:i,getMetrics:o,getAverageDuration:a,getSlowestExecution:p=>{let d=o(p);return d.length===0?null:d.reduce((f,m)=>m.duration>f.duration?m:f)},clearMetrics:p=>{p?t.metrics.delete(p):t.metrics.clear()},getMetricsSummary:()=>{let p={};for(let[d,f]of t.metrics.entries()){let m=f.length,g=a(d),h=Math.max(...f.map(y=>y.duration));p[d]={count:m,avgDuration:g,maxDuration:h}}return p}}};ji.createPerformanceMonitor=FE});var Vg=R(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.stroggerWithFileTransport=Hs.createFileTransportExample=void 0;var $i=Yt(),EE=(e={})=>{let t=e.level??$i.LogLevel.INFO,s=e.maxFileSize??10*1024*1024,n=e.rotationInterval??24*60*60*1e3,r=0,i=Date.now(),o=()=>r>=s||Date.now()-i>=n,a=async()=>{r=0,i=Date.now(),console.log("[MOCK FILE] Rotated log file")},c=async u=>{o()&&await a(),r+=u.length,console.log(`[MOCK FILE] Writing: ${u}`)};return{log:async u=>{if(u.level<t)return;let l=JSON.stringify(u);await c(l)},setLevel:u=>{t=u},getLevel:()=>t}};Hs.createFileTransportExample=EE;var RE=(0,$i.getEnvironment)(),wE=(0,$i.createJsonFormatter)(),IE=(0,Hs.createFileTransportExample)({maxFileSize:1024,rotationInterval:1e4});Hs.stroggerWithFileTransport=(0,$i.createLogger)({config:{serviceName:"file-rotation-example"},transports:[IE],formatter:wE,env:RE})});var Kg=R(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.loggerWithCloudWatchTransport=Vs.createCloudWatchTransportExample=void 0;var Ui=Yt(),TE=(e={})=>{let t=e.level??Ui.LogLevel.INFO,s=e.maxStreamSize??45*1024*1024,n=e.maxStreamAge??23*60*60*1e3,r=0,i=Date.now(),o=()=>r>=s||Date.now()-i>=n,a=async()=>{r=0,i=Date.now(),console.log("[MOCK CW] Rotated log stream")},c=async u=>{o()&&await a(),r+=u.length,console.log(`[MOCK CW] Sending: ${u}`)};return{log:async u=>{if(u.level<t)return;let l=JSON.stringify(u);await c(l)},setLevel:u=>{t=u},getLevel:()=>t}};Vs.createCloudWatchTransportExample=TE;var kE=(0,Ui.getEnvironment)(),_E=(0,Ui.createJsonFormatter)(),LE=(0,Vs.createCloudWatchTransportExample)({maxStreamSize:1024,maxStreamAge:1e4});Vs.loggerWithCloudWatchTransport=(0,Ui.createLogger)({config:{serviceName:"cloudwatch-rotation-example"},transports:[LE],formatter:_E,env:kE})});var sh=R((Ge,th)=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.demonstrateEnvironmentSpecificFileTransport=Ge.demonstrateCustomFileTransport=Ge.demonstrateMultipleFileTransports=Ge.demonstrateFileTransportWithSymlink=Ge.demonstrateCompressedFileTransport=Ge.demonstrateBasicFileTransport=Ge.runFileTransportExamples=void 0;var fe=Yt(),Zg=()=>{console.log(`=== Basic File Transport ===
10
+ `,C=await fetch(T,{method:"POST",headers:{"Content-Type":"application/x-ndjson",...g()},body:k,signal:AbortSignal.timeout(p)});if(!C.ok){let K=await C.text().catch(()=>"Unable to read response body");throw(0,_n.createDetailedError)("ELASTICSEARCH_API_ERROR",t,{status:C.status,statusText:C.statusText,url:T,responseBody:K})}let $=await C.json().catch(()=>null);if($?.errors&&Array.isArray($.items)){let K=$.items.filter(J=>J.index?.error).map(J=>J.index?.error).slice(0,3);K?.length>0&&console.warn("[ELASTICSEARCH] Some documents failed to index:",K)}}catch(E){(0,_n.handleTransportError)(E,t,!0)}},b=D=>{switch(D){case kn.LogLevel.DEBUG:return"debug";case kn.LogLevel.INFO:return"info";case kn.LogLevel.WARN:return"warn";case kn.LogLevel.ERROR:return"error";case kn.LogLevel.FATAL:return"fatal";default:return"info"}},y=async()=>{if(d.length===0)return;let D=[...d];d=[],await h(D)};return(()=>{f||(f=setInterval(()=>{y().catch(D=>{(0,_n.handleTransportError)(D,t,!0)})},l))})(),{log:async D=>{(0,cE.shouldLog)(D.level,s)&&(d.push(D),d.length>=u&&await y())},setLevel:D=>{s=D},getLevel:()=>s,flush:async()=>{await y()},close:async()=>{f&&(clearInterval(f),f=null),await y()},getConfig:()=>({url:n,index:a,indexPattern:c,batchSize:u,flushInterval:l,timeout:p}),getCurrentIndex:()=>m()}}catch(s){throw(0,_n.handleTransportError)(s,t,!1),s}};Mi.createElasticsearchTransport=uE});var dc=R(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.createNewRelicTransport=void 0;var lE=Ft(),qs=ls(),pE=qt(),dE=(e={})=>{let t="New Relic";try{let s=e.level??lE.LogLevel.INFO,n=e.apiKey||process.env.NEW_RELIC_LICENSE_KEY,r=e.accountId||process.env.NEW_RELIC_ACCOUNT_ID,i=e.region||process.env.NEW_RELIC_REGION||"us",o=e.serviceName||process.env.NEW_RELIC_SERVICE_NAME,a=e.batchSize||10,c=e.flushInterval||5e3;(0,qs.validateEnvironmentVariable)("NEW_RELIC_LICENSE_KEY",n,!0),(0,qs.validateEnvironmentVariable)("NEW_RELIC_ACCOUNT_ID",r,!0),(0,qs.validateTransportConfig)(t,{apiKey:n,accountId:r},["apiKey","accountId"]);let u=[],l=null,p=async m=>{try{let g=`https://log-api.${i}.newrelic.com/log/v1`,h={timestamp:Date.now(),service:o,attributes:{logtype:"application",timestamp:new Date().toISOString()},logs:m.map(y=>({message:y.message,level:y.level,timestamp:new Date(y.timestamp).getTime(),attributes:{...y.context,...y.error&&{error_name:y.error.name,error_message:y.error.message,error_stack:y.error.stack},...y.metadata&&{metadata:y.metadata}}}))},b=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json","Api-Key":n,"X-License-Key":n},body:JSON.stringify(h)});if(!b.ok)throw(0,qs.createDetailedError)("NEW_RELIC_API_ERROR",t,{status:b.status,statusText:b.statusText,url:g,responseBody:await b.text().catch(()=>"Unable to read response body")})}catch(g){(0,qs.handleTransportError)(g,t,!0)}},d=async()=>{if(u.length===0)return;let m=[...u];u=[],await p(m)};return(()=>{l||(l=setInterval(()=>{d().catch(m=>{(0,qs.handleTransportError)(m,t,!0)})},c))})(),{log:async m=>{(0,pE.shouldLog)(m.level,s)&&(u.push(m),u.length>=a&&await d())},setLevel:m=>{s=m},getLevel:()=>s,flush:async()=>{await d()},close:async()=>{l&&(clearInterval(l),l=null),await d()}}}catch(s){throw(0,qs.handleTransportError)(s,t,!1),s}};Ni.createNewRelicTransport=dE});var qg=R(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.createFileTransport=void 0;var ot=require("node:fs"),Dr=require("node:path"),mE=require("node:util"),fE=require("node:zlib"),gE=Ft(),ps=ls(),hE=qt(),yE=(0,mE.promisify)(fE.gzip),DE=(e={})=>{let t="File";try{let s=e.level??gE.LogLevel.INFO,n=e.formatter||{format:k=>JSON.stringify(k)},r=e.filePath||process.env.LOG_FILE_PATH||"./logs/app.log",i=e.maxFileSize??10*1024*1024,o=e.maxFiles??5,a=e.rotationInterval??24*60*60*1e3,c=e.compressOldFiles??!1,u=e.dateFormat??"YYYY-MM-DD",l=e.encoding??"utf8",p=e.createSymlink??!1,d=e.symlinkName??"current.log";(0,ps.validateEnvironmentVariable)("LOG_FILE_PATH",r,!1),(0,ps.validateTransportConfig)(t,{filePath:r},["filePath"]);let f={currentFile:r,currentSize:0,lastRotation:Date.now()},m=null,g=async k=>{let C=(0,Dr.dirname)(k);try{await ot.promises.access(C)}catch{await ot.promises.mkdir(C,{recursive:!0})}},h=(k,C)=>{let $=(0,Dr.extname)(k),K=k.replace($,""),J=new Date().toISOString().split("T")[0];return`${K}.${J}.${C}${$}${c?".gz":""}`},b=()=>{let k=Date.now()-f.lastRotation;return f.currentSize>=i||k>=a},y=async k=>{if(c)try{let C=await ot.promises.readFile(k,l),$=await yE(C);await ot.promises.writeFile(`${k}.gz`,$),await ot.promises.unlink(k)}catch(C){(0,ps.handleTransportError)(C,t,!0)}},S=async()=>{try{f.fileHandle&&(await f.fileHandle.close(),f.fileHandle=void 0);for(let C=o-1;C>=1;C--){let $=h(r,C),K=h(r,C+1);try{await ot.promises.access($),await ot.promises.rename($,K)}catch{}}let k=h(r,1);try{await ot.promises.access(r),await ot.promises.rename(r,k),await y(k)}catch{}if(f.currentSize=0,f.lastRotation=Date.now(),await g(r),f.fileHandle=await ot.promises.open(r,"a"),p){let C=(0,Dr.join)((0,Dr.dirname)(r),d);try{await ot.promises.unlink(C)}catch{}await ot.promises.symlink((0,Dr.basename)(r),C)}console.log(`[FILE] Rotated log file to: ${k}`)}catch(k){(0,ps.handleTransportError)(k,t,!0)}},D=async k=>{try{b()&&await S(),f.fileHandle||(await g(r),f.fileHandle=await ot.promises.open(r,"a"));let C=`${k}
11
+ `;await f.fileHandle.write(C,void 0,l),f.currentSize+=C.length}catch(C){(0,ps.handleTransportError)(C,t,!0)}},E=async()=>{try{f.fileHandle&&await f.fileHandle.sync()}catch(k){(0,ps.handleTransportError)(k,t,!0)}};return(()=>{m||(m=setInterval(()=>{E().catch(k=>{(0,ps.handleTransportError)(k,t,!0)})},5e3))})(),{log:async k=>{if(!(0,hE.shouldLog)(k.level,s))return;let C=n.format(k);await D(C)},setLevel:k=>{s=k},getLevel:()=>s,rotate:async()=>{await S()},getCurrentFile:()=>f.currentFile,getCurrentSize:()=>f.currentSize,flush:async()=>{await E()},close:async()=>{m&&(clearInterval(m),m=null),f.fileHandle&&(await f.fileHandle.close(),f.fileHandle=void 0)},getConfig:()=>({filePath:r,maxFileSize:i,maxFiles:o,rotationInterval:a,compressOldFiles:c,dateFormat:u,encoding:l,createSymlink:p,symlinkName:d}),getStats:()=>({currentFile:f.currentFile,currentSize:f.currentSize,lastRotation:f.lastRotation,fileHandleOpen:!!f.fileHandle,flushTimerActive:!!m})}}catch(s){throw(0,ps.handleTransportError)(s,t,!1),s}};Wi.createFileTransport=DE});var mc=R(Wt=>{"use strict";var bE=Wt&&Wt.__createBinding||(Object.create?function(e,t,s,n){n===void 0&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===void 0&&(n=s),e[n]=t[s]}),vE=Wt&&Wt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),SE=Wt&&Wt.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(s){var n=[];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(n[n.length]=r);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var s={};if(t!=null)for(var n=e(t),r=0;r<n.length;r++)n[r]!=="default"&&bE(s,t,n[r]);return vE(s,t),s}}();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.createCloudWatchTransport=void 0;var CE=Ft(),ds=ls(),xE=qt(),AE=(e={})=>{let t="CloudWatch";try{let s=e.level??CE.LogLevel.INFO,n=e.formatter||{format:D=>JSON.stringify(D)},r=e.logGroupName||process.env.CLOUDWATCH_LOG_GROUP||"/aws/lambda/my-function",i=e.logStreamName||process.env.CLOUDWATCH_LOG_STREAM,o=e.region||process.env.AWS_REGION||"us-east-1",a=e.maxStreamSize??45*1024*1024,c=e.maxStreamAge??23*60*60*1e3,u=e.batchSize||10,l=e.flushInterval||5e3,p=e.timeout||3e4;(0,ds.validateEnvironmentVariable)("CLOUDWATCH_LOG_GROUP",r,!1),(0,ds.validateEnvironmentVariable)("AWS_REGION",o,!1),(0,ds.validateTransportConfig)(t,{logGroupName:r,region:o},["logGroupName","region"]);let d={currentStreamName:i||`${new Date().toISOString().split("T")[0]}-${Date.now()}`,currentStreamSize:0,streamStartTime:Date.now(),sequenceToken:void 0,batch:[]},f=null,m=()=>{let D=Date.now()-d.streamStartTime;return d.currentStreamSize>=a||D>=c},g=()=>{let D=new Date().toISOString().replace(/[:.]/g,"-");return i?`${i}-${D}`:`${new Date().toISOString().split("T")[0]}-${D}`},h=async D=>{try{let{CloudWatchLogsClient:E,PutLogEventsCommand:T,CreateLogStreamCommand:k}=await Promise.resolve().then(()=>SE(require("@aws-sdk/client-cloudwatch-logs"))),C=new E({region:o,requestHandler:{requestTimeout:p}});try{await C.send(new k({logGroupName:r,logStreamName:d.currentStreamName}))}catch(Z){if(Z instanceof Error&&Z.name!=="ResourceAlreadyExistsException")throw Z}let $=D.map(Z=>({timestamp:new Date(Z.timestamp).getTime(),message:n.format(Z)})),K=new T({logGroupName:r,logStreamName:d.currentStreamName,logEvents:$,sequenceToken:d.sequenceToken}),J=await C.send(K);J.nextSequenceToken&&(d.sequenceToken=J.nextSequenceToken);let V=$.reduce((Z,O)=>Z+O.message.length,0);d.currentStreamSize+=V}catch(E){if(E instanceof Error&&E.name==="InvalidSequenceTokenException"){let T=E.message.match(/sequenceToken is: (.+)/);if(T){d.sequenceToken=T[1],await h(D);return}}throw E instanceof Error&&E.name==="ResourceNotFoundException"?(0,ds.createDetailedError)("CLOUDWATCH_LOG_GROUP_NOT_FOUND",t,{logGroupName:r,region:o,message:"Log group does not exist. Create it first in CloudWatch."}):(0,ds.createDetailedError)("CLOUDWATCH_API_ERROR",t,{error:E instanceof Error?E.message:String(E),logGroupName:r,logStreamName:d.currentStreamName,region:o})}},b=async()=>{try{await y(),d.currentStreamName=g(),d.currentStreamSize=0,d.streamStartTime=Date.now(),d.sequenceToken=void 0,console.log(`[CLOUDWATCH] Rotated to stream: ${d.currentStreamName}`)}catch(D){(0,ds.handleTransportError)(D,t,!0)}},y=async()=>{if(d.batch.length===0)return;let D=[...d.batch];d.batch=[],await h(D)};return(()=>{f||(f=setInterval(()=>{y().catch(D=>{(0,ds.handleTransportError)(D,t,!0)})},l))})(),{log:async D=>{(0,xE.shouldLog)(D.level,s)&&(m()&&await b(),d.batch.push(D),d.batch.length>=u&&await y())},setLevel:D=>{s=D},getLevel:()=>s,rotateStream:async()=>{await b()},getCurrentStream:()=>d.currentStreamName,getCurrentStreamSize:()=>d.currentStreamSize,flush:async()=>{await y()},close:async()=>{f&&(clearInterval(f),f=null),await y()},getConfig:()=>({logGroupName:r,logStreamName:d.currentStreamName,region:o,maxStreamSize:a,maxStreamAge:c,batchSize:u,flushInterval:l,timeout:p}),getStats:()=>({currentStream:d.currentStreamName,currentStreamSize:d.currentStreamSize,streamAge:Date.now()-d.streamStartTime,batchSize:d.batch.length,sequenceToken:d.sequenceToken?"set":"not set",flushTimerActive:!!f})}}catch(s){throw(0,ds.handleTransportError)(s,t,!1),s}};Wt.createCloudWatchTransport=AE});var Hg=R(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.createPerformanceMonitor=void 0;var FE=e=>{let t=e||{metrics:new Map},s=(p,d)=>{t.metrics.has(p)||t.metrics.set(p,[]);let f=t.metrics.get(p);f&&f.push(d)},n=p=>{let d=performance.now();return f=>{let m=performance.now(),g=m-d,h={functionName:p,duration:g,startTime:d,endTime:m,...f&&{metadata:f}};return s(p,h),h}},r=async(p,d,f)=>{let m=performance.now();try{let g=await d(),h=performance.now(),b=h-m,y={functionName:p,duration:b,startTime:m,endTime:h,...f&&{metadata:f}};return s(p,y),g}catch(g){let h=performance.now(),b=h-m,y={functionName:p,duration:b,startTime:m,endTime:h,...f&&{metadata:{...f,error:!0}}};throw s(p,y),g}},i=(p,d,f)=>{let m=performance.now();try{let g=d(),h=performance.now(),b=h-m,y={functionName:p,duration:b,startTime:m,endTime:h,...f&&{metadata:f}};return s(p,y),g}catch(g){let h=performance.now(),b=h-m,y={functionName:p,duration:b,startTime:m,endTime:h,...f&&{metadata:{...f,error:!0}}};throw s(p,y),g}},o=p=>{if(p)return t.metrics.get(p)||[];let d=[];for(let f of t.metrics.values())d.push(...f);return d},a=p=>{let d=o(p);return d.length===0?0:d.reduce((m,g)=>m+g.duration,0)/d.length};return{state:t,startTimer:n,timeAsync:r,timeSync:i,getMetrics:o,getAverageDuration:a,getSlowestExecution:p=>{let d=o(p);return d.length===0?null:d.reduce((f,m)=>m.duration>f.duration?m:f)},clearMetrics:p=>{p?t.metrics.delete(p):t.metrics.clear()},getMetricsSummary:()=>{let p={};for(let[d,f]of t.metrics.entries()){let m=f.length,g=a(d),h=Math.max(...f.map(b=>b.duration));p[d]={count:m,avgDuration:g,maxDuration:h}}return p}}};ji.createPerformanceMonitor=FE});var Vg=R(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.stroggerWithFileTransport=Hs.createFileTransportExample=void 0;var $i=Yt(),EE=(e={})=>{let t=e.level??$i.LogLevel.INFO,s=e.maxFileSize??10*1024*1024,n=e.rotationInterval??24*60*60*1e3,r=0,i=Date.now(),o=()=>r>=s||Date.now()-i>=n,a=async()=>{r=0,i=Date.now(),console.log("[MOCK FILE] Rotated log file")},c=async u=>{o()&&await a(),r+=u.length,console.log(`[MOCK FILE] Writing: ${u}`)};return{log:async u=>{if(u.level<t)return;let l=JSON.stringify(u);await c(l)},setLevel:u=>{t=u},getLevel:()=>t}};Hs.createFileTransportExample=EE;var RE=(0,$i.getEnvironment)(),wE=(0,$i.createJsonFormatter)(),IE=(0,Hs.createFileTransportExample)({maxFileSize:1024,rotationInterval:1e4});Hs.stroggerWithFileTransport=(0,$i.createLogger)({config:{serviceName:"file-rotation-example"},transports:[IE],formatter:wE,env:RE})});var Kg=R(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.loggerWithCloudWatchTransport=Vs.createCloudWatchTransportExample=void 0;var Ui=Yt(),TE=(e={})=>{let t=e.level??Ui.LogLevel.INFO,s=e.maxStreamSize??45*1024*1024,n=e.maxStreamAge??23*60*60*1e3,r=0,i=Date.now(),o=()=>r>=s||Date.now()-i>=n,a=async()=>{r=0,i=Date.now(),console.log("[MOCK CW] Rotated log stream")},c=async u=>{o()&&await a(),r+=u.length,console.log(`[MOCK CW] Sending: ${u}`)};return{log:async u=>{if(u.level<t)return;let l=JSON.stringify(u);await c(l)},setLevel:u=>{t=u},getLevel:()=>t}};Vs.createCloudWatchTransportExample=TE;var kE=(0,Ui.getEnvironment)(),_E=(0,Ui.createJsonFormatter)(),LE=(0,Vs.createCloudWatchTransportExample)({maxStreamSize:1024,maxStreamAge:1e4});Vs.loggerWithCloudWatchTransport=(0,Ui.createLogger)({config:{serviceName:"cloudwatch-rotation-example"},transports:[LE],formatter:_E,env:kE})});var sh=R((Ge,th)=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.demonstrateEnvironmentSpecificFileTransport=Ge.demonstrateCustomFileTransport=Ge.demonstrateMultipleFileTransports=Ge.demonstrateFileTransportWithSymlink=Ge.demonstrateCompressedFileTransport=Ge.demonstrateBasicFileTransport=Ge.runFileTransportExamples=void 0;var fe=Yt(),Zg=()=>{console.log(`=== Basic File Transport ===
12
12
  `);let e=(0,fe.getEnvironment)(),t=(0,fe.createJsonFormatter)(),s=(0,fe.createFileTransport)({level:fe.LogLevel.INFO,filePath:"./logs/basic-app.log",maxFileSize:5*1024*1024,maxFiles:3}),n=(0,fe.createLogger)({config:{serviceName:"basic-file-example",stage:e.stage},transports:[s],formatter:t,env:e});return n.info("Application started with basic file transport"),n.warn("This is a warning message"),n.error("This is an error message",{userId:"user-123"}),n};Ge.demonstrateBasicFileTransport=Zg;var Yg=()=>{console.log(`
13
13
  === File Transport with Compression ===
14
14
  `);let e=(0,fe.getEnvironment)(),t=(0,fe.createJsonFormatter)(),s=(0,fe.createFileTransport)({level:fe.LogLevel.DEBUG,filePath:"./logs/compressed-app.log",maxFileSize:10*1024*1024,maxFiles:5,compressOldFiles:!0,rotationInterval:12*60*60*1e3}),n=(0,fe.createLogger)({config:{serviceName:"compressed-file-example",stage:e.stage},transports:[s],formatter:t,env:e});return n.info("Application started with compressed file transport"),n.debug("Debug message with compression enabled"),n.warn("Warning message",{component:"file-transport"}),n};Ge.demonstrateCompressedFileTransport=Yg;var Jg=()=>{console.log(`
@@ -75,16 +75,16 @@ ${JSON.stringify(J)}`}).join(`
75
75
  `).reduce(function(r,i){return YD(i)>r?YD(i):r},0)}function Or(e,t){return Array(t+1).join(e)}function _I(e,t,s,n){let r=jt(e);if(t+1>=r){let i=t-r;switch(n){case"right":{e=Or(s,i)+e;break}case"center":{let o=Math.ceil(i/2),a=i-o;e=Or(s,a)+e+Or(s,o);break}default:{e=e+Or(s,i);break}}}return e}var $n={};function Br(e,t,s){t="\x1B["+t+"m",s="\x1B["+s+"m",$n[t]={set:e,to:!0},$n[s]={set:e,to:!1},$n[e]={on:t,off:s}}Br("bold",1,22);Br("italics",3,23);Br("underline",4,24);Br("inverse",7,27);Br("strikethrough",9,29);function JD(e,t){let s=t[1]?parseInt(t[1].split(";")[0]):0;if(s>=30&&s<=39||s>=90&&s<=97){e.lastForegroundAdded=t[0];return}if(s>=40&&s<=49||s>=100&&s<=107){e.lastBackgroundAdded=t[0];return}if(s===0){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&delete e[r];return}let n=$n[t[0]];n&&(e[n.set]=n.to)}function LI(e){let t=Do(!0),s=t.exec(e),n={};for(;s!==null;)JD(n,s),s=t.exec(e);return n}function QD(e,t){let s=e.lastBackgroundAdded,n=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(r){e[r]&&(t+=$n[r].off)}),s&&s!="\x1B[49m"&&(t+="\x1B[49m"),n&&n!="\x1B[39m"&&(t+="\x1B[39m"),t}function PI(e,t){let s=e.lastBackgroundAdded,n=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(r){e[r]&&(t=$n[r].on+t)}),s&&s!="\x1B[49m"&&(t=s+t),n&&n!="\x1B[39m"&&(t=n+t),t}function OI(e,t){if(e.length===jt(e))return e.substr(0,t);for(;jt(e)>t;)e=e.slice(0,-1);return e}function BI(e,t){let s=Do(!0),n=e.split(Do()),r=0,i=0,o="",a,c={};for(;i<t;){a=s.exec(e);let u=n[r];if(r++,i+jt(u)>t&&(u=OI(u,t-i)),o+=u,i+=jt(u),i<t){if(!a)break;o+=a[0],JD(c,a)}}return QD(c,o)}function MI(e,t,s){if(s=s||"\u2026",jt(e)<=t)return e;t-=jt(s);let r=BI(e,t);r+=s;let i="\x1B]8;;\x07";return e.includes(i)&&!r.includes(i)&&(r+=i),r}function NI(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function WI(e,t){e=e||{},t=t||NI();let s=Object.assign({},t,e);return s.chars=Object.assign({},t.chars,e.chars),s.style=Object.assign({},t.style,e.style),s}function jI(e,t){let s=[],n=t.split(/(\s+)/g),r=[],i=0,o;for(let a=0;a<n.length;a+=2){let c=n[a],u=i+jt(c);i>0&&o&&(u+=o.length),u>e?(i!==0&&s.push(r.join("")),r=[c],i=jt(c)):(r.push(o||"",c),i=u),o=n[a+1]}return i&&s.push(r.join("")),s}function $I(e,t){let s=[],n="";function r(o,a){for(n.length&&a&&(n+=a),n+=o;n.length>e;)s.push(n.slice(0,e)),n=n.slice(e)}let i=t.split(/(\s+)/g);for(let o=0;o<i.length;o+=2)r(i[o],o&&i[o-1]);return n.length&&s.push(n),s}function UI(e,t,s=!0){let n=[];t=t.split(`
76
76
  `);let r=s?jI:$I;for(let i=0;i<t.length;i++)n.push.apply(n,r(e,t[i]));return n}function GI(e){let t={},s=[];for(let n=0;n<e.length;n++){let r=PI(t,e[n]);t=LI(r);let i=Object.assign({},t);s.push(QD(i,r))}return s}function zI(e,t){let s="\x1B]",n="\x07",r=";";return[s,"8",r,r,e||t,n,t,s,"8",r,r,n].join("")}XD.exports={strlen:jt,repeat:Or,pad:_I,truncate:MI,mergeOptions:WI,wordWrap:UI,colorizeLines:GI,hyperlink:zI}});var nb=R((A8,sb)=>{var tb={};sb.exports=tb;var eb={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(eb).forEach(function(e){var t=eb[e],s=tb[e]=[];s.open="\x1B["+t[0]+"m",s.close="\x1B["+t[1]+"m"})});var ib=R((F8,rb)=>{"use strict";rb.exports=function(e,t){t=t||process.argv;var s=t.indexOf("--"),n=/^-{1,2}/.test(e)?"":"--",r=t.indexOf(n+e);return r!==-1&&(s===-1?!0:r<s)}});var ab=R((E8,ob)=>{"use strict";var qI=require("os"),kt=ib(),Ze=process.env,Un=void 0;kt("no-color")||kt("no-colors")||kt("color=false")?Un=!1:(kt("color")||kt("colors")||kt("color=true")||kt("color=always"))&&(Un=!0);"FORCE_COLOR"in Ze&&(Un=Ze.FORCE_COLOR.length===0||parseInt(Ze.FORCE_COLOR,10)!==0);function HI(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function VI(e){if(Un===!1)return 0;if(kt("color=16m")||kt("color=full")||kt("color=truecolor"))return 3;if(kt("color=256"))return 2;if(e&&!e.isTTY&&Un!==!0)return 0;var t=Un?1:0;if(process.platform==="win32"){var s=qI.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in Ze)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(r){return r in Ze})||Ze.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ze.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Ze){var n=parseInt((Ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ze.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ze.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Ze.TERM)||"COLORTERM"in Ze?1:(Ze.TERM==="dumb",t)}function yu(e){var t=VI(e);return HI(t)}ob.exports={supportsColor:yu,stdout:yu(process.stdout),stderr:yu(process.stderr)}});var ub=R((R8,cb)=>{cb.exports=function(t,s){var n="";t=t||"Run the trap, drop the bass",t=t.split("");var r={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return t.forEach(function(i){i=i.toLowerCase();var o=r[i]||[" "],a=Math.floor(Math.random()*o.length);typeof r[i]<"u"?n+=r[i][a]:n+=i}),n}});var pb=R((w8,lb)=>{lb.exports=function(t,s){t=t||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},r=[].concat(n.up,n.down,n.mid);function i(c){var u=Math.floor(Math.random()*c);return u}function o(c){var u=!1;return r.filter(function(l){u=l===c}),u}function a(c,u){var l="",p,d;u=u||{},u.up=typeof u.up<"u"?u.up:!0,u.mid=typeof u.mid<"u"?u.mid:!0,u.down=typeof u.down<"u"?u.down:!0,u.size=typeof u.size<"u"?u.size:"maxi",c=c.split("");for(d in c)if(!o(d)){switch(l=l+c[d],p={up:0,down:0,mid:0},u.size){case"mini":p.up=i(8),p.mid=i(2),p.down=i(8);break;case"maxi":p.up=i(16)+3,p.mid=i(4)+1,p.down=i(64)+3;break;default:p.up=i(8)+1,p.mid=i(6)/2,p.down=i(8)+1;break}var f=["up","mid","down"];for(var m in f)for(var g=f[m],h=0;h<=p[g];h++)u[g]&&(l=l+n[g][i(n[g].length)])}return l}return a(t,s)}});var mb=R((I8,db)=>{db.exports=function(e){return function(t,s,n){if(t===" ")return t;switch(s%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}});var gb=R((T8,fb)=>{fb.exports=function(e){return function(t,s,n){return s%2===0?t:e.inverse(t)}}});var yb=R((k8,hb)=>{hb.exports=function(e){var t=["red","yellow","green","blue","magenta"];return function(s,n,r){return s===" "?s:e[t[n++%t.length]](s)}}});var bb=R((_8,Db)=>{Db.exports=function(e){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(s,n,r){return s===" "?s:e[t[Math.round(Math.random()*(t.length-2))]](s)}}});var Fb=R((P8,Ab)=>{var ue={};Ab.exports=ue;ue.themes={};var KI=require("util"),Js=ue.styles=nb(),Sb=Object.defineProperties,ZI=new RegExp(/[\r\n]+/g);ue.supportsColor=ab().supportsColor;typeof ue.enabled>"u"&&(ue.enabled=ue.supportsColor()!==!1);ue.enable=function(){ue.enabled=!0};ue.disable=function(){ue.enabled=!1};ue.stripColors=ue.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")};var L8=ue.stylize=function(t,s){if(!ue.enabled)return t+"";var n=Js[s];return!n&&s in ue?ue[s](t):n.open+t+n.close},YI=/[|\\{}()[\]^$+*?.]/g,JI=function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(YI,"\\$&")};function Cb(e){var t=function s(){return XI.apply(s,arguments)};return t._styles=e,t.__proto__=QI,t}var xb=function(){var e={};return Js.grey=Js.gray,Object.keys(Js).forEach(function(t){Js[t].closeRe=new RegExp(JI(Js[t].close),"g"),e[t]={get:function(){return Cb(this._styles.concat(t))}}}),e}(),QI=Sb(function(){},xb);function XI(){var e=Array.prototype.slice.call(arguments),t=e.map(function(o){return o!=null&&o.constructor===String?o:KI.inspect(o)}).join(" ");if(!ue.enabled||!t)return t;for(var s=t.indexOf(`
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
- `))}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(`
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 b=0;g.forEach(function(y){y.y=h,y.x=h?e(m,b):b;let S=y.rowSpan||1,D=y.colSpan||1;if(S>1)for(let E=0;E<D;E++)m[y.x+E]=S;b=y.x+D}),Object.keys(m).forEach(y=>{m[y]--,m[y]<1&&delete m[y]})})}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),b=m.y,y=m.y-1+(m.rowSpan||1),S=!(g>y||b>h),D=f.x,E=f.x-1+(f.colSpan||1),T=m.x,k=m.x-1+(m.colSpan||1),C=!(D>k||T>E);return S&&C}function i(f,m,g){let h=Math.min(f.length-1,g),b={x:m,y:g};for(let y=0;y<=h;y++){let S=f[y];for(let D=0;D<S.length;D++)if(r(b,S[D]))return!0}return!1}function o(f,m,g,h){for(let b=g;b<h;b++)if(i(f,b,m))return!1;return!0}function a(f){f.forEach(function(m,g){m.forEach(function(h){for(let b=1;b<h.rowSpan;b++){let y=new uT(h);y.x=h.x,y.y=h.y+b,y.colSpan=h.colSpan,u(y,f[g+b])}})})}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 b=g[h];for(let y=1;y<b.colSpan;y++){let S=new cT;S.x=b.x+y,S.y=b.y,g.splice(h+1,0,S)}}}}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 b=0;b<g;b++)if(!i(f,b,h)){let y={x:b,y:h,colSpan:1,rowSpan:1};for(b++;b<g&&!i(f,b,h);)y.colSpan++,b++;let S=h+1;for(;S<m&&o(f,S,y.x,y.x+y.colSpan);)y.rowSpan++,S++;let D=new vu(y);D.x=y.x,D.y=y.y,oT(`Missing cell at ${D.y}-${D.x}.`),u(D,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.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(`
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.4",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 b=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,"[]"))&&(b=v.toArray(m)))return g=cd(g),b.forEach(function(S,D){!(v.isUndefined(S)||S===null)&&t.append(o===!0?ad([g],D,i):o===null?g:g+"[]",u(S))}),!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(b,y){(!(v.isUndefined(b)||b===null)&&r.call(t,b,v.isString(y)?y.trim():y,g,d))===!0&&f(b,g?g.concat(y):[y])}),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
- `)}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
- `,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 :
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,b=o,y,S=0;if(i){let D=Date.now();(!r.ts||(S=D-r.ts)>=a)&&(r.ts=D,y=u-r.bytes,r.bytes=y<0?-y:0,S=0),y=u-r.bytes}if(i){if(y<=0)return setTimeout(()=>{m(null,f)},a-S);y<b&&(b=y)}b&&g>b&&g-b>l&&(h=f.subarray(b),f=f.subarray(0,b)),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
+ `,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 b=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 y=new cm.EventEmitter;function S(G){try{y.emit("abort",!G||G.type?new nt(null,t,h):G)}catch(W){console.warn("emit error",W)}}y.once("abort",r);let D=()=>{t.cancelToken&&t.cancelToken.unsubscribe(S),t.signal&&t.signal.removeEventListener("abort",S),y.removeAllListeners()};(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(S),t.signal&&(t.signal.aborted?S():t.signal.addEventListener("abort",S))),i((G,W)=>{if(m=!0,W){g=!0,D();return}let{data:se}=G;if(se instanceof Ut.default.Readable||se instanceof Ut.default.Duplex){let Ee=Ut.default.finished(se,()=>{Ee(),D()})}else D()});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 C=we.from(t.headers).normalize();C.set("User-Agent","axios/"+xs,!1);let{onUploadProgress:$,onDownloadProgress:K}=t,J=t.maxRate,V,Z;if(v.isSpecCompliantForm(o)){let G=C.getContentType(/boundary=([-_\w\d]{10,70})/i);o=Vd(o,W=>{C.set(W)},{tag:`axios-${xs}-boundary`,boundary:G&&G[1]||void 0})}else if(v.isFormData(o)&&v.isFunction(o.getHeaders)){if(C.set(o.getHeaders()),!C.hasContentLength())try{let G=await Ba.default.promisify(o.getLength).call(o);Number.isFinite(G)&&G>=0&&C.setContentLength(G)}catch{}}else if(v.isBlob(o)||v.isFile(o))o.size&&C.setContentType(o.type||"application/octet-stream"),C.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(C.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(C.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&&C.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)}C.set("Accept-Encoding","gzip, compress, deflate"+(em?", br":""),!1);let B={path:_,method:f,headers:C.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,b?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(),S(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)})}y.once("abort",ge=>{De.destroyed||(De.emit("error",ge),De.destroy())})}),y.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)){S(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),S(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&&S(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 b(){if(!h)return;let S=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:S,config:e,request:h};Pt(function(k){s(k),g()},function(k){n(k),g()},E),h=null}"onloadend"in h?h.onloadend=b:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(b)},h.onabort=function(){h&&(n(new N("Request aborted",N.ECONNABORTED,e,h)),h=null)},h.onerror=function(D){let E=D&&D.message?D.message:"Network Error",T=new N(E,N.ERR_NETWORK,e,h);T.event=D||null,n(T),h=null},h.ontimeout=function(){let D=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",E=r.transitional||cn;r.timeoutErrorMessage&&(D=r.timeoutErrorMessage),n(new N(D,E.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,e,h)),h=null},i===void 0&&o.setContentType(null),"setRequestHeader"in h&&v.forEach(o.toJSON(),function(D,E){h.setRequestHeader(E,D)}),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=S=>{h&&(n(!S||S.type?new nt(null,e,h):S),h.abort(),h=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));let y=or(r.url);if(y&&he.protocols.indexOf(y)===-1){n(new N("Unsupported protocol "+y+":",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 b=g&&g[m];if(b)return b.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:b,signal:y,cancelToken:S,timeout:D,onDownloadProgress:E,onUploadProgress:T,responseType:k,headers:C,withCredentials:$="same-origin",fetchOptions:K}=mi(m),J=t||fetch;k=k?(k+"").toLowerCase():"text";let V=gm([y,S&&S.toAbortSignal()],D),Z=null,O=V&&V.unsubscribe&&(()=>{V.unsubscribe()}),I;try{if(T&&u&&h!=="get"&&h!=="head"&&(I=await f(C,b))!==0){let W=new s(g,{method:"POST",body:b,duplex:"half"}),se;if(v.isFormData(b)&&(se=W.headers.get("content-type"))&&C.setContentType(se),W.body){let[Ee,De]=gn(I,$t(hn(T)));b=Ma(W.body,hm,Ee,De)}}v.isString($)||($=$?"include":"omit");let _=i&&"credentials"in s.prototype,B={...K,signal:V,method:h.toUpperCase(),headers:C.normalize().toJSON(),body:b,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 :
84
84
  `+o.map(vm).join(`
85
85
  `):" "+vm(o[0]):"as no adapter specified";throw new N("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r}var gi={getAdapter:C0,adapters:Wa};function ja(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nt(null,e)}function hi(e){return ja(e),e.headers=we.from(e.headers),e.data=er.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),gi.getAdapter(e.adapter||un.adapter,e)(e).then(function(n){return ja(e),n.data=er.call(e,e.transformResponse,n),n.headers=we.from(n.headers),n},function(n){return tr(n)||(ja(e),n&&n.response&&(n.response.data=er.call(e,e.transformResponse,n.response),n.response.headers=we.from(n.response.headers))),Promise.reject(n)})}var yi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{yi[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var Sm={};yi.transitional=function(t,s,n){function r(i,o){return"[Axios v"+xs+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,a)=>{if(t===!1)throw new N(r(o," has been removed"+(s?" in "+s:"")),N.ERR_DEPRECATED);return s&&!Sm[o]&&(Sm[o]=!0,console.warn(r(o," has been deprecated since v"+s+" and will be removed in the near future"))),t?t(i,o,a):!0}};yi.spelling=function(t){return(s,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function x0(e,t,s){if(typeof e!="object")throw new N("options must be an object",N.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),r=n.length;for(;r-- >0;){let i=n[r],o=t[i];if(o){let a=e[i],c=a===void 0||o(a,i,e);if(c!==!0)throw new N("option "+i+" must be "+c,N.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new N("Unknown option "+i,N.ERR_BAD_OPTION)}}var cr={assertOptions:x0,validators:yi};var Ot=cr.validators,yn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ta,response:new ta}}async request(t,s){try{return await this._request(t,s)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;let i=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
86
- `+i):n.stack=i}catch{}}throw n}}_request(t,s){typeof t=="string"?(s=s||{},s.url=t):s=t||{},s=At(this.defaults,s);let{transitional:n,paramsSerializer:r,headers:i}=s;n!==void 0&&cr.assertOptions(n,{silentJSONParsing:Ot.transitional(Ot.boolean),forcedJSONParsing:Ot.transitional(Ot.boolean),clarifyTimeoutError:Ot.transitional(Ot.boolean)},!1),r!=null&&(v.isFunction(r)?s.paramsSerializer={serialize:r}:cr.assertOptions(r,{encode:Ot.function,serialize:Ot.function},!0)),s.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?s.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:s.allowAbsoluteUrls=!0),cr.assertOptions(s,{baseUrl:Ot.spelling("baseURL"),withXsrfToken:Ot.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let o=i&&v.merge(i.common,i[s.method]);i&&v.forEach(["delete","get","head","post","put","patch","common"],m=>{delete i[m]}),s.headers=we.concat(o,i);let a=[],c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(s)===!1||(c=c&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});let u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let l,p=0,d;if(!c){let m=[hi.bind(this),void 0];for(m.unshift(...a),m.push(...u),d=m.length,l=Promise.resolve(s);p<d;)l=l.then(m[p++],m[p++]);return l}d=a.length;let f=s;for(;p<d;){let m=a[p++],g=a[p++];try{f=m(f)}catch(h){g.call(this,h);break}}try{l=hi.call(this,f)}catch(m){return Promise.reject(m)}for(p=0,d=u.length;p<d;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=At(this.defaults,t);let s=bs(t.baseURL,t.url,t.allowAbsoluteUrls);return Ds(s,t.params,t.paramsSerializer)}};v.forEach(["delete","get","head","options"],function(t){yn.prototype[t]=function(s,n){return this.request(At(n||{},{method:t,url:s,data:(n||{}).data}))}});v.forEach(["post","put","patch"],function(t){function s(n){return function(i,o,a){return this.request(At(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}yn.prototype[t]=s(),yn.prototype[t+"Form"]=s(!0)});var ur=yn;var $a=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(i){s=i});let n=this;this.promise.then(r=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](r);n._listeners=null}),this.promise.then=r=>{let i,o=new Promise(a=>{n.subscribe(a),i=a}).then(r);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,a){n.reason||(n.reason=new nt(i,o,a),s(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let s=this._listeners.indexOf(t);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){let t=new AbortController,s=n=>{t.abort(n)};return this.subscribe(s),t.signal.unsubscribe=()=>this.unsubscribe(s),t.signal}static source(){let t;return{token:new e(function(r){t=r}),cancel:t}}},Cm=$a;function Ua(e){return function(s){return e.apply(null,s)}}function Ga(e){return v.isObject(e)&&e.isAxiosError===!0}var za={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(za).forEach(([e,t])=>{za[t]=e});var xm=za;function Am(e){let t=new ur(e),s=qn(ur.prototype.request,t);return v.extend(s,ur.prototype,t,{allOwnKeys:!0}),v.extend(s,t,null,{allOwnKeys:!0}),s.create=function(r){return Am(At(e,r))},s}var Le=Am(un);Le.Axios=ur;Le.CanceledError=nt;Le.CancelToken=Cm;Le.isCancel=tr;Le.VERSION=xs;Le.toFormData=ss;Le.AxiosError=N;Le.Cancel=Le.CanceledError;Le.all=function(t){return Promise.all(t)};Le.spread=Ua;Le.isAxiosError=Ga;Le.mergeConfig=At;Le.AxiosHeaders=we;Le.formToJSON=e=>oi(v.isHTMLForm(e)?new FormData(e):e);Le.getAdapter=gi.getAdapter;Le.HttpStatusCode=xm;Le.default=Le;var zt=Le;var{Axios:sO,AxiosError:nO,CanceledError:rO,isCancel:iO,CancelToken:oO,VERSION:aO,all:cO,Cancel:uO,isAxiosError:lO,spread:pO,toFormData:dO,AxiosHeaders:mO,HttpStatusCode:fO,formToJSON:gO,getAdapter:hO,mergeConfig:yO}=zt;var Di=require("node:fs"),lr=require("node:path");function Fm(){let e=require.resolve("@aws-solutions-constructs/core/package.json"),t=(0,lr.dirname)((0,lr.dirname)(e));return(0,Di.readdirSync)(t).filter(s=>s!=="core"&&s.startsWith("aws-")&&(0,Di.statSync)((0,lr.join)(t,s)).isDirectory())}var Em={"aws-apigateway-dynamodb":{className:"ApiGatewayToDynamoDB",packageName:"aws-apigateway-dynamodb",friendlyName:"Api Gateway To Dynamo DB",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigateway-dynamodb/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigateway-dynamodb",requiredResourceTypes:["AWS::DynamoDB::Table","AWS::Logs::LogGroup","AWS::ApiGateway::RestApi","AWS::ApiGateway::Deployment","AWS::ApiGateway::Stage","AWS::ApiGateway::Resource","AWS::ApiGateway::Method","AWS::ApiGateway::UsagePlan","AWS::IAM::Role","AWS::ApiGateway::Account","AWS::IAM::Policy"]},"aws-apigateway-kinesisstreams":{className:"ApiGatewayToKinesisStreams",packageName:"aws-apigateway-kinesisstreams",friendlyName:"Api Gateway To Kinesis Streams",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigateway-kinesisstreams/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigateway-kinesisstreams",requiredResourceTypes:["AWS::Logs::LogGroup","AWS::ApiGateway::RestApi","AWS::ApiGateway::Deployment","AWS::ApiGateway::Stage","AWS::ApiGateway::Resource","AWS::ApiGateway::Method","AWS::ApiGateway::UsagePlan","AWS::ApiGateway::RequestValidator","AWS::ApiGateway::Model","AWS::IAM::Role","AWS::ApiGateway::Account","AWS::IAM::Policy","AWS::CloudWatch::Alarm","AWS::Kinesis::Stream"]},"aws-apigateway-lambda":{className:"ApiGatewayToLambda",packageName:"aws-apigateway-lambda",friendlyName:"Api Gateway To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigateway-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigateway-lambda",requiredResourceTypes:["AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function","AWS::Logs::LogGroup","AWS::ApiGateway::RestApi","AWS::ApiGateway::Deployment","AWS::ApiGateway::Stage","AWS::ApiGateway::Resource","AWS::Lambda::Permission","AWS::ApiGateway::Method","AWS::ApiGateway::UsagePlan","AWS::ApiGateway::Account"]},"aws-apigateway-sqs":{className:"ApiGatewayToSqs",packageName:"aws-apigateway-sqs",friendlyName:"Api Gateway To Sqs",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigateway-sqs/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigateway-sqs",requiredResourceTypes:["AWS::SQS::Queue","AWS::SQS::QueuePolicy","AWS::Logs::LogGroup","AWS::ApiGateway::RestApi","AWS::ApiGateway::Deployment","AWS::ApiGateway::Stage","AWS::ApiGateway::Method","AWS::ApiGateway::UsagePlan","AWS::IAM::Role","AWS::ApiGateway::Account","AWS::IAM::Policy"]},"aws-apigatewayv2websocket-sqs":{className:"ApiGatewayV2WebSocketToSqs",packageName:"aws-apigatewayv2websocket-sqs",friendlyName:"Api Gateway V2 Web Socket To Sqs",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigatewayv2websocket-sqs/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigatewayv2websocket-sqs",requiredResourceTypes:["AWS::SQS::Queue","AWS::SQS::QueuePolicy","AWS::IAM::Role","AWS::IAM::Policy","AWS::ApiGatewayV2::Api","AWS::ApiGatewayV2::Integration","AWS::ApiGatewayV2::Route","AWS::ApiGatewayV2::Stage","AWS::Logs::LogGroup"]},"aws-cloudfront-apigateway-lambda":{className:"CloudFrontToApiGatewayToLambda",packageName:"aws-cloudfront-apigateway-lambda",friendlyName:"Cloud Front To Api Gateway To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-cloudfront-apigateway-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-cloudfront-apigateway-lambda",requiredResourceTypes:["AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function","AWS::Logs::LogGroup","AWS::ApiGateway::RestApi","AWS::ApiGateway::Deployment","AWS::ApiGateway::Stage","AWS::ApiGateway::Resource","AWS::Lambda::Permission","AWS::ApiGateway::Method","AWS::ApiGateway::UsagePlan","AWS::ApiGateway::Account","AWS::CloudFront::Function","AWS::S3::Bucket","AWS::S3::BucketPolicy","AWS::CloudFront::Distribution"]},"aws-cloudfront-mediastore":{className:"CloudFrontToMediaStore",packageName:"aws-cloudfront-mediastore",friendlyName:"Cloud Front To Media Store",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-cloudfront-mediastore/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-cloudfront-mediastore",requiredResourceTypes:["AWS::CloudFront::CloudFrontOriginAccessIdentity","AWS::MediaStore::Container","AWS::S3::Bucket","AWS::S3::BucketPolicy","AWS::CloudFront::OriginRequestPolicy","AWS::CloudFront::Function","AWS::CloudFront::Distribution"]},"aws-cloudfront-oai-s3":{className:"CloudFrontToOaiToS3",packageName:"aws-cloudfront-oai-s3",friendlyName:"Cloud Front To Oai To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-cloudfront-oai-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-cloudfront-oai-s3",requiredResourceTypes:["AWS::S3::Bucket","AWS::S3::BucketPolicy","AWS::CloudFront::Function","AWS::CloudFront::CloudFrontOriginAccessIdentity","AWS::CloudFront::Distribution"]},"aws-cloudfront-s3":{className:"CloudFrontToS3",packageName:"aws-cloudfront-s3",friendlyName:"Cloud Front To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-cloudfront-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-cloudfront-s3",requiredResourceTypes:["AWS::S3::Bucket","AWS::S3::BucketPolicy","AWS::CloudFront::Function","AWS::CloudFront::OriginAccessControl","AWS::CloudFront::Distribution"]},"aws-cognito-apigateway-lambda":{className:"CognitoToApiGatewayToLambda",packageName:"aws-cognito-apigateway-lambda",friendlyName:"Cognito To Api Gateway To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-cognito-apigateway-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-cognito-apigateway-lambda",requiredResourceTypes:["AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function","AWS::Logs::LogGroup","AWS::ApiGateway::RestApi","AWS::ApiGateway::Deployment","AWS::ApiGateway::Stage","AWS::ApiGateway::Resource","AWS::Lambda::Permission","AWS::ApiGateway::Method","AWS::ApiGateway::UsagePlan","AWS::ApiGateway::Account","AWS::Cognito::UserPool","AWS::Cognito::UserPoolClient","AWS::ApiGateway::Authorizer"]},"aws-dynamodbstreams-lambda":{className:"DynamoDBStreamsToLambda",packageName:"aws-dynamodbstreams-lambda",friendlyName:"Dynamo DBStreams To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-dynamodbstreams-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-dynamodbstreams-lambda",requiredResourceTypes:["AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function","AWS::Lambda::EventSourceMapping","AWS::DynamoDB::Table","AWS::SQS::Queue","AWS::SQS::QueuePolicy"]},"aws-kinesisfirehose-s3":{className:"KinesisFirehoseToS3",packageName:"aws-kinesisfirehose-s3",friendlyName:"Kinesis Firehose To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-kinesisfirehose-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-kinesisfirehose-s3",requiredResourceTypes:["AWS::S3::Bucket","AWS::S3::BucketPolicy","AWS::Logs::LogGroup","AWS::Logs::LogStream","AWS::IAM::Role","AWS::IAM::Policy","AWS::KinesisFirehose::DeliveryStream"]},"aws-kinesisstreams-kinesisfirehose-s3":{className:"KinesisStreamsToKinesisFirehoseToS3",packageName:"aws-kinesisstreams-kinesisfirehose-s3",friendlyName:"Kinesis Streams To Kinesis Firehose To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-kinesisstreams-kinesisfirehose-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-kinesisstreams-kinesisfirehose-s3",requiredResourceTypes:["AWS::Kinesis::Stream","AWS::S3::Bucket","AWS::S3::BucketPolicy","AWS::Logs::LogGroup","AWS::Logs::LogStream","AWS::IAM::Role","AWS::IAM::Policy","AWS::KinesisFirehose::DeliveryStream","AWS::CloudWatch::Alarm"]},"aws-s3-lambda":{className:"S3ToLambda",packageName:"aws-s3-lambda",friendlyName:"S3 To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-s3-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-s3-lambda",requiredResourceTypes:["AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function","AWS::S3::Bucket","AWS::S3::BucketPolicy","Custom::S3BucketNotifications","AWS::Lambda::Permission"]},"aws-s3-sns":{className:"S3ToSns",packageName:"aws-s3-sns",friendlyName:"S3 To Sns",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-s3-sns/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-s3-sns",requiredResourceTypes:["AWS::S3::Bucket","AWS::S3::BucketPolicy","Custom::S3BucketNotifications","AWS::KMS::Key","AWS::SNS::Topic","AWS::SNS::TopicPolicy","AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function"]},"aws-s3-sqs":{className:"S3ToSqs",packageName:"aws-s3-sqs",friendlyName:"S3 To Sqs",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-s3-sqs/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-s3-sqs",requiredResourceTypes:["AWS::S3::Bucket","AWS::S3::BucketPolicy","Custom::S3BucketNotifications","AWS::SQS::Queue","AWS::SQS::QueuePolicy","AWS::KMS::Key","AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function"]},"aws-sns-lambda":{className:"SnsToLambda",packageName:"aws-sns-lambda",friendlyName:"Sns To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-sns-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-sns-lambda",requiredResourceTypes:["AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function","AWS::Lambda::Permission","AWS::SNS::Subscription","AWS::SNS::Topic","AWS::SNS::TopicPolicy"]},"aws-sns-sqs":{className:"SnsToSqs",packageName:"aws-sns-sqs",friendlyName:"Sns To Sqs",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-sns-sqs/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-sns-sqs",requiredResourceTypes:["AWS::SNS::Topic","AWS::SNS::TopicPolicy","AWS::SQS::Queue","AWS::SQS::QueuePolicy","AWS::SNS::Subscription","AWS::KMS::Key"]},"aws-eventbridge-kinesisstreams":{className:"EventbridgeToKinesisStreams",packageName:"aws-eventbridge-kinesisstreams",friendlyName:"EventBridge To Kinesis Streams",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-eventbridge-kinesisstreams/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-eventbridge-kinesisstreams",requiredResourceTypes:["AWS::Events::Rule","AWS::Kinesis::Stream"]},"aws-eventbridge-sns":{className:"EventbridgeToSns",packageName:"aws-eventbridge-sns",friendlyName:"EventBridge To SNS",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-eventbridge-sns/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-eventbridge-sns",requiredResourceTypes:["AWS::Events::Rule","AWS::SNS::Topic"]},"aws-eventbridge-sqs":{className:"EventbridgeToSqs",packageName:"aws-eventbridge-sqs",friendlyName:"EventBridge To SQS",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-eventbridge-sqs/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-eventbridge-sqs",requiredResourceTypes:["AWS::Events::Rule","AWS::SQS::Queue"]},"aws-eventbridge-stepfunctions":{className:"EventbridgeToStepfunctions",packageName:"aws-eventbridge-stepfunctions",friendlyName:"EventBridge To StepFunctions",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-eventbridge-stepfunctions/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-eventbridge-stepfunctions",requiredResourceTypes:["AWS::Events::Rule","AWS::StepFunctions::StateMachine"]},"aws-alb-fargate":{className:"AlbToFargate",packageName:"aws-alb-fargate",friendlyName:"ALB To Fargate",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-alb-fargate/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-alb-fargate",requiredResourceTypes:["AWS::ElasticLoadBalancingV2::LoadBalancer","AWS::ElasticLoadBalancingV2::Listener","AWS::ECS::Cluster","AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::IAM::Role","AWS::Logs::LogGroup"]},"aws-alb-lambda":{className:"AlbToLambda",packageName:"aws-alb-lambda",friendlyName:"ALB To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-alb-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-alb-lambda",requiredResourceTypes:["AWS::ElasticLoadBalancingV2::LoadBalancer","AWS::ElasticLoadBalancingV2::Listener","AWS::Lambda::Function","AWS::IAM::Role","AWS::Logs::LogGroup"]},"aws-apigateway-iot":{className:"ApiGatewayToIot",packageName:"aws-apigateway-iot",friendlyName:"API Gateway To IoT",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigateway-iot/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigateway-iot",requiredResourceTypes:["AWS::ApiGateway::RestApi","AWS::ApiGateway::Resource","AWS::ApiGateway::Method","AWS::IoT::TopicRule"]},"aws-apigateway-sagemakerendpoint":{className:"ApiGatewayToSagemakerendpoint",packageName:"aws-apigateway-sagemakerendpoint",friendlyName:"API Gateway To SageMaker Endpoint",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigateway-sagemakerendpoint/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigateway-sagemakerendpoint",requiredResourceTypes:["AWS::ApiGateway::RestApi","AWS::ApiGateway::Integration","AWS::SageMaker::Endpoint"]},"aws-cloudfront-apigateway":{className:"CloudFrontToApiGateway",packageName:"aws-cloudfront-apigateway",friendlyName:"CloudFront To API Gateway",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-cloudfront-apigateway/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-cloudfront-apigateway",requiredResourceTypes:["AWS::CloudFront::Distribution","AWS::ApiGateway::RestApi","AWS::ApiGateway::Method"]},"aws-dynamodbstreams-lambda-elasticsearch-kibana":{className:"DynamoDBStreamsToLambdaElasticsearchKibana",packageName:"aws-dynamodbstreams-lambda-elasticsearch-kibana",friendlyName:"DynamoDB Streams To Lambda Elasticsearch Kibana",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-dynamodbstreams-lambda-elasticsearch-kibana/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-dynamodbstreams-lambda-elasticsearch-kibana",requiredResourceTypes:["AWS::DynamoDB::Stream","AWS::Lambda::Function","AWS::Elasticsearch::Domain","AWS::IAM::Role","AWS::Logs::LogGroup"]},"aws-dynamodbstreams-pipes-stepfunctions":{className:"DynamoDBStreamsToPipesStepfunctions",packageName:"aws-dynamodbstreams-pipes-stepfunctions",friendlyName:"DynamoDB Streams To Pipes StepFunctions",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-dynamodbstreams-pipes-stepfunctions/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-dynamodbstreams-pipes-stepfunctions",requiredResourceTypes:["AWS::DynamoDB::Stream","AWS::StepFunctions::StateMachine"]},"aws-eventbridge-kinesisfirehose-s3":{className:"EventbridgeToKinesisfirehoseToS3",packageName:"aws-eventbridge-kinesisfirehose-s3",friendlyName:"EventBridge To Kinesis Firehose To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-eventbridge-kinesisfirehose-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-eventbridge-kinesisfirehose-s3",requiredResourceTypes:["AWS::Events::Rule","AWS::KinesisFirehose::DeliveryStream","AWS::S3::Bucket"]},"aws-eventbridge-lambda":{className:"EventbridgeToLambda",packageName:"aws-eventbridge-lambda",friendlyName:"EventBridge To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-eventbridge-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-eventbridge-lambda",requiredResourceTypes:["AWS::Events::Rule","AWS::Lambda::Function","AWS::IAM::Role"]},"aws-fargate-dynamodb":{className:"FargateToDynamodb",packageName:"aws-fargate-dynamodb",friendlyName:"Fargate To DynamoDB",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-dynamodb/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-dynamodb",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::DynamoDB::Table"]},"aws-fargate-eventbridge":{className:"FargateToEventbridge",packageName:"aws-fargate-eventbridge",friendlyName:"Fargate To EventBridge",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-eventbridge/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-eventbridge",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::Events::Rule"]},"aws-fargate-kinesisfirehose":{className:"FargateToKinesisfirehose",packageName:"aws-fargate-kinesisfirehose",friendlyName:"Fargate To Kinesis Firehose",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-kinesisfirehose/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-kinesisfirehose",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::KinesisFirehose::DeliveryStream"]},"aws-fargate-kinesisstreams":{className:"FargateToKinesisstreams",packageName:"aws-fargate-kinesisstreams",friendlyName:"Fargate To Kinesis Streams",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-kinesisstreams/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-kinesisstreams",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::Kinesis::Stream"]},"aws-fargate-opensearch":{className:"FargateToOpensearch",packageName:"aws-fargate-opensearch",friendlyName:"Fargate To OpenSearch",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-opensearch/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-opensearch",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::OpenSearch::Domain"]},"aws-fargate-s3":{className:"FargateToS3",packageName:"aws-fargate-s3",friendlyName:"Fargate To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-s3",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::S3::Bucket"]},"aws-fargate-secretsmanager":{className:"FargateToSecretsmanager",packageName:"aws-fargate-secretsmanager",friendlyName:"Fargate To SecretsManager",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-secretsmanager/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-secretsmanager",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::SecretsManager::Secret"]},"aws-fargate-sns":{className:"FargateToSns",packageName:"aws-fargate-sns",friendlyName:"Fargate To SNS",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-sns/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-sns",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::SNS::Topic"]},"aws-fargate-sqs":{className:"FargateToSqs",packageName:"aws-fargate-sqs",friendlyName:"Fargate To SQS",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-sqs/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-sqs",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::SQS::Queue"]},"aws-fargate-ssmstringparameter":{className:"FargateToSsmstringparameter",packageName:"aws-fargate-ssmstringparameter",friendlyName:"Fargate To SSM String Parameter",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-ssmstringparameter/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-ssmstringparameter",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::SSM::StringParameter"]},"aws-fargate-stepfunctions":{className:"FargateToStepfunctions",packageName:"aws-fargate-stepfunctions",friendlyName:"Fargate To StepFunctions",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-stepfunctions/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-stepfunctions",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::StepFunctions::StateMachine"]},"aws-iot-kinesisfirehose-s3":{className:"IotToKinesisfirehoseToS3",packageName:"aws-iot-kinesisfirehose-s3",friendlyName:"IoT To Kinesis Firehose To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-iot-kinesisfirehose-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-iot-kinesisfirehose-s3",requiredResourceTypes:["AWS::IoT::TopicRule","AWS::KinesisFirehose::DeliveryStream","AWS::S3::Bucket"]},"aws-iot-kinesisstreams":{className:"IotToKinesisstreams",packageName:"aws-iot-kinesisstreams",friendlyName:"IoT To Kinesis Streams",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-iot-kinesisstreams/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-iot-kinesisstreams",requiredResourceTypes:["AWS::IoT::TopicRule","AWS::Kinesis::Stream"]},"aws-iot-lambda":{className:"IotToLambda",packageName:"aws-iot-lambda",friendlyName:"IoT To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-iot-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-iot-lambda",requiredResourceTypes:["AWS::IoT::TopicRule","AWS::Lambda::Function","AWS::IAM::Role"]}};var Rm=async e=>{let t={};for(let s of e)try{let n=await import(`@aws-solutions-constructs/${s}`),r=Object.keys(n).find(u=>/^[A-Z][a-zA-Z0-9]*To[A-Z][a-zA-Z0-9]*$/.test(u));if(!r)continue;let i=`https://docs.aws.amazon.com/solutions/latest/${s}/`,o=`https://github.com/awslabs/aws-solutions-constructs/tree/main/${s}`,c=Em[s]?.requiredResourceTypes||[];t[s]={className:r,packageName:s,friendlyName:r.replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim(),documentationUrl:i,githubUrl:o,requiredResourceTypes:c}}catch{}return t};var F=(e,t)=>e.Metadata?.["aws:cdk:path"]??t;var wm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::ApiGateway::RestApi"&&!r.Properties?.EndpointConfiguration?.Types?.includes("PRIVATE")&&(s[n]={issues:[t(n,"API Gateway is publicly accessible.","Use PRIVATE endpoints to restrict access.","HIGH","Security",F(r,n),"cdkInsights")]}),s),{});var Im=(e,t)=>Object.entries(e.Resources||{}).some(([,n])=>n.Type==="AWS::CloudTrail::Trail")?{}:{Global:{issues:[t("Global","CloudTrail is not enabled for logging.","Enable AWS CloudTrail to capture API activity and improve security monitoring.","HIGH","Security","Global","cdkInsights")]}};var Dn=(e,t)=>{let s=[];if(e==null)return s;if(typeof e=="string"){let n=e.matchAll(/\$\{([^.}]+)(?:\.[^}]+)?\}/g);for(let r of n){let i=r[1];t.has(i)&&s.push(i)}return s}if(Array.isArray(e)){for(let n of e)s.push(...Dn(n,t));return s}if(typeof e=="object"){let n=e;if("Ref"in n&&typeof n.Ref=="string"&&t.has(n.Ref)&&s.push(n.Ref),"Fn::GetAtt"in n){let r=n["Fn::GetAtt"];if(Array.isArray(r)&&typeof r[0]=="string")t.has(r[0])&&s.push(r[0]);else if(typeof r=="string"){let i=r.split(".")[0];t.has(i)&&s.push(i)}}if("Fn::Sub"in n){let r=n["Fn::Sub"];Array.isArray(r)?(s.push(...Dn(r[0],t)),r[1]&&typeof r[1]=="object"&&s.push(...Dn(r[1],t))):s.push(...Dn(r,t))}for(let[r,i]of Object.entries(n))["Ref","Fn::GetAtt","Fn::Sub"].includes(r)||s.push(...Dn(i,t))}return s},A0=e=>e.DependsOn?Array.isArray(e.DependsOn)?e.DependsOn:[e.DependsOn]:[],F0=(e,t)=>{if(t.length===0)return;let s=new Set(t.map(i=>i.type.split("::")[2]||i.type)),n=Array.from(s).slice(0,3),r=e.split("::")[2]||e;if(e.includes("SecurityGroup"))return`Security group attached to: ${n.join(", ")}`;if(e.includes("IAM::Role"))return`IAM role assumed by: ${n.join(", ")}`;if(e.includes("VPC")||e.includes("Subnet"))return`Network hosting: ${n.join(", ")}`;if(e.includes("KMS::Key"))return`Encryption key used by: ${n.join(", ")}`;if(e.includes("S3::Bucket")){if(n.some(i=>i.includes("Lambda")))return"S3 bucket accessed by Lambda functions";if(n.some(i=>i.includes("CloudFront")))return"S3 bucket serving as CloudFront origin"}if(e.includes("DynamoDB::Table")&&n.some(i=>i.includes("Lambda")))return"DynamoDB table accessed by Lambda functions";if(t.length>0)return`Referenced by ${t.length} resource${t.length>1?"s":""}: ${n.join(", ")}`},Fs=e=>{let t=new Set(Object.keys(e)),s={};for(let n of t)s[n]={dependencies:[],dependents:[]};for(let[n,r]of Object.entries(e)){let i=A0(r),o=Dn(r.Properties,t),a=[...new Set([...i,...o])];s[n].dependencies=a;for(let c of a)s[c]&&s[c].dependents.push(n)}for(let[n,r]of Object.entries(e)){let i=s[n],o=i.dependents.map(a=>({id:a,type:e[a]?.Type||"Unknown"}));i.usageDescription=F0(r.Type,o)}return s},qa=(e,t,s)=>{let n=t[e];if(!n)return{dependencies:[],dependents:[]};let r=n.dependencies.map(o=>{let a=s[o]?.Type?.split("::")[2]||o;return`${o} (${a})`}),i=n.dependents.map(o=>{let a=s[o]?.Type?.split("::")[2]||o;return`${o} (${a})`});return{dependencies:r,dependents:i,usageDescription:n.usageDescription}};var E0=(e,t,s)=>{let n={};for(let[r,i]of Object.entries(e)){if(i.Type!=="AWS::Lambda::Function")continue;let o=i.Properties||{};if(!!(o.DeadLetterConfig?.TargetArn||o.DeadLetterConfig?.TargetArn))continue;let c=t[r];if(!c)continue;c.dependencies.some(l=>{let p=e[l];return p?.Type==="AWS::DynamoDB::Table"||p?.Type==="AWS::DynamoDB::GlobalTable"})&&(n[r]||(n[r]={issues:[]}),n[r].issues.push(s(r,"Lambda function interacting with DynamoDB has no Dead Letter Queue configured","Configure a Dead Letter Queue (DLQ) using SQS or SNS to capture failed invocations. This ensures no data is lost when the function fails to process DynamoDB events or write operations.","MEDIUM","Reliability",i.Metadata?.["aws:cdk:path"]||r,"cdkInsights")))}return n},R0=(e,t,s)=>{let n={},r=new Set(["AWS::RDS::DBInstance","AWS::RDS::DBCluster","AWS::ElastiCache::CacheCluster","AWS::ElastiCache::ReplicationGroup","AWS::Redshift::Cluster","AWS::OpenSearchService::Domain","AWS::Elasticsearch::Domain","AWS::ECS::Service"]),i=new Set(Object.entries(e).filter(([,o])=>r.has(o.Type)).map(([o])=>o));for(let[o,a]of Object.entries(e)){if(a.Type!=="AWS::Lambda::Function")continue;let c=a.Properties||{},u=!!(c.VpcConfig&&(c.VpcConfig.SubnetIds||c.VpcConfig.SecurityGroupIds)),l=t[o];if(!l)continue;if(l.dependencies.some(d=>i.has(d))&&!u){n[o]||(n[o]={issues:[]});let d=l.dependencies.filter(f=>i.has(f));n[o].issues.push(s(o,`Lambda function references VPC resources (${d.join(", ")}) but is not VPC-enabled`,"Configure VpcConfig with appropriate SubnetIds and SecurityGroupIds to allow the Lambda function to connect to VPC resources. Without VPC configuration, the function cannot reach private resources like RDS databases.","HIGH","Reliability",a.Metadata?.["aws:cdk:path"]||o,"cdkInsights"))}}return n},w0=(e,t)=>{let s={},n=new Map;for(let[r,i]of Object.entries(e)){if(i.Type!=="AWS::S3::Bucket")continue;let o=i.Properties||{},a=!!(o.BucketEncryption||o.ServerSideEncryptionConfiguration);n.set(r,a)}for(let[r,i]of Object.entries(e)){if(i.Type!=="AWS::S3::Bucket")continue;let a=(i.Properties||{}).ReplicationConfiguration;if(!a)continue;let c=n.get(r),u=a.Rules;if(!(!u||!Array.isArray(u)))for(let l of u){if(l.Status!=="Enabled")continue;let p=l.Destination;if(!p||!p.Bucket)continue;let f=p.EncryptionConfiguration;c&&!f&&(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,"S3 replication configured without encryption configuration for replicated objects","Specify EncryptionConfiguration in the replication rule to ensure replicated objects maintain encryption. Use ReplicaKmsKeyID to specify the KMS key for encrypting replicated objects in the destination bucket.","MEDIUM","Security",i.Metadata?.["aws:cdk:path"]||r,"cdkInsights")))}}return s},I0=(e,t,s)=>{let n={},r=new Set([80,443,8080,8443]);for(let[i,o]of Object.entries(e)){if(o.Type!=="AWS::EC2::SecurityGroup")continue;let c=(o.Properties||{}).SecurityGroupIngress||[],u=t[i];if(!(u&&u.dependents.length>0))continue;let p=[];for(let d of c){let f=d.CidrIp,m=d.CidrIpv6,g=d.FromPort,h=d.ToPort;if(!(f==="0.0.0.0/0"||m==="::/0")||g===void 0)continue;let D=h!==void 0&&h!==g,A=!r.has(g);(D||A)&&p.push(g)}if(p.length>0){n[i]||(n[i]={issues:[]});let d=u.dependents.map(f=>e[f]?.Type?.split("::")[2]||"Unknown").join(", ");n[i].issues.push(s(i,`Security group used by ${d} has public access on non-standard ports: ${p.join(", ")}`,"Restrict ingress rules to specific CIDR blocks or reference other security groups instead of allowing 0.0.0.0/0 on non-standard ports. Consider using a bastion host or VPN for administrative access.","HIGH","Security",o.Metadata?.["aws:cdk:path"]||i,"cdkInsights"))}}return n},bi=(e,t)=>{let s=e.Resources||{},n=Fs(s),r={},i=[E0(s,n,t),R0(s,n,t),w0(s,t),I0(s,n,t)];for(let o of i)for(let[a,c]of Object.entries(o))r[a]||(r[a]={issues:[]}),r[a].issues.push(...c.issues);return r};var T0=e=>{let t=[],s=Object.values(e).map(S=>S.Type),n={};for(let S of s)n[S]=(n[S]||0)+1;let r=s.some(S=>S==="AWS::Lambda::Function"),i=s.some(S=>S==="AWS::ApiGateway::RestApi"||S==="AWS::ApiGatewayV2::Api"),o=s.some(S=>S==="AWS::DynamoDB::Table"),a=s.some(S=>S==="AWS::S3::Bucket");r&&(o||a)&&!s.some(S=>S.includes("ECS")||S.includes("EC2::Instance"))&&t.push("serverless");let c=s.some(S=>S==="AWS::ECS::Service"||S==="AWS::ECS::TaskDefinition"||S==="AWS::ECS::Cluster"),u=s.some(S=>S.startsWith("AWS::EKS::"));(c||u)&&t.push("container-based");let l=s.some(S=>S.startsWith("AWS::Events::")),p=s.some(S=>S==="AWS::SNS::Topic"),d=s.some(S=>S==="AWS::SQS::Queue"),f=s.some(S=>S.startsWith("AWS::Kinesis::")),m=s.some(S=>S.startsWith("AWS::StepFunctions::"));(l||p||d||f||m)&&r&&t.push("event-driven"),i&&t.push("api-gateway");let g=s.some(S=>S.startsWith("AWS::Glue::")),h=s.some(S=>S.startsWith("AWS::Athena::")),y=s.some(S=>S.startsWith("AWS::EMR::"));(f||g||h||y)&&t.push("data-processing");let D=s.some(S=>S==="AWS::CloudFront::Distribution");a&&D&&!r&&!c&&t.push("static-website");let A=n["AWS::Lambda::Function"]||0,b=n["AWS::ECS::Service"]||0;(A>=3||b>=2)&&t.push("microservices");let E=s.some(S=>S==="AWS::EC2::Instance"),T=s.some(S=>S==="AWS::RDS::DBInstance"||S==="AWS::RDS::DBCluster"),k=s.some(S=>S==="AWS::ElasticLoadBalancingV2::LoadBalancer");return E&&(T||k)&&t.push("traditional"),t},k0=(e,t)=>{let s={},n=Object.values(e).map(l=>l.Type),r=n.some(l=>l==="AWS::CloudWatch::Alarm"),i=n.some(l=>l==="AWS::Lambda::Function"),o=n.some(l=>l==="AWS::ECS::Service"),a=n.some(l=>l==="AWS::RDS::DBInstance"||l==="AWS::RDS::DBCluster");(i||o||a)&&!r&&(s["Stack Architecture"]={issues:[t("Stack Architecture","No CloudWatch Alarms defined for critical resources","Add CloudWatch Alarms to monitor key metrics like Lambda errors, ECS task failures, or RDS connections. Consider using CDK's built-in alarm methods or aws-cdk-lib/aws-cloudwatch.","MEDIUM","Operational Excellence","Stack Architecture","cdkInsights")]});let c=n.some(l=>l==="AWS::XRay::Group"||l==="AWS::XRay::SamplingRule");return n.filter(l=>l==="AWS::Lambda::Function").length>=3&&!c&&(s["Stack Architecture"]||(s["Stack Architecture"]={issues:[]}),s["Stack Architecture"].issues.push(t("Stack Architecture","Multiple Lambda functions without X-Ray tracing configuration","Enable X-Ray tracing for your Lambda functions to gain visibility into distributed request flows and identify performance bottlenecks. Set tracing: lambda.Tracing.ACTIVE on your functions.","LOW","Operational Excellence","Stack Architecture","cdkInsights"))),s},_0=(e,t)=>{let s={},n=Object.values(e).map(d=>d.Type),r=n.some(d=>d==="AWS::ApiGateway::RestApi"||d==="AWS::ApiGatewayV2::Api"),i=n.some(d=>d==="AWS::ElasticLoadBalancingV2::LoadBalancer"),o=n.some(d=>d==="AWS::CloudFront::Distribution"),a=n.some(d=>d==="AWS::WAFv2::WebACL"||d==="AWS::WAF::WebACL");(r||i||o)&&!a&&(s["Stack Architecture"]||(s["Stack Architecture"]={issues:[]}),s["Stack Architecture"].issues.push(t("Stack Architecture","Public-facing resources without WAF protection","Consider adding AWS WAF to protect your API Gateway, ALB, or CloudFront distribution from common web exploits. WAF can help prevent SQL injection, XSS, and rate-limit malicious traffic.","MEDIUM","Security","Stack Architecture","cdkInsights")));let c=n.some(d=>d==="AWS::SecretsManager::Secret"),u=n.some(d=>d==="AWS::SSM::Parameter"),l=n.some(d=>d==="AWS::RDS::DBInstance"||d==="AWS::RDS::DBCluster"),p=!1;for(let[d,f]of Object.entries(e))if(f.Type==="AWS::Lambda::Function"){let m=f.Properties?.Environment?.Variables;if(m){let g=["PASSWORD","SECRET","API_KEY","TOKEN","CREDENTIAL"];for(let h of Object.keys(m))if(g.some(y=>h.toUpperCase().includes(y))){let y=m[h];if(typeof y=="string"&&!y.startsWith("{{")){p=!0;break}}}}return l&&!c&&!u&&(s["Stack Architecture"]||(s["Stack Architecture"]={issues:[]}),s["Stack Architecture"].issues.push(t("Stack Architecture","RDS database without Secrets Manager for credential rotation","Use AWS Secrets Manager to store and automatically rotate database credentials. This improves security by eliminating hardcoded passwords and enabling automatic credential rotation.","HIGH","Security","Stack Architecture","cdkInsights"))),s},L0=(e,t)=>{let s={},n=Object.values(e).filter(u=>u.Type==="AWS::EC2::NatGateway").length;n>=3&&(s["Stack Architecture"]||(s["Stack Architecture"]={issues:[]}),s["Stack Architecture"].issues.push(t("Stack Architecture",`${n} NAT Gateways detected - potential cost optimization`,"Multiple NAT Gateways can be expensive ($32/month each + data processing). Consider if all are necessary, or explore alternatives like NAT instances for dev environments, or VPC endpoints for AWS services.","MEDIUM","Cost Optimization","Stack Architecture","cdkInsights")));let r=n>0,i=Object.values(e).some(u=>u.Type==="AWS::EC2::VPCEndpoint"),o=Object.values(e).some(u=>{if(u.Type!=="AWS::Lambda::Function")return!1;let l=u.Properties?.VpcConfig;return l?.SubnetIds||l?.SecurityGroupIds}),a=Object.values(e).some(u=>u.Type==="AWS::S3::Bucket"),c=Object.values(e).some(u=>u.Type==="AWS::DynamoDB::Table");return o&&r&&!i&&(a||c)&&(s["Stack Architecture"]||(s["Stack Architecture"]={issues:[]}),s["Stack Architecture"].issues.push(t("Stack Architecture","VPC Lambda functions accessing AWS services through NAT Gateway","Consider using VPC Endpoints (Gateway endpoints for S3/DynamoDB are free) instead of routing AWS service traffic through NAT Gateway. This reduces costs and improves latency.","LOW","Cost Optimization","Stack Architecture","cdkInsights"))),s},P0=(e,t,s)=>{let n={};for(let[r,i]of Object.entries(t)){let o=e[r];if(!o)continue;let a=i.dependents.length;if(a>=5){let c=o.Type.split("::")[2]||o.Type;n["Stack Architecture"]||(n["Stack Architecture"]={issues:[]}),n["Stack Architecture"].issues.push(s("Stack Architecture",`${c} (${r}) is a potential single point of failure with ${a} dependent resources`,"Consider adding redundancy or failover mechanisms for this critical resource. For databases, consider Multi-AZ. For queues, consider dead-letter queues. For Lambda, ensure proper error handling.","MEDIUM","Reliability","Stack Architecture","cdkInsights"))}}for(let[r,i]of Object.entries(e)){if(i.Type!=="AWS::DynamoDB::Table")continue;if(i.Properties?.PointInTimeRecoverySpecification?.PointInTimeRecoveryEnabled!==!0){let a=t[r];a&&a.dependents.length>=3&&(n["Stack Architecture"]||(n["Stack Architecture"]={issues:[]}),n["Stack Architecture"].issues.push(s("Stack Architecture",`Critical DynamoDB table ${r} has ${a.dependents.length} dependents but no point-in-time recovery`,"Enable Point-in-Time Recovery (PITR) for critical DynamoDB tables used by multiple resources. This provides continuous backups with 35-day retention.","HIGH","Reliability","Stack Architecture","cdkInsights")))}}return n},vi=(e,t)=>{let s=e.Resources||{};if(Object.keys(s).length<3)return{};let r=Fs(s),i=T0(s),o={},a=[k0(s,t),_0(s,t),L0(s,t),P0(s,r,t)];for(let c of a)for(let[u,l]of Object.entries(c))o[u]||(o[u]={issues:[]}),o[u].issues.push(...l.issues);return o};var Tm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::CloudFront::Distribution")return s;let i=F(r,n);return r.Properties?.DistributionConfig?.DefaultCacheBehavior?.ViewerProtocolPolicy==="allow-all"&&(s[n]={issues:[t(n,"CloudFront distribution allows HTTP traffic (ViewerProtocolPolicy is allow-all).",'Set ViewerProtocolPolicy to "https-only" or "redirect-to-https" to enforce HTTPS and protect data in transit.',"HIGH","Security",i,"cdkInsights")]}),s},{});var km=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::CloudFront::Distribution")return s;let i=F(r,n);return r.Properties?.DistributionConfig?.WebACLId||(s[n]={issues:[t(n,"CloudFront distribution has no WAF WebACL associated.","Associate a WAF WebACL to protect against common web exploits, SQL injection, XSS, and DDoS attacks.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var _m=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::CloudFront::Distribution")return s;let i=F(r,n);return r.Properties?.DistributionConfig?.Logging?.Bucket||(s[n]={issues:[t(n,"CloudFront distribution does not have access logging enabled.","Enable access logging to an S3 bucket to track viewer requests for security analysis, auditing, and troubleshooting.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var O0=["SSLv3","TLSv1","TLSv1_2016","TLSv1.1_2016"],Lm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::CloudFront::Distribution")return s;let i=F(r,n),a=r.Properties?.DistributionConfig?.ViewerCertificate,c=a?.MinimumProtocolVersion;return a?.CloudFrontDefaultCertificate||c&&O0.includes(c)&&(s[n]={issues:[t(n,`CloudFront distribution uses outdated TLS version (${c}).`,"Use TLSv1.2_2021 or later for improved security. Older TLS versions have known vulnerabilities.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var Pm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Cognito::UserPool")return s;let i=[],o=F(r,n),a=r.Properties?.PasswordPolicy;if(!a)i.push(t(n,"Cognito User Pool has no password policy configured.","Configure a strong password policy with minimum length, uppercase, lowercase, numbers, and symbols requirements.","HIGH","Security",o,"cdkInsights"));else{let c=a.MinimumLength||8;c<12&&i.push(t(n,`Cognito password policy has minimum length of ${c} characters.`,"Set MinimumLength to at least 12 characters for stronger security against brute-force attacks.","MEDIUM","Security",o,"cdkInsights")),a.RequireSymbols===!1&&i.push(t(n,"Cognito password policy does not require symbols.","Enable RequireSymbols for stronger password complexity requirements.","LOW","Security",o,"cdkInsights"))}return i.length>0&&(s[n]={issues:i}),s},{});var Om=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Cognito::UserPool")return s;let i=F(r,n),o=r.Properties?.MfaConfiguration;return(!o||o==="OFF")&&(s[n]={issues:[t(n,"Cognito User Pool has MFA disabled.","Enable MFA (OPTIONAL or ON) to add an extra layer of security for user authentication.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var Bm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Cognito::UserPool")return s;let i=F(r,n),o=r.Properties?.UserPoolAddOns?.AdvancedSecurityMode;return(!o||o==="OFF")&&(s[n]={issues:[t(n,"Cognito User Pool does not have advanced security features enabled.","Enable UserPoolAddOns with AdvancedSecurityMode set to AUDIT or ENFORCED to detect compromised credentials and block suspicious sign-ins.","LOW","Security",i,"cdkInsights")]}),s},{});var Mm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::DynamoDB::Table")return s;let i=r.Properties?.BillingMode,o=F(r,n);return(!i||i==="PROVISIONED")&&(s[n]={issues:[t(n,"DynamoDB table uses provisioned capacity without on-demand billing.","Consider using BillingMode: PAY_PER_REQUEST for automatic scaling and cost optimization, especially for unpredictable workloads. For predictable workloads, configure Application Auto Scaling.","MEDIUM","Cost Optimization",o,"cdkInsights")]}),s},{});var Nm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::DynamoDB::Table"&&!r.Properties?.StreamSpecification&&(s[n]={issues:[t(n,"DynamoDB table does not have streams enabled.","Consider enabling DynamoDB Streams to capture item-level changes for analytics, auditing, event-driven architectures, and cross-region replication.","LOW","Operational Excellence",F(r,n),"cdkInsights")]}),s),{});var Wm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::EC2::Volume")return s;let i=[],o=F(r,n),a=r.Properties??{};return a.Encrypted!==!0&&i.push(t(n,"EBS Volume is not encrypted.","Enable encryption on EBS volumes to protect data at rest. Use the Encrypted property and optionally specify a KmsKeyId.","HIGH","Security",o,"cdkInsights")),a.VolumeType==="gp2"&&i.push(t(n,"EBS Volume uses gp2 storage type.","Consider migrating to gp3 for up to 20% cost savings with better baseline performance (3,000 IOPS and 125 MB/s throughput).","MEDIUM","Cost Optimization",o,"cdkInsights")),i.length>0&&(s[n]={issues:i}),s},{});var jm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::EC2::Instance"&&r.Properties?.InstanceType?.toString().startsWith("t2")&&(s[n]={issues:[t(n,"EC2 instance is using an older t2 instance. Consider upgrading to t3 for better performance and cost savings.","Upgrade to a t3 instance for improved performance, lower latency, and better cost efficiency.","MEDIUM","Cost Optimization",F(r,n),"cdkInsights")]}),s),{});var $m=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::EC2::NatGateway"&&(s[n]={issues:[t(n,"NAT Gateway detected. NAT Gateways incur hourly charges (~$0.045/hr) plus data processing fees (~$0.045/GB).","Consider alternatives like NAT instances for lower traffic, VPC endpoints for AWS services, or IPv6 egress-only internet gateways to reduce costs.","LOW","Cost Optimization",F(r,n),"cdkInsights")]}),s),{});var B0=[22,3389,3306,5432,1433,27017,6379],M0=e=>e.CidrIp==="0.0.0.0/0"||e.CidrIpv6==="::/0",N0=(e,t,s)=>t===void 0||s===void 0?!1:e>=t&&e<=s,Um=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::EC2::SecurityGroup")return s;let i=[],o=F(r,n),a=r.Properties?.SecurityGroupIngress||[],c=r.Properties?.SecurityGroupEgress||[],u=a.some(d=>d.CidrIp==="0.0.0.0/0"),l=a.some(d=>d.CidrIpv6==="::/0");u&&i.push(t(n,"Security Group allows unrestricted IPv4 ingress (0.0.0.0/0).","Restrict security group rules to specific IPs and ports.","HIGH","Security",o,"cdkInsights")),l&&i.push(t(n,"Security Group allows unrestricted IPv6 ingress (::/0).","Restrict security group rules to specific IPs and ports.","HIGH","Security",o,"cdkInsights"));for(let d of a)if(M0(d)){for(let f of B0)if(N0(f,d.FromPort,d.ToPort)){i.push(t(n,`Security Group exposes port ${f} to the internet.`,"Restrict access to management and database ports. Use bastion hosts, VPN, or AWS Systems Manager Session Manager instead.","CRITICAL","Security",o,"cdkInsights"));break}}return c.some(d=>d.CidrIp==="0.0.0.0/0")&&i.push(t(n,"Security Group allows unrestricted egress to 0.0.0.0/0.","Consider restricting egress rules to specific destinations for defense in depth.","LOW","Security",o,"cdkInsights")),a.length===0&&c.length===0&&i.push(t(n,"Security Group has no ingress or egress rules defined.","Review if this security group is in use. Empty security groups may indicate orphaned resources or misconfiguration.","LOW","Operational Excellence",o,"cdkInsights")),i.length>0&&(s[n]={issues:i}),s},{});var W0=/(^|_)(secret|password|passwd|pwd|credential|private_key|api_key|api_secret|auth_token|access_key|access_secret|bearer_token|jwt_secret|encryption_key|signing_key)(_|$)/i,Gm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ECS::TaskDefinition")return s;let i=[],o=F(r,n),a=r.Properties?.ContainerDefinitions||[];for(let c of a){let u=c.Environment||[];for(let l of u)W0.test(l.Name||"")&&i.push(t(n,`ECS task definition has sensitive environment variable "${l.Name}" in plaintext.`,'Use AWS Secrets Manager or SSM Parameter Store with the "secrets" property instead of plaintext environment variables.',"HIGH","Security",o,"cdkInsights"))}return i.length>0&&(s[n]={issues:i}),s},{});var zm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ECS::TaskDefinition")return s;let i=[],o=F(r,n),a=r.Properties?.ContainerDefinitions||[];for(let c of a)c.LogConfiguration?.LogDriver||i.push(t(n,`ECS container "${c.Name||"unnamed"}" has no logging configuration.`,"Configure LogConfiguration with awslogs driver to send container logs to CloudWatch for monitoring and debugging.","MEDIUM","Operational Excellence",o,"cdkInsights"));return i.length>0&&(s[n]={issues:i}),s},{});var qm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ECS::TaskDefinition")return s;let i=[],o=F(r,n),a=r.Properties?.ContainerDefinitions||[];for(let c of a){let u=c.Memory||c.MemoryReservation,l=c.Cpu;!u&&!l&&i.push(t(n,`ECS container "${c.Name||"unnamed"}" has no CPU or memory limits defined.`,"Define CPU and Memory limits to prevent runaway containers and ensure predictable resource allocation.","LOW","Reliability",o,"cdkInsights"))}return i.length>0&&(s[n]={issues:i}),s},{});var Hm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElasticLoadBalancingV2::LoadBalancer")return s;let i=F(r,n);return(r.Properties?.LoadBalancerAttributes||[]).some(c=>c.Key==="deletion_protection.enabled"&&c.Value==="true")||(s[n]={issues:[t(n,"Load Balancer does not have deletion protection enabled.","Enable deletion protection to prevent accidental deletion of the load balancer in production environments.","MEDIUM","Reliability",i,"cdkInsights")]}),s},{});var Vm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElasticLoadBalancingV2::LoadBalancer")return s;let i=F(r,n);return(r.Properties?.LoadBalancerAttributes||[]).some(c=>c.Key==="access_logs.s3.enabled"&&c.Value==="true")||(s[n]={issues:[t(n,"Load Balancer does not have access logging enabled.","Enable access logging to S3 for security analysis, auditing, and troubleshooting of traffic patterns.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var Km=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElasticLoadBalancingV2::Listener")return s;let i=F(r,n),o=r.Properties?.Protocol,a=r.Properties?.Port;return o==="HTTP"&&a!==80?s[n]={issues:[t(n,`Load Balancer listener uses HTTP protocol on port ${a}.`,"Use HTTPS protocol with a valid SSL certificate to encrypt traffic in transit.","HIGH","Security",i,"cdkInsights")]}:o==="HTTP"&&a===80&&((r.Properties?.DefaultActions||[]).some(l=>l.Type==="redirect"&&l.RedirectConfig?.Protocol==="HTTPS")||(s[n]={issues:[t(n,"Load Balancer HTTP listener on port 80 does not redirect to HTTPS.","Configure the HTTP listener to redirect to HTTPS to ensure encrypted traffic.","MEDIUM","Security",i,"cdkInsights")]})),s},{});var j0=["ELBSecurityPolicy-2016-08","ELBSecurityPolicy-TLS-1-0-2015-04","ELBSecurityPolicy-TLS-1-1-2017-01","ELBSecurityPolicy-2015-05"],Zm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElasticLoadBalancingV2::Listener")return s;let i=F(r,n),o=r.Properties?.Protocol,a=r.Properties?.SslPolicy;return o!=="HTTPS"&&o!=="TLS"||a&&j0.includes(a)&&(s[n]={issues:[t(n,`Load Balancer listener uses outdated security policy (${a}).`,"Use ELBSecurityPolicy-TLS13-1-2-2021-06 or later for TLS 1.3 support, or at minimum ELBSecurityPolicy-TLS-1-2-2017-01 for TLS 1.2.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var Ym=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Events::Rule")return s;let i=F(r,n),o=[];return r.Properties?.State!=="ENABLED"&&o.push(t(n,"EventBridge rule is disabled or not explicitly enabled.","Ensure the EventBridge rule State is set to ENABLED to trigger events as expected.","MEDIUM","Operational Excellence",i,"cdkInsights")),(!r.Properties?.Targets||Array.isArray(r.Properties.Targets)&&r.Properties.Targets.length===0)&&o.push(t(n,"EventBridge rule has no targets configured. Events matching this rule will be silently dropped.","Add at least one target (Lambda, SQS, SNS, Step Functions, etc.) to process matched events. Without targets, the rule matches events but takes no action.","HIGH","Reliability",i,"cdkInsights")),o.length>0&&(s[n]={issues:[...s[n]?.issues||[],...o]}),s},{});var Jm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::IAM::Policy"&&r.Type!=="AWS::IAM::Role")return s;let i=r.Properties?.Policies,o=[];if(Array.isArray(i))for(let u of i)u?.PolicyDocument&&o.push(u.PolicyDocument);let a=r.Properties?.PolicyDocument;a&&o.push(a);let c=[];for(let u of o){if(!u?.Statement)continue;let l=u.Statement;for(let p of l)if(p.Effect==="Allow"){let d=p.Action,f=p.Resource,m=d==="*"||Array.isArray(d)&&d.includes("*"),g=f==="*"||Array.isArray(f)&&f.includes("*");m&&g?c.push(t(n,"IAM policy allows all actions (*) on all resources (*). This grants administrative access.","Restrict both actions and resources to follow the principle of least privilege.","CRITICAL","Security",n,"cdkInsights")):m?c.push(t(n,"IAM policy allows all actions (*). This is overly permissive.","Specify only the required actions instead of using wildcards.","CRITICAL","Security",n,"cdkInsights")):g&&c.push(t(n,"IAM policy allows actions on all resources (*). This is overly permissive.","Restrict resources to specific ARNs instead of using wildcards.","HIGH","Security",n,"cdkInsights"))}}return c.length>0&&(s[n]={issues:c}),s},{});var $0=[/\/ServiceRole\/Resource$/,/\/Role\/Resource$/,/\/InstanceRole\/Resource$/,/CustomResourceProvider\/Role$/],U0=e=>$0.some(t=>t.test(e)),Qm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::IAM::Role")return s;let i=F(r,n);return U0(i)||r.Properties?.PermissionsBoundary||(s[n]={issues:[t(n,"IAM Role has no permission boundary configured.","Consider using permission boundaries to limit the maximum permissions for delegated access and prevent privilege escalation.","LOW","Security",i,"cdkInsights")]}),s},{});var Xm=/^\d{12}$/,ef=/arn:aws:iam::(\d{12}):root/,G0=e=>{if(!e)return[];if(typeof e=="string"){if(Xm.test(e))return[e];let t=e.match(ef);return t?[t[1]]:[]}return typeof e=="object"&&e.AWS?(Array.isArray(e.AWS)?e.AWS:[e.AWS]).flatMap(s=>{if(Xm.test(s))return[s];let n=s.match(ef);return n?[n[1]]:[]}):[]},tf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::IAM::Role")return s;let i=[],o=F(r,n),a=r.Properties?.AssumeRolePolicyDocument;if(a?.Statement){for(let c of a.Statement)if(c.Effect==="Allow"){let u=G0(c.Principal);for(let l of u)i.push(t(n,`IAM Role allows cross-account trust from account ${l}.`,"Verify this cross-account trust relationship is intentional and the external account is trusted. Consider adding conditions to restrict access.","MEDIUM","Security",o,"cdkInsights"))}}return i.length>0&&(s[n]={issues:i}),s},{});var z0=e=>typeof e=="string"?e==="*":typeof e=="object"?Object.values(e).some(t=>Array.isArray(t)?t.includes("*"):t==="*"):!1,sf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>((r.Type==="AWS::KMS::Key"&&Array.isArray(r.Properties?.KeyPolicy?.Statement)?r.Properties.KeyPolicy.Statement:[]).some(a=>z0(a.Principal))&&(s[n]={issues:[t(n,"KMS key has a public policy.","Restrict the KMS key policy to specific IAM roles or users to prevent unauthorized access.","CRITICAL","Security",F(r,n),"cdkInsights")]}),s),{});var q0=/\b(secret|password|passwd|pwd|credential|private_key|api_key|api_secret|auth_token|access_key|access_secret|bearer_token|jwt_secret|encryption_key|signing_key)\b/i,nf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type==="AWS::Lambda::Function"){let i=Object.entries(r.Properties?.Environment?.Variables||{}).filter(([o])=>q0.test(o)).map(([o])=>t(n,`Lambda function contains sensitive environment variable: ${o}.`,"Store sensitive environment variables in AWS Secrets Manager or SSM Parameter Store instead of plaintext environment variables.","HIGH","Security",F(r,n),"cdkInsights"));i.length>0&&(s[n]={issues:i})}return s},{});var rf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type==="AWS::Lambda::Function"){let i=r.Properties?.MemorySize;typeof i=="number"&&i>1024&&(s[n]={issues:[t(n,"Lambda function has high memory allocation.","Consider reducing memory for cost savings.","MEDIUM","Cost Optimization",F(r,n),"cdkInsights")]})}return s},{});var of=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Lambda::Function")return s;let i=F(r,n);return r.Properties?.ReservedConcurrentExecutions===void 0&&(s[n]={issues:[t(n,"Lambda function has no reserved concurrency configured.","Consider setting ReservedConcurrentExecutions to prevent the function from consuming all available account concurrency and to control scaling behavior.","LOW","Reliability",i,"cdkInsights")]}),s},{});var af=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Lambda::Function")return s;let i=F(r,n);return r.Properties?.DeadLetterConfig?.TargetArn||(s[n]={issues:[t(n,"Lambda function has no Dead Letter Queue configured.","Configure a Dead Letter Queue (SQS or SNS) to capture failed async invocations for debugging, monitoring, and retry processing.","MEDIUM","Reliability",i,"cdkInsights")]}),s},{});var H0={nodejs:"nodejs22.x","nodejs4.3":"nodejs22.x","nodejs4.3-edge":"nodejs22.x","nodejs6.10":"nodejs22.x","nodejs8.10":"nodejs22.x","nodejs10.x":"nodejs22.x","nodejs12.x":"nodejs22.x","nodejs14.x":"nodejs22.x","nodejs16.x":"nodejs22.x","nodejs18.x":"nodejs22.x","python2.7":"python3.13","python3.6":"python3.13","python3.7":"python3.13","python3.8":"python3.13","python3.9":"python3.13",java8:"java21","java8.al2":"java21",java11:"java21","dotnetcore1.0":"dotnet8","dotnetcore2.0":"dotnet8","dotnetcore2.1":"dotnet8","dotnetcore3.1":"dotnet8","dotnet5.0":"dotnet8",dotnet6:"dotnet8","ruby2.5":"ruby3.3","ruby2.7":"ruby3.3","go1.x":"provided.al2023"},cf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Lambda::Function")return s;let i=r.Properties?.Runtime;if(typeof i!="string")return s;let o=H0[i];return o&&(s[n]={issues:[t(n,`Lambda function uses deprecated runtime "${i}". This runtime has reached or is approaching end-of-life and will no longer receive security patches.`,`Upgrade to "${o}" for continued security patches, performance improvements, and long-term support.`,"HIGH","Security",F(r,n),"cdkInsights")]}),s},{});var uf=(e,t)=>Object.values(e.Resources||{}).some(n=>n.Type==="AWS::EC2::NatGateway")?Object.entries(e.Resources||{}).reduce((n,[r,i])=>{if(i.Type!=="AWS::Lambda::Function")return n;let o=F(i,r),a=i.Properties?.VpcConfig;return a?.SubnetIds&&a.SubnetIds.length>0&&(n[r]={issues:[t(r,"Lambda function in VPC with NAT Gateway detected. NAT Gateway costs can accumulate quickly.","Evaluate if VPC attachment is necessary. Consider using VPC endpoints for AWS services to reduce NAT costs. NAT Gateway charges ~$0.045/hr plus $0.045/GB processed.","MEDIUM","Cost Optimization",o,"cdkInsights")]}),n},{}):{};var lf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::RDS::DBInstance"&&r.Properties?.StorageEncrypted!==!0&&(s[n]={issues:[t(n,"RDS instance is not encrypted.","Enable encryption to protect data at rest and meet compliance standards.","CRITICAL","Security",F(r,n),"cdkInsights")]}),s),{});var pf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::RDS::DBInstance")return s;let i=r.Properties??{},o=i.MultiAZ===!0,a=i.StorageType==="gp2",c=typeof i.StorageType>"u";return o&&(a||c)&&(s[n]={issues:[t(n,a?"RDS instance is using Multi-AZ with gp2 storage. Consider gp3 for lower costs.":"RDS instance is using Multi-AZ without explicitly setting a storage type. gp3 may offer better performance and cost savings.","Switch to gp3 storage for RDS to reduce costs and improve performance.","MEDIUM","Cost Optimization",F(r,n),"cdkInsights")]}),s},{});var df=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::RDS::DBInstance")return s;let i=F(r,n);return r.Properties?.PubliclyAccessible===!0&&(s[n]={issues:[t(n,"RDS instance is publicly accessible from the internet.","Set PubliclyAccessible to false and access the database through private subnets, bastion hosts, or VPN.","CRITICAL","Security",i,"cdkInsights")]}),s},{});var mf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::RDS::DBInstance")return s;let i=F(r,n),o=r.Properties?.BackupRetentionPeriod;return o===0?s[n]={issues:[t(n,"RDS instance has automated backups disabled (BackupRetentionPeriod is 0).","Enable automated backups with at least 7 days retention for production databases to enable point-in-time recovery.","HIGH","Reliability",i,"cdkInsights")]}:o!==void 0&&o<7&&(s[n]={issues:[t(n,`RDS backup retention period is only ${o} day(s).`,"Consider increasing backup retention to at least 7 days for production databases.","MEDIUM","Reliability",i,"cdkInsights")]}),s},{});var ff=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::RDS::DBInstance")return s;let i=F(r,n);return r.Properties?.DeletionProtection!==!0&&(s[n]={issues:[t(n,"RDS instance does not have deletion protection enabled.","Enable DeletionProtection to prevent accidental database deletion.","MEDIUM","Reliability",i,"cdkInsights")]}),s},{});var gf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::S3::Bucket")return s;let i=[],o=r.Properties??{},a=F(r,n);o.BucketEncryption||i.push(t(n,"S3 Bucket lacks encryption.","Enable encryption at rest for better security.","HIGH","Security",a,"cdkInsights"));let c=o?.PublicAccessBlockConfiguration;return c?(c.BlockPublicAcls===!1&&i.push(t(n,"S3 Bucket allows public ACLs (BlockPublicAcls is false).","Set BlockPublicAcls to true to prevent public ACLs from being applied.","CRITICAL","Security",a,"cdkInsights")),c.BlockPublicPolicy===!1&&i.push(t(n,"S3 Bucket allows public bucket policies (BlockPublicPolicy is false).","Set BlockPublicPolicy to true to prevent public bucket policies.","CRITICAL","Security",a,"cdkInsights")),c.IgnorePublicAcls===!1&&i.push(t(n,"S3 Bucket does not ignore public ACLs (IgnorePublicAcls is false).","Set IgnorePublicAcls to true to ignore any public ACLs on the bucket.","HIGH","Security",a,"cdkInsights")),c.RestrictPublicBuckets===!1&&i.push(t(n,"S3 Bucket does not restrict public bucket access (RestrictPublicBuckets is false).","Set RestrictPublicBuckets to true to restrict access to the bucket to only authorized users.","HIGH","Security",a,"cdkInsights"))):i.push(t(n,"S3 Bucket has no PublicAccessBlockConfiguration defined.","Configure PublicAccessBlockConfiguration with BlockPublicAcls, BlockPublicPolicy, IgnorePublicAcls, and RestrictPublicBuckets all set to true.","HIGH","Security",a,"cdkInsights")),o.VersioningConfiguration||i.push(t(n,"S3 Bucket has no versioning enabled.","Enable versioning to protect against accidental deletions.","MEDIUM","Operational Excellence",a,"cdkInsights")),i.length>0&&(s[n]={issues:i}),s},{});var hf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::S3::Bucket"&&!r.Properties?.IntelligentTieringConfigurations&&(s[n]={issues:[t(n,"S3 Bucket does not use Intelligent-Tiering. Consider enabling it for cost optimization.","Enable Intelligent-Tiering for automatic cost optimization of infrequently accessed objects.","LOW","Cost Optimization",F(r,n),"cdkInsights")]}),s),{});var yf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::S3::Bucket")return s;let i=F(r,n);return(r.Properties?.LifecycleConfiguration?.Rules||[]).length===0&&(s[n]={issues:[t(n,"S3 bucket has no lifecycle policy configured.","Configure lifecycle rules to automatically transition objects to cheaper storage classes (e.g., Glacier) or delete old versions to optimize storage costs.","MEDIUM","Cost Optimization",i,"cdkInsights")]}),s},{});var V0=/\b(prod|production|critical|backup|dr|disaster|recovery|primary)\b/i,Df=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::S3::Bucket")return s;let i=F(r,n),o=r.Properties?.BucketName||n,a=r.Properties?.ReplicationConfiguration;return V0.test(o)&&!a?.Rules?.length&&(s[n]={issues:[t(n,"Critical S3 bucket does not have cross-region replication configured.","Consider enabling cross-region replication for disaster recovery and data durability on production/critical buckets.","LOW","Reliability",i,"cdkInsights")]}),s},{});var bf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{let i=r.Properties??{};return r.Type==="AWS::SecretsManager::Secret"&&i.PublicPolicy&&(s[n]={issues:[t(n,"Secret is publicly accessible.","Restrict secret access using IAM policies to ensure only authorized entities can retrieve it.","CRITICAL","Security",F(r,n),"cdkInsights")]}),s},{});var vf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::SNS::Topic"&&!r.Properties?.KmsMasterKeyId&&(s[n]={issues:[t(n,"SNS topic is not encrypted.","Enable AWS KMS encryption for SNS to protect sensitive messages in transit and at rest.","HIGH","Security",F(r,n),"cdkInsights")]}),s),{});var Sf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::SQS::Queue"&&!r.Properties?.KmsMasterKeyId&&(s[n]={issues:[t(n,"SQS queue is not encrypted.","Enable AWS KMS encryption for SQS to protect message data in transit and at rest.","HIGH","Security",F(r,n),"cdkInsights")]}),s),{});var Cf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::StepFunctions::StateMachine"&&r.Properties?.LoggingConfiguration===void 0&&(s[n]={issues:[t(n,"Step Function lacks logging configuration.","Enable logging for the Step Function using AWS CloudWatch to improve monitoring and debugging.","HIGH","Security",F(r,n),"cdkInsights")]}),s),{});var K0=e=>Object.values(e.Resources||{}).some(t=>t.Type==="Custom::S3BucketNotifications"),xf=e=>Object.values(e.Resources||{}).some(t=>t.Type==="AWS::Lambda::EventSourceMapping"),Af=e=>Object.values(e.Resources||{}).some(t=>t.Type==="AWS::Events::Rule"),Ff=(e,t)=>Object.values(e.Resources||{}).some(s=>s.Type!=="AWS::ElasticLoadBalancingV2::Listener"?!1:(s.Properties?.DefaultActions||s.Properties?.Actions)?.some(r=>r.TargetGroupArn?.startsWith(t))),Z0=e=>Object.values(e.Resources||{}).some(t=>t.Type==="AWS::Lambda::Permission"&&t.Properties?.Principal==="apigateway.amazonaws.com"),Si=(e,t)=>Object.values(e.Resources||{}).some(s=>s.Type==="AWS::ApiGateway::Integration"&&typeof s.Properties?.Uri=="string"&&s.Properties.Uri.includes(t)),pr=(e,t)=>Object.values(e.Resources||{}).some(s=>s.Type==="AWS::IoT::TopicRule"&&s.Properties?.TopicRulePayload?.actions?.some(n=>Object.hasOwn(n,t))),Y0=e=>Object.values(e.Resources||{}).some(t=>t.Type==="AWS::ECS::Service"),Ef=(e,t)=>Object.values(e.Resources||{}).some(s=>s.Type==="AWS::SNS::Subscription"&&s.Properties?.Protocol===t),Rf=(e,t)=>{let s=[],n={},r={};for(let[o,a]of Object.entries(t)){let c=a.requiredResourceTypes||[];if(c.length!==0){r[o]=c.length;for(let u of c)n[u]||(n[u]=[]),n[u].push(o)}}let i={};for(let o of Object.values(e.Resources||{})){let a=o.Type,c=n[a];if(c){for(let u of c)if(i[u]=(i[u]||0)+1,i[u]===r[u]){let l=t[u],p=!0;switch(u){case"aws-s3-lambda":p=K0(e)||xf(e);break;case"aws-dynamodbstreams-lambda":p=xf(e);break;case"aws-eventbridge-lambda":p=Af(e);break;case"aws-alb-fargate":p=Ff(e,"arn:aws:ecs:");break;case"aws-alb-lambda":p=Ff(e,"arn:aws:lambda:");break;case"aws-apigateway-lambda":p=Z0(e);break;case"aws-apigateway-sqs":p=Si(e,"sqs");break;case"aws-apigateway-dynamodb":p=Si(e,"dynamodb");break;case"aws-apigateway-kinesisstreams":p=Si(e,"kinesis");break;case"aws-apigateway-sagemakerendpoint":p=Si(e,"sagemaker");break;case"aws-iot-lambda":p=pr(e,"lambda");break;case"aws-iot-kinesisstreams":p=pr(e,"kinesis");break;case"aws-iot-kinesisfirehose-s3":p=pr(e,"firehose");break;case"aws-iot-sqs":p=pr(e,"sqs");break;case"aws-iot-s3":p=pr(e,"s3");break;case"aws-sns-lambda":p=Ef(e,"lambda");break;case"aws-sns-sqs":p=Ef(e,"sqs");break;case"aws-fargate-dynamodb":case"aws-fargate-eventbridge":case"aws-fargate-kinesisfirehose":case"aws-fargate-kinesisstreams":case"aws-fargate-opensearch":case"aws-fargate-s3":case"aws-fargate-secretsmanager":case"aws-fargate-sns":case"aws-fargate-sqs":case"aws-fargate-ssmstringparameter":case"aws-fargate-stepfunctions":p=Y0(e);break;case"aws-eventbridge-kinesisfirehose-s3":case"aws-eventbridge-kinesisstreams":case"aws-eventbridge-sns":case"aws-eventbridge-sqs":case"aws-eventbridge-stepfunctions":p=Af(e);break}if(!p)continue;s.push({resourceId:l.className,issue:`Possible Pattern detected: ${l.friendlyName}`,recommendation:`Consider using the AWS Solutions Construct \`${l.className}\` from \`@aws-solutions-constructs/${u}\`.`,severity:"LOW",wafPillar:"Operational Excellence",docUrl:l.documentationUrl,githubUrl:l.githubUrl,constructPath:l.className,foundBy:"cdkInsights"}),delete r[u]}}}return s};var wf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::WAFv2::WebACL")return s;let i=F(r,n),o=[],a=r.Properties?.DefaultAction;a?.Allow&&!a?.Block&&o.push(t(n,"WAF WebACL has default action set to Allow, which permits all traffic not matching rules.","Consider setting the default action to Block and explicitly allowing known-good traffic patterns for defense-in-depth.","MEDIUM","Security",i,"cdkInsights")),r.Properties?.VisibilityConfig?.CloudWatchMetricsEnabled||o.push(t(n,"WAF WebACL does not have CloudWatch metrics enabled.","Enable CloudWatchMetricsEnabled in VisibilityConfig to monitor WAF activity and detect potential attacks.","MEDIUM","Security",i,"cdkInsights"));let u=r.Properties?.Rules;return(!u||u.length===0)&&o.push(t(n,"WAF WebACL has no rules defined.","Add WAF rules to protect against common web exploits like SQL injection, XSS, and bot traffic.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var If=(e,t)=>{let s=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::WAFv2::WebACL"),n=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::WAFv2::LoggingConfiguration"),r=new Set(n.map(([,i])=>{let o=i.Properties?.ResourceArn;return typeof o=="string"?o:o?.Ref?o.Ref:o?.["Fn::GetAtt"]?.[0]?o["Fn::GetAtt"][0]:null}).filter(Boolean));return s.reduce((i,[o,a])=>{let c=F(a,o);return r.has(o)||n.some(([,l])=>{let p=l.Properties?.ResourceArn;return typeof p=="object"&&(p?.Ref===o||p?.["Fn::GetAtt"]?.[0]===o)})||(i[o]={issues:[t(o,"WAF WebACL does not have logging configured.","Enable WAF logging to capture detailed information about web requests for security analysis and compliance.","MEDIUM","Security",c,"cdkInsights")]}),i},{})};var Tf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Logs::LogGroup")return s;let i=F(r,n);return r.Properties?.RetentionInDays===void 0&&(s[n]={issues:[t(n,"CloudWatch Log Group has no retention period set (logs retained indefinitely).","Set RetentionInDays to control storage costs. Consider 30-90 days for operational logs, longer for compliance requirements.","MEDIUM","Cost Optimization",i,"cdkInsights")]}),s},{});var kf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Logs::LogGroup")return s;let i=F(r,n);return r.Properties?.KmsKeyId||(s[n]={issues:[t(n,"CloudWatch Log Group is not encrypted with a customer-managed KMS key.","Enable KMS encryption using KmsKeyId to protect sensitive log data at rest with customer-managed keys.","LOW","Security",i,"cdkInsights")]}),s},{});var _f=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::CloudWatch::Alarm")return s;let i=F(r,n),o=[],a=r.Properties?.AlarmActions,c=r.Properties?.OKActions,u=r.Properties?.InsufficientDataActions;return(!a||a.length===0)&&o.push(t(n,"CloudWatch Alarm has no alarm actions configured.","Add AlarmActions (SNS topic, Lambda, etc.) to receive notifications when the alarm state changes to ALARM.","MEDIUM","Operational Excellence",i,"cdkInsights")),r.Properties?.TreatMissingData||o.push(t(n,"CloudWatch Alarm does not specify how to treat missing data.","Set TreatMissingData to define alarm behavior when data points are missing (missing, ignore, breaching, or notBreaching).","LOW","Operational Excellence",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Lf=(e,t)=>{let s=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::Route53::HostedZone"),n=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::Route53::DNSSEC"),r=new Set(n.map(([,i])=>{let o=i.Properties?.HostedZoneId;return typeof o=="string"?o:o?.Ref?o.Ref:null}).filter(Boolean));return s.reduce((i,[o,a])=>{if(a.Properties?.HostedZoneConfig?.Comment?.includes("private"))return i;let c=F(a,o);return r.has(o)||(i[o]={issues:[t(o,"Route53 Hosted Zone does not have DNSSEC signing enabled.","Enable DNSSEC to protect against DNS spoofing and cache poisoning attacks by cryptographically signing DNS records.","LOW","Security",c,"cdkInsights")]}),i},{})};var Pf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Route53::HealthCheck")return s;let i=F(r,n),o=[],a=r.Properties?.HealthCheckConfig;return a?.Type==="HTTP"&&o.push(t(n,"Route53 Health Check uses HTTP instead of HTTPS.","Use HTTPS for health checks to ensure the endpoint supports secure connections and to validate SSL certificates.","LOW","Security",i,"cdkInsights")),a?.RequestInterval===30&&o.push(t(n,"Route53 Health Check uses standard (30 second) request interval.","Consider using fast interval (10 seconds) for critical endpoints to detect failures more quickly.","LOW","Reliability",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Of=(e,t)=>{let s=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::Route53::HostedZone"),n=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::Route53::QueryLoggingConfig"),r=new Set(n.map(([,i])=>{let o=i.Properties?.HostedZoneId;return typeof o=="string"?o:o?.Ref?o.Ref:null}).filter(Boolean));return s.reduce((i,[o,a])=>{let c=F(a,o);return r.has(o)||(i[o]={issues:[t(o,"Route53 Hosted Zone does not have query logging enabled.","Enable query logging to CloudWatch Logs for DNS query analysis, troubleshooting, and security monitoring.","LOW","Security",c,"cdkInsights")]}),i},{})};var Bf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElastiCache::ReplicationGroup"&&r.Type!=="AWS::ElastiCache::CacheCluster")return s;let i=F(r,n),o=[];return r.Properties?.AtRestEncryptionEnabled!==!0&&o.push(t(n,"ElastiCache cluster does not have encryption at rest enabled.","Enable AtRestEncryptionEnabled to protect cached data at rest using AWS-managed or customer-managed keys.","HIGH","Security",i,"cdkInsights")),r.Properties?.TransitEncryptionEnabled!==!0&&o.push(t(n,"ElastiCache cluster does not have encryption in transit enabled.","Enable TransitEncryptionEnabled to protect data during transfer between clients and the cache.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Mf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElastiCache::ReplicationGroup")return s;let i=F(r,n),o=[],a=r.Properties?.AuthToken,c=r.Properties?.TransitEncryptionEnabled;return!a&&c===!0&&o.push(t(n,"ElastiCache Redis cluster has transit encryption but no AUTH token configured.","Set AuthToken to require authentication for Redis connections, providing an additional security layer.","MEDIUM","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Nf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElastiCache::ReplicationGroup")return s;let i=F(r,n),o=[],a=r.Properties?.AutomaticFailoverEnabled,c=r.Properties?.NumNodeGroups||1,u=r.Properties?.ReplicasPerNodeGroup||0;return a!==!0&&(c>1||u>0)&&o.push(t(n,"ElastiCache replication group has replicas but automatic failover is not enabled.","Enable AutomaticFailoverEnabled to automatically promote a replica to primary if the primary node fails.","MEDIUM","Reliability",i,"cdkInsights")),r.Properties?.MultiAZEnabled!==!0&&a===!0&&o.push(t(n,"ElastiCache replication group has automatic failover but Multi-AZ is not enabled.","Enable MultiAZEnabled to distribute nodes across availability zones for higher availability.","MEDIUM","Reliability",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Wf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ECR::Repository")return s;let i=F(r,n),o=[];return r.Properties?.ImageScanningConfiguration?.ScanOnPush!==!0&&o.push(t(n,"ECR repository does not have image scanning on push enabled.","Enable ScanOnPush in ImageScanningConfiguration to automatically scan images for vulnerabilities when pushed.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var jf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ECR::Repository")return s;let i=F(r,n);return r.Properties?.LifecyclePolicy?.LifecyclePolicyText||(s[n]={issues:[t(n,"ECR repository does not have a lifecycle policy configured.","Add a lifecycle policy to automatically clean up old or untagged images and reduce storage costs.","MEDIUM","Cost Optimization",i,"cdkInsights")]}),s},{});var $f=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ECR::Repository")return s;let i=F(r,n);return r.Properties?.ImageTagMutability!=="IMMUTABLE"&&(s[n]={issues:[t(n,"ECR repository allows mutable image tags.","Set ImageTagMutability to IMMUTABLE to prevent image tags from being overwritten, ensuring deployment consistency.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var Uf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::OpenSearchService::Domain"&&r.Type!=="AWS::Elasticsearch::Domain")return s;let i=F(r,n),o=[];return r.Properties?.EncryptionAtRestOptions?.Enabled!==!0&&o.push(t(n,"OpenSearch domain does not have encryption at rest enabled.","Enable EncryptionAtRestOptions to protect indexed data at rest using AWS KMS.","HIGH","Security",i,"cdkInsights")),r.Properties?.NodeToNodeEncryptionOptions?.Enabled!==!0&&o.push(t(n,"OpenSearch domain does not have node-to-node encryption enabled.","Enable NodeToNodeEncryptionOptions to encrypt data in transit between nodes within the cluster.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Gf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::OpenSearchService::Domain"&&r.Type!=="AWS::Elasticsearch::Domain")return s;let i=F(r,n),o=[];r.Properties?.AdvancedSecurityOptions?.Enabled!==!0&&o.push(t(n,"OpenSearch domain does not have fine-grained access control enabled.","Enable AdvancedSecurityOptions to use IAM or internal user database for document-level and field-level security.","MEDIUM","Security",i,"cdkInsights"));let c=r.Properties?.VPCOptions;return(!c?.SubnetIds||c.SubnetIds.length===0)&&o.push(t(n,"OpenSearch domain is not deployed within a VPC.","Configure VPCOptions with subnet IDs to deploy the domain within a VPC for network isolation.","MEDIUM","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var zf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::OpenSearchService::Domain"&&r.Type!=="AWS::Elasticsearch::Domain")return s;let i=F(r,n),o=[],a=r.Properties?.LogPublishingOptions;return a?.AUDIT_LOGS?.Enabled||o.push(t(n,"OpenSearch domain does not have audit logging enabled.","Enable AUDIT_LOGS in LogPublishingOptions to track user activity for security and compliance monitoring.","LOW","Security",i,"cdkInsights")),a?.ES_APPLICATION_LOGS?.Enabled||o.push(t(n,"OpenSearch domain does not have application logging enabled.","Enable ES_APPLICATION_LOGS in LogPublishingOptions to capture error logs for troubleshooting.","LOW","Operational Excellence",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var qf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::CertificateManager::Certificate")return s;let i=F(r,n),o=[];return r.Properties?.ValidationMethod==="EMAIL"&&o.push(t(n,"ACM certificate uses email validation instead of DNS validation.","Use DNS validation for automated certificate renewal. Email validation requires manual intervention for renewals.","LOW","Operational Excellence",i,"cdkInsights")),r.Properties?.CertificateTransparencyLoggingPreference==="DISABLED"&&o.push(t(n,"ACM certificate has certificate transparency logging disabled.","Enable certificate transparency logging for security monitoring and to detect misissued certificates.","LOW","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Hf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Backup::BackupPlan")return s;let i=F(r,n),o=[],c=r.Properties?.BackupPlan?.BackupPlanRule||[];for(let u of c){(u.CopyActions||[]).length===0&&o.push(t(n,`Backup rule "${u.RuleName||"unnamed"}" does not have cross-region copy configured.`,"Add CopyActions to replicate backups to another region for disaster recovery.","LOW","Reliability",i,"cdkInsights"));let p=u.Lifecycle;!p?.DeleteAfterDays&&!p?.MoveToColdStorageAfterDays&&o.push(t(n,`Backup rule "${u.RuleName||"unnamed"}" has no lifecycle configuration.`,"Set DeleteAfterDays or MoveToColdStorageAfterDays to manage backup retention and costs.","LOW","Cost Optimization",i,"cdkInsights"))}return o.length>0&&(s[n]={issues:o}),s},{});var Vf=(e,t)=>{let s=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::Backup::BackupVault"),n=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::Backup::BackupVaultLock"),r=new Set(n.map(([,i])=>{let o=i.Properties?.BackupVaultName;return typeof o=="string"?o:typeof o=="object"&&o?.Ref?o.Ref:null}).filter(Boolean));return s.reduce((i,[o,a])=>{let c=F(a,o),u=[];a.Properties?.EncryptionKeyArn||u.push(t(o,"Backup vault uses default AWS-managed encryption key.","Specify a customer-managed KMS key using EncryptionKeyArn for additional control over encryption.","LOW","Security",c,"cdkInsights"));let p=a.Properties?.BackupVaultName,d=typeof p=="string"?p:typeof p=="object"?p?.Ref:void 0;return r.has(o)||d&&r.has(d)||u.push(t(o,"Backup vault does not have a vault lock configured.","Add a BackupVaultLock to enforce retention policies and prevent backup deletion for compliance requirements.","LOW","Security",c,"cdkInsights")),u.length>0&&(i[o]={issues:u}),i},{})};var Kf=(e,t)=>{let s=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::EC2::VPC"),n=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::EC2::FlowLog"),r=new Set(n.filter(([,i])=>i.Properties?.ResourceType==="VPC").map(([,i])=>{let o=i.Properties?.ResourceId;return typeof o=="string"?o:o?.Ref?o.Ref:null}).filter(Boolean));return s.reduce((i,[o,a])=>{let c=F(a,o);return r.has(o)||(i[o]={issues:[t(o,"VPC does not have flow logs enabled.","Enable VPC Flow Logs to capture network traffic information for security analysis and troubleshooting.","MEDIUM","Security",c,"cdkInsights")]}),i},{})};var Zf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::EC2::SecurityGroup")return s;let i=F(r,n);if(r.Properties?.GroupName==="default"){let a=r.Properties?.SecurityGroupIngress||[],c=r.Properties?.SecurityGroupEgress||[];(a.length>0||c.length>0)&&(s[n]={issues:[t(n,"VPC default security group has rules configured.","Remove all rules from the default security group and use custom security groups instead. Default groups cannot be deleted but should have no rules.","MEDIUM","Security",i,"cdkInsights")]})}return s},{});var Yf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Kinesis::Stream")return s;let i=F(r,n),o=[],a=r.Properties?.StreamEncryption;return(!a?.EncryptionType||a.EncryptionType==="NONE")&&o.push(t(n,"Kinesis Data Stream does not have server-side encryption enabled.","Enable StreamEncryption with EncryptionType KMS to protect data at rest.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Jf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Kinesis::Stream")return s;let i=F(r,n),o=[];r.Properties?.RetentionPeriodHours===24&&o.push(t(n,"Kinesis Data Stream uses minimum retention period (24 hours).","Consider increasing RetentionPeriodHours for applications that need to replay or reprocess data during failures.","LOW","Reliability",i,"cdkInsights"));let c=r.Properties?.StreamModeDetails?.StreamMode;return o.length>0&&(s[n]={issues:o}),s},{});var Qf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::AppSync::GraphQLApi")return s;let i=F(r,n),o=[],a=r.Properties?.AuthenticationType;a==="API_KEY"&&o.push(t(n,"AppSync API uses API key authentication.","Consider using AWS_IAM, AMAZON_COGNITO_USER_POOLS, or OPENID_CONNECT for production workloads. API keys are best for development or public read-only access.","MEDIUM","Security",i,"cdkInsights"));let c=r.Properties?.AdditionalAuthenticationProviders;return a!=="AWS_IAM"&&(!c||c.length===0)&&o.push(t(n,"AppSync API does not have multiple authentication providers configured.","Consider adding AdditionalAuthenticationProviders for flexibility in authenticating different client types.","LOW","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Xf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::AppSync::GraphQLApi")return s;let i=F(r,n),o=[],a=r.Properties?.LogConfig;return a?a.FieldLogLevel==="NONE"&&o.push(t(n,"AppSync API has field-level logging disabled.","Set FieldLogLevel to ERROR or ALL to capture GraphQL resolver execution details.","LOW","Operational Excellence",i,"cdkInsights")):o.push(t(n,"AppSync API does not have logging configured.","Enable LogConfig to capture request/response logs in CloudWatch for debugging and monitoring.","MEDIUM","Operational Excellence",i,"cdkInsights")),r.Properties?.XrayEnabled!==!0&&o.push(t(n,"AppSync API does not have X-Ray tracing enabled.","Enable XrayEnabled for distributed tracing and performance analysis.","LOW","Operational Excellence",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var eg=(e,t)=>{let s=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::AppSync::GraphQLApi"),n=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::WAFv2::WebACLAssociation"),r=new Set(n.map(([,i])=>{let o=i.Properties?.ResourceArn;return typeof o=="string"?o:o?.["Fn::GetAtt"]?.[0]?o["Fn::GetAtt"][0]:null}).filter(Boolean));return s.reduce((i,[o,a])=>{let c=F(a,o);return r.has(o)||(i[o]={issues:[t(o,"AppSync API does not have AWS WAF protection.","Associate a WAF WebACL to protect against common web exploits and control access to the API.","MEDIUM","Security",c,"cdkInsights")]}),i},{})};var tg=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::EKS::Cluster")return s;let i=F(r,n),o=[],a=r.Properties?.ResourcesVpcConfig,c=a?.EndpointPublicAccess,u=a?.EndpointPrivateAccess,l=a?.PublicAccessCidrs;return c===!0&&u!==!0&&o.push(t(n,"EKS cluster has only public endpoint access enabled.","Enable EndpointPrivateAccess to allow communication between nodes and the API server within the VPC.","MEDIUM","Security",i,"cdkInsights")),c===!0&&(!l||l.length===0||l.includes("0.0.0.0/0"))&&o.push(t(n,"EKS cluster public endpoint is accessible from the internet (0.0.0.0/0).","Restrict PublicAccessCidrs to specific IP ranges that need to access the Kubernetes API.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var sg=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::EKS::Cluster")return s;let i=F(r,n),o=[];return r.Properties?.EncryptionConfig?.some(u=>u.Resources?.includes("secrets"))||o.push(t(n,"EKS cluster does not have Kubernetes secrets encryption enabled.","Configure EncryptionConfig with a KMS key to encrypt secrets stored in etcd.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var ng=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::EKS::Cluster")return s;let i=F(r,n),o=[],c=r.Properties?.Logging?.ClusterLogging?.EnabledTypes||[],u=c.map(d=>d.Type).filter(d=>!!d),p=["api","audit","authenticator","controllerManager","scheduler"].filter(d=>!u.includes(d));return p.length>0&&o.push(t(n,`EKS cluster is missing control plane logging for: ${p.join(", ")}.`,"Enable all control plane log types (api, audit, authenticator, controllerManager, scheduler) for comprehensive cluster monitoring.","MEDIUM","Operational Excellence",i,"cdkInsights")),c.length===0?(s[n]={issues:[t(n,"EKS cluster does not have any control plane logging enabled.","Enable control plane logging to CloudWatch for audit trails and troubleshooting Kubernetes API issues.","MEDIUM","Security",i,"cdkInsights")]},s):(o.length>0&&(s[n]={issues:o}),s)},{});var rg=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Redshift::Cluster")return s;let i=F(r,n),o=[];return r.Properties?.Encrypted!==!0&&o.push(t(n,"Redshift cluster does not have encryption at rest enabled.","Set Encrypted to true and specify a KmsKeyId to protect data at rest.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var ig=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Redshift::Cluster")return s;let i=F(r,n);return r.Properties?.PubliclyAccessible===!0&&(s[n]={issues:[t(n,"Redshift cluster is publicly accessible.","Set PubliclyAccessible to false and use VPC endpoints or bastion hosts for secure access.","CRITICAL","Security",i,"cdkInsights")]}),s},{});var og=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Redshift::Cluster")return s;let i=F(r,n);return r.Properties?.LoggingProperties?.BucketName||(s[n]={issues:[t(n,"Redshift cluster does not have audit logging enabled.","Configure LoggingProperties with an S3 bucket to capture connection logs, user activity, and query activity.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var ag=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::MSK::Cluster")return s;let i=F(r,n),o=[],a=r.Properties?.EncryptionInfo;a?.EncryptionAtRest?.DataVolumeKMSKeyId||o.push(t(n,"MSK cluster does not use a customer-managed KMS key for encryption at rest.","Specify DataVolumeKMSKeyId in EncryptionAtRest for additional control over data encryption.","LOW","Security",i,"cdkInsights"));let u=a?.EncryptionInTransit;return u?.ClientBroker!=="TLS"&&o.push(t(n,"MSK cluster does not enforce TLS encryption for client-broker communication.","Set ClientBroker to TLS in EncryptionInTransit to encrypt data between clients and brokers.","HIGH","Security",i,"cdkInsights")),u?.InCluster!==!0&&o.push(t(n,"MSK cluster does not have encryption enabled for inter-broker communication.","Set InCluster to true in EncryptionInTransit to encrypt data between brokers.","MEDIUM","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var cg=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::MSK::Cluster")return s;let i=F(r,n),o=[],a=r.Properties?.ClientAuthentication,c=(a?.Tls?.CertificateAuthorityArnList?.length??0)>0,u=a?.Sasl?.Scram?.Enabled===!0||a?.Sasl?.Iam?.Enabled===!0,l=a?.Unauthenticated?.Enabled===!0;return!c&&!u&&o.push(t(n,"MSK cluster does not have client authentication configured.","Enable SASL/SCRAM, IAM authentication, or mutual TLS for client authentication.","HIGH","Security",i,"cdkInsights")),l&&o.push(t(n,"MSK cluster allows unauthenticated access.","Disable unauthenticated access and require client authentication for all connections.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var ug=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::MSK::Cluster")return s;let i=F(r,n),o=[],c=r.Properties?.LoggingInfo?.BrokerLogs,u=c?.CloudWatchLogs?.Enabled===!0,l=c?.Firehose?.Enabled===!0,p=c?.S3?.Enabled===!0;return!u&&!l&&!p&&o.push(t(n,"MSK cluster does not have broker logging configured.","Enable broker logs to CloudWatch, Firehose, or S3 for monitoring and troubleshooting Kafka operations.","MEDIUM","Operational Excellence",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var lg=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Glue::Job")return s;let i=F(r,n),o=[];return r.Properties?.SecurityConfiguration||o.push(t(n,"Glue job does not have a security configuration specified.","Create and attach a SecurityConfiguration to enable encryption for job bookmarks, S3 data, and CloudWatch logs.","MEDIUM","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var pg=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Glue::Connection")return s;let i=F(r,n),o=[],a=r.Properties?.ConnectionInput,c=a?.ConnectionType,u=a?.PhysicalConnectionRequirements;if(c==="JDBC"){u?.SubnetId||o.push(t(n,"Glue JDBC connection does not specify a VPC subnet.","Configure PhysicalConnectionRequirements with SubnetId and SecurityGroupIdList for network isolation.","MEDIUM","Security",i,"cdkInsights"));let p=a?.ConnectionProperties?.JDBC_CONNECTION_URL||"";typeof p=="string"&&!p.includes("ssl=true")&&!p.includes("useSSL=true")&&o.push(t(n,"Glue JDBC connection URL may not enforce SSL.","Ensure the JDBC connection URL includes SSL parameters to encrypt data in transit.","LOW","Security",i,"cdkInsights"))}return o.length>0&&(s[n]={issues:o}),s},{});var dg=()=>({iamPolicies:Jm,iamPermissionBoundary:Qm,iamCrossAccountTrust:tf,s3Buckets:gf,s3IntelligentTiering:hf,s3LifecyclePolicy:yf,s3Replication:Df,securityGroups:Um,ec2InstanceType:jm,natGatewayUsage:$m,ebsVolumes:Wm,lambdaEnvironmentVariables:nf,lambdaMemory:rf,lambdaReservedConcurrency:of,lambdaDeadLetterQueue:af,lambdaRuntime:cf,lambdaVpcNatWarning:uf,rdsEncryption:lf,rdsMultiAZ:pf,rdsPublicAccess:df,rdsBackupRetention:mf,rdsDeletionProtection:ff,dynamoDBAutoScaling:Mm,dynamoDBStreams:Nm,cloudFrontHttpsOnly:Tm,cloudFrontWafAssociation:km,cloudFrontLogging:_m,cloudFrontTls:Lm,elbDeletionProtection:Hm,elbLogging:Vm,elbHttpsListeners:Km,elbSecurityPolicy:Zm,ecsSecrets:Gm,ecsLogging:zm,ecsResources:qm,cognitoPasswordPolicy:Pm,cognitoMfa:Om,cognitoAdvancedSecurity:Bm,wafWebAcl:wf,wafLogging:If,cloudWatchLogRetention:Tf,cloudWatchEncryption:kf,cloudWatchAlarms:_f,route53Dnssec:Lf,route53HealthChecks:Pf,route53QueryLogging:Of,elastiCacheEncryption:Bf,elastiCacheAuth:Mf,elastiCacheFailover:Nf,ecrScanning:Wf,ecrLifecycle:jf,ecrImmutableTags:$f,openSearchEncryption:Uf,openSearchAccessControl:Gf,openSearchLogging:zf,acmValidation:qf,backupPlans:Hf,backupVault:Vf,vpcFlowLogs:Kf,vpcDefaultSecurityGroup:Zf,kinesisEncryption:Yf,kinesisRetention:Jf,appSyncAuth:Qf,appSyncLogging:Xf,appSyncWaf:eg,eksPublicEndpoint:tg,eksEncryption:sg,eksLogging:ng,redshiftEncryption:rg,redshiftPublicAccess:ig,redshiftLogging:og,mskEncryption:ag,mskAuth:cg,mskLogging:ug,glueEncryption:lg,glueConnections:pg,apiGateway:wm,secretsManager:bf,cloudTrailLogging:Im,eventBridgeRules:Ym,kmsKeys:sf,sns:vf,sqs:Sf,stepFunctions:Cf,crossResourceRelationships:bi,stackArchitecture:vi,solutionsPatterns:Rf});var dr=(e={})=>{let{ttl:t=3e5,maxSize:s=1e3}=e,n=new Map,r=new Set,i=[],o=Date.now(),a=6e4,c=f=>Date.now()-f.timestamp>f.ttl,u=f=>{r.delete(f)},l=()=>{let f=0;for(let m=0;m<i.length;m++)r.has(i[m])&&(i[f++]=i[m]);i.length=f},p=()=>{let f=Date.now();if(f-o<a)return;o=f;let m=[];for(let[g,h]of n.entries())c(h)&&m.push(g);for(let g of m)n.delete(g),u(g);m.length>0&&l()},d=()=>{for(;n.size>=s&&i.length>0;){let f=i.shift();f&&r.has(f)&&(n.delete(f),r.delete(f))}};return{get(f){let m=n.get(f);if(m){if(c(m)){n.delete(f),u(f);return}return m.value}},set(f,m,g){n.size>=s*.9&&p(),d(),r.has(f)&&u(f),n.set(f,{value:m,timestamp:Date.now(),ttl:g??t}),r.add(f),i.push(f)},clear(){n.clear(),r.clear(),i.length=0},size(){return n.size},has(f){let m=n.get(f);return m?c(m)?(n.delete(f),u(f),!1):!0:!1}}},mg=(e,t={})=>{let s=dr(t);return(...n)=>{let r;try{r=JSON.stringify(n)}catch{return e(...n)}let i=s.get(r);if(i!==void 0)return i;let o=e(...n);return s.set(r,o),o}};var fg={IAM:["iamPolicies","iamPermissionBoundary","iamCrossAccountTrust"],S3:["s3Buckets","s3IntelligentTiering","s3LifecyclePolicy","s3Replication"],Lambda:["lambdaEnvironmentVariables","lambdaMemory","lambdaReservedConcurrency","lambdaDeadLetterQueue","lambdaRuntime","lambdaVpcNatWarning"],DynamoDB:["dynamoDBAutoScaling","dynamoDBStreams"],RDS:["rdsEncryption","rdsMultiAZ","rdsPublicAccess","rdsBackupRetention","rdsDeletionProtection"],EC2:["ec2InstanceType","natGatewayUsage","securityGroups","ebsVolumes"],SNS:["sns"],SQS:["sqs"],StepFunctions:["stepFunctions"],CloudTrail:["cloudTrailLogging"],ApiGateway:["apiGateway"],SecretsManager:["secretsManager"],KMS:["kmsKeys"],EventBridge:["eventBridgeRules"],CloudFront:["cloudFrontHttpsOnly","cloudFrontWafAssociation","cloudFrontLogging","cloudFrontTls"],ELB:["elbDeletionProtection","elbLogging","elbHttpsListeners","elbSecurityPolicy"],ECS:["ecsSecrets","ecsLogging","ecsResources"],Cognito:["cognitoPasswordPolicy","cognitoMfa","cognitoAdvancedSecurity"],WAF:["wafWebAcl","wafLogging"],CloudWatch:["cloudWatchLogRetention","cloudWatchEncryption","cloudWatchAlarms"],Route53:["route53Dnssec","route53HealthChecks","route53QueryLogging"],ElastiCache:["elastiCacheEncryption","elastiCacheAuth","elastiCacheFailover"],ECR:["ecrScanning","ecrLifecycle","ecrImmutableTags"],OpenSearch:["openSearchEncryption","openSearchAccessControl","openSearchLogging"],ACM:["acmValidation"],Backup:["backupPlans","backupVault"],VPC:["vpcFlowLogs","vpcDefaultSecurityGroup"],Kinesis:["kinesisEncryption","kinesisRetention"],AppSync:["appSyncAuth","appSyncLogging","appSyncWaf"],EKS:["eksPublicEndpoint","eksEncryption","eksLogging"],Redshift:["redshiftEncryption","redshiftPublicAccess","redshiftLogging"],MSK:["mskEncryption","mskAuth","mskLogging"],Glue:["glueEncryption","glueConnections"]},J0=Object.entries(fg).reduce((e,[t,s])=>{for(let n of s)e[n]=t;return e},{}),Ha=e=>{let t=new Set,s=[];for(let n of e)t.has(n)||(t.add(n),s.push(n));return s},gg=e=>{if(!e||e.length===0)return{services:["All services"],removedAllServices:!1,defaultedToAll:!0};let t=Ha(e),s=t.includes("All services"),n=t.filter(r=>r!=="All services");return s&&n.length>0?{services:n,removedAllServices:!0,defaultedToAll:!1}:{services:s?["All services"]:t,removedAllServices:!1,defaultedToAll:!1}},hg=(e,t)=>{if(e.length===0||e.includes("All services"))return Ha(t);let s=e.flatMap(n=>n==="All services"?t:fg[n]??[]);return Ha(s)},mr=e=>J0[e];var wt=H(Yt()),Ln=process.env.NODE_ENV==="development",hc=process.env.CDK_INSIGHTS_VERBOSE==="true",yR=Ln||hc||process.env.CDK_INSIGHTS_ENABLE_LOGGING==="true",Eh=hc?wt.LogLevel.DEBUG:Ln?wt.LogLevel.INFO:wt.LogLevel.ERROR,DR=yR?[(0,wt.createConsoleTransport)({formatter:(0,wt.createJsonFormatter)(),level:Eh,useColors:!Ln})]:[],Q=(0,wt.createLogger)({config:{level:Eh,serviceName:"cdk-insights",stage:Ln?"dev":"prod"},formatter:(0,wt.createJsonFormatter)(),transports:DR,env:{STAGE:Ln?"dev":"prod",LOG_LEVEL:hc?"DEBUG":Ln?"INFO":"ERROR"}}),Pn=e=>({debug:(t,s,n)=>Q.debug(t,{component:e,...s},n),info:(t,s,n)=>Q.info(t,{component:e,...s},n),warn:(t,s,n,r)=>Q.warn(t,{component:e,...s},n,r),error:(t,s,n,r)=>Q.error(t,{component:e,...s},n,r)}),Ve=Pn("cli"),pe=Pn("analysis"),ZN=Pn("license"),ms=Pn("cache"),Gi=Pn("github"),_e=Pn("aspect");function Sr(e,t){let s=t.split("."),n=e;for(let r of s){if(n==null||typeof n!="object")return;n=n[r]}return n}function yc(e,t){switch(e.type){case"property_exists":{let s=Sr(t,e.path),n=s!=null;return e.negate?!n:n}case"property_equals":{let s=Sr(t,e.path),n=JSON.stringify(s)===JSON.stringify(e.value);return e.negate?!n:n}case"property_matches":{let s=Sr(t,e.path);if(typeof s!="string")return!!e.negate;let n=new RegExp(e.pattern).test(s);return e.negate?!n:n}case"property_gt":{let s=Sr(t,e.path);return typeof s!="number"?!1:s>e.value}case"property_lt":{let s=Sr(t,e.path);return typeof s!="number"?!1:s<e.value}case"and":return e.conditions.every(s=>yc(s,t));case"or":return e.conditions.some(s=>yc(s,t));default:return!1}}function Rh(e,t,s){if(t.length===0)return{};let n={};for(let[r,i]of Object.entries(e.Resources||{}))for(let o of t)if(o.resourceTypes.some(c=>c.endsWith("*")?i.Type.startsWith(c.slice(0,-1)):i.Type===c))try{if(yc(o.condition,i)){let u=s(r,`[${o.ruleId}] ${o.description}`,o.recommendation,o.severity,o.wafPillar,"","cdkInsights");u.ruleId=o.ruleId,n[r]||(n[r]={issues:[]}),n[r].issues.push(u)}}catch(c){pe.warn(`Error evaluating custom rule '${o.ruleId}' on resource '${r}'`,{error:c instanceof Error?c.message:String(c)})}return n}var bR={IAM:["AWS::IAM::"],S3:["AWS::S3::"],Lambda:["AWS::Lambda::"],DynamoDB:["AWS::DynamoDB::"],RDS:["AWS::RDS::"],EC2:["AWS::EC2::"],SNS:["AWS::SNS::"],SQS:["AWS::SQS::"],StepFunctions:["AWS::StepFunctions::"],CloudTrail:["AWS::CloudTrail::"],ApiGateway:["AWS::ApiGateway::","AWS::ApiGatewayV2::"],SecretsManager:["AWS::SecretsManager::"],KMS:["AWS::KMS::"],EventBridge:["AWS::Events::"],CloudFront:["AWS::CloudFront::"],ELB:["AWS::ElasticLoadBalancing::","AWS::ElasticLoadBalancingV2::"],ECS:["AWS::ECS::"],Cognito:["AWS::Cognito::"],WAF:["AWS::WAFv2::","AWS::WAF::"],CloudWatch:["AWS::CloudWatch::","AWS::Logs::"],Route53:["AWS::Route53::"],ElastiCache:["AWS::ElastiCache::"],ECR:["AWS::ECR::"],OpenSearch:["AWS::OpenSearchService::","AWS::Elasticsearch::"],ACM:["AWS::CertificateManager::"],Backup:["AWS::Backup::"],VPC:["AWS::EC2::VPC","AWS::EC2::FlowLog","AWS::EC2::SecurityGroup"],Kinesis:["AWS::Kinesis::"],AppSync:["AWS::AppSync::"],EKS:["AWS::EKS::"],Redshift:["AWS::Redshift::"],MSK:["AWS::MSK::"],Glue:["AWS::Glue::"]},rW=dr({ttl:3e5,maxSize:100});var vR=mg(dg,{ttl:6e5,maxSize:10}),SR=e=>{if(e.includes("All services")||e.length===0)return s=>!s.Type.startsWith("AWS::CDK::");let t=[];for(let s of e){if(s==="All services")continue;let n=bR[s];n&&t.push(...n)}return t.length===0?s=>!s.Type.startsWith("AWS::CDK::"):s=>!s.Type.startsWith("AWS::CDK::")&&t.some(n=>s.Type.startsWith(n))},CR=e=>{let t=new Map,s={CRITICAL:4,HIGH:3,MEDIUM:2,LOW:1};for(let n of e){let r=n.issue,i=t.get(r);i?s[n.severity]>s[i.severity]&&t.set(r,n):t.set(r,n)}return Array.from(t.values())},xR=(e,t,s,n)=>{let r={CRITICAL:0,HIGH:0,MEDIUM:0,LOW:0},i={},o=0;for(let a of Object.values(e))for(let c of a.issues){o++,r[c.severity]++;let u=c.ruleId?mr(c.ruleId)??"Other":"Other";i[u]=(i[u]||0)+1}return{totalResources:t,analyzedResources:Object.keys(e).length,totalFindings:o,findingsBySeverity:r,findingsByService:i,analysisTimeMs:Date.now()-n,servicesAnalyzed:s}},wh=(e,t,s=[],n={},r=[])=>AR(e,t,{selectedServices:s,solutionsRegistry:n,deduplicateFindings:!0,includeStatistics:!1,customRules:r}).findings,AR=(e,t,s={})=>{let n=Date.now(),{selectedServices:r=[],solutionsRegistry:i={},deduplicateFindings:o=!0,customRules:a=[]}=s,c=vR(),u=new Set(["solutionsPatterns","stackArchitecture","crossResourceRelationships"]),l=Object.keys(c).filter(b=>!u.has(b)),{services:p}=gg(r),d=hg(p,l),f={},m=SR(p),g=Object.keys(e.Resources||{}).length,h=Object.entries(e.Resources||{}).filter(([,b])=>m(b)).reduce((b,[E,T])=>(b[E]=T,b),{}),y=[];for(let b of d)try{let E=c[b];if(typeof E!="function"){let k=mr(b)??b;pe.warn(`\u26A0\uFE0F Service check function for ${k} (${b}) is not available`);continue}let T=E({Resources:h},t);y.push(b);for(let[k,S]of Object.entries(T))f[k]||(f[k]={issues:[]}),f[k].issues.push(...S.issues)}catch(E){let T=mr(b)??b;pe.warn(`\u26A0\uFE0F Error in ${T} analysis (${b})`,{error:E instanceof Error?E.message:String(E)})}if(Object.keys(i).length>0)try{let b=c.solutionsPatterns({Resources:h},i);for(let E of b){let T=E.resourceId;f[T]||(f[T]={issues:[]}),f[T].issues.push(E)}}catch(b){pe.warn("\u26A0\uFE0F Error in solutions pattern analysis",{error:b instanceof Error?b.message:String(b)})}if(a.length>0)try{let b=Rh(e,a,t);for(let[E,T]of Object.entries(b))f[E]||(f[E]={issues:[]}),f[E].issues.push(...T.issues);pe.info(`Custom rules evaluated: ${a.length} rule(s)`)}catch(b){pe.warn("\u26A0\uFE0F Error evaluating custom rules",{error:b instanceof Error?b.message:String(b)})}if(o)for(let b of Object.keys(f))f[b].issues=CR(f[b].issues);Object.keys(f).length===0&&pe.info(`\x1B[32m\u2705 No security or cost issues detected!\x1B[0m
87
- `);let D=[...new Set(y.map(b=>mr(b)).filter(b=>b!==void 0))],A=xR(f,g,D,n);return{findings:f,statistics:A}};var qi=H(require("node:fs")),Ih=H(require("node:path"));var zi=".cdk-insights-rules.json",FR=new Set(["CRITICAL","HIGH","MEDIUM","LOW"]),ER=new Set(["Operational Excellence","Security","Cost Optimization","Reliability","Performance Efficiency","Sustainability"]),RR=new Set(["property_exists","property_equals","property_matches","property_gt","property_lt","and","or"]);function Th(e,t){if(!e||typeof e!="object")return pe.warn(`Custom rule '${t}': condition must be an object`),!1;let s=e;if(!s.type||!RR.has(s.type))return pe.warn(`Custom rule '${t}': invalid condition type '${s.type}'`),!1;if(s.type==="and"||s.type==="or")return!Array.isArray(s.conditions)||s.conditions.length===0?(pe.warn(`Custom rule '${t}': '${s.type}' condition requires non-empty conditions array`),!1):s.conditions.every(n=>Th(n,t));if(typeof s.path!="string"||s.path.length===0)return pe.warn(`Custom rule '${t}': condition requires a non-empty 'path'`),!1;if(s.type==="property_matches")try{new RegExp(s.pattern)}catch{return pe.warn(`Custom rule '${t}': invalid regex pattern '${s.pattern}'`),!1}return(s.type==="property_gt"||s.type==="property_lt")&&typeof s.value!="number"?(pe.warn(`Custom rule '${t}': '${s.type}' requires a numeric value`),!1):!0}function wR(e,t){if(!e||typeof e!="object")return pe.warn(`Custom rule at index ${t}: must be an object`),null;let s=e;return typeof s.ruleId!="string"||s.ruleId.length===0?(pe.warn(`Custom rule at index ${t}: ruleId is required`),null):typeof s.name!="string"||s.name.length===0?(pe.warn(`Custom rule '${s.ruleId}': name is required`),null):typeof s.description!="string"?(pe.warn(`Custom rule '${s.ruleId}': description is required`),null):FR.has(s.severity)?ER.has(s.wafPillar)?!Array.isArray(s.resourceTypes)||s.resourceTypes.length===0?(pe.warn(`Custom rule '${s.ruleId}': resourceTypes must be a non-empty array`),null):typeof s.recommendation!="string"?(pe.warn(`Custom rule '${s.ruleId}': recommendation is required`),null):Th(s.condition,s.ruleId)?s:null:(pe.warn(`Custom rule '${s.ruleId}': invalid wafPillar '${s.wafPillar}'`),null):(pe.warn(`Custom rule '${s.ruleId}': invalid severity '${s.severity}'`),null)}function kh(e=process.cwd()){let t=Ih.join(e,zi);if(!qi.existsSync(t))return[];try{let s=qi.readFileSync(t,"utf-8"),n=JSON.parse(s);if(!n.rules||!Array.isArray(n.rules))return pe.warn(`${zi}: 'rules' must be an array`),[];let r=[];for(let i=0;i<n.rules.length;i++){let o=wR(n.rules[i],i);o&&r.push(o)}return r.length>0&&pe.info(`Loaded ${r.length} custom rule(s) from ${zi}`),r}catch(s){return pe.warn(`Failed to load ${zi}: ${s instanceof Error?s.message:String(s)}`),[]}}var st=e=>e?JSON.stringify(e).length:0,_h=e=>{if(!e||typeof e!="object")return 0;let s=e.Statement;return Array.isArray(s)?s.length:s&&typeof s=="object"?1:0},Hi=(e,t)=>{if(!e)return null;if(typeof e=="string"&&t.has(e))return e;if(typeof e!="object")return null;let s=e;if("Ref"in s&&typeof s.Ref=="string"&&t.has(s.Ref))return s.Ref;if("Fn::GetAtt"in s){let n=s["Fn::GetAtt"];if(Array.isArray(n)&&typeof n[0]=="string"&&t.has(n[0]))return n[0];if(typeof n=="string"){let r=n.split(".")[0];if(t.has(r))return r}}return null};var Qt=e=>{if(!e||typeof e!="object")return[];let s=e.Statement;return Array.isArray(s)?s:s&&typeof s=="object"?[s]:[]},oe=(e,t)=>t<=0?0:e/t,X=e=>e<1024?`${e} bytes`:`${(e/1024).toFixed(1)}KB`,fs=e=>{let s=(e.Properties||{}).Policies;return Array.isArray(s)?s.map(n=>({name:n.PolicyName||"unnamed",document:n.PolicyDocument})):[]};var re=(e,t)=>Object.entries(e).filter(([,s])=>s.Type===t),Lh=e=>{let t=new Set(Object.keys(e)),s=new Map;for(let[n,r]of Object.entries(e)){if(r.Type!=="AWS::Events::Rule")continue;let o=(r.Properties||{}).Targets;if(Array.isArray(o))for(let a of o){let c=a.DeadLetterConfig;if(!c?.Arn)continue;let u=Hi(c.Arn,t);if(!u)continue;let l=s.get(u)||[];l.push(n),s.set(u,l)}}return s},Ph=e=>{let t=new Map;for(let[s,n]of Object.entries(e)){if(n.Type!=="AWS::Events::Rule")continue;let r=n.Properties||{},i="default";typeof r.EventBusName=="string"?i=r.EventBusName:r.EventBusName&&typeof r.EventBusName=="object"&&(i=JSON.stringify(r.EventBusName));let o=t.get(i)||[];o.push(s),t.set(i,o)}return t};var Oh=(e,t,s)=>{let n=new Set(Object.keys(s)),r=t.Properties||{},i=r.SecurityGroupIngress||[],o=r.SecurityGroupEgress||[],a=Array.isArray(i)?i.length:0,c=Array.isArray(o)?o.length:0;for(let[,u]of Object.entries(s))u.Type==="AWS::EC2::SecurityGroupIngress"&&Hi(u.Properties?.GroupId,n)===e&&a++,u.Type==="AWS::EC2::SecurityGroupEgress"&&Hi(u.Properties?.GroupId,n)===e&&c++;return{inbound:a,outbound:c}};var L={SQS_POLICY_MAX_BYTES:8192,SQS_POLICY_MAX_STATEMENTS:20,IAM_INLINE_POLICY_MAX_BYTES:2048,IAM_MANAGED_POLICY_MAX_BYTES:6144,IAM_ROLE_AGGREGATE_INLINE_MAX_BYTES:10240,LAMBDA_ENV_MAX_BYTES:4096,LAMBDA_MAX_LAYERS:5,S3_BUCKET_POLICY_MAX_BYTES:20480,SNS_TOPIC_POLICY_MAX_BYTES:30720,EVENTBRIDGE_RULES_PER_BUS_DEFAULT:300,CFN_MAX_RESOURCES:500,CFN_TEMPLATE_MAX_BYTES_DIRECT:51200,CFN_TEMPLATE_MAX_BYTES_S3:460800,SECURITY_GROUP_MAX_INBOUND_RULES:60,SECURITY_GROUP_MAX_OUTBOUND_RULES:60},Fe=.8;var Bh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::SQS::QueuePolicy");for(let[i,o]of r){let c=(o.Properties||{}).PolicyDocument;if(!c)continue;let u=st(c),l=_h(c),p=o.Metadata?.["aws:cdk:path"]||i;u>=L.SQS_POLICY_MAX_BYTES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SQS queue policy is ${X(u)}, exceeding the ${X(L.SQS_POLICY_MAX_BYTES)} limit. Deployment will fail.`,"Consolidate policy statements into a single statement with broader conditions, or split targets across multiple queues. If using a shared DLQ with EventBridge targets, use Queue.fromQueueArn() to prevent CDK from auto-generating per-target statements.","CRITICAL","Reliability",p,"cdkInsights"))):oe(u,L.SQS_POLICY_MAX_BYTES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SQS queue policy is ${X(u)} (${Math.round(oe(u,L.SQS_POLICY_MAX_BYTES)*100)}% of the ${X(L.SQS_POLICY_MAX_BYTES)} limit). Adding more targets may cause deployment failure.`,"Consider consolidating policy statements or splitting targets across multiple queues before this limit is reached.","HIGH","Reliability",p,"cdkInsights"))),l>=L.SQS_POLICY_MAX_STATEMENTS?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SQS queue policy has ${l} statements, reaching or exceeding the ${L.SQS_POLICY_MAX_STATEMENTS}-statement limit.`,"Consolidate statements using wildcard conditions or array-valued Action/Resource fields instead of one statement per target.","CRITICAL","Reliability",p,"cdkInsights"))):oe(l,L.SQS_POLICY_MAX_STATEMENTS)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SQS queue policy has ${l} of ${L.SQS_POLICY_MAX_STATEMENTS} maximum statements (${Math.round(oe(l,L.SQS_POLICY_MAX_STATEMENTS)*100)}%).`,"Consider consolidating policy statements before this limit is reached.","HIGH","Reliability",p,"cdkInsights")))}return s};var Mh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::IAM::Role"),i=re(n,"AWS::IAM::User");for(let[o,a]of[...r,...i]){let c=a.Metadata?.["aws:cdk:path"]||o,u=fs(a);for(let l of u){if(!l.document)continue;let p=st(l.document);p>=L.IAM_INLINE_POLICY_MAX_BYTES?(s[o]||(s[o]={issues:[]}),s[o].issues.push(t(o,`Inline policy "${l.name}" is ${X(p)}, exceeding the ${X(L.IAM_INLINE_POLICY_MAX_BYTES)} limit. Deployment will fail.`,"Convert this inline policy to a managed policy, or reduce the number of statements and actions. Use wildcard patterns where appropriate to consolidate permissions.","CRITICAL","Reliability",c,"cdkInsights"))):oe(p,L.IAM_INLINE_POLICY_MAX_BYTES)>=Fe&&(s[o]||(s[o]={issues:[]}),s[o].issues.push(t(o,`Inline policy "${l.name}" is ${X(p)} (${Math.round(oe(p,L.IAM_INLINE_POLICY_MAX_BYTES)*100)}% of the ${X(L.IAM_INLINE_POLICY_MAX_BYTES)} limit). Adding more permissions may cause deployment failure.`,"Consider converting this inline policy to a managed policy before the limit is reached.","HIGH","Reliability",c,"cdkInsights")))}}return s};var Nh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::IAM::ManagedPolicy");for(let[i,o]of r){let c=(o.Properties||{}).PolicyDocument;if(!c)continue;let u=st(c),l=o.Metadata?.["aws:cdk:path"]||i;u>=L.IAM_MANAGED_POLICY_MAX_BYTES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Managed policy is ${X(u)}, exceeding the ${X(L.IAM_MANAGED_POLICY_MAX_BYTES)} limit. Deployment will fail.`,"Split this managed policy into multiple smaller policies, or consolidate statements using wildcard patterns to reduce size.","CRITICAL","Reliability",l,"cdkInsights"))):oe(u,L.IAM_MANAGED_POLICY_MAX_BYTES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Managed policy is ${X(u)} (${Math.round(oe(u,L.IAM_MANAGED_POLICY_MAX_BYTES)*100)}% of the ${X(L.IAM_MANAGED_POLICY_MAX_BYTES)} limit). Adding more permissions may cause deployment failure.`,"Consider splitting this managed policy into multiple policies before the limit is reached.","HIGH","Reliability",l,"cdkInsights")))}return s};var Wh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::IAM::Role");for(let[i,o]of r){let a=o.Metadata?.["aws:cdk:path"]||i,c=fs(o),u=0;for(let l of c)l.document&&(u+=st(l.document));u!==0&&(u>=L.IAM_ROLE_AGGREGATE_INLINE_MAX_BYTES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Aggregate inline policy size is ${X(u)} across ${c.length} policies, exceeding the ${X(L.IAM_ROLE_AGGREGATE_INLINE_MAX_BYTES)} limit. Deployment will fail.`,"Convert some inline policies to managed policies to reduce the aggregate inline size. Consider consolidating overlapping permissions across policies.","CRITICAL","Reliability",a,"cdkInsights"))):oe(u,L.IAM_ROLE_AGGREGATE_INLINE_MAX_BYTES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Aggregate inline policy size is ${X(u)} across ${c.length} policies (${Math.round(oe(u,L.IAM_ROLE_AGGREGATE_INLINE_MAX_BYTES)*100)}% of the ${X(L.IAM_ROLE_AGGREGATE_INLINE_MAX_BYTES)} limit). Adding more inline policies may cause deployment failure.`,"Consider converting some inline policies to managed policies before the aggregate limit is reached.","HIGH","Reliability",a,"cdkInsights"))))}return s};var jh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::Lambda::Function");for(let[i,o]of r){let c=(o.Properties||{}).Environment;if(!c?.Variables)continue;let u=st(c.Variables),l=o.Metadata?.["aws:cdk:path"]||i;u>=L.LAMBDA_ENV_MAX_BYTES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Lambda environment variables are ${X(u)}, exceeding the ${X(L.LAMBDA_ENV_MAX_BYTES)} limit. Deployment will fail.`,"Move large configuration values to SSM Parameter Store or Secrets Manager. Use a single JSON-encoded parameter instead of many individual environment variables.","CRITICAL","Reliability",l,"cdkInsights"))):oe(u,L.LAMBDA_ENV_MAX_BYTES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Lambda environment variables are ${X(u)} (${Math.round(oe(u,L.LAMBDA_ENV_MAX_BYTES)*100)}% of the ${X(L.LAMBDA_ENV_MAX_BYTES)} limit). Adding more variables may cause deployment failure.`,"Consider moving some configuration values to SSM Parameter Store or Secrets Manager before the limit is reached.","HIGH","Reliability",l,"cdkInsights")))}return s};var $h=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::Lambda::Function");for(let[i,o]of r){let c=(o.Properties||{}).Layers;if(!Array.isArray(c))continue;let u=c.length,l=o.Metadata?.["aws:cdk:path"]||i;u>L.LAMBDA_MAX_LAYERS?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Lambda function has ${u} layers, exceeding the maximum of ${L.LAMBDA_MAX_LAYERS} layers. Deployment will fail.`,"Consolidate layers by combining related dependencies into a single layer, or move some dependencies into the deployment package itself.","CRITICAL","Reliability",l,"cdkInsights"))):u===L.LAMBDA_MAX_LAYERS&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Lambda function has ${u} of ${L.LAMBDA_MAX_LAYERS} maximum layers. There is no headroom to add additional layers.`,"Consider consolidating layers by combining related dependencies into a single layer to free up a layer slot for future needs.","HIGH","Reliability",l,"cdkInsights")))}return s};var Uh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::S3::BucketPolicy");for(let[i,o]of r){let c=(o.Properties||{}).PolicyDocument;if(!c)continue;let u=st(c),l=o.Metadata?.["aws:cdk:path"]||i;u>=L.S3_BUCKET_POLICY_MAX_BYTES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`S3 bucket policy is ${X(u)}, exceeding the ${X(L.S3_BUCKET_POLICY_MAX_BYTES)} limit. Deployment will fail.`,"Consolidate policy statements or split resources across multiple buckets to reduce policy size.","CRITICAL","Reliability",l,"cdkInsights"))):oe(u,L.S3_BUCKET_POLICY_MAX_BYTES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`S3 bucket policy is ${X(u)} (${Math.round(oe(u,L.S3_BUCKET_POLICY_MAX_BYTES)*100)}% of the ${X(L.S3_BUCKET_POLICY_MAX_BYTES)} limit). Adding more statements may cause deployment failure.`,"Consider consolidating policy statements or splitting resources across multiple buckets before this limit is reached.","HIGH","Reliability",l,"cdkInsights")))}return s};var Gh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::SNS::TopicPolicy");for(let[i,o]of r){let c=(o.Properties||{}).PolicyDocument;if(!c)continue;let u=st(c),l=o.Metadata?.["aws:cdk:path"]||i;u>=L.SNS_TOPIC_POLICY_MAX_BYTES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SNS topic policy is ${X(u)}, exceeding the ${X(L.SNS_TOPIC_POLICY_MAX_BYTES)} limit. Deployment will fail.`,"Consolidate policy statements or split subscriptions across multiple topics to reduce policy size.","CRITICAL","Reliability",l,"cdkInsights"))):oe(u,L.SNS_TOPIC_POLICY_MAX_BYTES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SNS topic policy is ${X(u)} (${Math.round(oe(u,L.SNS_TOPIC_POLICY_MAX_BYTES)*100)}% of the ${X(L.SNS_TOPIC_POLICY_MAX_BYTES)} limit). Adding more statements may cause deployment failure.`,"Consider consolidating policy statements or splitting subscriptions across multiple topics before this limit is reached.","HIGH","Reliability",l,"cdkInsights")))}return s};var zh=(e,t)=>{let s={},n=e.Resources||{},r=Ph(n);for(let[i,o]of r){let a=o.length,c=o[0],l=n[c]?.Metadata?.["aws:cdk:path"]||c;a>=L.EVENTBRIDGE_RULES_PER_BUS_DEFAULT?(s[c]||(s[c]={issues:[]}),s[c].issues.push(t(c,`EventBridge bus "${i}" has ${a} rules, reaching or exceeding the ${L.EVENTBRIDGE_RULES_PER_BUS_DEFAULT}-rule default limit. Deployment may fail.`,"Request a service quota increase for EventBridge rules per bus, or split rules across multiple event buses.","HIGH","Reliability",l,"cdkInsights"))):oe(a,L.EVENTBRIDGE_RULES_PER_BUS_DEFAULT)>=Fe&&(s[c]||(s[c]={issues:[]}),s[c].issues.push(t(c,`EventBridge bus "${i}" has ${a} rules (${Math.round(oe(a,L.EVENTBRIDGE_RULES_PER_BUS_DEFAULT)*100)}% of the ${L.EVENTBRIDGE_RULES_PER_BUS_DEFAULT}-rule default limit).`,"Consider requesting a service quota increase or splitting rules across multiple event buses before this limit is reached.","MEDIUM","Reliability",l,"cdkInsights")))}return s};var qh=(e,t)=>{let s={},n=Object.keys(e.Resources||{}).length,r="__TEMPLATE_LEVEL__";return n>=L.CFN_MAX_RESOURCES?(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,`CloudFormation template contains ${n} resources, reaching or exceeding the ${L.CFN_MAX_RESOURCES}-resource limit. Deployment will fail.`,"Split the stack into multiple nested stacks or separate stacks to stay within the CloudFormation resource limit.","CRITICAL","Reliability","__TEMPLATE_LEVEL__","cdkInsights"))):oe(n,L.CFN_MAX_RESOURCES)>=Fe&&(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,`CloudFormation template contains ${n} resources (${Math.round(oe(n,L.CFN_MAX_RESOURCES)*100)}% of the ${L.CFN_MAX_RESOURCES}-resource limit).`,"Consider splitting the stack into multiple nested stacks or separate stacks before this limit is reached.","HIGH","Reliability","__TEMPLATE_LEVEL__","cdkInsights"))),s};var Hh=(e,t)=>{let s={},n=JSON.stringify(e).length,r="__TEMPLATE_LEVEL__";return n>=L.CFN_TEMPLATE_MAX_BYTES_S3?(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,`CloudFormation template is ${X(n)}, exceeding the ${X(L.CFN_TEMPLATE_MAX_BYTES_S3)} S3 upload limit. Deployment will fail regardless of deployment method.`,"Split the stack into multiple nested stacks or separate stacks to reduce template size.","CRITICAL","Reliability","__TEMPLATE_LEVEL__","cdkInsights"))):oe(n,L.CFN_TEMPLATE_MAX_BYTES_S3)>=Fe&&(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,`CloudFormation template is ${X(n)} (${Math.round(oe(n,L.CFN_TEMPLATE_MAX_BYTES_S3)*100)}% of the ${X(L.CFN_TEMPLATE_MAX_BYTES_S3)} S3 upload limit).`,"Consider splitting the stack into multiple nested stacks or separate stacks before this limit is reached.","HIGH","Reliability","__TEMPLATE_LEVEL__","cdkInsights"))),n>=L.CFN_TEMPLATE_MAX_BYTES_DIRECT?(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,`CloudFormation template is ${X(n)}, exceeding the ${X(L.CFN_TEMPLATE_MAX_BYTES_DIRECT)} direct upload limit. Template must be uploaded via S3.`,"Ensure the template is deployed via S3 (CDK does this by default). Consider splitting the stack if it continues to grow.","HIGH","Reliability","__TEMPLATE_LEVEL__","cdkInsights"))):oe(n,L.CFN_TEMPLATE_MAX_BYTES_DIRECT)>=Fe&&(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,`CloudFormation template is ${X(n)} (${Math.round(oe(n,L.CFN_TEMPLATE_MAX_BYTES_DIRECT)*100)}% of the ${X(L.CFN_TEMPLATE_MAX_BYTES_DIRECT)} direct upload limit).`,"Ensure the template is deployed via S3 if it exceeds the direct upload limit. Consider splitting the stack if it continues to grow.","HIGH","Reliability","__TEMPLATE_LEVEL__","cdkInsights"))),s};var Vh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::EC2::SecurityGroup");for(let[i,o]of r){let{inbound:a,outbound:c}=Oh(i,o,n),u=o.Metadata?.["aws:cdk:path"]||i;a>=L.SECURITY_GROUP_MAX_INBOUND_RULES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Security group has ${a} inbound rules, reaching or exceeding the ${L.SECURITY_GROUP_MAX_INBOUND_RULES}-rule limit. Deployment will fail.`,"Consolidate rules using CIDR ranges or prefix lists, or split workloads across multiple security groups.","CRITICAL","Reliability",u,"cdkInsights"))):oe(a,L.SECURITY_GROUP_MAX_INBOUND_RULES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Security group has ${a} inbound rules (${Math.round(oe(a,L.SECURITY_GROUP_MAX_INBOUND_RULES)*100)}% of the ${L.SECURITY_GROUP_MAX_INBOUND_RULES}-rule limit).`,"Consider consolidating rules using CIDR ranges or prefix lists before this limit is reached.","HIGH","Reliability",u,"cdkInsights"))),c>=L.SECURITY_GROUP_MAX_OUTBOUND_RULES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Security group has ${c} outbound rules, reaching or exceeding the ${L.SECURITY_GROUP_MAX_OUTBOUND_RULES}-rule limit. Deployment will fail.`,"Consolidate rules using CIDR ranges or prefix lists, or split workloads across multiple security groups.","CRITICAL","Reliability",u,"cdkInsights"))):oe(c,L.SECURITY_GROUP_MAX_OUTBOUND_RULES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Security group has ${c} outbound rules (${Math.round(oe(c,L.SECURITY_GROUP_MAX_OUTBOUND_RULES)*100)}% of the ${L.SECURITY_GROUP_MAX_OUTBOUND_RULES}-rule limit).`,"Consider consolidating rules using CIDR ranges or prefix lists before this limit is reached.","HIGH","Reliability",u,"cdkInsights")))}return s};var Kh=(e,t)=>{let s={},n=e.Resources||{},r=Lh(n);for(let[i,o]of r){let a=o.length;if(a<=10)continue;let u=n[i]?.Metadata?.["aws:cdk:path"]||i;a>15?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SQS queue is used as a shared DLQ by ${a} EventBridge rules. This many targets will cause CDK to auto-generate excessive per-target SQS policy statements, risking policy size limit breaches.`,"Use dedicated DLQs per rule group, or create a single consolidated SQS policy using Queue.fromQueueArn() to prevent CDK from auto-generating per-target policy statements.","CRITICAL","Reliability",u,"cdkInsights"))):(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SQS queue is used as a shared DLQ by ${a} EventBridge rules. As more rules are added, CDK will auto-generate per-target SQS policy statements that may exceed the policy size limit.`,"Use dedicated DLQs per rule group, or create a single consolidated SQS policy using Queue.fromQueueArn() to prevent CDK from auto-generating per-target policy statements.","HIGH","Reliability",u,"cdkInsights")))}return s};var Zh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::Events::Rule");for(let[i,o]of r){let c=(o.Properties||{}).Targets;if(!Array.isArray(c))continue;let u=o.Metadata?.["aws:cdk:path"]||i,l=[];for(let p=0;p<c.length;p++)c[p].DeadLetterConfig||l.push(p);l.length>0&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`EventBridge rule has ${l.length} target(s) without a DeadLetterConfig. Failed invocations will be silently dropped after exhausting retries.`,"Configure a DeadLetterConfig with an SQS queue on each target to capture failed invocations for debugging and reprocessing.","MEDIUM","Reliability",u,"cdkInsights")))}return s};var Yh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::Lambda::Function"),i=re(n,"AWS::Logs::LogGroup"),o=new Set;for(let[,a]of i){let c=a.Properties?.LogGroupName;typeof c=="string"&&o.add(c)}for(let[a,c]of r){let l=(c.Properties||{}).FunctionName;if(typeof l!="string")continue;let p=`/aws/lambda/${l}`;if(!o.has(p)){let d=c.Metadata?.["aws:cdk:path"]||a;s[a]||(s[a]={issues:[]}),s[a].issues.push(t(a,`Lambda function "${l}" does not have an explicit AWS::Logs::LogGroup resource. CloudWatch will auto-create a log group with no retention policy, leading to indefinite log retention and increased costs.`,"Define an explicit AWS::Logs::LogGroup with a RetentionInDays property for this Lambda function to control log retention and avoid unbounded storage costs.","LOW","Operational Excellence",d,"cdkInsights"))}}return s};var IR=e=>{for(let[,t]of Object.entries(e)){let s=t.Metadata?.["aws:cdk:path"];if(s&&/prod/i.test(s))return!0;if(t.Metadata){for(let n of Object.values(t.Metadata))if(typeof n=="string"&&/prod/i.test(n))return!0}}return!1},Jh=(e,t)=>{let s={},n=e.Resources||{},r=IR(n),i=[...re(n,"AWS::DynamoDB::Table"),...re(n,"AWS::DynamoDB::GlobalTable")];for(let[o,a]of i)if(!((a.Properties||{}).PointInTimeRecoverySpecification?.PointInTimeRecoveryEnabled===!0)){let p=a.Metadata?.["aws:cdk:path"]||o,d=r?"HIGH":"MEDIUM",f=r?" This appears to be a production stack, making data recovery capabilities especially important.":"";s[o]||(s[o]={issues:[]}),s[o].issues.push(t(o,`DynamoDB table does not have Point-in-Time Recovery (PITR) enabled.${f} Without PITR, accidental data deletions or corruption cannot be recovered.`,"Enable PointInTimeRecoverySpecification.PointInTimeRecoveryEnabled on this table to allow restoration to any point within the last 35 days.",d,"Reliability",p,"cdkInsights"))}return s};var Qh=e=>{let t=e.Effect||"Allow",s=Array.isArray(e.Action)?[...e.Action].sort():typeof e.Action=="string"?[e.Action]:[],n=Array.isArray(e.Resource)?[...e.Resource].sort():typeof e.Resource=="string"?[e.Resource]:[];return`${t}|${s.join(",")}|${n.join(",")}`},Xh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::IAM::Role"),i=re(n,"AWS::IAM::Policy");for(let[o,a]of r){let c=a.Metadata?.["aws:cdk:path"]||o,u=[],l=fs(a);for(let f of l){if(!f.document)continue;let m=Qt(f.document);for(let g of m)u.push({key:Qh(g),source:`inline policy "${f.name}"`})}for(let[,f]of i){let m=f.Properties||{},g=m.Roles;if(!Array.isArray(g)||!g.some(b=>typeof b=="string"?b===o:b&&typeof b=="object"?b.Ref===o:!1))continue;let y=m.PolicyDocument;if(!y)continue;let D=Qt(y),A=m.PolicyName||"unnamed";for(let b of D)u.push({key:Qh(b),source:`attached policy "${A}"`})}let p=new Map;for(let{key:f,source:m}of u){let g=p.get(f)||[];g.push(m),p.set(f,g)}let d=0;for(let[,f]of p)f.length>1&&(d+=f.length-1);d>0&&(s[o]||(s[o]={issues:[]}),s[o].issues.push(t(o,`IAM role has ${d} duplicate policy statement(s) across its inline and attached policies. Duplicate statements increase policy size without adding permissions.`,"Consolidate duplicate statements into a single policy. Review inline policies and attached AWS::IAM::Policy resources for overlapping Effect + Action + Resource combinations.","LOW","Security",c,"cdkInsights")))}return s};var TR=e=>{let t=e.Effect||"Allow",s=JSON.stringify(e.Principal||"*"),n=JSON.stringify(e.Condition||null);return`${t}|${s}|${n}`},kR=e=>{let t=e.Action;return Array.isArray(t)?t:typeof t=="string"?[t]:[]},ey=(e,t)=>{let s={},n=e.Resources||{},r=[...re(n,"AWS::SQS::QueuePolicy"),...re(n,"AWS::SNS::TopicPolicy")];for(let[i,o]of r){let c=(o.Properties||{}).PolicyDocument;if(!c)continue;let u=Qt(c);if(u.length<=2)continue;let l=o.Metadata?.["aws:cdk:path"]||i,p=new Map;for(let h=0;h<u.length;h++){let y=TR(u[h]),D=kR(u[h]),A=p.get(y)||[];A.push({actions:D,index:h}),p.set(y,A)}let d=0;for(let[,h]of p)h.length>1&&(d+=h.length-1);if(d<=0||d<2)continue;let f=u.length,g=d/f>.5?"MEDIUM":"LOW";s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Policy has ${f} statements, of which ${d} could be consolidated. Multiple statements share the same Effect, Principal, and Condition but differ only in Action values.`,"Consolidate statements that share the same Effect, Principal, and Condition into a single statement with an Action array. This reduces policy size and improves readability.",g,"Reliability",l,"cdkInsights"))}return s};var _R=[{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/service-role\/AWSLambdaBasicExecutionRole$/,name:"AWSLambdaBasicExecutionRole",actions:["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/service-role\/AWSLambdaVPCAccessExecutionRole$/,name:"AWSLambdaVPCAccessExecutionRole",actions:["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents","ec2:CreateNetworkInterface","ec2:DescribeNetworkInterfaces","ec2:DeleteNetworkInterface"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AmazonDynamoDBReadOnlyAccess$/,name:"AmazonDynamoDBReadOnlyAccess",actions:["dynamodb:BatchGetItem","dynamodb:GetItem","dynamodb:Query","dynamodb:Scan","dynamodb:DescribeTable","dynamodb:DescribeReservedCapacity","dynamodb:DescribeReservedCapacityOfferings","dynamodb:ListTables","dynamodb:DescribeStream","dynamodb:ListStreams"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AmazonDynamoDBFullAccess$/,name:"AmazonDynamoDBFullAccess",actions:["dynamodb:*"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AmazonS3ReadOnlyAccess$/,name:"AmazonS3ReadOnlyAccess",actions:["s3:Get*","s3:List*"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AmazonS3FullAccess$/,name:"AmazonS3FullAccess",actions:["s3:*"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AmazonSQSFullAccess$/,name:"AmazonSQSFullAccess",actions:["sqs:*"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AmazonSNSFullAccess$/,name:"AmazonSNSFullAccess",actions:["sns:*"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/CloudWatchFullAccess$/,name:"CloudWatchFullAccess",actions:["cloudwatch:*","logs:*"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AWSStepFunctionsFullAccess$/,name:"AWSStepFunctionsFullAccess",actions:["states:*"]}],LR=(e,t)=>{if(e===t)return!0;let s=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${s}$`,"i").test(e)},ty=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::IAM::Role");for(let[i,o]of r){let c=(o.Properties||{}).ManagedPolicyArns;if(!Array.isArray(c)||c.length===0)continue;let u=[];for(let m of c)if(typeof m=="string"){for(let g of _R)if(g.pattern.test(m))for(let h of g.actions)u.push({action:h,policyName:g.name})}if(u.length===0)continue;let l=fs(o),p=[];for(let m of l){if(!m.document)continue;let g=Qt(m.document);for(let h of g){if((h.Effect||"Allow")!=="Allow")continue;let D=Array.isArray(h.Action)?h.Action:typeof h.Action=="string"?[h.Action]:[];for(let A of D)for(let b of u)if(LR(A,b.action)){p.push({action:A,policyName:b.policyName,inlinePolicy:m.name});break}}}if(p.length===0)continue;let d=o.Metadata?.["aws:cdk:path"]||i,f=[...new Set(p.map(m=>m.policyName))];s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`IAM role has ${p.length} inline action(s) that overlap with permissions already granted by managed policy(ies): ${f.join(", ")}. Redundant inline statements increase policy size without adding permissions.`,"Remove redundant inline policy statements that are already covered by attached managed policies. Review the managed policy permissions before adding inline actions.","LOW","Security",d,"cdkInsights"))}return s};var PR=new Set(["aws:SourceArn","aws:SourceAccount","aws:PrincipalOrgID","aws:SourceVpce"]),OR=e=>{if(e==="*")return!0;if(e&&typeof e=="object"&&!Array.isArray(e)){let t=e,s=t.AWS;if(s==="*"||Array.isArray(s)&&s.includes("*")||t.Service==="*")return!0}return!1},BR=e=>{if(!e||typeof e!="object")return!1;let t=e;for(let s of Object.values(t))if(s&&typeof s=="object"){let n=s;for(let r of Object.keys(n))if(PR.has(r))return!0}return!1},sy=(e,t)=>{let s={},n=e.Resources||{},r=[];for(let[i,o]of re(n,"AWS::SQS::QueuePolicy")){let a=o.Metadata?.["aws:cdk:path"]||i;r.push([i,o.Properties?.PolicyDocument,a])}for(let[i,o]of re(n,"AWS::SNS::TopicPolicy")){let a=o.Metadata?.["aws:cdk:path"]||i;r.push([i,o.Properties?.PolicyDocument,a])}for(let[i,o]of re(n,"AWS::S3::BucketPolicy")){let a=o.Metadata?.["aws:cdk:path"]||i;r.push([i,o.Properties?.PolicyDocument,a])}for(let[i,o]of re(n,"AWS::KMS::Key")){let a=o.Metadata?.["aws:cdk:path"]||i;r.push([i,o.Properties?.KeyPolicy,a])}for(let[i,o,a]of r){if(!o)continue;let c=Qt(o);for(let u of c){if((u.Effect||"Allow")!=="Allow"||!OR(u.Principal))continue;let p=u.Condition,d=p!=null;d&&BR(p)||(d?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,'Resource policy has a statement with Principal: "*" and a Condition that does not use a strongly restrictive key (aws:SourceArn, aws:SourceAccount, aws:PrincipalOrgID, or aws:SourceVpce). The current condition may not sufficiently limit access.',"Replace or supplement the existing Condition with aws:SourceArn, aws:SourceAccount, aws:PrincipalOrgID, or aws:SourceVpce to ensure only trusted sources can access this resource.","MEDIUM","Security",a,"cdkInsights"))):(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,'Resource policy has a statement with Principal: "*" and no Condition. This allows any AWS account or anonymous user to invoke the allowed actions.',"Add a restrictive Condition using aws:SourceArn, aws:SourceAccount, aws:PrincipalOrgID, or aws:SourceVpce to limit access to trusted sources.","HIGH","Security",a,"cdkInsights"))))}}return s};var MR=[{ruleId:"TL-LIMIT-001",title:"SQS Queue Policy Size Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Bh,description:"SQS queue policies must be under 8KB / 20 statements. Commonly exceeded when CDK auto-generates per-target policy statements for shared DLQs."},{ruleId:"TL-LIMIT-002",title:"IAM Inline Policy Size Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Mh,description:"Each IAM inline policy must be under 2,048 bytes when URL-encoded."},{ruleId:"TL-LIMIT-003",title:"IAM Managed Policy Size Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Nh,description:"IAM managed policies must be under 6,144 bytes."},{ruleId:"TL-LIMIT-004",title:"IAM Role Aggregate Inline Policy Size",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Wh,description:"Total size of all inline policies on a single IAM role must be under 10,240 bytes."},{ruleId:"TL-LIMIT-005",title:"Lambda Environment Variables Size Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:jh,description:"Lambda environment variables must total under 4KB including keys and values."},{ruleId:"TL-LIMIT-006",title:"Lambda Layers Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:$h,description:"Lambda functions can have a maximum of 5 layers."},{ruleId:"TL-LIMIT-007",title:"S3 Bucket Policy Size Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Uh,description:"S3 bucket policies must be under 20KB."},{ruleId:"TL-LIMIT-008",title:"SNS Topic Policy Size Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Gh,description:"SNS topic policies must be under 30KB."},{ruleId:"TL-LIMIT-009",title:"EventBridge Rules Per Bus Limit",category:"serviceLimits",defaultSeverity:"HIGH",wafPillar:"Reliability",check:zh,description:"Default quota is 300 EventBridge rules per event bus."},{ruleId:"TL-LIMIT-010",title:"CloudFormation Stack Resource Count",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:qh,description:"CloudFormation stacks have a hard limit of 500 resources."},{ruleId:"TL-LIMIT-011",title:"CloudFormation Template Size",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Hh,description:"CloudFormation templates have a 51KB limit (direct) or 460KB limit (S3)."},{ruleId:"TL-LIMIT-012",title:"Security Group Rules Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Vh,description:"Security groups have a default limit of 60 inbound and 60 outbound rules."},{ruleId:"TL-XRES-001",title:"Shared DLQ with Too Many EventBridge Targets",category:"crossResourceAntiPatterns",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Kh,description:"CDK generates one SQS policy statement per EventBridge target. Too many targets sharing a DLQ causes the policy to exceed the 8KB limit."},{ruleId:"TL-XRES-002",title:"EventBridge Targets Without DLQ",category:"crossResourceAntiPatterns",defaultSeverity:"MEDIUM",wafPillar:"Reliability",check:Zh,description:"EventBridge rule targets should have a Dead Letter Queue for failed event delivery."},{ruleId:"TL-XRES-003",title:"Lambda Without Explicit Log Group",category:"crossResourceAntiPatterns",defaultSeverity:"LOW",wafPillar:"Operational Excellence",check:Yh,description:"Lambda functions without explicit CloudWatch Log Groups use auto-created groups with infinite retention."},{ruleId:"TL-XRES-004",title:"DynamoDB Without Point-in-Time Recovery",category:"crossResourceAntiPatterns",defaultSeverity:"MEDIUM",wafPillar:"Reliability",check:Jh,description:"DynamoDB tables should have PITR enabled, especially in production stacks."},{ruleId:"TL-XRES-005",title:"Duplicate IAM Policy Statements",category:"crossResourceAntiPatterns",defaultSeverity:"LOW",wafPillar:"Security",check:Xh,description:"Duplicate policy statements across a role waste policy size budget and may indicate copy-paste errors."},{ruleId:"TL-POL-001",title:"Redundant SQS/SNS Policy Statements",category:"policyAnalysis",defaultSeverity:"MEDIUM",wafPillar:"Reliability",check:ey,description:"Policy statements that could be consolidated to reduce policy size."},{ruleId:"TL-POL-002",title:"IAM Overlapping Managed and Inline Policies",category:"policyAnalysis",defaultSeverity:"LOW",wafPillar:"Security",check:ty,description:"Inline policy statements that duplicate permissions from attached managed policies."},{ruleId:"TL-POL-003",title:"Overly Broad Resource Policy Principals",category:"policyAnalysis",defaultSeverity:"HIGH",wafPillar:"Security",check:sy,description:"Resource policies with wildcard (*) principals without restrictive conditions."}],Dc=(e,t,s)=>{let n={};for(let r of MR)if(!(s&&s.length>0&&!s.some(o=>r.ruleId.toLowerCase().includes(o.toLowerCase())||r.category.toLowerCase().includes(o.toLowerCase())||r.title.toLowerCase().includes(o.toLowerCase()))))try{let i=r.check(e,t);for(let[o,a]of Object.entries(i)){n[o]||(n[o]={issues:[]});for(let c of a.issues)c.ruleId=r.ruleId;n[o].issues.push(...a.issues)}}catch{}return n};var Cr={DEFAULT_MAX_CONCURRENT:5,DEFAULT_RETRY_ATTEMPTS:3,DEFAULT_RETRY_DELAY_MS:1e3,DEFAULT_TIMEOUT_MS:60*1e3};var Qi=H(require("node:crypto")),Ke=H(require("node:fs")),Xi=H(require("node:path"));var NR=["CI","BUILD_ID","BUILD_NUMBER","CIRCLECI","TRAVIS","GITHUB_ACTIONS","GITLAB_CI","JENKINS_URL","BITBUCKET_BUILD_NUMBER","TEAMCITY_VERSION","BAMBOO_BUILDKEY","GO_PIPELINE_NAME","BUILDKITE","DRONE","SEMAPHORE","APPVEYOR","WERCKER","CODEBUILD_BUILD_ID","AWS_CODEBUILD_BUILD_ID","TF_BUILD","CIRRUS_CI","NETLIFY","VERCEL","RENDER","HEROKU_TEST_RUN_ID"],xr=()=>NR.some(e=>!!process.env[e]);var ct=H(require("node:fs")),ry=H(require("node:os")),Zi=H(require("node:path"));var WR={features:{staticAnalysis:{free:!0,pro:!0,trial:!0,team:!0},multiStackAnalysis:{free:!0,pro:!0,trial:!0,team:!0},localAnalysis:{free:!0,pro:!0,trial:!0,team:!0},basicServiceChecks:{free:!0,pro:!0,trial:!0,team:!0},aiAnalysis:{free:!1,pro:!0,trial:!0,team:!0},contextualFixes:{free:!1,pro:!0,trial:!0,team:!0},smartPrioritization:{free:!1,pro:!0,trial:!0,team:!0},naturalLanguageExplanations:{free:!1,pro:!0,trial:!0,team:!0},customAITraining:{free:!1,pro:!1,trial:!1,team:!0},githubIntegration:{free:!1,pro:!0,trial:!0,team:!0},teamDashboards:{free:!1,pro:!0,trial:!0,team:!0},collaborativeCommenting:{free:!1,pro:!1,trial:!1,team:!0},sharedConfigurations:{free:!1,pro:!0,trial:!0,team:!0},jsonOutput:{free:!0,pro:!0,trial:!0,team:!0},tableOutput:{free:!0,pro:!0,trial:!0,team:!0},markdownOutput:{free:!0,pro:!0,trial:!0,team:!0},pdfReports:{free:!1,pro:!0,trial:!0,team:!0},executiveSummaries:{free:!1,pro:!1,trial:!1,team:!0},customBrandedReports:{free:!1,pro:!1,trial:!1,team:!0},customRuleSets:{free:!1,pro:!0,trial:!0,team:!0},advancedCompliance:{free:!1,pro:!0,trial:!0,team:!0},cloudAnalysis:{free:!1,pro:!0,trial:!0,team:!0},parallelAnalysis:{free:!1,pro:!0,trial:!0,team:!0},caching:{free:!1,pro:!0,trial:!0,team:!0},largeProjectSupport:{free:!1,pro:!0,trial:!0,team:!0},advancedFiltering:{free:!1,pro:!1,trial:!1,team:!0},apiAccess:{free:!1,pro:!1,trial:!1,team:!0},webhookNotifications:{free:!1,pro:!1,trial:!1,team:!0},cicdIntegration:{free:!1,pro:!1,trial:!1,team:!0},customIntegrations:{free:!1,pro:!1,trial:!1,team:!0},roleBasedAccess:{free:!1,pro:!1,trial:!1,team:!0},teamAnalytics:{free:!1,pro:!1,trial:!1,team:!0},auditTrails:{free:!1,pro:!1,trial:!1,team:!0},ssoIntegration:{free:!1,pro:!1,trial:!1,team:!0},multiTenantSupport:{free:!1,pro:!1,trial:!1,team:!0},whiteLabeling:{free:!1,pro:!1,trial:!1,team:!0},customBranding:{free:!1,pro:!1,trial:!1,team:!0},communitySupport:{free:!0,pro:!0,trial:!0,team:!0},emailSupport:{free:!1,pro:!0,trial:!0,team:!0},prioritySupport:{free:!1,pro:!1,trial:!1,team:!0},dedicatedAccountManager:{free:!1,pro:!1,trial:!1,team:!0},customTraining:{free:!1,pro:!1,trial:!1,team:!0},soc2Compliance:{free:!1,pro:!0,trial:!0,team:!0},hipaaCompliance:{free:!1,pro:!0,trial:!0,team:!0},fedrampCompliance:{free:!1,pro:!1,trial:!1,team:!0},customCompliance:{free:!1,pro:!1,trial:!1,team:!0}}},jR=(e=WR)=>({isFeatureEnabled:(o,a)=>e.features[o]?.[a]??!1,getEnabledFeatures:o=>Object.entries(e.features).filter(([,a])=>a[o]).map(([a])=>a),getAllFeatures:()=>Object.keys(e.features),getFeatureTiers:o=>e.features[o],getUpgradePath:(o,a)=>{let c=["free","pro","trial","team"],u=c.indexOf(a);for(let l=u+1;l<c.length;l++){let p=c[l];if(e.features[o]?.[p])return{required:!0,tier:p,path:`https://cdkinsights.dev/pricing?tier=${p}&feature=${o}`}}return null}}),Ar=jR();var ny=(e,t,s)=>{let n=Ar.getUpgradePath(e,t),r=s?` for ${s}`:"";return n?`\u{1F4A1} Upgrade to ${n.tier} to access ${e}${r}. Visit: ${n.path}`:`\u26A0\uFE0F ${e}${r} is not available for your current tier.`};var Vi=Zi.join(ry.homedir(),".cdk-insights","cache"),e$=Zi.join(Vi,"analysis-cache.json"),bc=Zi.join(Vi,"cache-stats.json"),Ks={totalHits:0,totalMisses:0,totalSets:0,totalClears:0,cacheSize:0,maxCacheSize:1e3},On=null,Ki=!1,$R=()=>{try{if(ct.existsSync(bc)){let e=ct.readFileSync(bc,"utf-8");try{Ks={...Ks,...JSON.parse(e)}}catch(t){ms.warn("Could not parse cache statistics file",{error:t instanceof Error?t.message:String(t)})}}}catch(e){ms.warn("Could not load cache statistics",{error:e instanceof Error?e.message:String(e)})}},vc=()=>{Ki=!0,!On&&(On=setTimeout(()=>{Ki&&iy(),On=null},5e3))},iy=()=>{try{UR(),ct.writeFileSync(bc,JSON.stringify(Ks,null,2),"utf-8"),Ki=!1}catch(e){ms.warn("Could not save cache statistics",{error:e instanceof Error?e.message:String(e)})}},Sc=()=>{On&&(clearTimeout(On),On=null),Ki&&iy()};process.on("exit",Sc);process.on("SIGINT",()=>{Sc(),process.exit(0)});process.on("SIGTERM",()=>{Sc(),process.exit(0)});$R();var UR=()=>{ct.existsSync(Vi)||ct.mkdirSync(Vi,{recursive:!0})};var oy=()=>{Ks.totalHits++,vc()},Yi=()=>{Ks.totalMisses++,vc()},ay=()=>{Ks.totalSets++,Ks.cacheSize++,vc()};var Bn=Xi.join(process.env.HOME||process.env.USERPROFILE||"",".cdk-insights","cache","analysis-cache.json"),GR=()=>{let e=Xi.dirname(Bn);Ke.existsSync(e)||Ke.mkdirSync(e,{recursive:!0})},zR=()=>{if(xr())return new Map;try{if(Ke.existsSync(Bn)){let e=JSON.parse(Ke.readFileSync(Bn,"utf-8")),t=new Map,s=Date.now();for(let[n,r]of e.entries||[])s-r.timestamp<=r.ttl&&t.set(n,r);return t}}catch(e){ms.warn("Could not load cache from disk",{error:e instanceof Error?e.message:String(e)})}return new Map},cy=e=>{if(!xr())try{GR();let t={entries:Array.from(e.entries()),timestamp:Date.now(),version:"1.0"};Ke.writeFileSync(Bn,JSON.stringify(t,null,2),"utf-8")}catch(t){ms.warn("Could not save cache to disk",{error:t instanceof Error?t.message:String(t)})}},qR=e=>{try{let t=Ke.statSync(e),s=Ke.readFileSync(e,"utf-8"),n=Qi.createHash("sha256").update(s).digest("hex");return{filePath:e,lastModified:t.mtime.getTime(),hash:n}}catch{return null}},HR=e=>{let t={};for(let s of e){let n=qR(s);n&&(t[s]=n)}return t},VR=(e,t)=>e?Qi.createHash("sha256").update(`${e}:${t||""}`).digest("hex").slice(0,16):"no-auth",KR=e=>Qi.createHash("sha256").update(JSON.stringify(e)).digest("hex"),uy=(e,t,s,n,r=[])=>{let i=VR(s,n),o=KR(t),a=HR(r);return{resourceId:e,authContext:i,resourceHash:o,fileHashes:a}},ly=e=>{let t=Object.entries(e.fileHashes).sort(([s],[n])=>s.localeCompare(n)).map(([s,n])=>`${s}:${n.hash}`).join("|");return`${e.resourceId}:${e.authContext}:${e.resourceHash}:${t}`};var Ji=class{cache;ttl;maxSize;disabled=!1;constructor(t={}){this.ttl=t.ttl||60*60*1e3,this.maxSize=t.maxSize||1e3,this.disabled=t.disabled||!1,this.disabled?this.cache=new Map:this.cache=zR()}setDisabled(t){this.disabled=t,t&&this.cache.clear()}get(t){if(this.disabled){Yi();return}let s=this.cache.get(t);if(!s){Yi();return}if(Date.now()-s.timestamp>s.ttl){this.cache.delete(t),Yi();return}return oy(),s.value}set(t,s,n,r){this.disabled||(this.cache.size>=this.maxSize&&this.evictOldest(),this.cache.set(t,{value:s,timestamp:Date.now(),ttl:r??this.ttl,fileHashes:n.fileHashes,authContext:n.authContext,resourceHash:n.resourceHash}),ay(),this.cache.size%10===0&&cy(this.cache))}has(t){return this.cache.has(t)}clear(){if(this.cache.clear(),!xr())try{Ke.existsSync(Bn)&&Ke.unlinkSync(Bn)}catch(t){ms.warn("Could not clear disk cache",{error:t instanceof Error?t.message:String(t)})}}saveToDisk(){cy(this.cache)}size(){return this.cache.size}evictOldest(){let t,s=Date.now();for(let[n,r]of Array.from(this.cache.entries()))r.timestamp<s&&(s=r.timestamp,t=n);t&&this.cache.delete(t)}getStats(){return{size:this.cache.size,maxSize:this.maxSize,hitRate:0,totalHits:0,totalMisses:0}}getAllCachedResults(){return new Map(this.cache)}getCachedResultsForResources(t){let s=new Map;for(let[n,r]of Array.from(this.cache.entries())){let i=n.split(":")[0];t.includes(i)&&Date.now()-r.timestamp<=r.ttl&&s.set(i,r.value)}return s}hasCachedResult(t){for(let s of Array.from(this.cache.keys()))if(s.split(":")[0]===t)return!0;return!1}};var ZR=new Set(["the","a","an","is","are","was","were","be","been","has","have","had","do","does","did","will","would","could","should","may","might","must","shall","can","this","that","these","those","it","its","to","for","of","in","on","at","by","with","from","or","and","not","no","but","if","then","else","when","where","resource","configuration","setting","configured","property","properties","which","lead","leads","leading","means","using","use","used","ensure","consider","also","such","most","more","any","all","some","other","each","every","necessary","unnecessary","recommended","default","specific","current","potential","possible","workloads","workload"]),YR=[["lacks","missing","without","absent","none","defined"],["encryption","encrypted","encrypt"],["configured","configuration","config","settings","setting"],["enabled","enable","active","activated"],["disabled","disable","inactive"],["public","publicly","open"],["access","accessible","accessibility"],["transit","transfer","transmission"],["rest","stored","storage"],["logging","logs","logged","log"],["dlq","dead","letter","queue"],["monitor","monitoring","observability"],["alarm","alarms","alert","alerts"],["unrestricted","permissive","overly"],["egress","outbound"],["ingress","inbound"],["recovery","backup","restore"],["pitr","point"],["function","functions"],["cluster","clusters"],["instance","instances"],["bucket","buckets"],["table","tables"],["domain","domains"],["node","nodes"],["policy","policies"],["rule","rules"],["subnet","subnets"],["high","higher","excessive","elevated"],["allocation","allocated","allocate"],["provisioned","provision"],["scaling","autoscaling","auto"],["restrict","restricted","restriction"],["expose","exposed","exposing","exposure"],["allow","allows","allowing"],["prevent","prevents","preventing"],["memory","ram","2gb","1gb"]],my=new Map;for(let e of YR){let t=e[0];for(let s of e)my.set(s,t)}var JR=e=>my.get(e)||e,py=e=>{if(!e)return new Set;let t=e.toLowerCase().replace(/[^\w\s]/g," ").replace(/\s+/g," ").trim().split(" ").filter(s=>s.length>2&&!ZR.has(s)).map(JR);return new Set(t)},QR=(e,t)=>{if(e.size===0&&t.size===0)return 1;if(e.size===0||t.size===0)return 0;let s=[...e].filter(r=>t.has(r)).length,n=new Set([...e,...t]).size;return n>0?s/n:0},XR=.4,dy=3,Cc=(e,t)=>{let s=py(e.issue),n=py(t.issue);return s.size<dy||n.size<dy?!1:QR(s,n)>=XR},xc=e=>`${e.issue}::${e.severity}::${e.wafPillar}`,Fr=e=>{let{existing:t,incoming:s}=e,n=new Set(t.map(xc)),r=[];for(let i of s){let o=xc(i);n.has(o)||t.some(u=>Cc(i,u))||r.some(u=>Cc(i,u))||(n.add(o),r.push(i))}return r},eo=(e,t)=>{let s=new Set,n=[];for(let r of e){let i=xc(r);s.has(i)||n.some(a=>Cc(r,a))||(s.add(i),n.push(r))}return n};var fy=H(require("node:crypto")),gy=(e,t)=>{let s=`${e}:${t}`;return fy.createHash("sha256").update(s).digest("hex").slice(0,32)};var hy=e=>t=>{let s={},n={};return Object.entries(t).forEach(([r,i])=>{let o=e(i);s[o]=r,n[o]=i}),{redactedResources:n,mapping:s}};var yy=(e,t,s={})=>{let n=[];return e.forEach(r=>{let i=r.resourceId,o=s[i];if(!o&&i.includes("/")){let c=i.split("/"),u=c[c.length-2],l=Object.entries(t).find(([p,d])=>d.startsWith(u));l&&(o=l[1])}if(!o)return;let a=Object.entries(t).find(([,c])=>c===o)?.[0];if(!a){Q.warn(`\u26A0\uFE0F Unable to find redacted ID for logical resource: ${o}`);return}n.push({...r,resourceId:a})}),n};var Dy=(e=0)=>t=>`\x1B[${t+e}m`,by=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,vy=(e=0)=>(t,s,n)=>`\x1B[${38+e};2;${t};${s};${n}m`,Re={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},l$=Object.keys(Re.modifier),ew=Object.keys(Re.color),tw=Object.keys(Re.bgColor),p$=[...ew,...tw];function sw(){let e=new Map;for(let[t,s]of Object.entries(Re)){for(let[n,r]of Object.entries(s))Re[n]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},s[n]=Re[n],e.set(r[0],r[1]);Object.defineProperty(Re,t,{value:s,enumerable:!1})}return Object.defineProperty(Re,"codes",{value:e,enumerable:!1}),Re.color.close="\x1B[39m",Re.bgColor.close="\x1B[49m",Re.color.ansi=Dy(),Re.color.ansi256=by(),Re.color.ansi16m=vy(),Re.bgColor.ansi=Dy(10),Re.bgColor.ansi256=by(10),Re.bgColor.ansi16m=vy(10),Object.defineProperties(Re,{rgbToAnsi256:{value(t,s,n){return t===s&&s===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!s)return[0,0,0];let[n]=s;n.length===3&&(n=[...n].map(i=>i+i).join(""));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:t=>Re.rgbToAnsi256(...Re.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let s,n,r;if(t>=232)s=((t-232)*10+8)/255,n=s,r=s;else{t-=16;let a=t%36;s=Math.floor(t/36)/5,n=Math.floor(a/6)/5,r=a%6/5}let i=Math.max(s,n,r)*2;if(i===0)return 30;let o=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(s));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,s,n)=>Re.ansi256ToAnsi(Re.rgbToAnsi256(t,s,n)),enumerable:!1},hexToAnsi:{value:t=>Re.ansi256ToAnsi(Re.hexToAnsi256(t)),enumerable:!1}}),Re}var nw=sw(),It=nw;var so=H(require("node:process"),1),Cy=H(require("node:os"),1),Ac=H(require("node:tty"),1);function yt(e,t=globalThis.Deno?globalThis.Deno.args:so.default.argv){let s=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(s+e),r=t.indexOf("--");return n!==-1&&(r===-1||n<r)}var{env:Te}=so.default,to;yt("no-color")||yt("no-colors")||yt("color=false")||yt("color=never")?to=0:(yt("color")||yt("colors")||yt("color=true")||yt("color=always"))&&(to=1);function rw(){if("FORCE_COLOR"in Te)return Te.FORCE_COLOR==="true"?1:Te.FORCE_COLOR==="false"?0:Te.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Te.FORCE_COLOR,10),3)}function iw(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ow(e,{streamIsTTY:t,sniffFlags:s=!0}={}){let n=rw();n!==void 0&&(to=n);let r=s?to:n;if(r===0)return 0;if(s){if(yt("color=16m")||yt("color=full")||yt("color=truecolor"))return 3;if(yt("color=256"))return 2}if("TF_BUILD"in Te&&"AGENT_NAME"in Te)return 1;if(e&&!t&&r===void 0)return 0;let i=r||0;if(Te.TERM==="dumb")return i;if(so.default.platform==="win32"){let o=Cy.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Te)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in Te)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Te)||Te.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in Te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Te.TEAMCITY_VERSION)?1:0;if(Te.COLORTERM==="truecolor"||Te.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Te){let o=Number.parseInt((Te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Te.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Te.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Te.TERM)||"COLORTERM"in Te?1:i}function Sy(e,t={}){let s=ow(e,{streamIsTTY:e&&e.isTTY,...t});return iw(s)}var aw={stdout:Sy({isTTY:Ac.default.isatty(1)}),stderr:Sy({isTTY:Ac.default.isatty(2)})},xy=aw;function Ay(e,t,s){let n=e.indexOf(t);if(n===-1)return e;let r=t.length,i=0,o="";do o+=e.slice(i,n)+t+s,i=n+r,n=e.indexOf(t,i);while(n!==-1);return o+=e.slice(i),o}function Fy(e,t,s,n){let r=0,i="";do{let o=e[n-1]==="\r";i+=e.slice(r,o?n-1:n)+t+(o?`\r
86
+ `+i):n.stack=i}catch{}}throw n}}_request(t,s){typeof t=="string"?(s=s||{},s.url=t):s=t||{},s=At(this.defaults,s);let{transitional:n,paramsSerializer:r,headers:i}=s;n!==void 0&&cr.assertOptions(n,{silentJSONParsing:Ot.transitional(Ot.boolean),forcedJSONParsing:Ot.transitional(Ot.boolean),clarifyTimeoutError:Ot.transitional(Ot.boolean)},!1),r!=null&&(v.isFunction(r)?s.paramsSerializer={serialize:r}:cr.assertOptions(r,{encode:Ot.function,serialize:Ot.function},!0)),s.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?s.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:s.allowAbsoluteUrls=!0),cr.assertOptions(s,{baseUrl:Ot.spelling("baseURL"),withXsrfToken:Ot.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let o=i&&v.merge(i.common,i[s.method]);i&&v.forEach(["delete","get","head","post","put","patch","common"],m=>{delete i[m]}),s.headers=we.concat(o,i);let a=[],c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(s)===!1||(c=c&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});let u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let l,p=0,d;if(!c){let m=[hi.bind(this),void 0];for(m.unshift(...a),m.push(...u),d=m.length,l=Promise.resolve(s);p<d;)l=l.then(m[p++],m[p++]);return l}d=a.length;let f=s;for(;p<d;){let m=a[p++],g=a[p++];try{f=m(f)}catch(h){g.call(this,h);break}}try{l=hi.call(this,f)}catch(m){return Promise.reject(m)}for(p=0,d=u.length;p<d;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=At(this.defaults,t);let s=bs(t.baseURL,t.url,t.allowAbsoluteUrls);return Ds(s,t.params,t.paramsSerializer)}};v.forEach(["delete","get","head","options"],function(t){yn.prototype[t]=function(s,n){return this.request(At(n||{},{method:t,url:s,data:(n||{}).data}))}});v.forEach(["post","put","patch"],function(t){function s(n){return function(i,o,a){return this.request(At(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}yn.prototype[t]=s(),yn.prototype[t+"Form"]=s(!0)});var ur=yn;var $a=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(i){s=i});let n=this;this.promise.then(r=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](r);n._listeners=null}),this.promise.then=r=>{let i,o=new Promise(a=>{n.subscribe(a),i=a}).then(r);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,a){n.reason||(n.reason=new nt(i,o,a),s(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let s=this._listeners.indexOf(t);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){let t=new AbortController,s=n=>{t.abort(n)};return this.subscribe(s),t.signal.unsubscribe=()=>this.unsubscribe(s),t.signal}static source(){let t;return{token:new e(function(r){t=r}),cancel:t}}},Cm=$a;function Ua(e){return function(s){return e.apply(null,s)}}function Ga(e){return v.isObject(e)&&e.isAxiosError===!0}var za={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(za).forEach(([e,t])=>{za[t]=e});var xm=za;function Am(e){let t=new ur(e),s=qn(ur.prototype.request,t);return v.extend(s,ur.prototype,t,{allOwnKeys:!0}),v.extend(s,t,null,{allOwnKeys:!0}),s.create=function(r){return Am(At(e,r))},s}var Le=Am(un);Le.Axios=ur;Le.CanceledError=nt;Le.CancelToken=Cm;Le.isCancel=tr;Le.VERSION=xs;Le.toFormData=ss;Le.AxiosError=N;Le.Cancel=Le.CanceledError;Le.all=function(t){return Promise.all(t)};Le.spread=Ua;Le.isAxiosError=Ga;Le.mergeConfig=At;Le.AxiosHeaders=we;Le.formToJSON=e=>oi(v.isHTMLForm(e)?new FormData(e):e);Le.getAdapter=gi.getAdapter;Le.HttpStatusCode=xm;Le.default=Le;var zt=Le;var{Axios:sO,AxiosError:nO,CanceledError:rO,isCancel:iO,CancelToken:oO,VERSION:aO,all:cO,Cancel:uO,isAxiosError:lO,spread:pO,toFormData:dO,AxiosHeaders:mO,HttpStatusCode:fO,formToJSON:gO,getAdapter:hO,mergeConfig:yO}=zt;var Di=require("node:fs"),lr=require("node:path");function Fm(){let e=require.resolve("@aws-solutions-constructs/core/package.json"),t=(0,lr.dirname)((0,lr.dirname)(e));return(0,Di.readdirSync)(t).filter(s=>s!=="core"&&s.startsWith("aws-")&&(0,Di.statSync)((0,lr.join)(t,s)).isDirectory())}var Em={"aws-apigateway-dynamodb":{className:"ApiGatewayToDynamoDB",packageName:"aws-apigateway-dynamodb",friendlyName:"Api Gateway To Dynamo DB",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigateway-dynamodb/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigateway-dynamodb",requiredResourceTypes:["AWS::DynamoDB::Table","AWS::Logs::LogGroup","AWS::ApiGateway::RestApi","AWS::ApiGateway::Deployment","AWS::ApiGateway::Stage","AWS::ApiGateway::Resource","AWS::ApiGateway::Method","AWS::ApiGateway::UsagePlan","AWS::IAM::Role","AWS::ApiGateway::Account","AWS::IAM::Policy"]},"aws-apigateway-kinesisstreams":{className:"ApiGatewayToKinesisStreams",packageName:"aws-apigateway-kinesisstreams",friendlyName:"Api Gateway To Kinesis Streams",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigateway-kinesisstreams/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigateway-kinesisstreams",requiredResourceTypes:["AWS::Logs::LogGroup","AWS::ApiGateway::RestApi","AWS::ApiGateway::Deployment","AWS::ApiGateway::Stage","AWS::ApiGateway::Resource","AWS::ApiGateway::Method","AWS::ApiGateway::UsagePlan","AWS::ApiGateway::RequestValidator","AWS::ApiGateway::Model","AWS::IAM::Role","AWS::ApiGateway::Account","AWS::IAM::Policy","AWS::CloudWatch::Alarm","AWS::Kinesis::Stream"]},"aws-apigateway-lambda":{className:"ApiGatewayToLambda",packageName:"aws-apigateway-lambda",friendlyName:"Api Gateway To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigateway-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigateway-lambda",requiredResourceTypes:["AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function","AWS::Logs::LogGroup","AWS::ApiGateway::RestApi","AWS::ApiGateway::Deployment","AWS::ApiGateway::Stage","AWS::ApiGateway::Resource","AWS::Lambda::Permission","AWS::ApiGateway::Method","AWS::ApiGateway::UsagePlan","AWS::ApiGateway::Account"]},"aws-apigateway-sqs":{className:"ApiGatewayToSqs",packageName:"aws-apigateway-sqs",friendlyName:"Api Gateway To Sqs",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigateway-sqs/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigateway-sqs",requiredResourceTypes:["AWS::SQS::Queue","AWS::SQS::QueuePolicy","AWS::Logs::LogGroup","AWS::ApiGateway::RestApi","AWS::ApiGateway::Deployment","AWS::ApiGateway::Stage","AWS::ApiGateway::Method","AWS::ApiGateway::UsagePlan","AWS::IAM::Role","AWS::ApiGateway::Account","AWS::IAM::Policy"]},"aws-apigatewayv2websocket-sqs":{className:"ApiGatewayV2WebSocketToSqs",packageName:"aws-apigatewayv2websocket-sqs",friendlyName:"Api Gateway V2 Web Socket To Sqs",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigatewayv2websocket-sqs/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigatewayv2websocket-sqs",requiredResourceTypes:["AWS::SQS::Queue","AWS::SQS::QueuePolicy","AWS::IAM::Role","AWS::IAM::Policy","AWS::ApiGatewayV2::Api","AWS::ApiGatewayV2::Integration","AWS::ApiGatewayV2::Route","AWS::ApiGatewayV2::Stage","AWS::Logs::LogGroup"]},"aws-cloudfront-apigateway-lambda":{className:"CloudFrontToApiGatewayToLambda",packageName:"aws-cloudfront-apigateway-lambda",friendlyName:"Cloud Front To Api Gateway To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-cloudfront-apigateway-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-cloudfront-apigateway-lambda",requiredResourceTypes:["AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function","AWS::Logs::LogGroup","AWS::ApiGateway::RestApi","AWS::ApiGateway::Deployment","AWS::ApiGateway::Stage","AWS::ApiGateway::Resource","AWS::Lambda::Permission","AWS::ApiGateway::Method","AWS::ApiGateway::UsagePlan","AWS::ApiGateway::Account","AWS::CloudFront::Function","AWS::S3::Bucket","AWS::S3::BucketPolicy","AWS::CloudFront::Distribution"]},"aws-cloudfront-mediastore":{className:"CloudFrontToMediaStore",packageName:"aws-cloudfront-mediastore",friendlyName:"Cloud Front To Media Store",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-cloudfront-mediastore/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-cloudfront-mediastore",requiredResourceTypes:["AWS::CloudFront::CloudFrontOriginAccessIdentity","AWS::MediaStore::Container","AWS::S3::Bucket","AWS::S3::BucketPolicy","AWS::CloudFront::OriginRequestPolicy","AWS::CloudFront::Function","AWS::CloudFront::Distribution"]},"aws-cloudfront-oai-s3":{className:"CloudFrontToOaiToS3",packageName:"aws-cloudfront-oai-s3",friendlyName:"Cloud Front To Oai To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-cloudfront-oai-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-cloudfront-oai-s3",requiredResourceTypes:["AWS::S3::Bucket","AWS::S3::BucketPolicy","AWS::CloudFront::Function","AWS::CloudFront::CloudFrontOriginAccessIdentity","AWS::CloudFront::Distribution"]},"aws-cloudfront-s3":{className:"CloudFrontToS3",packageName:"aws-cloudfront-s3",friendlyName:"Cloud Front To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-cloudfront-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-cloudfront-s3",requiredResourceTypes:["AWS::S3::Bucket","AWS::S3::BucketPolicy","AWS::CloudFront::Function","AWS::CloudFront::OriginAccessControl","AWS::CloudFront::Distribution"]},"aws-cognito-apigateway-lambda":{className:"CognitoToApiGatewayToLambda",packageName:"aws-cognito-apigateway-lambda",friendlyName:"Cognito To Api Gateway To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-cognito-apigateway-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-cognito-apigateway-lambda",requiredResourceTypes:["AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function","AWS::Logs::LogGroup","AWS::ApiGateway::RestApi","AWS::ApiGateway::Deployment","AWS::ApiGateway::Stage","AWS::ApiGateway::Resource","AWS::Lambda::Permission","AWS::ApiGateway::Method","AWS::ApiGateway::UsagePlan","AWS::ApiGateway::Account","AWS::Cognito::UserPool","AWS::Cognito::UserPoolClient","AWS::ApiGateway::Authorizer"]},"aws-dynamodbstreams-lambda":{className:"DynamoDBStreamsToLambda",packageName:"aws-dynamodbstreams-lambda",friendlyName:"Dynamo DBStreams To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-dynamodbstreams-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-dynamodbstreams-lambda",requiredResourceTypes:["AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function","AWS::Lambda::EventSourceMapping","AWS::DynamoDB::Table","AWS::SQS::Queue","AWS::SQS::QueuePolicy"]},"aws-kinesisfirehose-s3":{className:"KinesisFirehoseToS3",packageName:"aws-kinesisfirehose-s3",friendlyName:"Kinesis Firehose To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-kinesisfirehose-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-kinesisfirehose-s3",requiredResourceTypes:["AWS::S3::Bucket","AWS::S3::BucketPolicy","AWS::Logs::LogGroup","AWS::Logs::LogStream","AWS::IAM::Role","AWS::IAM::Policy","AWS::KinesisFirehose::DeliveryStream"]},"aws-kinesisstreams-kinesisfirehose-s3":{className:"KinesisStreamsToKinesisFirehoseToS3",packageName:"aws-kinesisstreams-kinesisfirehose-s3",friendlyName:"Kinesis Streams To Kinesis Firehose To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-kinesisstreams-kinesisfirehose-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-kinesisstreams-kinesisfirehose-s3",requiredResourceTypes:["AWS::Kinesis::Stream","AWS::S3::Bucket","AWS::S3::BucketPolicy","AWS::Logs::LogGroup","AWS::Logs::LogStream","AWS::IAM::Role","AWS::IAM::Policy","AWS::KinesisFirehose::DeliveryStream","AWS::CloudWatch::Alarm"]},"aws-s3-lambda":{className:"S3ToLambda",packageName:"aws-s3-lambda",friendlyName:"S3 To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-s3-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-s3-lambda",requiredResourceTypes:["AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function","AWS::S3::Bucket","AWS::S3::BucketPolicy","Custom::S3BucketNotifications","AWS::Lambda::Permission"]},"aws-s3-sns":{className:"S3ToSns",packageName:"aws-s3-sns",friendlyName:"S3 To Sns",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-s3-sns/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-s3-sns",requiredResourceTypes:["AWS::S3::Bucket","AWS::S3::BucketPolicy","Custom::S3BucketNotifications","AWS::KMS::Key","AWS::SNS::Topic","AWS::SNS::TopicPolicy","AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function"]},"aws-s3-sqs":{className:"S3ToSqs",packageName:"aws-s3-sqs",friendlyName:"S3 To Sqs",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-s3-sqs/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-s3-sqs",requiredResourceTypes:["AWS::S3::Bucket","AWS::S3::BucketPolicy","Custom::S3BucketNotifications","AWS::SQS::Queue","AWS::SQS::QueuePolicy","AWS::KMS::Key","AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function"]},"aws-sns-lambda":{className:"SnsToLambda",packageName:"aws-sns-lambda",friendlyName:"Sns To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-sns-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-sns-lambda",requiredResourceTypes:["AWS::IAM::Role","AWS::IAM::Policy","AWS::Lambda::Function","AWS::Lambda::Permission","AWS::SNS::Subscription","AWS::SNS::Topic","AWS::SNS::TopicPolicy"]},"aws-sns-sqs":{className:"SnsToSqs",packageName:"aws-sns-sqs",friendlyName:"Sns To Sqs",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-sns-sqs/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-sns-sqs",requiredResourceTypes:["AWS::SNS::Topic","AWS::SNS::TopicPolicy","AWS::SQS::Queue","AWS::SQS::QueuePolicy","AWS::SNS::Subscription","AWS::KMS::Key"]},"aws-eventbridge-kinesisstreams":{className:"EventbridgeToKinesisStreams",packageName:"aws-eventbridge-kinesisstreams",friendlyName:"EventBridge To Kinesis Streams",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-eventbridge-kinesisstreams/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-eventbridge-kinesisstreams",requiredResourceTypes:["AWS::Events::Rule","AWS::Kinesis::Stream"]},"aws-eventbridge-sns":{className:"EventbridgeToSns",packageName:"aws-eventbridge-sns",friendlyName:"EventBridge To SNS",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-eventbridge-sns/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-eventbridge-sns",requiredResourceTypes:["AWS::Events::Rule","AWS::SNS::Topic"]},"aws-eventbridge-sqs":{className:"EventbridgeToSqs",packageName:"aws-eventbridge-sqs",friendlyName:"EventBridge To SQS",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-eventbridge-sqs/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-eventbridge-sqs",requiredResourceTypes:["AWS::Events::Rule","AWS::SQS::Queue"]},"aws-eventbridge-stepfunctions":{className:"EventbridgeToStepfunctions",packageName:"aws-eventbridge-stepfunctions",friendlyName:"EventBridge To StepFunctions",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-eventbridge-stepfunctions/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-eventbridge-stepfunctions",requiredResourceTypes:["AWS::Events::Rule","AWS::StepFunctions::StateMachine"]},"aws-alb-fargate":{className:"AlbToFargate",packageName:"aws-alb-fargate",friendlyName:"ALB To Fargate",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-alb-fargate/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-alb-fargate",requiredResourceTypes:["AWS::ElasticLoadBalancingV2::LoadBalancer","AWS::ElasticLoadBalancingV2::Listener","AWS::ECS::Cluster","AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::IAM::Role","AWS::Logs::LogGroup"]},"aws-alb-lambda":{className:"AlbToLambda",packageName:"aws-alb-lambda",friendlyName:"ALB To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-alb-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-alb-lambda",requiredResourceTypes:["AWS::ElasticLoadBalancingV2::LoadBalancer","AWS::ElasticLoadBalancingV2::Listener","AWS::Lambda::Function","AWS::IAM::Role","AWS::Logs::LogGroup"]},"aws-apigateway-iot":{className:"ApiGatewayToIot",packageName:"aws-apigateway-iot",friendlyName:"API Gateway To IoT",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigateway-iot/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigateway-iot",requiredResourceTypes:["AWS::ApiGateway::RestApi","AWS::ApiGateway::Resource","AWS::ApiGateway::Method","AWS::IoT::TopicRule"]},"aws-apigateway-sagemakerendpoint":{className:"ApiGatewayToSagemakerendpoint",packageName:"aws-apigateway-sagemakerendpoint",friendlyName:"API Gateway To SageMaker Endpoint",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-apigateway-sagemakerendpoint/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-apigateway-sagemakerendpoint",requiredResourceTypes:["AWS::ApiGateway::RestApi","AWS::ApiGateway::Integration","AWS::SageMaker::Endpoint"]},"aws-cloudfront-apigateway":{className:"CloudFrontToApiGateway",packageName:"aws-cloudfront-apigateway",friendlyName:"CloudFront To API Gateway",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-cloudfront-apigateway/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-cloudfront-apigateway",requiredResourceTypes:["AWS::CloudFront::Distribution","AWS::ApiGateway::RestApi","AWS::ApiGateway::Method"]},"aws-dynamodbstreams-lambda-elasticsearch-kibana":{className:"DynamoDBStreamsToLambdaElasticsearchKibana",packageName:"aws-dynamodbstreams-lambda-elasticsearch-kibana",friendlyName:"DynamoDB Streams To Lambda Elasticsearch Kibana",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-dynamodbstreams-lambda-elasticsearch-kibana/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-dynamodbstreams-lambda-elasticsearch-kibana",requiredResourceTypes:["AWS::DynamoDB::Stream","AWS::Lambda::Function","AWS::Elasticsearch::Domain","AWS::IAM::Role","AWS::Logs::LogGroup"]},"aws-dynamodbstreams-pipes-stepfunctions":{className:"DynamoDBStreamsToPipesStepfunctions",packageName:"aws-dynamodbstreams-pipes-stepfunctions",friendlyName:"DynamoDB Streams To Pipes StepFunctions",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-dynamodbstreams-pipes-stepfunctions/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-dynamodbstreams-pipes-stepfunctions",requiredResourceTypes:["AWS::DynamoDB::Stream","AWS::StepFunctions::StateMachine"]},"aws-eventbridge-kinesisfirehose-s3":{className:"EventbridgeToKinesisfirehoseToS3",packageName:"aws-eventbridge-kinesisfirehose-s3",friendlyName:"EventBridge To Kinesis Firehose To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-eventbridge-kinesisfirehose-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-eventbridge-kinesisfirehose-s3",requiredResourceTypes:["AWS::Events::Rule","AWS::KinesisFirehose::DeliveryStream","AWS::S3::Bucket"]},"aws-eventbridge-lambda":{className:"EventbridgeToLambda",packageName:"aws-eventbridge-lambda",friendlyName:"EventBridge To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-eventbridge-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-eventbridge-lambda",requiredResourceTypes:["AWS::Events::Rule","AWS::Lambda::Function","AWS::IAM::Role"]},"aws-fargate-dynamodb":{className:"FargateToDynamodb",packageName:"aws-fargate-dynamodb",friendlyName:"Fargate To DynamoDB",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-dynamodb/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-dynamodb",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::DynamoDB::Table"]},"aws-fargate-eventbridge":{className:"FargateToEventbridge",packageName:"aws-fargate-eventbridge",friendlyName:"Fargate To EventBridge",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-eventbridge/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-eventbridge",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::Events::Rule"]},"aws-fargate-kinesisfirehose":{className:"FargateToKinesisfirehose",packageName:"aws-fargate-kinesisfirehose",friendlyName:"Fargate To Kinesis Firehose",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-kinesisfirehose/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-kinesisfirehose",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::KinesisFirehose::DeliveryStream"]},"aws-fargate-kinesisstreams":{className:"FargateToKinesisstreams",packageName:"aws-fargate-kinesisstreams",friendlyName:"Fargate To Kinesis Streams",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-kinesisstreams/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-kinesisstreams",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::Kinesis::Stream"]},"aws-fargate-opensearch":{className:"FargateToOpensearch",packageName:"aws-fargate-opensearch",friendlyName:"Fargate To OpenSearch",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-opensearch/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-opensearch",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::OpenSearch::Domain"]},"aws-fargate-s3":{className:"FargateToS3",packageName:"aws-fargate-s3",friendlyName:"Fargate To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-s3",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::S3::Bucket"]},"aws-fargate-secretsmanager":{className:"FargateToSecretsmanager",packageName:"aws-fargate-secretsmanager",friendlyName:"Fargate To SecretsManager",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-secretsmanager/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-secretsmanager",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::SecretsManager::Secret"]},"aws-fargate-sns":{className:"FargateToSns",packageName:"aws-fargate-sns",friendlyName:"Fargate To SNS",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-sns/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-sns",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::SNS::Topic"]},"aws-fargate-sqs":{className:"FargateToSqs",packageName:"aws-fargate-sqs",friendlyName:"Fargate To SQS",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-sqs/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-sqs",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::SQS::Queue"]},"aws-fargate-ssmstringparameter":{className:"FargateToSsmstringparameter",packageName:"aws-fargate-ssmstringparameter",friendlyName:"Fargate To SSM String Parameter",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-ssmstringparameter/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-ssmstringparameter",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::SSM::StringParameter"]},"aws-fargate-stepfunctions":{className:"FargateToStepfunctions",packageName:"aws-fargate-stepfunctions",friendlyName:"Fargate To StepFunctions",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-fargate-stepfunctions/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-fargate-stepfunctions",requiredResourceTypes:["AWS::ECS::TaskDefinition","AWS::ECS::Service","AWS::StepFunctions::StateMachine"]},"aws-iot-kinesisfirehose-s3":{className:"IotToKinesisfirehoseToS3",packageName:"aws-iot-kinesisfirehose-s3",friendlyName:"IoT To Kinesis Firehose To S3",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-iot-kinesisfirehose-s3/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-iot-kinesisfirehose-s3",requiredResourceTypes:["AWS::IoT::TopicRule","AWS::KinesisFirehose::DeliveryStream","AWS::S3::Bucket"]},"aws-iot-kinesisstreams":{className:"IotToKinesisstreams",packageName:"aws-iot-kinesisstreams",friendlyName:"IoT To Kinesis Streams",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-iot-kinesisstreams/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-iot-kinesisstreams",requiredResourceTypes:["AWS::IoT::TopicRule","AWS::Kinesis::Stream"]},"aws-iot-lambda":{className:"IotToLambda",packageName:"aws-iot-lambda",friendlyName:"IoT To Lambda",documentationUrl:"https://docs.aws.amazon.com/solutions/latest/aws-iot-lambda/",githubUrl:"https://github.com/awslabs/aws-solutions-constructs/tree/main/aws-iot-lambda",requiredResourceTypes:["AWS::IoT::TopicRule","AWS::Lambda::Function","AWS::IAM::Role"]}};var Rm=async e=>{let t={};for(let s of e)try{let n=await import(`@aws-solutions-constructs/${s}`),r=Object.keys(n).find(u=>/^[A-Z][a-zA-Z0-9]*To[A-Z][a-zA-Z0-9]*$/.test(u));if(!r)continue;let i=`https://docs.aws.amazon.com/solutions/latest/${s}/`,o=`https://github.com/awslabs/aws-solutions-constructs/tree/main/${s}`,c=Em[s]?.requiredResourceTypes||[];t[s]={className:r,packageName:s,friendlyName:r.replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim(),documentationUrl:i,githubUrl:o,requiredResourceTypes:c}}catch{}return t};var F=(e,t)=>e.Metadata?.["aws:cdk:path"]??t;var wm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::ApiGateway::RestApi"&&!r.Properties?.EndpointConfiguration?.Types?.includes("PRIVATE")&&(s[n]={issues:[t(n,"API Gateway is publicly accessible.","Use PRIVATE endpoints to restrict access.","HIGH","Security",F(r,n),"cdkInsights")]}),s),{});var Im=(e,t)=>Object.entries(e.Resources||{}).some(([,n])=>n.Type==="AWS::CloudTrail::Trail")?{}:{Global:{issues:[t("Global","CloudTrail is not enabled for logging.","Enable AWS CloudTrail to capture API activity and improve security monitoring.","HIGH","Security","Global","cdkInsights")]}};var Dn=(e,t)=>{let s=[];if(e==null)return s;if(typeof e=="string"){let n=e.matchAll(/\$\{([^.}]+)(?:\.[^}]+)?\}/g);for(let r of n){let i=r[1];t.has(i)&&s.push(i)}return s}if(Array.isArray(e)){for(let n of e)s.push(...Dn(n,t));return s}if(typeof e=="object"){let n=e;if("Ref"in n&&typeof n.Ref=="string"&&t.has(n.Ref)&&s.push(n.Ref),"Fn::GetAtt"in n){let r=n["Fn::GetAtt"];if(Array.isArray(r)&&typeof r[0]=="string")t.has(r[0])&&s.push(r[0]);else if(typeof r=="string"){let i=r.split(".")[0];t.has(i)&&s.push(i)}}if("Fn::Sub"in n){let r=n["Fn::Sub"];Array.isArray(r)?(s.push(...Dn(r[0],t)),r[1]&&typeof r[1]=="object"&&s.push(...Dn(r[1],t))):s.push(...Dn(r,t))}for(let[r,i]of Object.entries(n))["Ref","Fn::GetAtt","Fn::Sub"].includes(r)||s.push(...Dn(i,t))}return s},A0=e=>e.DependsOn?Array.isArray(e.DependsOn)?e.DependsOn:[e.DependsOn]:[],F0=(e,t)=>{if(t.length===0)return;let s=new Set(t.map(i=>i.type.split("::")[2]||i.type)),n=Array.from(s).slice(0,3),r=e.split("::")[2]||e;if(e.includes("SecurityGroup"))return`Security group attached to: ${n.join(", ")}`;if(e.includes("IAM::Role"))return`IAM role assumed by: ${n.join(", ")}`;if(e.includes("VPC")||e.includes("Subnet"))return`Network hosting: ${n.join(", ")}`;if(e.includes("KMS::Key"))return`Encryption key used by: ${n.join(", ")}`;if(e.includes("S3::Bucket")){if(n.some(i=>i.includes("Lambda")))return"S3 bucket accessed by Lambda functions";if(n.some(i=>i.includes("CloudFront")))return"S3 bucket serving as CloudFront origin"}if(e.includes("DynamoDB::Table")&&n.some(i=>i.includes("Lambda")))return"DynamoDB table accessed by Lambda functions";if(t.length>0)return`Referenced by ${t.length} resource${t.length>1?"s":""}: ${n.join(", ")}`},Fs=e=>{let t=new Set(Object.keys(e)),s={};for(let n of t)s[n]={dependencies:[],dependents:[]};for(let[n,r]of Object.entries(e)){let i=A0(r),o=Dn(r.Properties,t),a=[...new Set([...i,...o])];s[n].dependencies=a;for(let c of a)s[c]&&s[c].dependents.push(n)}for(let[n,r]of Object.entries(e)){let i=s[n],o=i.dependents.map(a=>({id:a,type:e[a]?.Type||"Unknown"}));i.usageDescription=F0(r.Type,o)}return s},qa=(e,t,s)=>{let n=t[e];if(!n)return{dependencies:[],dependents:[]};let r=n.dependencies.map(o=>{let a=s[o]?.Type?.split("::")[2]||o;return`${o} (${a})`}),i=n.dependents.map(o=>{let a=s[o]?.Type?.split("::")[2]||o;return`${o} (${a})`});return{dependencies:r,dependents:i,usageDescription:n.usageDescription}};var E0=(e,t,s)=>{let n={};for(let[r,i]of Object.entries(e)){if(i.Type!=="AWS::Lambda::Function")continue;let o=i.Properties||{};if(!!(o.DeadLetterConfig?.TargetArn||o.DeadLetterConfig?.TargetArn))continue;let c=t[r];if(!c)continue;c.dependencies.some(l=>{let p=e[l];return p?.Type==="AWS::DynamoDB::Table"||p?.Type==="AWS::DynamoDB::GlobalTable"})&&(n[r]||(n[r]={issues:[]}),n[r].issues.push(s(r,"Lambda function interacting with DynamoDB has no Dead Letter Queue configured","Configure a Dead Letter Queue (DLQ) using SQS or SNS to capture failed invocations. This ensures no data is lost when the function fails to process DynamoDB events or write operations.","MEDIUM","Reliability",i.Metadata?.["aws:cdk:path"]||r,"cdkInsights")))}return n},R0=(e,t,s)=>{let n={},r=new Set(["AWS::RDS::DBInstance","AWS::RDS::DBCluster","AWS::ElastiCache::CacheCluster","AWS::ElastiCache::ReplicationGroup","AWS::Redshift::Cluster","AWS::OpenSearchService::Domain","AWS::Elasticsearch::Domain","AWS::ECS::Service"]),i=new Set(Object.entries(e).filter(([,o])=>r.has(o.Type)).map(([o])=>o));for(let[o,a]of Object.entries(e)){if(a.Type!=="AWS::Lambda::Function")continue;let c=a.Properties||{},u=!!(c.VpcConfig&&(c.VpcConfig.SubnetIds||c.VpcConfig.SecurityGroupIds)),l=t[o];if(!l)continue;if(l.dependencies.some(d=>i.has(d))&&!u){n[o]||(n[o]={issues:[]});let d=l.dependencies.filter(f=>i.has(f));n[o].issues.push(s(o,`Lambda function references VPC resources (${d.join(", ")}) but is not VPC-enabled`,"Configure VpcConfig with appropriate SubnetIds and SecurityGroupIds to allow the Lambda function to connect to VPC resources. Without VPC configuration, the function cannot reach private resources like RDS databases.","HIGH","Reliability",a.Metadata?.["aws:cdk:path"]||o,"cdkInsights"))}}return n},w0=(e,t)=>{let s={},n=new Map;for(let[r,i]of Object.entries(e)){if(i.Type!=="AWS::S3::Bucket")continue;let o=i.Properties||{},a=!!(o.BucketEncryption||o.ServerSideEncryptionConfiguration);n.set(r,a)}for(let[r,i]of Object.entries(e)){if(i.Type!=="AWS::S3::Bucket")continue;let a=(i.Properties||{}).ReplicationConfiguration;if(!a)continue;let c=n.get(r),u=a.Rules;if(!(!u||!Array.isArray(u)))for(let l of u){if(l.Status!=="Enabled")continue;let p=l.Destination;if(!p||!p.Bucket)continue;let f=p.EncryptionConfiguration;c&&!f&&(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,"S3 replication configured without encryption configuration for replicated objects","Specify EncryptionConfiguration in the replication rule to ensure replicated objects maintain encryption. Use ReplicaKmsKeyID to specify the KMS key for encrypting replicated objects in the destination bucket.","MEDIUM","Security",i.Metadata?.["aws:cdk:path"]||r,"cdkInsights")))}}return s},I0=(e,t,s)=>{let n={},r=new Set([80,443,8080,8443]);for(let[i,o]of Object.entries(e)){if(o.Type!=="AWS::EC2::SecurityGroup")continue;let c=(o.Properties||{}).SecurityGroupIngress||[],u=t[i];if(!(u&&u.dependents.length>0))continue;let p=[];for(let d of c){let f=d.CidrIp,m=d.CidrIpv6,g=d.FromPort,h=d.ToPort;if(!(f==="0.0.0.0/0"||m==="::/0")||g===void 0)continue;let y=h!==void 0&&h!==g,S=!r.has(g);(y||S)&&p.push(g)}if(p.length>0){n[i]||(n[i]={issues:[]});let d=u.dependents.map(f=>e[f]?.Type?.split("::")[2]||"Unknown").join(", ");n[i].issues.push(s(i,`Security group used by ${d} has public access on non-standard ports: ${p.join(", ")}`,"Restrict ingress rules to specific CIDR blocks or reference other security groups instead of allowing 0.0.0.0/0 on non-standard ports. Consider using a bastion host or VPN for administrative access.","HIGH","Security",o.Metadata?.["aws:cdk:path"]||i,"cdkInsights"))}}return n},bi=(e,t)=>{let s=e.Resources||{},n=Fs(s),r={},i=[E0(s,n,t),R0(s,n,t),w0(s,t),I0(s,n,t)];for(let o of i)for(let[a,c]of Object.entries(o))r[a]||(r[a]={issues:[]}),r[a].issues.push(...c.issues);return r};var T0=e=>{let t=[],s=Object.values(e).map(C=>C.Type),n={};for(let C of s)n[C]=(n[C]||0)+1;let r=s.some(C=>C==="AWS::Lambda::Function"),i=s.some(C=>C==="AWS::ApiGateway::RestApi"||C==="AWS::ApiGatewayV2::Api"),o=s.some(C=>C==="AWS::DynamoDB::Table"),a=s.some(C=>C==="AWS::S3::Bucket");r&&(o||a)&&!s.some(C=>C.includes("ECS")||C.includes("EC2::Instance"))&&t.push("serverless");let c=s.some(C=>C==="AWS::ECS::Service"||C==="AWS::ECS::TaskDefinition"||C==="AWS::ECS::Cluster"),u=s.some(C=>C.startsWith("AWS::EKS::"));(c||u)&&t.push("container-based");let l=s.some(C=>C.startsWith("AWS::Events::")),p=s.some(C=>C==="AWS::SNS::Topic"),d=s.some(C=>C==="AWS::SQS::Queue"),f=s.some(C=>C.startsWith("AWS::Kinesis::")),m=s.some(C=>C.startsWith("AWS::StepFunctions::"));(l||p||d||f||m)&&r&&t.push("event-driven"),i&&t.push("api-gateway");let g=s.some(C=>C.startsWith("AWS::Glue::")),h=s.some(C=>C.startsWith("AWS::Athena::")),b=s.some(C=>C.startsWith("AWS::EMR::"));(f||g||h||b)&&t.push("data-processing");let y=s.some(C=>C==="AWS::CloudFront::Distribution");a&&y&&!r&&!c&&t.push("static-website");let S=n["AWS::Lambda::Function"]||0,D=n["AWS::ECS::Service"]||0;(S>=3||D>=2)&&t.push("microservices");let E=s.some(C=>C==="AWS::EC2::Instance"),T=s.some(C=>C==="AWS::RDS::DBInstance"||C==="AWS::RDS::DBCluster"),k=s.some(C=>C==="AWS::ElasticLoadBalancingV2::LoadBalancer");return E&&(T||k)&&t.push("traditional"),t},k0=(e,t)=>{let s={},n=Object.values(e).map(l=>l.Type),r=n.some(l=>l==="AWS::CloudWatch::Alarm"),i=n.some(l=>l==="AWS::Lambda::Function"),o=n.some(l=>l==="AWS::ECS::Service"),a=n.some(l=>l==="AWS::RDS::DBInstance"||l==="AWS::RDS::DBCluster");(i||o||a)&&!r&&(s["Stack Architecture"]={issues:[t("Stack Architecture","No CloudWatch Alarms defined for critical resources","Add CloudWatch Alarms to monitor key metrics like Lambda errors, ECS task failures, or RDS connections. Consider using CDK's built-in alarm methods or aws-cdk-lib/aws-cloudwatch.","MEDIUM","Operational Excellence","Stack Architecture","cdkInsights")]});let c=n.some(l=>l==="AWS::XRay::Group"||l==="AWS::XRay::SamplingRule");return n.filter(l=>l==="AWS::Lambda::Function").length>=3&&!c&&(s["Stack Architecture"]||(s["Stack Architecture"]={issues:[]}),s["Stack Architecture"].issues.push(t("Stack Architecture","Multiple Lambda functions without X-Ray tracing configuration","Enable X-Ray tracing for your Lambda functions to gain visibility into distributed request flows and identify performance bottlenecks. Set tracing: lambda.Tracing.ACTIVE on your functions.","LOW","Operational Excellence","Stack Architecture","cdkInsights"))),s},_0=(e,t)=>{let s={},n=Object.values(e).map(d=>d.Type),r=n.some(d=>d==="AWS::ApiGateway::RestApi"||d==="AWS::ApiGatewayV2::Api"),i=n.some(d=>d==="AWS::ElasticLoadBalancingV2::LoadBalancer"),o=n.some(d=>d==="AWS::CloudFront::Distribution"),a=n.some(d=>d==="AWS::WAFv2::WebACL"||d==="AWS::WAF::WebACL");(r||i||o)&&!a&&(s["Stack Architecture"]||(s["Stack Architecture"]={issues:[]}),s["Stack Architecture"].issues.push(t("Stack Architecture","Public-facing resources without WAF protection","Consider adding AWS WAF to protect your API Gateway, ALB, or CloudFront distribution from common web exploits. WAF can help prevent SQL injection, XSS, and rate-limit malicious traffic.","MEDIUM","Security","Stack Architecture","cdkInsights")));let c=n.some(d=>d==="AWS::SecretsManager::Secret"),u=n.some(d=>d==="AWS::SSM::Parameter"),l=n.some(d=>d==="AWS::RDS::DBInstance"||d==="AWS::RDS::DBCluster"),p=!1;for(let[d,f]of Object.entries(e))if(f.Type==="AWS::Lambda::Function"){let m=f.Properties?.Environment?.Variables;if(m){let g=["PASSWORD","SECRET","API_KEY","TOKEN","CREDENTIAL"];for(let h of Object.keys(m))if(g.some(b=>h.toUpperCase().includes(b))){let b=m[h];if(typeof b=="string"&&!b.startsWith("{{")){p=!0;break}}}}return l&&!c&&!u&&(s["Stack Architecture"]||(s["Stack Architecture"]={issues:[]}),s["Stack Architecture"].issues.push(t("Stack Architecture","RDS database without Secrets Manager for credential rotation","Use AWS Secrets Manager to store and automatically rotate database credentials. This improves security by eliminating hardcoded passwords and enabling automatic credential rotation.","HIGH","Security","Stack Architecture","cdkInsights"))),s},L0=(e,t)=>{let s={},n=Object.values(e).filter(u=>u.Type==="AWS::EC2::NatGateway").length;n>=3&&(s["Stack Architecture"]||(s["Stack Architecture"]={issues:[]}),s["Stack Architecture"].issues.push(t("Stack Architecture",`${n} NAT Gateways detected - potential cost optimization`,"Multiple NAT Gateways can be expensive ($32/month each + data processing). Consider if all are necessary, or explore alternatives like NAT instances for dev environments, or VPC endpoints for AWS services.","MEDIUM","Cost Optimization","Stack Architecture","cdkInsights")));let r=n>0,i=Object.values(e).some(u=>u.Type==="AWS::EC2::VPCEndpoint"),o=Object.values(e).some(u=>{if(u.Type!=="AWS::Lambda::Function")return!1;let l=u.Properties?.VpcConfig;return l?.SubnetIds||l?.SecurityGroupIds}),a=Object.values(e).some(u=>u.Type==="AWS::S3::Bucket"),c=Object.values(e).some(u=>u.Type==="AWS::DynamoDB::Table");return o&&r&&!i&&(a||c)&&(s["Stack Architecture"]||(s["Stack Architecture"]={issues:[]}),s["Stack Architecture"].issues.push(t("Stack Architecture","VPC Lambda functions accessing AWS services through NAT Gateway","Consider using VPC Endpoints (Gateway endpoints for S3/DynamoDB are free) instead of routing AWS service traffic through NAT Gateway. This reduces costs and improves latency.","LOW","Cost Optimization","Stack Architecture","cdkInsights"))),s},P0=(e,t,s)=>{let n={};for(let[r,i]of Object.entries(t)){let o=e[r];if(!o)continue;let a=i.dependents.length;if(a>=5){let c=o.Type.split("::")[2]||o.Type;n["Stack Architecture"]||(n["Stack Architecture"]={issues:[]}),n["Stack Architecture"].issues.push(s("Stack Architecture",`${c} (${r}) is a potential single point of failure with ${a} dependent resources`,"Consider adding redundancy or failover mechanisms for this critical resource. For databases, consider Multi-AZ. For queues, consider dead-letter queues. For Lambda, ensure proper error handling.","MEDIUM","Reliability","Stack Architecture","cdkInsights"))}}for(let[r,i]of Object.entries(e)){if(i.Type!=="AWS::DynamoDB::Table")continue;if(i.Properties?.PointInTimeRecoverySpecification?.PointInTimeRecoveryEnabled!==!0){let a=t[r];a&&a.dependents.length>=3&&(n["Stack Architecture"]||(n["Stack Architecture"]={issues:[]}),n["Stack Architecture"].issues.push(s("Stack Architecture",`Critical DynamoDB table ${r} has ${a.dependents.length} dependents but no point-in-time recovery`,"Enable Point-in-Time Recovery (PITR) for critical DynamoDB tables used by multiple resources. This provides continuous backups with 35-day retention.","HIGH","Reliability","Stack Architecture","cdkInsights")))}}return n},vi=(e,t)=>{let s=e.Resources||{};if(Object.keys(s).length<3)return{};let r=Fs(s),i=T0(s),o={},a=[k0(s,t),_0(s,t),L0(s,t),P0(s,r,t)];for(let c of a)for(let[u,l]of Object.entries(c))o[u]||(o[u]={issues:[]}),o[u].issues.push(...l.issues);return o};var Tm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::CloudFront::Distribution")return s;let i=F(r,n);return r.Properties?.DistributionConfig?.DefaultCacheBehavior?.ViewerProtocolPolicy==="allow-all"&&(s[n]={issues:[t(n,"CloudFront distribution allows HTTP traffic (ViewerProtocolPolicy is allow-all).",'Set ViewerProtocolPolicy to "https-only" or "redirect-to-https" to enforce HTTPS and protect data in transit.',"HIGH","Security",i,"cdkInsights")]}),s},{});var km=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::CloudFront::Distribution")return s;let i=F(r,n);return r.Properties?.DistributionConfig?.WebACLId||(s[n]={issues:[t(n,"CloudFront distribution has no WAF WebACL associated.","Associate a WAF WebACL to protect against common web exploits, SQL injection, XSS, and DDoS attacks.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var _m=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::CloudFront::Distribution")return s;let i=F(r,n);return r.Properties?.DistributionConfig?.Logging?.Bucket||(s[n]={issues:[t(n,"CloudFront distribution does not have access logging enabled.","Enable access logging to an S3 bucket to track viewer requests for security analysis, auditing, and troubleshooting.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var O0=["SSLv3","TLSv1","TLSv1_2016","TLSv1.1_2016"],Lm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::CloudFront::Distribution")return s;let i=F(r,n),a=r.Properties?.DistributionConfig?.ViewerCertificate,c=a?.MinimumProtocolVersion;return a?.CloudFrontDefaultCertificate||c&&O0.includes(c)&&(s[n]={issues:[t(n,`CloudFront distribution uses outdated TLS version (${c}).`,"Use TLSv1.2_2021 or later for improved security. Older TLS versions have known vulnerabilities.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var Pm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Cognito::UserPool")return s;let i=[],o=F(r,n),a=r.Properties?.PasswordPolicy;if(!a)i.push(t(n,"Cognito User Pool has no password policy configured.","Configure a strong password policy with minimum length, uppercase, lowercase, numbers, and symbols requirements.","HIGH","Security",o,"cdkInsights"));else{let c=a.MinimumLength||8;c<12&&i.push(t(n,`Cognito password policy has minimum length of ${c} characters.`,"Set MinimumLength to at least 12 characters for stronger security against brute-force attacks.","MEDIUM","Security",o,"cdkInsights")),a.RequireSymbols===!1&&i.push(t(n,"Cognito password policy does not require symbols.","Enable RequireSymbols for stronger password complexity requirements.","LOW","Security",o,"cdkInsights"))}return i.length>0&&(s[n]={issues:i}),s},{});var Om=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Cognito::UserPool")return s;let i=F(r,n),o=r.Properties?.MfaConfiguration;return(!o||o==="OFF")&&(s[n]={issues:[t(n,"Cognito User Pool has MFA disabled.","Enable MFA (OPTIONAL or ON) to add an extra layer of security for user authentication.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var Bm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Cognito::UserPool")return s;let i=F(r,n),o=r.Properties?.UserPoolAddOns?.AdvancedSecurityMode;return(!o||o==="OFF")&&(s[n]={issues:[t(n,"Cognito User Pool does not have advanced security features enabled.","Enable UserPoolAddOns with AdvancedSecurityMode set to AUDIT or ENFORCED to detect compromised credentials and block suspicious sign-ins.","LOW","Security",i,"cdkInsights")]}),s},{});var Mm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::DynamoDB::Table")return s;let i=r.Properties?.BillingMode,o=F(r,n);return(!i||i==="PROVISIONED")&&(s[n]={issues:[t(n,"DynamoDB table uses provisioned capacity without on-demand billing.","Consider using BillingMode: PAY_PER_REQUEST for automatic scaling and cost optimization, especially for unpredictable workloads. For predictable workloads, configure Application Auto Scaling.","MEDIUM","Cost Optimization",o,"cdkInsights")]}),s},{});var Nm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::DynamoDB::Table"&&!r.Properties?.StreamSpecification&&(s[n]={issues:[t(n,"DynamoDB table does not have streams enabled.","Consider enabling DynamoDB Streams to capture item-level changes for analytics, auditing, event-driven architectures, and cross-region replication.","LOW","Operational Excellence",F(r,n),"cdkInsights")]}),s),{});var Wm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::EC2::Volume")return s;let i=[],o=F(r,n),a=r.Properties??{};return a.Encrypted!==!0&&i.push(t(n,"EBS Volume is not encrypted.","Enable encryption on EBS volumes to protect data at rest. Use the Encrypted property and optionally specify a KmsKeyId.","HIGH","Security",o,"cdkInsights")),a.VolumeType==="gp2"&&i.push(t(n,"EBS Volume uses gp2 storage type.","Consider migrating to gp3 for up to 20% cost savings with better baseline performance (3,000 IOPS and 125 MB/s throughput).","MEDIUM","Cost Optimization",o,"cdkInsights")),i.length>0&&(s[n]={issues:i}),s},{});var jm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::EC2::Instance"&&r.Properties?.InstanceType?.toString().startsWith("t2")&&(s[n]={issues:[t(n,"EC2 instance is using an older t2 instance. Consider upgrading to t3 for better performance and cost savings.","Upgrade to a t3 instance for improved performance, lower latency, and better cost efficiency.","MEDIUM","Cost Optimization",F(r,n),"cdkInsights")]}),s),{});var $m=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::EC2::NatGateway"&&(s[n]={issues:[t(n,"NAT Gateway detected. NAT Gateways incur hourly charges (~$0.045/hr) plus data processing fees (~$0.045/GB).","Consider alternatives like NAT instances for lower traffic, VPC endpoints for AWS services, or IPv6 egress-only internet gateways to reduce costs.","LOW","Cost Optimization",F(r,n),"cdkInsights")]}),s),{});var B0=[22,3389,3306,5432,1433,27017,6379],M0=e=>e.CidrIp==="0.0.0.0/0"||e.CidrIpv6==="::/0",N0=(e,t,s)=>t===void 0||s===void 0?!1:e>=t&&e<=s,Um=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::EC2::SecurityGroup")return s;let i=[],o=F(r,n),a=r.Properties?.SecurityGroupIngress||[],c=r.Properties?.SecurityGroupEgress||[],u=a.some(d=>d.CidrIp==="0.0.0.0/0"),l=a.some(d=>d.CidrIpv6==="::/0");u&&i.push(t(n,"Security Group allows unrestricted IPv4 ingress (0.0.0.0/0).","Restrict security group rules to specific IPs and ports.","HIGH","Security",o,"cdkInsights")),l&&i.push(t(n,"Security Group allows unrestricted IPv6 ingress (::/0).","Restrict security group rules to specific IPs and ports.","HIGH","Security",o,"cdkInsights"));for(let d of a)if(M0(d)){for(let f of B0)if(N0(f,d.FromPort,d.ToPort)){i.push(t(n,`Security Group exposes port ${f} to the internet.`,"Restrict access to management and database ports. Use bastion hosts, VPN, or AWS Systems Manager Session Manager instead.","CRITICAL","Security",o,"cdkInsights"));break}}return c.some(d=>d.CidrIp==="0.0.0.0/0")&&i.push(t(n,"Security Group allows unrestricted egress to 0.0.0.0/0.","Consider restricting egress rules to specific destinations for defense in depth.","LOW","Security",o,"cdkInsights")),a.length===0&&c.length===0&&i.push(t(n,"Security Group has no ingress or egress rules defined.","Review if this security group is in use. Empty security groups may indicate orphaned resources or misconfiguration.","LOW","Operational Excellence",o,"cdkInsights")),i.length>0&&(s[n]={issues:i}),s},{});var W0=/(^|_)(secret|password|passwd|pwd|credential|private_key|api_key|api_secret|auth_token|access_key|access_secret|bearer_token|jwt_secret|encryption_key|signing_key)(_|$)/i,Gm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ECS::TaskDefinition")return s;let i=[],o=F(r,n),a=r.Properties?.ContainerDefinitions||[];for(let c of a){let u=c.Environment||[];for(let l of u)W0.test(l.Name||"")&&i.push(t(n,`ECS task definition has sensitive environment variable "${l.Name}" in plaintext.`,'Use AWS Secrets Manager or SSM Parameter Store with the "secrets" property instead of plaintext environment variables.',"HIGH","Security",o,"cdkInsights"))}return i.length>0&&(s[n]={issues:i}),s},{});var zm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ECS::TaskDefinition")return s;let i=[],o=F(r,n),a=r.Properties?.ContainerDefinitions||[];for(let c of a)c.LogConfiguration?.LogDriver||i.push(t(n,`ECS container "${c.Name||"unnamed"}" has no logging configuration.`,"Configure LogConfiguration with awslogs driver to send container logs to CloudWatch for monitoring and debugging.","MEDIUM","Operational Excellence",o,"cdkInsights"));return i.length>0&&(s[n]={issues:i}),s},{});var qm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ECS::TaskDefinition")return s;let i=[],o=F(r,n),a=r.Properties?.ContainerDefinitions||[];for(let c of a){let u=c.Memory||c.MemoryReservation,l=c.Cpu;!u&&!l&&i.push(t(n,`ECS container "${c.Name||"unnamed"}" has no CPU or memory limits defined.`,"Define CPU and Memory limits to prevent runaway containers and ensure predictable resource allocation.","LOW","Reliability",o,"cdkInsights"))}return i.length>0&&(s[n]={issues:i}),s},{});var Hm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElasticLoadBalancingV2::LoadBalancer")return s;let i=F(r,n);return(r.Properties?.LoadBalancerAttributes||[]).some(c=>c.Key==="deletion_protection.enabled"&&c.Value==="true")||(s[n]={issues:[t(n,"Load Balancer does not have deletion protection enabled.","Enable deletion protection to prevent accidental deletion of the load balancer in production environments.","MEDIUM","Reliability",i,"cdkInsights")]}),s},{});var Vm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElasticLoadBalancingV2::LoadBalancer")return s;let i=F(r,n);return(r.Properties?.LoadBalancerAttributes||[]).some(c=>c.Key==="access_logs.s3.enabled"&&c.Value==="true")||(s[n]={issues:[t(n,"Load Balancer does not have access logging enabled.","Enable access logging to S3 for security analysis, auditing, and troubleshooting of traffic patterns.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var Km=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElasticLoadBalancingV2::Listener")return s;let i=F(r,n),o=r.Properties?.Protocol,a=r.Properties?.Port;return o==="HTTP"&&a!==80?s[n]={issues:[t(n,`Load Balancer listener uses HTTP protocol on port ${a}.`,"Use HTTPS protocol with a valid SSL certificate to encrypt traffic in transit.","HIGH","Security",i,"cdkInsights")]}:o==="HTTP"&&a===80&&((r.Properties?.DefaultActions||[]).some(l=>l.Type==="redirect"&&l.RedirectConfig?.Protocol==="HTTPS")||(s[n]={issues:[t(n,"Load Balancer HTTP listener on port 80 does not redirect to HTTPS.","Configure the HTTP listener to redirect to HTTPS to ensure encrypted traffic.","MEDIUM","Security",i,"cdkInsights")]})),s},{});var j0=["ELBSecurityPolicy-2016-08","ELBSecurityPolicy-TLS-1-0-2015-04","ELBSecurityPolicy-TLS-1-1-2017-01","ELBSecurityPolicy-2015-05"],Zm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElasticLoadBalancingV2::Listener")return s;let i=F(r,n),o=r.Properties?.Protocol,a=r.Properties?.SslPolicy;return o!=="HTTPS"&&o!=="TLS"||a&&j0.includes(a)&&(s[n]={issues:[t(n,`Load Balancer listener uses outdated security policy (${a}).`,"Use ELBSecurityPolicy-TLS13-1-2-2021-06 or later for TLS 1.3 support, or at minimum ELBSecurityPolicy-TLS-1-2-2017-01 for TLS 1.2.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var Ym=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Events::Rule")return s;let i=F(r,n),o=[];return r.Properties?.State!=="ENABLED"&&o.push(t(n,"EventBridge rule is disabled or not explicitly enabled.","Ensure the EventBridge rule State is set to ENABLED to trigger events as expected.","MEDIUM","Operational Excellence",i,"cdkInsights")),(!r.Properties?.Targets||Array.isArray(r.Properties.Targets)&&r.Properties.Targets.length===0)&&o.push(t(n,"EventBridge rule has no targets configured. Events matching this rule will be silently dropped.","Add at least one target (Lambda, SQS, SNS, Step Functions, etc.) to process matched events. Without targets, the rule matches events but takes no action.","HIGH","Reliability",i,"cdkInsights")),o.length>0&&(s[n]={issues:[...s[n]?.issues||[],...o]}),s},{});var Jm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::IAM::Policy"&&r.Type!=="AWS::IAM::Role")return s;let i=r.Properties?.Policies,o=[];if(Array.isArray(i))for(let u of i)u?.PolicyDocument&&o.push(u.PolicyDocument);let a=r.Properties?.PolicyDocument;a&&o.push(a);let c=[];for(let u of o){if(!u?.Statement)continue;let l=u.Statement;for(let p of l)if(p.Effect==="Allow"){let d=p.Action,f=p.Resource,m=d==="*"||Array.isArray(d)&&d.includes("*"),g=f==="*"||Array.isArray(f)&&f.includes("*");m&&g?c.push(t(n,"IAM policy allows all actions (*) on all resources (*). This grants administrative access.","Restrict both actions and resources to follow the principle of least privilege.","CRITICAL","Security",n,"cdkInsights")):m?c.push(t(n,"IAM policy allows all actions (*). This is overly permissive.","Specify only the required actions instead of using wildcards.","CRITICAL","Security",n,"cdkInsights")):g&&c.push(t(n,"IAM policy allows actions on all resources (*). This is overly permissive.","Restrict resources to specific ARNs instead of using wildcards.","HIGH","Security",n,"cdkInsights"))}}return c.length>0&&(s[n]={issues:c}),s},{});var $0=[/\/ServiceRole\/Resource$/,/\/Role\/Resource$/,/\/InstanceRole\/Resource$/,/CustomResourceProvider\/Role$/],U0=e=>$0.some(t=>t.test(e)),Qm=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::IAM::Role")return s;let i=F(r,n);return U0(i)||r.Properties?.PermissionsBoundary||(s[n]={issues:[t(n,"IAM Role has no permission boundary configured.","Consider using permission boundaries to limit the maximum permissions for delegated access and prevent privilege escalation.","LOW","Security",i,"cdkInsights")]}),s},{});var Xm=/^\d{12}$/,ef=/arn:aws:iam::(\d{12}):root/,G0=e=>{if(!e)return[];if(typeof e=="string"){if(Xm.test(e))return[e];let t=e.match(ef);return t?[t[1]]:[]}return typeof e=="object"&&e.AWS?(Array.isArray(e.AWS)?e.AWS:[e.AWS]).flatMap(s=>{if(Xm.test(s))return[s];let n=s.match(ef);return n?[n[1]]:[]}):[]},tf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::IAM::Role")return s;let i=[],o=F(r,n),a=r.Properties?.AssumeRolePolicyDocument;if(a?.Statement){for(let c of a.Statement)if(c.Effect==="Allow"){let u=G0(c.Principal);for(let l of u)i.push(t(n,`IAM Role allows cross-account trust from account ${l}.`,"Verify this cross-account trust relationship is intentional and the external account is trusted. Consider adding conditions to restrict access.","MEDIUM","Security",o,"cdkInsights"))}}return i.length>0&&(s[n]={issues:i}),s},{});var z0=e=>typeof e=="string"?e==="*":typeof e=="object"?Object.values(e).some(t=>Array.isArray(t)?t.includes("*"):t==="*"):!1,sf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>((r.Type==="AWS::KMS::Key"&&Array.isArray(r.Properties?.KeyPolicy?.Statement)?r.Properties.KeyPolicy.Statement:[]).some(a=>z0(a.Principal))&&(s[n]={issues:[t(n,"KMS key has a public policy.","Restrict the KMS key policy to specific IAM roles or users to prevent unauthorized access.","CRITICAL","Security",F(r,n),"cdkInsights")]}),s),{});var q0=/\b(secret|password|passwd|pwd|credential|private_key|api_key|api_secret|auth_token|access_key|access_secret|bearer_token|jwt_secret|encryption_key|signing_key)\b/i,nf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type==="AWS::Lambda::Function"){let i=Object.entries(r.Properties?.Environment?.Variables||{}).filter(([o])=>q0.test(o)).map(([o])=>t(n,`Lambda function contains sensitive environment variable: ${o}.`,"Store sensitive environment variables in AWS Secrets Manager or SSM Parameter Store instead of plaintext environment variables.","HIGH","Security",F(r,n),"cdkInsights"));i.length>0&&(s[n]={issues:i})}return s},{});var rf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type==="AWS::Lambda::Function"){let i=r.Properties?.MemorySize;typeof i=="number"&&i>1024&&(s[n]={issues:[t(n,"Lambda function has high memory allocation.","Consider reducing memory for cost savings.","MEDIUM","Cost Optimization",F(r,n),"cdkInsights")]})}return s},{});var of=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Lambda::Function")return s;let i=F(r,n);return r.Properties?.ReservedConcurrentExecutions===void 0&&(s[n]={issues:[t(n,"Lambda function has no reserved concurrency configured.","Consider setting ReservedConcurrentExecutions to prevent the function from consuming all available account concurrency and to control scaling behavior.","LOW","Reliability",i,"cdkInsights")]}),s},{});var af=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Lambda::Function")return s;let i=F(r,n);return r.Properties?.DeadLetterConfig?.TargetArn||(s[n]={issues:[t(n,"Lambda function has no Dead Letter Queue configured.","Configure a Dead Letter Queue (SQS or SNS) to capture failed async invocations for debugging, monitoring, and retry processing.","MEDIUM","Reliability",i,"cdkInsights")]}),s},{});var H0={nodejs:"nodejs22.x","nodejs4.3":"nodejs22.x","nodejs4.3-edge":"nodejs22.x","nodejs6.10":"nodejs22.x","nodejs8.10":"nodejs22.x","nodejs10.x":"nodejs22.x","nodejs12.x":"nodejs22.x","nodejs14.x":"nodejs22.x","nodejs16.x":"nodejs22.x","nodejs18.x":"nodejs22.x","python2.7":"python3.13","python3.6":"python3.13","python3.7":"python3.13","python3.8":"python3.13","python3.9":"python3.13",java8:"java21","java8.al2":"java21",java11:"java21","dotnetcore1.0":"dotnet8","dotnetcore2.0":"dotnet8","dotnetcore2.1":"dotnet8","dotnetcore3.1":"dotnet8","dotnet5.0":"dotnet8",dotnet6:"dotnet8","ruby2.5":"ruby3.3","ruby2.7":"ruby3.3","go1.x":"provided.al2023"},cf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Lambda::Function")return s;let i=r.Properties?.Runtime;if(typeof i!="string")return s;let o=H0[i];return o&&(s[n]={issues:[t(n,`Lambda function uses deprecated runtime "${i}". This runtime has reached or is approaching end-of-life and will no longer receive security patches.`,`Upgrade to "${o}" for continued security patches, performance improvements, and long-term support.`,"HIGH","Security",F(r,n),"cdkInsights")]}),s},{});var uf=(e,t)=>Object.values(e.Resources||{}).some(n=>n.Type==="AWS::EC2::NatGateway")?Object.entries(e.Resources||{}).reduce((n,[r,i])=>{if(i.Type!=="AWS::Lambda::Function")return n;let o=F(i,r),a=i.Properties?.VpcConfig;return a?.SubnetIds&&a.SubnetIds.length>0&&(n[r]={issues:[t(r,"Lambda function in VPC with NAT Gateway detected. NAT Gateway costs can accumulate quickly.","Evaluate if VPC attachment is necessary. Consider using VPC endpoints for AWS services to reduce NAT costs. NAT Gateway charges ~$0.045/hr plus $0.045/GB processed.","MEDIUM","Cost Optimization",o,"cdkInsights")]}),n},{}):{};var lf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::RDS::DBInstance"&&r.Properties?.StorageEncrypted!==!0&&(s[n]={issues:[t(n,"RDS instance is not encrypted.","Enable encryption to protect data at rest and meet compliance standards.","CRITICAL","Security",F(r,n),"cdkInsights")]}),s),{});var pf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::RDS::DBInstance")return s;let i=r.Properties??{},o=i.MultiAZ===!0,a=i.StorageType==="gp2",c=typeof i.StorageType>"u";return o&&(a||c)&&(s[n]={issues:[t(n,a?"RDS instance is using Multi-AZ with gp2 storage. Consider gp3 for lower costs.":"RDS instance is using Multi-AZ without explicitly setting a storage type. gp3 may offer better performance and cost savings.","Switch to gp3 storage for RDS to reduce costs and improve performance.","MEDIUM","Cost Optimization",F(r,n),"cdkInsights")]}),s},{});var df=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::RDS::DBInstance")return s;let i=F(r,n);return r.Properties?.PubliclyAccessible===!0&&(s[n]={issues:[t(n,"RDS instance is publicly accessible from the internet.","Set PubliclyAccessible to false and access the database through private subnets, bastion hosts, or VPN.","CRITICAL","Security",i,"cdkInsights")]}),s},{});var mf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::RDS::DBInstance")return s;let i=F(r,n),o=r.Properties?.BackupRetentionPeriod;return o===0?s[n]={issues:[t(n,"RDS instance has automated backups disabled (BackupRetentionPeriod is 0).","Enable automated backups with at least 7 days retention for production databases to enable point-in-time recovery.","HIGH","Reliability",i,"cdkInsights")]}:o!==void 0&&o<7&&(s[n]={issues:[t(n,`RDS backup retention period is only ${o} day(s).`,"Consider increasing backup retention to at least 7 days for production databases.","MEDIUM","Reliability",i,"cdkInsights")]}),s},{});var ff=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::RDS::DBInstance")return s;let i=F(r,n);return r.Properties?.DeletionProtection!==!0&&(s[n]={issues:[t(n,"RDS instance does not have deletion protection enabled.","Enable DeletionProtection to prevent accidental database deletion.","MEDIUM","Reliability",i,"cdkInsights")]}),s},{});var gf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::S3::Bucket")return s;let i=[],o=r.Properties??{},a=F(r,n);o.BucketEncryption||i.push(t(n,"S3 Bucket lacks encryption.","Enable encryption at rest for better security.","HIGH","Security",a,"cdkInsights"));let c=o?.PublicAccessBlockConfiguration;return c?(c.BlockPublicAcls===!1&&i.push(t(n,"S3 Bucket allows public ACLs (BlockPublicAcls is false).","Set BlockPublicAcls to true to prevent public ACLs from being applied.","CRITICAL","Security",a,"cdkInsights")),c.BlockPublicPolicy===!1&&i.push(t(n,"S3 Bucket allows public bucket policies (BlockPublicPolicy is false).","Set BlockPublicPolicy to true to prevent public bucket policies.","CRITICAL","Security",a,"cdkInsights")),c.IgnorePublicAcls===!1&&i.push(t(n,"S3 Bucket does not ignore public ACLs (IgnorePublicAcls is false).","Set IgnorePublicAcls to true to ignore any public ACLs on the bucket.","HIGH","Security",a,"cdkInsights")),c.RestrictPublicBuckets===!1&&i.push(t(n,"S3 Bucket does not restrict public bucket access (RestrictPublicBuckets is false).","Set RestrictPublicBuckets to true to restrict access to the bucket to only authorized users.","HIGH","Security",a,"cdkInsights"))):i.push(t(n,"S3 Bucket has no PublicAccessBlockConfiguration defined.","Configure PublicAccessBlockConfiguration with BlockPublicAcls, BlockPublicPolicy, IgnorePublicAcls, and RestrictPublicBuckets all set to true.","HIGH","Security",a,"cdkInsights")),o.VersioningConfiguration||i.push(t(n,"S3 Bucket has no versioning enabled.","Enable versioning to protect against accidental deletions.","MEDIUM","Operational Excellence",a,"cdkInsights")),i.length>0&&(s[n]={issues:i}),s},{});var hf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::S3::Bucket"&&!r.Properties?.IntelligentTieringConfigurations&&(s[n]={issues:[t(n,"S3 Bucket does not use Intelligent-Tiering. Consider enabling it for cost optimization.","Enable Intelligent-Tiering for automatic cost optimization of infrequently accessed objects.","LOW","Cost Optimization",F(r,n),"cdkInsights")]}),s),{});var yf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::S3::Bucket")return s;let i=F(r,n);return(r.Properties?.LifecycleConfiguration?.Rules||[]).length===0&&(s[n]={issues:[t(n,"S3 bucket has no lifecycle policy configured.","Configure lifecycle rules to automatically transition objects to cheaper storage classes (e.g., Glacier) or delete old versions to optimize storage costs.","MEDIUM","Cost Optimization",i,"cdkInsights")]}),s},{});var V0=/\b(prod|production|critical|backup|dr|disaster|recovery|primary)\b/i,Df=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::S3::Bucket")return s;let i=F(r,n),o=r.Properties?.BucketName||n,a=r.Properties?.ReplicationConfiguration;return V0.test(o)&&!a?.Rules?.length&&(s[n]={issues:[t(n,"Critical S3 bucket does not have cross-region replication configured.","Consider enabling cross-region replication for disaster recovery and data durability on production/critical buckets.","LOW","Reliability",i,"cdkInsights")]}),s},{});var bf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{let i=r.Properties??{};return r.Type==="AWS::SecretsManager::Secret"&&i.PublicPolicy&&(s[n]={issues:[t(n,"Secret is publicly accessible.","Restrict secret access using IAM policies to ensure only authorized entities can retrieve it.","CRITICAL","Security",F(r,n),"cdkInsights")]}),s},{});var vf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::SNS::Topic"&&!r.Properties?.KmsMasterKeyId&&(s[n]={issues:[t(n,"SNS topic is not encrypted.","Enable AWS KMS encryption for SNS to protect sensitive messages in transit and at rest.","HIGH","Security",F(r,n),"cdkInsights")]}),s),{});var Sf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::SQS::Queue"&&!r.Properties?.KmsMasterKeyId&&(s[n]={issues:[t(n,"SQS queue is not encrypted.","Enable AWS KMS encryption for SQS to protect message data in transit and at rest.","HIGH","Security",F(r,n),"cdkInsights")]}),s),{});var Cf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>(r.Type==="AWS::StepFunctions::StateMachine"&&r.Properties?.LoggingConfiguration===void 0&&(s[n]={issues:[t(n,"Step Function lacks logging configuration.","Enable logging for the Step Function using AWS CloudWatch to improve monitoring and debugging.","HIGH","Security",F(r,n),"cdkInsights")]}),s),{});var K0=e=>Object.values(e.Resources||{}).some(t=>t.Type==="Custom::S3BucketNotifications"),xf=e=>Object.values(e.Resources||{}).some(t=>t.Type==="AWS::Lambda::EventSourceMapping"),Af=e=>Object.values(e.Resources||{}).some(t=>t.Type==="AWS::Events::Rule"),Ff=(e,t)=>Object.values(e.Resources||{}).some(s=>s.Type!=="AWS::ElasticLoadBalancingV2::Listener"?!1:(s.Properties?.DefaultActions||s.Properties?.Actions)?.some(r=>r.TargetGroupArn?.startsWith(t))),Z0=e=>Object.values(e.Resources||{}).some(t=>t.Type==="AWS::Lambda::Permission"&&t.Properties?.Principal==="apigateway.amazonaws.com"),Si=(e,t)=>Object.values(e.Resources||{}).some(s=>s.Type==="AWS::ApiGateway::Integration"&&typeof s.Properties?.Uri=="string"&&s.Properties.Uri.includes(t)),pr=(e,t)=>Object.values(e.Resources||{}).some(s=>s.Type==="AWS::IoT::TopicRule"&&s.Properties?.TopicRulePayload?.actions?.some(n=>Object.hasOwn(n,t))),Y0=e=>Object.values(e.Resources||{}).some(t=>t.Type==="AWS::ECS::Service"),Ef=(e,t)=>Object.values(e.Resources||{}).some(s=>s.Type==="AWS::SNS::Subscription"&&s.Properties?.Protocol===t),Rf=(e,t)=>{let s=[],n={},r={};for(let[o,a]of Object.entries(t)){let c=a.requiredResourceTypes||[];if(c.length!==0){r[o]=c.length;for(let u of c)n[u]||(n[u]=[]),n[u].push(o)}}let i={};for(let o of Object.values(e.Resources||{})){let a=o.Type,c=n[a];if(c){for(let u of c)if(i[u]=(i[u]||0)+1,i[u]===r[u]){let l=t[u],p=!0;switch(u){case"aws-s3-lambda":p=K0(e)||xf(e);break;case"aws-dynamodbstreams-lambda":p=xf(e);break;case"aws-eventbridge-lambda":p=Af(e);break;case"aws-alb-fargate":p=Ff(e,"arn:aws:ecs:");break;case"aws-alb-lambda":p=Ff(e,"arn:aws:lambda:");break;case"aws-apigateway-lambda":p=Z0(e);break;case"aws-apigateway-sqs":p=Si(e,"sqs");break;case"aws-apigateway-dynamodb":p=Si(e,"dynamodb");break;case"aws-apigateway-kinesisstreams":p=Si(e,"kinesis");break;case"aws-apigateway-sagemakerendpoint":p=Si(e,"sagemaker");break;case"aws-iot-lambda":p=pr(e,"lambda");break;case"aws-iot-kinesisstreams":p=pr(e,"kinesis");break;case"aws-iot-kinesisfirehose-s3":p=pr(e,"firehose");break;case"aws-iot-sqs":p=pr(e,"sqs");break;case"aws-iot-s3":p=pr(e,"s3");break;case"aws-sns-lambda":p=Ef(e,"lambda");break;case"aws-sns-sqs":p=Ef(e,"sqs");break;case"aws-fargate-dynamodb":case"aws-fargate-eventbridge":case"aws-fargate-kinesisfirehose":case"aws-fargate-kinesisstreams":case"aws-fargate-opensearch":case"aws-fargate-s3":case"aws-fargate-secretsmanager":case"aws-fargate-sns":case"aws-fargate-sqs":case"aws-fargate-ssmstringparameter":case"aws-fargate-stepfunctions":p=Y0(e);break;case"aws-eventbridge-kinesisfirehose-s3":case"aws-eventbridge-kinesisstreams":case"aws-eventbridge-sns":case"aws-eventbridge-sqs":case"aws-eventbridge-stepfunctions":p=Af(e);break}if(!p)continue;s.push({resourceId:l.className,issue:`Possible Pattern detected: ${l.friendlyName}`,recommendation:`Consider using the AWS Solutions Construct \`${l.className}\` from \`@aws-solutions-constructs/${u}\`.`,severity:"LOW",wafPillar:"Operational Excellence",docUrl:l.documentationUrl,githubUrl:l.githubUrl,constructPath:l.className,foundBy:"cdkInsights"}),delete r[u]}}}return s};var wf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::WAFv2::WebACL")return s;let i=F(r,n),o=[],a=r.Properties?.DefaultAction;a?.Allow&&!a?.Block&&o.push(t(n,"WAF WebACL has default action set to Allow, which permits all traffic not matching rules.","Consider setting the default action to Block and explicitly allowing known-good traffic patterns for defense-in-depth.","MEDIUM","Security",i,"cdkInsights")),r.Properties?.VisibilityConfig?.CloudWatchMetricsEnabled||o.push(t(n,"WAF WebACL does not have CloudWatch metrics enabled.","Enable CloudWatchMetricsEnabled in VisibilityConfig to monitor WAF activity and detect potential attacks.","MEDIUM","Security",i,"cdkInsights"));let u=r.Properties?.Rules;return(!u||u.length===0)&&o.push(t(n,"WAF WebACL has no rules defined.","Add WAF rules to protect against common web exploits like SQL injection, XSS, and bot traffic.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var If=(e,t)=>{let s=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::WAFv2::WebACL"),n=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::WAFv2::LoggingConfiguration"),r=new Set(n.map(([,i])=>{let o=i.Properties?.ResourceArn;return typeof o=="string"?o:o?.Ref?o.Ref:o?.["Fn::GetAtt"]?.[0]?o["Fn::GetAtt"][0]:null}).filter(Boolean));return s.reduce((i,[o,a])=>{let c=F(a,o);return r.has(o)||n.some(([,l])=>{let p=l.Properties?.ResourceArn;return typeof p=="object"&&(p?.Ref===o||p?.["Fn::GetAtt"]?.[0]===o)})||(i[o]={issues:[t(o,"WAF WebACL does not have logging configured.","Enable WAF logging to capture detailed information about web requests for security analysis and compliance.","MEDIUM","Security",c,"cdkInsights")]}),i},{})};var Tf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Logs::LogGroup")return s;let i=F(r,n);return r.Properties?.RetentionInDays===void 0&&(s[n]={issues:[t(n,"CloudWatch Log Group has no retention period set (logs retained indefinitely).","Set RetentionInDays to control storage costs. Consider 30-90 days for operational logs, longer for compliance requirements.","MEDIUM","Cost Optimization",i,"cdkInsights")]}),s},{});var kf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Logs::LogGroup")return s;let i=F(r,n);return r.Properties?.KmsKeyId||(s[n]={issues:[t(n,"CloudWatch Log Group is not encrypted with a customer-managed KMS key.","Enable KMS encryption using KmsKeyId to protect sensitive log data at rest with customer-managed keys.","LOW","Security",i,"cdkInsights")]}),s},{});var _f=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::CloudWatch::Alarm")return s;let i=F(r,n),o=[],a=r.Properties?.AlarmActions,c=r.Properties?.OKActions,u=r.Properties?.InsufficientDataActions;return(!a||a.length===0)&&o.push(t(n,"CloudWatch Alarm has no alarm actions configured.","Add AlarmActions (SNS topic, Lambda, etc.) to receive notifications when the alarm state changes to ALARM.","MEDIUM","Operational Excellence",i,"cdkInsights")),r.Properties?.TreatMissingData||o.push(t(n,"CloudWatch Alarm does not specify how to treat missing data.","Set TreatMissingData to define alarm behavior when data points are missing (missing, ignore, breaching, or notBreaching).","LOW","Operational Excellence",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Lf=(e,t)=>{let s=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::Route53::HostedZone"),n=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::Route53::DNSSEC"),r=new Set(n.map(([,i])=>{let o=i.Properties?.HostedZoneId;return typeof o=="string"?o:o?.Ref?o.Ref:null}).filter(Boolean));return s.reduce((i,[o,a])=>{if(a.Properties?.HostedZoneConfig?.Comment?.includes("private"))return i;let c=F(a,o);return r.has(o)||(i[o]={issues:[t(o,"Route53 Hosted Zone does not have DNSSEC signing enabled.","Enable DNSSEC to protect against DNS spoofing and cache poisoning attacks by cryptographically signing DNS records.","LOW","Security",c,"cdkInsights")]}),i},{})};var Pf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Route53::HealthCheck")return s;let i=F(r,n),o=[],a=r.Properties?.HealthCheckConfig;return a?.Type==="HTTP"&&o.push(t(n,"Route53 Health Check uses HTTP instead of HTTPS.","Use HTTPS for health checks to ensure the endpoint supports secure connections and to validate SSL certificates.","LOW","Security",i,"cdkInsights")),a?.RequestInterval===30&&o.push(t(n,"Route53 Health Check uses standard (30 second) request interval.","Consider using fast interval (10 seconds) for critical endpoints to detect failures more quickly.","LOW","Reliability",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Of=(e,t)=>{let s=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::Route53::HostedZone"),n=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::Route53::QueryLoggingConfig"),r=new Set(n.map(([,i])=>{let o=i.Properties?.HostedZoneId;return typeof o=="string"?o:o?.Ref?o.Ref:null}).filter(Boolean));return s.reduce((i,[o,a])=>{let c=F(a,o);return r.has(o)||(i[o]={issues:[t(o,"Route53 Hosted Zone does not have query logging enabled.","Enable query logging to CloudWatch Logs for DNS query analysis, troubleshooting, and security monitoring.","LOW","Security",c,"cdkInsights")]}),i},{})};var Bf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElastiCache::ReplicationGroup"&&r.Type!=="AWS::ElastiCache::CacheCluster")return s;let i=F(r,n),o=[];return r.Properties?.AtRestEncryptionEnabled!==!0&&o.push(t(n,"ElastiCache cluster does not have encryption at rest enabled.","Enable AtRestEncryptionEnabled to protect cached data at rest using AWS-managed or customer-managed keys.","HIGH","Security",i,"cdkInsights")),r.Properties?.TransitEncryptionEnabled!==!0&&o.push(t(n,"ElastiCache cluster does not have encryption in transit enabled.","Enable TransitEncryptionEnabled to protect data during transfer between clients and the cache.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Mf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElastiCache::ReplicationGroup")return s;let i=F(r,n),o=[],a=r.Properties?.AuthToken,c=r.Properties?.TransitEncryptionEnabled;return!a&&c===!0&&o.push(t(n,"ElastiCache Redis cluster has transit encryption but no AUTH token configured.","Set AuthToken to require authentication for Redis connections, providing an additional security layer.","MEDIUM","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Nf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ElastiCache::ReplicationGroup")return s;let i=F(r,n),o=[],a=r.Properties?.AutomaticFailoverEnabled,c=r.Properties?.NumNodeGroups||1,u=r.Properties?.ReplicasPerNodeGroup||0;return a!==!0&&(c>1||u>0)&&o.push(t(n,"ElastiCache replication group has replicas but automatic failover is not enabled.","Enable AutomaticFailoverEnabled to automatically promote a replica to primary if the primary node fails.","MEDIUM","Reliability",i,"cdkInsights")),r.Properties?.MultiAZEnabled!==!0&&a===!0&&o.push(t(n,"ElastiCache replication group has automatic failover but Multi-AZ is not enabled.","Enable MultiAZEnabled to distribute nodes across availability zones for higher availability.","MEDIUM","Reliability",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Wf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ECR::Repository")return s;let i=F(r,n),o=[];return r.Properties?.ImageScanningConfiguration?.ScanOnPush!==!0&&o.push(t(n,"ECR repository does not have image scanning on push enabled.","Enable ScanOnPush in ImageScanningConfiguration to automatically scan images for vulnerabilities when pushed.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var jf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ECR::Repository")return s;let i=F(r,n);return r.Properties?.LifecyclePolicy?.LifecyclePolicyText||(s[n]={issues:[t(n,"ECR repository does not have a lifecycle policy configured.","Add a lifecycle policy to automatically clean up old or untagged images and reduce storage costs.","MEDIUM","Cost Optimization",i,"cdkInsights")]}),s},{});var $f=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::ECR::Repository")return s;let i=F(r,n);return r.Properties?.ImageTagMutability!=="IMMUTABLE"&&(s[n]={issues:[t(n,"ECR repository allows mutable image tags.","Set ImageTagMutability to IMMUTABLE to prevent image tags from being overwritten, ensuring deployment consistency.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var Uf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::OpenSearchService::Domain"&&r.Type!=="AWS::Elasticsearch::Domain")return s;let i=F(r,n),o=[];return r.Properties?.EncryptionAtRestOptions?.Enabled!==!0&&o.push(t(n,"OpenSearch domain does not have encryption at rest enabled.","Enable EncryptionAtRestOptions to protect indexed data at rest using AWS KMS.","HIGH","Security",i,"cdkInsights")),r.Properties?.NodeToNodeEncryptionOptions?.Enabled!==!0&&o.push(t(n,"OpenSearch domain does not have node-to-node encryption enabled.","Enable NodeToNodeEncryptionOptions to encrypt data in transit between nodes within the cluster.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Gf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::OpenSearchService::Domain"&&r.Type!=="AWS::Elasticsearch::Domain")return s;let i=F(r,n),o=[];r.Properties?.AdvancedSecurityOptions?.Enabled!==!0&&o.push(t(n,"OpenSearch domain does not have fine-grained access control enabled.","Enable AdvancedSecurityOptions to use IAM or internal user database for document-level and field-level security.","MEDIUM","Security",i,"cdkInsights"));let c=r.Properties?.VPCOptions;return(!c?.SubnetIds||c.SubnetIds.length===0)&&o.push(t(n,"OpenSearch domain is not deployed within a VPC.","Configure VPCOptions with subnet IDs to deploy the domain within a VPC for network isolation.","MEDIUM","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var zf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::OpenSearchService::Domain"&&r.Type!=="AWS::Elasticsearch::Domain")return s;let i=F(r,n),o=[],a=r.Properties?.LogPublishingOptions;return a?.AUDIT_LOGS?.Enabled||o.push(t(n,"OpenSearch domain does not have audit logging enabled.","Enable AUDIT_LOGS in LogPublishingOptions to track user activity for security and compliance monitoring.","LOW","Security",i,"cdkInsights")),a?.ES_APPLICATION_LOGS?.Enabled||o.push(t(n,"OpenSearch domain does not have application logging enabled.","Enable ES_APPLICATION_LOGS in LogPublishingOptions to capture error logs for troubleshooting.","LOW","Operational Excellence",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var qf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::CertificateManager::Certificate")return s;let i=F(r,n),o=[];return r.Properties?.ValidationMethod==="EMAIL"&&o.push(t(n,"ACM certificate uses email validation instead of DNS validation.","Use DNS validation for automated certificate renewal. Email validation requires manual intervention for renewals.","LOW","Operational Excellence",i,"cdkInsights")),r.Properties?.CertificateTransparencyLoggingPreference==="DISABLED"&&o.push(t(n,"ACM certificate has certificate transparency logging disabled.","Enable certificate transparency logging for security monitoring and to detect misissued certificates.","LOW","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Hf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Backup::BackupPlan")return s;let i=F(r,n),o=[],c=r.Properties?.BackupPlan?.BackupPlanRule||[];for(let u of c){(u.CopyActions||[]).length===0&&o.push(t(n,`Backup rule "${u.RuleName||"unnamed"}" does not have cross-region copy configured.`,"Add CopyActions to replicate backups to another region for disaster recovery.","LOW","Reliability",i,"cdkInsights"));let p=u.Lifecycle;!p?.DeleteAfterDays&&!p?.MoveToColdStorageAfterDays&&o.push(t(n,`Backup rule "${u.RuleName||"unnamed"}" has no lifecycle configuration.`,"Set DeleteAfterDays or MoveToColdStorageAfterDays to manage backup retention and costs.","LOW","Cost Optimization",i,"cdkInsights"))}return o.length>0&&(s[n]={issues:o}),s},{});var Vf=(e,t)=>{let s=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::Backup::BackupVault"),n=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::Backup::BackupVaultLock"),r=new Set(n.map(([,i])=>{let o=i.Properties?.BackupVaultName;return typeof o=="string"?o:typeof o=="object"&&o?.Ref?o.Ref:null}).filter(Boolean));return s.reduce((i,[o,a])=>{let c=F(a,o),u=[];a.Properties?.EncryptionKeyArn||u.push(t(o,"Backup vault uses default AWS-managed encryption key.","Specify a customer-managed KMS key using EncryptionKeyArn for additional control over encryption.","LOW","Security",c,"cdkInsights"));let p=a.Properties?.BackupVaultName,d=typeof p=="string"?p:typeof p=="object"?p?.Ref:void 0;return r.has(o)||d&&r.has(d)||u.push(t(o,"Backup vault does not have a vault lock configured.","Add a BackupVaultLock to enforce retention policies and prevent backup deletion for compliance requirements.","LOW","Security",c,"cdkInsights")),u.length>0&&(i[o]={issues:u}),i},{})};var Kf=(e,t)=>{let s=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::EC2::VPC"),n=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::EC2::FlowLog"),r=new Set(n.filter(([,i])=>i.Properties?.ResourceType==="VPC").map(([,i])=>{let o=i.Properties?.ResourceId;return typeof o=="string"?o:o?.Ref?o.Ref:null}).filter(Boolean));return s.reduce((i,[o,a])=>{let c=F(a,o);return r.has(o)||(i[o]={issues:[t(o,"VPC does not have flow logs enabled.","Enable VPC Flow Logs to capture network traffic information for security analysis and troubleshooting.","MEDIUM","Security",c,"cdkInsights")]}),i},{})};var Zf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::EC2::SecurityGroup")return s;let i=F(r,n);if(r.Properties?.GroupName==="default"){let a=r.Properties?.SecurityGroupIngress||[],c=r.Properties?.SecurityGroupEgress||[];(a.length>0||c.length>0)&&(s[n]={issues:[t(n,"VPC default security group has rules configured.","Remove all rules from the default security group and use custom security groups instead. Default groups cannot be deleted but should have no rules.","MEDIUM","Security",i,"cdkInsights")]})}return s},{});var Yf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Kinesis::Stream")return s;let i=F(r,n),o=[],a=r.Properties?.StreamEncryption;return(!a?.EncryptionType||a.EncryptionType==="NONE")&&o.push(t(n,"Kinesis Data Stream does not have server-side encryption enabled.","Enable StreamEncryption with EncryptionType KMS to protect data at rest.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Jf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Kinesis::Stream")return s;let i=F(r,n),o=[];r.Properties?.RetentionPeriodHours===24&&o.push(t(n,"Kinesis Data Stream uses minimum retention period (24 hours).","Consider increasing RetentionPeriodHours for applications that need to replay or reprocess data during failures.","LOW","Reliability",i,"cdkInsights"));let c=r.Properties?.StreamModeDetails?.StreamMode;return o.length>0&&(s[n]={issues:o}),s},{});var Qf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::AppSync::GraphQLApi")return s;let i=F(r,n),o=[],a=r.Properties?.AuthenticationType;a==="API_KEY"&&o.push(t(n,"AppSync API uses API key authentication.","Consider using AWS_IAM, AMAZON_COGNITO_USER_POOLS, or OPENID_CONNECT for production workloads. API keys are best for development or public read-only access.","MEDIUM","Security",i,"cdkInsights"));let c=r.Properties?.AdditionalAuthenticationProviders;return a!=="AWS_IAM"&&(!c||c.length===0)&&o.push(t(n,"AppSync API does not have multiple authentication providers configured.","Consider adding AdditionalAuthenticationProviders for flexibility in authenticating different client types.","LOW","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var Xf=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::AppSync::GraphQLApi")return s;let i=F(r,n),o=[],a=r.Properties?.LogConfig;return a?a.FieldLogLevel==="NONE"&&o.push(t(n,"AppSync API has field-level logging disabled.","Set FieldLogLevel to ERROR or ALL to capture GraphQL resolver execution details.","LOW","Operational Excellence",i,"cdkInsights")):o.push(t(n,"AppSync API does not have logging configured.","Enable LogConfig to capture request/response logs in CloudWatch for debugging and monitoring.","MEDIUM","Operational Excellence",i,"cdkInsights")),r.Properties?.XrayEnabled!==!0&&o.push(t(n,"AppSync API does not have X-Ray tracing enabled.","Enable XrayEnabled for distributed tracing and performance analysis.","LOW","Operational Excellence",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var eg=(e,t)=>{let s=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::AppSync::GraphQLApi"),n=Object.entries(e.Resources||{}).filter(([,i])=>i.Type==="AWS::WAFv2::WebACLAssociation"),r=new Set(n.map(([,i])=>{let o=i.Properties?.ResourceArn;return typeof o=="string"?o:o?.["Fn::GetAtt"]?.[0]?o["Fn::GetAtt"][0]:null}).filter(Boolean));return s.reduce((i,[o,a])=>{let c=F(a,o);return r.has(o)||(i[o]={issues:[t(o,"AppSync API does not have AWS WAF protection.","Associate a WAF WebACL to protect against common web exploits and control access to the API.","MEDIUM","Security",c,"cdkInsights")]}),i},{})};var tg=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::EKS::Cluster")return s;let i=F(r,n),o=[],a=r.Properties?.ResourcesVpcConfig,c=a?.EndpointPublicAccess,u=a?.EndpointPrivateAccess,l=a?.PublicAccessCidrs;return c===!0&&u!==!0&&o.push(t(n,"EKS cluster has only public endpoint access enabled.","Enable EndpointPrivateAccess to allow communication between nodes and the API server within the VPC.","MEDIUM","Security",i,"cdkInsights")),c===!0&&(!l||l.length===0||l.includes("0.0.0.0/0"))&&o.push(t(n,"EKS cluster public endpoint is accessible from the internet (0.0.0.0/0).","Restrict PublicAccessCidrs to specific IP ranges that need to access the Kubernetes API.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var sg=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::EKS::Cluster")return s;let i=F(r,n),o=[];return r.Properties?.EncryptionConfig?.some(u=>u.Resources?.includes("secrets"))||o.push(t(n,"EKS cluster does not have Kubernetes secrets encryption enabled.","Configure EncryptionConfig with a KMS key to encrypt secrets stored in etcd.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var ng=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::EKS::Cluster")return s;let i=F(r,n),o=[],c=r.Properties?.Logging?.ClusterLogging?.EnabledTypes||[],u=c.map(d=>d.Type).filter(d=>!!d),p=["api","audit","authenticator","controllerManager","scheduler"].filter(d=>!u.includes(d));return p.length>0&&o.push(t(n,`EKS cluster is missing control plane logging for: ${p.join(", ")}.`,"Enable all control plane log types (api, audit, authenticator, controllerManager, scheduler) for comprehensive cluster monitoring.","MEDIUM","Operational Excellence",i,"cdkInsights")),c.length===0?(s[n]={issues:[t(n,"EKS cluster does not have any control plane logging enabled.","Enable control plane logging to CloudWatch for audit trails and troubleshooting Kubernetes API issues.","MEDIUM","Security",i,"cdkInsights")]},s):(o.length>0&&(s[n]={issues:o}),s)},{});var rg=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Redshift::Cluster")return s;let i=F(r,n),o=[];return r.Properties?.Encrypted!==!0&&o.push(t(n,"Redshift cluster does not have encryption at rest enabled.","Set Encrypted to true and specify a KmsKeyId to protect data at rest.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var ig=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Redshift::Cluster")return s;let i=F(r,n);return r.Properties?.PubliclyAccessible===!0&&(s[n]={issues:[t(n,"Redshift cluster is publicly accessible.","Set PubliclyAccessible to false and use VPC endpoints or bastion hosts for secure access.","CRITICAL","Security",i,"cdkInsights")]}),s},{});var og=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Redshift::Cluster")return s;let i=F(r,n);return r.Properties?.LoggingProperties?.BucketName||(s[n]={issues:[t(n,"Redshift cluster does not have audit logging enabled.","Configure LoggingProperties with an S3 bucket to capture connection logs, user activity, and query activity.","MEDIUM","Security",i,"cdkInsights")]}),s},{});var ag=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::MSK::Cluster")return s;let i=F(r,n),o=[],a=r.Properties?.EncryptionInfo;a?.EncryptionAtRest?.DataVolumeKMSKeyId||o.push(t(n,"MSK cluster does not use a customer-managed KMS key for encryption at rest.","Specify DataVolumeKMSKeyId in EncryptionAtRest for additional control over data encryption.","LOW","Security",i,"cdkInsights"));let u=a?.EncryptionInTransit;return u?.ClientBroker!=="TLS"&&o.push(t(n,"MSK cluster does not enforce TLS encryption for client-broker communication.","Set ClientBroker to TLS in EncryptionInTransit to encrypt data between clients and brokers.","HIGH","Security",i,"cdkInsights")),u?.InCluster!==!0&&o.push(t(n,"MSK cluster does not have encryption enabled for inter-broker communication.","Set InCluster to true in EncryptionInTransit to encrypt data between brokers.","MEDIUM","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var cg=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::MSK::Cluster")return s;let i=F(r,n),o=[],a=r.Properties?.ClientAuthentication,c=(a?.Tls?.CertificateAuthorityArnList?.length??0)>0,u=a?.Sasl?.Scram?.Enabled===!0||a?.Sasl?.Iam?.Enabled===!0,l=a?.Unauthenticated?.Enabled===!0;return!c&&!u&&o.push(t(n,"MSK cluster does not have client authentication configured.","Enable SASL/SCRAM, IAM authentication, or mutual TLS for client authentication.","HIGH","Security",i,"cdkInsights")),l&&o.push(t(n,"MSK cluster allows unauthenticated access.","Disable unauthenticated access and require client authentication for all connections.","HIGH","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var ug=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::MSK::Cluster")return s;let i=F(r,n),o=[],c=r.Properties?.LoggingInfo?.BrokerLogs,u=c?.CloudWatchLogs?.Enabled===!0,l=c?.Firehose?.Enabled===!0,p=c?.S3?.Enabled===!0;return!u&&!l&&!p&&o.push(t(n,"MSK cluster does not have broker logging configured.","Enable broker logs to CloudWatch, Firehose, or S3 for monitoring and troubleshooting Kafka operations.","MEDIUM","Operational Excellence",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var lg=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Glue::Job")return s;let i=F(r,n),o=[];return r.Properties?.SecurityConfiguration||o.push(t(n,"Glue job does not have a security configuration specified.","Create and attach a SecurityConfiguration to enable encryption for job bookmarks, S3 data, and CloudWatch logs.","MEDIUM","Security",i,"cdkInsights")),o.length>0&&(s[n]={issues:o}),s},{});var pg=(e,t)=>Object.entries(e.Resources||{}).reduce((s,[n,r])=>{if(r.Type!=="AWS::Glue::Connection")return s;let i=F(r,n),o=[],a=r.Properties?.ConnectionInput,c=a?.ConnectionType,u=a?.PhysicalConnectionRequirements;if(c==="JDBC"){u?.SubnetId||o.push(t(n,"Glue JDBC connection does not specify a VPC subnet.","Configure PhysicalConnectionRequirements with SubnetId and SecurityGroupIdList for network isolation.","MEDIUM","Security",i,"cdkInsights"));let p=a?.ConnectionProperties?.JDBC_CONNECTION_URL||"";typeof p=="string"&&!p.includes("ssl=true")&&!p.includes("useSSL=true")&&o.push(t(n,"Glue JDBC connection URL may not enforce SSL.","Ensure the JDBC connection URL includes SSL parameters to encrypt data in transit.","LOW","Security",i,"cdkInsights"))}return o.length>0&&(s[n]={issues:o}),s},{});var dg=()=>({iamPolicies:Jm,iamPermissionBoundary:Qm,iamCrossAccountTrust:tf,s3Buckets:gf,s3IntelligentTiering:hf,s3LifecyclePolicy:yf,s3Replication:Df,securityGroups:Um,ec2InstanceType:jm,natGatewayUsage:$m,ebsVolumes:Wm,lambdaEnvironmentVariables:nf,lambdaMemory:rf,lambdaReservedConcurrency:of,lambdaDeadLetterQueue:af,lambdaRuntime:cf,lambdaVpcNatWarning:uf,rdsEncryption:lf,rdsMultiAZ:pf,rdsPublicAccess:df,rdsBackupRetention:mf,rdsDeletionProtection:ff,dynamoDBAutoScaling:Mm,dynamoDBStreams:Nm,cloudFrontHttpsOnly:Tm,cloudFrontWafAssociation:km,cloudFrontLogging:_m,cloudFrontTls:Lm,elbDeletionProtection:Hm,elbLogging:Vm,elbHttpsListeners:Km,elbSecurityPolicy:Zm,ecsSecrets:Gm,ecsLogging:zm,ecsResources:qm,cognitoPasswordPolicy:Pm,cognitoMfa:Om,cognitoAdvancedSecurity:Bm,wafWebAcl:wf,wafLogging:If,cloudWatchLogRetention:Tf,cloudWatchEncryption:kf,cloudWatchAlarms:_f,route53Dnssec:Lf,route53HealthChecks:Pf,route53QueryLogging:Of,elastiCacheEncryption:Bf,elastiCacheAuth:Mf,elastiCacheFailover:Nf,ecrScanning:Wf,ecrLifecycle:jf,ecrImmutableTags:$f,openSearchEncryption:Uf,openSearchAccessControl:Gf,openSearchLogging:zf,acmValidation:qf,backupPlans:Hf,backupVault:Vf,vpcFlowLogs:Kf,vpcDefaultSecurityGroup:Zf,kinesisEncryption:Yf,kinesisRetention:Jf,appSyncAuth:Qf,appSyncLogging:Xf,appSyncWaf:eg,eksPublicEndpoint:tg,eksEncryption:sg,eksLogging:ng,redshiftEncryption:rg,redshiftPublicAccess:ig,redshiftLogging:og,mskEncryption:ag,mskAuth:cg,mskLogging:ug,glueEncryption:lg,glueConnections:pg,apiGateway:wm,secretsManager:bf,cloudTrailLogging:Im,eventBridgeRules:Ym,kmsKeys:sf,sns:vf,sqs:Sf,stepFunctions:Cf,crossResourceRelationships:bi,stackArchitecture:vi,solutionsPatterns:Rf});var dr=(e={})=>{let{ttl:t=3e5,maxSize:s=1e3}=e,n=new Map,r=new Set,i=[],o=Date.now(),a=6e4,c=f=>Date.now()-f.timestamp>f.ttl,u=f=>{r.delete(f)},l=()=>{let f=0;for(let m=0;m<i.length;m++)r.has(i[m])&&(i[f++]=i[m]);i.length=f},p=()=>{let f=Date.now();if(f-o<a)return;o=f;let m=[];for(let[g,h]of n.entries())c(h)&&m.push(g);for(let g of m)n.delete(g),u(g);m.length>0&&l()},d=()=>{for(;n.size>=s&&i.length>0;){let f=i.shift();f&&r.has(f)&&(n.delete(f),r.delete(f))}};return{get(f){let m=n.get(f);if(m){if(c(m)){n.delete(f),u(f);return}return m.value}},set(f,m,g){n.size>=s*.9&&p(),d(),r.has(f)&&u(f),n.set(f,{value:m,timestamp:Date.now(),ttl:g??t}),r.add(f),i.push(f)},clear(){n.clear(),r.clear(),i.length=0},size(){return n.size},has(f){let m=n.get(f);return m?c(m)?(n.delete(f),u(f),!1):!0:!1}}},mg=(e,t={})=>{let s=dr(t);return(...n)=>{let r;try{r=JSON.stringify(n)}catch{return e(...n)}let i=s.get(r);if(i!==void 0)return i;let o=e(...n);return s.set(r,o),o}};var fg={IAM:["iamPolicies","iamPermissionBoundary","iamCrossAccountTrust"],S3:["s3Buckets","s3IntelligentTiering","s3LifecyclePolicy","s3Replication"],Lambda:["lambdaEnvironmentVariables","lambdaMemory","lambdaReservedConcurrency","lambdaDeadLetterQueue","lambdaRuntime","lambdaVpcNatWarning"],DynamoDB:["dynamoDBAutoScaling","dynamoDBStreams"],RDS:["rdsEncryption","rdsMultiAZ","rdsPublicAccess","rdsBackupRetention","rdsDeletionProtection"],EC2:["ec2InstanceType","natGatewayUsage","securityGroups","ebsVolumes"],SNS:["sns"],SQS:["sqs"],StepFunctions:["stepFunctions"],CloudTrail:["cloudTrailLogging"],ApiGateway:["apiGateway"],SecretsManager:["secretsManager"],KMS:["kmsKeys"],EventBridge:["eventBridgeRules"],CloudFront:["cloudFrontHttpsOnly","cloudFrontWafAssociation","cloudFrontLogging","cloudFrontTls"],ELB:["elbDeletionProtection","elbLogging","elbHttpsListeners","elbSecurityPolicy"],ECS:["ecsSecrets","ecsLogging","ecsResources"],Cognito:["cognitoPasswordPolicy","cognitoMfa","cognitoAdvancedSecurity"],WAF:["wafWebAcl","wafLogging"],CloudWatch:["cloudWatchLogRetention","cloudWatchEncryption","cloudWatchAlarms"],Route53:["route53Dnssec","route53HealthChecks","route53QueryLogging"],ElastiCache:["elastiCacheEncryption","elastiCacheAuth","elastiCacheFailover"],ECR:["ecrScanning","ecrLifecycle","ecrImmutableTags"],OpenSearch:["openSearchEncryption","openSearchAccessControl","openSearchLogging"],ACM:["acmValidation"],Backup:["backupPlans","backupVault"],VPC:["vpcFlowLogs","vpcDefaultSecurityGroup"],Kinesis:["kinesisEncryption","kinesisRetention"],AppSync:["appSyncAuth","appSyncLogging","appSyncWaf"],EKS:["eksPublicEndpoint","eksEncryption","eksLogging"],Redshift:["redshiftEncryption","redshiftPublicAccess","redshiftLogging"],MSK:["mskEncryption","mskAuth","mskLogging"],Glue:["glueEncryption","glueConnections"]},J0=Object.entries(fg).reduce((e,[t,s])=>{for(let n of s)e[n]=t;return e},{}),Ha=e=>{let t=new Set,s=[];for(let n of e)t.has(n)||(t.add(n),s.push(n));return s},gg=e=>{if(!e||e.length===0)return{services:["All services"],removedAllServices:!1,defaultedToAll:!0};let t=Ha(e),s=t.includes("All services"),n=t.filter(r=>r!=="All services");return s&&n.length>0?{services:n,removedAllServices:!0,defaultedToAll:!1}:{services:s?["All services"]:t,removedAllServices:!1,defaultedToAll:!1}},hg=(e,t)=>{if(e.length===0||e.includes("All services"))return Ha(t);let s=e.flatMap(n=>n==="All services"?t:fg[n]??[]);return Ha(s)},mr=e=>J0[e];var wt=H(Yt()),Ln=process.env.NODE_ENV==="development",hc=process.env.CDK_INSIGHTS_VERBOSE==="true",yR=Ln||hc||process.env.CDK_INSIGHTS_ENABLE_LOGGING==="true",Eh=hc?wt.LogLevel.DEBUG:Ln?wt.LogLevel.INFO:wt.LogLevel.ERROR,DR=yR?[(0,wt.createConsoleTransport)({formatter:(0,wt.createJsonFormatter)(),level:Eh,useColors:!Ln})]:[],Q=(0,wt.createLogger)({config:{level:Eh,serviceName:"cdk-insights",stage:Ln?"dev":"prod"},formatter:(0,wt.createJsonFormatter)(),transports:DR,env:{STAGE:Ln?"dev":"prod",LOG_LEVEL:hc?"DEBUG":Ln?"INFO":"ERROR"}}),Pn=e=>({debug:(t,s,n)=>Q.debug(t,{component:e,...s},n),info:(t,s,n)=>Q.info(t,{component:e,...s},n),warn:(t,s,n,r)=>Q.warn(t,{component:e,...s},n,r),error:(t,s,n,r)=>Q.error(t,{component:e,...s},n,r)}),Ve=Pn("cli"),pe=Pn("analysis"),ZN=Pn("license"),ms=Pn("cache"),Gi=Pn("github"),_e=Pn("aspect");function Sr(e,t){let s=t.split("."),n=e;for(let r of s){if(n==null||typeof n!="object")return;n=n[r]}return n}function yc(e,t){switch(e.type){case"property_exists":{let s=Sr(t,e.path),n=s!=null;return e.negate?!n:n}case"property_equals":{let s=Sr(t,e.path),n=JSON.stringify(s)===JSON.stringify(e.value);return e.negate?!n:n}case"property_matches":{let s=Sr(t,e.path);if(typeof s!="string")return!!e.negate;let n=new RegExp(e.pattern).test(s);return e.negate?!n:n}case"property_gt":{let s=Sr(t,e.path);return typeof s!="number"?!1:s>e.value}case"property_lt":{let s=Sr(t,e.path);return typeof s!="number"?!1:s<e.value}case"and":return e.conditions.every(s=>yc(s,t));case"or":return e.conditions.some(s=>yc(s,t));default:return!1}}function Rh(e,t,s){if(t.length===0)return{};let n={};for(let[r,i]of Object.entries(e.Resources||{}))for(let o of t)if(o.resourceTypes.some(c=>c.endsWith("*")?i.Type.startsWith(c.slice(0,-1)):i.Type===c))try{if(yc(o.condition,i)){let u=s(r,`[${o.ruleId}] ${o.description}`,o.recommendation,o.severity,o.wafPillar,"","cdkInsights");u.ruleId=o.ruleId,n[r]||(n[r]={issues:[]}),n[r].issues.push(u)}}catch(c){pe.warn(`Error evaluating custom rule '${o.ruleId}' on resource '${r}'`,{error:c instanceof Error?c.message:String(c)})}return n}var bR={IAM:["AWS::IAM::"],S3:["AWS::S3::"],Lambda:["AWS::Lambda::"],DynamoDB:["AWS::DynamoDB::"],RDS:["AWS::RDS::"],EC2:["AWS::EC2::"],SNS:["AWS::SNS::"],SQS:["AWS::SQS::"],StepFunctions:["AWS::StepFunctions::"],CloudTrail:["AWS::CloudTrail::"],ApiGateway:["AWS::ApiGateway::","AWS::ApiGatewayV2::"],SecretsManager:["AWS::SecretsManager::"],KMS:["AWS::KMS::"],EventBridge:["AWS::Events::"],CloudFront:["AWS::CloudFront::"],ELB:["AWS::ElasticLoadBalancing::","AWS::ElasticLoadBalancingV2::"],ECS:["AWS::ECS::"],Cognito:["AWS::Cognito::"],WAF:["AWS::WAFv2::","AWS::WAF::"],CloudWatch:["AWS::CloudWatch::","AWS::Logs::"],Route53:["AWS::Route53::"],ElastiCache:["AWS::ElastiCache::"],ECR:["AWS::ECR::"],OpenSearch:["AWS::OpenSearchService::","AWS::Elasticsearch::"],ACM:["AWS::CertificateManager::"],Backup:["AWS::Backup::"],VPC:["AWS::EC2::VPC","AWS::EC2::FlowLog","AWS::EC2::SecurityGroup"],Kinesis:["AWS::Kinesis::"],AppSync:["AWS::AppSync::"],EKS:["AWS::EKS::"],Redshift:["AWS::Redshift::"],MSK:["AWS::MSK::"],Glue:["AWS::Glue::"]},rW=dr({ttl:3e5,maxSize:100});var vR=mg(dg,{ttl:6e5,maxSize:10}),SR=e=>{if(e.includes("All services")||e.length===0)return s=>!s.Type.startsWith("AWS::CDK::");let t=[];for(let s of e){if(s==="All services")continue;let n=bR[s];n&&t.push(...n)}return t.length===0?s=>!s.Type.startsWith("AWS::CDK::"):s=>!s.Type.startsWith("AWS::CDK::")&&t.some(n=>s.Type.startsWith(n))},CR=e=>{let t=new Map,s={CRITICAL:4,HIGH:3,MEDIUM:2,LOW:1};for(let n of e){let r=n.issue,i=t.get(r);i?s[n.severity]>s[i.severity]&&t.set(r,n):t.set(r,n)}return Array.from(t.values())},xR=(e,t,s,n)=>{let r={CRITICAL:0,HIGH:0,MEDIUM:0,LOW:0},i={},o=0;for(let a of Object.values(e))for(let c of a.issues){o++,r[c.severity]++;let u=c.ruleId?mr(c.ruleId)??"Other":"Other";i[u]=(i[u]||0)+1}return{totalResources:t,analyzedResources:Object.keys(e).length,totalFindings:o,findingsBySeverity:r,findingsByService:i,analysisTimeMs:Date.now()-n,servicesAnalyzed:s}},wh=(e,t,s=[],n={},r=[])=>AR(e,t,{selectedServices:s,solutionsRegistry:n,deduplicateFindings:!0,includeStatistics:!1,customRules:r}).findings,AR=(e,t,s={})=>{let n=Date.now(),{selectedServices:r=[],solutionsRegistry:i={},deduplicateFindings:o=!0,customRules:a=[]}=s,c=vR(),u=new Set(["solutionsPatterns","stackArchitecture","crossResourceRelationships"]),l=Object.keys(c).filter(D=>!u.has(D)),{services:p}=gg(r),d=hg(p,l),f={},m=SR(p),g=Object.keys(e.Resources||{}).length,h=Object.entries(e.Resources||{}).filter(([,D])=>m(D)).reduce((D,[E,T])=>(D[E]=T,D),{}),b=[];for(let D of d)try{let E=c[D];if(typeof E!="function"){let k=mr(D)??D;pe.warn(`\u26A0\uFE0F Service check function for ${k} (${D}) is not available`);continue}let T=E({Resources:h},t);b.push(D);for(let[k,C]of Object.entries(T))f[k]||(f[k]={issues:[]}),f[k].issues.push(...C.issues)}catch(E){let T=mr(D)??D;pe.warn(`\u26A0\uFE0F Error in ${T} analysis (${D})`,{error:E instanceof Error?E.message:String(E)})}if(Object.keys(i).length>0)try{let D=c.solutionsPatterns({Resources:h},i);for(let E of D){let T=E.resourceId;f[T]||(f[T]={issues:[]}),f[T].issues.push(E)}}catch(D){pe.warn("\u26A0\uFE0F Error in solutions pattern analysis",{error:D instanceof Error?D.message:String(D)})}if(a.length>0)try{let D=Rh(e,a,t);for(let[E,T]of Object.entries(D))f[E]||(f[E]={issues:[]}),f[E].issues.push(...T.issues);pe.info(`Custom rules evaluated: ${a.length} rule(s)`)}catch(D){pe.warn("\u26A0\uFE0F Error evaluating custom rules",{error:D instanceof Error?D.message:String(D)})}if(o)for(let D of Object.keys(f))f[D].issues=CR(f[D].issues);Object.keys(f).length===0&&pe.info(`\x1B[32m\u2705 No security or cost issues detected!\x1B[0m
87
+ `);let y=[...new Set(b.map(D=>mr(D)).filter(D=>D!==void 0))],S=xR(f,g,y,n);return{findings:f,statistics:S}};var qi=H(require("node:fs")),Ih=H(require("node:path"));var zi=".cdk-insights-rules.json",FR=new Set(["CRITICAL","HIGH","MEDIUM","LOW"]),ER=new Set(["Operational Excellence","Security","Cost Optimization","Reliability","Performance Efficiency","Sustainability"]),RR=new Set(["property_exists","property_equals","property_matches","property_gt","property_lt","and","or"]);function Th(e,t){if(!e||typeof e!="object")return pe.warn(`Custom rule '${t}': condition must be an object`),!1;let s=e;if(!s.type||!RR.has(s.type))return pe.warn(`Custom rule '${t}': invalid condition type '${s.type}'`),!1;if(s.type==="and"||s.type==="or")return!Array.isArray(s.conditions)||s.conditions.length===0?(pe.warn(`Custom rule '${t}': '${s.type}' condition requires non-empty conditions array`),!1):s.conditions.every(n=>Th(n,t));if(typeof s.path!="string"||s.path.length===0)return pe.warn(`Custom rule '${t}': condition requires a non-empty 'path'`),!1;if(s.type==="property_matches")try{new RegExp(s.pattern)}catch{return pe.warn(`Custom rule '${t}': invalid regex pattern '${s.pattern}'`),!1}return(s.type==="property_gt"||s.type==="property_lt")&&typeof s.value!="number"?(pe.warn(`Custom rule '${t}': '${s.type}' requires a numeric value`),!1):!0}function wR(e,t){if(!e||typeof e!="object")return pe.warn(`Custom rule at index ${t}: must be an object`),null;let s=e;return typeof s.ruleId!="string"||s.ruleId.length===0?(pe.warn(`Custom rule at index ${t}: ruleId is required`),null):typeof s.name!="string"||s.name.length===0?(pe.warn(`Custom rule '${s.ruleId}': name is required`),null):typeof s.description!="string"?(pe.warn(`Custom rule '${s.ruleId}': description is required`),null):FR.has(s.severity)?ER.has(s.wafPillar)?!Array.isArray(s.resourceTypes)||s.resourceTypes.length===0?(pe.warn(`Custom rule '${s.ruleId}': resourceTypes must be a non-empty array`),null):typeof s.recommendation!="string"?(pe.warn(`Custom rule '${s.ruleId}': recommendation is required`),null):Th(s.condition,s.ruleId)?s:null:(pe.warn(`Custom rule '${s.ruleId}': invalid wafPillar '${s.wafPillar}'`),null):(pe.warn(`Custom rule '${s.ruleId}': invalid severity '${s.severity}'`),null)}function kh(e=process.cwd()){let t=Ih.join(e,zi);if(!qi.existsSync(t))return[];try{let s=qi.readFileSync(t,"utf-8"),n=JSON.parse(s);if(!n.rules||!Array.isArray(n.rules))return pe.warn(`${zi}: 'rules' must be an array`),[];let r=[];for(let i=0;i<n.rules.length;i++){let o=wR(n.rules[i],i);o&&r.push(o)}return r.length>0&&pe.info(`Loaded ${r.length} custom rule(s) from ${zi}`),r}catch(s){return pe.warn(`Failed to load ${zi}: ${s instanceof Error?s.message:String(s)}`),[]}}var st=e=>e?JSON.stringify(e).length:0,_h=e=>{if(!e||typeof e!="object")return 0;let s=e.Statement;return Array.isArray(s)?s.length:s&&typeof s=="object"?1:0},Hi=(e,t)=>{if(!e)return null;if(typeof e=="string"&&t.has(e))return e;if(typeof e!="object")return null;let s=e;if("Ref"in s&&typeof s.Ref=="string"&&t.has(s.Ref))return s.Ref;if("Fn::GetAtt"in s){let n=s["Fn::GetAtt"];if(Array.isArray(n)&&typeof n[0]=="string"&&t.has(n[0]))return n[0];if(typeof n=="string"){let r=n.split(".")[0];if(t.has(r))return r}}return null};var Qt=e=>{if(!e||typeof e!="object")return[];let s=e.Statement;return Array.isArray(s)?s:s&&typeof s=="object"?[s]:[]},oe=(e,t)=>t<=0?0:e/t,X=e=>e<1024?`${e} bytes`:`${(e/1024).toFixed(1)}KB`,fs=e=>{let s=(e.Properties||{}).Policies;return Array.isArray(s)?s.map(n=>({name:n.PolicyName||"unnamed",document:n.PolicyDocument})):[]};var re=(e,t)=>Object.entries(e).filter(([,s])=>s.Type===t),Lh=e=>{let t=new Set(Object.keys(e)),s=new Map;for(let[n,r]of Object.entries(e)){if(r.Type!=="AWS::Events::Rule")continue;let o=(r.Properties||{}).Targets;if(Array.isArray(o))for(let a of o){let c=a.DeadLetterConfig;if(!c?.Arn)continue;let u=Hi(c.Arn,t);if(!u)continue;let l=s.get(u)||[];l.push(n),s.set(u,l)}}return s},Ph=e=>{let t=new Map;for(let[s,n]of Object.entries(e)){if(n.Type!=="AWS::Events::Rule")continue;let r=n.Properties||{},i="default";typeof r.EventBusName=="string"?i=r.EventBusName:r.EventBusName&&typeof r.EventBusName=="object"&&(i=JSON.stringify(r.EventBusName));let o=t.get(i)||[];o.push(s),t.set(i,o)}return t};var Oh=(e,t,s)=>{let n=new Set(Object.keys(s)),r=t.Properties||{},i=r.SecurityGroupIngress||[],o=r.SecurityGroupEgress||[],a=Array.isArray(i)?i.length:0,c=Array.isArray(o)?o.length:0;for(let[,u]of Object.entries(s))u.Type==="AWS::EC2::SecurityGroupIngress"&&Hi(u.Properties?.GroupId,n)===e&&a++,u.Type==="AWS::EC2::SecurityGroupEgress"&&Hi(u.Properties?.GroupId,n)===e&&c++;return{inbound:a,outbound:c}};var L={SQS_POLICY_MAX_BYTES:8192,SQS_POLICY_MAX_STATEMENTS:20,IAM_INLINE_POLICY_MAX_BYTES:2048,IAM_MANAGED_POLICY_MAX_BYTES:6144,IAM_ROLE_AGGREGATE_INLINE_MAX_BYTES:10240,LAMBDA_ENV_MAX_BYTES:4096,LAMBDA_MAX_LAYERS:5,S3_BUCKET_POLICY_MAX_BYTES:20480,SNS_TOPIC_POLICY_MAX_BYTES:30720,EVENTBRIDGE_RULES_PER_BUS_DEFAULT:300,CFN_MAX_RESOURCES:500,CFN_TEMPLATE_MAX_BYTES_DIRECT:51200,CFN_TEMPLATE_MAX_BYTES_S3:460800,SECURITY_GROUP_MAX_INBOUND_RULES:60,SECURITY_GROUP_MAX_OUTBOUND_RULES:60},Fe=.8;var Bh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::SQS::QueuePolicy");for(let[i,o]of r){let c=(o.Properties||{}).PolicyDocument;if(!c)continue;let u=st(c),l=_h(c),p=o.Metadata?.["aws:cdk:path"]||i;u>=L.SQS_POLICY_MAX_BYTES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SQS queue policy is ${X(u)}, exceeding the ${X(L.SQS_POLICY_MAX_BYTES)} limit. Deployment will fail.`,"Consolidate policy statements into a single statement with broader conditions, or split targets across multiple queues. If using a shared DLQ with EventBridge targets, use Queue.fromQueueArn() to prevent CDK from auto-generating per-target statements.","CRITICAL","Reliability",p,"cdkInsights"))):oe(u,L.SQS_POLICY_MAX_BYTES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SQS queue policy is ${X(u)} (${Math.round(oe(u,L.SQS_POLICY_MAX_BYTES)*100)}% of the ${X(L.SQS_POLICY_MAX_BYTES)} limit). Adding more targets may cause deployment failure.`,"Consider consolidating policy statements or splitting targets across multiple queues before this limit is reached.","HIGH","Reliability",p,"cdkInsights"))),l>=L.SQS_POLICY_MAX_STATEMENTS?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SQS queue policy has ${l} statements, reaching or exceeding the ${L.SQS_POLICY_MAX_STATEMENTS}-statement limit.`,"Consolidate statements using wildcard conditions or array-valued Action/Resource fields instead of one statement per target.","CRITICAL","Reliability",p,"cdkInsights"))):oe(l,L.SQS_POLICY_MAX_STATEMENTS)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SQS queue policy has ${l} of ${L.SQS_POLICY_MAX_STATEMENTS} maximum statements (${Math.round(oe(l,L.SQS_POLICY_MAX_STATEMENTS)*100)}%).`,"Consider consolidating policy statements before this limit is reached.","HIGH","Reliability",p,"cdkInsights")))}return s};var Mh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::IAM::Role"),i=re(n,"AWS::IAM::User");for(let[o,a]of[...r,...i]){let c=a.Metadata?.["aws:cdk:path"]||o,u=fs(a);for(let l of u){if(!l.document)continue;let p=st(l.document);p>=L.IAM_INLINE_POLICY_MAX_BYTES?(s[o]||(s[o]={issues:[]}),s[o].issues.push(t(o,`Inline policy "${l.name}" is ${X(p)}, exceeding the ${X(L.IAM_INLINE_POLICY_MAX_BYTES)} limit. Deployment will fail.`,"Convert this inline policy to a managed policy, or reduce the number of statements and actions. Use wildcard patterns where appropriate to consolidate permissions.","CRITICAL","Reliability",c,"cdkInsights"))):oe(p,L.IAM_INLINE_POLICY_MAX_BYTES)>=Fe&&(s[o]||(s[o]={issues:[]}),s[o].issues.push(t(o,`Inline policy "${l.name}" is ${X(p)} (${Math.round(oe(p,L.IAM_INLINE_POLICY_MAX_BYTES)*100)}% of the ${X(L.IAM_INLINE_POLICY_MAX_BYTES)} limit). Adding more permissions may cause deployment failure.`,"Consider converting this inline policy to a managed policy before the limit is reached.","HIGH","Reliability",c,"cdkInsights")))}}return s};var Nh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::IAM::ManagedPolicy");for(let[i,o]of r){let c=(o.Properties||{}).PolicyDocument;if(!c)continue;let u=st(c),l=o.Metadata?.["aws:cdk:path"]||i;u>=L.IAM_MANAGED_POLICY_MAX_BYTES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Managed policy is ${X(u)}, exceeding the ${X(L.IAM_MANAGED_POLICY_MAX_BYTES)} limit. Deployment will fail.`,"Split this managed policy into multiple smaller policies, or consolidate statements using wildcard patterns to reduce size.","CRITICAL","Reliability",l,"cdkInsights"))):oe(u,L.IAM_MANAGED_POLICY_MAX_BYTES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Managed policy is ${X(u)} (${Math.round(oe(u,L.IAM_MANAGED_POLICY_MAX_BYTES)*100)}% of the ${X(L.IAM_MANAGED_POLICY_MAX_BYTES)} limit). Adding more permissions may cause deployment failure.`,"Consider splitting this managed policy into multiple policies before the limit is reached.","HIGH","Reliability",l,"cdkInsights")))}return s};var Wh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::IAM::Role");for(let[i,o]of r){let a=o.Metadata?.["aws:cdk:path"]||i,c=fs(o),u=0;for(let l of c)l.document&&(u+=st(l.document));u!==0&&(u>=L.IAM_ROLE_AGGREGATE_INLINE_MAX_BYTES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Aggregate inline policy size is ${X(u)} across ${c.length} policies, exceeding the ${X(L.IAM_ROLE_AGGREGATE_INLINE_MAX_BYTES)} limit. Deployment will fail.`,"Convert some inline policies to managed policies to reduce the aggregate inline size. Consider consolidating overlapping permissions across policies.","CRITICAL","Reliability",a,"cdkInsights"))):oe(u,L.IAM_ROLE_AGGREGATE_INLINE_MAX_BYTES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Aggregate inline policy size is ${X(u)} across ${c.length} policies (${Math.round(oe(u,L.IAM_ROLE_AGGREGATE_INLINE_MAX_BYTES)*100)}% of the ${X(L.IAM_ROLE_AGGREGATE_INLINE_MAX_BYTES)} limit). Adding more inline policies may cause deployment failure.`,"Consider converting some inline policies to managed policies before the aggregate limit is reached.","HIGH","Reliability",a,"cdkInsights"))))}return s};var jh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::Lambda::Function");for(let[i,o]of r){let c=(o.Properties||{}).Environment;if(!c?.Variables)continue;let u=st(c.Variables),l=o.Metadata?.["aws:cdk:path"]||i;u>=L.LAMBDA_ENV_MAX_BYTES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Lambda environment variables are ${X(u)}, exceeding the ${X(L.LAMBDA_ENV_MAX_BYTES)} limit. Deployment will fail.`,"Move large configuration values to SSM Parameter Store or Secrets Manager. Use a single JSON-encoded parameter instead of many individual environment variables.","CRITICAL","Reliability",l,"cdkInsights"))):oe(u,L.LAMBDA_ENV_MAX_BYTES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Lambda environment variables are ${X(u)} (${Math.round(oe(u,L.LAMBDA_ENV_MAX_BYTES)*100)}% of the ${X(L.LAMBDA_ENV_MAX_BYTES)} limit). Adding more variables may cause deployment failure.`,"Consider moving some configuration values to SSM Parameter Store or Secrets Manager before the limit is reached.","HIGH","Reliability",l,"cdkInsights")))}return s};var $h=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::Lambda::Function");for(let[i,o]of r){let c=(o.Properties||{}).Layers;if(!Array.isArray(c))continue;let u=c.length,l=o.Metadata?.["aws:cdk:path"]||i;u>L.LAMBDA_MAX_LAYERS?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Lambda function has ${u} layers, exceeding the maximum of ${L.LAMBDA_MAX_LAYERS} layers. Deployment will fail.`,"Consolidate layers by combining related dependencies into a single layer, or move some dependencies into the deployment package itself.","CRITICAL","Reliability",l,"cdkInsights"))):u===L.LAMBDA_MAX_LAYERS&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Lambda function has ${u} of ${L.LAMBDA_MAX_LAYERS} maximum layers. There is no headroom to add additional layers.`,"Consider consolidating layers by combining related dependencies into a single layer to free up a layer slot for future needs.","HIGH","Reliability",l,"cdkInsights")))}return s};var Uh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::S3::BucketPolicy");for(let[i,o]of r){let c=(o.Properties||{}).PolicyDocument;if(!c)continue;let u=st(c),l=o.Metadata?.["aws:cdk:path"]||i;u>=L.S3_BUCKET_POLICY_MAX_BYTES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`S3 bucket policy is ${X(u)}, exceeding the ${X(L.S3_BUCKET_POLICY_MAX_BYTES)} limit. Deployment will fail.`,"Consolidate policy statements or split resources across multiple buckets to reduce policy size.","CRITICAL","Reliability",l,"cdkInsights"))):oe(u,L.S3_BUCKET_POLICY_MAX_BYTES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`S3 bucket policy is ${X(u)} (${Math.round(oe(u,L.S3_BUCKET_POLICY_MAX_BYTES)*100)}% of the ${X(L.S3_BUCKET_POLICY_MAX_BYTES)} limit). Adding more statements may cause deployment failure.`,"Consider consolidating policy statements or splitting resources across multiple buckets before this limit is reached.","HIGH","Reliability",l,"cdkInsights")))}return s};var Gh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::SNS::TopicPolicy");for(let[i,o]of r){let c=(o.Properties||{}).PolicyDocument;if(!c)continue;let u=st(c),l=o.Metadata?.["aws:cdk:path"]||i;u>=L.SNS_TOPIC_POLICY_MAX_BYTES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SNS topic policy is ${X(u)}, exceeding the ${X(L.SNS_TOPIC_POLICY_MAX_BYTES)} limit. Deployment will fail.`,"Consolidate policy statements or split subscriptions across multiple topics to reduce policy size.","CRITICAL","Reliability",l,"cdkInsights"))):oe(u,L.SNS_TOPIC_POLICY_MAX_BYTES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SNS topic policy is ${X(u)} (${Math.round(oe(u,L.SNS_TOPIC_POLICY_MAX_BYTES)*100)}% of the ${X(L.SNS_TOPIC_POLICY_MAX_BYTES)} limit). Adding more statements may cause deployment failure.`,"Consider consolidating policy statements or splitting subscriptions across multiple topics before this limit is reached.","HIGH","Reliability",l,"cdkInsights")))}return s};var zh=(e,t)=>{let s={},n=e.Resources||{},r=Ph(n);for(let[i,o]of r){let a=o.length,c=o[0],l=n[c]?.Metadata?.["aws:cdk:path"]||c;a>=L.EVENTBRIDGE_RULES_PER_BUS_DEFAULT?(s[c]||(s[c]={issues:[]}),s[c].issues.push(t(c,`EventBridge bus "${i}" has ${a} rules, reaching or exceeding the ${L.EVENTBRIDGE_RULES_PER_BUS_DEFAULT}-rule default limit. Deployment may fail.`,"Request a service quota increase for EventBridge rules per bus, or split rules across multiple event buses.","HIGH","Reliability",l,"cdkInsights"))):oe(a,L.EVENTBRIDGE_RULES_PER_BUS_DEFAULT)>=Fe&&(s[c]||(s[c]={issues:[]}),s[c].issues.push(t(c,`EventBridge bus "${i}" has ${a} rules (${Math.round(oe(a,L.EVENTBRIDGE_RULES_PER_BUS_DEFAULT)*100)}% of the ${L.EVENTBRIDGE_RULES_PER_BUS_DEFAULT}-rule default limit).`,"Consider requesting a service quota increase or splitting rules across multiple event buses before this limit is reached.","MEDIUM","Reliability",l,"cdkInsights")))}return s};var qh=(e,t)=>{let s={},n=Object.keys(e.Resources||{}).length,r="__TEMPLATE_LEVEL__";return n>=L.CFN_MAX_RESOURCES?(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,`CloudFormation template contains ${n} resources, reaching or exceeding the ${L.CFN_MAX_RESOURCES}-resource limit. Deployment will fail.`,"Split the stack into multiple nested stacks or separate stacks to stay within the CloudFormation resource limit.","CRITICAL","Reliability","__TEMPLATE_LEVEL__","cdkInsights"))):oe(n,L.CFN_MAX_RESOURCES)>=Fe&&(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,`CloudFormation template contains ${n} resources (${Math.round(oe(n,L.CFN_MAX_RESOURCES)*100)}% of the ${L.CFN_MAX_RESOURCES}-resource limit).`,"Consider splitting the stack into multiple nested stacks or separate stacks before this limit is reached.","HIGH","Reliability","__TEMPLATE_LEVEL__","cdkInsights"))),s};var Hh=(e,t)=>{let s={},n=JSON.stringify(e).length,r="__TEMPLATE_LEVEL__";return n>=L.CFN_TEMPLATE_MAX_BYTES_S3?(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,`CloudFormation template is ${X(n)}, exceeding the ${X(L.CFN_TEMPLATE_MAX_BYTES_S3)} S3 upload limit. Deployment will fail regardless of deployment method.`,"Split the stack into multiple nested stacks or separate stacks to reduce template size.","CRITICAL","Reliability","__TEMPLATE_LEVEL__","cdkInsights"))):oe(n,L.CFN_TEMPLATE_MAX_BYTES_S3)>=Fe&&(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,`CloudFormation template is ${X(n)} (${Math.round(oe(n,L.CFN_TEMPLATE_MAX_BYTES_S3)*100)}% of the ${X(L.CFN_TEMPLATE_MAX_BYTES_S3)} S3 upload limit).`,"Consider splitting the stack into multiple nested stacks or separate stacks before this limit is reached.","HIGH","Reliability","__TEMPLATE_LEVEL__","cdkInsights"))),n>=L.CFN_TEMPLATE_MAX_BYTES_DIRECT?(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,`CloudFormation template is ${X(n)}, exceeding the ${X(L.CFN_TEMPLATE_MAX_BYTES_DIRECT)} direct upload limit. Template must be uploaded via S3.`,"Ensure the template is deployed via S3 (CDK does this by default). Consider splitting the stack if it continues to grow.","HIGH","Reliability","__TEMPLATE_LEVEL__","cdkInsights"))):oe(n,L.CFN_TEMPLATE_MAX_BYTES_DIRECT)>=Fe&&(s[r]||(s[r]={issues:[]}),s[r].issues.push(t(r,`CloudFormation template is ${X(n)} (${Math.round(oe(n,L.CFN_TEMPLATE_MAX_BYTES_DIRECT)*100)}% of the ${X(L.CFN_TEMPLATE_MAX_BYTES_DIRECT)} direct upload limit).`,"Ensure the template is deployed via S3 if it exceeds the direct upload limit. Consider splitting the stack if it continues to grow.","HIGH","Reliability","__TEMPLATE_LEVEL__","cdkInsights"))),s};var Vh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::EC2::SecurityGroup");for(let[i,o]of r){let{inbound:a,outbound:c}=Oh(i,o,n),u=o.Metadata?.["aws:cdk:path"]||i;a>=L.SECURITY_GROUP_MAX_INBOUND_RULES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Security group has ${a} inbound rules, reaching or exceeding the ${L.SECURITY_GROUP_MAX_INBOUND_RULES}-rule limit. Deployment will fail.`,"Consolidate rules using CIDR ranges or prefix lists, or split workloads across multiple security groups.","CRITICAL","Reliability",u,"cdkInsights"))):oe(a,L.SECURITY_GROUP_MAX_INBOUND_RULES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Security group has ${a} inbound rules (${Math.round(oe(a,L.SECURITY_GROUP_MAX_INBOUND_RULES)*100)}% of the ${L.SECURITY_GROUP_MAX_INBOUND_RULES}-rule limit).`,"Consider consolidating rules using CIDR ranges or prefix lists before this limit is reached.","HIGH","Reliability",u,"cdkInsights"))),c>=L.SECURITY_GROUP_MAX_OUTBOUND_RULES?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Security group has ${c} outbound rules, reaching or exceeding the ${L.SECURITY_GROUP_MAX_OUTBOUND_RULES}-rule limit. Deployment will fail.`,"Consolidate rules using CIDR ranges or prefix lists, or split workloads across multiple security groups.","CRITICAL","Reliability",u,"cdkInsights"))):oe(c,L.SECURITY_GROUP_MAX_OUTBOUND_RULES)>=Fe&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Security group has ${c} outbound rules (${Math.round(oe(c,L.SECURITY_GROUP_MAX_OUTBOUND_RULES)*100)}% of the ${L.SECURITY_GROUP_MAX_OUTBOUND_RULES}-rule limit).`,"Consider consolidating rules using CIDR ranges or prefix lists before this limit is reached.","HIGH","Reliability",u,"cdkInsights")))}return s};var Kh=(e,t)=>{let s={},n=e.Resources||{},r=Lh(n);for(let[i,o]of r){let a=o.length;if(a<=10)continue;let u=n[i]?.Metadata?.["aws:cdk:path"]||i;a>15?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SQS queue is used as a shared DLQ by ${a} EventBridge rules. This many targets will cause CDK to auto-generate excessive per-target SQS policy statements, risking policy size limit breaches.`,"Use dedicated DLQs per rule group, or create a single consolidated SQS policy using Queue.fromQueueArn() to prevent CDK from auto-generating per-target policy statements.","CRITICAL","Reliability",u,"cdkInsights"))):(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`SQS queue is used as a shared DLQ by ${a} EventBridge rules. As more rules are added, CDK will auto-generate per-target SQS policy statements that may exceed the policy size limit.`,"Use dedicated DLQs per rule group, or create a single consolidated SQS policy using Queue.fromQueueArn() to prevent CDK from auto-generating per-target policy statements.","HIGH","Reliability",u,"cdkInsights")))}return s};var Zh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::Events::Rule");for(let[i,o]of r){let c=(o.Properties||{}).Targets;if(!Array.isArray(c))continue;let u=o.Metadata?.["aws:cdk:path"]||i,l=[];for(let p=0;p<c.length;p++)c[p].DeadLetterConfig||l.push(p);l.length>0&&(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`EventBridge rule has ${l.length} target(s) without a DeadLetterConfig. Failed invocations will be silently dropped after exhausting retries.`,"Configure a DeadLetterConfig with an SQS queue on each target to capture failed invocations for debugging and reprocessing.","MEDIUM","Reliability",u,"cdkInsights")))}return s};var Yh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::Lambda::Function"),i=re(n,"AWS::Logs::LogGroup"),o=new Set;for(let[,a]of i){let c=a.Properties?.LogGroupName;typeof c=="string"&&o.add(c)}for(let[a,c]of r){let l=(c.Properties||{}).FunctionName;if(typeof l!="string")continue;let p=`/aws/lambda/${l}`;if(!o.has(p)){let d=c.Metadata?.["aws:cdk:path"]||a;s[a]||(s[a]={issues:[]}),s[a].issues.push(t(a,`Lambda function "${l}" does not have an explicit AWS::Logs::LogGroup resource. CloudWatch will auto-create a log group with no retention policy, leading to indefinite log retention and increased costs.`,"Define an explicit AWS::Logs::LogGroup with a RetentionInDays property for this Lambda function to control log retention and avoid unbounded storage costs.","LOW","Operational Excellence",d,"cdkInsights"))}}return s};var IR=e=>{for(let[,t]of Object.entries(e)){let s=t.Metadata?.["aws:cdk:path"];if(s&&/prod/i.test(s))return!0;if(t.Metadata){for(let n of Object.values(t.Metadata))if(typeof n=="string"&&/prod/i.test(n))return!0}}return!1},Jh=(e,t)=>{let s={},n=e.Resources||{},r=IR(n),i=[...re(n,"AWS::DynamoDB::Table"),...re(n,"AWS::DynamoDB::GlobalTable")];for(let[o,a]of i)if(!((a.Properties||{}).PointInTimeRecoverySpecification?.PointInTimeRecoveryEnabled===!0)){let p=a.Metadata?.["aws:cdk:path"]||o,d=r?"HIGH":"MEDIUM",f=r?" This appears to be a production stack, making data recovery capabilities especially important.":"";s[o]||(s[o]={issues:[]}),s[o].issues.push(t(o,`DynamoDB table does not have Point-in-Time Recovery (PITR) enabled.${f} Without PITR, accidental data deletions or corruption cannot be recovered.`,"Enable PointInTimeRecoverySpecification.PointInTimeRecoveryEnabled on this table to allow restoration to any point within the last 35 days.",d,"Reliability",p,"cdkInsights"))}return s};var Qh=e=>{let t=e.Effect||"Allow",s=Array.isArray(e.Action)?[...e.Action].sort():typeof e.Action=="string"?[e.Action]:[],n=Array.isArray(e.Resource)?[...e.Resource].sort():typeof e.Resource=="string"?[e.Resource]:[];return`${t}|${s.join(",")}|${n.join(",")}`},Xh=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::IAM::Role"),i=re(n,"AWS::IAM::Policy");for(let[o,a]of r){let c=a.Metadata?.["aws:cdk:path"]||o,u=[],l=fs(a);for(let f of l){if(!f.document)continue;let m=Qt(f.document);for(let g of m)u.push({key:Qh(g),source:`inline policy "${f.name}"`})}for(let[,f]of i){let m=f.Properties||{},g=m.Roles;if(!Array.isArray(g)||!g.some(D=>typeof D=="string"?D===o:D&&typeof D=="object"?D.Ref===o:!1))continue;let b=m.PolicyDocument;if(!b)continue;let y=Qt(b),S=m.PolicyName||"unnamed";for(let D of y)u.push({key:Qh(D),source:`attached policy "${S}"`})}let p=new Map;for(let{key:f,source:m}of u){let g=p.get(f)||[];g.push(m),p.set(f,g)}let d=0;for(let[,f]of p)f.length>1&&(d+=f.length-1);d>0&&(s[o]||(s[o]={issues:[]}),s[o].issues.push(t(o,`IAM role has ${d} duplicate policy statement(s) across its inline and attached policies. Duplicate statements increase policy size without adding permissions.`,"Consolidate duplicate statements into a single policy. Review inline policies and attached AWS::IAM::Policy resources for overlapping Effect + Action + Resource combinations.","LOW","Security",c,"cdkInsights")))}return s};var TR=e=>{let t=e.Effect||"Allow",s=JSON.stringify(e.Principal||"*"),n=JSON.stringify(e.Condition||null);return`${t}|${s}|${n}`},kR=e=>{let t=e.Action;return Array.isArray(t)?t:typeof t=="string"?[t]:[]},ey=(e,t)=>{let s={},n=e.Resources||{},r=[...re(n,"AWS::SQS::QueuePolicy"),...re(n,"AWS::SNS::TopicPolicy")];for(let[i,o]of r){let c=(o.Properties||{}).PolicyDocument;if(!c)continue;let u=Qt(c);if(u.length<=2)continue;let l=o.Metadata?.["aws:cdk:path"]||i,p=new Map;for(let h=0;h<u.length;h++){let b=TR(u[h]),y=kR(u[h]),S=p.get(b)||[];S.push({actions:y,index:h}),p.set(b,S)}let d=0;for(let[,h]of p)h.length>1&&(d+=h.length-1);if(d<=0||d<2)continue;let f=u.length,g=d/f>.5?"MEDIUM":"LOW";s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`Policy has ${f} statements, of which ${d} could be consolidated. Multiple statements share the same Effect, Principal, and Condition but differ only in Action values.`,"Consolidate statements that share the same Effect, Principal, and Condition into a single statement with an Action array. This reduces policy size and improves readability.",g,"Reliability",l,"cdkInsights"))}return s};var _R=[{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/service-role\/AWSLambdaBasicExecutionRole$/,name:"AWSLambdaBasicExecutionRole",actions:["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/service-role\/AWSLambdaVPCAccessExecutionRole$/,name:"AWSLambdaVPCAccessExecutionRole",actions:["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents","ec2:CreateNetworkInterface","ec2:DescribeNetworkInterfaces","ec2:DeleteNetworkInterface"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AmazonDynamoDBReadOnlyAccess$/,name:"AmazonDynamoDBReadOnlyAccess",actions:["dynamodb:BatchGetItem","dynamodb:GetItem","dynamodb:Query","dynamodb:Scan","dynamodb:DescribeTable","dynamodb:DescribeReservedCapacity","dynamodb:DescribeReservedCapacityOfferings","dynamodb:ListTables","dynamodb:DescribeStream","dynamodb:ListStreams"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AmazonDynamoDBFullAccess$/,name:"AmazonDynamoDBFullAccess",actions:["dynamodb:*"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AmazonS3ReadOnlyAccess$/,name:"AmazonS3ReadOnlyAccess",actions:["s3:Get*","s3:List*"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AmazonS3FullAccess$/,name:"AmazonS3FullAccess",actions:["s3:*"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AmazonSQSFullAccess$/,name:"AmazonSQSFullAccess",actions:["sqs:*"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AmazonSNSFullAccess$/,name:"AmazonSNSFullAccess",actions:["sns:*"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/CloudWatchFullAccess$/,name:"CloudWatchFullAccess",actions:["cloudwatch:*","logs:*"]},{pattern:/^arn:aws[a-z-]*:iam::aws:policy\/AWSStepFunctionsFullAccess$/,name:"AWSStepFunctionsFullAccess",actions:["states:*"]}],LR=(e,t)=>{if(e===t)return!0;let s=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${s}$`,"i").test(e)},ty=(e,t)=>{let s={},n=e.Resources||{},r=re(n,"AWS::IAM::Role");for(let[i,o]of r){let c=(o.Properties||{}).ManagedPolicyArns;if(!Array.isArray(c)||c.length===0)continue;let u=[];for(let m of c)if(typeof m=="string"){for(let g of _R)if(g.pattern.test(m))for(let h of g.actions)u.push({action:h,policyName:g.name})}if(u.length===0)continue;let l=fs(o),p=[];for(let m of l){if(!m.document)continue;let g=Qt(m.document);for(let h of g){if((h.Effect||"Allow")!=="Allow")continue;let y=Array.isArray(h.Action)?h.Action:typeof h.Action=="string"?[h.Action]:[];for(let S of y)for(let D of u)if(LR(S,D.action)){p.push({action:S,policyName:D.policyName,inlinePolicy:m.name});break}}}if(p.length===0)continue;let d=o.Metadata?.["aws:cdk:path"]||i,f=[...new Set(p.map(m=>m.policyName))];s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,`IAM role has ${p.length} inline action(s) that overlap with permissions already granted by managed policy(ies): ${f.join(", ")}. Redundant inline statements increase policy size without adding permissions.`,"Remove redundant inline policy statements that are already covered by attached managed policies. Review the managed policy permissions before adding inline actions.","LOW","Security",d,"cdkInsights"))}return s};var PR=new Set(["aws:SourceArn","aws:SourceAccount","aws:PrincipalOrgID","aws:SourceVpce"]),OR=e=>{if(e==="*")return!0;if(e&&typeof e=="object"&&!Array.isArray(e)){let t=e,s=t.AWS;if(s==="*"||Array.isArray(s)&&s.includes("*")||t.Service==="*")return!0}return!1},BR=e=>{if(!e||typeof e!="object")return!1;let t=e;for(let s of Object.values(t))if(s&&typeof s=="object"){let n=s;for(let r of Object.keys(n))if(PR.has(r))return!0}return!1},sy=(e,t)=>{let s={},n=e.Resources||{},r=[];for(let[i,o]of re(n,"AWS::SQS::QueuePolicy")){let a=o.Metadata?.["aws:cdk:path"]||i;r.push([i,o.Properties?.PolicyDocument,a])}for(let[i,o]of re(n,"AWS::SNS::TopicPolicy")){let a=o.Metadata?.["aws:cdk:path"]||i;r.push([i,o.Properties?.PolicyDocument,a])}for(let[i,o]of re(n,"AWS::S3::BucketPolicy")){let a=o.Metadata?.["aws:cdk:path"]||i;r.push([i,o.Properties?.PolicyDocument,a])}for(let[i,o]of re(n,"AWS::KMS::Key")){let a=o.Metadata?.["aws:cdk:path"]||i;r.push([i,o.Properties?.KeyPolicy,a])}for(let[i,o,a]of r){if(!o)continue;let c=Qt(o);for(let u of c){if((u.Effect||"Allow")!=="Allow"||!OR(u.Principal))continue;let p=u.Condition,d=p!=null;d&&BR(p)||(d?(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,'Resource policy has a statement with Principal: "*" and a Condition that does not use a strongly restrictive key (aws:SourceArn, aws:SourceAccount, aws:PrincipalOrgID, or aws:SourceVpce). The current condition may not sufficiently limit access.',"Replace or supplement the existing Condition with aws:SourceArn, aws:SourceAccount, aws:PrincipalOrgID, or aws:SourceVpce to ensure only trusted sources can access this resource.","MEDIUM","Security",a,"cdkInsights"))):(s[i]||(s[i]={issues:[]}),s[i].issues.push(t(i,'Resource policy has a statement with Principal: "*" and no Condition. This allows any AWS account or anonymous user to invoke the allowed actions.',"Add a restrictive Condition using aws:SourceArn, aws:SourceAccount, aws:PrincipalOrgID, or aws:SourceVpce to limit access to trusted sources.","HIGH","Security",a,"cdkInsights"))))}}return s};var MR=[{ruleId:"TL-LIMIT-001",title:"SQS Queue Policy Size Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Bh,description:"SQS queue policies must be under 8KB / 20 statements. Commonly exceeded when CDK auto-generates per-target policy statements for shared DLQs."},{ruleId:"TL-LIMIT-002",title:"IAM Inline Policy Size Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Mh,description:"Each IAM inline policy must be under 2,048 bytes when URL-encoded."},{ruleId:"TL-LIMIT-003",title:"IAM Managed Policy Size Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Nh,description:"IAM managed policies must be under 6,144 bytes."},{ruleId:"TL-LIMIT-004",title:"IAM Role Aggregate Inline Policy Size",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Wh,description:"Total size of all inline policies on a single IAM role must be under 10,240 bytes."},{ruleId:"TL-LIMIT-005",title:"Lambda Environment Variables Size Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:jh,description:"Lambda environment variables must total under 4KB including keys and values."},{ruleId:"TL-LIMIT-006",title:"Lambda Layers Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:$h,description:"Lambda functions can have a maximum of 5 layers."},{ruleId:"TL-LIMIT-007",title:"S3 Bucket Policy Size Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Uh,description:"S3 bucket policies must be under 20KB."},{ruleId:"TL-LIMIT-008",title:"SNS Topic Policy Size Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Gh,description:"SNS topic policies must be under 30KB."},{ruleId:"TL-LIMIT-009",title:"EventBridge Rules Per Bus Limit",category:"serviceLimits",defaultSeverity:"HIGH",wafPillar:"Reliability",check:zh,description:"Default quota is 300 EventBridge rules per event bus."},{ruleId:"TL-LIMIT-010",title:"CloudFormation Stack Resource Count",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:qh,description:"CloudFormation stacks have a hard limit of 500 resources."},{ruleId:"TL-LIMIT-011",title:"CloudFormation Template Size",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Hh,description:"CloudFormation templates have a 51KB limit (direct) or 460KB limit (S3)."},{ruleId:"TL-LIMIT-012",title:"Security Group Rules Limit",category:"serviceLimits",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Vh,description:"Security groups have a default limit of 60 inbound and 60 outbound rules."},{ruleId:"TL-XRES-001",title:"Shared DLQ with Too Many EventBridge Targets",category:"crossResourceAntiPatterns",defaultSeverity:"CRITICAL",wafPillar:"Reliability",check:Kh,description:"CDK generates one SQS policy statement per EventBridge target. Too many targets sharing a DLQ causes the policy to exceed the 8KB limit."},{ruleId:"TL-XRES-002",title:"EventBridge Targets Without DLQ",category:"crossResourceAntiPatterns",defaultSeverity:"MEDIUM",wafPillar:"Reliability",check:Zh,description:"EventBridge rule targets should have a Dead Letter Queue for failed event delivery."},{ruleId:"TL-XRES-003",title:"Lambda Without Explicit Log Group",category:"crossResourceAntiPatterns",defaultSeverity:"LOW",wafPillar:"Operational Excellence",check:Yh,description:"Lambda functions without explicit CloudWatch Log Groups use auto-created groups with infinite retention."},{ruleId:"TL-XRES-004",title:"DynamoDB Without Point-in-Time Recovery",category:"crossResourceAntiPatterns",defaultSeverity:"MEDIUM",wafPillar:"Reliability",check:Jh,description:"DynamoDB tables should have PITR enabled, especially in production stacks."},{ruleId:"TL-XRES-005",title:"Duplicate IAM Policy Statements",category:"crossResourceAntiPatterns",defaultSeverity:"LOW",wafPillar:"Security",check:Xh,description:"Duplicate policy statements across a role waste policy size budget and may indicate copy-paste errors."},{ruleId:"TL-POL-001",title:"Redundant SQS/SNS Policy Statements",category:"policyAnalysis",defaultSeverity:"MEDIUM",wafPillar:"Reliability",check:ey,description:"Policy statements that could be consolidated to reduce policy size."},{ruleId:"TL-POL-002",title:"IAM Overlapping Managed and Inline Policies",category:"policyAnalysis",defaultSeverity:"LOW",wafPillar:"Security",check:ty,description:"Inline policy statements that duplicate permissions from attached managed policies."},{ruleId:"TL-POL-003",title:"Overly Broad Resource Policy Principals",category:"policyAnalysis",defaultSeverity:"HIGH",wafPillar:"Security",check:sy,description:"Resource policies with wildcard (*) principals without restrictive conditions."}],Dc=(e,t,s)=>{let n={};for(let r of MR)if(!(s&&s.length>0&&!s.some(o=>r.ruleId.toLowerCase().includes(o.toLowerCase())||r.category.toLowerCase().includes(o.toLowerCase())||r.title.toLowerCase().includes(o.toLowerCase()))))try{let i=r.check(e,t);for(let[o,a]of Object.entries(i)){n[o]||(n[o]={issues:[]});for(let c of a.issues)c.ruleId=r.ruleId;n[o].issues.push(...a.issues)}}catch{}return n};var Cr={DEFAULT_MAX_CONCURRENT:5,DEFAULT_RETRY_ATTEMPTS:3,DEFAULT_RETRY_DELAY_MS:1e3,DEFAULT_TIMEOUT_MS:60*1e3};var Qi=H(require("node:crypto")),Ke=H(require("node:fs")),Xi=H(require("node:path"));var NR=["CI","BUILD_ID","BUILD_NUMBER","CIRCLECI","TRAVIS","GITHUB_ACTIONS","GITLAB_CI","JENKINS_URL","BITBUCKET_BUILD_NUMBER","TEAMCITY_VERSION","BAMBOO_BUILDKEY","GO_PIPELINE_NAME","BUILDKITE","DRONE","SEMAPHORE","APPVEYOR","WERCKER","CODEBUILD_BUILD_ID","AWS_CODEBUILD_BUILD_ID","TF_BUILD","CIRRUS_CI","NETLIFY","VERCEL","RENDER","HEROKU_TEST_RUN_ID"],xr=()=>NR.some(e=>!!process.env[e]);var ct=H(require("node:fs")),ry=H(require("node:os")),Zi=H(require("node:path"));var WR={features:{staticAnalysis:{free:!0,pro:!0,trial:!0,team:!0},multiStackAnalysis:{free:!0,pro:!0,trial:!0,team:!0},localAnalysis:{free:!0,pro:!0,trial:!0,team:!0},basicServiceChecks:{free:!0,pro:!0,trial:!0,team:!0},aiAnalysis:{free:!1,pro:!0,trial:!0,team:!0},contextualFixes:{free:!1,pro:!0,trial:!0,team:!0},smartPrioritization:{free:!1,pro:!0,trial:!0,team:!0},naturalLanguageExplanations:{free:!1,pro:!0,trial:!0,team:!0},customAITraining:{free:!1,pro:!1,trial:!1,team:!0},githubIntegration:{free:!1,pro:!0,trial:!0,team:!0},teamDashboards:{free:!1,pro:!0,trial:!0,team:!0},collaborativeCommenting:{free:!1,pro:!1,trial:!1,team:!0},sharedConfigurations:{free:!1,pro:!0,trial:!0,team:!0},jsonOutput:{free:!0,pro:!0,trial:!0,team:!0},tableOutput:{free:!0,pro:!0,trial:!0,team:!0},markdownOutput:{free:!0,pro:!0,trial:!0,team:!0},pdfReports:{free:!1,pro:!0,trial:!0,team:!0},executiveSummaries:{free:!1,pro:!1,trial:!1,team:!0},customBrandedReports:{free:!1,pro:!1,trial:!1,team:!0},customRuleSets:{free:!1,pro:!0,trial:!0,team:!0},advancedCompliance:{free:!1,pro:!0,trial:!0,team:!0},cloudAnalysis:{free:!1,pro:!0,trial:!0,team:!0},parallelAnalysis:{free:!1,pro:!0,trial:!0,team:!0},caching:{free:!1,pro:!0,trial:!0,team:!0},largeProjectSupport:{free:!1,pro:!0,trial:!0,team:!0},advancedFiltering:{free:!1,pro:!1,trial:!1,team:!0},apiAccess:{free:!1,pro:!1,trial:!1,team:!0},webhookNotifications:{free:!1,pro:!1,trial:!1,team:!0},cicdIntegration:{free:!1,pro:!1,trial:!1,team:!0},customIntegrations:{free:!1,pro:!1,trial:!1,team:!0},roleBasedAccess:{free:!1,pro:!1,trial:!1,team:!0},teamAnalytics:{free:!1,pro:!1,trial:!1,team:!0},auditTrails:{free:!1,pro:!1,trial:!1,team:!0},ssoIntegration:{free:!1,pro:!1,trial:!1,team:!0},multiTenantSupport:{free:!1,pro:!1,trial:!1,team:!0},whiteLabeling:{free:!1,pro:!1,trial:!1,team:!0},customBranding:{free:!1,pro:!1,trial:!1,team:!0},communitySupport:{free:!0,pro:!0,trial:!0,team:!0},emailSupport:{free:!1,pro:!0,trial:!0,team:!0},prioritySupport:{free:!1,pro:!1,trial:!1,team:!0},dedicatedAccountManager:{free:!1,pro:!1,trial:!1,team:!0},customTraining:{free:!1,pro:!1,trial:!1,team:!0},soc2Compliance:{free:!1,pro:!0,trial:!0,team:!0},hipaaCompliance:{free:!1,pro:!0,trial:!0,team:!0},fedrampCompliance:{free:!1,pro:!1,trial:!1,team:!0},customCompliance:{free:!1,pro:!1,trial:!1,team:!0}}},jR=(e=WR)=>({isFeatureEnabled:(o,a)=>e.features[o]?.[a]??!1,getEnabledFeatures:o=>Object.entries(e.features).filter(([,a])=>a[o]).map(([a])=>a),getAllFeatures:()=>Object.keys(e.features),getFeatureTiers:o=>e.features[o],getUpgradePath:(o,a)=>{let c=["free","pro","trial","team"],u=c.indexOf(a);for(let l=u+1;l<c.length;l++){let p=c[l];if(e.features[o]?.[p])return{required:!0,tier:p,path:`https://cdkinsights.dev/pricing?tier=${p}&feature=${o}`}}return null}}),Ar=jR();var ny=(e,t,s)=>{let n=Ar.getUpgradePath(e,t),r=s?` for ${s}`:"";return n?`\u{1F4A1} Upgrade to ${n.tier} to access ${e}${r}. Visit: ${n.path}`:`\u26A0\uFE0F ${e}${r} is not available for your current tier.`};var Vi=Zi.join(ry.homedir(),".cdk-insights","cache"),e$=Zi.join(Vi,"analysis-cache.json"),bc=Zi.join(Vi,"cache-stats.json"),Ks={totalHits:0,totalMisses:0,totalSets:0,totalClears:0,cacheSize:0,maxCacheSize:1e3},On=null,Ki=!1,$R=()=>{try{if(ct.existsSync(bc)){let e=ct.readFileSync(bc,"utf-8");try{Ks={...Ks,...JSON.parse(e)}}catch(t){ms.warn("Could not parse cache statistics file",{error:t instanceof Error?t.message:String(t)})}}}catch(e){ms.warn("Could not load cache statistics",{error:e instanceof Error?e.message:String(e)})}},vc=()=>{Ki=!0,!On&&(On=setTimeout(()=>{Ki&&iy(),On=null},5e3))},iy=()=>{try{UR(),ct.writeFileSync(bc,JSON.stringify(Ks,null,2),"utf-8"),Ki=!1}catch(e){ms.warn("Could not save cache statistics",{error:e instanceof Error?e.message:String(e)})}},Sc=()=>{On&&(clearTimeout(On),On=null),Ki&&iy()};process.on("exit",Sc);process.on("SIGINT",()=>{Sc(),process.exit(0)});process.on("SIGTERM",()=>{Sc(),process.exit(0)});$R();var UR=()=>{ct.existsSync(Vi)||ct.mkdirSync(Vi,{recursive:!0})};var oy=()=>{Ks.totalHits++,vc()},Yi=()=>{Ks.totalMisses++,vc()},ay=()=>{Ks.totalSets++,Ks.cacheSize++,vc()};var Bn=Xi.join(process.env.HOME||process.env.USERPROFILE||"",".cdk-insights","cache","analysis-cache.json"),GR=()=>{let e=Xi.dirname(Bn);Ke.existsSync(e)||Ke.mkdirSync(e,{recursive:!0})},zR=()=>{if(xr())return new Map;try{if(Ke.existsSync(Bn)){let e=JSON.parse(Ke.readFileSync(Bn,"utf-8")),t=new Map,s=Date.now();for(let[n,r]of e.entries||[])s-r.timestamp<=r.ttl&&t.set(n,r);return t}}catch(e){ms.warn("Could not load cache from disk",{error:e instanceof Error?e.message:String(e)})}return new Map},cy=e=>{if(!xr())try{GR();let t={entries:Array.from(e.entries()),timestamp:Date.now(),version:"1.0"};Ke.writeFileSync(Bn,JSON.stringify(t,null,2),"utf-8")}catch(t){ms.warn("Could not save cache to disk",{error:t instanceof Error?t.message:String(t)})}},qR=e=>{try{let t=Ke.statSync(e),s=Ke.readFileSync(e,"utf-8"),n=Qi.createHash("sha256").update(s).digest("hex");return{filePath:e,lastModified:t.mtime.getTime(),hash:n}}catch{return null}},HR=e=>{let t={};for(let s of e){let n=qR(s);n&&(t[s]=n)}return t},VR=(e,t)=>e?Qi.createHash("sha256").update(`${e}:${t||""}`).digest("hex").slice(0,16):"no-auth",KR=e=>Qi.createHash("sha256").update(JSON.stringify(e)).digest("hex"),uy=(e,t,s,n,r=[])=>{let i=VR(s,n),o=KR(t),a=HR(r);return{resourceId:e,authContext:i,resourceHash:o,fileHashes:a}},ly=e=>{let t=Object.entries(e.fileHashes).sort(([s],[n])=>s.localeCompare(n)).map(([s,n])=>`${s}:${n.hash}`).join("|");return`${e.resourceId}:${e.authContext}:${e.resourceHash}:${t}`};var Ji=class{cache;ttl;maxSize;disabled=!1;constructor(t={}){this.ttl=t.ttl||60*60*1e3,this.maxSize=t.maxSize||1e3,this.disabled=t.disabled||!1,this.disabled?this.cache=new Map:this.cache=zR()}setDisabled(t){this.disabled=t,t&&this.cache.clear()}get(t){if(this.disabled){Yi();return}let s=this.cache.get(t);if(!s){Yi();return}if(Date.now()-s.timestamp>s.ttl){this.cache.delete(t),Yi();return}return oy(),s.value}set(t,s,n,r){this.disabled||(this.cache.size>=this.maxSize&&this.evictOldest(),this.cache.set(t,{value:s,timestamp:Date.now(),ttl:r??this.ttl,fileHashes:n.fileHashes,authContext:n.authContext,resourceHash:n.resourceHash}),ay(),this.cache.size%10===0&&cy(this.cache))}has(t){return this.cache.has(t)}clear(){if(this.cache.clear(),!xr())try{Ke.existsSync(Bn)&&Ke.unlinkSync(Bn)}catch(t){ms.warn("Could not clear disk cache",{error:t instanceof Error?t.message:String(t)})}}saveToDisk(){cy(this.cache)}size(){return this.cache.size}evictOldest(){let t,s=Date.now();for(let[n,r]of Array.from(this.cache.entries()))r.timestamp<s&&(s=r.timestamp,t=n);t&&this.cache.delete(t)}getStats(){return{size:this.cache.size,maxSize:this.maxSize,hitRate:0,totalHits:0,totalMisses:0}}getAllCachedResults(){return new Map(this.cache)}getCachedResultsForResources(t){let s=new Map;for(let[n,r]of Array.from(this.cache.entries())){let i=n.split(":")[0];t.includes(i)&&Date.now()-r.timestamp<=r.ttl&&s.set(i,r.value)}return s}hasCachedResult(t){for(let s of Array.from(this.cache.keys()))if(s.split(":")[0]===t)return!0;return!1}};var ZR=new Set(["the","a","an","is","are","was","were","be","been","has","have","had","do","does","did","will","would","could","should","may","might","must","shall","can","this","that","these","those","it","its","to","for","of","in","on","at","by","with","from","or","and","not","no","but","if","then","else","when","where","resource","configuration","setting","configured","property","properties","which","lead","leads","leading","means","using","use","used","ensure","consider","also","such","most","more","any","all","some","other","each","every","necessary","unnecessary","recommended","default","specific","current","potential","possible","workloads","workload"]),YR=[["lacks","missing","without","absent","none","defined"],["encryption","encrypted","encrypt"],["configured","configuration","config","settings","setting"],["enabled","enable","active","activated"],["disabled","disable","inactive"],["public","publicly","open"],["access","accessible","accessibility"],["transit","transfer","transmission"],["rest","stored","storage"],["logging","logs","logged","log"],["dlq","dead","letter","queue"],["monitor","monitoring","observability"],["alarm","alarms","alert","alerts"],["unrestricted","permissive","overly"],["egress","outbound"],["ingress","inbound"],["recovery","backup","restore"],["pitr","point"],["function","functions"],["cluster","clusters"],["instance","instances"],["bucket","buckets"],["table","tables"],["domain","domains"],["node","nodes"],["policy","policies"],["rule","rules"],["subnet","subnets"],["high","higher","excessive","elevated"],["allocation","allocated","allocate"],["provisioned","provision"],["scaling","autoscaling","auto"],["restrict","restricted","restriction"],["expose","exposed","exposing","exposure"],["allow","allows","allowing"],["prevent","prevents","preventing"],["memory","ram","2gb","1gb"]],my=new Map;for(let e of YR){let t=e[0];for(let s of e)my.set(s,t)}var JR=e=>my.get(e)||e,py=e=>{if(!e)return new Set;let t=e.toLowerCase().replace(/[^\w\s]/g," ").replace(/\s+/g," ").trim().split(" ").filter(s=>s.length>2&&!ZR.has(s)).map(JR);return new Set(t)},QR=(e,t)=>{if(e.size===0&&t.size===0)return 1;if(e.size===0||t.size===0)return 0;let s=[...e].filter(r=>t.has(r)).length,n=new Set([...e,...t]).size;return n>0?s/n:0},XR=.4,dy=3,Cc=(e,t)=>{let s=py(e.issue),n=py(t.issue);return s.size<dy||n.size<dy?!1:QR(s,n)>=XR},xc=e=>`${e.issue}::${e.severity}::${e.wafPillar}`,Fr=e=>{let{existing:t,incoming:s}=e,n=new Set(t.map(xc)),r=[];for(let i of s){let o=xc(i);n.has(o)||t.some(u=>Cc(i,u))||r.some(u=>Cc(i,u))||(n.add(o),r.push(i))}return r},eo=(e,t)=>{let s=new Set,n=[];for(let r of e){let i=xc(r);s.has(i)||n.some(a=>Cc(r,a))||(s.add(i),n.push(r))}return n};var fy=H(require("node:crypto")),gy=(e,t)=>{let s=`${e}:${t}`;return fy.createHash("sha256").update(s).digest("hex").slice(0,32)};var hy=e=>t=>{let s={},n={};return Object.entries(t).forEach(([r,i])=>{let o=e(i);s[o]=r,n[o]=i}),{redactedResources:n,mapping:s}};var yy=(e,t,s={})=>{let n=[];return e.forEach(r=>{let i=r.resourceId,o=s[i];if(!o&&i.includes("/")){let c=i.split("/"),u=c[c.length-2],l=Object.entries(t).find(([p,d])=>d.startsWith(u));l&&(o=l[1])}if(!o)return;let a=Object.entries(t).find(([,c])=>c===o)?.[0];if(!a){Q.warn(`\u26A0\uFE0F Unable to find redacted ID for logical resource: ${o}`);return}n.push({...r,resourceId:a})}),n};var Dy=(e=0)=>t=>`\x1B[${t+e}m`,by=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,vy=(e=0)=>(t,s,n)=>`\x1B[${38+e};2;${t};${s};${n}m`,Re={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},l$=Object.keys(Re.modifier),ew=Object.keys(Re.color),tw=Object.keys(Re.bgColor),p$=[...ew,...tw];function sw(){let e=new Map;for(let[t,s]of Object.entries(Re)){for(let[n,r]of Object.entries(s))Re[n]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},s[n]=Re[n],e.set(r[0],r[1]);Object.defineProperty(Re,t,{value:s,enumerable:!1})}return Object.defineProperty(Re,"codes",{value:e,enumerable:!1}),Re.color.close="\x1B[39m",Re.bgColor.close="\x1B[49m",Re.color.ansi=Dy(),Re.color.ansi256=by(),Re.color.ansi16m=vy(),Re.bgColor.ansi=Dy(10),Re.bgColor.ansi256=by(10),Re.bgColor.ansi16m=vy(10),Object.defineProperties(Re,{rgbToAnsi256:{value(t,s,n){return t===s&&s===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!s)return[0,0,0];let[n]=s;n.length===3&&(n=[...n].map(i=>i+i).join(""));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:t=>Re.rgbToAnsi256(...Re.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let s,n,r;if(t>=232)s=((t-232)*10+8)/255,n=s,r=s;else{t-=16;let a=t%36;s=Math.floor(t/36)/5,n=Math.floor(a/6)/5,r=a%6/5}let i=Math.max(s,n,r)*2;if(i===0)return 30;let o=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(s));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,s,n)=>Re.ansi256ToAnsi(Re.rgbToAnsi256(t,s,n)),enumerable:!1},hexToAnsi:{value:t=>Re.ansi256ToAnsi(Re.hexToAnsi256(t)),enumerable:!1}}),Re}var nw=sw(),It=nw;var so=H(require("node:process"),1),Cy=H(require("node:os"),1),Ac=H(require("node:tty"),1);function yt(e,t=globalThis.Deno?globalThis.Deno.args:so.default.argv){let s=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(s+e),r=t.indexOf("--");return n!==-1&&(r===-1||n<r)}var{env:Te}=so.default,to;yt("no-color")||yt("no-colors")||yt("color=false")||yt("color=never")?to=0:(yt("color")||yt("colors")||yt("color=true")||yt("color=always"))&&(to=1);function rw(){if("FORCE_COLOR"in Te)return Te.FORCE_COLOR==="true"?1:Te.FORCE_COLOR==="false"?0:Te.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Te.FORCE_COLOR,10),3)}function iw(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ow(e,{streamIsTTY:t,sniffFlags:s=!0}={}){let n=rw();n!==void 0&&(to=n);let r=s?to:n;if(r===0)return 0;if(s){if(yt("color=16m")||yt("color=full")||yt("color=truecolor"))return 3;if(yt("color=256"))return 2}if("TF_BUILD"in Te&&"AGENT_NAME"in Te)return 1;if(e&&!t&&r===void 0)return 0;let i=r||0;if(Te.TERM==="dumb")return i;if(so.default.platform==="win32"){let o=Cy.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Te)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in Te)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Te)||Te.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in Te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Te.TEAMCITY_VERSION)?1:0;if(Te.COLORTERM==="truecolor"||Te.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Te){let o=Number.parseInt((Te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Te.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Te.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Te.TERM)||"COLORTERM"in Te?1:i}function Sy(e,t={}){let s=ow(e,{streamIsTTY:e&&e.isTTY,...t});return iw(s)}var aw={stdout:Sy({isTTY:Ac.default.isatty(1)}),stderr:Sy({isTTY:Ac.default.isatty(2)})},xy=aw;function Ay(e,t,s){let n=e.indexOf(t);if(n===-1)return e;let r=t.length,i=0,o="";do o+=e.slice(i,n)+t+s,i=n+r,n=e.indexOf(t,i);while(n!==-1);return o+=e.slice(i),o}function Fy(e,t,s,n){let r=0,i="";do{let o=e[n-1]==="\r";i+=e.slice(r,o?n-1:n)+t+(o?`\r
88
88
  `:`
89
89
  `)+s,r=n+1,n=e.indexOf(`
90
90
  `,r)}while(n!==-1);return i+=e.slice(r),i}var{stdout:Ey,stderr:Ry}=xy,Fc=Symbol("GENERATOR"),Mn=Symbol("STYLER"),Er=Symbol("IS_EMPTY"),wy=["ansi","ansi","ansi256","ansi16m"],Nn=Object.create(null),cw=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let s=Ey?Ey.level:0;e.level=t.level===void 0?s:t.level};var uw=e=>{let t=(...s)=>s.join(" ");return cw(t,e),Object.setPrototypeOf(t,Rr.prototype),t};function Rr(e){return uw(e)}Object.setPrototypeOf(Rr.prototype,Function.prototype);for(let[e,t]of Object.entries(It))Nn[e]={get(){let s=no(this,Rc(t.open,t.close,this[Mn]),this[Er]);return Object.defineProperty(this,e,{value:s}),s}};Nn.visible={get(){let e=no(this,this[Mn],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Ec=(e,t,s,...n)=>e==="rgb"?t==="ansi16m"?It[s].ansi16m(...n):t==="ansi256"?It[s].ansi256(It.rgbToAnsi256(...n)):It[s].ansi(It.rgbToAnsi(...n)):e==="hex"?Ec("rgb",t,s,...It.hexToRgb(...n)):It[s][e](...n),lw=["rgb","hex","ansi256"];for(let e of lw){Nn[e]={get(){let{level:s}=this;return function(...n){let r=Rc(Ec(e,wy[s],"color",...n),It.color.close,this[Mn]);return no(this,r,this[Er])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);Nn[t]={get(){let{level:s}=this;return function(...n){let r=Rc(Ec(e,wy[s],"bgColor",...n),It.bgColor.close,this[Mn]);return no(this,r,this[Er])}}}}var pw=Object.defineProperties(()=>{},{...Nn,level:{enumerable:!0,get(){return this[Fc].level},set(e){this[Fc].level=e}}}),Rc=(e,t,s)=>{let n,r;return s===void 0?(n=e,r=t):(n=s.openAll+e,r=t+s.closeAll),{open:e,close:t,openAll:n,closeAll:r,parent:s}},no=(e,t,s)=>{let n=(...r)=>dw(n,r.length===1?""+r[0]:r.join(" "));return Object.setPrototypeOf(n,pw),n[Fc]=e,n[Mn]=t,n[Er]=s,n},dw=(e,t)=>{if(e.level<=0||!t)return e[Er]?"":t;let s=e[Mn];if(s===void 0)return t;let{openAll:n,closeAll:r}=s;if(t.includes("\x1B"))for(;s!==void 0;)t=Ay(t,s.close,s.open),s=s.parent;let i=t.indexOf(`
@@ -97,9 +97,9 @@ ${ve.primary.bold(`${Pe.rocket} ${s}`)}`),console.log(`${ve.comment("\u2500".rep
97
97
  `);let i=[];for(let o of n){if(o.enabled===!1||o.skip?.())continue;let a=uo({text:o.title,color:"blue",spinner:"dots"}).start();try{let c=await o.task();a.succeed(`${o.title} - Completed`),i.push(c)}catch(c){throw a.fail(`${o.title} - Failed`),console.error(ne.red(`
98
98
  \u274C Error in ${o.title}:`),c),c}}return r&&this.showSummary(i),i}createResourceProgressBar(t,s="Analyzing resources"){let n=0,r=process.stdout.isTTY===!0;return{update:(i=1)=>{n+=i;let o=(n/t*100).toFixed(1),a=`${n}/${t}`;r?process.stdout.write(`\r${ve.info(`${Pe.analyze} ${s}`)} ${a} (${o}%)`):console.log(`${Pe.analyze} ${s} ${a} (${o}%)`),n>=t&&r&&process.stdout.write(`
99
99
  `)},complete:()=>{r&&process.stdout.write(`
100
- `)}}}createSingleLineProgressTracker(t,s="Analyzing resources with AI"){let n=0,r=0,i=0,o=0,a=Date.now(),c=a,u=0,l=process.stdout.isTTY===!0,p=0,d=new Map,f=()=>{if(n===0)return"calculating...";let y=Date.now()-a,D=n/(y/1e3),b=(t-n)/D;return b<60?`${Math.ceil(b)}s`:b<3600?`${Math.ceil(b/60)}m`:`${Math.ceil(b/3600)}h`},m=()=>{let D=Math.floor(n/t*20),A=20-D;return"\u2588".repeat(D)+"\u2591".repeat(A)},g=()=>{let y=m(),D=f(),A=`${y} | ${n}/${t}`,b=D?` | ETA: ${D}`:"";l?(h(),process.stdout.write(`\r${ve.info(`${Pe.analyze} ${s}`)} ${A}${b}`),u=A.length+b.length+s.length+10):n>p&&(p=n,console.log(`${Pe.analyze} ${s} ${A}${b}`))},h=()=>{l&&u>0&&(process.stdout.write(`\r${" ".repeat(u)}\r`),u=0)};return{startJob:(y,D)=>{let A=d.get(D);A?A.status!=="active"&&(A.status==="timedOut"?o--:A.status==="failed"?i--:A.status==="completed"&&n--,r++,A.status="active",A.startTime=Date.now(),g()):(r++,d.set(D,{startTime:Date.now(),resourceType:D.split(":")[0]||"unknown",status:"active"}),g())},clearCurrentLine:()=>{h()},cleanup:()=>{h(),console.log(`
101
- \u26A0\uFE0F Progress tracking interrupted`)},updateJobStatus:(y,D,A,b)=>{let E=Date.now();E-c>500&&(c=E,g())},completeJob:(y,D)=>{let A=d.get(D);A&&A.status==="active"&&(n++,r--,A.status="completed",A.completionTime=Date.now()-A.startTime,g())},failJob:(y,D,A)=>{let b=d.get(D);b&&b.status==="active"&&(i++,r--,b.status="failed",g())},timeoutJob:(y,D)=>{let A=d.get(D);A&&A.status==="active"&&(o++,r--,A.status="timedOut",g())},getStats:()=>({completed:n,active:r,failed:i,timedOut:o,total:t,percentage:(n/t*100).toFixed(1),elapsed:Math.floor((Date.now()-a)/1e3),eta:f()}),getResourceStatus:y=>d.get(y),getAllResourceStatuses:()=>new Map(d),showSummary:()=>{h();let y=Math.floor((Date.now()-a)/1e3),D=n>0?Math.round(y/n):0;console.log(`
102
- ${ve.primary.bold(`${Pe.chart} Analysis Complete!`)}`),console.log(ve.comment("\u2500".repeat(50))),console.log(ve.success(`\u2705 Completed: ${n}`)),i>0&&console.log(ve.error(`\u274C Failed: ${i}`)),o>0&&console.log(ve.warning(`\u23F0 Timed out: ${o}`)),console.log(ve.comment(`\u23F1\uFE0F Total time: ${y}s`))}}}createSpinner(t){let s=uo({text:t,color:"blue",spinner:"dots"}).start();return{stop:n=>{n?s.succeed(n):s.stop()},fail:n=>{s.fail(n||"Failed")},warn:n=>{s.warn(n||"Warning")},info:n=>{s.info(n||"Info")}}}showSummary(t){console.log(`
100
+ `)}}}createSingleLineProgressTracker(t,s="Analyzing resources with AI"){let n=0,r=0,i=0,o=0,a=Date.now(),c=a,u=0,l=process.stdout.isTTY===!0,p=0,d=new Map,f=()=>{if(n===0)return"calculating...";let b=Date.now()-a,y=n/(b/1e3),D=(t-n)/y;return D<60?`${Math.ceil(D)}s`:D<3600?`${Math.ceil(D/60)}m`:`${Math.ceil(D/3600)}h`},m=()=>{let y=Math.floor(n/t*20),S=20-y;return"\u2588".repeat(y)+"\u2591".repeat(S)},g=()=>{let b=m(),y=f(),S=`${b} | ${n}/${t}`,D=y?` | ETA: ${y}`:"";l?(h(),process.stdout.write(`\r${ve.info(`${Pe.analyze} ${s}`)} ${S}${D}`),u=S.length+D.length+s.length+10):n>p&&(p=n,console.log(`${Pe.analyze} ${s} ${S}${D}`))},h=()=>{l&&u>0&&(process.stdout.write(`\r${" ".repeat(u)}\r`),u=0)};return{startJob:(b,y)=>{let S=d.get(y);S?S.status!=="active"&&(S.status==="timedOut"?o--:S.status==="failed"?i--:S.status==="completed"&&n--,r++,S.status="active",S.startTime=Date.now(),g()):(r++,d.set(y,{startTime:Date.now(),resourceType:y.split(":")[0]||"unknown",status:"active"}),g())},clearCurrentLine:()=>{h()},cleanup:()=>{h(),console.log(`
101
+ \u26A0\uFE0F Progress tracking interrupted`)},updateJobStatus:(b,y,S,D)=>{let E=Date.now();E-c>500&&(c=E,g())},completeJob:(b,y)=>{let S=d.get(y);S&&S.status==="active"&&(n++,r--,S.status="completed",S.completionTime=Date.now()-S.startTime,g())},failJob:(b,y,S)=>{let D=d.get(y);D&&D.status==="active"&&(i++,r--,D.status="failed",g())},timeoutJob:(b,y)=>{let S=d.get(y);S&&S.status==="active"&&(o++,r--,S.status="timedOut",g())},getStats:()=>({completed:n,active:r,failed:i,timedOut:o,total:t,percentage:(n/t*100).toFixed(1),elapsed:Math.floor((Date.now()-a)/1e3),eta:f()}),getResourceStatus:b=>d.get(b),getAllResourceStatuses:()=>new Map(d),showSummary:()=>{h();let b=Math.floor((Date.now()-a)/1e3),y=n>0?Math.round(b/n):0;console.log(`
102
+ ${ve.primary.bold(`${Pe.chart} Analysis Complete!`)}`),console.log(ve.comment("\u2500".repeat(50))),console.log(ve.success(`\u2705 Completed: ${n}`)),i>0&&console.log(ve.error(`\u274C Failed: ${i}`)),o>0&&console.log(ve.warning(`\u23F0 Timed out: ${o}`)),console.log(ve.comment(`\u23F1\uFE0F Total time: ${b}s`))}}}createSpinner(t){let s=uo({text:t,color:"blue",spinner:"dots"}).start();return{stop:n=>{n?s.succeed(n):s.stop()},fail:n=>{s.fail(n||"Failed")},warn:n=>{s.warn(n||"Warning")},info:n=>{s.info(n||"Info")}}}showSummary(t){console.log(`
103
103
  ${ve.primary.bold(`${Pe.chart} Analysis Summary`)}`),console.log(ve.comment("\u2500".repeat(40))),console.log(ve.text(`Completed ${t.length} step${t.length===1?"":"s"} successfully!`))}header(t){console.log(`
104
104
  ${ve.primary.bold(`${Pe.rocket} ${t}`)}`),console.log(`${ve.comment("\u2500".repeat(60))}
105
105
  `)}section(t,s=Pe.info){console.log(ve.primary.bold(`${s} ${t}`))}success(t,s=Pe.success){console.log(ve.success(`${s} ${t}`))}info(t,s=Pe.info){console.log(ve.info(`${s} ${t}`))}warning(t,s=Pe.warning){console.log(ve.warning(`${s} ${t}`))}error(t,s=Pe.error){console.log(ve.error(`${s} ${t}`))}comment(t,s=""){console.log(ve.comment(`${s} ${t}`))}phase1(t){console.log(ve.info(`${Pe.phase1} Phase 1: ${t}`))}phase2(t){console.log(ve.primary(`${Pe.phase2} Phase 2: ${t}`))}phase3(t){console.log(ve.secondary(`${Pe.phase3} Phase 3: ${t}`))}severityBadge(t){switch(t.toUpperCase()){case"CRITICAL":return ve.severity.critical.bold(`${Pe.critical} CRITICAL`);case"HIGH":return ve.severity.high.bold(`${Pe.high} HIGH`);case"MEDIUM":return ve.severity.medium.bold(`${Pe.medium} MEDIUM`);case"LOW":return ve.severity.low.bold(`${Pe.low} LOW`);default:return ve.comment(t)}}divider(){console.log(ve.comment("\u2500".repeat(60)))}newline(){console.log("")}clearLine(){process.stdout.write(`\r${" ".repeat(process.stdout.columns)}\r`)}},lo=Vc.getInstance();var iu=H(FD()),j={text:ne.hex("#E4E4E7"),success:ne.hex("#22C55E"),info:ne.hex("#3B82F6"),warning:ne.hex("#F59E0B"),error:ne.hex("#EF4444"),comment:ne.hex("#71717A"),primary:ne.hex("#8B5CF6"),secondary:ne.hex("#06B6D4"),severity:{critical:ne.hex("#EF4444"),high:ne.hex("#F97316"),medium:ne.hex("#F59E0B"),low:ne.hex("#22C55E"),info:ne.hex("#3B82F6")},accent:ne.hex("#F472B6")},Oe={success:"\u2705",info:"\u2139\uFE0F",warning:"\u26A0\uFE0F",error:"\u274C",loading:"\u23F3",done:"\u{1F389}",analyze:"\u{1F50D}",scan:"\u{1F50E}",search:"\u{1F50D}",check:"\u2705",fix:"\u{1F527}",create:"\u{1F4DD}",save:"\u{1F4BE}",upload:"\u{1F4E4}",download:"\u{1F4E5}",stack:"\u{1F4E6}",resource:"\u{1F527}",service:"\u2699\uFE0F",security:"\u{1F512}",performance:"\u26A1",cost:"\u{1F4B0}",phase1:"\u{1F4CB}",phase2:"\u{1F916}",phase3:"\u{1F4CA}",github:"\u{1F419}",issue:"\u{1F4CB}",gist:"\u{1F4C4}",critical:"\u{1F534}",high:"\u{1F7E0}",medium:"\u{1F7E1}",low:"\u{1F7E2}",sparkles:"\u2728",rocket:"\u{1F680}",brain:"\u{1F9E0}",shield:"\u{1F6E1}\uFE0F",lightning:"\u26A1",chart:"\u{1F4CA}",clock:"\u23F1\uFE0F",target:"\u{1F3AF}"},ED={log:console.log.bind(console),write:e=>process.stdout.write(e),clearScreen:()=>process.stdout.write("\x1B[2J\x1B[0f"),now:()=>Date.now(),columns:()=>process.stdout.columns??80},uI=(e,t="",s=ED)=>{let n={current:0,total:e,width:40,label:t},r=()=>{let i=Math.max(0,n.total),o=Math.max(0,Math.min(n.current,i)),a=i>0?o/i*100:0,c=i>0?Math.round(n.width*o/i):0,u=Math.max(0,n.width-c),l="\u2588".repeat(c)+"\u2591".repeat(u),p=`${a.toFixed(1)}%`,d=n.label?`${n.label} `:"",f=`${o}/${i}`;s.write(`\r${j.info(`${Oe.loading} ${d}`)}${l} ${j.comment(`${p} (${f})`)}`)};return{update:i=>{n.current=i,r()},complete:()=>{s.write(`
@@ -108,8 +108,8 @@ ${j.primary.bold(`\u{1F680} ${I}`)}`),e.log(`${j.comment("\u2500".repeat(60))}
108
108
  `)},s=(I,_=Oe.info)=>{e.log(j.primary.bold(`${_} ${I}`))},n=(I,_=Oe.success)=>{e.log(j.success(`${_} ${I}`))},r=(I,_=Oe.info)=>{e.log(j.info(`${_} ${I}`))},i=(I,_=Oe.warning)=>{e.log(j.warning(`${_} ${I}`))},o=(I,_=Oe.error)=>{e.log(j.error(`${_} ${I}`))},a=(I,_="")=>{e.log(j.comment(`${_} ${I}`))},c=I=>e.log(j.info(`${Oe.phase1} ${I}`)),u=I=>e.log(j.primary(`${Oe.phase2} ${I}`)),l=I=>e.log(j.secondary(`${Oe.phase3} ${I}`)),p=(I,_)=>{e.log(j.info(`${Oe.analyze} Analyzing your CDK stack: ${j.text.bold(I)}`)),e.log(j.comment(` \u{1F4CA} Found ${_} resource${_===1?"":"s"} to analyze`))},d=(I,_,B)=>{let U=_>0?(I/_*100).toFixed(1):"0.0";e.log(j.comment(` ${B}: ${I}/${_} (${U}%)`))},f=(I,_,B,U=0,le=0)=>{let G=_>0?(I/_*100).toFixed(1):"0.0",W=U>0||le>0?` | \u26A1${U} \u{1F40C}${le}`:"";e.log(j.comment(` ${B}: ${I}/${_} (${G}%)${W}`))},m=(I,_,B)=>{let U=_>0?(I/_*100).toFixed(1):"0.0";e.write(`\r${j.comment(` ${B}: ${I}/${_} (${U}%)`)}`),I===_&&e.write(`
109
109
  `)},g=(I,_,B,U=0,le=0)=>{let G=_>0?(I/_*100).toFixed(1):"0.0",W=U>0||le>0?` | \u26A1${U} \u{1F40C}${le}`:"";e.write(`\r${j.comment(` ${B}: ${I}/${_} (${G}%)${W}`)}`),I===_&&e.write(`
110
110
  `)},h=(I,_,B,U="\u280B")=>{let le=_>0?(I/_*100).toFixed(1):"0.0";e.write(`\r${j.comment(` ${U} ${B}: ${I}/${_} (${le}%)`)}`),I===_&&e.write(`
111
- `)},y=(I,_,B,U=0,le=0,G="\u280B")=>{let W=_>0?(I/_*100).toFixed(1):"0.0",se=U>0||le>0?` | \u26A1${U} \u{1F40C}${le}`:"";e.write(`\r${j.info(` ${G} ${B}: ${I}/${_} (${W}%)${se}`)}`),I===_&&e.write(`
112
- `)},D=(I,_="AI Analysis |{bar}| {percentage}% | {value}/{total} | ETA: {eta}s | {speed} items/s")=>new iu.default.SingleBar({format:j.comment(_),barCompleteChar:"\u2588",barIncompleteChar:"\u2591",hideCursor:!0,clearOnComplete:!0,stopOnComplete:!0,forceRedraw:!0,barsize:30},iu.default.Presets.shades_classic),A=(I,_,B,U)=>{let le=I>1e3?`${(I/1e3).toFixed(1)}s`:`${I}ms`;e.log(j.success(`${Oe.done} Analysis complete in ${le}`)),e.log(j.comment(` Success: ${_}, Failures: ${B}, Timeouts: ${U}`))},b=(I,_,B)=>{let U=B===0?"no issues":`${B} issue${B===1?"":"s"}`,le=B===0?j.success:j.warning,G=B===0?Oe.success:Oe.warning;e.log(le(` ${G} ${I} (${_}): ${U}`))},E=I=>{switch(I.toUpperCase()){case"CRITICAL":return j.severity.critical.bold(`${Oe.critical} CRITICAL`);case"HIGH":return j.severity.high.bold(`${Oe.high} HIGH`);case"MEDIUM":return j.severity.medium.bold(`${Oe.medium} MEDIUM`);case"LOW":return j.severity.low.bold(`${Oe.low} LOW`);default:return j.comment(I)}};return{header:t,section:s,success:n,info:r,warning:i,error:o,comment:a,phase1:c,phase2:u,phase3:l,analysisStart:p,analysisProgress:d,analysisProgressMixed:f,analysisProgressInPlace:m,analysisProgressInPlaceMixed:g,analysisProgressLive:h,analysisProgressLiveMixed:y,createSmoothProgressBar:D,analysisComplete:A,resourceAnalysis:b,severityBadge:E,summary:I=>{e.log(`
111
+ `)},b=(I,_,B,U=0,le=0,G="\u280B")=>{let W=_>0?(I/_*100).toFixed(1):"0.0",se=U>0||le>0?` | \u26A1${U} \u{1F40C}${le}`:"";e.write(`\r${j.info(` ${G} ${B}: ${I}/${_} (${W}%)${se}`)}`),I===_&&e.write(`
112
+ `)},y=(I,_="AI Analysis |{bar}| {percentage}% | {value}/{total} | ETA: {eta}s | {speed} items/s")=>new iu.default.SingleBar({format:j.comment(_),barCompleteChar:"\u2588",barIncompleteChar:"\u2591",hideCursor:!0,clearOnComplete:!0,stopOnComplete:!0,forceRedraw:!0,barsize:30},iu.default.Presets.shades_classic),S=(I,_,B,U)=>{let le=I>1e3?`${(I/1e3).toFixed(1)}s`:`${I}ms`;e.log(j.success(`${Oe.done} Analysis complete in ${le}`)),e.log(j.comment(` Success: ${_}, Failures: ${B}, Timeouts: ${U}`))},D=(I,_,B)=>{let U=B===0?"no issues":`${B} issue${B===1?"":"s"}`,le=B===0?j.success:j.warning,G=B===0?Oe.success:Oe.warning;e.log(le(` ${G} ${I} (${_}): ${U}`))},E=I=>{switch(I.toUpperCase()){case"CRITICAL":return j.severity.critical.bold(`${Oe.critical} CRITICAL`);case"HIGH":return j.severity.high.bold(`${Oe.high} HIGH`);case"MEDIUM":return j.severity.medium.bold(`${Oe.medium} MEDIUM`);case"LOW":return j.severity.low.bold(`${Oe.low} LOW`);default:return j.comment(I)}};return{header:t,section:s,success:n,info:r,warning:i,error:o,comment:a,phase1:c,phase2:u,phase3:l,analysisStart:p,analysisProgress:d,analysisProgressMixed:f,analysisProgressInPlace:m,analysisProgressInPlaceMixed:g,analysisProgressLive:h,analysisProgressLiveMixed:b,createSmoothProgressBar:y,analysisComplete:S,resourceAnalysis:D,severityBadge:E,summary:I=>{e.log(`
113
113
  ${j.primary.bold(`${Oe.chart} Analysis Summary`)}`),e.log(j.comment("\u2500".repeat(40))),e.log(j.text(`Total Resources: ${I.totalResources}`)),e.log(j.text(`Resources with Issues: ${I.resourcesWithIssues} (${I.percentWithIssues}%)`)),e.log(j.text(`Total Issues: ${I.totalIssues}`)),e.log(`
114
114
  ${j.primary.bold("Severity Breakdown:")}`),e.log(` ${E("CRITICAL")}: ${I.severityCounts.CRITICAL}`),e.log(` ${E("HIGH")}: ${I.severityCounts.HIGH}`),e.log(` ${E("MEDIUM")}: ${I.severityCounts.MEDIUM}`),e.log(` ${E("LOW")}: ${I.severityCounts.LOW}`);let _=Object.entries(I.wafIssues).filter(([,B])=>B>0);if(_.length>0){e.log(`
115
115
  ${j.primary.bold("WAF Pillar Impact:")}`);for(let[B,U]of _)e.log(j.text(` ${B}: ${U}`))}},githubIssueCreated:I=>{e.log(j.success(`${Oe.github} GitHub issue created successfully!`)),e.log(j.info(` ${I}`))},githubGistCreated:I=>{e.log(j.success(`${Oe.gist} Gist created for detailed report`)),e.log(j.info(` ${I}`))},createProgressBar:(I,_)=>uI(I,_,e),spinner:(I,_)=>{let B=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],U=0,le=null,G=()=>{le&&(clearInterval(le),le=null),e.write(`\r${" ".repeat(I.length+3)}\r`)},W=()=>G();return process.once("exit",W),process.once("SIGINT",W),process.once("SIGTERM",W),le=setInterval(()=>{e.write(`\r${j.info(B[U])} ${I}`),U=(U+1)%B.length},80),_().finally(()=>{process.removeListener("exit",W),process.removeListener("SIGINT",W),process.removeListener("SIGTERM",W),G()})},divider:()=>e.log(j.comment("\u2500".repeat(60))),newline:()=>e.log(""),clearLine:()=>{e.write(`\r${" ".repeat(e.columns())}\r`)},displayTrialStatus:I=>{if(!I.isTrial)return;let{currentResourcesAnalyzed:_,maxResources:B,remainingResources:U,trialExpired:le,trialStart:G,trialEnd:W,tier:se}=I,Ee=B>0?_/B*100:0,De=j.success,ie="\u{1F3AF}",de="Active";le?(De=j.error,ie="\u23F0",de="Expired"):Ee>=90?(De=j.error,ie="\u26A0\uFE0F",de="Critical"):Ee>=80?(De=j.warning,ie="\u26A1",de="Warning"):Ee>=50&&(De=j.info,ie="\u{1F4CA}",de="Good"),e.log(`
@@ -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.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(`
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 y=uy(p,h,i,o,[]),S=ly(y),D=t[p];if(!D)return{status:"skipped",redactedId:p};let E=D,T=()=>(s[E]||(s[E]={issues:[]}),s[E]),k=c.get(S);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 C=gy(a,D),$=qa(D,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,C,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(S,V,y),{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),b=new Map;for(let O of h){let I=b.get(O.resourceId);I?I.push(O):b.set(O.resourceId,[O])}let y=Object.keys(m),S=y.length,D=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:D}),C=lo.createSingleLineProgressTracker(S,"Analyzing resources with AI");await gI(y,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:b,progressTracker:C});switch(f.processedCount++,Ve.debug(`Resource ${O} analysis result: ${I.status}`,{redactedId:O,status:I.status,hasProgressTracker:!!C}),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:b.get(O)||[]});break;case"fail":case"skipped":f.failureCount++,Ve.warn(`Resource ${O} failed or was skipped`,{redactedId:O,status:I.status});break}}),C.showSummary();let $=Date.now()-f.startTime,K=C.getStats();if(Ve.debug("Analysis completed with progress tracker stats",{progressTrackerStats:K,performanceMetrics:f,totalTime:$,totalResources:S,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/S*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.4",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+=`
@@ -144,16 +144,16 @@ The detailed report includes:`),n.push("- Complete issue descriptions and recomm
144
144
  `),t.push("```typescript"),t.push("// Instead of hardcoding secrets:"),t.push("environment: {"),t.push(' API_KEY: "sk_live_hardcoded_secret", // \u274C Bad'),t.push("}"),t.push(""),t.push("// Use Secrets Manager:"),t.push("import { Secret } from 'aws-cdk-lib/aws-secretsmanager';"),t.push(""),t.push("const apiKeySecret = Secret.fromSecretNameV2(this, 'ApiKey', 'my-api-key');"),t.push("environment: {"),t.push(" API_KEY: apiKeySecret.secretValue.unsafeUnwrap(), // \u2705 Good"),t.push("}"),t.push("```\n"),t.push(`\u{1F4DA} Learn more: [AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html)
145
145
  `),t},jn=(e,t,s,n=!0,r={},i=!0)=>{let o=[],a=yI(t,i),c=i&&a<5e4;o.push(`# ${e}`),o.push(`_Generated by cdk-insights v${_D} on ${s.generatedAt}_`),o.push(`
146
146
  CDK Insights has found **${s.totalIssues} issues** in **${s.totalResources} resources** scanned.
147
- `);let u=vI(t);if(u.length>0&&o.push(...SI(u)),c){let f=new Map;for(let[,m]of Object.entries(t)){let g=m.sources.cdkInsights?.issues??[],h=m.sources.cdkNag?.issues??[];if(g.length===0&&h.length===0)continue;let y=m.resourceName??m.friendlyName??"Unknown";f.set(y,(f.get(y)||0)+1)}o.push("## Table of Contents");for(let[m,g]of Object.entries(t)){let h=g.sources.cdkInsights?.issues??[],y=g.sources.cdkNag?.issues??[];if(h.length===0&&y.length===0)continue;let D=g.resourceName??g.friendlyName??"Unknown";if((f.get(D)||0)>1&&g.cdkPath){let E=g.cdkPath.split("/");E.length>=3?D=E.slice(1).join("/"):E.length===2&&(D=E[1])}let b=TD(`${g.cdkPath}`);o.push(`- [${D}](#${b})`)}o.push(`
147
+ `);let u=vI(t);if(u.length>0&&o.push(...SI(u)),c){let f=new Map;for(let[,m]of Object.entries(t)){let g=m.sources.cdkInsights?.issues??[],h=m.sources.cdkNag?.issues??[];if(g.length===0&&h.length===0)continue;let b=m.resourceName??m.friendlyName??"Unknown";f.set(b,(f.get(b)||0)+1)}o.push("## Table of Contents");for(let[m,g]of Object.entries(t)){let h=g.sources.cdkInsights?.issues??[],b=g.sources.cdkNag?.issues??[];if(h.length===0&&b.length===0)continue;let y=g.resourceName??g.friendlyName??"Unknown";if((f.get(y)||0)>1&&g.cdkPath){let E=g.cdkPath.split("/");E.length>=3?y=E.slice(1).join("/"):E.length===2&&(y=E[1])}let D=TD(`${g.cdkPath}`);o.push(`- [${y}](#${D})`)}o.push(`
148
148
  ---
149
149
  `)}o.push("**Executive Summary:**"),o.push(`We discovered **${s.totalIssues} total issues** across **${s.totalResources} resources** (${s.percentWithIssues}% with issues).
150
150
  `),o.push("**Top Priorities:**");let l=s.severityCounts.CRITICAL===1?"issue":"issues";s.severityCounts.CRITICAL&&o.push(`\u{1F534} ${s.severityCounts.CRITICAL} Critical severity ${l}`);let p=s.severityCounts.HIGH===1?"issue":"issues";s.severityCounts.HIGH&&o.push(`\u{1F7E0} ${s.severityCounts.HIGH} High severity ${p}`),o.push(""),o.push("| Metric | Count |"),o.push("| --------------------------- | :---: |"),o.push(`| Resources scanned | ${s.totalResources} |`),o.push(`| Resources with issues | ${s.resourcesWithIssues} |`),o.push(`| Total issues found | ${s.totalIssues} |`),o.push(`| % of resources with issues | ${s.percentWithIssues}% |
151
151
  `),o.push("### WAF Pillar Impact");for(let[f,m]of Object.entries(s.wafIssues))o.push(`- **${f}**: ${m}`);o.push(`
152
152
  `),o.push("### Next Steps"),o.push("1. Triage \u{1F534} critical issues first"),o.push("2. Fix \u{1F7E0} high\u2010impact items next"),o.push("3. Schedule \u{1F7E1} medium\u2010priority tasks"),o.push(`4. Plan \u{1F7E2} low\u2010priority enhancements
153
- `);let d=new Map;for(let[,f]of Object.entries(t)){let m=f.sources.cdkInsights?.issues??[],g=f.sources.cdkNag?.issues??[];if(m.length===0&&g.length===0)continue;let h=f.resourceName??f.friendlyName??"Unknown";d.set(h,(d.get(h)||0)+1)}for(let[f,m]of Object.entries(t)){let g=m.sources.cdkInsights?.issues??[],h=m.sources.cdkNag?.issues??[];if(g.length===0&&h.length===0)continue;let y=m.resourceName??m.friendlyName??"Unknown";if((d.get(y)||0)>1&&m.cdkPath){let S=m.cdkPath.split("/");S.length>=3?y=S.slice(1).join("/"):S.length===2&&(y=S[1])}o.push(`---
154
- `),o.push(`<h2 id="${TD(m.cdkPath)}">Resource: ${y}</h2>
153
+ `);let d=new Map;for(let[,f]of Object.entries(t)){let m=f.sources.cdkInsights?.issues??[],g=f.sources.cdkNag?.issues??[];if(m.length===0&&g.length===0)continue;let h=f.resourceName??f.friendlyName??"Unknown";d.set(h,(d.get(h)||0)+1)}for(let[f,m]of Object.entries(t)){let g=m.sources.cdkInsights?.issues??[],h=m.sources.cdkNag?.issues??[];if(g.length===0&&h.length===0)continue;let b=m.resourceName??m.friendlyName??"Unknown";if((d.get(b)||0)>1&&m.cdkPath){let C=m.cdkPath.split("/");C.length>=3?b=C.slice(1).join("/"):C.length===2&&(b=C[1])}o.push(`---
154
+ `),o.push(`<h2 id="${TD(m.cdkPath)}">Resource: ${b}</h2>
155
155
 
156
- `);let A=[];if(m.constructType&&A.push(`**Type:** \`${m.constructType}\``),m.serviceCategory&&A.push(`**Category:** ${m.serviceCategory}`),m.sourceLocation){let{filePath:S,line:$,column:K,confidence:J,enclosingScope:V}=m.sourceLocation,O=`**${J==="high"?"\u{1F3AF}":J==="medium"?"\u{1F4CD}":"\u2753"} Source:** \`${S}:${$}:${K}\``;V&&(O+=` (in \`${V}\`)`),A.push(O)}else if(m.rootSourceLocation||m.createdBy||m.searchHint){if(m.createdBy&&A.push(`**\u{1F517} ${m.createdBy}**`),m.rootSourceLocation){let{filePath:S,line:$,column:K,enclosingScope:J}=m.rootSourceLocation,V=`**\u{1F4C2} Parent Source:** \`${S}:${$}:${K}\``;J&&(V+=` (in \`${J}\`)`),A.push(V)}m.searchHint&&A.push(`**\u{1F50D} ${m.searchHint}**`)}if(m.l2ConstructType&&m.l2ConstructId&&A.push(`**L2 Construct:** \`${m.l2ConstructId}\` (${m.l2ConstructType})`),m.parentPath&&A.push(`**Parent:** \`${m.parentPath}\``),m.childCount!==void 0&&m.childCount>0&&A.push(`**Children:** ${m.childCount}`),m.dependencies&&m.dependencies.length>0&&A.push(`**Depends On:** ${m.dependencies.map(S=>`\`${S}\``).join(", ")}`),m.tags&&Object.keys(m.tags).length>0){let S=Object.entries(m.tags).map(([$,K])=>`\`${$}=${K}\``).join(", ");A.push(`**Tags:** ${S}`)}if(A.length>0&&o.push(`${A.join(" | ")}
156
+ `);let S=[];if(m.constructType&&S.push(`**Type:** \`${m.constructType}\``),m.serviceCategory&&S.push(`**Category:** ${m.serviceCategory}`),m.sourceLocation){let{filePath:C,line:$,column:K,confidence:J,enclosingScope:V}=m.sourceLocation,O=`**${J==="high"?"\u{1F3AF}":J==="medium"?"\u{1F4CD}":"\u2753"} Source:** \`${C}:${$}:${K}\``;V&&(O+=` (in \`${V}\`)`),S.push(O)}else if(m.rootSourceLocation||m.createdBy||m.searchHint){if(m.createdBy&&S.push(`**\u{1F517} ${m.createdBy}**`),m.rootSourceLocation){let{filePath:C,line:$,column:K,enclosingScope:J}=m.rootSourceLocation,V=`**\u{1F4C2} Parent Source:** \`${C}:${$}:${K}\``;J&&(V+=` (in \`${J}\`)`),S.push(V)}m.searchHint&&S.push(`**\u{1F50D} ${m.searchHint}**`)}if(m.l2ConstructType&&m.l2ConstructId&&S.push(`**L2 Construct:** \`${m.l2ConstructId}\` (${m.l2ConstructType})`),m.parentPath&&S.push(`**Parent:** \`${m.parentPath}\``),m.childCount!==void 0&&m.childCount>0&&S.push(`**Children:** ${m.childCount}`),m.dependencies&&m.dependencies.length>0&&S.push(`**Depends On:** ${m.dependencies.map(C=>`\`${C}\``).join(", ")}`),m.tags&&Object.keys(m.tags).length>0){let C=Object.entries(m.tags).map(([$,K])=>`\`${$}=${K}\``).join(", ");S.push(`**Tags:** ${C}`)}if(S.length>0&&o.push(`${S.join(" | ")}
157
157
 
158
158
  `),m.sourceLocation?.codeSnippet?(o.push(`<details>
159
159
  <summary>Source Code Context</summary>
@@ -171,23 +171,23 @@ CDK Insights has found **${s.totalIssues} issues** in **${s.totalResources} reso
171
171
  \`\`\`
172
172
  </details>
173
173
 
174
- `)),m.sensitiveProperties&&m.sensitiveProperties.length>0){let S=m.sensitiveProperties.filter($=>$.isDefault);if(S.length>0){o.push(`**\u26A0\uFE0F Properties using defaults:**
175
- `);for(let $ of S)o.push(`- \`${$.path}\`: ${$.recommendation||"Review this property"}
174
+ `)),m.sensitiveProperties&&m.sensitiveProperties.length>0){let C=m.sensitiveProperties.filter($=>$.isDefault);if(C.length>0){o.push(`**\u26A0\uFE0F Properties using defaults:**
175
+ `);for(let $ of C)o.push(`- \`${$.path}\`: ${$.recommendation||"Review this property"}
176
176
  `);o.push(`
177
177
  `)}}m.usesDefaults&&o.push(`> **Note:** This resource appears to use mostly default configuration. Consider explicitly setting security-relevant properties.
178
178
 
179
179
  `),o.push(`**CDK Insights Issues:**
180
- `);let E=(m.sources.cdkInsights?.issues??[]).slice().sort((S,$)=>fo[S.severity]-fo[$.severity]);if(E.length)for(let S of E){if(o.push(`### ${mo(S.severity)} ${S.severity} Severity Issue ${mo(S.severity)}
181
- `),o.push(kD(S)),S.codeSnippet){let J=S.codeSnippet.replace(/^```[a-z]*\n?/,"").replace(/```$/,"").split(`
180
+ `);let E=(m.sources.cdkInsights?.issues??[]).slice().sort((C,$)=>fo[C.severity]-fo[$.severity]);if(E.length)for(let C of E){if(o.push(`### ${mo(C.severity)} ${C.severity} Severity Issue ${mo(C.severity)}
181
+ `),o.push(kD(C)),C.codeSnippet){let J=C.codeSnippet.replace(/^```[a-z]*\n?/,"").replace(/```$/,"").split(`
182
182
  `).map(V=>` ${V}`).join(`
183
183
  `);o.push(`- **Potential Fix Example:**
184
184
 
185
185
  \`\`\`ts
186
186
  ${J}
187
- \`\`\``)}let $=m.cdkPath??r[m.resourceId];o.push(`- **Source Path:** \`${$}\``),n&&m.docUrl&&o.push(`- **Documentation:** [View ${m.resourceName??m.friendlyName} Construct Docs](${m.docUrl})`);let K=hI[S.wafPillar];o.push(`- **WAF Pillar:** [${S.wafPillar}](${K})`),o.push("")}else o.push(`- _(no CDK Insights issues)_
187
+ \`\`\``)}let $=m.cdkPath??r[m.resourceId];o.push(`- **Source Path:** \`${$}\``),n&&m.docUrl&&o.push(`- **Documentation:** [View ${m.resourceName??m.friendlyName} Construct Docs](${m.docUrl})`);let K=hI[C.wafPillar];o.push(`- **WAF Pillar:** [${C.wafPillar}](${K})`),o.push("")}else o.push(`- _(no CDK Insights issues)_
188
188
  `);o.push(`**CDK Nag Issues:**
189
- `);let k=(m.sources.cdkNag?.issues??[]).slice().sort((S,$)=>fo[S.severity]-fo[$.severity]);if(k.length)for(let S of k){if(o.push(`### ${mo(S.severity)} ${S.severity} Severity CDK Nag Issue ${mo(S.severity)}
190
- `),o.push(kD(S)),S.codeSnippet){let $=S.codeSnippet.replace(/^```[a-z]*\n?/,"").replace(/```$/,"").split(`
189
+ `);let k=(m.sources.cdkNag?.issues??[]).slice().sort((C,$)=>fo[C.severity]-fo[$.severity]);if(k.length)for(let C of k){if(o.push(`### ${mo(C.severity)} ${C.severity} Severity CDK Nag Issue ${mo(C.severity)}
190
+ `),o.push(kD(C)),C.codeSnippet){let $=C.codeSnippet.replace(/^```[a-z]*\n?/,"").replace(/```$/,"").split(`
191
191
  `).map(K=>` ${K}`).join(`
192
192
  `);o.push(`- **Potential Fix Example:**
193
193
 
@@ -202,8 +202,8 @@ ${$}
202
202
  \u26A0\uFE0F Full report available at ${u}`)}if(a){let u={title:t,body:o};await zt.post(`https://api.github.com/repos/${c.owner}/${c.repo}/issues`,u,{headers:{Authorization:`Bearer ${a}`,Accept:"application/vnd.github+json"}}),q.githubIssueCreated(`https://github.com/${c.owner}/${c.repo}/issues`)}else if(n){let u,l;try{u=$e.mkdtempSync(Lr.join(uu.tmpdir(),"cdk-insights-")),l=Lr.join(u,"issue-body.md"),$e.writeFileSync(l,o);let d=(0,cu.execFileSync)("gh",["issue","create","--title",t,"--body-file",l],{encoding:"utf-8"}).trim().match(/https:\/\/github\.com\/[^\s]+/),f=d?d[0]:`https://github.com/${c.owner}/${c.repo}/issues`;q.githubIssueCreated(f)}catch(p){q.warning("GitHub CLI failed. You may need to authenticate with `gh auth login`"),q.warning(`Error: ${p instanceof Error?p.message:"Unknown error"}`),q.warning("Falling back to web interface..."),BD(c,t,o)}finally{if(l&&$e.existsSync(l))try{$e.unlinkSync(l)}catch{}if(u&&$e.existsSync(u))try{$e.rmdirSync(u)}catch{}}}else BD(c,t,o)},BD=(e,t,s)=>{let n=`https://github.com/${e.owner}/${e.repo}/issues/new`,r=encodeURIComponent(t),i=encodeURIComponent(s),o=`${n}?title=${r}&body=${i}`;if(o.length>xI){q.warning(`Issue body is too long for URL (${o.length} chars). The content may be truncated in the browser.`),q.comment("Consider setting GITHUB_TOKEN environment variable or installing GitHub CLI (gh) for full support.");let a=`${n}?title=${r}`;q.info(`Please open this URL and paste the issue body manually:
203
203
  ${a}`),q.info(`
204
204
  Issue body has been saved to: cdk-insights-issue-body.md`);try{$e.writeFileSync("cdk-insights-issue-body.md",s)}catch(c){q.warning(`Failed to save issue body to file: ${c instanceof Error?c.message:String(c)}`)}}else q.info(`Please open this URL to create the issue:
205
- ${o}`)};var ND=require("node:child_process"),WD=()=>{try{return(0,ND.execFileSync)("gh",["--version"],{stdio:"ignore"}),!0}catch{return!1}};var $D=H(require("node:crypto"));var AI=[/^AWS::/,/^arn:aws[a-z-]*:/,/^\[REDACTED\]$/,/^(true|false|enabled|disabled)$/i,/^(us|eu|ap|sa|ca|me|af)-(north|south|east|west|central)-\d$/,/^https:\/\/[a-z0-9-]+\.(amazonaws\.com|aws\.amazon\.com)/],FI=new Set(["Ref","Fn::GetAtt","Fn::Sub","Fn::Join","Fn::Select","Fn::Split","Fn::If","Fn::Equals","Fn::And","Fn::Or","Fn::Not","Fn::Condition","Fn::Base64","Fn::Cidr","Fn::FindInMap","Fn::GetAZs","Fn::ImportValue","Fn::Transform","Condition"]),EI=new Set(["SSEAlgorithm","Algorithm","KeySpec","CustomerMasterKeySpec","Protocol","Scheme","HttpMethod","AuthorizationType","Type","SslPolicy","SecurityPolicy","MinimumProtocolVersion","Runtime","Engine","EngineVersion","Handler","PackageType","Effect","Action","Principal","Resource","Condition","LogLevel","MetricsLevel","Status","State","Enabled","IpProtocol","CidrIp","CidrIpv6","FromPort","ToPort","Version","SchemaVersion"]),RI=e=>AI.some(t=>t.test(e)),wI=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.keys(e);return t.length===1&&FI.has(t[0])},go=(e,t,s=0)=>{if(s>50)return"[DEEP_NESTED]";if(e==null||typeof e=="boolean"||typeof e=="number")return e;if(typeof e=="string")return e===""?"":t&&EI.has(t)||RI(e)?e:e.length>100?"[REDACTED_LONG_STRING]":"[REDACTED]";if(Array.isArray(e))return e.map(n=>go(n,void 0,s+1));if(typeof e=="object"){if(wI(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=go(i,r,s+1);return n}return"[REDACTED]"},lu=e=>{let t={Type:e.Type};return e.Properties&&(t.Properties=go(e.Properties,void 0,0)),e.Metadata&&(t.Metadata=go(e.Metadata,void 0,0)),e.DependsOn&&(t.DependsOn=e.DependsOn),e.Condition&&(t.Condition=e.Condition),e.DeletionPolicy&&(t.DeletionPolicy=e.DeletionPolicy),e.UpdateReplacePolicy&&(t.UpdateReplacePolicy=e.UpdateReplacePolicy),t};var II=e=>{let t=JSON.stringify(e,Object.keys(e).sort());return $D.createHash("sha256").update(t).digest("hex").slice(0,32)},jD=(e,t)=>({Authorization:`Bearer ${e}`,"Content-Type":"application/json","x-cdk-insights-fingerprint":t,"x-cdk-insights-client":"cli"}),UD=(e,t)=>async(s,n,r,i,o,a,c,u,l)=>{let m=T=>new Promise(k=>setTimeout(k,T)),g,h=Date.now(),y=async()=>{let T=lu(r),k=II(T),S={stackName:s,resourceId:n,resource:T,resourceType:i,resourceContentHash:k};l&&(S.context=l);let{data:$}=await e.post(`${t}/analyze`,S,{headers:jD(o,a)});if(!$?.jobId)throw new Error(`No jobId returned from analysis API for resource ${n}`);return $.jobId};try{g=await y(),u&&u.startJob(g,n),pe.info(`Started analysis job ${g} for resource ${n} (${i})`)}catch(T){let{message:k}=T,S=zt.isAxiosError(T)&&T.response?.status===403;throw Q.error(`Failed to start analysis for resource ${n}:`,{error:T}),S?new Error(`Authentication failed (403) for resource ${n}. Your auth token may be invalid or expired. Try running 'npx cdk-insights clear-cache' to refresh your authentication.`):new Error(`Failed to start analysis for resource ${n}: ${k||T}`)}let D=1e3,A=0,b=Date.now();for(let T=1;T<=30;T++){try{let k=Date.now()-h;pe.info(`Polling job ${g} for resource ${n} on attempt ${T}/30 (interval: ${D}ms, total elapsed: ${k}ms)`),u&&u.updateJobStatus(g,n,"polling",T);let S=await e.get(`${t}/analyze/${g}`,{headers:jD(o,a)});pe.info(`API Response for job ${g}: status=${S.data.status}, hasResult=${!!S.data.result}, resultType=${typeof S.data.result}`);let{status:$,result:K,error:J}=S.data;if($==="completed"){if(!K)throw pe.error(`Job ${g} completed without result payload. Raw response: ${JSON.stringify(S.data)}`),new Error(`Job ${g} completed without result payload`);u&&u.completeJob(g,n);let Z=Date.now()-b,O=Date.now()-h;return pe.info(`Job ${g} completed successfully in ${Z}ms (attempt ${T}, total time: ${O}ms)`),K}if($==="failed"){u&&u.failJob(g,n,"Job failed");let Z=Date.now()-h,O=J||"Unknown error";throw pe.error(`Job ${g} failed after ${Z}ms (attempt ${T}): ${O}`),new Error(`Analysis job ${g} failed for resource ${n}: ${O}`)}let V=Date.now()-b;if(V>5e3){let Z=Math.min(D*1.5,3e3),O=Math.random()*500;D=Math.min(Z+O,3e3),A=0,pe.info(`Job ${g} running for ${V}ms, using exponential backoff: ${Math.round(D)}ms`)}else A===0&&(D=1e3);b=Date.now()}catch(k){if(A++,k instanceof Error){if(k.message.startsWith(`Analysis job ${g}`))throw k;Q.error(`Error polling job ${g} for resource ${n} on attempt ${T}:`,{error:k.message})}else if(typeof k=="object"&&k!==null&&"response"in k){let S=k;S.response?.status===404?D=Math.min(D*1.2,3e3):(Q.error(`Error polling job ${g} for resource ${n} on attempt ${T}:`,{error:S}),D=Math.min(D*1.5,3e3))}else Q.error(`Unknown error polling job ${g} for resource ${n} on attempt ${T}:`,{error:k}),D=Math.min(D*1.5,3e3)}await m(D)}u&&u.timeoutJob(g,n);let E=Date.now()-h;throw pe.error(`Job ${g} timed out after ${E}ms (30 attempts, max interval: 3000ms)`),new Error(`Polling timed out after 30 attempts for job ${g} (resource ${n}) - total time: ${E}ms`)};var pu=(e,t)=>e.filter(s=>t.some(n=>s.issue.toLowerCase().includes(n.toLowerCase())||s.wafPillar&&s.wafPillar.toLowerCase()===n.toLowerCase()));var St=H(require("node:fs")),vt=H(require("node:path"));var bt=new Map,du=3e4,GD=500,TI=()=>{if(bt.size<=GD)return;let t=Array.from(bt.entries()).sort((s,n)=>s[1].timestamp-n[1].timestamp).slice(0,bt.size-GD);for(let[s]of t)bt.delete(s)},mu=e=>{let t=bt.get(e);if(t&&Date.now()-t.timestamp<du)return t.content;try{let s=St.readFileSync(e,"utf-8");return TI(),bt.set(e,{content:s,timestamp:Date.now()}),s}catch{return null}},zD=(e,t=process.cwd())=>{try{let s=e.split("/").pop()||"",n=[s.replace(/Resource$/,""),s.replace(/Construct$/,""),s.replace(/Stack$/,""),s.replace(/[A-F0-9]{8,10}$/,""),s.replace(/[A-F0-9]{8}$/,""),s.replace(/[A-F0-9]{10}$/,""),s].filter(i=>i.length>2),r=[vt.join(t,"src"),vt.join(t,"lib"),vt.join(t,"cdk"),t];for(let i of r){if(!St.existsSync(i))continue;let o=fu(i);for(let a of o){let c=mu(a);if(c){for(let u of n)if(u&&u.length>2){let l=[new RegExp(`new\\s+(\\w+)\\s*\\(\\s*this\\s*,\\s*['"]${u}['"]`,"g"),new RegExp(`new\\s+(\\w+)\\s*\\(\\s*this\\s*,\\s*["']${u}["']`,"g"),new RegExp(`new\\s+(\\w+)\\s*\\(\\s*this\\s*,\\s*\`${u}\``,"g"),new RegExp(`new\\s+(\\w+)\\s*\\(\\s*this\\s*,\\s*${u}\\b`,"g"),new RegExp(`(\\w+)\\s*\\(\\s*this\\s*,\\s*['"]${u}['"]`,"g")];for(let p of l){let d=c.match(p);if(d){let f=c.split(`
206
- `);for(let m=0;m<f.length;m++){let g=f[m];if(g.includes("this")&&p.test(g)){let h=d[1]||"Unknown";return{filePath:vt.relative(t,a),line:m+1,column:g.indexOf("new")+1,constructType:h}}}}}}}}}}catch{}return null},fu=e=>{let t=[],s=`ts_files_${e}`,n=bt.get(s);if(n&&Date.now()-n.timestamp<du)try{return JSON.parse(n.content)}catch{bt.delete(s)}try{let r=St.readdirSync(e);for(let i of r){let o=vt.join(e,i),a=St.statSync(o);a.isDirectory()&&!i.startsWith(".")&&i!=="node_modules"&&i!=="dist"&&i!=="build"&&i!==".git"?t.push(...fu(o)):a.isFile()&&i.endsWith(".ts")&&!i.endsWith(".d.ts")&&t.push(o)}bt.set(s,{content:JSON.stringify(t),timestamp:Date.now()})}catch{}return t},kI=e=>{let t=[],s=`stack_files_${e}`,n=bt.get(s);if(n&&Date.now()-n.timestamp<du)try{return JSON.parse(n.content)}catch{bt.delete(s)}try{let r=St.readdirSync(e);for(let i of r){let o=vt.join(e,i),a=St.statSync(o);if(a.isDirectory()&&!i.startsWith(".")&&i!=="node_modules"&&i!=="dist")(i==="cdk"||i==="lib"||i==="src")&&t.push(...fu(o));else if(a.isFile()&&i.endsWith(".ts")&&!i.endsWith(".d.ts")){let c=mu(o);c?.includes("Stack")&&c.includes("extends")&&t.push(o)}}bt.set(s,{content:JSON.stringify(t),timestamp:Date.now()})}catch{}return t};var qD=(e,t)=>{let s=Array.isArray(e)?e.map(String):typeof e=="string"?[e]:[],n=null;for(let r of s){if(r.includes("/dist/")||r.includes("\\dist\\"))continue;let i=[/(\/.*?\.ts):(\d+):(\d+)/,/at (.*?\.ts):(\d+):(\d+)/,/\((.*?\.ts):(\d+):(\d+)\)/,/(\/.*?\.tsx):(\d+):(\d+)/,/at (.*?\.tsx):(\d+):(\d+)/,/\((.*?\.tsx):(\d+):(\d+)\)/,/(\/.*?\.js):(\d+):(\d+)/,/at (.*?\.js):(\d+):(\d+)/,/\((.*?\.js):(\d+):(\d+)\)/];for(let o of i){let a=r.match(o);if(a){let[,c,u,l]=a,p=c.split(".").pop()?.toLowerCase()??"";if(p==="ts"||p==="tsx")return{filePath:c.startsWith("/")?c:`./${c}`,line:Number(u),column:Number(l)};p==="js"&&!n&&(n={filePath:c.startsWith("/")?c:`./${c}`,line:Number(u),column:Number(l)})}}}return n},VD=(e,t,s=process.cwd())=>{try{if(e&&typeof e=="object"&&"artifacts"in e){let c=e,u=t,l={};for(let f of Object.values(c.artifacts??{}))if(f.metadata)for(let[m,g]of Object.entries(f.metadata))l[m]=g;let p=Object.entries(l).filter(([,f])=>f.some(m=>m.type==="aws:cdk:logicalId"&&m.data===u));for(let[f,m]of p){let g=m.find(y=>y.type==="aws:cdk:info"&&typeof y.data=="string"&&y.data.startsWith("cdk-insights::"));if(g)try{let y=JSON.parse(g.data.replace("cdk-insights::",""));if(y.sourceLocation)return{filePath:y.sourceLocation.filePath,line:y.sourceLocation.line||1,column:y.sourceLocation.column||1,constructPath:f,stackName:f.split("/")[0]||"",logicalId:u,confidence:"high"}}catch{}let h=m.find(y=>y.type==="aws:cdk:cloudformation:stack-trace");if(h){let y=qD(h.data,f);if(y?.filePath){let D=vt.resolve(s,y.filePath);if(St.existsSync(D))return{...y,line:y.line??1,column:y.column??1,constructPath:f,stackName:f.split("/")[0]||"",logicalId:u,confidence:"high"}}}}for(let[f]of p){let m=zD(f,s);if(m)return{...m,line:m.line??1,column:m.column??1,constructPath:f,stackName:f.split("/")[0]||"",logicalId:u,confidence:"medium"}}let d=p[0]?.[0]||u;return HD(d,u,s)}let r=e,i=t,o=qD(r,i);if(o?.filePath){let c=vt.resolve(s,o.filePath);if(St.existsSync(c))return{...o,line:o.line??1,column:o.column??1,constructPath:i,confidence:"high"}}let a=zD(i,s);return a?{...a,line:a.line??1,column:a.column??1,constructPath:i,confidence:"medium"}:HD(i,i,s)}catch{return{filePath:t,line:1,column:1,constructPath:t,confidence:"low"}}},HD=(e,t,s)=>{let n=e.split("/").pop()||"",r=e.split("/")[0]||"",i=kI(s);for(let o of i)try{let a=mu(o);if(!a)continue;let c=a.split(`
205
+ ${o}`)};var ND=require("node:child_process"),WD=()=>{try{return(0,ND.execFileSync)("gh",["--version"],{stdio:"ignore"}),!0}catch{return!1}};var $D=H(require("node:crypto"));var AI=[/^AWS::/,/^arn:aws[a-z-]*:/,/^\[REDACTED\]$/,/^(true|false|enabled|disabled)$/i,/^(us|eu|ap|sa|ca|me|af)-(north|south|east|west|central)-\d$/,/^https:\/\/[a-z0-9-]+\.(amazonaws\.com|aws\.amazon\.com)/],FI=new Set(["Ref","Fn::GetAtt","Fn::Sub","Fn::Join","Fn::Select","Fn::Split","Fn::If","Fn::Equals","Fn::And","Fn::Or","Fn::Not","Fn::Condition","Fn::Base64","Fn::Cidr","Fn::FindInMap","Fn::GetAZs","Fn::ImportValue","Fn::Transform","Condition"]),EI=new Set(["SSEAlgorithm","Algorithm","KeySpec","CustomerMasterKeySpec","Protocol","Scheme","HttpMethod","AuthorizationType","Type","SslPolicy","SecurityPolicy","MinimumProtocolVersion","Runtime","Engine","EngineVersion","Handler","PackageType","Effect","Action","Principal","Resource","Condition","LogLevel","MetricsLevel","Status","State","Enabled","IpProtocol","CidrIp","CidrIpv6","FromPort","ToPort","Version","SchemaVersion"]),RI=e=>AI.some(t=>t.test(e)),wI=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.keys(e);return t.length===1&&FI.has(t[0])},go=(e,t,s=0)=>{if(s>50)return"[DEEP_NESTED]";if(e==null||typeof e=="boolean"||typeof e=="number")return e;if(typeof e=="string")return e===""?"":t&&EI.has(t)||RI(e)?e:e.length>100?"[REDACTED_LONG_STRING]":"[REDACTED]";if(Array.isArray(e))return e.map(n=>go(n,void 0,s+1));if(typeof e=="object"){if(wI(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=go(i,r,s+1);return n}return"[REDACTED]"},lu=e=>{let t={Type:e.Type};return e.Properties&&(t.Properties=go(e.Properties,void 0,0)),e.Metadata&&(t.Metadata=go(e.Metadata,void 0,0)),e.DependsOn&&(t.DependsOn=e.DependsOn),e.Condition&&(t.Condition=e.Condition),e.DeletionPolicy&&(t.DeletionPolicy=e.DeletionPolicy),e.UpdateReplacePolicy&&(t.UpdateReplacePolicy=e.UpdateReplacePolicy),t};var II=e=>{let t=JSON.stringify(e,Object.keys(e).sort());return $D.createHash("sha256").update(t).digest("hex").slice(0,32)},jD=(e,t)=>({Authorization:`Bearer ${e}`,"Content-Type":"application/json","x-cdk-insights-fingerprint":t,"x-cdk-insights-client":"cli"}),UD=(e,t)=>async(s,n,r,i,o,a,c,u,l)=>{let m=T=>new Promise(k=>setTimeout(k,T)),g,h=Date.now(),b=async()=>{let T=lu(r),k=II(T),C={stackName:s,resourceId:n,resource:T,resourceType:i,resourceContentHash:k};l&&(C.context=l);let{data:$}=await e.post(`${t}/analyze`,C,{headers:jD(o,a)});if(!$?.jobId)throw new Error(`No jobId returned from analysis API for resource ${n}`);return $.jobId};try{g=await b(),u&&u.startJob(g,n),pe.info(`Started analysis job ${g} for resource ${n} (${i})`)}catch(T){let{message:k}=T,C=zt.isAxiosError(T)&&T.response?.status===403;throw Q.error(`Failed to start analysis for resource ${n}:`,{error:T}),C?new Error(`Authentication failed (403) for resource ${n}. Your auth token may be invalid or expired. Try running 'npx cdk-insights clear-cache' to refresh your authentication.`):new Error(`Failed to start analysis for resource ${n}: ${k||T}`)}let y=1e3,S=0,D=Date.now();for(let T=1;T<=30;T++){try{let k=Date.now()-h;pe.info(`Polling job ${g} for resource ${n} on attempt ${T}/30 (interval: ${y}ms, total elapsed: ${k}ms)`),u&&u.updateJobStatus(g,n,"polling",T);let C=await e.get(`${t}/analyze/${g}`,{headers:jD(o,a)});pe.info(`API Response for job ${g}: status=${C.data.status}, hasResult=${!!C.data.result}, resultType=${typeof C.data.result}`);let{status:$,result:K,error:J}=C.data;if($==="completed"){if(!K)throw pe.error(`Job ${g} completed without result payload. Raw response: ${JSON.stringify(C.data)}`),new Error(`Job ${g} completed without result payload`);u&&u.completeJob(g,n);let Z=Date.now()-D,O=Date.now()-h;return pe.info(`Job ${g} completed successfully in ${Z}ms (attempt ${T}, total time: ${O}ms)`),K}if($==="failed"){u&&u.failJob(g,n,"Job failed");let Z=Date.now()-h,O=J||"Unknown error";throw pe.error(`Job ${g} failed after ${Z}ms (attempt ${T}): ${O}`),new Error(`Analysis job ${g} failed for resource ${n}: ${O}`)}let V=Date.now()-D;if(V>5e3){let Z=Math.min(y*1.5,3e3),O=Math.random()*500;y=Math.min(Z+O,3e3),S=0,pe.info(`Job ${g} running for ${V}ms, using exponential backoff: ${Math.round(y)}ms`)}else S===0&&(y=1e3);D=Date.now()}catch(k){if(S++,k instanceof Error){if(k.message.startsWith(`Analysis job ${g}`))throw k;Q.error(`Error polling job ${g} for resource ${n} on attempt ${T}:`,{error:k.message})}else if(typeof k=="object"&&k!==null&&"response"in k){let C=k;C.response?.status===404?y=Math.min(y*1.2,3e3):(Q.error(`Error polling job ${g} for resource ${n} on attempt ${T}:`,{error:C}),y=Math.min(y*1.5,3e3))}else Q.error(`Unknown error polling job ${g} for resource ${n} on attempt ${T}:`,{error:k}),y=Math.min(y*1.5,3e3)}await m(y)}u&&u.timeoutJob(g,n);let E=Date.now()-h;throw pe.error(`Job ${g} timed out after ${E}ms (30 attempts, max interval: 3000ms)`),new Error(`Polling timed out after 30 attempts for job ${g} (resource ${n}) - total time: ${E}ms`)};var pu=(e,t)=>e.filter(s=>t.some(n=>s.issue.toLowerCase().includes(n.toLowerCase())||s.wafPillar&&s.wafPillar.toLowerCase()===n.toLowerCase()));var St=H(require("node:fs")),vt=H(require("node:path"));var bt=new Map,du=3e4,GD=500,TI=()=>{if(bt.size<=GD)return;let t=Array.from(bt.entries()).sort((s,n)=>s[1].timestamp-n[1].timestamp).slice(0,bt.size-GD);for(let[s]of t)bt.delete(s)},mu=e=>{let t=bt.get(e);if(t&&Date.now()-t.timestamp<du)return t.content;try{let s=St.readFileSync(e,"utf-8");return TI(),bt.set(e,{content:s,timestamp:Date.now()}),s}catch{return null}},zD=(e,t=process.cwd())=>{try{let s=e.split("/").pop()||"",n=[s.replace(/Resource$/,""),s.replace(/Construct$/,""),s.replace(/Stack$/,""),s.replace(/[A-F0-9]{8,10}$/,""),s.replace(/[A-F0-9]{8}$/,""),s.replace(/[A-F0-9]{10}$/,""),s].filter(i=>i.length>2),r=[vt.join(t,"src"),vt.join(t,"lib"),vt.join(t,"cdk"),t];for(let i of r){if(!St.existsSync(i))continue;let o=fu(i);for(let a of o){let c=mu(a);if(c){for(let u of n)if(u&&u.length>2){let l=[new RegExp(`new\\s+(\\w+)\\s*\\(\\s*this\\s*,\\s*['"]${u}['"]`,"g"),new RegExp(`new\\s+(\\w+)\\s*\\(\\s*this\\s*,\\s*["']${u}["']`,"g"),new RegExp(`new\\s+(\\w+)\\s*\\(\\s*this\\s*,\\s*\`${u}\``,"g"),new RegExp(`new\\s+(\\w+)\\s*\\(\\s*this\\s*,\\s*${u}\\b`,"g"),new RegExp(`(\\w+)\\s*\\(\\s*this\\s*,\\s*['"]${u}['"]`,"g")];for(let p of l){let d=c.match(p);if(d){let f=c.split(`
206
+ `);for(let m=0;m<f.length;m++){let g=f[m];if(g.includes("this")&&p.test(g)){let h=d[1]||"Unknown";return{filePath:vt.relative(t,a),line:m+1,column:g.indexOf("new")+1,constructType:h}}}}}}}}}}catch{}return null},fu=e=>{let t=[],s=`ts_files_${e}`,n=bt.get(s);if(n&&Date.now()-n.timestamp<du)try{return JSON.parse(n.content)}catch{bt.delete(s)}try{let r=St.readdirSync(e);for(let i of r){let o=vt.join(e,i),a=St.statSync(o);a.isDirectory()&&!i.startsWith(".")&&i!=="node_modules"&&i!=="dist"&&i!=="build"&&i!==".git"?t.push(...fu(o)):a.isFile()&&i.endsWith(".ts")&&!i.endsWith(".d.ts")&&t.push(o)}bt.set(s,{content:JSON.stringify(t),timestamp:Date.now()})}catch{}return t},kI=e=>{let t=[],s=`stack_files_${e}`,n=bt.get(s);if(n&&Date.now()-n.timestamp<du)try{return JSON.parse(n.content)}catch{bt.delete(s)}try{let r=St.readdirSync(e);for(let i of r){let o=vt.join(e,i),a=St.statSync(o);if(a.isDirectory()&&!i.startsWith(".")&&i!=="node_modules"&&i!=="dist")(i==="cdk"||i==="lib"||i==="src")&&t.push(...fu(o));else if(a.isFile()&&i.endsWith(".ts")&&!i.endsWith(".d.ts")){let c=mu(o);c?.includes("Stack")&&c.includes("extends")&&t.push(o)}}bt.set(s,{content:JSON.stringify(t),timestamp:Date.now()})}catch{}return t};var qD=(e,t)=>{let s=Array.isArray(e)?e.map(String):typeof e=="string"?[e]:[],n=null;for(let r of s){if(r.includes("/dist/")||r.includes("\\dist\\")||r.includes("/node_modules/")||r.includes("\\node_modules\\"))continue;let i=[/(\/.*?\.ts):(\d+):(\d+)/,/at (.*?\.ts):(\d+):(\d+)/,/\((.*?\.ts):(\d+):(\d+)\)/,/(\/.*?\.tsx):(\d+):(\d+)/,/at (.*?\.tsx):(\d+):(\d+)/,/\((.*?\.tsx):(\d+):(\d+)\)/,/(\/.*?\.js):(\d+):(\d+)/,/at (.*?\.js):(\d+):(\d+)/,/\((.*?\.js):(\d+):(\d+)\)/];for(let o of i){let a=r.match(o);if(a){let[,c,u,l]=a,p=c.split(".").pop()?.toLowerCase()??"";if(p==="ts"||p==="tsx")return{filePath:c.startsWith("/")?c:`./${c}`,line:Number(u),column:Number(l)};p==="js"&&!n&&(n={filePath:c.startsWith("/")?c:`./${c}`,line:Number(u),column:Number(l)})}}}return n},VD=(e,t,s=process.cwd())=>{try{if(e&&typeof e=="object"&&"artifacts"in e){let c=e,u=t,l={};for(let f of Object.values(c.artifacts??{}))if(f.metadata)for(let[m,g]of Object.entries(f.metadata))l[m]=g;let p=Object.entries(l).filter(([,f])=>f.some(m=>m.type==="aws:cdk:logicalId"&&m.data===u));for(let[f,m]of p){let g=m.find(S=>S.type==="aws:cdk:info"&&typeof S.data=="string"&&S.data.startsWith("cdk-insights::"));if(g)try{let S=JSON.parse(g.data.replace("cdk-insights::",""));if(S.sourceLocation)return{filePath:S.sourceLocation.filePath,line:S.sourceLocation.line||1,column:S.sourceLocation.column||1,constructPath:f,stackName:f.split("/")[0]||"",logicalId:u,confidence:"high"}}catch{}let h=m.find(S=>S.type==="aws:cdk:cloudformation:stack-trace"),b=m.find(S=>S.type==="aws:cdk:logicalId"&&S.data===u),y=h?.data??b?.trace;if(y){let S=qD(y,f);if(S?.filePath){let D=vt.resolve(s,S.filePath);if(St.existsSync(D))return{...S,line:S.line??1,column:S.column??1,constructPath:f,stackName:f.split("/")[0]||"",logicalId:u,confidence:"high"}}}}for(let[f]of p){let m=zD(f,s);if(m)return{...m,line:m.line??1,column:m.column??1,constructPath:f,stackName:f.split("/")[0]||"",logicalId:u,confidence:"medium"}}let d=p[0]?.[0]||u;return HD(d,u,s)}let r=e,i=t,o=qD(r,i);if(o?.filePath){let c=vt.resolve(s,o.filePath);if(St.existsSync(c))return{...o,line:o.line??1,column:o.column??1,constructPath:i,confidence:"high"}}let a=zD(i,s);return a?{...a,line:a.line??1,column:a.column??1,constructPath:i,confidence:"medium"}:HD(i,i,s)}catch{return{filePath:t,line:1,column:1,constructPath:t,confidence:"low"}}},HD=(e,t,s)=>{let n=e.split("/").pop()||"",r=e.split("/")[0]||"",i=kI(s);for(let o of i)try{let a=mu(o);if(!a)continue;let c=a.split(`
207
207
  `);for(let u=0;u<c.length;u++){let l=c[u];if(l.includes("new")&&l.includes("this")&&(l.includes(n)||l.includes(r)))return{filePath:vt.relative(s,o),line:u+1,column:l.indexOf("new")+1,constructPath:e,stackName:r,logicalId:t,confidence:"low"}}}catch{}return{filePath:e,line:1,column:1,constructPath:e,stackName:r,logicalId:t,confidence:"low"}};var Fu=H(require("node:fs"));var ho=e=>{switch(e.toUpperCase()){case"CRITICAL":return"\u{1F534}";case"HIGH":return"\u{1F7E0}";case"MEDIUM":return"\u{1F7E1}";case"LOW":return"\u{1F7E2}";default:return"\u26AA"}},Pr=(e,t)=>{Q.info(`
208
208
  \u{1F4DD} Analysis Summary for stack: ${e}`),Q.info(`Total Resources Scanned: ${t.totalResources}`),Q.info(`Resources with Issues: ${t.resourcesWithIssues} (${t.percentWithIssues}%)`),Q.info(`Total Issues Found: ${t.totalIssues}
209
209
  `),Q.info("Severity Breakdown:"),Q.info(` ${ho("CRITICAL")} Critical: ${t.severityCounts.CRITICAL}`),Q.info(` ${ho("HIGH")} High: ${t.severityCounts.HIGH}`),Q.info(` ${ho("MEDIUM")} Medium: ${t.severityCounts.MEDIUM}`),Q.info(` ${ho("LOW")} Low: ${t.severityCounts.LOW}
@@ -239,7 +239,7 @@ ${o}`)};var ND=require("node:child_process"),WD=()=>{try{return(0,ND.execFileSyn
239
239
  `,i},xT=e=>{let t=process.env.GITHUB_STEP_SUMMARY;if(!t)return!1;try{return Au.appendFileSync(t,e),!0}catch(s){return console.error("Failed to write GitHub step summary:",s),!1}},Co=(e,t,s,n)=>{let r=ST(e,t);for(let a of r)console.log(a);let i=CT(e,t,s,n);if(xT(i)||(console.log(`
240
240
  --- Job Summary ---`),console.log(i)),process.env.GITHUB_OUTPUT)try{let a=process.env.GITHUB_OUTPUT,c=[`total_issues=${Object.values(s).reduce((u,l)=>u+l,0)}`,`critical_issues=${s.CRITICAL}`,`high_issues=${s.HIGH}`,`has_critical=${s.CRITICAL>0}`];Au.appendFileSync(a,`${c.join(`
241
241
  `)}
242
- `)}catch(a){console.error("Failed to write GitHub outputs:",a)}};var qb=(e,t,s,n,r)=>{switch(Q.info(`Generating output in format: ${e}`),e){case"markdown":{let i=jn(t,s,r,n),o=`${t}_analysis_report.md`;try{Fu.writeFileSync(o,i),Q.info(`\u{1F4C4} Saved Markdown report to ${o}`)}catch(a){let c=a instanceof Error?a.message:String(a);throw Q.error(`\u274C Failed to write Markdown report to ${o}: ${c}`),new Error(`Failed to write Markdown report: ${c}`)}break}case"table":{Wr(s);break}case"json":Ub(t,r,s),Q.info(`\u{1F4C4} JSON report written to: ${t}_analysis_report.json`);break;case"sarif":{let i=So(t,s),o=`${t}_analysis_report.sarif`;try{Fu.writeFileSync(o,JSON.stringify(i,null,2)),Q.info(`\u{1F4C4} SARIF report written to: ${o}`),console.log(JSON.stringify(i,null,2))}catch(a){let c=a instanceof Error?a.message:String(a);throw Q.error(`\u274C Failed to write SARIF report to ${o}: ${c}`),new Error(`Failed to write SARIF report: ${c}`)}break}case"github-actions":{Co(t,s,r.severityCounts,r.totalResources);break}default:Pr(t,r);break}};var xo=(e,t,s)=>{let n=0,r=0,i={CRITICAL:0,HIGH:0,MEDIUM:0,LOW:0},o={"Operational Excellence":0,Security:0,"Cost Optimization":0,Reliability:0,"Performance Efficiency":0,Sustainability:0};for(let u in e){let l=[...e[u].sources.cdkInsights?.issues??[],...e[u].sources.cdkNag?.issues??[]],p=!s||s.has(u);l.length>0&&p&&r++,n+=l.length;for(let d of l)i[d.severity]+=1,o[d.wafPillar]+=1}let a=t,c=a>0?Number.parseFloat((r/a*100).toFixed(1)):0;return{totalResources:a,resourcesWithIssues:r,percentWithIssues:c,totalIssues:n,severityCounts:i,wafIssues:o,generatedBy:"cdk-insights",generatedAt:new Date().toISOString()}};var Hb=H(require("node:crypto")),Vb=e=>Hb.createHash("sha256").update(JSON.stringify(e)).digest("hex");var Ao=H(require("node:fs")),Kb=H(require("node:path")),Zb=e=>{let t=Kb.join(e,"manifest.json");if(!Ao.existsSync(t))return{};try{return JSON.parse(Ao.readFileSync(t,"utf-8"))}catch{return{}}};var AT=[/depends\s*on.*(?:not\s*(?:be\s*)?available|may\s*not\s*exist|circular)/i,/dependson.*relationship/i,/resource.*depends.*another.*resource/i,/dependency.*(?:not\s*)?(?:be\s*)?ready/i,/lacks?\s*(?:meaningful\s*)?tags?(?:\s*for)?/i,/missing.*tags?.*(?:metadata|identification)/i,/no\s*tags?\s*(?:defined|configured|specified)/i,/does\s*not\s*have\s*any\s*tags/i,/tags?.*(?:auditing|cost\s*allocation|management)/i,/\[redacted\].*(?:incomplete|invalid|malformed|missing)/i,/incomplete.*\[redacted\]/i,/placeholder.*value/i,/missing.*closing.*brace/i,/replac(?:e|ing).*\[redacted\]/i,/\[redacted\].*(?:should|could|must)\s*be/i,/trust.*policy.*any.*service.*\[redacted\]/i,/any.*service.*within.*account.*\[redacted\]/i,/cdk.*metadata.*exposed/i,/metadata.*cdk.*path/i,/nat\s*gateway.*(?:move|associated).*(?:private\s*subnet|public\s*subnet.*risk)/i,/move.*nat\s*gateway.*private/i,/eip.*not\s*associated.*(?:instance|resource)/i,/elastic\s*ip.*not.*(?:associated|utilized|being\s*used)/i,/userdata\s*(?:script\s*)?is\s*empty/i,/empty.*userdata/i,/routetable.*(?:tags?|metadata)/i,/iam.*(?:policy|role).*(?:grants?|has).*(?:sts:assumerole|administratoraccess).*(?:overly\s*)?permissive/i,/inline\s*policy\s*grants?\s*unrestricted\s*access\s*to\s*all/i,/subnet.*mappubliciponlaunch.*(?:true|set)/i,/mappubliciponlaunch.*(?:expose|public\s*ip|internet)/i,/instances.*launched.*subnet.*public\s*ip/i],FT=[/tags?/i,/naming\s*convention/i,/resource\s*name.*not.*descriptive/i,/lacks?\s*description/i,/missing\s*description/i,/default\s*iam\s*role.*(?:broad|permissive)/i,/security\s*group.*(?:all\s*outbound|all\s*egress|unrestricted\s*egress)/i,/allows?\s*all\s*outbound\s*traffic/i],ET=e=>AT.some(t=>t.test(e)),RT=e=>FT.some(t=>t.test(e)),Yb=(e,t=!1)=>e.filter(s=>{let n=s.issue||"";return!(ET(n)||t&&RT(n))});var Jb=({staticRecommendations:e,aiRecommendations:t,recommendationMap:s,ruleFilter:n,filterIssuesByRule:r,_displayNameMap:i={}})=>{let o={...s};for(let[p,{issues:d}]of Object.entries(e))o[p]&&(o[p].sources||(o[p].sources={cdkInsights:{issues:[]},cdkNag:{issues:[]}}),o[p].sources.cdkInsights||(o[p].sources.cdkInsights={issues:[]}),o[p].sources.cdkInsights.issues.push(...d));let a=0,c=0,u=0,l=0;for(let[p,d]of Object.entries(t)){if(!d||!Array.isArray(d.issues)){Q.warn(`\u26A0\uFE0F No AI issues for resource '${p}', skipping.`);continue}let f=p;if(!o[f]){Q.warn(`\u26A0\uFE0F AI recommendations for unknown resource '${f}', skipping enrichment.`);continue}let m=o[f],g=n.length>0?r(d.issues,n):d.issues,y=Yb(g,m.isGenerated).map(A=>{switch(A.severity||(Q.debug(`AI recommendation missing severity for resource '${f}', defaulting to MEDIUM`),A.severity="MEDIUM"),A.severity.toUpperCase()){case"CRITICAL":a++;break;case"HIGH":c++;break;case"MEDIUM":u++;break;case"LOW":l++;break;default:Q.warn(`\u26A0\uFE0F Unknown severity '${A.severity}' for resource '${f}', defaulting to MEDIUM`),A.severity="MEDIUM",u++;break}return{resourceName:A.resourceName||m.resourceName,resourceId:f,friendlyName:m.friendlyName,displayName:m.displayName,locationHint:A.locationHint||m.locationHint,constructPath:m.cdkPath,githubUrl:m.githubUrl,docUrl:m.docUrl,issue:A.issue||"AI analysis issue",recommendation:A.recommendation||"No specific recommendation provided",severity:A.severity,wafPillar:(()=>{if(A.wafPillar)switch(A.wafPillar.toLowerCase().trim()){case"security":return"Security";case"operational excellence":return"Operational Excellence";case"cost optimization":return"Cost Optimization";case"reliability":return"Reliability";case"performance efficiency":return"Performance Efficiency";case"sustainability":return"Sustainability";default:return"Security"}return"Security"})(),codeSnippet:A.codeSnippet||"",foundBy:A.foundBy??"cdkInsights"}}),D=eo(y,m.cdkPath);m.sources||(m.sources={cdkInsights:{issues:[]},cdkNag:{issues:[]}}),m.sources.cdkInsights||(m.sources.cdkInsights={issues:[]}),m.sources.cdkInsights.issues.push(...D)}return{updatedMap:o,criticalCount:a,highCount:c,mediumCount:u,lowCount:l}};var Qb=e=>{if(!e||e.length===0)return 0;let t=e.length,s=new Map;for(let r of e)s.set(r,(s.get(r)||0)+1);let n=0;for(let r of s.values()){let i=r/t;n-=i*Math.log2(i)}return n},Eu=(e,t=!1)=>{if(e.length<16||wT(e)||Qb(e)<(t?4:4.5))return!1;let r=/[A-Z]/.test(e),i=/[a-z]/.test(e),o=/[0-9]/.test(e),a=/[^A-Za-z0-9]/.test(e),c=[r,i,o,a].filter(Boolean).length;return t?c>=1:c>=2},wT=e=>{if(/^https?:\/\//i.test(e)||/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^arn:aws[a-z-]*:[a-z0-9-]+:[a-z0-9-]*:\d*:/.test(e)||/^(\/|\.\/|\.\.\/|[A-Za-z]:\\)/.test(e)||/^s3:\/\/[a-z0-9.-]+\//.test(e))return!0;if(/^[A-Za-z0-9+/]{4,}={0,2}$/.test(e)){let t=new Set(e).size;if(e.length>50&&t<10)return!0}return!!IT(e)},IT=e=>{let t=e.length;for(let s=1;s<=t/2;s++)if(e.slice(0,s).repeat(Math.ceil(t/s)).slice(0,t)===e)return!0;return!1};var TT=[/api[_-]?key/i,/secret[_-]?key/i,/^password$/i,/^passwd$/i,/credential/i,/private[_-]?key/i,/access[_-]?key/i,/auth[_-]?token/i,/bearer[_-]?token/i,/refresh[_-]?token/i,/client[_-]?secret/i,/app[_-]?secret/i,/secret[_-]?value/i,/aws[_-]?secret/i,/aws[_-]?access[_-]?key/i,/aws[_-]?session[_-]?token/i,/db[_-]?password/i,/database[_-]?password/i,/master[_-]?password/i,/master[_-]?user[_-]?password/i,/admin[_-]?password/i,/root[_-]?password/i,/connection[_-]?string/i,/stripe[_-]?key/i,/stripe[_-]?secret/i,/github[_-]?token/i,/gitlab[_-]?token/i,/slack[_-]?token/i,/slack[_-]?webhook/i,/discord[_-]?token/i,/twilio[_-]?token/i,/sendgrid[_-]?key/i,/mailgun[_-]?key/i,/datadog[_-]?key/i,/new[_-]?relic[_-]?key/i,/sentry[_-]?dsn/i,/webhook[_-]?secret/i,/signing[_-]?key/i,/signing[_-]?secret/i,/encryption[_-]?key/i,/jwt[_-]?secret/i,/hmac[_-]?key/i,/ssh[_-]?key/i,/ssh[_-]?private/i,/pem[_-]?key/i,/rsa[_-]?key/i],kT=[/^A[BGIK-Z][A-Z]{2}[0-9A-Z]{16}$/,/^[A-Za-z0-9/+=]{40}$/,/-----BEGIN (RSA |EC |DSA |OPENSSH |ENCRYPTED )?PRIVATE KEY-----/,/-----BEGIN PGP PRIVATE KEY BLOCK-----/,/^eyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/,/^gh[pousr]_[A-Za-z0-9]{36,}$/,/^[srp]k_(live|test)_[A-Za-z0-9]{24,}$/,/^xox[bpas]-[A-Za-z0-9-]+$/,/^SK[a-f0-9]{32}$/i,/^SG\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/],_T=[/\{\{resolve:secretsmanager:/,/{{resolve:secretsmanager:/,/\{\{resolve:ssm:/,/{{resolve:ssm:/,/\{\{resolve:ssm-secure:/,/{{resolve:ssm-secure:/,/!Ref\s+\w+/,/!GetAtt\s+[\w.]+/,/!Sub\s+/,/\$\{[\w:.]+\}/,/\$\{Token\[/,/\[\[token:/i,/\${Token\[TOKEN\.\d+\]\}/,/^arn:aws[a-z-]*:[a-z0-9-]+:[a-z0-9-]*:\d*:/],LT=[/^<[^>]+>$/,/^CHANGE[_-]?ME$/i,/^REPLACE[_-]?ME$/i,/^TODO$/i,/^TODO:/i,/^FIXME$/i,/^XXX$/i,/^YOUR[_-]/i,/^INSERT[_-]/i,/^ENTER[_-]/i,/^\*+$/,/^x+$/i,/^\s*$/,/^default$/i,/^example$/i,/^sample$/i,/^test$/i,/^demo$/i,/^dummy$/i,/^fake$/i,/^mock$/i,/^placeholder$/i],Ru=e=>TT.some(t=>t.test(e)),wu=e=>kT.some(t=>t.test(e)),Iu=e=>_T.some(t=>t.test(e)),Tu=e=>LT.some(t=>t.test(e)),Fo=e=>{if(typeof e!="object"||e===null)return!1;let t=["Ref","Fn::GetAtt","Fn::Sub","Fn::Join","Fn::ImportValue","Fn::If","Fn::Select","Fn::Split","Fn::Base64","Fn::Cidr","Fn::FindInMap","Fn::GetAZs","Fn::Transform"],s=Object.keys(e);return s.length===1&&t.includes(s[0])},ku=e=>{let t=[{patterns:[/api[_-]?key/i,/access[_-]?key/i],category:"api_key"},{patterns:[/password/i,/passwd/i],category:"password"},{patterns:[/private[_-]?key/i,/ssh[_-]?key/i,/pem[_-]?key/i,/rsa[_-]?key/i],category:"private_key"},{patterns:[/aws[_-]?secret/i,/aws[_-]?access/i],category:"aws_credentials"},{patterns:[/token/i,/bearer/i],category:"token"},{patterns:[/secret/i,/credential/i],category:"secret"},{patterns:[/connection[_-]?string/i,/database/i,/db[_-]/i],category:"database"},{patterns:[/webhook/i,/signing/i,/encryption/i,/hmac/i,/jwt/i],category:"encryption_key"}];for(let{patterns:s,category:n}of t)if(s.some(r=>r.test(e)))return n;return"secret"};var jr=e=>{let t={api_key:`Use AWS Secrets Manager to store API keys securely:
242
+ `)}catch(a){console.error("Failed to write GitHub outputs:",a)}};var qb=(e,t,s,n,r)=>{switch(Q.info(`Generating output in format: ${e}`),e){case"markdown":{let i=jn(t,s,r,n),o=`${t}_analysis_report.md`;try{Fu.writeFileSync(o,i),Q.info(`\u{1F4C4} Saved Markdown report to ${o}`)}catch(a){let c=a instanceof Error?a.message:String(a);throw Q.error(`\u274C Failed to write Markdown report to ${o}: ${c}`),new Error(`Failed to write Markdown report: ${c}`)}break}case"table":{Wr(s);break}case"json":Ub(t,r,s),Q.info(`\u{1F4C4} JSON report written to: ${t}_analysis_report.json`);break;case"sarif":{let i=So(t,s),o=`${t}_analysis_report.sarif`;try{Fu.writeFileSync(o,JSON.stringify(i,null,2)),Q.info(`\u{1F4C4} SARIF report written to: ${o}`),console.log(JSON.stringify(i,null,2))}catch(a){let c=a instanceof Error?a.message:String(a);throw Q.error(`\u274C Failed to write SARIF report to ${o}: ${c}`),new Error(`Failed to write SARIF report: ${c}`)}break}case"github-actions":{Co(t,s,r.severityCounts,r.totalResources);break}default:Pr(t,r);break}};var xo=(e,t,s)=>{let n=0,r=0,i={CRITICAL:0,HIGH:0,MEDIUM:0,LOW:0},o={"Operational Excellence":0,Security:0,"Cost Optimization":0,Reliability:0,"Performance Efficiency":0,Sustainability:0};for(let u in e){let l=[...e[u].sources.cdkInsights?.issues??[],...e[u].sources.cdkNag?.issues??[]],p=!s||s.has(u);l.length>0&&p&&r++,n+=l.length;for(let d of l)i[d.severity]+=1,o[d.wafPillar]+=1}let a=t,c=a>0?Number.parseFloat((r/a*100).toFixed(1)):0;return{totalResources:a,resourcesWithIssues:r,percentWithIssues:c,totalIssues:n,severityCounts:i,wafIssues:o,generatedBy:"cdk-insights",generatedAt:new Date().toISOString()}};var Hb=H(require("node:crypto")),Vb=e=>Hb.createHash("sha256").update(JSON.stringify(e)).digest("hex");var Ao=H(require("node:fs")),Kb=H(require("node:path")),Zb=e=>{let t=Kb.join(e,"manifest.json");if(!Ao.existsSync(t))return{};try{return JSON.parse(Ao.readFileSync(t,"utf-8"))}catch{return{}}};var AT=[/depends\s*on.*(?:not\s*(?:be\s*)?available|may\s*not\s*exist|circular)/i,/dependson.*relationship/i,/resource.*depends.*another.*resource/i,/dependency.*(?:not\s*)?(?:be\s*)?ready/i,/lacks?\s*(?:meaningful\s*)?tags?(?:\s*for)?/i,/missing.*tags?.*(?:metadata|identification)/i,/no\s*tags?\s*(?:defined|configured|specified)/i,/does\s*not\s*have\s*any\s*tags/i,/tags?.*(?:auditing|cost\s*allocation|management)/i,/\[redacted\].*(?:incomplete|invalid|malformed|missing)/i,/incomplete.*\[redacted\]/i,/placeholder.*value/i,/missing.*closing.*brace/i,/replac(?:e|ing).*\[redacted\]/i,/\[redacted\].*(?:should|could|must)\s*be/i,/trust.*policy.*any.*service.*\[redacted\]/i,/any.*service.*within.*account.*\[redacted\]/i,/cdk.*metadata.*exposed/i,/metadata.*cdk.*path/i,/nat\s*gateway.*(?:move|associated).*(?:private\s*subnet|public\s*subnet.*risk)/i,/move.*nat\s*gateway.*private/i,/eip.*not\s*associated.*(?:instance|resource)/i,/elastic\s*ip.*not.*(?:associated|utilized|being\s*used)/i,/userdata\s*(?:script\s*)?is\s*empty/i,/empty.*userdata/i,/routetable.*(?:tags?|metadata)/i,/iam.*(?:policy|role).*(?:grants?|has).*(?:sts:assumerole|administratoraccess).*(?:overly\s*)?permissive/i,/inline\s*policy\s*grants?\s*unrestricted\s*access\s*to\s*all/i,/subnet.*mappubliciponlaunch.*(?:true|set)/i,/mappubliciponlaunch.*(?:expose|public\s*ip|internet)/i,/instances.*launched.*subnet.*public\s*ip/i],FT=[/tags?/i,/naming\s*convention/i,/resource\s*name.*not.*descriptive/i,/lacks?\s*description/i,/missing\s*description/i,/default\s*iam\s*role.*(?:broad|permissive)/i,/security\s*group.*(?:all\s*outbound|all\s*egress|unrestricted\s*egress)/i,/allows?\s*all\s*outbound\s*traffic/i],ET=e=>AT.some(t=>t.test(e)),RT=e=>FT.some(t=>t.test(e)),Yb=(e,t=!1)=>e.filter(s=>{let n=s.issue||"";return!(ET(n)||t&&RT(n))});var Jb=({staticRecommendations:e,aiRecommendations:t,recommendationMap:s,ruleFilter:n,filterIssuesByRule:r,_displayNameMap:i={}})=>{let o={...s};for(let[p,{issues:d}]of Object.entries(e))o[p]&&(o[p].sources||(o[p].sources={cdkInsights:{issues:[]},cdkNag:{issues:[]}}),o[p].sources.cdkInsights||(o[p].sources.cdkInsights={issues:[]}),o[p].sources.cdkInsights.issues.push(...d));let a=0,c=0,u=0,l=0;for(let[p,d]of Object.entries(t)){if(!d||!Array.isArray(d.issues)){Q.warn(`\u26A0\uFE0F No AI issues for resource '${p}', skipping.`);continue}let f=p;if(!o[f]){Q.warn(`\u26A0\uFE0F AI recommendations for unknown resource '${f}', skipping enrichment.`);continue}let m=o[f],g=n.length>0?r(d.issues,n):d.issues,b=Yb(g,m.isGenerated).map(S=>{switch(S.severity||(Q.debug(`AI recommendation missing severity for resource '${f}', defaulting to MEDIUM`),S.severity="MEDIUM"),S.severity.toUpperCase()){case"CRITICAL":a++;break;case"HIGH":c++;break;case"MEDIUM":u++;break;case"LOW":l++;break;default:Q.warn(`\u26A0\uFE0F Unknown severity '${S.severity}' for resource '${f}', defaulting to MEDIUM`),S.severity="MEDIUM",u++;break}return{resourceName:S.resourceName||m.resourceName,resourceId:f,friendlyName:m.friendlyName,displayName:m.displayName,locationHint:S.locationHint||m.locationHint,constructPath:m.cdkPath,githubUrl:m.githubUrl,docUrl:m.docUrl,issue:S.issue||"AI analysis issue",recommendation:S.recommendation||"No specific recommendation provided",severity:S.severity,wafPillar:(()=>{if(S.wafPillar)switch(S.wafPillar.toLowerCase().trim()){case"security":return"Security";case"operational excellence":return"Operational Excellence";case"cost optimization":return"Cost Optimization";case"reliability":return"Reliability";case"performance efficiency":return"Performance Efficiency";case"sustainability":return"Sustainability";default:return"Security"}return"Security"})(),codeSnippet:S.codeSnippet||"",foundBy:S.foundBy??"cdkInsights"}}),y=eo(b,m.cdkPath);m.sources||(m.sources={cdkInsights:{issues:[]},cdkNag:{issues:[]}}),m.sources.cdkInsights||(m.sources.cdkInsights={issues:[]}),m.sources.cdkInsights.issues.push(...y)}return{updatedMap:o,criticalCount:a,highCount:c,mediumCount:u,lowCount:l}};var Qb=e=>{if(!e||e.length===0)return 0;let t=e.length,s=new Map;for(let r of e)s.set(r,(s.get(r)||0)+1);let n=0;for(let r of s.values()){let i=r/t;n-=i*Math.log2(i)}return n},Eu=(e,t=!1)=>{if(e.length<16||wT(e)||Qb(e)<(t?4:4.5))return!1;let r=/[A-Z]/.test(e),i=/[a-z]/.test(e),o=/[0-9]/.test(e),a=/[^A-Za-z0-9]/.test(e),c=[r,i,o,a].filter(Boolean).length;return t?c>=1:c>=2},wT=e=>{if(/^https?:\/\//i.test(e)||/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^arn:aws[a-z-]*:[a-z0-9-]+:[a-z0-9-]*:\d*:/.test(e)||/^(\/|\.\/|\.\.\/|[A-Za-z]:\\)/.test(e)||/^s3:\/\/[a-z0-9.-]+\//.test(e))return!0;if(/^[A-Za-z0-9+/]{4,}={0,2}$/.test(e)){let t=new Set(e).size;if(e.length>50&&t<10)return!0}return!!IT(e)},IT=e=>{let t=e.length;for(let s=1;s<=t/2;s++)if(e.slice(0,s).repeat(Math.ceil(t/s)).slice(0,t)===e)return!0;return!1};var TT=[/api[_-]?key/i,/secret[_-]?key/i,/^password$/i,/^passwd$/i,/credential/i,/private[_-]?key/i,/access[_-]?key/i,/auth[_-]?token/i,/bearer[_-]?token/i,/refresh[_-]?token/i,/client[_-]?secret/i,/app[_-]?secret/i,/secret[_-]?value/i,/aws[_-]?secret/i,/aws[_-]?access[_-]?key/i,/aws[_-]?session[_-]?token/i,/db[_-]?password/i,/database[_-]?password/i,/master[_-]?password/i,/master[_-]?user[_-]?password/i,/admin[_-]?password/i,/root[_-]?password/i,/connection[_-]?string/i,/stripe[_-]?key/i,/stripe[_-]?secret/i,/github[_-]?token/i,/gitlab[_-]?token/i,/slack[_-]?token/i,/slack[_-]?webhook/i,/discord[_-]?token/i,/twilio[_-]?token/i,/sendgrid[_-]?key/i,/mailgun[_-]?key/i,/datadog[_-]?key/i,/new[_-]?relic[_-]?key/i,/sentry[_-]?dsn/i,/webhook[_-]?secret/i,/signing[_-]?key/i,/signing[_-]?secret/i,/encryption[_-]?key/i,/jwt[_-]?secret/i,/hmac[_-]?key/i,/ssh[_-]?key/i,/ssh[_-]?private/i,/pem[_-]?key/i,/rsa[_-]?key/i],kT=[/^A[BGIK-Z][A-Z]{2}[0-9A-Z]{16}$/,/^[A-Za-z0-9/+=]{40}$/,/-----BEGIN (RSA |EC |DSA |OPENSSH |ENCRYPTED )?PRIVATE KEY-----/,/-----BEGIN PGP PRIVATE KEY BLOCK-----/,/^eyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/,/^gh[pousr]_[A-Za-z0-9]{36,}$/,/^[srp]k_(live|test)_[A-Za-z0-9]{24,}$/,/^xox[bpas]-[A-Za-z0-9-]+$/,/^SK[a-f0-9]{32}$/i,/^SG\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/],_T=[/\{\{resolve:secretsmanager:/,/{{resolve:secretsmanager:/,/\{\{resolve:ssm:/,/{{resolve:ssm:/,/\{\{resolve:ssm-secure:/,/{{resolve:ssm-secure:/,/!Ref\s+\w+/,/!GetAtt\s+[\w.]+/,/!Sub\s+/,/\$\{[\w:.]+\}/,/\$\{Token\[/,/\[\[token:/i,/\${Token\[TOKEN\.\d+\]\}/,/^arn:aws[a-z-]*:[a-z0-9-]+:[a-z0-9-]*:\d*:/],LT=[/^<[^>]+>$/,/^CHANGE[_-]?ME$/i,/^REPLACE[_-]?ME$/i,/^TODO$/i,/^TODO:/i,/^FIXME$/i,/^XXX$/i,/^YOUR[_-]/i,/^INSERT[_-]/i,/^ENTER[_-]/i,/^\*+$/,/^x+$/i,/^\s*$/,/^default$/i,/^example$/i,/^sample$/i,/^test$/i,/^demo$/i,/^dummy$/i,/^fake$/i,/^mock$/i,/^placeholder$/i],Ru=e=>TT.some(t=>t.test(e)),wu=e=>kT.some(t=>t.test(e)),Iu=e=>_T.some(t=>t.test(e)),Tu=e=>LT.some(t=>t.test(e)),Fo=e=>{if(typeof e!="object"||e===null)return!1;let t=["Ref","Fn::GetAtt","Fn::Sub","Fn::Join","Fn::ImportValue","Fn::If","Fn::Select","Fn::Split","Fn::Base64","Fn::Cidr","Fn::FindInMap","Fn::GetAZs","Fn::Transform"],s=Object.keys(e);return s.length===1&&t.includes(s[0])},ku=e=>{let t=[{patterns:[/api[_-]?key/i,/access[_-]?key/i],category:"api_key"},{patterns:[/password/i,/passwd/i],category:"password"},{patterns:[/private[_-]?key/i,/ssh[_-]?key/i,/pem[_-]?key/i,/rsa[_-]?key/i],category:"private_key"},{patterns:[/aws[_-]?secret/i,/aws[_-]?access/i],category:"aws_credentials"},{patterns:[/token/i,/bearer/i],category:"token"},{patterns:[/secret/i,/credential/i],category:"secret"},{patterns:[/connection[_-]?string/i,/database/i,/db[_-]/i],category:"database"},{patterns:[/webhook/i,/signing/i,/encryption/i,/hmac/i,/jwt/i],category:"encryption_key"}];for(let{patterns:s,category:n}of t)if(s.some(r=>r.test(e)))return n;return"secret"};var jr=e=>{let t={api_key:`Use AWS Secrets Manager to store API keys securely:
243
243
 
244
244
  // CDK TypeScript example:
245
245
  import { Secret } from 'aws-cdk-lib/aws-secretsmanager';
@@ -394,14 +394,14 @@ ${o}`)};var ND=require("node:child_process"),WD=()=>{try{return(0,ND.execFileSyn
394
394
  );
395
395
 
396
396
  See: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html`};return t[e]||t.secret||`Use AWS Secrets Manager or SSM Parameter Store to securely manage this value.
397
- See: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html`};var $r=(e,t)=>{switch(e){case"property_name":return t?`Property name "${t}" suggests this contains sensitive data`:"Property name suggests sensitive data";case"value_pattern":return"Value matches a known secret pattern (API key, token, or credential format)";case"high_entropy":return"Value has high entropy (appears random), which is characteristic of secrets";default:return"Value appears to contain sensitive data"}};var Gn={SEVERITY:"CRITICAL",WAF_PILLAR:"Security",RULE_ID_PREFIX:"CDK-INSIGHTS-SENSITIVE",FOUND_BY:"cdkInsights"};var Xb=(e,t,s={})=>{let n=[];return s.disabled?{hasSensitiveData:!1,resourceId:t,resourceType:e.Type,findings:[]}:(e.Properties&&Eo(e.Properties,"",n,s),{hasSensitiveData:n.length>0,resourceId:t,resourceType:e.Type,findings:n})},OT=new Set(["Tags"]),BT=e=>{if(!Array.isArray(e)||e.length===0)return!1;let t=e[0];return typeof t=="object"&&t!==null&&"Key"in t&&"Value"in t},Eo=(e,t,s,n)=>{if(e!=null){if(typeof e=="string"){MT(e,t,s,n);return}if(Array.isArray(e)){if(BT(e))return;e.forEach((r,i)=>{Eo(r,`${t}[${i}]`,s,n)});return}if(typeof e=="object"){if(Fo(e))return;for(let[r,i]of Object.entries(e)){let o=t?`${t}.${r}`:r;if(!(OT.has(r)&&(Array.isArray(i)||typeof i=="object"))&&!n.ignoreProperties?.includes(o)){if(Ru(r)){if(typeof i=="string"){if(!ev(i,n)){let a=ku(r)||"secret";s.push({propertyPath:o,propertyName:r,detectionReason:"property_name",detectionReasonMessage:$r("property_name",r),recommendation:jr(a)})}}else Fo(i)||Eo(i,o,s,n);continue}Eo(i,o,s,n)}}}}},MT=(e,t,s,n)=>{if(!ev(e,n)){if(wu(e)){let r=t.split(".").pop()??t;s.push({propertyPath:t,propertyName:r,detectionReason:"value_pattern",detectionReasonMessage:$r("value_pattern"),recommendation:jr("secret")});return}if(Eu(e,n.strictMode)){let r=t.split(".").pop()??t;s.push({propertyPath:t,propertyName:r,detectionReason:"high_entropy",detectionReasonMessage:$r("high_entropy"),recommendation:jr("secret")})}}},ev=(e,t)=>!!(!e||e.trim()===""||Iu(e)||Tu(e)||t.allowPatterns?.some(s=>e.includes(s)));var _u=(e,t)=>{let s=e.findings.map(r=>`"${r.propertyName}" at ${r.propertyPath}`).join(", "),n=e.findings.length;return{resourceId:e.resourceId,issue:n===1?`Sensitive data detected: ${s}. This resource was NOT sent to CDK Insights servers.`:`Sensitive data detected in ${n} properties: ${s}. This resource was NOT sent to CDK Insights servers.`,recommendation:"Use AWS Secrets Manager or SSM Parameter Store to securely manage sensitive values. See: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html",severity:Gn.SEVERITY,wafPillar:Gn.WAF_PILLAR,foundBy:Gn.FOUND_BY,constructPath:e.resourceId,constructType:e.resourceType,stackName:t,ruleId:Gn.RULE_ID_PREFIX,context:{property:e.findings.map(r=>r.propertyPath).join(", "),value:"[REDACTED]",expected:"AWS Secrets Manager or SSM Parameter Store reference"}}},Lu=(e,t={})=>{let s=[],n=[],r=0;for(let[i,o]of Object.entries(e)){let a=Xb(o,i,t);s.push(a),a.hasSensitiveData&&(n.push(i),r+=a.findings.length)}return{totalResourcesScanned:Object.keys(e).length,resourcesWithSensitiveData:n.length,totalFindings:r,hasSkippedResources:n.length>0,skippedResourceIds:n,detectionResults:s}};var tv=e=>{if(!e)return;let t=e.trim();if(t)return t.replace(/\/+$/,"")},sv=e=>{let t=tv(e);return t||(tv("https://api.cdkinsights.dev/analysis/v1")??"")};var es=require("aws-cdk-lib"),Gr=require("cdk-nag"),_t=H(require("node:fs")),lt=H(require("node:path"));var Bu="2.2.0",Mu="cdk-insights::",Nu=()=>process.env.CDK_DEBUG==="true"||(process.env.CDK_CONTEXT_JSON?.includes('"@aws-cdk/core:stackTrace":true')??!1)||(process.env.CDK_CONTEXT_JSON?.includes('"@aws-cdk/core:stackTrace": true')??!1),Pu=!1,NT=()=>{Pu||(Nu()||_e.info("\u{1F4A1} Tip: Set CDK_DEBUG=true for more accurate source location detection. Run: CDK_DEBUG=true cdk synth"),Pu=!0)},wo=new Map,zn=new Map,gs=new Map,WT=e=>{let i={},o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let l=0;l<o.length;l++)i[o[l]]=l;let a=[],c=0,u=0;for(let l of e){let p=i[l];if(p!==void 0)if(u+=(p&31)<<c,(p&32)!==0)c+=5;else{let d=u&1;u>>=1,a.push(d?-u:u),u=0,c=0}}return a},jT=e=>{let t=e;if(gs.has(t))return gs.get(t)??null;try{let s=_t.readFileSync(e,"utf-8"),n=s.match(/\/\/# sourceMappingURL=data:application\/json;base64,(.+)$/m);if(n){let o=Buffer.from(n[1],"base64").toString("utf-8"),a=JSON.parse(o);return gs.set(t,a),a}let r=s.match(/\/\/# sourceMappingURL=(.+)$/m);if(r){let o=lt.resolve(lt.dirname(e),r[1]);if(_t.existsSync(o)){let a=JSON.parse(_t.readFileSync(o,"utf-8"));return gs.set(t,a),a}}let i=`${e}.map`;if(_t.existsSync(i)){let o=JSON.parse(_t.readFileSync(i,"utf-8"));return gs.set(t,o),o}}catch{}return gs.set(t,null),null},$T=(e,t,s)=>{let n=jT(e);if(!n)return null;try{let r=n.mappings.split(";");if(t>r.length)return null;let i=0,o=0,a=0,c=0;for(let f=0;f<=Math.min(t-1,r.length-1);f++){let m=r[f].split(","),g=0;for(let h of m){if(!h)continue;let y=WT(h);if(y.length!==0&&(g+=y[0],y.length>=4&&(i+=y[1],o+=y[2],a+=y[3],y.length>=5&&(c+=y[4])),f===t-1&&g>=s))break}}let u=n.sources[i];if(!u)return null;let l=lt.dirname(e),p=lt.resolve(l,u),d=lt.relative(process.cwd(),p);return{source:d.startsWith(".")?d:`./${d}`,line:o+1,column:a+1,name:n.names?.[c]}}catch{return null}},nv=(e,t="fallback")=>{let s=e.split(`
398
- `),n=null,r;for(let i of s){if(i.includes("node_modules")||i.includes("aws-cdk-lib")||i.includes("cdk-insights"))continue;let o=i.match(/at\s+(?:new\s+)?(\w+(?:\.\w+)*)\s+\(/);o&&!r&&(r=o[1]);let a=i.match(/\(?([^()]+\.(ts|js|tsx|jsx)):(\d+):(\d+)\)?/);if(a){let[,c,u,l,p]=a,d=c.trim();!d.startsWith("/")&&!d.startsWith(".")&&(d=`./${d}`);let f=Number(l),m=Number(p);if((u==="js"||u==="jsx")&&(d.includes("/dist/")||d.includes("\\dist\\"))){let h=lt.resolve(process.cwd(),d),y=$T(h,f,m);if(y)return{filePath:y.source,line:y.line,column:y.column,confidence:"high",method:"source_map",enclosingScope:y.name||r,originalFile:d}}let g={filePath:d,line:f,column:m,confidence:t==="creation_stack"?"high":"medium",method:t,enclosingScope:r};if(u==="ts"||u==="tsx")return g;n||(n=g)}}return n??void 0},UT=(e,t,s,n)=>{let r=`${s}:${t}`;if(zn.has(r))return zn.get(r)??void 0;try{let i=process.cwd(),o=["lib","cdk","src","bin","stacks","cdk/stacks","infrastructure","apps"],a=t.split("/"),c=a.length>1?a[a.length-2]:"",u=e==="Resource"||e==="Default"?n||c||e:e||t.split("/").pop()||"";for(let l of o){let p=lt.join(i,l);if(!_t.existsSync(p))continue;let d=rv(p);for(let f of d){let m=qT(f,u,c,i);if(m)return zn.set(r,m),m}}}catch{}zn.set(r,null)},rv=(e,t=[])=>{try{let s=_t.readdirSync(e,{withFileTypes:!0});for(let n of s){let r=lt.join(e,n.name);n.isDirectory()&&!n.name.startsWith(".")&&n.name!=="node_modules"?rv(r,t):n.isFile()&&(n.name.endsWith(".ts")||n.name.endsWith(".tsx"))&&t.push(r)}}catch{}return t},GT=(e,t,s=2)=>{let n=e.split(`
397
+ See: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html`};var $r=(e,t)=>{switch(e){case"property_name":return t?`Property name "${t}" suggests this contains sensitive data`:"Property name suggests sensitive data";case"value_pattern":return"Value matches a known secret pattern (API key, token, or credential format)";case"high_entropy":return"Value has high entropy (appears random), which is characteristic of secrets";default:return"Value appears to contain sensitive data"}};var Gn={SEVERITY:"CRITICAL",WAF_PILLAR:"Security",RULE_ID_PREFIX:"CDK-INSIGHTS-SENSITIVE",FOUND_BY:"cdkInsights"};var Xb=(e,t,s={})=>{let n=[];return s.disabled?{hasSensitiveData:!1,resourceId:t,resourceType:e.Type,findings:[]}:(e.Properties&&Eo(e.Properties,"",n,s),{hasSensitiveData:n.length>0,resourceId:t,resourceType:e.Type,findings:n})},OT=new Set(["Tags"]),BT=e=>{if(!Array.isArray(e)||e.length===0)return!1;let t=e[0];return typeof t=="object"&&t!==null&&"Key"in t&&"Value"in t},Eo=(e,t,s,n)=>{if(e!=null){if(typeof e=="string"){MT(e,t,s,n);return}if(Array.isArray(e)){if(BT(e))return;e.forEach((r,i)=>{Eo(r,`${t}[${i}]`,s,n)});return}if(typeof e=="object"){if(Fo(e))return;for(let[r,i]of Object.entries(e)){let o=t?`${t}.${r}`:r;if(!(OT.has(r)&&(Array.isArray(i)||typeof i=="object"))&&!n.ignoreProperties?.includes(o)){if(Ru(r)){if(typeof i=="string"){if(!ev(i,n)){let a=ku(r)||"secret";s.push({propertyPath:o,propertyName:r,detectionReason:"property_name",detectionReasonMessage:$r("property_name",r),recommendation:jr(a)})}}else Fo(i)||Eo(i,o,s,n);continue}Eo(i,o,s,n)}}}}},MT=(e,t,s,n)=>{if(!ev(e,n)){if(wu(e)){let r=t.split(".").pop()??t;s.push({propertyPath:t,propertyName:r,detectionReason:"value_pattern",detectionReasonMessage:$r("value_pattern"),recommendation:jr("secret")});return}if(Eu(e,n.strictMode)){let r=t.split(".").pop()??t;s.push({propertyPath:t,propertyName:r,detectionReason:"high_entropy",detectionReasonMessage:$r("high_entropy"),recommendation:jr("secret")})}}},ev=(e,t)=>!!(!e||e.trim()===""||Iu(e)||Tu(e)||t.allowPatterns?.some(s=>e.includes(s)));var _u=(e,t)=>{let s=e.findings.map(r=>`"${r.propertyName}" at ${r.propertyPath}`).join(", "),n=e.findings.length;return{resourceId:e.resourceId,issue:n===1?`Sensitive data detected: ${s}. This resource was NOT sent to CDK Insights servers.`:`Sensitive data detected in ${n} properties: ${s}. This resource was NOT sent to CDK Insights servers.`,recommendation:"Use AWS Secrets Manager or SSM Parameter Store to securely manage sensitive values. See: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html",severity:Gn.SEVERITY,wafPillar:Gn.WAF_PILLAR,foundBy:Gn.FOUND_BY,constructPath:e.resourceId,constructType:e.resourceType,stackName:t,ruleId:Gn.RULE_ID_PREFIX,context:{property:e.findings.map(r=>r.propertyPath).join(", "),value:"[REDACTED]",expected:"AWS Secrets Manager or SSM Parameter Store reference"}}},Lu=(e,t={})=>{let s=[],n=[],r=0;for(let[i,o]of Object.entries(e)){let a=Xb(o,i,t);s.push(a),a.hasSensitiveData&&(n.push(i),r+=a.findings.length)}return{totalResourcesScanned:Object.keys(e).length,resourcesWithSensitiveData:n.length,totalFindings:r,hasSkippedResources:n.length>0,skippedResourceIds:n,detectionResults:s}};var tv=e=>{if(!e)return;let t=e.trim();if(t)return t.replace(/\/+$/,"")},sv=e=>{let t=tv(e);return t||(tv("https://api.cdkinsights.dev/analysis/v1")??"")};var es=require("aws-cdk-lib"),Gr=require("cdk-nag"),_t=H(require("node:fs")),lt=H(require("node:path"));var Bu="2.2.0",Mu="cdk-insights::",Nu=()=>process.env.CDK_DEBUG==="true"||(process.env.CDK_CONTEXT_JSON?.includes('"@aws-cdk/core:stackTrace":true')??!1)||(process.env.CDK_CONTEXT_JSON?.includes('"@aws-cdk/core:stackTrace": true')??!1),Pu=!1,NT=()=>{Pu||(Nu()||_e.info("\u{1F4A1} Tip: Set CDK_DEBUG=true for more accurate source location detection. Run: CDK_DEBUG=true cdk synth"),Pu=!0)},wo=new Map,zn=new Map,gs=new Map,WT=e=>{let i={},o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let l=0;l<o.length;l++)i[o[l]]=l;let a=[],c=0,u=0;for(let l of e){let p=i[l];if(p!==void 0)if(u+=(p&31)<<c,(p&32)!==0)c+=5;else{let d=u&1;u>>=1,a.push(d?-u:u),u=0,c=0}}return a},jT=e=>{let t=e;if(gs.has(t))return gs.get(t)??null;try{let s=_t.readFileSync(e,"utf-8"),n=s.match(/\/\/# sourceMappingURL=data:application\/json;base64,(.+)$/m);if(n){let o=Buffer.from(n[1],"base64").toString("utf-8"),a=JSON.parse(o);return gs.set(t,a),a}let r=s.match(/\/\/# sourceMappingURL=(.+)$/m);if(r){let o=lt.resolve(lt.dirname(e),r[1]);if(_t.existsSync(o)){let a=JSON.parse(_t.readFileSync(o,"utf-8"));return gs.set(t,a),a}}let i=`${e}.map`;if(_t.existsSync(i)){let o=JSON.parse(_t.readFileSync(i,"utf-8"));return gs.set(t,o),o}}catch{}return gs.set(t,null),null},$T=(e,t,s)=>{let n=jT(e);if(!n)return null;try{let r=n.mappings.split(";");if(t>r.length)return null;let i=0,o=0,a=0,c=0;for(let f=0;f<=Math.min(t-1,r.length-1);f++){let m=r[f].split(","),g=0;for(let h of m){if(!h)continue;let b=WT(h);if(b.length!==0&&(g+=b[0],b.length>=4&&(i+=b[1],o+=b[2],a+=b[3],b.length>=5&&(c+=b[4])),f===t-1&&g>=s))break}}let u=n.sources[i];if(!u)return null;let l=lt.dirname(e),p=lt.resolve(l,u),d=lt.relative(process.cwd(),p);return{source:d.startsWith(".")?d:`./${d}`,line:o+1,column:a+1,name:n.names?.[c]}}catch{return null}},nv=(e,t="fallback")=>{let s=e.split(`
398
+ `),n=null,r;for(let i of s){if(i.includes("node_modules")||i.includes("aws-cdk-lib")||i.includes("cdk-insights"))continue;let o=i.match(/at\s+(?:new\s+)?(\w+(?:\.\w+)*)\s+\(/);o&&!r&&(r=o[1]);let a=i.match(/\(?([^()]+\.(ts|js|tsx|jsx)):(\d+):(\d+)\)?/);if(a){let[,c,u,l,p]=a,d=c.trim();!d.startsWith("/")&&!d.startsWith(".")&&(d=`./${d}`);let f=Number(l),m=Number(p);if((u==="js"||u==="jsx")&&(d.includes("/dist/")||d.includes("\\dist\\"))){let h=lt.resolve(process.cwd(),d),b=$T(h,f,m);if(b)return{filePath:b.source,line:b.line,column:b.column,confidence:"high",method:"source_map",enclosingScope:b.name||r,originalFile:d}}let g={filePath:d,line:f,column:m,confidence:t==="creation_stack"?"high":"medium",method:t,enclosingScope:r};if(u==="ts"||u==="tsx")return g;n||(n=g)}}return n??void 0},UT=(e,t,s,n)=>{let r=`${s}:${t}`;if(zn.has(r))return zn.get(r)??void 0;try{let i=process.cwd(),o=["lib","cdk","src","bin","stacks","cdk/stacks","infrastructure","apps"],a=t.split("/"),c=a.length>1?a[a.length-2]:"",u=e==="Resource"||e==="Default"?n||c||e:e||t.split("/").pop()||"";for(let l of o){let p=lt.join(i,l);if(!_t.existsSync(p))continue;let d=rv(p);for(let f of d){let m=qT(f,u,c,i);if(m)return zn.set(r,m),m}}}catch{}zn.set(r,null)},rv=(e,t=[])=>{try{let s=_t.readdirSync(e,{withFileTypes:!0});for(let n of s){let r=lt.join(e,n.name);n.isDirectory()&&!n.name.startsWith(".")&&n.name!=="node_modules"?rv(r,t):n.isFile()&&(n.name.endsWith(".ts")||n.name.endsWith(".tsx"))&&t.push(r)}}catch{}return t},GT=(e,t,s=2)=>{let n=e.split(`
399
399
  `),r=Math.max(0,t-1-s),i=Math.min(n.length,t+s);return n.slice(r,i).map((o,a)=>{let c=r+a+1;return`${c===t?">":" "}${c.toString().padStart(4)} | ${o}`}).join(`
400
400
  `)},zT=(e,t)=>{let s=e.split(`
401
401
  `),n,r=0,i=0;for(let o=0;o<Math.min(t,s.length);o++){let a=s[o],c=a.match(/class\s+(\w+)/),u=a.match(/(?:function\s+(\w+)|(\w+)\s*[=:]\s*(?:async\s*)?\(|(\w+)\s*\([^)]*\)\s*(?:=>|\{))/);if(c)n=c[1],i=r;else if(u){let l=u[1]||u[2]||u[3];l&&n?n=`${n}.${l}`:l&&(n=l),i=r}if(r+=(a.match(/{/g)||[]).length,r-=(a.match(/}/g)||[]).length,r<=i&&n){let l=n.split(".");l.length>1&&(n=l.slice(0,-1).join("."))}}return n},qT=(e,t,s,n)=>{try{let r=wo.get(e);r||(r=_t.readFileSync(e,"utf-8"),wo.set(e,r));let i=r.split(`
402
- `),o=[],a=new RegExp(`new\\s+(\\w+)\\s*\\(\\s*(?:this|\\w+)\\s*,\\s*['"\`]${Ro(t)}['"\`]`,"g"),c=new RegExp(`(?:const|let|var)\\s+(${Ro(t.replace(/[^a-zA-Z0-9]/g,""))})\\s*=\\s*new\\s+(\\w+)`,"gi"),u=new RegExp(`\\w+\\s*[=:]\\s*new\\s+(\\w+)\\s*\\(\\s*(?:this|\\w+)\\s*,\\s*['"\`]${Ro(t)}['"\`]`,"g"),l=new RegExp(`\\.\\w+\\s*\\(\\s*['"\`]${Ro(t)}['"\`]`,"g");for(let p=0;p<i.length;p++){let d=i[p],f=a.exec(d);if(f){o.push({line:p+1,column:f.index+1,constructorName:f[1],confidence:"high"}),a.lastIndex=0;continue}if(f=u.exec(d),f){o.push({line:p+1,column:f.index+1,constructorName:f[1],confidence:"high"}),u.lastIndex=0;continue}if(f=c.exec(d),f){o.push({line:p+1,column:f.index+1,constructorName:f[2],confidence:"medium"}),c.lastIndex=0;continue}f=l.exec(d),f&&(o.push({line:p+1,column:f.index+1,confidence:"low"}),l.lastIndex=0)}if(o.length>0){o.sort((A,b)=>{let E={high:0,medium:1,low:2};return E[A.confidence]-E[b.confidence]});let p=o[0],d=lt.relative(n,e),f=zT(r,p.line),m=GT(r,p.line),g=p.line,h=0,y=0,D=!1;for(let A=p.line-1;A<i.length&&A<p.line+50;A++){let b=i[A];for(let E of b)if(E==="("||E==="{")E==="("?y++:h++,D=!0;else if((E===")"||E==="}")&&(E===")"?y--:h--,D&&y<=0&&h<=0)){g=A+1;break}if(g>p.line)break}return{filePath:d.startsWith(".")?d:`./${d}`,line:p.line,column:p.column,endLine:g>p.line?g:void 0,confidence:p.confidence,method:"source_analysis",enclosingScope:f,codeSnippet:m}}}catch{}},Ro=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),HT=e=>{let t=e;if(t._creationStack?.length)return t._creationStack;if(t.creationStack?.length)return t.creationStack;let s=e.node.defaultChild;if(s?._creationStack?.length)return s._creationStack;if(s?.creationStack?.length)return s.creationStack;let n=e.node.scope;for(;n;){let r=n;if(r._creationStack?.length)return r._creationStack;if(r.creationStack?.length)return r.creationStack;n=n.node?.scope}},iv=(e,t)=>{try{let s=HT(e);if(s?.length){let a=s.join(`
402
+ `),o=[],a=new RegExp(`new\\s+(\\w+)\\s*\\(\\s*(?:this|\\w+)\\s*,\\s*['"\`]${Ro(t)}['"\`]`,"g"),c=new RegExp(`(?:const|let|var)\\s+(${Ro(t.replace(/[^a-zA-Z0-9]/g,""))})\\s*=\\s*new\\s+(\\w+)`,"gi"),u=new RegExp(`\\w+\\s*[=:]\\s*new\\s+(\\w+)\\s*\\(\\s*(?:this|\\w+)\\s*,\\s*['"\`]${Ro(t)}['"\`]`,"g"),l=new RegExp(`\\.\\w+\\s*\\(\\s*['"\`]${Ro(t)}['"\`]`,"g");for(let p=0;p<i.length;p++){let d=i[p],f=a.exec(d);if(f){o.push({line:p+1,column:f.index+1,constructorName:f[1],confidence:"high"}),a.lastIndex=0;continue}if(f=u.exec(d),f){o.push({line:p+1,column:f.index+1,constructorName:f[1],confidence:"high"}),u.lastIndex=0;continue}if(f=c.exec(d),f){o.push({line:p+1,column:f.index+1,constructorName:f[2],confidence:"medium"}),c.lastIndex=0;continue}f=l.exec(d),f&&(o.push({line:p+1,column:f.index+1,confidence:"low"}),l.lastIndex=0)}if(o.length>0){o.sort((S,D)=>{let E={high:0,medium:1,low:2};return E[S.confidence]-E[D.confidence]});let p=o[0],d=lt.relative(n,e),f=zT(r,p.line),m=GT(r,p.line),g=p.line,h=0,b=0,y=!1;for(let S=p.line-1;S<i.length&&S<p.line+50;S++){let D=i[S];for(let E of D)if(E==="("||E==="{")E==="("?b++:h++,y=!0;else if((E===")"||E==="}")&&(E===")"?b--:h--,y&&b<=0&&h<=0)){g=S+1;break}if(g>p.line)break}return{filePath:d.startsWith(".")?d:`./${d}`,line:p.line,column:p.column,endLine:g>p.line?g:void 0,confidence:p.confidence,method:"source_analysis",enclosingScope:f,codeSnippet:m}}}catch{}},Ro=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),HT=e=>{let t=e;if(t._creationStack?.length)return t._creationStack;if(t.creationStack?.length)return t.creationStack;let s=e.node.defaultChild;if(s?._creationStack?.length)return s._creationStack;if(s?.creationStack?.length)return s.creationStack;let n=e.node.scope;for(;n;){let r=n;if(r._creationStack?.length)return r._creationStack;if(r.creationStack?.length)return r.creationStack;n=n.node?.scope}},iv=(e,t)=>{try{let s=HT(e);if(s?.length){let a=s.join(`
403
403
  `),c=nv(a,"creation_stack");if(c)return{...c,confidence:"high"}}for(let a of e.node.metadata)if(a.trace&&Array.isArray(a.trace)){let c=a.trace.join(`
404
- `),u=nv(c,"metadata_trace");if(u)return u}let n=e.node.id,r=e.node.path,i=es.Stack.of(e),o=UT(n,r,i.stackName,t);return o||void 0}catch{}},VT=(e,t=10)=>{let s=e.node.scope,n=0;for(;s&&n<t;){let r=s.node.id,i=s.constructor.name;if(i==="Stack"||i==="App"||!r){s=s.node.scope,n++;continue}let o=iv(s,r);if(o)return{location:o,ancestorId:r,ancestorType:i};s=s.node.scope,n++}},KT=(e,t,s)=>{let n=e.constructor.name,r={CfnSubnet:"Vpc",CfnRouteTable:"Vpc or Subnet",CfnRoute:"Vpc or Subnet",CfnSubnetRouteTableAssociation:"Subnet",CfnInternetGateway:"Vpc",CfnVPCGatewayAttachment:"Vpc",CfnNatGateway:"Vpc (public subnet)",CfnEIP:"Vpc (for NAT Gateway)",CfnSecurityGroup:"Vpc or other L2 construct",CfnSecurityGroupIngress:"SecurityGroup",CfnSecurityGroupEgress:"SecurityGroup",CfnDBSubnetGroup:"DatabaseInstance or DatabaseCluster",CfnLogGroup:"Lambda Function or other service",CfnRole:"Lambda Function, ECS Task, or other service",CfnPolicy:"Role or User",CfnInstanceProfile:"Role"};if(t&&s)return`Created by ${t.replace(/\d+$/,"")} construct '${s}'`;let i=r[n];if(i){let o=e.node.scope;if(o&&o.node){let a=o.node.id,c=o.constructor.name.replace(/\d+$/,"");if(a&&c!=="Stack")return`Created by ${c} construct '${a}'`}return`Implicitly created by ${i}`}},ZT=(e,t,s,n)=>{let r=[];t&&r.push(`'${t}'`);let i=e.split("/").filter(a=>a&&a!=="Resource"&&a!=="Default"&&!a.startsWith("Cfn")),o=i[i.length-1];if(o&&o!==t&&r.push(`'${o}'`),i.length>1){let a=i[i.length-2];a&&a!==t&&a!==o&&r.push(`'${a}'`)}if(s){let a=s.replace(/\d+$/,"");r.push(`new ${a}(`)}if(n){let a=n.split("::").pop()??"";a&&!r.some(c=>c.includes(a))&&r.push(`${a}`)}return r.length===0?`Search for: ${e}`:`Search for: ${r.slice(0,3).join(" or ")}`},YT={"AWS::S3":"Storage","AWS::DynamoDB":"Database","AWS::RDS":"Database","AWS::Lambda":"Compute","AWS::EC2":"Compute","AWS::ECS":"Containers","AWS::EKS":"Containers","AWS::IAM":"Security","AWS::KMS":"Security","AWS::SecretsManager":"Security","AWS::CloudWatch":"Management","AWS::CloudTrail":"Management","AWS::SNS":"Messaging","AWS::SQS":"Messaging","AWS::EventBridge":"Messaging","AWS::ApiGateway":"Networking","AWS::CloudFront":"Networking","AWS::ELB":"Networking","AWS::ElasticLoadBalancing":"Networking","AWS::VPC":"Networking","AWS::Route53":"Networking","AWS::Cognito":"Security","AWS::WAF":"Security","AWS::StepFunctions":"Integration","AWS::Kinesis":"Analytics","AWS::Glue":"Analytics","AWS::Athena":"Analytics","AWS::Redshift":"Analytics"},JT=[{pattern:/encryption|encrypted|kmsKey|sseSpecification/i,recommendation:"Enable encryption for data at rest",checkDefault:e=>e===!1||e===void 0||e===null},{pattern:/publicAccess|publicRead|publiclyAccessible/i,recommendation:"Restrict public access unless explicitly required",checkDefault:e=>e===!0},{pattern:/logging|accessLog|trailName/i,recommendation:"Enable logging for audit and compliance",checkDefault:e=>e===!1||e===void 0},{pattern:/versioning|versioningConfiguration/i,recommendation:"Enable versioning for data protection",checkDefault:e=>e===void 0||typeof e=="object"&&e!==null&&e.status!=="Enabled"},{pattern:/backupRetention|deletionProtection|deleteProtection/i,recommendation:"Configure backup and deletion protection",checkDefault:e=>e===!1||e===0||e===void 0},{pattern:/multiAz|multiAZ/i,recommendation:"Enable Multi-AZ for high availability",checkDefault:e=>e===!1},{pattern:/securityGroup|ingressRules|egressRules/i,recommendation:"Review security group rules"},{pattern:/iamRole|assumeRolePolicy|policyDocument/i,recommendation:"Review IAM permissions for least privilege"}],QT=e=>{try{let t=e.node.scope;if(!t)return{};let s=t.constructor.name;if(s.startsWith("Cfn")){let n=t.node?.scope;if(n)return{l2Type:n.constructor.name,l2Id:n.node?.id,l2Fqn:Ou(n)}}else return{l2Type:s,l2Id:t.node?.id,l2Fqn:Ou(t)}}catch{}return{}},Ou=e=>{try{let t=e;if(t.constructor.__jsii__?.fqn)return t.constructor.__jsii__.fqn;if(typeof t.constructor.fqn=="string")return t.constructor.fqn;let s=e.constructor.name;return s.startsWith("Cfn")?`aws-cdk-lib.${s}`:s}catch{return}},XT=e=>{let t=[];try{let s=e;for(;s;)t.unshift({id:s.node.id,type:s.constructor.name,fqn:Ou(s)}),s=s.node.scope}catch{}return t},ek=e=>{for(let[t,s]of Object.entries(YT))if(e.startsWith(t))return s},tk=e=>{let t=[];try{let n=e.cfnProperties;if(!n)return t;let r=(o,a)=>{for(let{pattern:c,recommendation:u,checkDefault:l}of JT)if(c.test(o)){let p=l?l(a):void 0,d=null;typeof a=="boolean"||typeof a=="number"?d=a:a==null?d=null:typeof a=="string"&&!es.Token.isUnresolved(a)?d=a.length>50?`${a.substring(0,47)}...`:a:typeof a=="string"?d="[Token]":d="[Object]",t.push({path:o,value:d,isDefault:p,recommendation:p?u:void 0});break}},i=(o,a="")=>{for(let[c,u]of Object.entries(o)){let l=a?`${a}.${c}`:c;r(l,u),u&&typeof u=="object"&&!Array.isArray(u)&&!es.Token.isUnresolved(u)&&i(u,l)}};i(n)}catch{}return t},sk=e=>{try{let s=e.cfnProperties;if(!s)return!0;let n=0;for(let r of Object.values(s))r!==void 0&&!es.Token.isUnresolved(r)&&n++;return n<3}catch{return!1}},nk=(e,t={})=>{let{captureSourceLocation:s=!0,captureTags:n=!0,captureRelationships:r=!0,captureHierarchy:i=!0,captureDependencies:o=!0,captureSensitiveProperties:a=!0}=t;if(!("cfnResourceType"in e))return null;let c=es.Stack.of(e),u=e.node.path,l=e.constructor.name,p=e.node.id,d=e,f=d.cfnResourceType,m;try{m=c.getLogicalId(d)}catch{}let{l2Type:g,l2Id:h}=QT(e),y=h?`${h} (${g||l})`:`${p} (${l})`,D={source:"cdk_insights",version:Bu,stackName:c.stackName,stackId:c.node.id,constructPath:u,constructType:l,friendlyName:y,timestamp:new Date().toISOString(),cfnResourceType:f};p&&(D.id=p),m&&(D.logicalId=m),g&&(D.l2ConstructType=g),h&&(D.l2ConstructId=h);let A=ek(f);if(A&&(D.serviceCategory=A),s){let b=iv(e,h);if(b)D.sourceLocation=b;else{let T=VT(e);T&&(D.rootSourceLocation=T.location),D.searchHint=ZT(u,h,g,f)}let E=KT(e,g,h);E&&(D.createdBy=E)}if(r){let b=e.node.scope;b&&(D.parentPath=b.node.path),D.childCount=e.node.children.length}if(i){let b=XT(e);b.length>0&&(D.constructHierarchy=b)}if(o)try{let b=e.node.dependencies;if(b.length>0){let E=[];for(let T of b)if("cfnResourceType"in T)try{let k=c.getLogicalId(T);k&&E.push(k)}catch{}E.length>0&&(D.dependencies=E)}}catch{}if(a){let b=tk(e);b.length>0&&(D.sensitiveProperties=b),D.usesDefaults=sk(e)}if(n)try{let b=d.tagsRaw;if(b&&Object.keys(b).length>0)D.tags=b;else{let E=d.tags;if(E&&typeof E.renderTags=="function"){let T=E.renderTags();T&&Object.keys(T).length>0&&(D.tags=T)}}}catch{}try{let b=c.cdkVersion;b&&(D.cdkVersion=b)}catch{}return D},ov=(e,t,s={})=>{if(NT(),t)try{t.visit(e)}catch(r){_e.warn(`CDK-Nag error suppressed for ${e.node.path}: ${r.message}`)}let n=nk(e,{captureSourceLocation:s.captureSourceLocation,captureTags:s.captureTags,captureRelationships:s.captureRelationships,captureHierarchy:s.captureHierarchy,captureDependencies:s.captureDependencies,captureSensitiveProperties:s.captureSensitiveProperties});n&&es.Annotations.of(e).addInfo(`${Mu}${JSON.stringify(n)}`)},av=(e={})=>{let{logCompliance:t=!1,logNotApplicable:s=!1,verbose:n=!1}=e;return{onCompliance:r=>{t&&_e.debug(`\u2713 ${r.resource.logicalId} is compliant with ${r.ruleId}`)},onNonCompliance:r=>{_e.warn(`\u2717 ${r.resource.logicalId} is non-compliant with ${r.ruleId}: ${r.ruleInfo}`)},onSuppressed:r=>{n&&_e.info(`\u2298 ${r.ruleId} suppressed on ${r.resource.logicalId}: ${r.suppressionReason}`)},onError:r=>{_e.error(`\u26A0 ${r.ruleId} error during validation: ${r.errorMessage}`)},onSuppressedError:r=>{n&&_e.warn(`\u2298 ${r.ruleId} error suppressed: ${r.errorSuppressionReason}`)},onNotApplicable:r=>{s&&n&&_e.debug(`- ${r.ruleId} not applicable to ${r.resource.logicalId}`)}}},cv=(e={})=>{let{logCompliance:t=!0,logNotApplicable:s=!1,verbose:n=!1}=e;return{onCompliance:r=>{t&&_e.info(`Yay! ${r.resource.logicalId} is compliant with ${r.ruleId}`)},onNonCompliance:r=>{_e.warn(`Boo! ${r.resource.logicalId} is non-compliant with ${r.ruleId}`)},onSuppressed:r=>{n&&_e.info(`Hmmmm... ${r.ruleId} has been suppressed on ${r.resource.logicalId} with reason: ${r.suppressionReason}`)},onError:r=>{_e.error(`WHAT?!?! ${r.ruleId} encountered an error during validation!`)},onSuppressedError:r=>{n&&_e.warn(`PHEW! ${r.ruleId} error was suppressed: ${r.errorSuppressionReason}`)},onNotApplicable:r=>{s&&n&&_e.debug(`Meh. ${r.ruleId} and ${r.resource.logicalId} aren't related at all.`)}}},uv=(e={})=>{let{runNagChecks:t=!0,captureSourceLocation:s=!0,captureTags:n=!0,captureRelationships:r=!0,captureHierarchy:i=!0,captureDependencies:o=!0,captureSensitiveProperties:a=!0}=e,c=t?new Gr.AwsSolutionsChecks:null;return{visit:u=>{ov(u,c,{captureSourceLocation:s,captureTags:n,captureRelationships:r,captureHierarchy:i,captureDependencies:o,captureSensitiveProperties:a})}}},Ur=class{options;constructor(t={}){this.options={logCompliance:!0,logNotApplicable:!1,verbose:!1,...t}}onCompliance(t){this.options.logCompliance&&_e.info(`Yay! ${t.resource.logicalId} is compliant with ${t.ruleId}`)}onNonCompliance(t){_e.warn(`Boo! ${t.resource.logicalId} is non-compliant with ${t.ruleId}`)}onSuppressed(t){this.options.verbose&&_e.info(`Hmmmm... ${t.ruleId} has been suppressed on ${t.resource.logicalId} with reason: ${t.suppressionReason}`)}onError(t){_e.error(`WHAT?!?! ${t.ruleId} encountered an error during validation!`)}onSuppressedError(t){this.options.verbose&&_e.warn(`PHEW! ${t.ruleId} error was suppressed: ${t.errorSuppressionReason}`)}onNotApplicable(t){this.options.logNotApplicable&&this.options.verbose&&_e.debug(`Meh. ${t.ruleId} and ${t.resource.logicalId} aren't related at all.`)}},Io=class extends Gr.NagPack{delegate;options;constructor(t){super(t),this.packName="CdkInsights",this.options={runNagChecks:t?.runNagChecks??!0,captureSourceLocation:t?.captureSourceLocation??!0,captureTags:t?.captureTags??!0,captureRelationships:t?.captureRelationships??!0,captureHierarchy:t?.captureHierarchy??!0,captureDependencies:t?.captureDependencies??!0,captureSensitiveProperties:t?.captureSensitiveProperties??!0,logger:t?.logger},this.loggers.push(new Ur(this.options.logger)),this.delegate=new Gr.AwsSolutionsChecks}visit(t){ov(t,this.options.runNagChecks?this.delegate:null,this.options)}};var lv=()=>{wo.clear(),zn.clear(),gs.clear(),Pu=!1},pv=()=>({sourceFiles:wo.size,constructLocations:zn.size,sourceMaps:gs.size});var ko=async(e,t)=>{try{return await e()}catch(s){return Ve.warn(`\u26A0\uFE0F Error in ${t.operationName}:`,{error:s}),t.fallbackValue}},rk=e=>!e||e.length===0||e.includes("All services"),ik=(e,t)=>{if(rk(t))return e;let s=new Set((t??[]).map(n=>`AWS::${n}::`));return Object.fromEntries(Object.entries(e).filter(([,n])=>{for(let r of s)if(n.Type.startsWith(r))return!0;return!1}))},ok=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>!t.Type.startsWith("AWS::CDK::"))),ak=e=>{let{stackName:t,pathToLogicalId:s}=e;return n=>({resourceId:n,friendlyName:s[n]??n,cdkPath:`${t}/${n}`,isGenerated:!1,sources:{cdkInsights:{issues:[]},cdkNag:{issues:[]}}})},Qs=(e,t,s)=>{let n=e[t];if(n)return n;let r=s(t);return e[t]=r,r},ck=e=>[...e.sources?.cdkInsights?.issues??[],...e.sources?.cdkNag?.issues??[]],dv=e=>{for(let t of Object.values(e)){for(let s of t.sources?.cdkInsights?.issues??[])if(s.severity==="CRITICAL")return!0;for(let s of t.sources?.cdkNag?.issues??[])if(s.severity==="CRITICAL")return!0}return!1},uk=e=>{for(let[t,s]of Object.entries(e))(s.sources?.cdkInsights?.issues?.length??0)>0||(s.sources?.cdkNag?.issues?.length??0)>0||delete e[t];return e},To=(e,t,s,n,r,i,o)=>({resourceId:e,issue:t,recommendation:s,severity:n,wafPillar:r,foundBy:o,constructPath:i}),lk=e=>{let{recommendationMap:t,stackName:s,stackResources:n,manifest:r}=e;try{let i=new Map,o=a=>{let c=i.get(a);if(c)return c;let u=VD(r,a);return i.set(a,u),u};return Object.entries(t).reduce((a,[c,u])=>{let l=u.cdkPath||c,p=o(l),d=n[c]?.Type||"Unknown",f=m=>({...m,...p?.filePath&&{sourceLocation:{filePath:p.filePath,line:p.line||1,column:p.column||1,confidence:p.confidence||"low"}},stackName:s,constructType:d});return a[c]={...u,sources:{cdkInsights:{issues:(u.sources?.cdkInsights?.issues??[]).map(f)},cdkNag:{issues:(u.sources?.cdkNag?.issues??[]).map(f)}}},a},{})}catch(i){return Ve.warn("\u26A0\uFE0F Could not enrich issues with source location:",{error:i}),t}},pk=e=>{let{authToken:t,fingerprint:s,tier:n,quotaValidation:r}=e,i=!!(t&&s&&n),o=!r||r.canRunStaticAnalysis,a=!r||r.canRunAIAnalysis,c=!!(n&&Ar.isFeatureEnabled("aiAnalysis",n));return{hasAuth:i,canRunStatic:o,canRunAI:i&&c&&a,isAiEnabledByTier:c,canRunAIByQuota:a}},dk=async e=>{let{userResources:t,selectedServices:s,constructRegistry:n,canRunStatic:r,customRules:i=[]}=e,o=Object.keys(t).length;return o===0?{}:r?(q.phase1(`Static analysis on ${o} resource${o===1?"":"s"}`),await ko(()=>Promise.resolve(wh({Resources:t},To,s||[],n,i)),{operationName:"static analysis",fallbackValue:{}})??{}):(q.warning("\u26A0\uFE0F Static analysis skipped due to license restrictions"),{})},mk=async e=>{let{stackName:t,userResources:s,inlineFindings:n,pathToLogicalId:r,authToken:i,fingerprint:o,tier:a,noCache:c=!1,cache:u,capabilities:l}=e,p=Object.keys(s).length;if(p===0)return{};if(!l.hasAuth)return{};if(a&&!l.isAiEnabledByTier)return q.comment("\u{1F4A1} AI analysis is available with Pro tier - upgrade for deeper insights"),{};if(!l.canRunAIByQuota&&l.canRunStatic)return q.comment("\u{1F4A1} AI analysis skipped due to trial quota limits - upgrade to Pro for unlimited AI analysis"),{};if(!l.canRunAI)return{};if(!i||!o)return Ve.warn("AI analysis skipped: missing authToken or fingerprint"),{};q.phase2(`AI analysis on ${p} resource${p===1?"":"s"}`);let d=sv(),f=UD(zt,d),m=hy(Vb),g=ID({analyzeResource:f,redactResources:m});return await ko(()=>g({stackName:t,resources:s,authToken:i,existingFindingsMap:n,pathToLogicalId:r,fingerprint:o,noCache:c,cacheConfig:u}),{operationName:"AI analysis",fallbackValue:{}})??{}},fk=e=>{let{recommendationMap:t,ruleFilter:s}=e;if(s.length===0)return t;for(let[n,r]of Object.entries(t)){let i=ck(r),o=pu(i,s);if(o.length===0){delete t[n];continue}r.sources||(r.sources={cdkInsights:{issues:[]},cdkNag:{issues:[]}}),r.sources.cdkInsights||(r.sources.cdkInsights={issues:[]}),r.sources.cdkNag||(r.sources.cdkNag={issues:[]}),r.sources.cdkInsights.issues=o.filter(a=>a.foundBy==="cdkInsights"),r.sources.cdkNag.issues=o.filter(a=>a.foundBy==="cdkNag")}return t},gk=async e=>{let{stackName:t,recommendationMap:s,summary:n,tier:r}=e;if(!r||!Ar.isFeatureEnabled("githubIntegration",r)){q.warning("GitHub integration is not available for your current tier"),q.comment(ny("githubIntegration",r??"free","GitHub integration"));return}let i=WD(),o=!!process.env.GITHUB_TOKEN;if(!i&&!o){q.warning("GitHub CLI not found and GITHUB_TOKEN not set. Skipping issue creation."),q.comment("Install GitHub CLI (gh) or set GITHUB_TOKEN environment variable to enable issue creation.");return}q.section("Creating GitHub Issue","\u{1F419}");let a=jn(t,s,n);await ko(()=>MD({stackName:t,issueTitle:`CDK Insights Analysis for ${t}`,issueBody:a,ghCli:i,recommendations:s,summary:n}),{operationName:"creating GitHub issue"})},mv=async({stackName:e,stack:t,selectedServices:s,inlineFindings:n,recommendationMapPerStack:r,pathToLogicalId:i,constructRegistry:o,ruleFilter:a,authToken:c,fingerprint:u,output:l,withIssue:p,tier:d,noCache:f=!1,warnSensitive:m=!1,sensitiveDataDetection:g={},cache:h,quotaValidation:y,manifest:D,customRules:A=[]})=>{let b=t.Resources??{},E=ik(b,s),T=ok(E),k=new Set(Object.keys(T)),S=k.size,$=pk({authToken:c,fingerprint:u,tier:d,quotaValidation:y}),K=ak({stackName:e,pathToLogicalId:i}),J=r[e]||{},V=ie=>{let de=K(ie),ge=J[ie];return ge?{...de,...ge,sources:de.sources}:de},Z=$.canRunAI?Object.fromEntries(Object.keys(T).map(ie=>[ie,V(ie)])):{};for(let ie of n)Qs(Z,ie.resourceId,V).sources.cdkNag.issues.push(ie);let O=await dk({userResources:T,selectedServices:s,constructRegistry:o,canRunStatic:$.canRunStatic,customRules:A});for(let[ie,de]of Object.entries(O)){let ge=Qs(Z,ie,V),Lt=de.issues??[];ge.sources.cdkInsights.issues.push(...Lt)}let I=Dc(t,To,a);for(let[ie,de]of Object.entries(I))Qs(Z,ie,V).sources.cdkInsights.issues.push(...de.issues);let _=vi(t,To);for(let[ie,de]of Object.entries(_))Qs(Z,ie,V).sources.cdkInsights.issues.push(...de.issues);let B=bi(t,To);for(let[ie,de]of Object.entries(B))Qs(Z,ie,V).sources.cdkInsights.issues.push(...de.issues);let U=Lu(T,{disabled:g.disabled,ignoreProperties:g.ignoreProperties,allowPatterns:g.allowPatterns,strictMode:g.strictMode}),le=T;if(U.hasSkippedResources){let ie=U.resourcesWithSensitiveData;q.warning(`\u{1F512} Sensitive data detected in ${ie} resource${ie===1?"":"s"} - NOT sent to CDK Insights servers`),le=Object.fromEntries(Object.entries(T).filter(([de])=>!U.skippedResourceIds.includes(de)));for(let de of U.detectionResults)if(de.hasSensitiveData){let ge=Qs(Z,de.resourceId,V),Lt=_u(de,e);ge.sources.cdkInsights.issues.push(Lt)}}let G=await mk({stackName:e,userResources:le,inlineFindings:n,pathToLogicalId:i,authToken:c,fingerprint:u,tier:d,noCache:f,cache:h,capabilities:$});c&&u&&Object.keys(G).length>0&&q.phase3("Processing results...");let W=Jb({staticRecommendations:{},aiRecommendations:G,recommendationMap:Z,ruleFilter:a,filterIssuesByRule:pu});for(let[ie,de]of Object.entries(W.updatedMap)){let ge=Qs(Z,ie,V);ge.sources.cdkInsights.issues.push(...Fr({existing:ge.sources.cdkInsights.issues,incoming:de.sources.cdkInsights.issues}))}fk({recommendationMap:Z,ruleFilter:a}),uk(Z);let se=lk({recommendationMap:Z,stackName:e,stackResources:T,manifest:D}),Ee=xo(se,S,k),De=Object.keys(se).length>0;return r[e]=se,l&&l!=="table"&&qb(l,e,se,!0,Ee),p&&De&&await gk({stackName:e,recommendationMap:se,summary:Ee,tier:d}),{recommendationMap:se,summary:Ee,hasIssues:De,scannedResourceCount:S,scannedResourceIds:k,stackName:e,sensitiveDataSummary:U,hasSensitiveData:U.hasSkippedResources}},hk=async({stacks:e,inlineFindings:t,pathToLogicalId:s,output:n,recommendationMapPerStack:r,withIssue:i,services:o,ruleFilter:a=[],authToken:c,fingerprint:u,failOnCritical:l,tier:p,noCache:d=!1,allowOveruse:f=!1,warnSensitive:m=!1,sensitiveDataDetection:g={},cache:h,quotaValidation:y})=>{if(Ve.info("\u{1F680} Starting CDK Insights analysis",{stackCount:Object.keys(e).length,stackNames:Object.keys(e),hasAuthToken:!!c,hasFingerprint:!!u,tier:p||"unknown",quotaValidation:y?{canRunStaticAnalysis:y.canRunStaticAnalysis,canRunAIAnalysis:y.canRunAIAnalysis,isTrial:y.quota?.isTrial}:null,services:o||["All services"],output:n||"table"}),y&&!y.quota.isTrial&&y.canRunAIAnalysis&&f){let O=y.quota.currentResourcesAnalyzed>=y.quota.maxResources,I=y.quota.wouldExceed;O?(q.warning(`\u26A0\uFE0F You have exceeded your paid allowance (${y.quota.currentResourcesAnalyzed}/${y.quota.maxResources} resources analyzed).`),q.warning(" Proceeding with AI analysis as --allow-overuse is enabled. Extra usage will be charged.")):I&&(q.warning(`\u26A0\uFE0F This analysis will exceed your paid allowance (${y.quota.currentResourcesAnalyzed}/${y.quota.maxResources} resources analyzed).`),q.warning(" Proceeding with AI analysis as --allow-overuse is enabled. Extra usage will be charged."))}let D=kh(),A=Zb("cdk.out"),b=await ko(()=>Rm(Fm()),{operationName:"loading construct metadata",fallbackValue:{}})??{},E={},T=!1,k=!1,S=0,$=new Set,K=Object.keys(e),J=K.length,V=O=>{let{stackName:I,map:_}=O;for(let[B,U]of Object.entries(_))E[`${I}:${B}`]=U};if(J>1)await lo.runAnalysis({title:`Deep Analysis of ${J} CDK Stacks`,steps:K.map((O,I)=>({title:`Analyzing stack ${I+1}/${J}: ${O}`,task:async()=>{let _=e[O],B=await mv({stackName:O,stack:_,selectedServices:o,inlineFindings:t,recommendationMapPerStack:r,pathToLogicalId:s,constructRegistry:b,ruleFilter:a,authToken:c,fingerprint:u,output:n,withIssue:i,tier:p,noCache:d,warnSensitive:m,sensitiveDataDetection:g,cache:h,quotaValidation:y,manifest:A,customRules:D});V({stackName:B.stackName,map:B.recommendationMap}),S+=B.scannedResourceCount;for(let U of B.scannedResourceIds)$.add(`${B.stackName}:${U}`);return!T&&B.hasIssues&&(T=dv(B.recommendationMap)),B.hasSensitiveData&&(k=!0),(n==="summary"||n==="table")&&q.summary(B.summary),B}})),showSummary:!0});else{let[O,I]=Object.entries(e)[0]??[];if(!O||!I)return{recommendationMaps:{},hasCriticalIssues:!1};let _=Object.entries(I.Resources||{}).filter(([,U])=>!U.Type.startsWith("AWS::CDK::")).length;q.analysisStart(O,_);let B=await mv({stackName:O,stack:I,selectedServices:o,inlineFindings:t,recommendationMapPerStack:r,pathToLogicalId:s,constructRegistry:b,ruleFilter:a,authToken:c,fingerprint:u,output:n,withIssue:i,tier:p,noCache:d,warnSensitive:m,sensitiveDataDetection:g,cache:h,quotaValidation:y,manifest:A,customRules:D});V({stackName:B.stackName,map:B.recommendationMap}),S+=B.scannedResourceCount;for(let U of B.scannedResourceIds)$.add(`${B.stackName}:${U}`);B.hasIssues&&(T=dv(B.recommendationMap)),B.hasSensitiveData&&(k=!0),(n==="summary"||n==="table")&&q.summary(B.summary)}if(Object.keys(E).length>0&&J>1){let O=xo(E,S,$);if(n==="table"||n==="summary")q.section("Overall Analysis Summary","\u{1F4CA}"),Pr("Overall",O),Wr(E);else if(n==="sarif"){let I=So("consolidated",E),_="consolidated_analysis_report.sarif";fv.writeFileSync(_,JSON.stringify(I,null,2)),q.info(`\u{1F4C4} Consolidated SARIF report written to: ${_}`)}else n==="github-actions"&&Co("consolidated",E,O.severityCounts,S)}else if(n==="table"||n==="summary")if(Object.keys(E).length>0){let O=xo(E,S,$);q.section("Overall Analysis Summary","\u{1F4CA}"),Pr("Overall",O),Wr(E)}else q.success("No issues found across all stacks!");return{recommendationMaps:E,hasCriticalIssues:!!l&&T||k&&!m,hasSensitiveData:k}};0&&(module.exports={CDK_INSIGHTS_ANNOTATION_PREFIX,CDK_INSIGHTS_METADATA_VERSION,CdkInsightsAspect,ExtremelyHelpfulConsoleLogger,clearCaches,createCdkInsightsAspect,createCdkInsightsLogger,createExtremelyHelpfulConsoleLogger,getCacheStats,isCdkDebugEnabled,runAnalysis});
404
+ `),u=nv(c,"metadata_trace");if(u)return u}let n=e.node.id,r=e.node.path,i=es.Stack.of(e),o=UT(n,r,i.stackName,t);return o||void 0}catch{}},VT=(e,t=10)=>{let s=e.node.scope,n=0;for(;s&&n<t;){let r=s.node.id,i=s.constructor.name;if(i==="Stack"||i==="App"||!r){s=s.node.scope,n++;continue}let o=iv(s,r);if(o)return{location:o,ancestorId:r,ancestorType:i};s=s.node.scope,n++}},KT=(e,t,s)=>{let n=e.constructor.name,r={CfnSubnet:"Vpc",CfnRouteTable:"Vpc or Subnet",CfnRoute:"Vpc or Subnet",CfnSubnetRouteTableAssociation:"Subnet",CfnInternetGateway:"Vpc",CfnVPCGatewayAttachment:"Vpc",CfnNatGateway:"Vpc (public subnet)",CfnEIP:"Vpc (for NAT Gateway)",CfnSecurityGroup:"Vpc or other L2 construct",CfnSecurityGroupIngress:"SecurityGroup",CfnSecurityGroupEgress:"SecurityGroup",CfnDBSubnetGroup:"DatabaseInstance or DatabaseCluster",CfnLogGroup:"Lambda Function or other service",CfnRole:"Lambda Function, ECS Task, or other service",CfnPolicy:"Role or User",CfnInstanceProfile:"Role"};if(t&&s)return`Created by ${t.replace(/\d+$/,"")} construct '${s}'`;let i=r[n];if(i){let o=e.node.scope;if(o&&o.node){let a=o.node.id,c=o.constructor.name.replace(/\d+$/,"");if(a&&c!=="Stack")return`Created by ${c} construct '${a}'`}return`Implicitly created by ${i}`}},ZT=(e,t,s,n)=>{let r=[];t&&r.push(`'${t}'`);let i=e.split("/").filter(a=>a&&a!=="Resource"&&a!=="Default"&&!a.startsWith("Cfn")),o=i[i.length-1];if(o&&o!==t&&r.push(`'${o}'`),i.length>1){let a=i[i.length-2];a&&a!==t&&a!==o&&r.push(`'${a}'`)}if(s){let a=s.replace(/\d+$/,"");r.push(`new ${a}(`)}if(n){let a=n.split("::").pop()??"";a&&!r.some(c=>c.includes(a))&&r.push(`${a}`)}return r.length===0?`Search for: ${e}`:`Search for: ${r.slice(0,3).join(" or ")}`},YT={"AWS::S3":"Storage","AWS::DynamoDB":"Database","AWS::RDS":"Database","AWS::Lambda":"Compute","AWS::EC2":"Compute","AWS::ECS":"Containers","AWS::EKS":"Containers","AWS::IAM":"Security","AWS::KMS":"Security","AWS::SecretsManager":"Security","AWS::CloudWatch":"Management","AWS::CloudTrail":"Management","AWS::SNS":"Messaging","AWS::SQS":"Messaging","AWS::EventBridge":"Messaging","AWS::ApiGateway":"Networking","AWS::CloudFront":"Networking","AWS::ELB":"Networking","AWS::ElasticLoadBalancing":"Networking","AWS::VPC":"Networking","AWS::Route53":"Networking","AWS::Cognito":"Security","AWS::WAF":"Security","AWS::StepFunctions":"Integration","AWS::Kinesis":"Analytics","AWS::Glue":"Analytics","AWS::Athena":"Analytics","AWS::Redshift":"Analytics"},JT=[{pattern:/encryption|encrypted|kmsKey|sseSpecification/i,recommendation:"Enable encryption for data at rest",checkDefault:e=>e===!1||e===void 0||e===null},{pattern:/publicAccess|publicRead|publiclyAccessible/i,recommendation:"Restrict public access unless explicitly required",checkDefault:e=>e===!0},{pattern:/logging|accessLog|trailName/i,recommendation:"Enable logging for audit and compliance",checkDefault:e=>e===!1||e===void 0},{pattern:/versioning|versioningConfiguration/i,recommendation:"Enable versioning for data protection",checkDefault:e=>e===void 0||typeof e=="object"&&e!==null&&e.status!=="Enabled"},{pattern:/backupRetention|deletionProtection|deleteProtection/i,recommendation:"Configure backup and deletion protection",checkDefault:e=>e===!1||e===0||e===void 0},{pattern:/multiAz|multiAZ/i,recommendation:"Enable Multi-AZ for high availability",checkDefault:e=>e===!1},{pattern:/securityGroup|ingressRules|egressRules/i,recommendation:"Review security group rules"},{pattern:/iamRole|assumeRolePolicy|policyDocument/i,recommendation:"Review IAM permissions for least privilege"}],QT=e=>{try{let t=e.node.scope;if(!t)return{};let s=t.constructor.name;if(s.startsWith("Cfn")){let n=t.node?.scope;if(n)return{l2Type:n.constructor.name,l2Id:n.node?.id,l2Fqn:Ou(n)}}else return{l2Type:s,l2Id:t.node?.id,l2Fqn:Ou(t)}}catch{}return{}},Ou=e=>{try{let t=e;if(t.constructor.__jsii__?.fqn)return t.constructor.__jsii__.fqn;if(typeof t.constructor.fqn=="string")return t.constructor.fqn;let s=e.constructor.name;return s.startsWith("Cfn")?`aws-cdk-lib.${s}`:s}catch{return}},XT=e=>{let t=[];try{let s=e;for(;s;)t.unshift({id:s.node.id,type:s.constructor.name,fqn:Ou(s)}),s=s.node.scope}catch{}return t},ek=e=>{for(let[t,s]of Object.entries(YT))if(e.startsWith(t))return s},tk=e=>{let t=[];try{let n=e.cfnProperties;if(!n)return t;let r=(o,a)=>{for(let{pattern:c,recommendation:u,checkDefault:l}of JT)if(c.test(o)){let p=l?l(a):void 0,d=null;typeof a=="boolean"||typeof a=="number"?d=a:a==null?d=null:typeof a=="string"&&!es.Token.isUnresolved(a)?d=a.length>50?`${a.substring(0,47)}...`:a:typeof a=="string"?d="[Token]":d="[Object]",t.push({path:o,value:d,isDefault:p,recommendation:p?u:void 0});break}},i=(o,a="")=>{for(let[c,u]of Object.entries(o)){let l=a?`${a}.${c}`:c;r(l,u),u&&typeof u=="object"&&!Array.isArray(u)&&!es.Token.isUnresolved(u)&&i(u,l)}};i(n)}catch{}return t},sk=e=>{try{let s=e.cfnProperties;if(!s)return!0;let n=0;for(let r of Object.values(s))r!==void 0&&!es.Token.isUnresolved(r)&&n++;return n<3}catch{return!1}},nk=(e,t={})=>{let{captureSourceLocation:s=!0,captureTags:n=!0,captureRelationships:r=!0,captureHierarchy:i=!0,captureDependencies:o=!0,captureSensitiveProperties:a=!0}=t;if(!("cfnResourceType"in e))return null;let c=es.Stack.of(e),u=e.node.path,l=e.constructor.name,p=e.node.id,d=e,f=d.cfnResourceType,m;try{m=c.getLogicalId(d)}catch{}let{l2Type:g,l2Id:h}=QT(e),b=h?`${h} (${g||l})`:`${p} (${l})`,y={source:"cdk_insights",version:Bu,stackName:c.stackName,stackId:c.node.id,constructPath:u,constructType:l,friendlyName:b,timestamp:new Date().toISOString(),cfnResourceType:f};p&&(y.id=p),m&&(y.logicalId=m),g&&(y.l2ConstructType=g),h&&(y.l2ConstructId=h);let S=ek(f);if(S&&(y.serviceCategory=S),s){let D=iv(e,h);if(D)y.sourceLocation=D;else{let T=VT(e);T&&(y.rootSourceLocation=T.location),y.searchHint=ZT(u,h,g,f)}let E=KT(e,g,h);E&&(y.createdBy=E)}if(r){let D=e.node.scope;D&&(y.parentPath=D.node.path),y.childCount=e.node.children.length}if(i){let D=XT(e);D.length>0&&(y.constructHierarchy=D)}if(o)try{let D=e.node.dependencies;if(D.length>0){let E=[];for(let T of D)if("cfnResourceType"in T)try{let k=c.getLogicalId(T);k&&E.push(k)}catch{}E.length>0&&(y.dependencies=E)}}catch{}if(a){let D=tk(e);D.length>0&&(y.sensitiveProperties=D),y.usesDefaults=sk(e)}if(n)try{let D=d.tagsRaw;if(D&&Object.keys(D).length>0)y.tags=D;else{let E=d.tags;if(E&&typeof E.renderTags=="function"){let T=E.renderTags();T&&Object.keys(T).length>0&&(y.tags=T)}}}catch{}try{let D=c.cdkVersion;D&&(y.cdkVersion=D)}catch{}return y},ov=(e,t,s={})=>{if(NT(),t)try{t.visit(e)}catch(r){_e.warn(`CDK-Nag error suppressed for ${e.node.path}: ${r.message}`)}let n=nk(e,{captureSourceLocation:s.captureSourceLocation,captureTags:s.captureTags,captureRelationships:s.captureRelationships,captureHierarchy:s.captureHierarchy,captureDependencies:s.captureDependencies,captureSensitiveProperties:s.captureSensitiveProperties});n&&es.Annotations.of(e).addInfo(`${Mu}${JSON.stringify(n)}`)},av=(e={})=>{let{logCompliance:t=!1,logNotApplicable:s=!1,verbose:n=!1}=e;return{onCompliance:r=>{t&&_e.debug(`\u2713 ${r.resource.logicalId} is compliant with ${r.ruleId}`)},onNonCompliance:r=>{_e.warn(`\u2717 ${r.resource.logicalId} is non-compliant with ${r.ruleId}: ${r.ruleInfo}`)},onSuppressed:r=>{n&&_e.info(`\u2298 ${r.ruleId} suppressed on ${r.resource.logicalId}: ${r.suppressionReason}`)},onError:r=>{_e.error(`\u26A0 ${r.ruleId} error during validation: ${r.errorMessage}`)},onSuppressedError:r=>{n&&_e.warn(`\u2298 ${r.ruleId} error suppressed: ${r.errorSuppressionReason}`)},onNotApplicable:r=>{s&&n&&_e.debug(`- ${r.ruleId} not applicable to ${r.resource.logicalId}`)}}},cv=(e={})=>{let{logCompliance:t=!0,logNotApplicable:s=!1,verbose:n=!1}=e;return{onCompliance:r=>{t&&_e.info(`Yay! ${r.resource.logicalId} is compliant with ${r.ruleId}`)},onNonCompliance:r=>{_e.warn(`Boo! ${r.resource.logicalId} is non-compliant with ${r.ruleId}`)},onSuppressed:r=>{n&&_e.info(`Hmmmm... ${r.ruleId} has been suppressed on ${r.resource.logicalId} with reason: ${r.suppressionReason}`)},onError:r=>{_e.error(`WHAT?!?! ${r.ruleId} encountered an error during validation!`)},onSuppressedError:r=>{n&&_e.warn(`PHEW! ${r.ruleId} error was suppressed: ${r.errorSuppressionReason}`)},onNotApplicable:r=>{s&&n&&_e.debug(`Meh. ${r.ruleId} and ${r.resource.logicalId} aren't related at all.`)}}},uv=(e={})=>{let{runNagChecks:t=!0,captureSourceLocation:s=!0,captureTags:n=!0,captureRelationships:r=!0,captureHierarchy:i=!0,captureDependencies:o=!0,captureSensitiveProperties:a=!0}=e,c=t?new Gr.AwsSolutionsChecks:null;return{visit:u=>{ov(u,c,{captureSourceLocation:s,captureTags:n,captureRelationships:r,captureHierarchy:i,captureDependencies:o,captureSensitiveProperties:a})}}},Ur=class{options;constructor(t={}){this.options={logCompliance:!0,logNotApplicable:!1,verbose:!1,...t}}onCompliance(t){this.options.logCompliance&&_e.info(`Yay! ${t.resource.logicalId} is compliant with ${t.ruleId}`)}onNonCompliance(t){_e.warn(`Boo! ${t.resource.logicalId} is non-compliant with ${t.ruleId}`)}onSuppressed(t){this.options.verbose&&_e.info(`Hmmmm... ${t.ruleId} has been suppressed on ${t.resource.logicalId} with reason: ${t.suppressionReason}`)}onError(t){_e.error(`WHAT?!?! ${t.ruleId} encountered an error during validation!`)}onSuppressedError(t){this.options.verbose&&_e.warn(`PHEW! ${t.ruleId} error was suppressed: ${t.errorSuppressionReason}`)}onNotApplicable(t){this.options.logNotApplicable&&this.options.verbose&&_e.debug(`Meh. ${t.ruleId} and ${t.resource.logicalId} aren't related at all.`)}},Io=class extends Gr.NagPack{delegate;options;constructor(t){super(t),this.packName="CdkInsights",this.options={runNagChecks:t?.runNagChecks??!0,captureSourceLocation:t?.captureSourceLocation??!0,captureTags:t?.captureTags??!0,captureRelationships:t?.captureRelationships??!0,captureHierarchy:t?.captureHierarchy??!0,captureDependencies:t?.captureDependencies??!0,captureSensitiveProperties:t?.captureSensitiveProperties??!0,logger:t?.logger},this.loggers.push(new Ur(this.options.logger)),this.delegate=new Gr.AwsSolutionsChecks}visit(t){ov(t,this.options.runNagChecks?this.delegate:null,this.options)}};var lv=()=>{wo.clear(),zn.clear(),gs.clear(),Pu=!1},pv=()=>({sourceFiles:wo.size,constructLocations:zn.size,sourceMaps:gs.size});var ko=async(e,t)=>{try{return await e()}catch(s){return Ve.warn(`\u26A0\uFE0F Error in ${t.operationName}:`,{error:s}),t.fallbackValue}},rk=e=>!e||e.length===0||e.includes("All services"),ik=(e,t)=>{if(rk(t))return e;let s=new Set((t??[]).map(n=>`AWS::${n}::`));return Object.fromEntries(Object.entries(e).filter(([,n])=>{for(let r of s)if(n.Type.startsWith(r))return!0;return!1}))},ok=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>!t.Type.startsWith("AWS::CDK::"))),ak=e=>{let{stackName:t,pathToLogicalId:s}=e;return n=>({resourceId:n,friendlyName:s[n]??n,cdkPath:`${t}/${n}`,isGenerated:!1,sources:{cdkInsights:{issues:[]},cdkNag:{issues:[]}}})},Qs=(e,t,s)=>{let n=e[t];if(n)return n;let r=s(t);return e[t]=r,r},ck=e=>[...e.sources?.cdkInsights?.issues??[],...e.sources?.cdkNag?.issues??[]],dv=e=>{for(let t of Object.values(e)){for(let s of t.sources?.cdkInsights?.issues??[])if(s.severity==="CRITICAL")return!0;for(let s of t.sources?.cdkNag?.issues??[])if(s.severity==="CRITICAL")return!0}return!1},uk=e=>{for(let[t,s]of Object.entries(e))(s.sources?.cdkInsights?.issues?.length??0)>0||(s.sources?.cdkNag?.issues?.length??0)>0||delete e[t];return e},To=(e,t,s,n,r,i,o)=>({resourceId:e,issue:t,recommendation:s,severity:n,wafPillar:r,foundBy:o,constructPath:i}),lk=e=>{let{recommendationMap:t,stackName:s,stackResources:n,manifest:r}=e;try{let i=new Map,o=a=>{let c=i.get(a);if(c)return c;let u=VD(r,a);return i.set(a,u),u};return Object.entries(t).reduce((a,[c,u])=>{let l=u.cdkPath||c,p=o(l),d=n[c]?.Type||"Unknown",f=m=>({...m,...p?.filePath&&{sourceLocation:{filePath:p.filePath,line:p.line||1,column:p.column||1,confidence:p.confidence||"low"}},stackName:s,constructType:d});return a[c]={...u,sources:{cdkInsights:{issues:(u.sources?.cdkInsights?.issues??[]).map(f)},cdkNag:{issues:(u.sources?.cdkNag?.issues??[]).map(f)}}},a},{})}catch(i){return Ve.warn("\u26A0\uFE0F Could not enrich issues with source location:",{error:i}),t}},pk=e=>{let{authToken:t,fingerprint:s,tier:n,quotaValidation:r}=e,i=!!(t&&s&&n),o=!r||r.canRunStaticAnalysis,a=!r||r.canRunAIAnalysis,c=!!(n&&Ar.isFeatureEnabled("aiAnalysis",n));return{hasAuth:i,canRunStatic:o,canRunAI:i&&c&&a,isAiEnabledByTier:c,canRunAIByQuota:a}},dk=async e=>{let{userResources:t,selectedServices:s,constructRegistry:n,canRunStatic:r,customRules:i=[]}=e,o=Object.keys(t).length;return o===0?{}:r?(q.phase1(`Static analysis on ${o} resource${o===1?"":"s"}`),await ko(()=>Promise.resolve(wh({Resources:t},To,s||[],n,i)),{operationName:"static analysis",fallbackValue:{}})??{}):(q.warning("\u26A0\uFE0F Static analysis skipped due to license restrictions"),{})},mk=async e=>{let{stackName:t,userResources:s,inlineFindings:n,pathToLogicalId:r,authToken:i,fingerprint:o,tier:a,noCache:c=!1,cache:u,capabilities:l}=e,p=Object.keys(s).length;if(p===0)return{};if(!l.hasAuth)return{};if(a&&!l.isAiEnabledByTier)return q.comment("\u{1F4A1} AI analysis is available with Pro tier - upgrade for deeper insights"),{};if(!l.canRunAIByQuota&&l.canRunStatic)return q.comment("\u{1F4A1} AI analysis skipped due to trial quota limits - upgrade to Pro for unlimited AI analysis"),{};if(!l.canRunAI)return{};if(!i||!o)return Ve.warn("AI analysis skipped: missing authToken or fingerprint"),{};q.phase2(`AI analysis on ${p} resource${p===1?"":"s"}`);let d=sv(),f=UD(zt,d),m=hy(Vb),g=ID({analyzeResource:f,redactResources:m});return await ko(()=>g({stackName:t,resources:s,authToken:i,existingFindingsMap:n,pathToLogicalId:r,fingerprint:o,noCache:c,cacheConfig:u}),{operationName:"AI analysis",fallbackValue:{}})??{}},fk=e=>{let{recommendationMap:t,ruleFilter:s}=e;if(s.length===0)return t;for(let[n,r]of Object.entries(t)){let i=ck(r),o=pu(i,s);if(o.length===0){delete t[n];continue}r.sources||(r.sources={cdkInsights:{issues:[]},cdkNag:{issues:[]}}),r.sources.cdkInsights||(r.sources.cdkInsights={issues:[]}),r.sources.cdkNag||(r.sources.cdkNag={issues:[]}),r.sources.cdkInsights.issues=o.filter(a=>a.foundBy==="cdkInsights"),r.sources.cdkNag.issues=o.filter(a=>a.foundBy==="cdkNag")}return t},gk=async e=>{let{stackName:t,recommendationMap:s,summary:n,tier:r}=e;if(!r||!Ar.isFeatureEnabled("githubIntegration",r)){q.warning("GitHub integration is not available for your current tier"),q.comment(ny("githubIntegration",r??"free","GitHub integration"));return}let i=WD(),o=!!process.env.GITHUB_TOKEN;if(!i&&!o){q.warning("GitHub CLI not found and GITHUB_TOKEN not set. Skipping issue creation."),q.comment("Install GitHub CLI (gh) or set GITHUB_TOKEN environment variable to enable issue creation.");return}q.section("Creating GitHub Issue","\u{1F419}");let a=jn(t,s,n);await ko(()=>MD({stackName:t,issueTitle:`CDK Insights Analysis for ${t}`,issueBody:a,ghCli:i,recommendations:s,summary:n}),{operationName:"creating GitHub issue"})},mv=async({stackName:e,stack:t,selectedServices:s,inlineFindings:n,recommendationMapPerStack:r,pathToLogicalId:i,constructRegistry:o,ruleFilter:a,authToken:c,fingerprint:u,output:l,withIssue:p,tier:d,noCache:f=!1,warnSensitive:m=!1,sensitiveDataDetection:g={},cache:h,quotaValidation:b,manifest:y,customRules:S=[]})=>{let D=t.Resources??{},E=ik(D,s),T=ok(E),k=new Set(Object.keys(T)),C=k.size,$=pk({authToken:c,fingerprint:u,tier:d,quotaValidation:b}),K=ak({stackName:e,pathToLogicalId:i}),J=r[e]||{},V=ie=>{let de=K(ie),ge=J[ie];return ge?{...de,...ge,sources:de.sources}:de},Z=$.canRunAI?Object.fromEntries(Object.keys(T).map(ie=>[ie,V(ie)])):{};for(let ie of n)Qs(Z,ie.resourceId,V).sources.cdkNag.issues.push(ie);let O=await dk({userResources:T,selectedServices:s,constructRegistry:o,canRunStatic:$.canRunStatic,customRules:S});for(let[ie,de]of Object.entries(O)){let ge=Qs(Z,ie,V),Lt=de.issues??[];ge.sources.cdkInsights.issues.push(...Lt)}let I=Dc(t,To,a);for(let[ie,de]of Object.entries(I))Qs(Z,ie,V).sources.cdkInsights.issues.push(...de.issues);let _=vi(t,To);for(let[ie,de]of Object.entries(_))Qs(Z,ie,V).sources.cdkInsights.issues.push(...de.issues);let B=bi(t,To);for(let[ie,de]of Object.entries(B))Qs(Z,ie,V).sources.cdkInsights.issues.push(...de.issues);let U=Lu(T,{disabled:g.disabled,ignoreProperties:g.ignoreProperties,allowPatterns:g.allowPatterns,strictMode:g.strictMode}),le=T;if(U.hasSkippedResources){let ie=U.resourcesWithSensitiveData;q.warning(`\u{1F512} Sensitive data detected in ${ie} resource${ie===1?"":"s"} - NOT sent to CDK Insights servers`),le=Object.fromEntries(Object.entries(T).filter(([de])=>!U.skippedResourceIds.includes(de)));for(let de of U.detectionResults)if(de.hasSensitiveData){let ge=Qs(Z,de.resourceId,V),Lt=_u(de,e);ge.sources.cdkInsights.issues.push(Lt)}}let G=await mk({stackName:e,userResources:le,inlineFindings:n,pathToLogicalId:i,authToken:c,fingerprint:u,tier:d,noCache:f,cache:h,capabilities:$});c&&u&&Object.keys(G).length>0&&q.phase3("Processing results...");let W=Jb({staticRecommendations:{},aiRecommendations:G,recommendationMap:Z,ruleFilter:a,filterIssuesByRule:pu});for(let[ie,de]of Object.entries(W.updatedMap)){let ge=Qs(Z,ie,V);ge.sources.cdkInsights.issues.push(...Fr({existing:ge.sources.cdkInsights.issues,incoming:de.sources.cdkInsights.issues}))}fk({recommendationMap:Z,ruleFilter:a}),uk(Z);let se=lk({recommendationMap:Z,stackName:e,stackResources:T,manifest:y}),Ee=xo(se,C,k),De=Object.keys(se).length>0;return r[e]=se,l&&l!=="table"&&qb(l,e,se,!0,Ee),p&&De&&await gk({stackName:e,recommendationMap:se,summary:Ee,tier:d}),{recommendationMap:se,summary:Ee,hasIssues:De,scannedResourceCount:C,scannedResourceIds:k,stackName:e,sensitiveDataSummary:U,hasSensitiveData:U.hasSkippedResources}},hk=async({stacks:e,inlineFindings:t,pathToLogicalId:s,output:n,recommendationMapPerStack:r,withIssue:i,services:o,ruleFilter:a=[],authToken:c,fingerprint:u,failOnCritical:l,tier:p,noCache:d=!1,allowOveruse:f=!1,warnSensitive:m=!1,sensitiveDataDetection:g={},cache:h,quotaValidation:b})=>{if(Ve.info("\u{1F680} Starting CDK Insights analysis",{stackCount:Object.keys(e).length,stackNames:Object.keys(e),hasAuthToken:!!c,hasFingerprint:!!u,tier:p||"unknown",quotaValidation:b?{canRunStaticAnalysis:b.canRunStaticAnalysis,canRunAIAnalysis:b.canRunAIAnalysis,isTrial:b.quota?.isTrial}:null,services:o||["All services"],output:n||"table"}),b&&!b.quota.isTrial&&b.canRunAIAnalysis&&f){let O=b.quota.currentResourcesAnalyzed>=b.quota.maxResources,I=b.quota.wouldExceed;O?(q.warning(`\u26A0\uFE0F You have exceeded your paid allowance (${b.quota.currentResourcesAnalyzed}/${b.quota.maxResources} resources analyzed).`),q.warning(" Proceeding with AI analysis as --allow-overuse is enabled. Extra usage will be charged.")):I&&(q.warning(`\u26A0\uFE0F This analysis will exceed your paid allowance (${b.quota.currentResourcesAnalyzed}/${b.quota.maxResources} resources analyzed).`),q.warning(" Proceeding with AI analysis as --allow-overuse is enabled. Extra usage will be charged."))}let y=kh(),S=Zb("cdk.out"),D=await ko(()=>Rm(Fm()),{operationName:"loading construct metadata",fallbackValue:{}})??{},E={},T=!1,k=!1,C=0,$=new Set,K=Object.keys(e),J=K.length,V=O=>{let{stackName:I,map:_}=O;for(let[B,U]of Object.entries(_))E[`${I}:${B}`]=U};if(J>1)await lo.runAnalysis({title:`Deep Analysis of ${J} CDK Stacks`,steps:K.map((O,I)=>({title:`Analyzing stack ${I+1}/${J}: ${O}`,task:async()=>{let _=e[O],B=await mv({stackName:O,stack:_,selectedServices:o,inlineFindings:t,recommendationMapPerStack:r,pathToLogicalId:s,constructRegistry:D,ruleFilter:a,authToken:c,fingerprint:u,output:n,withIssue:i,tier:p,noCache:d,warnSensitive:m,sensitiveDataDetection:g,cache:h,quotaValidation:b,manifest:S,customRules:y});V({stackName:B.stackName,map:B.recommendationMap}),C+=B.scannedResourceCount;for(let U of B.scannedResourceIds)$.add(`${B.stackName}:${U}`);return!T&&B.hasIssues&&(T=dv(B.recommendationMap)),B.hasSensitiveData&&(k=!0),(n==="summary"||n==="table")&&q.summary(B.summary),B}})),showSummary:!0});else{let[O,I]=Object.entries(e)[0]??[];if(!O||!I)return{recommendationMaps:{},hasCriticalIssues:!1};let _=Object.entries(I.Resources||{}).filter(([,U])=>!U.Type.startsWith("AWS::CDK::")).length;q.analysisStart(O,_);let B=await mv({stackName:O,stack:I,selectedServices:o,inlineFindings:t,recommendationMapPerStack:r,pathToLogicalId:s,constructRegistry:D,ruleFilter:a,authToken:c,fingerprint:u,output:n,withIssue:i,tier:p,noCache:d,warnSensitive:m,sensitiveDataDetection:g,cache:h,quotaValidation:b,manifest:S,customRules:y});V({stackName:B.stackName,map:B.recommendationMap}),C+=B.scannedResourceCount;for(let U of B.scannedResourceIds)$.add(`${B.stackName}:${U}`);B.hasIssues&&(T=dv(B.recommendationMap)),B.hasSensitiveData&&(k=!0),(n==="summary"||n==="table")&&q.summary(B.summary)}if(Object.keys(E).length>0&&J>1){let O=xo(E,C,$);if(n==="table"||n==="summary")q.section("Overall Analysis Summary","\u{1F4CA}"),Pr("Overall",O),Wr(E);else if(n==="sarif"){let I=So("consolidated",E),_="consolidated_analysis_report.sarif";fv.writeFileSync(_,JSON.stringify(I,null,2)),q.info(`\u{1F4C4} Consolidated SARIF report written to: ${_}`)}else n==="github-actions"&&Co("consolidated",E,O.severityCounts,C)}else if(n==="table"||n==="summary")if(Object.keys(E).length>0){let O=xo(E,C,$);q.section("Overall Analysis Summary","\u{1F4CA}"),Pr("Overall",O),Wr(E)}else q.success("No issues found across all stacks!");return{recommendationMaps:E,hasCriticalIssues:!!l&&T||k&&!m,hasSensitiveData:k}};0&&(module.exports={CDK_INSIGHTS_ANNOTATION_PREFIX,CDK_INSIGHTS_METADATA_VERSION,CdkInsightsAspect,ExtremelyHelpfulConsoleLogger,clearCaches,createCdkInsightsAspect,createCdkInsightsLogger,createExtremelyHelpfulConsoleLogger,getCacheStats,isCdkDebugEnabled,runAnalysis});
405
405
  /*! Bundled license information:
406
406
 
407
407
  mime-db/index.js: