@activepieces/piece-google-contacts 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +28 -28
package/src/index.js CHANGED
@@ -1,17 +1,17 @@
1
- "use strict";var ew=Object.create;var Ii=Object.defineProperty;var tw=Object.getOwnPropertyDescriptor;var rw=Object.getOwnPropertyNames;var nw=Object.getPrototypeOf,ow=Object.prototype.hasOwnProperty;var o=(t,e)=>Ii(t,"name",{value:e,configurable:!0});var gt=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var k=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},gs=(t,e)=>{for(var r in e)Ii(t,r,{get:e[r],enumerable:!0})},hh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of rw(e))!ow.call(t,i)&&i!==r&&Ii(t,i,{get:()=>e[i],enumerable:!(n=tw(e,i))||n.enumerable});return t};var pt=(t,e,r)=>(r=t!=null?ew(nw(t)):{},hh(e||!t||!t.__esModule?Ii(r,"default",{value:t,enumerable:!0}):r,t)),iw=t=>hh(Ii({},"__esModule",{value:!0}),t);var Mg=k((Ug,Us)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function l(g,y){if(g.indexOf("::")!==g.lastIndexOf("::"))return null;let T=0,P=-1,x=(g.match(d.zoneIndex)||[])[0],N,L;for(x&&(x=x.substring(1),g=g.replace(/%.+$/,""));(P=g.indexOf(":",P+1))>=0;)T++;if(g.substr(0,2)==="::"&&T--,g.substr(-2,2)==="::"&&T--,T>y)return null;for(L=y-T,N=":";L--;)N+="0:";return g=g.replace("::",N),g[0]===":"&&(g=g.slice(1)),g[g.length-1]===":"&&(g=g.slice(0,-1)),y=(function(){let X=g.split(":"),W=[];for(let G=0;G<X.length;G++)W.push(parseInt(X[G],16));return W})(),{parts:y,zoneId:x}}o(l,"expandIPv6");function p(g,y,T,P){if(g.length!==y.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,N;for(;P>0;){if(N=T-P,N<0&&(N=0),g[x]>>N!==y[x]>>N)return!1;P-=T,x+=1}return!0}o(p,"matchCIDR");function f(g){if(i.test(g))return parseInt(g,16);if(g[0]==="0"&&!isNaN(parseInt(g[1],10))){if(n.test(g))return parseInt(g,8);throw new Error(`ipaddr: cannot parse ${g} as octal`)}return parseInt(g,10)}o(f,"parseIntAuto");function _(g,y){for(;g.length<y;)g=`0${g}`;return g}o(_,"padPart");let h={};h.IPv4=(function(){function g(y){if(y.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let T,P;for(T=0;T<y.length;T++)if(P=y[T],!(0<=P&&P<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=y}return o(g,"IPv4"),g.prototype.SpecialRanges={unspecified:[[new g([0,0,0,0]),8]],broadcast:[[new g([255,255,255,255]),32]],multicast:[[new g([224,0,0,0]),4]],linkLocal:[[new g([169,254,0,0]),16]],loopback:[[new g([127,0,0,0]),8]],carrierGradeNat:[[new g([100,64,0,0]),10]],private:[[new g([10,0,0,0]),8],[new g([172,16,0,0]),12],[new g([192,168,0,0]),16]],reserved:[[new g([192,0,0,0]),24],[new g([192,0,2,0]),24],[new g([192,88,99,0]),24],[new g([198,18,0,0]),15],[new g([198,51,100,0]),24],[new g([203,0,113,0]),24],[new g([240,0,0,0]),4]],as112:[[new g([192,175,48,0]),24],[new g([192,31,196,0]),24]],amt:[[new g([192,52,193,0]),24]]},g.prototype.kind=function(){return"ipv4"},g.prototype.match=function(y,T){let P;if(T===void 0&&(P=y,y=P[0],T=P[1]),y.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return p(this.octets,y.octets,8,T)},g.prototype.prefixLengthFromSubnetMask=function(){let y=0,T=!1,P={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,N,L;for(x=3;x>=0;x-=1)if(N=this.octets[x],N in P){if(L=P[N],T&&L!==0)return null;L!==8&&(T=!0),y+=L}else return null;return 32-y},g.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},g.prototype.toByteArray=function(){return this.octets.slice(0)},g.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},g.prototype.toNormalizedString=function(){return this.toString()},g.prototype.toString=function(){return this.octets.join(".")},g})(),h.IPv4.broadcastAddressFromCIDR=function(g){try{let y=this.parseCIDR(g),T=y[0].toByteArray(),P=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],N=0;for(;N<4;)x.push(parseInt(T[N],10)|parseInt(P[N],10)^255),N++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(g){return this.parser(g)!==null},h.IPv4.isValid=function(g){try{return new this(this.parser(g)),!0}catch{return!1}},h.IPv4.isValidCIDR=function(g){try{return this.parseCIDR(g),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(g){return!!(h.IPv4.isValid(g)&&g.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.isValidCIDRFourPartDecimal=function(g){let y=g.match(/^(.+)\/(\d+)$/);return!h.IPv4.isValidCIDR(g)||!y?!1:h.IPv4.isValidFourPartDecimal(y[1])},h.IPv4.networkAddressFromCIDR=function(g){let y,T,P,x,N;try{for(y=this.parseCIDR(g),P=y[0].toByteArray(),N=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],T=0;T<4;)x.push(parseInt(P[T],10)&parseInt(N[T],10)),T++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.parse=function(g){let y=this.parser(g);if(y===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(y)},h.IPv4.parseCIDR=function(g){let y;if(y=g.match(/^(.+)\/(\d+)$/)){let T=parseInt(y[2]);if(T>=0&&T<=32){let P=[this.parse(y[1]),T];return Object.defineProperty(P,"toString",{value:o(function(){return this.join("/")},"value")}),P}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},h.IPv4.parser=function(g){let y,T,P;if(y=g.match(r.fourOctet))return(function(){let x=y.slice(1,6),N=[];for(let L=0;L<x.length;L++)T=x[L],N.push(f(T));return N})();if(y=g.match(r.longValue)){if(P=f(y[1]),P>4294967295||P<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],N;for(N=0;N<=24;N+=8)x.push(P>>N&255);return x})().reverse()}else return(y=g.match(r.twoOctet))?(function(){let x=y.slice(1,4),N=[];if(P=f(x[1]),P>16777215||P<0)throw new Error("ipaddr: address outside defined range");return N.push(f(x[0])),N.push(P>>16&255),N.push(P>>8&255),N.push(P&255),N})():(y=g.match(r.threeOctet))?(function(){let x=y.slice(1,5),N=[];if(P=f(x[2]),P>65535||P<0)throw new Error("ipaddr: address outside defined range");return N.push(f(x[0])),N.push(f(x[1])),N.push(P>>8&255),N.push(P&255),N})():null},h.IPv4.subnetMaskFromPrefixLength=function(g){if(g=parseInt(g),g<0||g>32)throw new Error("ipaddr: invalid IPv4 prefix length");let y=[0,0,0,0],T=0,P=Math.floor(g/8);for(;T<P;)y[T]=255,T++;return P<4&&(y[P]=Math.pow(2,g%8)-1<<8-g%8),new this(y)},h.IPv6=(function(){function g(y,T){let P,x;if(y.length===16)for(this.parts=[],P=0;P<=14;P+=2)this.parts.push(y[P]<<8|y[P+1]);else if(y.length===8)this.parts=y;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(P=0;P<this.parts.length;P++)if(x=this.parts[P],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");T&&(this.zoneId=T)}return o(g,"IPv6"),g.prototype.SpecialRanges={unspecified:[new g([0,0,0,0,0,0,0,0]),128],linkLocal:[new g([65152,0,0,0,0,0,0,0]),10],multicast:[new g([65280,0,0,0,0,0,0,0]),8],loopback:[new g([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new g([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new g([0,0,0,0,0,65535,0,0]),96],discard:[new g([256,0,0,0,0,0,0,0]),64],rfc6145:[new g([0,0,0,0,65535,0,0,0]),96],rfc6052:[new g([100,65435,0,0,0,0,0,0]),96],"6to4":[new g([8194,0,0,0,0,0,0,0]),16],teredo:[new g([8193,0,0,0,0,0,0,0]),32],benchmarking:[new g([8193,2,0,0,0,0,0,0]),48],amt:[new g([8193,3,0,0,0,0,0,0]),32],as112v6:[[new g([8193,4,274,0,0,0,0,0]),48],[new g([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new g([8193,16,0,0,0,0,0,0]),28],orchid2:[new g([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new g([8193,48,0,0,0,0,0,0]),28],reserved:[[new g([8193,0,0,0,0,0,0,0]),23],[new g([8193,3512,0,0,0,0,0,0]),32]]},g.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},g.prototype.kind=function(){return"ipv6"},g.prototype.match=function(y,T){let P;if(T===void 0&&(P=y,y=P[0],T=P[1]),y.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return p(this.parts,y.parts,16,T)},g.prototype.prefixLengthFromSubnetMask=function(){let y=0,T=!1,P={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,N;for(let L=7;L>=0;L-=1)if(x=this.parts[L],x in P){if(N=P[x],T&&N!==0)return null;N!==16&&(T=!0),y+=N}else return null;return 128-y},g.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},g.prototype.toByteArray=function(){let y,T=[],P=this.parts;for(let x=0;x<P.length;x++)y=P[x],T.push(y>>8),T.push(y&255);return T},g.prototype.toFixedLengthString=function(){let y=(function(){let P=[];for(let x=0;x<this.parts.length;x++)P.push(_(this.parts[x].toString(16),4));return P}).call(this).join(":"),T="";return this.zoneId&&(T=`%${this.zoneId}`),y+T},g.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let y=this.parts.slice(-2),T=y[0],P=y[1];return new h.IPv4([T>>8,T&255,P>>8,P&255])},g.prototype.toNormalizedString=function(){let y=(function(){let P=[];for(let x=0;x<this.parts.length;x++)P.push(this.parts[x].toString(16));return P}).call(this).join(":"),T="";return this.zoneId&&(T=`%${this.zoneId}`),y+T},g.prototype.toRFC5952String=function(){let y=/((^|:)(0(:|$)){2,})/g,T=this.toNormalizedString(),P=0,x=-1,N;for(;N=y.exec(T);)N[0].length>x&&(P=N.index,x=N[0].length);return x<0?T:`${T.substring(0,P)}::${T.substring(P+x)}`},g.prototype.toString=function(){return this.toRFC5952String()},g})(),h.IPv6.broadcastAddressFromCIDR=function(g){try{let y=this.parseCIDR(g),T=y[0].toByteArray(),P=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],N=0;for(;N<16;)x.push(parseInt(T[N],10)|parseInt(P[N],10)^255),N++;return new this(x)}catch(y){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${y})`)}},h.IPv6.isIPv6=function(g){return this.parser(g)!==null},h.IPv6.isValid=function(g){if(typeof g=="string"&&g.indexOf(":")===-1)return!1;try{let y=this.parser(g);return new this(y.parts,y.zoneId),!0}catch{return!1}},h.IPv6.isValidCIDR=function(g){if(typeof g=="string"&&g.indexOf(":")===-1)return!1;try{return this.parseCIDR(g),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(g){let y,T,P,x,N;try{for(y=this.parseCIDR(g),P=y[0].toByteArray(),N=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],T=0;T<16;)x.push(parseInt(P[T],10)&parseInt(N[T],10)),T++;return new this(x)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},h.IPv6.parse=function(g){let y=this.parser(g);if(y.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(y.parts,y.zoneId)},h.IPv6.parseCIDR=function(g){let y,T,P;if((T=g.match(/^(.+)\/(\d+)$/))&&(y=parseInt(T[2]),y>=0&&y<=128))return P=[this.parse(T[1]),y],Object.defineProperty(P,"toString",{value:o(function(){return this.join("/")},"value")}),P;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},h.IPv6.parser=function(g){let y,T,P,x,N,L;if(P=g.match(d.deprecatedTransitional))return this.parser(`::ffff:${P[1]}`);if(d.native.test(g))return l(g,8);if((P=g.match(d.transitional))&&(L=P[6]||"",y=P[1],P[1].endsWith("::")||(y=y.slice(0,-1)),y=l(y+L,6),y.parts)){for(N=[parseInt(P[2]),parseInt(P[3]),parseInt(P[4]),parseInt(P[5])],T=0;T<N.length;T++)if(x=N[T],!(0<=x&&x<=255))return null;return y.parts.push(N[0]<<8|N[1]),y.parts.push(N[2]<<8|N[3]),{parts:y.parts,zoneId:y.zoneId}}return null},h.IPv6.subnetMaskFromPrefixLength=function(g){if(g=parseInt(g),g<0||g>128)throw new Error("ipaddr: invalid IPv6 prefix length");let y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],T=0,P=Math.floor(g/8);for(;T<P;)y[T]=255,T++;return P<16&&(y[P]=Math.pow(2,g%8)-1<<8-g%8),new this(y)},h.fromByteArray=function(g){let y=g.length;if(y===4)return new h.IPv4(g);if(y===16)return new h.IPv6(g);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},h.isValid=function(g){return h.IPv6.isValid(g)||h.IPv4.isValid(g)},h.isValidCIDR=function(g){return h.IPv6.isValidCIDR(g)||h.IPv4.isValidCIDR(g)},h.parse=function(g){if(h.IPv6.isValid(g))return h.IPv6.parse(g);if(h.IPv4.isValid(g))return h.IPv4.parse(g);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},h.parseCIDR=function(g){try{return h.IPv6.parseCIDR(g)}catch{try{return h.IPv4.parseCIDR(g)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},h.process=function(g){let y=this.parse(g);return y.kind()==="ipv6"&&y.isIPv4MappedAddress()?y.toIPv4Address():y},h.subnetMatch=function(g,y,T){let P,x,N,L;T==null&&(T="unicast");for(x in y)if(Object.prototype.hasOwnProperty.call(y,x)){for(N=y[x],N[0]&&!(N[0]instanceof Array)&&(N=[N]),P=0;P<N.length;P++)if(L=N[P],g.kind()===L[0].kind()&&g.match.apply(g,L))return x}return T},typeof Us<"u"&&Us.exports?Us.exports=h:t.ipaddr=h})(Ug)});var Ly=k((iK,jy)=>{var My=require("stream").Stream,FR=require("util");jy.exports=fr;function fr(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(fr,"DelayedStream");FR.inherits(fr,My);fr.create=function(t,e){var r=new this;e=e||{};for(var n in e)r[n]=e[n];r.source=t;var i=t.emit;return t.emit=function(){return r._handleEmit(arguments),i.apply(t,arguments)},t.on("error",function(){}),r.pauseStream&&t.pause(),r};Object.defineProperty(fr.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});fr.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};fr.prototype.resume=function(){this._released||this.release(),this.source.resume()};fr.prototype.pause=function(){this.source.pause()};fr.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};fr.prototype.pipe=function(){var t=My.prototype.pipe.apply(this,arguments);return this.resume(),t};fr.prototype._handleEmit=function(t){if(this._released){this.emit.apply(this,t);return}t[0]==="data"&&(this.dataSize+=t[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(t)};fr.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(t))}}});var Vy=k((sK,qy)=>{var BR=require("util"),By=require("stream").Stream,Fy=Ly();qy.exports=ot;function ot(){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}o(ot,"CombinedStream");BR.inherits(ot,By);ot.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};ot.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};ot.prototype.append=function(t){var e=ot.isStreamLike(t);if(e){if(!(t instanceof Fy)){var r=Fy.create(t,{maxDataSize:1/0,pauseStream:this.pauseStreams});t.on("data",this._checkDataSize.bind(this)),t=r}this._handleErrors(t),this.pauseStreams&&t.pause()}return this._streams.push(t),this};ot.prototype.pipe=function(t,e){return By.prototype.pipe.call(this,t,e),this.resume(),t};ot.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}};ot.prototype._realGetNext=function(){var t=this._streams.shift();if(typeof t>"u"){this.end();return}if(typeof t!="function"){this._pipeNext(t);return}var e=t;e(function(r){var n=ot.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ot.prototype._pipeNext=function(t){this._currentStream=t;var e=ot.isStreamLike(t);if(e){t.on("end",this._getNext.bind(this)),t.pipe(this,{end:!1});return}var r=t;this.write(r),this._getNext()};ot.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};ot.prototype.write=function(t){this.emit("data",t)};ot.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ot.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")};ot.prototype.end=function(){this._reset(),this.emit("end")};ot.prototype.destroy=function(){this._reset(),this.emit("close")};ot.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ot.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};ot.prototype._updateDataSize=function(){this.dataSize=0;var t=this;this._streams.forEach(function(e){e.dataSize&&(t.dataSize+=e.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};ot.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var Gy=k((cK,Hy)=>{"use strict";Hy.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var Ky=k(Rt=>{"use strict";var Bs=Gy(),qR=require("path").extname,Wy=/^\s*([^;\s]*)(?:;|\s|$)/,VR=/^text\//i;Rt.charset=Zy;Rt.charsets={lookup:Zy};Rt.contentType=HR;Rt.extension=GR;Rt.extensions=Object.create(null);Rt.lookup=WR;Rt.types=Object.create(null);ZR(Rt.extensions,Rt.types);function Zy(t){if(!t||typeof t!="string")return!1;var e=Wy.exec(t),r=e&&Bs[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&VR.test(e[1])?"UTF-8":!1}o(Zy,"charset");function HR(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Rt.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Rt.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(HR,"contentType");function GR(t){if(!t||typeof t!="string")return!1;var e=Wy.exec(t),r=e&&Rt.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(GR,"extension");function WR(t){if(!t||typeof t!="string")return!1;var e=qR("x."+t).toLowerCase().substr(1);return e&&Rt.types[e]||!1}o(WR,"lookup");function ZR(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(Bs).forEach(o(function(i){var s=Bs[i],c=s.extensions;if(!(!c||!c.length)){t[i]=c;for(var d=0;d<c.length;d++){var l=c[d];if(e[l]){var p=r.indexOf(Bs[e[l]].source),f=r.indexOf(s.source);if(e[l]!=="application/octet-stream"&&(p>f||p===f&&e[l].substr(0,12)==="application/"))continue}e[l]=i}}},"forEachMimeType"))}o(ZR,"populateMaps")});var Yy=k((pK,Jy)=>{Jy.exports=KR;function KR(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(KR,"defer")});var ql=k((mK,Qy)=>{var Xy=Yy();Qy.exports=JR;function JR(t){var e=!1;return Xy(function(){e=!0}),o(function(n,i){e?t(n,i):Xy(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(JR,"async")});var Vl=k((gK,e_)=>{e_.exports=YR;function YR(t){Object.keys(t.jobs).forEach(XR.bind(t)),t.jobs={}}o(YR,"abort");function XR(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(XR,"clean")});var Hl=k((_K,r_)=>{var t_=ql(),QR=Vl();r_.exports=eO;function eO(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=tO(e,i,t[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?QR(r):r.results[i]=c,n(s,r.results))})}o(eO,"iterate");function tO(t,e,r,n){var i;return t.length==2?i=t(r,t_(n)):i=t(r,e,t_(n)),i}o(tO,"runJob")});var Gl=k((bK,n_)=>{n_.exports=rO;function rO(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};return e&&n.keyedList.sort(r?e:function(i,s){return e(t[i],t[s])}),n}o(rO,"state")});var Wl=k((SK,o_)=>{var nO=Vl(),oO=ql();o_.exports=iO;function iO(t){Object.keys(this.jobs).length&&(this.index=this.size,nO(this),oO(t)(null,this.results))}o(iO,"terminator")});var a_=k((TK,i_)=>{var aO=Hl(),sO=Gl(),uO=Wl();i_.exports=cO;function cO(t,e,r){for(var n=sO(t);n.index<(n.keyedList||t).length;)aO(t,e,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return uO.bind(n,r)}o(cO,"parallel")});var Zl=k((AK,qs)=>{var s_=Hl(),lO=Gl(),dO=Wl();qs.exports=pO;qs.exports.ascending=u_;qs.exports.descending=fO;function pO(t,e,r,n){var i=lO(t,r);return s_(t,e,i,o(function s(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||t).length){s_(t,e,i,s);return}n(null,i.results)},"iteratorHandler")),dO.bind(i,n)}o(pO,"serialOrdered");function u_(t,e){return t<e?-1:t>e?1:0}o(u_,"ascending");function fO(t,e){return-1*u_(t,e)}o(fO,"descending")});var l_=k((IK,c_)=>{var mO=Zl();c_.exports=hO;function hO(t,e,r){return mO(t,e,null,r)}o(hO,"serial")});var p_=k((OK,d_)=>{d_.exports={parallel:a_(),serial:l_(),serialOrdered:Zl()}});var Kl=k((CK,f_)=>{"use strict";f_.exports=Object});var h_=k(($K,m_)=>{"use strict";m_.exports=Error});var y_=k((kK,g_)=>{"use strict";g_.exports=EvalError});var v_=k((NK,__)=>{"use strict";__.exports=RangeError});var P_=k((zK,b_)=>{"use strict";b_.exports=ReferenceError});var E_=k((DK,S_)=>{"use strict";S_.exports=SyntaxError});var Cn=k((UK,T_)=>{"use strict";T_.exports=TypeError});var A_=k((MK,x_)=>{"use strict";x_.exports=URIError});var I_=k((jK,w_)=>{"use strict";w_.exports=Math.abs});var O_=k((LK,R_)=>{"use strict";R_.exports=Math.floor});var $_=k((FK,C_)=>{"use strict";C_.exports=Math.max});var N_=k((BK,k_)=>{"use strict";k_.exports=Math.min});var D_=k((qK,z_)=>{"use strict";z_.exports=Math.pow});var M_=k((VK,U_)=>{"use strict";U_.exports=Math.round});var L_=k((HK,j_)=>{"use strict";j_.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var B_=k((WK,F_)=>{"use strict";var gO=L_();F_.exports=o(function(e){return gO(e)||e===0?e:e<0?-1:1},"sign")});var V_=k((KK,q_)=>{"use strict";q_.exports=Object.getOwnPropertyDescriptor});var Jl=k((JK,H_)=>{"use strict";var Vs=V_();if(Vs)try{Vs([],"length")}catch{Vs=null}H_.exports=Vs});var W_=k((YK,G_)=>{"use strict";var Hs=Object.defineProperty||!1;if(Hs)try{Hs({},"a",{value:1})}catch{Hs=!1}G_.exports=Hs});var Yl=k((XK,Z_)=>{"use strict";Z_.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var c=Object.getOwnPropertySymbols(e);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(e,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var Y_=k((eJ,J_)=>{"use strict";var K_=typeof Symbol<"u"&&Symbol,yO=Yl();J_.exports=o(function(){return typeof K_!="function"||typeof Symbol!="function"||typeof K_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:yO()},"hasNativeSymbols")});var Xl=k((rJ,X_)=>{"use strict";X_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Ql=k((nJ,Q_)=>{"use strict";var _O=Kl();Q_.exports=_O.getPrototypeOf||null});var rv=k((oJ,tv)=>{"use strict";var vO="Function.prototype.bind called on incompatible ",bO=Object.prototype.toString,PO=Math.max,SO="[object Function]",ev=o(function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var s=0;s<r.length;s+=1)n[s+e.length]=r[s];return n},"concatty"),EO=o(function(e,r){for(var n=[],i=r||0,s=0;i<e.length;i+=1,s+=1)n[s]=e[i];return n},"slicy"),TO=o(function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r},"joiny");tv.exports=o(function(e){var r=this;if(typeof r!="function"||bO.apply(r)!==SO)throw new TypeError(vO+r);for(var n=EO(arguments,1),i,s=o(function(){if(this instanceof i){var f=r.apply(this,ev(n,arguments));return Object(f)===f?f:this}return r.apply(e,ev(n,arguments))},"binder"),c=PO(0,r.length-n.length),d=[],l=0;l<c;l++)d[l]="$"+l;if(i=Function("binder","return function ("+TO(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var p=o(function(){},"Empty");p.prototype=r.prototype,i.prototype=new p,p.prototype=null}return i},"bind")});var Lo=k((aJ,nv)=>{"use strict";var xO=rv();nv.exports=Function.prototype.bind||xO});var Gs=k((sJ,ov)=>{"use strict";ov.exports=Function.prototype.call});var ed=k((uJ,iv)=>{"use strict";iv.exports=Function.prototype.apply});var sv=k((cJ,av)=>{"use strict";av.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var cv=k((lJ,uv)=>{"use strict";var AO=Lo(),wO=ed(),IO=Gs(),RO=sv();uv.exports=RO||AO.call(IO,wO)});var td=k((dJ,lv)=>{"use strict";var OO=Lo(),CO=Cn(),$O=Gs(),kO=cv();lv.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new CO("a function is required");return kO(OO,$O,e)},"callBindBasic")});var gv=k((fJ,hv)=>{"use strict";var NO=td(),dv=Jl(),fv;try{fv=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var rd=!!fv&&dv&&dv(Object.prototype,"__proto__"),mv=Object,pv=mv.getPrototypeOf;hv.exports=rd&&typeof rd.get=="function"?NO([rd.get]):typeof pv=="function"?o(function(e){return pv(e==null?e:mv(e))},"getDunder"):!1});var Pv=k((hJ,bv)=>{"use strict";var yv=Xl(),_v=Ql(),vv=gv();bv.exports=yv?o(function(e){return yv(e)},"getProto"):_v?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return _v(e)},"getProto"):vv?o(function(e){return vv(e)},"getProto"):null});var nd=k((yJ,Sv)=>{"use strict";var zO=Function.prototype.call,DO=Object.prototype.hasOwnProperty,UO=Lo();Sv.exports=UO.call(zO,DO)});var Qi=k((_J,Iv)=>{"use strict";var ke,MO=Kl(),jO=h_(),LO=y_(),FO=v_(),BO=P_(),Vo=E_(),qo=Cn(),qO=A_(),VO=I_(),HO=O_(),GO=$_(),WO=N_(),ZO=D_(),KO=M_(),JO=B_(),Av=Function,od=o(function(t){try{return Av('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),Ji=Jl(),YO=W_(),id=o(function(){throw new qo},"throwTypeError"),XO=Ji?(function(){try{return arguments.callee,id}catch{try{return Ji(arguments,"callee").get}catch{return id}}})():id,Fo=Y_()(),yt=Pv(),QO=Ql(),eC=Xl(),wv=ed(),Yi=Gs(),Bo={},tC=typeof Uint8Array>"u"||!yt?ke:yt(Uint8Array),to={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ke:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ke:ArrayBuffer,"%ArrayIteratorPrototype%":Fo&&yt?yt([][Symbol.iterator]()):ke,"%AsyncFromSyncIteratorPrototype%":ke,"%AsyncFunction%":Bo,"%AsyncGenerator%":Bo,"%AsyncGeneratorFunction%":Bo,"%AsyncIteratorPrototype%":Bo,"%Atomics%":typeof Atomics>"u"?ke:Atomics,"%BigInt%":typeof BigInt>"u"?ke:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ke:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ke:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ke:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":jO,"%eval%":eval,"%EvalError%":LO,"%Float16Array%":typeof Float16Array>"u"?ke:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ke:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ke:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ke:FinalizationRegistry,"%Function%":Av,"%GeneratorFunction%":Bo,"%Int8Array%":typeof Int8Array>"u"?ke:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ke:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ke:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Fo&&yt?yt(yt([][Symbol.iterator]())):ke,"%JSON%":typeof JSON=="object"?JSON:ke,"%Map%":typeof Map>"u"?ke:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Fo||!yt?ke:yt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":MO,"%Object.getOwnPropertyDescriptor%":Ji,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ke:Promise,"%Proxy%":typeof Proxy>"u"?ke:Proxy,"%RangeError%":FO,"%ReferenceError%":BO,"%Reflect%":typeof Reflect>"u"?ke:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ke:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Fo||!yt?ke:yt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ke:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Fo&&yt?yt(""[Symbol.iterator]()):ke,"%Symbol%":Fo?Symbol:ke,"%SyntaxError%":Vo,"%ThrowTypeError%":XO,"%TypedArray%":tC,"%TypeError%":qo,"%Uint8Array%":typeof Uint8Array>"u"?ke:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ke:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ke:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ke:Uint32Array,"%URIError%":qO,"%WeakMap%":typeof WeakMap>"u"?ke:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ke:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ke:WeakSet,"%Function.prototype.call%":Yi,"%Function.prototype.apply%":wv,"%Object.defineProperty%":YO,"%Object.getPrototypeOf%":QO,"%Math.abs%":VO,"%Math.floor%":HO,"%Math.max%":GO,"%Math.min%":WO,"%Math.pow%":ZO,"%Math.round%":KO,"%Math.sign%":JO,"%Reflect.getPrototypeOf%":eC};if(yt)try{null.error}catch(t){Ev=yt(yt(t)),to["%Error.prototype%"]=Ev}var Ev,rC=o(function t(e){var r;if(e==="%AsyncFunction%")r=od("async function () {}");else if(e==="%GeneratorFunction%")r=od("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=od("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&yt&&(r=yt(i.prototype))}return to[e]=r,r},"doEval"),Tv={__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"]},Xi=Lo(),Ws=nd(),nC=Xi.call(Yi,Array.prototype.concat),oC=Xi.call(wv,Array.prototype.splice),xv=Xi.call(Yi,String.prototype.replace),Zs=Xi.call(Yi,String.prototype.slice),iC=Xi.call(Yi,RegExp.prototype.exec),aC=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,sC=/\\(\\)?/g,uC=o(function(e){var r=Zs(e,0,1),n=Zs(e,-1);if(r==="%"&&n!=="%")throw new Vo("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Vo("invalid intrinsic syntax, expected opening `%`");var i=[];return xv(e,aC,function(s,c,d,l){i[i.length]=d?xv(l,sC,"$1"):c||s}),i},"stringToPath"),cC=o(function(e,r){var n=e,i;if(Ws(Tv,n)&&(i=Tv[n],n="%"+i[0]+"%"),Ws(to,n)){var s=to[n];if(s===Bo&&(s=rC(n)),typeof s>"u"&&!r)throw new qo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Vo("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");Iv.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new qo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qo('"allowMissing" argument must be a boolean');if(iC(/^%?[^%]*%?$/,e)===null)throw new Vo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=uC(e),i=n.length>0?n[0]:"",s=cC("%"+i+"%",r),c=s.name,d=s.value,l=!1,p=s.alias;p&&(i=p[0],oC(n,nC([0,1],p)));for(var f=1,_=!0;f<n.length;f+=1){var h=n[f],g=Zs(h,0,1),y=Zs(h,-1);if((g==='"'||g==="'"||g==="`"||y==='"'||y==="'"||y==="`")&&g!==y)throw new Vo("property names with quotes must have matching quotes");if((h==="constructor"||!_)&&(l=!0),i+="."+h,c="%"+i+"%",Ws(to,c))d=to[c];else if(d!=null){if(!(h in d)){if(!r)throw new qo("base intrinsic for "+e+" exists, but the property is not available.");return}if(Ji&&f+1>=n.length){var T=Ji(d,h);_=!!T,_&&"get"in T&&!("originalValue"in T.get)?d=T.get:d=d[h]}else _=Ws(d,h),d=d[h];_&&!l&&(to[c]=d)}}return d},"GetIntrinsic")});var Ov=k((bJ,Rv)=>{"use strict";var lC=Yl();Rv.exports=o(function(){return lC()&&!!Symbol.toStringTag},"hasToStringTagShams")});var kv=k((SJ,$v)=>{"use strict";var dC=Qi(),Cv=dC("%Object.defineProperty%",!0),pC=Ov()(),fC=nd(),mC=Cn(),Ks=pC?Symbol.toStringTag:null;$v.exports=o(function(e,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new mC("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Ks&&(n||!fC(e,Ks))&&(Cv?Cv(e,Ks,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[Ks]=r)},"setToStringTag")});var zv=k((TJ,Nv)=>{"use strict";var hC=Function.prototype.call,gC=Object.prototype.hasOwnProperty,yC=Lo();Nv.exports=yC.call(hC,gC)});var Uv=k((xJ,Dv)=>{"use strict";Dv.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var Lv=k((AJ,jv)=>{"use strict";var cd=Vy(),_C=require("util"),ad=require("path"),vC=require("http"),bC=require("https"),PC=require("url").parse,SC=require("fs"),EC=require("stream").Stream,TC=require("crypto"),sd=Ky(),xC=p_(),AC=kv(),$n=zv(),ud=Uv();function Mv(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Mv,"escapeHeaderParam");function Ue(t){if(!(this instanceof Ue))return new Ue(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],cd.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(Ue,"FormData");_C.inherits(Ue,cd);Ue.LINE_BREAK=`\r
2
- `;Ue.DEFAULT_CONTENT_TYPE="application/octet-stream";Ue.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=cd.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r),s=this._multiPartFooter();n(i),n(e),n(s),this._trackLength(i,e,r)};Ue.prototype._trackLength=function(t,e,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(e)?n=e.length:typeof e=="string"&&(n=Buffer.byteLength(e)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(t)+Ue.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&$n(e,"httpVersion"))&&!(e instanceof EC))&&(r.knownLength||this._valuesToMeasure.push(e))};Ue.prototype._lengthRetriever=function(t,e){$n(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):SC.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):$n(t,"httpVersion")?e(null,Number(t.headers["content-length"])):$n(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};Ue.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),i=this._getContentType(e,r),s="",c={"Content-Disposition":["form-data",'name="'+Mv(t)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&ud(c,r.header);var d;for(var l in c)if($n(c,l)){if(d=c[l],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=l+": "+d.join("; ")+Ue.LINE_BREAK)}return"--"+this.getBoundary()+Ue.LINE_BREAK+s+Ue.LINE_BREAK};Ue.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=ad.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=ad.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&$n(t,"httpVersion")&&(r=ad.basename(t.client._httpMessage.path||"")),r)return'filename="'+Mv(r)+'"'};Ue.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=sd.lookup(t.name)),!r&&t&&t.path&&(r=sd.lookup(t.path)),!r&&t&&t.readable&&$n(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=sd.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=Ue.DEFAULT_CONTENT_TYPE),r};Ue.prototype._multiPartFooter=function(){return function(t){var e=Ue.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};Ue.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Ue.LINE_BREAK};Ue.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)$n(t,e)&&(r[e.toLowerCase()]=t[e]);return r};Ue.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Ue.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Ue.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?t=Buffer.concat([t,this._streams[r]]):t=Buffer.concat([t,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(Ue.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Ue.prototype._generateBoundary=function(){this._boundary="--------------------------"+TC.randomBytes(12).toString("hex")};Ue.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};Ue.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Ue.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}xC.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};Ue.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=PC(t),n=ud({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=ud(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=bC.request(n):r=vC.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),e){var d,l=o(function(p,f){return r.removeListener("error",l),r.removeListener("response",d),e.call(this,p,f)},"callback");d=l.bind(this,null),r.on("error",l),r.on("response",d)}}.bind(this)),r};Ue.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Ue.prototype.toString=function(){return"[object FormData]"};AC(Ue.prototype,"FormData");jv.exports=Ue});var ta=k((y8,eb)=>{"use strict";var Js=Object.prototype.hasOwnProperty,Qv=Object.prototype.toString,Wv=Object.defineProperty,Zv=Object.getOwnPropertyDescriptor,Kv=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):Qv.call(e)==="[object Array]"},"isArray"),Jv=o(function(e){if(!e||Qv.call(e)!=="[object Object]")return!1;var r=Js.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&Js.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||Js.call(e,i)},"isPlainObject"),Yv=o(function(e,r){Wv&&r.name==="__proto__"?Wv(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),Xv=o(function(e,r){if(r==="__proto__")if(Js.call(e,r)){if(Zv)return Zv(e,r).value}else return;return e[r]},"getProperty");eb.exports=o(function t(){var e,r,n,i,s,c,d=arguments[0],l=1,p=arguments.length,f=!1;for(typeof d=="boolean"&&(f=d,d=arguments[1]||{},l=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});l<p;++l)if(e=arguments[l],e!=null)for(r in e)n=Xv(d,r),i=Xv(e,r),d!==i&&(f&&i&&(Jv(i)||(s=Kv(i)))?(s?(s=!1,c=n&&Kv(n)?n:[]):c=n&&Jv(n)?n:{},Yv(d,{name:r,newValue:t(f,c,i)})):typeof i<"u"&&Yv(d,{name:r,newValue:i}));return d},"extend")});var tb=k((v8,zC)=>{zC.exports={name:"gaxios",version:"7.1.3",description:"A simple common HTTP client specifically for Google APIs and services.",main:"build/cjs/src/index.js",types:"build/cjs/src/index.d.ts",files:["build/"],exports:{".":{import:{types:"./build/esm/src/index.d.ts",default:"./build/esm/src/index.js"},require:{types:"./build/cjs/src/index.d.ts",default:"./build/cjs/src/index.js"}}},scripts:{lint:"gts check --no-inline-config",test:"c8 mocha build/esm/test","presystem-test":"npm run compile","system-test":"mocha build/esm/system-test --timeout 80000",compile:"tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"jsdoc -c .jsdoc.js","docs-test":"linkinator docs","predocs-test":"npm run docs","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean"},repository:{type:"git",directory:"packages/gaxios",url:"https://github.com/googleapis/google-cloud-node-core.git"},keywords:["google"],engines:{node:">=18"},author:"Google, LLC",license:"Apache-2.0",devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/cors":"^2.8.6","@types/express":"^5.0.0","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/multiparty":"4.2.1","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","@types/tmp":"0.2.6",assert:"^2.0.0",browserify:"^17.0.0",c8:"^10.0.0",cors:"^2.8.5",express:"^5.0.0",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",linkinator:"^6.1.2",mocha:"^11.1.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.0-beta.13","null-loader":"^4.0.0","pack-n-play":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","stream-browserify":"^3.0.0",tmp:"0.2.5","ts-loader":"^9.5.2",typescript:"^5.8.3",webpack:"^5.35.0","webpack-cli":"^6.0.1"},dependencies:{extend:"^3.0.2","https-proxy-agent":"^7.0.1","node-fetch":"^3.3.2",rimraf:"^5.0.1"},homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios"}});var nb=k((b8,rb)=>{"use strict";var DC=tb();rb.exports={pkg:DC}});var pd=k(er=>{"use strict";var ib=er&&er.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(er,"__esModule",{value:!0});er.GaxiosError=er.GAXIOS_ERROR_SYMBOL=void 0;er.defaultErrorRedactor=ab;var ob=ib(ta()),UC=ib(nb()),ld=UC.default.pkg;er.GAXIOS_ERROR_SYMBOL=Symbol.for(`${ld.name}-gaxios-error`);var dd=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[er.GAXIOS_ERROR_SYMBOL]=ld.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&er.GAXIOS_ERROR_SYMBOL in e&&e[er.GAXIOS_ERROR_SYMBOL]===ld.version?!0:Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,r,n,i){if(super(e,{cause:i}),this.config=r,this.response=n,this.error=i instanceof Error?i:void 0,this.config=(0,ob.default)(!0,{},r),this.response&&(this.response.config=(0,ob.default)(!0,{},this.response.config)),this.response){try{this.response.data=MC(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}i instanceof DOMException?this.code=i.name:i&&typeof i=="object"&&"code"in i&&(typeof i.code=="string"||typeof i.code=="number")&&(this.code=i.code)}static extractAPIErrorFromResponse(e,r="The request failed"){let n=r;if(typeof e.data=="string"&&(n=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){n="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:n;let i="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,s="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let c=[];for(let d of e.data.error.errors)typeof d=="object"&&"message"in d&&typeof d.message=="string"&&c.push(d.message);return Object.assign({message:c.join(`
3
- `)||n,code:s,status:i},e.data.error)}return Object.assign({message:n,code:s,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};er.GaxiosError=dd;function MC(t,e){switch(t){case"stream":return e;case"json":return JSON.parse(JSON.stringify(e));case"arraybuffer":return JSON.parse(Buffer.from(e).toString("utf8"));case"blob":return JSON.parse(e.text());default:return e}}o(MC,"translateData");function ab(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((c,d)=>{(/^authentication$/i.test(d)||/^authorization$/i.test(d)||/secret/i.test(d))&&s.set(d,e)})}o(r,"redactHeaders");function n(s,c){if(typeof s=="object"&&s!==null&&typeof s[c]=="string"){let d=s[c];(/grant_type=/i.test(d)||/assertion=/i.test(d)||/secret/i.test(d))&&(s[c]=e)}}o(n,"redactString");function i(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((c,d)=>{(["grant_type","assertion"].includes(d)||/secret/.test(d))&&s.set(d,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return o(i,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),i(t.config.data),n(t.config,"body"),i(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(ab({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(ab,"defaultErrorRedactor")});var ub=k(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.getRetryConfig=jC;async function jC(t){let e=sb(t);if(!t||!t.config||!e&&!t.config.retry)return{shouldRetry:!1};e=e||{},e.currentRetryAttempt=e.currentRetryAttempt||0,e.retry=e.retry===void 0||e.retry===null?3:e.retry,e.httpMethodsToRetry=e.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],e.noResponseRetries=e.noResponseRetries===void 0||e.noResponseRetries===null?2:e.noResponseRetries,e.retryDelayMultiplier=e.retryDelayMultiplier?e.retryDelayMultiplier:2,e.timeOfFirstRequest=e.timeOfFirstRequest?e.timeOfFirstRequest:Date.now(),e.totalTimeout=e.totalTimeout?e.totalTimeout:Number.MAX_SAFE_INTEGER,e.maxRetryDelay=e.maxRetryDelay?e.maxRetryDelay:Number.MAX_SAFE_INTEGER;let r=[[100,199],[408,408],[429,429],[500,599]];if(e.statusCodesToRetry=e.statusCodesToRetry||r,t.config.retryConfig=e,!await(e.shouldRetry||LC)(t))return{shouldRetry:!1,config:t.config};let i=FC(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,i):new Promise(c=>{setTimeout(c,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}o(jC,"getRetryConfig");function LC(t){let e=sb(t);if(t.config.signal?.aborted&&t.code!=="TimeoutError"||t.code==="AbortError"||!e||e.retry===0||!t.response&&(e.currentRetryAttempt||0)>=e.noResponseRetries||!e.httpMethodsToRetry||!e.httpMethodsToRetry.includes(t.config.method?.toUpperCase()||"GET"))return!1;if(t.response&&t.response.status){let r=!1;for(let[n,i]of e.statusCodesToRetry){let s=t.response.status;if(s>=n&&s<=i){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}o(LC,"shouldRetryRequest");function sb(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(sb,"getConfig");function FC(t){let r=(t.currentRetryAttempt?0:t.retryDelay??100)+(Math.pow(t.retryDelayMultiplier,t.currentRetryAttempt)-1)/2*1e3,n=t.totalTimeout-(Date.now()-t.timeOfFirstRequest);return Math.min(r,n,t.maxRetryDelay)}o(FC,"getNextRetryDelay")});var hd=k(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.GaxiosInterceptorManager=void 0;var md=class extends Set{static{o(this,"GaxiosInterceptorManager")}};Ys.GaxiosInterceptorManager=md});var lb=k((w8,cb)=>{var Ho=1e3,Go=Ho*60,Wo=Go*60,ro=Wo*24,BC=ro*7,qC=ro*365.25;cb.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return VC(t);if(r==="number"&&isFinite(t))return e.long?GC(t):HC(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function VC(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*qC;case"weeks":case"week":case"w":return r*BC;case"days":case"day":case"d":return r*ro;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Wo;case"minutes":case"minute":case"mins":case"min":case"m":return r*Go;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ho;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(VC,"parse");function HC(t){var e=Math.abs(t);return e>=ro?Math.round(t/ro)+"d":e>=Wo?Math.round(t/Wo)+"h":e>=Go?Math.round(t/Go)+"m":e>=Ho?Math.round(t/Ho)+"s":t+"ms"}o(HC,"fmtShort");function GC(t){var e=Math.abs(t);return e>=ro?Xs(t,e,ro,"day"):e>=Wo?Xs(t,e,Wo,"hour"):e>=Go?Xs(t,e,Go,"minute"):e>=Ho?Xs(t,e,Ho,"second"):t+" ms"}o(GC,"fmtLong");function Xs(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(Xs,"plural")});var gd=k((R8,db)=>{function WC(t){r.debug=r,r.default=r,r.coerce=l,r.disable=c,r.enable=i,r.enabled=d,r.humanize=lb(),r.destroy=p,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let _=0;for(let h=0;h<f.length;h++)_=(_<<5)-_+f.charCodeAt(h),_|=0;return r.colors[Math.abs(_)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(f){let _,h=null,g,y;function T(...P){if(!T.enabled)return;let x=T,N=Number(new Date),L=N-(_||N);x.diff=L,x.prev=_,x.curr=N,_=N,P[0]=r.coerce(P[0]),typeof P[0]!="string"&&P.unshift("%O");let X=0;P[0]=P[0].replace(/%([a-zA-Z%])/g,(G,Z)=>{if(G==="%%")return"%";X++;let ee=r.formatters[Z];if(typeof ee=="function"){let Y=P[X];G=ee.call(x,Y),P.splice(X,1),X--}return G}),r.formatArgs.call(x,P),(x.log||r.log).apply(x,P)}return o(T,"debug"),T.namespace=f,T.useColors=r.useColors(),T.color=r.selectColor(f),T.extend=n,T.destroy=r.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:o(()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,y=r.enabled(f)),y),"get"),set:o(P=>{h=P},"set")}),typeof r.init=="function"&&r.init(T),T}o(r,"createDebug");function n(f,_){let h=r(this.namespace+(typeof _>"u"?":":_)+f);return h.log=this.log,h}o(n,"extend");function i(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let _=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of _)h[0]==="-"?r.skips.push(h.slice(1)):r.names.push(h)}o(i,"enable");function s(f,_){let h=0,g=0,y=-1,T=0;for(;h<f.length;)if(g<_.length&&(_[g]===f[h]||_[g]==="*"))_[g]==="*"?(y=g,T=h,g++):(h++,g++);else if(y!==-1)g=y+1,T++,h=T;else return!1;for(;g<_.length&&_[g]==="*";)g++;return g===_.length}o(s,"matchesTemplate");function c(){let f=[...r.names,...r.skips.map(_=>"-"+_)].join(",");return r.enable(""),f}o(c,"disable");function d(f){for(let _ of r.skips)if(s(f,_))return!1;for(let _ of r.names)if(s(f,_))return!0;return!1}o(d,"enabled");function l(f){return f instanceof Error?f.stack||f.message:f}o(l,"coerce");function p(){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 o(p,"destroy"),r.enable(r.load()),r}o(WC,"setup");db.exports=WC});var pb=k((Ot,Qs)=>{Ot.formatArgs=KC;Ot.save=JC;Ot.load=YC;Ot.useColors=ZC;Ot.storage=XC();Ot.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();Ot.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 ZC(){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 t;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&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o(ZC,"useColors");function KC(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Qs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}o(KC,"formatArgs");Ot.log=console.debug||console.log||(()=>{});function JC(t){try{t?Ot.storage.setItem("debug",t):Ot.storage.removeItem("debug")}catch{}}o(JC,"save");function YC(){let t;try{t=Ot.storage.getItem("debug")||Ot.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(YC,"load");function XC(){try{return localStorage}catch{}}o(XC,"localstorage");Qs.exports=gd()(Ot);var{formatters:QC}=Qs.exports;QC.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var mb=k(($8,fb)=>{"use strict";fb.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var yb=k((k8,gb)=>{"use strict";var e0=require("os"),hb=require("tty"),tr=mb(),{env:_t}=process,Nn;tr("no-color")||tr("no-colors")||tr("color=false")||tr("color=never")?Nn=0:(tr("color")||tr("colors")||tr("color=true")||tr("color=always"))&&(Nn=1);"FORCE_COLOR"in _t&&(_t.FORCE_COLOR==="true"?Nn=1:_t.FORCE_COLOR==="false"?Nn=0:Nn=_t.FORCE_COLOR.length===0?1:Math.min(parseInt(_t.FORCE_COLOR,10),3));function yd(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(yd,"translateLevel");function _d(t,e){if(Nn===0)return 0;if(tr("color=16m")||tr("color=full")||tr("color=truecolor"))return 3;if(tr("color=256"))return 2;if(t&&!e&&Nn===void 0)return 0;let r=Nn||0;if(_t.TERM==="dumb")return r;if(process.platform==="win32"){let n=e0.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in _t)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in _t)||_t.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in _t)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_t.TEAMCITY_VERSION)?1:0;if(_t.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in _t){let n=parseInt((_t.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_t.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(_t.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_t.TERM)||"COLORTERM"in _t?1:r}o(_d,"supportsColor");function t0(t){let e=_d(t,t&&t.isTTY);return yd(e)}o(t0,"getSupportLevel");gb.exports={supportsColor:t0,stdout:yd(_d(!0,hb.isatty(1))),stderr:yd(_d(!0,hb.isatty(2)))}});var vb=k((vt,tu)=>{var r0=require("tty"),eu=require("util");vt.init=c0;vt.log=a0;vt.formatArgs=o0;vt.save=s0;vt.load=u0;vt.useColors=n0;vt.destroy=eu.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");vt.colors=[6,2,3,4,5,1];try{let t=yb();t&&(t.stderr||t).level>=2&&(vt.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{}vt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];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),t[r]=n,t},{});function n0(){return"colors"in vt.inspectOpts?!!vt.inspectOpts.colors:r0.isatty(process.stderr.fd)}o(n0,"useColors");function o0(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
1
+ "use strict";var tw=Object.create;var Ii=Object.defineProperty;var rw=Object.getOwnPropertyDescriptor;var nw=Object.getOwnPropertyNames;var ow=Object.getPrototypeOf,iw=Object.prototype.hasOwnProperty;var o=(t,e)=>Ii(t,"name",{value:e,configurable:!0});var gt=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var k=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},gs=(t,e)=>{for(var r in e)Ii(t,r,{get:e[r],enumerable:!0})},hh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of nw(e))!iw.call(t,i)&&i!==r&&Ii(t,i,{get:()=>e[i],enumerable:!(n=rw(e,i))||n.enumerable});return t};var ft=(t,e,r)=>(r=t!=null?tw(ow(t)):{},hh(e||!t||!t.__esModule?Ii(r,"default",{value:t,enumerable:!0}):r,t)),aw=t=>hh(Ii({},"__esModule",{value:!0}),t);var Mg=k((Ug,Us)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function l(g,y){if(g.indexOf("::")!==g.lastIndexOf("::"))return null;let T=0,P=-1,x=(g.match(d.zoneIndex)||[])[0],N,L;for(x&&(x=x.substring(1),g=g.replace(/%.+$/,""));(P=g.indexOf(":",P+1))>=0;)T++;if(g.substr(0,2)==="::"&&T--,g.substr(-2,2)==="::"&&T--,T>y)return null;for(L=y-T,N=":";L--;)N+="0:";return g=g.replace("::",N),g[0]===":"&&(g=g.slice(1)),g[g.length-1]===":"&&(g=g.slice(0,-1)),y=(function(){let X=g.split(":"),W=[];for(let G=0;G<X.length;G++)W.push(parseInt(X[G],16));return W})(),{parts:y,zoneId:x}}o(l,"expandIPv6");function p(g,y,T,P){if(g.length!==y.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,N;for(;P>0;){if(N=T-P,N<0&&(N=0),g[x]>>N!==y[x]>>N)return!1;P-=T,x+=1}return!0}o(p,"matchCIDR");function f(g){if(i.test(g))return parseInt(g,16);if(g[0]==="0"&&!isNaN(parseInt(g[1],10))){if(n.test(g))return parseInt(g,8);throw new Error(`ipaddr: cannot parse ${g} as octal`)}return parseInt(g,10)}o(f,"parseIntAuto");function _(g,y){for(;g.length<y;)g=`0${g}`;return g}o(_,"padPart");let h={};h.IPv4=(function(){function g(y){if(y.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let T,P;for(T=0;T<y.length;T++)if(P=y[T],!(0<=P&&P<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=y}return o(g,"IPv4"),g.prototype.SpecialRanges={unspecified:[[new g([0,0,0,0]),8]],broadcast:[[new g([255,255,255,255]),32]],multicast:[[new g([224,0,0,0]),4]],linkLocal:[[new g([169,254,0,0]),16]],loopback:[[new g([127,0,0,0]),8]],carrierGradeNat:[[new g([100,64,0,0]),10]],private:[[new g([10,0,0,0]),8],[new g([172,16,0,0]),12],[new g([192,168,0,0]),16]],reserved:[[new g([192,0,0,0]),24],[new g([192,0,2,0]),24],[new g([192,88,99,0]),24],[new g([198,18,0,0]),15],[new g([198,51,100,0]),24],[new g([203,0,113,0]),24],[new g([240,0,0,0]),4]],as112:[[new g([192,175,48,0]),24],[new g([192,31,196,0]),24]],amt:[[new g([192,52,193,0]),24]]},g.prototype.kind=function(){return"ipv4"},g.prototype.match=function(y,T){let P;if(T===void 0&&(P=y,y=P[0],T=P[1]),y.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return p(this.octets,y.octets,8,T)},g.prototype.prefixLengthFromSubnetMask=function(){let y=0,T=!1,P={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,N,L;for(x=3;x>=0;x-=1)if(N=this.octets[x],N in P){if(L=P[N],T&&L!==0)return null;L!==8&&(T=!0),y+=L}else return null;return 32-y},g.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},g.prototype.toByteArray=function(){return this.octets.slice(0)},g.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},g.prototype.toNormalizedString=function(){return this.toString()},g.prototype.toString=function(){return this.octets.join(".")},g})(),h.IPv4.broadcastAddressFromCIDR=function(g){try{let y=this.parseCIDR(g),T=y[0].toByteArray(),P=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],N=0;for(;N<4;)x.push(parseInt(T[N],10)|parseInt(P[N],10)^255),N++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(g){return this.parser(g)!==null},h.IPv4.isValid=function(g){try{return new this(this.parser(g)),!0}catch{return!1}},h.IPv4.isValidCIDR=function(g){try{return this.parseCIDR(g),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(g){return!!(h.IPv4.isValid(g)&&g.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.isValidCIDRFourPartDecimal=function(g){let y=g.match(/^(.+)\/(\d+)$/);return!h.IPv4.isValidCIDR(g)||!y?!1:h.IPv4.isValidFourPartDecimal(y[1])},h.IPv4.networkAddressFromCIDR=function(g){let y,T,P,x,N;try{for(y=this.parseCIDR(g),P=y[0].toByteArray(),N=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],T=0;T<4;)x.push(parseInt(P[T],10)&parseInt(N[T],10)),T++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.parse=function(g){let y=this.parser(g);if(y===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(y)},h.IPv4.parseCIDR=function(g){let y;if(y=g.match(/^(.+)\/(\d+)$/)){let T=parseInt(y[2]);if(T>=0&&T<=32){let P=[this.parse(y[1]),T];return Object.defineProperty(P,"toString",{value:o(function(){return this.join("/")},"value")}),P}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},h.IPv4.parser=function(g){let y,T,P;if(y=g.match(r.fourOctet))return(function(){let x=y.slice(1,6),N=[];for(let L=0;L<x.length;L++)T=x[L],N.push(f(T));return N})();if(y=g.match(r.longValue)){if(P=f(y[1]),P>4294967295||P<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],N;for(N=0;N<=24;N+=8)x.push(P>>N&255);return x})().reverse()}else return(y=g.match(r.twoOctet))?(function(){let x=y.slice(1,4),N=[];if(P=f(x[1]),P>16777215||P<0)throw new Error("ipaddr: address outside defined range");return N.push(f(x[0])),N.push(P>>16&255),N.push(P>>8&255),N.push(P&255),N})():(y=g.match(r.threeOctet))?(function(){let x=y.slice(1,5),N=[];if(P=f(x[2]),P>65535||P<0)throw new Error("ipaddr: address outside defined range");return N.push(f(x[0])),N.push(f(x[1])),N.push(P>>8&255),N.push(P&255),N})():null},h.IPv4.subnetMaskFromPrefixLength=function(g){if(g=parseInt(g),g<0||g>32)throw new Error("ipaddr: invalid IPv4 prefix length");let y=[0,0,0,0],T=0,P=Math.floor(g/8);for(;T<P;)y[T]=255,T++;return P<4&&(y[P]=Math.pow(2,g%8)-1<<8-g%8),new this(y)},h.IPv6=(function(){function g(y,T){let P,x;if(y.length===16)for(this.parts=[],P=0;P<=14;P+=2)this.parts.push(y[P]<<8|y[P+1]);else if(y.length===8)this.parts=y;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(P=0;P<this.parts.length;P++)if(x=this.parts[P],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");T&&(this.zoneId=T)}return o(g,"IPv6"),g.prototype.SpecialRanges={unspecified:[new g([0,0,0,0,0,0,0,0]),128],linkLocal:[new g([65152,0,0,0,0,0,0,0]),10],multicast:[new g([65280,0,0,0,0,0,0,0]),8],loopback:[new g([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new g([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new g([0,0,0,0,0,65535,0,0]),96],discard:[new g([256,0,0,0,0,0,0,0]),64],rfc6145:[new g([0,0,0,0,65535,0,0,0]),96],rfc6052:[new g([100,65435,0,0,0,0,0,0]),96],"6to4":[new g([8194,0,0,0,0,0,0,0]),16],teredo:[new g([8193,0,0,0,0,0,0,0]),32],benchmarking:[new g([8193,2,0,0,0,0,0,0]),48],amt:[new g([8193,3,0,0,0,0,0,0]),32],as112v6:[[new g([8193,4,274,0,0,0,0,0]),48],[new g([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new g([8193,16,0,0,0,0,0,0]),28],orchid2:[new g([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new g([8193,48,0,0,0,0,0,0]),28],reserved:[[new g([8193,0,0,0,0,0,0,0]),23],[new g([8193,3512,0,0,0,0,0,0]),32]]},g.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},g.prototype.kind=function(){return"ipv6"},g.prototype.match=function(y,T){let P;if(T===void 0&&(P=y,y=P[0],T=P[1]),y.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return p(this.parts,y.parts,16,T)},g.prototype.prefixLengthFromSubnetMask=function(){let y=0,T=!1,P={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,N;for(let L=7;L>=0;L-=1)if(x=this.parts[L],x in P){if(N=P[x],T&&N!==0)return null;N!==16&&(T=!0),y+=N}else return null;return 128-y},g.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},g.prototype.toByteArray=function(){let y,T=[],P=this.parts;for(let x=0;x<P.length;x++)y=P[x],T.push(y>>8),T.push(y&255);return T},g.prototype.toFixedLengthString=function(){let y=(function(){let P=[];for(let x=0;x<this.parts.length;x++)P.push(_(this.parts[x].toString(16),4));return P}).call(this).join(":"),T="";return this.zoneId&&(T=`%${this.zoneId}`),y+T},g.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let y=this.parts.slice(-2),T=y[0],P=y[1];return new h.IPv4([T>>8,T&255,P>>8,P&255])},g.prototype.toNormalizedString=function(){let y=(function(){let P=[];for(let x=0;x<this.parts.length;x++)P.push(this.parts[x].toString(16));return P}).call(this).join(":"),T="";return this.zoneId&&(T=`%${this.zoneId}`),y+T},g.prototype.toRFC5952String=function(){let y=/((^|:)(0(:|$)){2,})/g,T=this.toNormalizedString(),P=0,x=-1,N;for(;N=y.exec(T);)N[0].length>x&&(P=N.index,x=N[0].length);return x<0?T:`${T.substring(0,P)}::${T.substring(P+x)}`},g.prototype.toString=function(){return this.toRFC5952String()},g})(),h.IPv6.broadcastAddressFromCIDR=function(g){try{let y=this.parseCIDR(g),T=y[0].toByteArray(),P=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],N=0;for(;N<16;)x.push(parseInt(T[N],10)|parseInt(P[N],10)^255),N++;return new this(x)}catch(y){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${y})`)}},h.IPv6.isIPv6=function(g){return this.parser(g)!==null},h.IPv6.isValid=function(g){if(typeof g=="string"&&g.indexOf(":")===-1)return!1;try{let y=this.parser(g);return new this(y.parts,y.zoneId),!0}catch{return!1}},h.IPv6.isValidCIDR=function(g){if(typeof g=="string"&&g.indexOf(":")===-1)return!1;try{return this.parseCIDR(g),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(g){let y,T,P,x,N;try{for(y=this.parseCIDR(g),P=y[0].toByteArray(),N=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],T=0;T<16;)x.push(parseInt(P[T],10)&parseInt(N[T],10)),T++;return new this(x)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},h.IPv6.parse=function(g){let y=this.parser(g);if(y.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(y.parts,y.zoneId)},h.IPv6.parseCIDR=function(g){let y,T,P;if((T=g.match(/^(.+)\/(\d+)$/))&&(y=parseInt(T[2]),y>=0&&y<=128))return P=[this.parse(T[1]),y],Object.defineProperty(P,"toString",{value:o(function(){return this.join("/")},"value")}),P;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},h.IPv6.parser=function(g){let y,T,P,x,N,L;if(P=g.match(d.deprecatedTransitional))return this.parser(`::ffff:${P[1]}`);if(d.native.test(g))return l(g,8);if((P=g.match(d.transitional))&&(L=P[6]||"",y=P[1],P[1].endsWith("::")||(y=y.slice(0,-1)),y=l(y+L,6),y.parts)){for(N=[parseInt(P[2]),parseInt(P[3]),parseInt(P[4]),parseInt(P[5])],T=0;T<N.length;T++)if(x=N[T],!(0<=x&&x<=255))return null;return y.parts.push(N[0]<<8|N[1]),y.parts.push(N[2]<<8|N[3]),{parts:y.parts,zoneId:y.zoneId}}return null},h.IPv6.subnetMaskFromPrefixLength=function(g){if(g=parseInt(g),g<0||g>128)throw new Error("ipaddr: invalid IPv6 prefix length");let y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],T=0,P=Math.floor(g/8);for(;T<P;)y[T]=255,T++;return P<16&&(y[P]=Math.pow(2,g%8)-1<<8-g%8),new this(y)},h.fromByteArray=function(g){let y=g.length;if(y===4)return new h.IPv4(g);if(y===16)return new h.IPv6(g);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},h.isValid=function(g){return h.IPv6.isValid(g)||h.IPv4.isValid(g)},h.isValidCIDR=function(g){return h.IPv6.isValidCIDR(g)||h.IPv4.isValidCIDR(g)},h.parse=function(g){if(h.IPv6.isValid(g))return h.IPv6.parse(g);if(h.IPv4.isValid(g))return h.IPv4.parse(g);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},h.parseCIDR=function(g){try{return h.IPv6.parseCIDR(g)}catch{try{return h.IPv4.parseCIDR(g)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},h.process=function(g){let y=this.parse(g);return y.kind()==="ipv6"&&y.isIPv4MappedAddress()?y.toIPv4Address():y},h.subnetMatch=function(g,y,T){let P,x,N,L;T==null&&(T="unicast");for(x in y)if(Object.prototype.hasOwnProperty.call(y,x)){for(N=y[x],N[0]&&!(N[0]instanceof Array)&&(N=[N]),P=0;P<N.length;P++)if(L=N[P],g.kind()===L[0].kind()&&g.match.apply(g,L))return x}return T},typeof Us<"u"&&Us.exports?Us.exports=h:t.ipaddr=h})(Ug)});var Fy=k((cK,Ly)=>{var jy=require("stream").Stream,qR=require("util");Ly.exports=fr;function fr(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(fr,"DelayedStream");qR.inherits(fr,jy);fr.create=function(t,e){var r=new this;e=e||{};for(var n in e)r[n]=e[n];r.source=t;var i=t.emit;return t.emit=function(){return r._handleEmit(arguments),i.apply(t,arguments)},t.on("error",function(){}),r.pauseStream&&t.pause(),r};Object.defineProperty(fr.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});fr.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};fr.prototype.resume=function(){this._released||this.release(),this.source.resume()};fr.prototype.pause=function(){this.source.pause()};fr.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};fr.prototype.pipe=function(){var t=jy.prototype.pipe.apply(this,arguments);return this.resume(),t};fr.prototype._handleEmit=function(t){if(this._released){this.emit.apply(this,t);return}t[0]==="data"&&(this.dataSize+=t[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(t)};fr.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(t))}}});var Hy=k((dK,Vy)=>{var VR=require("util"),qy=require("stream").Stream,By=Fy();Vy.exports=ot;function ot(){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}o(ot,"CombinedStream");VR.inherits(ot,qy);ot.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};ot.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};ot.prototype.append=function(t){var e=ot.isStreamLike(t);if(e){if(!(t instanceof By)){var r=By.create(t,{maxDataSize:1/0,pauseStream:this.pauseStreams});t.on("data",this._checkDataSize.bind(this)),t=r}this._handleErrors(t),this.pauseStreams&&t.pause()}return this._streams.push(t),this};ot.prototype.pipe=function(t,e){return qy.prototype.pipe.call(this,t,e),this.resume(),t};ot.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}};ot.prototype._realGetNext=function(){var t=this._streams.shift();if(typeof t>"u"){this.end();return}if(typeof t!="function"){this._pipeNext(t);return}var e=t;e(function(r){var n=ot.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ot.prototype._pipeNext=function(t){this._currentStream=t;var e=ot.isStreamLike(t);if(e){t.on("end",this._getNext.bind(this)),t.pipe(this,{end:!1});return}var r=t;this.write(r),this._getNext()};ot.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};ot.prototype.write=function(t){this.emit("data",t)};ot.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ot.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")};ot.prototype.end=function(){this._reset(),this.emit("end")};ot.prototype.destroy=function(){this._reset(),this.emit("close")};ot.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ot.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};ot.prototype._updateDataSize=function(){this.dataSize=0;var t=this;this._streams.forEach(function(e){e.dataSize&&(t.dataSize+=e.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};ot.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var Wy=k((fK,Gy)=>{"use strict";Gy.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var Jy=k(Rt=>{"use strict";var Bs=Wy(),HR=require("path").extname,Zy=/^\s*([^;\s]*)(?:;|\s|$)/,GR=/^text\//i;Rt.charset=Ky;Rt.charsets={lookup:Ky};Rt.contentType=WR;Rt.extension=ZR;Rt.extensions=Object.create(null);Rt.lookup=KR;Rt.types=Object.create(null);JR(Rt.extensions,Rt.types);function Ky(t){if(!t||typeof t!="string")return!1;var e=Zy.exec(t),r=e&&Bs[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&GR.test(e[1])?"UTF-8":!1}o(Ky,"charset");function WR(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Rt.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Rt.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(WR,"contentType");function ZR(t){if(!t||typeof t!="string")return!1;var e=Zy.exec(t),r=e&&Rt.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(ZR,"extension");function KR(t){if(!t||typeof t!="string")return!1;var e=HR("x."+t).toLowerCase().substr(1);return e&&Rt.types[e]||!1}o(KR,"lookup");function JR(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(Bs).forEach(o(function(i){var s=Bs[i],c=s.extensions;if(!(!c||!c.length)){t[i]=c;for(var d=0;d<c.length;d++){var l=c[d];if(e[l]){var p=r.indexOf(Bs[e[l]].source),f=r.indexOf(s.source);if(e[l]!=="application/octet-stream"&&(p>f||p===f&&e[l].substr(0,12)==="application/"))continue}e[l]=i}}},"forEachMimeType"))}o(JR,"populateMaps")});var Xy=k((gK,Yy)=>{Yy.exports=YR;function YR(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(YR,"defer")});var ql=k((_K,e_)=>{var Qy=Xy();e_.exports=XR;function XR(t){var e=!1;return Qy(function(){e=!0}),o(function(n,i){e?t(n,i):Qy(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(XR,"async")});var Vl=k((bK,t_)=>{t_.exports=QR;function QR(t){Object.keys(t.jobs).forEach(eO.bind(t)),t.jobs={}}o(QR,"abort");function eO(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(eO,"clean")});var Hl=k((SK,n_)=>{var r_=ql(),tO=Vl();n_.exports=rO;function rO(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=nO(e,i,t[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?tO(r):r.results[i]=c,n(s,r.results))})}o(rO,"iterate");function nO(t,e,r,n){var i;return t.length==2?i=t(r,r_(n)):i=t(r,e,r_(n)),i}o(nO,"runJob")});var Gl=k((TK,o_)=>{o_.exports=oO;function oO(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};return e&&n.keyedList.sort(r?e:function(i,s){return e(t[i],t[s])}),n}o(oO,"state")});var Wl=k((AK,i_)=>{var iO=Vl(),aO=ql();i_.exports=sO;function sO(t){Object.keys(this.jobs).length&&(this.index=this.size,iO(this),aO(t)(null,this.results))}o(sO,"terminator")});var s_=k((IK,a_)=>{var uO=Hl(),cO=Gl(),lO=Wl();a_.exports=dO;function dO(t,e,r){for(var n=cO(t);n.index<(n.keyedList||t).length;)uO(t,e,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return lO.bind(n,r)}o(dO,"parallel")});var Zl=k((OK,qs)=>{var u_=Hl(),pO=Gl(),fO=Wl();qs.exports=mO;qs.exports.ascending=c_;qs.exports.descending=hO;function mO(t,e,r,n){var i=pO(t,r);return u_(t,e,i,o(function s(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||t).length){u_(t,e,i,s);return}n(null,i.results)},"iteratorHandler")),fO.bind(i,n)}o(mO,"serialOrdered");function c_(t,e){return t<e?-1:t>e?1:0}o(c_,"ascending");function hO(t,e){return-1*c_(t,e)}o(hO,"descending")});var d_=k(($K,l_)=>{var gO=Zl();l_.exports=yO;function yO(t,e,r){return gO(t,e,null,r)}o(yO,"serial")});var f_=k((NK,p_)=>{p_.exports={parallel:s_(),serial:d_(),serialOrdered:Zl()}});var Kl=k((zK,m_)=>{"use strict";m_.exports=Object});var g_=k((DK,h_)=>{"use strict";h_.exports=Error});var __=k((UK,y_)=>{"use strict";y_.exports=EvalError});var b_=k((MK,v_)=>{"use strict";v_.exports=RangeError});var S_=k((jK,P_)=>{"use strict";P_.exports=ReferenceError});var T_=k((LK,E_)=>{"use strict";E_.exports=SyntaxError});var Cn=k((FK,x_)=>{"use strict";x_.exports=TypeError});var w_=k((BK,A_)=>{"use strict";A_.exports=URIError});var R_=k((qK,I_)=>{"use strict";I_.exports=Math.abs});var C_=k((VK,O_)=>{"use strict";O_.exports=Math.floor});var k_=k((HK,$_)=>{"use strict";$_.exports=Math.max});var z_=k((GK,N_)=>{"use strict";N_.exports=Math.min});var U_=k((WK,D_)=>{"use strict";D_.exports=Math.pow});var j_=k((ZK,M_)=>{"use strict";M_.exports=Math.round});var F_=k((KK,L_)=>{"use strict";L_.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var q_=k((YK,B_)=>{"use strict";var _O=F_();B_.exports=o(function(e){return _O(e)||e===0?e:e<0?-1:1},"sign")});var H_=k((QK,V_)=>{"use strict";V_.exports=Object.getOwnPropertyDescriptor});var Jl=k((eJ,G_)=>{"use strict";var Vs=H_();if(Vs)try{Vs([],"length")}catch{Vs=null}G_.exports=Vs});var Z_=k((tJ,W_)=>{"use strict";var Hs=Object.defineProperty||!1;if(Hs)try{Hs({},"a",{value:1})}catch{Hs=!1}W_.exports=Hs});var Yl=k((rJ,K_)=>{"use strict";K_.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var c=Object.getOwnPropertySymbols(e);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(e,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var X_=k((oJ,Y_)=>{"use strict";var J_=typeof Symbol<"u"&&Symbol,vO=Yl();Y_.exports=o(function(){return typeof J_!="function"||typeof Symbol!="function"||typeof J_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vO()},"hasNativeSymbols")});var Xl=k((aJ,Q_)=>{"use strict";Q_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Ql=k((sJ,ev)=>{"use strict";var bO=Kl();ev.exports=bO.getPrototypeOf||null});var nv=k((uJ,rv)=>{"use strict";var PO="Function.prototype.bind called on incompatible ",SO=Object.prototype.toString,EO=Math.max,TO="[object Function]",tv=o(function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var s=0;s<r.length;s+=1)n[s+e.length]=r[s];return n},"concatty"),xO=o(function(e,r){for(var n=[],i=r||0,s=0;i<e.length;i+=1,s+=1)n[s]=e[i];return n},"slicy"),AO=o(function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r},"joiny");rv.exports=o(function(e){var r=this;if(typeof r!="function"||SO.apply(r)!==TO)throw new TypeError(PO+r);for(var n=xO(arguments,1),i,s=o(function(){if(this instanceof i){var f=r.apply(this,tv(n,arguments));return Object(f)===f?f:this}return r.apply(e,tv(n,arguments))},"binder"),c=EO(0,r.length-n.length),d=[],l=0;l<c;l++)d[l]="$"+l;if(i=Function("binder","return function ("+AO(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var p=o(function(){},"Empty");p.prototype=r.prototype,i.prototype=new p,p.prototype=null}return i},"bind")});var Lo=k((lJ,ov)=>{"use strict";var wO=nv();ov.exports=Function.prototype.bind||wO});var Gs=k((dJ,iv)=>{"use strict";iv.exports=Function.prototype.call});var ed=k((pJ,av)=>{"use strict";av.exports=Function.prototype.apply});var uv=k((fJ,sv)=>{"use strict";sv.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var lv=k((mJ,cv)=>{"use strict";var IO=Lo(),RO=ed(),OO=Gs(),CO=uv();cv.exports=CO||IO.call(OO,RO)});var td=k((hJ,dv)=>{"use strict";var $O=Lo(),kO=Cn(),NO=Gs(),zO=lv();dv.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new kO("a function is required");return zO($O,NO,e)},"callBindBasic")});var yv=k((yJ,gv)=>{"use strict";var DO=td(),pv=Jl(),mv;try{mv=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var rd=!!mv&&pv&&pv(Object.prototype,"__proto__"),hv=Object,fv=hv.getPrototypeOf;gv.exports=rd&&typeof rd.get=="function"?DO([rd.get]):typeof fv=="function"?o(function(e){return fv(e==null?e:hv(e))},"getDunder"):!1});var Sv=k((vJ,Pv)=>{"use strict";var _v=Xl(),vv=Ql(),bv=yv();Pv.exports=_v?o(function(e){return _v(e)},"getProto"):vv?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return vv(e)},"getProto"):bv?o(function(e){return bv(e)},"getProto"):null});var nd=k((PJ,Ev)=>{"use strict";var UO=Function.prototype.call,MO=Object.prototype.hasOwnProperty,jO=Lo();Ev.exports=jO.call(UO,MO)});var Qi=k((SJ,Rv)=>{"use strict";var ke,LO=Kl(),FO=g_(),BO=__(),qO=b_(),VO=S_(),Vo=T_(),qo=Cn(),HO=w_(),GO=R_(),WO=C_(),ZO=k_(),KO=z_(),JO=U_(),YO=j_(),XO=q_(),wv=Function,od=o(function(t){try{return wv('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),Ji=Jl(),QO=Z_(),id=o(function(){throw new qo},"throwTypeError"),eC=Ji?(function(){try{return arguments.callee,id}catch{try{return Ji(arguments,"callee").get}catch{return id}}})():id,Fo=X_()(),yt=Sv(),tC=Ql(),rC=Xl(),Iv=ed(),Yi=Gs(),Bo={},nC=typeof Uint8Array>"u"||!yt?ke:yt(Uint8Array),to={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ke:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ke:ArrayBuffer,"%ArrayIteratorPrototype%":Fo&&yt?yt([][Symbol.iterator]()):ke,"%AsyncFromSyncIteratorPrototype%":ke,"%AsyncFunction%":Bo,"%AsyncGenerator%":Bo,"%AsyncGeneratorFunction%":Bo,"%AsyncIteratorPrototype%":Bo,"%Atomics%":typeof Atomics>"u"?ke:Atomics,"%BigInt%":typeof BigInt>"u"?ke:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ke:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ke:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ke:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":FO,"%eval%":eval,"%EvalError%":BO,"%Float16Array%":typeof Float16Array>"u"?ke:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ke:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ke:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ke:FinalizationRegistry,"%Function%":wv,"%GeneratorFunction%":Bo,"%Int8Array%":typeof Int8Array>"u"?ke:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ke:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ke:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Fo&&yt?yt(yt([][Symbol.iterator]())):ke,"%JSON%":typeof JSON=="object"?JSON:ke,"%Map%":typeof Map>"u"?ke:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Fo||!yt?ke:yt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":LO,"%Object.getOwnPropertyDescriptor%":Ji,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ke:Promise,"%Proxy%":typeof Proxy>"u"?ke:Proxy,"%RangeError%":qO,"%ReferenceError%":VO,"%Reflect%":typeof Reflect>"u"?ke:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ke:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Fo||!yt?ke:yt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ke:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Fo&&yt?yt(""[Symbol.iterator]()):ke,"%Symbol%":Fo?Symbol:ke,"%SyntaxError%":Vo,"%ThrowTypeError%":eC,"%TypedArray%":nC,"%TypeError%":qo,"%Uint8Array%":typeof Uint8Array>"u"?ke:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ke:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ke:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ke:Uint32Array,"%URIError%":HO,"%WeakMap%":typeof WeakMap>"u"?ke:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ke:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ke:WeakSet,"%Function.prototype.call%":Yi,"%Function.prototype.apply%":Iv,"%Object.defineProperty%":QO,"%Object.getPrototypeOf%":tC,"%Math.abs%":GO,"%Math.floor%":WO,"%Math.max%":ZO,"%Math.min%":KO,"%Math.pow%":JO,"%Math.round%":YO,"%Math.sign%":XO,"%Reflect.getPrototypeOf%":rC};if(yt)try{null.error}catch(t){Tv=yt(yt(t)),to["%Error.prototype%"]=Tv}var Tv,oC=o(function t(e){var r;if(e==="%AsyncFunction%")r=od("async function () {}");else if(e==="%GeneratorFunction%")r=od("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=od("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&yt&&(r=yt(i.prototype))}return to[e]=r,r},"doEval"),xv={__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"]},Xi=Lo(),Ws=nd(),iC=Xi.call(Yi,Array.prototype.concat),aC=Xi.call(Iv,Array.prototype.splice),Av=Xi.call(Yi,String.prototype.replace),Zs=Xi.call(Yi,String.prototype.slice),sC=Xi.call(Yi,RegExp.prototype.exec),uC=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,cC=/\\(\\)?/g,lC=o(function(e){var r=Zs(e,0,1),n=Zs(e,-1);if(r==="%"&&n!=="%")throw new Vo("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Vo("invalid intrinsic syntax, expected opening `%`");var i=[];return Av(e,uC,function(s,c,d,l){i[i.length]=d?Av(l,cC,"$1"):c||s}),i},"stringToPath"),dC=o(function(e,r){var n=e,i;if(Ws(xv,n)&&(i=xv[n],n="%"+i[0]+"%"),Ws(to,n)){var s=to[n];if(s===Bo&&(s=oC(n)),typeof s>"u"&&!r)throw new qo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Vo("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");Rv.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new qo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qo('"allowMissing" argument must be a boolean');if(sC(/^%?[^%]*%?$/,e)===null)throw new Vo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=lC(e),i=n.length>0?n[0]:"",s=dC("%"+i+"%",r),c=s.name,d=s.value,l=!1,p=s.alias;p&&(i=p[0],aC(n,iC([0,1],p)));for(var f=1,_=!0;f<n.length;f+=1){var h=n[f],g=Zs(h,0,1),y=Zs(h,-1);if((g==='"'||g==="'"||g==="`"||y==='"'||y==="'"||y==="`")&&g!==y)throw new Vo("property names with quotes must have matching quotes");if((h==="constructor"||!_)&&(l=!0),i+="."+h,c="%"+i+"%",Ws(to,c))d=to[c];else if(d!=null){if(!(h in d)){if(!r)throw new qo("base intrinsic for "+e+" exists, but the property is not available.");return}if(Ji&&f+1>=n.length){var T=Ji(d,h);_=!!T,_&&"get"in T&&!("originalValue"in T.get)?d=T.get:d=d[h]}else _=Ws(d,h),d=d[h];_&&!l&&(to[c]=d)}}return d},"GetIntrinsic")});var Cv=k((TJ,Ov)=>{"use strict";var pC=Yl();Ov.exports=o(function(){return pC()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Nv=k((AJ,kv)=>{"use strict";var fC=Qi(),$v=fC("%Object.defineProperty%",!0),mC=Cv()(),hC=nd(),gC=Cn(),Ks=mC?Symbol.toStringTag:null;kv.exports=o(function(e,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new gC("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Ks&&(n||!hC(e,Ks))&&($v?$v(e,Ks,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[Ks]=r)},"setToStringTag")});var Dv=k((IJ,zv)=>{"use strict";var yC=Function.prototype.call,_C=Object.prototype.hasOwnProperty,vC=Lo();zv.exports=vC.call(yC,_C)});var Mv=k((RJ,Uv)=>{"use strict";Uv.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var Fv=k((OJ,Lv)=>{"use strict";var cd=Hy(),bC=require("util"),ad=require("path"),PC=require("http"),SC=require("https"),EC=require("url").parse,TC=require("fs"),xC=require("stream").Stream,AC=require("crypto"),sd=Jy(),wC=f_(),IC=Nv(),$n=Dv(),ud=Mv();function jv(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(jv,"escapeHeaderParam");function Ue(t){if(!(this instanceof Ue))return new Ue(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],cd.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(Ue,"FormData");bC.inherits(Ue,cd);Ue.LINE_BREAK=`\r
2
+ `;Ue.DEFAULT_CONTENT_TYPE="application/octet-stream";Ue.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=cd.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r),s=this._multiPartFooter();n(i),n(e),n(s),this._trackLength(i,e,r)};Ue.prototype._trackLength=function(t,e,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(e)?n=e.length:typeof e=="string"&&(n=Buffer.byteLength(e)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(t)+Ue.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&$n(e,"httpVersion"))&&!(e instanceof xC))&&(r.knownLength||this._valuesToMeasure.push(e))};Ue.prototype._lengthRetriever=function(t,e){$n(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):TC.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):$n(t,"httpVersion")?e(null,Number(t.headers["content-length"])):$n(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};Ue.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),i=this._getContentType(e,r),s="",c={"Content-Disposition":["form-data",'name="'+jv(t)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&ud(c,r.header);var d;for(var l in c)if($n(c,l)){if(d=c[l],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=l+": "+d.join("; ")+Ue.LINE_BREAK)}return"--"+this.getBoundary()+Ue.LINE_BREAK+s+Ue.LINE_BREAK};Ue.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=ad.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=ad.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&$n(t,"httpVersion")&&(r=ad.basename(t.client._httpMessage.path||"")),r)return'filename="'+jv(r)+'"'};Ue.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=sd.lookup(t.name)),!r&&t&&t.path&&(r=sd.lookup(t.path)),!r&&t&&t.readable&&$n(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=sd.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=Ue.DEFAULT_CONTENT_TYPE),r};Ue.prototype._multiPartFooter=function(){return function(t){var e=Ue.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};Ue.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Ue.LINE_BREAK};Ue.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)$n(t,e)&&(r[e.toLowerCase()]=t[e]);return r};Ue.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Ue.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Ue.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?t=Buffer.concat([t,this._streams[r]]):t=Buffer.concat([t,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(Ue.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Ue.prototype._generateBoundary=function(){this._boundary="--------------------------"+AC.randomBytes(12).toString("hex")};Ue.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};Ue.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Ue.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}wC.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};Ue.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=EC(t),n=ud({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=ud(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=SC.request(n):r=PC.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),e){var d,l=o(function(p,f){return r.removeListener("error",l),r.removeListener("response",d),e.call(this,p,f)},"callback");d=l.bind(this,null),r.on("error",l),r.on("response",d)}}.bind(this)),r};Ue.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Ue.prototype.toString=function(){return"[object FormData]"};IC(Ue.prototype,"FormData");Lv.exports=Ue});var ta=k((P8,tb)=>{"use strict";var Js=Object.prototype.hasOwnProperty,eb=Object.prototype.toString,Zv=Object.defineProperty,Kv=Object.getOwnPropertyDescriptor,Jv=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):eb.call(e)==="[object Array]"},"isArray"),Yv=o(function(e){if(!e||eb.call(e)!=="[object Object]")return!1;var r=Js.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&Js.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||Js.call(e,i)},"isPlainObject"),Xv=o(function(e,r){Zv&&r.name==="__proto__"?Zv(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),Qv=o(function(e,r){if(r==="__proto__")if(Js.call(e,r)){if(Kv)return Kv(e,r).value}else return;return e[r]},"getProperty");tb.exports=o(function t(){var e,r,n,i,s,c,d=arguments[0],l=1,p=arguments.length,f=!1;for(typeof d=="boolean"&&(f=d,d=arguments[1]||{},l=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});l<p;++l)if(e=arguments[l],e!=null)for(r in e)n=Qv(d,r),i=Qv(e,r),d!==i&&(f&&i&&(Yv(i)||(s=Jv(i)))?(s?(s=!1,c=n&&Jv(n)?n:[]):c=n&&Yv(n)?n:{},Xv(d,{name:r,newValue:t(f,c,i)})):typeof i<"u"&&Xv(d,{name:r,newValue:i}));return d},"extend")});var rb=k((E8,UC)=>{UC.exports={name:"gaxios",version:"7.1.3",description:"A simple common HTTP client specifically for Google APIs and services.",main:"build/cjs/src/index.js",types:"build/cjs/src/index.d.ts",files:["build/"],exports:{".":{import:{types:"./build/esm/src/index.d.ts",default:"./build/esm/src/index.js"},require:{types:"./build/cjs/src/index.d.ts",default:"./build/cjs/src/index.js"}}},scripts:{lint:"gts check --no-inline-config",test:"c8 mocha build/esm/test","presystem-test":"npm run compile","system-test":"mocha build/esm/system-test --timeout 80000",compile:"tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"jsdoc -c .jsdoc.js","docs-test":"linkinator docs","predocs-test":"npm run docs","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean"},repository:{type:"git",directory:"packages/gaxios",url:"https://github.com/googleapis/google-cloud-node-core.git"},keywords:["google"],engines:{node:">=18"},author:"Google, LLC",license:"Apache-2.0",devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/cors":"^2.8.6","@types/express":"^5.0.0","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/multiparty":"4.2.1","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","@types/tmp":"0.2.6",assert:"^2.0.0",browserify:"^17.0.0",c8:"^10.0.0",cors:"^2.8.5",express:"^5.0.0",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",linkinator:"^6.1.2",mocha:"^11.1.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.0-beta.13","null-loader":"^4.0.0","pack-n-play":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","stream-browserify":"^3.0.0",tmp:"0.2.5","ts-loader":"^9.5.2",typescript:"^5.8.3",webpack:"^5.35.0","webpack-cli":"^6.0.1"},dependencies:{extend:"^3.0.2","https-proxy-agent":"^7.0.1","node-fetch":"^3.3.2",rimraf:"^5.0.1"},homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios"}});var ob=k((T8,nb)=>{"use strict";var MC=rb();nb.exports={pkg:MC}});var pd=k(er=>{"use strict";var ab=er&&er.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(er,"__esModule",{value:!0});er.GaxiosError=er.GAXIOS_ERROR_SYMBOL=void 0;er.defaultErrorRedactor=sb;var ib=ab(ta()),jC=ab(ob()),ld=jC.default.pkg;er.GAXIOS_ERROR_SYMBOL=Symbol.for(`${ld.name}-gaxios-error`);var dd=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[er.GAXIOS_ERROR_SYMBOL]=ld.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&er.GAXIOS_ERROR_SYMBOL in e&&e[er.GAXIOS_ERROR_SYMBOL]===ld.version?!0:Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,r,n,i){if(super(e,{cause:i}),this.config=r,this.response=n,this.error=i instanceof Error?i:void 0,this.config=(0,ib.default)(!0,{},r),this.response&&(this.response.config=(0,ib.default)(!0,{},this.response.config)),this.response){try{this.response.data=LC(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}i instanceof DOMException?this.code=i.name:i&&typeof i=="object"&&"code"in i&&(typeof i.code=="string"||typeof i.code=="number")&&(this.code=i.code)}static extractAPIErrorFromResponse(e,r="The request failed"){let n=r;if(typeof e.data=="string"&&(n=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){n="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:n;let i="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,s="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let c=[];for(let d of e.data.error.errors)typeof d=="object"&&"message"in d&&typeof d.message=="string"&&c.push(d.message);return Object.assign({message:c.join(`
3
+ `)||n,code:s,status:i},e.data.error)}return Object.assign({message:n,code:s,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};er.GaxiosError=dd;function LC(t,e){switch(t){case"stream":return e;case"json":return JSON.parse(JSON.stringify(e));case"arraybuffer":return JSON.parse(Buffer.from(e).toString("utf8"));case"blob":return JSON.parse(e.text());default:return e}}o(LC,"translateData");function sb(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((c,d)=>{(/^authentication$/i.test(d)||/^authorization$/i.test(d)||/secret/i.test(d))&&s.set(d,e)})}o(r,"redactHeaders");function n(s,c){if(typeof s=="object"&&s!==null&&typeof s[c]=="string"){let d=s[c];(/grant_type=/i.test(d)||/assertion=/i.test(d)||/secret/i.test(d))&&(s[c]=e)}}o(n,"redactString");function i(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((c,d)=>{(["grant_type","assertion"].includes(d)||/secret/.test(d))&&s.set(d,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return o(i,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),i(t.config.data),n(t.config,"body"),i(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(sb({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(sb,"defaultErrorRedactor")});var cb=k(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.getRetryConfig=FC;async function FC(t){let e=ub(t);if(!t||!t.config||!e&&!t.config.retry)return{shouldRetry:!1};e=e||{},e.currentRetryAttempt=e.currentRetryAttempt||0,e.retry=e.retry===void 0||e.retry===null?3:e.retry,e.httpMethodsToRetry=e.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],e.noResponseRetries=e.noResponseRetries===void 0||e.noResponseRetries===null?2:e.noResponseRetries,e.retryDelayMultiplier=e.retryDelayMultiplier?e.retryDelayMultiplier:2,e.timeOfFirstRequest=e.timeOfFirstRequest?e.timeOfFirstRequest:Date.now(),e.totalTimeout=e.totalTimeout?e.totalTimeout:Number.MAX_SAFE_INTEGER,e.maxRetryDelay=e.maxRetryDelay?e.maxRetryDelay:Number.MAX_SAFE_INTEGER;let r=[[100,199],[408,408],[429,429],[500,599]];if(e.statusCodesToRetry=e.statusCodesToRetry||r,t.config.retryConfig=e,!await(e.shouldRetry||BC)(t))return{shouldRetry:!1,config:t.config};let i=qC(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,i):new Promise(c=>{setTimeout(c,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}o(FC,"getRetryConfig");function BC(t){let e=ub(t);if(t.config.signal?.aborted&&t.code!=="TimeoutError"||t.code==="AbortError"||!e||e.retry===0||!t.response&&(e.currentRetryAttempt||0)>=e.noResponseRetries||!e.httpMethodsToRetry||!e.httpMethodsToRetry.includes(t.config.method?.toUpperCase()||"GET"))return!1;if(t.response&&t.response.status){let r=!1;for(let[n,i]of e.statusCodesToRetry){let s=t.response.status;if(s>=n&&s<=i){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}o(BC,"shouldRetryRequest");function ub(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(ub,"getConfig");function qC(t){let r=(t.currentRetryAttempt?0:t.retryDelay??100)+(Math.pow(t.retryDelayMultiplier,t.currentRetryAttempt)-1)/2*1e3,n=t.totalTimeout-(Date.now()-t.timeOfFirstRequest);return Math.min(r,n,t.maxRetryDelay)}o(qC,"getNextRetryDelay")});var hd=k(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.GaxiosInterceptorManager=void 0;var md=class extends Set{static{o(this,"GaxiosInterceptorManager")}};Ys.GaxiosInterceptorManager=md});var db=k((C8,lb)=>{var Ho=1e3,Go=Ho*60,Wo=Go*60,ro=Wo*24,VC=ro*7,HC=ro*365.25;lb.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return GC(t);if(r==="number"&&isFinite(t))return e.long?ZC(t):WC(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function GC(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*HC;case"weeks":case"week":case"w":return r*VC;case"days":case"day":case"d":return r*ro;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Wo;case"minutes":case"minute":case"mins":case"min":case"m":return r*Go;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ho;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(GC,"parse");function WC(t){var e=Math.abs(t);return e>=ro?Math.round(t/ro)+"d":e>=Wo?Math.round(t/Wo)+"h":e>=Go?Math.round(t/Go)+"m":e>=Ho?Math.round(t/Ho)+"s":t+"ms"}o(WC,"fmtShort");function ZC(t){var e=Math.abs(t);return e>=ro?Xs(t,e,ro,"day"):e>=Wo?Xs(t,e,Wo,"hour"):e>=Go?Xs(t,e,Go,"minute"):e>=Ho?Xs(t,e,Ho,"second"):t+" ms"}o(ZC,"fmtLong");function Xs(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(Xs,"plural")});var gd=k((k8,pb)=>{function KC(t){r.debug=r,r.default=r,r.coerce=l,r.disable=c,r.enable=i,r.enabled=d,r.humanize=db(),r.destroy=p,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let _=0;for(let h=0;h<f.length;h++)_=(_<<5)-_+f.charCodeAt(h),_|=0;return r.colors[Math.abs(_)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(f){let _,h=null,g,y;function T(...P){if(!T.enabled)return;let x=T,N=Number(new Date),L=N-(_||N);x.diff=L,x.prev=_,x.curr=N,_=N,P[0]=r.coerce(P[0]),typeof P[0]!="string"&&P.unshift("%O");let X=0;P[0]=P[0].replace(/%([a-zA-Z%])/g,(G,Z)=>{if(G==="%%")return"%";X++;let ee=r.formatters[Z];if(typeof ee=="function"){let Y=P[X];G=ee.call(x,Y),P.splice(X,1),X--}return G}),r.formatArgs.call(x,P),(x.log||r.log).apply(x,P)}return o(T,"debug"),T.namespace=f,T.useColors=r.useColors(),T.color=r.selectColor(f),T.extend=n,T.destroy=r.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:o(()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,y=r.enabled(f)),y),"get"),set:o(P=>{h=P},"set")}),typeof r.init=="function"&&r.init(T),T}o(r,"createDebug");function n(f,_){let h=r(this.namespace+(typeof _>"u"?":":_)+f);return h.log=this.log,h}o(n,"extend");function i(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let _=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of _)h[0]==="-"?r.skips.push(h.slice(1)):r.names.push(h)}o(i,"enable");function s(f,_){let h=0,g=0,y=-1,T=0;for(;h<f.length;)if(g<_.length&&(_[g]===f[h]||_[g]==="*"))_[g]==="*"?(y=g,T=h,g++):(h++,g++);else if(y!==-1)g=y+1,T++,h=T;else return!1;for(;g<_.length&&_[g]==="*";)g++;return g===_.length}o(s,"matchesTemplate");function c(){let f=[...r.names,...r.skips.map(_=>"-"+_)].join(",");return r.enable(""),f}o(c,"disable");function d(f){for(let _ of r.skips)if(s(f,_))return!1;for(let _ of r.names)if(s(f,_))return!0;return!1}o(d,"enabled");function l(f){return f instanceof Error?f.stack||f.message:f}o(l,"coerce");function p(){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 o(p,"destroy"),r.enable(r.load()),r}o(KC,"setup");pb.exports=KC});var fb=k((Ot,Qs)=>{Ot.formatArgs=YC;Ot.save=XC;Ot.load=QC;Ot.useColors=JC;Ot.storage=e0();Ot.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();Ot.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 JC(){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 t;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&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o(JC,"useColors");function YC(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Qs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}o(YC,"formatArgs");Ot.log=console.debug||console.log||(()=>{});function XC(t){try{t?Ot.storage.setItem("debug",t):Ot.storage.removeItem("debug")}catch{}}o(XC,"save");function QC(){let t;try{t=Ot.storage.getItem("debug")||Ot.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(QC,"load");function e0(){try{return localStorage}catch{}}o(e0,"localstorage");Qs.exports=gd()(Ot);var{formatters:t0}=Qs.exports;t0.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var hb=k((D8,mb)=>{"use strict";mb.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var _b=k((U8,yb)=>{"use strict";var r0=require("os"),gb=require("tty"),tr=hb(),{env:_t}=process,Nn;tr("no-color")||tr("no-colors")||tr("color=false")||tr("color=never")?Nn=0:(tr("color")||tr("colors")||tr("color=true")||tr("color=always"))&&(Nn=1);"FORCE_COLOR"in _t&&(_t.FORCE_COLOR==="true"?Nn=1:_t.FORCE_COLOR==="false"?Nn=0:Nn=_t.FORCE_COLOR.length===0?1:Math.min(parseInt(_t.FORCE_COLOR,10),3));function yd(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(yd,"translateLevel");function _d(t,e){if(Nn===0)return 0;if(tr("color=16m")||tr("color=full")||tr("color=truecolor"))return 3;if(tr("color=256"))return 2;if(t&&!e&&Nn===void 0)return 0;let r=Nn||0;if(_t.TERM==="dumb")return r;if(process.platform==="win32"){let n=r0.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in _t)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in _t)||_t.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in _t)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_t.TEAMCITY_VERSION)?1:0;if(_t.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in _t){let n=parseInt((_t.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_t.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(_t.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_t.TERM)||"COLORTERM"in _t?1:r}o(_d,"supportsColor");function n0(t){let e=_d(t,t&&t.isTTY);return yd(e)}o(n0,"getSupportLevel");yb.exports={supportsColor:n0,stdout:yd(_d(!0,gb.isatty(1))),stderr:yd(_d(!0,gb.isatty(2)))}});var bb=k((vt,tu)=>{var o0=require("tty"),eu=require("util");vt.init=d0;vt.log=u0;vt.formatArgs=a0;vt.save=c0;vt.load=l0;vt.useColors=i0;vt.destroy=eu.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");vt.colors=[6,2,3,4,5,1];try{let t=_b();t&&(t.stderr||t).level>=2&&(vt.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{}vt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];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),t[r]=n,t},{});function i0(){return"colors"in vt.inspectOpts?!!vt.inspectOpts.colors:o0.isatty(process.stderr.fd)}o(i0,"useColors");function a0(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
4
4
  `).join(`
5
- `+s),t.push(i+"m+"+tu.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=i0()+e+" "+t[0]}o(o0,"formatArgs");function i0(){return vt.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(i0,"getDate");function a0(...t){return process.stderr.write(eu.formatWithOptions(vt.inspectOpts,...t)+`
6
- `)}o(a0,"log");function s0(t){t?process.env.DEBUG=t:delete process.env.DEBUG}o(s0,"save");function u0(){return process.env.DEBUG}o(u0,"load");function c0(t){t.inspectOpts={};let e=Object.keys(vt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=vt.inspectOpts[e[r]]}o(c0,"init");tu.exports=gd()(vt);var{formatters:_b}=tu.exports;_b.o=function(t){return this.inspectOpts.colors=this.useColors,eu.inspect(t,this.inspectOpts).split(`
7
- `).map(e=>e.trim()).join(" ")};_b.O=function(t){return this.inspectOpts.colors=this.useColors,eu.inspect(t,this.inspectOpts)}});var bd=k((D8,vd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?vd.exports=pb():vd.exports=vb()});var Sb=k(Ct=>{"use strict";var l0=Ct&&Ct.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),d0=Ct&&Ct.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bb=Ct&&Ct.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&l0(e,t,r);return d0(e,t),e};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.req=Ct.json=Ct.toBuffer=void 0;var p0=bb(require("http")),f0=bb(require("https"));async function Pb(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}o(Pb,"toBuffer");Ct.toBuffer=Pb;async function m0(t){let r=(await Pb(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let i=n;throw i.message+=` (input: ${r})`,i}}o(m0,"json");Ct.json=m0;function h0(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?f0:p0).request(t,e),i=new Promise((s,c)=>{n.once("response",s).once("error",c).end()});return n.then=i.then.bind(i),n}o(h0,"req");Ct.req=h0});var Ab=k(jt=>{"use strict";var Tb=jt&&jt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),g0=jt&&jt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xb=jt&&jt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Tb(e,t,r);return g0(e,t),e},y0=jt&&jt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tb(e,t,r)};Object.defineProperty(jt,"__esModule",{value:!0});jt.Agent=void 0;var _0=xb(require("net")),Eb=xb(require("http")),v0=require("https");y0(Sb(),jt);var Ir=Symbol("AgentBaseInternalState"),Pd=class extends Eb.Agent{static{o(this,"Agent")}constructor(e){super(e),this[Ir]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
8
- `).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new _0.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let n=this.sockets[e],i=n.indexOf(r);i!==-1&&(n.splice(i,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?v0.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let i={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(i),c=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(d=>{if(this.decrementSockets(s,c),d instanceof Eb.Agent)try{return d.addRequest(e,i)}catch(l){return n(l)}this[Ir].currentSocket=d,super.createSocket(e,r,n)},d=>{this.decrementSockets(s,c),n(d)})}createConnection(){let e=this[Ir].currentSocket;if(this[Ir].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Ir].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Ir]&&(this[Ir].defaultPort=e)}get protocol(){return this[Ir].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Ir]&&(this[Ir].protocol=e)}};jt.Agent=Pd});var wb=k(Zo=>{"use strict";var b0=Zo&&Zo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zo,"__esModule",{value:!0});Zo.parseProxyResponse=void 0;var P0=b0(bd()),ru=(0,P0.default)("https-proxy-agent:parse-proxy-response");function S0(t){return new Promise((e,r)=>{let n=0,i=[];function s(){let f=t.read();f?p(f):t.once("readable",s)}o(s,"read");function c(){t.removeListener("end",d),t.removeListener("error",l),t.removeListener("readable",s)}o(c,"cleanup");function d(){c(),ru("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}o(d,"onend");function l(f){c(),ru("onerror %o",f),r(f)}o(l,"onerror");function p(f){i.push(f),n+=f.length;let _=Buffer.concat(i,n),h=_.indexOf(`\r
5
+ `+s),t.push(i+"m+"+tu.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=s0()+e+" "+t[0]}o(a0,"formatArgs");function s0(){return vt.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(s0,"getDate");function u0(...t){return process.stderr.write(eu.formatWithOptions(vt.inspectOpts,...t)+`
6
+ `)}o(u0,"log");function c0(t){t?process.env.DEBUG=t:delete process.env.DEBUG}o(c0,"save");function l0(){return process.env.DEBUG}o(l0,"load");function d0(t){t.inspectOpts={};let e=Object.keys(vt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=vt.inspectOpts[e[r]]}o(d0,"init");tu.exports=gd()(vt);var{formatters:vb}=tu.exports;vb.o=function(t){return this.inspectOpts.colors=this.useColors,eu.inspect(t,this.inspectOpts).split(`
7
+ `).map(e=>e.trim()).join(" ")};vb.O=function(t){return this.inspectOpts.colors=this.useColors,eu.inspect(t,this.inspectOpts)}});var bd=k((L8,vd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?vd.exports=fb():vd.exports=bb()});var Eb=k(Ct=>{"use strict";var p0=Ct&&Ct.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),f0=Ct&&Ct.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Pb=Ct&&Ct.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&p0(e,t,r);return f0(e,t),e};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.req=Ct.json=Ct.toBuffer=void 0;var m0=Pb(require("http")),h0=Pb(require("https"));async function Sb(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}o(Sb,"toBuffer");Ct.toBuffer=Sb;async function g0(t){let r=(await Sb(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let i=n;throw i.message+=` (input: ${r})`,i}}o(g0,"json");Ct.json=g0;function y0(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?h0:m0).request(t,e),i=new Promise((s,c)=>{n.once("response",s).once("error",c).end()});return n.then=i.then.bind(i),n}o(y0,"req");Ct.req=y0});var wb=k(jt=>{"use strict";var xb=jt&&jt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_0=jt&&jt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Ab=jt&&jt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&xb(e,t,r);return _0(e,t),e},v0=jt&&jt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xb(e,t,r)};Object.defineProperty(jt,"__esModule",{value:!0});jt.Agent=void 0;var b0=Ab(require("net")),Tb=Ab(require("http")),P0=require("https");v0(Eb(),jt);var Ir=Symbol("AgentBaseInternalState"),Pd=class extends Tb.Agent{static{o(this,"Agent")}constructor(e){super(e),this[Ir]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
8
+ `).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new b0.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let n=this.sockets[e],i=n.indexOf(r);i!==-1&&(n.splice(i,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?P0.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let i={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(i),c=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(d=>{if(this.decrementSockets(s,c),d instanceof Tb.Agent)try{return d.addRequest(e,i)}catch(l){return n(l)}this[Ir].currentSocket=d,super.createSocket(e,r,n)},d=>{this.decrementSockets(s,c),n(d)})}createConnection(){let e=this[Ir].currentSocket;if(this[Ir].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Ir].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Ir]&&(this[Ir].defaultPort=e)}get protocol(){return this[Ir].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Ir]&&(this[Ir].protocol=e)}};jt.Agent=Pd});var Ib=k(Zo=>{"use strict";var S0=Zo&&Zo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zo,"__esModule",{value:!0});Zo.parseProxyResponse=void 0;var E0=S0(bd()),ru=(0,E0.default)("https-proxy-agent:parse-proxy-response");function T0(t){return new Promise((e,r)=>{let n=0,i=[];function s(){let f=t.read();f?p(f):t.once("readable",s)}o(s,"read");function c(){t.removeListener("end",d),t.removeListener("error",l),t.removeListener("readable",s)}o(c,"cleanup");function d(){c(),ru("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}o(d,"onend");function l(f){c(),ru("onerror %o",f),r(f)}o(l,"onerror");function p(f){i.push(f),n+=f.length;let _=Buffer.concat(i,n),h=_.indexOf(`\r
9
9
  \r
10
10
  `);if(h===-1){ru("have not received end of HTTP headers yet..."),s();return}let g=_.slice(0,h).toString("ascii").split(`\r
11
- `),y=g.shift();if(!y)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let T=y.split(" "),P=+T[1],x=T.slice(2).join(" "),N={};for(let L of g){if(!L)continue;let X=L.indexOf(":");if(X===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${L}"`));let W=L.slice(0,X).toLowerCase(),G=L.slice(X+1).trimStart(),Z=N[W];typeof Z=="string"?N[W]=[Z,G]:Array.isArray(Z)?Z.push(G):N[W]=G}ru("got proxy server response: %o %o",y,N),c(),e({connect:{statusCode:P,statusText:x,headers:N},buffered:_})}o(p,"ondata"),t.on("error",l),t.on("end",d),s()})}o(S0,"parseProxyResponse");Zo.parseProxyResponse=S0});var kb=k(rr=>{"use strict";var E0=rr&&rr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),T0=rr&&rr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Cb=rr&&rr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&E0(e,t,r);return T0(e,t),e},$b=rr&&rr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rr,"__esModule",{value:!0});rr.HttpsProxyAgent=void 0;var nu=Cb(require("net")),Ib=Cb(require("tls")),x0=$b(require("assert")),A0=$b(bd()),w0=Ab(),I0=require("url"),R0=wb(),ra=(0,A0.default)("https-proxy-agent"),Rb=o(t=>t.servername===void 0&&t.host&&!nu.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),ou=class extends w0.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new I0.URL(e):e,this.proxyHeaders=r?.headers??{},ra("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?Ob(r,"headers"):null,host:n,port:i}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let i;n.protocol==="https:"?(ra("Creating `tls.Socket`: %o",this.connectOpts),i=Ib.connect(Rb(this.connectOpts))):(ra("Creating `net.Socket`: %o",this.connectOpts),i=nu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=nu.isIPv6(r.host)?`[${r.host}]`:r.host,d=`CONNECT ${c}:${r.port} HTTP/1.1\r
11
+ `),y=g.shift();if(!y)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let T=y.split(" "),P=+T[1],x=T.slice(2).join(" "),N={};for(let L of g){if(!L)continue;let X=L.indexOf(":");if(X===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${L}"`));let W=L.slice(0,X).toLowerCase(),G=L.slice(X+1).trimStart(),Z=N[W];typeof Z=="string"?N[W]=[Z,G]:Array.isArray(Z)?Z.push(G):N[W]=G}ru("got proxy server response: %o %o",y,N),c(),e({connect:{statusCode:P,statusText:x,headers:N},buffered:_})}o(p,"ondata"),t.on("error",l),t.on("end",d),s()})}o(T0,"parseProxyResponse");Zo.parseProxyResponse=T0});var Nb=k(rr=>{"use strict";var x0=rr&&rr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),A0=rr&&rr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$b=rr&&rr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&x0(e,t,r);return A0(e,t),e},kb=rr&&rr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rr,"__esModule",{value:!0});rr.HttpsProxyAgent=void 0;var nu=$b(require("net")),Rb=$b(require("tls")),w0=kb(require("assert")),I0=kb(bd()),R0=wb(),O0=require("url"),C0=Ib(),ra=(0,I0.default)("https-proxy-agent"),Ob=o(t=>t.servername===void 0&&t.host&&!nu.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),ou=class extends R0.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new O0.URL(e):e,this.proxyHeaders=r?.headers??{},ra("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?Cb(r,"headers"):null,host:n,port:i}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let i;n.protocol==="https:"?(ra("Creating `tls.Socket`: %o",this.connectOpts),i=Rb.connect(Ob(this.connectOpts))):(ra("Creating `net.Socket`: %o",this.connectOpts),i=nu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=nu.isIPv6(r.host)?`[${r.host}]`:r.host,d=`CONNECT ${c}:${r.port} HTTP/1.1\r
12
12
  `;if(n.username||n.password){let h=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(h).toString("base64")}`}s.Host=`${c}:${r.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let h of Object.keys(s))d+=`${h}: ${s[h]}\r
13
- `;let l=(0,R0.parseProxyResponse)(i);i.write(`${d}\r
14
- `);let{connect:p,buffered:f}=await l;if(e.emit("proxyConnect",p),this.emit("proxyConnect",p,e),p.statusCode===200)return e.once("socket",O0),r.secureEndpoint?(ra("Upgrading socket connection to TLS"),Ib.connect({...Ob(Rb(r),"host","path","port"),socket:i})):i;i.destroy();let _=new nu.Socket({writable:!1});return _.readable=!0,e.once("socket",h=>{ra("Replaying proxy buffer for failed request"),(0,x0.default)(h.listenerCount("data")>0),h.push(f),h.push(null)}),_}};ou.protocols=["http","https"];rr.HttpsProxyAgent=ou;function O0(t){t.resume()}o(O0,"resume");function Ob(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(Ob,"omit")});function C0(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,s=r[0]||"text/plain",c=s;for(let f=1;f<r.length;f++)r[f]==="base64"?i=!0:r[f]&&(c+=`;${r[f]}`,r[f].indexOf("charset=")===0&&(n=r[f].substring(8)));!r[0]&&!n.length&&(c+=";charset=US-ASCII",n="US-ASCII");let d=i?"base64":"ascii",l=unescape(t.substring(e+1)),p=Buffer.from(l,d);return p.type=s,p.typeFull=c,p.charset=n,p}var Nb,zb=gt(()=>{o(C0,"dataUriToBuffer");Nb=C0});var Ub=k((iu,Db)=>{(function(t,e){typeof iu=="object"&&typeof Db<"u"?e(iu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(iu,(function(t){"use strict";function e(){}o(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(r,"typeIsObject");let n=e;function i(a,u){try{Object.defineProperty(a,"name",{value:u,configurable:!0})}catch{}}o(i,"setFunctionName");let s=Promise,c=Promise.prototype.then,d=Promise.reject.bind(s);function l(a){return new s(a)}o(l,"newPromise");function p(a){return l(u=>u(a))}o(p,"promiseResolvedWith");function f(a){return d(a)}o(f,"promiseRejectedWith");function _(a,u,m){return c.call(a,u,m)}o(_,"PerformPromiseThen");function h(a,u,m){_(_(a,u,m),void 0,n)}o(h,"uponPromise");function g(a,u){h(a,u)}o(g,"uponFulfillment");function y(a,u){h(a,void 0,u)}o(y,"uponRejection");function T(a,u,m){return _(a,u,m)}o(T,"transformPromiseWith");function P(a){_(a,void 0,n)}o(P,"setPromiseIsHandledToTrue");let x=o(a=>{if(typeof queueMicrotask=="function")x=queueMicrotask;else{let u=p(void 0);x=o(m=>_(u,m),"_queueMicrotask")}return x(a)},"_queueMicrotask");function N(a,u,m){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,u,m)}o(N,"reflectCall");function L(a,u,m){try{return p(N(a,u,m))}catch(S){return f(S)}}o(L,"promiseCall");let X=16384;class W{static{o(this,"SimpleQueue")}constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(u){let m=this._back,S=m;m._elements.length===X-1&&(S={_elements:[],_next:void 0}),m._elements.push(u),S!==m&&(this._back=S,m._next=S),++this._size}shift(){let u=this._front,m=u,S=this._cursor,w=S+1,M=u._elements,F=M[S];return w===X&&(m=u._next,w=0),--this._size,this._cursor=w,u!==m&&(this._front=m),M[S]=void 0,F}forEach(u){let m=this._cursor,S=this._front,w=S._elements;for(;(m!==w.length||S._next!==void 0)&&!(m===w.length&&(S=S._next,w=S._elements,m=0,w.length===0));)u(w[m]),++m}peek(){let u=this._front,m=this._cursor;return u._elements[m]}}let G=Symbol("[[AbortSteps]]"),Z=Symbol("[[ErrorSteps]]"),ee=Symbol("[[CancelSteps]]"),Y=Symbol("[[PullSteps]]"),Se=Symbol("[[ReleaseSteps]]");function te(a,u){a._ownerReadableStream=u,u._reader=a,u._state==="readable"?K(a):u._state==="closed"?oe(a):re(a,u._storedError)}o(te,"ReadableStreamReaderGenericInitialize");function q(a,u){let m=a._ownerReadableStream;return lr(m,u)}o(q,"ReadableStreamReaderGenericCancel");function B(a){let u=a._ownerReadableStream;u._state==="readable"?Ae(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Oe(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._readableStreamController[Se](),u._reader=void 0,a._ownerReadableStream=void 0}o(B,"ReadableStreamReaderGenericRelease");function J(a){return new TypeError("Cannot "+a+" a stream using a released reader")}o(J,"readerLockException");function K(a){a._closedPromise=l((u,m)=>{a._closedPromise_resolve=u,a._closedPromise_reject=m})}o(K,"defaultReaderClosedPromiseInitialize");function re(a,u){K(a),Ae(a,u)}o(re,"defaultReaderClosedPromiseInitializeAsRejected");function oe(a){K(a),Be(a)}o(oe,"defaultReaderClosedPromiseInitializeAsResolved");function Ae(a,u){a._closedPromise_reject!==void 0&&(P(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ae,"defaultReaderClosedPromiseReject");function Oe(a,u){re(a,u)}o(Oe,"defaultReaderClosedPromiseResetToRejected");function Be(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Be,"defaultReaderClosedPromiseResolve");let Ge=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},ht=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function Q(a){return typeof a=="object"||typeof a=="function"}o(Q,"isDictionary");function tt(a,u){if(a!==void 0&&!Q(a))throw new TypeError(`${u} is not an object.`)}o(tt,"assertDictionary");function it(a,u){if(typeof a!="function")throw new TypeError(`${u} is not a function.`)}o(it,"assertFunction");function Nt(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(Nt,"isObject");function Fe(a,u){if(!Nt(a))throw new TypeError(`${u} is not an object.`)}o(Fe,"assertObject");function qe(a,u,m){if(a===void 0)throw new TypeError(`Parameter ${u} is required in '${m}'.`)}o(qe,"assertRequiredArgument");function v(a,u,m){if(a===void 0)throw new TypeError(`${u} is required in '${m}'.`)}o(v,"assertRequiredField");function E(a){return Number(a)}o(E,"convertUnrestrictedDouble");function A(a){return a===0?0:a}o(A,"censorNegativeZero");function D(a){return A(ht(a))}o(D,"integerPart");function R(a,u){let S=Number.MAX_SAFE_INTEGER,w=Number(a);if(w=A(w),!Ge(w))throw new TypeError(`${u} is not a finite number`);if(w=D(w),w<0||w>S)throw new TypeError(`${u} is outside the accepted range of 0 to ${S}, inclusive`);return!Ge(w)||w===0?0:w}o(R,"convertUnsignedLongLongWithEnforceRange");function $(a,u){if(!gn(a))throw new TypeError(`${u} is not a ReadableStream.`)}o($,"assertReadableStream");function j(a){return new V(a)}o(j,"AcquireReadableStreamDefaultReader");function I(a,u){a._reader._readRequests.push(u)}o(I,"ReadableStreamAddReadRequest");function O(a,u,m){let w=a._reader._readRequests.shift();m?w._closeSteps():w._chunkSteps(u)}o(O,"ReadableStreamFulfillReadRequest");function U(a){return a._reader._readRequests.length}o(U,"ReadableStreamGetNumReadRequests");function z(a){let u=a._reader;return!(u===void 0||!ie(u))}o(z,"ReadableStreamHasDefaultReader");class V{static{o(this,"ReadableStreamDefaultReader")}constructor(u){if(qe(u,1,"ReadableStreamDefaultReader"),$(u,"First parameter"),yn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");te(this,u),this._readRequests=new W}get closed(){return ie(this)?this._closedPromise:f(Ye("closed"))}cancel(u=void 0){return ie(this)?this._ownerReadableStream===void 0?f(J("cancel")):q(this,u):f(Ye("cancel"))}read(){if(!ie(this))return f(Ye("read"));if(this._ownerReadableStream===void 0)return f(J("read from"));let u,m,S=l((M,F)=>{u=M,m=F});return ue(this,{_chunkSteps:o(M=>u({value:M,done:!1}),"_chunkSteps"),_closeSteps:o(()=>u({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(M=>m(M),"_errorSteps")}),S}releaseLock(){if(!ie(this))throw Ye("releaseLock");this._ownerReadableStream!==void 0&&De(this)}}Object.defineProperties(V.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(V.prototype.cancel,"cancel"),i(V.prototype.read,"read"),i(V.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(V.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function ie(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof V}o(ie,"IsReadableStreamDefaultReader");function ue(a,u){let m=a._ownerReadableStream;m._disturbed=!0,m._state==="closed"?u._closeSteps():m._state==="errored"?u._errorSteps(m._storedError):m._readableStreamController[Y](u)}o(ue,"ReadableStreamDefaultReaderRead");function De(a){B(a);let u=new TypeError("Reader was released");Je(a,u)}o(De,"ReadableStreamDefaultReaderRelease");function Je(a,u){let m=a._readRequests;a._readRequests=new W,m.forEach(S=>{S._errorSteps(u)})}o(Je,"ReadableStreamDefaultReaderErrorReadRequests");function Ye(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}o(Ye,"defaultReaderBrandCheckException");let ze=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class je{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(u,m){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=u,this._preventCancel=m}next(){let u=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?T(this._ongoingPromise,u,u):u(),this._ongoingPromise}return(u){let m=o(()=>this._returnSteps(u),"returnSteps");return this._ongoingPromise?T(this._ongoingPromise,m,m):m()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let u=this._reader,m,S,w=l((F,ne)=>{m=F,S=ne});return ue(u,{_chunkSteps:o(F=>{this._ongoingPromise=void 0,x(()=>m({value:F,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),m({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(F=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),S(F)},"_errorSteps")}),w}_returnSteps(u){if(this._isFinished)return Promise.resolve({value:u,done:!0});this._isFinished=!0;let m=this._reader;if(!this._preventCancel){let S=q(m,u);return B(m),T(S,()=>({value:u,done:!0}))}return B(m),p({value:u,done:!0})}}let lt={next(){return _o(this)?this._asyncIteratorImpl.next():f(vo("next"))},return(a){return _o(this)?this._asyncIteratorImpl.return(a):f(vo("return"))}};Object.setPrototypeOf(lt,ze);function yo(a,u){let m=j(a),S=new je(m,u),w=Object.create(lt);return w._asyncIteratorImpl=S,w}o(yo,"AcquireReadableStreamAsyncIterator");function _o(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof je}catch{return!1}}o(_o,"IsReadableStreamAsyncIterator");function vo(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}o(vo,"streamAsyncIteratorBrandCheckException");let zt=Number.isNaN||function(a){return a!==a};var qr,Pt,dt;function Ve(a){return a.slice()}o(Ve,"CreateArrayFromList");function fm(a,u,m,S,w){new Uint8Array(a).set(new Uint8Array(m,S,w),u)}o(fm,"CopyDataBlockBytes");let Vr=o(a=>(typeof a.transfer=="function"?Vr=o(u=>u.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?Vr=o(u=>structuredClone(u,{transfer:[u]}),"TransferArrayBuffer"):Vr=o(u=>u,"TransferArrayBuffer"),Vr(a)),"TransferArrayBuffer"),pn=o(a=>(typeof a.detached=="boolean"?pn=o(u=>u.detached,"IsDetachedBuffer"):pn=o(u=>u.byteLength===0,"IsDetachedBuffer"),pn(a)),"IsDetachedBuffer");function mm(a,u,m){if(a.slice)return a.slice(u,m);let S=m-u,w=new ArrayBuffer(S);return fm(w,0,a,u,S),w}o(mm,"ArrayBufferSlice");function qa(a,u){let m=a[u];if(m!=null){if(typeof m!="function")throw new TypeError(`${String(u)} is not a function`);return m}}o(qa,"GetMethod");function vx(a){let u={[Symbol.iterator]:()=>a.iterator},m=(async function*(){return yield*u})(),S=m.next;return{iterator:m,nextMethod:S,done:!1}}o(vx,"CreateAsyncFromSyncIterator");let Cc=(dt=(qr=Symbol.asyncIterator)!==null&&qr!==void 0?qr:(Pt=Symbol.for)===null||Pt===void 0?void 0:Pt.call(Symbol,"Symbol.asyncIterator"))!==null&&dt!==void 0?dt:"@@asyncIterator";function hm(a,u="sync",m){if(m===void 0)if(u==="async"){if(m=qa(a,Cc),m===void 0){let M=qa(a,Symbol.iterator),F=hm(a,"sync",M);return vx(F)}}else m=qa(a,Symbol.iterator);if(m===void 0)throw new TypeError("The object is not iterable");let S=N(m,a,[]);if(!r(S))throw new TypeError("The iterator method must return an object");let w=S.next;return{iterator:S,nextMethod:w,done:!1}}o(hm,"GetIterator");function bx(a){let u=N(a.nextMethod,a.iterator,[]);if(!r(u))throw new TypeError("The iterator.next() method must return an object");return u}o(bx,"IteratorNext");function Px(a){return!!a.done}o(Px,"IteratorComplete");function Sx(a){return a.value}o(Sx,"IteratorValue");function Ex(a){return!(typeof a!="number"||zt(a)||a<0)}o(Ex,"IsNonNegativeNumber");function gm(a){let u=mm(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(u)}o(gm,"CloneAsUint8Array");function $c(a){let u=a._queue.shift();return a._queueTotalSize-=u.size,a._queueTotalSize<0&&(a._queueTotalSize=0),u.value}o($c,"DequeueValue");function kc(a,u,m){if(!Ex(m)||m===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:u,size:m}),a._queueTotalSize+=m}o(kc,"EnqueueValueWithSize");function Tx(a){return a._queue.peek().value}o(Tx,"PeekQueueValue");function fn(a){a._queue=new W,a._queueTotalSize=0}o(fn,"ResetQueue");function ym(a){return a===DataView}o(ym,"isDataViewConstructor");function xx(a){return ym(a.constructor)}o(xx,"isDataView");function Ax(a){return ym(a)?1:a.BYTES_PER_ELEMENT}o(Ax,"arrayBufferViewElementSize");class Vn{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Nc(this))throw jc("view");return this._view}respond(u){if(!Nc(this))throw jc("respond");if(qe(u,1,"respond"),u=R(u,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(pn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Wa(this._associatedReadableByteStreamController,u)}respondWithNewView(u){if(!Nc(this))throw jc("respondWithNewView");if(qe(u,1,"respondWithNewView"),!ArrayBuffer.isView(u))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(pn(u.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Za(this._associatedReadableByteStreamController,u)}}Object.defineProperties(Vn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(Vn.prototype.respond,"respond"),i(Vn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Vn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Hr{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Hn(this))throw Pi("byobRequest");return Mc(this)}get desiredSize(){if(!Hn(this))throw Pi("desiredSize");return wm(this)}close(){if(!Hn(this))throw Pi("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let u=this._controlledReadableByteStream._state;if(u!=="readable")throw new TypeError(`The stream (in ${u} state) is not in the readable state and cannot be closed`);bi(this)}enqueue(u){if(!Hn(this))throw Pi("enqueue");if(qe(u,1,"enqueue"),!ArrayBuffer.isView(u))throw new TypeError("chunk must be an array buffer view");if(u.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(u.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let m=this._controlledReadableByteStream._state;if(m!=="readable")throw new TypeError(`The stream (in ${m} state) is not in the readable state and cannot be enqueued to`);Ga(this,u)}error(u=void 0){if(!Hn(this))throw Pi("error");Yt(this,u)}[ee](u){_m(this),fn(this);let m=this._cancelAlgorithm(u);return Ha(this),m}[Y](u){let m=this._controlledReadableByteStream;if(this._queueTotalSize>0){Am(this,u);return}let S=this._autoAllocateChunkSize;if(S!==void 0){let w;try{w=new ArrayBuffer(S)}catch(F){u._errorSteps(F);return}let M={buffer:w,bufferByteLength:S,byteOffset:0,byteLength:S,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(M)}I(m,u),Gn(this)}[Se](){if(this._pendingPullIntos.length>0){let u=this._pendingPullIntos.peek();u.readerType="none",this._pendingPullIntos=new W,this._pendingPullIntos.push(u)}}}Object.defineProperties(Hr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Hr.prototype.close,"close"),i(Hr.prototype.enqueue,"enqueue"),i(Hr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Hr.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Hn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof Hr}o(Hn,"IsReadableByteStreamController");function Nc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof Vn}o(Nc,"IsReadableStreamBYOBRequest");function Gn(a){if(!Cx(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let m=a._pullAlgorithm();h(m,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,Gn(a)),null),S=>(Yt(a,S),null))}o(Gn,"ReadableByteStreamControllerCallPullIfNeeded");function _m(a){Dc(a),a._pendingPullIntos=new W}o(_m,"ReadableByteStreamControllerClearPendingPullIntos");function zc(a,u){let m=!1;a._state==="closed"&&(m=!0);let S=vm(u);u.readerType==="default"?O(a,S,m):Ux(a,S,m)}o(zc,"ReadableByteStreamControllerCommitPullIntoDescriptor");function vm(a){let u=a.bytesFilled,m=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,u/m)}o(vm,"ReadableByteStreamControllerConvertPullIntoDescriptor");function Va(a,u,m,S){a._queue.push({buffer:u,byteOffset:m,byteLength:S}),a._queueTotalSize+=S}o(Va,"ReadableByteStreamControllerEnqueueChunkToQueue");function bm(a,u,m,S){let w;try{w=mm(u,m,m+S)}catch(M){throw Yt(a,M),M}Va(a,w,0,S)}o(bm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Pm(a,u){u.bytesFilled>0&&bm(a,u.buffer,u.byteOffset,u.bytesFilled),bo(a)}o(Pm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function Sm(a,u){let m=Math.min(a._queueTotalSize,u.byteLength-u.bytesFilled),S=u.bytesFilled+m,w=m,M=!1,F=S%u.elementSize,ne=S-F;ne>=u.minimumFill&&(w=ne-u.bytesFilled,M=!0);let he=a._queue;for(;w>0;){let le=he.peek(),Ee=Math.min(w,le.byteLength),Ce=u.byteOffset+u.bytesFilled;fm(u.buffer,Ce,le.buffer,le.byteOffset,Ee),le.byteLength===Ee?he.shift():(le.byteOffset+=Ee,le.byteLength-=Ee),a._queueTotalSize-=Ee,Em(a,Ee,u),w-=Ee}return M}o(Sm,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function Em(a,u,m){m.bytesFilled+=u}o(Em,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function Tm(a){a._queueTotalSize===0&&a._closeRequested?(Ha(a),wi(a._controlledReadableByteStream)):Gn(a)}o(Tm,"ReadableByteStreamControllerHandleQueueDrain");function Dc(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}o(Dc,"ReadableByteStreamControllerInvalidateBYOBRequest");function Uc(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let u=a._pendingPullIntos.peek();Sm(a,u)&&(bo(a),zc(a._controlledReadableByteStream,u))}}o(Uc,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function wx(a){let u=a._controlledReadableByteStream._reader;for(;u._readRequests.length>0;){if(a._queueTotalSize===0)return;let m=u._readRequests.shift();Am(a,m)}}o(wx,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function Ix(a,u,m,S){let w=a._controlledReadableByteStream,M=u.constructor,F=Ax(M),{byteOffset:ne,byteLength:he}=u,le=m*F,Ee;try{Ee=Vr(u.buffer)}catch(We){S._errorSteps(We);return}let Ce={buffer:Ee,bufferByteLength:Ee.byteLength,byteOffset:ne,byteLength:he,bytesFilled:0,minimumFill:le,elementSize:F,viewConstructor:M,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(Ce),Om(w,S);return}if(w._state==="closed"){let We=new M(Ce.buffer,Ce.byteOffset,0);S._closeSteps(We);return}if(a._queueTotalSize>0){if(Sm(a,Ce)){let We=vm(Ce);Tm(a),S._chunkSteps(We);return}if(a._closeRequested){let We=new TypeError("Insufficient bytes to fill elements in the given buffer");Yt(a,We),S._errorSteps(We);return}}a._pendingPullIntos.push(Ce),Om(w,S),Gn(a)}o(Ix,"ReadableByteStreamControllerPullInto");function Rx(a,u){u.readerType==="none"&&bo(a);let m=a._controlledReadableByteStream;if(Lc(m))for(;Cm(m)>0;){let S=bo(a);zc(m,S)}}o(Rx,"ReadableByteStreamControllerRespondInClosedState");function Ox(a,u,m){if(Em(a,u,m),m.readerType==="none"){Pm(a,m),Uc(a);return}if(m.bytesFilled<m.minimumFill)return;bo(a);let S=m.bytesFilled%m.elementSize;if(S>0){let w=m.byteOffset+m.bytesFilled;bm(a,m.buffer,w-S,S)}m.bytesFilled-=S,zc(a._controlledReadableByteStream,m),Uc(a)}o(Ox,"ReadableByteStreamControllerRespondInReadableState");function xm(a,u){let m=a._pendingPullIntos.peek();Dc(a),a._controlledReadableByteStream._state==="closed"?Rx(a,m):Ox(a,u,m),Gn(a)}o(xm,"ReadableByteStreamControllerRespondInternal");function bo(a){return a._pendingPullIntos.shift()}o(bo,"ReadableByteStreamControllerShiftPendingPullInto");function Cx(a){let u=a._controlledReadableByteStream;return u._state!=="readable"||a._closeRequested||!a._started?!1:!!(z(u)&&U(u)>0||Lc(u)&&Cm(u)>0||wm(a)>0)}o(Cx,"ReadableByteStreamControllerShouldCallPull");function Ha(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}o(Ha,"ReadableByteStreamControllerClearAlgorithms");function bi(a){let u=a._controlledReadableByteStream;if(!(a._closeRequested||u._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let m=a._pendingPullIntos.peek();if(m.bytesFilled%m.elementSize!==0){let S=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Yt(a,S),S}}Ha(a),wi(u)}}o(bi,"ReadableByteStreamControllerClose");function Ga(a,u){let m=a._controlledReadableByteStream;if(a._closeRequested||m._state!=="readable")return;let{buffer:S,byteOffset:w,byteLength:M}=u;if(pn(S))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let F=Vr(S);if(a._pendingPullIntos.length>0){let ne=a._pendingPullIntos.peek();if(pn(ne.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Dc(a),ne.buffer=Vr(ne.buffer),ne.readerType==="none"&&Pm(a,ne)}if(z(m))if(wx(a),U(m)===0)Va(a,F,w,M);else{a._pendingPullIntos.length>0&&bo(a);let ne=new Uint8Array(F,w,M);O(m,ne,!1)}else Lc(m)?(Va(a,F,w,M),Uc(a)):Va(a,F,w,M);Gn(a)}o(Ga,"ReadableByteStreamControllerEnqueue");function Yt(a,u){let m=a._controlledReadableByteStream;m._state==="readable"&&(_m(a),fn(a),Ha(a),th(m,u))}o(Yt,"ReadableByteStreamControllerError");function Am(a,u){let m=a._queue.shift();a._queueTotalSize-=m.byteLength,Tm(a);let S=new Uint8Array(m.buffer,m.byteOffset,m.byteLength);u._chunkSteps(S)}o(Am,"ReadableByteStreamControllerFillReadRequestFromQueue");function Mc(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let u=a._pendingPullIntos.peek(),m=new Uint8Array(u.buffer,u.byteOffset+u.bytesFilled,u.byteLength-u.bytesFilled),S=Object.create(Vn.prototype);kx(S,a,m),a._byobRequest=S}return a._byobRequest}o(Mc,"ReadableByteStreamControllerGetBYOBRequest");function wm(a){let u=a._controlledReadableByteStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(wm,"ReadableByteStreamControllerGetDesiredSize");function Wa(a,u){let m=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(u===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(m.bytesFilled+u>m.byteLength)throw new RangeError("bytesWritten out of range")}m.buffer=Vr(m.buffer),xm(a,u)}o(Wa,"ReadableByteStreamControllerRespond");function Za(a,u){let m=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(u.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(m.byteOffset+m.bytesFilled!==u.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(m.bufferByteLength!==u.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(m.bytesFilled+u.byteLength>m.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let w=u.byteLength;m.buffer=Vr(u.buffer),xm(a,w)}o(Za,"ReadableByteStreamControllerRespondWithNewView");function Im(a,u,m,S,w,M,F){u._controlledReadableByteStream=a,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,fn(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=M,u._pullAlgorithm=S,u._cancelAlgorithm=w,u._autoAllocateChunkSize=F,u._pendingPullIntos=new W,a._readableStreamController=u;let ne=m();h(p(ne),()=>(u._started=!0,Gn(u),null),he=>(Yt(u,he),null))}o(Im,"SetUpReadableByteStreamController");function $x(a,u,m){let S=Object.create(Hr.prototype),w,M,F;u.start!==void 0?w=o(()=>u.start(S),"startAlgorithm"):w=o(()=>{},"startAlgorithm"),u.pull!==void 0?M=o(()=>u.pull(S),"pullAlgorithm"):M=o(()=>p(void 0),"pullAlgorithm"),u.cancel!==void 0?F=o(he=>u.cancel(he),"cancelAlgorithm"):F=o(()=>p(void 0),"cancelAlgorithm");let ne=u.autoAllocateChunkSize;if(ne===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Im(a,S,w,M,F,m,ne)}o($x,"SetUpReadableByteStreamControllerFromUnderlyingSource");function kx(a,u,m){a._associatedReadableByteStreamController=u,a._view=m}o(kx,"SetUpReadableStreamBYOBRequest");function jc(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}o(jc,"byobRequestBrandCheckException");function Pi(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}o(Pi,"byteStreamControllerBrandCheckException");function Nx(a,u){tt(a,u);let m=a?.mode;return{mode:m===void 0?void 0:zx(m,`${u} has member 'mode' that`)}}o(Nx,"convertReaderOptions");function zx(a,u){if(a=`${a}`,a!=="byob")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}o(zx,"convertReadableStreamReaderMode");function Dx(a,u){var m;tt(a,u);let S=(m=a?.min)!==null&&m!==void 0?m:1;return{min:R(S,`${u} has member 'min' that`)}}o(Dx,"convertByobReadOptions");function Rm(a){return new mn(a)}o(Rm,"AcquireReadableStreamBYOBReader");function Om(a,u){a._reader._readIntoRequests.push(u)}o(Om,"ReadableStreamAddReadIntoRequest");function Ux(a,u,m){let w=a._reader._readIntoRequests.shift();m?w._closeSteps(u):w._chunkSteps(u)}o(Ux,"ReadableStreamFulfillReadIntoRequest");function Cm(a){return a._reader._readIntoRequests.length}o(Cm,"ReadableStreamGetNumReadIntoRequests");function Lc(a){let u=a._reader;return!(u===void 0||!Wn(u))}o(Lc,"ReadableStreamHasBYOBReader");class mn{static{o(this,"ReadableStreamBYOBReader")}constructor(u){if(qe(u,1,"ReadableStreamBYOBReader"),$(u,"First parameter"),yn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Hn(u._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");te(this,u),this._readIntoRequests=new W}get closed(){return Wn(this)?this._closedPromise:f(Ka("closed"))}cancel(u=void 0){return Wn(this)?this._ownerReadableStream===void 0?f(J("cancel")):q(this,u):f(Ka("cancel"))}read(u,m={}){if(!Wn(this))return f(Ka("read"));if(!ArrayBuffer.isView(u))return f(new TypeError("view must be an array buffer view"));if(u.byteLength===0)return f(new TypeError("view must have non-zero byteLength"));if(u.buffer.byteLength===0)return f(new TypeError("view's buffer must have non-zero byteLength"));if(pn(u.buffer))return f(new TypeError("view's buffer has been detached"));let S;try{S=Dx(m,"options")}catch(le){return f(le)}let w=S.min;if(w===0)return f(new TypeError("options.min must be greater than 0"));if(xx(u)){if(w>u.byteLength)return f(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(w>u.length)return f(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return f(J("read from"));let M,F,ne=l((le,Ee)=>{M=le,F=Ee});return $m(this,u,w,{_chunkSteps:o(le=>M({value:le,done:!1}),"_chunkSteps"),_closeSteps:o(le=>M({value:le,done:!0}),"_closeSteps"),_errorSteps:o(le=>F(le),"_errorSteps")}),ne}releaseLock(){if(!Wn(this))throw Ka("releaseLock");this._ownerReadableStream!==void 0&&Mx(this)}}Object.defineProperties(mn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(mn.prototype.cancel,"cancel"),i(mn.prototype.read,"read"),i(mn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(mn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Wn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof mn}o(Wn,"IsReadableStreamBYOBReader");function $m(a,u,m,S){let w=a._ownerReadableStream;w._disturbed=!0,w._state==="errored"?S._errorSteps(w._storedError):Ix(w._readableStreamController,u,m,S)}o($m,"ReadableStreamBYOBReaderRead");function Mx(a){B(a);let u=new TypeError("Reader was released");km(a,u)}o(Mx,"ReadableStreamBYOBReaderRelease");function km(a,u){let m=a._readIntoRequests;a._readIntoRequests=new W,m.forEach(S=>{S._errorSteps(u)})}o(km,"ReadableStreamBYOBReaderErrorReadIntoRequests");function Ka(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}o(Ka,"byobReaderBrandCheckException");function Si(a,u){let{highWaterMark:m}=a;if(m===void 0)return u;if(zt(m)||m<0)throw new RangeError("Invalid highWaterMark");return m}o(Si,"ExtractHighWaterMark");function Ja(a){let{size:u}=a;return u||(()=>1)}o(Ja,"ExtractSizeAlgorithm");function Ya(a,u){tt(a,u);let m=a?.highWaterMark,S=a?.size;return{highWaterMark:m===void 0?void 0:E(m),size:S===void 0?void 0:jx(S,`${u} has member 'size' that`)}}o(Ya,"convertQueuingStrategy");function jx(a,u){return it(a,u),m=>E(a(m))}o(jx,"convertQueuingStrategySize");function Lx(a,u){tt(a,u);let m=a?.abort,S=a?.close,w=a?.start,M=a?.type,F=a?.write;return{abort:m===void 0?void 0:Fx(m,a,`${u} has member 'abort' that`),close:S===void 0?void 0:Bx(S,a,`${u} has member 'close' that`),start:w===void 0?void 0:qx(w,a,`${u} has member 'start' that`),write:F===void 0?void 0:Vx(F,a,`${u} has member 'write' that`),type:M}}o(Lx,"convertUnderlyingSink");function Fx(a,u,m){return it(a,m),S=>L(a,u,[S])}o(Fx,"convertUnderlyingSinkAbortCallback");function Bx(a,u,m){return it(a,m),()=>L(a,u,[])}o(Bx,"convertUnderlyingSinkCloseCallback");function qx(a,u,m){return it(a,m),S=>N(a,u,[S])}o(qx,"convertUnderlyingSinkStartCallback");function Vx(a,u,m){return it(a,m),(S,w)=>L(a,u,[S,w])}o(Vx,"convertUnderlyingSinkWriteCallback");function Nm(a,u){if(!Po(a))throw new TypeError(`${u} is not a WritableStream.`)}o(Nm,"assertWritableStream");function Hx(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}o(Hx,"isAbortSignal");let Gx=typeof AbortController=="function";function Wx(){if(Gx)return new AbortController}o(Wx,"createAbortController");class hn{static{o(this,"WritableStream")}constructor(u={},m={}){u===void 0?u=null:Fe(u,"First parameter");let S=Ya(m,"Second parameter"),w=Lx(u,"First parameter");if(Dm(this),w.type!==void 0)throw new RangeError("Invalid type is specified");let F=Ja(S),ne=Si(S,1);sA(this,w,ne,F)}get locked(){if(!Po(this))throw rs("locked");return So(this)}abort(u=void 0){return Po(this)?So(this)?f(new TypeError("Cannot abort a stream that already has a writer")):Xa(this,u):f(rs("abort"))}close(){return Po(this)?So(this)?f(new TypeError("Cannot close a stream that already has a writer")):Tr(this)?f(new TypeError("Cannot close an already-closing stream")):Um(this):f(rs("close"))}getWriter(){if(!Po(this))throw rs("getWriter");return zm(this)}}Object.defineProperties(hn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(hn.prototype.abort,"abort"),i(hn.prototype.close,"close"),i(hn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(hn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function zm(a){return new Gr(a)}o(zm,"AcquireWritableStreamDefaultWriter");function Zx(a,u,m,S,w=1,M=()=>1){let F=Object.create(hn.prototype);Dm(F);let ne=Object.create(Eo.prototype);return qm(F,ne,a,u,m,S,w,M),F}o(Zx,"CreateWritableStream");function Dm(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new W,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}o(Dm,"InitializeWritableStream");function Po(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof hn}o(Po,"IsWritableStream");function So(a){return a._writer!==void 0}o(So,"IsWritableStreamLocked");function Xa(a,u){var m;if(a._state==="closed"||a._state==="errored")return p(void 0);a._writableStreamController._abortReason=u,(m=a._writableStreamController._abortController)===null||m===void 0||m.abort(u);let S=a._state;if(S==="closed"||S==="errored")return p(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let w=!1;S==="erroring"&&(w=!0,u=void 0);let M=l((F,ne)=>{a._pendingAbortRequest={_promise:void 0,_resolve:F,_reject:ne,_reason:u,_wasAlreadyErroring:w}});return a._pendingAbortRequest._promise=M,w||Bc(a,u),M}o(Xa,"WritableStreamAbort");function Um(a){let u=a._state;if(u==="closed"||u==="errored")return f(new TypeError(`The stream (in ${u} state) is not in the writable state and cannot be closed`));let m=l((w,M)=>{let F={_resolve:w,_reject:M};a._closeRequest=F}),S=a._writer;return S!==void 0&&a._backpressure&&u==="writable"&&Jc(S),uA(a._writableStreamController),m}o(Um,"WritableStreamClose");function Kx(a){return l((m,S)=>{let w={_resolve:m,_reject:S};a._writeRequests.push(w)})}o(Kx,"WritableStreamAddWriteRequest");function Fc(a,u){if(a._state==="writable"){Bc(a,u);return}qc(a)}o(Fc,"WritableStreamDealWithRejection");function Bc(a,u){let m=a._writableStreamController;a._state="erroring",a._storedError=u;let S=a._writer;S!==void 0&&jm(S,u),!eA(a)&&m._started&&qc(a)}o(Bc,"WritableStreamStartErroring");function qc(a){a._state="errored",a._writableStreamController[Z]();let u=a._storedError;if(a._writeRequests.forEach(w=>{w._reject(u)}),a._writeRequests=new W,a._pendingAbortRequest===void 0){Qa(a);return}let m=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,m._wasAlreadyErroring){m._reject(u),Qa(a);return}let S=a._writableStreamController[G](m._reason);h(S,()=>(m._resolve(),Qa(a),null),w=>(m._reject(w),Qa(a),null))}o(qc,"WritableStreamFinishErroring");function Jx(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}o(Jx,"WritableStreamFinishInFlightWrite");function Yx(a,u){a._inFlightWriteRequest._reject(u),a._inFlightWriteRequest=void 0,Fc(a,u)}o(Yx,"WritableStreamFinishInFlightWriteWithError");function Xx(a){a._inFlightCloseRequest._resolve(void 0),a._inFlightCloseRequest=void 0,a._state==="erroring"&&(a._storedError=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._resolve(),a._pendingAbortRequest=void 0)),a._state="closed";let m=a._writer;m!==void 0&&Wm(m)}o(Xx,"WritableStreamFinishInFlightClose");function Qx(a,u){a._inFlightCloseRequest._reject(u),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(u),a._pendingAbortRequest=void 0),Fc(a,u)}o(Qx,"WritableStreamFinishInFlightCloseWithError");function Tr(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Tr,"WritableStreamCloseQueuedOrInFlight");function eA(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}o(eA,"WritableStreamHasOperationMarkedInFlight");function tA(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}o(tA,"WritableStreamMarkCloseRequestInFlight");function rA(a){a._inFlightWriteRequest=a._writeRequests.shift()}o(rA,"WritableStreamMarkFirstWriteRequestInFlight");function Qa(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let u=a._writer;u!==void 0&&Zc(u,a._storedError)}o(Qa,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function Vc(a,u){let m=a._writer;m!==void 0&&u!==a._backpressure&&(u?hA(m):Jc(m)),a._backpressure=u}o(Vc,"WritableStreamUpdateBackpressure");class Gr{static{o(this,"WritableStreamDefaultWriter")}constructor(u){if(qe(u,1,"WritableStreamDefaultWriter"),Nm(u,"First parameter"),So(u))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=u,u._writer=this;let m=u._state;if(m==="writable")!Tr(u)&&u._backpressure?os(this):Zm(this),ns(this);else if(m==="erroring")Kc(this,u._storedError),ns(this);else if(m==="closed")Zm(this),fA(this);else{let S=u._storedError;Kc(this,S),Gm(this,S)}}get closed(){return Zn(this)?this._closedPromise:f(Kn("closed"))}get desiredSize(){if(!Zn(this))throw Kn("desiredSize");if(this._ownerWritableStream===void 0)throw Ti("desiredSize");return aA(this)}get ready(){return Zn(this)?this._readyPromise:f(Kn("ready"))}abort(u=void 0){return Zn(this)?this._ownerWritableStream===void 0?f(Ti("abort")):nA(this,u):f(Kn("abort"))}close(){if(!Zn(this))return f(Kn("close"));let u=this._ownerWritableStream;return u===void 0?f(Ti("close")):Tr(u)?f(new TypeError("Cannot close an already-closing stream")):Mm(this)}releaseLock(){if(!Zn(this))throw Kn("releaseLock");this._ownerWritableStream!==void 0&&Lm(this)}write(u=void 0){return Zn(this)?this._ownerWritableStream===void 0?f(Ti("write to")):Fm(this,u):f(Kn("write"))}}Object.defineProperties(Gr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(Gr.prototype.abort,"abort"),i(Gr.prototype.close,"close"),i(Gr.prototype.releaseLock,"releaseLock"),i(Gr.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Gr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Zn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof Gr}o(Zn,"IsWritableStreamDefaultWriter");function nA(a,u){let m=a._ownerWritableStream;return Xa(m,u)}o(nA,"WritableStreamDefaultWriterAbort");function Mm(a){let u=a._ownerWritableStream;return Um(u)}o(Mm,"WritableStreamDefaultWriterClose");function oA(a){let u=a._ownerWritableStream,m=u._state;return Tr(u)||m==="closed"?p(void 0):m==="errored"?f(u._storedError):Mm(a)}o(oA,"WritableStreamDefaultWriterCloseWithErrorPropagation");function iA(a,u){a._closedPromiseState==="pending"?Zc(a,u):mA(a,u)}o(iA,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function jm(a,u){a._readyPromiseState==="pending"?Km(a,u):gA(a,u)}o(jm,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function aA(a){let u=a._ownerWritableStream,m=u._state;return m==="errored"||m==="erroring"?null:m==="closed"?0:Vm(u._writableStreamController)}o(aA,"WritableStreamDefaultWriterGetDesiredSize");function Lm(a){let u=a._ownerWritableStream,m=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");jm(a,m),iA(a,m),u._writer=void 0,a._ownerWritableStream=void 0}o(Lm,"WritableStreamDefaultWriterRelease");function Fm(a,u){let m=a._ownerWritableStream,S=m._writableStreamController,w=cA(S,u);if(m!==a._ownerWritableStream)return f(Ti("write to"));let M=m._state;if(M==="errored")return f(m._storedError);if(Tr(m)||M==="closed")return f(new TypeError("The stream is closing or closed and cannot be written to"));if(M==="erroring")return f(m._storedError);let F=Kx(m);return lA(S,u,w),F}o(Fm,"WritableStreamDefaultWriterWrite");let Bm={};class Eo{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Hc(this))throw Wc("abortReason");return this._abortReason}get signal(){if(!Hc(this))throw Wc("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(u=void 0){if(!Hc(this))throw Wc("error");this._controlledWritableStream._state==="writable"&&Hm(this,u)}[G](u){let m=this._abortAlgorithm(u);return es(this),m}[Z](){fn(this)}}Object.defineProperties(Eo.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Eo.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Hc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Eo}o(Hc,"IsWritableStreamDefaultController");function qm(a,u,m,S,w,M,F,ne){u._controlledWritableStream=a,a._writableStreamController=u,u._queue=void 0,u._queueTotalSize=void 0,fn(u),u._abortReason=void 0,u._abortController=Wx(),u._started=!1,u._strategySizeAlgorithm=ne,u._strategyHWM=F,u._writeAlgorithm=S,u._closeAlgorithm=w,u._abortAlgorithm=M;let he=Gc(u);Vc(a,he);let le=m(),Ee=p(le);h(Ee,()=>(u._started=!0,ts(u),null),Ce=>(u._started=!0,Fc(a,Ce),null))}o(qm,"SetUpWritableStreamDefaultController");function sA(a,u,m,S){let w=Object.create(Eo.prototype),M,F,ne,he;u.start!==void 0?M=o(()=>u.start(w),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.write!==void 0?F=o(le=>u.write(le,w),"writeAlgorithm"):F=o(()=>p(void 0),"writeAlgorithm"),u.close!==void 0?ne=o(()=>u.close(),"closeAlgorithm"):ne=o(()=>p(void 0),"closeAlgorithm"),u.abort!==void 0?he=o(le=>u.abort(le),"abortAlgorithm"):he=o(()=>p(void 0),"abortAlgorithm"),qm(a,w,M,F,ne,he,m,S)}o(sA,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function es(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(es,"WritableStreamDefaultControllerClearAlgorithms");function uA(a){kc(a,Bm,0),ts(a)}o(uA,"WritableStreamDefaultControllerClose");function cA(a,u){try{return a._strategySizeAlgorithm(u)}catch(m){return Ei(a,m),1}}o(cA,"WritableStreamDefaultControllerGetChunkSize");function Vm(a){return a._strategyHWM-a._queueTotalSize}o(Vm,"WritableStreamDefaultControllerGetDesiredSize");function lA(a,u,m){try{kc(a,u,m)}catch(w){Ei(a,w);return}let S=a._controlledWritableStream;if(!Tr(S)&&S._state==="writable"){let w=Gc(a);Vc(S,w)}ts(a)}o(lA,"WritableStreamDefaultControllerWrite");function ts(a){let u=a._controlledWritableStream;if(!a._started||u._inFlightWriteRequest!==void 0)return;if(u._state==="erroring"){qc(u);return}if(a._queue.length===0)return;let S=Tx(a);S===Bm?dA(a):pA(a,S)}o(ts,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Ei(a,u){a._controlledWritableStream._state==="writable"&&Hm(a,u)}o(Ei,"WritableStreamDefaultControllerErrorIfNeeded");function dA(a){let u=a._controlledWritableStream;tA(u),$c(a);let m=a._closeAlgorithm();es(a),h(m,()=>(Xx(u),null),S=>(Qx(u,S),null))}o(dA,"WritableStreamDefaultControllerProcessClose");function pA(a,u){let m=a._controlledWritableStream;rA(m);let S=a._writeAlgorithm(u);h(S,()=>{Jx(m);let w=m._state;if($c(a),!Tr(m)&&w==="writable"){let M=Gc(a);Vc(m,M)}return ts(a),null},w=>(m._state==="writable"&&es(a),Yx(m,w),null))}o(pA,"WritableStreamDefaultControllerProcessWrite");function Gc(a){return Vm(a)<=0}o(Gc,"WritableStreamDefaultControllerGetBackpressure");function Hm(a,u){let m=a._controlledWritableStream;es(a),Bc(m,u)}o(Hm,"WritableStreamDefaultControllerError");function rs(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}o(rs,"streamBrandCheckException$2");function Wc(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}o(Wc,"defaultControllerBrandCheckException$2");function Kn(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}o(Kn,"defaultWriterBrandCheckException");function Ti(a){return new TypeError("Cannot "+a+" a stream using a released writer")}o(Ti,"defaultWriterLockException");function ns(a){a._closedPromise=l((u,m)=>{a._closedPromise_resolve=u,a._closedPromise_reject=m,a._closedPromiseState="pending"})}o(ns,"defaultWriterClosedPromiseInitialize");function Gm(a,u){ns(a),Zc(a,u)}o(Gm,"defaultWriterClosedPromiseInitializeAsRejected");function fA(a){ns(a),Wm(a)}o(fA,"defaultWriterClosedPromiseInitializeAsResolved");function Zc(a,u){a._closedPromise_reject!==void 0&&(P(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}o(Zc,"defaultWriterClosedPromiseReject");function mA(a,u){Gm(a,u)}o(mA,"defaultWriterClosedPromiseResetToRejected");function Wm(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="resolved")}o(Wm,"defaultWriterClosedPromiseResolve");function os(a){a._readyPromise=l((u,m)=>{a._readyPromise_resolve=u,a._readyPromise_reject=m}),a._readyPromiseState="pending"}o(os,"defaultWriterReadyPromiseInitialize");function Kc(a,u){os(a),Km(a,u)}o(Kc,"defaultWriterReadyPromiseInitializeAsRejected");function Zm(a){os(a),Jc(a)}o(Zm,"defaultWriterReadyPromiseInitializeAsResolved");function Km(a,u){a._readyPromise_reject!==void 0&&(P(a._readyPromise),a._readyPromise_reject(u),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}o(Km,"defaultWriterReadyPromiseReject");function hA(a){os(a)}o(hA,"defaultWriterReadyPromiseReset");function gA(a,u){Kc(a,u)}o(gA,"defaultWriterReadyPromiseResetToRejected");function Jc(a){a._readyPromise_resolve!==void 0&&(a._readyPromise_resolve(void 0),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="fulfilled")}o(Jc,"defaultWriterReadyPromiseResolve");function yA(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(yA,"getGlobals");let Yc=yA();function _A(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}o(_A,"isDOMExceptionConstructor");function vA(){let a=Yc?.DOMException;return _A(a)?a:void 0}o(vA,"getFromGlobal");function bA(){let a=o(function(m,S){this.message=m||"",this.name=S||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return i(a,"DOMException"),a.prototype=Object.create(Error.prototype),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,configurable:!0}),a}o(bA,"createPolyfill");let PA=vA()||bA();function Jm(a,u,m,S,w,M){let F=j(a),ne=zm(u);a._disturbed=!0;let he=!1,le=p(void 0);return l((Ee,Ce)=>{let We;if(M!==void 0){if(We=o(()=>{let de=M.reason!==void 0?M.reason:new PA("Aborted","AbortError"),Ne=[];S||Ne.push(()=>u._state==="writable"?Xa(u,de):p(void 0)),w||Ne.push(()=>a._state==="readable"?lr(a,de):p(void 0)),It(()=>Promise.all(Ne.map(Ze=>Ze())),!0,de)},"abortAlgorithm"),M.aborted){We();return}M.addEventListener("abort",We)}function dr(){return l((de,Ne)=>{function Ze(Dt){Dt?de():_(wo(),Ze,Ne)}o(Ze,"next"),Ze(!1)})}o(dr,"pipeLoop");function wo(){return he?p(!0):_(ne._readyPromise,()=>l((de,Ne)=>{ue(F,{_chunkSteps:o(Ze=>{le=_(Fm(ne,Ze),void 0,e),de(!1)},"_chunkSteps"),_closeSteps:o(()=>de(!0),"_closeSteps"),_errorSteps:Ne})}))}if(o(wo,"pipeStep"),Zr(a,F._closedPromise,de=>(S?Xt(!0,de):It(()=>Xa(u,de),!0,de),null)),Zr(u,ne._closedPromise,de=>(w?Xt(!0,de):It(()=>lr(a,de),!0,de),null)),Tt(a,F._closedPromise,()=>(m?Xt():It(()=>oA(ne)),null)),Tr(u)||u._state==="closed"){let de=new TypeError("the destination writable stream closed before all data could be piped to it");w?Xt(!0,de):It(()=>lr(a,de),!0,de)}P(dr());function vn(){let de=le;return _(le,()=>de!==le?vn():void 0)}o(vn,"waitForWritesToFinish");function Zr(de,Ne,Ze){de._state==="errored"?Ze(de._storedError):y(Ne,Ze)}o(Zr,"isOrBecomesErrored");function Tt(de,Ne,Ze){de._state==="closed"?Ze():g(Ne,Ze)}o(Tt,"isOrBecomesClosed");function It(de,Ne,Ze){if(he)return;he=!0,u._state==="writable"&&!Tr(u)?g(vn(),Dt):Dt();function Dt(){return h(de(),()=>Kr(Ne,Ze),Io=>Kr(!0,Io)),null}o(Dt,"doTheRest")}o(It,"shutdownWithAction");function Xt(de,Ne){he||(he=!0,u._state==="writable"&&!Tr(u)?g(vn(),()=>Kr(de,Ne)):Kr(de,Ne))}o(Xt,"shutdown");function Kr(de,Ne){return Lm(ne),B(F),M!==void 0&&M.removeEventListener("abort",We),de?Ce(Ne):Ee(void 0),null}o(Kr,"finalize")})}o(Jm,"ReadableStreamPipeTo");class Wr{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!is(this))throw ss("desiredSize");return Xc(this)}close(){if(!is(this))throw ss("close");if(!xo(this))throw new TypeError("The stream is not in a state that permits close");Jn(this)}enqueue(u=void 0){if(!is(this))throw ss("enqueue");if(!xo(this))throw new TypeError("The stream is not in a state that permits enqueue");return To(this,u)}error(u=void 0){if(!is(this))throw ss("error");cr(this,u)}[ee](u){fn(this);let m=this._cancelAlgorithm(u);return as(this),m}[Y](u){let m=this._controlledReadableStream;if(this._queue.length>0){let S=$c(this);this._closeRequested&&this._queue.length===0?(as(this),wi(m)):xi(this),u._chunkSteps(S)}else I(m,u),xi(this)}[Se](){}}Object.defineProperties(Wr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Wr.prototype.close,"close"),i(Wr.prototype.enqueue,"enqueue"),i(Wr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Wr.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function is(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof Wr}o(is,"IsReadableStreamDefaultController");function xi(a){if(!Ym(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let m=a._pullAlgorithm();h(m,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,xi(a)),null),S=>(cr(a,S),null))}o(xi,"ReadableStreamDefaultControllerCallPullIfNeeded");function Ym(a){let u=a._controlledReadableStream;return!xo(a)||!a._started?!1:!!(yn(u)&&U(u)>0||Xc(a)>0)}o(Ym,"ReadableStreamDefaultControllerShouldCallPull");function as(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(as,"ReadableStreamDefaultControllerClearAlgorithms");function Jn(a){if(!xo(a))return;let u=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(as(a),wi(u))}o(Jn,"ReadableStreamDefaultControllerClose");function To(a,u){if(!xo(a))return;let m=a._controlledReadableStream;if(yn(m)&&U(m)>0)O(m,u,!1);else{let S;try{S=a._strategySizeAlgorithm(u)}catch(w){throw cr(a,w),w}try{kc(a,u,S)}catch(w){throw cr(a,w),w}}xi(a)}o(To,"ReadableStreamDefaultControllerEnqueue");function cr(a,u){let m=a._controlledReadableStream;m._state==="readable"&&(fn(a),as(a),th(m,u))}o(cr,"ReadableStreamDefaultControllerError");function Xc(a){let u=a._controlledReadableStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(Xc,"ReadableStreamDefaultControllerGetDesiredSize");function SA(a){return!Ym(a)}o(SA,"ReadableStreamDefaultControllerHasBackpressure");function xo(a){let u=a._controlledReadableStream._state;return!a._closeRequested&&u==="readable"}o(xo,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Xm(a,u,m,S,w,M,F){u._controlledReadableStream=a,u._queue=void 0,u._queueTotalSize=void 0,fn(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=F,u._strategyHWM=M,u._pullAlgorithm=S,u._cancelAlgorithm=w,a._readableStreamController=u;let ne=m();h(p(ne),()=>(u._started=!0,xi(u),null),he=>(cr(u,he),null))}o(Xm,"SetUpReadableStreamDefaultController");function EA(a,u,m,S){let w=Object.create(Wr.prototype),M,F,ne;u.start!==void 0?M=o(()=>u.start(w),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.pull!==void 0?F=o(()=>u.pull(w),"pullAlgorithm"):F=o(()=>p(void 0),"pullAlgorithm"),u.cancel!==void 0?ne=o(he=>u.cancel(he),"cancelAlgorithm"):ne=o(()=>p(void 0),"cancelAlgorithm"),Xm(a,w,M,F,ne,m,S)}o(EA,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function ss(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}o(ss,"defaultControllerBrandCheckException$1");function TA(a,u){return Hn(a._readableStreamController)?AA(a):xA(a)}o(TA,"ReadableStreamTee");function xA(a,u){let m=j(a),S=!1,w=!1,M=!1,F=!1,ne,he,le,Ee,Ce,We=l(Tt=>{Ce=Tt});function dr(){return S?(w=!0,p(void 0)):(S=!0,ue(m,{_chunkSteps:o(It=>{x(()=>{w=!1;let Xt=It,Kr=It;M||To(le._readableStreamController,Xt),F||To(Ee._readableStreamController,Kr),S=!1,w&&dr()})},"_chunkSteps"),_closeSteps:o(()=>{S=!1,M||Jn(le._readableStreamController),F||Jn(Ee._readableStreamController),(!M||!F)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{S=!1},"_errorSteps")}),p(void 0))}o(dr,"pullAlgorithm");function wo(Tt){if(M=!0,ne=Tt,F){let It=Ve([ne,he]),Xt=lr(a,It);Ce(Xt)}return We}o(wo,"cancel1Algorithm");function vn(Tt){if(F=!0,he=Tt,M){let It=Ve([ne,he]),Xt=lr(a,It);Ce(Xt)}return We}o(vn,"cancel2Algorithm");function Zr(){}return o(Zr,"startAlgorithm"),le=Ai(Zr,dr,wo),Ee=Ai(Zr,dr,vn),y(m._closedPromise,Tt=>(cr(le._readableStreamController,Tt),cr(Ee._readableStreamController,Tt),(!M||!F)&&Ce(void 0),null)),[le,Ee]}o(xA,"ReadableStreamDefaultTee");function AA(a){let u=j(a),m=!1,S=!1,w=!1,M=!1,F=!1,ne,he,le,Ee,Ce,We=l(de=>{Ce=de});function dr(de){y(de._closedPromise,Ne=>(de!==u||(Yt(le._readableStreamController,Ne),Yt(Ee._readableStreamController,Ne),(!M||!F)&&Ce(void 0)),null))}o(dr,"forwardReaderError");function wo(){Wn(u)&&(B(u),u=j(a),dr(u)),ue(u,{_chunkSteps:o(Ne=>{x(()=>{S=!1,w=!1;let Ze=Ne,Dt=Ne;if(!M&&!F)try{Dt=gm(Ne)}catch(Io){Yt(le._readableStreamController,Io),Yt(Ee._readableStreamController,Io),Ce(lr(a,Io));return}M||Ga(le._readableStreamController,Ze),F||Ga(Ee._readableStreamController,Dt),m=!1,S?Zr():w&&Tt()})},"_chunkSteps"),_closeSteps:o(()=>{m=!1,M||bi(le._readableStreamController),F||bi(Ee._readableStreamController),le._readableStreamController._pendingPullIntos.length>0&&Wa(le._readableStreamController,0),Ee._readableStreamController._pendingPullIntos.length>0&&Wa(Ee._readableStreamController,0),(!M||!F)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{m=!1},"_errorSteps")})}o(wo,"pullWithDefaultReader");function vn(de,Ne){ie(u)&&(B(u),u=Rm(a),dr(u));let Ze=Ne?Ee:le,Dt=Ne?le:Ee;$m(u,de,1,{_chunkSteps:o(Ro=>{x(()=>{S=!1,w=!1;let Oo=Ne?F:M;if(Ne?M:F)Oo||Za(Ze._readableStreamController,Ro);else{let mh;try{mh=gm(Ro)}catch(nl){Yt(Ze._readableStreamController,nl),Yt(Dt._readableStreamController,nl),Ce(lr(a,nl));return}Oo||Za(Ze._readableStreamController,Ro),Ga(Dt._readableStreamController,mh)}m=!1,S?Zr():w&&Tt()})},"_chunkSteps"),_closeSteps:o(Ro=>{m=!1;let Oo=Ne?F:M,hs=Ne?M:F;Oo||bi(Ze._readableStreamController),hs||bi(Dt._readableStreamController),Ro!==void 0&&(Oo||Za(Ze._readableStreamController,Ro),!hs&&Dt._readableStreamController._pendingPullIntos.length>0&&Wa(Dt._readableStreamController,0)),(!Oo||!hs)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{m=!1},"_errorSteps")})}o(vn,"pullWithBYOBReader");function Zr(){if(m)return S=!0,p(void 0);m=!0;let de=Mc(le._readableStreamController);return de===null?wo():vn(de._view,!1),p(void 0)}o(Zr,"pull1Algorithm");function Tt(){if(m)return w=!0,p(void 0);m=!0;let de=Mc(Ee._readableStreamController);return de===null?wo():vn(de._view,!0),p(void 0)}o(Tt,"pull2Algorithm");function It(de){if(M=!0,ne=de,F){let Ne=Ve([ne,he]),Ze=lr(a,Ne);Ce(Ze)}return We}o(It,"cancel1Algorithm");function Xt(de){if(F=!0,he=de,M){let Ne=Ve([ne,he]),Ze=lr(a,Ne);Ce(Ze)}return We}o(Xt,"cancel2Algorithm");function Kr(){}return o(Kr,"startAlgorithm"),le=eh(Kr,Zr,It),Ee=eh(Kr,Tt,Xt),dr(u),[le,Ee]}o(AA,"ReadableByteStreamTee");function wA(a){return r(a)&&typeof a.getReader<"u"}o(wA,"isReadableStreamLike");function IA(a){return wA(a)?OA(a.getReader()):RA(a)}o(IA,"ReadableStreamFrom");function RA(a){let u,m=hm(a,"async"),S=e;function w(){let F;try{F=bx(m)}catch(he){return f(he)}let ne=p(F);return T(ne,he=>{if(!r(he))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(Px(he))Jn(u._readableStreamController);else{let Ee=Sx(he);To(u._readableStreamController,Ee)}})}o(w,"pullAlgorithm");function M(F){let ne=m.iterator,he;try{he=qa(ne,"return")}catch(Ce){return f(Ce)}if(he===void 0)return p(void 0);let le;try{le=N(he,ne,[F])}catch(Ce){return f(Ce)}let Ee=p(le);return T(Ee,Ce=>{if(!r(Ce))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(M,"cancelAlgorithm"),u=Ai(S,w,M,0),u}o(RA,"ReadableStreamFromIterable");function OA(a){let u,m=e;function S(){let M;try{M=a.read()}catch(F){return f(F)}return T(M,F=>{if(!r(F))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(F.done)Jn(u._readableStreamController);else{let ne=F.value;To(u._readableStreamController,ne)}})}o(S,"pullAlgorithm");function w(M){try{return p(a.cancel(M))}catch(F){return f(F)}}return o(w,"cancelAlgorithm"),u=Ai(m,S,w,0),u}o(OA,"ReadableStreamFromDefaultReader");function CA(a,u){tt(a,u);let m=a,S=m?.autoAllocateChunkSize,w=m?.cancel,M=m?.pull,F=m?.start,ne=m?.type;return{autoAllocateChunkSize:S===void 0?void 0:R(S,`${u} has member 'autoAllocateChunkSize' that`),cancel:w===void 0?void 0:$A(w,m,`${u} has member 'cancel' that`),pull:M===void 0?void 0:kA(M,m,`${u} has member 'pull' that`),start:F===void 0?void 0:NA(F,m,`${u} has member 'start' that`),type:ne===void 0?void 0:zA(ne,`${u} has member 'type' that`)}}o(CA,"convertUnderlyingDefaultOrByteSource");function $A(a,u,m){return it(a,m),S=>L(a,u,[S])}o($A,"convertUnderlyingSourceCancelCallback");function kA(a,u,m){return it(a,m),S=>L(a,u,[S])}o(kA,"convertUnderlyingSourcePullCallback");function NA(a,u,m){return it(a,m),S=>N(a,u,[S])}o(NA,"convertUnderlyingSourceStartCallback");function zA(a,u){if(a=`${a}`,a!=="bytes")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}o(zA,"convertReadableStreamType");function DA(a,u){return tt(a,u),{preventCancel:!!a?.preventCancel}}o(DA,"convertIteratorOptions");function Qm(a,u){tt(a,u);let m=a?.preventAbort,S=a?.preventCancel,w=a?.preventClose,M=a?.signal;return M!==void 0&&UA(M,`${u} has member 'signal' that`),{preventAbort:!!m,preventCancel:!!S,preventClose:!!w,signal:M}}o(Qm,"convertPipeOptions");function UA(a,u){if(!Hx(a))throw new TypeError(`${u} is not an AbortSignal.`)}o(UA,"assertAbortSignal");function MA(a,u){tt(a,u);let m=a?.readable;v(m,"readable","ReadableWritablePair"),$(m,`${u} has member 'readable' that`);let S=a?.writable;return v(S,"writable","ReadableWritablePair"),Nm(S,`${u} has member 'writable' that`),{readable:m,writable:S}}o(MA,"convertReadableWritablePair");class St{static{o(this,"ReadableStream")}constructor(u={},m={}){u===void 0?u=null:Fe(u,"First parameter");let S=Ya(m,"Second parameter"),w=CA(u,"First parameter");if(Qc(this),w.type==="bytes"){if(S.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let M=Si(S,0);$x(this,w,M)}else{let M=Ja(S),F=Si(S,1);EA(this,w,F,M)}}get locked(){if(!gn(this))throw Yn("locked");return yn(this)}cancel(u=void 0){return gn(this)?yn(this)?f(new TypeError("Cannot cancel a stream that already has a reader")):lr(this,u):f(Yn("cancel"))}getReader(u=void 0){if(!gn(this))throw Yn("getReader");return Nx(u,"First parameter").mode===void 0?j(this):Rm(this)}pipeThrough(u,m={}){if(!gn(this))throw Yn("pipeThrough");qe(u,1,"pipeThrough");let S=MA(u,"First parameter"),w=Qm(m,"Second parameter");if(yn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(So(S.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let M=Jm(this,S.writable,w.preventClose,w.preventAbort,w.preventCancel,w.signal);return P(M),S.readable}pipeTo(u,m={}){if(!gn(this))return f(Yn("pipeTo"));if(u===void 0)return f("Parameter 1 is required in 'pipeTo'.");if(!Po(u))return f(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let S;try{S=Qm(m,"Second parameter")}catch(w){return f(w)}return yn(this)?f(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):So(u)?f(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Jm(this,u,S.preventClose,S.preventAbort,S.preventCancel,S.signal)}tee(){if(!gn(this))throw Yn("tee");let u=TA(this);return Ve(u)}values(u=void 0){if(!gn(this))throw Yn("values");let m=DA(u,"First parameter");return yo(this,m.preventCancel)}[Cc](u){return this.values(u)}static from(u){return IA(u)}}Object.defineProperties(St,{from:{enumerable:!0}}),Object.defineProperties(St.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(St.from,"from"),i(St.prototype.cancel,"cancel"),i(St.prototype.getReader,"getReader"),i(St.prototype.pipeThrough,"pipeThrough"),i(St.prototype.pipeTo,"pipeTo"),i(St.prototype.tee,"tee"),i(St.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(St.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(St.prototype,Cc,{value:St.prototype.values,writable:!0,configurable:!0});function Ai(a,u,m,S=1,w=()=>1){let M=Object.create(St.prototype);Qc(M);let F=Object.create(Wr.prototype);return Xm(M,F,a,u,m,S,w),M}o(Ai,"CreateReadableStream");function eh(a,u,m){let S=Object.create(St.prototype);Qc(S);let w=Object.create(Hr.prototype);return Im(S,w,a,u,m,0,void 0),S}o(eh,"CreateReadableByteStream");function Qc(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}o(Qc,"InitializeReadableStream");function gn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof St}o(gn,"IsReadableStream");function yn(a){return a._reader!==void 0}o(yn,"IsReadableStreamLocked");function lr(a,u){if(a._disturbed=!0,a._state==="closed")return p(void 0);if(a._state==="errored")return f(a._storedError);wi(a);let m=a._reader;if(m!==void 0&&Wn(m)){let w=m._readIntoRequests;m._readIntoRequests=new W,w.forEach(M=>{M._closeSteps(void 0)})}let S=a._readableStreamController[ee](u);return T(S,e)}o(lr,"ReadableStreamCancel");function wi(a){a._state="closed";let u=a._reader;if(u!==void 0&&(Be(u),ie(u))){let m=u._readRequests;u._readRequests=new W,m.forEach(S=>{S._closeSteps()})}}o(wi,"ReadableStreamClose");function th(a,u){a._state="errored",a._storedError=u;let m=a._reader;m!==void 0&&(Ae(m,u),ie(m)?Je(m,u):km(m,u))}o(th,"ReadableStreamError");function Yn(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}o(Yn,"streamBrandCheckException$1");function rh(a,u){tt(a,u);let m=a?.highWaterMark;return v(m,"highWaterMark","QueuingStrategyInit"),{highWaterMark:E(m)}}o(rh,"convertQueuingStrategyInit");let nh=o(a=>a.byteLength,"byteLengthSizeFunction");i(nh,"size");class us{static{o(this,"ByteLengthQueuingStrategy")}constructor(u){qe(u,1,"ByteLengthQueuingStrategy"),u=rh(u,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!ih(this))throw oh("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!ih(this))throw oh("size");return nh}}Object.defineProperties(us.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(us.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function oh(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}o(oh,"byteLengthBrandCheckException");function ih(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof us}o(ih,"IsByteLengthQueuingStrategy");let ah=o(()=>1,"countSizeFunction");i(ah,"size");class cs{static{o(this,"CountQueuingStrategy")}constructor(u){qe(u,1,"CountQueuingStrategy"),u=rh(u,"First parameter"),this._countQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!uh(this))throw sh("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!uh(this))throw sh("size");return ah}}Object.defineProperties(cs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(cs.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function sh(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}o(sh,"countBrandCheckException");function uh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof cs}o(uh,"IsCountQueuingStrategy");function jA(a,u){tt(a,u);let m=a?.cancel,S=a?.flush,w=a?.readableType,M=a?.start,F=a?.transform,ne=a?.writableType;return{cancel:m===void 0?void 0:qA(m,a,`${u} has member 'cancel' that`),flush:S===void 0?void 0:LA(S,a,`${u} has member 'flush' that`),readableType:w,start:M===void 0?void 0:FA(M,a,`${u} has member 'start' that`),transform:F===void 0?void 0:BA(F,a,`${u} has member 'transform' that`),writableType:ne}}o(jA,"convertTransformer");function LA(a,u,m){return it(a,m),S=>L(a,u,[S])}o(LA,"convertTransformerFlushCallback");function FA(a,u,m){return it(a,m),S=>N(a,u,[S])}o(FA,"convertTransformerStartCallback");function BA(a,u,m){return it(a,m),(S,w)=>L(a,u,[S,w])}o(BA,"convertTransformerTransformCallback");function qA(a,u,m){return it(a,m),S=>L(a,u,[S])}o(qA,"convertTransformerCancelCallback");class ls{static{o(this,"TransformStream")}constructor(u={},m={},S={}){u===void 0&&(u=null);let w=Ya(m,"Second parameter"),M=Ya(S,"Third parameter"),F=jA(u,"First parameter");if(F.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(F.writableType!==void 0)throw new RangeError("Invalid writableType specified");let ne=Si(M,0),he=Ja(M),le=Si(w,1),Ee=Ja(w),Ce,We=l(dr=>{Ce=dr});VA(this,We,le,Ee,ne,he),GA(this,F),F.start!==void 0?Ce(F.start(this._transformStreamController)):Ce(void 0)}get readable(){if(!ch(this))throw fh("readable");return this._readable}get writable(){if(!ch(this))throw fh("writable");return this._writable}}Object.defineProperties(ls.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ls.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function VA(a,u,m,S,w,M){function F(){return u}o(F,"startAlgorithm");function ne(We){return KA(a,We)}o(ne,"writeAlgorithm");function he(We){return JA(a,We)}o(he,"abortAlgorithm");function le(){return YA(a)}o(le,"closeAlgorithm"),a._writable=Zx(F,ne,le,he,m,S);function Ee(){return XA(a)}o(Ee,"pullAlgorithm");function Ce(We){return QA(a,We)}o(Ce,"cancelAlgorithm"),a._readable=Ai(F,Ee,Ce,w,M),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,ds(a,!0),a._transformStreamController=void 0}o(VA,"InitializeTransformStream");function ch(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof ls}o(ch,"IsTransformStream");function lh(a,u){cr(a._readable._readableStreamController,u),el(a,u)}o(lh,"TransformStreamError");function el(a,u){fs(a._transformStreamController),Ei(a._writable._writableStreamController,u),tl(a)}o(el,"TransformStreamErrorWritableAndUnblockWrite");function tl(a){a._backpressure&&ds(a,!1)}o(tl,"TransformStreamUnblockWrite");function ds(a,u){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=l(m=>{a._backpressureChangePromise_resolve=m}),a._backpressure=u}o(ds,"TransformStreamSetBackpressure");class _n{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ps(this))throw ms("desiredSize");let u=this._controlledTransformStream._readable._readableStreamController;return Xc(u)}enqueue(u=void 0){if(!ps(this))throw ms("enqueue");dh(this,u)}error(u=void 0){if(!ps(this))throw ms("error");WA(this,u)}terminate(){if(!ps(this))throw ms("terminate");ZA(this)}}Object.defineProperties(_n.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(_n.prototype.enqueue,"enqueue"),i(_n.prototype.error,"error"),i(_n.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(_n.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function ps(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof _n}o(ps,"IsTransformStreamDefaultController");function HA(a,u,m,S,w){u._controlledTransformStream=a,a._transformStreamController=u,u._transformAlgorithm=m,u._flushAlgorithm=S,u._cancelAlgorithm=w,u._finishPromise=void 0,u._finishPromise_resolve=void 0,u._finishPromise_reject=void 0}o(HA,"SetUpTransformStreamDefaultController");function GA(a,u){let m=Object.create(_n.prototype),S,w,M;u.transform!==void 0?S=o(F=>u.transform(F,m),"transformAlgorithm"):S=o(F=>{try{return dh(m,F),p(void 0)}catch(ne){return f(ne)}},"transformAlgorithm"),u.flush!==void 0?w=o(()=>u.flush(m),"flushAlgorithm"):w=o(()=>p(void 0),"flushAlgorithm"),u.cancel!==void 0?M=o(F=>u.cancel(F),"cancelAlgorithm"):M=o(()=>p(void 0),"cancelAlgorithm"),HA(a,m,S,w,M)}o(GA,"SetUpTransformStreamDefaultControllerFromTransformer");function fs(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}o(fs,"TransformStreamDefaultControllerClearAlgorithms");function dh(a,u){let m=a._controlledTransformStream,S=m._readable._readableStreamController;if(!xo(S))throw new TypeError("Readable side is not in a state that permits enqueue");try{To(S,u)}catch(M){throw el(m,M),m._readable._storedError}SA(S)!==m._backpressure&&ds(m,!0)}o(dh,"TransformStreamDefaultControllerEnqueue");function WA(a,u){lh(a._controlledTransformStream,u)}o(WA,"TransformStreamDefaultControllerError");function ph(a,u){let m=a._transformAlgorithm(u);return T(m,void 0,S=>{throw lh(a._controlledTransformStream,S),S})}o(ph,"TransformStreamDefaultControllerPerformTransform");function ZA(a){let u=a._controlledTransformStream,m=u._readable._readableStreamController;Jn(m);let S=new TypeError("TransformStream terminated");el(u,S)}o(ZA,"TransformStreamDefaultControllerTerminate");function KA(a,u){let m=a._transformStreamController;if(a._backpressure){let S=a._backpressureChangePromise;return T(S,()=>{let w=a._writable;if(w._state==="erroring")throw w._storedError;return ph(m,u)})}return ph(m,u)}o(KA,"TransformStreamDefaultSinkWriteAlgorithm");function JA(a,u){let m=a._transformStreamController;if(m._finishPromise!==void 0)return m._finishPromise;let S=a._readable;m._finishPromise=l((M,F)=>{m._finishPromise_resolve=M,m._finishPromise_reject=F});let w=m._cancelAlgorithm(u);return fs(m),h(w,()=>(S._state==="errored"?Ao(m,S._storedError):(cr(S._readableStreamController,u),rl(m)),null),M=>(cr(S._readableStreamController,M),Ao(m,M),null)),m._finishPromise}o(JA,"TransformStreamDefaultSinkAbortAlgorithm");function YA(a){let u=a._transformStreamController;if(u._finishPromise!==void 0)return u._finishPromise;let m=a._readable;u._finishPromise=l((w,M)=>{u._finishPromise_resolve=w,u._finishPromise_reject=M});let S=u._flushAlgorithm();return fs(u),h(S,()=>(m._state==="errored"?Ao(u,m._storedError):(Jn(m._readableStreamController),rl(u)),null),w=>(cr(m._readableStreamController,w),Ao(u,w),null)),u._finishPromise}o(YA,"TransformStreamDefaultSinkCloseAlgorithm");function XA(a){return ds(a,!1),a._backpressureChangePromise}o(XA,"TransformStreamDefaultSourcePullAlgorithm");function QA(a,u){let m=a._transformStreamController;if(m._finishPromise!==void 0)return m._finishPromise;let S=a._writable;m._finishPromise=l((M,F)=>{m._finishPromise_resolve=M,m._finishPromise_reject=F});let w=m._cancelAlgorithm(u);return fs(m),h(w,()=>(S._state==="errored"?Ao(m,S._storedError):(Ei(S._writableStreamController,u),tl(a),rl(m)),null),M=>(Ei(S._writableStreamController,M),tl(a),Ao(m,M),null)),m._finishPromise}o(QA,"TransformStreamDefaultSourceCancelAlgorithm");function ms(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}o(ms,"defaultControllerBrandCheckException");function rl(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(rl,"defaultControllerFinishPromiseResolve");function Ao(a,u){a._finishPromise_reject!==void 0&&(P(a._finishPromise),a._finishPromise_reject(u),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Ao,"defaultControllerFinishPromiseReject");function fh(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}o(fh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=us,t.CountQueuingStrategy=cs,t.ReadableByteStreamController=Hr,t.ReadableStream=St,t.ReadableStreamBYOBReader=mn,t.ReadableStreamBYOBRequest=Vn,t.ReadableStreamDefaultController=Wr,t.ReadableStreamDefaultReader=V,t.TransformStream=ls,t.TransformStreamDefaultController=_n,t.WritableStream=hn,t.WritableStreamDefaultController=Eo,t.WritableStreamDefaultWriter=Gr}))});var Mb=k(()=>{if(!globalThis.ReadableStream)try{let t=require("node:process"),{emitWarning:e}=t;try{t.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),t.emitWarning=e}catch(r){throw t.emitWarning=e,r}}catch{Object.assign(globalThis,Ub())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=o(function(r){let n=0,i=this;return new ReadableStream({type:"bytes",async pull(s){let d=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=d.byteLength,s.enqueue(new Uint8Array(d)),n===i.size&&s.close()}})},"name"))}catch{}});async function*Sd(t,e=!0){for(let r of t)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let n=r.byteOffset,i=r.byteOffset+r.byteLength;for(;n!==i;){let s=Math.min(i-n,jb),c=r.buffer.slice(n,n+s);n+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let n=0,i=r;for(;n!==i.size;){let c=await i.slice(n,Math.min(i.size,n+jb)).arrayBuffer();n+=c.byteLength,yield new Uint8Array(c)}}}var Y8,jb,Lb,$0,hr,na=gt(()=>{Y8=pt(Mb(),1);jb=65536;o(Sd,"toIterator");Lb=class Ed{static{o(this,"Blob")}#e=[];#t="";#r=0;#n="transparent";constructor(e=[],r={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let n=new TextEncoder;for(let s of e){let c;ArrayBuffer.isView(s)?c=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?c=new Uint8Array(s.slice(0)):s instanceof Ed?c=s:c=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of Sd(this.#e,!1))r+=e.decode(n,{stream:!0});return r+=e.decode(),r}async arrayBuffer(){let e=new Uint8Array(this.size),r=0;for await(let n of Sd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Sd(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let n=await e.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,n=""){let{size:i}=this,s=e<0?Math.max(i+e,0):Math.min(e,i),c=r<0?Math.max(i+r,0):Math.min(r,i),d=Math.max(c-s,0),l=this.#e,p=[],f=0;for(let h of l){if(f>=d)break;let g=ArrayBuffer.isView(h)?h.byteLength:h.size;if(s&&g<=s)s-=g,c-=g;else{let y;ArrayBuffer.isView(h)?(y=h.subarray(s,Math.min(g,c)),f+=y.byteLength):(y=h.slice(s,Math.min(g,c)),f+=y.size),c-=g,p.push(y),s=0}}let _=new Ed([],{type:String(n).toLowerCase()});return _.#r=d,_.#e=p,_}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}};Object.defineProperties(Lb.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});$0=Lb,hr=$0});var k0,N0,zn,Td=gt(()=>{na();k0=class extends hr{static{o(this,"File")}#e=0;#t="";constructor(e,r,n={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,n),n===null&&(n={});let i=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(i)||(this.#e=i),this.#t=String(r)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof hr&&/^(File)$/.test(e[Symbol.toStringTag])}},N0=k0,zn=N0});function qb(t,e=hr){var r=`${Fb()}${Fb()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
13
+ `;let l=(0,C0.parseProxyResponse)(i);i.write(`${d}\r
14
+ `);let{connect:p,buffered:f}=await l;if(e.emit("proxyConnect",p),this.emit("proxyConnect",p,e),p.statusCode===200)return e.once("socket",$0),r.secureEndpoint?(ra("Upgrading socket connection to TLS"),Rb.connect({...Cb(Ob(r),"host","path","port"),socket:i})):i;i.destroy();let _=new nu.Socket({writable:!1});return _.readable=!0,e.once("socket",h=>{ra("Replaying proxy buffer for failed request"),(0,w0.default)(h.listenerCount("data")>0),h.push(f),h.push(null)}),_}};ou.protocols=["http","https"];rr.HttpsProxyAgent=ou;function $0(t){t.resume()}o($0,"resume");function Cb(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(Cb,"omit")});function k0(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,s=r[0]||"text/plain",c=s;for(let f=1;f<r.length;f++)r[f]==="base64"?i=!0:r[f]&&(c+=`;${r[f]}`,r[f].indexOf("charset=")===0&&(n=r[f].substring(8)));!r[0]&&!n.length&&(c+=";charset=US-ASCII",n="US-ASCII");let d=i?"base64":"ascii",l=unescape(t.substring(e+1)),p=Buffer.from(l,d);return p.type=s,p.typeFull=c,p.charset=n,p}var zb,Db=gt(()=>{o(k0,"dataUriToBuffer");zb=k0});var Mb=k((iu,Ub)=>{(function(t,e){typeof iu=="object"&&typeof Ub<"u"?e(iu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(iu,(function(t){"use strict";function e(){}o(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(r,"typeIsObject");let n=e;function i(a,u){try{Object.defineProperty(a,"name",{value:u,configurable:!0})}catch{}}o(i,"setFunctionName");let s=Promise,c=Promise.prototype.then,d=Promise.reject.bind(s);function l(a){return new s(a)}o(l,"newPromise");function p(a){return l(u=>u(a))}o(p,"promiseResolvedWith");function f(a){return d(a)}o(f,"promiseRejectedWith");function _(a,u,m){return c.call(a,u,m)}o(_,"PerformPromiseThen");function h(a,u,m){_(_(a,u,m),void 0,n)}o(h,"uponPromise");function g(a,u){h(a,u)}o(g,"uponFulfillment");function y(a,u){h(a,void 0,u)}o(y,"uponRejection");function T(a,u,m){return _(a,u,m)}o(T,"transformPromiseWith");function P(a){_(a,void 0,n)}o(P,"setPromiseIsHandledToTrue");let x=o(a=>{if(typeof queueMicrotask=="function")x=queueMicrotask;else{let u=p(void 0);x=o(m=>_(u,m),"_queueMicrotask")}return x(a)},"_queueMicrotask");function N(a,u,m){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,u,m)}o(N,"reflectCall");function L(a,u,m){try{return p(N(a,u,m))}catch(S){return f(S)}}o(L,"promiseCall");let X=16384;class W{static{o(this,"SimpleQueue")}constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(u){let m=this._back,S=m;m._elements.length===X-1&&(S={_elements:[],_next:void 0}),m._elements.push(u),S!==m&&(this._back=S,m._next=S),++this._size}shift(){let u=this._front,m=u,S=this._cursor,w=S+1,M=u._elements,F=M[S];return w===X&&(m=u._next,w=0),--this._size,this._cursor=w,u!==m&&(this._front=m),M[S]=void 0,F}forEach(u){let m=this._cursor,S=this._front,w=S._elements;for(;(m!==w.length||S._next!==void 0)&&!(m===w.length&&(S=S._next,w=S._elements,m=0,w.length===0));)u(w[m]),++m}peek(){let u=this._front,m=this._cursor;return u._elements[m]}}let G=Symbol("[[AbortSteps]]"),Z=Symbol("[[ErrorSteps]]"),ee=Symbol("[[CancelSteps]]"),Y=Symbol("[[PullSteps]]"),Se=Symbol("[[ReleaseSteps]]");function te(a,u){a._ownerReadableStream=u,u._reader=a,u._state==="readable"?K(a):u._state==="closed"?oe(a):re(a,u._storedError)}o(te,"ReadableStreamReaderGenericInitialize");function q(a,u){let m=a._ownerReadableStream;return lr(m,u)}o(q,"ReadableStreamReaderGenericCancel");function B(a){let u=a._ownerReadableStream;u._state==="readable"?Ae(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Oe(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._readableStreamController[Se](),u._reader=void 0,a._ownerReadableStream=void 0}o(B,"ReadableStreamReaderGenericRelease");function J(a){return new TypeError("Cannot "+a+" a stream using a released reader")}o(J,"readerLockException");function K(a){a._closedPromise=l((u,m)=>{a._closedPromise_resolve=u,a._closedPromise_reject=m})}o(K,"defaultReaderClosedPromiseInitialize");function re(a,u){K(a),Ae(a,u)}o(re,"defaultReaderClosedPromiseInitializeAsRejected");function oe(a){K(a),Be(a)}o(oe,"defaultReaderClosedPromiseInitializeAsResolved");function Ae(a,u){a._closedPromise_reject!==void 0&&(P(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ae,"defaultReaderClosedPromiseReject");function Oe(a,u){re(a,u)}o(Oe,"defaultReaderClosedPromiseResetToRejected");function Be(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Be,"defaultReaderClosedPromiseResolve");let Ge=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},ht=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function Q(a){return typeof a=="object"||typeof a=="function"}o(Q,"isDictionary");function tt(a,u){if(a!==void 0&&!Q(a))throw new TypeError(`${u} is not an object.`)}o(tt,"assertDictionary");function it(a,u){if(typeof a!="function")throw new TypeError(`${u} is not a function.`)}o(it,"assertFunction");function Nt(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(Nt,"isObject");function Fe(a,u){if(!Nt(a))throw new TypeError(`${u} is not an object.`)}o(Fe,"assertObject");function qe(a,u,m){if(a===void 0)throw new TypeError(`Parameter ${u} is required in '${m}'.`)}o(qe,"assertRequiredArgument");function v(a,u,m){if(a===void 0)throw new TypeError(`${u} is required in '${m}'.`)}o(v,"assertRequiredField");function E(a){return Number(a)}o(E,"convertUnrestrictedDouble");function A(a){return a===0?0:a}o(A,"censorNegativeZero");function D(a){return A(ht(a))}o(D,"integerPart");function R(a,u){let S=Number.MAX_SAFE_INTEGER,w=Number(a);if(w=A(w),!Ge(w))throw new TypeError(`${u} is not a finite number`);if(w=D(w),w<0||w>S)throw new TypeError(`${u} is outside the accepted range of 0 to ${S}, inclusive`);return!Ge(w)||w===0?0:w}o(R,"convertUnsignedLongLongWithEnforceRange");function $(a,u){if(!gn(a))throw new TypeError(`${u} is not a ReadableStream.`)}o($,"assertReadableStream");function j(a){return new V(a)}o(j,"AcquireReadableStreamDefaultReader");function I(a,u){a._reader._readRequests.push(u)}o(I,"ReadableStreamAddReadRequest");function O(a,u,m){let w=a._reader._readRequests.shift();m?w._closeSteps():w._chunkSteps(u)}o(O,"ReadableStreamFulfillReadRequest");function U(a){return a._reader._readRequests.length}o(U,"ReadableStreamGetNumReadRequests");function z(a){let u=a._reader;return!(u===void 0||!ie(u))}o(z,"ReadableStreamHasDefaultReader");class V{static{o(this,"ReadableStreamDefaultReader")}constructor(u){if(qe(u,1,"ReadableStreamDefaultReader"),$(u,"First parameter"),yn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");te(this,u),this._readRequests=new W}get closed(){return ie(this)?this._closedPromise:f(Ye("closed"))}cancel(u=void 0){return ie(this)?this._ownerReadableStream===void 0?f(J("cancel")):q(this,u):f(Ye("cancel"))}read(){if(!ie(this))return f(Ye("read"));if(this._ownerReadableStream===void 0)return f(J("read from"));let u,m,S=l((M,F)=>{u=M,m=F});return ue(this,{_chunkSteps:o(M=>u({value:M,done:!1}),"_chunkSteps"),_closeSteps:o(()=>u({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(M=>m(M),"_errorSteps")}),S}releaseLock(){if(!ie(this))throw Ye("releaseLock");this._ownerReadableStream!==void 0&&De(this)}}Object.defineProperties(V.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(V.prototype.cancel,"cancel"),i(V.prototype.read,"read"),i(V.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(V.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function ie(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof V}o(ie,"IsReadableStreamDefaultReader");function ue(a,u){let m=a._ownerReadableStream;m._disturbed=!0,m._state==="closed"?u._closeSteps():m._state==="errored"?u._errorSteps(m._storedError):m._readableStreamController[Y](u)}o(ue,"ReadableStreamDefaultReaderRead");function De(a){B(a);let u=new TypeError("Reader was released");Je(a,u)}o(De,"ReadableStreamDefaultReaderRelease");function Je(a,u){let m=a._readRequests;a._readRequests=new W,m.forEach(S=>{S._errorSteps(u)})}o(Je,"ReadableStreamDefaultReaderErrorReadRequests");function Ye(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}o(Ye,"defaultReaderBrandCheckException");let ze=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Le{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(u,m){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=u,this._preventCancel=m}next(){let u=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?T(this._ongoingPromise,u,u):u(),this._ongoingPromise}return(u){let m=o(()=>this._returnSteps(u),"returnSteps");return this._ongoingPromise?T(this._ongoingPromise,m,m):m()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let u=this._reader,m,S,w=l((F,ne)=>{m=F,S=ne});return ue(u,{_chunkSteps:o(F=>{this._ongoingPromise=void 0,x(()=>m({value:F,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),m({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(F=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),S(F)},"_errorSteps")}),w}_returnSteps(u){if(this._isFinished)return Promise.resolve({value:u,done:!0});this._isFinished=!0;let m=this._reader;if(!this._preventCancel){let S=q(m,u);return B(m),T(S,()=>({value:u,done:!0}))}return B(m),p({value:u,done:!0})}}let dt={next(){return _o(this)?this._asyncIteratorImpl.next():f(vo("next"))},return(a){return _o(this)?this._asyncIteratorImpl.return(a):f(vo("return"))}};Object.setPrototypeOf(dt,ze);function yo(a,u){let m=j(a),S=new Le(m,u),w=Object.create(dt);return w._asyncIteratorImpl=S,w}o(yo,"AcquireReadableStreamAsyncIterator");function _o(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof Le}catch{return!1}}o(_o,"IsReadableStreamAsyncIterator");function vo(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}o(vo,"streamAsyncIteratorBrandCheckException");let zt=Number.isNaN||function(a){return a!==a};var qr,Pt,pt;function Ve(a){return a.slice()}o(Ve,"CreateArrayFromList");function fm(a,u,m,S,w){new Uint8Array(a).set(new Uint8Array(m,S,w),u)}o(fm,"CopyDataBlockBytes");let Vr=o(a=>(typeof a.transfer=="function"?Vr=o(u=>u.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?Vr=o(u=>structuredClone(u,{transfer:[u]}),"TransferArrayBuffer"):Vr=o(u=>u,"TransferArrayBuffer"),Vr(a)),"TransferArrayBuffer"),pn=o(a=>(typeof a.detached=="boolean"?pn=o(u=>u.detached,"IsDetachedBuffer"):pn=o(u=>u.byteLength===0,"IsDetachedBuffer"),pn(a)),"IsDetachedBuffer");function mm(a,u,m){if(a.slice)return a.slice(u,m);let S=m-u,w=new ArrayBuffer(S);return fm(w,0,a,u,S),w}o(mm,"ArrayBufferSlice");function qa(a,u){let m=a[u];if(m!=null){if(typeof m!="function")throw new TypeError(`${String(u)} is not a function`);return m}}o(qa,"GetMethod");function bx(a){let u={[Symbol.iterator]:()=>a.iterator},m=(async function*(){return yield*u})(),S=m.next;return{iterator:m,nextMethod:S,done:!1}}o(bx,"CreateAsyncFromSyncIterator");let Cc=(pt=(qr=Symbol.asyncIterator)!==null&&qr!==void 0?qr:(Pt=Symbol.for)===null||Pt===void 0?void 0:Pt.call(Symbol,"Symbol.asyncIterator"))!==null&&pt!==void 0?pt:"@@asyncIterator";function hm(a,u="sync",m){if(m===void 0)if(u==="async"){if(m=qa(a,Cc),m===void 0){let M=qa(a,Symbol.iterator),F=hm(a,"sync",M);return bx(F)}}else m=qa(a,Symbol.iterator);if(m===void 0)throw new TypeError("The object is not iterable");let S=N(m,a,[]);if(!r(S))throw new TypeError("The iterator method must return an object");let w=S.next;return{iterator:S,nextMethod:w,done:!1}}o(hm,"GetIterator");function Px(a){let u=N(a.nextMethod,a.iterator,[]);if(!r(u))throw new TypeError("The iterator.next() method must return an object");return u}o(Px,"IteratorNext");function Sx(a){return!!a.done}o(Sx,"IteratorComplete");function Ex(a){return a.value}o(Ex,"IteratorValue");function Tx(a){return!(typeof a!="number"||zt(a)||a<0)}o(Tx,"IsNonNegativeNumber");function gm(a){let u=mm(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(u)}o(gm,"CloneAsUint8Array");function $c(a){let u=a._queue.shift();return a._queueTotalSize-=u.size,a._queueTotalSize<0&&(a._queueTotalSize=0),u.value}o($c,"DequeueValue");function kc(a,u,m){if(!Tx(m)||m===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:u,size:m}),a._queueTotalSize+=m}o(kc,"EnqueueValueWithSize");function xx(a){return a._queue.peek().value}o(xx,"PeekQueueValue");function fn(a){a._queue=new W,a._queueTotalSize=0}o(fn,"ResetQueue");function ym(a){return a===DataView}o(ym,"isDataViewConstructor");function Ax(a){return ym(a.constructor)}o(Ax,"isDataView");function wx(a){return ym(a)?1:a.BYTES_PER_ELEMENT}o(wx,"arrayBufferViewElementSize");class Vn{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Nc(this))throw jc("view");return this._view}respond(u){if(!Nc(this))throw jc("respond");if(qe(u,1,"respond"),u=R(u,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(pn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Wa(this._associatedReadableByteStreamController,u)}respondWithNewView(u){if(!Nc(this))throw jc("respondWithNewView");if(qe(u,1,"respondWithNewView"),!ArrayBuffer.isView(u))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(pn(u.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Za(this._associatedReadableByteStreamController,u)}}Object.defineProperties(Vn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(Vn.prototype.respond,"respond"),i(Vn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Vn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Hr{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Hn(this))throw Pi("byobRequest");return Mc(this)}get desiredSize(){if(!Hn(this))throw Pi("desiredSize");return wm(this)}close(){if(!Hn(this))throw Pi("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let u=this._controlledReadableByteStream._state;if(u!=="readable")throw new TypeError(`The stream (in ${u} state) is not in the readable state and cannot be closed`);bi(this)}enqueue(u){if(!Hn(this))throw Pi("enqueue");if(qe(u,1,"enqueue"),!ArrayBuffer.isView(u))throw new TypeError("chunk must be an array buffer view");if(u.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(u.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let m=this._controlledReadableByteStream._state;if(m!=="readable")throw new TypeError(`The stream (in ${m} state) is not in the readable state and cannot be enqueued to`);Ga(this,u)}error(u=void 0){if(!Hn(this))throw Pi("error");Yt(this,u)}[ee](u){_m(this),fn(this);let m=this._cancelAlgorithm(u);return Ha(this),m}[Y](u){let m=this._controlledReadableByteStream;if(this._queueTotalSize>0){Am(this,u);return}let S=this._autoAllocateChunkSize;if(S!==void 0){let w;try{w=new ArrayBuffer(S)}catch(F){u._errorSteps(F);return}let M={buffer:w,bufferByteLength:S,byteOffset:0,byteLength:S,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(M)}I(m,u),Gn(this)}[Se](){if(this._pendingPullIntos.length>0){let u=this._pendingPullIntos.peek();u.readerType="none",this._pendingPullIntos=new W,this._pendingPullIntos.push(u)}}}Object.defineProperties(Hr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Hr.prototype.close,"close"),i(Hr.prototype.enqueue,"enqueue"),i(Hr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Hr.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Hn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof Hr}o(Hn,"IsReadableByteStreamController");function Nc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof Vn}o(Nc,"IsReadableStreamBYOBRequest");function Gn(a){if(!$x(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let m=a._pullAlgorithm();h(m,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,Gn(a)),null),S=>(Yt(a,S),null))}o(Gn,"ReadableByteStreamControllerCallPullIfNeeded");function _m(a){Dc(a),a._pendingPullIntos=new W}o(_m,"ReadableByteStreamControllerClearPendingPullIntos");function zc(a,u){let m=!1;a._state==="closed"&&(m=!0);let S=vm(u);u.readerType==="default"?O(a,S,m):Mx(a,S,m)}o(zc,"ReadableByteStreamControllerCommitPullIntoDescriptor");function vm(a){let u=a.bytesFilled,m=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,u/m)}o(vm,"ReadableByteStreamControllerConvertPullIntoDescriptor");function Va(a,u,m,S){a._queue.push({buffer:u,byteOffset:m,byteLength:S}),a._queueTotalSize+=S}o(Va,"ReadableByteStreamControllerEnqueueChunkToQueue");function bm(a,u,m,S){let w;try{w=mm(u,m,m+S)}catch(M){throw Yt(a,M),M}Va(a,w,0,S)}o(bm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Pm(a,u){u.bytesFilled>0&&bm(a,u.buffer,u.byteOffset,u.bytesFilled),bo(a)}o(Pm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function Sm(a,u){let m=Math.min(a._queueTotalSize,u.byteLength-u.bytesFilled),S=u.bytesFilled+m,w=m,M=!1,F=S%u.elementSize,ne=S-F;ne>=u.minimumFill&&(w=ne-u.bytesFilled,M=!0);let he=a._queue;for(;w>0;){let le=he.peek(),Ee=Math.min(w,le.byteLength),Ce=u.byteOffset+u.bytesFilled;fm(u.buffer,Ce,le.buffer,le.byteOffset,Ee),le.byteLength===Ee?he.shift():(le.byteOffset+=Ee,le.byteLength-=Ee),a._queueTotalSize-=Ee,Em(a,Ee,u),w-=Ee}return M}o(Sm,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function Em(a,u,m){m.bytesFilled+=u}o(Em,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function Tm(a){a._queueTotalSize===0&&a._closeRequested?(Ha(a),wi(a._controlledReadableByteStream)):Gn(a)}o(Tm,"ReadableByteStreamControllerHandleQueueDrain");function Dc(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}o(Dc,"ReadableByteStreamControllerInvalidateBYOBRequest");function Uc(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let u=a._pendingPullIntos.peek();Sm(a,u)&&(bo(a),zc(a._controlledReadableByteStream,u))}}o(Uc,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function Ix(a){let u=a._controlledReadableByteStream._reader;for(;u._readRequests.length>0;){if(a._queueTotalSize===0)return;let m=u._readRequests.shift();Am(a,m)}}o(Ix,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function Rx(a,u,m,S){let w=a._controlledReadableByteStream,M=u.constructor,F=wx(M),{byteOffset:ne,byteLength:he}=u,le=m*F,Ee;try{Ee=Vr(u.buffer)}catch(We){S._errorSteps(We);return}let Ce={buffer:Ee,bufferByteLength:Ee.byteLength,byteOffset:ne,byteLength:he,bytesFilled:0,minimumFill:le,elementSize:F,viewConstructor:M,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(Ce),Om(w,S);return}if(w._state==="closed"){let We=new M(Ce.buffer,Ce.byteOffset,0);S._closeSteps(We);return}if(a._queueTotalSize>0){if(Sm(a,Ce)){let We=vm(Ce);Tm(a),S._chunkSteps(We);return}if(a._closeRequested){let We=new TypeError("Insufficient bytes to fill elements in the given buffer");Yt(a,We),S._errorSteps(We);return}}a._pendingPullIntos.push(Ce),Om(w,S),Gn(a)}o(Rx,"ReadableByteStreamControllerPullInto");function Ox(a,u){u.readerType==="none"&&bo(a);let m=a._controlledReadableByteStream;if(Lc(m))for(;Cm(m)>0;){let S=bo(a);zc(m,S)}}o(Ox,"ReadableByteStreamControllerRespondInClosedState");function Cx(a,u,m){if(Em(a,u,m),m.readerType==="none"){Pm(a,m),Uc(a);return}if(m.bytesFilled<m.minimumFill)return;bo(a);let S=m.bytesFilled%m.elementSize;if(S>0){let w=m.byteOffset+m.bytesFilled;bm(a,m.buffer,w-S,S)}m.bytesFilled-=S,zc(a._controlledReadableByteStream,m),Uc(a)}o(Cx,"ReadableByteStreamControllerRespondInReadableState");function xm(a,u){let m=a._pendingPullIntos.peek();Dc(a),a._controlledReadableByteStream._state==="closed"?Ox(a,m):Cx(a,u,m),Gn(a)}o(xm,"ReadableByteStreamControllerRespondInternal");function bo(a){return a._pendingPullIntos.shift()}o(bo,"ReadableByteStreamControllerShiftPendingPullInto");function $x(a){let u=a._controlledReadableByteStream;return u._state!=="readable"||a._closeRequested||!a._started?!1:!!(z(u)&&U(u)>0||Lc(u)&&Cm(u)>0||wm(a)>0)}o($x,"ReadableByteStreamControllerShouldCallPull");function Ha(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}o(Ha,"ReadableByteStreamControllerClearAlgorithms");function bi(a){let u=a._controlledReadableByteStream;if(!(a._closeRequested||u._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let m=a._pendingPullIntos.peek();if(m.bytesFilled%m.elementSize!==0){let S=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Yt(a,S),S}}Ha(a),wi(u)}}o(bi,"ReadableByteStreamControllerClose");function Ga(a,u){let m=a._controlledReadableByteStream;if(a._closeRequested||m._state!=="readable")return;let{buffer:S,byteOffset:w,byteLength:M}=u;if(pn(S))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let F=Vr(S);if(a._pendingPullIntos.length>0){let ne=a._pendingPullIntos.peek();if(pn(ne.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Dc(a),ne.buffer=Vr(ne.buffer),ne.readerType==="none"&&Pm(a,ne)}if(z(m))if(Ix(a),U(m)===0)Va(a,F,w,M);else{a._pendingPullIntos.length>0&&bo(a);let ne=new Uint8Array(F,w,M);O(m,ne,!1)}else Lc(m)?(Va(a,F,w,M),Uc(a)):Va(a,F,w,M);Gn(a)}o(Ga,"ReadableByteStreamControllerEnqueue");function Yt(a,u){let m=a._controlledReadableByteStream;m._state==="readable"&&(_m(a),fn(a),Ha(a),th(m,u))}o(Yt,"ReadableByteStreamControllerError");function Am(a,u){let m=a._queue.shift();a._queueTotalSize-=m.byteLength,Tm(a);let S=new Uint8Array(m.buffer,m.byteOffset,m.byteLength);u._chunkSteps(S)}o(Am,"ReadableByteStreamControllerFillReadRequestFromQueue");function Mc(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let u=a._pendingPullIntos.peek(),m=new Uint8Array(u.buffer,u.byteOffset+u.bytesFilled,u.byteLength-u.bytesFilled),S=Object.create(Vn.prototype);Nx(S,a,m),a._byobRequest=S}return a._byobRequest}o(Mc,"ReadableByteStreamControllerGetBYOBRequest");function wm(a){let u=a._controlledReadableByteStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(wm,"ReadableByteStreamControllerGetDesiredSize");function Wa(a,u){let m=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(u===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(m.bytesFilled+u>m.byteLength)throw new RangeError("bytesWritten out of range")}m.buffer=Vr(m.buffer),xm(a,u)}o(Wa,"ReadableByteStreamControllerRespond");function Za(a,u){let m=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(u.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(m.byteOffset+m.bytesFilled!==u.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(m.bufferByteLength!==u.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(m.bytesFilled+u.byteLength>m.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let w=u.byteLength;m.buffer=Vr(u.buffer),xm(a,w)}o(Za,"ReadableByteStreamControllerRespondWithNewView");function Im(a,u,m,S,w,M,F){u._controlledReadableByteStream=a,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,fn(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=M,u._pullAlgorithm=S,u._cancelAlgorithm=w,u._autoAllocateChunkSize=F,u._pendingPullIntos=new W,a._readableStreamController=u;let ne=m();h(p(ne),()=>(u._started=!0,Gn(u),null),he=>(Yt(u,he),null))}o(Im,"SetUpReadableByteStreamController");function kx(a,u,m){let S=Object.create(Hr.prototype),w,M,F;u.start!==void 0?w=o(()=>u.start(S),"startAlgorithm"):w=o(()=>{},"startAlgorithm"),u.pull!==void 0?M=o(()=>u.pull(S),"pullAlgorithm"):M=o(()=>p(void 0),"pullAlgorithm"),u.cancel!==void 0?F=o(he=>u.cancel(he),"cancelAlgorithm"):F=o(()=>p(void 0),"cancelAlgorithm");let ne=u.autoAllocateChunkSize;if(ne===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Im(a,S,w,M,F,m,ne)}o(kx,"SetUpReadableByteStreamControllerFromUnderlyingSource");function Nx(a,u,m){a._associatedReadableByteStreamController=u,a._view=m}o(Nx,"SetUpReadableStreamBYOBRequest");function jc(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}o(jc,"byobRequestBrandCheckException");function Pi(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}o(Pi,"byteStreamControllerBrandCheckException");function zx(a,u){tt(a,u);let m=a?.mode;return{mode:m===void 0?void 0:Dx(m,`${u} has member 'mode' that`)}}o(zx,"convertReaderOptions");function Dx(a,u){if(a=`${a}`,a!=="byob")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}o(Dx,"convertReadableStreamReaderMode");function Ux(a,u){var m;tt(a,u);let S=(m=a?.min)!==null&&m!==void 0?m:1;return{min:R(S,`${u} has member 'min' that`)}}o(Ux,"convertByobReadOptions");function Rm(a){return new mn(a)}o(Rm,"AcquireReadableStreamBYOBReader");function Om(a,u){a._reader._readIntoRequests.push(u)}o(Om,"ReadableStreamAddReadIntoRequest");function Mx(a,u,m){let w=a._reader._readIntoRequests.shift();m?w._closeSteps(u):w._chunkSteps(u)}o(Mx,"ReadableStreamFulfillReadIntoRequest");function Cm(a){return a._reader._readIntoRequests.length}o(Cm,"ReadableStreamGetNumReadIntoRequests");function Lc(a){let u=a._reader;return!(u===void 0||!Wn(u))}o(Lc,"ReadableStreamHasBYOBReader");class mn{static{o(this,"ReadableStreamBYOBReader")}constructor(u){if(qe(u,1,"ReadableStreamBYOBReader"),$(u,"First parameter"),yn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Hn(u._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");te(this,u),this._readIntoRequests=new W}get closed(){return Wn(this)?this._closedPromise:f(Ka("closed"))}cancel(u=void 0){return Wn(this)?this._ownerReadableStream===void 0?f(J("cancel")):q(this,u):f(Ka("cancel"))}read(u,m={}){if(!Wn(this))return f(Ka("read"));if(!ArrayBuffer.isView(u))return f(new TypeError("view must be an array buffer view"));if(u.byteLength===0)return f(new TypeError("view must have non-zero byteLength"));if(u.buffer.byteLength===0)return f(new TypeError("view's buffer must have non-zero byteLength"));if(pn(u.buffer))return f(new TypeError("view's buffer has been detached"));let S;try{S=Ux(m,"options")}catch(le){return f(le)}let w=S.min;if(w===0)return f(new TypeError("options.min must be greater than 0"));if(Ax(u)){if(w>u.byteLength)return f(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(w>u.length)return f(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return f(J("read from"));let M,F,ne=l((le,Ee)=>{M=le,F=Ee});return $m(this,u,w,{_chunkSteps:o(le=>M({value:le,done:!1}),"_chunkSteps"),_closeSteps:o(le=>M({value:le,done:!0}),"_closeSteps"),_errorSteps:o(le=>F(le),"_errorSteps")}),ne}releaseLock(){if(!Wn(this))throw Ka("releaseLock");this._ownerReadableStream!==void 0&&jx(this)}}Object.defineProperties(mn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(mn.prototype.cancel,"cancel"),i(mn.prototype.read,"read"),i(mn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(mn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Wn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof mn}o(Wn,"IsReadableStreamBYOBReader");function $m(a,u,m,S){let w=a._ownerReadableStream;w._disturbed=!0,w._state==="errored"?S._errorSteps(w._storedError):Rx(w._readableStreamController,u,m,S)}o($m,"ReadableStreamBYOBReaderRead");function jx(a){B(a);let u=new TypeError("Reader was released");km(a,u)}o(jx,"ReadableStreamBYOBReaderRelease");function km(a,u){let m=a._readIntoRequests;a._readIntoRequests=new W,m.forEach(S=>{S._errorSteps(u)})}o(km,"ReadableStreamBYOBReaderErrorReadIntoRequests");function Ka(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}o(Ka,"byobReaderBrandCheckException");function Si(a,u){let{highWaterMark:m}=a;if(m===void 0)return u;if(zt(m)||m<0)throw new RangeError("Invalid highWaterMark");return m}o(Si,"ExtractHighWaterMark");function Ja(a){let{size:u}=a;return u||(()=>1)}o(Ja,"ExtractSizeAlgorithm");function Ya(a,u){tt(a,u);let m=a?.highWaterMark,S=a?.size;return{highWaterMark:m===void 0?void 0:E(m),size:S===void 0?void 0:Lx(S,`${u} has member 'size' that`)}}o(Ya,"convertQueuingStrategy");function Lx(a,u){return it(a,u),m=>E(a(m))}o(Lx,"convertQueuingStrategySize");function Fx(a,u){tt(a,u);let m=a?.abort,S=a?.close,w=a?.start,M=a?.type,F=a?.write;return{abort:m===void 0?void 0:Bx(m,a,`${u} has member 'abort' that`),close:S===void 0?void 0:qx(S,a,`${u} has member 'close' that`),start:w===void 0?void 0:Vx(w,a,`${u} has member 'start' that`),write:F===void 0?void 0:Hx(F,a,`${u} has member 'write' that`),type:M}}o(Fx,"convertUnderlyingSink");function Bx(a,u,m){return it(a,m),S=>L(a,u,[S])}o(Bx,"convertUnderlyingSinkAbortCallback");function qx(a,u,m){return it(a,m),()=>L(a,u,[])}o(qx,"convertUnderlyingSinkCloseCallback");function Vx(a,u,m){return it(a,m),S=>N(a,u,[S])}o(Vx,"convertUnderlyingSinkStartCallback");function Hx(a,u,m){return it(a,m),(S,w)=>L(a,u,[S,w])}o(Hx,"convertUnderlyingSinkWriteCallback");function Nm(a,u){if(!Po(a))throw new TypeError(`${u} is not a WritableStream.`)}o(Nm,"assertWritableStream");function Gx(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}o(Gx,"isAbortSignal");let Wx=typeof AbortController=="function";function Zx(){if(Wx)return new AbortController}o(Zx,"createAbortController");class hn{static{o(this,"WritableStream")}constructor(u={},m={}){u===void 0?u=null:Fe(u,"First parameter");let S=Ya(m,"Second parameter"),w=Fx(u,"First parameter");if(Dm(this),w.type!==void 0)throw new RangeError("Invalid type is specified");let F=Ja(S),ne=Si(S,1);uA(this,w,ne,F)}get locked(){if(!Po(this))throw rs("locked");return So(this)}abort(u=void 0){return Po(this)?So(this)?f(new TypeError("Cannot abort a stream that already has a writer")):Xa(this,u):f(rs("abort"))}close(){return Po(this)?So(this)?f(new TypeError("Cannot close a stream that already has a writer")):Tr(this)?f(new TypeError("Cannot close an already-closing stream")):Um(this):f(rs("close"))}getWriter(){if(!Po(this))throw rs("getWriter");return zm(this)}}Object.defineProperties(hn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(hn.prototype.abort,"abort"),i(hn.prototype.close,"close"),i(hn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(hn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function zm(a){return new Gr(a)}o(zm,"AcquireWritableStreamDefaultWriter");function Kx(a,u,m,S,w=1,M=()=>1){let F=Object.create(hn.prototype);Dm(F);let ne=Object.create(Eo.prototype);return qm(F,ne,a,u,m,S,w,M),F}o(Kx,"CreateWritableStream");function Dm(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new W,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}o(Dm,"InitializeWritableStream");function Po(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof hn}o(Po,"IsWritableStream");function So(a){return a._writer!==void 0}o(So,"IsWritableStreamLocked");function Xa(a,u){var m;if(a._state==="closed"||a._state==="errored")return p(void 0);a._writableStreamController._abortReason=u,(m=a._writableStreamController._abortController)===null||m===void 0||m.abort(u);let S=a._state;if(S==="closed"||S==="errored")return p(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let w=!1;S==="erroring"&&(w=!0,u=void 0);let M=l((F,ne)=>{a._pendingAbortRequest={_promise:void 0,_resolve:F,_reject:ne,_reason:u,_wasAlreadyErroring:w}});return a._pendingAbortRequest._promise=M,w||Bc(a,u),M}o(Xa,"WritableStreamAbort");function Um(a){let u=a._state;if(u==="closed"||u==="errored")return f(new TypeError(`The stream (in ${u} state) is not in the writable state and cannot be closed`));let m=l((w,M)=>{let F={_resolve:w,_reject:M};a._closeRequest=F}),S=a._writer;return S!==void 0&&a._backpressure&&u==="writable"&&Jc(S),cA(a._writableStreamController),m}o(Um,"WritableStreamClose");function Jx(a){return l((m,S)=>{let w={_resolve:m,_reject:S};a._writeRequests.push(w)})}o(Jx,"WritableStreamAddWriteRequest");function Fc(a,u){if(a._state==="writable"){Bc(a,u);return}qc(a)}o(Fc,"WritableStreamDealWithRejection");function Bc(a,u){let m=a._writableStreamController;a._state="erroring",a._storedError=u;let S=a._writer;S!==void 0&&jm(S,u),!tA(a)&&m._started&&qc(a)}o(Bc,"WritableStreamStartErroring");function qc(a){a._state="errored",a._writableStreamController[Z]();let u=a._storedError;if(a._writeRequests.forEach(w=>{w._reject(u)}),a._writeRequests=new W,a._pendingAbortRequest===void 0){Qa(a);return}let m=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,m._wasAlreadyErroring){m._reject(u),Qa(a);return}let S=a._writableStreamController[G](m._reason);h(S,()=>(m._resolve(),Qa(a),null),w=>(m._reject(w),Qa(a),null))}o(qc,"WritableStreamFinishErroring");function Yx(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}o(Yx,"WritableStreamFinishInFlightWrite");function Xx(a,u){a._inFlightWriteRequest._reject(u),a._inFlightWriteRequest=void 0,Fc(a,u)}o(Xx,"WritableStreamFinishInFlightWriteWithError");function Qx(a){a._inFlightCloseRequest._resolve(void 0),a._inFlightCloseRequest=void 0,a._state==="erroring"&&(a._storedError=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._resolve(),a._pendingAbortRequest=void 0)),a._state="closed";let m=a._writer;m!==void 0&&Wm(m)}o(Qx,"WritableStreamFinishInFlightClose");function eA(a,u){a._inFlightCloseRequest._reject(u),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(u),a._pendingAbortRequest=void 0),Fc(a,u)}o(eA,"WritableStreamFinishInFlightCloseWithError");function Tr(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Tr,"WritableStreamCloseQueuedOrInFlight");function tA(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}o(tA,"WritableStreamHasOperationMarkedInFlight");function rA(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}o(rA,"WritableStreamMarkCloseRequestInFlight");function nA(a){a._inFlightWriteRequest=a._writeRequests.shift()}o(nA,"WritableStreamMarkFirstWriteRequestInFlight");function Qa(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let u=a._writer;u!==void 0&&Zc(u,a._storedError)}o(Qa,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function Vc(a,u){let m=a._writer;m!==void 0&&u!==a._backpressure&&(u?gA(m):Jc(m)),a._backpressure=u}o(Vc,"WritableStreamUpdateBackpressure");class Gr{static{o(this,"WritableStreamDefaultWriter")}constructor(u){if(qe(u,1,"WritableStreamDefaultWriter"),Nm(u,"First parameter"),So(u))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=u,u._writer=this;let m=u._state;if(m==="writable")!Tr(u)&&u._backpressure?os(this):Zm(this),ns(this);else if(m==="erroring")Kc(this,u._storedError),ns(this);else if(m==="closed")Zm(this),mA(this);else{let S=u._storedError;Kc(this,S),Gm(this,S)}}get closed(){return Zn(this)?this._closedPromise:f(Kn("closed"))}get desiredSize(){if(!Zn(this))throw Kn("desiredSize");if(this._ownerWritableStream===void 0)throw Ti("desiredSize");return sA(this)}get ready(){return Zn(this)?this._readyPromise:f(Kn("ready"))}abort(u=void 0){return Zn(this)?this._ownerWritableStream===void 0?f(Ti("abort")):oA(this,u):f(Kn("abort"))}close(){if(!Zn(this))return f(Kn("close"));let u=this._ownerWritableStream;return u===void 0?f(Ti("close")):Tr(u)?f(new TypeError("Cannot close an already-closing stream")):Mm(this)}releaseLock(){if(!Zn(this))throw Kn("releaseLock");this._ownerWritableStream!==void 0&&Lm(this)}write(u=void 0){return Zn(this)?this._ownerWritableStream===void 0?f(Ti("write to")):Fm(this,u):f(Kn("write"))}}Object.defineProperties(Gr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(Gr.prototype.abort,"abort"),i(Gr.prototype.close,"close"),i(Gr.prototype.releaseLock,"releaseLock"),i(Gr.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Gr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Zn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof Gr}o(Zn,"IsWritableStreamDefaultWriter");function oA(a,u){let m=a._ownerWritableStream;return Xa(m,u)}o(oA,"WritableStreamDefaultWriterAbort");function Mm(a){let u=a._ownerWritableStream;return Um(u)}o(Mm,"WritableStreamDefaultWriterClose");function iA(a){let u=a._ownerWritableStream,m=u._state;return Tr(u)||m==="closed"?p(void 0):m==="errored"?f(u._storedError):Mm(a)}o(iA,"WritableStreamDefaultWriterCloseWithErrorPropagation");function aA(a,u){a._closedPromiseState==="pending"?Zc(a,u):hA(a,u)}o(aA,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function jm(a,u){a._readyPromiseState==="pending"?Km(a,u):yA(a,u)}o(jm,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function sA(a){let u=a._ownerWritableStream,m=u._state;return m==="errored"||m==="erroring"?null:m==="closed"?0:Vm(u._writableStreamController)}o(sA,"WritableStreamDefaultWriterGetDesiredSize");function Lm(a){let u=a._ownerWritableStream,m=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");jm(a,m),aA(a,m),u._writer=void 0,a._ownerWritableStream=void 0}o(Lm,"WritableStreamDefaultWriterRelease");function Fm(a,u){let m=a._ownerWritableStream,S=m._writableStreamController,w=lA(S,u);if(m!==a._ownerWritableStream)return f(Ti("write to"));let M=m._state;if(M==="errored")return f(m._storedError);if(Tr(m)||M==="closed")return f(new TypeError("The stream is closing or closed and cannot be written to"));if(M==="erroring")return f(m._storedError);let F=Jx(m);return dA(S,u,w),F}o(Fm,"WritableStreamDefaultWriterWrite");let Bm={};class Eo{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Hc(this))throw Wc("abortReason");return this._abortReason}get signal(){if(!Hc(this))throw Wc("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(u=void 0){if(!Hc(this))throw Wc("error");this._controlledWritableStream._state==="writable"&&Hm(this,u)}[G](u){let m=this._abortAlgorithm(u);return es(this),m}[Z](){fn(this)}}Object.defineProperties(Eo.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Eo.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Hc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Eo}o(Hc,"IsWritableStreamDefaultController");function qm(a,u,m,S,w,M,F,ne){u._controlledWritableStream=a,a._writableStreamController=u,u._queue=void 0,u._queueTotalSize=void 0,fn(u),u._abortReason=void 0,u._abortController=Zx(),u._started=!1,u._strategySizeAlgorithm=ne,u._strategyHWM=F,u._writeAlgorithm=S,u._closeAlgorithm=w,u._abortAlgorithm=M;let he=Gc(u);Vc(a,he);let le=m(),Ee=p(le);h(Ee,()=>(u._started=!0,ts(u),null),Ce=>(u._started=!0,Fc(a,Ce),null))}o(qm,"SetUpWritableStreamDefaultController");function uA(a,u,m,S){let w=Object.create(Eo.prototype),M,F,ne,he;u.start!==void 0?M=o(()=>u.start(w),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.write!==void 0?F=o(le=>u.write(le,w),"writeAlgorithm"):F=o(()=>p(void 0),"writeAlgorithm"),u.close!==void 0?ne=o(()=>u.close(),"closeAlgorithm"):ne=o(()=>p(void 0),"closeAlgorithm"),u.abort!==void 0?he=o(le=>u.abort(le),"abortAlgorithm"):he=o(()=>p(void 0),"abortAlgorithm"),qm(a,w,M,F,ne,he,m,S)}o(uA,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function es(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(es,"WritableStreamDefaultControllerClearAlgorithms");function cA(a){kc(a,Bm,0),ts(a)}o(cA,"WritableStreamDefaultControllerClose");function lA(a,u){try{return a._strategySizeAlgorithm(u)}catch(m){return Ei(a,m),1}}o(lA,"WritableStreamDefaultControllerGetChunkSize");function Vm(a){return a._strategyHWM-a._queueTotalSize}o(Vm,"WritableStreamDefaultControllerGetDesiredSize");function dA(a,u,m){try{kc(a,u,m)}catch(w){Ei(a,w);return}let S=a._controlledWritableStream;if(!Tr(S)&&S._state==="writable"){let w=Gc(a);Vc(S,w)}ts(a)}o(dA,"WritableStreamDefaultControllerWrite");function ts(a){let u=a._controlledWritableStream;if(!a._started||u._inFlightWriteRequest!==void 0)return;if(u._state==="erroring"){qc(u);return}if(a._queue.length===0)return;let S=xx(a);S===Bm?pA(a):fA(a,S)}o(ts,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Ei(a,u){a._controlledWritableStream._state==="writable"&&Hm(a,u)}o(Ei,"WritableStreamDefaultControllerErrorIfNeeded");function pA(a){let u=a._controlledWritableStream;rA(u),$c(a);let m=a._closeAlgorithm();es(a),h(m,()=>(Qx(u),null),S=>(eA(u,S),null))}o(pA,"WritableStreamDefaultControllerProcessClose");function fA(a,u){let m=a._controlledWritableStream;nA(m);let S=a._writeAlgorithm(u);h(S,()=>{Yx(m);let w=m._state;if($c(a),!Tr(m)&&w==="writable"){let M=Gc(a);Vc(m,M)}return ts(a),null},w=>(m._state==="writable"&&es(a),Xx(m,w),null))}o(fA,"WritableStreamDefaultControllerProcessWrite");function Gc(a){return Vm(a)<=0}o(Gc,"WritableStreamDefaultControllerGetBackpressure");function Hm(a,u){let m=a._controlledWritableStream;es(a),Bc(m,u)}o(Hm,"WritableStreamDefaultControllerError");function rs(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}o(rs,"streamBrandCheckException$2");function Wc(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}o(Wc,"defaultControllerBrandCheckException$2");function Kn(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}o(Kn,"defaultWriterBrandCheckException");function Ti(a){return new TypeError("Cannot "+a+" a stream using a released writer")}o(Ti,"defaultWriterLockException");function ns(a){a._closedPromise=l((u,m)=>{a._closedPromise_resolve=u,a._closedPromise_reject=m,a._closedPromiseState="pending"})}o(ns,"defaultWriterClosedPromiseInitialize");function Gm(a,u){ns(a),Zc(a,u)}o(Gm,"defaultWriterClosedPromiseInitializeAsRejected");function mA(a){ns(a),Wm(a)}o(mA,"defaultWriterClosedPromiseInitializeAsResolved");function Zc(a,u){a._closedPromise_reject!==void 0&&(P(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}o(Zc,"defaultWriterClosedPromiseReject");function hA(a,u){Gm(a,u)}o(hA,"defaultWriterClosedPromiseResetToRejected");function Wm(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="resolved")}o(Wm,"defaultWriterClosedPromiseResolve");function os(a){a._readyPromise=l((u,m)=>{a._readyPromise_resolve=u,a._readyPromise_reject=m}),a._readyPromiseState="pending"}o(os,"defaultWriterReadyPromiseInitialize");function Kc(a,u){os(a),Km(a,u)}o(Kc,"defaultWriterReadyPromiseInitializeAsRejected");function Zm(a){os(a),Jc(a)}o(Zm,"defaultWriterReadyPromiseInitializeAsResolved");function Km(a,u){a._readyPromise_reject!==void 0&&(P(a._readyPromise),a._readyPromise_reject(u),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}o(Km,"defaultWriterReadyPromiseReject");function gA(a){os(a)}o(gA,"defaultWriterReadyPromiseReset");function yA(a,u){Kc(a,u)}o(yA,"defaultWriterReadyPromiseResetToRejected");function Jc(a){a._readyPromise_resolve!==void 0&&(a._readyPromise_resolve(void 0),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="fulfilled")}o(Jc,"defaultWriterReadyPromiseResolve");function _A(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(_A,"getGlobals");let Yc=_A();function vA(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}o(vA,"isDOMExceptionConstructor");function bA(){let a=Yc?.DOMException;return vA(a)?a:void 0}o(bA,"getFromGlobal");function PA(){let a=o(function(m,S){this.message=m||"",this.name=S||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return i(a,"DOMException"),a.prototype=Object.create(Error.prototype),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,configurable:!0}),a}o(PA,"createPolyfill");let SA=bA()||PA();function Jm(a,u,m,S,w,M){let F=j(a),ne=zm(u);a._disturbed=!0;let he=!1,le=p(void 0);return l((Ee,Ce)=>{let We;if(M!==void 0){if(We=o(()=>{let de=M.reason!==void 0?M.reason:new SA("Aborted","AbortError"),Ne=[];S||Ne.push(()=>u._state==="writable"?Xa(u,de):p(void 0)),w||Ne.push(()=>a._state==="readable"?lr(a,de):p(void 0)),It(()=>Promise.all(Ne.map(Ze=>Ze())),!0,de)},"abortAlgorithm"),M.aborted){We();return}M.addEventListener("abort",We)}function dr(){return l((de,Ne)=>{function Ze(Dt){Dt?de():_(wo(),Ze,Ne)}o(Ze,"next"),Ze(!1)})}o(dr,"pipeLoop");function wo(){return he?p(!0):_(ne._readyPromise,()=>l((de,Ne)=>{ue(F,{_chunkSteps:o(Ze=>{le=_(Fm(ne,Ze),void 0,e),de(!1)},"_chunkSteps"),_closeSteps:o(()=>de(!0),"_closeSteps"),_errorSteps:Ne})}))}if(o(wo,"pipeStep"),Zr(a,F._closedPromise,de=>(S?Xt(!0,de):It(()=>Xa(u,de),!0,de),null)),Zr(u,ne._closedPromise,de=>(w?Xt(!0,de):It(()=>lr(a,de),!0,de),null)),Tt(a,F._closedPromise,()=>(m?Xt():It(()=>iA(ne)),null)),Tr(u)||u._state==="closed"){let de=new TypeError("the destination writable stream closed before all data could be piped to it");w?Xt(!0,de):It(()=>lr(a,de),!0,de)}P(dr());function vn(){let de=le;return _(le,()=>de!==le?vn():void 0)}o(vn,"waitForWritesToFinish");function Zr(de,Ne,Ze){de._state==="errored"?Ze(de._storedError):y(Ne,Ze)}o(Zr,"isOrBecomesErrored");function Tt(de,Ne,Ze){de._state==="closed"?Ze():g(Ne,Ze)}o(Tt,"isOrBecomesClosed");function It(de,Ne,Ze){if(he)return;he=!0,u._state==="writable"&&!Tr(u)?g(vn(),Dt):Dt();function Dt(){return h(de(),()=>Kr(Ne,Ze),Io=>Kr(!0,Io)),null}o(Dt,"doTheRest")}o(It,"shutdownWithAction");function Xt(de,Ne){he||(he=!0,u._state==="writable"&&!Tr(u)?g(vn(),()=>Kr(de,Ne)):Kr(de,Ne))}o(Xt,"shutdown");function Kr(de,Ne){return Lm(ne),B(F),M!==void 0&&M.removeEventListener("abort",We),de?Ce(Ne):Ee(void 0),null}o(Kr,"finalize")})}o(Jm,"ReadableStreamPipeTo");class Wr{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!is(this))throw ss("desiredSize");return Xc(this)}close(){if(!is(this))throw ss("close");if(!xo(this))throw new TypeError("The stream is not in a state that permits close");Jn(this)}enqueue(u=void 0){if(!is(this))throw ss("enqueue");if(!xo(this))throw new TypeError("The stream is not in a state that permits enqueue");return To(this,u)}error(u=void 0){if(!is(this))throw ss("error");cr(this,u)}[ee](u){fn(this);let m=this._cancelAlgorithm(u);return as(this),m}[Y](u){let m=this._controlledReadableStream;if(this._queue.length>0){let S=$c(this);this._closeRequested&&this._queue.length===0?(as(this),wi(m)):xi(this),u._chunkSteps(S)}else I(m,u),xi(this)}[Se](){}}Object.defineProperties(Wr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Wr.prototype.close,"close"),i(Wr.prototype.enqueue,"enqueue"),i(Wr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Wr.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function is(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof Wr}o(is,"IsReadableStreamDefaultController");function xi(a){if(!Ym(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let m=a._pullAlgorithm();h(m,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,xi(a)),null),S=>(cr(a,S),null))}o(xi,"ReadableStreamDefaultControllerCallPullIfNeeded");function Ym(a){let u=a._controlledReadableStream;return!xo(a)||!a._started?!1:!!(yn(u)&&U(u)>0||Xc(a)>0)}o(Ym,"ReadableStreamDefaultControllerShouldCallPull");function as(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(as,"ReadableStreamDefaultControllerClearAlgorithms");function Jn(a){if(!xo(a))return;let u=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(as(a),wi(u))}o(Jn,"ReadableStreamDefaultControllerClose");function To(a,u){if(!xo(a))return;let m=a._controlledReadableStream;if(yn(m)&&U(m)>0)O(m,u,!1);else{let S;try{S=a._strategySizeAlgorithm(u)}catch(w){throw cr(a,w),w}try{kc(a,u,S)}catch(w){throw cr(a,w),w}}xi(a)}o(To,"ReadableStreamDefaultControllerEnqueue");function cr(a,u){let m=a._controlledReadableStream;m._state==="readable"&&(fn(a),as(a),th(m,u))}o(cr,"ReadableStreamDefaultControllerError");function Xc(a){let u=a._controlledReadableStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(Xc,"ReadableStreamDefaultControllerGetDesiredSize");function EA(a){return!Ym(a)}o(EA,"ReadableStreamDefaultControllerHasBackpressure");function xo(a){let u=a._controlledReadableStream._state;return!a._closeRequested&&u==="readable"}o(xo,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Xm(a,u,m,S,w,M,F){u._controlledReadableStream=a,u._queue=void 0,u._queueTotalSize=void 0,fn(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=F,u._strategyHWM=M,u._pullAlgorithm=S,u._cancelAlgorithm=w,a._readableStreamController=u;let ne=m();h(p(ne),()=>(u._started=!0,xi(u),null),he=>(cr(u,he),null))}o(Xm,"SetUpReadableStreamDefaultController");function TA(a,u,m,S){let w=Object.create(Wr.prototype),M,F,ne;u.start!==void 0?M=o(()=>u.start(w),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.pull!==void 0?F=o(()=>u.pull(w),"pullAlgorithm"):F=o(()=>p(void 0),"pullAlgorithm"),u.cancel!==void 0?ne=o(he=>u.cancel(he),"cancelAlgorithm"):ne=o(()=>p(void 0),"cancelAlgorithm"),Xm(a,w,M,F,ne,m,S)}o(TA,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function ss(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}o(ss,"defaultControllerBrandCheckException$1");function xA(a,u){return Hn(a._readableStreamController)?wA(a):AA(a)}o(xA,"ReadableStreamTee");function AA(a,u){let m=j(a),S=!1,w=!1,M=!1,F=!1,ne,he,le,Ee,Ce,We=l(Tt=>{Ce=Tt});function dr(){return S?(w=!0,p(void 0)):(S=!0,ue(m,{_chunkSteps:o(It=>{x(()=>{w=!1;let Xt=It,Kr=It;M||To(le._readableStreamController,Xt),F||To(Ee._readableStreamController,Kr),S=!1,w&&dr()})},"_chunkSteps"),_closeSteps:o(()=>{S=!1,M||Jn(le._readableStreamController),F||Jn(Ee._readableStreamController),(!M||!F)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{S=!1},"_errorSteps")}),p(void 0))}o(dr,"pullAlgorithm");function wo(Tt){if(M=!0,ne=Tt,F){let It=Ve([ne,he]),Xt=lr(a,It);Ce(Xt)}return We}o(wo,"cancel1Algorithm");function vn(Tt){if(F=!0,he=Tt,M){let It=Ve([ne,he]),Xt=lr(a,It);Ce(Xt)}return We}o(vn,"cancel2Algorithm");function Zr(){}return o(Zr,"startAlgorithm"),le=Ai(Zr,dr,wo),Ee=Ai(Zr,dr,vn),y(m._closedPromise,Tt=>(cr(le._readableStreamController,Tt),cr(Ee._readableStreamController,Tt),(!M||!F)&&Ce(void 0),null)),[le,Ee]}o(AA,"ReadableStreamDefaultTee");function wA(a){let u=j(a),m=!1,S=!1,w=!1,M=!1,F=!1,ne,he,le,Ee,Ce,We=l(de=>{Ce=de});function dr(de){y(de._closedPromise,Ne=>(de!==u||(Yt(le._readableStreamController,Ne),Yt(Ee._readableStreamController,Ne),(!M||!F)&&Ce(void 0)),null))}o(dr,"forwardReaderError");function wo(){Wn(u)&&(B(u),u=j(a),dr(u)),ue(u,{_chunkSteps:o(Ne=>{x(()=>{S=!1,w=!1;let Ze=Ne,Dt=Ne;if(!M&&!F)try{Dt=gm(Ne)}catch(Io){Yt(le._readableStreamController,Io),Yt(Ee._readableStreamController,Io),Ce(lr(a,Io));return}M||Ga(le._readableStreamController,Ze),F||Ga(Ee._readableStreamController,Dt),m=!1,S?Zr():w&&Tt()})},"_chunkSteps"),_closeSteps:o(()=>{m=!1,M||bi(le._readableStreamController),F||bi(Ee._readableStreamController),le._readableStreamController._pendingPullIntos.length>0&&Wa(le._readableStreamController,0),Ee._readableStreamController._pendingPullIntos.length>0&&Wa(Ee._readableStreamController,0),(!M||!F)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{m=!1},"_errorSteps")})}o(wo,"pullWithDefaultReader");function vn(de,Ne){ie(u)&&(B(u),u=Rm(a),dr(u));let Ze=Ne?Ee:le,Dt=Ne?le:Ee;$m(u,de,1,{_chunkSteps:o(Ro=>{x(()=>{S=!1,w=!1;let Oo=Ne?F:M;if(Ne?M:F)Oo||Za(Ze._readableStreamController,Ro);else{let mh;try{mh=gm(Ro)}catch(nl){Yt(Ze._readableStreamController,nl),Yt(Dt._readableStreamController,nl),Ce(lr(a,nl));return}Oo||Za(Ze._readableStreamController,Ro),Ga(Dt._readableStreamController,mh)}m=!1,S?Zr():w&&Tt()})},"_chunkSteps"),_closeSteps:o(Ro=>{m=!1;let Oo=Ne?F:M,hs=Ne?M:F;Oo||bi(Ze._readableStreamController),hs||bi(Dt._readableStreamController),Ro!==void 0&&(Oo||Za(Ze._readableStreamController,Ro),!hs&&Dt._readableStreamController._pendingPullIntos.length>0&&Wa(Dt._readableStreamController,0)),(!Oo||!hs)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{m=!1},"_errorSteps")})}o(vn,"pullWithBYOBReader");function Zr(){if(m)return S=!0,p(void 0);m=!0;let de=Mc(le._readableStreamController);return de===null?wo():vn(de._view,!1),p(void 0)}o(Zr,"pull1Algorithm");function Tt(){if(m)return w=!0,p(void 0);m=!0;let de=Mc(Ee._readableStreamController);return de===null?wo():vn(de._view,!0),p(void 0)}o(Tt,"pull2Algorithm");function It(de){if(M=!0,ne=de,F){let Ne=Ve([ne,he]),Ze=lr(a,Ne);Ce(Ze)}return We}o(It,"cancel1Algorithm");function Xt(de){if(F=!0,he=de,M){let Ne=Ve([ne,he]),Ze=lr(a,Ne);Ce(Ze)}return We}o(Xt,"cancel2Algorithm");function Kr(){}return o(Kr,"startAlgorithm"),le=eh(Kr,Zr,It),Ee=eh(Kr,Tt,Xt),dr(u),[le,Ee]}o(wA,"ReadableByteStreamTee");function IA(a){return r(a)&&typeof a.getReader<"u"}o(IA,"isReadableStreamLike");function RA(a){return IA(a)?CA(a.getReader()):OA(a)}o(RA,"ReadableStreamFrom");function OA(a){let u,m=hm(a,"async"),S=e;function w(){let F;try{F=Px(m)}catch(he){return f(he)}let ne=p(F);return T(ne,he=>{if(!r(he))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(Sx(he))Jn(u._readableStreamController);else{let Ee=Ex(he);To(u._readableStreamController,Ee)}})}o(w,"pullAlgorithm");function M(F){let ne=m.iterator,he;try{he=qa(ne,"return")}catch(Ce){return f(Ce)}if(he===void 0)return p(void 0);let le;try{le=N(he,ne,[F])}catch(Ce){return f(Ce)}let Ee=p(le);return T(Ee,Ce=>{if(!r(Ce))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(M,"cancelAlgorithm"),u=Ai(S,w,M,0),u}o(OA,"ReadableStreamFromIterable");function CA(a){let u,m=e;function S(){let M;try{M=a.read()}catch(F){return f(F)}return T(M,F=>{if(!r(F))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(F.done)Jn(u._readableStreamController);else{let ne=F.value;To(u._readableStreamController,ne)}})}o(S,"pullAlgorithm");function w(M){try{return p(a.cancel(M))}catch(F){return f(F)}}return o(w,"cancelAlgorithm"),u=Ai(m,S,w,0),u}o(CA,"ReadableStreamFromDefaultReader");function $A(a,u){tt(a,u);let m=a,S=m?.autoAllocateChunkSize,w=m?.cancel,M=m?.pull,F=m?.start,ne=m?.type;return{autoAllocateChunkSize:S===void 0?void 0:R(S,`${u} has member 'autoAllocateChunkSize' that`),cancel:w===void 0?void 0:kA(w,m,`${u} has member 'cancel' that`),pull:M===void 0?void 0:NA(M,m,`${u} has member 'pull' that`),start:F===void 0?void 0:zA(F,m,`${u} has member 'start' that`),type:ne===void 0?void 0:DA(ne,`${u} has member 'type' that`)}}o($A,"convertUnderlyingDefaultOrByteSource");function kA(a,u,m){return it(a,m),S=>L(a,u,[S])}o(kA,"convertUnderlyingSourceCancelCallback");function NA(a,u,m){return it(a,m),S=>L(a,u,[S])}o(NA,"convertUnderlyingSourcePullCallback");function zA(a,u,m){return it(a,m),S=>N(a,u,[S])}o(zA,"convertUnderlyingSourceStartCallback");function DA(a,u){if(a=`${a}`,a!=="bytes")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}o(DA,"convertReadableStreamType");function UA(a,u){return tt(a,u),{preventCancel:!!a?.preventCancel}}o(UA,"convertIteratorOptions");function Qm(a,u){tt(a,u);let m=a?.preventAbort,S=a?.preventCancel,w=a?.preventClose,M=a?.signal;return M!==void 0&&MA(M,`${u} has member 'signal' that`),{preventAbort:!!m,preventCancel:!!S,preventClose:!!w,signal:M}}o(Qm,"convertPipeOptions");function MA(a,u){if(!Gx(a))throw new TypeError(`${u} is not an AbortSignal.`)}o(MA,"assertAbortSignal");function jA(a,u){tt(a,u);let m=a?.readable;v(m,"readable","ReadableWritablePair"),$(m,`${u} has member 'readable' that`);let S=a?.writable;return v(S,"writable","ReadableWritablePair"),Nm(S,`${u} has member 'writable' that`),{readable:m,writable:S}}o(jA,"convertReadableWritablePair");class St{static{o(this,"ReadableStream")}constructor(u={},m={}){u===void 0?u=null:Fe(u,"First parameter");let S=Ya(m,"Second parameter"),w=$A(u,"First parameter");if(Qc(this),w.type==="bytes"){if(S.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let M=Si(S,0);kx(this,w,M)}else{let M=Ja(S),F=Si(S,1);TA(this,w,F,M)}}get locked(){if(!gn(this))throw Yn("locked");return yn(this)}cancel(u=void 0){return gn(this)?yn(this)?f(new TypeError("Cannot cancel a stream that already has a reader")):lr(this,u):f(Yn("cancel"))}getReader(u=void 0){if(!gn(this))throw Yn("getReader");return zx(u,"First parameter").mode===void 0?j(this):Rm(this)}pipeThrough(u,m={}){if(!gn(this))throw Yn("pipeThrough");qe(u,1,"pipeThrough");let S=jA(u,"First parameter"),w=Qm(m,"Second parameter");if(yn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(So(S.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let M=Jm(this,S.writable,w.preventClose,w.preventAbort,w.preventCancel,w.signal);return P(M),S.readable}pipeTo(u,m={}){if(!gn(this))return f(Yn("pipeTo"));if(u===void 0)return f("Parameter 1 is required in 'pipeTo'.");if(!Po(u))return f(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let S;try{S=Qm(m,"Second parameter")}catch(w){return f(w)}return yn(this)?f(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):So(u)?f(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Jm(this,u,S.preventClose,S.preventAbort,S.preventCancel,S.signal)}tee(){if(!gn(this))throw Yn("tee");let u=xA(this);return Ve(u)}values(u=void 0){if(!gn(this))throw Yn("values");let m=UA(u,"First parameter");return yo(this,m.preventCancel)}[Cc](u){return this.values(u)}static from(u){return RA(u)}}Object.defineProperties(St,{from:{enumerable:!0}}),Object.defineProperties(St.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(St.from,"from"),i(St.prototype.cancel,"cancel"),i(St.prototype.getReader,"getReader"),i(St.prototype.pipeThrough,"pipeThrough"),i(St.prototype.pipeTo,"pipeTo"),i(St.prototype.tee,"tee"),i(St.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(St.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(St.prototype,Cc,{value:St.prototype.values,writable:!0,configurable:!0});function Ai(a,u,m,S=1,w=()=>1){let M=Object.create(St.prototype);Qc(M);let F=Object.create(Wr.prototype);return Xm(M,F,a,u,m,S,w),M}o(Ai,"CreateReadableStream");function eh(a,u,m){let S=Object.create(St.prototype);Qc(S);let w=Object.create(Hr.prototype);return Im(S,w,a,u,m,0,void 0),S}o(eh,"CreateReadableByteStream");function Qc(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}o(Qc,"InitializeReadableStream");function gn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof St}o(gn,"IsReadableStream");function yn(a){return a._reader!==void 0}o(yn,"IsReadableStreamLocked");function lr(a,u){if(a._disturbed=!0,a._state==="closed")return p(void 0);if(a._state==="errored")return f(a._storedError);wi(a);let m=a._reader;if(m!==void 0&&Wn(m)){let w=m._readIntoRequests;m._readIntoRequests=new W,w.forEach(M=>{M._closeSteps(void 0)})}let S=a._readableStreamController[ee](u);return T(S,e)}o(lr,"ReadableStreamCancel");function wi(a){a._state="closed";let u=a._reader;if(u!==void 0&&(Be(u),ie(u))){let m=u._readRequests;u._readRequests=new W,m.forEach(S=>{S._closeSteps()})}}o(wi,"ReadableStreamClose");function th(a,u){a._state="errored",a._storedError=u;let m=a._reader;m!==void 0&&(Ae(m,u),ie(m)?Je(m,u):km(m,u))}o(th,"ReadableStreamError");function Yn(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}o(Yn,"streamBrandCheckException$1");function rh(a,u){tt(a,u);let m=a?.highWaterMark;return v(m,"highWaterMark","QueuingStrategyInit"),{highWaterMark:E(m)}}o(rh,"convertQueuingStrategyInit");let nh=o(a=>a.byteLength,"byteLengthSizeFunction");i(nh,"size");class us{static{o(this,"ByteLengthQueuingStrategy")}constructor(u){qe(u,1,"ByteLengthQueuingStrategy"),u=rh(u,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!ih(this))throw oh("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!ih(this))throw oh("size");return nh}}Object.defineProperties(us.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(us.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function oh(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}o(oh,"byteLengthBrandCheckException");function ih(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof us}o(ih,"IsByteLengthQueuingStrategy");let ah=o(()=>1,"countSizeFunction");i(ah,"size");class cs{static{o(this,"CountQueuingStrategy")}constructor(u){qe(u,1,"CountQueuingStrategy"),u=rh(u,"First parameter"),this._countQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!uh(this))throw sh("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!uh(this))throw sh("size");return ah}}Object.defineProperties(cs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(cs.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function sh(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}o(sh,"countBrandCheckException");function uh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof cs}o(uh,"IsCountQueuingStrategy");function LA(a,u){tt(a,u);let m=a?.cancel,S=a?.flush,w=a?.readableType,M=a?.start,F=a?.transform,ne=a?.writableType;return{cancel:m===void 0?void 0:VA(m,a,`${u} has member 'cancel' that`),flush:S===void 0?void 0:FA(S,a,`${u} has member 'flush' that`),readableType:w,start:M===void 0?void 0:BA(M,a,`${u} has member 'start' that`),transform:F===void 0?void 0:qA(F,a,`${u} has member 'transform' that`),writableType:ne}}o(LA,"convertTransformer");function FA(a,u,m){return it(a,m),S=>L(a,u,[S])}o(FA,"convertTransformerFlushCallback");function BA(a,u,m){return it(a,m),S=>N(a,u,[S])}o(BA,"convertTransformerStartCallback");function qA(a,u,m){return it(a,m),(S,w)=>L(a,u,[S,w])}o(qA,"convertTransformerTransformCallback");function VA(a,u,m){return it(a,m),S=>L(a,u,[S])}o(VA,"convertTransformerCancelCallback");class ls{static{o(this,"TransformStream")}constructor(u={},m={},S={}){u===void 0&&(u=null);let w=Ya(m,"Second parameter"),M=Ya(S,"Third parameter"),F=LA(u,"First parameter");if(F.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(F.writableType!==void 0)throw new RangeError("Invalid writableType specified");let ne=Si(M,0),he=Ja(M),le=Si(w,1),Ee=Ja(w),Ce,We=l(dr=>{Ce=dr});HA(this,We,le,Ee,ne,he),WA(this,F),F.start!==void 0?Ce(F.start(this._transformStreamController)):Ce(void 0)}get readable(){if(!ch(this))throw fh("readable");return this._readable}get writable(){if(!ch(this))throw fh("writable");return this._writable}}Object.defineProperties(ls.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ls.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function HA(a,u,m,S,w,M){function F(){return u}o(F,"startAlgorithm");function ne(We){return JA(a,We)}o(ne,"writeAlgorithm");function he(We){return YA(a,We)}o(he,"abortAlgorithm");function le(){return XA(a)}o(le,"closeAlgorithm"),a._writable=Kx(F,ne,le,he,m,S);function Ee(){return QA(a)}o(Ee,"pullAlgorithm");function Ce(We){return ew(a,We)}o(Ce,"cancelAlgorithm"),a._readable=Ai(F,Ee,Ce,w,M),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,ds(a,!0),a._transformStreamController=void 0}o(HA,"InitializeTransformStream");function ch(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof ls}o(ch,"IsTransformStream");function lh(a,u){cr(a._readable._readableStreamController,u),el(a,u)}o(lh,"TransformStreamError");function el(a,u){fs(a._transformStreamController),Ei(a._writable._writableStreamController,u),tl(a)}o(el,"TransformStreamErrorWritableAndUnblockWrite");function tl(a){a._backpressure&&ds(a,!1)}o(tl,"TransformStreamUnblockWrite");function ds(a,u){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=l(m=>{a._backpressureChangePromise_resolve=m}),a._backpressure=u}o(ds,"TransformStreamSetBackpressure");class _n{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ps(this))throw ms("desiredSize");let u=this._controlledTransformStream._readable._readableStreamController;return Xc(u)}enqueue(u=void 0){if(!ps(this))throw ms("enqueue");dh(this,u)}error(u=void 0){if(!ps(this))throw ms("error");ZA(this,u)}terminate(){if(!ps(this))throw ms("terminate");KA(this)}}Object.defineProperties(_n.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(_n.prototype.enqueue,"enqueue"),i(_n.prototype.error,"error"),i(_n.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(_n.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function ps(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof _n}o(ps,"IsTransformStreamDefaultController");function GA(a,u,m,S,w){u._controlledTransformStream=a,a._transformStreamController=u,u._transformAlgorithm=m,u._flushAlgorithm=S,u._cancelAlgorithm=w,u._finishPromise=void 0,u._finishPromise_resolve=void 0,u._finishPromise_reject=void 0}o(GA,"SetUpTransformStreamDefaultController");function WA(a,u){let m=Object.create(_n.prototype),S,w,M;u.transform!==void 0?S=o(F=>u.transform(F,m),"transformAlgorithm"):S=o(F=>{try{return dh(m,F),p(void 0)}catch(ne){return f(ne)}},"transformAlgorithm"),u.flush!==void 0?w=o(()=>u.flush(m),"flushAlgorithm"):w=o(()=>p(void 0),"flushAlgorithm"),u.cancel!==void 0?M=o(F=>u.cancel(F),"cancelAlgorithm"):M=o(()=>p(void 0),"cancelAlgorithm"),GA(a,m,S,w,M)}o(WA,"SetUpTransformStreamDefaultControllerFromTransformer");function fs(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}o(fs,"TransformStreamDefaultControllerClearAlgorithms");function dh(a,u){let m=a._controlledTransformStream,S=m._readable._readableStreamController;if(!xo(S))throw new TypeError("Readable side is not in a state that permits enqueue");try{To(S,u)}catch(M){throw el(m,M),m._readable._storedError}EA(S)!==m._backpressure&&ds(m,!0)}o(dh,"TransformStreamDefaultControllerEnqueue");function ZA(a,u){lh(a._controlledTransformStream,u)}o(ZA,"TransformStreamDefaultControllerError");function ph(a,u){let m=a._transformAlgorithm(u);return T(m,void 0,S=>{throw lh(a._controlledTransformStream,S),S})}o(ph,"TransformStreamDefaultControllerPerformTransform");function KA(a){let u=a._controlledTransformStream,m=u._readable._readableStreamController;Jn(m);let S=new TypeError("TransformStream terminated");el(u,S)}o(KA,"TransformStreamDefaultControllerTerminate");function JA(a,u){let m=a._transformStreamController;if(a._backpressure){let S=a._backpressureChangePromise;return T(S,()=>{let w=a._writable;if(w._state==="erroring")throw w._storedError;return ph(m,u)})}return ph(m,u)}o(JA,"TransformStreamDefaultSinkWriteAlgorithm");function YA(a,u){let m=a._transformStreamController;if(m._finishPromise!==void 0)return m._finishPromise;let S=a._readable;m._finishPromise=l((M,F)=>{m._finishPromise_resolve=M,m._finishPromise_reject=F});let w=m._cancelAlgorithm(u);return fs(m),h(w,()=>(S._state==="errored"?Ao(m,S._storedError):(cr(S._readableStreamController,u),rl(m)),null),M=>(cr(S._readableStreamController,M),Ao(m,M),null)),m._finishPromise}o(YA,"TransformStreamDefaultSinkAbortAlgorithm");function XA(a){let u=a._transformStreamController;if(u._finishPromise!==void 0)return u._finishPromise;let m=a._readable;u._finishPromise=l((w,M)=>{u._finishPromise_resolve=w,u._finishPromise_reject=M});let S=u._flushAlgorithm();return fs(u),h(S,()=>(m._state==="errored"?Ao(u,m._storedError):(Jn(m._readableStreamController),rl(u)),null),w=>(cr(m._readableStreamController,w),Ao(u,w),null)),u._finishPromise}o(XA,"TransformStreamDefaultSinkCloseAlgorithm");function QA(a){return ds(a,!1),a._backpressureChangePromise}o(QA,"TransformStreamDefaultSourcePullAlgorithm");function ew(a,u){let m=a._transformStreamController;if(m._finishPromise!==void 0)return m._finishPromise;let S=a._writable;m._finishPromise=l((M,F)=>{m._finishPromise_resolve=M,m._finishPromise_reject=F});let w=m._cancelAlgorithm(u);return fs(m),h(w,()=>(S._state==="errored"?Ao(m,S._storedError):(Ei(S._writableStreamController,u),tl(a),rl(m)),null),M=>(Ei(S._writableStreamController,M),tl(a),Ao(m,M),null)),m._finishPromise}o(ew,"TransformStreamDefaultSourceCancelAlgorithm");function ms(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}o(ms,"defaultControllerBrandCheckException");function rl(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(rl,"defaultControllerFinishPromiseResolve");function Ao(a,u){a._finishPromise_reject!==void 0&&(P(a._finishPromise),a._finishPromise_reject(u),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Ao,"defaultControllerFinishPromiseReject");function fh(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}o(fh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=us,t.CountQueuingStrategy=cs,t.ReadableByteStreamController=Hr,t.ReadableStream=St,t.ReadableStreamBYOBReader=mn,t.ReadableStreamBYOBRequest=Vn,t.ReadableStreamDefaultController=Wr,t.ReadableStreamDefaultReader=V,t.TransformStream=ls,t.TransformStreamDefaultController=_n,t.WritableStream=hn,t.WritableStreamDefaultController=Eo,t.WritableStreamDefaultWriter=Gr}))});var jb=k(()=>{if(!globalThis.ReadableStream)try{let t=require("node:process"),{emitWarning:e}=t;try{t.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),t.emitWarning=e}catch(r){throw t.emitWarning=e,r}}catch{Object.assign(globalThis,Mb())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=o(function(r){let n=0,i=this;return new ReadableStream({type:"bytes",async pull(s){let d=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=d.byteLength,s.enqueue(new Uint8Array(d)),n===i.size&&s.close()}})},"name"))}catch{}});async function*Sd(t,e=!0){for(let r of t)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let n=r.byteOffset,i=r.byteOffset+r.byteLength;for(;n!==i;){let s=Math.min(i-n,Lb),c=r.buffer.slice(n,n+s);n+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let n=0,i=r;for(;n!==i.size;){let c=await i.slice(n,Math.min(i.size,n+Lb)).arrayBuffer();n+=c.byteLength,yield new Uint8Array(c)}}}var t5,Lb,Fb,N0,hr,na=gt(()=>{t5=ft(jb(),1);Lb=65536;o(Sd,"toIterator");Fb=class Ed{static{o(this,"Blob")}#e=[];#t="";#r=0;#n="transparent";constructor(e=[],r={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let n=new TextEncoder;for(let s of e){let c;ArrayBuffer.isView(s)?c=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?c=new Uint8Array(s.slice(0)):s instanceof Ed?c=s:c=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of Sd(this.#e,!1))r+=e.decode(n,{stream:!0});return r+=e.decode(),r}async arrayBuffer(){let e=new Uint8Array(this.size),r=0;for await(let n of Sd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Sd(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let n=await e.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,n=""){let{size:i}=this,s=e<0?Math.max(i+e,0):Math.min(e,i),c=r<0?Math.max(i+r,0):Math.min(r,i),d=Math.max(c-s,0),l=this.#e,p=[],f=0;for(let h of l){if(f>=d)break;let g=ArrayBuffer.isView(h)?h.byteLength:h.size;if(s&&g<=s)s-=g,c-=g;else{let y;ArrayBuffer.isView(h)?(y=h.subarray(s,Math.min(g,c)),f+=y.byteLength):(y=h.slice(s,Math.min(g,c)),f+=y.size),c-=g,p.push(y),s=0}}let _=new Ed([],{type:String(n).toLowerCase()});return _.#r=d,_.#e=p,_}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}};Object.defineProperties(Fb.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});N0=Fb,hr=N0});var z0,D0,zn,Td=gt(()=>{na();z0=class extends hr{static{o(this,"File")}#e=0;#t="";constructor(e,r,n={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,n),n===null&&(n={});let i=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(i)||(this.#e=i),this.#t=String(r)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof hr&&/^(File)$/.test(e[Symbol.toStringTag])}},D0=z0,zn=D0});function Vb(t,e=hr){var r=`${Bb()}${Bb()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
15
15
  Content-Disposition: form-data; name="`;return t.forEach((s,c)=>typeof s=="string"?n.push(i+xd(c)+`"\r
16
16
  \r
17
17
  ${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
@@ -20,53 +20,53 @@ ${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
20
20
  Content-Type: ${s.type||"application/octet-stream"}\r
21
21
  \r
22
22
  `,s,`\r
23
- `)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var oa,z0,D0,Fb,U0,Bb,xd,no,Dn,au=gt(()=>{na();Td();({toStringTag:oa,iterator:z0,hasInstance:D0}=Symbol),Fb=Math.random,U0="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),Bb=o((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[oa])?[(r=r!==void 0?r+"":e[oa]=="File"?e.name:"blob",t),e.name!==r||e[oa]=="blob"?new zn([e],r,e):e]:[t,e+""]),"f"),xd=o((t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r
24
- `)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),no=o((t,e,r)=>{if(e.length<r)throw new TypeError(`Failed to execute '${t}' on 'FormData': ${r} arguments required, but only ${e.length} present.`)},"x"),Dn=class{static{o(this,"FormData")}#e=[];constructor(...e){if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[oa](){return"FormData"}[z0](){return this.entries()}static[D0](e){return e&&typeof e=="object"&&e[oa]==="FormData"&&!U0.some(r=>typeof e[r]!="function")}append(...e){no("append",arguments,2),this.#e.push(Bb(...e))}delete(e){no("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){no("get",arguments,1),e+="";for(var r=this.#e,n=r.length,i=0;i<n;i++)if(r[i][0]===e)return r[i][1];return null}getAll(e,r){return no("getAll",arguments,1),r=[],e+="",this.#e.forEach(n=>n[0]===e&&r.push(n[1])),r}has(e){return no("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){no("forEach",arguments,1);for(var[n,i]of this)e.call(r,i,n,this)}set(...e){no("set",arguments,2);var r=[],n=!0;e=Bb(...e),this.#e.forEach(i=>{i[0]===e[0]?n&&(n=!r.push(e)):r.push(i)}),n&&r.push(e),this.#e=r}*entries(){yield*this.#e}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}};o(qb,"formDataToBlob")});var rn,su=gt(()=>{rn=class extends Error{static{o(this,"FetchBaseError")}constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var At,Ad=gt(()=>{su();At=class extends rn{static{o(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var uu,wd,ia,Vb,Hb,Gb,cu=gt(()=>{uu=Symbol.toStringTag,wd=o(t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[uu]==="URLSearchParams","isURLSearchParameters"),ia=o(t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[uu]),"isBlob"),Vb=o(t=>typeof t=="object"&&(t[uu]==="AbortSignal"||t[uu]==="EventTarget"),"isAbortSignal"),Hb=o((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),Gb=o((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var Zb=k((g5,Wb)=>{if(!globalThis.DOMException)try{let{MessageChannel:t}=require("worker_threads"),e=new t().port1,r=new ArrayBuffer;e.postMessage(r,[r,r])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}Wb.exports=globalThis.DOMException});var oo,Kb,Jb,Id,Yb,Xb,Qb,eP,tP,rP,lu,Rd=gt(()=>{oo=require("node:fs"),Kb=require("node:path"),Jb=pt(Zb(),1);Td();na();({stat:Id}=oo.promises),Yb=o((t,e)=>tP((0,oo.statSync)(t),t,e),"blobFromSync"),Xb=o((t,e)=>Id(t).then(r=>tP(r,t,e)),"blobFrom"),Qb=o((t,e)=>Id(t).then(r=>rP(r,t,e)),"fileFrom"),eP=o((t,e)=>rP((0,oo.statSync)(t),t,e),"fileFromSync"),tP=o((t,e,r="")=>new hr([new lu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),rP=o((t,e,r="")=>new zn([new lu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,Kb.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),lu=class t{static{o(this,"BlobDataItem")}#e;#t;constructor(e){this.#e=e.path,this.#t=e.start,this.size=e.size,this.lastModified=e.lastModified}slice(e,r){return new t({path:this.#e,lastModified:this.lastModified,size:r-e,start:this.#t+e})}async*stream(){let{mtimeMs:e}=await Id(this.#e);if(e>this.lastModified)throw new Jb.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,oo.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var oP={};gs(oP,{toFormData:()=>V0});function q0(t){let e=t.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let r=e[2]||e[3]||"",n=r.slice(r.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,(i,s)=>String.fromCharCode(s)),n}async function V0(t,e){if(!/multipart/i.test(e))throw new TypeError("Failed to fetch");let r=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new TypeError("no or bad content-type header, no multipart boundary");let n=new Od(r[1]||r[2]),i,s,c,d,l,p,f=[],_=new Dn,h=o(x=>{c+=P.decode(x,{stream:!0})},"onPartData"),g=o(x=>{f.push(x)},"appendToFile"),y=o(()=>{let x=new zn(f,p,{type:l});_.append(d,x)},"appendFileToFormData"),T=o(()=>{_.append(d,c)},"appendEntryToFormData"),P=new TextDecoder("utf-8");P.decode(),n.onPartBegin=function(){n.onPartData=h,n.onPartEnd=T,i="",s="",c="",d="",l="",p=null,f.length=0},n.onHeaderField=function(x){i+=P.decode(x,{stream:!0})},n.onHeaderValue=function(x){s+=P.decode(x,{stream:!0})},n.onHeaderEnd=function(){if(s+=P.decode(),i=i.toLowerCase(),i==="content-disposition"){let x=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);x&&(d=x[2]||x[3]||""),p=q0(s),p&&(n.onPartData=g,n.onPartEnd=y)}else i==="content-type"&&(l=s);s="",i=""};for await(let x of t)n.write(x);return n.end(),_}var Rr,Ke,nP,Un,du,pu,M0,aa,j0,L0,F0,B0,io,Od,iP=gt(()=>{Rd();au();Rr=0,Ke={START_BOUNDARY:Rr++,HEADER_FIELD_START:Rr++,HEADER_FIELD:Rr++,HEADER_VALUE_START:Rr++,HEADER_VALUE:Rr++,HEADER_VALUE_ALMOST_DONE:Rr++,HEADERS_ALMOST_DONE:Rr++,PART_DATA_START:Rr++,PART_DATA:Rr++,END:Rr++},nP=1,Un={PART_BOUNDARY:nP,LAST_BOUNDARY:nP*=2},du=10,pu=13,M0=32,aa=45,j0=58,L0=97,F0=122,B0=o(t=>t|32,"lower"),io=o(()=>{},"noop"),Od=class{static{o(this,"MultipartParser")}constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=io,this.onHeaderField=io,this.onHeadersEnd=io,this.onHeaderValue=io,this.onPartBegin=io,this.onPartData=io,this.onPartEnd=io,this.boundaryChars={},e=`\r
25
- --`+e;let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n),this.boundaryChars[r[n]]=!0;this.boundary=r,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=Ke.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:s,boundary:c,boundaryChars:d,index:l,state:p,flags:f}=this,_=this.boundary.length,h=_-1,g=e.length,y,T,P=o(X=>{this[X+"Mark"]=r},"mark"),x=o(X=>{delete this[X+"Mark"]},"clear"),N=o((X,W,G,Z)=>{(W===void 0||W!==G)&&this[X](Z&&Z.subarray(W,G))},"callback"),L=o((X,W)=>{let G=X+"Mark";G in this&&(W?(N(X,this[G],r,e),delete this[G]):(N(X,this[G],e.length,e),this[G]=0))},"dataCallback");for(r=0;r<n;r++)switch(y=e[r],p){case Ke.START_BOUNDARY:if(l===c.length-2){if(y===aa)f|=Un.LAST_BOUNDARY;else if(y!==pu)return;l++;break}else if(l-1===c.length-2){if(f&Un.LAST_BOUNDARY&&y===aa)p=Ke.END,f=0;else if(!(f&Un.LAST_BOUNDARY)&&y===du)l=0,N("onPartBegin"),p=Ke.HEADER_FIELD_START;else return;break}y!==c[l+2]&&(l=-2),y===c[l+2]&&l++;break;case Ke.HEADER_FIELD_START:p=Ke.HEADER_FIELD,P("onHeaderField"),l=0;case Ke.HEADER_FIELD:if(y===pu){x("onHeaderField"),p=Ke.HEADERS_ALMOST_DONE;break}if(l++,y===aa)break;if(y===j0){if(l===1)return;L("onHeaderField",!0),p=Ke.HEADER_VALUE_START;break}if(T=B0(y),T<L0||T>F0)return;break;case Ke.HEADER_VALUE_START:if(y===M0)break;P("onHeaderValue"),p=Ke.HEADER_VALUE;case Ke.HEADER_VALUE:y===pu&&(L("onHeaderValue",!0),N("onHeaderEnd"),p=Ke.HEADER_VALUE_ALMOST_DONE);break;case Ke.HEADER_VALUE_ALMOST_DONE:if(y!==du)return;p=Ke.HEADER_FIELD_START;break;case Ke.HEADERS_ALMOST_DONE:if(y!==du)return;N("onHeadersEnd"),p=Ke.PART_DATA_START;break;case Ke.PART_DATA_START:p=Ke.PART_DATA,P("onPartData");case Ke.PART_DATA:if(i=l,l===0){for(r+=h;r<g&&!(e[r]in d);)r+=_;r-=h,y=e[r]}if(l<c.length)c[l]===y?(l===0&&L("onPartData",!0),l++):l=0;else if(l===c.length)l++,y===pu?f|=Un.PART_BOUNDARY:y===aa?f|=Un.LAST_BOUNDARY:l=0;else if(l-1===c.length)if(f&Un.PART_BOUNDARY){if(l=0,y===du){f&=~Un.PART_BOUNDARY,N("onPartEnd"),N("onPartBegin"),p=Ke.HEADER_FIELD_START;break}}else f&Un.LAST_BOUNDARY&&y===aa?(N("onPartEnd"),p=Ke.END,f=0):l=0;if(l>0)s[l-1]=y;else if(i>0){let X=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);N("onPartData",0,i,X),i=0,P("onPartData"),r--}break;case Ke.END:break;default:throw new Error(`Unexpected state entered: ${p}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=l,this.state=p,this.flags=f}end(){if(this.state===Ke.HEADER_FIELD_START&&this.index===0||this.state===Ke.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Ke.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o(q0,"_fileName");o(V0,"toFormData")});async function Cd(t){if(t[$t].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[$t].disturbed=!0,t[$t].error)throw t[$t].error;let{body:e}=t;if(e===null)return Lt.Buffer.alloc(0);if(!(e instanceof nr.default))return Lt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let s=new At(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}n+=i.length,r.push(i)}}catch(i){throw i instanceof rn?i:new At(`Invalid response body while trying to fetch ${t.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(i=>typeof i=="string")?Lt.Buffer.from(r.join("")):Lt.Buffer.concat(r,n)}catch(i){throw new At(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new At(`Premature close of server response while trying to fetch ${t.url}`)}var nr,nn,Lt,H0,$t,Or,Ko,G0,fu,aP,sP,mu=gt(()=>{nr=pt(require("node:stream"),1),nn=require("node:util"),Lt=require("node:buffer");na();au();Ad();su();cu();H0=(0,nn.promisify)(nr.default.pipeline),$t=Symbol("Body internals"),Or=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:wd(e)?e=Lt.Buffer.from(e.toString()):ia(e)||Lt.Buffer.isBuffer(e)||(nn.types.isAnyArrayBuffer(e)?e=Lt.Buffer.from(e):ArrayBuffer.isView(e)?e=Lt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof nr.default||(e instanceof Dn?(e=qb(e),n=e.type.split("=")[1]):e=Lt.Buffer.from(String(e))));let i=e;Lt.Buffer.isBuffer(e)?i=nr.default.Readable.from(e):ia(e)&&(i=nr.default.Readable.from(e.stream())),this[$t]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof nr.default&&e.on("error",s=>{let c=s instanceof rn?s:new At(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[$t].error=c})}get body(){return this[$t].stream}get bodyUsed(){return this[$t].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await Cd(this);return e.slice(r,r+n)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let n=new Dn,i=new URLSearchParams(await this.text());for(let[s,c]of i)n.append(s,c);return n}let{toFormData:r}=await Promise.resolve().then(()=>(iP(),oP));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[$t].body&&this[$t].body.type||"",r=await this.arrayBuffer();return new hr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await Cd(this);return new TextDecoder().decode(e)}buffer(){return Cd(this)}};Or.prototype.buffer=(0,nn.deprecate)(Or.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Or.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,nn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(Cd,"consumeBody");Ko=o((t,e)=>{let r,n,{body:i}=t[$t];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof nr.default&&typeof i.getBoundary!="function"&&(r=new nr.PassThrough({highWaterMark:e}),n=new nr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[$t].stream=r,i=n),i},"clone"),G0=(0,nn.deprecate)(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),fu=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":wd(t)?"application/x-www-form-urlencoded;charset=UTF-8":ia(t)?t.type||null:Lt.Buffer.isBuffer(t)||nn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Dn?`multipart/form-data; boundary=${e[$t].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${G0(t)}`:t instanceof nr.default?null:"text/plain;charset=UTF-8","extractContentType"),aP=o(t=>{let{body:e}=t[$t];return e===null?0:ia(e)?e.size:Lt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),sP=o(async(t,{body:e})=>{e===null?t.end():await H0(e,t)},"writeToStream")});function uP(t=[]){return new kt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return hu(e),kd(e,String(r)),!0}catch{return!1}}))}var $d,sa,hu,kd,kt,gu=gt(()=>{$d=require("node:util"),sa=pt(require("node:http"),1),hu=typeof sa.default.validateHeaderName=="function"?sa.default.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},kd=typeof sa.default.validateHeaderValue=="function"?sa.default.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},kt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,s]of Object.entries(n))r.push(...s.map(c=>[i,c]))}else if(e!=null)if(typeof e=="object"&&!$d.types.isBoxedPrimitive(e)){let n=e[Symbol.iterator];if(n==null)r.push(...Object.entries(e));else{if(typeof n!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(i=>{if(typeof i!="object"||$d.types.isBoxedPrimitive(i))throw new TypeError("Each header pair must be an iterable object");return[...i]}).map(i=>{if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...i]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([n,i])=>(hu(n),kd(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,s){switch(i){case"append":case"set":return(c,d)=>(hu(c),kd(c,String(d)),URLSearchParams.prototype[i].call(n,String(c).toLowerCase(),String(d)));case"delete":case"has":case"getAll":return c=>(hu(c),URLSearchParams.prototype[i].call(n,String(c).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(kt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(uP,"fromRawHeaders")});var W0,ua,Nd=gt(()=>{W0=new Set([301,302,303,307,308]),ua=o(t=>W0.has(t),"isRedirect")});var gr,Ft,cP=gt(()=>{gu();mu();Nd();gr=Symbol("Response internals"),Ft=class t extends Or{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new kt(r.headers);if(e!==null&&!i.has("Content-Type")){let s=fu(e,this);s&&i.append("Content-Type",s)}this[gr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[gr].type}get url(){return this[gr].url||""}get status(){return this[gr].status}get ok(){return this[gr].status>=200&&this[gr].status<300}get redirected(){return this[gr].counter>0}get statusText(){return this[gr].statusText}get headers(){return this[gr].headers}get highWaterMark(){return this[gr].highWaterMark}clone(){return new t(Ko(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!ua(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new t(null,{status:0,statusText:""});return e[gr].type="error",e}static json(e=void 0,r={}){let n=JSON.stringify(e);if(n===void 0)throw new TypeError("data is not JSON serializable");let i=new kt(r&&r.headers);return i.has("content-type")||i.set("content-type","application/json"),new t(n,{...r,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Ft.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var lP,dP=gt(()=>{lP=o(t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""},"getSearch")});function pP(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}function gP(t){if(!mP.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function Z0(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,fP.isIP)(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function Jo(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:Z0(t)}function yP(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let n=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,s=pP(i),c=pP(i,!0);s.toString().length>4096&&(s=c),e&&(s=e(s)),r&&(c=r(c));let d=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return s;case"strict-origin":return Jo(s)&&!Jo(d)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return s.origin===d.origin?s:Jo(s)&&!Jo(d)?"no-referrer":c;case"same-origin":return s.origin===d.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===d.origin?s:c;case"no-referrer-when-downgrade":return Jo(s)&&!Jo(d)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function _P(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&mP.has(n)&&(r=n);return r}var fP,mP,hP,zd=gt(()=>{fP=require("node:net");o(pP,"stripURLForUseAsAReferrer");mP=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),hP="strict-origin-when-cross-origin";o(gP,"validateReferrerPolicy");o(Z0,"isOriginPotentiallyTrustworthy");o(Jo,"isUrlPotentiallyTrustworthy");o(yP,"determineRequestsReferrer");o(_P,"parseReferrerPolicyFromHeader")});var vP,bP,bt,ca,K0,Mn,PP,SP=gt(()=>{vP=require("node:url"),bP=require("node:util");gu();mu();cu();dP();zd();bt=Symbol("Request internals"),ca=o(t=>typeof t=="object"&&typeof t[bt]=="object","isRequest"),K0=(0,bP.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Mn=class t extends Or{static{o(this,"Request")}constructor(e,r={}){let n;if(ca(e)?n=new URL(e.url):(n=new URL(e),e={}),n.username!==""||n.password!=="")throw new TypeError(`${n} is an url with embedded credentials.`);let i=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!ca(r)&&"data"in r&&K0(),(r.body!=null||ca(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:ca(e)&&e.body!==null?Ko(e):null;super(s,{size:r.size||e.size||0});let c=new kt(r.headers||e.headers||{});if(s!==null&&!c.has("Content-Type")){let p=fu(s,this);p&&c.set("Content-Type",p)}let d=ca(e)?e.signal:null;if("signal"in r&&(d=r.signal),d!=null&&!Vb(d))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let l=r.referrer==null?e.referrer:r.referrer;if(l==="")l="no-referrer";else if(l){let p=new URL(l);l=/^about:(\/\/)?client$/.test(p)?"client":p}else l=void 0;this[bt]={method:i,redirect:r.redirect||e.redirect||"follow",headers:c,parsedURL:n,signal:d,referrer:l},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[bt].method}get url(){return(0,vP.format)(this[bt].parsedURL)}get headers(){return this[bt].headers}get redirect(){return this[bt].redirect}get signal(){return this[bt].signal}get referrer(){if(this[bt].referrer==="no-referrer")return"";if(this[bt].referrer==="client")return"about:client";if(this[bt].referrer)return this[bt].referrer.toString()}get referrerPolicy(){return this[bt].referrerPolicy}set referrerPolicy(e){this[bt].referrerPolicy=gP(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Mn.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});PP=o(t=>{let{parsedURL:e}=t[bt],r=new kt(t[bt].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(n="0"),t.body!==null){let d=aP(t);typeof d=="number"&&!Number.isNaN(d)&&(n=String(d))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=hP),t.referrer&&t.referrer!=="no-referrer"?t[bt].referrer=yP(t):t[bt].referrer="no-referrer",t[bt].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=t;typeof i=="function"&&(i=i(e));let s=lP(e),c={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:c}},"getNodeRequestOptions")});var la,EP=gt(()=>{su();la=class extends rn{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var AP={};gs(AP,{AbortError:()=>la,Blob:()=>hr,FetchError:()=>At,File:()=>zn,FormData:()=>Dn,Headers:()=>kt,Request:()=>Mn,Response:()=>Ft,blobFrom:()=>Xb,blobFromSync:()=>Yb,default:()=>Dd,fileFrom:()=>Qb,fileFromSync:()=>eP,isRedirect:()=>ua});async function Dd(t,e){return new Promise((r,n)=>{let i=new Mn(t,e),{parsedURL:s,options:c}=PP(i);if(!J0.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let y=Nb(i.url),T=new Ft(y,{headers:{"Content-Type":y.typeFull}});r(T);return}let d=(s.protocol==="https:"?xP.default:TP.default).request,{signal:l}=i,p=null,f=o(()=>{let y=new la("The operation was aborted.");n(y),i.body&&i.body instanceof Bt.default.Readable&&i.body.destroy(y),!(!p||!p.body)&&p.body.emit("error",y)},"abort");if(l&&l.aborted){f();return}let _=o(()=>{f(),g()},"abortAndFinalize"),h=d(s.toString(),c);l&&l.addEventListener("abort",_);let g=o(()=>{h.abort(),l&&l.removeEventListener("abort",_)},"finalize");h.on("error",y=>{n(new At(`request to ${i.url} failed, reason: ${y.message}`,"system",y)),g()}),Y0(h,y=>{p&&p.body&&p.body.destroy(y)}),process.version<"v14"&&h.on("socket",y=>{let T;y.prependListener("end",()=>{T=y._eventsCount}),y.prependListener("close",P=>{if(p&&T<y._eventsCount&&!P){let x=new Error("Premature close");x.code="ERR_STREAM_PREMATURE_CLOSE",p.body.emit("error",x)}})}),h.on("response",y=>{h.setTimeout(0);let T=uP(y.rawHeaders);if(ua(y.statusCode)){let X=T.get("Location"),W=null;try{W=X===null?null:new URL(X,i.url)}catch{if(i.redirect!=="manual"){n(new At(`uri requested responds with an invalid redirect URL: ${X}`,"invalid-redirect")),g();return}}switch(i.redirect){case"error":n(new At(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),g();return;case"manual":break;case"follow":{if(W===null)break;if(i.counter>=i.follow){n(new At(`maximum redirect reached at: ${i.url}`,"max-redirect")),g();return}let G={headers:new kt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:Ko(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!Hb(i.url,W)||!Gb(i.url,W))for(let ee of["authorization","www-authenticate","cookie","cookie2"])G.headers.delete(ee);if(y.statusCode!==303&&i.body&&e.body instanceof Bt.default.Readable){n(new At("Cannot follow redirect with body being a readable stream","unsupported-redirect")),g();return}(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&i.method==="POST")&&(G.method="GET",G.body=void 0,G.headers.delete("content-length"));let Z=_P(T);Z&&(G.referrerPolicy=Z),r(Dd(new Mn(W,G))),g();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}l&&y.once("end",()=>{l.removeEventListener("abort",_)});let P=(0,Bt.pipeline)(y,new Bt.PassThrough,X=>{X&&n(X)});process.version<"v12.10"&&y.on("aborted",_);let x={url:i.url,status:y.statusCode,statusText:y.statusMessage,headers:T,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},N=T.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||N===null||y.statusCode===204||y.statusCode===304){p=new Ft(P,x),r(p);return}let L={flush:ao.default.Z_SYNC_FLUSH,finishFlush:ao.default.Z_SYNC_FLUSH};if(N==="gzip"||N==="x-gzip"){P=(0,Bt.pipeline)(P,ao.default.createGunzip(L),X=>{X&&n(X)}),p=new Ft(P,x),r(p);return}if(N==="deflate"||N==="x-deflate"){let X=(0,Bt.pipeline)(y,new Bt.PassThrough,W=>{W&&n(W)});X.once("data",W=>{(W[0]&15)===8?P=(0,Bt.pipeline)(P,ao.default.createInflate(),G=>{G&&n(G)}):P=(0,Bt.pipeline)(P,ao.default.createInflateRaw(),G=>{G&&n(G)}),p=new Ft(P,x),r(p)}),X.once("end",()=>{p||(p=new Ft(P,x),r(p))});return}if(N==="br"){P=(0,Bt.pipeline)(P,ao.default.createBrotliDecompress(),X=>{X&&n(X)}),p=new Ft(P,x),r(p);return}p=new Ft(P,x),r(p)}),sP(h,i).catch(n)})}function Y0(t,e){let r=da.Buffer.from(`0\r
23
+ `)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var oa,U0,M0,Bb,j0,qb,xd,no,Dn,au=gt(()=>{na();Td();({toStringTag:oa,iterator:U0,hasInstance:M0}=Symbol),Bb=Math.random,j0="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),qb=o((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[oa])?[(r=r!==void 0?r+"":e[oa]=="File"?e.name:"blob",t),e.name!==r||e[oa]=="blob"?new zn([e],r,e):e]:[t,e+""]),"f"),xd=o((t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r
24
+ `)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),no=o((t,e,r)=>{if(e.length<r)throw new TypeError(`Failed to execute '${t}' on 'FormData': ${r} arguments required, but only ${e.length} present.`)},"x"),Dn=class{static{o(this,"FormData")}#e=[];constructor(...e){if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[oa](){return"FormData"}[U0](){return this.entries()}static[M0](e){return e&&typeof e=="object"&&e[oa]==="FormData"&&!j0.some(r=>typeof e[r]!="function")}append(...e){no("append",arguments,2),this.#e.push(qb(...e))}delete(e){no("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){no("get",arguments,1),e+="";for(var r=this.#e,n=r.length,i=0;i<n;i++)if(r[i][0]===e)return r[i][1];return null}getAll(e,r){return no("getAll",arguments,1),r=[],e+="",this.#e.forEach(n=>n[0]===e&&r.push(n[1])),r}has(e){return no("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){no("forEach",arguments,1);for(var[n,i]of this)e.call(r,i,n,this)}set(...e){no("set",arguments,2);var r=[],n=!0;e=qb(...e),this.#e.forEach(i=>{i[0]===e[0]?n&&(n=!r.push(e)):r.push(i)}),n&&r.push(e),this.#e=r}*entries(){yield*this.#e}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}};o(Vb,"formDataToBlob")});var rn,su=gt(()=>{rn=class extends Error{static{o(this,"FetchBaseError")}constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var At,Ad=gt(()=>{su();At=class extends rn{static{o(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var uu,wd,ia,Hb,Gb,Wb,cu=gt(()=>{uu=Symbol.toStringTag,wd=o(t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[uu]==="URLSearchParams","isURLSearchParameters"),ia=o(t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[uu]),"isBlob"),Hb=o(t=>typeof t=="object"&&(t[uu]==="AbortSignal"||t[uu]==="EventTarget"),"isAbortSignal"),Gb=o((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),Wb=o((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var Kb=k((b5,Zb)=>{if(!globalThis.DOMException)try{let{MessageChannel:t}=require("worker_threads"),e=new t().port1,r=new ArrayBuffer;e.postMessage(r,[r,r])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}Zb.exports=globalThis.DOMException});var oo,Jb,Yb,Id,Xb,Qb,eP,tP,rP,nP,lu,Rd=gt(()=>{oo=require("node:fs"),Jb=require("node:path"),Yb=ft(Kb(),1);Td();na();({stat:Id}=oo.promises),Xb=o((t,e)=>rP((0,oo.statSync)(t),t,e),"blobFromSync"),Qb=o((t,e)=>Id(t).then(r=>rP(r,t,e)),"blobFrom"),eP=o((t,e)=>Id(t).then(r=>nP(r,t,e)),"fileFrom"),tP=o((t,e)=>nP((0,oo.statSync)(t),t,e),"fileFromSync"),rP=o((t,e,r="")=>new hr([new lu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),nP=o((t,e,r="")=>new zn([new lu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,Jb.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),lu=class t{static{o(this,"BlobDataItem")}#e;#t;constructor(e){this.#e=e.path,this.#t=e.start,this.size=e.size,this.lastModified=e.lastModified}slice(e,r){return new t({path:this.#e,lastModified:this.lastModified,size:r-e,start:this.#t+e})}async*stream(){let{mtimeMs:e}=await Id(this.#e);if(e>this.lastModified)throw new Yb.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,oo.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var iP={};gs(iP,{toFormData:()=>G0});function H0(t){let e=t.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let r=e[2]||e[3]||"",n=r.slice(r.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,(i,s)=>String.fromCharCode(s)),n}async function G0(t,e){if(!/multipart/i.test(e))throw new TypeError("Failed to fetch");let r=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new TypeError("no or bad content-type header, no multipart boundary");let n=new Od(r[1]||r[2]),i,s,c,d,l,p,f=[],_=new Dn,h=o(x=>{c+=P.decode(x,{stream:!0})},"onPartData"),g=o(x=>{f.push(x)},"appendToFile"),y=o(()=>{let x=new zn(f,p,{type:l});_.append(d,x)},"appendFileToFormData"),T=o(()=>{_.append(d,c)},"appendEntryToFormData"),P=new TextDecoder("utf-8");P.decode(),n.onPartBegin=function(){n.onPartData=h,n.onPartEnd=T,i="",s="",c="",d="",l="",p=null,f.length=0},n.onHeaderField=function(x){i+=P.decode(x,{stream:!0})},n.onHeaderValue=function(x){s+=P.decode(x,{stream:!0})},n.onHeaderEnd=function(){if(s+=P.decode(),i=i.toLowerCase(),i==="content-disposition"){let x=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);x&&(d=x[2]||x[3]||""),p=H0(s),p&&(n.onPartData=g,n.onPartEnd=y)}else i==="content-type"&&(l=s);s="",i=""};for await(let x of t)n.write(x);return n.end(),_}var Rr,Ke,oP,Un,du,pu,L0,aa,F0,B0,q0,V0,io,Od,aP=gt(()=>{Rd();au();Rr=0,Ke={START_BOUNDARY:Rr++,HEADER_FIELD_START:Rr++,HEADER_FIELD:Rr++,HEADER_VALUE_START:Rr++,HEADER_VALUE:Rr++,HEADER_VALUE_ALMOST_DONE:Rr++,HEADERS_ALMOST_DONE:Rr++,PART_DATA_START:Rr++,PART_DATA:Rr++,END:Rr++},oP=1,Un={PART_BOUNDARY:oP,LAST_BOUNDARY:oP*=2},du=10,pu=13,L0=32,aa=45,F0=58,B0=97,q0=122,V0=o(t=>t|32,"lower"),io=o(()=>{},"noop"),Od=class{static{o(this,"MultipartParser")}constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=io,this.onHeaderField=io,this.onHeadersEnd=io,this.onHeaderValue=io,this.onPartBegin=io,this.onPartData=io,this.onPartEnd=io,this.boundaryChars={},e=`\r
25
+ --`+e;let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n),this.boundaryChars[r[n]]=!0;this.boundary=r,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=Ke.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:s,boundary:c,boundaryChars:d,index:l,state:p,flags:f}=this,_=this.boundary.length,h=_-1,g=e.length,y,T,P=o(X=>{this[X+"Mark"]=r},"mark"),x=o(X=>{delete this[X+"Mark"]},"clear"),N=o((X,W,G,Z)=>{(W===void 0||W!==G)&&this[X](Z&&Z.subarray(W,G))},"callback"),L=o((X,W)=>{let G=X+"Mark";G in this&&(W?(N(X,this[G],r,e),delete this[G]):(N(X,this[G],e.length,e),this[G]=0))},"dataCallback");for(r=0;r<n;r++)switch(y=e[r],p){case Ke.START_BOUNDARY:if(l===c.length-2){if(y===aa)f|=Un.LAST_BOUNDARY;else if(y!==pu)return;l++;break}else if(l-1===c.length-2){if(f&Un.LAST_BOUNDARY&&y===aa)p=Ke.END,f=0;else if(!(f&Un.LAST_BOUNDARY)&&y===du)l=0,N("onPartBegin"),p=Ke.HEADER_FIELD_START;else return;break}y!==c[l+2]&&(l=-2),y===c[l+2]&&l++;break;case Ke.HEADER_FIELD_START:p=Ke.HEADER_FIELD,P("onHeaderField"),l=0;case Ke.HEADER_FIELD:if(y===pu){x("onHeaderField"),p=Ke.HEADERS_ALMOST_DONE;break}if(l++,y===aa)break;if(y===F0){if(l===1)return;L("onHeaderField",!0),p=Ke.HEADER_VALUE_START;break}if(T=V0(y),T<B0||T>q0)return;break;case Ke.HEADER_VALUE_START:if(y===L0)break;P("onHeaderValue"),p=Ke.HEADER_VALUE;case Ke.HEADER_VALUE:y===pu&&(L("onHeaderValue",!0),N("onHeaderEnd"),p=Ke.HEADER_VALUE_ALMOST_DONE);break;case Ke.HEADER_VALUE_ALMOST_DONE:if(y!==du)return;p=Ke.HEADER_FIELD_START;break;case Ke.HEADERS_ALMOST_DONE:if(y!==du)return;N("onHeadersEnd"),p=Ke.PART_DATA_START;break;case Ke.PART_DATA_START:p=Ke.PART_DATA,P("onPartData");case Ke.PART_DATA:if(i=l,l===0){for(r+=h;r<g&&!(e[r]in d);)r+=_;r-=h,y=e[r]}if(l<c.length)c[l]===y?(l===0&&L("onPartData",!0),l++):l=0;else if(l===c.length)l++,y===pu?f|=Un.PART_BOUNDARY:y===aa?f|=Un.LAST_BOUNDARY:l=0;else if(l-1===c.length)if(f&Un.PART_BOUNDARY){if(l=0,y===du){f&=~Un.PART_BOUNDARY,N("onPartEnd"),N("onPartBegin"),p=Ke.HEADER_FIELD_START;break}}else f&Un.LAST_BOUNDARY&&y===aa?(N("onPartEnd"),p=Ke.END,f=0):l=0;if(l>0)s[l-1]=y;else if(i>0){let X=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);N("onPartData",0,i,X),i=0,P("onPartData"),r--}break;case Ke.END:break;default:throw new Error(`Unexpected state entered: ${p}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=l,this.state=p,this.flags=f}end(){if(this.state===Ke.HEADER_FIELD_START&&this.index===0||this.state===Ke.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Ke.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o(H0,"_fileName");o(G0,"toFormData")});async function Cd(t){if(t[$t].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[$t].disturbed=!0,t[$t].error)throw t[$t].error;let{body:e}=t;if(e===null)return Lt.Buffer.alloc(0);if(!(e instanceof nr.default))return Lt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let s=new At(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}n+=i.length,r.push(i)}}catch(i){throw i instanceof rn?i:new At(`Invalid response body while trying to fetch ${t.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(i=>typeof i=="string")?Lt.Buffer.from(r.join("")):Lt.Buffer.concat(r,n)}catch(i){throw new At(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new At(`Premature close of server response while trying to fetch ${t.url}`)}var nr,nn,Lt,W0,$t,Or,Ko,Z0,fu,sP,uP,mu=gt(()=>{nr=ft(require("node:stream"),1),nn=require("node:util"),Lt=require("node:buffer");na();au();Ad();su();cu();W0=(0,nn.promisify)(nr.default.pipeline),$t=Symbol("Body internals"),Or=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:wd(e)?e=Lt.Buffer.from(e.toString()):ia(e)||Lt.Buffer.isBuffer(e)||(nn.types.isAnyArrayBuffer(e)?e=Lt.Buffer.from(e):ArrayBuffer.isView(e)?e=Lt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof nr.default||(e instanceof Dn?(e=Vb(e),n=e.type.split("=")[1]):e=Lt.Buffer.from(String(e))));let i=e;Lt.Buffer.isBuffer(e)?i=nr.default.Readable.from(e):ia(e)&&(i=nr.default.Readable.from(e.stream())),this[$t]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof nr.default&&e.on("error",s=>{let c=s instanceof rn?s:new At(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[$t].error=c})}get body(){return this[$t].stream}get bodyUsed(){return this[$t].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await Cd(this);return e.slice(r,r+n)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let n=new Dn,i=new URLSearchParams(await this.text());for(let[s,c]of i)n.append(s,c);return n}let{toFormData:r}=await Promise.resolve().then(()=>(aP(),iP));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[$t].body&&this[$t].body.type||"",r=await this.arrayBuffer();return new hr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await Cd(this);return new TextDecoder().decode(e)}buffer(){return Cd(this)}};Or.prototype.buffer=(0,nn.deprecate)(Or.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Or.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,nn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(Cd,"consumeBody");Ko=o((t,e)=>{let r,n,{body:i}=t[$t];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof nr.default&&typeof i.getBoundary!="function"&&(r=new nr.PassThrough({highWaterMark:e}),n=new nr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[$t].stream=r,i=n),i},"clone"),Z0=(0,nn.deprecate)(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),fu=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":wd(t)?"application/x-www-form-urlencoded;charset=UTF-8":ia(t)?t.type||null:Lt.Buffer.isBuffer(t)||nn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Dn?`multipart/form-data; boundary=${e[$t].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${Z0(t)}`:t instanceof nr.default?null:"text/plain;charset=UTF-8","extractContentType"),sP=o(t=>{let{body:e}=t[$t];return e===null?0:ia(e)?e.size:Lt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),uP=o(async(t,{body:e})=>{e===null?t.end():await W0(e,t)},"writeToStream")});function cP(t=[]){return new kt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return hu(e),kd(e,String(r)),!0}catch{return!1}}))}var $d,sa,hu,kd,kt,gu=gt(()=>{$d=require("node:util"),sa=ft(require("node:http"),1),hu=typeof sa.default.validateHeaderName=="function"?sa.default.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},kd=typeof sa.default.validateHeaderValue=="function"?sa.default.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},kt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,s]of Object.entries(n))r.push(...s.map(c=>[i,c]))}else if(e!=null)if(typeof e=="object"&&!$d.types.isBoxedPrimitive(e)){let n=e[Symbol.iterator];if(n==null)r.push(...Object.entries(e));else{if(typeof n!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(i=>{if(typeof i!="object"||$d.types.isBoxedPrimitive(i))throw new TypeError("Each header pair must be an iterable object");return[...i]}).map(i=>{if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...i]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([n,i])=>(hu(n),kd(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,s){switch(i){case"append":case"set":return(c,d)=>(hu(c),kd(c,String(d)),URLSearchParams.prototype[i].call(n,String(c).toLowerCase(),String(d)));case"delete":case"has":case"getAll":return c=>(hu(c),URLSearchParams.prototype[i].call(n,String(c).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(kt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(cP,"fromRawHeaders")});var K0,ua,Nd=gt(()=>{K0=new Set([301,302,303,307,308]),ua=o(t=>K0.has(t),"isRedirect")});var gr,Ft,lP=gt(()=>{gu();mu();Nd();gr=Symbol("Response internals"),Ft=class t extends Or{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new kt(r.headers);if(e!==null&&!i.has("Content-Type")){let s=fu(e,this);s&&i.append("Content-Type",s)}this[gr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[gr].type}get url(){return this[gr].url||""}get status(){return this[gr].status}get ok(){return this[gr].status>=200&&this[gr].status<300}get redirected(){return this[gr].counter>0}get statusText(){return this[gr].statusText}get headers(){return this[gr].headers}get highWaterMark(){return this[gr].highWaterMark}clone(){return new t(Ko(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!ua(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new t(null,{status:0,statusText:""});return e[gr].type="error",e}static json(e=void 0,r={}){let n=JSON.stringify(e);if(n===void 0)throw new TypeError("data is not JSON serializable");let i=new kt(r&&r.headers);return i.has("content-type")||i.set("content-type","application/json"),new t(n,{...r,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Ft.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var dP,pP=gt(()=>{dP=o(t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""},"getSearch")});function fP(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}function yP(t){if(!hP.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function J0(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,mP.isIP)(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function Jo(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:J0(t)}function _P(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let n=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,s=fP(i),c=fP(i,!0);s.toString().length>4096&&(s=c),e&&(s=e(s)),r&&(c=r(c));let d=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return s;case"strict-origin":return Jo(s)&&!Jo(d)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return s.origin===d.origin?s:Jo(s)&&!Jo(d)?"no-referrer":c;case"same-origin":return s.origin===d.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===d.origin?s:c;case"no-referrer-when-downgrade":return Jo(s)&&!Jo(d)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function vP(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&hP.has(n)&&(r=n);return r}var mP,hP,gP,zd=gt(()=>{mP=require("node:net");o(fP,"stripURLForUseAsAReferrer");hP=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),gP="strict-origin-when-cross-origin";o(yP,"validateReferrerPolicy");o(J0,"isOriginPotentiallyTrustworthy");o(Jo,"isUrlPotentiallyTrustworthy");o(_P,"determineRequestsReferrer");o(vP,"parseReferrerPolicyFromHeader")});var bP,PP,bt,ca,Y0,Mn,SP,EP=gt(()=>{bP=require("node:url"),PP=require("node:util");gu();mu();cu();pP();zd();bt=Symbol("Request internals"),ca=o(t=>typeof t=="object"&&typeof t[bt]=="object","isRequest"),Y0=(0,PP.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Mn=class t extends Or{static{o(this,"Request")}constructor(e,r={}){let n;if(ca(e)?n=new URL(e.url):(n=new URL(e),e={}),n.username!==""||n.password!=="")throw new TypeError(`${n} is an url with embedded credentials.`);let i=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!ca(r)&&"data"in r&&Y0(),(r.body!=null||ca(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:ca(e)&&e.body!==null?Ko(e):null;super(s,{size:r.size||e.size||0});let c=new kt(r.headers||e.headers||{});if(s!==null&&!c.has("Content-Type")){let p=fu(s,this);p&&c.set("Content-Type",p)}let d=ca(e)?e.signal:null;if("signal"in r&&(d=r.signal),d!=null&&!Hb(d))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let l=r.referrer==null?e.referrer:r.referrer;if(l==="")l="no-referrer";else if(l){let p=new URL(l);l=/^about:(\/\/)?client$/.test(p)?"client":p}else l=void 0;this[bt]={method:i,redirect:r.redirect||e.redirect||"follow",headers:c,parsedURL:n,signal:d,referrer:l},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[bt].method}get url(){return(0,bP.format)(this[bt].parsedURL)}get headers(){return this[bt].headers}get redirect(){return this[bt].redirect}get signal(){return this[bt].signal}get referrer(){if(this[bt].referrer==="no-referrer")return"";if(this[bt].referrer==="client")return"about:client";if(this[bt].referrer)return this[bt].referrer.toString()}get referrerPolicy(){return this[bt].referrerPolicy}set referrerPolicy(e){this[bt].referrerPolicy=yP(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Mn.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});SP=o(t=>{let{parsedURL:e}=t[bt],r=new kt(t[bt].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(n="0"),t.body!==null){let d=sP(t);typeof d=="number"&&!Number.isNaN(d)&&(n=String(d))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=gP),t.referrer&&t.referrer!=="no-referrer"?t[bt].referrer=_P(t):t[bt].referrer="no-referrer",t[bt].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=t;typeof i=="function"&&(i=i(e));let s=dP(e),c={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:c}},"getNodeRequestOptions")});var la,TP=gt(()=>{su();la=class extends rn{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var wP={};gs(wP,{AbortError:()=>la,Blob:()=>hr,FetchError:()=>At,File:()=>zn,FormData:()=>Dn,Headers:()=>kt,Request:()=>Mn,Response:()=>Ft,blobFrom:()=>Qb,blobFromSync:()=>Xb,default:()=>Dd,fileFrom:()=>eP,fileFromSync:()=>tP,isRedirect:()=>ua});async function Dd(t,e){return new Promise((r,n)=>{let i=new Mn(t,e),{parsedURL:s,options:c}=SP(i);if(!X0.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let y=zb(i.url),T=new Ft(y,{headers:{"Content-Type":y.typeFull}});r(T);return}let d=(s.protocol==="https:"?AP.default:xP.default).request,{signal:l}=i,p=null,f=o(()=>{let y=new la("The operation was aborted.");n(y),i.body&&i.body instanceof Bt.default.Readable&&i.body.destroy(y),!(!p||!p.body)&&p.body.emit("error",y)},"abort");if(l&&l.aborted){f();return}let _=o(()=>{f(),g()},"abortAndFinalize"),h=d(s.toString(),c);l&&l.addEventListener("abort",_);let g=o(()=>{h.abort(),l&&l.removeEventListener("abort",_)},"finalize");h.on("error",y=>{n(new At(`request to ${i.url} failed, reason: ${y.message}`,"system",y)),g()}),Q0(h,y=>{p&&p.body&&p.body.destroy(y)}),process.version<"v14"&&h.on("socket",y=>{let T;y.prependListener("end",()=>{T=y._eventsCount}),y.prependListener("close",P=>{if(p&&T<y._eventsCount&&!P){let x=new Error("Premature close");x.code="ERR_STREAM_PREMATURE_CLOSE",p.body.emit("error",x)}})}),h.on("response",y=>{h.setTimeout(0);let T=cP(y.rawHeaders);if(ua(y.statusCode)){let X=T.get("Location"),W=null;try{W=X===null?null:new URL(X,i.url)}catch{if(i.redirect!=="manual"){n(new At(`uri requested responds with an invalid redirect URL: ${X}`,"invalid-redirect")),g();return}}switch(i.redirect){case"error":n(new At(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),g();return;case"manual":break;case"follow":{if(W===null)break;if(i.counter>=i.follow){n(new At(`maximum redirect reached at: ${i.url}`,"max-redirect")),g();return}let G={headers:new kt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:Ko(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!Gb(i.url,W)||!Wb(i.url,W))for(let ee of["authorization","www-authenticate","cookie","cookie2"])G.headers.delete(ee);if(y.statusCode!==303&&i.body&&e.body instanceof Bt.default.Readable){n(new At("Cannot follow redirect with body being a readable stream","unsupported-redirect")),g();return}(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&i.method==="POST")&&(G.method="GET",G.body=void 0,G.headers.delete("content-length"));let Z=vP(T);Z&&(G.referrerPolicy=Z),r(Dd(new Mn(W,G))),g();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}l&&y.once("end",()=>{l.removeEventListener("abort",_)});let P=(0,Bt.pipeline)(y,new Bt.PassThrough,X=>{X&&n(X)});process.version<"v12.10"&&y.on("aborted",_);let x={url:i.url,status:y.statusCode,statusText:y.statusMessage,headers:T,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},N=T.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||N===null||y.statusCode===204||y.statusCode===304){p=new Ft(P,x),r(p);return}let L={flush:ao.default.Z_SYNC_FLUSH,finishFlush:ao.default.Z_SYNC_FLUSH};if(N==="gzip"||N==="x-gzip"){P=(0,Bt.pipeline)(P,ao.default.createGunzip(L),X=>{X&&n(X)}),p=new Ft(P,x),r(p);return}if(N==="deflate"||N==="x-deflate"){let X=(0,Bt.pipeline)(y,new Bt.PassThrough,W=>{W&&n(W)});X.once("data",W=>{(W[0]&15)===8?P=(0,Bt.pipeline)(P,ao.default.createInflate(),G=>{G&&n(G)}):P=(0,Bt.pipeline)(P,ao.default.createInflateRaw(),G=>{G&&n(G)}),p=new Ft(P,x),r(p)}),X.once("end",()=>{p||(p=new Ft(P,x),r(p))});return}if(N==="br"){P=(0,Bt.pipeline)(P,ao.default.createBrotliDecompress(),X=>{X&&n(X)}),p=new Ft(P,x),r(p);return}p=new Ft(P,x),r(p)}),uP(h,i).catch(n)})}function Q0(t,e){let r=da.Buffer.from(`0\r
26
26
  \r
27
- `),n=!1,i=!1,s;t.on("response",c=>{let{headers:d}=c;n=d["transfer-encoding"]==="chunked"&&!d["content-length"]}),t.on("socket",c=>{let d=o(()=>{if(n&&!i){let p=new Error("Premature close");p.code="ERR_STREAM_PREMATURE_CLOSE",e(p)}},"onSocketClose"),l=o(p=>{i=da.Buffer.compare(p.slice(-5),r)===0,!i&&s&&(i=da.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&da.Buffer.compare(p.slice(-2),r.slice(3))===0),s=p},"onData");c.prependListener("close",d),c.on("data",l),t.on("close",()=>{c.removeListener("close",d),c.removeListener("data",l)})})}var TP,xP,ao,Bt,da,J0,wP=gt(()=>{TP=pt(require("node:http"),1),xP=pt(require("node:https"),1),ao=pt(require("node:zlib"),1),Bt=pt(require("node:stream"),1),da=require("node:buffer");zb();mu();cP();gu();SP();Ad();EP();Nd();au();cu();zd();Rd();J0=new Set(["data:","http:","https:"]);o(Dd,"fetch");o(Y0,"fixResponseChunkedTransferBadEnding")});var OP=k(Xo=>{"use strict";var X0=Xo&&Xo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Yo;Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Gaxios=void 0;var Q0=X0(ta()),e$=require("https"),so=pd(),t$=ub(),IP=require("stream"),RP=hd(),r$=o(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),n$=204,yu=class{static{o(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new RP.GaxiosInterceptorManager,response:new RP.GaxiosInterceptorManager}}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&Yo.mergeHeaders(s,r.headers),n&&Yo.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}async request(e={}){let r=await this.#n(e);return r=await this.#t(r),this.#r(this._request(r))}async _defaultAdapter(e){let r=e.fetchImplementation||this.defaults.fetchImplementation||await Yo.#u(),n={...e};delete n.data;let i=await r(e.url,n),s=await this.getResponseData(e,i);return Object.getOwnPropertyDescriptor(i,"data")?.configurable||Object.defineProperties(i,{data:{configurable:!0,writable:!0,enumerable:!0,value:s}}),Object.assign(i,{config:e,data:s})}async _request(e){try{let r;if(e.adapter?r=await e.adapter(e,this._defaultAdapter.bind(this)):r=await this._defaultAdapter(e),!e.validateStatus(r.status)){if(e.responseType==="stream"){let i=[];for await(let s of r.data)i.push(s);r.data=i.toString()}let n=so.GaxiosError.extractAPIErrorFromResponse(r,`Request failed with status code ${r.status}`);throw new so.GaxiosError(n?.message,e,r,n)}return r}catch(r){let n;r instanceof so.GaxiosError?n=r:r instanceof Error?n=new so.GaxiosError(r.message,e,void 0,r):n=new so.GaxiosError("Unexpected Gaxios Error",e,void 0,r);let{shouldRetry:i,config:s}=await(0,t$.getRetryConfig)(n);if(i&&s)return n.config.retryConfig.currentRetryAttempt=s.retryConfig.currentRetryAttempt,e.retryConfig=n.config?.retryConfig,this.#o(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(n),n}}async getResponseData(e,r){if(r.status===n$)return"";if(e.maxContentLength&&r.headers.has("content-length")&&e.maxContentLength<Number.parseInt(r.headers?.get("content-length")||""))throw new so.GaxiosError("Response's `Content-Length` is over the limit.",e,Object.assign(r,{config:e}));switch(e.responseType){case"stream":return r.body;case"json":{let n=await r.text();try{return JSON.parse(n)}catch{return n}}case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"text":return r.text();default:return this.getResponseDataFromContentType(r)}}#e(e,r=[]){let n=new URL(e),i=[...r],s=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let c of s)i.push(c.trim());for(let c of i)if(c instanceof RegExp){if(c.test(n.toString()))return!1}else if(c instanceof URL){if(c.origin===n.origin)return!1}else if(c.startsWith("*.")||c.startsWith(".")){let d=c.replace(/^\*\./,".");if(n.hostname.endsWith(d))return!1}else if(c===n.origin||c===n.hostname||c===n.href)return!1;return!0}async#t(e){let r=Promise.resolve(e);for(let n of this.interceptors.request.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#r(e){let r=Promise.resolve(e);for(let n of this.interceptors.response.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#n(e){let r=new Headers(this.defaults.headers);Yo.mergeHeaders(r,e.headers);let n=(0,Q0.default)(!0,{},this.defaults,e);if(!n.url)throw new Error("URL is required.");if(n.baseURL&&(n.url=new URL(n.url,n.baseURL)),n.url=new URL(n.url),n.params)if(n.paramsSerializer){let c=n.paramsSerializer(n.params);c.startsWith("?")&&(c=c.slice(1));let d=n.url.toString().includes("?")?"&":"?";n.url=n.url+d+c}else{let c=n.url instanceof URL?n.url:new URL(n.url);for(let[d,l]of new URLSearchParams(n.params))c.searchParams.append(d,l);n.url=c}typeof e.maxContentLength=="number"&&(n.size=e.maxContentLength),typeof e.maxRedirects=="number"&&(n.follow=e.maxRedirects);let i=typeof n.data=="string"||n.data instanceof ArrayBuffer||n.data instanceof Blob||globalThis.File&&n.data instanceof File||n.data instanceof FormData||n.data instanceof IP.Readable||n.data instanceof ReadableStream||n.data instanceof String||n.data instanceof URLSearchParams||ArrayBuffer.isView(n.data)||["Blob","File","FormData"].includes(n.data?.constructor?.name||"");if(n.multipart?.length){let c=await r$();r.set("content-type",`multipart/related; boundary=${c}`),n.body=IP.Readable.from(this.getMultipartRequest(n.multipart,c))}else i?n.body=n.data:typeof n.data=="object"?r.get("Content-Type")==="application/x-www-form-urlencoded"?n.body=n.paramsSerializer?n.paramsSerializer(n.data):new URLSearchParams(n.data):(r.has("content-type")||r.set("content-type","application/json"),n.body=JSON.stringify(n.data)):n.data&&(n.body=n.data);n.validateStatus=n.validateStatus||this.validateStatus,n.responseType=n.responseType||"unknown",!r.has("accept")&&n.responseType==="json"&&r.set("accept","application/json");let s=n.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!n.agent)if(s&&this.#e(n.url,n.noProxy)){let c=await Yo.#s();this.agentCache.has(s)?n.agent=this.agentCache.get(s):(n.agent=new c(s,{cert:n.cert,key:n.key}),this.agentCache.set(s,n.agent))}else n.cert&&n.key&&(this.agentCache.has(n.key)?n.agent=this.agentCache.get(n.key):(n.agent=new e$.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!="function"&&n.errorRedactor!==!1&&(n.errorRedactor=so.defaultErrorRedactor),n.body&&!("duplex"in n)&&(n.duplex="half"),this.#o(n),Object.assign(n,{headers:r,url:n.url instanceof URL?n.url:new URL(n.url)})}#o(e){if(e.timeout){let r=AbortSignal.timeout(e.timeout);e.signal&&!e.signal.aborted?e.signal=AbortSignal.any([e.signal,r]):e.signal=r}}validateStatus(e){return e>=200&&e<300}async getResponseDataFromContentType(e){let r=e.headers.get("Content-Type");if(r===null)return e.text();if(r=r.toLowerCase(),r.includes("application/json")){let n=await e.text();try{n=JSON.parse(n)}catch{}return n}else return r.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,r){let n=`--${r}--`;for(let i of e){let s=i.headers.get("Content-Type")||"application/octet-stream";yield`--${r}\r
27
+ `),n=!1,i=!1,s;t.on("response",c=>{let{headers:d}=c;n=d["transfer-encoding"]==="chunked"&&!d["content-length"]}),t.on("socket",c=>{let d=o(()=>{if(n&&!i){let p=new Error("Premature close");p.code="ERR_STREAM_PREMATURE_CLOSE",e(p)}},"onSocketClose"),l=o(p=>{i=da.Buffer.compare(p.slice(-5),r)===0,!i&&s&&(i=da.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&da.Buffer.compare(p.slice(-2),r.slice(3))===0),s=p},"onData");c.prependListener("close",d),c.on("data",l),t.on("close",()=>{c.removeListener("close",d),c.removeListener("data",l)})})}var xP,AP,ao,Bt,da,X0,IP=gt(()=>{xP=ft(require("node:http"),1),AP=ft(require("node:https"),1),ao=ft(require("node:zlib"),1),Bt=ft(require("node:stream"),1),da=require("node:buffer");Db();mu();lP();gu();EP();Ad();TP();Nd();au();cu();zd();Rd();X0=new Set(["data:","http:","https:"]);o(Dd,"fetch");o(Q0,"fixResponseChunkedTransferBadEnding")});var CP=k(Xo=>{"use strict";var e$=Xo&&Xo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Yo;Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Gaxios=void 0;var t$=e$(ta()),r$=require("https"),so=pd(),n$=cb(),RP=require("stream"),OP=hd(),o$=o(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),i$=204,yu=class{static{o(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new OP.GaxiosInterceptorManager,response:new OP.GaxiosInterceptorManager}}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&Yo.mergeHeaders(s,r.headers),n&&Yo.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}async request(e={}){let r=await this.#n(e);return r=await this.#t(r),this.#r(this._request(r))}async _defaultAdapter(e){let r=e.fetchImplementation||this.defaults.fetchImplementation||await Yo.#u(),n={...e};delete n.data;let i=await r(e.url,n),s=await this.getResponseData(e,i);return Object.getOwnPropertyDescriptor(i,"data")?.configurable||Object.defineProperties(i,{data:{configurable:!0,writable:!0,enumerable:!0,value:s}}),Object.assign(i,{config:e,data:s})}async _request(e){try{let r;if(e.adapter?r=await e.adapter(e,this._defaultAdapter.bind(this)):r=await this._defaultAdapter(e),!e.validateStatus(r.status)){if(e.responseType==="stream"){let i=[];for await(let s of r.data)i.push(s);r.data=i.toString()}let n=so.GaxiosError.extractAPIErrorFromResponse(r,`Request failed with status code ${r.status}`);throw new so.GaxiosError(n?.message,e,r,n)}return r}catch(r){let n;r instanceof so.GaxiosError?n=r:r instanceof Error?n=new so.GaxiosError(r.message,e,void 0,r):n=new so.GaxiosError("Unexpected Gaxios Error",e,void 0,r);let{shouldRetry:i,config:s}=await(0,n$.getRetryConfig)(n);if(i&&s)return n.config.retryConfig.currentRetryAttempt=s.retryConfig.currentRetryAttempt,e.retryConfig=n.config?.retryConfig,this.#o(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(n),n}}async getResponseData(e,r){if(r.status===i$)return"";if(e.maxContentLength&&r.headers.has("content-length")&&e.maxContentLength<Number.parseInt(r.headers?.get("content-length")||""))throw new so.GaxiosError("Response's `Content-Length` is over the limit.",e,Object.assign(r,{config:e}));switch(e.responseType){case"stream":return r.body;case"json":{let n=await r.text();try{return JSON.parse(n)}catch{return n}}case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"text":return r.text();default:return this.getResponseDataFromContentType(r)}}#e(e,r=[]){let n=new URL(e),i=[...r],s=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let c of s)i.push(c.trim());for(let c of i)if(c instanceof RegExp){if(c.test(n.toString()))return!1}else if(c instanceof URL){if(c.origin===n.origin)return!1}else if(c.startsWith("*.")||c.startsWith(".")){let d=c.replace(/^\*\./,".");if(n.hostname.endsWith(d))return!1}else if(c===n.origin||c===n.hostname||c===n.href)return!1;return!0}async#t(e){let r=Promise.resolve(e);for(let n of this.interceptors.request.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#r(e){let r=Promise.resolve(e);for(let n of this.interceptors.response.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#n(e){let r=new Headers(this.defaults.headers);Yo.mergeHeaders(r,e.headers);let n=(0,t$.default)(!0,{},this.defaults,e);if(!n.url)throw new Error("URL is required.");if(n.baseURL&&(n.url=new URL(n.url,n.baseURL)),n.url=new URL(n.url),n.params)if(n.paramsSerializer){let c=n.paramsSerializer(n.params);c.startsWith("?")&&(c=c.slice(1));let d=n.url.toString().includes("?")?"&":"?";n.url=n.url+d+c}else{let c=n.url instanceof URL?n.url:new URL(n.url);for(let[d,l]of new URLSearchParams(n.params))c.searchParams.append(d,l);n.url=c}typeof e.maxContentLength=="number"&&(n.size=e.maxContentLength),typeof e.maxRedirects=="number"&&(n.follow=e.maxRedirects);let i=typeof n.data=="string"||n.data instanceof ArrayBuffer||n.data instanceof Blob||globalThis.File&&n.data instanceof File||n.data instanceof FormData||n.data instanceof RP.Readable||n.data instanceof ReadableStream||n.data instanceof String||n.data instanceof URLSearchParams||ArrayBuffer.isView(n.data)||["Blob","File","FormData"].includes(n.data?.constructor?.name||"");if(n.multipart?.length){let c=await o$();r.set("content-type",`multipart/related; boundary=${c}`),n.body=RP.Readable.from(this.getMultipartRequest(n.multipart,c))}else i?n.body=n.data:typeof n.data=="object"?r.get("Content-Type")==="application/x-www-form-urlencoded"?n.body=n.paramsSerializer?n.paramsSerializer(n.data):new URLSearchParams(n.data):(r.has("content-type")||r.set("content-type","application/json"),n.body=JSON.stringify(n.data)):n.data&&(n.body=n.data);n.validateStatus=n.validateStatus||this.validateStatus,n.responseType=n.responseType||"unknown",!r.has("accept")&&n.responseType==="json"&&r.set("accept","application/json");let s=n.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!n.agent)if(s&&this.#e(n.url,n.noProxy)){let c=await Yo.#s();this.agentCache.has(s)?n.agent=this.agentCache.get(s):(n.agent=new c(s,{cert:n.cert,key:n.key}),this.agentCache.set(s,n.agent))}else n.cert&&n.key&&(this.agentCache.has(n.key)?n.agent=this.agentCache.get(n.key):(n.agent=new r$.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!="function"&&n.errorRedactor!==!1&&(n.errorRedactor=so.defaultErrorRedactor),n.body&&!("duplex"in n)&&(n.duplex="half"),this.#o(n),Object.assign(n,{headers:r,url:n.url instanceof URL?n.url:new URL(n.url)})}#o(e){if(e.timeout){let r=AbortSignal.timeout(e.timeout);e.signal&&!e.signal.aborted?e.signal=AbortSignal.any([e.signal,r]):e.signal=r}}validateStatus(e){return e>=200&&e<300}async getResponseDataFromContentType(e){let r=e.headers.get("Content-Type");if(r===null)return e.text();if(r=r.toLowerCase(),r.includes("application/json")){let n=await e.text();try{n=JSON.parse(n)}catch{}return n}else return r.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,r){let n=`--${r}--`;for(let i of e){let s=i.headers.get("Content-Type")||"application/octet-stream";yield`--${r}\r
28
28
  Content-Type: ${s}\r
29
29
  \r
30
30
  `,typeof i.content=="string"?yield i.content:yield*i.content,yield`\r
31
- `}yield n}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>pt(kb()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(wP(),AP))).default,this.#a}static mergeHeaders(e,...r){e=e instanceof Headers?e:new Headers(e);for(let n of r)(n instanceof Headers?n:new Headers(n)).forEach((s,c)=>{c==="set-cookie"?e.append(c,s):e.set(c,s)});return e}};Xo.Gaxios=yu;Yo=yu});var at=k(wt=>{"use strict";var o$=wt&&wt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i$=wt&&wt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&o$(e,t,r)};Object.defineProperty(wt,"__esModule",{value:!0});wt.instance=wt.Gaxios=wt.GaxiosError=void 0;wt.request=s$;var CP=OP();Object.defineProperty(wt,"Gaxios",{enumerable:!0,get:o(function(){return CP.Gaxios},"get")});var a$=pd();Object.defineProperty(wt,"GaxiosError",{enumerable:!0,get:o(function(){return a$.GaxiosError},"get")});i$(hd(),wt);wt.instance=new CP.Gaxios;async function s$(t){return wt.instance.request(t)}o(s$,"request")});var Ud=k(($P,_u)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,s="[BigNumber Error] ",c=s+"Number primitive has more than 15 significant digits: ",d=1e14,l=14,p=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],_=1e7,h=1e9;function g(W){var G,Z,ee,Y=Q.prototype={constructor:Q,toString:null,valueOf:null},Se=new Q(1),te=20,q=4,B=-7,J=21,K=-1e7,re=1e7,oe=!1,Ae=1,Oe=0,Be={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Ge="0123456789abcdefghijklmnopqrstuvwxyz",ht=!0;function Q(v,E){var A,D,R,$,j,I,O,U,z=this;if(!(z instanceof Q))return new Q(v,E);if(E==null){if(v&&v._isBigNumber===!0){z.s=v.s,!v.c||v.e>re?z.c=z.e=null:v.e<K?z.c=[z.e=0]:(z.e=v.e,z.c=v.c.slice());return}if((I=typeof v=="number")&&v*0==0){if(z.s=1/v<0?(v=-v,-1):1,v===~~v){for($=0,j=v;j>=10;j/=10,$++);$>re?z.c=z.e=null:(z.e=$,z.c=[v]);return}U=String(v)}else{if(!r.test(U=String(v)))return ee(z,U,I);z.s=U.charCodeAt(0)==45?(U=U.slice(1),-1):1}($=U.indexOf("."))>-1&&(U=U.replace(".","")),(j=U.search(/e/i))>0?($<0&&($=j),$+=+U.slice(j+1),U=U.substring(0,j)):$<0&&($=U.length)}else{if(x(E,2,Ge.length,"Base"),E==10&&ht)return z=new Q(v),Fe(z,te+z.e+1,q);if(U=String(v),I=typeof v=="number"){if(v*0!=0)return ee(z,U,I,E);if(z.s=1/v<0?(U=U.slice(1),-1):1,Q.DEBUG&&U.replace(/^0\.0*|\./,"").length>15)throw Error(c+v)}else z.s=U.charCodeAt(0)===45?(U=U.slice(1),-1):1;for(A=Ge.slice(0,E),$=j=0,O=U.length;j<O;j++)if(A.indexOf(D=U.charAt(j))<0){if(D=="."){if(j>$){$=O;continue}}else if(!R&&(U==U.toUpperCase()&&(U=U.toLowerCase())||U==U.toLowerCase()&&(U=U.toUpperCase()))){R=!0,j=-1,$=0;continue}return ee(z,String(v),I,E)}I=!1,U=Z(U,E,10,z.s),($=U.indexOf("."))>-1?U=U.replace(".",""):$=U.length}for(j=0;U.charCodeAt(j)===48;j++);for(O=U.length;U.charCodeAt(--O)===48;);if(U=U.slice(j,++O)){if(O-=j,I&&Q.DEBUG&&O>15&&(v>p||v!==i(v)))throw Error(c+z.s*v);if(($=$-j-1)>re)z.c=z.e=null;else if($<K)z.c=[z.e=0];else{if(z.e=$,z.c=[],j=($+1)%l,$<0&&(j+=l),j<O){for(j&&z.c.push(+U.slice(0,j)),O-=l;j<O;)z.c.push(+U.slice(j,j+=l));j=l-(U=U.slice(j)).length}else j-=O;for(;j--;U+="0");z.c.push(+U)}}else z.c=[z.e=0]}o(Q,"BigNumber"),Q.clone=g,Q.ROUND_UP=0,Q.ROUND_DOWN=1,Q.ROUND_CEIL=2,Q.ROUND_FLOOR=3,Q.ROUND_HALF_UP=4,Q.ROUND_HALF_DOWN=5,Q.ROUND_HALF_EVEN=6,Q.ROUND_HALF_CEIL=7,Q.ROUND_HALF_FLOOR=8,Q.EUCLID=9,Q.config=Q.set=function(v){var E,A;if(v!=null)if(typeof v=="object"){if(v.hasOwnProperty(E="DECIMAL_PLACES")&&(A=v[E],x(A,0,h,E),te=A),v.hasOwnProperty(E="ROUNDING_MODE")&&(A=v[E],x(A,0,8,E),q=A),v.hasOwnProperty(E="EXPONENTIAL_AT")&&(A=v[E],A&&A.pop?(x(A[0],-h,0,E),x(A[1],0,h,E),B=A[0],J=A[1]):(x(A,-h,h,E),B=-(J=A<0?-A:A))),v.hasOwnProperty(E="RANGE"))if(A=v[E],A&&A.pop)x(A[0],-h,-1,E),x(A[1],1,h,E),K=A[0],re=A[1];else if(x(A,-h,h,E),A)K=-(re=A<0?-A:A);else throw Error(s+E+" cannot be zero: "+A);if(v.hasOwnProperty(E="CRYPTO"))if(A=v[E],A===!!A)if(A)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))oe=A;else throw oe=!A,Error(s+"crypto unavailable");else oe=A;else throw Error(s+E+" not true or false: "+A);if(v.hasOwnProperty(E="MODULO_MODE")&&(A=v[E],x(A,0,9,E),Ae=A),v.hasOwnProperty(E="POW_PRECISION")&&(A=v[E],x(A,0,h,E),Oe=A),v.hasOwnProperty(E="FORMAT"))if(A=v[E],typeof A=="object")Be=A;else throw Error(s+E+" not an object: "+A);if(v.hasOwnProperty(E="ALPHABET"))if(A=v[E],typeof A=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(A))ht=A.slice(0,10)=="0123456789",Ge=A;else throw Error(s+E+" invalid: "+A)}else throw Error(s+"Object expected: "+v);return{DECIMAL_PLACES:te,ROUNDING_MODE:q,EXPONENTIAL_AT:[B,J],RANGE:[K,re],CRYPTO:oe,MODULO_MODE:Ae,POW_PRECISION:Oe,FORMAT:Be,ALPHABET:Ge}},Q.isBigNumber=function(v){if(!v||v._isBigNumber!==!0)return!1;if(!Q.DEBUG)return!0;var E,A,D=v.c,R=v.e,$=v.s;e:if({}.toString.call(D)=="[object Array]"){if(($===1||$===-1)&&R>=-h&&R<=h&&R===i(R)){if(D[0]===0){if(R===0&&D.length===1)return!0;break e}if(E=(R+1)%l,E<1&&(E+=l),String(D[0]).length==E){for(E=0;E<D.length;E++)if(A=D[E],A<0||A>=d||A!==i(A))break e;if(A!==0)return!0}}}else if(D===null&&R===null&&($===null||$===1||$===-1))return!0;throw Error(s+"Invalid BigNumber: "+v)},Q.maximum=Q.max=function(){return it(arguments,-1)},Q.minimum=Q.min=function(){return it(arguments,1)},Q.random=(function(){var v=9007199254740992,E=Math.random()*v&2097151?function(){return i(Math.random()*v)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(A){var D,R,$,j,I,O=0,U=[],z=new Q(Se);if(A==null?A=te:x(A,0,h),j=n(A/l),oe)if(crypto.getRandomValues){for(D=crypto.getRandomValues(new Uint32Array(j*=2));O<j;)I=D[O]*131072+(D[O+1]>>>11),I>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),D[O]=R[0],D[O+1]=R[1]):(U.push(I%1e14),O+=2);O=j/2}else if(crypto.randomBytes){for(D=crypto.randomBytes(j*=7);O<j;)I=(D[O]&31)*281474976710656+D[O+1]*1099511627776+D[O+2]*4294967296+D[O+3]*16777216+(D[O+4]<<16)+(D[O+5]<<8)+D[O+6],I>=9e15?crypto.randomBytes(7).copy(D,O):(U.push(I%1e14),O+=7);O=j/7}else throw oe=!1,Error(s+"crypto unavailable");if(!oe)for(;O<j;)I=E(),I<9e15&&(U[O++]=I%1e14);for(j=U[--O],A%=l,j&&A&&(I=f[l-A],U[O]=i(j/I)*I);U[O]===0;U.pop(),O--);if(O<0)U=[$=0];else{for($=-1;U[0]===0;U.splice(0,1),$-=l);for(O=1,I=U[0];I>=10;I/=10,O++);O<l&&($-=l-O)}return z.e=$,z.c=U,z}})(),Q.sum=function(){for(var v=1,E=arguments,A=new Q(E[0]);v<E.length;)A=A.plus(E[v++]);return A},Z=(function(){var v="0123456789";function E(A,D,R,$){for(var j,I=[0],O,U=0,z=A.length;U<z;){for(O=I.length;O--;I[O]*=D);for(I[0]+=$.indexOf(A.charAt(U++)),j=0;j<I.length;j++)I[j]>R-1&&(I[j+1]==null&&(I[j+1]=0),I[j+1]+=I[j]/R|0,I[j]%=R)}return I.reverse()}return o(E,"toBaseOut"),function(A,D,R,$,j){var I,O,U,z,V,ie,ue,De,Je=A.indexOf("."),Ye=te,ze=q;for(Je>=0&&(z=Oe,Oe=0,A=A.replace(".",""),De=new Q(D),ie=De.pow(A.length-Je),Oe=z,De.c=E(X(T(ie.c),ie.e,"0"),10,R,v),De.e=De.c.length),ue=E(A,D,R,j?(I=Ge,v):(I=v,Ge)),U=z=ue.length;ue[--z]==0;ue.pop());if(!ue[0])return I.charAt(0);if(Je<0?--U:(ie.c=ue,ie.e=U,ie.s=$,ie=G(ie,De,Ye,ze,R),ue=ie.c,V=ie.r,U=ie.e),O=U+Ye+1,Je=ue[O],z=R/2,V=V||O<0||ue[O+1]!=null,V=ze<4?(Je!=null||V)&&(ze==0||ze==(ie.s<0?3:2)):Je>z||Je==z&&(ze==4||V||ze==6&&ue[O-1]&1||ze==(ie.s<0?8:7)),O<1||!ue[0])A=V?X(I.charAt(1),-Ye,I.charAt(0)):I.charAt(0);else{if(ue.length=O,V)for(--R;++ue[--O]>R;)ue[O]=0,O||(++U,ue=[1].concat(ue));for(z=ue.length;!ue[--z];);for(Je=0,A="";Je<=z;A+=I.charAt(ue[Je++]));A=X(A,U,I.charAt(0))}return A}})(),G=(function(){function v(D,R,$){var j,I,O,U,z=0,V=D.length,ie=R%_,ue=R/_|0;for(D=D.slice();V--;)O=D[V]%_,U=D[V]/_|0,j=ue*O+U*ie,I=ie*O+j%_*_+z,z=(I/$|0)+(j/_|0)+ue*U,D[V]=I%$;return z&&(D=[z].concat(D)),D}o(v,"multiply");function E(D,R,$,j){var I,O;if($!=j)O=$>j?1:-1;else for(I=O=0;I<$;I++)if(D[I]!=R[I]){O=D[I]>R[I]?1:-1;break}return O}o(E,"compare");function A(D,R,$,j){for(var I=0;$--;)D[$]-=I,I=D[$]<R[$]?1:0,D[$]=I*j+D[$]-R[$];for(;!D[0]&&D.length>1;D.splice(0,1));}return o(A,"subtract"),function(D,R,$,j,I){var O,U,z,V,ie,ue,De,Je,Ye,ze,je,lt,yo,_o,vo,zt,qr,Pt=D.s==R.s?1:-1,dt=D.c,Ve=R.c;if(!dt||!dt[0]||!Ve||!Ve[0])return new Q(!D.s||!R.s||(dt?Ve&&dt[0]==Ve[0]:!Ve)?NaN:dt&&dt[0]==0||!Ve?Pt*0:Pt/0);for(Je=new Q(Pt),Ye=Je.c=[],U=D.e-R.e,Pt=$+U+1,I||(I=d,U=y(D.e/l)-y(R.e/l),Pt=Pt/l|0),z=0;Ve[z]==(dt[z]||0);z++);if(Ve[z]>(dt[z]||0)&&U--,Pt<0)Ye.push(1),V=!0;else{for(_o=dt.length,zt=Ve.length,z=0,Pt+=2,ie=i(I/(Ve[0]+1)),ie>1&&(Ve=v(Ve,ie,I),dt=v(dt,ie,I),zt=Ve.length,_o=dt.length),yo=zt,ze=dt.slice(0,zt),je=ze.length;je<zt;ze[je++]=0);qr=Ve.slice(),qr=[0].concat(qr),vo=Ve[0],Ve[1]>=I/2&&vo++;do{if(ie=0,O=E(Ve,ze,zt,je),O<0){if(lt=ze[0],zt!=je&&(lt=lt*I+(ze[1]||0)),ie=i(lt/vo),ie>1)for(ie>=I&&(ie=I-1),ue=v(Ve,ie,I),De=ue.length,je=ze.length;E(ue,ze,De,je)==1;)ie--,A(ue,zt<De?qr:Ve,De,I),De=ue.length,O=1;else ie==0&&(O=ie=1),ue=Ve.slice(),De=ue.length;if(De<je&&(ue=[0].concat(ue)),A(ze,ue,je,I),je=ze.length,O==-1)for(;E(Ve,ze,zt,je)<1;)ie++,A(ze,zt<je?qr:Ve,je,I),je=ze.length}else O===0&&(ie++,ze=[0]);Ye[z++]=ie,ze[0]?ze[je++]=dt[yo]||0:(ze=[dt[yo]],je=1)}while((yo++<_o||ze[0]!=null)&&Pt--);V=ze[0]!=null,Ye[0]||Ye.splice(0,1)}if(I==d){for(z=1,Pt=Ye[0];Pt>=10;Pt/=10,z++);Fe(Je,$+(Je.e=z+U*l-1)+1,j,V)}else Je.e=U,Je.r=+V;return Je}})();function tt(v,E,A,D){var R,$,j,I,O;if(A==null?A=q:x(A,0,8),!v.c)return v.toString();if(R=v.c[0],j=v.e,E==null)O=T(v.c),O=D==1||D==2&&(j<=B||j>=J)?L(O,j):X(O,j,"0");else if(v=Fe(new Q(v),E,A),$=v.e,O=T(v.c),I=O.length,D==1||D==2&&(E<=$||$<=B)){for(;I<E;O+="0",I++);O=L(O,$)}else if(E-=j+(D===2&&$>j),O=X(O,$,"0"),$+1>I){if(--E>0)for(O+=".";E--;O+="0");}else if(E+=$-I,E>0)for($+1==I&&(O+=".");E--;O+="0");return v.s<0&&R?"-"+O:O}o(tt,"format");function it(v,E){for(var A,D,R=1,$=new Q(v[0]);R<v.length;R++)D=new Q(v[R]),(!D.s||(A=P($,D))===E||A===0&&$.s===E)&&($=D);return $}o(it,"maxOrMin");function Nt(v,E,A){for(var D=1,R=E.length;!E[--R];E.pop());for(R=E[0];R>=10;R/=10,D++);return(A=D+A*l-1)>re?v.c=v.e=null:A<K?v.c=[v.e=0]:(v.e=A,v.c=E),v}o(Nt,"normalise"),ee=(function(){var v=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,A=/^\.([^.]+)$/,D=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,j,I,O){var U,z=I?j:j.replace(R,"");if(D.test(z))$.s=isNaN(z)?null:z<0?-1:1;else{if(!I&&(z=z.replace(v,function(V,ie,ue){return U=(ue=ue.toLowerCase())=="x"?16:ue=="b"?2:8,!O||O==U?ie:V}),O&&(U=O,z=z.replace(E,"$1").replace(A,"0.$1")),j!=z))return new Q(z,U);if(Q.DEBUG)throw Error(s+"Not a"+(O?" base "+O:"")+" number: "+j);$.s=null}$.c=$.e=null}})();function Fe(v,E,A,D){var R,$,j,I,O,U,z,V=v.c,ie=f;if(V){e:{for(R=1,I=V[0];I>=10;I/=10,R++);if($=E-R,$<0)$+=l,j=E,O=V[U=0],z=i(O/ie[R-j-1]%10);else if(U=n(($+1)/l),U>=V.length)if(D){for(;V.length<=U;V.push(0));O=z=0,R=1,$%=l,j=$-l+1}else break e;else{for(O=I=V[U],R=1;I>=10;I/=10,R++);$%=l,j=$-l+R,z=j<0?0:i(O/ie[R-j-1]%10)}if(D=D||E<0||V[U+1]!=null||(j<0?O:O%ie[R-j-1]),D=A<4?(z||D)&&(A==0||A==(v.s<0?3:2)):z>5||z==5&&(A==4||D||A==6&&($>0?j>0?O/ie[R-j]:0:V[U-1])%10&1||A==(v.s<0?8:7)),E<1||!V[0])return V.length=0,D?(E-=v.e+1,V[0]=ie[(l-E%l)%l],v.e=-E||0):V[0]=v.e=0,v;if($==0?(V.length=U,I=1,U--):(V.length=U+1,I=ie[l-$],V[U]=j>0?i(O/ie[R-j]%ie[j])*I:0),D)for(;;)if(U==0){for($=1,j=V[0];j>=10;j/=10,$++);for(j=V[0]+=I,I=1;j>=10;j/=10,I++);$!=I&&(v.e++,V[0]==d&&(V[0]=1));break}else{if(V[U]+=I,V[U]!=d)break;V[U--]=0,I=1}for($=V.length;V[--$]===0;V.pop());}v.e>re?v.c=v.e=null:v.e<K&&(v.c=[v.e=0])}return v}o(Fe,"round");function qe(v){var E,A=v.e;return A===null?v.toString():(E=T(v.c),E=A<=B||A>=J?L(E,A):X(E,A,"0"),v.s<0?"-"+E:E)}return o(qe,"valueOf"),Y.absoluteValue=Y.abs=function(){var v=new Q(this);return v.s<0&&(v.s=1),v},Y.comparedTo=function(v,E){return P(this,new Q(v,E))},Y.decimalPlaces=Y.dp=function(v,E){var A,D,R,$=this;if(v!=null)return x(v,0,h),E==null?E=q:x(E,0,8),Fe(new Q($),v+$.e+1,E);if(!(A=$.c))return null;if(D=((R=A.length-1)-y(this.e/l))*l,R=A[R])for(;R%10==0;R/=10,D--);return D<0&&(D=0),D},Y.dividedBy=Y.div=function(v,E){return G(this,new Q(v,E),te,q)},Y.dividedToIntegerBy=Y.idiv=function(v,E){return G(this,new Q(v,E),0,1)},Y.exponentiatedBy=Y.pow=function(v,E){var A,D,R,$,j,I,O,U,z,V=this;if(v=new Q(v),v.c&&!v.isInteger())throw Error(s+"Exponent not an integer: "+qe(v));if(E!=null&&(E=new Q(E)),I=v.e>14,!V.c||!V.c[0]||V.c[0]==1&&!V.e&&V.c.length==1||!v.c||!v.c[0])return z=new Q(Math.pow(+qe(V),I?v.s*(2-N(v)):+qe(v))),E?z.mod(E):z;if(O=v.s<0,E){if(E.c?!E.c[0]:!E.s)return new Q(NaN);D=!O&&V.isInteger()&&E.isInteger(),D&&(V=V.mod(E))}else{if(v.e>9&&(V.e>0||V.e<-1||(V.e==0?V.c[0]>1||I&&V.c[1]>=24e7:V.c[0]<8e13||I&&V.c[0]<=9999975e7)))return $=V.s<0&&N(v)?-0:0,V.e>-1&&($=1/$),new Q(O?1/$:$);Oe&&($=n(Oe/l+2))}for(I?(A=new Q(.5),O&&(v.s=1),U=N(v)):(R=Math.abs(+qe(v)),U=R%2),z=new Q(Se);;){if(U){if(z=z.times(V),!z.c)break;$?z.c.length>$&&(z.c.length=$):D&&(z=z.mod(E))}if(R){if(R=i(R/2),R===0)break;U=R%2}else if(v=v.times(A),Fe(v,v.e+1,1),v.e>14)U=N(v);else{if(R=+qe(v),R===0)break;U=R%2}V=V.times(V),$?V.c&&V.c.length>$&&(V.c.length=$):D&&(V=V.mod(E))}return D?z:(O&&(z=Se.div(z)),E?z.mod(E):$?Fe(z,Oe,q,j):z)},Y.integerValue=function(v){var E=new Q(this);return v==null?v=q:x(v,0,8),Fe(E,E.e+1,v)},Y.isEqualTo=Y.eq=function(v,E){return P(this,new Q(v,E))===0},Y.isFinite=function(){return!!this.c},Y.isGreaterThan=Y.gt=function(v,E){return P(this,new Q(v,E))>0},Y.isGreaterThanOrEqualTo=Y.gte=function(v,E){return(E=P(this,new Q(v,E)))===1||E===0},Y.isInteger=function(){return!!this.c&&y(this.e/l)>this.c.length-2},Y.isLessThan=Y.lt=function(v,E){return P(this,new Q(v,E))<0},Y.isLessThanOrEqualTo=Y.lte=function(v,E){return(E=P(this,new Q(v,E)))===-1||E===0},Y.isNaN=function(){return!this.s},Y.isNegative=function(){return this.s<0},Y.isPositive=function(){return this.s>0},Y.isZero=function(){return!!this.c&&this.c[0]==0},Y.minus=function(v,E){var A,D,R,$,j=this,I=j.s;if(v=new Q(v,E),E=v.s,!I||!E)return new Q(NaN);if(I!=E)return v.s=-E,j.plus(v);var O=j.e/l,U=v.e/l,z=j.c,V=v.c;if(!O||!U){if(!z||!V)return z?(v.s=-E,v):new Q(V?j:NaN);if(!z[0]||!V[0])return V[0]?(v.s=-E,v):new Q(z[0]?j:q==3?-0:0)}if(O=y(O),U=y(U),z=z.slice(),I=O-U){for(($=I<0)?(I=-I,R=z):(U=O,R=V),R.reverse(),E=I;E--;R.push(0));R.reverse()}else for(D=($=(I=z.length)<(E=V.length))?I:E,I=E=0;E<D;E++)if(z[E]!=V[E]){$=z[E]<V[E];break}if($&&(R=z,z=V,V=R,v.s=-v.s),E=(D=V.length)-(A=z.length),E>0)for(;E--;z[A++]=0);for(E=d-1;D>I;){if(z[--D]<V[D]){for(A=D;A&&!z[--A];z[A]=E);--z[A],z[D]+=d}z[D]-=V[D]}for(;z[0]==0;z.splice(0,1),--U);return z[0]?Nt(v,z,U):(v.s=q==3?-1:1,v.c=[v.e=0],v)},Y.modulo=Y.mod=function(v,E){var A,D,R=this;return v=new Q(v,E),!R.c||!v.s||v.c&&!v.c[0]?new Q(NaN):!v.c||R.c&&!R.c[0]?new Q(R):(Ae==9?(D=v.s,v.s=1,A=G(R,v,0,3),v.s=D,A.s*=D):A=G(R,v,0,Ae),v=R.minus(A.times(v)),!v.c[0]&&Ae==1&&(v.s=R.s),v)},Y.multipliedBy=Y.times=function(v,E){var A,D,R,$,j,I,O,U,z,V,ie,ue,De,Je,Ye,ze=this,je=ze.c,lt=(v=new Q(v,E)).c;if(!je||!lt||!je[0]||!lt[0])return!ze.s||!v.s||je&&!je[0]&&!lt||lt&&!lt[0]&&!je?v.c=v.e=v.s=null:(v.s*=ze.s,!je||!lt?v.c=v.e=null:(v.c=[0],v.e=0)),v;for(D=y(ze.e/l)+y(v.e/l),v.s*=ze.s,O=je.length,V=lt.length,O<V&&(De=je,je=lt,lt=De,R=O,O=V,V=R),R=O+V,De=[];R--;De.push(0));for(Je=d,Ye=_,R=V;--R>=0;){for(A=0,ie=lt[R]%Ye,ue=lt[R]/Ye|0,j=O,$=R+j;$>R;)U=je[--j]%Ye,z=je[j]/Ye|0,I=ue*U+z*ie,U=ie*U+I%Ye*Ye+De[$]+A,A=(U/Je|0)+(I/Ye|0)+ue*z,De[$--]=U%Je;De[$]=A}return A?++D:De.splice(0,1),Nt(v,De,D)},Y.negated=function(){var v=new Q(this);return v.s=-v.s||null,v},Y.plus=function(v,E){var A,D=this,R=D.s;if(v=new Q(v,E),E=v.s,!R||!E)return new Q(NaN);if(R!=E)return v.s=-E,D.minus(v);var $=D.e/l,j=v.e/l,I=D.c,O=v.c;if(!$||!j){if(!I||!O)return new Q(R/0);if(!I[0]||!O[0])return O[0]?v:new Q(I[0]?D:R*0)}if($=y($),j=y(j),I=I.slice(),R=$-j){for(R>0?(j=$,A=O):(R=-R,A=I),A.reverse();R--;A.push(0));A.reverse()}for(R=I.length,E=O.length,R-E<0&&(A=O,O=I,I=A,E=R),R=0;E;)R=(I[--E]=I[E]+O[E]+R)/d|0,I[E]=d===I[E]?0:I[E]%d;return R&&(I=[R].concat(I),++j),Nt(v,I,j)},Y.precision=Y.sd=function(v,E){var A,D,R,$=this;if(v!=null&&v!==!!v)return x(v,1,h),E==null?E=q:x(E,0,8),Fe(new Q($),v,E);if(!(A=$.c))return null;if(R=A.length-1,D=R*l+1,R=A[R]){for(;R%10==0;R/=10,D--);for(R=A[0];R>=10;R/=10,D++);}return v&&$.e+1>D&&(D=$.e+1),D},Y.shiftedBy=function(v){return x(v,-p,p),this.times("1e"+v)},Y.squareRoot=Y.sqrt=function(){var v,E,A,D,R,$=this,j=$.c,I=$.s,O=$.e,U=te+4,z=new Q("0.5");if(I!==1||!j||!j[0])return new Q(!I||I<0&&(!j||j[0])?NaN:j?$:1/0);if(I=Math.sqrt(+qe($)),I==0||I==1/0?(E=T(j),(E.length+O)%2==0&&(E+="0"),I=Math.sqrt(+E),O=y((O+1)/2)-(O<0||O%2),I==1/0?E="5e"+O:(E=I.toExponential(),E=E.slice(0,E.indexOf("e")+1)+O),A=new Q(E)):A=new Q(I+""),A.c[0]){for(O=A.e,I=O+U,I<3&&(I=0);;)if(R=A,A=z.times(R.plus(G($,R,U,1))),T(R.c).slice(0,I)===(E=T(A.c)).slice(0,I))if(A.e<O&&--I,E=E.slice(I-3,I+1),E=="9999"||!D&&E=="4999"){if(!D&&(Fe(R,R.e+te+2,0),R.times(R).eq($))){A=R;break}U+=4,I+=4,D=1}else{(!+E||!+E.slice(1)&&E.charAt(0)=="5")&&(Fe(A,A.e+te+2,1),v=!A.times(A).eq($));break}}return Fe(A,A.e+te+1,q,v)},Y.toExponential=function(v,E){return v!=null&&(x(v,0,h),v++),tt(this,v,E,1)},Y.toFixed=function(v,E){return v!=null&&(x(v,0,h),v=v+this.e+1),tt(this,v,E)},Y.toFormat=function(v,E,A){var D,R=this;if(A==null)v!=null&&E&&typeof E=="object"?(A=E,E=null):v&&typeof v=="object"?(A=v,v=E=null):A=Be;else if(typeof A!="object")throw Error(s+"Argument not an object: "+A);if(D=R.toFixed(v,E),R.c){var $,j=D.split("."),I=+A.groupSize,O=+A.secondaryGroupSize,U=A.groupSeparator||"",z=j[0],V=j[1],ie=R.s<0,ue=ie?z.slice(1):z,De=ue.length;if(O&&($=I,I=O,O=$,De-=$),I>0&&De>0){for($=De%I||I,z=ue.substr(0,$);$<De;$+=I)z+=U+ue.substr($,I);O>0&&(z+=U+ue.slice($)),ie&&(z="-"+z)}D=V?z+(A.decimalSeparator||"")+((O=+A.fractionGroupSize)?V.replace(new RegExp("\\d{"+O+"}\\B","g"),"$&"+(A.fractionGroupSeparator||"")):V):z}return(A.prefix||"")+D+(A.suffix||"")},Y.toFraction=function(v){var E,A,D,R,$,j,I,O,U,z,V,ie,ue=this,De=ue.c;if(v!=null&&(I=new Q(v),!I.isInteger()&&(I.c||I.s!==1)||I.lt(Se)))throw Error(s+"Argument "+(I.isInteger()?"out of range: ":"not an integer: ")+qe(I));if(!De)return new Q(ue);for(E=new Q(Se),U=A=new Q(Se),D=O=new Q(Se),ie=T(De),$=E.e=ie.length-ue.e-1,E.c[0]=f[(j=$%l)<0?l+j:j],v=!v||I.comparedTo(E)>0?$>0?E:U:I,j=re,re=1/0,I=new Q(ie),O.c[0]=0;z=G(I,E,0,1),R=A.plus(z.times(D)),R.comparedTo(v)!=1;)A=D,D=R,U=O.plus(z.times(R=U)),O=R,E=I.minus(z.times(R=E)),I=R;return R=G(v.minus(A),D,0,1),O=O.plus(R.times(U)),A=A.plus(R.times(D)),O.s=U.s=ue.s,$=$*2,V=G(U,D,$,q).minus(ue).abs().comparedTo(G(O,A,$,q).minus(ue).abs())<1?[U,D]:[O,A],re=j,V},Y.toNumber=function(){return+qe(this)},Y.toPrecision=function(v,E){return v!=null&&x(v,1,h),tt(this,v,E,2)},Y.toString=function(v){var E,A=this,D=A.s,R=A.e;return R===null?D?(E="Infinity",D<0&&(E="-"+E)):E="NaN":(v==null?E=R<=B||R>=J?L(T(A.c),R):X(T(A.c),R,"0"):v===10&&ht?(A=Fe(new Q(A),te+R+1,q),E=X(T(A.c),A.e,"0")):(x(v,2,Ge.length,"Base"),E=Z(X(T(A.c),R,"0"),10,v,D,!0)),D<0&&A.c[0]&&(E="-"+E)),E},Y.valueOf=Y.toJSON=function(){return qe(this)},Y._isBigNumber=!0,W!=null&&Q.set(W),Q}o(g,"clone");function y(W){var G=W|0;return W>0||W===G?G:G-1}o(y,"bitFloor");function T(W){for(var G,Z,ee=1,Y=W.length,Se=W[0]+"";ee<Y;){for(G=W[ee++]+"",Z=l-G.length;Z--;G="0"+G);Se+=G}for(Y=Se.length;Se.charCodeAt(--Y)===48;);return Se.slice(0,Y+1||1)}o(T,"coeffToString");function P(W,G){var Z,ee,Y=W.c,Se=G.c,te=W.s,q=G.s,B=W.e,J=G.e;if(!te||!q)return null;if(Z=Y&&!Y[0],ee=Se&&!Se[0],Z||ee)return Z?ee?0:-q:te;if(te!=q)return te;if(Z=te<0,ee=B==J,!Y||!Se)return ee?0:!Y^Z?1:-1;if(!ee)return B>J^Z?1:-1;for(q=(B=Y.length)<(J=Se.length)?B:J,te=0;te<q;te++)if(Y[te]!=Se[te])return Y[te]>Se[te]^Z?1:-1;return B==J?0:B>J^Z?1:-1}o(P,"compare");function x(W,G,Z,ee){if(W<G||W>Z||W!==i(W))throw Error(s+(ee||"Argument")+(typeof W=="number"?W<G||W>Z?" out of range: ":" not an integer: ":" not a primitive number: ")+String(W))}o(x,"intCheck");function N(W){var G=W.c.length-1;return y(W.e/l)==G&&W.c[G]%2!=0}o(N,"isOdd");function L(W,G){return(W.length>1?W.charAt(0)+"."+W.slice(1):W)+(G<0?"e":"e+")+G}o(L,"toExponential");function X(W,G,Z){var ee,Y;if(G<0){for(Y=Z+".";++G;Y+=Z);W=Y+W}else if(ee=W.length,++G>ee){for(Y=Z,G-=ee;--G;Y+=Z);W+=Y}else G<ee&&(W=W.slice(0,G)+"."+W.slice(G));return W}o(X,"toFixedPoint"),e=g(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof _u<"u"&&_u.exports?_u.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})($P)});var DP=k((_9,zP)=>{var kP=Ud(),NP=zP.exports;(function(){"use strict";function t(p){return p<10?"0"+p:p}o(t,"f");var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,i,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c;function d(p){return r.lastIndex=0,r.test(p)?'"'+p.replace(r,function(f){var _=s[f];return typeof _=="string"?_:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+p+'"'}o(d,"quote");function l(p,f){var _,h,g,y,T=n,P,x=f[p],N=x!=null&&(x instanceof kP||kP.isBigNumber(x));switch(x&&typeof x=="object"&&typeof x.toJSON=="function"&&(x=x.toJSON(p)),typeof c=="function"&&(x=c.call(f,p,x)),typeof x){case"string":return N?x:d(x);case"number":return isFinite(x)?String(x):"null";case"boolean":case"null":case"bigint":return String(x);case"object":if(!x)return"null";if(n+=i,P=[],Object.prototype.toString.apply(x)==="[object Array]"){for(y=x.length,_=0;_<y;_+=1)P[_]=l(_,x)||"null";return g=P.length===0?"[]":n?`[
31
+ `}yield n}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>ft(Nb()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(IP(),wP))).default,this.#a}static mergeHeaders(e,...r){e=e instanceof Headers?e:new Headers(e);for(let n of r)(n instanceof Headers?n:new Headers(n)).forEach((s,c)=>{c==="set-cookie"?e.append(c,s):e.set(c,s)});return e}};Xo.Gaxios=yu;Yo=yu});var st=k(wt=>{"use strict";var a$=wt&&wt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),s$=wt&&wt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&a$(e,t,r)};Object.defineProperty(wt,"__esModule",{value:!0});wt.instance=wt.Gaxios=wt.GaxiosError=void 0;wt.request=c$;var $P=CP();Object.defineProperty(wt,"Gaxios",{enumerable:!0,get:o(function(){return $P.Gaxios},"get")});var u$=pd();Object.defineProperty(wt,"GaxiosError",{enumerable:!0,get:o(function(){return u$.GaxiosError},"get")});s$(hd(),wt);wt.instance=new $P.Gaxios;async function c$(t){return wt.instance.request(t)}o(c$,"request")});var Ud=k((kP,_u)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,s="[BigNumber Error] ",c=s+"Number primitive has more than 15 significant digits: ",d=1e14,l=14,p=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],_=1e7,h=1e9;function g(W){var G,Z,ee,Y=Q.prototype={constructor:Q,toString:null,valueOf:null},Se=new Q(1),te=20,q=4,B=-7,J=21,K=-1e7,re=1e7,oe=!1,Ae=1,Oe=0,Be={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Ge="0123456789abcdefghijklmnopqrstuvwxyz",ht=!0;function Q(v,E){var A,D,R,$,j,I,O,U,z=this;if(!(z instanceof Q))return new Q(v,E);if(E==null){if(v&&v._isBigNumber===!0){z.s=v.s,!v.c||v.e>re?z.c=z.e=null:v.e<K?z.c=[z.e=0]:(z.e=v.e,z.c=v.c.slice());return}if((I=typeof v=="number")&&v*0==0){if(z.s=1/v<0?(v=-v,-1):1,v===~~v){for($=0,j=v;j>=10;j/=10,$++);$>re?z.c=z.e=null:(z.e=$,z.c=[v]);return}U=String(v)}else{if(!r.test(U=String(v)))return ee(z,U,I);z.s=U.charCodeAt(0)==45?(U=U.slice(1),-1):1}($=U.indexOf("."))>-1&&(U=U.replace(".","")),(j=U.search(/e/i))>0?($<0&&($=j),$+=+U.slice(j+1),U=U.substring(0,j)):$<0&&($=U.length)}else{if(x(E,2,Ge.length,"Base"),E==10&&ht)return z=new Q(v),Fe(z,te+z.e+1,q);if(U=String(v),I=typeof v=="number"){if(v*0!=0)return ee(z,U,I,E);if(z.s=1/v<0?(U=U.slice(1),-1):1,Q.DEBUG&&U.replace(/^0\.0*|\./,"").length>15)throw Error(c+v)}else z.s=U.charCodeAt(0)===45?(U=U.slice(1),-1):1;for(A=Ge.slice(0,E),$=j=0,O=U.length;j<O;j++)if(A.indexOf(D=U.charAt(j))<0){if(D=="."){if(j>$){$=O;continue}}else if(!R&&(U==U.toUpperCase()&&(U=U.toLowerCase())||U==U.toLowerCase()&&(U=U.toUpperCase()))){R=!0,j=-1,$=0;continue}return ee(z,String(v),I,E)}I=!1,U=Z(U,E,10,z.s),($=U.indexOf("."))>-1?U=U.replace(".",""):$=U.length}for(j=0;U.charCodeAt(j)===48;j++);for(O=U.length;U.charCodeAt(--O)===48;);if(U=U.slice(j,++O)){if(O-=j,I&&Q.DEBUG&&O>15&&(v>p||v!==i(v)))throw Error(c+z.s*v);if(($=$-j-1)>re)z.c=z.e=null;else if($<K)z.c=[z.e=0];else{if(z.e=$,z.c=[],j=($+1)%l,$<0&&(j+=l),j<O){for(j&&z.c.push(+U.slice(0,j)),O-=l;j<O;)z.c.push(+U.slice(j,j+=l));j=l-(U=U.slice(j)).length}else j-=O;for(;j--;U+="0");z.c.push(+U)}}else z.c=[z.e=0]}o(Q,"BigNumber"),Q.clone=g,Q.ROUND_UP=0,Q.ROUND_DOWN=1,Q.ROUND_CEIL=2,Q.ROUND_FLOOR=3,Q.ROUND_HALF_UP=4,Q.ROUND_HALF_DOWN=5,Q.ROUND_HALF_EVEN=6,Q.ROUND_HALF_CEIL=7,Q.ROUND_HALF_FLOOR=8,Q.EUCLID=9,Q.config=Q.set=function(v){var E,A;if(v!=null)if(typeof v=="object"){if(v.hasOwnProperty(E="DECIMAL_PLACES")&&(A=v[E],x(A,0,h,E),te=A),v.hasOwnProperty(E="ROUNDING_MODE")&&(A=v[E],x(A,0,8,E),q=A),v.hasOwnProperty(E="EXPONENTIAL_AT")&&(A=v[E],A&&A.pop?(x(A[0],-h,0,E),x(A[1],0,h,E),B=A[0],J=A[1]):(x(A,-h,h,E),B=-(J=A<0?-A:A))),v.hasOwnProperty(E="RANGE"))if(A=v[E],A&&A.pop)x(A[0],-h,-1,E),x(A[1],1,h,E),K=A[0],re=A[1];else if(x(A,-h,h,E),A)K=-(re=A<0?-A:A);else throw Error(s+E+" cannot be zero: "+A);if(v.hasOwnProperty(E="CRYPTO"))if(A=v[E],A===!!A)if(A)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))oe=A;else throw oe=!A,Error(s+"crypto unavailable");else oe=A;else throw Error(s+E+" not true or false: "+A);if(v.hasOwnProperty(E="MODULO_MODE")&&(A=v[E],x(A,0,9,E),Ae=A),v.hasOwnProperty(E="POW_PRECISION")&&(A=v[E],x(A,0,h,E),Oe=A),v.hasOwnProperty(E="FORMAT"))if(A=v[E],typeof A=="object")Be=A;else throw Error(s+E+" not an object: "+A);if(v.hasOwnProperty(E="ALPHABET"))if(A=v[E],typeof A=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(A))ht=A.slice(0,10)=="0123456789",Ge=A;else throw Error(s+E+" invalid: "+A)}else throw Error(s+"Object expected: "+v);return{DECIMAL_PLACES:te,ROUNDING_MODE:q,EXPONENTIAL_AT:[B,J],RANGE:[K,re],CRYPTO:oe,MODULO_MODE:Ae,POW_PRECISION:Oe,FORMAT:Be,ALPHABET:Ge}},Q.isBigNumber=function(v){if(!v||v._isBigNumber!==!0)return!1;if(!Q.DEBUG)return!0;var E,A,D=v.c,R=v.e,$=v.s;e:if({}.toString.call(D)=="[object Array]"){if(($===1||$===-1)&&R>=-h&&R<=h&&R===i(R)){if(D[0]===0){if(R===0&&D.length===1)return!0;break e}if(E=(R+1)%l,E<1&&(E+=l),String(D[0]).length==E){for(E=0;E<D.length;E++)if(A=D[E],A<0||A>=d||A!==i(A))break e;if(A!==0)return!0}}}else if(D===null&&R===null&&($===null||$===1||$===-1))return!0;throw Error(s+"Invalid BigNumber: "+v)},Q.maximum=Q.max=function(){return it(arguments,-1)},Q.minimum=Q.min=function(){return it(arguments,1)},Q.random=(function(){var v=9007199254740992,E=Math.random()*v&2097151?function(){return i(Math.random()*v)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(A){var D,R,$,j,I,O=0,U=[],z=new Q(Se);if(A==null?A=te:x(A,0,h),j=n(A/l),oe)if(crypto.getRandomValues){for(D=crypto.getRandomValues(new Uint32Array(j*=2));O<j;)I=D[O]*131072+(D[O+1]>>>11),I>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),D[O]=R[0],D[O+1]=R[1]):(U.push(I%1e14),O+=2);O=j/2}else if(crypto.randomBytes){for(D=crypto.randomBytes(j*=7);O<j;)I=(D[O]&31)*281474976710656+D[O+1]*1099511627776+D[O+2]*4294967296+D[O+3]*16777216+(D[O+4]<<16)+(D[O+5]<<8)+D[O+6],I>=9e15?crypto.randomBytes(7).copy(D,O):(U.push(I%1e14),O+=7);O=j/7}else throw oe=!1,Error(s+"crypto unavailable");if(!oe)for(;O<j;)I=E(),I<9e15&&(U[O++]=I%1e14);for(j=U[--O],A%=l,j&&A&&(I=f[l-A],U[O]=i(j/I)*I);U[O]===0;U.pop(),O--);if(O<0)U=[$=0];else{for($=-1;U[0]===0;U.splice(0,1),$-=l);for(O=1,I=U[0];I>=10;I/=10,O++);O<l&&($-=l-O)}return z.e=$,z.c=U,z}})(),Q.sum=function(){for(var v=1,E=arguments,A=new Q(E[0]);v<E.length;)A=A.plus(E[v++]);return A},Z=(function(){var v="0123456789";function E(A,D,R,$){for(var j,I=[0],O,U=0,z=A.length;U<z;){for(O=I.length;O--;I[O]*=D);for(I[0]+=$.indexOf(A.charAt(U++)),j=0;j<I.length;j++)I[j]>R-1&&(I[j+1]==null&&(I[j+1]=0),I[j+1]+=I[j]/R|0,I[j]%=R)}return I.reverse()}return o(E,"toBaseOut"),function(A,D,R,$,j){var I,O,U,z,V,ie,ue,De,Je=A.indexOf("."),Ye=te,ze=q;for(Je>=0&&(z=Oe,Oe=0,A=A.replace(".",""),De=new Q(D),ie=De.pow(A.length-Je),Oe=z,De.c=E(X(T(ie.c),ie.e,"0"),10,R,v),De.e=De.c.length),ue=E(A,D,R,j?(I=Ge,v):(I=v,Ge)),U=z=ue.length;ue[--z]==0;ue.pop());if(!ue[0])return I.charAt(0);if(Je<0?--U:(ie.c=ue,ie.e=U,ie.s=$,ie=G(ie,De,Ye,ze,R),ue=ie.c,V=ie.r,U=ie.e),O=U+Ye+1,Je=ue[O],z=R/2,V=V||O<0||ue[O+1]!=null,V=ze<4?(Je!=null||V)&&(ze==0||ze==(ie.s<0?3:2)):Je>z||Je==z&&(ze==4||V||ze==6&&ue[O-1]&1||ze==(ie.s<0?8:7)),O<1||!ue[0])A=V?X(I.charAt(1),-Ye,I.charAt(0)):I.charAt(0);else{if(ue.length=O,V)for(--R;++ue[--O]>R;)ue[O]=0,O||(++U,ue=[1].concat(ue));for(z=ue.length;!ue[--z];);for(Je=0,A="";Je<=z;A+=I.charAt(ue[Je++]));A=X(A,U,I.charAt(0))}return A}})(),G=(function(){function v(D,R,$){var j,I,O,U,z=0,V=D.length,ie=R%_,ue=R/_|0;for(D=D.slice();V--;)O=D[V]%_,U=D[V]/_|0,j=ue*O+U*ie,I=ie*O+j%_*_+z,z=(I/$|0)+(j/_|0)+ue*U,D[V]=I%$;return z&&(D=[z].concat(D)),D}o(v,"multiply");function E(D,R,$,j){var I,O;if($!=j)O=$>j?1:-1;else for(I=O=0;I<$;I++)if(D[I]!=R[I]){O=D[I]>R[I]?1:-1;break}return O}o(E,"compare");function A(D,R,$,j){for(var I=0;$--;)D[$]-=I,I=D[$]<R[$]?1:0,D[$]=I*j+D[$]-R[$];for(;!D[0]&&D.length>1;D.splice(0,1));}return o(A,"subtract"),function(D,R,$,j,I){var O,U,z,V,ie,ue,De,Je,Ye,ze,Le,dt,yo,_o,vo,zt,qr,Pt=D.s==R.s?1:-1,pt=D.c,Ve=R.c;if(!pt||!pt[0]||!Ve||!Ve[0])return new Q(!D.s||!R.s||(pt?Ve&&pt[0]==Ve[0]:!Ve)?NaN:pt&&pt[0]==0||!Ve?Pt*0:Pt/0);for(Je=new Q(Pt),Ye=Je.c=[],U=D.e-R.e,Pt=$+U+1,I||(I=d,U=y(D.e/l)-y(R.e/l),Pt=Pt/l|0),z=0;Ve[z]==(pt[z]||0);z++);if(Ve[z]>(pt[z]||0)&&U--,Pt<0)Ye.push(1),V=!0;else{for(_o=pt.length,zt=Ve.length,z=0,Pt+=2,ie=i(I/(Ve[0]+1)),ie>1&&(Ve=v(Ve,ie,I),pt=v(pt,ie,I),zt=Ve.length,_o=pt.length),yo=zt,ze=pt.slice(0,zt),Le=ze.length;Le<zt;ze[Le++]=0);qr=Ve.slice(),qr=[0].concat(qr),vo=Ve[0],Ve[1]>=I/2&&vo++;do{if(ie=0,O=E(Ve,ze,zt,Le),O<0){if(dt=ze[0],zt!=Le&&(dt=dt*I+(ze[1]||0)),ie=i(dt/vo),ie>1)for(ie>=I&&(ie=I-1),ue=v(Ve,ie,I),De=ue.length,Le=ze.length;E(ue,ze,De,Le)==1;)ie--,A(ue,zt<De?qr:Ve,De,I),De=ue.length,O=1;else ie==0&&(O=ie=1),ue=Ve.slice(),De=ue.length;if(De<Le&&(ue=[0].concat(ue)),A(ze,ue,Le,I),Le=ze.length,O==-1)for(;E(Ve,ze,zt,Le)<1;)ie++,A(ze,zt<Le?qr:Ve,Le,I),Le=ze.length}else O===0&&(ie++,ze=[0]);Ye[z++]=ie,ze[0]?ze[Le++]=pt[yo]||0:(ze=[pt[yo]],Le=1)}while((yo++<_o||ze[0]!=null)&&Pt--);V=ze[0]!=null,Ye[0]||Ye.splice(0,1)}if(I==d){for(z=1,Pt=Ye[0];Pt>=10;Pt/=10,z++);Fe(Je,$+(Je.e=z+U*l-1)+1,j,V)}else Je.e=U,Je.r=+V;return Je}})();function tt(v,E,A,D){var R,$,j,I,O;if(A==null?A=q:x(A,0,8),!v.c)return v.toString();if(R=v.c[0],j=v.e,E==null)O=T(v.c),O=D==1||D==2&&(j<=B||j>=J)?L(O,j):X(O,j,"0");else if(v=Fe(new Q(v),E,A),$=v.e,O=T(v.c),I=O.length,D==1||D==2&&(E<=$||$<=B)){for(;I<E;O+="0",I++);O=L(O,$)}else if(E-=j+(D===2&&$>j),O=X(O,$,"0"),$+1>I){if(--E>0)for(O+=".";E--;O+="0");}else if(E+=$-I,E>0)for($+1==I&&(O+=".");E--;O+="0");return v.s<0&&R?"-"+O:O}o(tt,"format");function it(v,E){for(var A,D,R=1,$=new Q(v[0]);R<v.length;R++)D=new Q(v[R]),(!D.s||(A=P($,D))===E||A===0&&$.s===E)&&($=D);return $}o(it,"maxOrMin");function Nt(v,E,A){for(var D=1,R=E.length;!E[--R];E.pop());for(R=E[0];R>=10;R/=10,D++);return(A=D+A*l-1)>re?v.c=v.e=null:A<K?v.c=[v.e=0]:(v.e=A,v.c=E),v}o(Nt,"normalise"),ee=(function(){var v=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,A=/^\.([^.]+)$/,D=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,j,I,O){var U,z=I?j:j.replace(R,"");if(D.test(z))$.s=isNaN(z)?null:z<0?-1:1;else{if(!I&&(z=z.replace(v,function(V,ie,ue){return U=(ue=ue.toLowerCase())=="x"?16:ue=="b"?2:8,!O||O==U?ie:V}),O&&(U=O,z=z.replace(E,"$1").replace(A,"0.$1")),j!=z))return new Q(z,U);if(Q.DEBUG)throw Error(s+"Not a"+(O?" base "+O:"")+" number: "+j);$.s=null}$.c=$.e=null}})();function Fe(v,E,A,D){var R,$,j,I,O,U,z,V=v.c,ie=f;if(V){e:{for(R=1,I=V[0];I>=10;I/=10,R++);if($=E-R,$<0)$+=l,j=E,O=V[U=0],z=i(O/ie[R-j-1]%10);else if(U=n(($+1)/l),U>=V.length)if(D){for(;V.length<=U;V.push(0));O=z=0,R=1,$%=l,j=$-l+1}else break e;else{for(O=I=V[U],R=1;I>=10;I/=10,R++);$%=l,j=$-l+R,z=j<0?0:i(O/ie[R-j-1]%10)}if(D=D||E<0||V[U+1]!=null||(j<0?O:O%ie[R-j-1]),D=A<4?(z||D)&&(A==0||A==(v.s<0?3:2)):z>5||z==5&&(A==4||D||A==6&&($>0?j>0?O/ie[R-j]:0:V[U-1])%10&1||A==(v.s<0?8:7)),E<1||!V[0])return V.length=0,D?(E-=v.e+1,V[0]=ie[(l-E%l)%l],v.e=-E||0):V[0]=v.e=0,v;if($==0?(V.length=U,I=1,U--):(V.length=U+1,I=ie[l-$],V[U]=j>0?i(O/ie[R-j]%ie[j])*I:0),D)for(;;)if(U==0){for($=1,j=V[0];j>=10;j/=10,$++);for(j=V[0]+=I,I=1;j>=10;j/=10,I++);$!=I&&(v.e++,V[0]==d&&(V[0]=1));break}else{if(V[U]+=I,V[U]!=d)break;V[U--]=0,I=1}for($=V.length;V[--$]===0;V.pop());}v.e>re?v.c=v.e=null:v.e<K&&(v.c=[v.e=0])}return v}o(Fe,"round");function qe(v){var E,A=v.e;return A===null?v.toString():(E=T(v.c),E=A<=B||A>=J?L(E,A):X(E,A,"0"),v.s<0?"-"+E:E)}return o(qe,"valueOf"),Y.absoluteValue=Y.abs=function(){var v=new Q(this);return v.s<0&&(v.s=1),v},Y.comparedTo=function(v,E){return P(this,new Q(v,E))},Y.decimalPlaces=Y.dp=function(v,E){var A,D,R,$=this;if(v!=null)return x(v,0,h),E==null?E=q:x(E,0,8),Fe(new Q($),v+$.e+1,E);if(!(A=$.c))return null;if(D=((R=A.length-1)-y(this.e/l))*l,R=A[R])for(;R%10==0;R/=10,D--);return D<0&&(D=0),D},Y.dividedBy=Y.div=function(v,E){return G(this,new Q(v,E),te,q)},Y.dividedToIntegerBy=Y.idiv=function(v,E){return G(this,new Q(v,E),0,1)},Y.exponentiatedBy=Y.pow=function(v,E){var A,D,R,$,j,I,O,U,z,V=this;if(v=new Q(v),v.c&&!v.isInteger())throw Error(s+"Exponent not an integer: "+qe(v));if(E!=null&&(E=new Q(E)),I=v.e>14,!V.c||!V.c[0]||V.c[0]==1&&!V.e&&V.c.length==1||!v.c||!v.c[0])return z=new Q(Math.pow(+qe(V),I?v.s*(2-N(v)):+qe(v))),E?z.mod(E):z;if(O=v.s<0,E){if(E.c?!E.c[0]:!E.s)return new Q(NaN);D=!O&&V.isInteger()&&E.isInteger(),D&&(V=V.mod(E))}else{if(v.e>9&&(V.e>0||V.e<-1||(V.e==0?V.c[0]>1||I&&V.c[1]>=24e7:V.c[0]<8e13||I&&V.c[0]<=9999975e7)))return $=V.s<0&&N(v)?-0:0,V.e>-1&&($=1/$),new Q(O?1/$:$);Oe&&($=n(Oe/l+2))}for(I?(A=new Q(.5),O&&(v.s=1),U=N(v)):(R=Math.abs(+qe(v)),U=R%2),z=new Q(Se);;){if(U){if(z=z.times(V),!z.c)break;$?z.c.length>$&&(z.c.length=$):D&&(z=z.mod(E))}if(R){if(R=i(R/2),R===0)break;U=R%2}else if(v=v.times(A),Fe(v,v.e+1,1),v.e>14)U=N(v);else{if(R=+qe(v),R===0)break;U=R%2}V=V.times(V),$?V.c&&V.c.length>$&&(V.c.length=$):D&&(V=V.mod(E))}return D?z:(O&&(z=Se.div(z)),E?z.mod(E):$?Fe(z,Oe,q,j):z)},Y.integerValue=function(v){var E=new Q(this);return v==null?v=q:x(v,0,8),Fe(E,E.e+1,v)},Y.isEqualTo=Y.eq=function(v,E){return P(this,new Q(v,E))===0},Y.isFinite=function(){return!!this.c},Y.isGreaterThan=Y.gt=function(v,E){return P(this,new Q(v,E))>0},Y.isGreaterThanOrEqualTo=Y.gte=function(v,E){return(E=P(this,new Q(v,E)))===1||E===0},Y.isInteger=function(){return!!this.c&&y(this.e/l)>this.c.length-2},Y.isLessThan=Y.lt=function(v,E){return P(this,new Q(v,E))<0},Y.isLessThanOrEqualTo=Y.lte=function(v,E){return(E=P(this,new Q(v,E)))===-1||E===0},Y.isNaN=function(){return!this.s},Y.isNegative=function(){return this.s<0},Y.isPositive=function(){return this.s>0},Y.isZero=function(){return!!this.c&&this.c[0]==0},Y.minus=function(v,E){var A,D,R,$,j=this,I=j.s;if(v=new Q(v,E),E=v.s,!I||!E)return new Q(NaN);if(I!=E)return v.s=-E,j.plus(v);var O=j.e/l,U=v.e/l,z=j.c,V=v.c;if(!O||!U){if(!z||!V)return z?(v.s=-E,v):new Q(V?j:NaN);if(!z[0]||!V[0])return V[0]?(v.s=-E,v):new Q(z[0]?j:q==3?-0:0)}if(O=y(O),U=y(U),z=z.slice(),I=O-U){for(($=I<0)?(I=-I,R=z):(U=O,R=V),R.reverse(),E=I;E--;R.push(0));R.reverse()}else for(D=($=(I=z.length)<(E=V.length))?I:E,I=E=0;E<D;E++)if(z[E]!=V[E]){$=z[E]<V[E];break}if($&&(R=z,z=V,V=R,v.s=-v.s),E=(D=V.length)-(A=z.length),E>0)for(;E--;z[A++]=0);for(E=d-1;D>I;){if(z[--D]<V[D]){for(A=D;A&&!z[--A];z[A]=E);--z[A],z[D]+=d}z[D]-=V[D]}for(;z[0]==0;z.splice(0,1),--U);return z[0]?Nt(v,z,U):(v.s=q==3?-1:1,v.c=[v.e=0],v)},Y.modulo=Y.mod=function(v,E){var A,D,R=this;return v=new Q(v,E),!R.c||!v.s||v.c&&!v.c[0]?new Q(NaN):!v.c||R.c&&!R.c[0]?new Q(R):(Ae==9?(D=v.s,v.s=1,A=G(R,v,0,3),v.s=D,A.s*=D):A=G(R,v,0,Ae),v=R.minus(A.times(v)),!v.c[0]&&Ae==1&&(v.s=R.s),v)},Y.multipliedBy=Y.times=function(v,E){var A,D,R,$,j,I,O,U,z,V,ie,ue,De,Je,Ye,ze=this,Le=ze.c,dt=(v=new Q(v,E)).c;if(!Le||!dt||!Le[0]||!dt[0])return!ze.s||!v.s||Le&&!Le[0]&&!dt||dt&&!dt[0]&&!Le?v.c=v.e=v.s=null:(v.s*=ze.s,!Le||!dt?v.c=v.e=null:(v.c=[0],v.e=0)),v;for(D=y(ze.e/l)+y(v.e/l),v.s*=ze.s,O=Le.length,V=dt.length,O<V&&(De=Le,Le=dt,dt=De,R=O,O=V,V=R),R=O+V,De=[];R--;De.push(0));for(Je=d,Ye=_,R=V;--R>=0;){for(A=0,ie=dt[R]%Ye,ue=dt[R]/Ye|0,j=O,$=R+j;$>R;)U=Le[--j]%Ye,z=Le[j]/Ye|0,I=ue*U+z*ie,U=ie*U+I%Ye*Ye+De[$]+A,A=(U/Je|0)+(I/Ye|0)+ue*z,De[$--]=U%Je;De[$]=A}return A?++D:De.splice(0,1),Nt(v,De,D)},Y.negated=function(){var v=new Q(this);return v.s=-v.s||null,v},Y.plus=function(v,E){var A,D=this,R=D.s;if(v=new Q(v,E),E=v.s,!R||!E)return new Q(NaN);if(R!=E)return v.s=-E,D.minus(v);var $=D.e/l,j=v.e/l,I=D.c,O=v.c;if(!$||!j){if(!I||!O)return new Q(R/0);if(!I[0]||!O[0])return O[0]?v:new Q(I[0]?D:R*0)}if($=y($),j=y(j),I=I.slice(),R=$-j){for(R>0?(j=$,A=O):(R=-R,A=I),A.reverse();R--;A.push(0));A.reverse()}for(R=I.length,E=O.length,R-E<0&&(A=O,O=I,I=A,E=R),R=0;E;)R=(I[--E]=I[E]+O[E]+R)/d|0,I[E]=d===I[E]?0:I[E]%d;return R&&(I=[R].concat(I),++j),Nt(v,I,j)},Y.precision=Y.sd=function(v,E){var A,D,R,$=this;if(v!=null&&v!==!!v)return x(v,1,h),E==null?E=q:x(E,0,8),Fe(new Q($),v,E);if(!(A=$.c))return null;if(R=A.length-1,D=R*l+1,R=A[R]){for(;R%10==0;R/=10,D--);for(R=A[0];R>=10;R/=10,D++);}return v&&$.e+1>D&&(D=$.e+1),D},Y.shiftedBy=function(v){return x(v,-p,p),this.times("1e"+v)},Y.squareRoot=Y.sqrt=function(){var v,E,A,D,R,$=this,j=$.c,I=$.s,O=$.e,U=te+4,z=new Q("0.5");if(I!==1||!j||!j[0])return new Q(!I||I<0&&(!j||j[0])?NaN:j?$:1/0);if(I=Math.sqrt(+qe($)),I==0||I==1/0?(E=T(j),(E.length+O)%2==0&&(E+="0"),I=Math.sqrt(+E),O=y((O+1)/2)-(O<0||O%2),I==1/0?E="5e"+O:(E=I.toExponential(),E=E.slice(0,E.indexOf("e")+1)+O),A=new Q(E)):A=new Q(I+""),A.c[0]){for(O=A.e,I=O+U,I<3&&(I=0);;)if(R=A,A=z.times(R.plus(G($,R,U,1))),T(R.c).slice(0,I)===(E=T(A.c)).slice(0,I))if(A.e<O&&--I,E=E.slice(I-3,I+1),E=="9999"||!D&&E=="4999"){if(!D&&(Fe(R,R.e+te+2,0),R.times(R).eq($))){A=R;break}U+=4,I+=4,D=1}else{(!+E||!+E.slice(1)&&E.charAt(0)=="5")&&(Fe(A,A.e+te+2,1),v=!A.times(A).eq($));break}}return Fe(A,A.e+te+1,q,v)},Y.toExponential=function(v,E){return v!=null&&(x(v,0,h),v++),tt(this,v,E,1)},Y.toFixed=function(v,E){return v!=null&&(x(v,0,h),v=v+this.e+1),tt(this,v,E)},Y.toFormat=function(v,E,A){var D,R=this;if(A==null)v!=null&&E&&typeof E=="object"?(A=E,E=null):v&&typeof v=="object"?(A=v,v=E=null):A=Be;else if(typeof A!="object")throw Error(s+"Argument not an object: "+A);if(D=R.toFixed(v,E),R.c){var $,j=D.split("."),I=+A.groupSize,O=+A.secondaryGroupSize,U=A.groupSeparator||"",z=j[0],V=j[1],ie=R.s<0,ue=ie?z.slice(1):z,De=ue.length;if(O&&($=I,I=O,O=$,De-=$),I>0&&De>0){for($=De%I||I,z=ue.substr(0,$);$<De;$+=I)z+=U+ue.substr($,I);O>0&&(z+=U+ue.slice($)),ie&&(z="-"+z)}D=V?z+(A.decimalSeparator||"")+((O=+A.fractionGroupSize)?V.replace(new RegExp("\\d{"+O+"}\\B","g"),"$&"+(A.fractionGroupSeparator||"")):V):z}return(A.prefix||"")+D+(A.suffix||"")},Y.toFraction=function(v){var E,A,D,R,$,j,I,O,U,z,V,ie,ue=this,De=ue.c;if(v!=null&&(I=new Q(v),!I.isInteger()&&(I.c||I.s!==1)||I.lt(Se)))throw Error(s+"Argument "+(I.isInteger()?"out of range: ":"not an integer: ")+qe(I));if(!De)return new Q(ue);for(E=new Q(Se),U=A=new Q(Se),D=O=new Q(Se),ie=T(De),$=E.e=ie.length-ue.e-1,E.c[0]=f[(j=$%l)<0?l+j:j],v=!v||I.comparedTo(E)>0?$>0?E:U:I,j=re,re=1/0,I=new Q(ie),O.c[0]=0;z=G(I,E,0,1),R=A.plus(z.times(D)),R.comparedTo(v)!=1;)A=D,D=R,U=O.plus(z.times(R=U)),O=R,E=I.minus(z.times(R=E)),I=R;return R=G(v.minus(A),D,0,1),O=O.plus(R.times(U)),A=A.plus(R.times(D)),O.s=U.s=ue.s,$=$*2,V=G(U,D,$,q).minus(ue).abs().comparedTo(G(O,A,$,q).minus(ue).abs())<1?[U,D]:[O,A],re=j,V},Y.toNumber=function(){return+qe(this)},Y.toPrecision=function(v,E){return v!=null&&x(v,1,h),tt(this,v,E,2)},Y.toString=function(v){var E,A=this,D=A.s,R=A.e;return R===null?D?(E="Infinity",D<0&&(E="-"+E)):E="NaN":(v==null?E=R<=B||R>=J?L(T(A.c),R):X(T(A.c),R,"0"):v===10&&ht?(A=Fe(new Q(A),te+R+1,q),E=X(T(A.c),A.e,"0")):(x(v,2,Ge.length,"Base"),E=Z(X(T(A.c),R,"0"),10,v,D,!0)),D<0&&A.c[0]&&(E="-"+E)),E},Y.valueOf=Y.toJSON=function(){return qe(this)},Y._isBigNumber=!0,W!=null&&Q.set(W),Q}o(g,"clone");function y(W){var G=W|0;return W>0||W===G?G:G-1}o(y,"bitFloor");function T(W){for(var G,Z,ee=1,Y=W.length,Se=W[0]+"";ee<Y;){for(G=W[ee++]+"",Z=l-G.length;Z--;G="0"+G);Se+=G}for(Y=Se.length;Se.charCodeAt(--Y)===48;);return Se.slice(0,Y+1||1)}o(T,"coeffToString");function P(W,G){var Z,ee,Y=W.c,Se=G.c,te=W.s,q=G.s,B=W.e,J=G.e;if(!te||!q)return null;if(Z=Y&&!Y[0],ee=Se&&!Se[0],Z||ee)return Z?ee?0:-q:te;if(te!=q)return te;if(Z=te<0,ee=B==J,!Y||!Se)return ee?0:!Y^Z?1:-1;if(!ee)return B>J^Z?1:-1;for(q=(B=Y.length)<(J=Se.length)?B:J,te=0;te<q;te++)if(Y[te]!=Se[te])return Y[te]>Se[te]^Z?1:-1;return B==J?0:B>J^Z?1:-1}o(P,"compare");function x(W,G,Z,ee){if(W<G||W>Z||W!==i(W))throw Error(s+(ee||"Argument")+(typeof W=="number"?W<G||W>Z?" out of range: ":" not an integer: ":" not a primitive number: ")+String(W))}o(x,"intCheck");function N(W){var G=W.c.length-1;return y(W.e/l)==G&&W.c[G]%2!=0}o(N,"isOdd");function L(W,G){return(W.length>1?W.charAt(0)+"."+W.slice(1):W)+(G<0?"e":"e+")+G}o(L,"toExponential");function X(W,G,Z){var ee,Y;if(G<0){for(Y=Z+".";++G;Y+=Z);W=Y+W}else if(ee=W.length,++G>ee){for(Y=Z,G-=ee;--G;Y+=Z);W+=Y}else G<ee&&(W=W.slice(0,G)+"."+W.slice(G));return W}o(X,"toFixedPoint"),e=g(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof _u<"u"&&_u.exports?_u.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(kP)});var UP=k((S9,DP)=>{var NP=Ud(),zP=DP.exports;(function(){"use strict";function t(p){return p<10?"0"+p:p}o(t,"f");var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,i,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c;function d(p){return r.lastIndex=0,r.test(p)?'"'+p.replace(r,function(f){var _=s[f];return typeof _=="string"?_:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+p+'"'}o(d,"quote");function l(p,f){var _,h,g,y,T=n,P,x=f[p],N=x!=null&&(x instanceof NP||NP.isBigNumber(x));switch(x&&typeof x=="object"&&typeof x.toJSON=="function"&&(x=x.toJSON(p)),typeof c=="function"&&(x=c.call(f,p,x)),typeof x){case"string":return N?x:d(x);case"number":return isFinite(x)?String(x):"null";case"boolean":case"null":case"bigint":return String(x);case"object":if(!x)return"null";if(n+=i,P=[],Object.prototype.toString.apply(x)==="[object Array]"){for(y=x.length,_=0;_<y;_+=1)P[_]=l(_,x)||"null";return g=P.length===0?"[]":n?`[
32
32
  `+n+P.join(`,
33
33
  `+n)+`
34
34
  `+T+"]":"["+P.join(",")+"]",n=T,g}if(c&&typeof c=="object")for(y=c.length,_=0;_<y;_+=1)typeof c[_]=="string"&&(h=c[_],g=l(h,x),g&&P.push(d(h)+(n?": ":":")+g));else Object.keys(x).forEach(function(L){var X=l(L,x);X&&P.push(d(L)+(n?": ":":")+X)});return g=P.length===0?"{}":n?`{
35
35
  `+n+P.join(`,
36
36
  `+n)+`
37
- `+T+"}":"{"+P.join(",")+"}",n=T,g}}o(l,"str"),typeof NP.stringify!="function"&&(NP.stringify=function(p,f,_){var h;if(n="",i="",typeof _=="number")for(h=0;h<_;h+=1)i+=" ";else typeof _=="string"&&(i=_);if(c=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return l("",{"":p})})})()});var MP=k((b9,UP)=>{var vu=null,u$=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,c$=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/,l$=o(function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(t!=null){if(t.strict===!0&&(e.strict=!0),t.storeAsString===!0&&(e.storeAsString=!0),e.alwaysParseAsBig=t.alwaysParseAsBig===!0?t.alwaysParseAsBig:!1,e.useNativeBigInt=t.useNativeBigInt===!0?t.useNativeBigInt:!1,typeof t.constructorAction<"u")if(t.constructorAction==="error"||t.constructorAction==="ignore"||t.constructorAction==="preserve")e.constructorAction=t.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);if(typeof t.protoAction<"u")if(t.protoAction==="error"||t.protoAction==="ignore"||t.protoAction==="preserve")e.protoAction=t.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`)}var r,n,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
38
- `,r:"\r",t:" "},s,c=o(function(T){throw{name:"SyntaxError",message:T,at:r,text:s}},"error"),d=o(function(T){return T&&T!==n&&c("Expected '"+T+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),l=o(function(){var T,P="";for(n==="-"&&(P="-",d("-"));n>="0"&&n<="9";)P+=n,d();if(n===".")for(P+=".";d()&&n>="0"&&n<="9";)P+=n;if(n==="e"||n==="E")for(P+=n,d(),(n==="-"||n==="+")&&(P+=n,d());n>="0"&&n<="9";)P+=n,d();if(T=+P,!isFinite(T))c("Bad number");else return vu==null&&(vu=Ud()),P.length>15?e.storeAsString?P:e.useNativeBigInt?BigInt(P):new vu(P):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(T):new vu(T):T},"number"),p=o(function(){var T,P,x="",N;if(n==='"')for(var L=r;d();){if(n==='"')return r-1>L&&(x+=s.substring(L,r-1)),d(),x;if(n==="\\"){if(r-1>L&&(x+=s.substring(L,r-1)),d(),n==="u"){for(N=0,P=0;P<4&&(T=parseInt(d(),16),!!isFinite(T));P+=1)N=N*16+T;x+=String.fromCharCode(N)}else if(typeof i[n]=="string")x+=i[n];else break;L=r}}c("Bad string")},"string"),f=o(function(){for(;n&&n<=" ";)d()},"white"),_=o(function(){switch(n){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}c("Unexpected '"+n+"'")},"word"),h,g=o(function(){var T=[];if(n==="["){if(d("["),f(),n==="]")return d("]"),T;for(;n;){if(T.push(h()),f(),n==="]")return d("]"),T;d(","),f()}}c("Bad array")},"array"),y=o(function(){var T,P=Object.create(null);if(n==="{"){if(d("{"),f(),n==="}")return d("}"),P;for(;n;){if(T=p(),f(),d(":"),e.strict===!0&&Object.hasOwnProperty.call(P,T)&&c('Duplicate key "'+T+'"'),u$.test(T)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?h():P[T]=h():c$.test(T)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?h():P[T]=h():P[T]=h(),f(),n==="}")return d("}"),P;d(","),f()}}c("Bad object")},"object");return h=o(function(){switch(f(),n){case"{":return y();case"[":return g();case'"':return p();case"-":return l();default:return n>="0"&&n<="9"?l():_()}},"value"),function(T,P){var x;return s=T+"",r=0,n=" ",x=h(),f(),n&&c("Syntax error"),typeof P=="function"?o((function N(L,X){var W,G,Z=L[X];return Z&&typeof Z=="object"&&Object.keys(Z).forEach(function(ee){G=N(Z,ee),G!==void 0?Z[ee]=G:delete Z[ee]}),P.call(L,X,Z)}),"walk")({"":x},""):x}},"json_parse");UP.exports=l$});var FP=k((S9,bu)=>{var jP=DP().stringify,LP=MP();bu.exports=function(t){return{parse:LP(t),stringify:jP}};bu.exports.parse=LP();bu.exports.stringify=jP});var Md=k(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.GCE_LINUX_BIOS_PATHS=void 0;yr.isGoogleCloudServerless=VP;yr.isGoogleComputeEngineLinux=HP;yr.isGoogleComputeEngineMACAddress=GP;yr.isGoogleComputeEngine=WP;yr.detectGCPResidency=p$;var BP=require("fs"),qP=require("os");yr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var d$=/^42:01/;function VP(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(VP,"isGoogleCloudServerless");function HP(){if((0,qP.platform)()!=="linux")return!1;try{(0,BP.statSync)(yr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,BP.readFileSync)(yr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(HP,"isGoogleComputeEngineLinux");function GP(){let t=(0,qP.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(d$.test(r))return!0}return!1}o(GP,"isGoogleComputeEngineMACAddress");function WP(){return HP()||GP()}o(WP,"isGoogleComputeEngine");function p$(){return VP()||WP()}o(p$,"detectGCPResidency")});var ZP=k(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.Colours=void 0;var Et=class t{static{o(this,"Colours")}static isEnabled(e){return e&&e.isTTY&&(typeof e.getColorDepth=="function"?e.getColorDepth()>2:!0)}static refresh(){t.enabled=t.isEnabled(process==null?void 0:process.stderr),this.enabled?(t.reset="\x1B[0m",t.bright="\x1B[1m",t.dim="\x1B[2m",t.red="\x1B[31m",t.green="\x1B[32m",t.yellow="\x1B[33m",t.blue="\x1B[34m",t.magenta="\x1B[35m",t.cyan="\x1B[36m",t.white="\x1B[37m",t.grey="\x1B[90m"):(t.reset="",t.bright="",t.dim="",t.red="",t.green="",t.yellow="",t.blue="",t.magenta="",t.cyan="",t.white="",t.grey="")}};Pu.Colours=Et;Et.enabled=!1;Et.reset="";Et.bright="";Et.dim="";Et.red="";Et.green="";Et.yellow="";Et.blue="";Et.magenta="";Et.cyan="";Et.white="";Et.grey="";Et.refresh()});var XP=k(He=>{"use strict";var f$=He&&He.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),m$=He&&He.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),KP=He&&He.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&f$(r,e,n[i]);return m$(r,e),r}})();Object.defineProperty(He,"__esModule",{value:!0});He.env=He.DebugLogBackendBase=He.placeholder=He.AdhocDebugLogger=He.LogSeverity=void 0;He.getNodeBackend=Ld;He.getDebugBackend=g$;He.getStructuredBackend=y$;He.setBackend=_$;He.log=YP;var h$=require("events"),pa=KP(require("process")),JP=KP(require("util")),qt=ZP(),_r;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(_r||(He.LogSeverity=_r={}));var fa=class extends h$.EventEmitter{static{o(this,"AdhocDebugLogger")}constructor(e,r){super(),this.namespace=e,this.upstream=r,this.func=Object.assign(this.invoke.bind(this),{instance:this,on:o((n,i)=>this.on(n,i),"on")}),this.func.debug=(...n)=>this.invokeSeverity(_r.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(_r.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(_r.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(_r.ERROR,...n),this.func.sublog=n=>YP(n,this.func)}invoke(e,...r){if(this.upstream)try{this.upstream(e,...r)}catch{}try{this.emit("log",e,r)}catch{}}invokeSeverity(e,...r){this.invoke({severity:e},...r)}};He.AdhocDebugLogger=fa;He.placeholder=new fa("",()=>{}).func;var Qo=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=pa.env[He.env.nodeEnables])!==null&&e!==void 0?e:"*";r==="all"&&(r="*"),this.filters=r.split(",")}log(e,r,...n){try{this.filtersSet||(this.setFilters(),this.filtersSet=!0);let i=this.cached.get(e);i||(i=this.makeLogger(e),this.cached.set(e,i)),i(r,...n)}catch(i){console.error(i)}}};He.DebugLogBackendBase=Qo;var jd=class extends Qo{static{o(this,"NodeBackend")}constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(r,...n)=>{var i;let s=`${qt.Colours.green}${e}${qt.Colours.reset}`,c=`${qt.Colours.yellow}${pa.pid}${qt.Colours.reset}`,d;switch(r.severity){case _r.ERROR:d=`${qt.Colours.red}${r.severity}${qt.Colours.reset}`;break;case _r.INFO:d=`${qt.Colours.magenta}${r.severity}${qt.Colours.reset}`;break;case _r.WARNING:d=`${qt.Colours.yellow}${r.severity}${qt.Colours.reset}`;break;default:d=(i=r.severity)!==null&&i!==void 0?i:_r.DEFAULT;break}let l=JP.formatWithOptions({colors:qt.Colours.enabled},...n),p=Object.assign({},r);delete p.severity;let f=Object.getOwnPropertyNames(p).length?JSON.stringify(p):"",_=f?`${qt.Colours.grey}${f}${qt.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",c,s,d,l,f?` ${_}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function Ld(){return new jd}o(Ld,"getNodeBackend");var Fd=class extends Qo{static{o(this,"DebugBackend")}constructor(e){super(),this.debugPkg=e}makeLogger(e){let r=this.debugPkg(e);return(n,...i)=>{r(i[0],...i.slice(1))}}setFilters(){var e;let r=(e=pa.env.NODE_DEBUG)!==null&&e!==void 0?e:"";pa.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function g$(t){return new Fd(t)}o(g$,"getDebugBackend");var Bd=class extends Qo{static{o(this,"StructuredBackend")}constructor(e){var r;super(),this.upstream=(r=e)!==null&&r!==void 0?r:void 0}makeLogger(e){var r;let n=(r=this.upstream)===null||r===void 0?void 0:r.makeLogger(e);return(i,...s)=>{var c;let d=(c=i.severity)!==null&&c!==void 0?c:_r.INFO,l=Object.assign({severity:d,message:JP.format(...s)},i),p=JSON.stringify(l);n?n(i,p):console.log("%s",p)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function y$(t){return new Bd(t)}o(y$,"getStructuredBackend");He.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var qd=new Map,Vt;function _$(t){Vt=t,qd.clear()}o(_$,"setBackend");function YP(t,e){if(!Vt&&!pa.env[He.env.nodeEnables]||!t)return He.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=qd.get(t);if(r)return r.func;if(Vt===null)return He.placeholder;Vt===void 0&&(Vt=Ld());let n=(()=>{let i;return new fa(t,(c,...d)=>{if(i!==Vt){if(Vt===null)return;Vt===void 0&&(Vt=Ld()),i=Vt}Vt?.log(t,c,...d)})})();return qd.set(t,n),n.func}o(YP,"log")});var Vd=k(uo=>{"use strict";var v$=uo&&uo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),b$=uo&&uo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v$(e,t,r)};Object.defineProperty(uo,"__esModule",{value:!0});b$(XP(),uo)});var ha=k(fe=>{"use strict";var eS=fe&&fe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),P$=fe&&fe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),S$=fe&&fe.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&eS(r,e,n[i]);return P$(r,e),r}})(),E$=fe&&fe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eS(e,t,r)};Object.defineProperty(fe,"__esModule",{value:!0});fe.gcpResidencyCache=fe.METADATA_SERVER_DETECTION=fe.HEADERS=fe.HEADER_VALUE=fe.HEADER_NAME=fe.SECONDARY_HOST_ADDRESS=fe.HOST_ADDRESS=fe.BASE_PATH=void 0;fe.instance=R$;fe.project=O$;fe.universe=C$;fe.bulk=$$;fe.isAvailable=N$;fe.resetIsAvailableCache=z$;fe.getGCPResidency=Wd;fe.setGCPResidency=tS;fe.requestTimeout=rS;var Hd=at(),T$=FP(),x$=Md(),A$=S$(Vd());fe.BASE_PATH="/computeMetadata/v1";fe.HOST_ADDRESS="http://169.254.169.254";fe.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";fe.HEADER_NAME="Metadata-Flavor";fe.HEADER_VALUE="Google";fe.HEADERS=Object.freeze({[fe.HEADER_NAME]:fe.HEADER_VALUE});var QP=A$.log("gcp-metadata");fe.METADATA_SERVER_DETECTION=Object.freeze({"assume-present":"don't try to ping the metadata server, but assume it's present",none:"don't try to ping the metadata server, but don't try to use it either","bios-only":"treat the result of a BIOS probe as canonical (don't fall back to pinging)","ping-only":"skip the BIOS probe, and go straight to pinging"});function Gd(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||fe.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(fe.BASE_PATH,t).href}o(Gd,"getBaseUrl");function w$(t){Object.keys(t).forEach(e=>{switch(e){case"params":case"property":case"headers":break;case"qs":throw new Error("'qs' is not a valid configuration option. Please use 'params' instead.");default:throw new Error(`'${e}' is not a valid configuration option.`)}})}o(w$,"validate");async function ma(t,e={},r=3,n=!1){let i=new Headers(fe.HEADERS),s="",c={};if(typeof t=="object"){let _=t;new Headers(_.headers).forEach((h,g)=>i.set(g,h)),s=_.metadataKey,c=_.params||c,r=_.noResponseRetries||r,n=_.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(w$(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((_,h)=>i.set(h,_)),c=e.params||c);let d=n?I$:Hd.request,l={url:`${Gd()}/${s}`,headers:i,retryConfig:{noResponseRetries:r},params:c,responseType:"text",timeout:rS()};QP.info("instance request %j",l);let p=await d(l);QP.info("instance metadata is %s",p.data);let f=p.headers.get(fe.HEADER_NAME);if(f!==fe.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${fe.HEADER_NAME} header. Expected '${fe.HEADER_VALUE}', got ${f?`'${f}'`:"no header"}`);if(typeof p.data=="string")try{return T$.parse(p.data)}catch{}return p.data}o(ma,"metadataAccessor");async function I$(t){let e={...t,url:t.url?.toString().replace(Gd(),Gd(fe.SECONDARY_HOST_ADDRESS))},r=(0,Hd.request)(t),n=(0,Hd.request)(e);return Promise.any([r,n])}o(I$,"fastFailMetadataRequest");function R$(t){return ma("instance",t)}o(R$,"instance");function O$(t){return ma("project",t)}o(O$,"project");function C$(t){return ma("universe",t)}o(C$,"universe");async function $$(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await ma(r),i=r.metadataKey;e[i]=n})())),e}o($$,"bulk");function k$(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(k$,"detectGCPAvailableRetries");var Su;async function N$(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in fe.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(fe.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return Wd();case"ping-only":}}try{return Su===void 0&&(Su=ma("instance",void 0,k$(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Su,!0}catch(t){let e=t;if(process.env.DEBUG_AUTH&&console.info(e),e.type==="request-timeout"||e.response&&e.response.status===404)return!1;if(!(e.response&&e.response.status===404)&&(!e.code||!["EHOSTDOWN","EHOSTUNREACH","ENETUNREACH","ENOENT","ENOTFOUND","ECONNREFUSED"].includes(e.code.toString()))){let r="UNKNOWN";e.code&&(r=e.code.toString()),process.emitWarning(`received unexpected error = ${e.message} code = ${r}`,"MetadataLookupWarning")}return!1}}o(N$,"isAvailable");function z$(){Su=void 0}o(z$,"resetIsAvailableCache");fe.gcpResidencyCache=null;function Wd(){return fe.gcpResidencyCache===null&&tS(),fe.gcpResidencyCache}o(Wd,"getGCPResidency");function tS(t=null){fe.gcpResidencyCache=t!==null?t:(0,x$.detectGCPResidency)()}o(tS,"setGCPResidency");function rS(){return Wd()?0:3e3}o(rS,"requestTimeout");E$(Md(),fe)});var iS=k(Eu=>{"use strict";Eu.byteLength=U$;Eu.toByteArray=j$;Eu.fromByteArray=B$;var Cr=[],or=[],D$=typeof Uint8Array<"u"?Uint8Array:Array,Zd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(co=0,nS=Zd.length;co<nS;++co)Cr[co]=Zd[co],or[Zd.charCodeAt(co)]=co;var co,nS;or[45]=62;or[95]=63;function oS(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}o(oS,"getLens");function U$(t){var e=oS(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(U$,"byteLength");function M$(t,e,r){return(e+r)*3/4-r}o(M$,"_byteLength");function j$(t){var e,r=oS(t),n=r[0],i=r[1],s=new D$(M$(t,n,i)),c=0,d=i>0?n-4:n,l;for(l=0;l<d;l+=4)e=or[t.charCodeAt(l)]<<18|or[t.charCodeAt(l+1)]<<12|or[t.charCodeAt(l+2)]<<6|or[t.charCodeAt(l+3)],s[c++]=e>>16&255,s[c++]=e>>8&255,s[c++]=e&255;return i===2&&(e=or[t.charCodeAt(l)]<<2|or[t.charCodeAt(l+1)]>>4,s[c++]=e&255),i===1&&(e=or[t.charCodeAt(l)]<<10|or[t.charCodeAt(l+1)]<<4|or[t.charCodeAt(l+2)]>>2,s[c++]=e>>8&255,s[c++]=e&255),s}o(j$,"toByteArray");function L$(t){return Cr[t>>18&63]+Cr[t>>12&63]+Cr[t>>6&63]+Cr[t&63]}o(L$,"tripletToBase64");function F$(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(L$(n));return i.join("")}o(F$,"encodeChunk");function B$(t){for(var e,r=t.length,n=r%3,i=[],s=16383,c=0,d=r-n;c<d;c+=s)i.push(F$(t,c,c+s>d?d:c+s));return n===1?(e=t[r-1],i.push(Cr[e>>2]+Cr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Cr[e>>10]+Cr[e>>4&63]+Cr[e<<2&63]+"=")),i.join("")}o(B$,"fromByteArray")});var Jd=k(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.fromArrayBufferToHex=q$;function q$(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o(q$,"fromArrayBufferToHex")});var aS=k(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.BrowserCrypto=void 0;var ei=iS(),V$=Jd(),Yd=class t{static{o(this,"BrowserCrypto")}constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return ei.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),ei.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let i={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),c=ei.toByteArray(t.padBase64(n)),d=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,d,c,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),c=await window.crypto.subtle.sign(n,s,i);return ei.fromByteArray(new Uint8Array(c))}decodeBase64StringUtf8(e){let r=ei.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return ei.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,V$.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),i=new TextEncoder,s=await window.crypto.subtle.importKey("raw",i.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",s,i.encode(r))}};Tu.BrowserCrypto=Yd});var sS=k(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.NodeCrypto=void 0;var ti=require("crypto"),Xd=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return ti.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return ti.randomBytes(e).toString("base64")}async verify(e,r,n){let i=ti.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=ti.createSign("RSA-SHA256");return n.update(r),n.end(),n.sign(e,"base64")}decodeBase64StringUtf8(e){return Buffer.from(e,"base64").toString("utf-8")}encodeBase64StringUtf8(e){return Buffer.from(e,"utf-8").toString("base64")}async sha256DigestHex(e){return ti.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:G$(e);return H$(ti.createHmac("sha256",n).update(r).digest())}};xu.NodeCrypto=Xd;function H$(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(H$,"toArrayBuffer");function G$(t){return Buffer.from(t)}o(G$,"toBuffer")});var ga=k(on=>{"use strict";var W$=on&&on.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Z$=on&&on.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W$(e,t,r)};Object.defineProperty(on,"__esModule",{value:!0});on.createCrypto=Y$;on.hasBrowserCrypto=uS;var K$=aS(),J$=sS();Z$(Jd(),on);function Y$(){return uS()?new K$.BrowserCrypto:new J$.NodeCrypto}o(Y$,"createCrypto");function uS(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(uS,"hasBrowserCrypto")});var ri=k((Qd,lS)=>{var Au=require("buffer"),$r=Au.Buffer;function cS(t,e){for(var r in t)e[r]=t[r]}o(cS,"copyProps");$r.from&&$r.alloc&&$r.allocUnsafe&&$r.allocUnsafeSlow?lS.exports=Au:(cS(Au,Qd),Qd.Buffer=lo);function lo(t,e,r){return $r(t,e,r)}o(lo,"SafeBuffer");lo.prototype=Object.create($r.prototype);cS($r,lo);lo.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return $r(t,e,r)};lo.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=$r(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};lo.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return $r(t)};lo.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Au.SlowBuffer(t)}});var pS=k((V9,dS)=>{"use strict";function ep(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(ep,"getParamSize");var X$={ES256:ep(256),ES384:ep(384),ES512:ep(521)};function Q$(t){var e=X$[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(Q$,"getParamBytesForAlg");dS.exports=Q$});var tp=k((G9,_S)=>{"use strict";var wu=ri().Buffer,mS=pS(),Iu=128,hS=0,ek=32,tk=16,rk=2,gS=tk|ek|hS<<6,Ru=rk|hS<<6;function nk(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(nk,"base64Url");function yS(t){if(wu.isBuffer(t))return t;if(typeof t=="string")return wu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}o(yS,"signatureAsBuffer");function ok(t,e){t=yS(t);var r=mS(e),n=r+1,i=t.length,s=0;if(t[s++]!==gS)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(Iu|1)&&(c=t[s++]),i-s<c)throw new Error('"seq" specified length of "'+c+'", only "'+(i-s)+'" remaining');if(t[s++]!==Ru)throw new Error('Could not find expected "int" for "r"');var d=t[s++];if(i-s-2<d)throw new Error('"r" specified length of "'+d+'", only "'+(i-s-2)+'" available');if(n<d)throw new Error('"r" specified length of "'+d+'", max of "'+n+'" is acceptable');var l=s;if(s+=d,t[s++]!==Ru)throw new Error('Could not find expected "int" for "s"');var p=t[s++];if(i-s!==p)throw new Error('"s" specified length of "'+p+'", expected "'+(i-s)+'"');if(n<p)throw new Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var f=s;if(s+=p,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var _=r-d,h=r-p,g=wu.allocUnsafe(_+d+h+p);for(s=0;s<_;++s)g[s]=0;t.copy(g,s,l+Math.max(-_,0),l+d),s=r;for(var y=s;s<y+h;++s)g[s]=0;return t.copy(g,s,f+Math.max(-h,0),f+p),g=g.toString("base64"),g=nk(g),g}o(ok,"derToJose");function fS(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=Iu;return i&&--n,n}o(fS,"countPadding");function ik(t,e){t=yS(t);var r=mS(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=fS(t,0,r),s=fS(t,r,t.length),c=r-i,d=r-s,l=2+c+1+1+d,p=l<Iu,f=wu.allocUnsafe((p?2:3)+l),_=0;return f[_++]=gS,p?f[_++]=l:(f[_++]=Iu|1,f[_++]=l&255),f[_++]=Ru,f[_++]=c,i<0?(f[_++]=0,_+=t.copy(f,_,0,r)):_+=t.copy(f,_,i,r),f[_++]=Ru,f[_++]=d,s<0?(f[_++]=0,t.copy(f,_,r)):t.copy(f,_,r+s),f}o(ik,"joseToDer");_S.exports={derToJose:ok,joseToDer:ik}});var vr=k(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.LRUCache=void 0;an.snakeToCamel=bS;an.originalOrCamelOptions=ck;an.removeUndefinedValuesInObject=lk;an.isValidFile=dk;an.getWellKnownCertificateConfigFileLocation=pk;var ak=require("fs"),sk=require("os"),rp=require("path"),uk="certificate_config.json",vS="gcloud";function bS(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(bS,"snakeToCamel");function ck(t){function e(r){let n=t||{};return n[r]??n[bS(r)]}return o(e,"get"),{get:e}}o(ck,"originalOrCamelOptions");var np=class{static{o(this,"LRUCache")}capacity;#e=new Map;maxAge;constructor(e){this.capacity=e.capacity,this.maxAge=e.maxAge}#t(e,r){this.#e.delete(e),this.#e.set(e,{value:r,lastAccessed:Date.now()})}set(e,r){this.#t(e,r),this.#r()}get(e){let r=this.#e.get(e);if(r)return this.#t(e,r.value),this.#r(),r.value}#r(){let e=this.maxAge?Date.now()-this.maxAge:0,r=this.#e.entries().next();for(;!r.done&&(this.#e.size>this.capacity||r.value[1].lastAccessed<e);)this.#e.delete(r.value[0]),r=this.#e.entries().next()}};an.LRUCache=np;function lk(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(lk,"removeUndefinedValuesInObject");async function dk(t){try{return(await ak.promises.lstat(t)).isFile()}catch{return!1}}o(dk,"isValidFile");function pk(){let t=process.env.CLOUDSDK_CONFIG||(fk()?rp.join(process.env.APPDATA||"",vS):rp.join(process.env.HOME||"",".config",vS));return rp.join(t,uk)}o(pk,"getWellKnownCertificateConfigFileLocation");function fk(){return sk.platform().startsWith("win")}o(fk,"_isWindows")});var PS=k((J9,mk)=>{mk.exports={name:"google-auth-library",version:"10.5.0",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=18"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:"googleapis/google-auth-library-nodejs.git",keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^7.0.0","gcp-metadata":"^8.0.0","google-logging-utils":"^1.0.0",gtoken:"^8.0.0",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/jws":"^3.1.0","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","assert-rejects":"^1.0.0",c8:"^10.0.0",codecov:"^3.0.2",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",keypair:"^1.0.4",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","ts-loader":"^8.0.0",typescript:"5.8.2",webpack:"^5.21.2","webpack-cli":"^4.0.0"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check --no-inline-config",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.js","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start","docs-test":"echo 'disabled until linkinator is fixed'","predocs-test":"npm run docs",prelint:"cd samples; npm link ../; npm install"},license:"Apache-2.0"}});var op=k(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.USER_AGENT=jn.PRODUCT_NAME=jn.pkg=void 0;var SS=PS();jn.pkg=SS;var ES="google-api-nodejs-client";jn.PRODUCT_NAME=ES;var hk=`${ES}/${SS.version}`;jn.USER_AGENT=hk});var Ht=k(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.AuthClient=br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=br.DEFAULT_UNIVERSE=void 0;var gk=require("events"),ip=at(),yk=vr(),_k=Vd(),ap=op();br.DEFAULT_UNIVERSE="googleapis.com";br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var sp=class t extends gk.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=br.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,yk.originalOrCamelOptions)(e);this.apiKey=e.apiKey,this.projectId=r.get("project_id")??null,this.quotaProjectId=r.get("quota_project_id"),this.credentials=r.get("credentials")??{},this.universeDomain=r.get("universe_domain")??br.DEFAULT_UNIVERSE,this.transporter=e.transporter??new ip.Gaxios(e.transporterOptions),r.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(t.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(t.DEFAULT_RESPONSE_INTERCEPTOR)),e.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=e.forceRefreshOnFailure??!1}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&ip.Gaxios.mergeHeaders(s,r.headers),n&&ip.Gaxios.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}setCredentials(e){this.credentials=e}addSharedMetadataHeaders(e){return!e.has("x-goog-user-project")&&this.quotaProjectId&&e.set("x-goog-user-project",this.quotaProjectId),e}addUserProjectAndAuthHeaders(e,r){let n=r.get("x-goog-user-project"),i=r.get("authorization");return n&&e.set("x-goog-user-project",n),i&&e.set("authorization",i),e}static log=(0,_k.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:o(async e=>{if(!e.headers.has("x-goog-api-client")){let n=process.version.replace(/^v/,"");e.headers.set("x-goog-api-client",`gl-node/${n}`)}let r=e.headers.get("User-Agent");r?r.includes(`${ap.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${ap.USER_AGENT}`):e.headers.set("User-Agent",ap.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let c={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,s,c):t.log.info("[%s] request %j",s,c)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,i,e.data):t.log.info("[%s] response %j",i,e.data)}catch{}return e},"resolved"),rejected:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,i,e.response?.data):t.log.error("[%s] error %j",i,e.response?.data)}catch{}throw e},"rejected")};static setMethodName(e,r){try{let n=e;n[t.RequestMethodNameSymbol]=r}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};br.AuthClient=sp});var cp=k(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.LoginTicket=void 0;var up=class{static{o(this,"LoginTicket")}envelope;payload;constructor(e,r){this.envelope=e,this.payload=r}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let e=this.getPayload();return e&&e.sub?e.sub:null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}};Ou.LoginTicket=up});var po=k(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.OAuth2Client=kr.ClientAuthentication=kr.CertificateFormat=kr.CodeChallengeMethod=void 0;var TS=at(),vk=require("querystring"),bk=require("stream"),Pk=tp(),xS=vr(),lp=ga(),ni=Ht(),Sk=cp(),AS;(function(t){t.Plain="plain",t.S256="S256"})(AS||(kr.CodeChallengeMethod=AS={}));var sn;(function(t){t.PEM="PEM",t.JWK="JWK"})(sn||(kr.CertificateFormat=sn={}));var ya;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(ya||(kr.ClientAuthentication=ya={}));var dp=class t extends ni.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=sn.PEM;refreshTokenPromises=new Map;endpoints;issuers;clientAuthentication;_clientId;_clientSecret;refreshHandler;constructor(e={},r,n){super(typeof e=="object"?e:{}),typeof e!="object"&&(e={clientId:e,clientSecret:r,redirectUri:n}),this._clientId=e.clientId||e.client_id,this._clientSecret=e.clientSecret||e.client_secret,this.redirectUri=e.redirectUri||e.redirect_uris?.[0],this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...e.endpoints},this.clientAuthentication=e.clientAuthentication||ya.ClientSecretPost,this.issuers=e.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}static GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";static CLOCK_SKEW_SECS_=300;static DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400;generateAuthUrl(e={}){if(e.code_challenge_method&&!e.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return e.response_type=e.response_type||"code",e.client_id=e.client_id||this._clientId,e.redirect_uri=e.redirect_uri||this.redirectUri,Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+vk.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,lp.createCrypto)(),n=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),s=(await e.sha256DigestBase64(n)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:n,codeChallenge:s}}getToken(e,r){let n=typeof e=="string"?{code:e}:e;if(r)this.getTokenAsync(n).then(i=>r(null,i.tokens,i.res),i=>r(i,null,i.response));else return this.getTokenAsync(n)}async getTokenAsync(e){let r=this.endpoints.oauth2TokenUrl.toString(),n=new Headers,i={client_id:e.client_id||this._clientId,code_verifier:e.codeVerifier,code:e.code,grant_type:"authorization_code",redirect_uri:e.redirect_uri||this.redirectUri};if(this.clientAuthentication===ya.ClientSecretBasic){let l=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${l.toString("base64")}`)}this.clientAuthentication===ya.ClientSecretPost&&(i.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,xS.removeUndefinedValuesInObject)(i)),headers:n};ni.AuthClient.setMethodName(s,"getTokenAsync");let c=await this.transporter.request(s),d=c.data;return c.data&&c.data.expires_in&&(d.expiry_date=new Date().getTime()+c.data.expires_in*1e3,delete d.expires_in),this.emit("tokens",d),{tokens:d,res:c}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let r=this.refreshTokenNoCache(e).then(n=>(this.refreshTokenPromises.delete(e),n),n=>{throw this.refreshTokenPromises.delete(e),n});return this.refreshTokenPromises.set(e,r),r}async refreshTokenNoCache(e){if(!e)throw new Error("No refresh token is set.");let r=this.endpoints.oauth2TokenUrl.toString(),n={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},i;try{let c={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,xS.removeUndefinedValuesInObject)(n))};ni.AuthClient.setMethodName(c,"refreshTokenNoCache"),i=await this.transporter.request(c)}catch(c){throw c instanceof TS.GaxiosError&&c.message==="invalid_grant"&&c.response?.data&&/ReAuth/i.test(c.response.data.error_description)&&(c.message=JSON.stringify(c.response.data)),c}let s=i.data;return i.data&&i.data.expires_in&&(s.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:i}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(r=>e(null,r.credentials,r.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),r=e.tokens;return r.refresh_token=this.credentials.refresh_token,this.credentials=r,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(r=>e(null,r.token,r.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let n=await this.processAndValidateRefreshHandler();if(n?.access_token)return this.setCredentials(n),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let r=await this.refreshAccessTokenAsync();if(!r.credentials||r.credentials&&!r.credentials.access_token)throw new Error("Could not refresh access token.");return{token:r.credentials.access_token,res:r.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let r=this.credentials;if(!r.access_token&&!r.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(r.access_token&&!this.isTokenExpiring()){r.token_type=r.token_type||"Bearer";let d=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(d)}}if(this.refreshHandler){let d=await this.processAndValidateRefreshHandler();if(d?.access_token){this.setCredentials(d);let l=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(l)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,i=null;try{n=await this.refreshToken(r.refresh_token),i=n.tokens}catch(d){let l=d;throw l.response&&(l.response.status===403||l.response.status===404)&&(l.message=`Could not refresh access token: ${l.message}`),l}let s=this.credentials;s.token_type=s.token_type||"Bearer",i.refresh_token=s.refresh_token,this.credentials=i;let c=new Headers({authorization:s.token_type+" "+i.access_token});return{headers:this.addSharedMetadataHeaders(c),res:n.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let r=new URL(this.endpoints.oauth2RevokeUrl);return r.searchParams.append("token",e),r}revokeToken(e,r){let n={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(ni.AuthClient.setMethodName(n,"revokeToken"),r)this.transporter.request(n).then(i=>r(null,i),r);else return this.transporter.request(n)}revokeCredentials(e){if(e)this.revokeCredentialsAsync().then(r=>e(null,r),e);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let e=this.credentials.access_token;if(this.credentials={},e)return this.revokeToken(e);throw new Error("No access token to revoke.")}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){try{let n=await this.getRequestMetadataAsync();return e.headers=TS.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,n.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(n){let i=n.response;if(i){let s=i.status,c=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),d=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,l=i.config.data instanceof bk.Readable,p=s===401||s===403;if(!r&&p&&!l&&c)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&p&&!l&&d){let f=await this.processAndValidateRefreshHandler();return f?.access_token&&this.setCredentials(f),this.requestAsync(e,!0)}}throw n}}verifyIdToken(e,r){if(r&&typeof r!="function")throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(r)this.verifyIdTokenAsync(e).then(n=>r(null,n),r);else return this.verifyIdTokenAsync(e)}async verifyIdTokenAsync(e){if(!e.idToken)throw new Error("The verifyIdToken method requires an ID Token");let r=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(e.idToken,r.certs,e.audience,this.issuers,e.maxExpiry)}async getTokenInfo(e){let{data:r}=await this.transporter.request({...t.RETRY_CONFIG,method:"POST",headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8",authorization:`Bearer ${e}`},url:this.endpoints.tokenInfoUrl.toString()}),n=Object.assign({expiry_date:new Date().getTime()+r.expires_in*1e3,scopes:r.scope.split(" ")},r);return delete n.expires_in,delete n.scope,n}getFederatedSignonCerts(e){if(e)this.getFederatedSignonCertsAsync().then(r=>e(null,r.certs,r.res),e);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let e=new Date().getTime(),r=(0,lp.hasBrowserCrypto)()?sn.JWK:sn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case sn.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case sn.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let p={...t.RETRY_CONFIG,url:i};ni.AuthClient.setMethodName(p,"getFederatedSignonCertsAsync"),n=await this.transporter.request(p)}catch(p){throw p instanceof Error&&(p.message=`Failed to retrieve verification certificates: ${p.message}`),p}let s=n?.headers.get("cache-control"),c=-1;if(s){let p=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;p&&(c=Number(p)*1e3)}let d={};switch(r){case sn.PEM:d=n.data;break;case sn.JWK:for(let p of n.data.keys)d[p.kid]=p;break;default:throw new Error(`Unsupported certificate format ${r}`)}let l=new Date;return this.certificateExpiry=c===-1?null:new Date(l.getTime()+c),this.certificateCache=d,this.certificateCacheFormat=r,{certs:d,format:r,res:n}}getIapPublicKeys(e){if(e)this.getIapPublicKeysAsync().then(r=>e(null,r.pubkeys,r.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,r=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let n={...t.RETRY_CONFIG,url:r};ni.AuthClient.setMethodName(n,"getIapPublicKeysAsync"),e=await this.transporter.request(n)}catch(n){throw n instanceof Error&&(n.message=`Failed to retrieve verification certificates: ${n.message}`),n}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,r,n,i,s){let c=(0,lp.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let d=e.split(".");if(d.length!==3)throw new Error("Wrong number of segments in token: "+e);let l=d[0]+"."+d[1],p=d[2],f,_;try{f=JSON.parse(c.decodeBase64StringUtf8(d[0]))}catch(L){throw L instanceof Error&&(L.message=`Can't parse token envelope: ${d[0]}': ${L.message}`),L}if(!f)throw new Error("Can't parse token envelope: "+d[0]);try{_=JSON.parse(c.decodeBase64StringUtf8(d[1]))}catch(L){throw L instanceof Error&&(L.message=`Can't parse token payload '${d[0]}`),L}if(!_)throw new Error("Can't parse token payload: "+d[1]);if(!Object.prototype.hasOwnProperty.call(r,f.kid))throw new Error("No pem found for envelope: "+JSON.stringify(f));let h=r[f.kid];if(f.alg==="ES256"&&(p=Pk.joseToDer(p,"ES256").toString("base64")),!await c.verify(h,l,p))throw new Error("Invalid token signature: "+e);if(!_.iat)throw new Error("No issue time in token: "+JSON.stringify(_));if(!_.exp)throw new Error("No expiration time in token: "+JSON.stringify(_));let y=Number(_.iat);if(isNaN(y))throw new Error("iat field using invalid format");let T=Number(_.exp);if(isNaN(T))throw new Error("exp field using invalid format");let P=new Date().getTime()/1e3;if(T>=P+s)throw new Error("Expiration time too far in future: "+JSON.stringify(_));let x=y-t.CLOCK_SKEW_SECS_,N=T+t.CLOCK_SKEW_SECS_;if(P<x)throw new Error("Token used too early, "+P+" < "+x+": "+JSON.stringify(_));if(P>N)throw new Error("Token used too late, "+P+" > "+N+": "+JSON.stringify(_));if(i&&i.indexOf(_.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+_.iss);if(typeof n<"u"&&n!==null){let L=_.aud,X=!1;if(n.constructor===Array?X=n.indexOf(L)>-1:X=L===n,!X)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new Sk.LoginTicket(f,_)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let e=await this.refreshHandler();if(!e.access_token)throw new Error("No access token is returned by the refreshHandler callback.");return e}}isTokenExpiring(){let e=this.credentials.expiry_date;return e?e<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}};kr.OAuth2Client=dp});var fp=k(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.Compute=void 0;var Ek=at(),wS=ha(),Tk=po(),pp=class extends Tk.OAuth2Client{static{o(this,"Compute")}serviceAccountEmail;scopes;constructor(e={}){super(e),this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=e.serviceAccountEmail||"default",this.scopes=Array.isArray(e.scopes)?e.scopes:e.scopes?[e.scopes]:[]}async refreshTokenNoCache(){let e=`service-accounts/${this.serviceAccountEmail}/token`,r;try{let i={property:e};this.scopes.length>0&&(i.params={scopes:this.scopes.join(",")}),r=await wS.instance(i)}catch(i){throw i instanceof Ek.GaxiosError&&(i.message=`Could not refresh access token: ${i.message}`,this.wrapError(i)),i}let n=r;return r&&r.expires_in&&(n.expiry_date=new Date().getTime()+r.expires_in*1e3,delete n.expires_in),this.emit("tokens",n),{tokens:n,res:null}}async fetchIdToken(e){let r=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${e}`,n;try{let i={property:r};n=await wS.instance(i)}catch(i){throw i instanceof Error&&(i.message=`Could not fetch ID token: ${i.message}`),i}return n}wrapError(e){let r=e.response;r&&r.status&&(e.status=r.status,r.status===403?e.message="A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified: "+e.message:r.status===404&&(e.message="A Not Found error was returned while attempting to retrieve an accesstoken for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have any permission scopes specified: "+e.message))}};Cu.Compute=pp});var hp=k($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.IdTokenClient=void 0;var xk=po(),mp=class extends xk.OAuth2Client{static{o(this,"IdTokenClient")}targetAudience;idTokenProvider;constructor(e){super(e),this.targetAudience=e.targetAudience,this.idTokenProvider=e.idTokenProvider}async getRequestMetadataAsync(){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let r=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:r,expiry_date:this.getIdTokenExpiryDate(r)}}return{headers:new Headers({authorization:"Bearer "+this.credentials.id_token})}}getIdTokenExpiryDate(e){let r=e.split(".")[1];if(r)return JSON.parse(Buffer.from(r,"base64").toString("ascii")).exp*1e3}};$u.IdTokenClient=mp});var gp=k(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.GCPEnv=void 0;oi.clear=Ak;oi.getEnv=wk;var IS=ha(),Nr;(function(t){t.APP_ENGINE="APP_ENGINE",t.KUBERNETES_ENGINE="KUBERNETES_ENGINE",t.CLOUD_FUNCTIONS="CLOUD_FUNCTIONS",t.COMPUTE_ENGINE="COMPUTE_ENGINE",t.CLOUD_RUN="CLOUD_RUN",t.CLOUD_RUN_JOBS="CLOUD_RUN_JOBS",t.NONE="NONE"})(Nr||(oi.GCPEnv=Nr={}));var _a;function Ak(){_a=void 0}o(Ak,"clear");async function wk(){return _a||(_a=Ik(),_a)}o(wk,"getEnv");async function Ik(){let t=Nr.NONE;return Rk()?t=Nr.APP_ENGINE:Ok()?t=Nr.CLOUD_FUNCTIONS:await Nk()?await kk()?t=Nr.KUBERNETES_ENGINE:Ck()?t=Nr.CLOUD_RUN:$k()?t=Nr.CLOUD_RUN_JOBS:t=Nr.COMPUTE_ENGINE:t=Nr.NONE,t}o(Ik,"getEnvMemoized");function Rk(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(Rk,"isAppEngine");function Ok(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o(Ok,"isCloudFunction");function Ck(){return!!process.env.K_CONFIGURATION}o(Ck,"isCloudRun");function $k(){return!!process.env.CLOUD_RUN_JOB}o($k,"isCloudRunJob");async function kk(){try{return await IS.instance("attributes/cluster-name"),!0}catch{return!1}}o(kk,"isKubernetesEngine");async function Nk(){return IS.isAvailable()}o(Nk,"isComputeEngine")});var yp=k((lY,RS)=>{var ku=ri().Buffer,zk=require("stream"),Dk=require("util");function Nu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=ku.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=ku.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}o(Nu,"DataStream");Dk.inherits(Nu,zk);Nu.prototype.write=o(function(e){this.buffer=ku.concat([this.buffer,ku.from(e)]),this.emit("data",e)},"write");Nu.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");RS.exports=Nu});var CS=k((pY,OS)=>{"use strict";var va=require("buffer").Buffer,_p=require("buffer").SlowBuffer;OS.exports=zu;function zu(t,e){if(!va.isBuffer(t)||!va.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}o(zu,"bufferEq");zu.install=function(){va.prototype.equal=_p.prototype.equal=o(function(e){return zu(this,e)},"equal")};var Uk=va.prototype.equal,Mk=_p.prototype.equal;zu.restore=function(){va.prototype.equal=Uk,_p.prototype.equal=Mk}});var Sp=k((mY,LS)=>{var ai=ri().Buffer,ir=require("crypto"),kS=tp(),$S=require("util"),jk=`"%s" is not a valid algorithm.
37
+ `+T+"}":"{"+P.join(",")+"}",n=T,g}}o(l,"str"),typeof zP.stringify!="function"&&(zP.stringify=function(p,f,_){var h;if(n="",i="",typeof _=="number")for(h=0;h<_;h+=1)i+=" ";else typeof _=="string"&&(i=_);if(c=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return l("",{"":p})})})()});var jP=k((T9,MP)=>{var vu=null,l$=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,d$=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/,p$=o(function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(t!=null){if(t.strict===!0&&(e.strict=!0),t.storeAsString===!0&&(e.storeAsString=!0),e.alwaysParseAsBig=t.alwaysParseAsBig===!0?t.alwaysParseAsBig:!1,e.useNativeBigInt=t.useNativeBigInt===!0?t.useNativeBigInt:!1,typeof t.constructorAction<"u")if(t.constructorAction==="error"||t.constructorAction==="ignore"||t.constructorAction==="preserve")e.constructorAction=t.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);if(typeof t.protoAction<"u")if(t.protoAction==="error"||t.protoAction==="ignore"||t.protoAction==="preserve")e.protoAction=t.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`)}var r,n,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
38
+ `,r:"\r",t:" "},s,c=o(function(T){throw{name:"SyntaxError",message:T,at:r,text:s}},"error"),d=o(function(T){return T&&T!==n&&c("Expected '"+T+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),l=o(function(){var T,P="";for(n==="-"&&(P="-",d("-"));n>="0"&&n<="9";)P+=n,d();if(n===".")for(P+=".";d()&&n>="0"&&n<="9";)P+=n;if(n==="e"||n==="E")for(P+=n,d(),(n==="-"||n==="+")&&(P+=n,d());n>="0"&&n<="9";)P+=n,d();if(T=+P,!isFinite(T))c("Bad number");else return vu==null&&(vu=Ud()),P.length>15?e.storeAsString?P:e.useNativeBigInt?BigInt(P):new vu(P):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(T):new vu(T):T},"number"),p=o(function(){var T,P,x="",N;if(n==='"')for(var L=r;d();){if(n==='"')return r-1>L&&(x+=s.substring(L,r-1)),d(),x;if(n==="\\"){if(r-1>L&&(x+=s.substring(L,r-1)),d(),n==="u"){for(N=0,P=0;P<4&&(T=parseInt(d(),16),!!isFinite(T));P+=1)N=N*16+T;x+=String.fromCharCode(N)}else if(typeof i[n]=="string")x+=i[n];else break;L=r}}c("Bad string")},"string"),f=o(function(){for(;n&&n<=" ";)d()},"white"),_=o(function(){switch(n){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}c("Unexpected '"+n+"'")},"word"),h,g=o(function(){var T=[];if(n==="["){if(d("["),f(),n==="]")return d("]"),T;for(;n;){if(T.push(h()),f(),n==="]")return d("]"),T;d(","),f()}}c("Bad array")},"array"),y=o(function(){var T,P=Object.create(null);if(n==="{"){if(d("{"),f(),n==="}")return d("}"),P;for(;n;){if(T=p(),f(),d(":"),e.strict===!0&&Object.hasOwnProperty.call(P,T)&&c('Duplicate key "'+T+'"'),l$.test(T)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?h():P[T]=h():d$.test(T)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?h():P[T]=h():P[T]=h(),f(),n==="}")return d("}"),P;d(","),f()}}c("Bad object")},"object");return h=o(function(){switch(f(),n){case"{":return y();case"[":return g();case'"':return p();case"-":return l();default:return n>="0"&&n<="9"?l():_()}},"value"),function(T,P){var x;return s=T+"",r=0,n=" ",x=h(),f(),n&&c("Syntax error"),typeof P=="function"?o((function N(L,X){var W,G,Z=L[X];return Z&&typeof Z=="object"&&Object.keys(Z).forEach(function(ee){G=N(Z,ee),G!==void 0?Z[ee]=G:delete Z[ee]}),P.call(L,X,Z)}),"walk")({"":x},""):x}},"json_parse");MP.exports=p$});var BP=k((A9,bu)=>{var LP=UP().stringify,FP=jP();bu.exports=function(t){return{parse:FP(t),stringify:LP}};bu.exports.parse=FP();bu.exports.stringify=LP});var Md=k(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.GCE_LINUX_BIOS_PATHS=void 0;yr.isGoogleCloudServerless=HP;yr.isGoogleComputeEngineLinux=GP;yr.isGoogleComputeEngineMACAddress=WP;yr.isGoogleComputeEngine=ZP;yr.detectGCPResidency=m$;var qP=require("fs"),VP=require("os");yr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var f$=/^42:01/;function HP(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(HP,"isGoogleCloudServerless");function GP(){if((0,VP.platform)()!=="linux")return!1;try{(0,qP.statSync)(yr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,qP.readFileSync)(yr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(GP,"isGoogleComputeEngineLinux");function WP(){let t=(0,VP.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(f$.test(r))return!0}return!1}o(WP,"isGoogleComputeEngineMACAddress");function ZP(){return GP()||WP()}o(ZP,"isGoogleComputeEngine");function m$(){return HP()||ZP()}o(m$,"detectGCPResidency")});var KP=k(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.Colours=void 0;var Et=class t{static{o(this,"Colours")}static isEnabled(e){return e&&e.isTTY&&(typeof e.getColorDepth=="function"?e.getColorDepth()>2:!0)}static refresh(){t.enabled=t.isEnabled(process==null?void 0:process.stderr),this.enabled?(t.reset="\x1B[0m",t.bright="\x1B[1m",t.dim="\x1B[2m",t.red="\x1B[31m",t.green="\x1B[32m",t.yellow="\x1B[33m",t.blue="\x1B[34m",t.magenta="\x1B[35m",t.cyan="\x1B[36m",t.white="\x1B[37m",t.grey="\x1B[90m"):(t.reset="",t.bright="",t.dim="",t.red="",t.green="",t.yellow="",t.blue="",t.magenta="",t.cyan="",t.white="",t.grey="")}};Pu.Colours=Et;Et.enabled=!1;Et.reset="";Et.bright="";Et.dim="";Et.red="";Et.green="";Et.yellow="";Et.blue="";Et.magenta="";Et.cyan="";Et.white="";Et.grey="";Et.refresh()});var QP=k(He=>{"use strict";var h$=He&&He.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),g$=He&&He.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),JP=He&&He.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&h$(r,e,n[i]);return g$(r,e),r}})();Object.defineProperty(He,"__esModule",{value:!0});He.env=He.DebugLogBackendBase=He.placeholder=He.AdhocDebugLogger=He.LogSeverity=void 0;He.getNodeBackend=Ld;He.getDebugBackend=_$;He.getStructuredBackend=v$;He.setBackend=b$;He.log=XP;var y$=require("events"),pa=JP(require("process")),YP=JP(require("util")),qt=KP(),_r;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(_r||(He.LogSeverity=_r={}));var fa=class extends y$.EventEmitter{static{o(this,"AdhocDebugLogger")}constructor(e,r){super(),this.namespace=e,this.upstream=r,this.func=Object.assign(this.invoke.bind(this),{instance:this,on:o((n,i)=>this.on(n,i),"on")}),this.func.debug=(...n)=>this.invokeSeverity(_r.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(_r.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(_r.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(_r.ERROR,...n),this.func.sublog=n=>XP(n,this.func)}invoke(e,...r){if(this.upstream)try{this.upstream(e,...r)}catch{}try{this.emit("log",e,r)}catch{}}invokeSeverity(e,...r){this.invoke({severity:e},...r)}};He.AdhocDebugLogger=fa;He.placeholder=new fa("",()=>{}).func;var Qo=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=pa.env[He.env.nodeEnables])!==null&&e!==void 0?e:"*";r==="all"&&(r="*"),this.filters=r.split(",")}log(e,r,...n){try{this.filtersSet||(this.setFilters(),this.filtersSet=!0);let i=this.cached.get(e);i||(i=this.makeLogger(e),this.cached.set(e,i)),i(r,...n)}catch(i){console.error(i)}}};He.DebugLogBackendBase=Qo;var jd=class extends Qo{static{o(this,"NodeBackend")}constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(r,...n)=>{var i;let s=`${qt.Colours.green}${e}${qt.Colours.reset}`,c=`${qt.Colours.yellow}${pa.pid}${qt.Colours.reset}`,d;switch(r.severity){case _r.ERROR:d=`${qt.Colours.red}${r.severity}${qt.Colours.reset}`;break;case _r.INFO:d=`${qt.Colours.magenta}${r.severity}${qt.Colours.reset}`;break;case _r.WARNING:d=`${qt.Colours.yellow}${r.severity}${qt.Colours.reset}`;break;default:d=(i=r.severity)!==null&&i!==void 0?i:_r.DEFAULT;break}let l=YP.formatWithOptions({colors:qt.Colours.enabled},...n),p=Object.assign({},r);delete p.severity;let f=Object.getOwnPropertyNames(p).length?JSON.stringify(p):"",_=f?`${qt.Colours.grey}${f}${qt.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",c,s,d,l,f?` ${_}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function Ld(){return new jd}o(Ld,"getNodeBackend");var Fd=class extends Qo{static{o(this,"DebugBackend")}constructor(e){super(),this.debugPkg=e}makeLogger(e){let r=this.debugPkg(e);return(n,...i)=>{r(i[0],...i.slice(1))}}setFilters(){var e;let r=(e=pa.env.NODE_DEBUG)!==null&&e!==void 0?e:"";pa.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function _$(t){return new Fd(t)}o(_$,"getDebugBackend");var Bd=class extends Qo{static{o(this,"StructuredBackend")}constructor(e){var r;super(),this.upstream=(r=e)!==null&&r!==void 0?r:void 0}makeLogger(e){var r;let n=(r=this.upstream)===null||r===void 0?void 0:r.makeLogger(e);return(i,...s)=>{var c;let d=(c=i.severity)!==null&&c!==void 0?c:_r.INFO,l=Object.assign({severity:d,message:YP.format(...s)},i),p=JSON.stringify(l);n?n(i,p):console.log("%s",p)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function v$(t){return new Bd(t)}o(v$,"getStructuredBackend");He.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var qd=new Map,Vt;function b$(t){Vt=t,qd.clear()}o(b$,"setBackend");function XP(t,e){if(!Vt&&!pa.env[He.env.nodeEnables]||!t)return He.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=qd.get(t);if(r)return r.func;if(Vt===null)return He.placeholder;Vt===void 0&&(Vt=Ld());let n=(()=>{let i;return new fa(t,(c,...d)=>{if(i!==Vt){if(Vt===null)return;Vt===void 0&&(Vt=Ld()),i=Vt}Vt?.log(t,c,...d)})})();return qd.set(t,n),n.func}o(XP,"log")});var Vd=k(uo=>{"use strict";var P$=uo&&uo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),S$=uo&&uo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P$(e,t,r)};Object.defineProperty(uo,"__esModule",{value:!0});S$(QP(),uo)});var ha=k(fe=>{"use strict";var tS=fe&&fe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),E$=fe&&fe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),T$=fe&&fe.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&tS(r,e,n[i]);return E$(r,e),r}})(),x$=fe&&fe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tS(e,t,r)};Object.defineProperty(fe,"__esModule",{value:!0});fe.gcpResidencyCache=fe.METADATA_SERVER_DETECTION=fe.HEADERS=fe.HEADER_VALUE=fe.HEADER_NAME=fe.SECONDARY_HOST_ADDRESS=fe.HOST_ADDRESS=fe.BASE_PATH=void 0;fe.instance=C$;fe.project=$$;fe.universe=k$;fe.bulk=N$;fe.isAvailable=D$;fe.resetIsAvailableCache=U$;fe.getGCPResidency=Wd;fe.setGCPResidency=rS;fe.requestTimeout=nS;var Hd=st(),A$=BP(),w$=Md(),I$=T$(Vd());fe.BASE_PATH="/computeMetadata/v1";fe.HOST_ADDRESS="http://169.254.169.254";fe.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";fe.HEADER_NAME="Metadata-Flavor";fe.HEADER_VALUE="Google";fe.HEADERS=Object.freeze({[fe.HEADER_NAME]:fe.HEADER_VALUE});var eS=I$.log("gcp-metadata");fe.METADATA_SERVER_DETECTION=Object.freeze({"assume-present":"don't try to ping the metadata server, but assume it's present",none:"don't try to ping the metadata server, but don't try to use it either","bios-only":"treat the result of a BIOS probe as canonical (don't fall back to pinging)","ping-only":"skip the BIOS probe, and go straight to pinging"});function Gd(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||fe.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(fe.BASE_PATH,t).href}o(Gd,"getBaseUrl");function R$(t){Object.keys(t).forEach(e=>{switch(e){case"params":case"property":case"headers":break;case"qs":throw new Error("'qs' is not a valid configuration option. Please use 'params' instead.");default:throw new Error(`'${e}' is not a valid configuration option.`)}})}o(R$,"validate");async function ma(t,e={},r=3,n=!1){let i=new Headers(fe.HEADERS),s="",c={};if(typeof t=="object"){let _=t;new Headers(_.headers).forEach((h,g)=>i.set(g,h)),s=_.metadataKey,c=_.params||c,r=_.noResponseRetries||r,n=_.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(R$(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((_,h)=>i.set(h,_)),c=e.params||c);let d=n?O$:Hd.request,l={url:`${Gd()}/${s}`,headers:i,retryConfig:{noResponseRetries:r},params:c,responseType:"text",timeout:nS()};eS.info("instance request %j",l);let p=await d(l);eS.info("instance metadata is %s",p.data);let f=p.headers.get(fe.HEADER_NAME);if(f!==fe.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${fe.HEADER_NAME} header. Expected '${fe.HEADER_VALUE}', got ${f?`'${f}'`:"no header"}`);if(typeof p.data=="string")try{return A$.parse(p.data)}catch{}return p.data}o(ma,"metadataAccessor");async function O$(t){let e={...t,url:t.url?.toString().replace(Gd(),Gd(fe.SECONDARY_HOST_ADDRESS))},r=(0,Hd.request)(t),n=(0,Hd.request)(e);return Promise.any([r,n])}o(O$,"fastFailMetadataRequest");function C$(t){return ma("instance",t)}o(C$,"instance");function $$(t){return ma("project",t)}o($$,"project");function k$(t){return ma("universe",t)}o(k$,"universe");async function N$(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await ma(r),i=r.metadataKey;e[i]=n})())),e}o(N$,"bulk");function z$(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(z$,"detectGCPAvailableRetries");var Su;async function D$(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in fe.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(fe.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return Wd();case"ping-only":}}try{return Su===void 0&&(Su=ma("instance",void 0,z$(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Su,!0}catch(t){let e=t;if(process.env.DEBUG_AUTH&&console.info(e),e.type==="request-timeout"||e.response&&e.response.status===404)return!1;if(!(e.response&&e.response.status===404)&&(!e.code||!["EHOSTDOWN","EHOSTUNREACH","ENETUNREACH","ENOENT","ENOTFOUND","ECONNREFUSED"].includes(e.code.toString()))){let r="UNKNOWN";e.code&&(r=e.code.toString()),process.emitWarning(`received unexpected error = ${e.message} code = ${r}`,"MetadataLookupWarning")}return!1}}o(D$,"isAvailable");function U$(){Su=void 0}o(U$,"resetIsAvailableCache");fe.gcpResidencyCache=null;function Wd(){return fe.gcpResidencyCache===null&&rS(),fe.gcpResidencyCache}o(Wd,"getGCPResidency");function rS(t=null){fe.gcpResidencyCache=t!==null?t:(0,w$.detectGCPResidency)()}o(rS,"setGCPResidency");function nS(){return Wd()?0:3e3}o(nS,"requestTimeout");x$(Md(),fe)});var aS=k(Eu=>{"use strict";Eu.byteLength=j$;Eu.toByteArray=F$;Eu.fromByteArray=V$;var Cr=[],or=[],M$=typeof Uint8Array<"u"?Uint8Array:Array,Zd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(co=0,oS=Zd.length;co<oS;++co)Cr[co]=Zd[co],or[Zd.charCodeAt(co)]=co;var co,oS;or[45]=62;or[95]=63;function iS(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}o(iS,"getLens");function j$(t){var e=iS(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(j$,"byteLength");function L$(t,e,r){return(e+r)*3/4-r}o(L$,"_byteLength");function F$(t){var e,r=iS(t),n=r[0],i=r[1],s=new M$(L$(t,n,i)),c=0,d=i>0?n-4:n,l;for(l=0;l<d;l+=4)e=or[t.charCodeAt(l)]<<18|or[t.charCodeAt(l+1)]<<12|or[t.charCodeAt(l+2)]<<6|or[t.charCodeAt(l+3)],s[c++]=e>>16&255,s[c++]=e>>8&255,s[c++]=e&255;return i===2&&(e=or[t.charCodeAt(l)]<<2|or[t.charCodeAt(l+1)]>>4,s[c++]=e&255),i===1&&(e=or[t.charCodeAt(l)]<<10|or[t.charCodeAt(l+1)]<<4|or[t.charCodeAt(l+2)]>>2,s[c++]=e>>8&255,s[c++]=e&255),s}o(F$,"toByteArray");function B$(t){return Cr[t>>18&63]+Cr[t>>12&63]+Cr[t>>6&63]+Cr[t&63]}o(B$,"tripletToBase64");function q$(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(B$(n));return i.join("")}o(q$,"encodeChunk");function V$(t){for(var e,r=t.length,n=r%3,i=[],s=16383,c=0,d=r-n;c<d;c+=s)i.push(q$(t,c,c+s>d?d:c+s));return n===1?(e=t[r-1],i.push(Cr[e>>2]+Cr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Cr[e>>10]+Cr[e>>4&63]+Cr[e<<2&63]+"=")),i.join("")}o(V$,"fromByteArray")});var Jd=k(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.fromArrayBufferToHex=H$;function H$(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o(H$,"fromArrayBufferToHex")});var sS=k(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.BrowserCrypto=void 0;var ei=aS(),G$=Jd(),Yd=class t{static{o(this,"BrowserCrypto")}constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return ei.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),ei.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let i={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),c=ei.toByteArray(t.padBase64(n)),d=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,d,c,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),c=await window.crypto.subtle.sign(n,s,i);return ei.fromByteArray(new Uint8Array(c))}decodeBase64StringUtf8(e){let r=ei.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return ei.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,G$.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),i=new TextEncoder,s=await window.crypto.subtle.importKey("raw",i.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",s,i.encode(r))}};Tu.BrowserCrypto=Yd});var uS=k(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.NodeCrypto=void 0;var ti=require("crypto"),Xd=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return ti.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return ti.randomBytes(e).toString("base64")}async verify(e,r,n){let i=ti.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=ti.createSign("RSA-SHA256");return n.update(r),n.end(),n.sign(e,"base64")}decodeBase64StringUtf8(e){return Buffer.from(e,"base64").toString("utf-8")}encodeBase64StringUtf8(e){return Buffer.from(e,"utf-8").toString("base64")}async sha256DigestHex(e){return ti.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:Z$(e);return W$(ti.createHmac("sha256",n).update(r).digest())}};xu.NodeCrypto=Xd;function W$(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(W$,"toArrayBuffer");function Z$(t){return Buffer.from(t)}o(Z$,"toBuffer")});var ga=k(on=>{"use strict";var K$=on&&on.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),J$=on&&on.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&K$(e,t,r)};Object.defineProperty(on,"__esModule",{value:!0});on.createCrypto=Q$;on.hasBrowserCrypto=cS;var Y$=sS(),X$=uS();J$(Jd(),on);function Q$(){return cS()?new Y$.BrowserCrypto:new X$.NodeCrypto}o(Q$,"createCrypto");function cS(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(cS,"hasBrowserCrypto")});var ri=k((Qd,dS)=>{var Au=require("buffer"),$r=Au.Buffer;function lS(t,e){for(var r in t)e[r]=t[r]}o(lS,"copyProps");$r.from&&$r.alloc&&$r.allocUnsafe&&$r.allocUnsafeSlow?dS.exports=Au:(lS(Au,Qd),Qd.Buffer=lo);function lo(t,e,r){return $r(t,e,r)}o(lo,"SafeBuffer");lo.prototype=Object.create($r.prototype);lS($r,lo);lo.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return $r(t,e,r)};lo.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=$r(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};lo.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return $r(t)};lo.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Au.SlowBuffer(t)}});var fS=k((Z9,pS)=>{"use strict";function ep(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(ep,"getParamSize");var ek={ES256:ep(256),ES384:ep(384),ES512:ep(521)};function tk(t){var e=ek[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(tk,"getParamBytesForAlg");pS.exports=tk});var tp=k((J9,vS)=>{"use strict";var wu=ri().Buffer,hS=fS(),Iu=128,gS=0,rk=32,nk=16,ok=2,yS=nk|rk|gS<<6,Ru=ok|gS<<6;function ik(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(ik,"base64Url");function _S(t){if(wu.isBuffer(t))return t;if(typeof t=="string")return wu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}o(_S,"signatureAsBuffer");function ak(t,e){t=_S(t);var r=hS(e),n=r+1,i=t.length,s=0;if(t[s++]!==yS)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(Iu|1)&&(c=t[s++]),i-s<c)throw new Error('"seq" specified length of "'+c+'", only "'+(i-s)+'" remaining');if(t[s++]!==Ru)throw new Error('Could not find expected "int" for "r"');var d=t[s++];if(i-s-2<d)throw new Error('"r" specified length of "'+d+'", only "'+(i-s-2)+'" available');if(n<d)throw new Error('"r" specified length of "'+d+'", max of "'+n+'" is acceptable');var l=s;if(s+=d,t[s++]!==Ru)throw new Error('Could not find expected "int" for "s"');var p=t[s++];if(i-s!==p)throw new Error('"s" specified length of "'+p+'", expected "'+(i-s)+'"');if(n<p)throw new Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var f=s;if(s+=p,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var _=r-d,h=r-p,g=wu.allocUnsafe(_+d+h+p);for(s=0;s<_;++s)g[s]=0;t.copy(g,s,l+Math.max(-_,0),l+d),s=r;for(var y=s;s<y+h;++s)g[s]=0;return t.copy(g,s,f+Math.max(-h,0),f+p),g=g.toString("base64"),g=ik(g),g}o(ak,"derToJose");function mS(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=Iu;return i&&--n,n}o(mS,"countPadding");function sk(t,e){t=_S(t);var r=hS(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=mS(t,0,r),s=mS(t,r,t.length),c=r-i,d=r-s,l=2+c+1+1+d,p=l<Iu,f=wu.allocUnsafe((p?2:3)+l),_=0;return f[_++]=yS,p?f[_++]=l:(f[_++]=Iu|1,f[_++]=l&255),f[_++]=Ru,f[_++]=c,i<0?(f[_++]=0,_+=t.copy(f,_,0,r)):_+=t.copy(f,_,i,r),f[_++]=Ru,f[_++]=d,s<0?(f[_++]=0,t.copy(f,_,r)):t.copy(f,_,r+s),f}o(sk,"joseToDer");vS.exports={derToJose:ak,joseToDer:sk}});var vr=k(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.LRUCache=void 0;an.snakeToCamel=PS;an.originalOrCamelOptions=dk;an.removeUndefinedValuesInObject=pk;an.isValidFile=fk;an.getWellKnownCertificateConfigFileLocation=mk;var uk=require("fs"),ck=require("os"),rp=require("path"),lk="certificate_config.json",bS="gcloud";function PS(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(PS,"snakeToCamel");function dk(t){function e(r){let n=t||{};return n[r]??n[PS(r)]}return o(e,"get"),{get:e}}o(dk,"originalOrCamelOptions");var np=class{static{o(this,"LRUCache")}capacity;#e=new Map;maxAge;constructor(e){this.capacity=e.capacity,this.maxAge=e.maxAge}#t(e,r){this.#e.delete(e),this.#e.set(e,{value:r,lastAccessed:Date.now()})}set(e,r){this.#t(e,r),this.#r()}get(e){let r=this.#e.get(e);if(r)return this.#t(e,r.value),this.#r(),r.value}#r(){let e=this.maxAge?Date.now()-this.maxAge:0,r=this.#e.entries().next();for(;!r.done&&(this.#e.size>this.capacity||r.value[1].lastAccessed<e);)this.#e.delete(r.value[0]),r=this.#e.entries().next()}};an.LRUCache=np;function pk(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(pk,"removeUndefinedValuesInObject");async function fk(t){try{return(await uk.promises.lstat(t)).isFile()}catch{return!1}}o(fk,"isValidFile");function mk(){let t=process.env.CLOUDSDK_CONFIG||(hk()?rp.join(process.env.APPDATA||"",bS):rp.join(process.env.HOME||"",".config",bS));return rp.join(t,lk)}o(mk,"getWellKnownCertificateConfigFileLocation");function hk(){return ck.platform().startsWith("win")}o(hk,"_isWindows")});var SS=k((eY,gk)=>{gk.exports={name:"google-auth-library",version:"10.5.0",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=18"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:"googleapis/google-auth-library-nodejs.git",keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^7.0.0","gcp-metadata":"^8.0.0","google-logging-utils":"^1.0.0",gtoken:"^8.0.0",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/jws":"^3.1.0","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","assert-rejects":"^1.0.0",c8:"^10.0.0",codecov:"^3.0.2",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",keypair:"^1.0.4",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","ts-loader":"^8.0.0",typescript:"5.8.2",webpack:"^5.21.2","webpack-cli":"^4.0.0"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check --no-inline-config",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.js","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start","docs-test":"echo 'disabled until linkinator is fixed'","predocs-test":"npm run docs",prelint:"cd samples; npm link ../; npm install"},license:"Apache-2.0"}});var op=k(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.USER_AGENT=jn.PRODUCT_NAME=jn.pkg=void 0;var ES=SS();jn.pkg=ES;var TS="google-api-nodejs-client";jn.PRODUCT_NAME=TS;var yk=`${TS}/${ES.version}`;jn.USER_AGENT=yk});var Ht=k(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.AuthClient=br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=br.DEFAULT_UNIVERSE=void 0;var _k=require("events"),ip=st(),vk=vr(),bk=Vd(),ap=op();br.DEFAULT_UNIVERSE="googleapis.com";br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var sp=class t extends _k.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=br.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,vk.originalOrCamelOptions)(e);this.apiKey=e.apiKey,this.projectId=r.get("project_id")??null,this.quotaProjectId=r.get("quota_project_id"),this.credentials=r.get("credentials")??{},this.universeDomain=r.get("universe_domain")??br.DEFAULT_UNIVERSE,this.transporter=e.transporter??new ip.Gaxios(e.transporterOptions),r.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(t.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(t.DEFAULT_RESPONSE_INTERCEPTOR)),e.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=e.forceRefreshOnFailure??!1}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&ip.Gaxios.mergeHeaders(s,r.headers),n&&ip.Gaxios.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}setCredentials(e){this.credentials=e}addSharedMetadataHeaders(e){return!e.has("x-goog-user-project")&&this.quotaProjectId&&e.set("x-goog-user-project",this.quotaProjectId),e}addUserProjectAndAuthHeaders(e,r){let n=r.get("x-goog-user-project"),i=r.get("authorization");return n&&e.set("x-goog-user-project",n),i&&e.set("authorization",i),e}static log=(0,bk.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:o(async e=>{if(!e.headers.has("x-goog-api-client")){let n=process.version.replace(/^v/,"");e.headers.set("x-goog-api-client",`gl-node/${n}`)}let r=e.headers.get("User-Agent");r?r.includes(`${ap.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${ap.USER_AGENT}`):e.headers.set("User-Agent",ap.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let c={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,s,c):t.log.info("[%s] request %j",s,c)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,i,e.data):t.log.info("[%s] response %j",i,e.data)}catch{}return e},"resolved"),rejected:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,i,e.response?.data):t.log.error("[%s] error %j",i,e.response?.data)}catch{}throw e},"rejected")};static setMethodName(e,r){try{let n=e;n[t.RequestMethodNameSymbol]=r}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};br.AuthClient=sp});var cp=k(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.LoginTicket=void 0;var up=class{static{o(this,"LoginTicket")}envelope;payload;constructor(e,r){this.envelope=e,this.payload=r}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let e=this.getPayload();return e&&e.sub?e.sub:null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}};Ou.LoginTicket=up});var po=k(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.OAuth2Client=kr.ClientAuthentication=kr.CertificateFormat=kr.CodeChallengeMethod=void 0;var xS=st(),Pk=require("querystring"),Sk=require("stream"),Ek=tp(),AS=vr(),lp=ga(),ni=Ht(),Tk=cp(),wS;(function(t){t.Plain="plain",t.S256="S256"})(wS||(kr.CodeChallengeMethod=wS={}));var sn;(function(t){t.PEM="PEM",t.JWK="JWK"})(sn||(kr.CertificateFormat=sn={}));var ya;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(ya||(kr.ClientAuthentication=ya={}));var dp=class t extends ni.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=sn.PEM;refreshTokenPromises=new Map;endpoints;issuers;clientAuthentication;_clientId;_clientSecret;refreshHandler;constructor(e={},r,n){super(typeof e=="object"?e:{}),typeof e!="object"&&(e={clientId:e,clientSecret:r,redirectUri:n}),this._clientId=e.clientId||e.client_id,this._clientSecret=e.clientSecret||e.client_secret,this.redirectUri=e.redirectUri||e.redirect_uris?.[0],this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...e.endpoints},this.clientAuthentication=e.clientAuthentication||ya.ClientSecretPost,this.issuers=e.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}static GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";static CLOCK_SKEW_SECS_=300;static DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400;generateAuthUrl(e={}){if(e.code_challenge_method&&!e.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return e.response_type=e.response_type||"code",e.client_id=e.client_id||this._clientId,e.redirect_uri=e.redirect_uri||this.redirectUri,Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+Pk.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,lp.createCrypto)(),n=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),s=(await e.sha256DigestBase64(n)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:n,codeChallenge:s}}getToken(e,r){let n=typeof e=="string"?{code:e}:e;if(r)this.getTokenAsync(n).then(i=>r(null,i.tokens,i.res),i=>r(i,null,i.response));else return this.getTokenAsync(n)}async getTokenAsync(e){let r=this.endpoints.oauth2TokenUrl.toString(),n=new Headers,i={client_id:e.client_id||this._clientId,code_verifier:e.codeVerifier,code:e.code,grant_type:"authorization_code",redirect_uri:e.redirect_uri||this.redirectUri};if(this.clientAuthentication===ya.ClientSecretBasic){let l=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${l.toString("base64")}`)}this.clientAuthentication===ya.ClientSecretPost&&(i.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,AS.removeUndefinedValuesInObject)(i)),headers:n};ni.AuthClient.setMethodName(s,"getTokenAsync");let c=await this.transporter.request(s),d=c.data;return c.data&&c.data.expires_in&&(d.expiry_date=new Date().getTime()+c.data.expires_in*1e3,delete d.expires_in),this.emit("tokens",d),{tokens:d,res:c}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let r=this.refreshTokenNoCache(e).then(n=>(this.refreshTokenPromises.delete(e),n),n=>{throw this.refreshTokenPromises.delete(e),n});return this.refreshTokenPromises.set(e,r),r}async refreshTokenNoCache(e){if(!e)throw new Error("No refresh token is set.");let r=this.endpoints.oauth2TokenUrl.toString(),n={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},i;try{let c={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,AS.removeUndefinedValuesInObject)(n))};ni.AuthClient.setMethodName(c,"refreshTokenNoCache"),i=await this.transporter.request(c)}catch(c){throw c instanceof xS.GaxiosError&&c.message==="invalid_grant"&&c.response?.data&&/ReAuth/i.test(c.response.data.error_description)&&(c.message=JSON.stringify(c.response.data)),c}let s=i.data;return i.data&&i.data.expires_in&&(s.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:i}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(r=>e(null,r.credentials,r.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),r=e.tokens;return r.refresh_token=this.credentials.refresh_token,this.credentials=r,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(r=>e(null,r.token,r.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let n=await this.processAndValidateRefreshHandler();if(n?.access_token)return this.setCredentials(n),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let r=await this.refreshAccessTokenAsync();if(!r.credentials||r.credentials&&!r.credentials.access_token)throw new Error("Could not refresh access token.");return{token:r.credentials.access_token,res:r.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let r=this.credentials;if(!r.access_token&&!r.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(r.access_token&&!this.isTokenExpiring()){r.token_type=r.token_type||"Bearer";let d=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(d)}}if(this.refreshHandler){let d=await this.processAndValidateRefreshHandler();if(d?.access_token){this.setCredentials(d);let l=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(l)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,i=null;try{n=await this.refreshToken(r.refresh_token),i=n.tokens}catch(d){let l=d;throw l.response&&(l.response.status===403||l.response.status===404)&&(l.message=`Could not refresh access token: ${l.message}`),l}let s=this.credentials;s.token_type=s.token_type||"Bearer",i.refresh_token=s.refresh_token,this.credentials=i;let c=new Headers({authorization:s.token_type+" "+i.access_token});return{headers:this.addSharedMetadataHeaders(c),res:n.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let r=new URL(this.endpoints.oauth2RevokeUrl);return r.searchParams.append("token",e),r}revokeToken(e,r){let n={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(ni.AuthClient.setMethodName(n,"revokeToken"),r)this.transporter.request(n).then(i=>r(null,i),r);else return this.transporter.request(n)}revokeCredentials(e){if(e)this.revokeCredentialsAsync().then(r=>e(null,r),e);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let e=this.credentials.access_token;if(this.credentials={},e)return this.revokeToken(e);throw new Error("No access token to revoke.")}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){try{let n=await this.getRequestMetadataAsync();return e.headers=xS.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,n.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(n){let i=n.response;if(i){let s=i.status,c=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),d=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,l=i.config.data instanceof Sk.Readable,p=s===401||s===403;if(!r&&p&&!l&&c)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&p&&!l&&d){let f=await this.processAndValidateRefreshHandler();return f?.access_token&&this.setCredentials(f),this.requestAsync(e,!0)}}throw n}}verifyIdToken(e,r){if(r&&typeof r!="function")throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(r)this.verifyIdTokenAsync(e).then(n=>r(null,n),r);else return this.verifyIdTokenAsync(e)}async verifyIdTokenAsync(e){if(!e.idToken)throw new Error("The verifyIdToken method requires an ID Token");let r=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(e.idToken,r.certs,e.audience,this.issuers,e.maxExpiry)}async getTokenInfo(e){let{data:r}=await this.transporter.request({...t.RETRY_CONFIG,method:"POST",headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8",authorization:`Bearer ${e}`},url:this.endpoints.tokenInfoUrl.toString()}),n=Object.assign({expiry_date:new Date().getTime()+r.expires_in*1e3,scopes:r.scope.split(" ")},r);return delete n.expires_in,delete n.scope,n}getFederatedSignonCerts(e){if(e)this.getFederatedSignonCertsAsync().then(r=>e(null,r.certs,r.res),e);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let e=new Date().getTime(),r=(0,lp.hasBrowserCrypto)()?sn.JWK:sn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case sn.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case sn.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let p={...t.RETRY_CONFIG,url:i};ni.AuthClient.setMethodName(p,"getFederatedSignonCertsAsync"),n=await this.transporter.request(p)}catch(p){throw p instanceof Error&&(p.message=`Failed to retrieve verification certificates: ${p.message}`),p}let s=n?.headers.get("cache-control"),c=-1;if(s){let p=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;p&&(c=Number(p)*1e3)}let d={};switch(r){case sn.PEM:d=n.data;break;case sn.JWK:for(let p of n.data.keys)d[p.kid]=p;break;default:throw new Error(`Unsupported certificate format ${r}`)}let l=new Date;return this.certificateExpiry=c===-1?null:new Date(l.getTime()+c),this.certificateCache=d,this.certificateCacheFormat=r,{certs:d,format:r,res:n}}getIapPublicKeys(e){if(e)this.getIapPublicKeysAsync().then(r=>e(null,r.pubkeys,r.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,r=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let n={...t.RETRY_CONFIG,url:r};ni.AuthClient.setMethodName(n,"getIapPublicKeysAsync"),e=await this.transporter.request(n)}catch(n){throw n instanceof Error&&(n.message=`Failed to retrieve verification certificates: ${n.message}`),n}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,r,n,i,s){let c=(0,lp.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let d=e.split(".");if(d.length!==3)throw new Error("Wrong number of segments in token: "+e);let l=d[0]+"."+d[1],p=d[2],f,_;try{f=JSON.parse(c.decodeBase64StringUtf8(d[0]))}catch(L){throw L instanceof Error&&(L.message=`Can't parse token envelope: ${d[0]}': ${L.message}`),L}if(!f)throw new Error("Can't parse token envelope: "+d[0]);try{_=JSON.parse(c.decodeBase64StringUtf8(d[1]))}catch(L){throw L instanceof Error&&(L.message=`Can't parse token payload '${d[0]}`),L}if(!_)throw new Error("Can't parse token payload: "+d[1]);if(!Object.prototype.hasOwnProperty.call(r,f.kid))throw new Error("No pem found for envelope: "+JSON.stringify(f));let h=r[f.kid];if(f.alg==="ES256"&&(p=Ek.joseToDer(p,"ES256").toString("base64")),!await c.verify(h,l,p))throw new Error("Invalid token signature: "+e);if(!_.iat)throw new Error("No issue time in token: "+JSON.stringify(_));if(!_.exp)throw new Error("No expiration time in token: "+JSON.stringify(_));let y=Number(_.iat);if(isNaN(y))throw new Error("iat field using invalid format");let T=Number(_.exp);if(isNaN(T))throw new Error("exp field using invalid format");let P=new Date().getTime()/1e3;if(T>=P+s)throw new Error("Expiration time too far in future: "+JSON.stringify(_));let x=y-t.CLOCK_SKEW_SECS_,N=T+t.CLOCK_SKEW_SECS_;if(P<x)throw new Error("Token used too early, "+P+" < "+x+": "+JSON.stringify(_));if(P>N)throw new Error("Token used too late, "+P+" > "+N+": "+JSON.stringify(_));if(i&&i.indexOf(_.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+_.iss);if(typeof n<"u"&&n!==null){let L=_.aud,X=!1;if(n.constructor===Array?X=n.indexOf(L)>-1:X=L===n,!X)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new Tk.LoginTicket(f,_)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let e=await this.refreshHandler();if(!e.access_token)throw new Error("No access token is returned by the refreshHandler callback.");return e}}isTokenExpiring(){let e=this.credentials.expiry_date;return e?e<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}};kr.OAuth2Client=dp});var fp=k(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.Compute=void 0;var xk=st(),IS=ha(),Ak=po(),pp=class extends Ak.OAuth2Client{static{o(this,"Compute")}serviceAccountEmail;scopes;constructor(e={}){super(e),this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=e.serviceAccountEmail||"default",this.scopes=Array.isArray(e.scopes)?e.scopes:e.scopes?[e.scopes]:[]}async refreshTokenNoCache(){let e=`service-accounts/${this.serviceAccountEmail}/token`,r;try{let i={property:e};this.scopes.length>0&&(i.params={scopes:this.scopes.join(",")}),r=await IS.instance(i)}catch(i){throw i instanceof xk.GaxiosError&&(i.message=`Could not refresh access token: ${i.message}`,this.wrapError(i)),i}let n=r;return r&&r.expires_in&&(n.expiry_date=new Date().getTime()+r.expires_in*1e3,delete n.expires_in),this.emit("tokens",n),{tokens:n,res:null}}async fetchIdToken(e){let r=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${e}`,n;try{let i={property:r};n=await IS.instance(i)}catch(i){throw i instanceof Error&&(i.message=`Could not fetch ID token: ${i.message}`),i}return n}wrapError(e){let r=e.response;r&&r.status&&(e.status=r.status,r.status===403?e.message="A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified: "+e.message:r.status===404&&(e.message="A Not Found error was returned while attempting to retrieve an accesstoken for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have any permission scopes specified: "+e.message))}};Cu.Compute=pp});var hp=k($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.IdTokenClient=void 0;var wk=po(),mp=class extends wk.OAuth2Client{static{o(this,"IdTokenClient")}targetAudience;idTokenProvider;constructor(e){super(e),this.targetAudience=e.targetAudience,this.idTokenProvider=e.idTokenProvider}async getRequestMetadataAsync(){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let r=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:r,expiry_date:this.getIdTokenExpiryDate(r)}}return{headers:new Headers({authorization:"Bearer "+this.credentials.id_token})}}getIdTokenExpiryDate(e){let r=e.split(".")[1];if(r)return JSON.parse(Buffer.from(r,"base64").toString("ascii")).exp*1e3}};$u.IdTokenClient=mp});var gp=k(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.GCPEnv=void 0;oi.clear=Ik;oi.getEnv=Rk;var RS=ha(),Nr;(function(t){t.APP_ENGINE="APP_ENGINE",t.KUBERNETES_ENGINE="KUBERNETES_ENGINE",t.CLOUD_FUNCTIONS="CLOUD_FUNCTIONS",t.COMPUTE_ENGINE="COMPUTE_ENGINE",t.CLOUD_RUN="CLOUD_RUN",t.CLOUD_RUN_JOBS="CLOUD_RUN_JOBS",t.NONE="NONE"})(Nr||(oi.GCPEnv=Nr={}));var _a;function Ik(){_a=void 0}o(Ik,"clear");async function Rk(){return _a||(_a=Ok(),_a)}o(Rk,"getEnv");async function Ok(){let t=Nr.NONE;return Ck()?t=Nr.APP_ENGINE:$k()?t=Nr.CLOUD_FUNCTIONS:await Dk()?await zk()?t=Nr.KUBERNETES_ENGINE:kk()?t=Nr.CLOUD_RUN:Nk()?t=Nr.CLOUD_RUN_JOBS:t=Nr.COMPUTE_ENGINE:t=Nr.NONE,t}o(Ok,"getEnvMemoized");function Ck(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(Ck,"isAppEngine");function $k(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o($k,"isCloudFunction");function kk(){return!!process.env.K_CONFIGURATION}o(kk,"isCloudRun");function Nk(){return!!process.env.CLOUD_RUN_JOB}o(Nk,"isCloudRunJob");async function zk(){try{return await RS.instance("attributes/cluster-name"),!0}catch{return!1}}o(zk,"isKubernetesEngine");async function Dk(){return RS.isAvailable()}o(Dk,"isComputeEngine")});var yp=k((mY,OS)=>{var ku=ri().Buffer,Uk=require("stream"),Mk=require("util");function Nu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=ku.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=ku.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}o(Nu,"DataStream");Mk.inherits(Nu,Uk);Nu.prototype.write=o(function(e){this.buffer=ku.concat([this.buffer,ku.from(e)]),this.emit("data",e)},"write");Nu.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");OS.exports=Nu});var $S=k((gY,CS)=>{"use strict";var va=require("buffer").Buffer,_p=require("buffer").SlowBuffer;CS.exports=zu;function zu(t,e){if(!va.isBuffer(t)||!va.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}o(zu,"bufferEq");zu.install=function(){va.prototype.equal=_p.prototype.equal=o(function(e){return zu(this,e)},"equal")};var jk=va.prototype.equal,Lk=_p.prototype.equal;zu.restore=function(){va.prototype.equal=jk,_p.prototype.equal=Lk}});var Sp=k((_Y,FS)=>{var ai=ri().Buffer,ir=require("crypto"),NS=tp(),kS=require("util"),Fk=`"%s" is not a valid algorithm.
39
39
  Supported algorithms are:
40
- "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,ba="secret must be a string or buffer",ii="key must be a string or a buffer",Lk="key must be a string, a buffer or an object",bp=typeof ir.createPublicKey=="function";bp&&(ii+=" or a KeyObject",ba+="or a KeyObject");function NS(t){if(!ai.isBuffer(t)&&typeof t!="string"&&(!bp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Pr(ii)}o(NS,"checkIsPublicKey");function zS(t){if(!ai.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Pr(Lk)}o(zS,"checkIsPrivateKey");function Fk(t){if(!ai.isBuffer(t)){if(typeof t=="string")return t;if(!bp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Pr(ba)}}o(Fk,"checkIsSecretKey");function Pp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Pp,"fromBase64");function DS(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r<e;++r)t+="=";return t.replace(/\-/g,"+").replace(/_/g,"/")}o(DS,"toBase64");function Pr(t){var e=[].slice.call(arguments,1),r=$S.format.bind($S,t).apply(null,e);return new TypeError(r)}o(Pr,"typeError");function Bk(t){return ai.isBuffer(t)||typeof t=="string"}o(Bk,"bufferOrString");function Pa(t){return Bk(t)||(t=JSON.stringify(t)),t}o(Pa,"normalizeInput");function US(t){return o(function(r,n){Fk(n),r=Pa(r);var i=ir.createHmac("sha"+t,n),s=(i.update(r),i.digest("base64"));return Pp(s)},"sign")}o(US,"createHmacSigner");var vp,qk="timingSafeEqual"in ir?o(function(e,r){return e.byteLength!==r.byteLength?!1:ir.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return vp||(vp=CS()),vp(e,r)},"timingSafeEqual");function Vk(t){return o(function(r,n,i){var s=US(t)(r,i);return qk(ai.from(n),ai.from(s))},"verify")}o(Vk,"createHmacVerifier");function MS(t){return o(function(r,n){zS(n),r=Pa(r);var i=ir.createSign("RSA-SHA"+t),s=(i.update(r),i.sign(n,"base64"));return Pp(s)},"sign")}o(MS,"createKeySigner");function jS(t){return o(function(r,n,i){NS(i),r=Pa(r),n=DS(n);var s=ir.createVerify("RSA-SHA"+t);return s.update(r),s.verify(i,n,"base64")},"verify")}o(jS,"createKeyVerifier");function Hk(t){return o(function(r,n){zS(n),r=Pa(r);var i=ir.createSign("RSA-SHA"+t),s=(i.update(r),i.sign({key:n,padding:ir.constants.RSA_PKCS1_PSS_PADDING,saltLength:ir.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Pp(s)},"sign")}o(Hk,"createPSSKeySigner");function Gk(t){return o(function(r,n,i){NS(i),r=Pa(r),n=DS(n);var s=ir.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:i,padding:ir.constants.RSA_PKCS1_PSS_PADDING,saltLength:ir.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(Gk,"createPSSKeyVerifier");function Wk(t){var e=MS(t);return o(function(){var n=e.apply(null,arguments);return n=kS.derToJose(n,"ES"+t),n},"sign")}o(Wk,"createECDSASigner");function Zk(t){var e=jS(t);return o(function(n,i,s){i=kS.joseToDer(i,"ES"+t).toString("base64");var c=e(n,i,s);return c},"verify")}o(Zk,"createECDSAVerifer");function Kk(){return o(function(){return""},"sign")}o(Kk,"createNoneSigner");function Jk(){return o(function(e,r){return r===""},"verify")}o(Jk,"createNoneVerifier");LS.exports=o(function(e){var r={hs:US,rs:MS,ps:Hk,es:Wk,none:Kk},n={hs:Vk,rs:jS,ps:Gk,es:Zk,none:Jk},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Pr(jk,e);var s=(i[1]||i[3]).toLowerCase(),c=i[2];return{sign:r[s](c),verify:n[s](c)}},"jwa")});var Ep=k((gY,FS)=>{var Yk=require("buffer").Buffer;FS.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||Yk.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var WS=k((_Y,GS)=>{var Xk=ri().Buffer,BS=yp(),Qk=Sp(),eN=require("stream"),qS=Ep(),Tp=require("util");function VS(t,e){return Xk.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(VS,"base64url");function tN(t,e,r){r=r||"utf8";var n=VS(qS(t),"binary"),i=VS(qS(e),r);return Tp.format("%s.%s",n,i)}o(tN,"jwsSecuredInput");function HS(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,s=Qk(e.alg),c=tN(e,r,i),d=s.sign(c,n);return Tp.format("%s.%s",c,d)}o(HS,"jwsSign");function Du(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new BS(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new BS(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}o(Du,"SignStream");Tp.inherits(Du,eN);Du.prototype.sign=o(function(){try{var e=HS({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}},"sign");Du.sign=HS;GS.exports=Du});var nE=k((bY,rE)=>{var KS=ri().Buffer,ZS=yp(),rN=Sp(),nN=require("stream"),JS=Ep(),oN=require("util"),iN=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function aN(t){return Object.prototype.toString.call(t)==="[object Object]"}o(aN,"isObject");function sN(t){if(aN(t))return t;try{return JSON.parse(t)}catch{return}}o(sN,"safeJsonParse");function YS(t){var e=t.split(".",1)[0];return sN(KS.from(e,"base64").toString("binary"))}o(YS,"headerFromJWS");function uN(t){return t.split(".",2).join(".")}o(uN,"securedInputFromJWS");function XS(t){return t.split(".")[2]}o(XS,"signatureFromJWS");function cN(t,e){e=e||"utf8";var r=t.split(".")[1];return KS.from(r,"base64").toString(e)}o(cN,"payloadFromJWS");function QS(t){return iN.test(t)&&!!YS(t)}o(QS,"isValidJws");function eE(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=JS(t);var i=XS(t),s=uN(t),c=rN(e);return c.verify(s,i,r)}o(eE,"jwsVerify");function tE(t,e){if(e=e||{},t=JS(t),!QS(t))return null;var r=YS(t);if(!r)return null;var n=cN(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:XS(t)}}o(tE,"jwsDecode");function si(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new ZS(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new ZS(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}o(si,"VerifyStream");oN.inherits(si,nN);si.prototype.verify=o(function(){try{var e=eE(this.signature.buffer,this.algorithm,this.key.buffer),r=tE(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"verify");si.decode=tE;si.isValid=QS;si.verify=eE;rE.exports=si});var xp=k(Ln=>{var oE=WS(),Uu=nE(),lN=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Ln.ALGORITHMS=lN;Ln.sign=oE.sign;Ln.verify=Uu.verify;Ln.decode=Uu.decode;Ln.isValid=Uu.isValid;Ln.createSign=o(function(e){return new oE(e)},"createSign");Ln.createVerify=o(function(e){return new Uu(e)},"createVerify")});var vE=k(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.GoogleToken=void 0;var iE=Mu(require("fs")),dN=at(),pN=Mu(xp()),fN=Mu(require("path")),mN=require("util");function Mu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Mu=o(function(s,c){if(!c&&s&&s.__esModule)return s;var d,l,p={__proto__:null,default:s};if(s===null||un(s)!="object"&&typeof s!="function")return p;if(d=c?n:r){if(d.has(s))return d.get(s);d.set(s,p)}for(var f in s)f!=="default"&&{}.hasOwnProperty.call(s,f)&&((l=(d=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,f))&&(l.get||l.set)?d(p,f,l):p[f]=s[f]);return p},"_interopRequireWildcard"))(t,e)}o(Mu,"_interopRequireWildcard");function un(t){"@babel/helpers - typeof";return un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},un(t)}o(un,"_typeof");function hN(t,e){mE(t,e),e.add(t)}o(hN,"_classPrivateMethodInitSpec");function gN(t,e,r){mE(t,e),e.set(t,r)}o(gN,"_classPrivateFieldInitSpec");function mE(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(mE,"_checkPrivateRedeclaration");function aE(t,e,r){return t.set(Sr(t,e),r),r}o(aE,"_classPrivateFieldSet");function sE(t,e){return t.get(Sr(t,e))}o(sE,"_classPrivateFieldGet");function Sr(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}o(Sr,"_assertClassBrand");function uE(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,yE(n.key),n)}}o(uE,"_defineProperties");function hE(t,e,r){return e&&uE(t.prototype,e),r&&uE(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(hE,"_createClass");function gE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(gE,"_classCallCheck");function yN(t,e,r){return e=xa(e),_N(t,Cp()?Reflect.construct(e,r||[],xa(t).constructor):e.apply(t,r))}o(yN,"_callSuper");function _N(t,e){if(e&&(un(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vN(t)}o(_N,"_possibleConstructorReturn");function vN(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(vN,"_assertThisInitialized");function bN(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ta(t,e)}o(bN,"_inherits");function Ap(t){var e=typeof Map=="function"?new Map:void 0;return Ap=o(function(n){if(n===null||!SN(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return PN(n,arguments,xa(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ta(i,n)},"_wrapNativeSuper"),Ap(t)}o(Ap,"_wrapNativeSuper");function PN(t,e,r){if(Cp())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Ta(i,r.prototype),i}o(PN,"_construct");function Cp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Cp=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(Cp,"_isNativeReflectConstruct");function SN(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(SN,"_isNativeFunction");function Ta(t,e){return Ta=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ta(t,e)}o(Ta,"_setPrototypeOf");function xa(t){return xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xa(t)}o(xa,"_getPrototypeOf");function Gt(t,e,r){return(e=yE(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(Gt,"_defineProperty");function yE(t){var e=EN(t,"string");return un(e)=="symbol"?e:e+""}o(yE,"_toPropertyKey");function EN(t,e){if(un(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(un(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(EN,"_toPrimitive");function Zt(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(g,y,T,P){var x=y&&y.prototype instanceof d?y:d,N=Object.create(x.prototype);return Wt(N,"_invoke",(function(L,X,W){var G,Z,ee,Y=0,Se=W||[],te=!1,q={p:0,n:0,v:t,a:B,f:B.bind(t,4),d:o(function(K,re){return G=K,Z=0,ee=t,q.n=re,c},"d")};function B(J,K){for(Z=J,ee=K,e=0;!te&&Y&&!re&&e<Se.length;e++){var re,oe=Se[e],Ae=q.p,Oe=oe[2];J>3?(re=Oe===K)&&(ee=oe[(Z=oe[4])?5:(Z=3,3)],oe[4]=oe[5]=t):oe[0]<=Ae&&((re=J<2&&Ae<oe[1])?(Z=0,q.v=K,q.n=oe[1]):Ae<Oe&&(re=J<3||oe[0]>K||K>Oe)&&(oe[4]=J,oe[5]=K,q.n=Oe,Z=0))}if(re||J>1)return c;throw te=!0,K}return o(B,"d"),function(J,K,re){if(Y>1)throw TypeError("Generator is already running");for(te&&K===1&&B(K,re),Z=K,ee=re;(e=Z<2?t:ee)||!te;){G||(Z?Z<3?(Z>1&&(q.n=-1),B(Z,ee)):q.n=ee:q.v=ee);try{if(Y=2,G){if(Z||(J="next"),e=G[J]){if(!(e=e.call(G,ee)))throw TypeError("iterator result is not an object");if(!e.done)return e;ee=e.value,Z<2&&(Z=0)}else Z===1&&(e=G.return)&&e.call(G),Z<2&&(ee=TypeError("The iterator does not provide a '"+J+"' method"),Z=1);G=t}else if((e=(te=q.n<0)?ee:L.call(X,q))!==c)break}catch(oe){G=t,Z=1,ee=oe}finally{Y=1}}return{value:e,done:te}}})(g,T,P),!0),N}o(s,"i");var c={};function d(){}o(d,"Generator");function l(){}o(l,"GeneratorFunction");function p(){}o(p,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var f=[][n]?e(e([][n]())):(Wt(e={},n,function(){return this}),e),_=p.prototype=d.prototype=Object.create(f);function h(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,p):(g.__proto__=p,Wt(g,i,"GeneratorFunction")),g.prototype=Object.create(_),g}return o(h,"f"),l.prototype=p,Wt(_,"constructor",p),Wt(p,"constructor",l),l.displayName="GeneratorFunction",Wt(p,i,"GeneratorFunction"),Wt(_),Wt(_,i,"Generator"),Wt(_,n,function(){return this}),Wt(_,"toString",function(){return"[object Generator]"}),(Zt=o(function(){return{w:s,m:h}},"_regenerator"))()}o(Zt,"_regenerator");function Wt(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}Wt=o(function(c,d,l,p){if(d)i?i(c,d,{value:l,enumerable:!p,configurable:!p,writable:!p}):c[d]=l;else{var f=o(function(h,g){Wt(c,h,function(y){return this._invoke(h,g,y)})},"o");f("next",0),f("throw",1),f("return",2)}},"_regeneratorDefine"),Wt(t,e,r,n)}o(Wt,"_regeneratorDefine2");function cE(t,e,r,n,i,s,c){try{var d=t[s](c),l=d.value}catch(p){return void r(p)}d.done?e(l):Promise.resolve(l).then(n,i)}o(cE,"asyncGeneratorStep");function ui(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function c(l){cE(s,n,i,c,d,"next",l)}o(c,"_next");function d(l){cE(s,n,i,c,d,"throw",l)}o(d,"_throw"),c(void 0)})}}o(ui,"_asyncToGenerator");var lE=iE.readFile?(0,mN.promisify)(iE.readFile):ui(Zt().m(o(function t(){return Zt().w(function(e){for(;;)switch(e.n){case 0:throw new Ea("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),dE="https://oauth2.googleapis.com/token",TN="https://oauth2.googleapis.com/revoke?token=",Ea=(function(t){function e(r,n){var i;return gE(this,e),i=yN(this,e,[r]),Gt(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),bN(e,t),hE(e)})(Ap(Error)),Sa=new WeakMap,zr=new WeakSet,TY=ju.GoogleToken=(function(){function t(e){gE(this,t),hN(this,zr),Gt(this,"expiresAt",void 0),Gt(this,"key",void 0),Gt(this,"keyFile",void 0),Gt(this,"iss",void 0),Gt(this,"sub",void 0),Gt(this,"scope",void 0),Gt(this,"rawToken",void 0),Gt(this,"tokenExpires",void 0),Gt(this,"email",void 0),Gt(this,"additionalClaims",void 0),Gt(this,"eagerRefreshThresholdMillis",void 0),Gt(this,"transporter",{request:o(function(n){return(0,dN.request)(n)},"request")}),gN(this,Sa,void 0),Sr(zr,this,_E).call(this,e)}return o(t,"GoogleToken"),hE(t,[{key:"accessToken",get:o(function(){return this.rawToken?this.rawToken.access_token:void 0},"get")},{key:"idToken",get:o(function(){return this.rawToken?this.rawToken.id_token:void 0},"get")},{key:"tokenType",get:o(function(){return this.rawToken?this.rawToken.token_type:void 0},"get")},{key:"refreshToken",get:o(function(){return this.rawToken?this.rawToken.refresh_token:void 0},"get")},{key:"hasExpired",value:o(function(){var r=new Date().getTime();return this.rawToken&&this.expiresAt?r>=this.expiresAt:!0},"hasExpired")},{key:"isTokenExpiring",value:o(function(){var r,n=new Date().getTime(),i=(r=this.eagerRefreshThresholdMillis)!==null&&r!==void 0?r:0;return this.rawToken&&this.expiresAt?this.expiresAt<=n+i:!0},"isTokenExpiring")},{key:"getToken",value:o(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(un(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;Sr(zr,this,pE).call(this,n).then(function(s){return i(null,s)},r);return}return Sr(zr,this,pE).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=ui(Zt().m(o(function n(i){var s,c,d,l,p,f,_;return Zt().w(function(h){for(;;)switch(h.n){case 0:s=fN.extname(i),_=s,h.n=_===".json"?1:_===".der"||_===".crt"||_===".pem"?4:_===".p12"||_===".pfx"?6:7;break;case 1:return h.n=2,lE(i,"utf8");case 2:if(c=h.v,d=JSON.parse(c),l=d.private_key,p=d.client_email,!(!l||!p)){h.n=3;break}throw new Ea("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return h.a(2,{privateKey:l,clientEmail:p});case 4:return h.n=5,lE(i,"utf8");case 5:return f=h.v,h.a(2,{privateKey:f});case 6:throw new Ea("*.p12 certificates are not supported after v6.1.2. Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.","UNKNOWN_CERTIFICATE_TYPE");case 7:throw new Ea("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return h.a(2)}},n)},"_callee2")));function r(n){return e.apply(this,arguments)}return o(r,"getCredentials"),r})()},{key:"revokeToken",value:o(function(r){if(r){Sr(zr,this,fE).call(this).then(function(){return r()},r);return}return Sr(zr,this,fE).call(this)},"revokeToken")}])})();function pE(t){return wp.apply(this,arguments)}o(pE,"_getTokenAsync");function wp(){return wp=ui(Zt().m(o(function t(e){return Zt().w(function(r){for(;;)switch(r.n){case 0:if(!(sE(Sa,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,sE(Sa,this));case 1:return r.p=1,r.n=2,aE(Sa,this,Sr(zr,this,xN).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,aE(Sa,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),wp.apply(this,arguments)}o(wp,"_getTokenAsync2");function xN(t){return Ip.apply(this,arguments)}o(xN,"_getTokenAsyncInner");function Ip(){return Ip=ui(Zt().m(o(function t(e){var r;return Zt().w(function(n){for(;;)switch(n.n){case 0:if(!(this.isTokenExpiring()===!1&&e.forceRefresh===!1)){n.n=1;break}return n.a(2,Promise.resolve(this.rawToken));case 1:if(!(!this.key&&!this.keyFile)){n.n=2;break}throw new Error("No key or keyFile set.");case 2:if(!(!this.key&&this.keyFile)){n.n=4;break}return n.n=3,this.getCredentials(this.keyFile);case 3:r=n.v,this.key=r.privateKey,this.iss=r.clientEmail||this.iss,r.clientEmail||Sr(zr,this,AN).call(this);case 4:return n.a(2,Sr(zr,this,wN).call(this))}},t,this)},"_callee4"))),Ip.apply(this,arguments)}o(Ip,"_getTokenAsyncInner2");function AN(){if(!this.iss)throw new Ea("email is required.","MISSING_CREDENTIALS")}o(AN,"_ensureEmail");function fE(){return Rp.apply(this,arguments)}o(fE,"_revokeTokenAsync");function Rp(){return Rp=ui(Zt().m(o(function t(){var e;return Zt().w(function(r){for(;;)switch(r.n){case 0:if(this.accessToken){r.n=1;break}throw new Error("No token to revoke.");case 1:return e=TN+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Sr(zr,this,_E).call(this,{email:this.iss,sub:this.sub,key:this.key,keyFile:this.keyFile,scope:this.scope,additionalClaims:this.additionalClaims});case 3:return r.a(2)}},t,this)},"_callee5"))),Rp.apply(this,arguments)}o(Rp,"_revokeTokenAsync2");function _E(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.keyFile=t.keyFile,this.key=t.key,this.rawToken=void 0,this.iss=t.email||t.iss,this.sub=t.sub,this.additionalClaims=t.additionalClaims,un(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(_E,"_configure");function wN(){return Op.apply(this,arguments)}o(wN,"_requestToken");function Op(){return Op=ui(Zt().m(o(function t(){var e,r,n,i,s,c,d,l,p,f;return Zt().w(function(_){for(;;)switch(_.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:dE,exp:e+3600,iat:e,sub:this.sub},r),i=pN.sign({header:{alg:"RS256"},payload:n,secret:this.key}),_.p=1,_.n=2,this.transporter.request({method:"POST",url:dE,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=_.v,this.rawToken=s.data,this.expiresAt=s.data.expires_in===null||s.data.expires_in===void 0?void 0:(e+s.data.expires_in)*1e3,_.a(2,this.rawToken);case 3:throw _.p=3,f=_.v,this.rawToken=void 0,this.tokenExpires=void 0,l=f.response&&(c=f.response)!==null&&c!==void 0&&c.data?(d=f.response)===null||d===void 0?void 0:d.data:{},l.error&&(p=l.error_description?": ".concat(l.error_description):"",f.message="".concat(l.error).concat(p)),f;case 4:return _.a(2)}},t,this,[[1,3]])},"_callee6"))),Op.apply(this,arguments)}o(Op,"_requestToken2")});var kp=k(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.JWTAccess=void 0;var IN=xp(),RN=vr(),bE={alg:"RS256",typ:"JWT"},$p=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new RN.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,r,n,i){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=i??300*1e3}getCachedKey(e,r){let n=e;if(r&&Array.isArray(r)&&r.length?n=e?`${e}_${r.join("_")}`:`${r.join("_")}`:typeof r=="string"&&(n=e?`${e}_${r}`:r),!n)throw Error("Scopes or url must be provided");return n}getRequestHeaders(e,r,n){let i=this.getCachedKey(e,n),s=this.cache.get(i),c=Date.now();if(s&&s.expiration-c>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let d=Math.floor(Date.now()/1e3),l=t.getExpirationTime(d),p;if(Array.isArray(n)&&(n=n.join(" ")),n?p={iss:this.email,sub:this.email,scope:n,exp:l,iat:d}:p={iss:this.email,sub:this.email,aud:e,exp:l,iat:d},r){for(let y in p)if(r[y])throw new Error(`The '${y}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let f=this.keyId?{...bE,kid:this.keyId}:bE,_=Object.assign(p,r),h=IN.sign({header:f,payload:_,secret:this.key}),g=new Headers({authorization:`Bearer ${h}`});return this.cache.set(i,{expiration:l*1e3,headers:g}),g}static getExpirationTime(e){return e+3600}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{e||n(new Error("Must pass in a stream containing the service account auth settings."));let i="";e.setEncoding("utf8").on("data",s=>i+=s).on("error",n).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}};Lu.JWTAccess=$p});var zp=k(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.JWT=void 0;var PE=vE(),ON=kp(),CN=po(),Fu=Ht(),Np=class t extends CN.OAuth2Client{static{o(this,"JWT")}email;keyFile;key;keyId;defaultScopes;scopes;scope;subject;gtoken;additionalClaims;useJWTAccessWithScope;defaultServicePath;access;constructor(e={}){super(e),this.email=e.email,this.keyFile=e.keyFile,this.key=e.key,this.keyId=e.keyId,this.scopes=e.scopes,this.subject=e.subject,this.additionalClaims=e.additionalClaims,this.credentials={refresh_token:"jwt-placeholder",expiry_date:1}}createScoped(e){let r=new t(this);return r.scopes=e,r}async getRequestMetadataAsync(e){e=this.defaultServicePath?`https://${this.defaultServicePath}/`:e;let r=!this.hasUserScopes()&&e||this.useJWTAccessWithScope&&this.hasAnyScopes()||this.universeDomain!==Fu.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==Fu.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${Fu.DEFAULT_UNIVERSE}`);if(!this.apiKey&&r)if(this.additionalClaims&&this.additionalClaims.target_audience){let{tokens:n}=await this.refreshToken();return{headers:this.addSharedMetadataHeaders(new Headers({authorization:`Bearer ${n.id_token}`}))}}else{this.access||(this.access=new ON.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let n;this.hasUserScopes()?n=this.scopes:e||(n=this.defaultScopes);let i=this.useJWTAccessWithScope||this.universeDomain!==Fu.DEFAULT_UNIVERSE,s=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,i?n:void 0);return{headers:this.addSharedMetadataHeaders(s)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let r=new PE.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:{target_audience:e},transporter:this.transporter});if(await r.getToken({forceRefresh:!0}),!r.idToken)throw new Error("Unknown error: Failed to fetch ID token");return r.idToken}hasUserScopes(){return this.scopes?this.scopes.length>0:!1}hasAnyScopes(){return!!(this.scopes&&this.scopes.length>0||this.defaultScopes&&this.defaultScopes.length>0)}authorize(e){if(e)this.authorizeAsync().then(r=>e(null,r),e);else return this.authorizeAsync()}async authorizeAsync(){let e=await this.refreshToken();if(!e)throw new Error("No result returned");return this.credentials=e.tokens,this.credentials.refresh_token="jwt-placeholder",this.key=this.gtoken.key,this.email=this.gtoken.iss,e.tokens}async refreshTokenNoCache(){let e=this.createGToken(),n={access_token:(await e.getToken({forceRefresh:this.isTokenExpiring()})).access_token,token_type:"Bearer",expiry_date:e.expiresAt,id_token:e.idToken};return this.emit("tokens",n),{res:null,tokens:n}}createGToken(){return this.gtoken||(this.gtoken=new PE.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}fromAPIKey(e){if(typeof e!="string")throw new Error("Must provide an API Key string.");this.apiKey=e}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let r=await this.createGToken().getCredentials(this.keyFile);return{private_key:r.privateKey,client_email:r.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};Bu.JWT=Np});var Up=k(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.UserRefreshClient=ci.USER_REFRESH_ACCOUNT_TYPE=void 0;var $N=po(),kN=Ht();ci.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var Dp=class t extends $N.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,s){let c=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:s};super(c),this._refreshToken=c.refreshToken,this.credentials.refresh_token=c.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){let r={...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e})};return kN.AuthClient.setMethodName(r,"fetchIdToken"),(await this.transporter.request(r)).data.id_token}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the user refresh token");if(e.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!e.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!e.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!e.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=e.client_id,this._clientSecret=e.client_secret,this._refreshToken=e.refresh_token,this.credentials.refresh_token=e.refresh_token,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}async fromStreamAsync(e){return new Promise((r,n)=>{if(!e)return n(new Error("Must pass in a stream containing the user refresh token."));let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);return this.fromJSON(s),r()}catch(s){return n(s)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};ci.UserRefreshClient=Dp});var jp=k(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.Impersonated=li.IMPERSONATED_ACCOUNT_TYPE=void 0;var SE=po(),NN=at(),zN=vr();li.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var Mp=class t extends SE.OAuth2Client{static{o(this,"Impersonated")}sourceClient;targetPrincipal;targetScopes;delegates;lifetime;endpoint;constructor(e={}){if(super(e),this.credentials={expiry_date:1,refresh_token:"impersonated-placeholder"},this.sourceClient=e.sourceClient??new SE.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,zN.originalOrCamelOptions)(e).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=e.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(e){await this.sourceClient.getAccessToken();let r=`projects/-/serviceAccounts/${this.targetPrincipal}`,n=`${this.endpoint}/v1/${r}:signBlob`,i={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:i,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let e="projects/-/serviceAccounts/"+this.targetPrincipal,r=`${this.endpoint}/v1/${e}:generateAccessToken`,n={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},i=await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:n,method:"POST"}),s=i.data;return this.credentials.access_token=s.accessToken,this.credentials.expiry_date=Date.parse(s.expireTime),{tokens:this.credentials,res:i}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof NN.GaxiosError&&(r=e?.response?.data?.error?.status,n=e?.response?.data?.error?.message),r&&n?(e.message=`${r}: unable to impersonate: ${n}`,e):(e.message=`unable to impersonate: ${e}`,e)}}async fetchIdToken(e,r){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,i=`${this.endpoint}/v1/${n}:generateIdToken`,s={delegates:this.delegates,audience:e,includeEmail:r?.includeEmail??!0,useEmailAzp:r?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:i,data:s,method:"POST"})).data.token}};li.Impersonated=Mp});var Fp=k(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.OAuthClientAuthHandler=void 0;Aa.getErrorFromOAuthErrorResponse=MN;var di=at(),DN=ga(),UN=["PUT","POST","PATCH"],Lp=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,DN.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new di.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new di.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=di.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=di.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=di.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${i}`);di.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!UN.includes(r))throw new Error(`${r} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let i=new Headers(e.headers).get("content-type");if(i?.startsWith("application/x-www-form-urlencoded")||e.data instanceof URLSearchParams){let s=new URLSearchParams(e.data??"");s.append("client_id",this.#t.clientId),s.append("client_secret",this.#t.clientSecret||""),e.data=s}else if(i?.startsWith("application/json"))e.data=e.data||{},Object.assign(e.data,{client_id:this.#t.clientId,client_secret:this.#t.clientSecret||""});else throw new Error(`${i} content-types are not supported with ${this.#t.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};Aa.OAuthClientAuthHandler=Lp;function MN(t,e){let r=t.error,n=t.error_description,i=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof i<"u"&&(s+=` - ${i}`);let c=new Error(s);if(e){let d=Object.keys(e);e.stack&&d.push("stack"),d.forEach(l=>{l!=="message"&&Object.defineProperty(c,l,{value:e[l],writable:!1,enumerable:!0})})}return c}o(MN,"getErrorFromOAuthErrorResponse")});var Vu=k(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.StsCredentials=void 0;var jN=at(),LN=Ht(),EE=Fp(),FN=vr(),Bp=class t extends EE.OAuthClientAuthHandler{static{o(this,"StsCredentials")}#e;constructor(e={tokenExchangeEndpoint:""},r){(typeof e!="object"||e instanceof URL)&&(e={tokenExchangeEndpoint:e,clientAuthentication:r}),super(e),this.#e=e.tokenExchangeEndpoint}async exchangeToken(e,r,n){let i={grant_type:e.grantType,resource:e.resource,audience:e.audience,scope:e.scope?.join(" "),requested_token_type:e.requestedTokenType,subject_token:e.subjectToken,subject_token_type:e.subjectTokenType,actor_token:e.actingParty?.actorToken,actor_token_type:e.actingParty?.actorTokenType,options:n&&JSON.stringify(n)},s={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:r,data:new URLSearchParams((0,FN.removeUndefinedValuesInObject)(i))};LN.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let c=await this.transporter.request(s),d=c.data;return d.res=c,d}catch(c){throw c instanceof jN.GaxiosError&&c.response?(0,EE.getErrorFromOAuthErrorResponse)(c.response.data,c):c}}};qu.StsCredentials=Bp});var Fn=k(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.BaseExternalAccountClient=ar.CLOUD_RESOURCE_MANAGER=ar.EXTERNAL_ACCOUNT_TYPE=ar.EXPIRATION_TIME_OFFSET=void 0;var BN=at(),qN=require("stream"),qp=Ht(),VN=Vu(),TE=vr(),HN=op(),GN="urn:ietf:params:oauth:grant-type:token-exchange",WN="urn:ietf:params:oauth:token-type:access_token",Vp="https://www.googleapis.com/auth/cloud-platform",ZN=3600;ar.EXPIRATION_TIME_OFFSET=300*1e3;ar.EXTERNAL_ACCOUNT_TYPE="external_account";ar.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var KN="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",JN="https://sts.{universeDomain}/v1/token",Hp=class t extends qp.AuthClient{static{o(this,"BaseExternalAccountClient")}scopes;projectNumber;audience;subjectTokenType;stsCredential;clientAuth;credentialSourceType;cachedAccessToken;serviceAccountImpersonationUrl;serviceAccountImpersonationLifetime;workforcePoolUserProject;configLifetimeRequested;tokenUrl;cloudResourceManagerURL;supplierContext;#e=null;constructor(e){super(e);let r=(0,TE.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==ar.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${ar.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let i=r.get("client_id"),s=r.get("client_secret");this.tokenUrl=r.get("token_url")??JN.replace("{universeDomain}",this.universeDomain);let c=r.get("subject_token_type"),d=r.get("workforce_pool_user_project"),l=r.get("service_account_impersonation_url"),p=r.get("service_account_impersonation"),f=(0,TE.originalOrCamelOptions)(p).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(r.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),i&&(this.clientAuth={confidentialClientType:"basic",clientId:i,clientSecret:s}),this.stsCredential=new VN.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[Vp],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=c,this.workforcePoolUserProject=d;let _=new RegExp(KN);if(this.workforcePoolUserProject&&!this.audience.match(_))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=l,this.serviceAccountImpersonationLifetime=f,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=ZN),this.projectNumber=this.getProjectNumber(this.audience),this.supplierContext={audience:this.audience,subjectTokenType:this.subjectTokenType,transporter:this.transporter}}getServiceAccountEmail(){if(this.serviceAccountImpersonationUrl){if(this.serviceAccountImpersonationUrl.length>256)throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);return/serviceAccounts\/(?<email>[^:]+):generateAccessToken$/.exec(this.serviceAccountImpersonationUrl)?.groups?.email||null}return null}setCredentials(e){super.setCredentials(e),this.cachedAccessToken=e}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async getProjectId(){let e=this.projectNumber||this.workforcePoolUserProject;if(this.projectId)return this.projectId;if(e){let r=await this.getRequestHeaders(),n={...t.RETRY_CONFIG,headers:r,url:`${this.cloudResourceManagerURL.toString()}${e}`};qp.AuthClient.setMethodName(n,"getProjectId");let i=await this.transporter.request(n);return this.projectId=i.data.projectId,this.projectId}return null}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=BN.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof qN.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),r={grantType:GN,audience:this.audience,requestedTokenType:WN,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[Vp]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,i=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),s=await this.stsCredential.exchangeToken(r,i,n);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(s.access_token):s.expires_in?this.cachedAccessToken={access_token:s.access_token,expiry_date:new Date().getTime()+s.expires_in*1e3,res:s.res}:this.cachedAccessToken={access_token:s.access_token,res:s.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}getProjectNumber(e){let r=e.match(/\/projects\/([^/]+)/);return r?r[1]:null}async getImpersonatedAccessToken(e){let r={...t.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"}};qp.AuthClient.setMethodName(r,"getImpersonatedAccessToken");let n=await this.transporter.request(r),i=n.data;return{access_token:i.accessToken,expiry_date:new Date(i.expireTime).getTime(),res:n}}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}getScopesArray(){return typeof this.scopes=="string"?[this.scopes]:this.scopes||[Vp]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${HN.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};ar.BaseExternalAccountClient=Hp});var xE=k(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.FileSubjectTokenSupplier=void 0;var Wp=require("util"),Zp=require("fs"),YN=(0,Wp.promisify)(Zp.readFile??(()=>{})),XN=(0,Wp.promisify)(Zp.realpath??(()=>{})),QN=(0,Wp.promisify)(Zp.lstat??(()=>{})),Gp=class{static{o(this,"FileSubjectTokenSupplier")}filePath;formatType;subjectTokenFieldName;constructor(e){this.filePath=e.filePath,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName}async getSubjectToken(){let e=this.filePath;try{if(e=await XN(e),!(await QN(e)).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let r,n=await YN(e,{encoding:"utf8"});if(this.formatType==="text"?r=n:this.formatType==="json"&&this.subjectTokenFieldName&&(r=JSON.parse(n)[this.subjectTokenFieldName]),!r)throw new Error("Unable to parse the subject_token from the credential_source file");return r}};Hu.FileSubjectTokenSupplier=Gp});var AE=k(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.UrlSubjectTokenSupplier=void 0;var ez=Ht(),Kp=class{static{o(this,"UrlSubjectTokenSupplier")}url;headers;formatType;subjectTokenFieldName;additionalGaxiosOptions;constructor(e){this.url=e.url,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName,this.headers=e.headers,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getSubjectToken(e){let r={...this.additionalGaxiosOptions,url:this.url,method:"GET",headers:this.headers};ez.AuthClient.setMethodName(r,"getSubjectToken");let n;if(this.formatType==="text"?n=(await e.transporter.request(r)).data:this.formatType==="json"&&this.subjectTokenFieldName&&(n=(await e.transporter.request(r)).data[this.subjectTokenFieldName]),!n)throw new Error("Unable to parse the subject_token from the credential_source URL");return n}};Gu.UrlSubjectTokenSupplier=Kp});var wE=k(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.CertificateSubjectTokenSupplier=Kt.InvalidConfigurationError=Kt.CertificateSourceUnavailableError=Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var Wu=vr(),Zu=require("fs"),Ku=require("crypto"),tz=require("https");Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Dr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};Kt.CertificateSourceUnavailableError=Dr;var sr=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};Kt.InvalidConfigurationError=sr;var Jp=class{static{o(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new sr("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new sr("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new sr("Cannot create mTLS Agent with missing certificate or key");return new tz.Agent({key:this.key,cert:this.cert})}async getSubjectToken(){this.certificateConfigPath=await this.#e();let{certPath:e,keyPath:r}=await this.#t();return{cert:this.cert,key:this.key}=await this.#r(e,r),await this.#n(this.cert)}async#e(){let e=this.certificateConfigPath;if(e){if(await(0,Wu.isValidFile)(e))return e;throw new Dr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,Wu.isValidFile)(r))return r;throw new Dr(`Path from environment variable "${Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,Wu.getWellKnownCertificateConfigFileLocation)();if(await(0,Wu.isValidFile)(n))return n;throw new Dr(`Could not find certificate configuration file. Searched override path, the "${Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await Zu.promises.readFile(e,"utf8")}catch{throw new Dr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),i=n?.cert_configs?.workload?.cert_path,s=n?.cert_configs?.workload?.key_path;if(!i||!s)throw new sr(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:i,keyPath:s}}catch(n){throw n instanceof sr?n:new sr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await Zu.promises.readFile(e),new Ku.X509Certificate(n)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Dr(`Failed to read certificate file at ${e}: ${c}`)}try{i=await Zu.promises.readFile(r),(0,Ku.createPrivateKey)(i)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Dr(`Failed to read private key file at ${r}: ${c}`)}return{cert:n,key:i}}async#n(e){let r=new Ku.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await Zu.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((l,p)=>{try{return new Ku.X509Certificate(l)}catch(f){let _=f instanceof Error?f.message:String(f);throw new sr(`Failed to parse certificate at index ${p} in trust chain file ${this.trustChainPath}: ${_}`)}}),c=s.findIndex(l=>r.raw.equals(l.raw)),d;if(c===-1)d=[r,...s];else if(c===0)d=s;else throw new sr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${c}).`);return JSON.stringify(d.map(l=>l.raw.toString("base64")))}catch(n){if(n instanceof sr)throw n;let i=n instanceof Error?n.message:String(n);throw new Dr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};Kt.CertificateSubjectTokenSupplier=Jp});var Qp=k(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.IdentityPoolClient=void 0;var rz=Fn(),Yp=vr(),nz=xE(),oz=AE(),IE=wE(),iz=Vu(),RE=at(),Xp=class t extends rz.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,Yp.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("subject_token_supplier");if(!n&&!i)throw new Error("A credential source or subject token supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or subject token supplier can be specified.");if(i)this.subjectTokenSupplier=i,this.credentialSourceType="programmatic";else{let s=(0,Yp.originalOrCamelOptions)(n),c=(0,Yp.originalOrCamelOptions)(s.get("format")),d=c.get("type")||"text",l=c.get("subject_token_field_name");if(d!=="json"&&d!=="text")throw new Error(`Invalid credential_source format "${d}"`);if(d==="json"&&!l)throw new Error("Missing subject_token_field_name for JSON credential_source format");let p=s.get("file"),f=s.get("url"),_=s.get("certificate"),h=s.get("headers");if(p&&f||f&&_||p&&_)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(p)this.credentialSourceType="file",this.subjectTokenSupplier=new nz.FileSubjectTokenSupplier({filePath:p,formatType:d,subjectTokenFieldName:l});else if(f)this.credentialSourceType="url",this.subjectTokenSupplier=new oz.UrlSubjectTokenSupplier({url:f,formatType:d,subjectTokenFieldName:l,headers:h,additionalGaxiosOptions:t.RETRY_CONFIG});else if(_){this.credentialSourceType="certificate";let g=new IE.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:_.use_default_certificate_config,certificateConfigLocation:_.certificate_config_location,trustChainPath:_.trust_chain_path});this.subjectTokenSupplier=g}else throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.')}}async retrieveSubjectToken(){let e=await this.subjectTokenSupplier.getSubjectToken(this.supplierContext);if(this.subjectTokenSupplier instanceof IE.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new iz.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new RE.Gaxios({agent:r})}),this.transporter=new RE.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};Ju.IdentityPoolClient=Xp});var tf=k(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.AwsRequestSigner=void 0;var Yu=at(),CE=ga(),OE="AWS4-HMAC-SHA256",az="aws4_request",ef=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,CE.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let r=typeof e.data=="object"?JSON.stringify(e.data):e.data,n=e.url,i=e.method||"GET",s=e.body||r,c=e.headers,d=await this.getCredentials(),l=new URL(n);if(typeof s!="string"&&s!==void 0)throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${s}`);let p=await uz({crypto:this.crypto,host:l.host,canonicalUri:l.pathname,canonicalQuerystring:l.search.slice(1),method:i,region:this.region,securityCredentials:d,requestPayload:s,additionalAmzHeaders:c}),f=Yu.Gaxios.mergeHeaders(p.amzDate?{"x-amz-date":p.amzDate}:{},{authorization:p.authorizationHeader,host:l.host},c||{});d.token&&Yu.Gaxios.mergeHeaders(f,{"x-amz-security-token":d.token});let _={url:n,method:i,headers:f};return s!==void 0&&(_.body=s),_}};Xu.AwsRequestSigner=ef;async function wa(t,e,r){return await t.signWithHmacSha256(e,r)}o(wa,"sign");async function sz(t,e,r,n,i){let s=await wa(t,`AWS4${e}`,r),c=await wa(t,s,n),d=await wa(t,c,i);return await wa(t,d,"aws4_request")}o(sz,"getSigningKey");async function uz(t){let e=Yu.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,s=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),c=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let d=Yu.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),l="",p=[...d.keys()].sort();p.forEach(N=>{l+=`${N}:${d.get(N)}
40
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,ba="secret must be a string or buffer",ii="key must be a string or a buffer",Bk="key must be a string, a buffer or an object",bp=typeof ir.createPublicKey=="function";bp&&(ii+=" or a KeyObject",ba+="or a KeyObject");function zS(t){if(!ai.isBuffer(t)&&typeof t!="string"&&(!bp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Pr(ii)}o(zS,"checkIsPublicKey");function DS(t){if(!ai.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Pr(Bk)}o(DS,"checkIsPrivateKey");function qk(t){if(!ai.isBuffer(t)){if(typeof t=="string")return t;if(!bp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Pr(ba)}}o(qk,"checkIsSecretKey");function Pp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Pp,"fromBase64");function US(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r<e;++r)t+="=";return t.replace(/\-/g,"+").replace(/_/g,"/")}o(US,"toBase64");function Pr(t){var e=[].slice.call(arguments,1),r=kS.format.bind(kS,t).apply(null,e);return new TypeError(r)}o(Pr,"typeError");function Vk(t){return ai.isBuffer(t)||typeof t=="string"}o(Vk,"bufferOrString");function Pa(t){return Vk(t)||(t=JSON.stringify(t)),t}o(Pa,"normalizeInput");function MS(t){return o(function(r,n){qk(n),r=Pa(r);var i=ir.createHmac("sha"+t,n),s=(i.update(r),i.digest("base64"));return Pp(s)},"sign")}o(MS,"createHmacSigner");var vp,Hk="timingSafeEqual"in ir?o(function(e,r){return e.byteLength!==r.byteLength?!1:ir.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return vp||(vp=$S()),vp(e,r)},"timingSafeEqual");function Gk(t){return o(function(r,n,i){var s=MS(t)(r,i);return Hk(ai.from(n),ai.from(s))},"verify")}o(Gk,"createHmacVerifier");function jS(t){return o(function(r,n){DS(n),r=Pa(r);var i=ir.createSign("RSA-SHA"+t),s=(i.update(r),i.sign(n,"base64"));return Pp(s)},"sign")}o(jS,"createKeySigner");function LS(t){return o(function(r,n,i){zS(i),r=Pa(r),n=US(n);var s=ir.createVerify("RSA-SHA"+t);return s.update(r),s.verify(i,n,"base64")},"verify")}o(LS,"createKeyVerifier");function Wk(t){return o(function(r,n){DS(n),r=Pa(r);var i=ir.createSign("RSA-SHA"+t),s=(i.update(r),i.sign({key:n,padding:ir.constants.RSA_PKCS1_PSS_PADDING,saltLength:ir.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Pp(s)},"sign")}o(Wk,"createPSSKeySigner");function Zk(t){return o(function(r,n,i){zS(i),r=Pa(r),n=US(n);var s=ir.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:i,padding:ir.constants.RSA_PKCS1_PSS_PADDING,saltLength:ir.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(Zk,"createPSSKeyVerifier");function Kk(t){var e=jS(t);return o(function(){var n=e.apply(null,arguments);return n=NS.derToJose(n,"ES"+t),n},"sign")}o(Kk,"createECDSASigner");function Jk(t){var e=LS(t);return o(function(n,i,s){i=NS.joseToDer(i,"ES"+t).toString("base64");var c=e(n,i,s);return c},"verify")}o(Jk,"createECDSAVerifer");function Yk(){return o(function(){return""},"sign")}o(Yk,"createNoneSigner");function Xk(){return o(function(e,r){return r===""},"verify")}o(Xk,"createNoneVerifier");FS.exports=o(function(e){var r={hs:MS,rs:jS,ps:Wk,es:Kk,none:Yk},n={hs:Gk,rs:LS,ps:Zk,es:Jk,none:Xk},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Pr(Fk,e);var s=(i[1]||i[3]).toLowerCase(),c=i[2];return{sign:r[s](c),verify:n[s](c)}},"jwa")});var Ep=k((bY,BS)=>{var Qk=require("buffer").Buffer;BS.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||Qk.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var ZS=k((SY,WS)=>{var eN=ri().Buffer,qS=yp(),tN=Sp(),rN=require("stream"),VS=Ep(),Tp=require("util");function HS(t,e){return eN.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(HS,"base64url");function nN(t,e,r){r=r||"utf8";var n=HS(VS(t),"binary"),i=HS(VS(e),r);return Tp.format("%s.%s",n,i)}o(nN,"jwsSecuredInput");function GS(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,s=tN(e.alg),c=nN(e,r,i),d=s.sign(c,n);return Tp.format("%s.%s",c,d)}o(GS,"jwsSign");function Du(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new qS(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new qS(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}o(Du,"SignStream");Tp.inherits(Du,rN);Du.prototype.sign=o(function(){try{var e=GS({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}},"sign");Du.sign=GS;WS.exports=Du});var oE=k((TY,nE)=>{var JS=ri().Buffer,KS=yp(),oN=Sp(),iN=require("stream"),YS=Ep(),aN=require("util"),sN=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function uN(t){return Object.prototype.toString.call(t)==="[object Object]"}o(uN,"isObject");function cN(t){if(uN(t))return t;try{return JSON.parse(t)}catch{return}}o(cN,"safeJsonParse");function XS(t){var e=t.split(".",1)[0];return cN(JS.from(e,"base64").toString("binary"))}o(XS,"headerFromJWS");function lN(t){return t.split(".",2).join(".")}o(lN,"securedInputFromJWS");function QS(t){return t.split(".")[2]}o(QS,"signatureFromJWS");function dN(t,e){e=e||"utf8";var r=t.split(".")[1];return JS.from(r,"base64").toString(e)}o(dN,"payloadFromJWS");function eE(t){return sN.test(t)&&!!XS(t)}o(eE,"isValidJws");function tE(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=YS(t);var i=QS(t),s=lN(t),c=oN(e);return c.verify(s,i,r)}o(tE,"jwsVerify");function rE(t,e){if(e=e||{},t=YS(t),!eE(t))return null;var r=XS(t);if(!r)return null;var n=dN(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:QS(t)}}o(rE,"jwsDecode");function si(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new KS(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new KS(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}o(si,"VerifyStream");aN.inherits(si,iN);si.prototype.verify=o(function(){try{var e=tE(this.signature.buffer,this.algorithm,this.key.buffer),r=rE(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"verify");si.decode=rE;si.isValid=eE;si.verify=tE;nE.exports=si});var xp=k(Ln=>{var iE=ZS(),Uu=oE(),pN=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Ln.ALGORITHMS=pN;Ln.sign=iE.sign;Ln.verify=Uu.verify;Ln.decode=Uu.decode;Ln.isValid=Uu.isValid;Ln.createSign=o(function(e){return new iE(e)},"createSign");Ln.createVerify=o(function(e){return new Uu(e)},"createVerify")});var bE=k(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.GoogleToken=void 0;var aE=Mu(require("fs")),fN=st(),mN=Mu(xp()),hN=Mu(require("path")),gN=require("util");function Mu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Mu=o(function(s,c){if(!c&&s&&s.__esModule)return s;var d,l,p={__proto__:null,default:s};if(s===null||un(s)!="object"&&typeof s!="function")return p;if(d=c?n:r){if(d.has(s))return d.get(s);d.set(s,p)}for(var f in s)f!=="default"&&{}.hasOwnProperty.call(s,f)&&((l=(d=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,f))&&(l.get||l.set)?d(p,f,l):p[f]=s[f]);return p},"_interopRequireWildcard"))(t,e)}o(Mu,"_interopRequireWildcard");function un(t){"@babel/helpers - typeof";return un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},un(t)}o(un,"_typeof");function yN(t,e){hE(t,e),e.add(t)}o(yN,"_classPrivateMethodInitSpec");function _N(t,e,r){hE(t,e),e.set(t,r)}o(_N,"_classPrivateFieldInitSpec");function hE(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(hE,"_checkPrivateRedeclaration");function sE(t,e,r){return t.set(Sr(t,e),r),r}o(sE,"_classPrivateFieldSet");function uE(t,e){return t.get(Sr(t,e))}o(uE,"_classPrivateFieldGet");function Sr(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}o(Sr,"_assertClassBrand");function cE(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_E(n.key),n)}}o(cE,"_defineProperties");function gE(t,e,r){return e&&cE(t.prototype,e),r&&cE(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(gE,"_createClass");function yE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(yE,"_classCallCheck");function vN(t,e,r){return e=xa(e),bN(t,Cp()?Reflect.construct(e,r||[],xa(t).constructor):e.apply(t,r))}o(vN,"_callSuper");function bN(t,e){if(e&&(un(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return PN(t)}o(bN,"_possibleConstructorReturn");function PN(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(PN,"_assertThisInitialized");function SN(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ta(t,e)}o(SN,"_inherits");function Ap(t){var e=typeof Map=="function"?new Map:void 0;return Ap=o(function(n){if(n===null||!TN(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return EN(n,arguments,xa(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ta(i,n)},"_wrapNativeSuper"),Ap(t)}o(Ap,"_wrapNativeSuper");function EN(t,e,r){if(Cp())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Ta(i,r.prototype),i}o(EN,"_construct");function Cp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Cp=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(Cp,"_isNativeReflectConstruct");function TN(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(TN,"_isNativeFunction");function Ta(t,e){return Ta=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ta(t,e)}o(Ta,"_setPrototypeOf");function xa(t){return xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xa(t)}o(xa,"_getPrototypeOf");function Gt(t,e,r){return(e=_E(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(Gt,"_defineProperty");function _E(t){var e=xN(t,"string");return un(e)=="symbol"?e:e+""}o(_E,"_toPropertyKey");function xN(t,e){if(un(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(un(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(xN,"_toPrimitive");function Zt(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(g,y,T,P){var x=y&&y.prototype instanceof d?y:d,N=Object.create(x.prototype);return Wt(N,"_invoke",(function(L,X,W){var G,Z,ee,Y=0,Se=W||[],te=!1,q={p:0,n:0,v:t,a:B,f:B.bind(t,4),d:o(function(K,re){return G=K,Z=0,ee=t,q.n=re,c},"d")};function B(J,K){for(Z=J,ee=K,e=0;!te&&Y&&!re&&e<Se.length;e++){var re,oe=Se[e],Ae=q.p,Oe=oe[2];J>3?(re=Oe===K)&&(ee=oe[(Z=oe[4])?5:(Z=3,3)],oe[4]=oe[5]=t):oe[0]<=Ae&&((re=J<2&&Ae<oe[1])?(Z=0,q.v=K,q.n=oe[1]):Ae<Oe&&(re=J<3||oe[0]>K||K>Oe)&&(oe[4]=J,oe[5]=K,q.n=Oe,Z=0))}if(re||J>1)return c;throw te=!0,K}return o(B,"d"),function(J,K,re){if(Y>1)throw TypeError("Generator is already running");for(te&&K===1&&B(K,re),Z=K,ee=re;(e=Z<2?t:ee)||!te;){G||(Z?Z<3?(Z>1&&(q.n=-1),B(Z,ee)):q.n=ee:q.v=ee);try{if(Y=2,G){if(Z||(J="next"),e=G[J]){if(!(e=e.call(G,ee)))throw TypeError("iterator result is not an object");if(!e.done)return e;ee=e.value,Z<2&&(Z=0)}else Z===1&&(e=G.return)&&e.call(G),Z<2&&(ee=TypeError("The iterator does not provide a '"+J+"' method"),Z=1);G=t}else if((e=(te=q.n<0)?ee:L.call(X,q))!==c)break}catch(oe){G=t,Z=1,ee=oe}finally{Y=1}}return{value:e,done:te}}})(g,T,P),!0),N}o(s,"i");var c={};function d(){}o(d,"Generator");function l(){}o(l,"GeneratorFunction");function p(){}o(p,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var f=[][n]?e(e([][n]())):(Wt(e={},n,function(){return this}),e),_=p.prototype=d.prototype=Object.create(f);function h(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,p):(g.__proto__=p,Wt(g,i,"GeneratorFunction")),g.prototype=Object.create(_),g}return o(h,"f"),l.prototype=p,Wt(_,"constructor",p),Wt(p,"constructor",l),l.displayName="GeneratorFunction",Wt(p,i,"GeneratorFunction"),Wt(_),Wt(_,i,"Generator"),Wt(_,n,function(){return this}),Wt(_,"toString",function(){return"[object Generator]"}),(Zt=o(function(){return{w:s,m:h}},"_regenerator"))()}o(Zt,"_regenerator");function Wt(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}Wt=o(function(c,d,l,p){if(d)i?i(c,d,{value:l,enumerable:!p,configurable:!p,writable:!p}):c[d]=l;else{var f=o(function(h,g){Wt(c,h,function(y){return this._invoke(h,g,y)})},"o");f("next",0),f("throw",1),f("return",2)}},"_regeneratorDefine"),Wt(t,e,r,n)}o(Wt,"_regeneratorDefine2");function lE(t,e,r,n,i,s,c){try{var d=t[s](c),l=d.value}catch(p){return void r(p)}d.done?e(l):Promise.resolve(l).then(n,i)}o(lE,"asyncGeneratorStep");function ui(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function c(l){lE(s,n,i,c,d,"next",l)}o(c,"_next");function d(l){lE(s,n,i,c,d,"throw",l)}o(d,"_throw"),c(void 0)})}}o(ui,"_asyncToGenerator");var dE=aE.readFile?(0,gN.promisify)(aE.readFile):ui(Zt().m(o(function t(){return Zt().w(function(e){for(;;)switch(e.n){case 0:throw new Ea("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),pE="https://oauth2.googleapis.com/token",AN="https://oauth2.googleapis.com/revoke?token=",Ea=(function(t){function e(r,n){var i;return yE(this,e),i=vN(this,e,[r]),Gt(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),SN(e,t),gE(e)})(Ap(Error)),Sa=new WeakMap,zr=new WeakSet,IY=ju.GoogleToken=(function(){function t(e){yE(this,t),yN(this,zr),Gt(this,"expiresAt",void 0),Gt(this,"key",void 0),Gt(this,"keyFile",void 0),Gt(this,"iss",void 0),Gt(this,"sub",void 0),Gt(this,"scope",void 0),Gt(this,"rawToken",void 0),Gt(this,"tokenExpires",void 0),Gt(this,"email",void 0),Gt(this,"additionalClaims",void 0),Gt(this,"eagerRefreshThresholdMillis",void 0),Gt(this,"transporter",{request:o(function(n){return(0,fN.request)(n)},"request")}),_N(this,Sa,void 0),Sr(zr,this,vE).call(this,e)}return o(t,"GoogleToken"),gE(t,[{key:"accessToken",get:o(function(){return this.rawToken?this.rawToken.access_token:void 0},"get")},{key:"idToken",get:o(function(){return this.rawToken?this.rawToken.id_token:void 0},"get")},{key:"tokenType",get:o(function(){return this.rawToken?this.rawToken.token_type:void 0},"get")},{key:"refreshToken",get:o(function(){return this.rawToken?this.rawToken.refresh_token:void 0},"get")},{key:"hasExpired",value:o(function(){var r=new Date().getTime();return this.rawToken&&this.expiresAt?r>=this.expiresAt:!0},"hasExpired")},{key:"isTokenExpiring",value:o(function(){var r,n=new Date().getTime(),i=(r=this.eagerRefreshThresholdMillis)!==null&&r!==void 0?r:0;return this.rawToken&&this.expiresAt?this.expiresAt<=n+i:!0},"isTokenExpiring")},{key:"getToken",value:o(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(un(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;Sr(zr,this,fE).call(this,n).then(function(s){return i(null,s)},r);return}return Sr(zr,this,fE).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=ui(Zt().m(o(function n(i){var s,c,d,l,p,f,_;return Zt().w(function(h){for(;;)switch(h.n){case 0:s=hN.extname(i),_=s,h.n=_===".json"?1:_===".der"||_===".crt"||_===".pem"?4:_===".p12"||_===".pfx"?6:7;break;case 1:return h.n=2,dE(i,"utf8");case 2:if(c=h.v,d=JSON.parse(c),l=d.private_key,p=d.client_email,!(!l||!p)){h.n=3;break}throw new Ea("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return h.a(2,{privateKey:l,clientEmail:p});case 4:return h.n=5,dE(i,"utf8");case 5:return f=h.v,h.a(2,{privateKey:f});case 6:throw new Ea("*.p12 certificates are not supported after v6.1.2. Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.","UNKNOWN_CERTIFICATE_TYPE");case 7:throw new Ea("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return h.a(2)}},n)},"_callee2")));function r(n){return e.apply(this,arguments)}return o(r,"getCredentials"),r})()},{key:"revokeToken",value:o(function(r){if(r){Sr(zr,this,mE).call(this).then(function(){return r()},r);return}return Sr(zr,this,mE).call(this)},"revokeToken")}])})();function fE(t){return wp.apply(this,arguments)}o(fE,"_getTokenAsync");function wp(){return wp=ui(Zt().m(o(function t(e){return Zt().w(function(r){for(;;)switch(r.n){case 0:if(!(uE(Sa,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,uE(Sa,this));case 1:return r.p=1,r.n=2,sE(Sa,this,Sr(zr,this,wN).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,sE(Sa,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),wp.apply(this,arguments)}o(wp,"_getTokenAsync2");function wN(t){return Ip.apply(this,arguments)}o(wN,"_getTokenAsyncInner");function Ip(){return Ip=ui(Zt().m(o(function t(e){var r;return Zt().w(function(n){for(;;)switch(n.n){case 0:if(!(this.isTokenExpiring()===!1&&e.forceRefresh===!1)){n.n=1;break}return n.a(2,Promise.resolve(this.rawToken));case 1:if(!(!this.key&&!this.keyFile)){n.n=2;break}throw new Error("No key or keyFile set.");case 2:if(!(!this.key&&this.keyFile)){n.n=4;break}return n.n=3,this.getCredentials(this.keyFile);case 3:r=n.v,this.key=r.privateKey,this.iss=r.clientEmail||this.iss,r.clientEmail||Sr(zr,this,IN).call(this);case 4:return n.a(2,Sr(zr,this,RN).call(this))}},t,this)},"_callee4"))),Ip.apply(this,arguments)}o(Ip,"_getTokenAsyncInner2");function IN(){if(!this.iss)throw new Ea("email is required.","MISSING_CREDENTIALS")}o(IN,"_ensureEmail");function mE(){return Rp.apply(this,arguments)}o(mE,"_revokeTokenAsync");function Rp(){return Rp=ui(Zt().m(o(function t(){var e;return Zt().w(function(r){for(;;)switch(r.n){case 0:if(this.accessToken){r.n=1;break}throw new Error("No token to revoke.");case 1:return e=AN+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Sr(zr,this,vE).call(this,{email:this.iss,sub:this.sub,key:this.key,keyFile:this.keyFile,scope:this.scope,additionalClaims:this.additionalClaims});case 3:return r.a(2)}},t,this)},"_callee5"))),Rp.apply(this,arguments)}o(Rp,"_revokeTokenAsync2");function vE(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.keyFile=t.keyFile,this.key=t.key,this.rawToken=void 0,this.iss=t.email||t.iss,this.sub=t.sub,this.additionalClaims=t.additionalClaims,un(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(vE,"_configure");function RN(){return Op.apply(this,arguments)}o(RN,"_requestToken");function Op(){return Op=ui(Zt().m(o(function t(){var e,r,n,i,s,c,d,l,p,f;return Zt().w(function(_){for(;;)switch(_.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:pE,exp:e+3600,iat:e,sub:this.sub},r),i=mN.sign({header:{alg:"RS256"},payload:n,secret:this.key}),_.p=1,_.n=2,this.transporter.request({method:"POST",url:pE,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=_.v,this.rawToken=s.data,this.expiresAt=s.data.expires_in===null||s.data.expires_in===void 0?void 0:(e+s.data.expires_in)*1e3,_.a(2,this.rawToken);case 3:throw _.p=3,f=_.v,this.rawToken=void 0,this.tokenExpires=void 0,l=f.response&&(c=f.response)!==null&&c!==void 0&&c.data?(d=f.response)===null||d===void 0?void 0:d.data:{},l.error&&(p=l.error_description?": ".concat(l.error_description):"",f.message="".concat(l.error).concat(p)),f;case 4:return _.a(2)}},t,this,[[1,3]])},"_callee6"))),Op.apply(this,arguments)}o(Op,"_requestToken2")});var kp=k(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.JWTAccess=void 0;var ON=xp(),CN=vr(),PE={alg:"RS256",typ:"JWT"},$p=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new CN.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,r,n,i){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=i??300*1e3}getCachedKey(e,r){let n=e;if(r&&Array.isArray(r)&&r.length?n=e?`${e}_${r.join("_")}`:`${r.join("_")}`:typeof r=="string"&&(n=e?`${e}_${r}`:r),!n)throw Error("Scopes or url must be provided");return n}getRequestHeaders(e,r,n){let i=this.getCachedKey(e,n),s=this.cache.get(i),c=Date.now();if(s&&s.expiration-c>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let d=Math.floor(Date.now()/1e3),l=t.getExpirationTime(d),p;if(Array.isArray(n)&&(n=n.join(" ")),n?p={iss:this.email,sub:this.email,scope:n,exp:l,iat:d}:p={iss:this.email,sub:this.email,aud:e,exp:l,iat:d},r){for(let y in p)if(r[y])throw new Error(`The '${y}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let f=this.keyId?{...PE,kid:this.keyId}:PE,_=Object.assign(p,r),h=ON.sign({header:f,payload:_,secret:this.key}),g=new Headers({authorization:`Bearer ${h}`});return this.cache.set(i,{expiration:l*1e3,headers:g}),g}static getExpirationTime(e){return e+3600}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{e||n(new Error("Must pass in a stream containing the service account auth settings."));let i="";e.setEncoding("utf8").on("data",s=>i+=s).on("error",n).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}};Lu.JWTAccess=$p});var zp=k(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.JWT=void 0;var SE=bE(),$N=kp(),kN=po(),Fu=Ht(),Np=class t extends kN.OAuth2Client{static{o(this,"JWT")}email;keyFile;key;keyId;defaultScopes;scopes;scope;subject;gtoken;additionalClaims;useJWTAccessWithScope;defaultServicePath;access;constructor(e={}){super(e),this.email=e.email,this.keyFile=e.keyFile,this.key=e.key,this.keyId=e.keyId,this.scopes=e.scopes,this.subject=e.subject,this.additionalClaims=e.additionalClaims,this.credentials={refresh_token:"jwt-placeholder",expiry_date:1}}createScoped(e){let r=new t(this);return r.scopes=e,r}async getRequestMetadataAsync(e){e=this.defaultServicePath?`https://${this.defaultServicePath}/`:e;let r=!this.hasUserScopes()&&e||this.useJWTAccessWithScope&&this.hasAnyScopes()||this.universeDomain!==Fu.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==Fu.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${Fu.DEFAULT_UNIVERSE}`);if(!this.apiKey&&r)if(this.additionalClaims&&this.additionalClaims.target_audience){let{tokens:n}=await this.refreshToken();return{headers:this.addSharedMetadataHeaders(new Headers({authorization:`Bearer ${n.id_token}`}))}}else{this.access||(this.access=new $N.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let n;this.hasUserScopes()?n=this.scopes:e||(n=this.defaultScopes);let i=this.useJWTAccessWithScope||this.universeDomain!==Fu.DEFAULT_UNIVERSE,s=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,i?n:void 0);return{headers:this.addSharedMetadataHeaders(s)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let r=new SE.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:{target_audience:e},transporter:this.transporter});if(await r.getToken({forceRefresh:!0}),!r.idToken)throw new Error("Unknown error: Failed to fetch ID token");return r.idToken}hasUserScopes(){return this.scopes?this.scopes.length>0:!1}hasAnyScopes(){return!!(this.scopes&&this.scopes.length>0||this.defaultScopes&&this.defaultScopes.length>0)}authorize(e){if(e)this.authorizeAsync().then(r=>e(null,r),e);else return this.authorizeAsync()}async authorizeAsync(){let e=await this.refreshToken();if(!e)throw new Error("No result returned");return this.credentials=e.tokens,this.credentials.refresh_token="jwt-placeholder",this.key=this.gtoken.key,this.email=this.gtoken.iss,e.tokens}async refreshTokenNoCache(){let e=this.createGToken(),n={access_token:(await e.getToken({forceRefresh:this.isTokenExpiring()})).access_token,token_type:"Bearer",expiry_date:e.expiresAt,id_token:e.idToken};return this.emit("tokens",n),{res:null,tokens:n}}createGToken(){return this.gtoken||(this.gtoken=new SE.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}fromAPIKey(e){if(typeof e!="string")throw new Error("Must provide an API Key string.");this.apiKey=e}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let r=await this.createGToken().getCredentials(this.keyFile);return{private_key:r.privateKey,client_email:r.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};Bu.JWT=Np});var Up=k(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.UserRefreshClient=ci.USER_REFRESH_ACCOUNT_TYPE=void 0;var NN=po(),zN=Ht();ci.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var Dp=class t extends NN.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,s){let c=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:s};super(c),this._refreshToken=c.refreshToken,this.credentials.refresh_token=c.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){let r={...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e})};return zN.AuthClient.setMethodName(r,"fetchIdToken"),(await this.transporter.request(r)).data.id_token}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the user refresh token");if(e.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!e.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!e.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!e.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=e.client_id,this._clientSecret=e.client_secret,this._refreshToken=e.refresh_token,this.credentials.refresh_token=e.refresh_token,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}async fromStreamAsync(e){return new Promise((r,n)=>{if(!e)return n(new Error("Must pass in a stream containing the user refresh token."));let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);return this.fromJSON(s),r()}catch(s){return n(s)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};ci.UserRefreshClient=Dp});var jp=k(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.Impersonated=li.IMPERSONATED_ACCOUNT_TYPE=void 0;var EE=po(),DN=st(),UN=vr();li.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var Mp=class t extends EE.OAuth2Client{static{o(this,"Impersonated")}sourceClient;targetPrincipal;targetScopes;delegates;lifetime;endpoint;constructor(e={}){if(super(e),this.credentials={expiry_date:1,refresh_token:"impersonated-placeholder"},this.sourceClient=e.sourceClient??new EE.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,UN.originalOrCamelOptions)(e).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=e.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(e){await this.sourceClient.getAccessToken();let r=`projects/-/serviceAccounts/${this.targetPrincipal}`,n=`${this.endpoint}/v1/${r}:signBlob`,i={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:i,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let e="projects/-/serviceAccounts/"+this.targetPrincipal,r=`${this.endpoint}/v1/${e}:generateAccessToken`,n={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},i=await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:n,method:"POST"}),s=i.data;return this.credentials.access_token=s.accessToken,this.credentials.expiry_date=Date.parse(s.expireTime),{tokens:this.credentials,res:i}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof DN.GaxiosError&&(r=e?.response?.data?.error?.status,n=e?.response?.data?.error?.message),r&&n?(e.message=`${r}: unable to impersonate: ${n}`,e):(e.message=`unable to impersonate: ${e}`,e)}}async fetchIdToken(e,r){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,i=`${this.endpoint}/v1/${n}:generateIdToken`,s={delegates:this.delegates,audience:e,includeEmail:r?.includeEmail??!0,useEmailAzp:r?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:i,data:s,method:"POST"})).data.token}};li.Impersonated=Mp});var Fp=k(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.OAuthClientAuthHandler=void 0;Aa.getErrorFromOAuthErrorResponse=LN;var di=st(),MN=ga(),jN=["PUT","POST","PATCH"],Lp=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,MN.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new di.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new di.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=di.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=di.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=di.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${i}`);di.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!jN.includes(r))throw new Error(`${r} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let i=new Headers(e.headers).get("content-type");if(i?.startsWith("application/x-www-form-urlencoded")||e.data instanceof URLSearchParams){let s=new URLSearchParams(e.data??"");s.append("client_id",this.#t.clientId),s.append("client_secret",this.#t.clientSecret||""),e.data=s}else if(i?.startsWith("application/json"))e.data=e.data||{},Object.assign(e.data,{client_id:this.#t.clientId,client_secret:this.#t.clientSecret||""});else throw new Error(`${i} content-types are not supported with ${this.#t.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};Aa.OAuthClientAuthHandler=Lp;function LN(t,e){let r=t.error,n=t.error_description,i=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof i<"u"&&(s+=` - ${i}`);let c=new Error(s);if(e){let d=Object.keys(e);e.stack&&d.push("stack"),d.forEach(l=>{l!=="message"&&Object.defineProperty(c,l,{value:e[l],writable:!1,enumerable:!0})})}return c}o(LN,"getErrorFromOAuthErrorResponse")});var Vu=k(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.StsCredentials=void 0;var FN=st(),BN=Ht(),TE=Fp(),qN=vr(),Bp=class t extends TE.OAuthClientAuthHandler{static{o(this,"StsCredentials")}#e;constructor(e={tokenExchangeEndpoint:""},r){(typeof e!="object"||e instanceof URL)&&(e={tokenExchangeEndpoint:e,clientAuthentication:r}),super(e),this.#e=e.tokenExchangeEndpoint}async exchangeToken(e,r,n){let i={grant_type:e.grantType,resource:e.resource,audience:e.audience,scope:e.scope?.join(" "),requested_token_type:e.requestedTokenType,subject_token:e.subjectToken,subject_token_type:e.subjectTokenType,actor_token:e.actingParty?.actorToken,actor_token_type:e.actingParty?.actorTokenType,options:n&&JSON.stringify(n)},s={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:r,data:new URLSearchParams((0,qN.removeUndefinedValuesInObject)(i))};BN.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let c=await this.transporter.request(s),d=c.data;return d.res=c,d}catch(c){throw c instanceof FN.GaxiosError&&c.response?(0,TE.getErrorFromOAuthErrorResponse)(c.response.data,c):c}}};qu.StsCredentials=Bp});var Fn=k(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.BaseExternalAccountClient=ar.CLOUD_RESOURCE_MANAGER=ar.EXTERNAL_ACCOUNT_TYPE=ar.EXPIRATION_TIME_OFFSET=void 0;var VN=st(),HN=require("stream"),qp=Ht(),GN=Vu(),xE=vr(),WN=op(),ZN="urn:ietf:params:oauth:grant-type:token-exchange",KN="urn:ietf:params:oauth:token-type:access_token",Vp="https://www.googleapis.com/auth/cloud-platform",JN=3600;ar.EXPIRATION_TIME_OFFSET=300*1e3;ar.EXTERNAL_ACCOUNT_TYPE="external_account";ar.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var YN="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",XN="https://sts.{universeDomain}/v1/token",Hp=class t extends qp.AuthClient{static{o(this,"BaseExternalAccountClient")}scopes;projectNumber;audience;subjectTokenType;stsCredential;clientAuth;credentialSourceType;cachedAccessToken;serviceAccountImpersonationUrl;serviceAccountImpersonationLifetime;workforcePoolUserProject;configLifetimeRequested;tokenUrl;cloudResourceManagerURL;supplierContext;#e=null;constructor(e){super(e);let r=(0,xE.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==ar.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${ar.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let i=r.get("client_id"),s=r.get("client_secret");this.tokenUrl=r.get("token_url")??XN.replace("{universeDomain}",this.universeDomain);let c=r.get("subject_token_type"),d=r.get("workforce_pool_user_project"),l=r.get("service_account_impersonation_url"),p=r.get("service_account_impersonation"),f=(0,xE.originalOrCamelOptions)(p).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(r.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),i&&(this.clientAuth={confidentialClientType:"basic",clientId:i,clientSecret:s}),this.stsCredential=new GN.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[Vp],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=c,this.workforcePoolUserProject=d;let _=new RegExp(YN);if(this.workforcePoolUserProject&&!this.audience.match(_))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=l,this.serviceAccountImpersonationLifetime=f,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=JN),this.projectNumber=this.getProjectNumber(this.audience),this.supplierContext={audience:this.audience,subjectTokenType:this.subjectTokenType,transporter:this.transporter}}getServiceAccountEmail(){if(this.serviceAccountImpersonationUrl){if(this.serviceAccountImpersonationUrl.length>256)throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);return/serviceAccounts\/(?<email>[^:]+):generateAccessToken$/.exec(this.serviceAccountImpersonationUrl)?.groups?.email||null}return null}setCredentials(e){super.setCredentials(e),this.cachedAccessToken=e}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async getProjectId(){let e=this.projectNumber||this.workforcePoolUserProject;if(this.projectId)return this.projectId;if(e){let r=await this.getRequestHeaders(),n={...t.RETRY_CONFIG,headers:r,url:`${this.cloudResourceManagerURL.toString()}${e}`};qp.AuthClient.setMethodName(n,"getProjectId");let i=await this.transporter.request(n);return this.projectId=i.data.projectId,this.projectId}return null}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=VN.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof HN.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),r={grantType:ZN,audience:this.audience,requestedTokenType:KN,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[Vp]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,i=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),s=await this.stsCredential.exchangeToken(r,i,n);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(s.access_token):s.expires_in?this.cachedAccessToken={access_token:s.access_token,expiry_date:new Date().getTime()+s.expires_in*1e3,res:s.res}:this.cachedAccessToken={access_token:s.access_token,res:s.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}getProjectNumber(e){let r=e.match(/\/projects\/([^/]+)/);return r?r[1]:null}async getImpersonatedAccessToken(e){let r={...t.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"}};qp.AuthClient.setMethodName(r,"getImpersonatedAccessToken");let n=await this.transporter.request(r),i=n.data;return{access_token:i.accessToken,expiry_date:new Date(i.expireTime).getTime(),res:n}}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}getScopesArray(){return typeof this.scopes=="string"?[this.scopes]:this.scopes||[Vp]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${WN.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};ar.BaseExternalAccountClient=Hp});var AE=k(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.FileSubjectTokenSupplier=void 0;var Wp=require("util"),Zp=require("fs"),QN=(0,Wp.promisify)(Zp.readFile??(()=>{})),ez=(0,Wp.promisify)(Zp.realpath??(()=>{})),tz=(0,Wp.promisify)(Zp.lstat??(()=>{})),Gp=class{static{o(this,"FileSubjectTokenSupplier")}filePath;formatType;subjectTokenFieldName;constructor(e){this.filePath=e.filePath,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName}async getSubjectToken(){let e=this.filePath;try{if(e=await ez(e),!(await tz(e)).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let r,n=await QN(e,{encoding:"utf8"});if(this.formatType==="text"?r=n:this.formatType==="json"&&this.subjectTokenFieldName&&(r=JSON.parse(n)[this.subjectTokenFieldName]),!r)throw new Error("Unable to parse the subject_token from the credential_source file");return r}};Hu.FileSubjectTokenSupplier=Gp});var wE=k(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.UrlSubjectTokenSupplier=void 0;var rz=Ht(),Kp=class{static{o(this,"UrlSubjectTokenSupplier")}url;headers;formatType;subjectTokenFieldName;additionalGaxiosOptions;constructor(e){this.url=e.url,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName,this.headers=e.headers,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getSubjectToken(e){let r={...this.additionalGaxiosOptions,url:this.url,method:"GET",headers:this.headers};rz.AuthClient.setMethodName(r,"getSubjectToken");let n;if(this.formatType==="text"?n=(await e.transporter.request(r)).data:this.formatType==="json"&&this.subjectTokenFieldName&&(n=(await e.transporter.request(r)).data[this.subjectTokenFieldName]),!n)throw new Error("Unable to parse the subject_token from the credential_source URL");return n}};Gu.UrlSubjectTokenSupplier=Kp});var IE=k(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.CertificateSubjectTokenSupplier=Kt.InvalidConfigurationError=Kt.CertificateSourceUnavailableError=Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var Wu=vr(),Zu=require("fs"),Ku=require("crypto"),nz=require("https");Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Dr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};Kt.CertificateSourceUnavailableError=Dr;var sr=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};Kt.InvalidConfigurationError=sr;var Jp=class{static{o(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new sr("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new sr("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new sr("Cannot create mTLS Agent with missing certificate or key");return new nz.Agent({key:this.key,cert:this.cert})}async getSubjectToken(){this.certificateConfigPath=await this.#e();let{certPath:e,keyPath:r}=await this.#t();return{cert:this.cert,key:this.key}=await this.#r(e,r),await this.#n(this.cert)}async#e(){let e=this.certificateConfigPath;if(e){if(await(0,Wu.isValidFile)(e))return e;throw new Dr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,Wu.isValidFile)(r))return r;throw new Dr(`Path from environment variable "${Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,Wu.getWellKnownCertificateConfigFileLocation)();if(await(0,Wu.isValidFile)(n))return n;throw new Dr(`Could not find certificate configuration file. Searched override path, the "${Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await Zu.promises.readFile(e,"utf8")}catch{throw new Dr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),i=n?.cert_configs?.workload?.cert_path,s=n?.cert_configs?.workload?.key_path;if(!i||!s)throw new sr(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:i,keyPath:s}}catch(n){throw n instanceof sr?n:new sr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await Zu.promises.readFile(e),new Ku.X509Certificate(n)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Dr(`Failed to read certificate file at ${e}: ${c}`)}try{i=await Zu.promises.readFile(r),(0,Ku.createPrivateKey)(i)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Dr(`Failed to read private key file at ${r}: ${c}`)}return{cert:n,key:i}}async#n(e){let r=new Ku.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await Zu.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((l,p)=>{try{return new Ku.X509Certificate(l)}catch(f){let _=f instanceof Error?f.message:String(f);throw new sr(`Failed to parse certificate at index ${p} in trust chain file ${this.trustChainPath}: ${_}`)}}),c=s.findIndex(l=>r.raw.equals(l.raw)),d;if(c===-1)d=[r,...s];else if(c===0)d=s;else throw new sr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${c}).`);return JSON.stringify(d.map(l=>l.raw.toString("base64")))}catch(n){if(n instanceof sr)throw n;let i=n instanceof Error?n.message:String(n);throw new Dr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};Kt.CertificateSubjectTokenSupplier=Jp});var Qp=k(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.IdentityPoolClient=void 0;var oz=Fn(),Yp=vr(),iz=AE(),az=wE(),RE=IE(),sz=Vu(),OE=st(),Xp=class t extends oz.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,Yp.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("subject_token_supplier");if(!n&&!i)throw new Error("A credential source or subject token supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or subject token supplier can be specified.");if(i)this.subjectTokenSupplier=i,this.credentialSourceType="programmatic";else{let s=(0,Yp.originalOrCamelOptions)(n),c=(0,Yp.originalOrCamelOptions)(s.get("format")),d=c.get("type")||"text",l=c.get("subject_token_field_name");if(d!=="json"&&d!=="text")throw new Error(`Invalid credential_source format "${d}"`);if(d==="json"&&!l)throw new Error("Missing subject_token_field_name for JSON credential_source format");let p=s.get("file"),f=s.get("url"),_=s.get("certificate"),h=s.get("headers");if(p&&f||f&&_||p&&_)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(p)this.credentialSourceType="file",this.subjectTokenSupplier=new iz.FileSubjectTokenSupplier({filePath:p,formatType:d,subjectTokenFieldName:l});else if(f)this.credentialSourceType="url",this.subjectTokenSupplier=new az.UrlSubjectTokenSupplier({url:f,formatType:d,subjectTokenFieldName:l,headers:h,additionalGaxiosOptions:t.RETRY_CONFIG});else if(_){this.credentialSourceType="certificate";let g=new RE.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:_.use_default_certificate_config,certificateConfigLocation:_.certificate_config_location,trustChainPath:_.trust_chain_path});this.subjectTokenSupplier=g}else throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.')}}async retrieveSubjectToken(){let e=await this.subjectTokenSupplier.getSubjectToken(this.supplierContext);if(this.subjectTokenSupplier instanceof RE.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new sz.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new OE.Gaxios({agent:r})}),this.transporter=new OE.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};Ju.IdentityPoolClient=Xp});var tf=k(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.AwsRequestSigner=void 0;var Yu=st(),$E=ga(),CE="AWS4-HMAC-SHA256",uz="aws4_request",ef=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,$E.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let r=typeof e.data=="object"?JSON.stringify(e.data):e.data,n=e.url,i=e.method||"GET",s=e.body||r,c=e.headers,d=await this.getCredentials(),l=new URL(n);if(typeof s!="string"&&s!==void 0)throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${s}`);let p=await lz({crypto:this.crypto,host:l.host,canonicalUri:l.pathname,canonicalQuerystring:l.search.slice(1),method:i,region:this.region,securityCredentials:d,requestPayload:s,additionalAmzHeaders:c}),f=Yu.Gaxios.mergeHeaders(p.amzDate?{"x-amz-date":p.amzDate}:{},{authorization:p.authorizationHeader,host:l.host},c||{});d.token&&Yu.Gaxios.mergeHeaders(f,{"x-amz-security-token":d.token});let _={url:n,method:i,headers:f};return s!==void 0&&(_.body=s),_}};Xu.AwsRequestSigner=ef;async function wa(t,e,r){return await t.signWithHmacSha256(e,r)}o(wa,"sign");async function cz(t,e,r,n,i){let s=await wa(t,`AWS4${e}`,r),c=await wa(t,s,n),d=await wa(t,c,i);return await wa(t,d,"aws4_request")}o(cz,"getSigningKey");async function lz(t){let e=Yu.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,s=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),c=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let d=Yu.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),l="",p=[...d.keys()].sort();p.forEach(N=>{l+=`${N}:${d.get(N)}
41
41
  `});let f=p.join(";"),_=await t.crypto.sha256DigestHex(r),h=`${t.method.toUpperCase()}
42
42
  ${t.canonicalUri}
43
43
  ${t.canonicalQuerystring}
44
44
  ${l}
45
45
  ${f}
46
- ${_}`,g=`${c}/${t.region}/${n}/${az}`,y=`${OE}
46
+ ${_}`,g=`${c}/${t.region}/${n}/${uz}`,y=`${CE}
47
47
  ${s}
48
48
  ${g}
49
- `+await t.crypto.sha256DigestHex(h),T=await sz(t.crypto,t.securityCredentials.secretAccessKey,c,t.region,n),P=await wa(t.crypto,T,y),x=`${OE} Credential=${t.securityCredentials.accessKeyId}/${g}, SignedHeaders=${f}, Signature=${(0,CE.fromArrayBufferToHex)(P)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:x,canonicalQuerystring:t.canonicalQuerystring}}o(uz,"generateAuthenticationHeaderMap")});var $E=k(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.DefaultAwsSecurityCredentialsSupplier=void 0;var Qu=Ht(),rf=class{static{o(this,"DefaultAwsSecurityCredentialsSupplier")}regionUrl;securityCredentialsUrl;imdsV2SessionTokenUrl;additionalGaxiosOptions;constructor(e){this.regionUrl=e.regionUrl,this.securityCredentialsUrl=e.securityCredentialsUrl,this.imdsV2SessionTokenUrl=e.imdsV2SessionTokenUrl,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getAwsRegion(e){if(this.#n)return this.#n;let r=new Headers;if(!this.#n&&this.imdsV2SessionTokenUrl&&r.set("x-aws-ec2-metadata-token",await this.#e(e.transporter)),!this.regionUrl)throw new RangeError('Unable to determine AWS region due to missing "options.credential_source.region_url"');let n={...this.additionalGaxiosOptions,url:this.regionUrl,method:"GET",headers:r};Qu.AuthClient.setMethodName(n,"getAwsRegion");let i=await e.transporter.request(n);return i.data.substr(0,i.data.length-1)}async getAwsSecurityCredentials(e){if(this.#o)return this.#o;let r=new Headers;this.imdsV2SessionTokenUrl&&r.set("x-aws-ec2-metadata-token",await this.#e(e.transporter));let n=await this.#t(r,e.transporter),i=await this.#r(n,r,e.transporter);return{accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,token:i.Token}}async#e(e){let r={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return Qu.AuthClient.setMethodName(r,"#getImdsV2SessionToken"),(await e.request(r)).data}async#t(e,r){if(!this.securityCredentialsUrl)throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"');let n={...this.additionalGaxiosOptions,url:this.securityCredentialsUrl,method:"GET",headers:e};return Qu.AuthClient.setMethodName(n,"#getAwsRoleName"),(await r.request(n)).data}async#r(e,r,n){let i={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,headers:r};return Qu.AuthClient.setMethodName(i,"#retrieveAwsSecurityCredentials"),(await n.request(i)).data}get#n(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null}get#o(){return process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY?{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,token:process.env.AWS_SESSION_TOKEN}:null}};ec.DefaultAwsSecurityCredentialsSupplier=rf});var of=k(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.AwsClient=void 0;var cz=tf(),lz=Fn(),dz=$E(),kE=vr(),pz=at(),nf=class t extends lz.BaseExternalAccountClient{static{o(this,"AwsClient")}environmentId;awsSecurityCredentialsSupplier;regionalCredVerificationUrl;awsRequestSigner;region;static#e="https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15";static AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";static AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254";constructor(e){super(e);let r=(0,kE.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("aws_security_credentials_supplier");if(!n&&!i)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(i)this.awsSecurityCredentialsSupplier=i,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let s=(0,kE.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let c=s.get("region_url"),d=s.get("url"),l=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new dz.DefaultAwsSecurityCredentialsSupplier({regionUrl:c,securityCredentialsUrl:d,imdsV2SessionTokenUrl:l}),this.regionalCredVerificationUrl=s.get("regional_cred_verification_url"),this.credentialSourceType="aws",this.validateEnvironmentId()}this.awsRequestSigner=null,this.region=""}validateEnvironmentId(){let e=this.environmentId?.match(/^(aws)(\d+)$/);if(!e||!this.regionalCredVerificationUrl)throw new Error('No valid AWS "credential_source" provided');if(parseInt(e[2],10)!==1)throw new Error(`aws version "${e[2]}" is not supported in the current build.`)}async retrieveSubjectToken(){this.awsRequestSigner||(this.region=await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext),this.awsRequestSigner=new cz.AwsRequestSigner(async()=>this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext),this.region));let e=await this.awsRequestSigner.getRequestOptions({...t.RETRY_CONFIG,url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"}),r=[];return pz.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((i,s)=>r.push({key:s,value:i})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};tc.AwsClient=nf});var lf=k(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.InvalidSubjectTokenError=ct.InvalidMessageFieldError=ct.InvalidCodeFieldError=ct.InvalidTokenTypeFieldError=ct.InvalidExpirationTimeFieldError=ct.InvalidSuccessFieldError=ct.InvalidVersionFieldError=ct.ExecutableResponseError=ct.ExecutableResponse=void 0;var rc="urn:ietf:params:oauth:token-type:saml2",af="urn:ietf:params:oauth:token-type:id_token",sf="urn:ietf:params:oauth:token-type:jwt",uf=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new nc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new oc("Executable response must contain a 'success' field.");if(this.version=e.version,this.success=e.success,this.success){if(this.expirationTime=e.expiration_time,this.tokenType=e.token_type,this.tokenType!==rc&&this.tokenType!==af&&this.tokenType!==sf)throw new ic(`Executable response must contain a 'token_type' field when successful and it must be one of ${af}, ${sf}, or ${rc}.`);if(this.tokenType===rc){if(!e.saml_response)throw new Ia(`Executable response must contain a 'saml_response' field when token_type=${rc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new Ia(`Executable response must contain a 'id_token' field when token_type=${af} or ${sf}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new ac("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new sc("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=e.code,this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};ct.ExecutableResponse=uf;var Ur=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};ct.ExecutableResponseError=Ur;var nc=class extends Ur{static{o(this,"InvalidVersionFieldError")}};ct.InvalidVersionFieldError=nc;var oc=class extends Ur{static{o(this,"InvalidSuccessFieldError")}};ct.InvalidSuccessFieldError=oc;var cf=class extends Ur{static{o(this,"InvalidExpirationTimeFieldError")}};ct.InvalidExpirationTimeFieldError=cf;var ic=class extends Ur{static{o(this,"InvalidTokenTypeFieldError")}};ct.InvalidTokenTypeFieldError=ic;var ac=class extends Ur{static{o(this,"InvalidCodeFieldError")}};ct.InvalidCodeFieldError=ac;var sc=class extends Ur{static{o(this,"InvalidMessageFieldError")}};ct.InvalidMessageFieldError=sc;var Ia=class extends Ur{static{o(this,"InvalidSubjectTokenError")}};ct.InvalidSubjectTokenError=Ia});var ff=k(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.PluggableAuthHandler=pi.ExecutableError=void 0;var fo=lf(),fz=require("child_process"),df=require("fs"),uc=class extends Error{static{o(this,"ExecutableError")}code;constructor(e,r){super(`The executable failed with exit code: ${r} and error message: ${e}.`),this.code=r,Object.setPrototypeOf(this,new.target.prototype)}};pi.ExecutableError=uc;var pf=class t{static{o(this,"PluggableAuthHandler")}commandComponents;timeoutMillis;outputFile;constructor(e){if(!e.command)throw new Error("No command provided.");if(this.commandComponents=t.parseCommand(e.command),this.timeoutMillis=e.timeoutMillis,!this.timeoutMillis)throw new Error("No timeoutMillis provided.");this.outputFile=e.outputFile}retrieveResponseFromExecutable(e){return new Promise((r,n)=>{let i=fz.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";i.stdout.on("data",d=>{s+=d}),i.stderr.on("data",d=>{s+=d});let c=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",d=>{if(clearTimeout(c),d===0)try{let l=JSON.parse(s),p=new fo.ExecutableResponse(l);return r(p)}catch(l){return l instanceof fo.ExecutableResponseError?n(l):n(new fo.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new uc(s,d.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await df.promises.realpath(this.outputFile)}catch{return}if(!(await df.promises.lstat(e)).isFile())return;let r=await df.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new fo.ExecutableResponse(n).isValid()?new fo.ExecutableResponse(n):void 0}catch(n){throw n instanceof fo.ExecutableResponseError?n:new fo.ExecutableResponseError(`The output file contained an invalid response: ${r}`)}}static parseCommand(e){let r=e.match(/(?:[^\s"]+|"[^"]*")+/g);if(!r)throw new Error(`Provided command: "${e}" could not be parsed.`);for(let n=0;n<r.length;n++)r[n][0]==='"'&&r[n].slice(-1)==='"'&&(r[n]=r[n].slice(1,-1));return r}};pi.PluggableAuthHandler=pf});var hf=k(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.PluggableAuthClient=fi.ExecutableError=void 0;var mz=Fn(),hz=lf(),NE=ff(),gz=ff();Object.defineProperty(fi,"ExecutableError",{enumerable:!0,get:o(function(){return gz.ExecutableError},"get")});var yz=30*1e3,zE=5*1e3,DE=120*1e3,_z="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",UE=1,mf=class extends mz.BaseExternalAccountClient{static{o(this,"PluggableAuthClient")}command;timeoutMillis;outputFile;handler;constructor(e){if(super(e),!e.credential_source.executable)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(this.command=e.credential_source.executable.command,!this.command)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(e.credential_source.executable.timeout_millis===void 0)this.timeoutMillis=yz;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<zE||this.timeoutMillis>DE)throw new Error(`Timeout must be between ${zE} and ${DE} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new NE.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[_z]!=="1")throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.");let e;if(this.outputFile&&(e=await this.handler.retrieveCachedResponse()),!e){let r=new Map;r.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience),r.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType),r.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0"),this.outputFile&&r.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile);let n=this.getServiceAccountEmail();n&&r.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",n),e=await this.handler.retrieveResponseFromExecutable(r)}if(e.version>UE)throw new Error(`Version of executable is not currently supported, maximum supported version is ${UE}.`);if(!e.success)throw new NE.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new hz.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.");if(e.isExpired())throw new Error("Executable response is expired.");return e.subjectToken}};fi.PluggableAuthClient=mf});var yf=k(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.ExternalAccountClient=void 0;var vz=Fn(),bz=Qp(),Pz=of(),Sz=hf(),gf=class{static{o(this,"ExternalAccountClient")}constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(e){return e&&e.type===vz.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new Pz.AwsClient(e):e.credential_source?.executable?new Sz.PluggableAuthClient(e):new bz.IdentityPoolClient(e):null}};cc.ExternalAccountClient=gf});var bf=k(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.ExternalAccountAuthorizedUserClient=mi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var jE=Ht(),ME=Fp(),LE=at(),Ez=require("stream"),Tz=Fn();mi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var xz="https://sts.{universeDomain}/v1/oauthtoken",_f=class t extends ME.OAuthClientAuthHandler{static{o(this,"ExternalAccountAuthorizedUserHandler")}#e;constructor(e){super(e),this.#e=e.tokenRefreshEndpoint}async refreshToken(e,r){let n={...t.RETRY_CONFIG,url:this.#e,method:"POST",headers:r,data:new URLSearchParams({grant_type:"refresh_token",refresh_token:e})};jE.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let i=await this.transporter.request(n),s=i.data;return s.res=i,s}catch(i){throw i instanceof LE.GaxiosError&&i.response?(0,ME.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},vf=class extends jE.AuthClient{static{o(this,"ExternalAccountAuthorizedUserClient")}cachedAccessToken;externalAccountAuthorizedUserHandler;refreshToken;constructor(e){super(e),e.universe_domain&&(this.universeDomain=e.universe_domain),this.refreshToken=e.refresh_token;let r={confidentialClientType:"basic",clientId:e.client_id,clientSecret:e.client_secret};this.externalAccountAuthorizedUserHandler=new _f({tokenRefreshEndpoint:e.token_url??xz.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=Tz.EXPIRATION_TIME_OFFSET:this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis,this.forceRefreshOnFailure=!!e?.forceRefreshOnFailure}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=LE.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof Ez.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};mi.ExternalAccountAuthorizedUserClient=vf});var VE=k(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.GoogleAuth=Er.GoogleAuthExceptionMessages=void 0;var Az=require("child_process"),Ra=require("fs"),wz=at(),Oa=ha(),Iz=require("os"),Pf=require("path"),Rz=ga(),Oz=fp(),Cz=hp(),$z=gp(),hi=zp(),FE=Up(),gi=jp(),kz=yf(),Ca=Fn(),Sf=Ht(),BE=bf(),qE=vr();Er.GoogleAuthExceptionMessages={API_KEY_WITH_CREDENTIALS:"API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.",NO_PROJECT_ID_FOUND:`Unable to detect a Project Id in the current environment.
49
+ `+await t.crypto.sha256DigestHex(h),T=await cz(t.crypto,t.securityCredentials.secretAccessKey,c,t.region,n),P=await wa(t.crypto,T,y),x=`${CE} Credential=${t.securityCredentials.accessKeyId}/${g}, SignedHeaders=${f}, Signature=${(0,$E.fromArrayBufferToHex)(P)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:x,canonicalQuerystring:t.canonicalQuerystring}}o(lz,"generateAuthenticationHeaderMap")});var kE=k(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.DefaultAwsSecurityCredentialsSupplier=void 0;var Qu=Ht(),rf=class{static{o(this,"DefaultAwsSecurityCredentialsSupplier")}regionUrl;securityCredentialsUrl;imdsV2SessionTokenUrl;additionalGaxiosOptions;constructor(e){this.regionUrl=e.regionUrl,this.securityCredentialsUrl=e.securityCredentialsUrl,this.imdsV2SessionTokenUrl=e.imdsV2SessionTokenUrl,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getAwsRegion(e){if(this.#n)return this.#n;let r=new Headers;if(!this.#n&&this.imdsV2SessionTokenUrl&&r.set("x-aws-ec2-metadata-token",await this.#e(e.transporter)),!this.regionUrl)throw new RangeError('Unable to determine AWS region due to missing "options.credential_source.region_url"');let n={...this.additionalGaxiosOptions,url:this.regionUrl,method:"GET",headers:r};Qu.AuthClient.setMethodName(n,"getAwsRegion");let i=await e.transporter.request(n);return i.data.substr(0,i.data.length-1)}async getAwsSecurityCredentials(e){if(this.#o)return this.#o;let r=new Headers;this.imdsV2SessionTokenUrl&&r.set("x-aws-ec2-metadata-token",await this.#e(e.transporter));let n=await this.#t(r,e.transporter),i=await this.#r(n,r,e.transporter);return{accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,token:i.Token}}async#e(e){let r={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return Qu.AuthClient.setMethodName(r,"#getImdsV2SessionToken"),(await e.request(r)).data}async#t(e,r){if(!this.securityCredentialsUrl)throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"');let n={...this.additionalGaxiosOptions,url:this.securityCredentialsUrl,method:"GET",headers:e};return Qu.AuthClient.setMethodName(n,"#getAwsRoleName"),(await r.request(n)).data}async#r(e,r,n){let i={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,headers:r};return Qu.AuthClient.setMethodName(i,"#retrieveAwsSecurityCredentials"),(await n.request(i)).data}get#n(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null}get#o(){return process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY?{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,token:process.env.AWS_SESSION_TOKEN}:null}};ec.DefaultAwsSecurityCredentialsSupplier=rf});var of=k(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.AwsClient=void 0;var dz=tf(),pz=Fn(),fz=kE(),NE=vr(),mz=st(),nf=class t extends pz.BaseExternalAccountClient{static{o(this,"AwsClient")}environmentId;awsSecurityCredentialsSupplier;regionalCredVerificationUrl;awsRequestSigner;region;static#e="https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15";static AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";static AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254";constructor(e){super(e);let r=(0,NE.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("aws_security_credentials_supplier");if(!n&&!i)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(i)this.awsSecurityCredentialsSupplier=i,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let s=(0,NE.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let c=s.get("region_url"),d=s.get("url"),l=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new fz.DefaultAwsSecurityCredentialsSupplier({regionUrl:c,securityCredentialsUrl:d,imdsV2SessionTokenUrl:l}),this.regionalCredVerificationUrl=s.get("regional_cred_verification_url"),this.credentialSourceType="aws",this.validateEnvironmentId()}this.awsRequestSigner=null,this.region=""}validateEnvironmentId(){let e=this.environmentId?.match(/^(aws)(\d+)$/);if(!e||!this.regionalCredVerificationUrl)throw new Error('No valid AWS "credential_source" provided');if(parseInt(e[2],10)!==1)throw new Error(`aws version "${e[2]}" is not supported in the current build.`)}async retrieveSubjectToken(){this.awsRequestSigner||(this.region=await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext),this.awsRequestSigner=new dz.AwsRequestSigner(async()=>this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext),this.region));let e=await this.awsRequestSigner.getRequestOptions({...t.RETRY_CONFIG,url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"}),r=[];return mz.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((i,s)=>r.push({key:s,value:i})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};tc.AwsClient=nf});var lf=k(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.InvalidSubjectTokenError=lt.InvalidMessageFieldError=lt.InvalidCodeFieldError=lt.InvalidTokenTypeFieldError=lt.InvalidExpirationTimeFieldError=lt.InvalidSuccessFieldError=lt.InvalidVersionFieldError=lt.ExecutableResponseError=lt.ExecutableResponse=void 0;var rc="urn:ietf:params:oauth:token-type:saml2",af="urn:ietf:params:oauth:token-type:id_token",sf="urn:ietf:params:oauth:token-type:jwt",uf=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new nc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new oc("Executable response must contain a 'success' field.");if(this.version=e.version,this.success=e.success,this.success){if(this.expirationTime=e.expiration_time,this.tokenType=e.token_type,this.tokenType!==rc&&this.tokenType!==af&&this.tokenType!==sf)throw new ic(`Executable response must contain a 'token_type' field when successful and it must be one of ${af}, ${sf}, or ${rc}.`);if(this.tokenType===rc){if(!e.saml_response)throw new Ia(`Executable response must contain a 'saml_response' field when token_type=${rc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new Ia(`Executable response must contain a 'id_token' field when token_type=${af} or ${sf}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new ac("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new sc("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=e.code,this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};lt.ExecutableResponse=uf;var Ur=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};lt.ExecutableResponseError=Ur;var nc=class extends Ur{static{o(this,"InvalidVersionFieldError")}};lt.InvalidVersionFieldError=nc;var oc=class extends Ur{static{o(this,"InvalidSuccessFieldError")}};lt.InvalidSuccessFieldError=oc;var cf=class extends Ur{static{o(this,"InvalidExpirationTimeFieldError")}};lt.InvalidExpirationTimeFieldError=cf;var ic=class extends Ur{static{o(this,"InvalidTokenTypeFieldError")}};lt.InvalidTokenTypeFieldError=ic;var ac=class extends Ur{static{o(this,"InvalidCodeFieldError")}};lt.InvalidCodeFieldError=ac;var sc=class extends Ur{static{o(this,"InvalidMessageFieldError")}};lt.InvalidMessageFieldError=sc;var Ia=class extends Ur{static{o(this,"InvalidSubjectTokenError")}};lt.InvalidSubjectTokenError=Ia});var ff=k(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.PluggableAuthHandler=pi.ExecutableError=void 0;var fo=lf(),hz=require("child_process"),df=require("fs"),uc=class extends Error{static{o(this,"ExecutableError")}code;constructor(e,r){super(`The executable failed with exit code: ${r} and error message: ${e}.`),this.code=r,Object.setPrototypeOf(this,new.target.prototype)}};pi.ExecutableError=uc;var pf=class t{static{o(this,"PluggableAuthHandler")}commandComponents;timeoutMillis;outputFile;constructor(e){if(!e.command)throw new Error("No command provided.");if(this.commandComponents=t.parseCommand(e.command),this.timeoutMillis=e.timeoutMillis,!this.timeoutMillis)throw new Error("No timeoutMillis provided.");this.outputFile=e.outputFile}retrieveResponseFromExecutable(e){return new Promise((r,n)=>{let i=hz.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";i.stdout.on("data",d=>{s+=d}),i.stderr.on("data",d=>{s+=d});let c=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",d=>{if(clearTimeout(c),d===0)try{let l=JSON.parse(s),p=new fo.ExecutableResponse(l);return r(p)}catch(l){return l instanceof fo.ExecutableResponseError?n(l):n(new fo.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new uc(s,d.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await df.promises.realpath(this.outputFile)}catch{return}if(!(await df.promises.lstat(e)).isFile())return;let r=await df.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new fo.ExecutableResponse(n).isValid()?new fo.ExecutableResponse(n):void 0}catch(n){throw n instanceof fo.ExecutableResponseError?n:new fo.ExecutableResponseError(`The output file contained an invalid response: ${r}`)}}static parseCommand(e){let r=e.match(/(?:[^\s"]+|"[^"]*")+/g);if(!r)throw new Error(`Provided command: "${e}" could not be parsed.`);for(let n=0;n<r.length;n++)r[n][0]==='"'&&r[n].slice(-1)==='"'&&(r[n]=r[n].slice(1,-1));return r}};pi.PluggableAuthHandler=pf});var hf=k(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.PluggableAuthClient=fi.ExecutableError=void 0;var gz=Fn(),yz=lf(),zE=ff(),_z=ff();Object.defineProperty(fi,"ExecutableError",{enumerable:!0,get:o(function(){return _z.ExecutableError},"get")});var vz=30*1e3,DE=5*1e3,UE=120*1e3,bz="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",ME=1,mf=class extends gz.BaseExternalAccountClient{static{o(this,"PluggableAuthClient")}command;timeoutMillis;outputFile;handler;constructor(e){if(super(e),!e.credential_source.executable)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(this.command=e.credential_source.executable.command,!this.command)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(e.credential_source.executable.timeout_millis===void 0)this.timeoutMillis=vz;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<DE||this.timeoutMillis>UE)throw new Error(`Timeout must be between ${DE} and ${UE} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new zE.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[bz]!=="1")throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.");let e;if(this.outputFile&&(e=await this.handler.retrieveCachedResponse()),!e){let r=new Map;r.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience),r.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType),r.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0"),this.outputFile&&r.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile);let n=this.getServiceAccountEmail();n&&r.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",n),e=await this.handler.retrieveResponseFromExecutable(r)}if(e.version>ME)throw new Error(`Version of executable is not currently supported, maximum supported version is ${ME}.`);if(!e.success)throw new zE.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new yz.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.");if(e.isExpired())throw new Error("Executable response is expired.");return e.subjectToken}};fi.PluggableAuthClient=mf});var yf=k(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.ExternalAccountClient=void 0;var Pz=Fn(),Sz=Qp(),Ez=of(),Tz=hf(),gf=class{static{o(this,"ExternalAccountClient")}constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(e){return e&&e.type===Pz.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new Ez.AwsClient(e):e.credential_source?.executable?new Tz.PluggableAuthClient(e):new Sz.IdentityPoolClient(e):null}};cc.ExternalAccountClient=gf});var bf=k(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.ExternalAccountAuthorizedUserClient=mi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var LE=Ht(),jE=Fp(),FE=st(),xz=require("stream"),Az=Fn();mi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var wz="https://sts.{universeDomain}/v1/oauthtoken",_f=class t extends jE.OAuthClientAuthHandler{static{o(this,"ExternalAccountAuthorizedUserHandler")}#e;constructor(e){super(e),this.#e=e.tokenRefreshEndpoint}async refreshToken(e,r){let n={...t.RETRY_CONFIG,url:this.#e,method:"POST",headers:r,data:new URLSearchParams({grant_type:"refresh_token",refresh_token:e})};LE.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let i=await this.transporter.request(n),s=i.data;return s.res=i,s}catch(i){throw i instanceof FE.GaxiosError&&i.response?(0,jE.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},vf=class extends LE.AuthClient{static{o(this,"ExternalAccountAuthorizedUserClient")}cachedAccessToken;externalAccountAuthorizedUserHandler;refreshToken;constructor(e){super(e),e.universe_domain&&(this.universeDomain=e.universe_domain),this.refreshToken=e.refresh_token;let r={confidentialClientType:"basic",clientId:e.client_id,clientSecret:e.client_secret};this.externalAccountAuthorizedUserHandler=new _f({tokenRefreshEndpoint:e.token_url??wz.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=Az.EXPIRATION_TIME_OFFSET:this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis,this.forceRefreshOnFailure=!!e?.forceRefreshOnFailure}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=FE.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof xz.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};mi.ExternalAccountAuthorizedUserClient=vf});var HE=k(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.GoogleAuth=Er.GoogleAuthExceptionMessages=void 0;var Iz=require("child_process"),Ra=require("fs"),Rz=st(),Oa=ha(),Oz=require("os"),Pf=require("path"),Cz=ga(),$z=fp(),kz=hp(),Nz=gp(),hi=zp(),BE=Up(),gi=jp(),zz=yf(),Ca=Fn(),Sf=Ht(),qE=bf(),VE=vr();Er.GoogleAuthExceptionMessages={API_KEY_WITH_CREDENTIALS:"API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.",NO_PROJECT_ID_FOUND:`Unable to detect a Project Id in the current environment.
50
50
  To learn more about authentication and Google APIs, visit:
51
51
  https://cloud.google.com/docs/authentication/getting-started`,NO_CREDENTIALS_FOUND:`Unable to find credentials in current environment.
52
52
  To learn more about authentication and Google APIs, visit:
53
53
  https://cloud.google.com/docs/authentication/getting-started`,NO_ADC_FOUND:"Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.",NO_UNIVERSE_DOMAIN_FOUND:`Unable to detect a Universe Domain in the current environment.
54
54
  To learn more about Universe Domain retrieval, visit:
55
- https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var Ef=class{static{o(this,"GoogleAuth")}checkIsGCE=void 0;useJWTAccessWithScope;defaultServicePath;get isGCE(){return this.checkIsGCE}_findProjectIdPromise;_cachedProjectId;jsonContent=null;apiKey;cachedCredential=null;#e=null;defaultScopes;keyFilename;scopes;clientOptions={};constructor(e={}){if(this._cachedProjectId=e.projectId||null,this.cachedCredential=e.authClient||null,this.keyFilename=e.keyFilename||e.keyFile,this.scopes=e.scopes,this.clientOptions=e.clientOptions||{},this.jsonContent=e.credentials||null,this.apiKey=e.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw new RangeError(Er.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);e.universeDomain&&(this.clientOptions.universeDomain=e.universeDomain)}setGapicJWTValues(e){e.defaultServicePath=this.defaultServicePath,e.useJWTAccessWithScope=this.useJWTAccessWithScope,e.defaultScopes=this.defaultScopes}getProjectId(e){if(e)this.getProjectIdAsync().then(r=>e(null,r),e);else return this.getProjectIdAsync()}async getProjectIdOptional(){try{return await this.getProjectId()}catch(e){if(e instanceof Error&&e.message===Er.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)return null;throw e}}async findAndCacheProjectId(){let e=null;if(e||=await this.getProductionProjectId(),e||=await this.getFileProjectId(),e||=await this.getDefaultServiceProjectId(),e||=await this.getGCEProjectId(),e||=await this.getExternalAccountClientProjectId(),e)return this._cachedProjectId=e,e;throw new Error(Er.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)}async getProjectIdAsync(){return this._cachedProjectId?this._cachedProjectId:(this._findProjectIdPromise||(this._findProjectIdPromise=this.findAndCacheProjectId()),this._findProjectIdPromise)}async getUniverseDomainFromMetadataServer(){let e;try{e=await Oa.universe("universe-domain"),e||=Sf.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Sf.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,qE.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Sf.DEFAULT_UNIVERSE}return e}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(e={},r){let n;if(typeof e=="function"?r=e:n=e,r)this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r);else return this.getApplicationDefaultAsync(n)}async getApplicationDefaultAsync(e={}){if(this.cachedCredential)return await this.#t(this.cachedCredential,null);let r;if(r=await this._tryGetApplicationCredentialsFromEnvironmentVariable(e),r)return r instanceof hi.JWT?r.scopes=this.scopes:r instanceof Ca.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof hi.JWT?r.scopes=this.scopes:r instanceof Ca.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new Oz.Compute(e));throw new Error(Er.GoogleAuthExceptionMessages.NO_ADC_FOUND)}async#t(e,r=process.env.GOOGLE_CLOUD_QUOTA_PROJECT||null){let n=await this.getProjectIdOptional();return r&&(e.quotaProjectId=r),this.cachedCredential=e,{credential:e,projectId:n}}async _checkIsGCE(){return this.checkIsGCE===void 0&&(this.checkIsGCE=Oa.getGCPResidency()||await Oa.isAvailable()),this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(e){let r=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials;if(!r||r.length===0)return null;try{return this._getApplicationCredentialsFromFilePath(r,e)}catch(n){throw n instanceof Error&&(n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`),n}}async _tryGetApplicationCredentialsFromWellKnownFile(e){let r=null;if(this._isWindows())r=process.env.APPDATA;else{let i=process.env.HOME;i&&(r=Pf.join(i,".config"))}return r&&(r=Pf.join(r,"gcloud","application_default_credentials.json"),Ra.existsSync(r)||(r=null)),r?await this._getApplicationCredentialsFromFilePath(r,e):null}async _getApplicationCredentialsFromFilePath(e,r={}){if(!e||e.length===0)throw new Error("The file path is invalid.");try{if(e=Ra.realpathSync(e),!Ra.lstatSync(e).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let n=Ra.createReadStream(e);return this.fromStream(n,r)}fromImpersonatedJSON(e){if(!e)throw new Error("Must pass in a JSON object containing an impersonated refresh token");if(e.type!==gi.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${gi.IMPERSONATED_ACCOUNT_TYPE}" type`);if(!e.source_credentials)throw new Error("The incoming JSON object does not contain a source_credentials field");if(!e.service_account_impersonation_url)throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field");let r=this.fromJSON(e.source_credentials);if(e.service_account_impersonation_url?.length>256)throw new RangeError(`Target principal is too long: ${e.service_account_impersonation_url}`);let n=/(?<target>[^/]+):(generateAccessToken|generateIdToken)$/.exec(e.service_account_impersonation_url)?.groups?.target;if(!n)throw new RangeError(`Cannot extract target principal from ${e.service_account_impersonation_url}`);let i=(this.scopes||e.scopes||this.defaultScopes)??[];return new gi.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,r={}){let n,i=(0,qE.originalOrCamelOptions)(r).get("universe_domain");return e.type===FE.USER_REFRESH_ACCOUNT_TYPE?(n=new FE.UserRefreshClient(r),n.fromJSON(e)):e.type===gi.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===Ca.EXTERNAL_ACCOUNT_TYPE?(n=kz.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===BE.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new BE.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new hi.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),i&&(n.universeDomain=i),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let i={};if(typeof r=="function"?n=r:i=r,n)this.fromStreamAsync(e,i).then(s=>n(null,s),n);else return this.fromStreamAsync(e,i)}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",i).on("data",c=>s.push(c)).on("end",()=>{try{try{let c=JSON.parse(s.join("")),d=this._cacheClientFromJSON(c,r);return n(d)}catch(c){if(!this.keyFilename)throw c;let d=new hi.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=d,this.setGapicJWTValues(d),n(d)}}catch(c){return i(c)}})})}fromAPIKey(e,r={}){return new hi.JWT({...r,apiKey:e})}_isWindows(){let e=Iz.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,Az.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n)try{let i=JSON.parse(n).configuration.properties.core.project;e(i);return}catch{}e(null)})})}getProductionProjectId(){return process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project}async getFileProjectId(){if(this.cachedCredential)return this.cachedCredential.projectId;if(this.keyFilename){let r=await this.getClient();if(r&&r.projectId)return r.projectId}let e=await this._tryGetApplicationCredentialsFromEnvironmentVariable();return e?e.projectId:null}async getExternalAccountClientProjectId(){return!this.jsonContent||this.jsonContent.type!==Ca.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await Oa.project("project-id")}catch{return null}}getCredentials(e){if(e)this.getCredentialsAsync().then(r=>e(null,r),e);else return this.getCredentialsAsync()}async getCredentialsAsync(){let e=await this.getClient();if(e instanceof gi.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof Ca.BaseExternalAccountClient){let r=e.getServiceAccountEmail();if(r)return{client_email:r,universe_domain:e.universeDomain}}if(this.jsonContent)return{client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key,universe_domain:this.jsonContent.universe_domain};if(await this._checkIsGCE()){let[r,n]=await Promise.all([Oa.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(Er.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND)}async getClient(){if(this.cachedCredential)return this.cachedCredential;this.#e=this.#e||this.#r();try{return await this.#e}finally{this.#e=null}}async#r(){if(this.jsonContent)return this._cacheClientFromJSON(this.jsonContent,this.clientOptions);if(this.keyFilename){let e=Pf.resolve(this.keyFilename),r=Ra.createReadStream(e);return await this.fromStreamAsync(r,this.clientOptions)}else if(this.apiKey){let e=await this.fromAPIKey(this.apiKey,this.clientOptions);e.scopes=this.scopes;let{credential:r}=await this.#t(e);return r}else{let{credential:e}=await this.getApplicationDefaultAsync(this.clientOptions);return e}}async getIdTokenClient(e){let r=await this.getClient();if(!("fetchIdToken"in r))throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.");return new Cz.IdTokenClient({targetAudience:e,idTokenProvider:r})}async getAccessToken(){return(await(await this.getClient()).getAccessToken()).token}async getRequestHeaders(e){return(await this.getClient()).getRequestHeaders(e)}async authorizeRequest(e={}){let r=e.url,i=await(await this.getClient()).getRequestHeaders(r);return e.headers=wz.Gaxios.mergeHeaders(e.headers,i),e}async fetch(...e){return(await this.getClient()).fetch(...e)}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,$z.getEnv)()}async sign(e,r){let n=await this.getClient(),i=await this.getUniverseDomain();if(r=r||`https://iamcredentials.${i}/v1/projects/-/serviceAccounts/`,n instanceof gi.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,Rz.createCrypto)();if(n instanceof hi.JWT&&n.key)return await s.sign(n.key,e);let c=await this.getCredentials();if(!c.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,c.client_email,e,r)}async signBlob(e,r,n,i){let s=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};Er.GoogleAuth=Ef});var HE=k(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.IAMAuth=void 0;var Tf=class{static{o(this,"IAMAuth")}selector;token;constructor(e,r){this.selector=e,this.token=r,this.selector=e,this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};lc.IAMAuth=Tf});var GE=k(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.DownscopedClient=Mr.EXPIRATION_TIME_OFFSET=Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var Nz=at(),zz=require("stream"),xf=Ht(),Dz=Vu(),Uz="urn:ietf:params:oauth:grant-type:token-exchange",Mz="urn:ietf:params:oauth:token-type:access_token",jz="urn:ietf:params:oauth:token-type:access_token";Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Mr.EXPIRATION_TIME_OFFSET=300*1e3;var Af=class extends xf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof xf.AuthClient?{}:e),e instanceof xf.AuthClient?(this.authClient=e,this.credentialAccessBoundary=r):(this.authClient=e.authClient,this.credentialAccessBoundary=e.credentialAccessBoundary),this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length===0)throw new Error("At least one access boundary rule needs to be defined.");if(this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length>Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);for(let n of this.credentialAccessBoundary.accessBoundary.accessBoundaryRules)if(n.availablePermissions.length===0)throw new Error("At least one permission should be defined in access boundary rules.");this.stsCredential=new Dz.StsCredentials({tokenExchangeEndpoint:`https://sts.${this.universeDomain}/v1/token`}),this.cachedDownscopedAccessToken=null}setCredentials(e){if(!e.expiry_date)throw new Error("The access token expiry_date field is missing in the provided credentials.");super.setCredentials(e),this.cachedDownscopedAccessToken=e}async getAccessToken(){return(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=Nz.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof zz.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:Uz,requestedTokenType:Mz,subjectToken:e,subjectTokenType:jz},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),i=this.authClient.credentials?.expiry_date||null,s=n.expires_in?new Date().getTime()+n.expires_in*1e3:i;return this.cachedDownscopedAccessToken={access_token:n.access_token,expiry_date:s,res:n.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};Mr.DownscopedClient=Af});var WE=k(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.PassThroughClient=void 0;var Lz=Ht(),wf=class extends Lz.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};dc.PassThroughClient=wf});var $a=k(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.GoogleAuth=se.auth=se.PassThroughClient=se.ExternalAccountAuthorizedUserClient=se.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=se.ExecutableError=se.PluggableAuthClient=se.DownscopedClient=se.BaseExternalAccountClient=se.ExternalAccountClient=se.IdentityPoolClient=se.AwsRequestSigner=se.AwsClient=se.UserRefreshClient=se.LoginTicket=se.ClientAuthentication=se.OAuth2Client=se.CodeChallengeMethod=se.Impersonated=se.JWT=se.JWTAccess=se.IdTokenClient=se.IAMAuth=se.GCPEnv=se.Compute=se.DEFAULT_UNIVERSE=se.AuthClient=se.gaxios=se.gcpMetadata=void 0;var ZE=VE();Object.defineProperty(se,"GoogleAuth",{enumerable:!0,get:o(function(){return ZE.GoogleAuth},"get")});se.gcpMetadata=ha();se.gaxios=at();var KE=Ht();Object.defineProperty(se,"AuthClient",{enumerable:!0,get:o(function(){return KE.AuthClient},"get")});Object.defineProperty(se,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return KE.DEFAULT_UNIVERSE},"get")});var Fz=fp();Object.defineProperty(se,"Compute",{enumerable:!0,get:o(function(){return Fz.Compute},"get")});var Bz=gp();Object.defineProperty(se,"GCPEnv",{enumerable:!0,get:o(function(){return Bz.GCPEnv},"get")});var qz=HE();Object.defineProperty(se,"IAMAuth",{enumerable:!0,get:o(function(){return qz.IAMAuth},"get")});var Vz=hp();Object.defineProperty(se,"IdTokenClient",{enumerable:!0,get:o(function(){return Vz.IdTokenClient},"get")});var Hz=kp();Object.defineProperty(se,"JWTAccess",{enumerable:!0,get:o(function(){return Hz.JWTAccess},"get")});var Gz=zp();Object.defineProperty(se,"JWT",{enumerable:!0,get:o(function(){return Gz.JWT},"get")});var Wz=jp();Object.defineProperty(se,"Impersonated",{enumerable:!0,get:o(function(){return Wz.Impersonated},"get")});var If=po();Object.defineProperty(se,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return If.CodeChallengeMethod},"get")});Object.defineProperty(se,"OAuth2Client",{enumerable:!0,get:o(function(){return If.OAuth2Client},"get")});Object.defineProperty(se,"ClientAuthentication",{enumerable:!0,get:o(function(){return If.ClientAuthentication},"get")});var Zz=cp();Object.defineProperty(se,"LoginTicket",{enumerable:!0,get:o(function(){return Zz.LoginTicket},"get")});var Kz=Up();Object.defineProperty(se,"UserRefreshClient",{enumerable:!0,get:o(function(){return Kz.UserRefreshClient},"get")});var Jz=of();Object.defineProperty(se,"AwsClient",{enumerable:!0,get:o(function(){return Jz.AwsClient},"get")});var Yz=tf();Object.defineProperty(se,"AwsRequestSigner",{enumerable:!0,get:o(function(){return Yz.AwsRequestSigner},"get")});var Xz=Qp();Object.defineProperty(se,"IdentityPoolClient",{enumerable:!0,get:o(function(){return Xz.IdentityPoolClient},"get")});var Qz=yf();Object.defineProperty(se,"ExternalAccountClient",{enumerable:!0,get:o(function(){return Qz.ExternalAccountClient},"get")});var eD=Fn();Object.defineProperty(se,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return eD.BaseExternalAccountClient},"get")});var tD=GE();Object.defineProperty(se,"DownscopedClient",{enumerable:!0,get:o(function(){return tD.DownscopedClient},"get")});var JE=hf();Object.defineProperty(se,"PluggableAuthClient",{enumerable:!0,get:o(function(){return JE.PluggableAuthClient},"get")});Object.defineProperty(se,"ExecutableError",{enumerable:!0,get:o(function(){return JE.ExecutableError},"get")});var YE=bf();Object.defineProperty(se,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return YE.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(se,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return YE.ExternalAccountAuthorizedUserClient},"get")});var rD=WE();Object.defineProperty(se,"PassThroughClient",{enumerable:!0,get:o(function(){return rD.PassThroughClient},"get")});var nD=new ZE.GoogleAuth;se.auth=nD});var XE=k(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.getAPI=oD;function oD(t,e,r,n){let i;if(typeof e=="string")i=e,e={};else if(typeof e=="object")i=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[i],c=new s(e,n);return Object.freeze(c)}catch(s){throw new Error(`Unable to load endpoint ${t}("${i}"): ${s.message}`)}}o(oD,"getAPI")});var eT=k((EX,QE)=>{QE.exports=require("util").inspect});var Ua=k((TX,bT)=>{var jf=typeof Map=="function"&&Map.prototype,Of=Object.getOwnPropertyDescriptor&&jf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,fc=jf&&Of&&typeof Of.get=="function"?Of.get:null,tT=jf&&Map.prototype.forEach,Lf=typeof Set=="function"&&Set.prototype,Cf=Object.getOwnPropertyDescriptor&&Lf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,mc=Lf&&Cf&&typeof Cf.get=="function"?Cf.get:null,rT=Lf&&Set.prototype.forEach,iD=typeof WeakMap=="function"&&WeakMap.prototype,Na=iD?WeakMap.prototype.has:null,aD=typeof WeakSet=="function"&&WeakSet.prototype,za=aD?WeakSet.prototype.has:null,sD=typeof WeakRef=="function"&&WeakRef.prototype,nT=sD?WeakRef.prototype.deref:null,uD=Boolean.prototype.valueOf,cD=Object.prototype.toString,lD=Function.prototype.toString,dD=String.prototype.match,Ff=String.prototype.slice,Bn=String.prototype.replace,pD=String.prototype.toUpperCase,oT=String.prototype.toLowerCase,fT=RegExp.prototype.test,iT=Array.prototype.concat,jr=Array.prototype.join,fD=Array.prototype.slice,aT=Math.floor,Nf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,$f=Object.getOwnPropertySymbols,zf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,yi=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Da=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===yi||!0)?Symbol.toStringTag:null,mT=Object.prototype.propertyIsEnumerable,sT=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function uT(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||fT.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-aT(-t):aT(t);if(n!==t){var i=String(n),s=Ff.call(e,i.length+1);return Bn.call(i,r,"$&_")+"."+Bn.call(Bn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Bn.call(e,r,"$&_")}o(uT,"addNumericSeparator");var Df=eT(),cT=Df.custom,lT=yT(cT)?cT:null,hT={__proto__:null,double:'"',single:"'"},mD={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};bT.exports=o(function t(e,r,n,i){var s=r||{};if(cn(s,"quoteStyle")&&!cn(hT,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(cn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=cn(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(cn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(cn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return vT(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return d?uT(e,l):l}if(typeof e=="bigint"){var p=String(e)+"n";return d?uT(e,p):p}var f=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=f&&f>0&&typeof e=="object")return Uf(e)?"[Array]":"[Object]";var _=$D(s,n);if(typeof i>"u")i=[];else if(_T(i,e)>=0)return"[Circular]";function h(B,J,K){if(J&&(i=fD.call(i),i.push(J)),K){var re={depth:s.depth};return cn(s,"quoteStyle")&&(re.quoteStyle=s.quoteStyle),t(B,re,n+1,i)}return t(B,s,n+1,i)}if(o(h,"inspect"),typeof e=="function"&&!dT(e)){var g=ED(e),y=pc(e,h);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(y.length>0?" { "+jr.call(y,", ")+" }":"")}if(yT(e)){var T=yi?Bn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):zf.call(e);return typeof e=="object"&&!yi?ka(T):T}if(RD(e)){for(var P="<"+oT.call(String(e.nodeName)),x=e.attributes||[],N=0;N<x.length;N++)P+=" "+x[N].name+"="+gT(hD(x[N].value),"double",s);return P+=">",e.childNodes&&e.childNodes.length&&(P+="..."),P+="</"+oT.call(String(e.nodeName))+">",P}if(Uf(e)){if(e.length===0)return"[]";var L=pc(e,h);return _&&!CD(L)?"["+Mf(L,_)+"]":"[ "+jr.call(L,", ")+" ]"}if(yD(e)){var X=pc(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!mT.call(e,"cause")?"{ ["+String(e)+"] "+jr.call(iT.call("[cause]: "+h(e.cause),X),", ")+" }":X.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+jr.call(X,", ")+" }"}if(typeof e=="object"&&c){if(lT&&typeof e[lT]=="function"&&Df)return Df(e,{depth:f-n});if(c!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(TD(e)){var W=[];return tT&&tT.call(e,function(B,J){W.push(h(J,e,!0)+" => "+h(B,e))}),pT("Map",fc.call(e),W,_)}if(wD(e)){var G=[];return rT&&rT.call(e,function(B){G.push(h(B,e))}),pT("Set",mc.call(e),G,_)}if(xD(e))return kf("WeakMap");if(ID(e))return kf("WeakSet");if(AD(e))return kf("WeakRef");if(vD(e))return ka(h(Number(e)));if(PD(e))return ka(h(Nf.call(e)));if(bD(e))return ka(uD.call(e));if(_D(e))return ka(h(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof global<"u"&&e===global)return"{ [object globalThis] }";if(!gD(e)&&!dT(e)){var Z=pc(e,h),ee=sT?sT(e)===Object.prototype:e instanceof Object||e.constructor===Object,Y=e instanceof Object?"":"null prototype",Se=!ee&&Da&&Object(e)===e&&Da in e?Ff.call(qn(e),8,-1):Y?"Object":"",te=ee||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",q=te+(Se||Y?"["+jr.call(iT.call([],Se||[],Y||[]),": ")+"] ":"");return Z.length===0?q+"{}":_?q+"{"+Mf(Z,_)+"}":q+"{ "+jr.call(Z,", ")+" }"}return String(e)},"inspect_");function gT(t,e,r){var n=r.quoteStyle||e,i=hT[n];return i+t+i}o(gT,"wrapQuotes");function hD(t){return Bn.call(String(t),/"/g,"&quot;")}o(hD,"quote");function mo(t){return!Da||!(typeof t=="object"&&(Da in t||typeof t[Da]<"u"))}o(mo,"canTrustToString");function Uf(t){return qn(t)==="[object Array]"&&mo(t)}o(Uf,"isArray");function gD(t){return qn(t)==="[object Date]"&&mo(t)}o(gD,"isDate");function dT(t){return qn(t)==="[object RegExp]"&&mo(t)}o(dT,"isRegExp");function yD(t){return qn(t)==="[object Error]"&&mo(t)}o(yD,"isError");function _D(t){return qn(t)==="[object String]"&&mo(t)}o(_D,"isString");function vD(t){return qn(t)==="[object Number]"&&mo(t)}o(vD,"isNumber");function bD(t){return qn(t)==="[object Boolean]"&&mo(t)}o(bD,"isBoolean");function yT(t){if(yi)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!zf)return!1;try{return zf.call(t),!0}catch{}return!1}o(yT,"isSymbol");function PD(t){if(!t||typeof t!="object"||!Nf)return!1;try{return Nf.call(t),!0}catch{}return!1}o(PD,"isBigInt");var SD=Object.prototype.hasOwnProperty||function(t){return t in this};function cn(t,e){return SD.call(t,e)}o(cn,"has");function qn(t){return cD.call(t)}o(qn,"toStr");function ED(t){if(t.name)return t.name;var e=dD.call(lD.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(ED,"nameOf");function _T(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}o(_T,"indexOf");function TD(t){if(!fc||!t||typeof t!="object")return!1;try{fc.call(t);try{mc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(TD,"isMap");function xD(t){if(!Na||!t||typeof t!="object")return!1;try{Na.call(t,Na);try{za.call(t,za)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(xD,"isWeakMap");function AD(t){if(!nT||!t||typeof t!="object")return!1;try{return nT.call(t),!0}catch{}return!1}o(AD,"isWeakRef");function wD(t){if(!mc||!t||typeof t!="object")return!1;try{mc.call(t);try{fc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(wD,"isSet");function ID(t){if(!za||!t||typeof t!="object")return!1;try{za.call(t,za);try{Na.call(t,Na)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(ID,"isWeakSet");function RD(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(RD,"isElement");function vT(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return vT(Ff.call(t,0,e.maxStringLength),e)+n}var i=mD[e.quoteStyle||"single"];i.lastIndex=0;var s=Bn.call(Bn.call(t,i,"\\$1"),/[\x00-\x1f]/g,OD);return gT(s,"single",e)}o(vT,"inspectString");function OD(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+pD.call(e.toString(16))}o(OD,"lowbyte");function ka(t){return"Object("+t+")"}o(ka,"markBoxed");function kf(t){return t+" { ? }"}o(kf,"weakCollectionOf");function pT(t,e,r,n){var i=n?Mf(r,n):jr.call(r,", ");return t+" ("+e+") {"+i+"}"}o(pT,"collectionOf");function CD(t){for(var e=0;e<t.length;e++)if(_T(t[e],`
56
- `)>=0)return!1;return!0}o(CD,"singleLineValues");function $D(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=jr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:jr.call(Array(e+1),r)}}o($D,"getIndent");function Mf(t,e){if(t.length===0)return"";var r=`
55
+ https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var Ef=class{static{o(this,"GoogleAuth")}checkIsGCE=void 0;useJWTAccessWithScope;defaultServicePath;get isGCE(){return this.checkIsGCE}_findProjectIdPromise;_cachedProjectId;jsonContent=null;apiKey;cachedCredential=null;#e=null;defaultScopes;keyFilename;scopes;clientOptions={};constructor(e={}){if(this._cachedProjectId=e.projectId||null,this.cachedCredential=e.authClient||null,this.keyFilename=e.keyFilename||e.keyFile,this.scopes=e.scopes,this.clientOptions=e.clientOptions||{},this.jsonContent=e.credentials||null,this.apiKey=e.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw new RangeError(Er.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);e.universeDomain&&(this.clientOptions.universeDomain=e.universeDomain)}setGapicJWTValues(e){e.defaultServicePath=this.defaultServicePath,e.useJWTAccessWithScope=this.useJWTAccessWithScope,e.defaultScopes=this.defaultScopes}getProjectId(e){if(e)this.getProjectIdAsync().then(r=>e(null,r),e);else return this.getProjectIdAsync()}async getProjectIdOptional(){try{return await this.getProjectId()}catch(e){if(e instanceof Error&&e.message===Er.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)return null;throw e}}async findAndCacheProjectId(){let e=null;if(e||=await this.getProductionProjectId(),e||=await this.getFileProjectId(),e||=await this.getDefaultServiceProjectId(),e||=await this.getGCEProjectId(),e||=await this.getExternalAccountClientProjectId(),e)return this._cachedProjectId=e,e;throw new Error(Er.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)}async getProjectIdAsync(){return this._cachedProjectId?this._cachedProjectId:(this._findProjectIdPromise||(this._findProjectIdPromise=this.findAndCacheProjectId()),this._findProjectIdPromise)}async getUniverseDomainFromMetadataServer(){let e;try{e=await Oa.universe("universe-domain"),e||=Sf.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Sf.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,VE.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Sf.DEFAULT_UNIVERSE}return e}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(e={},r){let n;if(typeof e=="function"?r=e:n=e,r)this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r);else return this.getApplicationDefaultAsync(n)}async getApplicationDefaultAsync(e={}){if(this.cachedCredential)return await this.#t(this.cachedCredential,null);let r;if(r=await this._tryGetApplicationCredentialsFromEnvironmentVariable(e),r)return r instanceof hi.JWT?r.scopes=this.scopes:r instanceof Ca.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof hi.JWT?r.scopes=this.scopes:r instanceof Ca.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new $z.Compute(e));throw new Error(Er.GoogleAuthExceptionMessages.NO_ADC_FOUND)}async#t(e,r=process.env.GOOGLE_CLOUD_QUOTA_PROJECT||null){let n=await this.getProjectIdOptional();return r&&(e.quotaProjectId=r),this.cachedCredential=e,{credential:e,projectId:n}}async _checkIsGCE(){return this.checkIsGCE===void 0&&(this.checkIsGCE=Oa.getGCPResidency()||await Oa.isAvailable()),this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(e){let r=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials;if(!r||r.length===0)return null;try{return this._getApplicationCredentialsFromFilePath(r,e)}catch(n){throw n instanceof Error&&(n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`),n}}async _tryGetApplicationCredentialsFromWellKnownFile(e){let r=null;if(this._isWindows())r=process.env.APPDATA;else{let i=process.env.HOME;i&&(r=Pf.join(i,".config"))}return r&&(r=Pf.join(r,"gcloud","application_default_credentials.json"),Ra.existsSync(r)||(r=null)),r?await this._getApplicationCredentialsFromFilePath(r,e):null}async _getApplicationCredentialsFromFilePath(e,r={}){if(!e||e.length===0)throw new Error("The file path is invalid.");try{if(e=Ra.realpathSync(e),!Ra.lstatSync(e).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let n=Ra.createReadStream(e);return this.fromStream(n,r)}fromImpersonatedJSON(e){if(!e)throw new Error("Must pass in a JSON object containing an impersonated refresh token");if(e.type!==gi.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${gi.IMPERSONATED_ACCOUNT_TYPE}" type`);if(!e.source_credentials)throw new Error("The incoming JSON object does not contain a source_credentials field");if(!e.service_account_impersonation_url)throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field");let r=this.fromJSON(e.source_credentials);if(e.service_account_impersonation_url?.length>256)throw new RangeError(`Target principal is too long: ${e.service_account_impersonation_url}`);let n=/(?<target>[^/]+):(generateAccessToken|generateIdToken)$/.exec(e.service_account_impersonation_url)?.groups?.target;if(!n)throw new RangeError(`Cannot extract target principal from ${e.service_account_impersonation_url}`);let i=(this.scopes||e.scopes||this.defaultScopes)??[];return new gi.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,r={}){let n,i=(0,VE.originalOrCamelOptions)(r).get("universe_domain");return e.type===BE.USER_REFRESH_ACCOUNT_TYPE?(n=new BE.UserRefreshClient(r),n.fromJSON(e)):e.type===gi.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===Ca.EXTERNAL_ACCOUNT_TYPE?(n=zz.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===qE.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new qE.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new hi.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),i&&(n.universeDomain=i),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let i={};if(typeof r=="function"?n=r:i=r,n)this.fromStreamAsync(e,i).then(s=>n(null,s),n);else return this.fromStreamAsync(e,i)}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",i).on("data",c=>s.push(c)).on("end",()=>{try{try{let c=JSON.parse(s.join("")),d=this._cacheClientFromJSON(c,r);return n(d)}catch(c){if(!this.keyFilename)throw c;let d=new hi.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=d,this.setGapicJWTValues(d),n(d)}}catch(c){return i(c)}})})}fromAPIKey(e,r={}){return new hi.JWT({...r,apiKey:e})}_isWindows(){let e=Oz.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,Iz.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n)try{let i=JSON.parse(n).configuration.properties.core.project;e(i);return}catch{}e(null)})})}getProductionProjectId(){return process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project}async getFileProjectId(){if(this.cachedCredential)return this.cachedCredential.projectId;if(this.keyFilename){let r=await this.getClient();if(r&&r.projectId)return r.projectId}let e=await this._tryGetApplicationCredentialsFromEnvironmentVariable();return e?e.projectId:null}async getExternalAccountClientProjectId(){return!this.jsonContent||this.jsonContent.type!==Ca.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await Oa.project("project-id")}catch{return null}}getCredentials(e){if(e)this.getCredentialsAsync().then(r=>e(null,r),e);else return this.getCredentialsAsync()}async getCredentialsAsync(){let e=await this.getClient();if(e instanceof gi.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof Ca.BaseExternalAccountClient){let r=e.getServiceAccountEmail();if(r)return{client_email:r,universe_domain:e.universeDomain}}if(this.jsonContent)return{client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key,universe_domain:this.jsonContent.universe_domain};if(await this._checkIsGCE()){let[r,n]=await Promise.all([Oa.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(Er.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND)}async getClient(){if(this.cachedCredential)return this.cachedCredential;this.#e=this.#e||this.#r();try{return await this.#e}finally{this.#e=null}}async#r(){if(this.jsonContent)return this._cacheClientFromJSON(this.jsonContent,this.clientOptions);if(this.keyFilename){let e=Pf.resolve(this.keyFilename),r=Ra.createReadStream(e);return await this.fromStreamAsync(r,this.clientOptions)}else if(this.apiKey){let e=await this.fromAPIKey(this.apiKey,this.clientOptions);e.scopes=this.scopes;let{credential:r}=await this.#t(e);return r}else{let{credential:e}=await this.getApplicationDefaultAsync(this.clientOptions);return e}}async getIdTokenClient(e){let r=await this.getClient();if(!("fetchIdToken"in r))throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.");return new kz.IdTokenClient({targetAudience:e,idTokenProvider:r})}async getAccessToken(){return(await(await this.getClient()).getAccessToken()).token}async getRequestHeaders(e){return(await this.getClient()).getRequestHeaders(e)}async authorizeRequest(e={}){let r=e.url,i=await(await this.getClient()).getRequestHeaders(r);return e.headers=Rz.Gaxios.mergeHeaders(e.headers,i),e}async fetch(...e){return(await this.getClient()).fetch(...e)}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,Nz.getEnv)()}async sign(e,r){let n=await this.getClient(),i=await this.getUniverseDomain();if(r=r||`https://iamcredentials.${i}/v1/projects/-/serviceAccounts/`,n instanceof gi.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,Cz.createCrypto)();if(n instanceof hi.JWT&&n.key)return await s.sign(n.key,e);let c=await this.getCredentials();if(!c.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,c.client_email,e,r)}async signBlob(e,r,n,i){let s=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};Er.GoogleAuth=Ef});var GE=k(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.IAMAuth=void 0;var Tf=class{static{o(this,"IAMAuth")}selector;token;constructor(e,r){this.selector=e,this.token=r,this.selector=e,this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};lc.IAMAuth=Tf});var WE=k(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.DownscopedClient=Mr.EXPIRATION_TIME_OFFSET=Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var Dz=st(),Uz=require("stream"),xf=Ht(),Mz=Vu(),jz="urn:ietf:params:oauth:grant-type:token-exchange",Lz="urn:ietf:params:oauth:token-type:access_token",Fz="urn:ietf:params:oauth:token-type:access_token";Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Mr.EXPIRATION_TIME_OFFSET=300*1e3;var Af=class extends xf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof xf.AuthClient?{}:e),e instanceof xf.AuthClient?(this.authClient=e,this.credentialAccessBoundary=r):(this.authClient=e.authClient,this.credentialAccessBoundary=e.credentialAccessBoundary),this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length===0)throw new Error("At least one access boundary rule needs to be defined.");if(this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length>Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);for(let n of this.credentialAccessBoundary.accessBoundary.accessBoundaryRules)if(n.availablePermissions.length===0)throw new Error("At least one permission should be defined in access boundary rules.");this.stsCredential=new Mz.StsCredentials({tokenExchangeEndpoint:`https://sts.${this.universeDomain}/v1/token`}),this.cachedDownscopedAccessToken=null}setCredentials(e){if(!e.expiry_date)throw new Error("The access token expiry_date field is missing in the provided credentials.");super.setCredentials(e),this.cachedDownscopedAccessToken=e}async getAccessToken(){return(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=Dz.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof Uz.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:jz,requestedTokenType:Lz,subjectToken:e,subjectTokenType:Fz},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),i=this.authClient.credentials?.expiry_date||null,s=n.expires_in?new Date().getTime()+n.expires_in*1e3:i;return this.cachedDownscopedAccessToken={access_token:n.access_token,expiry_date:s,res:n.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};Mr.DownscopedClient=Af});var ZE=k(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.PassThroughClient=void 0;var Bz=Ht(),wf=class extends Bz.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};dc.PassThroughClient=wf});var $a=k(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.GoogleAuth=se.auth=se.PassThroughClient=se.ExternalAccountAuthorizedUserClient=se.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=se.ExecutableError=se.PluggableAuthClient=se.DownscopedClient=se.BaseExternalAccountClient=se.ExternalAccountClient=se.IdentityPoolClient=se.AwsRequestSigner=se.AwsClient=se.UserRefreshClient=se.LoginTicket=se.ClientAuthentication=se.OAuth2Client=se.CodeChallengeMethod=se.Impersonated=se.JWT=se.JWTAccess=se.IdTokenClient=se.IAMAuth=se.GCPEnv=se.Compute=se.DEFAULT_UNIVERSE=se.AuthClient=se.gaxios=se.gcpMetadata=void 0;var KE=HE();Object.defineProperty(se,"GoogleAuth",{enumerable:!0,get:o(function(){return KE.GoogleAuth},"get")});se.gcpMetadata=ha();se.gaxios=st();var JE=Ht();Object.defineProperty(se,"AuthClient",{enumerable:!0,get:o(function(){return JE.AuthClient},"get")});Object.defineProperty(se,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return JE.DEFAULT_UNIVERSE},"get")});var qz=fp();Object.defineProperty(se,"Compute",{enumerable:!0,get:o(function(){return qz.Compute},"get")});var Vz=gp();Object.defineProperty(se,"GCPEnv",{enumerable:!0,get:o(function(){return Vz.GCPEnv},"get")});var Hz=GE();Object.defineProperty(se,"IAMAuth",{enumerable:!0,get:o(function(){return Hz.IAMAuth},"get")});var Gz=hp();Object.defineProperty(se,"IdTokenClient",{enumerable:!0,get:o(function(){return Gz.IdTokenClient},"get")});var Wz=kp();Object.defineProperty(se,"JWTAccess",{enumerable:!0,get:o(function(){return Wz.JWTAccess},"get")});var Zz=zp();Object.defineProperty(se,"JWT",{enumerable:!0,get:o(function(){return Zz.JWT},"get")});var Kz=jp();Object.defineProperty(se,"Impersonated",{enumerable:!0,get:o(function(){return Kz.Impersonated},"get")});var If=po();Object.defineProperty(se,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return If.CodeChallengeMethod},"get")});Object.defineProperty(se,"OAuth2Client",{enumerable:!0,get:o(function(){return If.OAuth2Client},"get")});Object.defineProperty(se,"ClientAuthentication",{enumerable:!0,get:o(function(){return If.ClientAuthentication},"get")});var Jz=cp();Object.defineProperty(se,"LoginTicket",{enumerable:!0,get:o(function(){return Jz.LoginTicket},"get")});var Yz=Up();Object.defineProperty(se,"UserRefreshClient",{enumerable:!0,get:o(function(){return Yz.UserRefreshClient},"get")});var Xz=of();Object.defineProperty(se,"AwsClient",{enumerable:!0,get:o(function(){return Xz.AwsClient},"get")});var Qz=tf();Object.defineProperty(se,"AwsRequestSigner",{enumerable:!0,get:o(function(){return Qz.AwsRequestSigner},"get")});var eD=Qp();Object.defineProperty(se,"IdentityPoolClient",{enumerable:!0,get:o(function(){return eD.IdentityPoolClient},"get")});var tD=yf();Object.defineProperty(se,"ExternalAccountClient",{enumerable:!0,get:o(function(){return tD.ExternalAccountClient},"get")});var rD=Fn();Object.defineProperty(se,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return rD.BaseExternalAccountClient},"get")});var nD=WE();Object.defineProperty(se,"DownscopedClient",{enumerable:!0,get:o(function(){return nD.DownscopedClient},"get")});var YE=hf();Object.defineProperty(se,"PluggableAuthClient",{enumerable:!0,get:o(function(){return YE.PluggableAuthClient},"get")});Object.defineProperty(se,"ExecutableError",{enumerable:!0,get:o(function(){return YE.ExecutableError},"get")});var XE=bf();Object.defineProperty(se,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return XE.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(se,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return XE.ExternalAccountAuthorizedUserClient},"get")});var oD=ZE();Object.defineProperty(se,"PassThroughClient",{enumerable:!0,get:o(function(){return oD.PassThroughClient},"get")});var iD=new KE.GoogleAuth;se.auth=iD});var QE=k(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.getAPI=aD;function aD(t,e,r,n){let i;if(typeof e=="string")i=e,e={};else if(typeof e=="object")i=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[i],c=new s(e,n);return Object.freeze(c)}catch(s){throw new Error(`Unable to load endpoint ${t}("${i}"): ${s.message}`)}}o(aD,"getAPI")});var tT=k((wX,eT)=>{eT.exports=require("util").inspect});var Ua=k((IX,PT)=>{var jf=typeof Map=="function"&&Map.prototype,Of=Object.getOwnPropertyDescriptor&&jf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,fc=jf&&Of&&typeof Of.get=="function"?Of.get:null,rT=jf&&Map.prototype.forEach,Lf=typeof Set=="function"&&Set.prototype,Cf=Object.getOwnPropertyDescriptor&&Lf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,mc=Lf&&Cf&&typeof Cf.get=="function"?Cf.get:null,nT=Lf&&Set.prototype.forEach,sD=typeof WeakMap=="function"&&WeakMap.prototype,Na=sD?WeakMap.prototype.has:null,uD=typeof WeakSet=="function"&&WeakSet.prototype,za=uD?WeakSet.prototype.has:null,cD=typeof WeakRef=="function"&&WeakRef.prototype,oT=cD?WeakRef.prototype.deref:null,lD=Boolean.prototype.valueOf,dD=Object.prototype.toString,pD=Function.prototype.toString,fD=String.prototype.match,Ff=String.prototype.slice,Bn=String.prototype.replace,mD=String.prototype.toUpperCase,iT=String.prototype.toLowerCase,mT=RegExp.prototype.test,aT=Array.prototype.concat,jr=Array.prototype.join,hD=Array.prototype.slice,sT=Math.floor,Nf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,$f=Object.getOwnPropertySymbols,zf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,yi=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Da=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===yi||!0)?Symbol.toStringTag:null,hT=Object.prototype.propertyIsEnumerable,uT=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function cT(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||mT.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-sT(-t):sT(t);if(n!==t){var i=String(n),s=Ff.call(e,i.length+1);return Bn.call(i,r,"$&_")+"."+Bn.call(Bn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Bn.call(e,r,"$&_")}o(cT,"addNumericSeparator");var Df=tT(),lT=Df.custom,dT=_T(lT)?lT:null,gT={__proto__:null,double:'"',single:"'"},gD={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};PT.exports=o(function t(e,r,n,i){var s=r||{};if(cn(s,"quoteStyle")&&!cn(gT,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(cn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=cn(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(cn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(cn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return bT(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return d?cT(e,l):l}if(typeof e=="bigint"){var p=String(e)+"n";return d?cT(e,p):p}var f=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=f&&f>0&&typeof e=="object")return Uf(e)?"[Array]":"[Object]";var _=ND(s,n);if(typeof i>"u")i=[];else if(vT(i,e)>=0)return"[Circular]";function h(B,J,K){if(J&&(i=hD.call(i),i.push(J)),K){var re={depth:s.depth};return cn(s,"quoteStyle")&&(re.quoteStyle=s.quoteStyle),t(B,re,n+1,i)}return t(B,s,n+1,i)}if(o(h,"inspect"),typeof e=="function"&&!pT(e)){var g=xD(e),y=pc(e,h);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(y.length>0?" { "+jr.call(y,", ")+" }":"")}if(_T(e)){var T=yi?Bn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):zf.call(e);return typeof e=="object"&&!yi?ka(T):T}if(CD(e)){for(var P="<"+iT.call(String(e.nodeName)),x=e.attributes||[],N=0;N<x.length;N++)P+=" "+x[N].name+"="+yT(yD(x[N].value),"double",s);return P+=">",e.childNodes&&e.childNodes.length&&(P+="..."),P+="</"+iT.call(String(e.nodeName))+">",P}if(Uf(e)){if(e.length===0)return"[]";var L=pc(e,h);return _&&!kD(L)?"["+Mf(L,_)+"]":"[ "+jr.call(L,", ")+" ]"}if(vD(e)){var X=pc(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!hT.call(e,"cause")?"{ ["+String(e)+"] "+jr.call(aT.call("[cause]: "+h(e.cause),X),", ")+" }":X.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+jr.call(X,", ")+" }"}if(typeof e=="object"&&c){if(dT&&typeof e[dT]=="function"&&Df)return Df(e,{depth:f-n});if(c!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(AD(e)){var W=[];return rT&&rT.call(e,function(B,J){W.push(h(J,e,!0)+" => "+h(B,e))}),fT("Map",fc.call(e),W,_)}if(RD(e)){var G=[];return nT&&nT.call(e,function(B){G.push(h(B,e))}),fT("Set",mc.call(e),G,_)}if(wD(e))return kf("WeakMap");if(OD(e))return kf("WeakSet");if(ID(e))return kf("WeakRef");if(PD(e))return ka(h(Number(e)));if(ED(e))return ka(h(Nf.call(e)));if(SD(e))return ka(lD.call(e));if(bD(e))return ka(h(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof global<"u"&&e===global)return"{ [object globalThis] }";if(!_D(e)&&!pT(e)){var Z=pc(e,h),ee=uT?uT(e)===Object.prototype:e instanceof Object||e.constructor===Object,Y=e instanceof Object?"":"null prototype",Se=!ee&&Da&&Object(e)===e&&Da in e?Ff.call(qn(e),8,-1):Y?"Object":"",te=ee||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",q=te+(Se||Y?"["+jr.call(aT.call([],Se||[],Y||[]),": ")+"] ":"");return Z.length===0?q+"{}":_?q+"{"+Mf(Z,_)+"}":q+"{ "+jr.call(Z,", ")+" }"}return String(e)},"inspect_");function yT(t,e,r){var n=r.quoteStyle||e,i=gT[n];return i+t+i}o(yT,"wrapQuotes");function yD(t){return Bn.call(String(t),/"/g,"&quot;")}o(yD,"quote");function mo(t){return!Da||!(typeof t=="object"&&(Da in t||typeof t[Da]<"u"))}o(mo,"canTrustToString");function Uf(t){return qn(t)==="[object Array]"&&mo(t)}o(Uf,"isArray");function _D(t){return qn(t)==="[object Date]"&&mo(t)}o(_D,"isDate");function pT(t){return qn(t)==="[object RegExp]"&&mo(t)}o(pT,"isRegExp");function vD(t){return qn(t)==="[object Error]"&&mo(t)}o(vD,"isError");function bD(t){return qn(t)==="[object String]"&&mo(t)}o(bD,"isString");function PD(t){return qn(t)==="[object Number]"&&mo(t)}o(PD,"isNumber");function SD(t){return qn(t)==="[object Boolean]"&&mo(t)}o(SD,"isBoolean");function _T(t){if(yi)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!zf)return!1;try{return zf.call(t),!0}catch{}return!1}o(_T,"isSymbol");function ED(t){if(!t||typeof t!="object"||!Nf)return!1;try{return Nf.call(t),!0}catch{}return!1}o(ED,"isBigInt");var TD=Object.prototype.hasOwnProperty||function(t){return t in this};function cn(t,e){return TD.call(t,e)}o(cn,"has");function qn(t){return dD.call(t)}o(qn,"toStr");function xD(t){if(t.name)return t.name;var e=fD.call(pD.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(xD,"nameOf");function vT(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}o(vT,"indexOf");function AD(t){if(!fc||!t||typeof t!="object")return!1;try{fc.call(t);try{mc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(AD,"isMap");function wD(t){if(!Na||!t||typeof t!="object")return!1;try{Na.call(t,Na);try{za.call(t,za)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(wD,"isWeakMap");function ID(t){if(!oT||!t||typeof t!="object")return!1;try{return oT.call(t),!0}catch{}return!1}o(ID,"isWeakRef");function RD(t){if(!mc||!t||typeof t!="object")return!1;try{mc.call(t);try{fc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(RD,"isSet");function OD(t){if(!za||!t||typeof t!="object")return!1;try{za.call(t,za);try{Na.call(t,Na)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(OD,"isWeakSet");function CD(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(CD,"isElement");function bT(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return bT(Ff.call(t,0,e.maxStringLength),e)+n}var i=gD[e.quoteStyle||"single"];i.lastIndex=0;var s=Bn.call(Bn.call(t,i,"\\$1"),/[\x00-\x1f]/g,$D);return yT(s,"single",e)}o(bT,"inspectString");function $D(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+mD.call(e.toString(16))}o($D,"lowbyte");function ka(t){return"Object("+t+")"}o(ka,"markBoxed");function kf(t){return t+" { ? }"}o(kf,"weakCollectionOf");function fT(t,e,r,n){var i=n?Mf(r,n):jr.call(r,", ");return t+" ("+e+") {"+i+"}"}o(fT,"collectionOf");function kD(t){for(var e=0;e<t.length;e++)if(vT(t[e],`
56
+ `)>=0)return!1;return!0}o(kD,"singleLineValues");function ND(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=jr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:jr.call(Array(e+1),r)}}o(ND,"getIndent");function Mf(t,e){if(t.length===0)return"";var r=`
57
57
  `+e.prev+e.base;return r+jr.call(t,","+r)+`
58
- `+e.prev}o(Mf,"indentedJoin");function pc(t,e){var r=Uf(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=cn(t,i)?e(t[i],t):""}var s=typeof $f=="function"?$f(t):[],c;if(yi){c={};for(var d=0;d<s.length;d++)c["$"+s[d]]=s[d]}for(var l in t)cn(t,l)&&(r&&String(Number(l))===l&&l<t.length||yi&&c["$"+l]instanceof Symbol||(fT.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof $f=="function")for(var p=0;p<s.length;p++)mT.call(t,s[p])&&n.push("["+e(s[p])+"]: "+e(t[s[p]],t));return n}o(pc,"arrObjKeys")});var ST=k((AX,PT)=>{"use strict";var kD=Ua(),ND=Cn(),hc=o(function(t,e,r){for(var n=t,i;(i=n.next)!=null;n=i)if(i.key===e)return n.next=i.next,r||(i.next=t.next,t.next=i),i},"listGetNode"),zD=o(function(t,e){if(t){var r=hc(t,e);return r&&r.value}},"listGet"),DD=o(function(t,e,r){var n=hc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),UD=o(function(t,e){return t?!!hc(t,e):!1},"listHas"),MD=o(function(t,e){if(t)return hc(t,e,!0)},"listDelete");PT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new ND("Side channel does not contain "+kD(n))},"assert"),delete:o(function(n){var i=MD(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return zD(e,n)},"get"),has:o(function(n){return UD(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),DD(e,n,i)},"set")};return r},"getSideChannelList")});var Bf=k((IX,xT)=>{"use strict";var ET=Qi(),TT=td(),jD=TT([ET("%String.prototype.indexOf%")]);xT.exports=o(function(e,r){var n=ET(e,!!r);return typeof n=="function"&&jD(e,".prototype.")>-1?TT([n]):n},"callBoundIntrinsic")});var qf=k((OX,wT)=>{"use strict";var LD=Qi(),Ma=Bf(),FD=Ua(),BD=Cn(),AT=LD("%Map%",!0),qD=Ma("Map.prototype.get",!0),VD=Ma("Map.prototype.set",!0),HD=Ma("Map.prototype.has",!0),GD=Ma("Map.prototype.delete",!0),WD=Ma("Map.prototype.size",!0);wT.exports=!!AT&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new BD("Side channel does not contain "+FD(n))},"assert"),delete:o(function(n){if(e){var i=GD(e,n);return WD(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return qD(e,n)},"get"),has:o(function(n){return e?HD(e,n):!1},"has"),set:o(function(n,i){e||(e=new AT),VD(e,n,i)},"set")};return r},"getSideChannelMap")});var RT=k(($X,IT)=>{"use strict";var ZD=Qi(),yc=Bf(),KD=Ua(),gc=qf(),JD=Cn(),_i=ZD("%WeakMap%",!0),YD=yc("WeakMap.prototype.get",!0),XD=yc("WeakMap.prototype.set",!0),QD=yc("WeakMap.prototype.has",!0),eU=yc("WeakMap.prototype.delete",!0);IT.exports=_i?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new JD("Side channel does not contain "+KD(i))},"assert"),delete:o(function(i){if(_i&&i&&(typeof i=="object"||typeof i=="function")){if(e)return eU(e,i)}else if(gc&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return _i&&i&&(typeof i=="object"||typeof i=="function")&&e?YD(e,i):r&&r.get(i)},"get"),has:o(function(i){return _i&&i&&(typeof i=="object"||typeof i=="function")&&e?QD(e,i):!!r&&r.has(i)},"has"),set:o(function(i,s){_i&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new _i),XD(e,i,s)):gc&&(r||(r=gc()),r.set(i,s))},"set")};return n},"getSideChannelWeakMap"):gc});var Vf=k((NX,OT)=>{"use strict";var tU=Cn(),rU=Ua(),nU=ST(),oU=qf(),iU=RT(),aU=iU||oU||nU;OT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new tU("Side channel does not contain "+rU(n))},"assert"),delete:o(function(n){return!!e&&e.delete(n)},"delete"),get:o(function(n){return e&&e.get(n)},"get"),has:o(function(n){return!!e&&e.has(n)},"has"),set:o(function(n,i){e||(e=aU()),e.set(n,i)},"set")};return r},"getSideChannel")});var _c=k((DX,CT)=>{"use strict";var sU=String.prototype.replace,uU=/%20/g,Hf={RFC1738:"RFC1738",RFC3986:"RFC3986"};CT.exports={default:Hf.RFC3986,formatters:{RFC1738:o(function(t){return sU.call(t,uU,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:Hf.RFC1738,RFC3986:Hf.RFC3986}});var Kf=k((MX,$T)=>{"use strict";var cU=_c(),lU=Vf(),Gf=Object.prototype.hasOwnProperty,ho=Array.isArray,vc=lU(),vi=o(function(e,r){return vc.set(e,r),e},"markOverflow"),go=o(function(e){return vc.has(e)},"isOverflow"),ja=o(function(e){return vc.get(e)},"getMaxIndex"),Zf=o(function(e,r){vc.set(e,r)},"setMaxIndex"),Lr=(function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t})(),dU=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(ho(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&(i[i.length]=n[s]);r.obj[r.prop]=i}}},"compactQueue"),La=o(function(e,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},"arrayToObject"),pU=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(ho(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return vi(La(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(go(e)){var s=ja(e)+1;e[s]=r,Zf(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!Gf.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(go(r)){for(var c=Object.keys(r),d=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},l=0;l<c.length;l++){var p=parseInt(c[l],10);d[p+1]=r[c[l]]}return vi(d,ja(r)+1)}var f=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&f.length>n.arrayLimit?vi(La(f,n),f.length-1):f}var _=e;return ho(e)&&!ho(r)&&(_=La(e,n)),ho(e)&&ho(r)?(r.forEach(function(h,g){if(Gf.call(e,g)){var y=e[g];y&&typeof y=="object"&&h&&typeof h=="object"?e[g]=t(y,h,n):e[e.length]=h}else e[g]=h}),e):Object.keys(r).reduce(function(h,g){var y=r[g];if(Gf.call(h,g)?h[g]=t(h[g],y,n):h[g]=y,go(r)&&!go(h)&&vi(h,ja(r)),go(h)){var T=parseInt(g,10);String(T)===g&&T>=0&&T>ja(h)&&Zf(h,T)}return h},_)},"merge"),fU=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),mU=o(function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},"decode"),Wf=1024,hU=o(function(e,r,n,i,s){if(e.length===0)return e;var c=e;if(typeof e=="symbol"?c=Symbol.prototype.toString.call(e):typeof e!="string"&&(c=String(e)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(g){return"%26%23"+parseInt(g.slice(2),16)+"%3B"});for(var d="",l=0;l<c.length;l+=Wf){for(var p=c.length>=Wf?c.slice(l,l+Wf):c,f=[],_=0;_<p.length;++_){var h=p.charCodeAt(_);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===cU.RFC1738&&(h===40||h===41)){f[f.length]=p.charAt(_);continue}if(h<128){f[f.length]=Lr[h];continue}if(h<2048){f[f.length]=Lr[192|h>>6]+Lr[128|h&63];continue}if(h<55296||h>=57344){f[f.length]=Lr[224|h>>12]+Lr[128|h>>6&63]+Lr[128|h&63];continue}_+=1,h=65536+((h&1023)<<10|p.charCodeAt(_)&1023),f[f.length]=Lr[240|h>>18]+Lr[128|h>>12&63]+Lr[128|h>>6&63]+Lr[128|h&63]}d+=f.join("")}return d},"encode"),gU=o(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],c=s.obj[s.prop],d=Object.keys(c),l=0;l<d.length;++l){var p=d[l],f=c[p];typeof f=="object"&&f!==null&&n.indexOf(f)===-1&&(r[r.length]={obj:c,prop:p},n[n.length]=f)}return dU(r),e},"compact"),yU=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),_U=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),vU=o(function(e,r,n,i){if(go(e)){var s=ja(e)+1;return e[s]=r,Zf(e,s),e}var c=[].concat(e,r);return c.length>n?vi(La(c,{plainObjects:i}),c.length-1):c},"combine"),bU=o(function(e,r){if(ho(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");$T.exports={arrayToObject:La,assign:fU,combine:vU,compact:gU,decode:mU,encode:hU,isBuffer:_U,isOverflow:go,isRegExp:yU,markOverflow:vi,maybeMap:bU,merge:pU}});var MT=k((LX,UT)=>{"use strict";var NT=Vf(),bc=Kf(),Fa=_c(),PU=Object.prototype.hasOwnProperty,zT={brackets:o(function(e){return e+"[]"},"brackets"),comma:"comma",indices:o(function(e,r){return e+"["+r+"]"},"indices"),repeat:o(function(e){return e},"repeat")},Fr=Array.isArray,SU=Array.prototype.push,DT=o(function(t,e){SU.apply(t,Fr(e)?e:[e])},"pushToArray"),EU=Date.prototype.toISOString,kT=Fa.default,mt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:bc.encode,encodeValuesOnly:!1,filter:void 0,format:kT,formatter:Fa.formatters[kT],indices:!1,serializeDate:o(function(e){return EU.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},TU=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),Jf={},xU=o(function t(e,r,n,i,s,c,d,l,p,f,_,h,g,y,T,P,x,N){for(var L=e,X=N,W=0,G=!1;(X=X.get(Jf))!==void 0&&!G;){var Z=X.get(e);if(W+=1,typeof Z<"u"){if(Z===W)throw new RangeError("Cyclic object value");G=!0}typeof X.get(Jf)>"u"&&(W=0)}if(typeof f=="function"?L=f(r,L):L instanceof Date?L=g(L):n==="comma"&&Fr(L)&&(L=bc.maybeMap(L,function(Be){return Be instanceof Date?g(Be):Be})),L===null){if(c)return p&&!P?p(r,mt.encoder,x,"key",y):r;L=""}if(TU(L)||bc.isBuffer(L)){if(p){var ee=P?r:p(r,mt.encoder,x,"key",y);return[T(ee)+"="+T(p(L,mt.encoder,x,"value",y))]}return[T(r)+"="+T(String(L))]}var Y=[];if(typeof L>"u")return Y;var Se;if(n==="comma"&&Fr(L))P&&p&&(L=bc.maybeMap(L,p)),Se=[{value:L.length>0?L.join(",")||null:void 0}];else if(Fr(f))Se=f;else{var te=Object.keys(L);Se=_?te.sort(_):te}var q=l?String(r).replace(/\./g,"%2E"):String(r),B=i&&Fr(L)&&L.length===1?q+"[]":q;if(s&&Fr(L)&&L.length===0)return B+"[]";for(var J=0;J<Se.length;++J){var K=Se[J],re=typeof K=="object"&&K&&typeof K.value<"u"?K.value:L[K];if(!(d&&re===null)){var oe=h&&l?String(K).replace(/\./g,"%2E"):String(K),Ae=Fr(L)?typeof n=="function"?n(B,oe):B:B+(h?"."+oe:"["+oe+"]");N.set(e,W);var Oe=NT();Oe.set(Jf,N),DT(Y,t(re,Ae,n,i,s,c,d,l,n==="comma"&&P&&Fr(L)?null:p,f,_,h,g,y,T,P,x,Oe))}}return Y},"stringify"),AU=o(function(e){if(!e)return mt;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||mt.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Fa.default;if(typeof e.format<"u"){if(!PU.call(Fa.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Fa.formatters[n],s=mt.filter;(typeof e.filter=="function"||Fr(e.filter))&&(s=e.filter);var c;if(e.arrayFormat in zT?c=e.arrayFormat:"indices"in e?c=e.indices?"indices":"repeat":c=mt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var d=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:mt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:mt.addQueryPrefix,allowDots:d,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:mt.allowEmptyArrays,arrayFormat:c,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:mt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?mt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:mt.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:mt.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:mt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:mt.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:mt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:mt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:mt.strictNullHandling}},"normalizeStringifyOptions");UT.exports=function(t,e){var r=t,n=AU(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Fr(n.filter)&&(s=n.filter,i=s);var c=[];if(typeof r!="object"||r===null)return"";var d=zT[n.arrayFormat],l=d==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var p=NT(),f=0;f<i.length;++f){var _=i[f],h=r[_];n.skipNulls&&h===null||DT(c,xU(h,_,d,l,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,p))}var g=c.join(n.delimiter),y=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),g.length>0?y+g:""}});var FT=k((BX,LT)=>{"use strict";var Br=Kf(),Pc=Object.prototype.hasOwnProperty,Yf=Array.isArray,et={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Br.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},wU=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),jT=o(function(t,e,r){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},"parseArrayValue"),IU="utf8=%26%2310003%3B",RU="utf8=%E2%9C%93",OU=o(function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,c=i.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&c.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var d=-1,l,p=r.charset;if(r.charsetSentinel)for(l=0;l<c.length;++l)c[l].indexOf("utf8=")===0&&(c[l]===RU?p="utf-8":c[l]===IU&&(p="iso-8859-1"),d=l,l=c.length);for(l=0;l<c.length;++l)if(l!==d){var f=c[l],_=f.indexOf("]="),h=_===-1?f.indexOf("="):_+1,g,y;if(h===-1?(g=r.decoder(f,et.decoder,p,"key"),y=r.strictNullHandling?null:""):(g=r.decoder(f.slice(0,h),et.decoder,p,"key"),g!==null&&(y=Br.maybeMap(jT(f.slice(h+1),r,Yf(n[g])?n[g].length:0),function(P){return r.decoder(P,et.decoder,p,"value")}))),y&&r.interpretNumericEntities&&p==="iso-8859-1"&&(y=wU(String(y))),f.indexOf("[]=")>-1&&(y=Yf(y)?[y]:y),r.comma&&Yf(y)&&y.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");y=Br.combine([],y,r.arrayLimit,r.plainObjects)}if(g!==null){var T=Pc.call(n,g);T&&(r.duplicates==="combine"||f.indexOf("[]=")>-1)?n[g]=Br.combine(n[g],y,r.arrayLimit,r.plainObjects):(!T||r.duplicates==="last")&&(n[g]=y)}}return n},"parseQueryStringValues"),CU=o(function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");i=Array.isArray(e)&&e[s]?e[s].length:0}for(var c=n?e:jT(e,r,i),d=t.length-1;d>=0;--d){var l,p=t[d];if(p==="[]"&&r.parseArrays)Br.isOverflow(c)?l=c:l=r.allowEmptyArrays&&(c===""||r.strictNullHandling&&c===null)?[]:Br.combine([],c,r.arrayLimit,r.plainObjects);else{l=r.plainObjects?{__proto__:null}:{};var f=p.charAt(0)==="["&&p.charAt(p.length-1)==="]"?p.slice(1,-1):p,_=r.decodeDotInKeys?f.replace(/%2E/g,"."):f,h=parseInt(_,10),g=!isNaN(h)&&p!==_&&String(h)===_&&h>=0&&r.parseArrays;if(!r.parseArrays&&_==="")l={0:c};else if(g&&h<r.arrayLimit)l=[],l[h]=c;else{if(g&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");g?(l[h]=c,Br.markOverflow(l,h)):_!=="__proto__"&&(l[_]=c)}}c=l}return c},"parseObject"),$U=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&Pc.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=i.exec(n),d=c?n.slice(0,c.index):n,l=[];if(d){if(!r.plainObjects&&Pc.call(Object.prototype,d)&&!r.allowPrototypes)return;l[l.length]=d}for(var p=0;(c=s.exec(n))!==null&&p<r.depth;){p+=1;var f=c[1].slice(1,-1);if(!r.plainObjects&&Pc.call(Object.prototype,f)&&!r.allowPrototypes)return;l[l.length]=c[1]}if(c){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");l[l.length]="["+n.slice(c.index)+"]"}return l},"splitKeyIntoSegments"),kU=o(function(e,r,n,i){if(e){var s=$U(e,n);if(s)return CU(s,r,n,i)}},"parseQueryStringKeys"),NU=o(function(e){if(!e)return et;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof e.charset>"u"?et.charset:e.charset,n=typeof e.duplicates>"u"?et.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var i=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:et.allowDots:!!e.allowDots;return{allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:et.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:et.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:et.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:et.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:et.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:et.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:et.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:et.decoder,delimiter:typeof e.delimiter=="string"||Br.isRegExp(e.delimiter)?e.delimiter:et.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:et.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:et.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:et.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:et.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:et.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:et.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:et.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");LT.exports=function(t,e){var r=NU(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?OU(t,r):t,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),c=0;c<s.length;++c){var d=s[c],l=kU(d,n[d],r,typeof t=="string");i=Br.merge(i,l,r)}return r.allowSparse===!0?i:Br.compact(i)}});var Xf=k((VX,BT)=>{"use strict";var zU=MT(),DU=FT(),UU=_c();BT.exports={formats:UU,parse:DU,stringify:zU}});var VT=k((Qf,qT)=>{(function(t,e){typeof Qf=="object"?qT.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(Qf,function(){function t(){}return o(t,"UrlTemplate"),t.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(r){return/%[0-9A-Fa-f]/.test(r)||(r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")),r}).join("")},t.prototype.encodeUnreserved=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})},t.prototype.encodeValue=function(e,r,n){return r=e==="+"||e==="#"?this.encodeReserved(r):this.encodeUnreserved(r),n?this.encodeUnreserved(n)+"="+r:r},t.prototype.isDefined=function(e){return e!=null},t.prototype.isKeyOperator=function(e){return e===";"||e==="&"||e==="?"},t.prototype.getValues=function(e,r,n,i){var s=e[n],c=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),i&&i!=="*"&&(s=s.substring(0,parseInt(i,10))),c.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(i==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(l){c.push(this.encodeValue(r,l,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(l){this.isDefined(s[l])&&c.push(this.encodeValue(r,s[l],l))},this);else{var d=[];Array.isArray(s)?s.filter(this.isDefined).forEach(function(l){d.push(this.encodeValue(r,l))},this):Object.keys(s).forEach(function(l){this.isDefined(s[l])&&(d.push(this.encodeUnreserved(l)),d.push(this.encodeValue(r,s[l].toString())))},this),this.isKeyOperator(r)?c.push(this.encodeUnreserved(n)+"="+d.join(",")):d.length!==0&&c.push(d.join(","))}else r===";"?this.isDefined(s)&&c.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?c.push(this.encodeUnreserved(n)+"="):s===""&&c.push("");return c},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:o(function(i){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,c,d){if(c){var l=null,p=[];if(n.indexOf(c.charAt(0))!==-1&&(l=c.charAt(0),c=c.substr(1)),c.split(/,/g).forEach(function(_){var h=/([^:\*]*)(?::(\d+)|(\*))?/.exec(_);p.push.apply(p,r.getValues(i,l,h[1],h[2]||h[3]))}),l&&l!=="+"){var f=",";return l==="?"?f="&":l!=="#"&&(f=l),(p.length!==0?l:"")+p.join(f)}else return p.join(",")}else return r.encodeReserved(d)})},"expand")}},new t})});var HT=k(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.isBrowser=MU;function MU(){return typeof window<"u"}o(MU,"isBrowser")});var Ec=k(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.headersToClassicHeaders=GT;Sc.marshallGaxiosResponse=jU;function GT(t){let e={};if(t instanceof Headers)t.forEach((r,n)=>{e[n]=r});else if(Array.isArray(t))for(let[r,n]of t)e[r]=n;else e=t||{};return e}o(GT,"headersToClassicHeaders");function jU(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:GT(t?.headers)}})}o(jU,"marshallGaxiosResponse")});var KT=k(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.sessions=void 0;Jt.request=XU;Jt.closeSession=tm;var ZT=require("http2"),LU=require("zlib"),FU=require("url"),BU=Xf(),qU=ta(),VU=require("stream"),HU=require("util"),GU=require("process"),WU=Ec(),{HTTP2_HEADER_CONTENT_ENCODING:ZU,HTTP2_HEADER_CONTENT_TYPE:WT,HTTP2_HEADER_METHOD:KU,HTTP2_HEADER_PATH:JU,HTTP2_HEADER_STATUS:YU}=ZT.constants,Ba=!!GU.env.HTTP2_DEBUG;Jt.sessions={};async function XU(t){let e=qU(!0,{},t);e.validateStatus=e.validateStatus||QU,e.responseType=e.responseType||"json";let r=new FU.URL(e.url),n=e1(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let _=(t.paramsSerializer||BU.stringify)(e.params);i+=`?${_}`}let s=(0,WU.headersToClassicHeaders)(e.headers);s[JU]=i,s[KU]=t.method||"GET",e.headers=s,s[WT]||e.responseType!=="text"&&(s[WT]="application/json");let c={config:t,headers:{},status:0,data:{},statusText:""},d=[],l=n.session,p;return new Promise((f,_)=>{try{p=l.request(s).on("response",h=>{Object.assign(c,{headers:h,status:h[YU]});let g=p;if(h[ZU]==="gzip"&&(g=p.pipe(LU.createGunzip())),e.responseType==="stream"){c.data=g,f(c);return}g.on("data",y=>{d.push(y)}).on("error",y=>{_(y)}).on("end",()=>{let y=Buffer.concat(d),T=y;if(y){if(e.responseType==="json")try{T=JSON.parse(y.toString("utf8"))}catch{T=y.toString("utf8")}else e.responseType==="text"?T=y.toString("utf8"):e.responseType==="arraybuffer"&&(T=y.buffer);c.data=T}if(!e.validateStatus(c.status)){let P=`Request failed with status code ${c.status}. `;if(c.data&&typeof c.data=="object"){let x=HU.inspect(c.data,{depth:5});P=`${P}
59
- '${x}`}_(new Error(P,{cause:c}))}f(c)})}).on("error",h=>{_(h)})}catch(h){tm(r).then(()=>_(h)).catch(_);return}if(c.request=p,t.data){if(t.data instanceof VU.Stream)t.data.pipe(p);else if(typeof t.data=="string"){let h=Buffer.from(t.data);p.end(h)}else if(typeof t.data=="object"){let h=JSON.stringify(t.data);p.end(h)}}n.timeoutHandle=setTimeout(()=>tm(r),500)})}o(XU,"request");function QU(t){return t>=200&&t<300}o(QU,"validateStatus");function e1(t){if(Jt.sessions[t])Ba&&console.log(`Used cached client for ${t}`);else{Ba&&console.log(`Creating client for ${t}`);let e=ZT.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete Jt.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete Jt.sessions[t]}),Jt.sessions[t]={session:e}}return Jt.sessions[t]}o(e1,"_getClient");async function tm(t){let e=Jt.sessions[t.host];if(!e)return;let{session:r}=e;delete Jt.sessions[t.host],Ba&&console.error(`Closing ${t.host}`),r.close(()=>{Ba&&console.error(`Closed ${t.host}`)}),setTimeout(()=>{r&&!r.destroyed&&(Ba&&console.log(`Forcing close ${t.host}`),r&&r.destroy())},1e3)}o(tm,"closeSession")});var JT=k((XX,t1)=>{t1.exports={name:"googleapis-common",version:"8.0.2",description:"A common tooling library used by the googleapis npm module. You probably don't want to use this directly.",repository:{type:"git",directory:"packages/nodejs-googleapis-common",url:"https://github.com/googleapis/google-cloud-node-core.git"},main:"build/src/index.js",types:"build/src/index.d.ts",files:["build/src","!build/src/**/*.map"],scripts:{prebenchmark:"npm run compile",benchmark:"node build/benchmark/bench.js",compile:"tsc -p .",test:"c8 mocha build/test","system-test":"c8 mocha build/system-test --timeout 600000","presystem-test":"npm run compile",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",lint:"gts check","samples-test":"mocha build/samples-test",docs:"jsdoc -c .jsdoc.js",webpack:"webpack","browser-test":"karma start",prelint:"cd samples; npm link ../; npm install",clean:"gts clean",precompile:"gts clean"},keywords:[],author:"Google LLC",license:"Apache-2.0",dependencies:{extend:"^3.0.2",gaxios:"7.1.3","google-auth-library":"10.5.0","google-logging-utils":"1.1.3",qs:"^6.7.0","url-template":"^2.0.8"},devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.8","@types/nock":"^11.0.0","@types/proxyquire":"^1.3.31","@types/qs":"^6.5.3","@types/sinon":"^21.0.0","@types/tmp":"^0.2.6","@types/url-template":"^2.0.28",c8:"^10.1.3",codecov:"^3.8.3",gts:"^6.0.2",http2spy:"^2.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.4","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.1","path-to-regexp":"^6.0.0",proxyquire:"^2.1.3",puppeteer:"^24.0.0",sinon:"21.0.3",tmp:"0.2.5","ts-loader":"^9.5.2",typescript:"5.8.3",webpack:"^5.97.1","webpack-cli":"^6.0.1"},engines:{node:">=18.0.0"},homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/nodejs-googleapis-common"}});var Tc=k(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.createAPIRequest=a1;var rm=at(),r1=Xf(),tx=require("stream"),YT=VT(),XT=ta(),om=HT(),n1=KT(),nm=Ec(),rx=JT(),QT=o(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function o1(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}o(o1,"isReadableStream");function i1(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}o(i1,"getMissingParams");function a1(t,e){if(e)ex(t).then(r=>e(null,r),e);else return ex(t)}o(a1,"createAPIRequest");async function ex(t){let e=XT(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=XT(!0,{},e.params,t.params);e.userAgentDirectives=e.userAgentDirectives||[];let n=r.media||{},i=r.requestBody;!r.requestBody&&r.resource&&(!t.requiredParams.includes("resource")||typeof r.resource!="string")&&(i=r.resource,delete r.resource),delete r.requestBody;let s=r.auth||e.auth,c=typeof n.body=="string"?"text/plain":"application/octet-stream";delete r.media,delete r.auth;let d=(0,nm.headersToClassicHeaders)(r.headers||{});s1(d,e.apiVersion),delete r.headers,Object.keys(r).forEach(g=>{if(g.slice(-1)==="_"){let y=g.slice(0,-1);r[y]=r[g],delete r[g]}});let l=i1(r,t.requiredParams);if(l)throw new Error("Missing required parameters: "+l.join(", "));if(e.url){let g=e.url;typeof g=="object"&&(g=g.toString()),e.url=YT.parse(g).expand(r)}if(t.mediaUrl&&(t.mediaUrl=YT.parse(t.mediaUrl).expand(r)),t.context._options.rootUrl!==void 0&&e.url!==void 0){let g=new URL(e.url),y=g.href.substr(g.origin.length);e.url=new URL(y,t.context._options.rootUrl).href}e.paramsSerializer=g=>r1.stringify(g,{arrayFormat:"repeat"}),t.pathParams.forEach(g=>delete r[g]),typeof s=="string"&&(r.key=r.key||s,s=void 0);function p(g){let y=QT(),T=`--${y}--`,P=new tx.PassThrough({flush(L){this.push(`\r
60
- `),this.push(T),L()}}),x=new im,N=o1(g[1].body);d["content-type"]=`multipart/related; boundary=${y}`;for(let L of g){let X=`--${y}\r
58
+ `+e.prev}o(Mf,"indentedJoin");function pc(t,e){var r=Uf(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=cn(t,i)?e(t[i],t):""}var s=typeof $f=="function"?$f(t):[],c;if(yi){c={};for(var d=0;d<s.length;d++)c["$"+s[d]]=s[d]}for(var l in t)cn(t,l)&&(r&&String(Number(l))===l&&l<t.length||yi&&c["$"+l]instanceof Symbol||(mT.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof $f=="function")for(var p=0;p<s.length;p++)hT.call(t,s[p])&&n.push("["+e(s[p])+"]: "+e(t[s[p]],t));return n}o(pc,"arrObjKeys")});var ET=k((OX,ST)=>{"use strict";var zD=Ua(),DD=Cn(),hc=o(function(t,e,r){for(var n=t,i;(i=n.next)!=null;n=i)if(i.key===e)return n.next=i.next,r||(i.next=t.next,t.next=i),i},"listGetNode"),UD=o(function(t,e){if(t){var r=hc(t,e);return r&&r.value}},"listGet"),MD=o(function(t,e,r){var n=hc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),jD=o(function(t,e){return t?!!hc(t,e):!1},"listHas"),LD=o(function(t,e){if(t)return hc(t,e,!0)},"listDelete");ST.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new DD("Side channel does not contain "+zD(n))},"assert"),delete:o(function(n){var i=LD(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return UD(e,n)},"get"),has:o(function(n){return jD(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),MD(e,n,i)},"set")};return r},"getSideChannelList")});var Bf=k(($X,AT)=>{"use strict";var TT=Qi(),xT=td(),FD=xT([TT("%String.prototype.indexOf%")]);AT.exports=o(function(e,r){var n=TT(e,!!r);return typeof n=="function"&&FD(e,".prototype.")>-1?xT([n]):n},"callBoundIntrinsic")});var qf=k((NX,IT)=>{"use strict";var BD=Qi(),Ma=Bf(),qD=Ua(),VD=Cn(),wT=BD("%Map%",!0),HD=Ma("Map.prototype.get",!0),GD=Ma("Map.prototype.set",!0),WD=Ma("Map.prototype.has",!0),ZD=Ma("Map.prototype.delete",!0),KD=Ma("Map.prototype.size",!0);IT.exports=!!wT&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new VD("Side channel does not contain "+qD(n))},"assert"),delete:o(function(n){if(e){var i=ZD(e,n);return KD(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return HD(e,n)},"get"),has:o(function(n){return e?WD(e,n):!1},"has"),set:o(function(n,i){e||(e=new wT),GD(e,n,i)},"set")};return r},"getSideChannelMap")});var OT=k((DX,RT)=>{"use strict";var JD=Qi(),yc=Bf(),YD=Ua(),gc=qf(),XD=Cn(),_i=JD("%WeakMap%",!0),QD=yc("WeakMap.prototype.get",!0),eU=yc("WeakMap.prototype.set",!0),tU=yc("WeakMap.prototype.has",!0),rU=yc("WeakMap.prototype.delete",!0);RT.exports=_i?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new XD("Side channel does not contain "+YD(i))},"assert"),delete:o(function(i){if(_i&&i&&(typeof i=="object"||typeof i=="function")){if(e)return rU(e,i)}else if(gc&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return _i&&i&&(typeof i=="object"||typeof i=="function")&&e?QD(e,i):r&&r.get(i)},"get"),has:o(function(i){return _i&&i&&(typeof i=="object"||typeof i=="function")&&e?tU(e,i):!!r&&r.has(i)},"has"),set:o(function(i,s){_i&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new _i),eU(e,i,s)):gc&&(r||(r=gc()),r.set(i,s))},"set")};return n},"getSideChannelWeakMap"):gc});var Vf=k((MX,CT)=>{"use strict";var nU=Cn(),oU=Ua(),iU=ET(),aU=qf(),sU=OT(),uU=sU||aU||iU;CT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new nU("Side channel does not contain "+oU(n))},"assert"),delete:o(function(n){return!!e&&e.delete(n)},"delete"),get:o(function(n){return e&&e.get(n)},"get"),has:o(function(n){return!!e&&e.has(n)},"has"),set:o(function(n,i){e||(e=uU()),e.set(n,i)},"set")};return r},"getSideChannel")});var _c=k((LX,$T)=>{"use strict";var cU=String.prototype.replace,lU=/%20/g,Hf={RFC1738:"RFC1738",RFC3986:"RFC3986"};$T.exports={default:Hf.RFC3986,formatters:{RFC1738:o(function(t){return cU.call(t,lU,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:Hf.RFC1738,RFC3986:Hf.RFC3986}});var Kf=k((BX,kT)=>{"use strict";var dU=_c(),pU=Vf(),Gf=Object.prototype.hasOwnProperty,ho=Array.isArray,vc=pU(),vi=o(function(e,r){return vc.set(e,r),e},"markOverflow"),go=o(function(e){return vc.has(e)},"isOverflow"),ja=o(function(e){return vc.get(e)},"getMaxIndex"),Zf=o(function(e,r){vc.set(e,r)},"setMaxIndex"),Lr=(function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t})(),fU=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(ho(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&(i[i.length]=n[s]);r.obj[r.prop]=i}}},"compactQueue"),La=o(function(e,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},"arrayToObject"),mU=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(ho(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return vi(La(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(go(e)){var s=ja(e)+1;e[s]=r,Zf(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!Gf.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(go(r)){for(var c=Object.keys(r),d=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},l=0;l<c.length;l++){var p=parseInt(c[l],10);d[p+1]=r[c[l]]}return vi(d,ja(r)+1)}var f=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&f.length>n.arrayLimit?vi(La(f,n),f.length-1):f}var _=e;return ho(e)&&!ho(r)&&(_=La(e,n)),ho(e)&&ho(r)?(r.forEach(function(h,g){if(Gf.call(e,g)){var y=e[g];y&&typeof y=="object"&&h&&typeof h=="object"?e[g]=t(y,h,n):e[e.length]=h}else e[g]=h}),e):Object.keys(r).reduce(function(h,g){var y=r[g];if(Gf.call(h,g)?h[g]=t(h[g],y,n):h[g]=y,go(r)&&!go(h)&&vi(h,ja(r)),go(h)){var T=parseInt(g,10);String(T)===g&&T>=0&&T>ja(h)&&Zf(h,T)}return h},_)},"merge"),hU=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),gU=o(function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},"decode"),Wf=1024,yU=o(function(e,r,n,i,s){if(e.length===0)return e;var c=e;if(typeof e=="symbol"?c=Symbol.prototype.toString.call(e):typeof e!="string"&&(c=String(e)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(g){return"%26%23"+parseInt(g.slice(2),16)+"%3B"});for(var d="",l=0;l<c.length;l+=Wf){for(var p=c.length>=Wf?c.slice(l,l+Wf):c,f=[],_=0;_<p.length;++_){var h=p.charCodeAt(_);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===dU.RFC1738&&(h===40||h===41)){f[f.length]=p.charAt(_);continue}if(h<128){f[f.length]=Lr[h];continue}if(h<2048){f[f.length]=Lr[192|h>>6]+Lr[128|h&63];continue}if(h<55296||h>=57344){f[f.length]=Lr[224|h>>12]+Lr[128|h>>6&63]+Lr[128|h&63];continue}_+=1,h=65536+((h&1023)<<10|p.charCodeAt(_)&1023),f[f.length]=Lr[240|h>>18]+Lr[128|h>>12&63]+Lr[128|h>>6&63]+Lr[128|h&63]}d+=f.join("")}return d},"encode"),_U=o(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],c=s.obj[s.prop],d=Object.keys(c),l=0;l<d.length;++l){var p=d[l],f=c[p];typeof f=="object"&&f!==null&&n.indexOf(f)===-1&&(r[r.length]={obj:c,prop:p},n[n.length]=f)}return fU(r),e},"compact"),vU=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),bU=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),PU=o(function(e,r,n,i){if(go(e)){var s=ja(e)+1;return e[s]=r,Zf(e,s),e}var c=[].concat(e,r);return c.length>n?vi(La(c,{plainObjects:i}),c.length-1):c},"combine"),SU=o(function(e,r){if(ho(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");kT.exports={arrayToObject:La,assign:hU,combine:PU,compact:_U,decode:gU,encode:yU,isBuffer:bU,isOverflow:go,isRegExp:vU,markOverflow:vi,maybeMap:SU,merge:mU}});var jT=k((VX,MT)=>{"use strict";var zT=Vf(),bc=Kf(),Fa=_c(),EU=Object.prototype.hasOwnProperty,DT={brackets:o(function(e){return e+"[]"},"brackets"),comma:"comma",indices:o(function(e,r){return e+"["+r+"]"},"indices"),repeat:o(function(e){return e},"repeat")},Fr=Array.isArray,TU=Array.prototype.push,UT=o(function(t,e){TU.apply(t,Fr(e)?e:[e])},"pushToArray"),xU=Date.prototype.toISOString,NT=Fa.default,mt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:bc.encode,encodeValuesOnly:!1,filter:void 0,format:NT,formatter:Fa.formatters[NT],indices:!1,serializeDate:o(function(e){return xU.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},AU=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),Jf={},wU=o(function t(e,r,n,i,s,c,d,l,p,f,_,h,g,y,T,P,x,N){for(var L=e,X=N,W=0,G=!1;(X=X.get(Jf))!==void 0&&!G;){var Z=X.get(e);if(W+=1,typeof Z<"u"){if(Z===W)throw new RangeError("Cyclic object value");G=!0}typeof X.get(Jf)>"u"&&(W=0)}if(typeof f=="function"?L=f(r,L):L instanceof Date?L=g(L):n==="comma"&&Fr(L)&&(L=bc.maybeMap(L,function(Be){return Be instanceof Date?g(Be):Be})),L===null){if(c)return p&&!P?p(r,mt.encoder,x,"key",y):r;L=""}if(AU(L)||bc.isBuffer(L)){if(p){var ee=P?r:p(r,mt.encoder,x,"key",y);return[T(ee)+"="+T(p(L,mt.encoder,x,"value",y))]}return[T(r)+"="+T(String(L))]}var Y=[];if(typeof L>"u")return Y;var Se;if(n==="comma"&&Fr(L))P&&p&&(L=bc.maybeMap(L,p)),Se=[{value:L.length>0?L.join(",")||null:void 0}];else if(Fr(f))Se=f;else{var te=Object.keys(L);Se=_?te.sort(_):te}var q=l?String(r).replace(/\./g,"%2E"):String(r),B=i&&Fr(L)&&L.length===1?q+"[]":q;if(s&&Fr(L)&&L.length===0)return B+"[]";for(var J=0;J<Se.length;++J){var K=Se[J],re=typeof K=="object"&&K&&typeof K.value<"u"?K.value:L[K];if(!(d&&re===null)){var oe=h&&l?String(K).replace(/\./g,"%2E"):String(K),Ae=Fr(L)?typeof n=="function"?n(B,oe):B:B+(h?"."+oe:"["+oe+"]");N.set(e,W);var Oe=zT();Oe.set(Jf,N),UT(Y,t(re,Ae,n,i,s,c,d,l,n==="comma"&&P&&Fr(L)?null:p,f,_,h,g,y,T,P,x,Oe))}}return Y},"stringify"),IU=o(function(e){if(!e)return mt;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||mt.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Fa.default;if(typeof e.format<"u"){if(!EU.call(Fa.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Fa.formatters[n],s=mt.filter;(typeof e.filter=="function"||Fr(e.filter))&&(s=e.filter);var c;if(e.arrayFormat in DT?c=e.arrayFormat:"indices"in e?c=e.indices?"indices":"repeat":c=mt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var d=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:mt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:mt.addQueryPrefix,allowDots:d,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:mt.allowEmptyArrays,arrayFormat:c,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:mt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?mt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:mt.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:mt.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:mt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:mt.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:mt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:mt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:mt.strictNullHandling}},"normalizeStringifyOptions");MT.exports=function(t,e){var r=t,n=IU(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Fr(n.filter)&&(s=n.filter,i=s);var c=[];if(typeof r!="object"||r===null)return"";var d=DT[n.arrayFormat],l=d==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var p=zT(),f=0;f<i.length;++f){var _=i[f],h=r[_];n.skipNulls&&h===null||UT(c,wU(h,_,d,l,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,p))}var g=c.join(n.delimiter),y=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),g.length>0?y+g:""}});var BT=k((GX,FT)=>{"use strict";var Br=Kf(),Pc=Object.prototype.hasOwnProperty,Yf=Array.isArray,et={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Br.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},RU=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),LT=o(function(t,e,r){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},"parseArrayValue"),OU="utf8=%26%2310003%3B",CU="utf8=%E2%9C%93",$U=o(function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,c=i.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&c.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var d=-1,l,p=r.charset;if(r.charsetSentinel)for(l=0;l<c.length;++l)c[l].indexOf("utf8=")===0&&(c[l]===CU?p="utf-8":c[l]===OU&&(p="iso-8859-1"),d=l,l=c.length);for(l=0;l<c.length;++l)if(l!==d){var f=c[l],_=f.indexOf("]="),h=_===-1?f.indexOf("="):_+1,g,y;if(h===-1?(g=r.decoder(f,et.decoder,p,"key"),y=r.strictNullHandling?null:""):(g=r.decoder(f.slice(0,h),et.decoder,p,"key"),g!==null&&(y=Br.maybeMap(LT(f.slice(h+1),r,Yf(n[g])?n[g].length:0),function(P){return r.decoder(P,et.decoder,p,"value")}))),y&&r.interpretNumericEntities&&p==="iso-8859-1"&&(y=RU(String(y))),f.indexOf("[]=")>-1&&(y=Yf(y)?[y]:y),r.comma&&Yf(y)&&y.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");y=Br.combine([],y,r.arrayLimit,r.plainObjects)}if(g!==null){var T=Pc.call(n,g);T&&(r.duplicates==="combine"||f.indexOf("[]=")>-1)?n[g]=Br.combine(n[g],y,r.arrayLimit,r.plainObjects):(!T||r.duplicates==="last")&&(n[g]=y)}}return n},"parseQueryStringValues"),kU=o(function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");i=Array.isArray(e)&&e[s]?e[s].length:0}for(var c=n?e:LT(e,r,i),d=t.length-1;d>=0;--d){var l,p=t[d];if(p==="[]"&&r.parseArrays)Br.isOverflow(c)?l=c:l=r.allowEmptyArrays&&(c===""||r.strictNullHandling&&c===null)?[]:Br.combine([],c,r.arrayLimit,r.plainObjects);else{l=r.plainObjects?{__proto__:null}:{};var f=p.charAt(0)==="["&&p.charAt(p.length-1)==="]"?p.slice(1,-1):p,_=r.decodeDotInKeys?f.replace(/%2E/g,"."):f,h=parseInt(_,10),g=!isNaN(h)&&p!==_&&String(h)===_&&h>=0&&r.parseArrays;if(!r.parseArrays&&_==="")l={0:c};else if(g&&h<r.arrayLimit)l=[],l[h]=c;else{if(g&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");g?(l[h]=c,Br.markOverflow(l,h)):_!=="__proto__"&&(l[_]=c)}}c=l}return c},"parseObject"),NU=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&Pc.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=i.exec(n),d=c?n.slice(0,c.index):n,l=[];if(d){if(!r.plainObjects&&Pc.call(Object.prototype,d)&&!r.allowPrototypes)return;l[l.length]=d}for(var p=0;(c=s.exec(n))!==null&&p<r.depth;){p+=1;var f=c[1].slice(1,-1);if(!r.plainObjects&&Pc.call(Object.prototype,f)&&!r.allowPrototypes)return;l[l.length]=c[1]}if(c){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");l[l.length]="["+n.slice(c.index)+"]"}return l},"splitKeyIntoSegments"),zU=o(function(e,r,n,i){if(e){var s=NU(e,n);if(s)return kU(s,r,n,i)}},"parseQueryStringKeys"),DU=o(function(e){if(!e)return et;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof e.charset>"u"?et.charset:e.charset,n=typeof e.duplicates>"u"?et.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var i=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:et.allowDots:!!e.allowDots;return{allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:et.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:et.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:et.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:et.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:et.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:et.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:et.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:et.decoder,delimiter:typeof e.delimiter=="string"||Br.isRegExp(e.delimiter)?e.delimiter:et.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:et.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:et.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:et.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:et.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:et.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:et.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:et.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");FT.exports=function(t,e){var r=DU(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?$U(t,r):t,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),c=0;c<s.length;++c){var d=s[c],l=zU(d,n[d],r,typeof t=="string");i=Br.merge(i,l,r)}return r.allowSparse===!0?i:Br.compact(i)}});var Xf=k((ZX,qT)=>{"use strict";var UU=jT(),MU=BT(),jU=_c();qT.exports={formats:jU,parse:MU,stringify:UU}});var HT=k((Qf,VT)=>{(function(t,e){typeof Qf=="object"?VT.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(Qf,function(){function t(){}return o(t,"UrlTemplate"),t.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(r){return/%[0-9A-Fa-f]/.test(r)||(r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")),r}).join("")},t.prototype.encodeUnreserved=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})},t.prototype.encodeValue=function(e,r,n){return r=e==="+"||e==="#"?this.encodeReserved(r):this.encodeUnreserved(r),n?this.encodeUnreserved(n)+"="+r:r},t.prototype.isDefined=function(e){return e!=null},t.prototype.isKeyOperator=function(e){return e===";"||e==="&"||e==="?"},t.prototype.getValues=function(e,r,n,i){var s=e[n],c=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),i&&i!=="*"&&(s=s.substring(0,parseInt(i,10))),c.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(i==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(l){c.push(this.encodeValue(r,l,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(l){this.isDefined(s[l])&&c.push(this.encodeValue(r,s[l],l))},this);else{var d=[];Array.isArray(s)?s.filter(this.isDefined).forEach(function(l){d.push(this.encodeValue(r,l))},this):Object.keys(s).forEach(function(l){this.isDefined(s[l])&&(d.push(this.encodeUnreserved(l)),d.push(this.encodeValue(r,s[l].toString())))},this),this.isKeyOperator(r)?c.push(this.encodeUnreserved(n)+"="+d.join(",")):d.length!==0&&c.push(d.join(","))}else r===";"?this.isDefined(s)&&c.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?c.push(this.encodeUnreserved(n)+"="):s===""&&c.push("");return c},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:o(function(i){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,c,d){if(c){var l=null,p=[];if(n.indexOf(c.charAt(0))!==-1&&(l=c.charAt(0),c=c.substr(1)),c.split(/,/g).forEach(function(_){var h=/([^:\*]*)(?::(\d+)|(\*))?/.exec(_);p.push.apply(p,r.getValues(i,l,h[1],h[2]||h[3]))}),l&&l!=="+"){var f=",";return l==="?"?f="&":l!=="#"&&(f=l),(p.length!==0?l:"")+p.join(f)}else return p.join(",")}else return r.encodeReserved(d)})},"expand")}},new t})});var GT=k(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.isBrowser=LU;function LU(){return typeof window<"u"}o(LU,"isBrowser")});var Ec=k(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.headersToClassicHeaders=WT;Sc.marshallGaxiosResponse=FU;function WT(t){let e={};if(t instanceof Headers)t.forEach((r,n)=>{e[n]=r});else if(Array.isArray(t))for(let[r,n]of t)e[r]=n;else e=t||{};return e}o(WT,"headersToClassicHeaders");function FU(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:WT(t?.headers)}})}o(FU,"marshallGaxiosResponse")});var JT=k(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.sessions=void 0;Jt.request=e1;Jt.closeSession=tm;var KT=require("http2"),BU=require("zlib"),qU=require("url"),VU=Xf(),HU=ta(),GU=require("stream"),WU=require("util"),ZU=require("process"),KU=Ec(),{HTTP2_HEADER_CONTENT_ENCODING:JU,HTTP2_HEADER_CONTENT_TYPE:ZT,HTTP2_HEADER_METHOD:YU,HTTP2_HEADER_PATH:XU,HTTP2_HEADER_STATUS:QU}=KT.constants,Ba=!!ZU.env.HTTP2_DEBUG;Jt.sessions={};async function e1(t){let e=HU(!0,{},t);e.validateStatus=e.validateStatus||t1,e.responseType=e.responseType||"json";let r=new qU.URL(e.url),n=r1(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let _=(t.paramsSerializer||VU.stringify)(e.params);i+=`?${_}`}let s=(0,KU.headersToClassicHeaders)(e.headers);s[XU]=i,s[YU]=t.method||"GET",e.headers=s,s[ZT]||e.responseType!=="text"&&(s[ZT]="application/json");let c={config:t,headers:{},status:0,data:{},statusText:""},d=[],l=n.session,p;return new Promise((f,_)=>{try{p=l.request(s).on("response",h=>{Object.assign(c,{headers:h,status:h[QU]});let g=p;if(h[JU]==="gzip"&&(g=p.pipe(BU.createGunzip())),e.responseType==="stream"){c.data=g,f(c);return}g.on("data",y=>{d.push(y)}).on("error",y=>{_(y)}).on("end",()=>{let y=Buffer.concat(d),T=y;if(y){if(e.responseType==="json")try{T=JSON.parse(y.toString("utf8"))}catch{T=y.toString("utf8")}else e.responseType==="text"?T=y.toString("utf8"):e.responseType==="arraybuffer"&&(T=y.buffer);c.data=T}if(!e.validateStatus(c.status)){let P=`Request failed with status code ${c.status}. `;if(c.data&&typeof c.data=="object"){let x=WU.inspect(c.data,{depth:5});P=`${P}
59
+ '${x}`}_(new Error(P,{cause:c}))}f(c)})}).on("error",h=>{_(h)})}catch(h){tm(r).then(()=>_(h)).catch(_);return}if(c.request=p,t.data){if(t.data instanceof GU.Stream)t.data.pipe(p);else if(typeof t.data=="string"){let h=Buffer.from(t.data);p.end(h)}else if(typeof t.data=="object"){let h=JSON.stringify(t.data);p.end(h)}}n.timeoutHandle=setTimeout(()=>tm(r),500)})}o(e1,"request");function t1(t){return t>=200&&t<300}o(t1,"validateStatus");function r1(t){if(Jt.sessions[t])Ba&&console.log(`Used cached client for ${t}`);else{Ba&&console.log(`Creating client for ${t}`);let e=KT.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete Jt.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete Jt.sessions[t]}),Jt.sessions[t]={session:e}}return Jt.sessions[t]}o(r1,"_getClient");async function tm(t){let e=Jt.sessions[t.host];if(!e)return;let{session:r}=e;delete Jt.sessions[t.host],Ba&&console.error(`Closing ${t.host}`),r.close(()=>{Ba&&console.error(`Closed ${t.host}`)}),setTimeout(()=>{r&&!r.destroyed&&(Ba&&console.log(`Forcing close ${t.host}`),r&&r.destroy())},1e3)}o(tm,"closeSession")});var YT=k((r7,n1)=>{n1.exports={name:"googleapis-common",version:"8.0.2",description:"A common tooling library used by the googleapis npm module. You probably don't want to use this directly.",repository:{type:"git",directory:"packages/nodejs-googleapis-common",url:"https://github.com/googleapis/google-cloud-node-core.git"},main:"build/src/index.js",types:"build/src/index.d.ts",files:["build/src","!build/src/**/*.map"],scripts:{prebenchmark:"npm run compile",benchmark:"node build/benchmark/bench.js",compile:"tsc -p .",test:"c8 mocha build/test","system-test":"c8 mocha build/system-test --timeout 600000","presystem-test":"npm run compile",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",lint:"gts check","samples-test":"mocha build/samples-test",docs:"jsdoc -c .jsdoc.js",webpack:"webpack","browser-test":"karma start",prelint:"cd samples; npm link ../; npm install",clean:"gts clean",precompile:"gts clean"},keywords:[],author:"Google LLC",license:"Apache-2.0",dependencies:{extend:"^3.0.2",gaxios:"7.1.3","google-auth-library":"10.5.0","google-logging-utils":"1.1.3",qs:"^6.7.0","url-template":"^2.0.8"},devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.8","@types/nock":"^11.0.0","@types/proxyquire":"^1.3.31","@types/qs":"^6.5.3","@types/sinon":"^21.0.0","@types/tmp":"^0.2.6","@types/url-template":"^2.0.28",c8:"^10.1.3",codecov:"^3.8.3",gts:"^6.0.2",http2spy:"^2.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.4","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.1","path-to-regexp":"^6.0.0",proxyquire:"^2.1.3",puppeteer:"^24.0.0",sinon:"21.0.3",tmp:"0.2.5","ts-loader":"^9.5.2",typescript:"5.8.3",webpack:"^5.97.1","webpack-cli":"^6.0.1"},engines:{node:">=18.0.0"},homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/nodejs-googleapis-common"}});var Tc=k(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.createAPIRequest=u1;var rm=st(),o1=Xf(),rx=require("stream"),XT=HT(),QT=ta(),om=GT(),i1=JT(),nm=Ec(),nx=YT(),ex=o(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function a1(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}o(a1,"isReadableStream");function s1(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}o(s1,"getMissingParams");function u1(t,e){if(e)tx(t).then(r=>e(null,r),e);else return tx(t)}o(u1,"createAPIRequest");async function tx(t){let e=QT(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=QT(!0,{},e.params,t.params);e.userAgentDirectives=e.userAgentDirectives||[];let n=r.media||{},i=r.requestBody;!r.requestBody&&r.resource&&(!t.requiredParams.includes("resource")||typeof r.resource!="string")&&(i=r.resource,delete r.resource),delete r.requestBody;let s=r.auth||e.auth,c=typeof n.body=="string"?"text/plain":"application/octet-stream";delete r.media,delete r.auth;let d=(0,nm.headersToClassicHeaders)(r.headers||{});c1(d,e.apiVersion),delete r.headers,Object.keys(r).forEach(g=>{if(g.slice(-1)==="_"){let y=g.slice(0,-1);r[y]=r[g],delete r[g]}});let l=s1(r,t.requiredParams);if(l)throw new Error("Missing required parameters: "+l.join(", "));if(e.url){let g=e.url;typeof g=="object"&&(g=g.toString()),e.url=XT.parse(g).expand(r)}if(t.mediaUrl&&(t.mediaUrl=XT.parse(t.mediaUrl).expand(r)),t.context._options.rootUrl!==void 0&&e.url!==void 0){let g=new URL(e.url),y=g.href.substr(g.origin.length);e.url=new URL(y,t.context._options.rootUrl).href}e.paramsSerializer=g=>o1.stringify(g,{arrayFormat:"repeat"}),t.pathParams.forEach(g=>delete r[g]),typeof s=="string"&&(r.key=r.key||s,s=void 0);function p(g){let y=ex(),T=`--${y}--`,P=new rx.PassThrough({flush(L){this.push(`\r
60
+ `),this.push(T),L()}}),x=new im,N=a1(g[1].body);d["content-type"]=`multipart/related; boundary=${y}`;for(let L of g){let X=`--${y}\r
61
61
  content-type: ${L["content-type"]}\r
62
62
  \r
63
63
  `;P.push(X),typeof L.body=="string"?(P.push(L.body),P.push(`\r
64
- `)):(x.on("progress",W=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:W})}),L.body.pipe(x).pipe(P))}N||(P.push(T),P.push(null)),e.data=P}o(p,"multipartUpload");function f(g){let y=QT(),T=`--${y}--`;d["content-type"]=`multipart/related; boundary=${y}`;let P="";for(let x of g){let N=`--${y}\r
64
+ `)):(x.on("progress",W=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:W})}),L.body.pipe(x).pipe(P))}N||(P.push(T),P.push(null)),e.data=P}o(p,"multipartUpload");function f(g){let y=ex(),T=`--${y}--`;d["content-type"]=`multipart/related; boundary=${y}`;let P="";for(let x of g){let N=`--${y}\r
65
65
  content-type: ${x["content-type"]}\r
66
66
  \r
67
67
  `;P+=N,typeof x.body=="string"&&(P+=x.body,P+=`\r
68
- `)}P+=T,e.data=P}if(o(f,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,i){r.uploadType="multipart";let g=[{"content-type":"application/json",body:JSON.stringify(i)},{"content-type":n.mimeType||i&&i.mimeType||c,body:n.body}];(0,om.isBrowser)()?f(g):p(g)}else r.uploadType="media",Object.assign(d,{"content-type":n.mimeType||c}),e.data=n.body;else e.data=i||void 0;if(e.headers=rm.Gaxios.mergeHeaders(e.headers||{},d),e.params=r,!(0,om.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:rx.version,comment:"gzip"});let g=e.userAgentDirectives.map(y=>{let T=`${y.product}/${y.version}`;return y.comment&&(T+=` (${y.comment})`),T}).join(" ");e.headers.set("User-Agent",g)}if(e.validateStatus||(e.validateStatus=g=>g>=200&&g<300||g===304),e.retry=e.retry===void 0?!0:e.retry,delete e.auth,e.universeDomain&&e.universe_domain&&e.universeDomain!==e.universe_domain)throw new Error("Please set either universe_domain or universeDomain, but not both.");let _=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,h=e.universeDomain??e.universe_domain??_??"googleapis.com";if(h!=="googleapis.com"&&e.url){let g=new URL(e.url);g.hostname.endsWith(".googleapis.com")&&(g.hostname=g.hostname.replace(/googleapis\.com$/,h),e.url=g.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let g=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(g&&h!==g)throw new Error(`The configured universe domain (${h}) does not match the universe domain found in the credentials (${g}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let y=await s.getRequestHeaders(e.url),T=Object.assign({},e);return T.headers=rm.Gaxios.mergeHeaders(T.headers,y),n1.request(T)}else{let y=await s.request(e);return(0,nm.marshallGaxiosResponse)(y)}}else return new rm.Gaxios().request(e).then(g=>(0,nm.marshallGaxiosResponse)(g))}o(ex,"createAPIRequestAsync");var im=class extends tx.Transform{static{o(this,"ProgressStream")}bytesRead=0;_transform(e,r,n){this.bytesRead+=e.length,this.emit("progress",this.bytesRead),this.push(e),n()}};function s1(t,e){(0,om.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${rx.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o(s1,"populateAPIHeader")});var nx=k(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.AuthPlus=void 0;var ln=$a(),sm=class extends ln.GoogleAuth{static{o(this,"AuthPlus")}JWT=ln.JWT;Compute=ln.Compute;OAuth2=ln.OAuth2Client;GoogleAuth=ln.GoogleAuth;AwsClient=ln.AwsClient;IdentityPoolClient=ln.IdentityPoolClient;ExternalAccountClient=ln.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new ln.GoogleAuth(e),this._cachedAuth.getClient()}getProjectId(e){return e?this._cachedAuth?this._cachedAuth.getProjectId(e):super.getProjectId(e):this._cachedAuth?this._cachedAuth.getProjectId():super.getProjectId()}};xc.AuthPlus=sm});var cm=k(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.Endpoint=void 0;var ox=Tc(),um=class{static{o(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,i){if(this.applyMethodsFromSchema(e,r,n,i),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let c=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,c,i)}}}applyMethodsFromSchema(e,r,n,i){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let c=n.methods[s];e[s]=this.makeMethod(r,c,i)}}}makeMethod(e,r,n){return(i,s)=>{let c=typeof i=="function"?{}:i;s=typeof i=="function"?i:s;let d=ix(e.rootUrl+e.servicePath+r.path),l={options:{url:d.substring(1,d.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:c,requiredParams:r.parameterOrder||[],pathParams:this.getPathParams(r.parameters),context:n};if(r.mediaUpload&&r.mediaUpload.protocols&&r.mediaUpload.protocols.simple&&r.mediaUpload.protocols.simple.path){let p=ix(e.rootUrl+r.mediaUpload.protocols.simple.path);l.mediaUrl=p.substring(1,p.length-1)}if(!s)return(0,ox.createAPIRequest)(l);(0,ox.createAPIRequest)(l,s)}}getPathParams(e){let r=new Array;return typeof e!="object"&&(e={}),Object.keys(e).forEach(n=>{e[n].location==="path"&&r.push(n)}),r}};Ac.Endpoint=um;function ix(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(ix,"buildurl")});var sx=k(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.Discovery=void 0;var u1=require("fs"),c1=at(),l1=require("url"),ax=require("util"),d1=Tc(),p1=cm(),f1=ax.promisify(u1.readFile),lm=class{static{o(this,"Discovery")}transporter=new c1.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new p1.Endpoint(r);return n.applySchema(n,e,e,n),n}}log(...e){this.options&&this.options.debug&&console.log(...e)}async discoverAllAPIs(e){let r=new Headers(this.options.includePrivate?{}:{"X-User-Ip":"0.0.0.0"}),i=(await this.transporter.request({url:e,headers:r})).data.items,s=await Promise.all(i.map(async l=>{let p=await this.discoverAPI(l.discoveryRestUrl);return{api:l,endpointCreator:p}})),c={},d={};for(let l of s)d[l.api.name]||(c[l.api.name]={},d[l.api.name]=p=>{let f=typeof p,_;if(f==="string")_=p,p={};else if(f==="object")_=p.version,delete p.version;else throw new Error("Argument error: Accepts only string or object");try{let h=l.endpointCreator(p,this);return Object.freeze(h)}catch(h){throw new Error(ax.format('Unable to load endpoint %s("%s"): %s',l.api.name,_,h.message))}}),c[l.api.name][l.api.version]=l.endpointCreator;return d}async discoverAPI(e){if(typeof e=="string"){let r=l1.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await f1(e,{encoding:"utf8"});return this.makeEndpoint(JSON.parse(n))}else{this.log("Requesting "+e);let n=await this.transporter.request({url:e});return this.makeEndpoint(n.data)}}else{let r=e;this.log("Requesting "+r.url);let n=r.url;delete r.url;let i={options:{url:n,method:"GET"},requiredParams:[],pathParams:[],params:r,context:{google:{_options:{}},_options:{}}},s=await(0,d1.createAPIRequest)(i);return this.makeEndpoint(s.data)}}};wc.Discovery=lm});var Ic=k(xe=>{"use strict";var m1=xe&&xe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),h1=xe&&xe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&m1(e,t,r)};Object.defineProperty(xe,"__esModule",{value:!0});xe.Endpoint=xe.Discovery=xe.AuthPlus=xe.createAPIRequest=xe.getAPI=xe.GaxiosError=xe.Gaxios=xe.AwsClient=xe.IdentityPoolClient=xe.BaseExternalAccountClient=xe.ExternalAccountClient=xe.GoogleAuth=xe.UserRefreshClient=xe.Compute=xe.JWT=xe.OAuth2Client=xe.gaxios=xe.googleAuthLibrary=void 0;xe.googleAuthLibrary=$a();xe.gaxios=at();var dn=$a();Object.defineProperty(xe,"OAuth2Client",{enumerable:!0,get:o(function(){return dn.OAuth2Client},"get")});Object.defineProperty(xe,"JWT",{enumerable:!0,get:o(function(){return dn.JWT},"get")});Object.defineProperty(xe,"Compute",{enumerable:!0,get:o(function(){return dn.Compute},"get")});Object.defineProperty(xe,"UserRefreshClient",{enumerable:!0,get:o(function(){return dn.UserRefreshClient},"get")});Object.defineProperty(xe,"GoogleAuth",{enumerable:!0,get:o(function(){return dn.GoogleAuth},"get")});Object.defineProperty(xe,"ExternalAccountClient",{enumerable:!0,get:o(function(){return dn.ExternalAccountClient},"get")});Object.defineProperty(xe,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return dn.BaseExternalAccountClient},"get")});Object.defineProperty(xe,"IdentityPoolClient",{enumerable:!0,get:o(function(){return dn.IdentityPoolClient},"get")});Object.defineProperty(xe,"AwsClient",{enumerable:!0,get:o(function(){return dn.AwsClient},"get")});var ux=at();Object.defineProperty(xe,"Gaxios",{enumerable:!0,get:o(function(){return ux.Gaxios},"get")});Object.defineProperty(xe,"GaxiosError",{enumerable:!0,get:o(function(){return ux.GaxiosError},"get")});var g1=XE();Object.defineProperty(xe,"getAPI",{enumerable:!0,get:o(function(){return g1.getAPI},"get")});var y1=Tc();Object.defineProperty(xe,"createAPIRequest",{enumerable:!0,get:o(function(){return y1.createAPIRequest},"get")});var _1=nx();Object.defineProperty(xe,"AuthPlus",{enumerable:!0,get:o(function(){return _1.AuthPlus},"get")});var v1=sx();Object.defineProperty(xe,"Discovery",{enumerable:!0,get:o(function(){return v1.Discovery},"get")});var b1=cm();Object.defineProperty(xe,"Endpoint",{enumerable:!0,get:o(function(){return b1.Endpoint},"get")});h1(Ec(),xe)});var lx=k(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.people_v1=void 0;var me=Ic(),cx;(function(t){class e{static{o(this,"People")}context;contactGroups;otherContacts;people;constructor(l,p){this.context={_options:l||{},google:p},this.contactGroups=new r(this.context),this.otherContacts=new i(this.context),this.people=new s(this.context)}}t.People=e;class r{static{o(this,"Resource$Contactgroups")}context;members;constructor(l){this.context=l,this.members=new n(this.context)}batchGet(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups:batchGet").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}create(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}delete(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}get(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}list(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}update(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$Contactgroups=r;class n{static{o(this,"Resource$Contactgroups$Members")}context;constructor(l){this.context=l}modify(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}/members:modify").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$Contactgroups$Members=n;class i{static{o(this,"Resource$Othercontacts")}context;constructor(l){this.context=l}copyOtherContactToMyContactsGroup(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:copyOtherContactToMyContactsGroup").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}list(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/otherContacts").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}search(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/otherContacts:search").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$Othercontacts=i;class s{static{o(this,"Resource$People")}context;connections;constructor(l){this.context=l,this.connections=new c(this.context)}batchCreateContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchCreateContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}batchDeleteContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchDeleteContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}batchUpdateContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchUpdateContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}createContact(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:createContact").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}deleteContact(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:deleteContact").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}deleteContactPhoto(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:deleteContactPhoto").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}get(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}getBatchGet(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchGet").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}listDirectoryPeople(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:listDirectoryPeople").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}searchContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:searchContacts").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}searchDirectoryPeople(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:searchDirectoryPeople").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}updateContact(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:updateContact").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}updateContactPhoto(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:updateContactPhoto").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$People=s;class c{static{o(this,"Resource$People$Connections")}context;constructor(l){this.context=l}list(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}/connections").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$People$Connections=c})(cx||(Rc.people_v1=cx={}))});var fx=k(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.AuthPlus=ur.people_v1=ur.auth=ur.VERSIONS=void 0;ur.people=P1;var dx=Ic(),px=lx();Object.defineProperty(ur,"people_v1",{enumerable:!0,get:o(function(){return px.people_v1},"get")});ur.VERSIONS={v1:px.people_v1.People};function P1(t){return(0,dx.getAPI)("people",t,ur.VERSIONS,this)}o(P1,"people");var S1=new dx.AuthPlus;ur.auth=S1;var E1=Ic();Object.defineProperty(ur,"AuthPlus",{enumerable:!0,get:o(function(){return E1.AuthPlus},"get")})});var mx=k((dm,pm)=>{(function(t,e){typeof dm=="object"&&typeof pm<"u"?pm.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(dm,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",s="minute",c="hour",d="day",l="week",p="month",f="quarter",_="year",h="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,P={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o(function(te){var q=["th","st","nd","rd"],B=te%100;return"["+te+(q[(B-20)%10]||q[B]||q[0])+"]"},"ordinal")},x=o(function(te,q,B){var J=String(te);return!J||J.length>=q?te:""+Array(q+1-J.length).join(B)+te},"m"),N={s:x,z:o(function(te){var q=-te.utcOffset(),B=Math.abs(q),J=Math.floor(B/60),K=B%60;return(q<=0?"+":"-")+x(J,2,"0")+":"+x(K,2,"0")},"z"),m:o(function te(q,B){if(q.date()<B.date())return-te(B,q);var J=12*(B.year()-q.year())+(B.month()-q.month()),K=q.clone().add(J,p),re=B-K<0,oe=q.clone().add(J+(re?-1:1),p);return+(-(J+(B-K)/(re?K-oe:oe-K))||0)},"t"),a:o(function(te){return te<0?Math.ceil(te)||0:Math.floor(te)},"a"),p:o(function(te){return{M:p,y:_,w:l,d,D:h,h:c,m:s,s:i,ms:n,Q:f}[te]||String(te||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(te){return te===void 0},"u")},L="en",X={};X[L]=P;var W=o(function(te){return te instanceof Y},"p"),G=o(function te(q,B,J){var K;if(!q)return L;if(typeof q=="string"){var re=q.toLowerCase();X[re]&&(K=re),B&&(X[re]=B,K=re);var oe=q.split("-");if(!K&&oe.length>1)return te(oe[0])}else{var Ae=q.name;X[Ae]=q,K=Ae}return!J&&K&&(L=K),K||!J&&L},"t"),Z=o(function(te,q){if(W(te))return te.clone();var B=typeof q=="object"?q:{};return B.date=te,B.args=arguments,new Y(B)},"w"),ee=N;ee.l=G,ee.i=W,ee.w=function(te,q){return Z(te,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var Y=(function(){function te(B){this.$L=G(B.locale,null,!0),this.parse(B)}o(te,"M");var q=te.prototype;return q.parse=function(B){this.$d=(function(J){var K=J.date,re=J.utc;if(K===null)return new Date(NaN);if(ee.u(K))return new Date;if(K instanceof Date)return new Date(K);if(typeof K=="string"&&!/Z$/i.test(K)){var oe=K.match(y);if(oe){var Ae=oe[2]-1||0,Oe=(oe[7]||"0").substring(0,3);return re?new Date(Date.UTC(oe[1],Ae,oe[3]||1,oe[4]||0,oe[5]||0,oe[6]||0,Oe)):new Date(oe[1],Ae,oe[3]||1,oe[4]||0,oe[5]||0,oe[6]||0,Oe)}}return new Date(K)})(B),this.$x=B.x||{},this.init()},q.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},q.$utils=function(){return ee},q.isValid=function(){return this.$d.toString()!==g},q.isSame=function(B,J){var K=Z(B);return this.startOf(J)<=K&&K<=this.endOf(J)},q.isAfter=function(B,J){return Z(B)<this.startOf(J)},q.isBefore=function(B,J){return this.endOf(J)<Z(B)},q.$g=function(B,J,K){return ee.u(B)?this[J]:this.set(K,B)},q.unix=function(){return Math.floor(this.valueOf()/1e3)},q.valueOf=function(){return this.$d.getTime()},q.startOf=function(B,J){var K=this,re=!!ee.u(J)||J,oe=ee.p(B),Ae=o(function(Nt,Fe){var qe=ee.w(K.$u?Date.UTC(K.$y,Fe,Nt):new Date(K.$y,Fe,Nt),K);return re?qe:qe.endOf(d)},"l"),Oe=o(function(Nt,Fe){return ee.w(K.toDate()[Nt].apply(K.toDate("s"),(re?[0,0,0,0]:[23,59,59,999]).slice(Fe)),K)},"$"),Be=this.$W,Ge=this.$M,ht=this.$D,Q="set"+(this.$u?"UTC":"");switch(oe){case _:return re?Ae(1,0):Ae(31,11);case p:return re?Ae(1,Ge):Ae(0,Ge+1);case l:var tt=this.$locale().weekStart||0,it=(Be<tt?Be+7:Be)-tt;return Ae(re?ht-it:ht+(6-it),Ge);case d:case h:return Oe(Q+"Hours",0);case c:return Oe(Q+"Minutes",1);case s:return Oe(Q+"Seconds",2);case i:return Oe(Q+"Milliseconds",3);default:return this.clone()}},q.endOf=function(B){return this.startOf(B,!1)},q.$set=function(B,J){var K,re=ee.p(B),oe="set"+(this.$u?"UTC":""),Ae=(K={},K[d]=oe+"Date",K[h]=oe+"Date",K[p]=oe+"Month",K[_]=oe+"FullYear",K[c]=oe+"Hours",K[s]=oe+"Minutes",K[i]=oe+"Seconds",K[n]=oe+"Milliseconds",K)[re],Oe=re===d?this.$D+(J-this.$W):J;if(re===p||re===_){var Be=this.clone().set(h,1);Be.$d[Ae](Oe),Be.init(),this.$d=Be.set(h,Math.min(this.$D,Be.daysInMonth())).$d}else Ae&&this.$d[Ae](Oe);return this.init(),this},q.set=function(B,J){return this.clone().$set(B,J)},q.get=function(B){return this[ee.p(B)]()},q.add=function(B,J){var K,re=this;B=Number(B);var oe=ee.p(J),Ae=o(function(Ge){var ht=Z(re);return ee.w(ht.date(ht.date()+Math.round(Ge*B)),re)},"y");if(oe===p)return this.set(p,this.$M+B);if(oe===_)return this.set(_,this.$y+B);if(oe===d)return Ae(1);if(oe===l)return Ae(7);var Oe=(K={},K[s]=e,K[c]=r,K[i]=t,K)[oe]||1,Be=this.$d.getTime()+B*Oe;return ee.w(Be,this)},q.subtract=function(B,J){return this.add(-1*B,J)},q.format=function(B){var J=this,K=this.$locale();if(!this.isValid())return K.invalidDate||g;var re=B||"YYYY-MM-DDTHH:mm:ssZ",oe=ee.z(this),Ae=this.$H,Oe=this.$m,Be=this.$M,Ge=K.weekdays,ht=K.months,Q=K.meridiem,tt=o(function(Fe,qe,v,E){return Fe&&(Fe[qe]||Fe(J,re))||v[qe].slice(0,E)},"h"),it=o(function(Fe){return ee.s(Ae%12||12,Fe,"0")},"d"),Nt=Q||function(Fe,qe,v){var E=Fe<12?"AM":"PM";return v?E.toLowerCase():E};return re.replace(T,(function(Fe,qe){return qe||(function(v){switch(v){case"YY":return String(J.$y).slice(-2);case"YYYY":return ee.s(J.$y,4,"0");case"M":return Be+1;case"MM":return ee.s(Be+1,2,"0");case"MMM":return tt(K.monthsShort,Be,ht,3);case"MMMM":return tt(ht,Be);case"D":return J.$D;case"DD":return ee.s(J.$D,2,"0");case"d":return String(J.$W);case"dd":return tt(K.weekdaysMin,J.$W,Ge,2);case"ddd":return tt(K.weekdaysShort,J.$W,Ge,3);case"dddd":return Ge[J.$W];case"H":return String(Ae);case"HH":return ee.s(Ae,2,"0");case"h":return it(1);case"hh":return it(2);case"a":return Nt(Ae,Oe,!0);case"A":return Nt(Ae,Oe,!1);case"m":return String(Oe);case"mm":return ee.s(Oe,2,"0");case"s":return String(J.$s);case"ss":return ee.s(J.$s,2,"0");case"SSS":return ee.s(J.$ms,3,"0");case"Z":return oe}return null})(Fe)||oe.replace(":","")}))},q.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},q.diff=function(B,J,K){var re,oe=this,Ae=ee.p(J),Oe=Z(B),Be=(Oe.utcOffset()-this.utcOffset())*e,Ge=this-Oe,ht=o(function(){return ee.m(oe,Oe)},"D");switch(Ae){case _:re=ht()/12;break;case p:re=ht();break;case f:re=ht()/3;break;case l:re=(Ge-Be)/6048e5;break;case d:re=(Ge-Be)/864e5;break;case c:re=Ge/r;break;case s:re=Ge/e;break;case i:re=Ge/t;break;default:re=Ge}return K?re:ee.a(re)},q.daysInMonth=function(){return this.endOf(p).$D},q.$locale=function(){return X[this.$L]},q.locale=function(B,J){if(!B)return this.$L;var K=this.clone(),re=G(B,J,!0);return re&&(K.$L=re),K},q.clone=function(){return ee.w(this.$d,this)},q.toDate=function(){return new Date(this.valueOf())},q.toJSON=function(){return this.isValid()?this.toISOString():null},q.toISOString=function(){return this.$d.toISOString()},q.toString=function(){return this.$d.toUTCString()},te})(),Se=Y.prototype;return Z.prototype=Se,[["$ms",n],["$s",i],["$m",s],["$H",c],["$W",d],["$M",p],["$y",_],["$D",h]].forEach((function(te){Se[te[1]]=function(q){return this.$g(q,te[0],te[1])}})),Z.extend=function(te,q){return te.$i||(te(q,Y,Z),te.$i=!0),Z},Z.locale=G,Z.isDayjs=W,Z.unix=function(te){return Z(1e3*te)},Z.en=X[L],Z.Ls=X,Z.p={},Z}))});var x1={};gs(x1,{googleContacts:()=>T1});module.exports=iw(x1);var aw=Object.freeze({status:"aborted"});function ae(t,e,r){function n(d,l){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:l,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(t))return;d._zod.traits.add(t),e(d,l);let p=c.prototype,f=Object.keys(p);for(let _=0;_<f.length;_++){let h=f[_];h in d||(d[h]=p[h].bind(d))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(d){var l;let p=r?.Parent?new s:this;n(p,d),(l=p._zod).deferred??(l.deferred=[]);for(let f of p._zod.deferred)f();return p}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}o(ae,"$constructor");var xr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ys=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},ol={};function Jr(t){return t&&Object.assign(ol,t),ol}o(Jr,"config");function al(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}o(al,"getEnumValues");function yh(t,e){return typeof e=="bigint"?e.toString():e}o(yh,"jsonStringifyReplacer");function vs(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(vs,"cached");function _h(t){return t==null}o(_h,"nullish");function bs(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(bs,"cleanRegex");var gh=Symbol("evaluating");function st(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==gh)return n===void 0&&(n=gh,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(st,"defineLazy");var sl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Ri(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(Ri,"isObject");var sw=vs(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function vh(t){if(Ri(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Ri(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(vh,"isPlainObject");var bh=new Set(["string","number","symbol"]);function Co(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Co,"escapeRegex");function Ps(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}o(Ps,"clone");function Xe(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:o(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:o(()=>e.error,"error")}:e}o(Xe,"normalizeParams");function Ph(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(Ph,"optionalKeys");var Sh={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function $o(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}o($o,"aborted");function bn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(bn,"prefixIssues");function _s(t){return typeof t=="string"?t:t?.message}o(_s,"unwrapMessage");function Pn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=_s(t.inst?._zod.def?.error?.(t))??_s(e?.error?.(t))??_s(r.customError?.(t))??_s(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(Pn,"finalizeIssue");function Eh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(Eh,"getLengthableOrigin");function ul(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o(ul,"issue");var Th=o((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,yh,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),xh=ae("$ZodError",Th),Oi=ae("$ZodError",Th,{Parent:Error});var cw=o(t=>(e,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new xr;if(c.issues.length){let d=new(i?.Err??t)(c.issues.map(l=>Pn(l,s,Jr())));throw sl(d,i?.callee),d}return c.value},"_parse"),Ss=cw(Oi),lw=o(t=>async(e,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??t)(c.issues.map(l=>Pn(l,s,Jr())));throw sl(d,i?.callee),d}return c.value},"_parseAsync"),Es=lw(Oi),dw=o(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new xr;return s.issues.length?{success:!1,error:new(t??xh)(s.issues.map(c=>Pn(c,i,Jr())))}:{success:!0,data:s.value}},"_safeParse"),Ci=dw(Oi),pw=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>Pn(c,i,Jr())))}:{success:!0,data:s.value}},"_safeParseAsync"),$i=pw(Oi);var fw="(?:(?:\\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])))",mw=new RegExp(`^${fw}$`);var Ah=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),wh=/^-?\d+n?$/,Ih=/^-?\d+$/,cl=/^-?\d+(?:\.\d+)?$/,Rh=/^(?:true|false)$/i;var Sn=ae("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),hw={number:"number",bigint:"bigint",object:"date"};var Oh=ae("$ZodCheckGreaterThan",(t,e)=>{Sn.init(t,e);let r=hw[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}});var Ch=ae("$ZodCheckNumberFormat",(t,e)=>{Sn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,s]=Sh[e.format];t._zod.onattach.push(c=>{let d=c._zod.bag;d.format=e.format,d.minimum=i,d.maximum=s,r&&(d.pattern=Ih)}),t._zod.check=c=>{let d=c.value;if(r){if(!Number.isInteger(d)){c.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:d,inst:t});return}if(!Number.isSafeInteger(d)){d>0?c.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):c.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}d<i&&c.issues.push({origin:"number",input:d,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),d>s&&c.issues.push({origin:"number",input:d,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var $h=ae("$ZodCheckMinLength",(t,e)=>{var r;Sn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!_h(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let c=Eh(i);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var ll=ae("$ZodCheckStringFormat",(t,e)=>{var r,n;Sn.init(t,e),t._zod.onattach.push(i=>{let s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),kh=ae("$ZodCheckRegex",(t,e)=>{ll.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}});var zh={major:4,minor:3,patch:6};var rt=ae("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=zh;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let s of i._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=o((c,d,l)=>{let p=$o(c),f;for(let _ of d){if(_._zod.def.when){if(!_._zod.def.when(c))continue}else if(p)continue;let h=c.issues.length,g=_._zod.check(c);if(g instanceof Promise&&l?.async===!1)throw new xr;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,c.issues.length!==h&&(p||(p=$o(c,h)))});else{if(c.issues.length===h)continue;p||(p=$o(c,h))}}return f?f.then(()=>c):c},"runChecks"),s=o((c,d,l)=>{if($o(c))return c.aborted=!0,c;let p=i(d,n,l);if(p instanceof Promise){if(l.async===!1)throw new xr;return p.then(f=>t._zod.parse(f,l))}return t._zod.parse(p,l)},"handleCanaryResult");t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){let p=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(f=>s(f,c,d)):s(p,c,d)}let l=t._zod.parse(c,d);if(l instanceof Promise){if(d.async===!1)throw new xr;return l.then(p=>i(p,n,d))}return i(l,n,d)}}st(t,"~standard",()=>({validate:o(i=>{try{let s=Ci(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return $i(t,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),As=ae("$ZodString",(t,e)=>{rt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Ah(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),dl=ae("$ZodStringFormat",(t,e)=>{ll.init(t,e),As.init(t,e)});var Lh=ae("$ZodURL",(t,e)=>{dl.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}});var pl=ae("$ZodNumber",(t,e)=>{rt.init(t,e),t._zod.pattern=t._zod.bag.pattern??cl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}}),Fh=ae("$ZodNumberFormat",(t,e)=>{Ch.init(t,e),pl.init(t,e)}),fl=ae("$ZodBoolean",(t,e)=>{rt.init(t,e),t._zod.pattern=Rh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),Bh=ae("$ZodBigInt",(t,e)=>{rt.init(t,e),t._zod.pattern=wh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}});var qh=ae("$ZodAny",(t,e)=>{rt.init(t,e),t._zod.parse=r=>r}),Vh=ae("$ZodUnknown",(t,e)=>{rt.init(t,e),t._zod.parse=r=>r});var Hh=ae("$ZodVoid",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),Gh=ae("$ZodDate",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:t}),r}});function Dh(t,e,r){t.issues.length&&e.issues.push(...bn(r,t.issues)),e.value[r]=t.value}o(Dh,"handleArrayResult");var Wh=ae("$ZodArray",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let s=[];for(let c=0;c<i.length;c++){let d=i[c],l=e.element._zod.run({value:d,issues:[]},n);l instanceof Promise?s.push(l.then(p=>Dh(p,r,c))):Dh(l,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function xs(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...bn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(xs,"handlePropertyResult");function gw(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Ph(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(gw,"normalizeDef");function yw(t,e,r,n,i,s){let c=[],d=i.keySet,l=i.catchall._zod,p=l.def.type,f=l.optout==="optional";for(let _ in e){if(d.has(_))continue;if(p==="never"){c.push(_);continue}let h=l.run({value:e[_],issues:[]},n);h instanceof Promise?t.push(h.then(g=>xs(g,r,_,e,f))):xs(h,r,_,e,f)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}o(yw,"handleCatchall");var Zh=ae("$ZodObject",(t,e)=>{if(rt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let d=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let l={...d};return Object.defineProperty(e,"shape",{value:l}),l},"get")})}let n=vs(()=>gw(e));st(t._zod,"propValues",()=>{let d=e.shape,l={};for(let p in d){let f=d[p]._zod;if(f.values){l[p]??(l[p]=new Set);for(let _ of f.values)l[p].add(_)}}return l});let i=Ri,s=e.catchall,c;t._zod.parse=(d,l)=>{c??(c=n.value);let p=d.value;if(!i(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),d;d.value={};let f=[],_=c.shape;for(let h of c.keys){let g=_[h],y=g._zod.optout==="optional",T=g._zod.run({value:p[h],issues:[]},l);T instanceof Promise?f.push(T.then(P=>xs(P,d,h,p,y))):xs(T,d,h,p,y)}return s?yw(f,p,d,l,n.value,t):f.length?Promise.all(f).then(()=>d):d}});function Uh(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let i=t.filter(s=>!$o(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>Pn(c,n,Jr())))}),e)}o(Uh,"handleUnionResults");var ml=ae("$ZodUnion",(t,e)=>{rt.init(t,e),st(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),st(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),st(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),st(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>bs(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,d=[];for(let l of e.options){let p=l._zod.run({value:i.value,issues:[]},s);if(p instanceof Promise)d.push(p),c=!0;else{if(p.issues.length===0)return p;d.push(p)}}return c?Promise.all(d).then(l=>Uh(l,i,t,s)):Uh(d,i,t,s)}});var Kh=ae("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ml.init(t,e);let r=t._zod.parse;st(t._zod,"propValues",()=>{let i={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[d,l]of Object.entries(c)){i[d]||(i[d]=new Set);for(let p of l)i[d].add(p)}}return i});let n=vs(()=>{let i=e.options,s=new Map;for(let c of i){let d=c._zod.propValues?.[e.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let l of d){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,c)}}return s});t._zod.parse=(i,s)=>{let c=i.value;if(!Ri(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),i;let d=n.value.get(c?.[e.discriminator]);return d?d._zod.run(i,s):e.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:c,path:[e.discriminator],inst:t}),i)}});var Jh=ae("$ZodRecord",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!vh(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let s=[],c=e.keyType._zod.values;if(c){r.value={};let d=new Set;for(let p of c)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){d.add(typeof p=="number"?p.toString():p);let f=e.valueType._zod.run({value:i[p],issues:[]},n);f instanceof Promise?s.push(f.then(_=>{_.issues.length&&r.issues.push(...bn(p,_.issues)),r.value[p]=_.value})):(f.issues.length&&r.issues.push(...bn(p,f.issues)),r.value[p]=f.value)}let l;for(let p in i)d.has(p)||(l=l??[],l.push(p));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:l})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let l=e.keyType._zod.run({value:d,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&cl.test(d)&&l.issues.length){let _=e.keyType._zod.run({value:Number(d),issues:[]},n);if(_ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");_.issues.length===0&&(l=_)}if(l.issues.length){e.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(_=>Pn(_,n,Jr())),input:d,path:[d],inst:t});continue}let f=e.valueType._zod.run({value:i[d],issues:[]},n);f instanceof Promise?s.push(f.then(_=>{_.issues.length&&r.issues.push(...bn(d,_.issues)),r.value[l.value]=_.value})):(f.issues.length&&r.issues.push(...bn(d,f.issues)),r.value[l.value]=f.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Yh=ae("$ZodEnum",(t,e)=>{rt.init(t,e);let r=al(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>bh.has(typeof i)).map(i=>typeof i=="string"?Co(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:t}),i}}),Xh=ae("$ZodLiteral",(t,e)=>{if(rt.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Co(n):n?Co(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var Qh=ae("$ZodTransform",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ys(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new xr;return r.value=i,r}});function Mh(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(Mh,"handleOptionalResult");var eg=ae("$ZodOptional",(t,e)=>{rt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",st(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),st(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bs(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Mh(s,r.value)):Mh(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var tg=ae("$ZodNullable",(t,e)=>{rt.init(t,e),st(t._zod,"optin",()=>e.innerType._zod.optin),st(t._zod,"optout",()=>e.innerType._zod.optout),st(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bs(r.source)}|null)$`):void 0}),st(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)});var rg=ae("$ZodPipe",(t,e)=>{rt.init(t,e),st(t._zod,"values",()=>e.in._zod.values),st(t._zod,"optin",()=>e.in._zod.optin),st(t._zod,"optout",()=>e.out._zod.optout),st(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Ts(c,e.in,n)):Ts(s,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Ts(s,e.out,n)):Ts(i,e.out,n)}});function Ts(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(Ts,"handlePipeResult");var ng=ae("$ZodCustom",(t,e)=>{Sn.init(t,e),rt.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(s=>jh(s,r,n,t));jh(i,r,n,t)}});function jh(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(ul(i))}}o(jh,"handleRefineResult");var ig;var hl=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ag(){return new hl}o(ag,"registry");(ig=globalThis).__zod_globalRegistry??(ig.__zod_globalRegistry=ag());var gl=globalThis.__zod_globalRegistry;function sg(t,e){return new t({type:"string",...Xe(e)})}o(sg,"_string");function ug(t,e){return new t({type:"string",coerce:!0,...Xe(e)})}o(ug,"_coercedString");function cg(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Xe(e)})}o(cg,"_url");function lg(t,e){return new t({type:"number",checks:[],...Xe(e)})}o(lg,"_number");function dg(t,e){return new t({type:"number",coerce:!0,checks:[],...Xe(e)})}o(dg,"_coercedNumber");function pg(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Xe(e)})}o(pg,"_int");function fg(t,e){return new t({type:"boolean",...Xe(e)})}o(fg,"_boolean");function mg(t,e){return new t({type:"boolean",coerce:!0,...Xe(e)})}o(mg,"_coercedBoolean");function hg(t,e){return new t({type:"bigint",coerce:!0,...Xe(e)})}o(hg,"_coercedBigint");function gg(t){return new t({type:"any"})}o(gg,"_any");function yg(t){return new t({type:"unknown"})}o(yg,"_unknown");function _g(t,e){return new t({type:"void",...Xe(e)})}o(_g,"_void");function vg(t,e){return new t({type:"date",coerce:!0,...Xe(e)})}o(vg,"_coercedDate");function ws(t,e){return new Oh({check:"greater_than",...Xe(e),value:t,inclusive:!0})}o(ws,"_gte");function pr(t,e){return new $h({check:"min_length",...Xe(e),minimum:t})}o(pr,"_minLength");function En(t,e){return new kh({check:"string_format",format:"regex",...Xe(e),pattern:t})}o(En,"_regex");function bg(t,e,r){let n=Xe(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(bg,"_custom");var ut=ae("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");rt.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>Ss(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Ci(t,r,n),t.parseAsync=async(r,n)=>Es(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>$i(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>Ps(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),Rs=ae("ZodMiniString",(t,e)=>{As.init(t,e),ut.init(t,e)});function b(t){return sg(Rs,t)}o(b,"string");var Pg=ae("ZodMiniStringFormat",(t,e)=>{dl.init(t,e),Rs.init(t,e)});var Ow=ae("ZodMiniURL",(t,e)=>{Lh.init(t,e),Pg.init(t,e)});function Sg(t){return cg(Ow,t)}o(Sg,"url");var Os=ae("ZodMiniNumber",(t,e)=>{pl.init(t,e),ut.init(t,e)});function xt(t){return lg(Os,t)}o(xt,"number");var Cw=ae("ZodMiniNumberFormat",(t,e)=>{Fh.init(t,e),Os.init(t,e)});function Eg(t){return pg(Cw,t)}o(Eg,"int");var yl=ae("ZodMiniBoolean",(t,e)=>{fl.init(t,e),ut.init(t,e)});function Le(t){return fg(yl,t)}o(Le,"boolean");var Tg=ae("ZodMiniBigInt",(t,e)=>{Bh.init(t,e),ut.init(t,e)});var $w=ae("ZodMiniAny",(t,e)=>{qh.init(t,e),ut.init(t,e)});function Ni(){return gg($w)}o(Ni,"any");var kw=ae("ZodMiniUnknown",(t,e)=>{Vh.init(t,e),ut.init(t,e)});function ve(){return yg(kw)}o(ve,"unknown");var Nw=ae("ZodMiniVoid",(t,e)=>{Hh.init(t,e),ut.init(t,e)});function xg(t){return _g(Nw,t)}o(xg,"_void");var Ag=ae("ZodMiniDate",(t,e)=>{Gh.init(t,e),ut.init(t,e)});var zw=ae("ZodMiniArray",(t,e)=>{Wh.init(t,e),ut.init(t,e)});function we(t,e){return new zw({type:"array",element:t,...Xe(e)})}o(we,"array");var Dw=ae("ZodMiniObject",(t,e)=>{Zh.init(t,e),ut.init(t,e),st(t,"shape",()=>e.shape)});function C(t,e){let r={type:"object",shape:t??{},...Xe(e)};return new Dw(r)}o(C,"object");var Uw=ae("ZodMiniUnion",(t,e)=>{ml.init(t,e),ut.init(t,e)});function Ie(t,e){return new Uw({type:"union",options:t,...Xe(e)})}o(Ie,"union");var Mw=ae("ZodMiniDiscriminatedUnion",(t,e)=>{Kh.init(t,e),ut.init(t,e)});function Tn(t,e,r){return new Mw({type:"union",options:e,discriminator:t,...Xe(r)})}o(Tn,"discriminatedUnion");var jw=ae("ZodMiniRecord",(t,e)=>{Jh.init(t,e),ut.init(t,e)});function be(t,e,r){return new jw({type:"record",keyType:t,valueType:e,...Xe(r)})}o(be,"record");var Lw=ae("ZodMiniEnum",(t,e)=>{Yh.init(t,e),ut.init(t,e),t.options=Object.values(e.entries)});function $e(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Lw({type:"enum",entries:r,...Xe(e)})}o($e,"_enum");var Fw=ae("ZodMiniLiteral",(t,e)=>{Xh.init(t,e),ut.init(t,e)});function pe(t,e){return new Fw({type:"literal",values:Array.isArray(t)?t:[t],...Xe(e)})}o(pe,"literal");var Bw=ae("ZodMiniTransform",(t,e)=>{Qh.init(t,e),ut.init(t,e)});function xn(t){return new Bw({type:"transform",transform:t})}o(xn,"transform");var qw=ae("ZodMiniOptional",(t,e)=>{eg.init(t,e),ut.init(t,e)});function H(t){return new qw({type:"optional",innerType:t})}o(H,"optional");var Vw=ae("ZodMiniNullable",(t,e)=>{tg.init(t,e),ut.init(t,e)});function zi(t){return new Vw({type:"nullable",innerType:t})}o(zi,"nullable");var Hw=ae("ZodMiniPipe",(t,e)=>{rg.init(t,e),ut.init(t,e)});function An(t,e){return new Hw({type:"pipe",in:t,out:e})}o(An,"pipe");var Gw=ae("ZodMiniCustom",(t,e)=>{ng.init(t,e),ut.init(t,e)});function Cs(t,e){return bg(Gw,t??(()=>!0),e)}o(Cs,"custom");var Di={};gs(Di,{bigint:()=>Xw,boolean:()=>Yw,date:()=>Qw,number:()=>Jw,string:()=>Kw});function Kw(t){return ug(Rs,t)}o(Kw,"string");function Jw(t){return dg(Os,t)}o(Jw,"number");function Yw(t){return mg(yl,t)}o(Yw,"boolean");function Xw(t){return hg(Tg,t)}o(Xw,"bigint");function Qw(t){return vg(Ag,t)}o(Qw,"date");var vl=C({retryOnFailure:C({defaultValue:H(Le()),hide:H(Le())}),continueOnFailure:C({defaultValue:H(Le()),hide:H(Le())})}),_l=class{constructor(e,r,n,i,s,c,d,l,p,f,_){this.name=e;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=d;this.errorHandlingOptions=l;this.outputSchema=p;this.audience=f;this.aiMetadata=_}static{o(this,"IAction")}},wn=o(t=>new _l(t.name,t.displayName,t.description,t.props,t.run,t.test??t.run,t.requireAuth??!0,t.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},t.outputSchema,t.audience,t.aiMetadata),"createAction");var Me=C({displayName:b(),description:H(b())}),Re=o((t,e)=>C({type:pe(e),required:Le(),defaultValue:H(Ni())}),"TPropertyValue");var Ut=C({...Me.shape,...Re(b(),"SHORT_TEXT").shape}),Yr=C({...Me.shape,...Re(b(),"LONG_TEXT").shape});var Ig=C({label:b(),value:ve()}),$s=C({disabled:H(Le()),placeholder:H(b()),options:we(Ig)});var Mt=C({...Me.shape,options:$s,...Re(ve(),"STATIC_DROPDOWN").shape}),Xr=C({...Me.shape,options:$s,...Re(we(ve()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var bl=C({...Me.shape,...Re(ve(),"DROPDOWN").shape,refreshers:we(b())}),Ui=C({...Me.shape,...Re(we(ve()),"MULTI_SELECT_DROPDOWN").shape,refreshers:we(b())});var Qr=C({...Me.shape,...Re(Le(),"CHECKBOX").shape});var en=C({...Me.shape,...Re(xt(),"NUMBER").shape});var Mi=C({...Me.shape,streaming:H(Le()),...Re(ve(),"FILE").shape});var ji=C({...Me.shape,...Re(b(),"DATE_TIME").shape});var Rg=be(b(),Ie([Ut,Yr,Mt,Ui,Xr,Qr,en,Mi,ji])),Li=C({...Me.shape,properties:Rg,...Re(we(ve()),"ARRAY").shape});var Fi=C({...Me.shape,...Re(Ie([be(b(),ve())]),"JSON").shape});var Og=Ie([Ut,Mt,Fi,Li,Xr]),tI=be(b(),Og),Pl=C({refreshers:we(b()),...Me.shape,...Re(ve(),"DYNAMIC").shape});var ks=C({...Me.shape,...Re(xg(),"MARKDOWN").shape});var Bi=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Bi||{}),ko=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(ko||{}),No=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(No||{});var qi=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(qi||{}),Sl="both_client_credentials_and_authorization_code";var In=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(In||{}),Vi=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(Vi||{}),rI=C({strategy:$e(Vi),paramName:H(b())}),Hi=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Hi||{});var Ns=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ns||{}),Cg=C({status:H(xt()),body:H(ve()),headers:H(be(b(),b()))}),$g=C({type:pe("DELAY"),resumeDateTime:b(),requestIdToReply:H(b()),handlerId:H(b()),streamStepProgress:H($e(Ns))}),kg=C({type:pe("WEBHOOK"),requestId:b(),requestIdToReply:H(b()),response:Cg,handlerId:H(b()),streamStepProgress:H($e(Ns))}),nI=Ie([$g,kg]);var oI=C({body:ve(),rawBody:H(ve()),headers:be(b(),b()),queryParams:be(b(),b())});function ft(t){return t==null}o(ft,"isNil");function Gi(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(Gi,"isEmpty");function zs(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(zs,"assertNotNullOrUndefined");var El=pt(require("crypto"),1);var iI=128,Xn,zo,aI=o(t=>{!Xn||Xn.length<t?(Xn=Buffer.allocUnsafe(t*iI),El.default.randomFillSync(Xn),zo=0):zo+t>Xn.length&&(El.default.randomFillSync(Xn),zo=0),zo+=t},"fillPool"),sI=o(t=>(aI(t|=0),Xn.subarray(zo-t,zo)),"random"),uI=o((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(s=e)=>{let c="";for(;;){let d=r(i),l=i;for(;l--;)if(c+=t[d[l]&n]||"",c.length===s)return c}}},"customRandom"),zg=o((t,e=21)=>uI(t,e,sI),"customAlphabet");var cI="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Dg=21,iV=b().check(En(new RegExp(`^[0-9a-zA-Z]{${Dg}}$`))),lI=zg(cI,Dg);var Rn=An(xn(t=>t instanceof Date?t.toISOString():t),b()),Qt={id:b(),created:Rn,updated:Rn},Qe=o(t=>H(zi(t)),"Nullable");function Tl(t){return H(zi($e(t)))}o(Tl,"NullableEnum");var uV=An(xn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),H(Le())),Ds=o(t=>An(xn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),H(we(t))),"OptionalArrayFromQuery");var dV=be(b(),ve());var Wi=(f=>(f.OPENAI="openai",f.OPENROUTER="openrouter",f.ANTHROPIC="anthropic",f.AZURE="azure",f.GOOGLE="google",f.ACTIVEPIECES="activepieces",f.CLOUDFLARE_GATEWAY="cloudflare-gateway",f.CUSTOM="custom",f.BEDROCK="bedrock",f.MISTRAL="mistral",f))(Wi||{});var EV=b().check(En(/^#[0-9A-Fa-f]{6}$/));var xV=C({filename:b(),data:ve(),type:pe("file"),mimetype:H(b())});var dI=pt(Mg());var $V=C({...Qt,name:b(),permissions:we(b()),platformId:Qe(b()),type:b(),userCount:H(xt())});var jg=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(jg||{}),xl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(xl||{}),Al=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Al||{});var wl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(wl||{});var Il=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Il||{});var pI=C({mode:$e(jg),value:ve()}),fI=C({auth:H(b()),fields:be(b(),pI)}),mI=C({pieceName:b(),pieceVersion:b(),actionName:b(),predefinedInput:H(fI)}),hI=C({type:pe("PIECE"),toolName:b().check(pr(1)),pieceMetadata:mI}),gI=C({type:pe("none")}),yI=C({type:pe("access_token"),accessToken:b()}),_I=C({type:pe("api_key"),apiKey:b(),apiKeyHeader:b()}),vI=C({type:pe("headers"),headers:be(b(),b())}),bI=Tn("type",[gI,yI,_I,vI]),Lg=C({type:pe("FLOW"),toolName:b().check(pr(1)),externalFlowId:b(),flowDisplayName:H(b())}),Fg=C({type:pe("MCP"),toolName:b().check(pr(1)),serverUrl:Sg(),protocol:$e(Al),auth:bI}),Bg=C({type:pe("KNOWLEDGE_BASE"),toolName:b().check(pr(1)),sourceType:$e(xl),sourceId:b(),sourceName:b()}),PI=Tn("type",[hI,Lg,Fg,Bg]),SI=C({displayName:b(),description:H(b()),type:$e(wl)}),qg=C({type:pe("MARKDOWN"),markdown:b()}),Do={type:pe("TOOL_CALL"),input:Qe(be(b(),ve())),output:H(ve()),toolName:b(),status:$e(Il),toolCallId:b(),startTime:b(),endTime:H(b())},cH=C(Do),Vg=Tn("toolCallType",[C({...Do,toolCallType:pe("PIECE"),pieceName:b(),pieceVersion:b(),actionName:b()}),C({...Do,toolCallType:pe("FLOW"),displayName:b(),externalFlowId:b()}),C({...Do,toolCallType:pe("MCP"),displayName:b(),serverUrl:b()}),C({...Do,toolCallType:pe("KNOWLEDGE_BASE"),displayName:b(),sourceType:b()}),C({...Do,toolCallType:pe("UNKNOWN"),displayName:b()})]),EI=Ie([qg,Vg]);var Rl=(r=>(r.IMAGE="image",r.TEXT="text",r))(Rl||{}),tn=C({apiKey:b()}),TI=tn,xI=C({apiKey:b(),apiKeyHash:b()}),AI=tn,wI=tn,II=tn,RI=tn,OI=tn,CI=tn,$I=tn,Kg=C({accessKeyId:b().check(pr(1)),secretAccessKey:b().check(pr(1))}),kI=C({}),NI=C({}),zI=C({}),DI=C({}),UI=C({}),MI=C({}),Jg=C({modelId:b(),modelName:b(),modelType:$e(Rl)}),Yg=C({apiKeyHeader:b(),baseUrl:b(),models:we(Jg),defaultHeaders:H(be(b(),b()))}),Xg=C({accountId:b(),gatewayId:b(),models:we(Jg),vertexProject:H(b()),vertexRegion:H(b())}),Qg=C({resourceName:b(),apiVersion:An(xn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),H(b()))}),ey=C({region:b().check(pr(1))}),jI=Ie([TI,II,RI,OI,CI,wI,AI,xI,Kg,$I]),ty=Ie([Yg,Xg,Qg,ey,kI,zI,DI,UI,NI,MI]),LI=C({id:b(),name:b(),type:$e(Rl)}),FI=C({id:b(),name:b(),provider:$e(Wi),config:ty,enabledForChat:Le()}),BI=C({provider:$e(Wi),config:ty,auth:jI,platformId:b()});var fH={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Hg=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],qI=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],VI=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Gg=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],HI=["grok-4.20","grok-4.1-fast"],GI={openai:Hg,anthropic:qI,google:Gg,activepieces:[...VI.map(t=>`anthropic/${t}`),...Hg.map(t=>`openai/${t}`),...Gg.map(t=>`google/${t}`),...HI.map(t=>`x-ai/${t}`)]};var Wg=128e3,WI={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function ZI({provider:t}){return t?WI[t]??Wg:Wg}o(ZI,"getMaxContextTokens");var Zg={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},KI={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},JI=new Set(["anthropic","mistral"]);function Ar(t){return{chatModels:GI[t],maxContextTokens:ZI({provider:t}),defaultEmbeddingModel:Zg[t],supportsEmbedding:Zg[t]!==void 0,supportsImageGeneration:!JI.has(t),webSearch:KI[t]}}o(Ar,"buildProviderCapabilities");var YI={openai:Ar("openai"),anthropic:Ar("anthropic"),openrouter:Ar("openrouter"),azure:Ar("azure"),google:Ar("google"),"cloudflare-gateway":Ar("cloudflare-gateway"),custom:Ar("custom"),bedrock:Ar("bedrock"),mistral:Ar("mistral"),activepieces:Ar("activepieces")};var XI=C({base64Url:b(),fileName:b(),extension:H(b())}),QI=C({mimeType:b(),url:b(),fileName:H(b())}),Ol=Ie([XI,QI]);var eR=Ie([C({type:pe("file"),value:Ol}),C({type:pe("markdown"),value:b(),files:H(we(Ol))})]),tR=C({sessionId:b(),message:b(),files:H(we(b()))});var ny=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ny||{}),oy=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(oy||{}),Cl=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Cl||{});var rR=Ie([C({...Qt,name:b(),externalId:b(),type:pe("STATIC_DROPDOWN"),tableId:b(),projectId:b(),data:C({options:we(C({value:b()}))})}),C({...Qt,name:b(),externalId:b(),type:Ie([pe("TEXT"),pe("NUMBER"),pe("DATE")]),tableId:b(),projectId:b()})]),nR=C({...Qt,name:b(),folderId:Qe(b()),projectId:b(),externalId:b(),status:Tl(oy),trigger:Tl(ny)}),oR=C({...Qt,tableId:b(),projectId:b(),cells:be(b(),C({updated:b(),created:b(),value:ve(),fieldName:b()}))}),iR=C({events:we($e(Cl)),webhookUrl:b(),flowId:b()}),aR=C({fields:we(C({id:b(),name:b()})),rows:we(be(b(),b())),name:b()}),sR=C({projectId:b(),limit:H(Di.number()),cursor:H(b()),name:H(b()),externalIds:Ds(b()),folderId:H(b()),folderIds:Ds(b())}),uR=C({records:we(we(C({fieldId:b(),value:ay()}))),tableId:b()}),cR=C({cells:H(we(C({fieldId:b(),value:ay()}))),tableId:b(),agentUpdate:H(Le())}),iy=Tn("operator",[Qn("eq"),Qn("neq"),Qn("gt"),Qn("gte"),Qn("lt"),Qn("lte"),Qn("co"),ry("exists"),ry("not_exists")]),lR=C({tableId:b(),limit:H(Di.number()),cursor:H(b()),filters:Ds(iy)});function ay(){return An(xn(t=>t==null?t:String(t)),zi(b()))}o(ay,"coerceToString");function Qn(t){return C({fieldId:b(),operator:pe(t),value:b()})}o(Qn,"valueFilter");function ry(t){return C({fieldId:b(),operator:pe(t)})}o(ry,"existenceFilter");var dR=C({status:H(xt()),body:H(ve()),headers:H(be(b(),b()))}),pR=C({...Qt,deleted:Qe(Rn),ownerId:b(),displayName:b(),platformId:b(),externalId:Qe(b())});var sy=C({name:b(),description:H(b()),type:b(),required:Le()}),fR=C({pieceName:b(),triggerName:b(),input:C({toolName:b(),toolDescription:b(),inputSchema:we(sy),returnsResponse:Le()})});var uy="^[0-9]+\\.[0-9]+\\.[0-9]+$",$H=new RegExp(uy),hR="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",kH=b().check(En(new RegExp(uy))),NH=b().check(En(new RegExp(hR))),gR=C({packageType:pe("ARCHIVE"),pieceType:$e(ko),pieceName:b(),pieceVersion:b(),archiveId:b(),platformId:b()}),cy=C({packageType:pe("REGISTRY"),pieceType:pe("OFFICIAL"),pieceName:b(),pieceVersion:b()}),ly=C({packageType:pe("REGISTRY"),pieceType:pe("CUSTOM"),pieceName:b(),pieceVersion:b(),platformId:b()}),zH=Ie([cy,ly]),DH=Ie([gR,cy,ly]);var yR=Tn("type",[C({type:pe("CRON_EXPRESSION"),cronExpression:b(),timezone:b()}),C({type:pe("INTERVAL"),intervalMs:Eg().check(ws(6e4))})]),UH=C({...Qt,type:$e(In),projectId:b(),flowId:b(),triggerName:b(),schedule:Qe(yR),flowVersionId:b(),pieceName:b(),pieceVersion:b(),deleted:Qe(b()),simulate:Le()}),dy=(P=>(P.UNKNOWN="UNKNOWN",P.FLOW_RUN_LOG="FLOW_RUN_LOG",P.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",P.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",P.FLOW_STEP_FILE="FLOW_STEP_FILE",P.SAMPLE_DATA="SAMPLE_DATA",P.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",P.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",P.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",P.PROJECT_RELEASE="PROJECT_RELEASE",P.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",P.PLATFORM_ASSET="PLATFORM_ASSET",P.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",P.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",P.KNOWLEDGE_BASE="KNOWLEDGE_BASE",P.FLOW_BUNDLE="FLOW_BUNDLE",P))(dy||{}),py=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(py||{}),fy=(r=>(r.S3="S3",r.DB="DB",r))(fy||{}),MH=C({...Qt,projectId:Qe(b()),platformId:Qe(b()),type:$e(dy),compression:$e(py),data:H(ve()),location:$e(fy),size:Qe(xt()),fileName:Qe(b()),s3Key:Qe(b()),metadata:Qe(be(b(),b()))}),my=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(my||{}),hy=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(hy||{}),jH=C({id:b(),email:b(),firstName:b(),status:$e(hy),externalId:Qe(b()),platformId:Qe(b()),platformRole:$e(my),lastName:b(),created:Rn,updated:Rn,lastActiveDate:Qe(Rn),imageUrl:Qe(b())});var $l=C({...Me.shape,...Re(be(b(),ve()),"OBJECT").shape});var vy=C({...Me.shape,...Re(b(),"COLOR").shape});var kl=Ie([Ut,Yr,ks,Qr,Mt,Xr,bl,Ui,Pl,en,Li,$l,Fi,ji,Mi,vy]),Te={ShortText(t){return{...t,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(t){return{...t,valueSchema:void 0,type:"CHECKBOX"}},LongText(t){return{...t,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(t){return{displayName:"Markdown",required:!1,description:t.value,type:"MARKDOWN",valueSchema:void 0,variant:t.variant??"INFO"}},Number(t){return{...t,valueSchema:void 0,type:"NUMBER"}},Json(t){return{...t,valueSchema:void 0,type:"JSON"}},Array(t){return{...t,valueSchema:void 0,type:"ARRAY"}},Object(t){return{...t,valueSchema:void 0,type:"OBJECT"}},Dropdown(t){return{...t,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(t){return{...t,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(t){return{...t,valueSchema:void 0,type:"DATE_TIME"}},File(t){return{...t,valueSchema:void 0,type:"FILE"}},Custom(t){let e=t.code.toString();return{...t,code:e,valueSchema:void 0,type:"CUSTOM"}},Color(t){return{...t,valueSchema:void 0,type:"COLOR"}}};var wr=C({displayName:b(),description:H(b())});var by=C({username:b(),password:b()}),Nl=C({...wr.shape,username:C({displayName:b(),description:H(b())}),password:C({displayName:b(),description:H(b())}),...Re(by,"BASIC_AUTH").shape});var PR=be(b(),Ie([Ut,Yr,en,Qr,Mt])),zl=C({...wr.shape,props:PR,...Re(ve(),"CUSTOM_AUTH").shape});var eo=C({...wr.shape,...Re(C({auth:b()}),"SECRET_TEXT").shape});var SR=be(b(),Ie([Ut,Yr,eo,en,Qr,Mt,Xr,ks])),Py=C({...wr.shape,props:SR,...Re(ve(),"OIDC").shape});var Dl=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Dl||{}),Sy=Ie([Ut,eo,Mt]),Ey=be(b(),Sy),ER=C({props:H(be(b(),Sy)),authUrl:b(),tokenUrl:b(),scope:we(b()),prompt:H(Ie([pe("none"),pe("consent"),pe("login"),pe("omit")])),pkce:H(Le()),pkceMethod:H(Ie([pe("plain"),pe("S256")])),authorizationMethod:H($e(Dl)),grantType:H(Ie([$e(qi),pe(Sl)])),extra:H(be(b(),b()))}),Ty=C({access_token:b(),props:H(Ey),data:be(b(),Ni())}),Ul=C({...wr.shape,...ER.shape,...Re(Ty,"OAUTH2").shape});var Uo=Ie([Nl,zl,Py,Ul,eo]),Zi="Connection",Ml={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||Zi}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||Zi,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||Zi}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||Zi}},None(){}};var yW={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var TR=C({...Me.shape,...Re(ve(),"CUSTOM").shape,code:b()});var xR=Ie([kl,Uo]),jl=be(b(),xR),UW=be(b(),kl);var xy=Ie([C({strategy:pe("CRON"),cronExpression:b()}),C({strategy:pe("NONE")})]),Mo=class{constructor(e,r,n,i,s,c,d,l,p,f,_,h,g,y,T,P,x,N,L){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=d;this.onHandshake=l;this.renewConfiguration=p;this.onRenew=f;this.onEnable=_;this.onDisable=h;this.onStart=g;this.run=y;this.test=T;this.sampleData=P;this.testStrategy=x;this.outputSchema=N;this.aiMetadata=L}static{o(this,"ITrigger")}},Ay=o(t=>{switch(t.type){case"WEBHOOK":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,t.handshakeConfiguration??{strategy:"NONE"},t.onHandshake??(async()=>({status:200})),t.renewConfiguration??{strategy:"NONE"},t.onRenew??(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,t.test?"TEST_FUNCTION":"SIMULATION",t.outputSchema,t.aiMetadata);case"POLLING":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata);case"MANUAL":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata);case"APP_WEBHOOK":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,ft(t.sampleData)&&ft(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var wy="2",Ms="0.82.0";var Ll=class{constructor(e,r,n,i,s,c,d,l,p=Ms,f,_="",h){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=l;this.minimumSupportedRelease=p;this.maximumSupportedRelease=f;this.description=_;this.deprecated=h;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:wy}),"getContextInfo");(!AR(p)||wR(p,Ms))&&(this.minimumSupportedRelease=Ms),s.forEach(g=>this._actions[g.name]=g),c.forEach(g=>this._triggers[g.name]=g)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(e){return this._actions[e]}getTrigger(e){return this._triggers[e]}actions(){return this._actions}triggers(){return this._triggers}},Iy=o(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Ll(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description,t.deprecated)},"createPiece");function AR(t){return/^\d+\.\d+\.\d+$/.test(t)}o(AR,"isValidSimpleSemver");function wR(t,e){let[r,n,i]=t.split(".").map(Number),[s,c,d]=e.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<d}o(wR,"isSemverLessThan");var IR=H(be(b(),be(b(),b()))),Ry=C({id:H(b()),name:b(),displayName:b(),logoUrl:b(),description:b(),authors:we(b()),platformId:H(b()),directoryPath:H(b()),auth:H(Ie([Uo,we(Uo)])),version:b(),categories:H(we($e(No))),minimumSupportedRelease:H(b()),maximumSupportedRelease:H(b()),deprecated:H(Le()),i18n:IR}),RR=$e(["human","ai","both"]),Oy=C({description:H(b()),idempotent:H(Le())}),Cy=C({name:b(),displayName:b(),description:b(),props:jl,requireAuth:Le(),errorHandlingOptions:H(vl),outputSchema:H(Cs()),audience:H(RR),aiMetadata:H(Oy)}),$y=C({name:b(),displayName:b(),description:b(),props:jl,errorHandlingOptions:H(vl),type:$e(In),sampleData:ve(),handshakeConfiguration:H(Cs()),renewConfiguration:H(xy),testStrategy:$e(Hi),outputSchema:H(Cs()),aiMetadata:H(Oy)}),OR=C({...Ry.shape,actions:be(b(),Cy),triggers:be(b(),$y)}),CR=C({...Ry.shape,actions:xt(),triggers:xt(),suggestedActions:H(we(Cy)),suggestedTriggers:H(we($y))}),ky=C({projectUsage:xt(),pieceType:$e(ko),packageType:$e(Bi),platformId:H(b()),archiveId:H(b())}),UZ=C({...OR.shape,...ky.shape}),MZ=C({...CR.shape,...ky.shape}),jZ=C({name:b(),version:b()});var $R=pt(require("path")),kR=pt(require("fs/promises"));var Uy=require("node:stream");var js=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};return e.authentication&&this.populateAuthentication(e.authentication,r),e.body&&(e.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),e.headers&&(r={...r,...e.headers}),r}populateAuthentication(e,r){this.authenticationConverter.convert(e,r)}};var Ls=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new Fl,r=new Bl){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},Fl=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},Bl=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(e,r){let n=`${e.username}:${e.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Ki=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Ny({error:t,requestBody:e}){return t instanceof Ki?t.errorMessage():{response:{status:0,body:t instanceof Error?t.message:String(t)},request:{body:e}}}o(Ny,"toFailsafeOutput");var jo=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(jo||{});var Fs=class extends js{static{o(this,"FetchHttpClient")}constructor(e="",r=new Ls){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),s=this.getHeaders(e),c=e.queryParams??{};for(let[L,X]of Object.entries(c))i.append(L,X);let d=i.toString(),l=d?`${n}?${d}`:n,p=e.responseType??"json",f=e.followRedirects??!0,_=e.retries??0,{body:h,extraHeaders:g,isStream:y}=NR(e.method)?zR(e.body,s):{body:void 0,extraHeaders:{},isStream:!1},T=UR({...s,...g}),P=await DR(async()=>{let L=new AbortController,X=e.timeout&&e.timeout>0?setTimeout(()=>L.abort(),e.timeout):void 0;try{let W={method:e.method.toString(),headers:T,body:h,redirect:f?"follow":"manual",signal:L.signal};return y&&(W.duplex="half"),r?.dispatcher!==void 0&&(W.dispatcher=r.dispatcher),await fetch(l,W)}finally{X!==void 0&&clearTimeout(X)}},_),x=f?300:400;if(P.status<200||P.status>=x){let L=await zy(P,p),X=new Ki(e.body,{status:P.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",X),X}let N=await zy(P,p);return{status:P.status,headers:MR(P.headers),body:N}}};function NR(t){return t!=="GET"&&t!=="HEAD"}o(NR,"acceptsRequestBody");function zR(t,e){if(LR(t))return{body:void 0,extraHeaders:{},isStream:!1};if(jR(t)){let n=new Uy.PassThrough;return t.on("error",i=>n.destroy(i)),t.pipe(n),{body:n,extraHeaders:t.getHeaders(),isStream:!0}}return typeof t=="string"||Buffer.isBuffer(t)||t instanceof URLSearchParams||t instanceof ArrayBuffer||typeof FormData<"u"&&t instanceof FormData||typeof Blob<"u"&&t instanceof Blob?{body:t,extraHeaders:{},isStream:!1}:(e["Content-Type"]??e["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(t).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(t),extraHeaders:{},isStream:!1}}o(zR,"serializeBody");async function zy(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"blob":return await t.blob();case"text":return await t.text();default:{let r=await t.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(zy,"parseResponseBody");async function DR(t,e){let r;for(let n=0;n<=e;n++)try{let i=await t();if(i.status>=500&&n<e){await Dy(n);continue}return i}catch(i){if(r=i,n<e){await Dy(n);continue}throw i}throw r}o(DR,"sendWithRetries");function Dy(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(Dy,"backoff");function UR(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&(e[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return e}o(UR,"normalizeHeaders");function MR(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(MR,"toHttpHeaders");function jR(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}o(jR,"isNodeFormData");function LR(t){return t==null}o(LR,"isNil");var On=new Fs;var wC=pt(require("fs")),Fv=pt(Lv());var IC={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function RC(t){let e=t.split(";")[0].trim().toLowerCase();return IC[e]??""}o(RC,"contentTypeToExtension");var OC=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),CC=o((t,e)=>{let r="https://api.example.com";try{let n=e?t(e):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Bv({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:d,authLocation:l="headers"}){return wn({audience:"human",name:s||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:Te.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:p})=>({url:Te.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
69
- i.e ${CC(e,p)}/resource or /resource`,required:!0,defaultValue:p?e(p):"",...c?.url??{}})}),"props")}),method:Te.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(jo).map(p=>({label:p,value:p}))},...c?.method??{}}),headers:Te.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:Te.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:Te.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:Te.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:p})=>{if(!p)return{};let f=p,_={};switch(f){case"none":break;case"json":_.data=Te.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":_.data=Te.LongText({displayName:"Raw Body",required:!0});break;case"form_data":_.data=Te.Array({displayName:"Form Data",required:!0,properties:{fieldName:Te.ShortText({displayName:"Field Name",required:!0}),fieldType:Te.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:Te.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:Te.File({displayName:"File Field Value",required:!1})}});break}return _},"props")}),response_is_binary:Te.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:Te.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:Te.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:Te.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async p=>{let{method:f,url:_,headers:h,queryParams:g,body:y,body_type:T,failsafe:P,timeout:x,response_is_binary:N,followRedirects:L}=p.propsValue;zs(f,"Method"),zs(_,"URL");let X=ft(r)?{}:await r(p.auth,p.propsValue),W=_.url,G=W.startsWith("http://")||W.startsWith("https://")?W:OC({baseUrl:e(p.auth),relativePath:W}),Z={method:f,url:G,headers:{...h??{},...l==="headers"||!ft(l)?X:{}},queryParams:{...l==="queryParams"?X:{},...g??{}},timeout:x?x*1e3:0,followRedirects:L};if(N&&(Z.responseType="arraybuffer"),y)if(T&&T!=="none"){let ee=y.data;if(T==="form_data"){let Y=ee,Se=new Fv.default;for(let{fieldName:te,fieldType:q,textFieldValue:B,fileFieldValue:J}of Y)q==="text"&&!Gi(B)?Se.append(te,B):q==="file"&&!Gi(J)&&Se.append(te,J.data,{filename:J?.filename});Z.body=Se,Z.headers={...Z.headers,...Se.getHeaders()}}else Z.body=ee}else T||(Z.body=y);try{let ee=await On.sendRequest(Z);return await $C(p.files,ee.body,ee.status,ee.headers,N)}catch(ee){if(P)return Ny({error:ee,requestBody:Z.body});throw ee}},"run")})}o(Bv,"createCustomApiCallAction");var $C=o(async(t,e,r,n,i)=>{let s;if(i&&kC(e)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=RC(c??"")||"txt",l;e instanceof ArrayBuffer?l=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?l=e:l=Buffer.from(e),s=await t.write({fileName:`output.${d}`,data:l})}else s=e;return{status:r,headers:n,body:s}},"handleBinaryResponse"),kC=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var ea={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:c}){switch(t.strategy){case 0:{let d=await e.get("lastPoll");if(ft(d))throw new Error("lastPoll doesn't exist in the store.");let l=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:d,server:c}),p=l.reduce((f,_)=>Math.max(f,_.epochMilliSeconds),d);return await e.put("lastPoll",p),l.filter(f=>f.epochMilliSeconds>d).map(f=>f.data)}case 1:{let d=await e.get("lastItem"),l=await t.items({store:e,auth:r,propsValue:n,lastItemId:d,files:s,server:c}),p=l.findIndex(h=>h.id===d),f=[];ft(d)||p==-1?f=l??[]:f=l?.slice(0,p)??[],ft(i)||(f=f.slice(-i));let _=f?.[0]?.id;return ft(_)||await e.put("lastItem",_),f.map(h=>h.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i}){switch(t.strategy){case 0:{await e.put("lastPoll",Date.now());break}case 1:{let c=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;ft(c)?await e.delete("lastItem"):await e.put("lastItem",c);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:i,server:s}){let c=[];switch(t.strategy){case 0:{c=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:s});break}}return NC(c.map(d=>d.data))}};function NC(t){return t.length<=5?t:t.slice(0,5)}o(NC,"getFirstFiveOrAll");var kn={baseUrl:"https://people.googleapis.com/v1/people"};var mr=Ml.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:["https://www.googleapis.com/auth/contacts"]});var Vv=wn({auth:mr,name:"add_contact",description:"Add a contact to a Google Contacts account",audience:"both",aiMetadata:{description:"Creates a new person in the authenticated Google Contacts account from name, email, phone, company, and job title fields. Use when an agent needs to add someone to address book contacts; first and last name are required. Not idempotent \u2014 each call creates a separate contact even with identical input, so guard against duplicates.",idempotent:!1},displayName:"Add Contact",props:{firstName:Te.ShortText({displayName:"First Name",description:"The first name of the contact",required:!0}),middleName:Te.ShortText({displayName:"Middle Name",description:"The middle name of the contact",required:!1}),lastName:Te.ShortText({displayName:"Last Name",description:"The last name of the contact",required:!0}),jobTitle:Te.ShortText({displayName:"Job Title",description:"The job title of the contact",required:!1}),company:Te.ShortText({displayName:"Company",description:"The company of the contact",required:!1}),email:Te.ShortText({displayName:"Email",description:"The email address of the contact",required:!1}),phoneNumber:Te.ShortText({displayName:"Phone Number",description:"The phone number of the contact",required:!1})},async run(t){let e={names:[{givenName:t.propsValue.firstName,middleName:t.propsValue.middleName,familyName:t.propsValue.lastName}]},r={};t.propsValue.email&&(r.emailAddresses=[{value:t.propsValue.email}]),t.propsValue.phoneNumber&&(r.phoneNumbers=[{value:t.propsValue.phoneNumber}]),(t.propsValue.company||t.propsValue.jobTitle)&&(r.organizations=[{name:t.propsValue.company||void 0,title:t.propsValue.jobTitle||void 0}]),e={...e,...r};let n={method:"POST",url:`${kn.baseUrl}:createContact`,body:e,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token}};return(await On.sendRequest(n)).body}});var Hv=wn({auth:mr,name:"update_contact",description:"Update a contact in Google Contacts account.",audience:"both",aiMetadata:{description:"Updates fields (name, email, phone, company, job title) on an existing Google Contacts person identified by its resourceName (people/{id}). Use when an agent needs to modify a known contact; requires both the resourceName and the current etag, and a field mask listing which fields to update \u2014 the call is rejected if the contact changed since the etag was fetched. Repeating the same update with the same etag/values is safe and yields the same result.",idempotent:!0},displayName:"Update Contact",props:{resourceName:Te.ShortText({displayName:"Resource Name",description:"The resource name for the person, assigned by the server. An ASCII string in the form of people/{person_id}.",required:!0}),etag:Te.ShortText({displayName:"Etag",description:"The `etag` ensures contact updates only apply if the contact hasn't changed since last retrieved.",required:!0}),updatePersonFields:Te.StaticMultiSelectDropdown({displayName:"Update Field Mask",description:"A field mask to restrict which fields on the person are updated.",required:!0,options:{options:[{label:"Names",value:"names"},{label:"Email",value:"emailAddresses"},{label:"Phone Number",value:"phoneNumbers"},{label:"Job Title / Company",value:"organizations"}]},defaultValue:["names","emailAddresses"]}),firstName:Te.ShortText({displayName:"First Name",description:"The first name of the contact",required:!1}),middleName:Te.ShortText({displayName:"Middle Name",description:"The middle name of the contact",required:!1}),lastName:Te.ShortText({displayName:"Last Name",description:"The last name of the contact",required:!1}),jobTitle:Te.ShortText({displayName:"Job Title",description:"The job title of the contact",required:!1}),company:Te.ShortText({displayName:"Company",description:"The company of the contact",required:!1}),email:Te.ShortText({displayName:"Email",description:"The email address of the contact",required:!1}),phoneNumber:Te.ShortText({displayName:"Phone Number",description:"The phone number of the contact",required:!1})},async run(t){let e=t.propsValue.resourceName.substring(6),r={etag:t.propsValue.etag},n={updatePersonFields:t.propsValue.updatePersonFields.join(",")};(t.propsValue.firstName||t.propsValue.middleName||t.propsValue.lastName)&&(r.names=[{givenName:t.propsValue.firstName||void 0,middleName:t.propsValue.middleName||void 0,familyName:t.propsValue.lastName||void 0}]),t.propsValue.email&&(r.emailAddresses=[{value:t.propsValue.email}]),t.propsValue.phoneNumber&&(r.phoneNumbers=[{value:t.propsValue.phoneNumber}]),(t.propsValue.company||t.propsValue.jobTitle)&&(r.organizations=[{name:t.propsValue.company||void 0,title:t.propsValue.jobTitle||void 0}]);let i={method:"PATCH",url:`${kn.baseUrl}${e}:updateContact`,body:r,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token},queryParams:n};return(await On.sendRequest(i)).body}});var Gv=wn({auth:mr,name:"search_contact",description:"Search contacts in Google Contacts account.",audience:"both",aiMetadata:{description:"Searches the authenticated Google Contacts account for people matching a plain-text query, which prefix-matches against contact fields. Use when an agent needs to find a contact or its resourceName before updating it; the query is required and a read mask selects which fields come back (max 30 results). Read-only and idempotent.",idempotent:!0},displayName:"Search Contacts",props:{query:Te.ShortText({displayName:"Query",description:'The plain-text query for the request.The query is used to match prefix phrases of the fields on a person. For example, a person with name "foo name" matches queries such as "f", "fo", "foo", "foo n", "nam", etc., but not "oo n".',required:!0}),readMask:Te.StaticMultiSelectDropdown({displayName:"Read Mask",description:"A field mask to restrict which fields on each person are returned.",required:!0,options:{options:[{label:"addresses",value:"addresses"},{label:"ageRanges",value:"ageRanges"},{label:"biographies",value:"biographies"},{label:"birthdays",value:"birthdays"},{label:"calendarUrls",value:"calendarUrls"},{label:"clientData",value:"clientData"},{label:"coverPhotos",value:"coverPhotos"},{label:"emailAddresses",value:"emailAddresses"},{label:"events",value:"events"},{label:"externalIds",value:"externalIds"},{label:"genders",value:"genders"},{label:"imClients",value:"imClients"},{label:"interests",value:"interests"},{label:"locales",value:"locales"},{label:"locations",value:"locations"},{label:"memberships",value:"memberships"},{label:"metadata",value:"metadata"},{label:"miscKeywords",value:"miscKeywords"},{label:"names",value:"names"},{label:"nicknames",value:"nicknames"},{label:"occupations",value:"occupations"},{label:"organizations",value:"organizations"},{label:"phoneNumbers",value:"phoneNumbers"},{label:"photos",value:"photos"},{label:"relations",value:"relations"},{label:"sipAddresses",value:"sipAddresses"},{label:"skills",value:"skills"},{label:"urls",value:"urls"},{label:"userDefined",value:"userDefined"}]},defaultValue:["names","emailAddresses"]}),pageSize:Te.Number({displayName:"Page Size",description:"The number of results to return. Maximum 30.",required:!1})},async run(t){let e={query:t.propsValue.query,readMask:t.propsValue.readMask.join(",")};t.propsValue.pageSize&&(e.pageSize=String(t.propsValue.pageSize));let r={method:"GET",url:`${kn.baseUrl}:searchContacts`,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token},queryParams:e};return(await On.sendRequest(r)).body}});var hx=pt(fx()),gx=pt($a()),yx=pt(mx());var Oc={strategy:0,items:o(async({store:t,auth:e})=>{let r=new gx.OAuth2Client;r.setCredentials(e);let n=(0,hx.people)({version:"v1",auth:r}),i,s=[];do{let c=await n.people.connections.list({resourceName:"people/me",pageToken:i,pageSize:100,sortOrder:"LAST_MODIFIED_DESCENDING",personFields:["addresses","ageRanges","biographies","birthdays","calendarUrls","clientData","coverPhotos","emailAddresses","events","externalIds","genders","imClients","interests","locales","locations","memberships","metadata","miscKeywords","names","nicknames","occupations","organizations","phoneNumbers","photos","relations","sipAddresses","skills","urls","userDefined"].join()});for(let d of c.data.connections||[])d.metadata?.deleted!==!0&&s.push({data:d,epochMilliSeconds:(0,yx.default)(d.metadata?.sources?.[0].updateTime).valueOf()});i=c.data.nextPageToken}while(i);return s},"items")},_x=Ay({auth:mr,name:"new_or_updated_contact",displayName:"New Or Updated Contact",description:"Triggers when there is a new or updated contact",aiMetadata:{description:"Fires when a contact in the authenticated Google Contacts account is newly created or has been modified since the last poll. Each event represents one person record with its current fields; deleted contacts are excluded."},props:{},sampleData:{resourceName:"people/c4278485694217203807",etag:"%EiMBAgMFBgcICQoLDA0ODxATFBUWGSEiIyQlJicuNDU3PT4/QBoEAQIFByIMZFVwNlJPNEVKUzg9",metadata:{sources:[{type:"CONTACT",id:"3b603c120c68305f",etag:"#dUp6RO4EJS8=",updateTime:"2023-01-30T14:35:18.142565Z"}],objectType:"PERSON"},names:[{metadata:{primary:!0,source:{type:"CONTACT",id:"3b603c120c68305f"}},displayName:"Shahed Mashni",familyName:"Mashni",givenName:"Shahed",displayNameLastFirst:"Mashni, Shahed",unstructuredName:"Shahed Mashni"}],photos:[{metadata:{primary:!0,source:{type:"CONTACT",id:"3b603c120c68305f"}},url:"https://lh3.googleusercontent.com/cm/AAkddurmZojs4vCcxrpkfSxH9tnqcH-hI82ESDnwv6eq86nZeLStcjYEIe_TCx8r8g5Y=s100",default:!0}],memberships:[{metadata:{source:{type:"CONTACT",id:"3b603c120c68305f"}},contactGroupMembership:{contactGroupId:"myContacts",contactGroupResourceName:"contactGroups/myContacts"}}]},type:"POLLING",async onEnable(t){return await ea.onEnable(Oc,{store:t.store,auth:t.auth,propsValue:{}})},async onDisable(t){return await ea.onEnable(Oc,{store:t.store,auth:t.auth,propsValue:{}})},async run(t){return await ea.poll(Oc,{store:t.store,auth:t.auth,propsValue:{},files:t.files})},test:o(async t=>await ea.test(Oc,{store:t.store,auth:t.auth,propsValue:{},files:t.files}),"test")});var T1=Iy({minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/google-contacts.png",categories:["SALES_AND_CRM"],actions:[Vv,Hv,Gv,Bv({baseUrl:o(()=>kn.baseUrl,"baseUrl"),auth:mr,authMapping:o(async t=>({Authorization:`Bearer ${t.access_token}`}),"authMapping")})],displayName:"Google Contacts",description:"Stay connected and organized",authors:["Abdallah-Alwarawreh","Salem-Alaa","kishanprmr","MoShizzle","khaledmashaly","abuaboud","ikus060"],triggers:[_x],auth:mr});0&&(module.exports={googleContacts});
68
+ `)}P+=T,e.data=P}if(o(f,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,i){r.uploadType="multipart";let g=[{"content-type":"application/json",body:JSON.stringify(i)},{"content-type":n.mimeType||i&&i.mimeType||c,body:n.body}];(0,om.isBrowser)()?f(g):p(g)}else r.uploadType="media",Object.assign(d,{"content-type":n.mimeType||c}),e.data=n.body;else e.data=i||void 0;if(e.headers=rm.Gaxios.mergeHeaders(e.headers||{},d),e.params=r,!(0,om.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:nx.version,comment:"gzip"});let g=e.userAgentDirectives.map(y=>{let T=`${y.product}/${y.version}`;return y.comment&&(T+=` (${y.comment})`),T}).join(" ");e.headers.set("User-Agent",g)}if(e.validateStatus||(e.validateStatus=g=>g>=200&&g<300||g===304),e.retry=e.retry===void 0?!0:e.retry,delete e.auth,e.universeDomain&&e.universe_domain&&e.universeDomain!==e.universe_domain)throw new Error("Please set either universe_domain or universeDomain, but not both.");let _=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,h=e.universeDomain??e.universe_domain??_??"googleapis.com";if(h!=="googleapis.com"&&e.url){let g=new URL(e.url);g.hostname.endsWith(".googleapis.com")&&(g.hostname=g.hostname.replace(/googleapis\.com$/,h),e.url=g.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let g=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(g&&h!==g)throw new Error(`The configured universe domain (${h}) does not match the universe domain found in the credentials (${g}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let y=await s.getRequestHeaders(e.url),T=Object.assign({},e);return T.headers=rm.Gaxios.mergeHeaders(T.headers,y),i1.request(T)}else{let y=await s.request(e);return(0,nm.marshallGaxiosResponse)(y)}}else return new rm.Gaxios().request(e).then(g=>(0,nm.marshallGaxiosResponse)(g))}o(tx,"createAPIRequestAsync");var im=class extends rx.Transform{static{o(this,"ProgressStream")}bytesRead=0;_transform(e,r,n){this.bytesRead+=e.length,this.emit("progress",this.bytesRead),this.push(e),n()}};function c1(t,e){(0,om.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${nx.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o(c1,"populateAPIHeader")});var ox=k(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.AuthPlus=void 0;var ln=$a(),sm=class extends ln.GoogleAuth{static{o(this,"AuthPlus")}JWT=ln.JWT;Compute=ln.Compute;OAuth2=ln.OAuth2Client;GoogleAuth=ln.GoogleAuth;AwsClient=ln.AwsClient;IdentityPoolClient=ln.IdentityPoolClient;ExternalAccountClient=ln.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new ln.GoogleAuth(e),this._cachedAuth.getClient()}getProjectId(e){return e?this._cachedAuth?this._cachedAuth.getProjectId(e):super.getProjectId(e):this._cachedAuth?this._cachedAuth.getProjectId():super.getProjectId()}};xc.AuthPlus=sm});var cm=k(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.Endpoint=void 0;var ix=Tc(),um=class{static{o(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,i){if(this.applyMethodsFromSchema(e,r,n,i),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let c=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,c,i)}}}applyMethodsFromSchema(e,r,n,i){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let c=n.methods[s];e[s]=this.makeMethod(r,c,i)}}}makeMethod(e,r,n){return(i,s)=>{let c=typeof i=="function"?{}:i;s=typeof i=="function"?i:s;let d=ax(e.rootUrl+e.servicePath+r.path),l={options:{url:d.substring(1,d.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:c,requiredParams:r.parameterOrder||[],pathParams:this.getPathParams(r.parameters),context:n};if(r.mediaUpload&&r.mediaUpload.protocols&&r.mediaUpload.protocols.simple&&r.mediaUpload.protocols.simple.path){let p=ax(e.rootUrl+r.mediaUpload.protocols.simple.path);l.mediaUrl=p.substring(1,p.length-1)}if(!s)return(0,ix.createAPIRequest)(l);(0,ix.createAPIRequest)(l,s)}}getPathParams(e){let r=new Array;return typeof e!="object"&&(e={}),Object.keys(e).forEach(n=>{e[n].location==="path"&&r.push(n)}),r}};Ac.Endpoint=um;function ax(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(ax,"buildurl")});var ux=k(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.Discovery=void 0;var l1=require("fs"),d1=st(),p1=require("url"),sx=require("util"),f1=Tc(),m1=cm(),h1=sx.promisify(l1.readFile),lm=class{static{o(this,"Discovery")}transporter=new d1.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new m1.Endpoint(r);return n.applySchema(n,e,e,n),n}}log(...e){this.options&&this.options.debug&&console.log(...e)}async discoverAllAPIs(e){let r=new Headers(this.options.includePrivate?{}:{"X-User-Ip":"0.0.0.0"}),i=(await this.transporter.request({url:e,headers:r})).data.items,s=await Promise.all(i.map(async l=>{let p=await this.discoverAPI(l.discoveryRestUrl);return{api:l,endpointCreator:p}})),c={},d={};for(let l of s)d[l.api.name]||(c[l.api.name]={},d[l.api.name]=p=>{let f=typeof p,_;if(f==="string")_=p,p={};else if(f==="object")_=p.version,delete p.version;else throw new Error("Argument error: Accepts only string or object");try{let h=l.endpointCreator(p,this);return Object.freeze(h)}catch(h){throw new Error(sx.format('Unable to load endpoint %s("%s"): %s',l.api.name,_,h.message))}}),c[l.api.name][l.api.version]=l.endpointCreator;return d}async discoverAPI(e){if(typeof e=="string"){let r=p1.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await h1(e,{encoding:"utf8"});return this.makeEndpoint(JSON.parse(n))}else{this.log("Requesting "+e);let n=await this.transporter.request({url:e});return this.makeEndpoint(n.data)}}else{let r=e;this.log("Requesting "+r.url);let n=r.url;delete r.url;let i={options:{url:n,method:"GET"},requiredParams:[],pathParams:[],params:r,context:{google:{_options:{}},_options:{}}},s=await(0,f1.createAPIRequest)(i);return this.makeEndpoint(s.data)}}};wc.Discovery=lm});var Ic=k(xe=>{"use strict";var g1=xe&&xe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y1=xe&&xe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&g1(e,t,r)};Object.defineProperty(xe,"__esModule",{value:!0});xe.Endpoint=xe.Discovery=xe.AuthPlus=xe.createAPIRequest=xe.getAPI=xe.GaxiosError=xe.Gaxios=xe.AwsClient=xe.IdentityPoolClient=xe.BaseExternalAccountClient=xe.ExternalAccountClient=xe.GoogleAuth=xe.UserRefreshClient=xe.Compute=xe.JWT=xe.OAuth2Client=xe.gaxios=xe.googleAuthLibrary=void 0;xe.googleAuthLibrary=$a();xe.gaxios=st();var dn=$a();Object.defineProperty(xe,"OAuth2Client",{enumerable:!0,get:o(function(){return dn.OAuth2Client},"get")});Object.defineProperty(xe,"JWT",{enumerable:!0,get:o(function(){return dn.JWT},"get")});Object.defineProperty(xe,"Compute",{enumerable:!0,get:o(function(){return dn.Compute},"get")});Object.defineProperty(xe,"UserRefreshClient",{enumerable:!0,get:o(function(){return dn.UserRefreshClient},"get")});Object.defineProperty(xe,"GoogleAuth",{enumerable:!0,get:o(function(){return dn.GoogleAuth},"get")});Object.defineProperty(xe,"ExternalAccountClient",{enumerable:!0,get:o(function(){return dn.ExternalAccountClient},"get")});Object.defineProperty(xe,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return dn.BaseExternalAccountClient},"get")});Object.defineProperty(xe,"IdentityPoolClient",{enumerable:!0,get:o(function(){return dn.IdentityPoolClient},"get")});Object.defineProperty(xe,"AwsClient",{enumerable:!0,get:o(function(){return dn.AwsClient},"get")});var cx=st();Object.defineProperty(xe,"Gaxios",{enumerable:!0,get:o(function(){return cx.Gaxios},"get")});Object.defineProperty(xe,"GaxiosError",{enumerable:!0,get:o(function(){return cx.GaxiosError},"get")});var _1=QE();Object.defineProperty(xe,"getAPI",{enumerable:!0,get:o(function(){return _1.getAPI},"get")});var v1=Tc();Object.defineProperty(xe,"createAPIRequest",{enumerable:!0,get:o(function(){return v1.createAPIRequest},"get")});var b1=ox();Object.defineProperty(xe,"AuthPlus",{enumerable:!0,get:o(function(){return b1.AuthPlus},"get")});var P1=ux();Object.defineProperty(xe,"Discovery",{enumerable:!0,get:o(function(){return P1.Discovery},"get")});var S1=cm();Object.defineProperty(xe,"Endpoint",{enumerable:!0,get:o(function(){return S1.Endpoint},"get")});y1(Ec(),xe)});var dx=k(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.people_v1=void 0;var me=Ic(),lx;(function(t){class e{static{o(this,"People")}context;contactGroups;otherContacts;people;constructor(l,p){this.context={_options:l||{},google:p},this.contactGroups=new r(this.context),this.otherContacts=new i(this.context),this.people=new s(this.context)}}t.People=e;class r{static{o(this,"Resource$Contactgroups")}context;members;constructor(l){this.context=l,this.members=new n(this.context)}batchGet(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups:batchGet").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}create(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}delete(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}get(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}list(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}update(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$Contactgroups=r;class n{static{o(this,"Resource$Contactgroups$Members")}context;constructor(l){this.context=l}modify(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}/members:modify").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$Contactgroups$Members=n;class i{static{o(this,"Resource$Othercontacts")}context;constructor(l){this.context=l}copyOtherContactToMyContactsGroup(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:copyOtherContactToMyContactsGroup").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}list(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/otherContacts").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}search(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/otherContacts:search").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$Othercontacts=i;class s{static{o(this,"Resource$People")}context;connections;constructor(l){this.context=l,this.connections=new c(this.context)}batchCreateContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchCreateContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}batchDeleteContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchDeleteContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}batchUpdateContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchUpdateContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}createContact(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:createContact").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}deleteContact(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:deleteContact").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}deleteContactPhoto(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:deleteContactPhoto").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}get(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}getBatchGet(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchGet").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}listDirectoryPeople(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:listDirectoryPeople").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}searchContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:searchContacts").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}searchDirectoryPeople(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:searchDirectoryPeople").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}updateContact(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:updateContact").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}updateContactPhoto(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:updateContactPhoto").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$People=s;class c{static{o(this,"Resource$People$Connections")}context;constructor(l){this.context=l}list(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}/connections").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$People$Connections=c})(lx||(Rc.people_v1=lx={}))});var mx=k(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.AuthPlus=ur.people_v1=ur.auth=ur.VERSIONS=void 0;ur.people=E1;var px=Ic(),fx=dx();Object.defineProperty(ur,"people_v1",{enumerable:!0,get:o(function(){return fx.people_v1},"get")});ur.VERSIONS={v1:fx.people_v1.People};function E1(t){return(0,px.getAPI)("people",t,ur.VERSIONS,this)}o(E1,"people");var T1=new px.AuthPlus;ur.auth=T1;var x1=Ic();Object.defineProperty(ur,"AuthPlus",{enumerable:!0,get:o(function(){return x1.AuthPlus},"get")})});var hx=k((dm,pm)=>{(function(t,e){typeof dm=="object"&&typeof pm<"u"?pm.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(dm,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",s="minute",c="hour",d="day",l="week",p="month",f="quarter",_="year",h="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,P={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o(function(te){var q=["th","st","nd","rd"],B=te%100;return"["+te+(q[(B-20)%10]||q[B]||q[0])+"]"},"ordinal")},x=o(function(te,q,B){var J=String(te);return!J||J.length>=q?te:""+Array(q+1-J.length).join(B)+te},"m"),N={s:x,z:o(function(te){var q=-te.utcOffset(),B=Math.abs(q),J=Math.floor(B/60),K=B%60;return(q<=0?"+":"-")+x(J,2,"0")+":"+x(K,2,"0")},"z"),m:o(function te(q,B){if(q.date()<B.date())return-te(B,q);var J=12*(B.year()-q.year())+(B.month()-q.month()),K=q.clone().add(J,p),re=B-K<0,oe=q.clone().add(J+(re?-1:1),p);return+(-(J+(B-K)/(re?K-oe:oe-K))||0)},"t"),a:o(function(te){return te<0?Math.ceil(te)||0:Math.floor(te)},"a"),p:o(function(te){return{M:p,y:_,w:l,d,D:h,h:c,m:s,s:i,ms:n,Q:f}[te]||String(te||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(te){return te===void 0},"u")},L="en",X={};X[L]=P;var W=o(function(te){return te instanceof Y},"p"),G=o(function te(q,B,J){var K;if(!q)return L;if(typeof q=="string"){var re=q.toLowerCase();X[re]&&(K=re),B&&(X[re]=B,K=re);var oe=q.split("-");if(!K&&oe.length>1)return te(oe[0])}else{var Ae=q.name;X[Ae]=q,K=Ae}return!J&&K&&(L=K),K||!J&&L},"t"),Z=o(function(te,q){if(W(te))return te.clone();var B=typeof q=="object"?q:{};return B.date=te,B.args=arguments,new Y(B)},"w"),ee=N;ee.l=G,ee.i=W,ee.w=function(te,q){return Z(te,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var Y=(function(){function te(B){this.$L=G(B.locale,null,!0),this.parse(B)}o(te,"M");var q=te.prototype;return q.parse=function(B){this.$d=(function(J){var K=J.date,re=J.utc;if(K===null)return new Date(NaN);if(ee.u(K))return new Date;if(K instanceof Date)return new Date(K);if(typeof K=="string"&&!/Z$/i.test(K)){var oe=K.match(y);if(oe){var Ae=oe[2]-1||0,Oe=(oe[7]||"0").substring(0,3);return re?new Date(Date.UTC(oe[1],Ae,oe[3]||1,oe[4]||0,oe[5]||0,oe[6]||0,Oe)):new Date(oe[1],Ae,oe[3]||1,oe[4]||0,oe[5]||0,oe[6]||0,Oe)}}return new Date(K)})(B),this.$x=B.x||{},this.init()},q.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},q.$utils=function(){return ee},q.isValid=function(){return this.$d.toString()!==g},q.isSame=function(B,J){var K=Z(B);return this.startOf(J)<=K&&K<=this.endOf(J)},q.isAfter=function(B,J){return Z(B)<this.startOf(J)},q.isBefore=function(B,J){return this.endOf(J)<Z(B)},q.$g=function(B,J,K){return ee.u(B)?this[J]:this.set(K,B)},q.unix=function(){return Math.floor(this.valueOf()/1e3)},q.valueOf=function(){return this.$d.getTime()},q.startOf=function(B,J){var K=this,re=!!ee.u(J)||J,oe=ee.p(B),Ae=o(function(Nt,Fe){var qe=ee.w(K.$u?Date.UTC(K.$y,Fe,Nt):new Date(K.$y,Fe,Nt),K);return re?qe:qe.endOf(d)},"l"),Oe=o(function(Nt,Fe){return ee.w(K.toDate()[Nt].apply(K.toDate("s"),(re?[0,0,0,0]:[23,59,59,999]).slice(Fe)),K)},"$"),Be=this.$W,Ge=this.$M,ht=this.$D,Q="set"+(this.$u?"UTC":"");switch(oe){case _:return re?Ae(1,0):Ae(31,11);case p:return re?Ae(1,Ge):Ae(0,Ge+1);case l:var tt=this.$locale().weekStart||0,it=(Be<tt?Be+7:Be)-tt;return Ae(re?ht-it:ht+(6-it),Ge);case d:case h:return Oe(Q+"Hours",0);case c:return Oe(Q+"Minutes",1);case s:return Oe(Q+"Seconds",2);case i:return Oe(Q+"Milliseconds",3);default:return this.clone()}},q.endOf=function(B){return this.startOf(B,!1)},q.$set=function(B,J){var K,re=ee.p(B),oe="set"+(this.$u?"UTC":""),Ae=(K={},K[d]=oe+"Date",K[h]=oe+"Date",K[p]=oe+"Month",K[_]=oe+"FullYear",K[c]=oe+"Hours",K[s]=oe+"Minutes",K[i]=oe+"Seconds",K[n]=oe+"Milliseconds",K)[re],Oe=re===d?this.$D+(J-this.$W):J;if(re===p||re===_){var Be=this.clone().set(h,1);Be.$d[Ae](Oe),Be.init(),this.$d=Be.set(h,Math.min(this.$D,Be.daysInMonth())).$d}else Ae&&this.$d[Ae](Oe);return this.init(),this},q.set=function(B,J){return this.clone().$set(B,J)},q.get=function(B){return this[ee.p(B)]()},q.add=function(B,J){var K,re=this;B=Number(B);var oe=ee.p(J),Ae=o(function(Ge){var ht=Z(re);return ee.w(ht.date(ht.date()+Math.round(Ge*B)),re)},"y");if(oe===p)return this.set(p,this.$M+B);if(oe===_)return this.set(_,this.$y+B);if(oe===d)return Ae(1);if(oe===l)return Ae(7);var Oe=(K={},K[s]=e,K[c]=r,K[i]=t,K)[oe]||1,Be=this.$d.getTime()+B*Oe;return ee.w(Be,this)},q.subtract=function(B,J){return this.add(-1*B,J)},q.format=function(B){var J=this,K=this.$locale();if(!this.isValid())return K.invalidDate||g;var re=B||"YYYY-MM-DDTHH:mm:ssZ",oe=ee.z(this),Ae=this.$H,Oe=this.$m,Be=this.$M,Ge=K.weekdays,ht=K.months,Q=K.meridiem,tt=o(function(Fe,qe,v,E){return Fe&&(Fe[qe]||Fe(J,re))||v[qe].slice(0,E)},"h"),it=o(function(Fe){return ee.s(Ae%12||12,Fe,"0")},"d"),Nt=Q||function(Fe,qe,v){var E=Fe<12?"AM":"PM";return v?E.toLowerCase():E};return re.replace(T,(function(Fe,qe){return qe||(function(v){switch(v){case"YY":return String(J.$y).slice(-2);case"YYYY":return ee.s(J.$y,4,"0");case"M":return Be+1;case"MM":return ee.s(Be+1,2,"0");case"MMM":return tt(K.monthsShort,Be,ht,3);case"MMMM":return tt(ht,Be);case"D":return J.$D;case"DD":return ee.s(J.$D,2,"0");case"d":return String(J.$W);case"dd":return tt(K.weekdaysMin,J.$W,Ge,2);case"ddd":return tt(K.weekdaysShort,J.$W,Ge,3);case"dddd":return Ge[J.$W];case"H":return String(Ae);case"HH":return ee.s(Ae,2,"0");case"h":return it(1);case"hh":return it(2);case"a":return Nt(Ae,Oe,!0);case"A":return Nt(Ae,Oe,!1);case"m":return String(Oe);case"mm":return ee.s(Oe,2,"0");case"s":return String(J.$s);case"ss":return ee.s(J.$s,2,"0");case"SSS":return ee.s(J.$ms,3,"0");case"Z":return oe}return null})(Fe)||oe.replace(":","")}))},q.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},q.diff=function(B,J,K){var re,oe=this,Ae=ee.p(J),Oe=Z(B),Be=(Oe.utcOffset()-this.utcOffset())*e,Ge=this-Oe,ht=o(function(){return ee.m(oe,Oe)},"D");switch(Ae){case _:re=ht()/12;break;case p:re=ht();break;case f:re=ht()/3;break;case l:re=(Ge-Be)/6048e5;break;case d:re=(Ge-Be)/864e5;break;case c:re=Ge/r;break;case s:re=Ge/e;break;case i:re=Ge/t;break;default:re=Ge}return K?re:ee.a(re)},q.daysInMonth=function(){return this.endOf(p).$D},q.$locale=function(){return X[this.$L]},q.locale=function(B,J){if(!B)return this.$L;var K=this.clone(),re=G(B,J,!0);return re&&(K.$L=re),K},q.clone=function(){return ee.w(this.$d,this)},q.toDate=function(){return new Date(this.valueOf())},q.toJSON=function(){return this.isValid()?this.toISOString():null},q.toISOString=function(){return this.$d.toISOString()},q.toString=function(){return this.$d.toUTCString()},te})(),Se=Y.prototype;return Z.prototype=Se,[["$ms",n],["$s",i],["$m",s],["$H",c],["$W",d],["$M",p],["$y",_],["$D",h]].forEach((function(te){Se[te[1]]=function(q){return this.$g(q,te[0],te[1])}})),Z.extend=function(te,q){return te.$i||(te(q,Y,Z),te.$i=!0),Z},Z.locale=G,Z.isDayjs=W,Z.unix=function(te){return Z(1e3*te)},Z.en=X[L],Z.Ls=X,Z.p={},Z}))});var w1={};gs(w1,{googleContacts:()=>A1});module.exports=aw(w1);var sw=Object.freeze({status:"aborted"});function ae(t,e,r){function n(d,l){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:l,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(t))return;d._zod.traits.add(t),e(d,l);let p=c.prototype,f=Object.keys(p);for(let _=0;_<f.length;_++){let h=f[_];h in d||(d[h]=p[h].bind(d))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(d){var l;let p=r?.Parent?new s:this;n(p,d),(l=p._zod).deferred??(l.deferred=[]);for(let f of p._zod.deferred)f();return p}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}o(ae,"$constructor");var xr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ys=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},ol={};function Jr(t){return t&&Object.assign(ol,t),ol}o(Jr,"config");function al(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}o(al,"getEnumValues");function yh(t,e){return typeof e=="bigint"?e.toString():e}o(yh,"jsonStringifyReplacer");function vs(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(vs,"cached");function _h(t){return t==null}o(_h,"nullish");function bs(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(bs,"cleanRegex");var gh=Symbol("evaluating");function ut(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==gh)return n===void 0&&(n=gh,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(ut,"defineLazy");var sl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Ri(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(Ri,"isObject");var uw=vs(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function vh(t){if(Ri(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Ri(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(vh,"isPlainObject");var bh=new Set(["string","number","symbol"]);function Co(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Co,"escapeRegex");function Ps(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}o(Ps,"clone");function Xe(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:o(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:o(()=>e.error,"error")}:e}o(Xe,"normalizeParams");function Ph(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(Ph,"optionalKeys");var Sh={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function $o(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}o($o,"aborted");function bn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(bn,"prefixIssues");function _s(t){return typeof t=="string"?t:t?.message}o(_s,"unwrapMessage");function Pn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=_s(t.inst?._zod.def?.error?.(t))??_s(e?.error?.(t))??_s(r.customError?.(t))??_s(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(Pn,"finalizeIssue");function Eh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(Eh,"getLengthableOrigin");function ul(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o(ul,"issue");var Th=o((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,yh,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),xh=ae("$ZodError",Th),Oi=ae("$ZodError",Th,{Parent:Error});var lw=o(t=>(e,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new xr;if(c.issues.length){let d=new(i?.Err??t)(c.issues.map(l=>Pn(l,s,Jr())));throw sl(d,i?.callee),d}return c.value},"_parse"),Ss=lw(Oi),dw=o(t=>async(e,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??t)(c.issues.map(l=>Pn(l,s,Jr())));throw sl(d,i?.callee),d}return c.value},"_parseAsync"),Es=dw(Oi),pw=o(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new xr;return s.issues.length?{success:!1,error:new(t??xh)(s.issues.map(c=>Pn(c,i,Jr())))}:{success:!0,data:s.value}},"_safeParse"),Ci=pw(Oi),fw=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>Pn(c,i,Jr())))}:{success:!0,data:s.value}},"_safeParseAsync"),$i=fw(Oi);var mw="(?:(?:\\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])))",hw=new RegExp(`^${mw}$`);var Ah=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),wh=/^-?\d+n?$/,Ih=/^-?\d+$/,cl=/^-?\d+(?:\.\d+)?$/,Rh=/^(?:true|false)$/i;var Sn=ae("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),gw={number:"number",bigint:"bigint",object:"date"};var Oh=ae("$ZodCheckGreaterThan",(t,e)=>{Sn.init(t,e);let r=gw[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}});var Ch=ae("$ZodCheckNumberFormat",(t,e)=>{Sn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,s]=Sh[e.format];t._zod.onattach.push(c=>{let d=c._zod.bag;d.format=e.format,d.minimum=i,d.maximum=s,r&&(d.pattern=Ih)}),t._zod.check=c=>{let d=c.value;if(r){if(!Number.isInteger(d)){c.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:d,inst:t});return}if(!Number.isSafeInteger(d)){d>0?c.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):c.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}d<i&&c.issues.push({origin:"number",input:d,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),d>s&&c.issues.push({origin:"number",input:d,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var $h=ae("$ZodCheckMinLength",(t,e)=>{var r;Sn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!_h(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let c=Eh(i);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var ll=ae("$ZodCheckStringFormat",(t,e)=>{var r,n;Sn.init(t,e),t._zod.onattach.push(i=>{let s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),kh=ae("$ZodCheckRegex",(t,e)=>{ll.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}});var zh={major:4,minor:3,patch:6};var rt=ae("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=zh;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let s of i._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=o((c,d,l)=>{let p=$o(c),f;for(let _ of d){if(_._zod.def.when){if(!_._zod.def.when(c))continue}else if(p)continue;let h=c.issues.length,g=_._zod.check(c);if(g instanceof Promise&&l?.async===!1)throw new xr;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,c.issues.length!==h&&(p||(p=$o(c,h)))});else{if(c.issues.length===h)continue;p||(p=$o(c,h))}}return f?f.then(()=>c):c},"runChecks"),s=o((c,d,l)=>{if($o(c))return c.aborted=!0,c;let p=i(d,n,l);if(p instanceof Promise){if(l.async===!1)throw new xr;return p.then(f=>t._zod.parse(f,l))}return t._zod.parse(p,l)},"handleCanaryResult");t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){let p=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(f=>s(f,c,d)):s(p,c,d)}let l=t._zod.parse(c,d);if(l instanceof Promise){if(d.async===!1)throw new xr;return l.then(p=>i(p,n,d))}return i(l,n,d)}}ut(t,"~standard",()=>({validate:o(i=>{try{let s=Ci(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return $i(t,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),As=ae("$ZodString",(t,e)=>{rt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Ah(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),dl=ae("$ZodStringFormat",(t,e)=>{ll.init(t,e),As.init(t,e)});var Lh=ae("$ZodURL",(t,e)=>{dl.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}});var pl=ae("$ZodNumber",(t,e)=>{rt.init(t,e),t._zod.pattern=t._zod.bag.pattern??cl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}}),Fh=ae("$ZodNumberFormat",(t,e)=>{Ch.init(t,e),pl.init(t,e)}),fl=ae("$ZodBoolean",(t,e)=>{rt.init(t,e),t._zod.pattern=Rh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),Bh=ae("$ZodBigInt",(t,e)=>{rt.init(t,e),t._zod.pattern=wh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}});var qh=ae("$ZodAny",(t,e)=>{rt.init(t,e),t._zod.parse=r=>r}),Vh=ae("$ZodUnknown",(t,e)=>{rt.init(t,e),t._zod.parse=r=>r});var Hh=ae("$ZodVoid",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),Gh=ae("$ZodDate",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:t}),r}});function Dh(t,e,r){t.issues.length&&e.issues.push(...bn(r,t.issues)),e.value[r]=t.value}o(Dh,"handleArrayResult");var Wh=ae("$ZodArray",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let s=[];for(let c=0;c<i.length;c++){let d=i[c],l=e.element._zod.run({value:d,issues:[]},n);l instanceof Promise?s.push(l.then(p=>Dh(p,r,c))):Dh(l,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function xs(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...bn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(xs,"handlePropertyResult");function yw(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Ph(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(yw,"normalizeDef");function _w(t,e,r,n,i,s){let c=[],d=i.keySet,l=i.catchall._zod,p=l.def.type,f=l.optout==="optional";for(let _ in e){if(d.has(_))continue;if(p==="never"){c.push(_);continue}let h=l.run({value:e[_],issues:[]},n);h instanceof Promise?t.push(h.then(g=>xs(g,r,_,e,f))):xs(h,r,_,e,f)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}o(_w,"handleCatchall");var Zh=ae("$ZodObject",(t,e)=>{if(rt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let d=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let l={...d};return Object.defineProperty(e,"shape",{value:l}),l},"get")})}let n=vs(()=>yw(e));ut(t._zod,"propValues",()=>{let d=e.shape,l={};for(let p in d){let f=d[p]._zod;if(f.values){l[p]??(l[p]=new Set);for(let _ of f.values)l[p].add(_)}}return l});let i=Ri,s=e.catchall,c;t._zod.parse=(d,l)=>{c??(c=n.value);let p=d.value;if(!i(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),d;d.value={};let f=[],_=c.shape;for(let h of c.keys){let g=_[h],y=g._zod.optout==="optional",T=g._zod.run({value:p[h],issues:[]},l);T instanceof Promise?f.push(T.then(P=>xs(P,d,h,p,y))):xs(T,d,h,p,y)}return s?_w(f,p,d,l,n.value,t):f.length?Promise.all(f).then(()=>d):d}});function Uh(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let i=t.filter(s=>!$o(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>Pn(c,n,Jr())))}),e)}o(Uh,"handleUnionResults");var ml=ae("$ZodUnion",(t,e)=>{rt.init(t,e),ut(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ut(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ut(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),ut(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>bs(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,d=[];for(let l of e.options){let p=l._zod.run({value:i.value,issues:[]},s);if(p instanceof Promise)d.push(p),c=!0;else{if(p.issues.length===0)return p;d.push(p)}}return c?Promise.all(d).then(l=>Uh(l,i,t,s)):Uh(d,i,t,s)}});var Kh=ae("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ml.init(t,e);let r=t._zod.parse;ut(t._zod,"propValues",()=>{let i={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[d,l]of Object.entries(c)){i[d]||(i[d]=new Set);for(let p of l)i[d].add(p)}}return i});let n=vs(()=>{let i=e.options,s=new Map;for(let c of i){let d=c._zod.propValues?.[e.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let l of d){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,c)}}return s});t._zod.parse=(i,s)=>{let c=i.value;if(!Ri(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),i;let d=n.value.get(c?.[e.discriminator]);return d?d._zod.run(i,s):e.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:c,path:[e.discriminator],inst:t}),i)}});var Jh=ae("$ZodRecord",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!vh(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let s=[],c=e.keyType._zod.values;if(c){r.value={};let d=new Set;for(let p of c)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){d.add(typeof p=="number"?p.toString():p);let f=e.valueType._zod.run({value:i[p],issues:[]},n);f instanceof Promise?s.push(f.then(_=>{_.issues.length&&r.issues.push(...bn(p,_.issues)),r.value[p]=_.value})):(f.issues.length&&r.issues.push(...bn(p,f.issues)),r.value[p]=f.value)}let l;for(let p in i)d.has(p)||(l=l??[],l.push(p));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:l})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let l=e.keyType._zod.run({value:d,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&cl.test(d)&&l.issues.length){let _=e.keyType._zod.run({value:Number(d),issues:[]},n);if(_ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");_.issues.length===0&&(l=_)}if(l.issues.length){e.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(_=>Pn(_,n,Jr())),input:d,path:[d],inst:t});continue}let f=e.valueType._zod.run({value:i[d],issues:[]},n);f instanceof Promise?s.push(f.then(_=>{_.issues.length&&r.issues.push(...bn(d,_.issues)),r.value[l.value]=_.value})):(f.issues.length&&r.issues.push(...bn(d,f.issues)),r.value[l.value]=f.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Yh=ae("$ZodEnum",(t,e)=>{rt.init(t,e);let r=al(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>bh.has(typeof i)).map(i=>typeof i=="string"?Co(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:t}),i}}),Xh=ae("$ZodLiteral",(t,e)=>{if(rt.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Co(n):n?Co(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var Qh=ae("$ZodTransform",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ys(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new xr;return r.value=i,r}});function Mh(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(Mh,"handleOptionalResult");var eg=ae("$ZodOptional",(t,e)=>{rt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ut(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ut(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bs(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Mh(s,r.value)):Mh(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var tg=ae("$ZodNullable",(t,e)=>{rt.init(t,e),ut(t._zod,"optin",()=>e.innerType._zod.optin),ut(t._zod,"optout",()=>e.innerType._zod.optout),ut(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bs(r.source)}|null)$`):void 0}),ut(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)});var rg=ae("$ZodPipe",(t,e)=>{rt.init(t,e),ut(t._zod,"values",()=>e.in._zod.values),ut(t._zod,"optin",()=>e.in._zod.optin),ut(t._zod,"optout",()=>e.out._zod.optout),ut(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Ts(c,e.in,n)):Ts(s,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Ts(s,e.out,n)):Ts(i,e.out,n)}});function Ts(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(Ts,"handlePipeResult");var ng=ae("$ZodCustom",(t,e)=>{Sn.init(t,e),rt.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(s=>jh(s,r,n,t));jh(i,r,n,t)}});function jh(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(ul(i))}}o(jh,"handleRefineResult");var ig;var hl=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ag(){return new hl}o(ag,"registry");(ig=globalThis).__zod_globalRegistry??(ig.__zod_globalRegistry=ag());var gl=globalThis.__zod_globalRegistry;function sg(t,e){return new t({type:"string",...Xe(e)})}o(sg,"_string");function ug(t,e){return new t({type:"string",coerce:!0,...Xe(e)})}o(ug,"_coercedString");function cg(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Xe(e)})}o(cg,"_url");function lg(t,e){return new t({type:"number",checks:[],...Xe(e)})}o(lg,"_number");function dg(t,e){return new t({type:"number",coerce:!0,checks:[],...Xe(e)})}o(dg,"_coercedNumber");function pg(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Xe(e)})}o(pg,"_int");function fg(t,e){return new t({type:"boolean",...Xe(e)})}o(fg,"_boolean");function mg(t,e){return new t({type:"boolean",coerce:!0,...Xe(e)})}o(mg,"_coercedBoolean");function hg(t,e){return new t({type:"bigint",coerce:!0,...Xe(e)})}o(hg,"_coercedBigint");function gg(t){return new t({type:"any"})}o(gg,"_any");function yg(t){return new t({type:"unknown"})}o(yg,"_unknown");function _g(t,e){return new t({type:"void",...Xe(e)})}o(_g,"_void");function vg(t,e){return new t({type:"date",coerce:!0,...Xe(e)})}o(vg,"_coercedDate");function ws(t,e){return new Oh({check:"greater_than",...Xe(e),value:t,inclusive:!0})}o(ws,"_gte");function pr(t,e){return new $h({check:"min_length",...Xe(e),minimum:t})}o(pr,"_minLength");function En(t,e){return new kh({check:"string_format",format:"regex",...Xe(e),pattern:t})}o(En,"_regex");function bg(t,e,r){let n=Xe(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(bg,"_custom");var ct=ae("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");rt.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>Ss(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Ci(t,r,n),t.parseAsync=async(r,n)=>Es(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>$i(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>Ps(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),Rs=ae("ZodMiniString",(t,e)=>{As.init(t,e),ct.init(t,e)});function b(t){return sg(Rs,t)}o(b,"string");var Pg=ae("ZodMiniStringFormat",(t,e)=>{dl.init(t,e),Rs.init(t,e)});var Cw=ae("ZodMiniURL",(t,e)=>{Lh.init(t,e),Pg.init(t,e)});function Sg(t){return cg(Cw,t)}o(Sg,"url");var Os=ae("ZodMiniNumber",(t,e)=>{pl.init(t,e),ct.init(t,e)});function xt(t){return lg(Os,t)}o(xt,"number");var $w=ae("ZodMiniNumberFormat",(t,e)=>{Fh.init(t,e),Os.init(t,e)});function Eg(t){return pg($w,t)}o(Eg,"int");var yl=ae("ZodMiniBoolean",(t,e)=>{fl.init(t,e),ct.init(t,e)});function Me(t){return fg(yl,t)}o(Me,"boolean");var Tg=ae("ZodMiniBigInt",(t,e)=>{Bh.init(t,e),ct.init(t,e)});var kw=ae("ZodMiniAny",(t,e)=>{qh.init(t,e),ct.init(t,e)});function Ni(){return gg(kw)}o(Ni,"any");var Nw=ae("ZodMiniUnknown",(t,e)=>{Vh.init(t,e),ct.init(t,e)});function ve(){return yg(Nw)}o(ve,"unknown");var zw=ae("ZodMiniVoid",(t,e)=>{Hh.init(t,e),ct.init(t,e)});function xg(t){return _g(zw,t)}o(xg,"_void");var Ag=ae("ZodMiniDate",(t,e)=>{Gh.init(t,e),ct.init(t,e)});var Dw=ae("ZodMiniArray",(t,e)=>{Wh.init(t,e),ct.init(t,e)});function we(t,e){return new Dw({type:"array",element:t,...Xe(e)})}o(we,"array");var Uw=ae("ZodMiniObject",(t,e)=>{Zh.init(t,e),ct.init(t,e),ut(t,"shape",()=>e.shape)});function C(t,e){let r={type:"object",shape:t??{},...Xe(e)};return new Uw(r)}o(C,"object");var Mw=ae("ZodMiniUnion",(t,e)=>{ml.init(t,e),ct.init(t,e)});function Ie(t,e){return new Mw({type:"union",options:t,...Xe(e)})}o(Ie,"union");var jw=ae("ZodMiniDiscriminatedUnion",(t,e)=>{Kh.init(t,e),ct.init(t,e)});function Tn(t,e,r){return new jw({type:"union",options:e,discriminator:t,...Xe(r)})}o(Tn,"discriminatedUnion");var Lw=ae("ZodMiniRecord",(t,e)=>{Jh.init(t,e),ct.init(t,e)});function be(t,e,r){return new Lw({type:"record",keyType:t,valueType:e,...Xe(r)})}o(be,"record");var Fw=ae("ZodMiniEnum",(t,e)=>{Yh.init(t,e),ct.init(t,e),t.options=Object.values(e.entries)});function $e(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Fw({type:"enum",entries:r,...Xe(e)})}o($e,"_enum");var Bw=ae("ZodMiniLiteral",(t,e)=>{Xh.init(t,e),ct.init(t,e)});function pe(t,e){return new Bw({type:"literal",values:Array.isArray(t)?t:[t],...Xe(e)})}o(pe,"literal");var qw=ae("ZodMiniTransform",(t,e)=>{Qh.init(t,e),ct.init(t,e)});function xn(t){return new qw({type:"transform",transform:t})}o(xn,"transform");var Vw=ae("ZodMiniOptional",(t,e)=>{eg.init(t,e),ct.init(t,e)});function H(t){return new Vw({type:"optional",innerType:t})}o(H,"optional");var Hw=ae("ZodMiniNullable",(t,e)=>{tg.init(t,e),ct.init(t,e)});function zi(t){return new Hw({type:"nullable",innerType:t})}o(zi,"nullable");var Gw=ae("ZodMiniPipe",(t,e)=>{rg.init(t,e),ct.init(t,e)});function An(t,e){return new Gw({type:"pipe",in:t,out:e})}o(An,"pipe");var Ww=ae("ZodMiniCustom",(t,e)=>{ng.init(t,e),ct.init(t,e)});function Cs(t,e){return bg(Ww,t??(()=>!0),e)}o(Cs,"custom");var Di={};gs(Di,{bigint:()=>Qw,boolean:()=>Xw,date:()=>eI,number:()=>Yw,string:()=>Jw});function Jw(t){return ug(Rs,t)}o(Jw,"string");function Yw(t){return dg(Os,t)}o(Yw,"number");function Xw(t){return mg(yl,t)}o(Xw,"boolean");function Qw(t){return hg(Tg,t)}o(Qw,"bigint");function eI(t){return vg(Ag,t)}o(eI,"date");var vl=C({retryOnFailure:C({defaultValue:H(Me()),hide:H(Me())}),continueOnFailure:C({defaultValue:H(Me()),hide:H(Me())})}),_l=class{constructor(e,r,n,i,s,c,d,l,p,f,_){this.name=e;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=d;this.errorHandlingOptions=l;this.outputSchema=p;this.audience=f;this.aiMetadata=_}static{o(this,"IAction")}},wn=o(t=>new _l(t.name,t.displayName,t.description,t.props,t.run,t.test??t.run,t.requireAuth??!0,t.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},t.outputSchema,t.audience,t.aiMetadata),"createAction");var je=C({displayName:b(),description:H(b())}),Re=o((t,e)=>C({type:pe(e),required:Me(),defaultValue:H(Ni())}),"TPropertyValue");var Ut=C({...je.shape,...Re(b(),"SHORT_TEXT").shape}),Yr=C({...je.shape,...Re(b(),"LONG_TEXT").shape});var Ig=C({label:b(),value:ve()}),$s=C({disabled:H(Me()),placeholder:H(b()),options:we(Ig)});var Mt=C({...je.shape,options:$s,...Re(ve(),"STATIC_DROPDOWN").shape}),Xr=C({...je.shape,options:$s,...Re(we(ve()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var bl=C({...je.shape,...Re(ve(),"DROPDOWN").shape,refreshers:we(b())}),Ui=C({...je.shape,...Re(we(ve()),"MULTI_SELECT_DROPDOWN").shape,refreshers:we(b())});var Qr=C({...je.shape,...Re(Me(),"CHECKBOX").shape});var en=C({...je.shape,...Re(xt(),"NUMBER").shape});var Mi=C({...je.shape,streaming:H(Me()),...Re(ve(),"FILE").shape});var ji=C({...je.shape,...Re(b(),"DATE_TIME").shape});var Rg=be(b(),Ie([Ut,Yr,Mt,Ui,Xr,Qr,en,Mi,ji])),Li=C({...je.shape,properties:Rg,...Re(we(ve()),"ARRAY").shape});var Fi=C({...je.shape,...Re(Ie([be(b(),ve())]),"JSON").shape});var Og=Ie([Ut,Mt,Fi,Li,Xr]),rI=be(b(),Og),Pl=C({refreshers:we(b()),...je.shape,...Re(ve(),"DYNAMIC").shape});var ks=C({...je.shape,...Re(xg(),"MARKDOWN").shape});var Bi=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Bi||{}),ko=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(ko||{}),No=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(No||{});var qi=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(qi||{}),Sl="both_client_credentials_and_authorization_code";var In=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(In||{}),Vi=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(Vi||{}),nI=C({strategy:$e(Vi),paramName:H(b())}),Hi=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Hi||{});var Ns=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ns||{}),Cg=C({status:H(xt()),body:H(ve()),headers:H(be(b(),b()))}),$g=C({type:pe("DELAY"),resumeDateTime:b(),requestIdToReply:H(b()),handlerId:H(b()),streamStepProgress:H($e(Ns))}),kg=C({type:pe("WEBHOOK"),requestId:b(),requestIdToReply:H(b()),response:Cg,handlerId:H(b()),streamStepProgress:H($e(Ns))}),oI=Ie([$g,kg]);var iI=C({body:ve(),rawBody:H(ve()),headers:be(b(),b()),queryParams:be(b(),b())});function at(t){return t==null}o(at,"isNil");function Gi(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(Gi,"isEmpty");function zs(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(zs,"assertNotNullOrUndefined");var El=ft(require("crypto"),1);var aI=128,Xn,zo,sI=o(t=>{!Xn||Xn.length<t?(Xn=Buffer.allocUnsafe(t*aI),El.default.randomFillSync(Xn),zo=0):zo+t>Xn.length&&(El.default.randomFillSync(Xn),zo=0),zo+=t},"fillPool"),uI=o(t=>(sI(t|=0),Xn.subarray(zo-t,zo)),"random"),cI=o((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(s=e)=>{let c="";for(;;){let d=r(i),l=i;for(;l--;)if(c+=t[d[l]&n]||"",c.length===s)return c}}},"customRandom"),zg=o((t,e=21)=>cI(t,e,uI),"customAlphabet");var lI="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Dg=21,sV=b().check(En(new RegExp(`^[0-9a-zA-Z]{${Dg}}$`))),dI=zg(lI,Dg);var Rn=An(xn(t=>t instanceof Date?t.toISOString():t),b()),Qt={id:b(),created:Rn,updated:Rn},Qe=o(t=>H(zi(t)),"Nullable");function Tl(t){return H(zi($e(t)))}o(Tl,"NullableEnum");var lV=An(xn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),H(Me())),Ds=o(t=>An(xn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),H(we(t))),"OptionalArrayFromQuery");var fV=be(b(),ve());var Wi=(f=>(f.OPENAI="openai",f.OPENROUTER="openrouter",f.ANTHROPIC="anthropic",f.AZURE="azure",f.GOOGLE="google",f.ACTIVEPIECES="activepieces",f.CLOUDFLARE_GATEWAY="cloudflare-gateway",f.CUSTOM="custom",f.BEDROCK="bedrock",f.MISTRAL="mistral",f))(Wi||{});var xV=b().check(En(/^#[0-9A-Fa-f]{6}$/));var wV=C({filename:b(),data:ve(),type:pe("file"),mimetype:H(b())});var pI=ft(Mg());var NV=C({...Qt,name:b(),permissions:we(b()),platformId:Qe(b()),type:b(),userCount:H(xt())});var jg=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(jg||{}),xl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(xl||{}),Al=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Al||{});var wl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(wl||{});var Il=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Il||{});var fI=C({mode:$e(jg),value:ve()}),mI=C({auth:H(b()),fields:be(b(),fI)}),hI=C({pieceName:b(),pieceVersion:b(),actionName:b(),predefinedInput:H(mI)}),gI=C({type:pe("PIECE"),toolName:b().check(pr(1)),pieceMetadata:hI}),yI=C({type:pe("none")}),_I=C({type:pe("access_token"),accessToken:b()}),vI=C({type:pe("api_key"),apiKey:b(),apiKeyHeader:b()}),bI=C({type:pe("headers"),headers:be(b(),b())}),PI=Tn("type",[yI,_I,vI,bI]),Lg=C({type:pe("FLOW"),toolName:b().check(pr(1)),externalFlowId:b(),flowDisplayName:H(b())}),Fg=C({type:pe("MCP"),toolName:b().check(pr(1)),serverUrl:Sg(),protocol:$e(Al),auth:PI}),Bg=C({type:pe("KNOWLEDGE_BASE"),toolName:b().check(pr(1)),sourceType:$e(xl),sourceId:b(),sourceName:b()}),SI=Tn("type",[gI,Lg,Fg,Bg]),EI=C({displayName:b(),description:H(b()),type:$e(wl)}),qg=C({type:pe("MARKDOWN"),markdown:b()}),Do={type:pe("TOOL_CALL"),input:Qe(be(b(),ve())),output:H(ve()),toolName:b(),status:$e(Il),toolCallId:b(),startTime:b(),endTime:H(b())},dH=C(Do),Vg=Tn("toolCallType",[C({...Do,toolCallType:pe("PIECE"),pieceName:b(),pieceVersion:b(),actionName:b()}),C({...Do,toolCallType:pe("FLOW"),displayName:b(),externalFlowId:b()}),C({...Do,toolCallType:pe("MCP"),displayName:b(),serverUrl:b()}),C({...Do,toolCallType:pe("KNOWLEDGE_BASE"),displayName:b(),sourceType:b()}),C({...Do,toolCallType:pe("UNKNOWN"),displayName:b()})]),TI=Ie([qg,Vg]);var Rl=(r=>(r.IMAGE="image",r.TEXT="text",r))(Rl||{}),tn=C({apiKey:b()}),xI=tn,AI=C({apiKey:b(),apiKeyHash:b()}),wI=tn,II=tn,RI=tn,OI=tn,CI=tn,$I=tn,kI=tn,Kg=C({accessKeyId:b().check(pr(1)),secretAccessKey:b().check(pr(1))}),NI=C({}),zI=C({}),DI=C({}),UI=C({}),MI=C({}),jI=C({}),Jg=C({modelId:b(),modelName:b(),modelType:$e(Rl)}),Yg=C({apiKeyHeader:b(),baseUrl:b(),models:we(Jg),defaultHeaders:H(be(b(),b()))}),Xg=C({accountId:b(),gatewayId:b(),models:we(Jg),vertexProject:H(b()),vertexRegion:H(b())}),Qg=C({resourceName:b(),apiVersion:An(xn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),H(b()))}),ey=C({region:b().check(pr(1))}),LI=Ie([xI,RI,OI,CI,$I,II,wI,AI,Kg,kI]),ty=Ie([Yg,Xg,Qg,ey,NI,DI,UI,MI,zI,jI]),FI=C({id:b(),name:b(),type:$e(Rl)}),BI=C({id:b(),name:b(),provider:$e(Wi),config:ty,enabledForChat:Me()}),qI=C({provider:$e(Wi),config:ty,auth:LI,platformId:b()});var hH={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Hg=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],VI=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],HI=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Gg=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],GI=["grok-4.20","grok-4.1-fast"],WI={openai:Hg,anthropic:VI,google:Gg,activepieces:[...HI.map(t=>`anthropic/${t}`),...Hg.map(t=>`openai/${t}`),...Gg.map(t=>`google/${t}`),...GI.map(t=>`x-ai/${t}`)]};var Wg=128e3,ZI={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function KI({provider:t}){return t?ZI[t]??Wg:Wg}o(KI,"getMaxContextTokens");var Zg={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},JI={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},YI=new Set(["anthropic","mistral"]);function Ar(t){return{chatModels:WI[t],maxContextTokens:KI({provider:t}),defaultEmbeddingModel:Zg[t],supportsEmbedding:Zg[t]!==void 0,supportsImageGeneration:!YI.has(t),webSearch:JI[t]}}o(Ar,"buildProviderCapabilities");var XI={openai:Ar("openai"),anthropic:Ar("anthropic"),openrouter:Ar("openrouter"),azure:Ar("azure"),google:Ar("google"),"cloudflare-gateway":Ar("cloudflare-gateway"),custom:Ar("custom"),bedrock:Ar("bedrock"),mistral:Ar("mistral"),activepieces:Ar("activepieces")};var QI=C({base64Url:b(),fileName:b(),extension:H(b())}),eR=C({mimeType:b(),url:b(),fileName:H(b())}),Ol=Ie([QI,eR]);var tR=Ie([C({type:pe("file"),value:Ol}),C({type:pe("markdown"),value:b(),files:H(we(Ol))})]),rR=C({sessionId:b(),message:b(),files:H(we(b()))});var ny=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ny||{}),oy=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(oy||{}),Cl=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Cl||{});var nR=Ie([C({...Qt,name:b(),externalId:b(),type:pe("STATIC_DROPDOWN"),tableId:b(),projectId:b(),data:C({options:we(C({value:b()}))})}),C({...Qt,name:b(),externalId:b(),type:Ie([pe("TEXT"),pe("NUMBER"),pe("DATE")]),tableId:b(),projectId:b()})]),oR=C({...Qt,name:b(),folderId:Qe(b()),projectId:b(),externalId:b(),status:Tl(oy),trigger:Tl(ny)}),iR=C({...Qt,tableId:b(),projectId:b(),cells:be(b(),C({updated:b(),created:b(),value:ve(),fieldName:b()}))}),aR=C({events:we($e(Cl)),webhookUrl:b(),flowId:b()}),sR=C({fields:we(C({id:b(),name:b()})),rows:we(be(b(),b())),name:b()}),uR=C({projectId:b(),limit:H(Di.number()),cursor:H(b()),name:H(b()),externalIds:Ds(b()),folderId:H(b()),folderIds:Ds(b())}),cR=C({records:we(we(C({fieldId:b(),value:ay()}))),tableId:b()}),lR=C({cells:H(we(C({fieldId:b(),value:ay()}))),tableId:b(),agentUpdate:H(Me())}),iy=Tn("operator",[Qn("eq"),Qn("neq"),Qn("gt"),Qn("gte"),Qn("lt"),Qn("lte"),Qn("co"),ry("exists"),ry("not_exists")]),dR=C({tableId:b(),limit:H(Di.number()),cursor:H(b()),filters:Ds(iy)});function ay(){return An(xn(t=>t==null?t:String(t)),zi(b()))}o(ay,"coerceToString");function Qn(t){return C({fieldId:b(),operator:pe(t),value:b()})}o(Qn,"valueFilter");function ry(t){return C({fieldId:b(),operator:pe(t)})}o(ry,"existenceFilter");var pR=C({status:H(xt()),body:H(ve()),headers:H(be(b(),b()))}),fR=C({...Qt,deleted:Qe(Rn),ownerId:b(),displayName:b(),platformId:b(),externalId:Qe(b())});var sy=C({name:b(),description:H(b()),type:b(),required:Me()}),mR=C({pieceName:b(),triggerName:b(),input:C({toolName:b(),toolDescription:b(),inputSchema:we(sy),returnsResponse:Me()})});var uy="^[0-9]+\\.[0-9]+\\.[0-9]+$",NH=new RegExp(uy),gR="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",zH=b().check(En(new RegExp(uy))),DH=b().check(En(new RegExp(gR))),yR=C({packageType:pe("ARCHIVE"),pieceType:$e(ko),pieceName:b(),pieceVersion:b(),archiveId:b(),platformId:b()}),cy=C({packageType:pe("REGISTRY"),pieceType:pe("OFFICIAL"),pieceName:b(),pieceVersion:b()}),ly=C({packageType:pe("REGISTRY"),pieceType:pe("CUSTOM"),pieceName:b(),pieceVersion:b(),platformId:b()}),UH=Ie([cy,ly]),MH=Ie([yR,cy,ly]);var _R=Tn("type",[C({type:pe("CRON_EXPRESSION"),cronExpression:b(),timezone:b()}),C({type:pe("INTERVAL"),intervalMs:Eg().check(ws(6e4))})]),jH=C({...Qt,type:$e(In),projectId:b(),flowId:b(),triggerName:b(),schedule:Qe(_R),flowVersionId:b(),pieceName:b(),pieceVersion:b(),deleted:Qe(b()),simulate:Me()}),dy=(P=>(P.UNKNOWN="UNKNOWN",P.FLOW_RUN_LOG="FLOW_RUN_LOG",P.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",P.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",P.FLOW_STEP_FILE="FLOW_STEP_FILE",P.SAMPLE_DATA="SAMPLE_DATA",P.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",P.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",P.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",P.PROJECT_RELEASE="PROJECT_RELEASE",P.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",P.PLATFORM_ASSET="PLATFORM_ASSET",P.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",P.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",P.KNOWLEDGE_BASE="KNOWLEDGE_BASE",P.FLOW_BUNDLE="FLOW_BUNDLE",P))(dy||{}),py=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(py||{}),fy=(r=>(r.S3="S3",r.DB="DB",r))(fy||{}),LH=C({...Qt,projectId:Qe(b()),platformId:Qe(b()),type:$e(dy),compression:$e(py),data:H(ve()),location:$e(fy),size:Qe(xt()),fileName:Qe(b()),s3Key:Qe(b()),metadata:Qe(be(b(),b()))}),my=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(my||{}),hy=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(hy||{}),FH=C({id:b(),email:b(),firstName:b(),status:$e(hy),externalId:Qe(b()),platformId:Qe(b()),platformRole:$e(my),lastName:b(),created:Rn,updated:Rn,lastActiveDate:Qe(Rn),imageUrl:Qe(b())});var $l=C({...je.shape,...Re(be(b(),ve()),"OBJECT").shape});var vy=C({...je.shape,...Re(b(),"COLOR").shape});var kl=Ie([Ut,Yr,ks,Qr,Mt,Xr,bl,Ui,Pl,en,Li,$l,Fi,ji,Mi,vy]),Te={ShortText(t){return{...t,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(t){return{...t,valueSchema:void 0,type:"CHECKBOX"}},LongText(t){return{...t,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(t){return{displayName:"Markdown",required:!1,description:t.value,type:"MARKDOWN",valueSchema:void 0,variant:t.variant??"INFO"}},Number(t){return{...t,valueSchema:void 0,type:"NUMBER"}},Json(t){return{...t,valueSchema:void 0,type:"JSON"}},Array(t){return{...t,valueSchema:void 0,type:"ARRAY"}},Object(t){return{...t,valueSchema:void 0,type:"OBJECT"}},Dropdown(t){return{...t,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(t){return{...t,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(t){return{...t,valueSchema:void 0,type:"DATE_TIME"}},File(t){return{...t,valueSchema:void 0,type:"FILE"}},Custom(t){let e=t.code.toString();return{...t,code:e,valueSchema:void 0,type:"CUSTOM"}},Color(t){return{...t,valueSchema:void 0,type:"COLOR"}}};var wr=C({displayName:b(),description:H(b()),hasConnectionIdentifier:H(Me())});var by=C({username:b(),password:b()}),Nl=C({...wr.shape,username:C({displayName:b(),description:H(b())}),password:C({displayName:b(),description:H(b())}),...Re(by,"BASIC_AUTH").shape});var SR=be(b(),Ie([Ut,Yr,en,Qr,Mt])),zl=C({...wr.shape,props:SR,...Re(ve(),"CUSTOM_AUTH").shape});var eo=C({...wr.shape,...Re(C({auth:b()}),"SECRET_TEXT").shape});var ER=be(b(),Ie([Ut,Yr,eo,en,Qr,Mt,Xr,ks])),Py=C({...wr.shape,props:ER,...Re(ve(),"OIDC").shape});var Dl=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Dl||{}),Sy=Ie([Ut,eo,Mt]),Ey=be(b(),Sy),TR=C({props:H(be(b(),Sy)),authUrl:b(),tokenUrl:b(),scope:we(b()),prompt:H(Ie([pe("none"),pe("consent"),pe("login"),pe("omit")])),pkce:H(Me()),pkceMethod:H(Ie([pe("plain"),pe("S256")])),authorizationMethod:H($e(Dl)),grantType:H(Ie([$e(qi),pe(Sl)])),extra:H(be(b(),b()))}),Ty=C({access_token:b(),props:H(Ey),data:be(b(),Ni())}),Ul=C({...wr.shape,...TR.shape,...Re(Ty,"OAUTH2").shape});var Uo=Ie([Nl,zl,Py,Ul,eo]),Zi="Connection",Ml={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||Zi}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||Zi,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||Zi}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||Zi}},None(){}};var vW={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var xR=C({...je.shape,...Re(ve(),"CUSTOM").shape,code:b()});var AR=Ie([kl,Uo]),jl=be(b(),AR),jW=be(b(),kl);var xy=Ie([C({strategy:pe("CRON"),cronExpression:b()}),C({strategy:pe("NONE")})]),Mo=class{constructor(e,r,n,i,s,c,d,l,p,f,_,h,g,y,T,P,x,N,L){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=d;this.onHandshake=l;this.renewConfiguration=p;this.onRenew=f;this.onEnable=_;this.onDisable=h;this.onStart=g;this.run=y;this.test=T;this.sampleData=P;this.testStrategy=x;this.outputSchema=N;this.aiMetadata=L}static{o(this,"ITrigger")}},Ay=o(t=>{switch(t.type){case"WEBHOOK":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,t.handshakeConfiguration??{strategy:"NONE"},t.onHandshake??(async()=>({status:200})),t.renewConfiguration??{strategy:"NONE"},t.onRenew??(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,t.test?"TEST_FUNCTION":"SIMULATION",t.outputSchema,t.aiMetadata);case"POLLING":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata);case"MANUAL":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata);case"APP_WEBHOOK":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,at(t.sampleData)&&at(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var wy="2",Ms="0.82.0";var Ll=class{constructor(e,r,n,i,s,c,d,l,p=Ms,f,_="",h){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=l;this.minimumSupportedRelease=p;this.maximumSupportedRelease=f;this.description=_;this.deprecated=h;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:wy}),"getContextInfo");(!IR(p)||RR(p,Ms))&&(this.minimumSupportedRelease=Ms),s.forEach(g=>this._actions[g.name]=g),c.forEach(g=>this._triggers[g.name]=g)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:wR(this.auth),minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(e){return this._actions[e]}getTrigger(e){return this._triggers[e]}actions(){return this._actions}triggers(){return this._triggers}},Ry=o(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Ll(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description,t.deprecated)},"createPiece");function wR(t){if(t!==void 0)return Array.isArray(t)?t.map(Iy):Iy(t)}o(wR,"withConnectionIdentifierFlag");function Iy(t){return{...t,hasConnectionIdentifier:t.getConnectionIdentifier!==void 0}}o(Iy,"flagConnectionIdentifier");function IR(t){return/^\d+\.\d+\.\d+$/.test(t)}o(IR,"isValidSimpleSemver");function RR(t,e){let[r,n,i]=t.split(".").map(Number),[s,c,d]=e.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<d}o(RR,"isSemverLessThan");var OR=H(be(b(),be(b(),b()))),Oy=C({id:H(b()),name:b(),displayName:b(),logoUrl:b(),description:b(),authors:we(b()),platformId:H(b()),directoryPath:H(b()),auth:H(Ie([Uo,we(Uo)])),version:b(),categories:H(we($e(No))),minimumSupportedRelease:H(b()),maximumSupportedRelease:H(b()),deprecated:H(Me()),i18n:OR}),CR=$e(["human","ai","both"]),Cy=C({description:H(b()),idempotent:H(Me())}),$y=C({name:b(),displayName:b(),description:b(),props:jl,requireAuth:Me(),errorHandlingOptions:H(vl),outputSchema:H(Cs()),audience:H(CR),aiMetadata:H(Cy)}),ky=C({name:b(),displayName:b(),description:b(),props:jl,errorHandlingOptions:H(vl),type:$e(In),sampleData:ve(),handshakeConfiguration:H(Cs()),renewConfiguration:H(xy),testStrategy:$e(Hi),outputSchema:H(Cs()),aiMetadata:H(Cy)}),$R=C({...Oy.shape,actions:be(b(),$y),triggers:be(b(),ky)}),kR=C({...Oy.shape,actions:xt(),triggers:xt(),suggestedActions:H(we($y)),suggestedTriggers:H(we(ky))}),Ny=C({projectUsage:xt(),pieceType:$e(ko),packageType:$e(Bi),platformId:H(b()),archiveId:H(b())}),jZ=C({...$R.shape,...Ny.shape}),LZ=C({...kR.shape,...Ny.shape}),FZ=C({name:b(),version:b()});var NR=ft(require("path")),zR=ft(require("fs/promises"));var My=require("node:stream");var js=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};return e.authentication&&this.populateAuthentication(e.authentication,r),e.body&&(e.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),e.headers&&(r={...r,...e.headers}),r}populateAuthentication(e,r){this.authenticationConverter.convert(e,r)}};var Ls=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new Fl,r=new Bl){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},Fl=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},Bl=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(e,r){let n=`${e.username}:${e.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Ki=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function zy({error:t,requestBody:e}){return t instanceof Ki?t.errorMessage():{response:{status:0,body:t instanceof Error?t.message:String(t)},request:{body:e}}}o(zy,"toFailsafeOutput");var jo=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(jo||{});var Fs=class extends js{static{o(this,"FetchHttpClient")}constructor(e="",r=new Ls){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),s=this.getHeaders(e),c=e.queryParams??{};for(let[L,X]of Object.entries(c))i.append(L,X);let d=i.toString(),l=d?`${n}?${d}`:n,p=e.responseType??"json",f=e.followRedirects??!0,_=e.retries??0,{body:h,extraHeaders:g,isStream:y}=DR(e.method)?UR(e.body,s):{body:void 0,extraHeaders:{},isStream:!1},T=jR({...s,...g}),P=await MR(async()=>{let L=new AbortController,X=e.timeout&&e.timeout>0?setTimeout(()=>L.abort(),e.timeout):void 0;try{let W={method:e.method.toString(),headers:T,body:h,redirect:f?"follow":"manual",signal:L.signal};return y&&(W.duplex="half"),r?.dispatcher!==void 0&&(W.dispatcher=r.dispatcher),await fetch(l,W)}finally{X!==void 0&&clearTimeout(X)}},_),x=f?300:400;if(P.status<200||P.status>=x){let L=await Dy(P,p),X=new Ki(e.body,{status:P.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",X),X}let N=await Dy(P,p);return{status:P.status,headers:LR(P.headers),body:N}}};function DR(t){return t!=="GET"&&t!=="HEAD"}o(DR,"acceptsRequestBody");function UR(t,e){if(BR(t))return{body:void 0,extraHeaders:{},isStream:!1};if(FR(t)){let n=new My.PassThrough;return t.on("error",i=>n.destroy(i)),t.pipe(n),{body:n,extraHeaders:t.getHeaders(),isStream:!0}}return typeof t=="string"||Buffer.isBuffer(t)||t instanceof URLSearchParams||t instanceof ArrayBuffer||typeof FormData<"u"&&t instanceof FormData||typeof Blob<"u"&&t instanceof Blob?{body:t,extraHeaders:{},isStream:!1}:(e["Content-Type"]??e["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(t).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(t),extraHeaders:{},isStream:!1}}o(UR,"serializeBody");async function Dy(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"blob":return await t.blob();case"text":return await t.text();default:{let r=await t.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Dy,"parseResponseBody");async function MR(t,e){let r;for(let n=0;n<=e;n++)try{let i=await t();if(i.status>=500&&n<e){await Uy(n);continue}return i}catch(i){if(r=i,n<e){await Uy(n);continue}throw i}throw r}o(MR,"sendWithRetries");function Uy(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(Uy,"backoff");function jR(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&(e[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return e}o(jR,"normalizeHeaders");function LR(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(LR,"toHttpHeaders");function FR(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}o(FR,"isNodeFormData");function BR(t){return t==null}o(BR,"isNil");var On=new Fs;var RC=ft(require("fs")),Bv=ft(Fv());var OC={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function CC(t){let e=t.split(";")[0].trim().toLowerCase();return OC[e]??""}o(CC,"contentTypeToExtension");var $C=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),kC=o((t,e)=>{let r="https://api.example.com";try{let n=e?t(e):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function qv({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:d,authLocation:l="headers"}){return wn({audience:"human",name:s||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:Te.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:p})=>({url:Te.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
69
+ i.e ${kC(e,p)}/resource or /resource`,required:!0,defaultValue:p?e(p):"",...c?.url??{}})}),"props")}),method:Te.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(jo).map(p=>({label:p,value:p}))},...c?.method??{}}),headers:Te.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:Te.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:Te.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:Te.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:p})=>{if(!p)return{};let f=p,_={};switch(f){case"none":break;case"json":_.data=Te.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":_.data=Te.LongText({displayName:"Raw Body",required:!0});break;case"form_data":_.data=Te.Array({displayName:"Form Data",required:!0,properties:{fieldName:Te.ShortText({displayName:"Field Name",required:!0}),fieldType:Te.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:Te.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:Te.File({displayName:"File Field Value",required:!1})}});break}return _},"props")}),response_is_binary:Te.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:Te.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:Te.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:Te.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async p=>{let{method:f,url:_,headers:h,queryParams:g,body:y,body_type:T,failsafe:P,timeout:x,response_is_binary:N,followRedirects:L}=p.propsValue;zs(f,"Method"),zs(_,"URL");let X=at(r)?{}:await r(p.auth,p.propsValue),W=_.url,G=W.startsWith("http://")||W.startsWith("https://")?W:$C({baseUrl:e(p.auth),relativePath:W}),Z={method:f,url:G,headers:{...h??{},...l==="headers"||!at(l)?X:{}},queryParams:{...l==="queryParams"?X:{},...g??{}},timeout:x?x*1e3:0,followRedirects:L};if(N&&(Z.responseType="arraybuffer"),y)if(T&&T!=="none"){let ee=y.data;if(T==="form_data"){let Y=ee,Se=new Bv.default;for(let{fieldName:te,fieldType:q,textFieldValue:B,fileFieldValue:J}of Y)q==="text"&&!Gi(B)?Se.append(te,B):q==="file"&&!Gi(J)&&Se.append(te,J.data,{filename:J?.filename});Z.body=Se,Z.headers={...Z.headers,...Se.getHeaders()}}else Z.body=ee}else T||(Z.body=y);try{let ee=await On.sendRequest(Z);return await NC(p.files,ee.body,ee.status,ee.headers,N)}catch(ee){if(P)return zy({error:ee,requestBody:Z.body});throw ee}},"run")})}o(qv,"createCustomApiCallAction");var NC=o(async(t,e,r,n,i)=>{let s;if(i&&zC(e)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=CC(c??"")||"txt",l;e instanceof ArrayBuffer?l=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?l=e:l=Buffer.from(e),s=await t.write({fileName:`output.${d}`,data:l})}else s=e;return{status:r,headers:n,body:s}},"handleBinaryResponse"),zC=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var ea={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:c}){switch(t.strategy){case 0:{let d=await e.get("lastPoll");if(at(d))throw new Error("lastPoll doesn't exist in the store.");let l=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:d,server:c}),p=l.reduce((f,_)=>Math.max(f,_.epochMilliSeconds),d);return await e.put("lastPoll",p),l.filter(f=>f.epochMilliSeconds>d).map(f=>f.data)}case 1:{let d=await e.get("lastItem"),l=await t.items({store:e,auth:r,propsValue:n,lastItemId:d,files:s,server:c}),p=l.findIndex(h=>h.id===d),f=[];at(d)||p==-1?f=l??[]:f=l?.slice(0,p)??[],at(i)||(f=f.slice(-i));let _=f?.[0]?.id;return at(_)||await e.put("lastItem",_),f.map(h=>h.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i,isRepublish:s}){switch(t.strategy){case 0:{if(s&&!at(await e.get("lastPoll")))break;await e.put("lastPoll",Date.now());break}case 1:{if(s&&!at(await e.get("lastItem")))break;let d=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;at(d)?await e.delete("lastItem"):await e.put("lastItem",d);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:i,server:s}){let c=[];switch(t.strategy){case 0:{c=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:s});break}}return DC(c.map(d=>d.data))}};function DC(t){return t.length<=5?t:t.slice(0,5)}o(DC,"getFirstFiveOrAll");var kn={baseUrl:"https://people.googleapis.com/v1/people"};var mr=Ml.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:["https://www.googleapis.com/auth/contacts","email"]});var Hv=wn({auth:mr,name:"add_contact",description:"Add a contact to a Google Contacts account",audience:"both",aiMetadata:{description:"Creates a new person in the authenticated Google Contacts account from name, email, phone, company, and job title fields. Use when an agent needs to add someone to address book contacts; first and last name are required. Not idempotent \u2014 each call creates a separate contact even with identical input, so guard against duplicates.",idempotent:!1},displayName:"Add Contact",props:{firstName:Te.ShortText({displayName:"First Name",description:"The first name of the contact",required:!0}),middleName:Te.ShortText({displayName:"Middle Name",description:"The middle name of the contact",required:!1}),lastName:Te.ShortText({displayName:"Last Name",description:"The last name of the contact",required:!0}),jobTitle:Te.ShortText({displayName:"Job Title",description:"The job title of the contact",required:!1}),company:Te.ShortText({displayName:"Company",description:"The company of the contact",required:!1}),email:Te.ShortText({displayName:"Email",description:"The email address of the contact",required:!1}),phoneNumber:Te.ShortText({displayName:"Phone Number",description:"The phone number of the contact",required:!1})},async run(t){let e={names:[{givenName:t.propsValue.firstName,middleName:t.propsValue.middleName,familyName:t.propsValue.lastName}]},r={};t.propsValue.email&&(r.emailAddresses=[{value:t.propsValue.email}]),t.propsValue.phoneNumber&&(r.phoneNumbers=[{value:t.propsValue.phoneNumber}]),(t.propsValue.company||t.propsValue.jobTitle)&&(r.organizations=[{name:t.propsValue.company||void 0,title:t.propsValue.jobTitle||void 0}]),e={...e,...r};let n={method:"POST",url:`${kn.baseUrl}:createContact`,body:e,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token}};return(await On.sendRequest(n)).body}});var Gv=wn({auth:mr,name:"update_contact",description:"Update a contact in Google Contacts account.",audience:"both",aiMetadata:{description:"Updates fields (name, email, phone, company, job title) on an existing Google Contacts person identified by its resourceName (people/{id}). Use when an agent needs to modify a known contact; requires both the resourceName and the current etag, and a field mask listing which fields to update \u2014 the call is rejected if the contact changed since the etag was fetched. Repeating the same update with the same etag/values is safe and yields the same result.",idempotent:!0},displayName:"Update Contact",props:{resourceName:Te.ShortText({displayName:"Resource Name",description:"The resource name for the person, assigned by the server. An ASCII string in the form of people/{person_id}.",required:!0}),etag:Te.ShortText({displayName:"Etag",description:"The `etag` ensures contact updates only apply if the contact hasn't changed since last retrieved.",required:!0}),updatePersonFields:Te.StaticMultiSelectDropdown({displayName:"Update Field Mask",description:"A field mask to restrict which fields on the person are updated.",required:!0,options:{options:[{label:"Names",value:"names"},{label:"Email",value:"emailAddresses"},{label:"Phone Number",value:"phoneNumbers"},{label:"Job Title / Company",value:"organizations"}]},defaultValue:["names","emailAddresses"]}),firstName:Te.ShortText({displayName:"First Name",description:"The first name of the contact",required:!1}),middleName:Te.ShortText({displayName:"Middle Name",description:"The middle name of the contact",required:!1}),lastName:Te.ShortText({displayName:"Last Name",description:"The last name of the contact",required:!1}),jobTitle:Te.ShortText({displayName:"Job Title",description:"The job title of the contact",required:!1}),company:Te.ShortText({displayName:"Company",description:"The company of the contact",required:!1}),email:Te.ShortText({displayName:"Email",description:"The email address of the contact",required:!1}),phoneNumber:Te.ShortText({displayName:"Phone Number",description:"The phone number of the contact",required:!1})},async run(t){let e=t.propsValue.resourceName.substring(6),r={etag:t.propsValue.etag},n={updatePersonFields:t.propsValue.updatePersonFields.join(",")};(t.propsValue.firstName||t.propsValue.middleName||t.propsValue.lastName)&&(r.names=[{givenName:t.propsValue.firstName||void 0,middleName:t.propsValue.middleName||void 0,familyName:t.propsValue.lastName||void 0}]),t.propsValue.email&&(r.emailAddresses=[{value:t.propsValue.email}]),t.propsValue.phoneNumber&&(r.phoneNumbers=[{value:t.propsValue.phoneNumber}]),(t.propsValue.company||t.propsValue.jobTitle)&&(r.organizations=[{name:t.propsValue.company||void 0,title:t.propsValue.jobTitle||void 0}]);let i={method:"PATCH",url:`${kn.baseUrl}${e}:updateContact`,body:r,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token},queryParams:n};return(await On.sendRequest(i)).body}});var Wv=wn({auth:mr,name:"search_contact",description:"Search contacts in Google Contacts account.",audience:"both",aiMetadata:{description:"Searches the authenticated Google Contacts account for people matching a plain-text query, which prefix-matches against contact fields. Use when an agent needs to find a contact or its resourceName before updating it; the query is required and a read mask selects which fields come back (max 30 results). Read-only and idempotent.",idempotent:!0},displayName:"Search Contacts",props:{query:Te.ShortText({displayName:"Query",description:'The plain-text query for the request.The query is used to match prefix phrases of the fields on a person. For example, a person with name "foo name" matches queries such as "f", "fo", "foo", "foo n", "nam", etc., but not "oo n".',required:!0}),readMask:Te.StaticMultiSelectDropdown({displayName:"Read Mask",description:"A field mask to restrict which fields on each person are returned.",required:!0,options:{options:[{label:"addresses",value:"addresses"},{label:"ageRanges",value:"ageRanges"},{label:"biographies",value:"biographies"},{label:"birthdays",value:"birthdays"},{label:"calendarUrls",value:"calendarUrls"},{label:"clientData",value:"clientData"},{label:"coverPhotos",value:"coverPhotos"},{label:"emailAddresses",value:"emailAddresses"},{label:"events",value:"events"},{label:"externalIds",value:"externalIds"},{label:"genders",value:"genders"},{label:"imClients",value:"imClients"},{label:"interests",value:"interests"},{label:"locales",value:"locales"},{label:"locations",value:"locations"},{label:"memberships",value:"memberships"},{label:"metadata",value:"metadata"},{label:"miscKeywords",value:"miscKeywords"},{label:"names",value:"names"},{label:"nicknames",value:"nicknames"},{label:"occupations",value:"occupations"},{label:"organizations",value:"organizations"},{label:"phoneNumbers",value:"phoneNumbers"},{label:"photos",value:"photos"},{label:"relations",value:"relations"},{label:"sipAddresses",value:"sipAddresses"},{label:"skills",value:"skills"},{label:"urls",value:"urls"},{label:"userDefined",value:"userDefined"}]},defaultValue:["names","emailAddresses"]}),pageSize:Te.Number({displayName:"Page Size",description:"The number of results to return. Maximum 30.",required:!1})},async run(t){let e={query:t.propsValue.query,readMask:t.propsValue.readMask.join(",")};t.propsValue.pageSize&&(e.pageSize=String(t.propsValue.pageSize));let r={method:"GET",url:`${kn.baseUrl}:searchContacts`,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token},queryParams:e};return(await On.sendRequest(r)).body}});var gx=ft(mx()),yx=ft($a()),_x=ft(hx());var Oc={strategy:0,items:o(async({store:t,auth:e})=>{let r=new yx.OAuth2Client;r.setCredentials(e);let n=(0,gx.people)({version:"v1",auth:r}),i,s=[];do{let c=await n.people.connections.list({resourceName:"people/me",pageToken:i,pageSize:100,sortOrder:"LAST_MODIFIED_DESCENDING",personFields:["addresses","ageRanges","biographies","birthdays","calendarUrls","clientData","coverPhotos","emailAddresses","events","externalIds","genders","imClients","interests","locales","locations","memberships","metadata","miscKeywords","names","nicknames","occupations","organizations","phoneNumbers","photos","relations","sipAddresses","skills","urls","userDefined"].join()});for(let d of c.data.connections||[])d.metadata?.deleted!==!0&&s.push({data:d,epochMilliSeconds:(0,_x.default)(d.metadata?.sources?.[0].updateTime).valueOf()});i=c.data.nextPageToken}while(i);return s},"items")},vx=Ay({auth:mr,name:"new_or_updated_contact",displayName:"New Or Updated Contact",description:"Triggers when there is a new or updated contact",aiMetadata:{description:"Fires when a contact in the authenticated Google Contacts account is newly created or has been modified since the last poll. Each event represents one person record with its current fields; deleted contacts are excluded."},props:{},sampleData:{resourceName:"people/c4278485694217203807",etag:"%EiMBAgMFBgcICQoLDA0ODxATFBUWGSEiIyQlJicuNDU3PT4/QBoEAQIFByIMZFVwNlJPNEVKUzg9",metadata:{sources:[{type:"CONTACT",id:"3b603c120c68305f",etag:"#dUp6RO4EJS8=",updateTime:"2023-01-30T14:35:18.142565Z"}],objectType:"PERSON"},names:[{metadata:{primary:!0,source:{type:"CONTACT",id:"3b603c120c68305f"}},displayName:"Shahed Mashni",familyName:"Mashni",givenName:"Shahed",displayNameLastFirst:"Mashni, Shahed",unstructuredName:"Shahed Mashni"}],photos:[{metadata:{primary:!0,source:{type:"CONTACT",id:"3b603c120c68305f"}},url:"https://lh3.googleusercontent.com/cm/AAkddurmZojs4vCcxrpkfSxH9tnqcH-hI82ESDnwv6eq86nZeLStcjYEIe_TCx8r8g5Y=s100",default:!0}],memberships:[{metadata:{source:{type:"CONTACT",id:"3b603c120c68305f"}},contactGroupMembership:{contactGroupId:"myContacts",contactGroupResourceName:"contactGroups/myContacts"}}]},type:"POLLING",async onEnable(t){return await ea.onEnable(Oc,{store:t.store,auth:t.auth,propsValue:{}})},async onDisable(t){return await ea.onEnable(Oc,{store:t.store,auth:t.auth,propsValue:{}})},async run(t){return await ea.poll(Oc,{store:t.store,auth:t.auth,propsValue:{},files:t.files})},test:o(async t=>await ea.test(Oc,{store:t.store,auth:t.auth,propsValue:{},files:t.files}),"test")});var A1=Ry({minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/google-contacts.png",categories:["SALES_AND_CRM"],actions:[Hv,Gv,Wv,qv({baseUrl:o(()=>kn.baseUrl,"baseUrl"),auth:mr,authMapping:o(async t=>({Authorization:`Bearer ${t.access_token}`}),"authMapping")})],displayName:"Google Contacts",description:"Stay connected and organized",authors:["Abdallah-Alwarawreh","Salem-Alaa","kishanprmr","MoShizzle","khaledmashaly","abuaboud","ikus060"],triggers:[vx],auth:mr});0&&(module.exports={googleContacts});
70
70
  /*! Bundled license information:
71
71
 
72
72
  mime-types/index.js: