@activepieces/piece-google-drive 0.7.10 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.js CHANGED
@@ -1,74 +1,74 @@
1
- "use strict";var ZA=Object.create;var Di=Object.defineProperty;var KA=Object.getOwnPropertyDescriptor;var JA=Object.getOwnPropertyNames;var YA=Object.getPrototypeOf,XA=Object.prototype.hasOwnProperty;var o=(t,e)=>Di(t,"name",{value:e,configurable:!0});var Pt=(t,e)=>()=>(t&&(e=t(t=0)),e);var M=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pa=(t,e)=>{for(var r in e)Di(t,r,{get:e[r],enumerable:!0})},Ah=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of JA(e))!XA.call(t,i)&&i!==r&&Di(t,i,{get:()=>e[i],enumerable:!(n=KA(e,i))||n.enumerable});return t};var ze=(t,e,r)=>(r=t!=null?ZA(YA(t)):{},Ah(e||!t||!t.__esModule?Di(r,"default",{value:t,enumerable:!0}):r,t)),QA=t=>Ah(Di({},"__esModule",{value:!0}),t);var Vg=M((Bg,Ma)=>{(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"),a="%[0-9a-z]{1,}",f="(?:[0-9a-f]+::?)+",m={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${f})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${f})|(?:::)(?:${f})?)${e}\\.${e}\\.${e}\\.${e}(${a})?$`,"i")};function h(w,T){if(w.indexOf("::")!==w.lastIndexOf("::"))return null;let $=0,b=-1,u=(w.match(m.zoneIndex)||[])[0],p,c;for(u&&(u=u.substring(1),w=w.replace(/%.+$/,""));(b=w.indexOf(":",b+1))>=0;)$++;if(w.substr(0,2)==="::"&&$--,w.substr(-2,2)==="::"&&$--,$>T)return null;for(c=T-$,p=":";c--;)p+="0:";return w=w.replace("::",p),w[0]===":"&&(w=w.slice(1)),w[w.length-1]===":"&&(w=w.slice(0,-1)),T=function(){let y=w.split(":"),l=[];for(let x=0;x<y.length;x++)l.push(parseInt(y[x],16));return l}(),{parts:T,zoneId:u}}o(h,"expandIPv6");function _(w,T,$,b){if(w.length!==T.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let u=0,p;for(;b>0;){if(p=$-b,p<0&&(p=0),w[u]>>p!==T[u]>>p)return!1;b-=$,u+=1}return!0}o(_,"matchCIDR");function P(w){if(i.test(w))return parseInt(w,16);if(w[0]==="0"&&!isNaN(parseInt(w[1],10))){if(n.test(w))return parseInt(w,8);throw new Error(`ipaddr: cannot parse ${w} as octal`)}return parseInt(w,10)}o(P,"parseIntAuto");function E(w,T){for(;w.length<T;)w=`0${w}`;return w}o(E,"padPart");let S={};S.IPv4=function(){function w(T){if(T.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let $,b;for($=0;$<T.length;$++)if(b=T[$],!(0<=b&&b<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=T}return o(w,"IPv4"),w.prototype.SpecialRanges={unspecified:[[new w([0,0,0,0]),8]],broadcast:[[new w([255,255,255,255]),32]],multicast:[[new w([224,0,0,0]),4]],linkLocal:[[new w([169,254,0,0]),16]],loopback:[[new w([127,0,0,0]),8]],carrierGradeNat:[[new w([100,64,0,0]),10]],private:[[new w([10,0,0,0]),8],[new w([172,16,0,0]),12],[new w([192,168,0,0]),16]],reserved:[[new w([192,0,0,0]),24],[new w([192,0,2,0]),24],[new w([192,88,99,0]),24],[new w([198,18,0,0]),15],[new w([198,51,100,0]),24],[new w([203,0,113,0]),24],[new w([240,0,0,0]),4]],as112:[[new w([192,175,48,0]),24],[new w([192,31,196,0]),24]],amt:[[new w([192,52,193,0]),24]]},w.prototype.kind=function(){return"ipv4"},w.prototype.match=function(T,$){let b;if($===void 0&&(b=T,T=b[0],$=b[1]),T.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return _(this.octets,T.octets,8,$)},w.prototype.prefixLengthFromSubnetMask=function(){let T=0,$=!1,b={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},u,p,c;for(u=3;u>=0;u-=1)if(p=this.octets[u],p in b){if(c=b[p],$&&c!==0)return null;c!==8&&($=!0),T+=c}else return null;return 32-T},w.prototype.range=function(){return S.subnetMatch(this,this.SpecialRanges)},w.prototype.toByteArray=function(){return this.octets.slice(0)},w.prototype.toIPv4MappedAddress=function(){return S.IPv6.parse(`::ffff:${this.toString()}`)},w.prototype.toNormalizedString=function(){return this.toString()},w.prototype.toString=function(){return this.octets.join(".")},w}(),S.IPv4.broadcastAddressFromCIDR=function(w){try{let T=this.parseCIDR(w),$=T[0].toByteArray(),b=this.subnetMaskFromPrefixLength(T[1]).toByteArray(),u=[],p=0;for(;p<4;)u.push(parseInt($[p],10)|parseInt(b[p],10)^255),p++;return new this(u)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},S.IPv4.isIPv4=function(w){return this.parser(w)!==null},S.IPv4.isValid=function(w){try{return new this(this.parser(w)),!0}catch{return!1}},S.IPv4.isValidCIDR=function(w){try{return this.parseCIDR(w),!0}catch{return!1}},S.IPv4.isValidFourPartDecimal=function(w){return!!(S.IPv4.isValid(w)&&w.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},S.IPv4.isValidCIDRFourPartDecimal=function(w){let T=w.match(/^(.+)\/(\d+)$/);return!S.IPv4.isValidCIDR(w)||!T?!1:S.IPv4.isValidFourPartDecimal(T[1])},S.IPv4.networkAddressFromCIDR=function(w){let T,$,b,u,p;try{for(T=this.parseCIDR(w),b=T[0].toByteArray(),p=this.subnetMaskFromPrefixLength(T[1]).toByteArray(),u=[],$=0;$<4;)u.push(parseInt(b[$],10)&parseInt(p[$],10)),$++;return new this(u)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},S.IPv4.parse=function(w){let T=this.parser(w);if(T===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(T)},S.IPv4.parseCIDR=function(w){let T;if(T=w.match(/^(.+)\/(\d+)$/)){let $=parseInt(T[2]);if($>=0&&$<=32){let b=[this.parse(T[1]),$];return Object.defineProperty(b,"toString",{value:o(function(){return this.join("/")},"value")}),b}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},S.IPv4.parser=function(w){let T,$,b;if(T=w.match(r.fourOctet))return function(){let u=T.slice(1,6),p=[];for(let c=0;c<u.length;c++)$=u[c],p.push(P($));return p}();if(T=w.match(r.longValue)){if(b=P(T[1]),b>4294967295||b<0)throw new Error("ipaddr: address outside defined range");return function(){let u=[],p;for(p=0;p<=24;p+=8)u.push(b>>p&255);return u}().reverse()}else return(T=w.match(r.twoOctet))?function(){let u=T.slice(1,4),p=[];if(b=P(u[1]),b>16777215||b<0)throw new Error("ipaddr: address outside defined range");return p.push(P(u[0])),p.push(b>>16&255),p.push(b>>8&255),p.push(b&255),p}():(T=w.match(r.threeOctet))?function(){let u=T.slice(1,5),p=[];if(b=P(u[2]),b>65535||b<0)throw new Error("ipaddr: address outside defined range");return p.push(P(u[0])),p.push(P(u[1])),p.push(b>>8&255),p.push(b&255),p}():null},S.IPv4.subnetMaskFromPrefixLength=function(w){if(w=parseInt(w),w<0||w>32)throw new Error("ipaddr: invalid IPv4 prefix length");let T=[0,0,0,0],$=0,b=Math.floor(w/8);for(;$<b;)T[$]=255,$++;return b<4&&(T[b]=Math.pow(2,w%8)-1<<8-w%8),new this(T)},S.IPv6=function(){function w(T,$){let b,u;if(T.length===16)for(this.parts=[],b=0;b<=14;b+=2)this.parts.push(T[b]<<8|T[b+1]);else if(T.length===8)this.parts=T;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(b=0;b<this.parts.length;b++)if(u=this.parts[b],!(0<=u&&u<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");$&&(this.zoneId=$)}return o(w,"IPv6"),w.prototype.SpecialRanges={unspecified:[new w([0,0,0,0,0,0,0,0]),128],linkLocal:[new w([65152,0,0,0,0,0,0,0]),10],multicast:[new w([65280,0,0,0,0,0,0,0]),8],loopback:[new w([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new w([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new w([0,0,0,0,0,65535,0,0]),96],discard:[new w([256,0,0,0,0,0,0,0]),64],rfc6145:[new w([0,0,0,0,65535,0,0,0]),96],rfc6052:[new w([100,65435,0,0,0,0,0,0]),96],"6to4":[new w([8194,0,0,0,0,0,0,0]),16],teredo:[new w([8193,0,0,0,0,0,0,0]),32],benchmarking:[new w([8193,2,0,0,0,0,0,0]),48],amt:[new w([8193,3,0,0,0,0,0,0]),32],as112v6:[[new w([8193,4,274,0,0,0,0,0]),48],[new w([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new w([8193,16,0,0,0,0,0,0]),28],orchid2:[new w([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new w([8193,48,0,0,0,0,0,0]),28],reserved:[[new w([8193,0,0,0,0,0,0,0]),23],[new w([8193,3512,0,0,0,0,0,0]),32]]},w.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},w.prototype.kind=function(){return"ipv6"},w.prototype.match=function(T,$){let b;if($===void 0&&(b=T,T=b[0],$=b[1]),T.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return _(this.parts,T.parts,16,$)},w.prototype.prefixLengthFromSubnetMask=function(){let T=0,$=!1,b={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},u,p;for(let c=7;c>=0;c-=1)if(u=this.parts[c],u in b){if(p=b[u],$&&p!==0)return null;p!==16&&($=!0),T+=p}else return null;return 128-T},w.prototype.range=function(){return S.subnetMatch(this,this.SpecialRanges)},w.prototype.toByteArray=function(){let T,$=[],b=this.parts;for(let u=0;u<b.length;u++)T=b[u],$.push(T>>8),$.push(T&255);return $},w.prototype.toFixedLengthString=function(){let T=function(){let b=[];for(let u=0;u<this.parts.length;u++)b.push(E(this.parts[u].toString(16),4));return b}.call(this).join(":"),$="";return this.zoneId&&($=`%${this.zoneId}`),T+$},w.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let T=this.parts.slice(-2),$=T[0],b=T[1];return new S.IPv4([$>>8,$&255,b>>8,b&255])},w.prototype.toNormalizedString=function(){let T=function(){let b=[];for(let u=0;u<this.parts.length;u++)b.push(this.parts[u].toString(16));return b}.call(this).join(":"),$="";return this.zoneId&&($=`%${this.zoneId}`),T+$},w.prototype.toRFC5952String=function(){let T=/((^|:)(0(:|$)){2,})/g,$=this.toNormalizedString(),b=0,u=-1,p;for(;p=T.exec($);)p[0].length>u&&(b=p.index,u=p[0].length);return u<0?$:`${$.substring(0,b)}::${$.substring(b+u)}`},w.prototype.toString=function(){return this.toRFC5952String()},w}(),S.IPv6.broadcastAddressFromCIDR=function(w){try{let T=this.parseCIDR(w),$=T[0].toByteArray(),b=this.subnetMaskFromPrefixLength(T[1]).toByteArray(),u=[],p=0;for(;p<16;)u.push(parseInt($[p],10)|parseInt(b[p],10)^255),p++;return new this(u)}catch(T){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${T})`)}},S.IPv6.isIPv6=function(w){return this.parser(w)!==null},S.IPv6.isValid=function(w){if(typeof w=="string"&&w.indexOf(":")===-1)return!1;try{let T=this.parser(w);return new this(T.parts,T.zoneId),!0}catch{return!1}},S.IPv6.isValidCIDR=function(w){if(typeof w=="string"&&w.indexOf(":")===-1)return!1;try{return this.parseCIDR(w),!0}catch{return!1}},S.IPv6.networkAddressFromCIDR=function(w){let T,$,b,u,p;try{for(T=this.parseCIDR(w),b=T[0].toByteArray(),p=this.subnetMaskFromPrefixLength(T[1]).toByteArray(),u=[],$=0;$<16;)u.push(parseInt(b[$],10)&parseInt(p[$],10)),$++;return new this(u)}catch(c){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${c})`)}},S.IPv6.parse=function(w){let T=this.parser(w);if(T.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(T.parts,T.zoneId)},S.IPv6.parseCIDR=function(w){let T,$,b;if(($=w.match(/^(.+)\/(\d+)$/))&&(T=parseInt($[2]),T>=0&&T<=128))return b=[this.parse($[1]),T],Object.defineProperty(b,"toString",{value:o(function(){return this.join("/")},"value")}),b;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},S.IPv6.parser=function(w){let T,$,b,u,p,c;if(b=w.match(m.deprecatedTransitional))return this.parser(`::ffff:${b[1]}`);if(m.native.test(w))return h(w,8);if((b=w.match(m.transitional))&&(c=b[6]||"",T=b[1],b[1].endsWith("::")||(T=T.slice(0,-1)),T=h(T+c,6),T.parts)){for(p=[parseInt(b[2]),parseInt(b[3]),parseInt(b[4]),parseInt(b[5])],$=0;$<p.length;$++)if(u=p[$],!(0<=u&&u<=255))return null;return T.parts.push(p[0]<<8|p[1]),T.parts.push(p[2]<<8|p[3]),{parts:T.parts,zoneId:T.zoneId}}return null},S.IPv6.subnetMaskFromPrefixLength=function(w){if(w=parseInt(w),w<0||w>128)throw new Error("ipaddr: invalid IPv6 prefix length");let T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],$=0,b=Math.floor(w/8);for(;$<b;)T[$]=255,$++;return b<16&&(T[b]=Math.pow(2,w%8)-1<<8-w%8),new this(T)},S.fromByteArray=function(w){let T=w.length;if(T===4)return new S.IPv4(w);if(T===16)return new S.IPv6(w);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},S.isValid=function(w){return S.IPv6.isValid(w)||S.IPv4.isValid(w)},S.isValidCIDR=function(w){return S.IPv6.isValidCIDR(w)||S.IPv4.isValidCIDR(w)},S.parse=function(w){if(S.IPv6.isValid(w))return S.IPv6.parse(w);if(S.IPv4.isValid(w))return S.IPv4.parse(w);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},S.parseCIDR=function(w){try{return S.IPv6.parseCIDR(w)}catch{try{return S.IPv4.parseCIDR(w)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},S.process=function(w){let T=this.parse(w);return T.kind()==="ipv6"&&T.isIPv4MappedAddress()?T.toIPv4Address():T},S.subnetMatch=function(w,T,$){let b,u,p,c;$==null&&($="unicast");for(u in T)if(Object.prototype.hasOwnProperty.call(T,u)){for(p=T[u],p[0]&&!(p[0]instanceof Array)&&(p=[p]),b=0;b<p.length;b++)if(c=p[b],w.kind()===c[0].kind()&&w.match.apply(w,c))return u}return $},typeof Ma<"u"&&Ma.exports?Ma.exports=S:t.ipaddr=S})(Bg)});var My=M((GK,jy)=>{var ky=require("stream").Stream,I0=require("util");jy.exports=Pr;function Pr(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(Pr,"DelayedStream");I0.inherits(Pr,ky);Pr.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(Pr.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});Pr.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Pr.prototype.resume=function(){this._released||this.release(),this.source.resume()};Pr.prototype.pause=function(){this.source.pause()};Pr.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};Pr.prototype.pipe=function(){var t=ky.prototype.pipe.apply(this,arguments);return this.resume(),t};Pr.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)};Pr.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 By=M((WK,qy)=>{var R0=require("util"),Ly=require("stream").Stream,Fy=My();qy.exports=lt;function lt(){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(lt,"CombinedStream");R0.inherits(lt,Ly);lt.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};lt.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};lt.prototype.append=function(t){var e=lt.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};lt.prototype.pipe=function(t,e){return Ly.prototype.pipe.call(this,t,e),this.resume(),t};lt.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}};lt.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=lt.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};lt.prototype._pipeNext=function(t){this._currentStream=t;var e=lt.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()};lt.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};lt.prototype.write=function(t){this.emit("data",t)};lt.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};lt.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")};lt.prototype.end=function(){this._reset(),this.emit("end")};lt.prototype.destroy=function(){this._reset(),this.emit("close")};lt.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};lt.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};lt.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)};lt.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var Gy=M((KK,Vy)=>{"use strict";Vy.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 Za=M(zt=>{"use strict";var Wa=Gy(),$0=require("path").extname,Hy=/^\s*([^;\s]*)(?:;|\s|$)/,O0=/^text\//i;zt.charset=Wy;zt.charsets={lookup:Wy};zt.contentType=D0;zt.extension=C0;zt.extensions=Object.create(null);zt.lookup=N0;zt.types=Object.create(null);z0(zt.extensions,zt.types);function Wy(t){if(!t||typeof t!="string")return!1;var e=Hy.exec(t),r=e&&Wa[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&O0.test(e[1])?"UTF-8":!1}o(Wy,"charset");function D0(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?zt.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=zt.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(D0,"contentType");function C0(t){if(!t||typeof t!="string")return!1;var e=Hy.exec(t),r=e&&zt.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(C0,"extension");function N0(t){if(!t||typeof t!="string")return!1;var e=$0("x."+t).toLowerCase().substr(1);return e&&zt.types[e]||!1}o(N0,"lookup");function z0(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(Wa).forEach(o(function(i){var a=Wa[i],f=a.extensions;if(!(!f||!f.length)){t[i]=f;for(var m=0;m<f.length;m++){var h=f[m];if(e[h]){var _=r.indexOf(Wa[e[h]].source),P=r.indexOf(a.source);if(e[h]!=="application/octet-stream"&&(_>P||_===P&&e[h].substr(0,12)==="application/"))continue}e[h]=i}}},"forEachMimeType"))}o(z0,"populateMaps")});var Ky=M((XK,Zy)=>{Zy.exports=U0;function U0(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(U0,"defer")});var Xl=M((eJ,Yy)=>{var Jy=Ky();Yy.exports=k0;function k0(t){var e=!1;return Jy(function(){e=!0}),o(function(n,i){e?t(n,i):Jy(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(k0,"async")});var Ql=M((rJ,Xy)=>{Xy.exports=j0;function j0(t){Object.keys(t.jobs).forEach(M0.bind(t)),t.jobs={}}o(j0,"abort");function M0(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(M0,"clean")});var ed=M((oJ,ev)=>{var Qy=Xl(),F0=Ql();ev.exports=L0;function L0(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=q0(e,i,t[i],function(a,f){i in r.jobs&&(delete r.jobs[i],a?F0(r):r.results[i]=f,n(a,r.results))})}o(L0,"iterate");function q0(t,e,r,n){var i;return t.length==2?i=t(r,Qy(n)):i=t(r,e,Qy(n)),i}o(q0,"runJob")});var td=M((sJ,tv)=>{tv.exports=B0;function B0(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,a){return e(t[i],t[a])}),n}o(B0,"state")});var rd=M((uJ,rv)=>{var V0=Ql(),G0=Xl();rv.exports=H0;function H0(t){Object.keys(this.jobs).length&&(this.index=this.size,V0(this),G0(t)(null,this.results))}o(H0,"terminator")});var ov=M((lJ,nv)=>{var W0=ed(),Z0=td(),K0=rd();nv.exports=J0;function J0(t,e,r){for(var n=Z0(t);n.index<(n.keyedList||t).length;)W0(t,e,n,function(i,a){if(i){r(i,a);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return K0.bind(n,r)}o(J0,"parallel")});var nd=M((pJ,Ka)=>{var iv=ed(),Y0=td(),X0=rd();Ka.exports=Q0;Ka.exports.ascending=sv;Ka.exports.descending=e$;function Q0(t,e,r,n){var i=Y0(t,r);return iv(t,e,i,o(function a(f,m){if(f){n(f,m);return}if(i.index++,i.index<(i.keyedList||t).length){iv(t,e,i,a);return}n(null,i.results)},"iteratorHandler")),X0.bind(i,n)}o(Q0,"serialOrdered");function sv(t,e){return t<e?-1:t>e?1:0}o(sv,"ascending");function e$(t,e){return-1*sv(t,e)}o(e$,"descending")});var uv=M((mJ,av)=>{var t$=nd();av.exports=r$;function r$(t,e,r){return t$(t,e,null,r)}o(r$,"serial")});var lv=M((gJ,cv)=>{cv.exports={parallel:ov(),serial:uv(),serialOrdered:nd()}});var od=M((yJ,dv)=>{"use strict";dv.exports=Object});var fv=M((vJ,pv)=>{"use strict";pv.exports=Error});var hv=M((_J,mv)=>{"use strict";mv.exports=EvalError});var yv=M((PJ,gv)=>{"use strict";gv.exports=RangeError});var _v=M((wJ,vv)=>{"use strict";vv.exports=ReferenceError});var wv=M((xJ,Pv)=>{"use strict";Pv.exports=SyntaxError});var Cn=M((SJ,xv)=>{"use strict";xv.exports=TypeError});var Tv=M((TJ,Sv)=>{"use strict";Sv.exports=URIError});var bv=M((EJ,Ev)=>{"use strict";Ev.exports=Math.abs});var Iv=M((bJ,Av)=>{"use strict";Av.exports=Math.floor});var $v=M((AJ,Rv)=>{"use strict";Rv.exports=Math.max});var Dv=M((IJ,Ov)=>{"use strict";Ov.exports=Math.min});var Nv=M((RJ,Cv)=>{"use strict";Cv.exports=Math.pow});var Uv=M(($J,zv)=>{"use strict";zv.exports=Math.round});var jv=M((OJ,kv)=>{"use strict";kv.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var Fv=M((CJ,Mv)=>{"use strict";var n$=jv();Mv.exports=o(function(e){return n$(e)||e===0?e:e<0?-1:1},"sign")});var qv=M((zJ,Lv)=>{"use strict";Lv.exports=Object.getOwnPropertyDescriptor});var id=M((UJ,Bv)=>{"use strict";var Ja=qv();if(Ja)try{Ja([],"length")}catch{Ja=null}Bv.exports=Ja});var Gv=M((kJ,Vv)=>{"use strict";var Ya=Object.defineProperty||!1;if(Ya)try{Ya({},"a",{value:1})}catch{Ya=!1}Vv.exports=Ya});var sd=M((jJ,Hv)=>{"use strict";Hv.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 a 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 f=Object.getOwnPropertySymbols(e);if(f.length!==1||f[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var m=Object.getOwnPropertyDescriptor(e,r);if(m.value!==i||m.enumerable!==!0)return!1}return!0},"hasSymbols")});var Kv=M((FJ,Zv)=>{"use strict";var Wv=typeof Symbol<"u"&&Symbol,o$=sd();Zv.exports=o(function(){return typeof Wv!="function"||typeof Symbol!="function"||typeof Wv("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:o$()},"hasNativeSymbols")});var ad=M((qJ,Jv)=>{"use strict";Jv.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var ud=M((BJ,Yv)=>{"use strict";var i$=od();Yv.exports=i$.getPrototypeOf||null});var e_=M((VJ,Qv)=>{"use strict";var s$="Function.prototype.bind called on incompatible ",a$=Object.prototype.toString,u$=Math.max,c$="[object Function]",Xv=o(function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var a=0;a<r.length;a+=1)n[a+e.length]=r[a];return n},"concatty"),l$=o(function(e,r){for(var n=[],i=r||0,a=0;i<e.length;i+=1,a+=1)n[a]=e[i];return n},"slicy"),d$=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");Qv.exports=o(function(e){var r=this;if(typeof r!="function"||a$.apply(r)!==c$)throw new TypeError(s$+r);for(var n=l$(arguments,1),i,a=o(function(){if(this instanceof i){var P=r.apply(this,Xv(n,arguments));return Object(P)===P?P:this}return r.apply(e,Xv(n,arguments))},"binder"),f=u$(0,r.length-n.length),m=[],h=0;h<f;h++)m[h]="$"+h;if(i=Function("binder","return function ("+d$(m,",")+"){ return binder.apply(this,arguments); }")(a),r.prototype){var _=o(function(){},"Empty");_.prototype=r.prototype,i.prototype=new _,_.prototype=null}return i},"bind")});var Vo=M((HJ,t_)=>{"use strict";var p$=e_();t_.exports=Function.prototype.bind||p$});var Xa=M((WJ,r_)=>{"use strict";r_.exports=Function.prototype.call});var cd=M((ZJ,n_)=>{"use strict";n_.exports=Function.prototype.apply});var i_=M((KJ,o_)=>{"use strict";o_.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var a_=M((JJ,s_)=>{"use strict";var f$=Vo(),m$=cd(),h$=Xa(),g$=i_();s_.exports=g$||f$.call(h$,m$)});var ld=M((YJ,u_)=>{"use strict";var y$=Vo(),v$=Cn(),_$=Xa(),P$=a_();u_.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new v$("a function is required");return P$(y$,_$,e)},"callBindBasic")});var m_=M((QJ,f_)=>{"use strict";var w$=ld(),c_=id(),d_;try{d_=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var dd=!!d_&&c_&&c_(Object.prototype,"__proto__"),p_=Object,l_=p_.getPrototypeOf;f_.exports=dd&&typeof dd.get=="function"?w$([dd.get]):typeof l_=="function"?o(function(e){return l_(e==null?e:p_(e))},"getDunder"):!1});var __=M((t8,v_)=>{"use strict";var h_=ad(),g_=ud(),y_=m_();v_.exports=h_?o(function(e){return h_(e)},"getProto"):g_?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return g_(e)},"getProto"):y_?o(function(e){return y_(e)},"getProto"):null});var pd=M((n8,P_)=>{"use strict";var x$=Function.prototype.call,S$=Object.prototype.hasOwnProperty,T$=Vo();P_.exports=T$.call(x$,S$)});var ns=M((o8,b_)=>{"use strict";var Ue,E$=od(),b$=fv(),A$=hv(),I$=yv(),R$=_v(),Zo=wv(),Wo=Cn(),$$=Tv(),O$=bv(),D$=Iv(),C$=$v(),N$=Dv(),z$=Nv(),U$=Uv(),k$=Fv(),T_=Function,fd=o(function(t){try{return T_('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),es=id(),j$=Gv(),md=o(function(){throw new Wo},"throwTypeError"),M$=es?function(){try{return arguments.callee,md}catch{try{return es(arguments,"callee").get}catch{return md}}}():md,Go=Kv()(),wt=__(),F$=ud(),L$=ad(),E_=cd(),ts=Xa(),Ho={},q$=typeof Uint8Array>"u"||!wt?Ue:wt(Uint8Array),oo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Ue:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ue:ArrayBuffer,"%ArrayIteratorPrototype%":Go&&wt?wt([][Symbol.iterator]()):Ue,"%AsyncFromSyncIteratorPrototype%":Ue,"%AsyncFunction%":Ho,"%AsyncGenerator%":Ho,"%AsyncGeneratorFunction%":Ho,"%AsyncIteratorPrototype%":Ho,"%Atomics%":typeof Atomics>"u"?Ue:Atomics,"%BigInt%":typeof BigInt>"u"?Ue:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ue:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ue:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ue:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":b$,"%eval%":eval,"%EvalError%":A$,"%Float16Array%":typeof Float16Array>"u"?Ue:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Ue:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ue:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ue:FinalizationRegistry,"%Function%":T_,"%GeneratorFunction%":Ho,"%Int8Array%":typeof Int8Array>"u"?Ue:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ue:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ue:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Go&&wt?wt(wt([][Symbol.iterator]())):Ue,"%JSON%":typeof JSON=="object"?JSON:Ue,"%Map%":typeof Map>"u"?Ue:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Go||!wt?Ue:wt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":E$,"%Object.getOwnPropertyDescriptor%":es,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ue:Promise,"%Proxy%":typeof Proxy>"u"?Ue:Proxy,"%RangeError%":I$,"%ReferenceError%":R$,"%Reflect%":typeof Reflect>"u"?Ue:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ue:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Go||!wt?Ue:wt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ue:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Go&&wt?wt(""[Symbol.iterator]()):Ue,"%Symbol%":Go?Symbol:Ue,"%SyntaxError%":Zo,"%ThrowTypeError%":M$,"%TypedArray%":q$,"%TypeError%":Wo,"%Uint8Array%":typeof Uint8Array>"u"?Ue:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ue:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ue:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ue:Uint32Array,"%URIError%":$$,"%WeakMap%":typeof WeakMap>"u"?Ue:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ue:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ue:WeakSet,"%Function.prototype.call%":ts,"%Function.prototype.apply%":E_,"%Object.defineProperty%":j$,"%Object.getPrototypeOf%":F$,"%Math.abs%":O$,"%Math.floor%":D$,"%Math.max%":C$,"%Math.min%":N$,"%Math.pow%":z$,"%Math.round%":U$,"%Math.sign%":k$,"%Reflect.getPrototypeOf%":L$};if(wt)try{null.error}catch(t){w_=wt(wt(t)),oo["%Error.prototype%"]=w_}var w_,B$=o(function t(e){var r;if(e==="%AsyncFunction%")r=fd("async function () {}");else if(e==="%GeneratorFunction%")r=fd("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=fd("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&wt&&(r=wt(i.prototype))}return oo[e]=r,r},"doEval"),x_={__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"]},rs=Vo(),Qa=pd(),V$=rs.call(ts,Array.prototype.concat),G$=rs.call(E_,Array.prototype.splice),S_=rs.call(ts,String.prototype.replace),eu=rs.call(ts,String.prototype.slice),H$=rs.call(ts,RegExp.prototype.exec),W$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Z$=/\\(\\)?/g,K$=o(function(e){var r=eu(e,0,1),n=eu(e,-1);if(r==="%"&&n!=="%")throw new Zo("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Zo("invalid intrinsic syntax, expected opening `%`");var i=[];return S_(e,W$,function(a,f,m,h){i[i.length]=m?S_(h,Z$,"$1"):f||a}),i},"stringToPath"),J$=o(function(e,r){var n=e,i;if(Qa(x_,n)&&(i=x_[n],n="%"+i[0]+"%"),Qa(oo,n)){var a=oo[n];if(a===Ho&&(a=B$(n)),typeof a>"u"&&!r)throw new Wo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Zo("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");b_.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new Wo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Wo('"allowMissing" argument must be a boolean');if(H$(/^%?[^%]*%?$/,e)===null)throw new Zo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=K$(e),i=n.length>0?n[0]:"",a=J$("%"+i+"%",r),f=a.name,m=a.value,h=!1,_=a.alias;_&&(i=_[0],G$(n,V$([0,1],_)));for(var P=1,E=!0;P<n.length;P+=1){var S=n[P],w=eu(S,0,1),T=eu(S,-1);if((w==='"'||w==="'"||w==="`"||T==='"'||T==="'"||T==="`")&&w!==T)throw new Zo("property names with quotes must have matching quotes");if((S==="constructor"||!E)&&(h=!0),i+="."+S,f="%"+i+"%",Qa(oo,f))m=oo[f];else if(m!=null){if(!(S in m)){if(!r)throw new Wo("base intrinsic for "+e+" exists, but the property is not available.");return}if(es&&P+1>=n.length){var $=es(m,S);E=!!$,E&&"get"in $&&!("originalValue"in $.get)?m=$.get:m=m[S]}else E=Qa(m,S),m=m[S];E&&!h&&(oo[f]=m)}}return m},"GetIntrinsic")});var I_=M((s8,A_)=>{"use strict";var Y$=sd();A_.exports=o(function(){return Y$()&&!!Symbol.toStringTag},"hasToStringTagShams")});var O_=M((u8,$_)=>{"use strict";var X$=ns(),R_=X$("%Object.defineProperty%",!0),Q$=I_()(),eO=pd(),tO=Cn(),tu=Q$?Symbol.toStringTag:null;$_.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 tO("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");tu&&(n||!eO(e,tu))&&(R_?R_(e,tu,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[tu]=r)},"setToStringTag")});var C_=M((l8,D_)=>{"use strict";var rO=Function.prototype.call,nO=Object.prototype.hasOwnProperty,oO=Vo();D_.exports=oO.call(rO,nO)});var z_=M((d8,N_)=>{"use strict";N_.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var j_=M((p8,k_)=>{"use strict";var vd=By(),iO=require("util"),hd=require("path"),sO=require("http"),aO=require("https"),uO=require("url").parse,cO=require("fs"),lO=require("stream").Stream,dO=require("crypto"),gd=Za(),pO=lv(),fO=O_(),Nn=C_(),yd=z_();function U_(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(U_,"escapeHeaderParam");function Le(t){if(!(this instanceof Le))return new Le(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],vd.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(Le,"FormData");iO.inherits(Le,vd);Le.LINE_BREAK=`\r
2
- `;Le.DEFAULT_CONTENT_TYPE="application/octet-stream";Le.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=vd.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),a=this._multiPartFooter();n(i),n(e),n(a),this._trackLength(i,e,r)};Le.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)+Le.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&Nn(e,"httpVersion"))&&!(e instanceof lO))&&(r.knownLength||this._valuesToMeasure.push(e))};Le.prototype._lengthRetriever=function(t,e){Nn(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):cO.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):Nn(t,"httpVersion")?e(null,Number(t.headers["content-length"])):Nn(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};Le.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),a="",f={"Content-Disposition":["form-data",'name="'+U_(t)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&yd(f,r.header);var m;for(var h in f)if(Nn(f,h)){if(m=f[h],m==null)continue;Array.isArray(m)||(m=[m]),m.length&&(a+=h+": "+m.join("; ")+Le.LINE_BREAK)}return"--"+this.getBoundary()+Le.LINE_BREAK+a+Le.LINE_BREAK};Le.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=hd.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=hd.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&Nn(t,"httpVersion")&&(r=hd.basename(t.client._httpMessage.path||"")),r)return'filename="'+U_(r)+'"'};Le.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=gd.lookup(t.name)),!r&&t&&t.path&&(r=gd.lookup(t.path)),!r&&t&&t.readable&&Nn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=gd.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=Le.DEFAULT_CONTENT_TYPE),r};Le.prototype._multiPartFooter=function(){return function(t){var e=Le.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};Le.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Le.LINE_BREAK};Le.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)Nn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};Le.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Le.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Le.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(Le.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Le.prototype._generateBoundary=function(){this._boundary="--------------------------"+dO.randomBytes(12).toString("hex")};Le.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};Le.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Le.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}pO.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};Le.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=uO(t),n=yd({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=yd(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=aO.request(n):r=sO.request(n),this.getLength(function(a,f){if(a&&a!=="Unknown stream"){this._error(a);return}if(f&&r.setHeader("Content-Length",f),this.pipe(r),e){var m,h=o(function(_,P){return r.removeListener("error",h),r.removeListener("response",m),e.call(this,_,P)},"callback");m=h.bind(this,null),r.on("error",h),r.on("response",m)}}.bind(this)),r};Le.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Le.prototype.toString=function(){return"[object FormData]"};fO(Le.prototype,"FormData");k_.exports=Le});var os=M((z8,Z_)=>{"use strict";var ru=Object.prototype.hasOwnProperty,W_=Object.prototype.toString,L_=Object.defineProperty,q_=Object.getOwnPropertyDescriptor,B_=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):W_.call(e)==="[object Array]"},"isArray"),V_=o(function(e){if(!e||W_.call(e)!=="[object Object]")return!1;var r=ru.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&ru.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||ru.call(e,i)},"isPlainObject"),G_=o(function(e,r){L_&&r.name==="__proto__"?L_(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),H_=o(function(e,r){if(r==="__proto__")if(ru.call(e,r)){if(q_)return q_(e,r).value}else return;return e[r]},"getProperty");Z_.exports=o(function t(){var e,r,n,i,a,f,m=arguments[0],h=1,_=arguments.length,P=!1;for(typeof m=="boolean"&&(P=m,m=arguments[1]||{},h=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});h<_;++h)if(e=arguments[h],e!=null)for(r in e)n=H_(m,r),i=H_(e,r),m!==i&&(P&&i&&(V_(i)||(a=B_(i)))?(a?(a=!1,f=n&&B_(n)?n:[]):f=n&&V_(n)?n:{},G_(m,{name:r,newValue:t(P,f,i)})):typeof i<"u"&&G_(m,{name:r,newValue:i}));return m},"extend")});var K_=M((k8,xO)=>{xO.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 Y_=M((j8,J_)=>{"use strict";var SO=K_();J_.exports={pkg:SO}});var wd=M(ar=>{"use strict";var Q_=ar&&ar.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ar,"__esModule",{value:!0});ar.GaxiosError=ar.GAXIOS_ERROR_SYMBOL=void 0;ar.defaultErrorRedactor=eP;var X_=Q_(os()),TO=Q_(Y_()),_d=TO.default.pkg;ar.GAXIOS_ERROR_SYMBOL=Symbol.for(`${_d.name}-gaxios-error`);var Pd=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[ar.GAXIOS_ERROR_SYMBOL]=_d.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&ar.GAXIOS_ERROR_SYMBOL in e&&e[ar.GAXIOS_ERROR_SYMBOL]===_d.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,X_.default)(!0,{},r),this.response&&(this.response.config=(0,X_.default)(!0,{},this.response.config)),this.response){try{this.response.data=EO(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,a="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 f=[];for(let m of e.data.error.errors)typeof m=="object"&&"message"in m&&typeof m.message=="string"&&f.push(m.message);return Object.assign({message:f.join(`
3
- `)||n,code:a,status:i},e.data.error)}return Object.assign({message:n,code:a,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};ar.GaxiosError=Pd;function EO(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(EO,"translateData");function eP(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(a){a&&a.forEach((f,m)=>{(/^authentication$/i.test(m)||/^authorization$/i.test(m)||/secret/i.test(m))&&a.set(m,e)})}o(r,"redactHeaders");function n(a,f){if(typeof a=="object"&&a!==null&&typeof a[f]=="string"){let m=a[f];(/grant_type=/i.test(m)||/assertion=/i.test(m)||/secret/i.test(m))&&(a[f]=e)}}o(n,"redactString");function i(a){!a||typeof a!="object"||(a instanceof FormData||a instanceof URLSearchParams||"forEach"in a&&"set"in a?a.forEach((f,m)=>{(["grant_type","assertion"].includes(m)||/secret/.test(m))&&a.set(m,e)}):("grant_type"in a&&(a.grant_type=e),"assertion"in a&&(a.assertion=e),"client_secret"in a&&(a.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&&(eP({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(eP,"defaultErrorRedactor")});var rP=M(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.getRetryConfig=bO;async function bO(t){let e=tP(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||AO)(t))return{shouldRetry:!1,config:t.config};let i=IO(e);t.config.retryConfig.currentRetryAttempt+=1;let a=e.retryBackoff?e.retryBackoff(t,i):new Promise(f=>{setTimeout(f,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await a,{shouldRetry:!0,config:t.config}}o(bO,"getRetryConfig");function AO(t){let e=tP(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 a=t.response.status;if(a>=n&&a<=i){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}o(AO,"shouldRetryRequest");function tP(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(tP,"getConfig");function IO(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(IO,"getNextRetryDelay")});var Td=M(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.GaxiosInterceptorManager=void 0;var Sd=class extends Set{static{o(this,"GaxiosInterceptorManager")}};nu.GaxiosInterceptorManager=Sd});var oP=M((G8,nP)=>{var Ko=1e3,Jo=Ko*60,Yo=Jo*60,io=Yo*24,RO=io*7,$O=io*365.25;nP.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return OO(t);if(r==="number"&&isFinite(t))return e.long?CO(t):DO(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function OO(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*$O;case"weeks":case"week":case"w":return r*RO;case"days":case"day":case"d":return r*io;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Yo;case"minutes":case"minute":case"mins":case"min":case"m":return r*Jo;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ko;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(OO,"parse");function DO(t){var e=Math.abs(t);return e>=io?Math.round(t/io)+"d":e>=Yo?Math.round(t/Yo)+"h":e>=Jo?Math.round(t/Jo)+"m":e>=Ko?Math.round(t/Ko)+"s":t+"ms"}o(DO,"fmtShort");function CO(t){var e=Math.abs(t);return e>=io?ou(t,e,io,"day"):e>=Yo?ou(t,e,Yo,"hour"):e>=Jo?ou(t,e,Jo,"minute"):e>=Ko?ou(t,e,Ko,"second"):t+" ms"}o(CO,"fmtLong");function ou(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(ou,"plural")});var Ed=M((W8,iP)=>{function NO(t){r.debug=r,r.default=r,r.coerce=h,r.disable=f,r.enable=i,r.enabled=m,r.humanize=oP(),r.destroy=_,Object.keys(t).forEach(P=>{r[P]=t[P]}),r.names=[],r.skips=[],r.formatters={};function e(P){let E=0;for(let S=0;S<P.length;S++)E=(E<<5)-E+P.charCodeAt(S),E|=0;return r.colors[Math.abs(E)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(P){let E,S=null,w,T;function $(...b){if(!$.enabled)return;let u=$,p=Number(new Date),c=p-(E||p);u.diff=c,u.prev=E,u.curr=p,E=p,b[0]=r.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let y=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(x,g)=>{if(x==="%%")return"%";y++;let re=r.formatters[g];if(typeof re=="function"){let ee=b[y];x=re.call(u,ee),b.splice(y,1),y--}return x}),r.formatArgs.call(u,b),(u.log||r.log).apply(u,b)}return o($,"debug"),$.namespace=P,$.useColors=r.useColors(),$.color=r.selectColor(P),$.extend=n,$.destroy=r.destroy,Object.defineProperty($,"enabled",{enumerable:!0,configurable:!1,get:o(()=>S!==null?S:(w!==r.namespaces&&(w=r.namespaces,T=r.enabled(P)),T),"get"),set:o(b=>{S=b},"set")}),typeof r.init=="function"&&r.init($),$}o(r,"createDebug");function n(P,E){let S=r(this.namespace+(typeof E>"u"?":":E)+P);return S.log=this.log,S}o(n,"extend");function i(P){r.save(P),r.namespaces=P,r.names=[],r.skips=[];let E=(typeof P=="string"?P:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let S of E)S[0]==="-"?r.skips.push(S.slice(1)):r.names.push(S)}o(i,"enable");function a(P,E){let S=0,w=0,T=-1,$=0;for(;S<P.length;)if(w<E.length&&(E[w]===P[S]||E[w]==="*"))E[w]==="*"?(T=w,$=S,w++):(S++,w++);else if(T!==-1)w=T+1,$++,S=$;else return!1;for(;w<E.length&&E[w]==="*";)w++;return w===E.length}o(a,"matchesTemplate");function f(){let P=[...r.names,...r.skips.map(E=>"-"+E)].join(",");return r.enable(""),P}o(f,"disable");function m(P){for(let E of r.skips)if(a(P,E))return!1;for(let E of r.names)if(a(P,E))return!0;return!1}o(m,"enabled");function h(P){return P instanceof Error?P.stack||P.message:P}o(h,"coerce");function _(){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(_,"destroy"),r.enable(r.load()),r}o(NO,"setup");iP.exports=NO});var sP=M((Ut,iu)=>{Ut.formatArgs=UO;Ut.save=kO;Ut.load=jO;Ut.useColors=zO;Ut.storage=MO();Ut.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`."))}})();Ut.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 zO(){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(zO,"useColors");function UO(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+iu.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(UO,"formatArgs");Ut.log=console.debug||console.log||(()=>{});function kO(t){try{t?Ut.storage.setItem("debug",t):Ut.storage.removeItem("debug")}catch{}}o(kO,"save");function jO(){let t;try{t=Ut.storage.getItem("debug")||Ut.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(jO,"load");function MO(){try{return localStorage}catch{}}o(MO,"localstorage");iu.exports=Ed()(Ut);var{formatters:FO}=iu.exports;FO.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var uP=M((J8,aP)=>{"use strict";aP.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 dP=M((Y8,lP)=>{"use strict";var LO=require("os"),cP=require("tty"),ur=uP(),{env:xt}=process,zn;ur("no-color")||ur("no-colors")||ur("color=false")||ur("color=never")?zn=0:(ur("color")||ur("colors")||ur("color=true")||ur("color=always"))&&(zn=1);"FORCE_COLOR"in xt&&(xt.FORCE_COLOR==="true"?zn=1:xt.FORCE_COLOR==="false"?zn=0:zn=xt.FORCE_COLOR.length===0?1:Math.min(parseInt(xt.FORCE_COLOR,10),3));function bd(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(bd,"translateLevel");function Ad(t,e){if(zn===0)return 0;if(ur("color=16m")||ur("color=full")||ur("color=truecolor"))return 3;if(ur("color=256"))return 2;if(t&&!e&&zn===void 0)return 0;let r=zn||0;if(xt.TERM==="dumb")return r;if(process.platform==="win32"){let n=LO.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in xt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in xt)||xt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in xt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(xt.TEAMCITY_VERSION)?1:0;if(xt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in xt){let n=parseInt((xt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(xt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(xt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(xt.TERM)||"COLORTERM"in xt?1:r}o(Ad,"supportsColor");function qO(t){let e=Ad(t,t&&t.isTTY);return bd(e)}o(qO,"getSupportLevel");lP.exports={supportsColor:qO,stdout:bd(Ad(!0,cP.isatty(1))),stderr:bd(Ad(!0,cP.isatty(2)))}});var fP=M((St,au)=>{var BO=require("tty"),su=require("util");St.init=JO;St.log=WO;St.formatArgs=GO;St.save=ZO;St.load=KO;St.useColors=VO;St.destroy=su.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");St.colors=[6,2,3,4,5,1];try{let t=dP();t&&(t.stderr||t).level>=2&&(St.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{}St.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,a)=>a.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 VO(){return"colors"in St.inspectOpts?!!St.inspectOpts.colors:BO.isatty(process.stderr.fd)}o(VO,"useColors");function GO(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),a=` ${i};1m${e} \x1B[0m`;t[0]=a+t[0].split(`
1
+ "use strict";var f0=Object.create;var ko=Object.defineProperty;var m0=Object.getOwnPropertyDescriptor;var h0=Object.getOwnPropertyNames;var g0=Object.getPrototypeOf,y0=Object.prototype.hasOwnProperty;var i=(t,e)=>ko(t,"name",{value:e,configurable:!0});var St=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var L=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ss=(t,e)=>{for(var r in e)ko(t,r,{get:e[r],enumerable:!0})},Ch=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of h0(e))!y0.call(t,o)&&o!==r&&ko(t,o,{get:()=>e[o],enumerable:!(n=m0(e,o))||n.enumerable});return t};var ue=(t,e,r)=>(r=t!=null?f0(g0(t)):{},Ch(e||!t||!t.__esModule?ko(r,"default",{value:t,enumerable:!0}):r,t)),v0=t=>Ch(ko({},"__esModule",{value:!0}),t);var ry=L((ty,Gs)=>{(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"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",p="(?:[0-9a-f]+::?)+",m={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${p})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${p})|(?:::)(?:${p})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function h(w,S){if(w.indexOf("::")!==w.lastIndexOf("::"))return null;let D=0,E=-1,u=(w.match(m.zoneIndex)||[])[0],f,c;for(u&&(u=u.substring(1),w=w.replace(/%.+$/,""));(E=w.indexOf(":",E+1))>=0;)D++;if(w.substr(0,2)==="::"&&D--,w.substr(-2,2)==="::"&&D--,D>S)return null;for(c=S-D,f=":";c--;)f+="0:";return w=w.replace("::",f),w[0]===":"&&(w=w.slice(1)),w[w.length-1]===":"&&(w=w.slice(0,-1)),S=(function(){let y=w.split(":"),l=[];for(let b=0;b<y.length;b++)l.push(parseInt(y[b],16));return l})(),{parts:S,zoneId:u}}i(h,"expandIPv6");function v(w,S,D,E){if(w.length!==S.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let u=0,f;for(;E>0;){if(f=D-E,f<0&&(f=0),w[u]>>f!==S[u]>>f)return!1;E-=D,u+=1}return!0}i(v,"matchCIDR");function P(w){if(o.test(w))return parseInt(w,16);if(w[0]==="0"&&!isNaN(parseInt(w[1],10))){if(n.test(w))return parseInt(w,8);throw new Error(`ipaddr: cannot parse ${w} as octal`)}return parseInt(w,10)}i(P,"parseIntAuto");function x(w,S){for(;w.length<S;)w=`0${w}`;return w}i(x,"padPart");let T={};T.IPv4=(function(){function w(S){if(S.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let D,E;for(D=0;D<S.length;D++)if(E=S[D],!(0<=E&&E<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=S}return i(w,"IPv4"),w.prototype.SpecialRanges={unspecified:[[new w([0,0,0,0]),8]],broadcast:[[new w([255,255,255,255]),32]],multicast:[[new w([224,0,0,0]),4]],linkLocal:[[new w([169,254,0,0]),16]],loopback:[[new w([127,0,0,0]),8]],carrierGradeNat:[[new w([100,64,0,0]),10]],private:[[new w([10,0,0,0]),8],[new w([172,16,0,0]),12],[new w([192,168,0,0]),16]],reserved:[[new w([192,0,0,0]),24],[new w([192,0,2,0]),24],[new w([192,88,99,0]),24],[new w([198,18,0,0]),15],[new w([198,51,100,0]),24],[new w([203,0,113,0]),24],[new w([240,0,0,0]),4]],as112:[[new w([192,175,48,0]),24],[new w([192,31,196,0]),24]],amt:[[new w([192,52,193,0]),24]]},w.prototype.kind=function(){return"ipv4"},w.prototype.match=function(S,D){let E;if(D===void 0&&(E=S,S=E[0],D=E[1]),S.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return v(this.octets,S.octets,8,D)},w.prototype.prefixLengthFromSubnetMask=function(){let S=0,D=!1,E={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},u,f,c;for(u=3;u>=0;u-=1)if(f=this.octets[u],f in E){if(c=E[f],D&&c!==0)return null;c!==8&&(D=!0),S+=c}else return null;return 32-S},w.prototype.range=function(){return T.subnetMatch(this,this.SpecialRanges)},w.prototype.toByteArray=function(){return this.octets.slice(0)},w.prototype.toIPv4MappedAddress=function(){return T.IPv6.parse(`::ffff:${this.toString()}`)},w.prototype.toNormalizedString=function(){return this.toString()},w.prototype.toString=function(){return this.octets.join(".")},w})(),T.IPv4.broadcastAddressFromCIDR=function(w){try{let S=this.parseCIDR(w),D=S[0].toByteArray(),E=this.subnetMaskFromPrefixLength(S[1]).toByteArray(),u=[],f=0;for(;f<4;)u.push(parseInt(D[f],10)|parseInt(E[f],10)^255),f++;return new this(u)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},T.IPv4.isIPv4=function(w){return this.parser(w)!==null},T.IPv4.isValid=function(w){try{return new this(this.parser(w)),!0}catch{return!1}},T.IPv4.isValidCIDR=function(w){try{return this.parseCIDR(w),!0}catch{return!1}},T.IPv4.isValidFourPartDecimal=function(w){return!!(T.IPv4.isValid(w)&&w.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},T.IPv4.isValidCIDRFourPartDecimal=function(w){let S=w.match(/^(.+)\/(\d+)$/);return!T.IPv4.isValidCIDR(w)||!S?!1:T.IPv4.isValidFourPartDecimal(S[1])},T.IPv4.networkAddressFromCIDR=function(w){let S,D,E,u,f;try{for(S=this.parseCIDR(w),E=S[0].toByteArray(),f=this.subnetMaskFromPrefixLength(S[1]).toByteArray(),u=[],D=0;D<4;)u.push(parseInt(E[D],10)&parseInt(f[D],10)),D++;return new this(u)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},T.IPv4.parse=function(w){let S=this.parser(w);if(S===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(S)},T.IPv4.parseCIDR=function(w){let S;if(S=w.match(/^(.+)\/(\d+)$/)){let D=parseInt(S[2]);if(D>=0&&D<=32){let E=[this.parse(S[1]),D];return Object.defineProperty(E,"toString",{value:i(function(){return this.join("/")},"value")}),E}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},T.IPv4.parser=function(w){let S,D,E;if(S=w.match(r.fourOctet))return(function(){let u=S.slice(1,6),f=[];for(let c=0;c<u.length;c++)D=u[c],f.push(P(D));return f})();if(S=w.match(r.longValue)){if(E=P(S[1]),E>4294967295||E<0)throw new Error("ipaddr: address outside defined range");return(function(){let u=[],f;for(f=0;f<=24;f+=8)u.push(E>>f&255);return u})().reverse()}else return(S=w.match(r.twoOctet))?(function(){let u=S.slice(1,4),f=[];if(E=P(u[1]),E>16777215||E<0)throw new Error("ipaddr: address outside defined range");return f.push(P(u[0])),f.push(E>>16&255),f.push(E>>8&255),f.push(E&255),f})():(S=w.match(r.threeOctet))?(function(){let u=S.slice(1,5),f=[];if(E=P(u[2]),E>65535||E<0)throw new Error("ipaddr: address outside defined range");return f.push(P(u[0])),f.push(P(u[1])),f.push(E>>8&255),f.push(E&255),f})():null},T.IPv4.subnetMaskFromPrefixLength=function(w){if(w=parseInt(w),w<0||w>32)throw new Error("ipaddr: invalid IPv4 prefix length");let S=[0,0,0,0],D=0,E=Math.floor(w/8);for(;D<E;)S[D]=255,D++;return E<4&&(S[E]=Math.pow(2,w%8)-1<<8-w%8),new this(S)},T.IPv6=(function(){function w(S,D){let E,u;if(S.length===16)for(this.parts=[],E=0;E<=14;E+=2)this.parts.push(S[E]<<8|S[E+1]);else if(S.length===8)this.parts=S;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(E=0;E<this.parts.length;E++)if(u=this.parts[E],!(0<=u&&u<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");D&&(this.zoneId=D)}return i(w,"IPv6"),w.prototype.SpecialRanges={unspecified:[new w([0,0,0,0,0,0,0,0]),128],linkLocal:[new w([65152,0,0,0,0,0,0,0]),10],multicast:[new w([65280,0,0,0,0,0,0,0]),8],loopback:[new w([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new w([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new w([0,0,0,0,0,65535,0,0]),96],discard:[new w([256,0,0,0,0,0,0,0]),64],rfc6145:[new w([0,0,0,0,65535,0,0,0]),96],rfc6052:[new w([100,65435,0,0,0,0,0,0]),96],"6to4":[new w([8194,0,0,0,0,0,0,0]),16],teredo:[new w([8193,0,0,0,0,0,0,0]),32],benchmarking:[new w([8193,2,0,0,0,0,0,0]),48],amt:[new w([8193,3,0,0,0,0,0,0]),32],as112v6:[[new w([8193,4,274,0,0,0,0,0]),48],[new w([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new w([8193,16,0,0,0,0,0,0]),28],orchid2:[new w([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new w([8193,48,0,0,0,0,0,0]),28],reserved:[[new w([8193,0,0,0,0,0,0,0]),23],[new w([8193,3512,0,0,0,0,0,0]),32]]},w.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},w.prototype.kind=function(){return"ipv6"},w.prototype.match=function(S,D){let E;if(D===void 0&&(E=S,S=E[0],D=E[1]),S.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return v(this.parts,S.parts,16,D)},w.prototype.prefixLengthFromSubnetMask=function(){let S=0,D=!1,E={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},u,f;for(let c=7;c>=0;c-=1)if(u=this.parts[c],u in E){if(f=E[u],D&&f!==0)return null;f!==16&&(D=!0),S+=f}else return null;return 128-S},w.prototype.range=function(){return T.subnetMatch(this,this.SpecialRanges)},w.prototype.toByteArray=function(){let S,D=[],E=this.parts;for(let u=0;u<E.length;u++)S=E[u],D.push(S>>8),D.push(S&255);return D},w.prototype.toFixedLengthString=function(){let S=(function(){let E=[];for(let u=0;u<this.parts.length;u++)E.push(x(this.parts[u].toString(16),4));return E}).call(this).join(":"),D="";return this.zoneId&&(D=`%${this.zoneId}`),S+D},w.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let S=this.parts.slice(-2),D=S[0],E=S[1];return new T.IPv4([D>>8,D&255,E>>8,E&255])},w.prototype.toNormalizedString=function(){let S=(function(){let E=[];for(let u=0;u<this.parts.length;u++)E.push(this.parts[u].toString(16));return E}).call(this).join(":"),D="";return this.zoneId&&(D=`%${this.zoneId}`),S+D},w.prototype.toRFC5952String=function(){let S=/((^|:)(0(:|$)){2,})/g,D=this.toNormalizedString(),E=0,u=-1,f;for(;f=S.exec(D);)f[0].length>u&&(E=f.index,u=f[0].length);return u<0?D:`${D.substring(0,E)}::${D.substring(E+u)}`},w.prototype.toString=function(){return this.toRFC5952String()},w})(),T.IPv6.broadcastAddressFromCIDR=function(w){try{let S=this.parseCIDR(w),D=S[0].toByteArray(),E=this.subnetMaskFromPrefixLength(S[1]).toByteArray(),u=[],f=0;for(;f<16;)u.push(parseInt(D[f],10)|parseInt(E[f],10)^255),f++;return new this(u)}catch(S){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${S})`)}},T.IPv6.isIPv6=function(w){return this.parser(w)!==null},T.IPv6.isValid=function(w){if(typeof w=="string"&&w.indexOf(":")===-1)return!1;try{let S=this.parser(w);return new this(S.parts,S.zoneId),!0}catch{return!1}},T.IPv6.isValidCIDR=function(w){if(typeof w=="string"&&w.indexOf(":")===-1)return!1;try{return this.parseCIDR(w),!0}catch{return!1}},T.IPv6.networkAddressFromCIDR=function(w){let S,D,E,u,f;try{for(S=this.parseCIDR(w),E=S[0].toByteArray(),f=this.subnetMaskFromPrefixLength(S[1]).toByteArray(),u=[],D=0;D<16;)u.push(parseInt(E[D],10)&parseInt(f[D],10)),D++;return new this(u)}catch(c){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${c})`)}},T.IPv6.parse=function(w){let S=this.parser(w);if(S.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(S.parts,S.zoneId)},T.IPv6.parseCIDR=function(w){let S,D,E;if((D=w.match(/^(.+)\/(\d+)$/))&&(S=parseInt(D[2]),S>=0&&S<=128))return E=[this.parse(D[1]),S],Object.defineProperty(E,"toString",{value:i(function(){return this.join("/")},"value")}),E;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},T.IPv6.parser=function(w){let S,D,E,u,f,c;if(E=w.match(m.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(m.native.test(w))return h(w,8);if((E=w.match(m.transitional))&&(c=E[6]||"",S=E[1],E[1].endsWith("::")||(S=S.slice(0,-1)),S=h(S+c,6),S.parts)){for(f=[parseInt(E[2]),parseInt(E[3]),parseInt(E[4]),parseInt(E[5])],D=0;D<f.length;D++)if(u=f[D],!(0<=u&&u<=255))return null;return S.parts.push(f[0]<<8|f[1]),S.parts.push(f[2]<<8|f[3]),{parts:S.parts,zoneId:S.zoneId}}return null},T.IPv6.subnetMaskFromPrefixLength=function(w){if(w=parseInt(w),w<0||w>128)throw new Error("ipaddr: invalid IPv6 prefix length");let S=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],D=0,E=Math.floor(w/8);for(;D<E;)S[D]=255,D++;return E<16&&(S[E]=Math.pow(2,w%8)-1<<8-w%8),new this(S)},T.fromByteArray=function(w){let S=w.length;if(S===4)return new T.IPv4(w);if(S===16)return new T.IPv6(w);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},T.isValid=function(w){return T.IPv6.isValid(w)||T.IPv4.isValid(w)},T.isValidCIDR=function(w){return T.IPv6.isValidCIDR(w)||T.IPv4.isValidCIDR(w)},T.parse=function(w){if(T.IPv6.isValid(w))return T.IPv6.parse(w);if(T.IPv4.isValid(w))return T.IPv4.parse(w);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},T.parseCIDR=function(w){try{return T.IPv6.parseCIDR(w)}catch{try{return T.IPv4.parseCIDR(w)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},T.process=function(w){let S=this.parse(w);return S.kind()==="ipv6"&&S.isIPv4MappedAddress()?S.toIPv4Address():S},T.subnetMatch=function(w,S,D){let E,u,f,c;D==null&&(D="unicast");for(u in S)if(Object.prototype.hasOwnProperty.call(S,u)){for(f=S[u],f[0]&&!(f[0]instanceof Array)&&(f=[f]),E=0;E<f.length;E++)if(c=f[E],w.kind()===c[0].kind()&&w.match.apply(w,c))return u}return D},typeof Gs<"u"&&Gs.exports?Gs.exports=T:t.ipaddr=T})(ty)});var rv=L((b5,tv)=>{var ev=require("stream").Stream,eO=require("util");tv.exports=br;function br(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(br,"DelayedStream");eO.inherits(br,ev);br.create=function(t,e){var r=new this;e=e||{};for(var n in e)r[n]=e[n];r.source=t;var o=t.emit;return t.emit=function(){return r._handleEmit(arguments),o.apply(t,arguments)},t.on("error",function(){}),r.pauseStream&&t.pause(),r};Object.defineProperty(br.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});br.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};br.prototype.resume=function(){this._released||this.release(),this.source.resume()};br.prototype.pause=function(){this.source.pause()};br.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};br.prototype.pipe=function(){var t=ev.prototype.pipe.apply(this,arguments);return this.resume(),t};br.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)};br.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 av=L((S5,ov)=>{var tO=require("util"),iv=require("stream").Stream,nv=rv();ov.exports=dt;function dt(){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}i(dt,"CombinedStream");tO.inherits(dt,iv);dt.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};dt.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};dt.prototype.append=function(t){var e=dt.isStreamLike(t);if(e){if(!(t instanceof nv)){var r=nv.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};dt.prototype.pipe=function(t,e){return iv.prototype.pipe.call(this,t,e),this.resume(),t};dt.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}};dt.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=dt.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};dt.prototype._pipeNext=function(t){this._currentStream=t;var e=dt.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()};dt.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};dt.prototype.write=function(t){this.emit("data",t)};dt.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};dt.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")};dt.prototype.end=function(){this._reset(),this.emit("end")};dt.prototype.destroy=function(){this._reset(),this.emit("close")};dt.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};dt.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};dt.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)};dt.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var uv=L((E5,sv)=>{"use strict";sv.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 Fn=L(Ut=>{"use strict";var Xs=uv(),rO=require("path").extname,cv=/^\s*([^;\s]*)(?:;|\s|$)/,nO=/^text\//i;Ut.charset=lv;Ut.charsets={lookup:lv};Ut.contentType=iO;Ut.extension=oO;Ut.extensions=Object.create(null);Ut.lookup=aO;Ut.types=Object.create(null);sO(Ut.extensions,Ut.types);function lv(t){if(!t||typeof t!="string")return!1;var e=cv.exec(t),r=e&&Xs[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&nO.test(e[1])?"UTF-8":!1}i(lv,"charset");function iO(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Ut.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Ut.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}i(iO,"contentType");function oO(t){if(!t||typeof t!="string")return!1;var e=cv.exec(t),r=e&&Ut.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(oO,"extension");function aO(t){if(!t||typeof t!="string")return!1;var e=rO("x."+t).toLowerCase().substr(1);return e&&Ut.types[e]||!1}i(aO,"lookup");function sO(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(Xs).forEach(i(function(o){var s=Xs[o],p=s.extensions;if(!(!p||!p.length)){t[o]=p;for(var m=0;m<p.length;m++){var h=p[m];if(e[h]){var v=r.indexOf(Xs[e[h]].source),P=r.indexOf(s.source);if(e[h]!=="application/octet-stream"&&(v>P||v===P&&e[h].substr(0,12)==="application/"))continue}e[h]=o}}},"forEachMimeType"))}i(sO,"populateMaps")});var pv=L((R5,dv)=>{dv.exports=uO;function uO(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}i(uO,"defer")});var nd=L(($5,mv)=>{var fv=pv();mv.exports=cO;function cO(t){var e=!1;return fv(function(){e=!0}),i(function(n,o){e?t(n,o):fv(i(function(){t(n,o)},"nextTick_callback"))},"async_callback")}i(cO,"async")});var id=L((C5,hv)=>{hv.exports=lO;function lO(t){Object.keys(t.jobs).forEach(dO.bind(t)),t.jobs={}}i(lO,"abort");function dO(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}i(dO,"clean")});var od=L((k5,yv)=>{var gv=nd(),pO=id();yv.exports=fO;function fO(t,e,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=mO(e,o,t[o],function(s,p){o in r.jobs&&(delete r.jobs[o],s?pO(r):r.results[o]=p,n(s,r.results))})}i(fO,"iterate");function mO(t,e,r,n){var o;return t.length==2?o=t(r,gv(n)):o=t(r,e,gv(n)),o}i(mO,"runJob")});var ad=L((U5,vv)=>{vv.exports=hO;function hO(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(o,s){return e(t[o],t[s])}),n}i(hO,"state")});var sd=L((F5,_v)=>{var gO=id(),yO=nd();_v.exports=vO;function vO(t){Object.keys(this.jobs).length&&(this.index=this.size,gO(this),yO(t)(null,this.results))}i(vO,"terminator")});var wv=L((j5,Pv)=>{var _O=od(),PO=ad(),wO=sd();Pv.exports=bO;function bO(t,e,r){for(var n=PO(t);n.index<(n.keyedList||t).length;)_O(t,e,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return wO.bind(n,r)}i(bO,"parallel")});var ud=L((B5,Qs)=>{var bv=od(),TO=ad(),SO=sd();Qs.exports=xO;Qs.exports.ascending=Tv;Qs.exports.descending=EO;function xO(t,e,r,n){var o=TO(t,r);return bv(t,e,o,i(function s(p,m){if(p){n(p,m);return}if(o.index++,o.index<(o.keyedList||t).length){bv(t,e,o,s);return}n(null,o.results)},"iteratorHandler")),SO.bind(o,n)}i(xO,"serialOrdered");function Tv(t,e){return t<e?-1:t>e?1:0}i(Tv,"ascending");function EO(t,e){return-1*Tv(t,e)}i(EO,"descending")});var xv=L((G5,Sv)=>{var IO=ud();Sv.exports=AO;function AO(t,e,r){return IO(t,e,null,r)}i(AO,"serial")});var Iv=L((W5,Ev)=>{Ev.exports={parallel:wv(),serial:xv(),serialOrdered:ud()}});var cd=L((Z5,Av)=>{"use strict";Av.exports=Object});var Dv=L((K5,Rv)=>{"use strict";Rv.exports=Error});var Ov=L((J5,$v)=>{"use strict";$v.exports=EvalError});var Nv=L((Y5,Cv)=>{"use strict";Cv.exports=RangeError});var zv=L((X5,kv)=>{"use strict";kv.exports=ReferenceError});var Mv=L((Q5,Uv)=>{"use strict";Uv.exports=SyntaxError});var Ln=L((e9,Fv)=>{"use strict";Fv.exports=TypeError});var jv=L((t9,Lv)=>{"use strict";Lv.exports=URIError});var Bv=L((r9,qv)=>{"use strict";qv.exports=Math.abs});var Gv=L((n9,Vv)=>{"use strict";Vv.exports=Math.floor});var Wv=L((i9,Hv)=>{"use strict";Hv.exports=Math.max});var Kv=L((o9,Zv)=>{"use strict";Zv.exports=Math.min});var Yv=L((a9,Jv)=>{"use strict";Jv.exports=Math.pow});var Qv=L((s9,Xv)=>{"use strict";Xv.exports=Math.round});var t_=L((u9,e_)=>{"use strict";e_.exports=Number.isNaN||i(function(e){return e!==e},"isNaN")});var n_=L((l9,r_)=>{"use strict";var RO=t_();r_.exports=i(function(e){return RO(e)||e===0?e:e<0?-1:1},"sign")});var o_=L((p9,i_)=>{"use strict";i_.exports=Object.getOwnPropertyDescriptor});var ld=L((f9,a_)=>{"use strict";var eu=o_();if(eu)try{eu([],"length")}catch{eu=null}a_.exports=eu});var u_=L((m9,s_)=>{"use strict";var tu=Object.defineProperty||!1;if(tu)try{tu({},"a",{value:1})}catch{tu=!1}s_.exports=tu});var dd=L((h9,c_)=>{"use strict";c_.exports=i(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 o=42;e[r]=o;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 p=Object.getOwnPropertySymbols(e);if(p.length!==1||p[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var m=Object.getOwnPropertyDescriptor(e,r);if(m.value!==o||m.enumerable!==!0)return!1}return!0},"hasSymbols")});var p_=L((y9,d_)=>{"use strict";var l_=typeof Symbol<"u"&&Symbol,DO=dd();d_.exports=i(function(){return typeof l_!="function"||typeof Symbol!="function"||typeof l_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:DO()},"hasNativeSymbols")});var pd=L((_9,f_)=>{"use strict";f_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var fd=L((P9,m_)=>{"use strict";var $O=cd();m_.exports=$O.getPrototypeOf||null});var y_=L((w9,g_)=>{"use strict";var OO="Function.prototype.bind called on incompatible ",CO=Object.prototype.toString,NO=Math.max,kO="[object Function]",h_=i(function(e,r){for(var n=[],o=0;o<e.length;o+=1)n[o]=e[o];for(var s=0;s<r.length;s+=1)n[s+e.length]=r[s];return n},"concatty"),zO=i(function(e,r){for(var n=[],o=r||0,s=0;o<e.length;o+=1,s+=1)n[s]=e[o];return n},"slicy"),UO=i(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");g_.exports=i(function(e){var r=this;if(typeof r!="function"||CO.apply(r)!==kO)throw new TypeError(OO+r);for(var n=zO(arguments,1),o,s=i(function(){if(this instanceof o){var P=r.apply(this,h_(n,arguments));return Object(P)===P?P:this}return r.apply(e,h_(n,arguments))},"binder"),p=NO(0,r.length-n.length),m=[],h=0;h<p;h++)m[h]="$"+h;if(o=Function("binder","return function ("+UO(m,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var v=i(function(){},"Empty");v.prototype=r.prototype,o.prototype=new v,v.prototype=null}return o},"bind")});var Hi=L((T9,v_)=>{"use strict";var MO=y_();v_.exports=Function.prototype.bind||MO});var ru=L((S9,__)=>{"use strict";__.exports=Function.prototype.call});var md=L((x9,P_)=>{"use strict";P_.exports=Function.prototype.apply});var b_=L((E9,w_)=>{"use strict";w_.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var S_=L((I9,T_)=>{"use strict";var FO=Hi(),LO=md(),jO=ru(),qO=b_();T_.exports=qO||FO.call(jO,LO)});var hd=L((A9,x_)=>{"use strict";var BO=Hi(),VO=Ln(),GO=ru(),HO=S_();x_.exports=i(function(e){if(e.length<1||typeof e[0]!="function")throw new VO("a function is required");return HO(BO,GO,e)},"callBindBasic")});var $_=L((D9,D_)=>{"use strict";var WO=hd(),E_=ld(),A_;try{A_=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var gd=!!A_&&E_&&E_(Object.prototype,"__proto__"),R_=Object,I_=R_.getPrototypeOf;D_.exports=gd&&typeof gd.get=="function"?WO([gd.get]):typeof I_=="function"?i(function(e){return I_(e==null?e:R_(e))},"getDunder"):!1});var z_=L((O9,k_)=>{"use strict";var O_=pd(),C_=fd(),N_=$_();k_.exports=O_?i(function(e){return O_(e)},"getProto"):C_?i(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return C_(e)},"getProto"):N_?i(function(e){return N_(e)},"getProto"):null});var yd=L((N9,U_)=>{"use strict";var ZO=Function.prototype.call,KO=Object.prototype.hasOwnProperty,JO=Hi();U_.exports=JO.call(ZO,KO)});var aa=L((k9,B_)=>{"use strict";var Fe,YO=cd(),XO=Dv(),QO=Ov(),eC=Nv(),tC=zv(),Ji=Mv(),Ki=Ln(),rC=jv(),nC=Bv(),iC=Gv(),oC=Wv(),aC=Kv(),sC=Yv(),uC=Qv(),cC=n_(),j_=Function,vd=i(function(t){try{return j_('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),na=ld(),lC=u_(),_d=i(function(){throw new Ki},"throwTypeError"),dC=na?(function(){try{return arguments.callee,_d}catch{try{return na(arguments,"callee").get}catch{return _d}}})():_d,Wi=p_()(),xt=z_(),pC=fd(),fC=pd(),q_=md(),ia=ru(),Zi={},mC=typeof Uint8Array>"u"||!xt?Fe:xt(Uint8Array),ci={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Fe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Fe:ArrayBuffer,"%ArrayIteratorPrototype%":Wi&&xt?xt([][Symbol.iterator]()):Fe,"%AsyncFromSyncIteratorPrototype%":Fe,"%AsyncFunction%":Zi,"%AsyncGenerator%":Zi,"%AsyncGeneratorFunction%":Zi,"%AsyncIteratorPrototype%":Zi,"%Atomics%":typeof Atomics>"u"?Fe:Atomics,"%BigInt%":typeof BigInt>"u"?Fe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Fe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Fe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Fe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":XO,"%eval%":eval,"%EvalError%":QO,"%Float16Array%":typeof Float16Array>"u"?Fe:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Fe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Fe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Fe:FinalizationRegistry,"%Function%":j_,"%GeneratorFunction%":Zi,"%Int8Array%":typeof Int8Array>"u"?Fe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Fe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Fe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Wi&&xt?xt(xt([][Symbol.iterator]())):Fe,"%JSON%":typeof JSON=="object"?JSON:Fe,"%Map%":typeof Map>"u"?Fe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Wi||!xt?Fe:xt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":YO,"%Object.getOwnPropertyDescriptor%":na,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Fe:Promise,"%Proxy%":typeof Proxy>"u"?Fe:Proxy,"%RangeError%":eC,"%ReferenceError%":tC,"%Reflect%":typeof Reflect>"u"?Fe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Fe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Wi||!xt?Fe:xt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Fe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Wi&&xt?xt(""[Symbol.iterator]()):Fe,"%Symbol%":Wi?Symbol:Fe,"%SyntaxError%":Ji,"%ThrowTypeError%":dC,"%TypedArray%":mC,"%TypeError%":Ki,"%Uint8Array%":typeof Uint8Array>"u"?Fe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Fe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Fe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Fe:Uint32Array,"%URIError%":rC,"%WeakMap%":typeof WeakMap>"u"?Fe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Fe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Fe:WeakSet,"%Function.prototype.call%":ia,"%Function.prototype.apply%":q_,"%Object.defineProperty%":lC,"%Object.getPrototypeOf%":pC,"%Math.abs%":nC,"%Math.floor%":iC,"%Math.max%":oC,"%Math.min%":aC,"%Math.pow%":sC,"%Math.round%":uC,"%Math.sign%":cC,"%Reflect.getPrototypeOf%":fC};if(xt)try{null.error}catch(t){M_=xt(xt(t)),ci["%Error.prototype%"]=M_}var M_,hC=i(function t(e){var r;if(e==="%AsyncFunction%")r=vd("async function () {}");else if(e==="%GeneratorFunction%")r=vd("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=vd("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&xt&&(r=xt(o.prototype))}return ci[e]=r,r},"doEval"),F_={__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"]},oa=Hi(),nu=yd(),gC=oa.call(ia,Array.prototype.concat),yC=oa.call(q_,Array.prototype.splice),L_=oa.call(ia,String.prototype.replace),iu=oa.call(ia,String.prototype.slice),vC=oa.call(ia,RegExp.prototype.exec),_C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,PC=/\\(\\)?/g,wC=i(function(e){var r=iu(e,0,1),n=iu(e,-1);if(r==="%"&&n!=="%")throw new Ji("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ji("invalid intrinsic syntax, expected opening `%`");var o=[];return L_(e,_C,function(s,p,m,h){o[o.length]=m?L_(h,PC,"$1"):p||s}),o},"stringToPath"),bC=i(function(e,r){var n=e,o;if(nu(F_,n)&&(o=F_[n],n="%"+o[0]+"%"),nu(ci,n)){var s=ci[n];if(s===Zi&&(s=hC(n)),typeof s>"u"&&!r)throw new Ki("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Ji("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");B_.exports=i(function(e,r){if(typeof e!="string"||e.length===0)throw new Ki("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ki('"allowMissing" argument must be a boolean');if(vC(/^%?[^%]*%?$/,e)===null)throw new Ji("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=wC(e),o=n.length>0?n[0]:"",s=bC("%"+o+"%",r),p=s.name,m=s.value,h=!1,v=s.alias;v&&(o=v[0],yC(n,gC([0,1],v)));for(var P=1,x=!0;P<n.length;P+=1){var T=n[P],w=iu(T,0,1),S=iu(T,-1);if((w==='"'||w==="'"||w==="`"||S==='"'||S==="'"||S==="`")&&w!==S)throw new Ji("property names with quotes must have matching quotes");if((T==="constructor"||!x)&&(h=!0),o+="."+T,p="%"+o+"%",nu(ci,p))m=ci[p];else if(m!=null){if(!(T in m)){if(!r)throw new Ki("base intrinsic for "+e+" exists, but the property is not available.");return}if(na&&P+1>=n.length){var D=na(m,T);x=!!D,x&&"get"in D&&!("originalValue"in D.get)?m=D.get:m=m[T]}else x=nu(m,T),m=m[T];x&&!h&&(ci[p]=m)}}return m},"GetIntrinsic")});var G_=L((U9,V_)=>{"use strict";var TC=dd();V_.exports=i(function(){return TC()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Z_=L((F9,W_)=>{"use strict";var SC=aa(),H_=SC("%Object.defineProperty%",!0),xC=G_()(),EC=yd(),IC=Ln(),ou=xC?Symbol.toStringTag:null;W_.exports=i(function(e,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new IC("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ou&&(n||!EC(e,ou))&&(H_?H_(e,ou,{configurable:!o,enumerable:!1,value:r,writable:!1}):e[ou]=r)},"setToStringTag")});var J_=L((j9,K_)=>{"use strict";var AC=Function.prototype.call,RC=Object.prototype.hasOwnProperty,DC=Hi();K_.exports=DC.call(AC,RC)});var X_=L((q9,Y_)=>{"use strict";Y_.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var sa=L((B9,eP)=>{"use strict";var Td=av(),$C=require("util"),Pd=require("path"),OC=require("http"),CC=require("https"),NC=require("url").parse,kC=require("fs"),zC=require("stream").Stream,UC=require("crypto"),wd=Fn(),MC=Iv(),FC=Z_(),jn=J_(),bd=X_();function Q_(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Q_,"escapeHeaderParam");function Ve(t){if(!(this instanceof Ve))return new Ve(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Td.call(this),t=t||{};for(var e in t)this[e]=t[e]}i(Ve,"FormData");$C.inherits(Ve,Td);Ve.LINE_BREAK=`\r
2
+ `;Ve.DEFAULT_CONTENT_TYPE="application/octet-stream";Ve.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Td.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 o=this._multiPartHeader(t,e,r),s=this._multiPartFooter();n(o),n(e),n(s),this._trackLength(o,e,r)};Ve.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)+Ve.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&jn(e,"httpVersion"))&&!(e instanceof zC))&&(r.knownLength||this._valuesToMeasure.push(e))};Ve.prototype._lengthRetriever=function(t,e){jn(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):kC.stat(t.path,function(r,n){if(r){e(r);return}var o=n.size-(t.start?t.start:0);e(null,o)}):jn(t,"httpVersion")?e(null,Number(t.headers["content-length"])):jn(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};Ve.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),o=this._getContentType(e,r),s="",p={"Content-Disposition":["form-data",'name="'+Q_(t)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&bd(p,r.header);var m;for(var h in p)if(jn(p,h)){if(m=p[h],m==null)continue;Array.isArray(m)||(m=[m]),m.length&&(s+=h+": "+m.join("; ")+Ve.LINE_BREAK)}return"--"+this.getBoundary()+Ve.LINE_BREAK+s+Ve.LINE_BREAK};Ve.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=Pd.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=Pd.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&jn(t,"httpVersion")&&(r=Pd.basename(t.client._httpMessage.path||"")),r)return'filename="'+Q_(r)+'"'};Ve.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=wd.lookup(t.name)),!r&&t&&t.path&&(r=wd.lookup(t.path)),!r&&t&&t.readable&&jn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=wd.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=Ve.DEFAULT_CONTENT_TYPE),r};Ve.prototype._multiPartFooter=function(){return function(t){var e=Ve.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};Ve.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Ve.LINE_BREAK};Ve.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)jn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};Ve.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Ve.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Ve.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(Ve.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Ve.prototype._generateBoundary=function(){this._boundary="--------------------------"+UC.randomBytes(12).toString("hex")};Ve.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};Ve.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Ve.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}MC.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(o){e+=o}),t(null,e)})};Ve.prototype.submit=function(t,e){var r,n,o={method:"post"};return typeof t=="string"?(t=NC(t),n=bd({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},o)):(n=bd(t,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=CC.request(n):r=OC.request(n),this.getLength(function(s,p){if(s&&s!=="Unknown stream"){this._error(s);return}if(p&&r.setHeader("Content-Length",p),this.pipe(r),e){var m,h=i(function(v,P){return r.removeListener("error",h),r.removeListener("response",m),e.call(this,v,P)},"callback");m=h.bind(this,null),r.on("error",h),r.on("response",m)}}.bind(this)),r};Ve.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Ve.prototype.toString=function(){return"[object FormData]"};FC(Ve.prototype,"FormData");eP.exports=Ve});var ua=L((dY,lP)=>{"use strict";var au=Object.prototype.hasOwnProperty,cP=Object.prototype.toString,nP=Object.defineProperty,iP=Object.getOwnPropertyDescriptor,oP=i(function(e){return typeof Array.isArray=="function"?Array.isArray(e):cP.call(e)==="[object Array]"},"isArray"),aP=i(function(e){if(!e||cP.call(e)!=="[object Object]")return!1;var r=au.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&au.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var o;for(o in e);return typeof o>"u"||au.call(e,o)},"isPlainObject"),sP=i(function(e,r){nP&&r.name==="__proto__"?nP(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),uP=i(function(e,r){if(r==="__proto__")if(au.call(e,r)){if(iP)return iP(e,r).value}else return;return e[r]},"getProperty");lP.exports=i(function t(){var e,r,n,o,s,p,m=arguments[0],h=1,v=arguments.length,P=!1;for(typeof m=="boolean"&&(P=m,m=arguments[1]||{},h=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});h<v;++h)if(e=arguments[h],e!=null)for(r in e)n=uP(m,r),o=uP(e,r),m!==o&&(P&&o&&(aP(o)||(s=oP(o)))?(s?(s=!1,p=n&&oP(n)?n:[]):p=n&&aP(n)?n:{},sP(m,{name:r,newValue:t(P,p,o)})):typeof o<"u"&&sP(m,{name:r,newValue:o}));return m},"extend")});var dP=L((fY,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 fP=L((mY,pP)=>{"use strict";var KC=dP();pP.exports={pkg:KC}});var Ed=L(lr=>{"use strict";var hP=lr&&lr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(lr,"__esModule",{value:!0});lr.GaxiosError=lr.GAXIOS_ERROR_SYMBOL=void 0;lr.defaultErrorRedactor=gP;var mP=hP(ua()),JC=hP(fP()),Sd=JC.default.pkg;lr.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Sd.name}-gaxios-error`);var xd=class t extends Error{static{i(this,"GaxiosError")}config;response;code;status;error;[lr.GAXIOS_ERROR_SYMBOL]=Sd.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&lr.GAXIOS_ERROR_SYMBOL in e&&e[lr.GAXIOS_ERROR_SYMBOL]===Sd.version?!0:Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,r,n,o){if(super(e,{cause:o}),this.config=r,this.response=n,this.error=o instanceof Error?o:void 0,this.config=(0,mP.default)(!0,{},r),this.response&&(this.response.config=(0,mP.default)(!0,{},this.response.config)),this.response){try{this.response.data=YC(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}o instanceof DOMException?this.code=o.name:o&&typeof o=="object"&&"code"in o&&(typeof o.code=="string"||typeof o.code=="number")&&(this.code=o.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 o="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 p=[];for(let m of e.data.error.errors)typeof m=="object"&&"message"in m&&typeof m.message=="string"&&p.push(m.message);return Object.assign({message:p.join(`
3
+ `)||n,code:s,status:o},e.data.error)}return Object.assign({message:n,code:s,status:o},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};lr.GaxiosError=xd;function YC(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}}i(YC,"translateData");function gP(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((p,m)=>{(/^authentication$/i.test(m)||/^authorization$/i.test(m)||/secret/i.test(m))&&s.set(m,e)})}i(r,"redactHeaders");function n(s,p){if(typeof s=="object"&&s!==null&&typeof s[p]=="string"){let m=s[p];(/grant_type=/i.test(m)||/assertion=/i.test(m)||/secret/i.test(m))&&(s[p]=e)}}i(n,"redactString");function o(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((p,m)=>{(["grant_type","assertion"].includes(m)||/secret/.test(m))&&s.set(m,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return i(o,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),o(t.config.data),n(t.config,"body"),o(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&&(gP({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),o(t.response.data))),t}i(gP,"defaultErrorRedactor")});var vP=L(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.getRetryConfig=XC;async function XC(t){let e=yP(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||QC)(t))return{shouldRetry:!1,config:t.config};let o=eN(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,o):new Promise(p=>{setTimeout(p,o)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}i(XC,"getRetryConfig");function QC(t){let e=yP(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,o]of e.statusCodesToRetry){let s=t.response.status;if(s>=n&&s<=o){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}i(QC,"shouldRetryRequest");function yP(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}i(yP,"getConfig");function eN(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)}i(eN,"getNextRetryDelay")});var Rd=L(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.GaxiosInterceptorManager=void 0;var Ad=class extends Set{static{i(this,"GaxiosInterceptorManager")}};su.GaxiosInterceptorManager=Ad});var PP=L((wY,_P)=>{var Yi=1e3,Xi=Yi*60,Qi=Xi*60,li=Qi*24,tN=li*7,rN=li*365.25;_P.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return nN(t);if(r==="number"&&isFinite(t))return e.long?oN(t):iN(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function nN(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*rN;case"weeks":case"week":case"w":return r*tN;case"days":case"day":case"d":return r*li;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Qi;case"minutes":case"minute":case"mins":case"min":case"m":return r*Xi;case"seconds":case"second":case"secs":case"sec":case"s":return r*Yi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}i(nN,"parse");function iN(t){var e=Math.abs(t);return e>=li?Math.round(t/li)+"d":e>=Qi?Math.round(t/Qi)+"h":e>=Xi?Math.round(t/Xi)+"m":e>=Yi?Math.round(t/Yi)+"s":t+"ms"}i(iN,"fmtShort");function oN(t){var e=Math.abs(t);return e>=li?uu(t,e,li,"day"):e>=Qi?uu(t,e,Qi,"hour"):e>=Xi?uu(t,e,Xi,"minute"):e>=Yi?uu(t,e,Yi,"second"):t+" ms"}i(oN,"fmtLong");function uu(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}i(uu,"plural")});var Dd=L((TY,wP)=>{function aN(t){r.debug=r,r.default=r,r.coerce=h,r.disable=p,r.enable=o,r.enabled=m,r.humanize=PP(),r.destroy=v,Object.keys(t).forEach(P=>{r[P]=t[P]}),r.names=[],r.skips=[],r.formatters={};function e(P){let x=0;for(let T=0;T<P.length;T++)x=(x<<5)-x+P.charCodeAt(T),x|=0;return r.colors[Math.abs(x)%r.colors.length]}i(e,"selectColor"),r.selectColor=e;function r(P){let x,T=null,w,S;function D(...E){if(!D.enabled)return;let u=D,f=Number(new Date),c=f-(x||f);u.diff=c,u.prev=x,u.curr=f,x=f,E[0]=r.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let y=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(b,g)=>{if(b==="%%")return"%";y++;let oe=r.formatters[g];if(typeof oe=="function"){let ne=E[y];b=oe.call(u,ne),E.splice(y,1),y--}return b}),r.formatArgs.call(u,E),(u.log||r.log).apply(u,E)}return i(D,"debug"),D.namespace=P,D.useColors=r.useColors(),D.color=r.selectColor(P),D.extend=n,D.destroy=r.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:i(()=>T!==null?T:(w!==r.namespaces&&(w=r.namespaces,S=r.enabled(P)),S),"get"),set:i(E=>{T=E},"set")}),typeof r.init=="function"&&r.init(D),D}i(r,"createDebug");function n(P,x){let T=r(this.namespace+(typeof x>"u"?":":x)+P);return T.log=this.log,T}i(n,"extend");function o(P){r.save(P),r.namespaces=P,r.names=[],r.skips=[];let x=(typeof P=="string"?P:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let T of x)T[0]==="-"?r.skips.push(T.slice(1)):r.names.push(T)}i(o,"enable");function s(P,x){let T=0,w=0,S=-1,D=0;for(;T<P.length;)if(w<x.length&&(x[w]===P[T]||x[w]==="*"))x[w]==="*"?(S=w,D=T,w++):(T++,w++);else if(S!==-1)w=S+1,D++,T=D;else return!1;for(;w<x.length&&x[w]==="*";)w++;return w===x.length}i(s,"matchesTemplate");function p(){let P=[...r.names,...r.skips.map(x=>"-"+x)].join(",");return r.enable(""),P}i(p,"disable");function m(P){for(let x of r.skips)if(s(P,x))return!1;for(let x of r.names)if(s(P,x))return!0;return!1}i(m,"enabled");function h(P){return P instanceof Error?P.stack||P.message:P}i(h,"coerce");function v(){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 i(v,"destroy"),r.enable(r.load()),r}i(aN,"setup");wP.exports=aN});var bP=L((Mt,cu)=>{Mt.formatArgs=uN;Mt.save=cN;Mt.load=lN;Mt.useColors=sN;Mt.storage=dN();Mt.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`."))}})();Mt.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 sN(){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+)/)}i(sN,"useColors");function uN(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+cu.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,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}i(uN,"formatArgs");Mt.log=console.debug||console.log||(()=>{});function cN(t){try{t?Mt.storage.setItem("debug",t):Mt.storage.removeItem("debug")}catch{}}i(cN,"save");function lN(){let t;try{t=Mt.storage.getItem("debug")||Mt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}i(lN,"load");function dN(){try{return localStorage}catch{}}i(dN,"localstorage");cu.exports=Dd()(Mt);var{formatters:pN}=cu.exports;pN.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var SP=L((EY,TP)=>{"use strict";TP.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),o=e.indexOf("--");return n!==-1&&(o===-1||n<o)}});var IP=L((IY,EP)=>{"use strict";var fN=require("os"),xP=require("tty"),dr=SP(),{env:Et}=process,qn;dr("no-color")||dr("no-colors")||dr("color=false")||dr("color=never")?qn=0:(dr("color")||dr("colors")||dr("color=true")||dr("color=always"))&&(qn=1);"FORCE_COLOR"in Et&&(Et.FORCE_COLOR==="true"?qn=1:Et.FORCE_COLOR==="false"?qn=0:qn=Et.FORCE_COLOR.length===0?1:Math.min(parseInt(Et.FORCE_COLOR,10),3));function $d(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}i($d,"translateLevel");function Od(t,e){if(qn===0)return 0;if(dr("color=16m")||dr("color=full")||dr("color=truecolor"))return 3;if(dr("color=256"))return 2;if(t&&!e&&qn===void 0)return 0;let r=qn||0;if(Et.TERM==="dumb")return r;if(process.platform==="win32"){let n=fN.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Et)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in Et)||Et.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in Et)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Et.TEAMCITY_VERSION)?1:0;if(Et.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Et){let n=parseInt((Et.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Et.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Et.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Et.TERM)||"COLORTERM"in Et?1:r}i(Od,"supportsColor");function mN(t){let e=Od(t,t&&t.isTTY);return $d(e)}i(mN,"getSupportLevel");EP.exports={supportsColor:mN,stdout:$d(Od(!0,xP.isatty(1))),stderr:$d(Od(!0,xP.isatty(2)))}});var RP=L((It,du)=>{var hN=require("tty"),lu=require("util");It.init=bN;It.log=_N;It.formatArgs=yN;It.save=PN;It.load=wN;It.useColors=gN;It.destroy=lu.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");It.colors=[6,2,3,4,5,1];try{let t=IP();t&&(t.stderr||t).level>=2&&(It.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{}It.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,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 gN(){return"colors"in It.inspectOpts?!!It.inspectOpts.colors:hN.isatty(process.stderr.fd)}i(gN,"useColors");function yN(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
4
4
  `).join(`
5
- `+a),t.push(i+"m+"+au.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=HO()+e+" "+t[0]}o(GO,"formatArgs");function HO(){return St.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(HO,"getDate");function WO(...t){return process.stderr.write(su.formatWithOptions(St.inspectOpts,...t)+`
6
- `)}o(WO,"log");function ZO(t){t?process.env.DEBUG=t:delete process.env.DEBUG}o(ZO,"save");function KO(){return process.env.DEBUG}o(KO,"load");function JO(t){t.inspectOpts={};let e=Object.keys(St.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=St.inspectOpts[e[r]]}o(JO,"init");au.exports=Ed()(St);var{formatters:pP}=au.exports;pP.o=function(t){return this.inspectOpts.colors=this.useColors,su.inspect(t,this.inspectOpts).split(`
7
- `).map(e=>e.trim()).join(" ")};pP.O=function(t){return this.inspectOpts.colors=this.useColors,su.inspect(t,this.inspectOpts)}});var Rd=M((e9,Id)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Id.exports=sP():Id.exports=fP()});var gP=M(kt=>{"use strict";var YO=kt&&kt.__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]}),XO=kt&&kt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mP=kt&&kt.__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)&&YO(e,t,r);return XO(e,t),e};Object.defineProperty(kt,"__esModule",{value:!0});kt.req=kt.json=kt.toBuffer=void 0;var QO=mP(require("http")),eD=mP(require("https"));async function hP(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}o(hP,"toBuffer");kt.toBuffer=hP;async function tD(t){let r=(await hP(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let i=n;throw i.message+=` (input: ${r})`,i}}o(tD,"json");kt.json=tD;function rD(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?eD:QO).request(t,e),i=new Promise((a,f)=>{n.once("response",a).once("error",f).end()});return n.then=i.then.bind(i),n}o(rD,"req");kt.req=rD});var PP=M(Ht=>{"use strict";var vP=Ht&&Ht.__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]}),nD=Ht&&Ht.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_P=Ht&&Ht.__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)&&vP(e,t,r);return nD(e,t),e},oD=Ht&&Ht.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vP(e,t,r)};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.Agent=void 0;var iD=_P(require("net")),yP=_P(require("http")),sD=require("https");oD(gP(),Ht);var Nr=Symbol("AgentBaseInternalState"),$d=class extends yP.Agent{static{o(this,"Agent")}constructor(e){super(e),this[Nr]={}}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 iD.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)?sD.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let i={...r,secureEndpoint:this.isSecureEndpoint(r)},a=this.getName(i),f=this.incrementSockets(a);Promise.resolve().then(()=>this.connect(e,i)).then(m=>{if(this.decrementSockets(a,f),m instanceof yP.Agent)try{return m.addRequest(e,i)}catch(h){return n(h)}this[Nr].currentSocket=m,super.createSocket(e,r,n)},m=>{this.decrementSockets(a,f),n(m)})}createConnection(){let e=this[Nr].currentSocket;if(this[Nr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Nr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Nr]&&(this[Nr].defaultPort=e)}get protocol(){return this[Nr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Nr]&&(this[Nr].protocol=e)}};Ht.Agent=$d});var wP=M(Xo=>{"use strict";var aD=Xo&&Xo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xo,"__esModule",{value:!0});Xo.parseProxyResponse=void 0;var uD=aD(Rd()),uu=(0,uD.default)("https-proxy-agent:parse-proxy-response");function cD(t){return new Promise((e,r)=>{let n=0,i=[];function a(){let P=t.read();P?_(P):t.once("readable",a)}o(a,"read");function f(){t.removeListener("end",m),t.removeListener("error",h),t.removeListener("readable",a)}o(f,"cleanup");function m(){f(),uu("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}o(m,"onend");function h(P){f(),uu("onerror %o",P),r(P)}o(h,"onerror");function _(P){i.push(P),n+=P.length;let E=Buffer.concat(i,n),S=E.indexOf(`\r
5
+ `+s),t.push(o+"m+"+du.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=vN()+e+" "+t[0]}i(yN,"formatArgs");function vN(){return It.inspectOpts.hideDate?"":new Date().toISOString()+" "}i(vN,"getDate");function _N(...t){return process.stderr.write(lu.formatWithOptions(It.inspectOpts,...t)+`
6
+ `)}i(_N,"log");function PN(t){t?process.env.DEBUG=t:delete process.env.DEBUG}i(PN,"save");function wN(){return process.env.DEBUG}i(wN,"load");function bN(t){t.inspectOpts={};let e=Object.keys(It.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=It.inspectOpts[e[r]]}i(bN,"init");du.exports=Dd()(It);var{formatters:AP}=du.exports;AP.o=function(t){return this.inspectOpts.colors=this.useColors,lu.inspect(t,this.inspectOpts).split(`
7
+ `).map(e=>e.trim()).join(" ")};AP.O=function(t){return this.inspectOpts.colors=this.useColors,lu.inspect(t,this.inspectOpts)}});var Nd=L((DY,Cd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Cd.exports=bP():Cd.exports=RP()});var OP=L(Ft=>{"use strict";var TN=Ft&&Ft.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SN=Ft&&Ft.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),DP=Ft&&Ft.__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)&&TN(e,t,r);return SN(e,t),e};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.req=Ft.json=Ft.toBuffer=void 0;var xN=DP(require("http")),EN=DP(require("https"));async function $P(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}i($P,"toBuffer");Ft.toBuffer=$P;async function IN(t){let r=(await $P(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}i(IN,"json");Ft.json=IN;function AN(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?EN:xN).request(t,e),o=new Promise((s,p)=>{n.once("response",s).once("error",p).end()});return n.then=o.then.bind(o),n}i(AN,"req");Ft.req=AN});var zP=L(Kt=>{"use strict";var NP=Kt&&Kt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RN=Kt&&Kt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kP=Kt&&Kt.__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)&&NP(e,t,r);return RN(e,t),e},DN=Kt&&Kt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NP(e,t,r)};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.Agent=void 0;var $N=kP(require("net")),CP=kP(require("http")),ON=require("https");DN(OP(),Kt);var Mr=Symbol("AgentBaseInternalState"),kd=class extends CP.Agent{static{i(this,"Agent")}constructor(e){super(e),this[Mr]={}}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 $N.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],o=n.indexOf(r);o!==-1&&(n.splice(o,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?ON.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let o={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(o),p=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,o)).then(m=>{if(this.decrementSockets(s,p),m instanceof CP.Agent)try{return m.addRequest(e,o)}catch(h){return n(h)}this[Mr].currentSocket=m,super.createSocket(e,r,n)},m=>{this.decrementSockets(s,p),n(m)})}createConnection(){let e=this[Mr].currentSocket;if(this[Mr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Mr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Mr]&&(this[Mr].defaultPort=e)}get protocol(){return this[Mr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Mr]&&(this[Mr].protocol=e)}};Kt.Agent=kd});var UP=L(eo=>{"use strict";var CN=eo&&eo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eo,"__esModule",{value:!0});eo.parseProxyResponse=void 0;var NN=CN(Nd()),pu=(0,NN.default)("https-proxy-agent:parse-proxy-response");function kN(t){return new Promise((e,r)=>{let n=0,o=[];function s(){let P=t.read();P?v(P):t.once("readable",s)}i(s,"read");function p(){t.removeListener("end",m),t.removeListener("error",h),t.removeListener("readable",s)}i(p,"cleanup");function m(){p(),pu("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}i(m,"onend");function h(P){p(),pu("onerror %o",P),r(P)}i(h,"onerror");function v(P){o.push(P),n+=P.length;let x=Buffer.concat(o,n),T=x.indexOf(`\r
9
9
  \r
10
- `);if(S===-1){uu("have not received end of HTTP headers yet..."),a();return}let w=E.slice(0,S).toString("ascii").split(`\r
11
- `),T=w.shift();if(!T)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let $=T.split(" "),b=+$[1],u=$.slice(2).join(" "),p={};for(let c of w){if(!c)continue;let y=c.indexOf(":");if(y===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${c}"`));let l=c.slice(0,y).toLowerCase(),x=c.slice(y+1).trimStart(),g=p[l];typeof g=="string"?p[l]=[g,x]:Array.isArray(g)?g.push(x):p[l]=x}uu("got proxy server response: %o %o",T,p),f(),e({connect:{statusCode:b,statusText:u,headers:p},buffered:E})}o(_,"ondata"),t.on("error",h),t.on("end",m),a()})}o(cD,"parseProxyResponse");Xo.parseProxyResponse=cD});var AP=M(cr=>{"use strict";var lD=cr&&cr.__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]}),dD=cr&&cr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),EP=cr&&cr.__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)&&lD(e,t,r);return dD(e,t),e},bP=cr&&cr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(cr,"__esModule",{value:!0});cr.HttpsProxyAgent=void 0;var cu=EP(require("net")),xP=EP(require("tls")),pD=bP(require("assert")),fD=bP(Rd()),mD=PP(),hD=require("url"),gD=wP(),is=(0,fD.default)("https-proxy-agent"),SP=o(t=>t.servername===void 0&&t.host&&!cu.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),lu=class extends mD.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new hD.URL(e):e,this.proxyHeaders=r?.headers??{},is("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?TP(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:"?(is("Creating `tls.Socket`: %o",this.connectOpts),i=xP.connect(SP(this.connectOpts))):(is("Creating `net.Socket`: %o",this.connectOpts),i=cu.connect(this.connectOpts));let a=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},f=cu.isIPv6(r.host)?`[${r.host}]`:r.host,m=`CONNECT ${f}:${r.port} HTTP/1.1\r
12
- `;if(n.username||n.password){let S=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;a["Proxy-Authorization"]=`Basic ${Buffer.from(S).toString("base64")}`}a.Host=`${f}:${r.port}`,a["Proxy-Connection"]||(a["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let S of Object.keys(a))m+=`${S}: ${a[S]}\r
13
- `;let h=(0,gD.parseProxyResponse)(i);i.write(`${m}\r
14
- `);let{connect:_,buffered:P}=await h;if(e.emit("proxyConnect",_),this.emit("proxyConnect",_,e),_.statusCode===200)return e.once("socket",yD),r.secureEndpoint?(is("Upgrading socket connection to TLS"),xP.connect({...TP(SP(r),"host","path","port"),socket:i})):i;i.destroy();let E=new cu.Socket({writable:!1});return E.readable=!0,e.once("socket",S=>{is("Replaying proxy buffer for failed request"),(0,pD.default)(S.listenerCount("data")>0),S.push(P),S.push(null)}),E}};lu.protocols=["http","https"];cr.HttpsProxyAgent=lu;function yD(t){t.resume()}o(yD,"resume");function TP(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(TP,"omit")});function vD(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,a=r[0]||"text/plain",f=a;for(let P=1;P<r.length;P++)r[P]==="base64"?i=!0:r[P]&&(f+=`;${r[P]}`,r[P].indexOf("charset=")===0&&(n=r[P].substring(8)));!r[0]&&!n.length&&(f+=";charset=US-ASCII",n="US-ASCII");let m=i?"base64":"ascii",h=unescape(t.substring(e+1)),_=Buffer.from(h,m);return _.type=a,_.typeFull=f,_.charset=n,_}var IP,RP=Pt(()=>{o(vD,"dataUriToBuffer");IP=vD});var OP=M((du,$P)=>{(function(t,e){typeof du=="object"&&typeof $P<"u"?e(du):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(du,function(t){"use strict";function e(){}o(e,"noop");function r(s){return typeof s=="object"&&s!==null||typeof s=="function"}o(r,"typeIsObject");let n=e;function i(s,d){try{Object.defineProperty(s,"name",{value:d,configurable:!0})}catch{}}o(i,"setFunctionName");let a=Promise,f=Promise.prototype.then,m=Promise.reject.bind(a);function h(s){return new a(s)}o(h,"newPromise");function _(s){return h(d=>d(s))}o(_,"promiseResolvedWith");function P(s){return m(s)}o(P,"promiseRejectedWith");function E(s,d,v){return f.call(s,d,v)}o(E,"PerformPromiseThen");function S(s,d,v){E(E(s,d,v),void 0,n)}o(S,"uponPromise");function w(s,d){S(s,d)}o(w,"uponFulfillment");function T(s,d){S(s,void 0,d)}o(T,"uponRejection");function $(s,d,v){return E(s,d,v)}o($,"transformPromiseWith");function b(s){E(s,void 0,n)}o(b,"setPromiseIsHandledToTrue");let u=o(s=>{if(typeof queueMicrotask=="function")u=queueMicrotask;else{let d=_(void 0);u=o(v=>E(d,v),"_queueMicrotask")}return u(s)},"_queueMicrotask");function p(s,d,v){if(typeof s!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(s,d,v)}o(p,"reflectCall");function c(s,d,v){try{return _(p(s,d,v))}catch(R){return P(R)}}o(c,"promiseCall");let y=16384;class l{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(d){let v=this._back,R=v;v._elements.length===y-1&&(R={_elements:[],_next:void 0}),v._elements.push(d),R!==v&&(this._back=R,v._next=R),++this._size}shift(){let d=this._front,v=d,R=this._cursor,C=R+1,V=d._elements,W=V[R];return C===y&&(v=d._next,C=0),--this._size,this._cursor=C,d!==v&&(this._front=v),V[R]=void 0,W}forEach(d){let v=this._cursor,R=this._front,C=R._elements;for(;(v!==C.length||R._next!==void 0)&&!(v===C.length&&(R=R._next,C=R._elements,v=0,C.length===0));)d(C[v]),++v}peek(){let d=this._front,v=this._cursor;return d._elements[v]}}let x=Symbol("[[AbortSteps]]"),g=Symbol("[[ErrorSteps]]"),re=Symbol("[[CancelSteps]]"),ee=Symbol("[[PullSteps]]"),Te=Symbol("[[ReleaseSteps]]");function ne(s,d){s._ownerReadableStream=d,d._reader=s,d._state==="readable"?X(s):d._state==="closed"?ae(s):ie(s,d._storedError)}o(ne,"ReadableStreamReaderGenericInitialize");function K(s,d){let v=s._ownerReadableStream;return yr(v,d)}o(K,"ReadableStreamReaderGenericCancel");function Z(s){let d=s._ownerReadableStream;d._state==="readable"?Ie(s,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):De(s,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),d._readableStreamController[Te](),d._reader=void 0,s._ownerReadableStream=void 0}o(Z,"ReadableStreamReaderGenericRelease");function Q(s){return new TypeError("Cannot "+s+" a stream using a released reader")}o(Q,"readerLockException");function X(s){s._closedPromise=h((d,v)=>{s._closedPromise_resolve=d,s._closedPromise_reject=v})}o(X,"defaultReaderClosedPromiseInitialize");function ie(s,d){X(s),Ie(s,d)}o(ie,"defaultReaderClosedPromiseInitializeAsRejected");function ae(s){X(s),We(s)}o(ae,"defaultReaderClosedPromiseInitializeAsResolved");function Ie(s,d){s._closedPromise_reject!==void 0&&(b(s._closedPromise),s._closedPromise_reject(d),s._closedPromise_resolve=void 0,s._closedPromise_reject=void 0)}o(Ie,"defaultReaderClosedPromiseReject");function De(s,d){ie(s,d)}o(De,"defaultReaderClosedPromiseResetToRejected");function We(s){s._closedPromise_resolve!==void 0&&(s._closedPromise_resolve(void 0),s._closedPromise_resolve=void 0,s._closedPromise_reject=void 0)}o(We,"defaultReaderClosedPromiseResolve");let Xe=Number.isFinite||function(s){return typeof s=="number"&&isFinite(s)},_t=Math.trunc||function(s){return s<0?Math.ceil(s):Math.floor(s)};function te(s){return typeof s=="object"||typeof s=="function"}o(te,"isDictionary");function st(s,d){if(s!==void 0&&!te(s))throw new TypeError(`${d} is not an object.`)}o(st,"assertDictionary");function dt(s,d){if(typeof s!="function")throw new TypeError(`${d} is not a function.`)}o(dt,"assertFunction");function Lt(s){return typeof s=="object"&&s!==null||typeof s=="function"}o(Lt,"isObject");function He(s,d){if(!Lt(s))throw new TypeError(`${d} is not an object.`)}o(He,"assertObject");function Ze(s,d,v){if(s===void 0)throw new TypeError(`Parameter ${d} is required in '${v}'.`)}o(Ze,"assertRequiredArgument");function A(s,d,v){if(s===void 0)throw new TypeError(`${d} is required in '${v}'.`)}o(A,"assertRequiredField");function O(s){return Number(s)}o(O,"convertUnrestrictedDouble");function D(s){return s===0?0:s}o(D,"censorNegativeZero");function L(s){return D(_t(s))}o(L,"integerPart");function z(s,d){let R=Number.MAX_SAFE_INTEGER,C=Number(s);if(C=D(C),!Xe(C))throw new TypeError(`${d} is not a finite number`);if(C=L(C),C<0||C>R)throw new TypeError(`${d} is outside the accepted range of 0 to ${R}, inclusive`);return!Xe(C)||C===0?0:C}o(z,"convertUnsignedLongLongWithEnforceRange");function j(s,d){if(!Sn(s))throw new TypeError(`${d} is not a ReadableStream.`)}o(j,"assertReadableStream");function G(s){return new J(s)}o(G,"AcquireReadableStreamDefaultReader");function N(s,d){s._reader._readRequests.push(d)}o(N,"ReadableStreamAddReadRequest");function U(s,d,v){let C=s._reader._readRequests.shift();v?C._closeSteps():C._chunkSteps(d)}o(U,"ReadableStreamFulfillReadRequest");function B(s){return s._reader._readRequests.length}o(B,"ReadableStreamGetNumReadRequests");function F(s){let d=s._reader;return!(d===void 0||!ue(d))}o(F,"ReadableStreamHasDefaultReader");class J{static{o(this,"ReadableStreamDefaultReader")}constructor(d){if(Ze(d,1,"ReadableStreamDefaultReader"),j(d,"First parameter"),Tn(d))throw new TypeError("This stream has already been locked for exclusive reading by another reader");ne(this,d),this._readRequests=new l}get closed(){return ue(this)?this._closedPromise:P(nt("closed"))}cancel(d=void 0){return ue(this)?this._ownerReadableStream===void 0?P(Q("cancel")):K(this,d):P(nt("cancel"))}read(){if(!ue(this))return P(nt("read"));if(this._ownerReadableStream===void 0)return P(Q("read from"));let d,v,R=h((V,W)=>{d=V,v=W});return le(this,{_chunkSteps:o(V=>d({value:V,done:!1}),"_chunkSteps"),_closeSteps:o(()=>d({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(V=>v(V),"_errorSteps")}),R}releaseLock(){if(!ue(this))throw nt("releaseLock");this._ownerReadableStream!==void 0&&Fe(this)}}Object.defineProperties(J.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(J.prototype.cancel,"cancel"),i(J.prototype.read,"read"),i(J.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(J.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function ue(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_readRequests")?!1:s instanceof J}o(ue,"IsReadableStreamDefaultReader");function le(s,d){let v=s._ownerReadableStream;v._disturbed=!0,v._state==="closed"?d._closeSteps():v._state==="errored"?d._errorSteps(v._storedError):v._readableStreamController[ee](d)}o(le,"ReadableStreamDefaultReaderRead");function Fe(s){Z(s);let d=new TypeError("Reader was released");rt(s,d)}o(Fe,"ReadableStreamDefaultReaderRelease");function rt(s,d){let v=s._readRequests;s._readRequests=new l,v.forEach(R=>{R._errorSteps(d)})}o(rt,"ReadableStreamDefaultReaderErrorReadRequests");function nt(s){return new TypeError(`ReadableStreamDefaultReader.prototype.${s} can only be used on a ReadableStreamDefaultReader`)}o(nt,"defaultReaderBrandCheckException");let Me=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Ge{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(d,v){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=d,this._preventCancel=v}next(){let d=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?$(this._ongoingPromise,d,d):d(),this._ongoingPromise}return(d){let v=o(()=>this._returnSteps(d),"returnSteps");return this._ongoingPromise?$(this._ongoingPromise,v,v):v()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let d=this._reader,v,R,C=h((W,se)=>{v=W,R=se});return le(d,{_chunkSteps:o(W=>{this._ongoingPromise=void 0,u(()=>v({value:W,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,Z(d),v({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(W=>{this._ongoingPromise=void 0,this._isFinished=!0,Z(d),R(W)},"_errorSteps")}),C}_returnSteps(d){if(this._isFinished)return Promise.resolve({value:d,done:!0});this._isFinished=!0;let v=this._reader;if(!this._preventCancel){let R=K(v,d);return Z(v),$(R,()=>({value:d,done:!0}))}return Z(v),_({value:d,done:!0})}}let gt={next(){return wo(this)?this._asyncIteratorImpl.next():P(xo("next"))},return(s){return wo(this)?this._asyncIteratorImpl.return(s):P(xo("return"))}};Object.setPrototypeOf(gt,Me);function Po(s,d){let v=G(s),R=new Ge(v,d),C=Object.create(gt);return C._asyncIteratorImpl=R,C}o(Po,"AcquireReadableStreamAsyncIterator");function wo(s){if(!r(s)||!Object.prototype.hasOwnProperty.call(s,"_asyncIteratorImpl"))return!1;try{return s._asyncIteratorImpl instanceof Ge}catch{return!1}}o(wo,"IsReadableStreamAsyncIterator");function xo(s){return new TypeError(`ReadableStreamAsyncIterator.${s} can only be used on a ReadableSteamAsyncIterator`)}o(xo,"streamAsyncIteratorBrandCheckException");let qt=Number.isNaN||function(s){return s!==s};var Kr,bt,yt;function Ke(s){return s.slice()}o(Ke,"CreateArrayFromList");function Em(s,d,v,R,C){new Uint8Array(s).set(new Uint8Array(v,R,C),d)}o(Em,"CopyDataBlockBytes");let Jr=o(s=>(typeof s.transfer=="function"?Jr=o(d=>d.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?Jr=o(d=>structuredClone(d,{transfer:[d]}),"TransferArrayBuffer"):Jr=o(d=>d,"TransferArrayBuffer"),Jr(s)),"TransferArrayBuffer"),_n=o(s=>(typeof s.detached=="boolean"?_n=o(d=>d.detached,"IsDetachedBuffer"):_n=o(d=>d.byteLength===0,"IsDetachedBuffer"),_n(s)),"IsDetachedBuffer");function bm(s,d,v){if(s.slice)return s.slice(d,v);let R=v-d,C=new ArrayBuffer(R);return Em(C,0,s,d,R),C}o(bm,"ArrayBufferSlice");function Ws(s,d){let v=s[d];if(v!=null){if(typeof v!="function")throw new TypeError(`${String(d)} is not a function`);return v}}o(Ws,"GetMethod");function fb(s){let d={[Symbol.iterator]:()=>s.iterator},v=async function*(){return yield*d}(),R=v.next;return{iterator:v,nextMethod:R,done:!1}}o(fb,"CreateAsyncFromSyncIterator");let Fc=(yt=(Kr=Symbol.asyncIterator)!==null&&Kr!==void 0?Kr:(bt=Symbol.for)===null||bt===void 0?void 0:bt.call(Symbol,"Symbol.asyncIterator"))!==null&&yt!==void 0?yt:"@@asyncIterator";function Am(s,d="sync",v){if(v===void 0)if(d==="async"){if(v=Ws(s,Fc),v===void 0){let V=Ws(s,Symbol.iterator),W=Am(s,"sync",V);return fb(W)}}else v=Ws(s,Symbol.iterator);if(v===void 0)throw new TypeError("The object is not iterable");let R=p(v,s,[]);if(!r(R))throw new TypeError("The iterator method must return an object");let C=R.next;return{iterator:R,nextMethod:C,done:!1}}o(Am,"GetIterator");function mb(s){let d=p(s.nextMethod,s.iterator,[]);if(!r(d))throw new TypeError("The iterator.next() method must return an object");return d}o(mb,"IteratorNext");function hb(s){return!!s.done}o(hb,"IteratorComplete");function gb(s){return s.value}o(gb,"IteratorValue");function yb(s){return!(typeof s!="number"||qt(s)||s<0)}o(yb,"IsNonNegativeNumber");function Im(s){let d=bm(s.buffer,s.byteOffset,s.byteOffset+s.byteLength);return new Uint8Array(d)}o(Im,"CloneAsUint8Array");function Lc(s){let d=s._queue.shift();return s._queueTotalSize-=d.size,s._queueTotalSize<0&&(s._queueTotalSize=0),d.value}o(Lc,"DequeueValue");function qc(s,d,v){if(!yb(v)||v===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");s._queue.push({value:d,size:v}),s._queueTotalSize+=v}o(qc,"EnqueueValueWithSize");function vb(s){return s._queue.peek().value}o(vb,"PeekQueueValue");function Pn(s){s._queue=new l,s._queueTotalSize=0}o(Pn,"ResetQueue");function Rm(s){return s===DataView}o(Rm,"isDataViewConstructor");function _b(s){return Rm(s.constructor)}o(_b,"isDataView");function Pb(s){return Rm(s)?1:s.BYTES_PER_ELEMENT}o(Pb,"arrayBufferViewElementSize");class Hn{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Bc(this))throw Zc("view");return this._view}respond(d){if(!Bc(this))throw Zc("respond");if(Ze(d,1,"respond"),d=z(d,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(_n(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Ys(this._associatedReadableByteStreamController,d)}respondWithNewView(d){if(!Bc(this))throw Zc("respondWithNewView");if(Ze(d,1,"respondWithNewView"),!ArrayBuffer.isView(d))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(_n(d.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Xs(this._associatedReadableByteStreamController,d)}}Object.defineProperties(Hn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(Hn.prototype.respond,"respond"),i(Hn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Hn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Yr{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Wn(this))throw Ei("byobRequest");return Wc(this)}get desiredSize(){if(!Wn(this))throw Ei("desiredSize");return Mm(this)}close(){if(!Wn(this))throw Ei("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let d=this._controlledReadableByteStream._state;if(d!=="readable")throw new TypeError(`The stream (in ${d} state) is not in the readable state and cannot be closed`);Ti(this)}enqueue(d){if(!Wn(this))throw Ei("enqueue");if(Ze(d,1,"enqueue"),!ArrayBuffer.isView(d))throw new TypeError("chunk must be an array buffer view");if(d.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(d.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 v=this._controlledReadableByteStream._state;if(v!=="readable")throw new TypeError(`The stream (in ${v} state) is not in the readable state and cannot be enqueued to`);Js(this,d)}error(d=void 0){if(!Wn(this))throw Ei("error");or(this,d)}[re](d){$m(this),Pn(this);let v=this._cancelAlgorithm(d);return Ks(this),v}[ee](d){let v=this._controlledReadableByteStream;if(this._queueTotalSize>0){jm(this,d);return}let R=this._autoAllocateChunkSize;if(R!==void 0){let C;try{C=new ArrayBuffer(R)}catch(W){d._errorSteps(W);return}let V={buffer:C,bufferByteLength:R,byteOffset:0,byteLength:R,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(V)}N(v,d),Zn(this)}[Te](){if(this._pendingPullIntos.length>0){let d=this._pendingPullIntos.peek();d.readerType="none",this._pendingPullIntos=new l,this._pendingPullIntos.push(d)}}}Object.defineProperties(Yr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Yr.prototype.close,"close"),i(Yr.prototype.enqueue,"enqueue"),i(Yr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Yr.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Wn(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_controlledReadableByteStream")?!1:s instanceof Yr}o(Wn,"IsReadableByteStreamController");function Bc(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_associatedReadableByteStreamController")?!1:s instanceof Hn}o(Bc,"IsReadableStreamBYOBRequest");function Zn(s){if(!Eb(s))return;if(s._pulling){s._pullAgain=!0;return}s._pulling=!0;let v=s._pullAlgorithm();S(v,()=>(s._pulling=!1,s._pullAgain&&(s._pullAgain=!1,Zn(s)),null),R=>(or(s,R),null))}o(Zn,"ReadableByteStreamControllerCallPullIfNeeded");function $m(s){Gc(s),s._pendingPullIntos=new l}o($m,"ReadableByteStreamControllerClearPendingPullIntos");function Vc(s,d){let v=!1;s._state==="closed"&&(v=!0);let R=Om(d);d.readerType==="default"?U(s,R,v):Ob(s,R,v)}o(Vc,"ReadableByteStreamControllerCommitPullIntoDescriptor");function Om(s){let d=s.bytesFilled,v=s.elementSize;return new s.viewConstructor(s.buffer,s.byteOffset,d/v)}o(Om,"ReadableByteStreamControllerConvertPullIntoDescriptor");function Zs(s,d,v,R){s._queue.push({buffer:d,byteOffset:v,byteLength:R}),s._queueTotalSize+=R}o(Zs,"ReadableByteStreamControllerEnqueueChunkToQueue");function Dm(s,d,v,R){let C;try{C=bm(d,v,v+R)}catch(V){throw or(s,V),V}Zs(s,C,0,R)}o(Dm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Cm(s,d){d.bytesFilled>0&&Dm(s,d.buffer,d.byteOffset,d.bytesFilled),So(s)}o(Cm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function Nm(s,d){let v=Math.min(s._queueTotalSize,d.byteLength-d.bytesFilled),R=d.bytesFilled+v,C=v,V=!1,W=R%d.elementSize,se=R-W;se>=d.minimumFill&&(C=se-d.bytesFilled,V=!0);let ye=s._queue;for(;C>0;){let fe=ye.peek(),Ee=Math.min(C,fe.byteLength),Ce=d.byteOffset+d.bytesFilled;Em(d.buffer,Ce,fe.buffer,fe.byteOffset,Ee),fe.byteLength===Ee?ye.shift():(fe.byteOffset+=Ee,fe.byteLength-=Ee),s._queueTotalSize-=Ee,zm(s,Ee,d),C-=Ee}return V}o(Nm,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function zm(s,d,v){v.bytesFilled+=d}o(zm,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function Um(s){s._queueTotalSize===0&&s._closeRequested?(Ks(s),Oi(s._controlledReadableByteStream)):Zn(s)}o(Um,"ReadableByteStreamControllerHandleQueueDrain");function Gc(s){s._byobRequest!==null&&(s._byobRequest._associatedReadableByteStreamController=void 0,s._byobRequest._view=null,s._byobRequest=null)}o(Gc,"ReadableByteStreamControllerInvalidateBYOBRequest");function Hc(s){for(;s._pendingPullIntos.length>0;){if(s._queueTotalSize===0)return;let d=s._pendingPullIntos.peek();Nm(s,d)&&(So(s),Vc(s._controlledReadableByteStream,d))}}o(Hc,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function wb(s){let d=s._controlledReadableByteStream._reader;for(;d._readRequests.length>0;){if(s._queueTotalSize===0)return;let v=d._readRequests.shift();jm(s,v)}}o(wb,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function xb(s,d,v,R){let C=s._controlledReadableByteStream,V=d.constructor,W=Pb(V),{byteOffset:se,byteLength:ye}=d,fe=v*W,Ee;try{Ee=Jr(d.buffer)}catch(Qe){R._errorSteps(Qe);return}let Ce={buffer:Ee,bufferByteLength:Ee.byteLength,byteOffset:se,byteLength:ye,bytesFilled:0,minimumFill:fe,elementSize:W,viewConstructor:V,readerType:"byob"};if(s._pendingPullIntos.length>0){s._pendingPullIntos.push(Ce),qm(C,R);return}if(C._state==="closed"){let Qe=new V(Ce.buffer,Ce.byteOffset,0);R._closeSteps(Qe);return}if(s._queueTotalSize>0){if(Nm(s,Ce)){let Qe=Om(Ce);Um(s),R._chunkSteps(Qe);return}if(s._closeRequested){let Qe=new TypeError("Insufficient bytes to fill elements in the given buffer");or(s,Qe),R._errorSteps(Qe);return}}s._pendingPullIntos.push(Ce),qm(C,R),Zn(s)}o(xb,"ReadableByteStreamControllerPullInto");function Sb(s,d){d.readerType==="none"&&So(s);let v=s._controlledReadableByteStream;if(Kc(v))for(;Bm(v)>0;){let R=So(s);Vc(v,R)}}o(Sb,"ReadableByteStreamControllerRespondInClosedState");function Tb(s,d,v){if(zm(s,d,v),v.readerType==="none"){Cm(s,v),Hc(s);return}if(v.bytesFilled<v.minimumFill)return;So(s);let R=v.bytesFilled%v.elementSize;if(R>0){let C=v.byteOffset+v.bytesFilled;Dm(s,v.buffer,C-R,R)}v.bytesFilled-=R,Vc(s._controlledReadableByteStream,v),Hc(s)}o(Tb,"ReadableByteStreamControllerRespondInReadableState");function km(s,d){let v=s._pendingPullIntos.peek();Gc(s),s._controlledReadableByteStream._state==="closed"?Sb(s,v):Tb(s,d,v),Zn(s)}o(km,"ReadableByteStreamControllerRespondInternal");function So(s){return s._pendingPullIntos.shift()}o(So,"ReadableByteStreamControllerShiftPendingPullInto");function Eb(s){let d=s._controlledReadableByteStream;return d._state!=="readable"||s._closeRequested||!s._started?!1:!!(F(d)&&B(d)>0||Kc(d)&&Bm(d)>0||Mm(s)>0)}o(Eb,"ReadableByteStreamControllerShouldCallPull");function Ks(s){s._pullAlgorithm=void 0,s._cancelAlgorithm=void 0}o(Ks,"ReadableByteStreamControllerClearAlgorithms");function Ti(s){let d=s._controlledReadableByteStream;if(!(s._closeRequested||d._state!=="readable")){if(s._queueTotalSize>0){s._closeRequested=!0;return}if(s._pendingPullIntos.length>0){let v=s._pendingPullIntos.peek();if(v.bytesFilled%v.elementSize!==0){let R=new TypeError("Insufficient bytes to fill elements in the given buffer");throw or(s,R),R}}Ks(s),Oi(d)}}o(Ti,"ReadableByteStreamControllerClose");function Js(s,d){let v=s._controlledReadableByteStream;if(s._closeRequested||v._state!=="readable")return;let{buffer:R,byteOffset:C,byteLength:V}=d;if(_n(R))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let W=Jr(R);if(s._pendingPullIntos.length>0){let se=s._pendingPullIntos.peek();if(_n(se.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Gc(s),se.buffer=Jr(se.buffer),se.readerType==="none"&&Cm(s,se)}if(F(v))if(wb(s),B(v)===0)Zs(s,W,C,V);else{s._pendingPullIntos.length>0&&So(s);let se=new Uint8Array(W,C,V);U(v,se,!1)}else Kc(v)?(Zs(s,W,C,V),Hc(s)):Zs(s,W,C,V);Zn(s)}o(Js,"ReadableByteStreamControllerEnqueue");function or(s,d){let v=s._controlledReadableByteStream;v._state==="readable"&&($m(s),Pn(s),Ks(s),fh(v,d))}o(or,"ReadableByteStreamControllerError");function jm(s,d){let v=s._queue.shift();s._queueTotalSize-=v.byteLength,Um(s);let R=new Uint8Array(v.buffer,v.byteOffset,v.byteLength);d._chunkSteps(R)}o(jm,"ReadableByteStreamControllerFillReadRequestFromQueue");function Wc(s){if(s._byobRequest===null&&s._pendingPullIntos.length>0){let d=s._pendingPullIntos.peek(),v=new Uint8Array(d.buffer,d.byteOffset+d.bytesFilled,d.byteLength-d.bytesFilled),R=Object.create(Hn.prototype);Ab(R,s,v),s._byobRequest=R}return s._byobRequest}o(Wc,"ReadableByteStreamControllerGetBYOBRequest");function Mm(s){let d=s._controlledReadableByteStream._state;return d==="errored"?null:d==="closed"?0:s._strategyHWM-s._queueTotalSize}o(Mm,"ReadableByteStreamControllerGetDesiredSize");function Ys(s,d){let v=s._pendingPullIntos.peek();if(s._controlledReadableByteStream._state==="closed"){if(d!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(d===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(v.bytesFilled+d>v.byteLength)throw new RangeError("bytesWritten out of range")}v.buffer=Jr(v.buffer),km(s,d)}o(Ys,"ReadableByteStreamControllerRespond");function Xs(s,d){let v=s._pendingPullIntos.peek();if(s._controlledReadableByteStream._state==="closed"){if(d.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(d.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(v.byteOffset+v.bytesFilled!==d.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(v.bufferByteLength!==d.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(v.bytesFilled+d.byteLength>v.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let C=d.byteLength;v.buffer=Jr(d.buffer),km(s,C)}o(Xs,"ReadableByteStreamControllerRespondWithNewView");function Fm(s,d,v,R,C,V,W){d._controlledReadableByteStream=s,d._pullAgain=!1,d._pulling=!1,d._byobRequest=null,d._queue=d._queueTotalSize=void 0,Pn(d),d._closeRequested=!1,d._started=!1,d._strategyHWM=V,d._pullAlgorithm=R,d._cancelAlgorithm=C,d._autoAllocateChunkSize=W,d._pendingPullIntos=new l,s._readableStreamController=d;let se=v();S(_(se),()=>(d._started=!0,Zn(d),null),ye=>(or(d,ye),null))}o(Fm,"SetUpReadableByteStreamController");function bb(s,d,v){let R=Object.create(Yr.prototype),C,V,W;d.start!==void 0?C=o(()=>d.start(R),"startAlgorithm"):C=o(()=>{},"startAlgorithm"),d.pull!==void 0?V=o(()=>d.pull(R),"pullAlgorithm"):V=o(()=>_(void 0),"pullAlgorithm"),d.cancel!==void 0?W=o(ye=>d.cancel(ye),"cancelAlgorithm"):W=o(()=>_(void 0),"cancelAlgorithm");let se=d.autoAllocateChunkSize;if(se===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Fm(s,R,C,V,W,v,se)}o(bb,"SetUpReadableByteStreamControllerFromUnderlyingSource");function Ab(s,d,v){s._associatedReadableByteStreamController=d,s._view=v}o(Ab,"SetUpReadableStreamBYOBRequest");function Zc(s){return new TypeError(`ReadableStreamBYOBRequest.prototype.${s} can only be used on a ReadableStreamBYOBRequest`)}o(Zc,"byobRequestBrandCheckException");function Ei(s){return new TypeError(`ReadableByteStreamController.prototype.${s} can only be used on a ReadableByteStreamController`)}o(Ei,"byteStreamControllerBrandCheckException");function Ib(s,d){st(s,d);let v=s?.mode;return{mode:v===void 0?void 0:Rb(v,`${d} has member 'mode' that`)}}o(Ib,"convertReaderOptions");function Rb(s,d){if(s=`${s}`,s!=="byob")throw new TypeError(`${d} '${s}' is not a valid enumeration value for ReadableStreamReaderMode`);return s}o(Rb,"convertReadableStreamReaderMode");function $b(s,d){var v;st(s,d);let R=(v=s?.min)!==null&&v!==void 0?v:1;return{min:z(R,`${d} has member 'min' that`)}}o($b,"convertByobReadOptions");function Lm(s){return new wn(s)}o(Lm,"AcquireReadableStreamBYOBReader");function qm(s,d){s._reader._readIntoRequests.push(d)}o(qm,"ReadableStreamAddReadIntoRequest");function Ob(s,d,v){let C=s._reader._readIntoRequests.shift();v?C._closeSteps(d):C._chunkSteps(d)}o(Ob,"ReadableStreamFulfillReadIntoRequest");function Bm(s){return s._reader._readIntoRequests.length}o(Bm,"ReadableStreamGetNumReadIntoRequests");function Kc(s){let d=s._reader;return!(d===void 0||!Kn(d))}o(Kc,"ReadableStreamHasBYOBReader");class wn{static{o(this,"ReadableStreamBYOBReader")}constructor(d){if(Ze(d,1,"ReadableStreamBYOBReader"),j(d,"First parameter"),Tn(d))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Wn(d._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");ne(this,d),this._readIntoRequests=new l}get closed(){return Kn(this)?this._closedPromise:P(Qs("closed"))}cancel(d=void 0){return Kn(this)?this._ownerReadableStream===void 0?P(Q("cancel")):K(this,d):P(Qs("cancel"))}read(d,v={}){if(!Kn(this))return P(Qs("read"));if(!ArrayBuffer.isView(d))return P(new TypeError("view must be an array buffer view"));if(d.byteLength===0)return P(new TypeError("view must have non-zero byteLength"));if(d.buffer.byteLength===0)return P(new TypeError("view's buffer must have non-zero byteLength"));if(_n(d.buffer))return P(new TypeError("view's buffer has been detached"));let R;try{R=$b(v,"options")}catch(fe){return P(fe)}let C=R.min;if(C===0)return P(new TypeError("options.min must be greater than 0"));if(_b(d)){if(C>d.byteLength)return P(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(C>d.length)return P(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return P(Q("read from"));let V,W,se=h((fe,Ee)=>{V=fe,W=Ee});return Vm(this,d,C,{_chunkSteps:o(fe=>V({value:fe,done:!1}),"_chunkSteps"),_closeSteps:o(fe=>V({value:fe,done:!0}),"_closeSteps"),_errorSteps:o(fe=>W(fe),"_errorSteps")}),se}releaseLock(){if(!Kn(this))throw Qs("releaseLock");this._ownerReadableStream!==void 0&&Db(this)}}Object.defineProperties(wn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(wn.prototype.cancel,"cancel"),i(wn.prototype.read,"read"),i(wn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(wn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Kn(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_readIntoRequests")?!1:s instanceof wn}o(Kn,"IsReadableStreamBYOBReader");function Vm(s,d,v,R){let C=s._ownerReadableStream;C._disturbed=!0,C._state==="errored"?R._errorSteps(C._storedError):xb(C._readableStreamController,d,v,R)}o(Vm,"ReadableStreamBYOBReaderRead");function Db(s){Z(s);let d=new TypeError("Reader was released");Gm(s,d)}o(Db,"ReadableStreamBYOBReaderRelease");function Gm(s,d){let v=s._readIntoRequests;s._readIntoRequests=new l,v.forEach(R=>{R._errorSteps(d)})}o(Gm,"ReadableStreamBYOBReaderErrorReadIntoRequests");function Qs(s){return new TypeError(`ReadableStreamBYOBReader.prototype.${s} can only be used on a ReadableStreamBYOBReader`)}o(Qs,"byobReaderBrandCheckException");function bi(s,d){let{highWaterMark:v}=s;if(v===void 0)return d;if(qt(v)||v<0)throw new RangeError("Invalid highWaterMark");return v}o(bi,"ExtractHighWaterMark");function ea(s){let{size:d}=s;return d||(()=>1)}o(ea,"ExtractSizeAlgorithm");function ta(s,d){st(s,d);let v=s?.highWaterMark,R=s?.size;return{highWaterMark:v===void 0?void 0:O(v),size:R===void 0?void 0:Cb(R,`${d} has member 'size' that`)}}o(ta,"convertQueuingStrategy");function Cb(s,d){return dt(s,d),v=>O(s(v))}o(Cb,"convertQueuingStrategySize");function Nb(s,d){st(s,d);let v=s?.abort,R=s?.close,C=s?.start,V=s?.type,W=s?.write;return{abort:v===void 0?void 0:zb(v,s,`${d} has member 'abort' that`),close:R===void 0?void 0:Ub(R,s,`${d} has member 'close' that`),start:C===void 0?void 0:kb(C,s,`${d} has member 'start' that`),write:W===void 0?void 0:jb(W,s,`${d} has member 'write' that`),type:V}}o(Nb,"convertUnderlyingSink");function zb(s,d,v){return dt(s,v),R=>c(s,d,[R])}o(zb,"convertUnderlyingSinkAbortCallback");function Ub(s,d,v){return dt(s,v),()=>c(s,d,[])}o(Ub,"convertUnderlyingSinkCloseCallback");function kb(s,d,v){return dt(s,v),R=>p(s,d,[R])}o(kb,"convertUnderlyingSinkStartCallback");function jb(s,d,v){return dt(s,v),(R,C)=>c(s,d,[R,C])}o(jb,"convertUnderlyingSinkWriteCallback");function Hm(s,d){if(!To(s))throw new TypeError(`${d} is not a WritableStream.`)}o(Hm,"assertWritableStream");function Mb(s){if(typeof s!="object"||s===null)return!1;try{return typeof s.aborted=="boolean"}catch{return!1}}o(Mb,"isAbortSignal");let Fb=typeof AbortController=="function";function Lb(){if(Fb)return new AbortController}o(Lb,"createAbortController");class xn{static{o(this,"WritableStream")}constructor(d={},v={}){d===void 0?d=null:He(d,"First parameter");let R=ta(v,"Second parameter"),C=Nb(d,"First parameter");if(Zm(this),C.type!==void 0)throw new RangeError("Invalid type is specified");let W=ea(R),se=bi(R,1);tA(this,C,se,W)}get locked(){if(!To(this))throw sa("locked");return Eo(this)}abort(d=void 0){return To(this)?Eo(this)?P(new TypeError("Cannot abort a stream that already has a writer")):ra(this,d):P(sa("abort"))}close(){return To(this)?Eo(this)?P(new TypeError("Cannot close a stream that already has a writer")):$r(this)?P(new TypeError("Cannot close an already-closing stream")):Km(this):P(sa("close"))}getWriter(){if(!To(this))throw sa("getWriter");return Wm(this)}}Object.defineProperties(xn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(xn.prototype.abort,"abort"),i(xn.prototype.close,"close"),i(xn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(xn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function Wm(s){return new Xr(s)}o(Wm,"AcquireWritableStreamDefaultWriter");function qb(s,d,v,R,C=1,V=()=>1){let W=Object.create(xn.prototype);Zm(W);let se=Object.create(bo.prototype);return th(W,se,s,d,v,R,C,V),W}o(qb,"CreateWritableStream");function Zm(s){s._state="writable",s._storedError=void 0,s._writer=void 0,s._writableStreamController=void 0,s._writeRequests=new l,s._inFlightWriteRequest=void 0,s._closeRequest=void 0,s._inFlightCloseRequest=void 0,s._pendingAbortRequest=void 0,s._backpressure=!1}o(Zm,"InitializeWritableStream");function To(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_writableStreamController")?!1:s instanceof xn}o(To,"IsWritableStream");function Eo(s){return s._writer!==void 0}o(Eo,"IsWritableStreamLocked");function ra(s,d){var v;if(s._state==="closed"||s._state==="errored")return _(void 0);s._writableStreamController._abortReason=d,(v=s._writableStreamController._abortController)===null||v===void 0||v.abort(d);let R=s._state;if(R==="closed"||R==="errored")return _(void 0);if(s._pendingAbortRequest!==void 0)return s._pendingAbortRequest._promise;let C=!1;R==="erroring"&&(C=!0,d=void 0);let V=h((W,se)=>{s._pendingAbortRequest={_promise:void 0,_resolve:W,_reject:se,_reason:d,_wasAlreadyErroring:C}});return s._pendingAbortRequest._promise=V,C||Yc(s,d),V}o(ra,"WritableStreamAbort");function Km(s){let d=s._state;if(d==="closed"||d==="errored")return P(new TypeError(`The stream (in ${d} state) is not in the writable state and cannot be closed`));let v=h((C,V)=>{let W={_resolve:C,_reject:V};s._closeRequest=W}),R=s._writer;return R!==void 0&&s._backpressure&&d==="writable"&&il(R),rA(s._writableStreamController),v}o(Km,"WritableStreamClose");function Bb(s){return h((v,R)=>{let C={_resolve:v,_reject:R};s._writeRequests.push(C)})}o(Bb,"WritableStreamAddWriteRequest");function Jc(s,d){if(s._state==="writable"){Yc(s,d);return}Xc(s)}o(Jc,"WritableStreamDealWithRejection");function Yc(s,d){let v=s._writableStreamController;s._state="erroring",s._storedError=d;let R=s._writer;R!==void 0&&Ym(R,d),!Zb(s)&&v._started&&Xc(s)}o(Yc,"WritableStreamStartErroring");function Xc(s){s._state="errored",s._writableStreamController[g]();let d=s._storedError;if(s._writeRequests.forEach(C=>{C._reject(d)}),s._writeRequests=new l,s._pendingAbortRequest===void 0){na(s);return}let v=s._pendingAbortRequest;if(s._pendingAbortRequest=void 0,v._wasAlreadyErroring){v._reject(d),na(s);return}let R=s._writableStreamController[x](v._reason);S(R,()=>(v._resolve(),na(s),null),C=>(v._reject(C),na(s),null))}o(Xc,"WritableStreamFinishErroring");function Vb(s){s._inFlightWriteRequest._resolve(void 0),s._inFlightWriteRequest=void 0}o(Vb,"WritableStreamFinishInFlightWrite");function Gb(s,d){s._inFlightWriteRequest._reject(d),s._inFlightWriteRequest=void 0,Jc(s,d)}o(Gb,"WritableStreamFinishInFlightWriteWithError");function Hb(s){s._inFlightCloseRequest._resolve(void 0),s._inFlightCloseRequest=void 0,s._state==="erroring"&&(s._storedError=void 0,s._pendingAbortRequest!==void 0&&(s._pendingAbortRequest._resolve(),s._pendingAbortRequest=void 0)),s._state="closed";let v=s._writer;v!==void 0&&ih(v)}o(Hb,"WritableStreamFinishInFlightClose");function Wb(s,d){s._inFlightCloseRequest._reject(d),s._inFlightCloseRequest=void 0,s._pendingAbortRequest!==void 0&&(s._pendingAbortRequest._reject(d),s._pendingAbortRequest=void 0),Jc(s,d)}o(Wb,"WritableStreamFinishInFlightCloseWithError");function $r(s){return!(s._closeRequest===void 0&&s._inFlightCloseRequest===void 0)}o($r,"WritableStreamCloseQueuedOrInFlight");function Zb(s){return!(s._inFlightWriteRequest===void 0&&s._inFlightCloseRequest===void 0)}o(Zb,"WritableStreamHasOperationMarkedInFlight");function Kb(s){s._inFlightCloseRequest=s._closeRequest,s._closeRequest=void 0}o(Kb,"WritableStreamMarkCloseRequestInFlight");function Jb(s){s._inFlightWriteRequest=s._writeRequests.shift()}o(Jb,"WritableStreamMarkFirstWriteRequestInFlight");function na(s){s._closeRequest!==void 0&&(s._closeRequest._reject(s._storedError),s._closeRequest=void 0);let d=s._writer;d!==void 0&&nl(d,s._storedError)}o(na,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function Qc(s,d){let v=s._writer;v!==void 0&&d!==s._backpressure&&(d?cA(v):il(v)),s._backpressure=d}o(Qc,"WritableStreamUpdateBackpressure");class Xr{static{o(this,"WritableStreamDefaultWriter")}constructor(d){if(Ze(d,1,"WritableStreamDefaultWriter"),Hm(d,"First parameter"),Eo(d))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=d,d._writer=this;let v=d._state;if(v==="writable")!$r(d)&&d._backpressure?ua(this):sh(this),aa(this);else if(v==="erroring")ol(this,d._storedError),aa(this);else if(v==="closed")sh(this),aA(this);else{let R=d._storedError;ol(this,R),oh(this,R)}}get closed(){return Jn(this)?this._closedPromise:P(Yn("closed"))}get desiredSize(){if(!Jn(this))throw Yn("desiredSize");if(this._ownerWritableStream===void 0)throw Ii("desiredSize");return eA(this)}get ready(){return Jn(this)?this._readyPromise:P(Yn("ready"))}abort(d=void 0){return Jn(this)?this._ownerWritableStream===void 0?P(Ii("abort")):Yb(this,d):P(Yn("abort"))}close(){if(!Jn(this))return P(Yn("close"));let d=this._ownerWritableStream;return d===void 0?P(Ii("close")):$r(d)?P(new TypeError("Cannot close an already-closing stream")):Jm(this)}releaseLock(){if(!Jn(this))throw Yn("releaseLock");this._ownerWritableStream!==void 0&&Xm(this)}write(d=void 0){return Jn(this)?this._ownerWritableStream===void 0?P(Ii("write to")):Qm(this,d):P(Yn("write"))}}Object.defineProperties(Xr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(Xr.prototype.abort,"abort"),i(Xr.prototype.close,"close"),i(Xr.prototype.releaseLock,"releaseLock"),i(Xr.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Xr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Jn(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_ownerWritableStream")?!1:s instanceof Xr}o(Jn,"IsWritableStreamDefaultWriter");function Yb(s,d){let v=s._ownerWritableStream;return ra(v,d)}o(Yb,"WritableStreamDefaultWriterAbort");function Jm(s){let d=s._ownerWritableStream;return Km(d)}o(Jm,"WritableStreamDefaultWriterClose");function Xb(s){let d=s._ownerWritableStream,v=d._state;return $r(d)||v==="closed"?_(void 0):v==="errored"?P(d._storedError):Jm(s)}o(Xb,"WritableStreamDefaultWriterCloseWithErrorPropagation");function Qb(s,d){s._closedPromiseState==="pending"?nl(s,d):uA(s,d)}o(Qb,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function Ym(s,d){s._readyPromiseState==="pending"?ah(s,d):lA(s,d)}o(Ym,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function eA(s){let d=s._ownerWritableStream,v=d._state;return v==="errored"||v==="erroring"?null:v==="closed"?0:rh(d._writableStreamController)}o(eA,"WritableStreamDefaultWriterGetDesiredSize");function Xm(s){let d=s._ownerWritableStream,v=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Ym(s,v),Qb(s,v),d._writer=void 0,s._ownerWritableStream=void 0}o(Xm,"WritableStreamDefaultWriterRelease");function Qm(s,d){let v=s._ownerWritableStream,R=v._writableStreamController,C=nA(R,d);if(v!==s._ownerWritableStream)return P(Ii("write to"));let V=v._state;if(V==="errored")return P(v._storedError);if($r(v)||V==="closed")return P(new TypeError("The stream is closing or closed and cannot be written to"));if(V==="erroring")return P(v._storedError);let W=Bb(v);return oA(R,d,C),W}o(Qm,"WritableStreamDefaultWriterWrite");let eh={};class bo{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!el(this))throw rl("abortReason");return this._abortReason}get signal(){if(!el(this))throw rl("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(d=void 0){if(!el(this))throw rl("error");this._controlledWritableStream._state==="writable"&&nh(this,d)}[x](d){let v=this._abortAlgorithm(d);return oa(this),v}[g](){Pn(this)}}Object.defineProperties(bo.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bo.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function el(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_controlledWritableStream")?!1:s instanceof bo}o(el,"IsWritableStreamDefaultController");function th(s,d,v,R,C,V,W,se){d._controlledWritableStream=s,s._writableStreamController=d,d._queue=void 0,d._queueTotalSize=void 0,Pn(d),d._abortReason=void 0,d._abortController=Lb(),d._started=!1,d._strategySizeAlgorithm=se,d._strategyHWM=W,d._writeAlgorithm=R,d._closeAlgorithm=C,d._abortAlgorithm=V;let ye=tl(d);Qc(s,ye);let fe=v(),Ee=_(fe);S(Ee,()=>(d._started=!0,ia(d),null),Ce=>(d._started=!0,Jc(s,Ce),null))}o(th,"SetUpWritableStreamDefaultController");function tA(s,d,v,R){let C=Object.create(bo.prototype),V,W,se,ye;d.start!==void 0?V=o(()=>d.start(C),"startAlgorithm"):V=o(()=>{},"startAlgorithm"),d.write!==void 0?W=o(fe=>d.write(fe,C),"writeAlgorithm"):W=o(()=>_(void 0),"writeAlgorithm"),d.close!==void 0?se=o(()=>d.close(),"closeAlgorithm"):se=o(()=>_(void 0),"closeAlgorithm"),d.abort!==void 0?ye=o(fe=>d.abort(fe),"abortAlgorithm"):ye=o(()=>_(void 0),"abortAlgorithm"),th(s,C,V,W,se,ye,v,R)}o(tA,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function oa(s){s._writeAlgorithm=void 0,s._closeAlgorithm=void 0,s._abortAlgorithm=void 0,s._strategySizeAlgorithm=void 0}o(oa,"WritableStreamDefaultControllerClearAlgorithms");function rA(s){qc(s,eh,0),ia(s)}o(rA,"WritableStreamDefaultControllerClose");function nA(s,d){try{return s._strategySizeAlgorithm(d)}catch(v){return Ai(s,v),1}}o(nA,"WritableStreamDefaultControllerGetChunkSize");function rh(s){return s._strategyHWM-s._queueTotalSize}o(rh,"WritableStreamDefaultControllerGetDesiredSize");function oA(s,d,v){try{qc(s,d,v)}catch(C){Ai(s,C);return}let R=s._controlledWritableStream;if(!$r(R)&&R._state==="writable"){let C=tl(s);Qc(R,C)}ia(s)}o(oA,"WritableStreamDefaultControllerWrite");function ia(s){let d=s._controlledWritableStream;if(!s._started||d._inFlightWriteRequest!==void 0)return;if(d._state==="erroring"){Xc(d);return}if(s._queue.length===0)return;let R=vb(s);R===eh?iA(s):sA(s,R)}o(ia,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Ai(s,d){s._controlledWritableStream._state==="writable"&&nh(s,d)}o(Ai,"WritableStreamDefaultControllerErrorIfNeeded");function iA(s){let d=s._controlledWritableStream;Kb(d),Lc(s);let v=s._closeAlgorithm();oa(s),S(v,()=>(Hb(d),null),R=>(Wb(d,R),null))}o(iA,"WritableStreamDefaultControllerProcessClose");function sA(s,d){let v=s._controlledWritableStream;Jb(v);let R=s._writeAlgorithm(d);S(R,()=>{Vb(v);let C=v._state;if(Lc(s),!$r(v)&&C==="writable"){let V=tl(s);Qc(v,V)}return ia(s),null},C=>(v._state==="writable"&&oa(s),Gb(v,C),null))}o(sA,"WritableStreamDefaultControllerProcessWrite");function tl(s){return rh(s)<=0}o(tl,"WritableStreamDefaultControllerGetBackpressure");function nh(s,d){let v=s._controlledWritableStream;oa(s),Yc(v,d)}o(nh,"WritableStreamDefaultControllerError");function sa(s){return new TypeError(`WritableStream.prototype.${s} can only be used on a WritableStream`)}o(sa,"streamBrandCheckException$2");function rl(s){return new TypeError(`WritableStreamDefaultController.prototype.${s} can only be used on a WritableStreamDefaultController`)}o(rl,"defaultControllerBrandCheckException$2");function Yn(s){return new TypeError(`WritableStreamDefaultWriter.prototype.${s} can only be used on a WritableStreamDefaultWriter`)}o(Yn,"defaultWriterBrandCheckException");function Ii(s){return new TypeError("Cannot "+s+" a stream using a released writer")}o(Ii,"defaultWriterLockException");function aa(s){s._closedPromise=h((d,v)=>{s._closedPromise_resolve=d,s._closedPromise_reject=v,s._closedPromiseState="pending"})}o(aa,"defaultWriterClosedPromiseInitialize");function oh(s,d){aa(s),nl(s,d)}o(oh,"defaultWriterClosedPromiseInitializeAsRejected");function aA(s){aa(s),ih(s)}o(aA,"defaultWriterClosedPromiseInitializeAsResolved");function nl(s,d){s._closedPromise_reject!==void 0&&(b(s._closedPromise),s._closedPromise_reject(d),s._closedPromise_resolve=void 0,s._closedPromise_reject=void 0,s._closedPromiseState="rejected")}o(nl,"defaultWriterClosedPromiseReject");function uA(s,d){oh(s,d)}o(uA,"defaultWriterClosedPromiseResetToRejected");function ih(s){s._closedPromise_resolve!==void 0&&(s._closedPromise_resolve(void 0),s._closedPromise_resolve=void 0,s._closedPromise_reject=void 0,s._closedPromiseState="resolved")}o(ih,"defaultWriterClosedPromiseResolve");function ua(s){s._readyPromise=h((d,v)=>{s._readyPromise_resolve=d,s._readyPromise_reject=v}),s._readyPromiseState="pending"}o(ua,"defaultWriterReadyPromiseInitialize");function ol(s,d){ua(s),ah(s,d)}o(ol,"defaultWriterReadyPromiseInitializeAsRejected");function sh(s){ua(s),il(s)}o(sh,"defaultWriterReadyPromiseInitializeAsResolved");function ah(s,d){s._readyPromise_reject!==void 0&&(b(s._readyPromise),s._readyPromise_reject(d),s._readyPromise_resolve=void 0,s._readyPromise_reject=void 0,s._readyPromiseState="rejected")}o(ah,"defaultWriterReadyPromiseReject");function cA(s){ua(s)}o(cA,"defaultWriterReadyPromiseReset");function lA(s,d){ol(s,d)}o(lA,"defaultWriterReadyPromiseResetToRejected");function il(s){s._readyPromise_resolve!==void 0&&(s._readyPromise_resolve(void 0),s._readyPromise_resolve=void 0,s._readyPromise_reject=void 0,s._readyPromiseState="fulfilled")}o(il,"defaultWriterReadyPromiseResolve");function dA(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(dA,"getGlobals");let sl=dA();function pA(s){if(!(typeof s=="function"||typeof s=="object")||s.name!=="DOMException")return!1;try{return new s,!0}catch{return!1}}o(pA,"isDOMExceptionConstructor");function fA(){let s=sl?.DOMException;return pA(s)?s:void 0}o(fA,"getFromGlobal");function mA(){let s=o(function(v,R){this.message=v||"",this.name=R||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return i(s,"DOMException"),s.prototype=Object.create(Error.prototype),Object.defineProperty(s.prototype,"constructor",{value:s,writable:!0,configurable:!0}),s}o(mA,"createPolyfill");let hA=fA()||mA();function uh(s,d,v,R,C,V){let W=G(s),se=Wm(d);s._disturbed=!0;let ye=!1,fe=_(void 0);return h((Ee,Ce)=>{let Qe;if(V!==void 0){if(Qe=o(()=>{let me=V.reason!==void 0?V.reason:new hA("Aborted","AbortError"),je=[];R||je.push(()=>d._state==="writable"?ra(d,me):_(void 0)),C||je.push(()=>s._state==="readable"?yr(s,me):_(void 0)),Nt(()=>Promise.all(je.map(et=>et())),!0,me)},"abortAlgorithm"),V.aborted){Qe();return}V.addEventListener("abort",Qe)}function vr(){return h((me,je)=>{function et(Bt){Bt?me():E($o(),et,je)}o(et,"next"),et(!1)})}o(vr,"pipeLoop");function $o(){return ye?_(!0):E(se._readyPromise,()=>h((me,je)=>{le(W,{_chunkSteps:o(et=>{fe=E(Qm(se,et),void 0,e),me(!1)},"_chunkSteps"),_closeSteps:o(()=>me(!0),"_closeSteps"),_errorSteps:je})}))}if(o($o,"pipeStep"),en(s,W._closedPromise,me=>(R?ir(!0,me):Nt(()=>ra(d,me),!0,me),null)),en(d,se._closedPromise,me=>(C?ir(!0,me):Nt(()=>yr(s,me),!0,me),null)),Rt(s,W._closedPromise,()=>(v?ir():Nt(()=>Xb(se)),null)),$r(d)||d._state==="closed"){let me=new TypeError("the destination writable stream closed before all data could be piped to it");C?ir(!0,me):Nt(()=>yr(s,me),!0,me)}b(vr());function bn(){let me=fe;return E(fe,()=>me!==fe?bn():void 0)}o(bn,"waitForWritesToFinish");function en(me,je,et){me._state==="errored"?et(me._storedError):T(je,et)}o(en,"isOrBecomesErrored");function Rt(me,je,et){me._state==="closed"?et():w(je,et)}o(Rt,"isOrBecomesClosed");function Nt(me,je,et){if(ye)return;ye=!0,d._state==="writable"&&!$r(d)?w(bn(),Bt):Bt();function Bt(){return S(me(),()=>tn(je,et),Oo=>tn(!0,Oo)),null}o(Bt,"doTheRest")}o(Nt,"shutdownWithAction");function ir(me,je){ye||(ye=!0,d._state==="writable"&&!$r(d)?w(bn(),()=>tn(me,je)):tn(me,je))}o(ir,"shutdown");function tn(me,je){return Xm(se),Z(W),V!==void 0&&V.removeEventListener("abort",Qe),me?Ce(je):Ee(void 0),null}o(tn,"finalize")})}o(uh,"ReadableStreamPipeTo");class Qr{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ca(this))throw da("desiredSize");return al(this)}close(){if(!ca(this))throw da("close");if(!Io(this))throw new TypeError("The stream is not in a state that permits close");Xn(this)}enqueue(d=void 0){if(!ca(this))throw da("enqueue");if(!Io(this))throw new TypeError("The stream is not in a state that permits enqueue");return Ao(this,d)}error(d=void 0){if(!ca(this))throw da("error");gr(this,d)}[re](d){Pn(this);let v=this._cancelAlgorithm(d);return la(this),v}[ee](d){let v=this._controlledReadableStream;if(this._queue.length>0){let R=Lc(this);this._closeRequested&&this._queue.length===0?(la(this),Oi(v)):Ri(this),d._chunkSteps(R)}else N(v,d),Ri(this)}[Te](){}}Object.defineProperties(Qr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Qr.prototype.close,"close"),i(Qr.prototype.enqueue,"enqueue"),i(Qr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Qr.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function ca(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_controlledReadableStream")?!1:s instanceof Qr}o(ca,"IsReadableStreamDefaultController");function Ri(s){if(!ch(s))return;if(s._pulling){s._pullAgain=!0;return}s._pulling=!0;let v=s._pullAlgorithm();S(v,()=>(s._pulling=!1,s._pullAgain&&(s._pullAgain=!1,Ri(s)),null),R=>(gr(s,R),null))}o(Ri,"ReadableStreamDefaultControllerCallPullIfNeeded");function ch(s){let d=s._controlledReadableStream;return!Io(s)||!s._started?!1:!!(Tn(d)&&B(d)>0||al(s)>0)}o(ch,"ReadableStreamDefaultControllerShouldCallPull");function la(s){s._pullAlgorithm=void 0,s._cancelAlgorithm=void 0,s._strategySizeAlgorithm=void 0}o(la,"ReadableStreamDefaultControllerClearAlgorithms");function Xn(s){if(!Io(s))return;let d=s._controlledReadableStream;s._closeRequested=!0,s._queue.length===0&&(la(s),Oi(d))}o(Xn,"ReadableStreamDefaultControllerClose");function Ao(s,d){if(!Io(s))return;let v=s._controlledReadableStream;if(Tn(v)&&B(v)>0)U(v,d,!1);else{let R;try{R=s._strategySizeAlgorithm(d)}catch(C){throw gr(s,C),C}try{qc(s,d,R)}catch(C){throw gr(s,C),C}}Ri(s)}o(Ao,"ReadableStreamDefaultControllerEnqueue");function gr(s,d){let v=s._controlledReadableStream;v._state==="readable"&&(Pn(s),la(s),fh(v,d))}o(gr,"ReadableStreamDefaultControllerError");function al(s){let d=s._controlledReadableStream._state;return d==="errored"?null:d==="closed"?0:s._strategyHWM-s._queueTotalSize}o(al,"ReadableStreamDefaultControllerGetDesiredSize");function gA(s){return!ch(s)}o(gA,"ReadableStreamDefaultControllerHasBackpressure");function Io(s){let d=s._controlledReadableStream._state;return!s._closeRequested&&d==="readable"}o(Io,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function lh(s,d,v,R,C,V,W){d._controlledReadableStream=s,d._queue=void 0,d._queueTotalSize=void 0,Pn(d),d._started=!1,d._closeRequested=!1,d._pullAgain=!1,d._pulling=!1,d._strategySizeAlgorithm=W,d._strategyHWM=V,d._pullAlgorithm=R,d._cancelAlgorithm=C,s._readableStreamController=d;let se=v();S(_(se),()=>(d._started=!0,Ri(d),null),ye=>(gr(d,ye),null))}o(lh,"SetUpReadableStreamDefaultController");function yA(s,d,v,R){let C=Object.create(Qr.prototype),V,W,se;d.start!==void 0?V=o(()=>d.start(C),"startAlgorithm"):V=o(()=>{},"startAlgorithm"),d.pull!==void 0?W=o(()=>d.pull(C),"pullAlgorithm"):W=o(()=>_(void 0),"pullAlgorithm"),d.cancel!==void 0?se=o(ye=>d.cancel(ye),"cancelAlgorithm"):se=o(()=>_(void 0),"cancelAlgorithm"),lh(s,C,V,W,se,v,R)}o(yA,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function da(s){return new TypeError(`ReadableStreamDefaultController.prototype.${s} can only be used on a ReadableStreamDefaultController`)}o(da,"defaultControllerBrandCheckException$1");function vA(s,d){return Wn(s._readableStreamController)?PA(s):_A(s)}o(vA,"ReadableStreamTee");function _A(s,d){let v=G(s),R=!1,C=!1,V=!1,W=!1,se,ye,fe,Ee,Ce,Qe=h(Rt=>{Ce=Rt});function vr(){return R?(C=!0,_(void 0)):(R=!0,le(v,{_chunkSteps:o(Nt=>{u(()=>{C=!1;let ir=Nt,tn=Nt;V||Ao(fe._readableStreamController,ir),W||Ao(Ee._readableStreamController,tn),R=!1,C&&vr()})},"_chunkSteps"),_closeSteps:o(()=>{R=!1,V||Xn(fe._readableStreamController),W||Xn(Ee._readableStreamController),(!V||!W)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{R=!1},"_errorSteps")}),_(void 0))}o(vr,"pullAlgorithm");function $o(Rt){if(V=!0,se=Rt,W){let Nt=Ke([se,ye]),ir=yr(s,Nt);Ce(ir)}return Qe}o($o,"cancel1Algorithm");function bn(Rt){if(W=!0,ye=Rt,V){let Nt=Ke([se,ye]),ir=yr(s,Nt);Ce(ir)}return Qe}o(bn,"cancel2Algorithm");function en(){}return o(en,"startAlgorithm"),fe=$i(en,vr,$o),Ee=$i(en,vr,bn),T(v._closedPromise,Rt=>(gr(fe._readableStreamController,Rt),gr(Ee._readableStreamController,Rt),(!V||!W)&&Ce(void 0),null)),[fe,Ee]}o(_A,"ReadableStreamDefaultTee");function PA(s){let d=G(s),v=!1,R=!1,C=!1,V=!1,W=!1,se,ye,fe,Ee,Ce,Qe=h(me=>{Ce=me});function vr(me){T(me._closedPromise,je=>(me!==d||(or(fe._readableStreamController,je),or(Ee._readableStreamController,je),(!V||!W)&&Ce(void 0)),null))}o(vr,"forwardReaderError");function $o(){Kn(d)&&(Z(d),d=G(s),vr(d)),le(d,{_chunkSteps:o(je=>{u(()=>{R=!1,C=!1;let et=je,Bt=je;if(!V&&!W)try{Bt=Im(je)}catch(Oo){or(fe._readableStreamController,Oo),or(Ee._readableStreamController,Oo),Ce(yr(s,Oo));return}V||Js(fe._readableStreamController,et),W||Js(Ee._readableStreamController,Bt),v=!1,R?en():C&&Rt()})},"_chunkSteps"),_closeSteps:o(()=>{v=!1,V||Ti(fe._readableStreamController),W||Ti(Ee._readableStreamController),fe._readableStreamController._pendingPullIntos.length>0&&Ys(fe._readableStreamController,0),Ee._readableStreamController._pendingPullIntos.length>0&&Ys(Ee._readableStreamController,0),(!V||!W)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{v=!1},"_errorSteps")})}o($o,"pullWithDefaultReader");function bn(me,je){ue(d)&&(Z(d),d=Lm(s),vr(d));let et=je?Ee:fe,Bt=je?fe:Ee;Vm(d,me,1,{_chunkSteps:o(Do=>{u(()=>{R=!1,C=!1;let Co=je?W:V;if(je?V:W)Co||Xs(et._readableStreamController,Do);else{let bh;try{bh=Im(Do)}catch(pl){or(et._readableStreamController,pl),or(Bt._readableStreamController,pl),Ce(yr(s,pl));return}Co||Xs(et._readableStreamController,Do),Js(Bt._readableStreamController,bh)}v=!1,R?en():C&&Rt()})},"_chunkSteps"),_closeSteps:o(Do=>{v=!1;let Co=je?W:V,_a=je?V:W;Co||Ti(et._readableStreamController),_a||Ti(Bt._readableStreamController),Do!==void 0&&(Co||Xs(et._readableStreamController,Do),!_a&&Bt._readableStreamController._pendingPullIntos.length>0&&Ys(Bt._readableStreamController,0)),(!Co||!_a)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{v=!1},"_errorSteps")})}o(bn,"pullWithBYOBReader");function en(){if(v)return R=!0,_(void 0);v=!0;let me=Wc(fe._readableStreamController);return me===null?$o():bn(me._view,!1),_(void 0)}o(en,"pull1Algorithm");function Rt(){if(v)return C=!0,_(void 0);v=!0;let me=Wc(Ee._readableStreamController);return me===null?$o():bn(me._view,!0),_(void 0)}o(Rt,"pull2Algorithm");function Nt(me){if(V=!0,se=me,W){let je=Ke([se,ye]),et=yr(s,je);Ce(et)}return Qe}o(Nt,"cancel1Algorithm");function ir(me){if(W=!0,ye=me,V){let je=Ke([se,ye]),et=yr(s,je);Ce(et)}return Qe}o(ir,"cancel2Algorithm");function tn(){}return o(tn,"startAlgorithm"),fe=ph(tn,en,Nt),Ee=ph(tn,Rt,ir),vr(d),[fe,Ee]}o(PA,"ReadableByteStreamTee");function wA(s){return r(s)&&typeof s.getReader<"u"}o(wA,"isReadableStreamLike");function xA(s){return wA(s)?TA(s.getReader()):SA(s)}o(xA,"ReadableStreamFrom");function SA(s){let d,v=Am(s,"async"),R=e;function C(){let W;try{W=mb(v)}catch(ye){return P(ye)}let se=_(W);return $(se,ye=>{if(!r(ye))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(hb(ye))Xn(d._readableStreamController);else{let Ee=gb(ye);Ao(d._readableStreamController,Ee)}})}o(C,"pullAlgorithm");function V(W){let se=v.iterator,ye;try{ye=Ws(se,"return")}catch(Ce){return P(Ce)}if(ye===void 0)return _(void 0);let fe;try{fe=p(ye,se,[W])}catch(Ce){return P(Ce)}let Ee=_(fe);return $(Ee,Ce=>{if(!r(Ce))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(V,"cancelAlgorithm"),d=$i(R,C,V,0),d}o(SA,"ReadableStreamFromIterable");function TA(s){let d,v=e;function R(){let V;try{V=s.read()}catch(W){return P(W)}return $(V,W=>{if(!r(W))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(W.done)Xn(d._readableStreamController);else{let se=W.value;Ao(d._readableStreamController,se)}})}o(R,"pullAlgorithm");function C(V){try{return _(s.cancel(V))}catch(W){return P(W)}}return o(C,"cancelAlgorithm"),d=$i(v,R,C,0),d}o(TA,"ReadableStreamFromDefaultReader");function EA(s,d){st(s,d);let v=s,R=v?.autoAllocateChunkSize,C=v?.cancel,V=v?.pull,W=v?.start,se=v?.type;return{autoAllocateChunkSize:R===void 0?void 0:z(R,`${d} has member 'autoAllocateChunkSize' that`),cancel:C===void 0?void 0:bA(C,v,`${d} has member 'cancel' that`),pull:V===void 0?void 0:AA(V,v,`${d} has member 'pull' that`),start:W===void 0?void 0:IA(W,v,`${d} has member 'start' that`),type:se===void 0?void 0:RA(se,`${d} has member 'type' that`)}}o(EA,"convertUnderlyingDefaultOrByteSource");function bA(s,d,v){return dt(s,v),R=>c(s,d,[R])}o(bA,"convertUnderlyingSourceCancelCallback");function AA(s,d,v){return dt(s,v),R=>c(s,d,[R])}o(AA,"convertUnderlyingSourcePullCallback");function IA(s,d,v){return dt(s,v),R=>p(s,d,[R])}o(IA,"convertUnderlyingSourceStartCallback");function RA(s,d){if(s=`${s}`,s!=="bytes")throw new TypeError(`${d} '${s}' is not a valid enumeration value for ReadableStreamType`);return s}o(RA,"convertReadableStreamType");function $A(s,d){return st(s,d),{preventCancel:!!s?.preventCancel}}o($A,"convertIteratorOptions");function dh(s,d){st(s,d);let v=s?.preventAbort,R=s?.preventCancel,C=s?.preventClose,V=s?.signal;return V!==void 0&&OA(V,`${d} has member 'signal' that`),{preventAbort:!!v,preventCancel:!!R,preventClose:!!C,signal:V}}o(dh,"convertPipeOptions");function OA(s,d){if(!Mb(s))throw new TypeError(`${d} is not an AbortSignal.`)}o(OA,"assertAbortSignal");function DA(s,d){st(s,d);let v=s?.readable;A(v,"readable","ReadableWritablePair"),j(v,`${d} has member 'readable' that`);let R=s?.writable;return A(R,"writable","ReadableWritablePair"),Hm(R,`${d} has member 'writable' that`),{readable:v,writable:R}}o(DA,"convertReadableWritablePair");class At{static{o(this,"ReadableStream")}constructor(d={},v={}){d===void 0?d=null:He(d,"First parameter");let R=ta(v,"Second parameter"),C=EA(d,"First parameter");if(ul(this),C.type==="bytes"){if(R.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let V=bi(R,0);bb(this,C,V)}else{let V=ea(R),W=bi(R,1);yA(this,C,W,V)}}get locked(){if(!Sn(this))throw Qn("locked");return Tn(this)}cancel(d=void 0){return Sn(this)?Tn(this)?P(new TypeError("Cannot cancel a stream that already has a reader")):yr(this,d):P(Qn("cancel"))}getReader(d=void 0){if(!Sn(this))throw Qn("getReader");return Ib(d,"First parameter").mode===void 0?G(this):Lm(this)}pipeThrough(d,v={}){if(!Sn(this))throw Qn("pipeThrough");Ze(d,1,"pipeThrough");let R=DA(d,"First parameter"),C=dh(v,"Second parameter");if(Tn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Eo(R.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let V=uh(this,R.writable,C.preventClose,C.preventAbort,C.preventCancel,C.signal);return b(V),R.readable}pipeTo(d,v={}){if(!Sn(this))return P(Qn("pipeTo"));if(d===void 0)return P("Parameter 1 is required in 'pipeTo'.");if(!To(d))return P(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let R;try{R=dh(v,"Second parameter")}catch(C){return P(C)}return Tn(this)?P(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Eo(d)?P(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):uh(this,d,R.preventClose,R.preventAbort,R.preventCancel,R.signal)}tee(){if(!Sn(this))throw Qn("tee");let d=vA(this);return Ke(d)}values(d=void 0){if(!Sn(this))throw Qn("values");let v=$A(d,"First parameter");return Po(this,v.preventCancel)}[Fc](d){return this.values(d)}static from(d){return xA(d)}}Object.defineProperties(At,{from:{enumerable:!0}}),Object.defineProperties(At.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(At.from,"from"),i(At.prototype.cancel,"cancel"),i(At.prototype.getReader,"getReader"),i(At.prototype.pipeThrough,"pipeThrough"),i(At.prototype.pipeTo,"pipeTo"),i(At.prototype.tee,"tee"),i(At.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(At.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(At.prototype,Fc,{value:At.prototype.values,writable:!0,configurable:!0});function $i(s,d,v,R=1,C=()=>1){let V=Object.create(At.prototype);ul(V);let W=Object.create(Qr.prototype);return lh(V,W,s,d,v,R,C),V}o($i,"CreateReadableStream");function ph(s,d,v){let R=Object.create(At.prototype);ul(R);let C=Object.create(Yr.prototype);return Fm(R,C,s,d,v,0,void 0),R}o(ph,"CreateReadableByteStream");function ul(s){s._state="readable",s._reader=void 0,s._storedError=void 0,s._disturbed=!1}o(ul,"InitializeReadableStream");function Sn(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_readableStreamController")?!1:s instanceof At}o(Sn,"IsReadableStream");function Tn(s){return s._reader!==void 0}o(Tn,"IsReadableStreamLocked");function yr(s,d){if(s._disturbed=!0,s._state==="closed")return _(void 0);if(s._state==="errored")return P(s._storedError);Oi(s);let v=s._reader;if(v!==void 0&&Kn(v)){let C=v._readIntoRequests;v._readIntoRequests=new l,C.forEach(V=>{V._closeSteps(void 0)})}let R=s._readableStreamController[re](d);return $(R,e)}o(yr,"ReadableStreamCancel");function Oi(s){s._state="closed";let d=s._reader;if(d!==void 0&&(We(d),ue(d))){let v=d._readRequests;d._readRequests=new l,v.forEach(R=>{R._closeSteps()})}}o(Oi,"ReadableStreamClose");function fh(s,d){s._state="errored",s._storedError=d;let v=s._reader;v!==void 0&&(Ie(v,d),ue(v)?rt(v,d):Gm(v,d))}o(fh,"ReadableStreamError");function Qn(s){return new TypeError(`ReadableStream.prototype.${s} can only be used on a ReadableStream`)}o(Qn,"streamBrandCheckException$1");function mh(s,d){st(s,d);let v=s?.highWaterMark;return A(v,"highWaterMark","QueuingStrategyInit"),{highWaterMark:O(v)}}o(mh,"convertQueuingStrategyInit");let hh=o(s=>s.byteLength,"byteLengthSizeFunction");i(hh,"size");class pa{static{o(this,"ByteLengthQueuingStrategy")}constructor(d){Ze(d,1,"ByteLengthQueuingStrategy"),d=mh(d,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=d.highWaterMark}get highWaterMark(){if(!yh(this))throw gh("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!yh(this))throw gh("size");return hh}}Object.defineProperties(pa.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(pa.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function gh(s){return new TypeError(`ByteLengthQueuingStrategy.prototype.${s} can only be used on a ByteLengthQueuingStrategy`)}o(gh,"byteLengthBrandCheckException");function yh(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_byteLengthQueuingStrategyHighWaterMark")?!1:s instanceof pa}o(yh,"IsByteLengthQueuingStrategy");let vh=o(()=>1,"countSizeFunction");i(vh,"size");class fa{static{o(this,"CountQueuingStrategy")}constructor(d){Ze(d,1,"CountQueuingStrategy"),d=mh(d,"First parameter"),this._countQueuingStrategyHighWaterMark=d.highWaterMark}get highWaterMark(){if(!Ph(this))throw _h("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Ph(this))throw _h("size");return vh}}Object.defineProperties(fa.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(fa.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function _h(s){return new TypeError(`CountQueuingStrategy.prototype.${s} can only be used on a CountQueuingStrategy`)}o(_h,"countBrandCheckException");function Ph(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_countQueuingStrategyHighWaterMark")?!1:s instanceof fa}o(Ph,"IsCountQueuingStrategy");function CA(s,d){st(s,d);let v=s?.cancel,R=s?.flush,C=s?.readableType,V=s?.start,W=s?.transform,se=s?.writableType;return{cancel:v===void 0?void 0:kA(v,s,`${d} has member 'cancel' that`),flush:R===void 0?void 0:NA(R,s,`${d} has member 'flush' that`),readableType:C,start:V===void 0?void 0:zA(V,s,`${d} has member 'start' that`),transform:W===void 0?void 0:UA(W,s,`${d} has member 'transform' that`),writableType:se}}o(CA,"convertTransformer");function NA(s,d,v){return dt(s,v),R=>c(s,d,[R])}o(NA,"convertTransformerFlushCallback");function zA(s,d,v){return dt(s,v),R=>p(s,d,[R])}o(zA,"convertTransformerStartCallback");function UA(s,d,v){return dt(s,v),(R,C)=>c(s,d,[R,C])}o(UA,"convertTransformerTransformCallback");function kA(s,d,v){return dt(s,v),R=>c(s,d,[R])}o(kA,"convertTransformerCancelCallback");class ma{static{o(this,"TransformStream")}constructor(d={},v={},R={}){d===void 0&&(d=null);let C=ta(v,"Second parameter"),V=ta(R,"Third parameter"),W=CA(d,"First parameter");if(W.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(W.writableType!==void 0)throw new RangeError("Invalid writableType specified");let se=bi(V,0),ye=ea(V),fe=bi(C,1),Ee=ea(C),Ce,Qe=h(vr=>{Ce=vr});jA(this,Qe,fe,Ee,se,ye),FA(this,W),W.start!==void 0?Ce(W.start(this._transformStreamController)):Ce(void 0)}get readable(){if(!wh(this))throw Eh("readable");return this._readable}get writable(){if(!wh(this))throw Eh("writable");return this._writable}}Object.defineProperties(ma.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ma.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function jA(s,d,v,R,C,V){function W(){return d}o(W,"startAlgorithm");function se(Qe){return BA(s,Qe)}o(se,"writeAlgorithm");function ye(Qe){return VA(s,Qe)}o(ye,"abortAlgorithm");function fe(){return GA(s)}o(fe,"closeAlgorithm"),s._writable=qb(W,se,fe,ye,v,R);function Ee(){return HA(s)}o(Ee,"pullAlgorithm");function Ce(Qe){return WA(s,Qe)}o(Ce,"cancelAlgorithm"),s._readable=$i(W,Ee,Ce,C,V),s._backpressure=void 0,s._backpressureChangePromise=void 0,s._backpressureChangePromise_resolve=void 0,ha(s,!0),s._transformStreamController=void 0}o(jA,"InitializeTransformStream");function wh(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_transformStreamController")?!1:s instanceof ma}o(wh,"IsTransformStream");function xh(s,d){gr(s._readable._readableStreamController,d),cl(s,d)}o(xh,"TransformStreamError");function cl(s,d){ya(s._transformStreamController),Ai(s._writable._writableStreamController,d),ll(s)}o(cl,"TransformStreamErrorWritableAndUnblockWrite");function ll(s){s._backpressure&&ha(s,!1)}o(ll,"TransformStreamUnblockWrite");function ha(s,d){s._backpressureChangePromise!==void 0&&s._backpressureChangePromise_resolve(),s._backpressureChangePromise=h(v=>{s._backpressureChangePromise_resolve=v}),s._backpressure=d}o(ha,"TransformStreamSetBackpressure");class En{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ga(this))throw va("desiredSize");let d=this._controlledTransformStream._readable._readableStreamController;return al(d)}enqueue(d=void 0){if(!ga(this))throw va("enqueue");Sh(this,d)}error(d=void 0){if(!ga(this))throw va("error");LA(this,d)}terminate(){if(!ga(this))throw va("terminate");qA(this)}}Object.defineProperties(En.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(En.prototype.enqueue,"enqueue"),i(En.prototype.error,"error"),i(En.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(En.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function ga(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_controlledTransformStream")?!1:s instanceof En}o(ga,"IsTransformStreamDefaultController");function MA(s,d,v,R,C){d._controlledTransformStream=s,s._transformStreamController=d,d._transformAlgorithm=v,d._flushAlgorithm=R,d._cancelAlgorithm=C,d._finishPromise=void 0,d._finishPromise_resolve=void 0,d._finishPromise_reject=void 0}o(MA,"SetUpTransformStreamDefaultController");function FA(s,d){let v=Object.create(En.prototype),R,C,V;d.transform!==void 0?R=o(W=>d.transform(W,v),"transformAlgorithm"):R=o(W=>{try{return Sh(v,W),_(void 0)}catch(se){return P(se)}},"transformAlgorithm"),d.flush!==void 0?C=o(()=>d.flush(v),"flushAlgorithm"):C=o(()=>_(void 0),"flushAlgorithm"),d.cancel!==void 0?V=o(W=>d.cancel(W),"cancelAlgorithm"):V=o(()=>_(void 0),"cancelAlgorithm"),MA(s,v,R,C,V)}o(FA,"SetUpTransformStreamDefaultControllerFromTransformer");function ya(s){s._transformAlgorithm=void 0,s._flushAlgorithm=void 0,s._cancelAlgorithm=void 0}o(ya,"TransformStreamDefaultControllerClearAlgorithms");function Sh(s,d){let v=s._controlledTransformStream,R=v._readable._readableStreamController;if(!Io(R))throw new TypeError("Readable side is not in a state that permits enqueue");try{Ao(R,d)}catch(V){throw cl(v,V),v._readable._storedError}gA(R)!==v._backpressure&&ha(v,!0)}o(Sh,"TransformStreamDefaultControllerEnqueue");function LA(s,d){xh(s._controlledTransformStream,d)}o(LA,"TransformStreamDefaultControllerError");function Th(s,d){let v=s._transformAlgorithm(d);return $(v,void 0,R=>{throw xh(s._controlledTransformStream,R),R})}o(Th,"TransformStreamDefaultControllerPerformTransform");function qA(s){let d=s._controlledTransformStream,v=d._readable._readableStreamController;Xn(v);let R=new TypeError("TransformStream terminated");cl(d,R)}o(qA,"TransformStreamDefaultControllerTerminate");function BA(s,d){let v=s._transformStreamController;if(s._backpressure){let R=s._backpressureChangePromise;return $(R,()=>{let C=s._writable;if(C._state==="erroring")throw C._storedError;return Th(v,d)})}return Th(v,d)}o(BA,"TransformStreamDefaultSinkWriteAlgorithm");function VA(s,d){let v=s._transformStreamController;if(v._finishPromise!==void 0)return v._finishPromise;let R=s._readable;v._finishPromise=h((V,W)=>{v._finishPromise_resolve=V,v._finishPromise_reject=W});let C=v._cancelAlgorithm(d);return ya(v),S(C,()=>(R._state==="errored"?Ro(v,R._storedError):(gr(R._readableStreamController,d),dl(v)),null),V=>(gr(R._readableStreamController,V),Ro(v,V),null)),v._finishPromise}o(VA,"TransformStreamDefaultSinkAbortAlgorithm");function GA(s){let d=s._transformStreamController;if(d._finishPromise!==void 0)return d._finishPromise;let v=s._readable;d._finishPromise=h((C,V)=>{d._finishPromise_resolve=C,d._finishPromise_reject=V});let R=d._flushAlgorithm();return ya(d),S(R,()=>(v._state==="errored"?Ro(d,v._storedError):(Xn(v._readableStreamController),dl(d)),null),C=>(gr(v._readableStreamController,C),Ro(d,C),null)),d._finishPromise}o(GA,"TransformStreamDefaultSinkCloseAlgorithm");function HA(s){return ha(s,!1),s._backpressureChangePromise}o(HA,"TransformStreamDefaultSourcePullAlgorithm");function WA(s,d){let v=s._transformStreamController;if(v._finishPromise!==void 0)return v._finishPromise;let R=s._writable;v._finishPromise=h((V,W)=>{v._finishPromise_resolve=V,v._finishPromise_reject=W});let C=v._cancelAlgorithm(d);return ya(v),S(C,()=>(R._state==="errored"?Ro(v,R._storedError):(Ai(R._writableStreamController,d),ll(s),dl(v)),null),V=>(Ai(R._writableStreamController,V),ll(s),Ro(v,V),null)),v._finishPromise}o(WA,"TransformStreamDefaultSourceCancelAlgorithm");function va(s){return new TypeError(`TransformStreamDefaultController.prototype.${s} can only be used on a TransformStreamDefaultController`)}o(va,"defaultControllerBrandCheckException");function dl(s){s._finishPromise_resolve!==void 0&&(s._finishPromise_resolve(),s._finishPromise_resolve=void 0,s._finishPromise_reject=void 0)}o(dl,"defaultControllerFinishPromiseResolve");function Ro(s,d){s._finishPromise_reject!==void 0&&(b(s._finishPromise),s._finishPromise_reject(d),s._finishPromise_resolve=void 0,s._finishPromise_reject=void 0)}o(Ro,"defaultControllerFinishPromiseReject");function Eh(s){return new TypeError(`TransformStream.prototype.${s} can only be used on a TransformStream`)}o(Eh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=pa,t.CountQueuingStrategy=fa,t.ReadableByteStreamController=Yr,t.ReadableStream=At,t.ReadableStreamBYOBReader=wn,t.ReadableStreamBYOBRequest=Hn,t.ReadableStreamDefaultController=Qr,t.ReadableStreamDefaultReader=J,t.TransformStream=ma,t.TransformStreamDefaultController=En,t.WritableStream=xn,t.WritableStreamDefaultController=bo,t.WritableStreamDefaultWriter=Xr})});var DP=M(()=>{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,OP())}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(a){let m=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=m.byteLength,a.enqueue(new Uint8Array(m)),n===i.size&&a.close()}})},"name"))}catch{}});async function*Od(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 a=Math.min(i-n,CP),f=r.buffer.slice(n,n+a);n+=f.byteLength,yield new Uint8Array(f)}}else yield r;else{let n=0,i=r;for(;n!==i.size;){let f=await i.slice(n,Math.min(i.size,n+CP)).arrayBuffer();n+=f.byteLength,yield new Uint8Array(f)}}}var h9,CP,NP,_D,wr,ss=Pt(()=>{h9=ze(DP(),1);CP=65536;o(Od,"toIterator");NP=class Dd{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 a of e){let f;ArrayBuffer.isView(a)?f=new Uint8Array(a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength)):a instanceof ArrayBuffer?f=new Uint8Array(a.slice(0)):a instanceof Dd?f=a:f=n.encode(`${a}`),this.#r+=ArrayBuffer.isView(f)?f.byteLength:f.size,this.#e.push(f)}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 Od(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 Od(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Od(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,a=e<0?Math.max(i+e,0):Math.min(e,i),f=r<0?Math.max(i+r,0):Math.min(r,i),m=Math.max(f-a,0),h=this.#e,_=[],P=0;for(let S of h){if(P>=m)break;let w=ArrayBuffer.isView(S)?S.byteLength:S.size;if(a&&w<=a)a-=w,f-=w;else{let T;ArrayBuffer.isView(S)?(T=S.subarray(a,Math.min(w,f)),P+=T.byteLength):(T=S.slice(a,Math.min(w,f)),P+=T.size),f-=w,_.push(T),a=0}}let E=new Dd([],{type:String(n).toLowerCase()});return E.#r=m,E.#e=_,E}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(NP.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});_D=NP,wr=_D});var PD,wD,Un,Cd=Pt(()=>{ss();PD=class extends wr{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 wr&&/^(File)$/.test(e[Symbol.toStringTag])}},wD=PD,Un=wD});function kP(t,e=wr){var r=`${zP()}${zP()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
15
- Content-Disposition: form-data; name="`;return t.forEach((a,f)=>typeof a=="string"?n.push(i+Nd(f)+`"\r
10
+ `);if(T===-1){pu("have not received end of HTTP headers yet..."),s();return}let w=x.slice(0,T).toString("ascii").split(`\r
11
+ `),S=w.shift();if(!S)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let D=S.split(" "),E=+D[1],u=D.slice(2).join(" "),f={};for(let c of w){if(!c)continue;let y=c.indexOf(":");if(y===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${c}"`));let l=c.slice(0,y).toLowerCase(),b=c.slice(y+1).trimStart(),g=f[l];typeof g=="string"?f[l]=[g,b]:Array.isArray(g)?g.push(b):f[l]=b}pu("got proxy server response: %o %o",S,f),p(),e({connect:{statusCode:E,statusText:u,headers:f},buffered:x})}i(v,"ondata"),t.on("error",h),t.on("end",m),s()})}i(kN,"parseProxyResponse");eo.parseProxyResponse=kN});var BP=L(pr=>{"use strict";var zN=pr&&pr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UN=pr&&pr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jP=pr&&pr.__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)&&zN(e,t,r);return UN(e,t),e},qP=pr&&pr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pr,"__esModule",{value:!0});pr.HttpsProxyAgent=void 0;var fu=jP(require("net")),MP=jP(require("tls")),MN=qP(require("assert")),FN=qP(Nd()),LN=zP(),jN=require("url"),qN=UP(),ca=(0,FN.default)("https-proxy-agent"),FP=i(t=>t.servername===void 0&&t.host&&!fu.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),mu=class extends LN.Agent{static{i(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new jN.URL(e):e,this.proxyHeaders=r?.headers??{},ca("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?LP(r,"headers"):null,host:n,port:o}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let o;n.protocol==="https:"?(ca("Creating `tls.Socket`: %o",this.connectOpts),o=MP.connect(FP(this.connectOpts))):(ca("Creating `net.Socket`: %o",this.connectOpts),o=fu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},p=fu.isIPv6(r.host)?`[${r.host}]`:r.host,m=`CONNECT ${p}:${r.port} HTTP/1.1\r
12
+ `;if(n.username||n.password){let T=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(T).toString("base64")}`}s.Host=`${p}:${r.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let T of Object.keys(s))m+=`${T}: ${s[T]}\r
13
+ `;let h=(0,qN.parseProxyResponse)(o);o.write(`${m}\r
14
+ `);let{connect:v,buffered:P}=await h;if(e.emit("proxyConnect",v),this.emit("proxyConnect",v,e),v.statusCode===200)return e.once("socket",BN),r.secureEndpoint?(ca("Upgrading socket connection to TLS"),MP.connect({...LP(FP(r),"host","path","port"),socket:o})):o;o.destroy();let x=new fu.Socket({writable:!1});return x.readable=!0,e.once("socket",T=>{ca("Replaying proxy buffer for failed request"),(0,MN.default)(T.listenerCount("data")>0),T.push(P),T.push(null)}),x}};mu.protocols=["http","https"];pr.HttpsProxyAgent=mu;function BN(t){t.resume()}i(BN,"resume");function LP(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}i(LP,"omit")});function VN(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="",o=!1,s=r[0]||"text/plain",p=s;for(let P=1;P<r.length;P++)r[P]==="base64"?o=!0:r[P]&&(p+=`;${r[P]}`,r[P].indexOf("charset=")===0&&(n=r[P].substring(8)));!r[0]&&!n.length&&(p+=";charset=US-ASCII",n="US-ASCII");let m=o?"base64":"ascii",h=unescape(t.substring(e+1)),v=Buffer.from(h,m);return v.type=s,v.typeFull=p,v.charset=n,v}var VP,GP=St(()=>{i(VN,"dataUriToBuffer");VP=VN});var WP=L((hu,HP)=>{(function(t,e){typeof hu=="object"&&typeof HP<"u"?e(hu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(hu,(function(t){"use strict";function e(){}i(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}i(r,"typeIsObject");let n=e;function o(a,d){try{Object.defineProperty(a,"name",{value:d,configurable:!0})}catch{}}i(o,"setFunctionName");let s=Promise,p=Promise.prototype.then,m=Promise.reject.bind(s);function h(a){return new s(a)}i(h,"newPromise");function v(a){return h(d=>d(a))}i(v,"promiseResolvedWith");function P(a){return m(a)}i(P,"promiseRejectedWith");function x(a,d,_){return p.call(a,d,_)}i(x,"PerformPromiseThen");function T(a,d,_){x(x(a,d,_),void 0,n)}i(T,"uponPromise");function w(a,d){T(a,d)}i(w,"uponFulfillment");function S(a,d){T(a,void 0,d)}i(S,"uponRejection");function D(a,d,_){return x(a,d,_)}i(D,"transformPromiseWith");function E(a){x(a,void 0,n)}i(E,"setPromiseIsHandledToTrue");let u=i(a=>{if(typeof queueMicrotask=="function")u=queueMicrotask;else{let d=v(void 0);u=i(_=>x(d,_),"_queueMicrotask")}return u(a)},"_queueMicrotask");function f(a,d,_){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,d,_)}i(f,"reflectCall");function c(a,d,_){try{return v(f(a,d,_))}catch(R){return P(R)}}i(c,"promiseCall");let y=16384;class l{static{i(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(d){let _=this._back,R=_;_._elements.length===y-1&&(R={_elements:[],_next:void 0}),_._elements.push(d),R!==_&&(this._back=R,_._next=R),++this._size}shift(){let d=this._front,_=d,R=this._cursor,N=R+1,G=d._elements,Z=G[R];return N===y&&(_=d._next,N=0),--this._size,this._cursor=N,d!==_&&(this._front=_),G[R]=void 0,Z}forEach(d){let _=this._cursor,R=this._front,N=R._elements;for(;(_!==N.length||R._next!==void 0)&&!(_===N.length&&(R=R._next,N=R._elements,_=0,N.length===0));)d(N[_]),++_}peek(){let d=this._front,_=this._cursor;return d._elements[_]}}let b=Symbol("[[AbortSteps]]"),g=Symbol("[[ErrorSteps]]"),oe=Symbol("[[CancelSteps]]"),ne=Symbol("[[PullSteps]]"),Re=Symbol("[[ReleaseSteps]]");function se(a,d){a._ownerReadableStream=d,d._reader=a,d._state==="readable"?te(a):d._state==="closed"?de(a):ce(a,d._storedError)}i(se,"ReadableStreamReaderGenericInitialize");function Y(a,d){let _=a._ownerReadableStream;return _r(_,d)}i(Y,"ReadableStreamReaderGenericCancel");function K(a){let d=a._ownerReadableStream;d._state==="readable"?Oe(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):ze(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),d._readableStreamController[Re](),d._reader=void 0,a._ownerReadableStream=void 0}i(K,"ReadableStreamReaderGenericRelease");function re(a){return new TypeError("Cannot "+a+" a stream using a released reader")}i(re,"readerLockException");function te(a){a._closedPromise=h((d,_)=>{a._closedPromise_resolve=d,a._closedPromise_reject=_})}i(te,"defaultReaderClosedPromiseInitialize");function ce(a,d){te(a),Oe(a,d)}i(ce,"defaultReaderClosedPromiseInitializeAsRejected");function de(a){te(a),Ke(a)}i(de,"defaultReaderClosedPromiseInitializeAsResolved");function Oe(a,d){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(d),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}i(Oe,"defaultReaderClosedPromiseReject");function ze(a,d){ce(a,d)}i(ze,"defaultReaderClosedPromiseResetToRejected");function Ke(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}i(Ke,"defaultReaderClosedPromiseResolve");let Qe=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Tt=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function ie(a){return typeof a=="object"||typeof a=="function"}i(ie,"isDictionary");function ut(a,d){if(a!==void 0&&!ie(a))throw new TypeError(`${d} is not an object.`)}i(ut,"assertDictionary");function ft(a,d){if(typeof a!="function")throw new TypeError(`${d} is not a function.`)}i(ft,"assertFunction");function Vt(a){return typeof a=="object"&&a!==null||typeof a=="function"}i(Vt,"isObject");function Ze(a,d){if(!Vt(a))throw new TypeError(`${d} is not an object.`)}i(Ze,"assertObject");function Je(a,d,_){if(a===void 0)throw new TypeError(`Parameter ${d} is required in '${_}'.`)}i(Je,"assertRequiredArgument");function I(a,d,_){if(a===void 0)throw new TypeError(`${d} is required in '${_}'.`)}i(I,"assertRequiredField");function $(a){return Number(a)}i($,"convertUnrestrictedDouble");function O(a){return a===0?0:a}i(O,"censorNegativeZero");function q(a){return O(Tt(a))}i(q,"integerPart");function z(a,d){let R=Number.MAX_SAFE_INTEGER,N=Number(a);if(N=O(N),!Qe(N))throw new TypeError(`${d} is not a finite number`);if(N=q(N),N<0||N>R)throw new TypeError(`${d} is outside the accepted range of 0 to ${R}, inclusive`);return!Qe(N)||N===0?0:N}i(z,"convertUnsignedLongLongWithEnforceRange");function F(a,d){if(!In(a))throw new TypeError(`${d} is not a ReadableStream.`)}i(F,"assertReadableStream");function H(a){return new X(a)}i(H,"AcquireReadableStreamDefaultReader");function k(a,d){a._reader._readRequests.push(d)}i(k,"ReadableStreamAddReadRequest");function U(a,d,_){let N=a._reader._readRequests.shift();_?N._closeSteps():N._chunkSteps(d)}i(U,"ReadableStreamFulfillReadRequest");function V(a){return a._reader._readRequests.length}i(V,"ReadableStreamGetNumReadRequests");function j(a){let d=a._reader;return!(d===void 0||!pe(d))}i(j,"ReadableStreamHasDefaultReader");class X{static{i(this,"ReadableStreamDefaultReader")}constructor(d){if(Je(d,1,"ReadableStreamDefaultReader"),F(d,"First parameter"),An(d))throw new TypeError("This stream has already been locked for exclusive reading by another reader");se(this,d),this._readRequests=new l}get closed(){return pe(this)?this._closedPromise:P(it("closed"))}cancel(d=void 0){return pe(this)?this._ownerReadableStream===void 0?P(re("cancel")):Y(this,d):P(it("cancel"))}read(){if(!pe(this))return P(it("read"));if(this._ownerReadableStream===void 0)return P(re("read from"));let d,_,R=h((G,Z)=>{d=G,_=Z});return he(this,{_chunkSteps:i(G=>d({value:G,done:!1}),"_chunkSteps"),_closeSteps:i(()=>d({value:void 0,done:!0}),"_closeSteps"),_errorSteps:i(G=>_(G),"_errorSteps")}),R}releaseLock(){if(!pe(this))throw it("releaseLock");this._ownerReadableStream!==void 0&&Be(this)}}Object.defineProperties(X.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),o(X.prototype.cancel,"cancel"),o(X.prototype.read,"read"),o(X.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(X.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function pe(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof X}i(pe,"IsReadableStreamDefaultReader");function he(a,d){let _=a._ownerReadableStream;_._disturbed=!0,_._state==="closed"?d._closeSteps():_._state==="errored"?d._errorSteps(_._storedError):_._readableStreamController[ne](d)}i(he,"ReadableStreamDefaultReaderRead");function Be(a){K(a);let d=new TypeError("Reader was released");nt(a,d)}i(Be,"ReadableStreamDefaultReaderRelease");function nt(a,d){let _=a._readRequests;a._readRequests=new l,_.forEach(R=>{R._errorSteps(d)})}i(nt,"ReadableStreamDefaultReaderErrorReadRequests");function it(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}i(it,"defaultReaderBrandCheckException");let qe=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class He{static{i(this,"ReadableStreamAsyncIteratorImpl")}constructor(d,_){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=d,this._preventCancel=_}next(){let d=i(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?D(this._ongoingPromise,d,d):d(),this._ongoingPromise}return(d){let _=i(()=>this._returnSteps(d),"returnSteps");return this._ongoingPromise?D(this._ongoingPromise,_,_):_()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let d=this._reader,_,R,N=h((Z,le)=>{_=Z,R=le});return he(d,{_chunkSteps:i(Z=>{this._ongoingPromise=void 0,u(()=>_({value:Z,done:!1}))},"_chunkSteps"),_closeSteps:i(()=>{this._ongoingPromise=void 0,this._isFinished=!0,K(d),_({value:void 0,done:!0})},"_closeSteps"),_errorSteps:i(Z=>{this._ongoingPromise=void 0,this._isFinished=!0,K(d),R(Z)},"_errorSteps")}),N}_returnSteps(d){if(this._isFinished)return Promise.resolve({value:d,done:!0});this._isFinished=!0;let _=this._reader;if(!this._preventCancel){let R=Y(_,d);return K(_),D(R,()=>({value:d,done:!0}))}return K(_),v({value:d,done:!0})}}let vt={next(){return xi(this)?this._asyncIteratorImpl.next():P(Ei("next"))},return(a){return xi(this)?this._asyncIteratorImpl.return(a):P(Ei("return"))}};Object.setPrototypeOf(vt,qe);function Si(a,d){let _=H(a),R=new He(_,d),N=Object.create(vt);return N._asyncIteratorImpl=R,N}i(Si,"AcquireReadableStreamAsyncIterator");function xi(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof He}catch{return!1}}i(xi,"IsReadableStreamAsyncIterator");function Ei(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}i(Ei,"streamAsyncIteratorBrandCheckException");let Gt=Number.isNaN||function(a){return a!==a};var Qr,Rt,_t;function Ye(a){return a.slice()}i(Ye,"CreateArrayFromList");function $m(a,d,_,R,N){new Uint8Array(a).set(new Uint8Array(_,R,N),d)}i($m,"CopyDataBlockBytes");let en=i(a=>(typeof a.transfer=="function"?en=i(d=>d.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?en=i(d=>structuredClone(d,{transfer:[d]}),"TransferArrayBuffer"):en=i(d=>d,"TransferArrayBuffer"),en(a)),"TransferArrayBuffer"),Tn=i(a=>(typeof a.detached=="boolean"?Tn=i(d=>d.detached,"IsDetachedBuffer"):Tn=i(d=>d.byteLength===0,"IsDetachedBuffer"),Tn(a)),"IsDetachedBuffer");function Om(a,d,_){if(a.slice)return a.slice(d,_);let R=_-d,N=new ArrayBuffer(R);return $m(N,0,a,d,R),N}i(Om,"ArrayBufferSlice");function Ya(a,d){let _=a[d];if(_!=null){if(typeof _!="function")throw new TypeError(`${String(d)} is not a function`);return _}}i(Ya,"GetMethod");function OA(a){let d={[Symbol.iterator]:()=>a.iterator},_=(async function*(){return yield*d})(),R=_.next;return{iterator:_,nextMethod:R,done:!1}}i(OA,"CreateAsyncFromSyncIterator");let Gc=(_t=(Qr=Symbol.asyncIterator)!==null&&Qr!==void 0?Qr:(Rt=Symbol.for)===null||Rt===void 0?void 0:Rt.call(Symbol,"Symbol.asyncIterator"))!==null&&_t!==void 0?_t:"@@asyncIterator";function Cm(a,d="sync",_){if(_===void 0)if(d==="async"){if(_=Ya(a,Gc),_===void 0){let G=Ya(a,Symbol.iterator),Z=Cm(a,"sync",G);return OA(Z)}}else _=Ya(a,Symbol.iterator);if(_===void 0)throw new TypeError("The object is not iterable");let R=f(_,a,[]);if(!r(R))throw new TypeError("The iterator method must return an object");let N=R.next;return{iterator:R,nextMethod:N,done:!1}}i(Cm,"GetIterator");function CA(a){let d=f(a.nextMethod,a.iterator,[]);if(!r(d))throw new TypeError("The iterator.next() method must return an object");return d}i(CA,"IteratorNext");function NA(a){return!!a.done}i(NA,"IteratorComplete");function kA(a){return a.value}i(kA,"IteratorValue");function zA(a){return!(typeof a!="number"||Gt(a)||a<0)}i(zA,"IsNonNegativeNumber");function Nm(a){let d=Om(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(d)}i(Nm,"CloneAsUint8Array");function Hc(a){let d=a._queue.shift();return a._queueTotalSize-=d.size,a._queueTotalSize<0&&(a._queueTotalSize=0),d.value}i(Hc,"DequeueValue");function Wc(a,d,_){if(!zA(_)||_===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:d,size:_}),a._queueTotalSize+=_}i(Wc,"EnqueueValueWithSize");function UA(a){return a._queue.peek().value}i(UA,"PeekQueueValue");function Sn(a){a._queue=new l,a._queueTotalSize=0}i(Sn,"ResetQueue");function km(a){return a===DataView}i(km,"isDataViewConstructor");function MA(a){return km(a.constructor)}i(MA,"isDataView");function FA(a){return km(a)?1:a.BYTES_PER_ELEMENT}i(FA,"arrayBufferViewElementSize");class Xn{static{i(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Zc(this))throw Qc("view");return this._view}respond(d){if(!Zc(this))throw Qc("respond");if(Je(d,1,"respond"),d=z(d,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Tn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");ts(this._associatedReadableByteStreamController,d)}respondWithNewView(d){if(!Zc(this))throw Qc("respondWithNewView");if(Je(d,1,"respondWithNewView"),!ArrayBuffer.isView(d))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(Tn(d.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");rs(this._associatedReadableByteStreamController,d)}}Object.defineProperties(Xn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),o(Xn.prototype.respond,"respond"),o(Xn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Xn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class tn{static{i(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Qn(this))throw Ao("byobRequest");return Xc(this)}get desiredSize(){if(!Qn(this))throw Ao("desiredSize");return Gm(this)}close(){if(!Qn(this))throw Ao("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let d=this._controlledReadableByteStream._state;if(d!=="readable")throw new TypeError(`The stream (in ${d} state) is not in the readable state and cannot be closed`);Io(this)}enqueue(d){if(!Qn(this))throw Ao("enqueue");if(Je(d,1,"enqueue"),!ArrayBuffer.isView(d))throw new TypeError("chunk must be an array buffer view");if(d.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(d.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 _=this._controlledReadableByteStream._state;if(_!=="readable")throw new TypeError(`The stream (in ${_} state) is not in the readable state and cannot be enqueued to`);es(this,d)}error(d=void 0){if(!Qn(this))throw Ao("error");sr(this,d)}[oe](d){zm(this),Sn(this);let _=this._cancelAlgorithm(d);return Qa(this),_}[ne](d){let _=this._controlledReadableByteStream;if(this._queueTotalSize>0){Vm(this,d);return}let R=this._autoAllocateChunkSize;if(R!==void 0){let N;try{N=new ArrayBuffer(R)}catch(Z){d._errorSteps(Z);return}let G={buffer:N,bufferByteLength:R,byteOffset:0,byteLength:R,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(G)}k(_,d),ei(this)}[Re](){if(this._pendingPullIntos.length>0){let d=this._pendingPullIntos.peek();d.readerType="none",this._pendingPullIntos=new l,this._pendingPullIntos.push(d)}}}Object.defineProperties(tn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),o(tn.prototype.close,"close"),o(tn.prototype.enqueue,"enqueue"),o(tn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(tn.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Qn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof tn}i(Qn,"IsReadableByteStreamController");function Zc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof Xn}i(Zc,"IsReadableStreamBYOBRequest");function ei(a){if(!VA(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let _=a._pullAlgorithm();T(_,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,ei(a)),null),R=>(sr(a,R),null))}i(ei,"ReadableByteStreamControllerCallPullIfNeeded");function zm(a){Jc(a),a._pendingPullIntos=new l}i(zm,"ReadableByteStreamControllerClearPendingPullIntos");function Kc(a,d){let _=!1;a._state==="closed"&&(_=!0);let R=Um(d);d.readerType==="default"?U(a,R,_):JA(a,R,_)}i(Kc,"ReadableByteStreamControllerCommitPullIntoDescriptor");function Um(a){let d=a.bytesFilled,_=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,d/_)}i(Um,"ReadableByteStreamControllerConvertPullIntoDescriptor");function Xa(a,d,_,R){a._queue.push({buffer:d,byteOffset:_,byteLength:R}),a._queueTotalSize+=R}i(Xa,"ReadableByteStreamControllerEnqueueChunkToQueue");function Mm(a,d,_,R){let N;try{N=Om(d,_,_+R)}catch(G){throw sr(a,G),G}Xa(a,N,0,R)}i(Mm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Fm(a,d){d.bytesFilled>0&&Mm(a,d.buffer,d.byteOffset,d.bytesFilled),Ii(a)}i(Fm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function Lm(a,d){let _=Math.min(a._queueTotalSize,d.byteLength-d.bytesFilled),R=d.bytesFilled+_,N=_,G=!1,Z=R%d.elementSize,le=R-Z;le>=d.minimumFill&&(N=le-d.bytesFilled,G=!0);let we=a._queue;for(;N>0;){let ye=we.peek(),De=Math.min(N,ye.byteLength),Ue=d.byteOffset+d.bytesFilled;$m(d.buffer,Ue,ye.buffer,ye.byteOffset,De),ye.byteLength===De?we.shift():(ye.byteOffset+=De,ye.byteLength-=De),a._queueTotalSize-=De,jm(a,De,d),N-=De}return G}i(Lm,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function jm(a,d,_){_.bytesFilled+=d}i(jm,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function qm(a){a._queueTotalSize===0&&a._closeRequested?(Qa(a),No(a._controlledReadableByteStream)):ei(a)}i(qm,"ReadableByteStreamControllerHandleQueueDrain");function Jc(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}i(Jc,"ReadableByteStreamControllerInvalidateBYOBRequest");function Yc(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let d=a._pendingPullIntos.peek();Lm(a,d)&&(Ii(a),Kc(a._controlledReadableByteStream,d))}}i(Yc,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function LA(a){let d=a._controlledReadableByteStream._reader;for(;d._readRequests.length>0;){if(a._queueTotalSize===0)return;let _=d._readRequests.shift();Vm(a,_)}}i(LA,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function jA(a,d,_,R){let N=a._controlledReadableByteStream,G=d.constructor,Z=FA(G),{byteOffset:le,byteLength:we}=d,ye=_*Z,De;try{De=en(d.buffer)}catch(et){R._errorSteps(et);return}let Ue={buffer:De,bufferByteLength:De.byteLength,byteOffset:le,byteLength:we,bytesFilled:0,minimumFill:ye,elementSize:Z,viewConstructor:G,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(Ue),Zm(N,R);return}if(N._state==="closed"){let et=new G(Ue.buffer,Ue.byteOffset,0);R._closeSteps(et);return}if(a._queueTotalSize>0){if(Lm(a,Ue)){let et=Um(Ue);qm(a),R._chunkSteps(et);return}if(a._closeRequested){let et=new TypeError("Insufficient bytes to fill elements in the given buffer");sr(a,et),R._errorSteps(et);return}}a._pendingPullIntos.push(Ue),Zm(N,R),ei(a)}i(jA,"ReadableByteStreamControllerPullInto");function qA(a,d){d.readerType==="none"&&Ii(a);let _=a._controlledReadableByteStream;if(el(_))for(;Km(_)>0;){let R=Ii(a);Kc(_,R)}}i(qA,"ReadableByteStreamControllerRespondInClosedState");function BA(a,d,_){if(jm(a,d,_),_.readerType==="none"){Fm(a,_),Yc(a);return}if(_.bytesFilled<_.minimumFill)return;Ii(a);let R=_.bytesFilled%_.elementSize;if(R>0){let N=_.byteOffset+_.bytesFilled;Mm(a,_.buffer,N-R,R)}_.bytesFilled-=R,Kc(a._controlledReadableByteStream,_),Yc(a)}i(BA,"ReadableByteStreamControllerRespondInReadableState");function Bm(a,d){let _=a._pendingPullIntos.peek();Jc(a),a._controlledReadableByteStream._state==="closed"?qA(a,_):BA(a,d,_),ei(a)}i(Bm,"ReadableByteStreamControllerRespondInternal");function Ii(a){return a._pendingPullIntos.shift()}i(Ii,"ReadableByteStreamControllerShiftPendingPullInto");function VA(a){let d=a._controlledReadableByteStream;return d._state!=="readable"||a._closeRequested||!a._started?!1:!!(j(d)&&V(d)>0||el(d)&&Km(d)>0||Gm(a)>0)}i(VA,"ReadableByteStreamControllerShouldCallPull");function Qa(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}i(Qa,"ReadableByteStreamControllerClearAlgorithms");function Io(a){let d=a._controlledReadableByteStream;if(!(a._closeRequested||d._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let _=a._pendingPullIntos.peek();if(_.bytesFilled%_.elementSize!==0){let R=new TypeError("Insufficient bytes to fill elements in the given buffer");throw sr(a,R),R}}Qa(a),No(d)}}i(Io,"ReadableByteStreamControllerClose");function es(a,d){let _=a._controlledReadableByteStream;if(a._closeRequested||_._state!=="readable")return;let{buffer:R,byteOffset:N,byteLength:G}=d;if(Tn(R))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let Z=en(R);if(a._pendingPullIntos.length>0){let le=a._pendingPullIntos.peek();if(Tn(le.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Jc(a),le.buffer=en(le.buffer),le.readerType==="none"&&Fm(a,le)}if(j(_))if(LA(a),V(_)===0)Xa(a,Z,N,G);else{a._pendingPullIntos.length>0&&Ii(a);let le=new Uint8Array(Z,N,G);U(_,le,!1)}else el(_)?(Xa(a,Z,N,G),Yc(a)):Xa(a,Z,N,G);ei(a)}i(es,"ReadableByteStreamControllerEnqueue");function sr(a,d){let _=a._controlledReadableByteStream;_._state==="readable"&&(zm(a),Sn(a),Qa(a),_h(_,d))}i(sr,"ReadableByteStreamControllerError");function Vm(a,d){let _=a._queue.shift();a._queueTotalSize-=_.byteLength,qm(a);let R=new Uint8Array(_.buffer,_.byteOffset,_.byteLength);d._chunkSteps(R)}i(Vm,"ReadableByteStreamControllerFillReadRequestFromQueue");function Xc(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let d=a._pendingPullIntos.peek(),_=new Uint8Array(d.buffer,d.byteOffset+d.bytesFilled,d.byteLength-d.bytesFilled),R=Object.create(Xn.prototype);HA(R,a,_),a._byobRequest=R}return a._byobRequest}i(Xc,"ReadableByteStreamControllerGetBYOBRequest");function Gm(a){let d=a._controlledReadableByteStream._state;return d==="errored"?null:d==="closed"?0:a._strategyHWM-a._queueTotalSize}i(Gm,"ReadableByteStreamControllerGetDesiredSize");function ts(a,d){let _=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(d!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(d===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(_.bytesFilled+d>_.byteLength)throw new RangeError("bytesWritten out of range")}_.buffer=en(_.buffer),Bm(a,d)}i(ts,"ReadableByteStreamControllerRespond");function rs(a,d){let _=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(d.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(d.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(_.byteOffset+_.bytesFilled!==d.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(_.bufferByteLength!==d.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(_.bytesFilled+d.byteLength>_.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let N=d.byteLength;_.buffer=en(d.buffer),Bm(a,N)}i(rs,"ReadableByteStreamControllerRespondWithNewView");function Hm(a,d,_,R,N,G,Z){d._controlledReadableByteStream=a,d._pullAgain=!1,d._pulling=!1,d._byobRequest=null,d._queue=d._queueTotalSize=void 0,Sn(d),d._closeRequested=!1,d._started=!1,d._strategyHWM=G,d._pullAlgorithm=R,d._cancelAlgorithm=N,d._autoAllocateChunkSize=Z,d._pendingPullIntos=new l,a._readableStreamController=d;let le=_();T(v(le),()=>(d._started=!0,ei(d),null),we=>(sr(d,we),null))}i(Hm,"SetUpReadableByteStreamController");function GA(a,d,_){let R=Object.create(tn.prototype),N,G,Z;d.start!==void 0?N=i(()=>d.start(R),"startAlgorithm"):N=i(()=>{},"startAlgorithm"),d.pull!==void 0?G=i(()=>d.pull(R),"pullAlgorithm"):G=i(()=>v(void 0),"pullAlgorithm"),d.cancel!==void 0?Z=i(we=>d.cancel(we),"cancelAlgorithm"):Z=i(()=>v(void 0),"cancelAlgorithm");let le=d.autoAllocateChunkSize;if(le===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Hm(a,R,N,G,Z,_,le)}i(GA,"SetUpReadableByteStreamControllerFromUnderlyingSource");function HA(a,d,_){a._associatedReadableByteStreamController=d,a._view=_}i(HA,"SetUpReadableStreamBYOBRequest");function Qc(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}i(Qc,"byobRequestBrandCheckException");function Ao(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}i(Ao,"byteStreamControllerBrandCheckException");function WA(a,d){ut(a,d);let _=a?.mode;return{mode:_===void 0?void 0:ZA(_,`${d} has member 'mode' that`)}}i(WA,"convertReaderOptions");function ZA(a,d){if(a=`${a}`,a!=="byob")throw new TypeError(`${d} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}i(ZA,"convertReadableStreamReaderMode");function KA(a,d){var _;ut(a,d);let R=(_=a?.min)!==null&&_!==void 0?_:1;return{min:z(R,`${d} has member 'min' that`)}}i(KA,"convertByobReadOptions");function Wm(a){return new xn(a)}i(Wm,"AcquireReadableStreamBYOBReader");function Zm(a,d){a._reader._readIntoRequests.push(d)}i(Zm,"ReadableStreamAddReadIntoRequest");function JA(a,d,_){let N=a._reader._readIntoRequests.shift();_?N._closeSteps(d):N._chunkSteps(d)}i(JA,"ReadableStreamFulfillReadIntoRequest");function Km(a){return a._reader._readIntoRequests.length}i(Km,"ReadableStreamGetNumReadIntoRequests");function el(a){let d=a._reader;return!(d===void 0||!ti(d))}i(el,"ReadableStreamHasBYOBReader");class xn{static{i(this,"ReadableStreamBYOBReader")}constructor(d){if(Je(d,1,"ReadableStreamBYOBReader"),F(d,"First parameter"),An(d))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Qn(d._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");se(this,d),this._readIntoRequests=new l}get closed(){return ti(this)?this._closedPromise:P(ns("closed"))}cancel(d=void 0){return ti(this)?this._ownerReadableStream===void 0?P(re("cancel")):Y(this,d):P(ns("cancel"))}read(d,_={}){if(!ti(this))return P(ns("read"));if(!ArrayBuffer.isView(d))return P(new TypeError("view must be an array buffer view"));if(d.byteLength===0)return P(new TypeError("view must have non-zero byteLength"));if(d.buffer.byteLength===0)return P(new TypeError("view's buffer must have non-zero byteLength"));if(Tn(d.buffer))return P(new TypeError("view's buffer has been detached"));let R;try{R=KA(_,"options")}catch(ye){return P(ye)}let N=R.min;if(N===0)return P(new TypeError("options.min must be greater than 0"));if(MA(d)){if(N>d.byteLength)return P(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(N>d.length)return P(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return P(re("read from"));let G,Z,le=h((ye,De)=>{G=ye,Z=De});return Jm(this,d,N,{_chunkSteps:i(ye=>G({value:ye,done:!1}),"_chunkSteps"),_closeSteps:i(ye=>G({value:ye,done:!0}),"_closeSteps"),_errorSteps:i(ye=>Z(ye),"_errorSteps")}),le}releaseLock(){if(!ti(this))throw ns("releaseLock");this._ownerReadableStream!==void 0&&YA(this)}}Object.defineProperties(xn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),o(xn.prototype.cancel,"cancel"),o(xn.prototype.read,"read"),o(xn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(xn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function ti(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof xn}i(ti,"IsReadableStreamBYOBReader");function Jm(a,d,_,R){let N=a._ownerReadableStream;N._disturbed=!0,N._state==="errored"?R._errorSteps(N._storedError):jA(N._readableStreamController,d,_,R)}i(Jm,"ReadableStreamBYOBReaderRead");function YA(a){K(a);let d=new TypeError("Reader was released");Ym(a,d)}i(YA,"ReadableStreamBYOBReaderRelease");function Ym(a,d){let _=a._readIntoRequests;a._readIntoRequests=new l,_.forEach(R=>{R._errorSteps(d)})}i(Ym,"ReadableStreamBYOBReaderErrorReadIntoRequests");function ns(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}i(ns,"byobReaderBrandCheckException");function Ro(a,d){let{highWaterMark:_}=a;if(_===void 0)return d;if(Gt(_)||_<0)throw new RangeError("Invalid highWaterMark");return _}i(Ro,"ExtractHighWaterMark");function is(a){let{size:d}=a;return d||(()=>1)}i(is,"ExtractSizeAlgorithm");function os(a,d){ut(a,d);let _=a?.highWaterMark,R=a?.size;return{highWaterMark:_===void 0?void 0:$(_),size:R===void 0?void 0:XA(R,`${d} has member 'size' that`)}}i(os,"convertQueuingStrategy");function XA(a,d){return ft(a,d),_=>$(a(_))}i(XA,"convertQueuingStrategySize");function QA(a,d){ut(a,d);let _=a?.abort,R=a?.close,N=a?.start,G=a?.type,Z=a?.write;return{abort:_===void 0?void 0:eR(_,a,`${d} has member 'abort' that`),close:R===void 0?void 0:tR(R,a,`${d} has member 'close' that`),start:N===void 0?void 0:rR(N,a,`${d} has member 'start' that`),write:Z===void 0?void 0:nR(Z,a,`${d} has member 'write' that`),type:G}}i(QA,"convertUnderlyingSink");function eR(a,d,_){return ft(a,_),R=>c(a,d,[R])}i(eR,"convertUnderlyingSinkAbortCallback");function tR(a,d,_){return ft(a,_),()=>c(a,d,[])}i(tR,"convertUnderlyingSinkCloseCallback");function rR(a,d,_){return ft(a,_),R=>f(a,d,[R])}i(rR,"convertUnderlyingSinkStartCallback");function nR(a,d,_){return ft(a,_),(R,N)=>c(a,d,[R,N])}i(nR,"convertUnderlyingSinkWriteCallback");function Xm(a,d){if(!Ai(a))throw new TypeError(`${d} is not a WritableStream.`)}i(Xm,"assertWritableStream");function iR(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}i(iR,"isAbortSignal");let oR=typeof AbortController=="function";function aR(){if(oR)return new AbortController}i(aR,"createAbortController");class En{static{i(this,"WritableStream")}constructor(d={},_={}){d===void 0?d=null:Ze(d,"First parameter");let R=os(_,"Second parameter"),N=QA(d,"First parameter");if(eh(this),N.type!==void 0)throw new RangeError("Invalid type is specified");let Z=is(R),le=Ro(R,1);PR(this,N,le,Z)}get locked(){if(!Ai(this))throw ls("locked");return Ri(this)}abort(d=void 0){return Ai(this)?Ri(this)?P(new TypeError("Cannot abort a stream that already has a writer")):as(this,d):P(ls("abort"))}close(){return Ai(this)?Ri(this)?P(new TypeError("Cannot close a stream that already has a writer")):Or(this)?P(new TypeError("Cannot close an already-closing stream")):th(this):P(ls("close"))}getWriter(){if(!Ai(this))throw ls("getWriter");return Qm(this)}}Object.defineProperties(En.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),o(En.prototype.abort,"abort"),o(En.prototype.close,"close"),o(En.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(En.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function Qm(a){return new rn(a)}i(Qm,"AcquireWritableStreamDefaultWriter");function sR(a,d,_,R,N=1,G=()=>1){let Z=Object.create(En.prototype);eh(Z);let le=Object.create(Di.prototype);return sh(Z,le,a,d,_,R,N,G),Z}i(sR,"CreateWritableStream");function eh(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new l,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}i(eh,"InitializeWritableStream");function Ai(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof En}i(Ai,"IsWritableStream");function Ri(a){return a._writer!==void 0}i(Ri,"IsWritableStreamLocked");function as(a,d){var _;if(a._state==="closed"||a._state==="errored")return v(void 0);a._writableStreamController._abortReason=d,(_=a._writableStreamController._abortController)===null||_===void 0||_.abort(d);let R=a._state;if(R==="closed"||R==="errored")return v(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let N=!1;R==="erroring"&&(N=!0,d=void 0);let G=h((Z,le)=>{a._pendingAbortRequest={_promise:void 0,_resolve:Z,_reject:le,_reason:d,_wasAlreadyErroring:N}});return a._pendingAbortRequest._promise=G,N||rl(a,d),G}i(as,"WritableStreamAbort");function th(a){let d=a._state;if(d==="closed"||d==="errored")return P(new TypeError(`The stream (in ${d} state) is not in the writable state and cannot be closed`));let _=h((N,G)=>{let Z={_resolve:N,_reject:G};a._closeRequest=Z}),R=a._writer;return R!==void 0&&a._backpressure&&d==="writable"&&ll(R),wR(a._writableStreamController),_}i(th,"WritableStreamClose");function uR(a){return h((_,R)=>{let N={_resolve:_,_reject:R};a._writeRequests.push(N)})}i(uR,"WritableStreamAddWriteRequest");function tl(a,d){if(a._state==="writable"){rl(a,d);return}nl(a)}i(tl,"WritableStreamDealWithRejection");function rl(a,d){let _=a._writableStreamController;a._state="erroring",a._storedError=d;let R=a._writer;R!==void 0&&nh(R,d),!fR(a)&&_._started&&nl(a)}i(rl,"WritableStreamStartErroring");function nl(a){a._state="errored",a._writableStreamController[g]();let d=a._storedError;if(a._writeRequests.forEach(N=>{N._reject(d)}),a._writeRequests=new l,a._pendingAbortRequest===void 0){ss(a);return}let _=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,_._wasAlreadyErroring){_._reject(d),ss(a);return}let R=a._writableStreamController[b](_._reason);T(R,()=>(_._resolve(),ss(a),null),N=>(_._reject(N),ss(a),null))}i(nl,"WritableStreamFinishErroring");function cR(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}i(cR,"WritableStreamFinishInFlightWrite");function lR(a,d){a._inFlightWriteRequest._reject(d),a._inFlightWriteRequest=void 0,tl(a,d)}i(lR,"WritableStreamFinishInFlightWriteWithError");function dR(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 _=a._writer;_!==void 0&&dh(_)}i(dR,"WritableStreamFinishInFlightClose");function pR(a,d){a._inFlightCloseRequest._reject(d),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(d),a._pendingAbortRequest=void 0),tl(a,d)}i(pR,"WritableStreamFinishInFlightCloseWithError");function Or(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}i(Or,"WritableStreamCloseQueuedOrInFlight");function fR(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}i(fR,"WritableStreamHasOperationMarkedInFlight");function mR(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}i(mR,"WritableStreamMarkCloseRequestInFlight");function hR(a){a._inFlightWriteRequest=a._writeRequests.shift()}i(hR,"WritableStreamMarkFirstWriteRequestInFlight");function ss(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let d=a._writer;d!==void 0&&ul(d,a._storedError)}i(ss,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function il(a,d){let _=a._writer;_!==void 0&&d!==a._backpressure&&(d?AR(_):ll(_)),a._backpressure=d}i(il,"WritableStreamUpdateBackpressure");class rn{static{i(this,"WritableStreamDefaultWriter")}constructor(d){if(Je(d,1,"WritableStreamDefaultWriter"),Xm(d,"First parameter"),Ri(d))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=d,d._writer=this;let _=d._state;if(_==="writable")!Or(d)&&d._backpressure?ps(this):ph(this),ds(this);else if(_==="erroring")cl(this,d._storedError),ds(this);else if(_==="closed")ph(this),ER(this);else{let R=d._storedError;cl(this,R),lh(this,R)}}get closed(){return ri(this)?this._closedPromise:P(ni("closed"))}get desiredSize(){if(!ri(this))throw ni("desiredSize");if(this._ownerWritableStream===void 0)throw $o("desiredSize");return _R(this)}get ready(){return ri(this)?this._readyPromise:P(ni("ready"))}abort(d=void 0){return ri(this)?this._ownerWritableStream===void 0?P($o("abort")):gR(this,d):P(ni("abort"))}close(){if(!ri(this))return P(ni("close"));let d=this._ownerWritableStream;return d===void 0?P($o("close")):Or(d)?P(new TypeError("Cannot close an already-closing stream")):rh(this)}releaseLock(){if(!ri(this))throw ni("releaseLock");this._ownerWritableStream!==void 0&&ih(this)}write(d=void 0){return ri(this)?this._ownerWritableStream===void 0?P($o("write to")):oh(this,d):P(ni("write"))}}Object.defineProperties(rn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),o(rn.prototype.abort,"abort"),o(rn.prototype.close,"close"),o(rn.prototype.releaseLock,"releaseLock"),o(rn.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(rn.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function ri(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof rn}i(ri,"IsWritableStreamDefaultWriter");function gR(a,d){let _=a._ownerWritableStream;return as(_,d)}i(gR,"WritableStreamDefaultWriterAbort");function rh(a){let d=a._ownerWritableStream;return th(d)}i(rh,"WritableStreamDefaultWriterClose");function yR(a){let d=a._ownerWritableStream,_=d._state;return Or(d)||_==="closed"?v(void 0):_==="errored"?P(d._storedError):rh(a)}i(yR,"WritableStreamDefaultWriterCloseWithErrorPropagation");function vR(a,d){a._closedPromiseState==="pending"?ul(a,d):IR(a,d)}i(vR,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function nh(a,d){a._readyPromiseState==="pending"?fh(a,d):RR(a,d)}i(nh,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function _R(a){let d=a._ownerWritableStream,_=d._state;return _==="errored"||_==="erroring"?null:_==="closed"?0:uh(d._writableStreamController)}i(_R,"WritableStreamDefaultWriterGetDesiredSize");function ih(a){let d=a._ownerWritableStream,_=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");nh(a,_),vR(a,_),d._writer=void 0,a._ownerWritableStream=void 0}i(ih,"WritableStreamDefaultWriterRelease");function oh(a,d){let _=a._ownerWritableStream,R=_._writableStreamController,N=bR(R,d);if(_!==a._ownerWritableStream)return P($o("write to"));let G=_._state;if(G==="errored")return P(_._storedError);if(Or(_)||G==="closed")return P(new TypeError("The stream is closing or closed and cannot be written to"));if(G==="erroring")return P(_._storedError);let Z=uR(_);return TR(R,d,N),Z}i(oh,"WritableStreamDefaultWriterWrite");let ah={};class Di{static{i(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!ol(this))throw sl("abortReason");return this._abortReason}get signal(){if(!ol(this))throw sl("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(d=void 0){if(!ol(this))throw sl("error");this._controlledWritableStream._state==="writable"&&ch(this,d)}[b](d){let _=this._abortAlgorithm(d);return us(this),_}[g](){Sn(this)}}Object.defineProperties(Di.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Di.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function ol(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Di}i(ol,"IsWritableStreamDefaultController");function sh(a,d,_,R,N,G,Z,le){d._controlledWritableStream=a,a._writableStreamController=d,d._queue=void 0,d._queueTotalSize=void 0,Sn(d),d._abortReason=void 0,d._abortController=aR(),d._started=!1,d._strategySizeAlgorithm=le,d._strategyHWM=Z,d._writeAlgorithm=R,d._closeAlgorithm=N,d._abortAlgorithm=G;let we=al(d);il(a,we);let ye=_(),De=v(ye);T(De,()=>(d._started=!0,cs(d),null),Ue=>(d._started=!0,tl(a,Ue),null))}i(sh,"SetUpWritableStreamDefaultController");function PR(a,d,_,R){let N=Object.create(Di.prototype),G,Z,le,we;d.start!==void 0?G=i(()=>d.start(N),"startAlgorithm"):G=i(()=>{},"startAlgorithm"),d.write!==void 0?Z=i(ye=>d.write(ye,N),"writeAlgorithm"):Z=i(()=>v(void 0),"writeAlgorithm"),d.close!==void 0?le=i(()=>d.close(),"closeAlgorithm"):le=i(()=>v(void 0),"closeAlgorithm"),d.abort!==void 0?we=i(ye=>d.abort(ye),"abortAlgorithm"):we=i(()=>v(void 0),"abortAlgorithm"),sh(a,N,G,Z,le,we,_,R)}i(PR,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function us(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}i(us,"WritableStreamDefaultControllerClearAlgorithms");function wR(a){Wc(a,ah,0),cs(a)}i(wR,"WritableStreamDefaultControllerClose");function bR(a,d){try{return a._strategySizeAlgorithm(d)}catch(_){return Do(a,_),1}}i(bR,"WritableStreamDefaultControllerGetChunkSize");function uh(a){return a._strategyHWM-a._queueTotalSize}i(uh,"WritableStreamDefaultControllerGetDesiredSize");function TR(a,d,_){try{Wc(a,d,_)}catch(N){Do(a,N);return}let R=a._controlledWritableStream;if(!Or(R)&&R._state==="writable"){let N=al(a);il(R,N)}cs(a)}i(TR,"WritableStreamDefaultControllerWrite");function cs(a){let d=a._controlledWritableStream;if(!a._started||d._inFlightWriteRequest!==void 0)return;if(d._state==="erroring"){nl(d);return}if(a._queue.length===0)return;let R=UA(a);R===ah?SR(a):xR(a,R)}i(cs,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Do(a,d){a._controlledWritableStream._state==="writable"&&ch(a,d)}i(Do,"WritableStreamDefaultControllerErrorIfNeeded");function SR(a){let d=a._controlledWritableStream;mR(d),Hc(a);let _=a._closeAlgorithm();us(a),T(_,()=>(dR(d),null),R=>(pR(d,R),null))}i(SR,"WritableStreamDefaultControllerProcessClose");function xR(a,d){let _=a._controlledWritableStream;hR(_);let R=a._writeAlgorithm(d);T(R,()=>{cR(_);let N=_._state;if(Hc(a),!Or(_)&&N==="writable"){let G=al(a);il(_,G)}return cs(a),null},N=>(_._state==="writable"&&us(a),lR(_,N),null))}i(xR,"WritableStreamDefaultControllerProcessWrite");function al(a){return uh(a)<=0}i(al,"WritableStreamDefaultControllerGetBackpressure");function ch(a,d){let _=a._controlledWritableStream;us(a),rl(_,d)}i(ch,"WritableStreamDefaultControllerError");function ls(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}i(ls,"streamBrandCheckException$2");function sl(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}i(sl,"defaultControllerBrandCheckException$2");function ni(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}i(ni,"defaultWriterBrandCheckException");function $o(a){return new TypeError("Cannot "+a+" a stream using a released writer")}i($o,"defaultWriterLockException");function ds(a){a._closedPromise=h((d,_)=>{a._closedPromise_resolve=d,a._closedPromise_reject=_,a._closedPromiseState="pending"})}i(ds,"defaultWriterClosedPromiseInitialize");function lh(a,d){ds(a),ul(a,d)}i(lh,"defaultWriterClosedPromiseInitializeAsRejected");function ER(a){ds(a),dh(a)}i(ER,"defaultWriterClosedPromiseInitializeAsResolved");function ul(a,d){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(d),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}i(ul,"defaultWriterClosedPromiseReject");function IR(a,d){lh(a,d)}i(IR,"defaultWriterClosedPromiseResetToRejected");function dh(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="resolved")}i(dh,"defaultWriterClosedPromiseResolve");function ps(a){a._readyPromise=h((d,_)=>{a._readyPromise_resolve=d,a._readyPromise_reject=_}),a._readyPromiseState="pending"}i(ps,"defaultWriterReadyPromiseInitialize");function cl(a,d){ps(a),fh(a,d)}i(cl,"defaultWriterReadyPromiseInitializeAsRejected");function ph(a){ps(a),ll(a)}i(ph,"defaultWriterReadyPromiseInitializeAsResolved");function fh(a,d){a._readyPromise_reject!==void 0&&(E(a._readyPromise),a._readyPromise_reject(d),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}i(fh,"defaultWriterReadyPromiseReject");function AR(a){ps(a)}i(AR,"defaultWriterReadyPromiseReset");function RR(a,d){cl(a,d)}i(RR,"defaultWriterReadyPromiseResetToRejected");function ll(a){a._readyPromise_resolve!==void 0&&(a._readyPromise_resolve(void 0),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="fulfilled")}i(ll,"defaultWriterReadyPromiseResolve");function DR(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}i(DR,"getGlobals");let dl=DR();function $R(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}i($R,"isDOMExceptionConstructor");function OR(){let a=dl?.DOMException;return $R(a)?a:void 0}i(OR,"getFromGlobal");function CR(){let a=i(function(_,R){this.message=_||"",this.name=R||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return o(a,"DOMException"),a.prototype=Object.create(Error.prototype),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,configurable:!0}),a}i(CR,"createPolyfill");let NR=OR()||CR();function mh(a,d,_,R,N,G){let Z=H(a),le=Qm(d);a._disturbed=!0;let we=!1,ye=v(void 0);return h((De,Ue)=>{let et;if(G!==void 0){if(et=i(()=>{let ve=G.reason!==void 0?G.reason:new NR("Aborted","AbortError"),je=[];R||je.push(()=>d._state==="writable"?as(d,ve):v(void 0)),N||je.push(()=>a._state==="readable"?_r(a,ve):v(void 0)),zt(()=>Promise.all(je.map(tt=>tt())),!0,ve)},"abortAlgorithm"),G.aborted){et();return}G.addEventListener("abort",et)}function Pr(){return h((ve,je)=>{function tt(Ht){Ht?ve():x(Ni(),tt,je)}i(tt,"next"),tt(!1)})}i(Pr,"pipeLoop");function Ni(){return we?v(!0):x(le._readyPromise,()=>h((ve,je)=>{he(Z,{_chunkSteps:i(tt=>{ye=x(oh(le,tt),void 0,e),ve(!1)},"_chunkSteps"),_closeSteps:i(()=>ve(!0),"_closeSteps"),_errorSteps:je})}))}if(i(Ni,"pipeStep"),on(a,Z._closedPromise,ve=>(R?ur(!0,ve):zt(()=>as(d,ve),!0,ve),null)),on(d,le._closedPromise,ve=>(N?ur(!0,ve):zt(()=>_r(a,ve),!0,ve),null)),Ot(a,Z._closedPromise,()=>(_?ur():zt(()=>yR(le)),null)),Or(d)||d._state==="closed"){let ve=new TypeError("the destination writable stream closed before all data could be piped to it");N?ur(!0,ve):zt(()=>_r(a,ve),!0,ve)}E(Pr());function Dn(){let ve=ye;return x(ye,()=>ve!==ye?Dn():void 0)}i(Dn,"waitForWritesToFinish");function on(ve,je,tt){ve._state==="errored"?tt(ve._storedError):S(je,tt)}i(on,"isOrBecomesErrored");function Ot(ve,je,tt){ve._state==="closed"?tt():w(je,tt)}i(Ot,"isOrBecomesClosed");function zt(ve,je,tt){if(we)return;we=!0,d._state==="writable"&&!Or(d)?w(Dn(),Ht):Ht();function Ht(){return T(ve(),()=>an(je,tt),ki=>an(!0,ki)),null}i(Ht,"doTheRest")}i(zt,"shutdownWithAction");function ur(ve,je){we||(we=!0,d._state==="writable"&&!Or(d)?w(Dn(),()=>an(ve,je)):an(ve,je))}i(ur,"shutdown");function an(ve,je){return ih(le),K(Z),G!==void 0&&G.removeEventListener("abort",et),ve?Ue(je):De(void 0),null}i(an,"finalize")})}i(mh,"ReadableStreamPipeTo");class nn{static{i(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!fs(this))throw hs("desiredSize");return pl(this)}close(){if(!fs(this))throw hs("close");if(!Oi(this))throw new TypeError("The stream is not in a state that permits close");ii(this)}enqueue(d=void 0){if(!fs(this))throw hs("enqueue");if(!Oi(this))throw new TypeError("The stream is not in a state that permits enqueue");return $i(this,d)}error(d=void 0){if(!fs(this))throw hs("error");vr(this,d)}[oe](d){Sn(this);let _=this._cancelAlgorithm(d);return ms(this),_}[ne](d){let _=this._controlledReadableStream;if(this._queue.length>0){let R=Hc(this);this._closeRequested&&this._queue.length===0?(ms(this),No(_)):Oo(this),d._chunkSteps(R)}else k(_,d),Oo(this)}[Re](){}}Object.defineProperties(nn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),o(nn.prototype.close,"close"),o(nn.prototype.enqueue,"enqueue"),o(nn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(nn.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function fs(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof nn}i(fs,"IsReadableStreamDefaultController");function Oo(a){if(!hh(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let _=a._pullAlgorithm();T(_,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,Oo(a)),null),R=>(vr(a,R),null))}i(Oo,"ReadableStreamDefaultControllerCallPullIfNeeded");function hh(a){let d=a._controlledReadableStream;return!Oi(a)||!a._started?!1:!!(An(d)&&V(d)>0||pl(a)>0)}i(hh,"ReadableStreamDefaultControllerShouldCallPull");function ms(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}i(ms,"ReadableStreamDefaultControllerClearAlgorithms");function ii(a){if(!Oi(a))return;let d=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(ms(a),No(d))}i(ii,"ReadableStreamDefaultControllerClose");function $i(a,d){if(!Oi(a))return;let _=a._controlledReadableStream;if(An(_)&&V(_)>0)U(_,d,!1);else{let R;try{R=a._strategySizeAlgorithm(d)}catch(N){throw vr(a,N),N}try{Wc(a,d,R)}catch(N){throw vr(a,N),N}}Oo(a)}i($i,"ReadableStreamDefaultControllerEnqueue");function vr(a,d){let _=a._controlledReadableStream;_._state==="readable"&&(Sn(a),ms(a),_h(_,d))}i(vr,"ReadableStreamDefaultControllerError");function pl(a){let d=a._controlledReadableStream._state;return d==="errored"?null:d==="closed"?0:a._strategyHWM-a._queueTotalSize}i(pl,"ReadableStreamDefaultControllerGetDesiredSize");function kR(a){return!hh(a)}i(kR,"ReadableStreamDefaultControllerHasBackpressure");function Oi(a){let d=a._controlledReadableStream._state;return!a._closeRequested&&d==="readable"}i(Oi,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function gh(a,d,_,R,N,G,Z){d._controlledReadableStream=a,d._queue=void 0,d._queueTotalSize=void 0,Sn(d),d._started=!1,d._closeRequested=!1,d._pullAgain=!1,d._pulling=!1,d._strategySizeAlgorithm=Z,d._strategyHWM=G,d._pullAlgorithm=R,d._cancelAlgorithm=N,a._readableStreamController=d;let le=_();T(v(le),()=>(d._started=!0,Oo(d),null),we=>(vr(d,we),null))}i(gh,"SetUpReadableStreamDefaultController");function zR(a,d,_,R){let N=Object.create(nn.prototype),G,Z,le;d.start!==void 0?G=i(()=>d.start(N),"startAlgorithm"):G=i(()=>{},"startAlgorithm"),d.pull!==void 0?Z=i(()=>d.pull(N),"pullAlgorithm"):Z=i(()=>v(void 0),"pullAlgorithm"),d.cancel!==void 0?le=i(we=>d.cancel(we),"cancelAlgorithm"):le=i(()=>v(void 0),"cancelAlgorithm"),gh(a,N,G,Z,le,_,R)}i(zR,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function hs(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}i(hs,"defaultControllerBrandCheckException$1");function UR(a,d){return Qn(a._readableStreamController)?FR(a):MR(a)}i(UR,"ReadableStreamTee");function MR(a,d){let _=H(a),R=!1,N=!1,G=!1,Z=!1,le,we,ye,De,Ue,et=h(Ot=>{Ue=Ot});function Pr(){return R?(N=!0,v(void 0)):(R=!0,he(_,{_chunkSteps:i(zt=>{u(()=>{N=!1;let ur=zt,an=zt;G||$i(ye._readableStreamController,ur),Z||$i(De._readableStreamController,an),R=!1,N&&Pr()})},"_chunkSteps"),_closeSteps:i(()=>{R=!1,G||ii(ye._readableStreamController),Z||ii(De._readableStreamController),(!G||!Z)&&Ue(void 0)},"_closeSteps"),_errorSteps:i(()=>{R=!1},"_errorSteps")}),v(void 0))}i(Pr,"pullAlgorithm");function Ni(Ot){if(G=!0,le=Ot,Z){let zt=Ye([le,we]),ur=_r(a,zt);Ue(ur)}return et}i(Ni,"cancel1Algorithm");function Dn(Ot){if(Z=!0,we=Ot,G){let zt=Ye([le,we]),ur=_r(a,zt);Ue(ur)}return et}i(Dn,"cancel2Algorithm");function on(){}return i(on,"startAlgorithm"),ye=Co(on,Pr,Ni),De=Co(on,Pr,Dn),S(_._closedPromise,Ot=>(vr(ye._readableStreamController,Ot),vr(De._readableStreamController,Ot),(!G||!Z)&&Ue(void 0),null)),[ye,De]}i(MR,"ReadableStreamDefaultTee");function FR(a){let d=H(a),_=!1,R=!1,N=!1,G=!1,Z=!1,le,we,ye,De,Ue,et=h(ve=>{Ue=ve});function Pr(ve){S(ve._closedPromise,je=>(ve!==d||(sr(ye._readableStreamController,je),sr(De._readableStreamController,je),(!G||!Z)&&Ue(void 0)),null))}i(Pr,"forwardReaderError");function Ni(){ti(d)&&(K(d),d=H(a),Pr(d)),he(d,{_chunkSteps:i(je=>{u(()=>{R=!1,N=!1;let tt=je,Ht=je;if(!G&&!Z)try{Ht=Nm(je)}catch(ki){sr(ye._readableStreamController,ki),sr(De._readableStreamController,ki),Ue(_r(a,ki));return}G||es(ye._readableStreamController,tt),Z||es(De._readableStreamController,Ht),_=!1,R?on():N&&Ot()})},"_chunkSteps"),_closeSteps:i(()=>{_=!1,G||Io(ye._readableStreamController),Z||Io(De._readableStreamController),ye._readableStreamController._pendingPullIntos.length>0&&ts(ye._readableStreamController,0),De._readableStreamController._pendingPullIntos.length>0&&ts(De._readableStreamController,0),(!G||!Z)&&Ue(void 0)},"_closeSteps"),_errorSteps:i(()=>{_=!1},"_errorSteps")})}i(Ni,"pullWithDefaultReader");function Dn(ve,je){pe(d)&&(K(d),d=Wm(a),Pr(d));let tt=je?De:ye,Ht=je?ye:De;Jm(d,ve,1,{_chunkSteps:i(zi=>{u(()=>{R=!1,N=!1;let Ui=je?Z:G;if(je?G:Z)Ui||rs(tt._readableStreamController,zi);else{let Oh;try{Oh=Nm(zi)}catch(yl){sr(tt._readableStreamController,yl),sr(Ht._readableStreamController,yl),Ue(_r(a,yl));return}Ui||rs(tt._readableStreamController,zi),es(Ht._readableStreamController,Oh)}_=!1,R?on():N&&Ot()})},"_chunkSteps"),_closeSteps:i(zi=>{_=!1;let Ui=je?Z:G,Ts=je?G:Z;Ui||Io(tt._readableStreamController),Ts||Io(Ht._readableStreamController),zi!==void 0&&(Ui||rs(tt._readableStreamController,zi),!Ts&&Ht._readableStreamController._pendingPullIntos.length>0&&ts(Ht._readableStreamController,0)),(!Ui||!Ts)&&Ue(void 0)},"_closeSteps"),_errorSteps:i(()=>{_=!1},"_errorSteps")})}i(Dn,"pullWithBYOBReader");function on(){if(_)return R=!0,v(void 0);_=!0;let ve=Xc(ye._readableStreamController);return ve===null?Ni():Dn(ve._view,!1),v(void 0)}i(on,"pull1Algorithm");function Ot(){if(_)return N=!0,v(void 0);_=!0;let ve=Xc(De._readableStreamController);return ve===null?Ni():Dn(ve._view,!0),v(void 0)}i(Ot,"pull2Algorithm");function zt(ve){if(G=!0,le=ve,Z){let je=Ye([le,we]),tt=_r(a,je);Ue(tt)}return et}i(zt,"cancel1Algorithm");function ur(ve){if(Z=!0,we=ve,G){let je=Ye([le,we]),tt=_r(a,je);Ue(tt)}return et}i(ur,"cancel2Algorithm");function an(){}return i(an,"startAlgorithm"),ye=vh(an,on,zt),De=vh(an,Ot,ur),Pr(d),[ye,De]}i(FR,"ReadableByteStreamTee");function LR(a){return r(a)&&typeof a.getReader<"u"}i(LR,"isReadableStreamLike");function jR(a){return LR(a)?BR(a.getReader()):qR(a)}i(jR,"ReadableStreamFrom");function qR(a){let d,_=Cm(a,"async"),R=e;function N(){let Z;try{Z=CA(_)}catch(we){return P(we)}let le=v(Z);return D(le,we=>{if(!r(we))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(NA(we))ii(d._readableStreamController);else{let De=kA(we);$i(d._readableStreamController,De)}})}i(N,"pullAlgorithm");function G(Z){let le=_.iterator,we;try{we=Ya(le,"return")}catch(Ue){return P(Ue)}if(we===void 0)return v(void 0);let ye;try{ye=f(we,le,[Z])}catch(Ue){return P(Ue)}let De=v(ye);return D(De,Ue=>{if(!r(Ue))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return i(G,"cancelAlgorithm"),d=Co(R,N,G,0),d}i(qR,"ReadableStreamFromIterable");function BR(a){let d,_=e;function R(){let G;try{G=a.read()}catch(Z){return P(Z)}return D(G,Z=>{if(!r(Z))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(Z.done)ii(d._readableStreamController);else{let le=Z.value;$i(d._readableStreamController,le)}})}i(R,"pullAlgorithm");function N(G){try{return v(a.cancel(G))}catch(Z){return P(Z)}}return i(N,"cancelAlgorithm"),d=Co(_,R,N,0),d}i(BR,"ReadableStreamFromDefaultReader");function VR(a,d){ut(a,d);let _=a,R=_?.autoAllocateChunkSize,N=_?.cancel,G=_?.pull,Z=_?.start,le=_?.type;return{autoAllocateChunkSize:R===void 0?void 0:z(R,`${d} has member 'autoAllocateChunkSize' that`),cancel:N===void 0?void 0:GR(N,_,`${d} has member 'cancel' that`),pull:G===void 0?void 0:HR(G,_,`${d} has member 'pull' that`),start:Z===void 0?void 0:WR(Z,_,`${d} has member 'start' that`),type:le===void 0?void 0:ZR(le,`${d} has member 'type' that`)}}i(VR,"convertUnderlyingDefaultOrByteSource");function GR(a,d,_){return ft(a,_),R=>c(a,d,[R])}i(GR,"convertUnderlyingSourceCancelCallback");function HR(a,d,_){return ft(a,_),R=>c(a,d,[R])}i(HR,"convertUnderlyingSourcePullCallback");function WR(a,d,_){return ft(a,_),R=>f(a,d,[R])}i(WR,"convertUnderlyingSourceStartCallback");function ZR(a,d){if(a=`${a}`,a!=="bytes")throw new TypeError(`${d} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}i(ZR,"convertReadableStreamType");function KR(a,d){return ut(a,d),{preventCancel:!!a?.preventCancel}}i(KR,"convertIteratorOptions");function yh(a,d){ut(a,d);let _=a?.preventAbort,R=a?.preventCancel,N=a?.preventClose,G=a?.signal;return G!==void 0&&JR(G,`${d} has member 'signal' that`),{preventAbort:!!_,preventCancel:!!R,preventClose:!!N,signal:G}}i(yh,"convertPipeOptions");function JR(a,d){if(!iR(a))throw new TypeError(`${d} is not an AbortSignal.`)}i(JR,"assertAbortSignal");function YR(a,d){ut(a,d);let _=a?.readable;I(_,"readable","ReadableWritablePair"),F(_,`${d} has member 'readable' that`);let R=a?.writable;return I(R,"writable","ReadableWritablePair"),Xm(R,`${d} has member 'writable' that`),{readable:_,writable:R}}i(YR,"convertReadableWritablePair");class Dt{static{i(this,"ReadableStream")}constructor(d={},_={}){d===void 0?d=null:Ze(d,"First parameter");let R=os(_,"Second parameter"),N=VR(d,"First parameter");if(fl(this),N.type==="bytes"){if(R.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let G=Ro(R,0);GA(this,N,G)}else{let G=is(R),Z=Ro(R,1);zR(this,N,Z,G)}}get locked(){if(!In(this))throw oi("locked");return An(this)}cancel(d=void 0){return In(this)?An(this)?P(new TypeError("Cannot cancel a stream that already has a reader")):_r(this,d):P(oi("cancel"))}getReader(d=void 0){if(!In(this))throw oi("getReader");return WA(d,"First parameter").mode===void 0?H(this):Wm(this)}pipeThrough(d,_={}){if(!In(this))throw oi("pipeThrough");Je(d,1,"pipeThrough");let R=YR(d,"First parameter"),N=yh(_,"Second parameter");if(An(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Ri(R.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let G=mh(this,R.writable,N.preventClose,N.preventAbort,N.preventCancel,N.signal);return E(G),R.readable}pipeTo(d,_={}){if(!In(this))return P(oi("pipeTo"));if(d===void 0)return P("Parameter 1 is required in 'pipeTo'.");if(!Ai(d))return P(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let R;try{R=yh(_,"Second parameter")}catch(N){return P(N)}return An(this)?P(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Ri(d)?P(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):mh(this,d,R.preventClose,R.preventAbort,R.preventCancel,R.signal)}tee(){if(!In(this))throw oi("tee");let d=UR(this);return Ye(d)}values(d=void 0){if(!In(this))throw oi("values");let _=KR(d,"First parameter");return Si(this,_.preventCancel)}[Gc](d){return this.values(d)}static from(d){return jR(d)}}Object.defineProperties(Dt,{from:{enumerable:!0}}),Object.defineProperties(Dt.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),o(Dt.from,"from"),o(Dt.prototype.cancel,"cancel"),o(Dt.prototype.getReader,"getReader"),o(Dt.prototype.pipeThrough,"pipeThrough"),o(Dt.prototype.pipeTo,"pipeTo"),o(Dt.prototype.tee,"tee"),o(Dt.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Dt.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Dt.prototype,Gc,{value:Dt.prototype.values,writable:!0,configurable:!0});function Co(a,d,_,R=1,N=()=>1){let G=Object.create(Dt.prototype);fl(G);let Z=Object.create(nn.prototype);return gh(G,Z,a,d,_,R,N),G}i(Co,"CreateReadableStream");function vh(a,d,_){let R=Object.create(Dt.prototype);fl(R);let N=Object.create(tn.prototype);return Hm(R,N,a,d,_,0,void 0),R}i(vh,"CreateReadableByteStream");function fl(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}i(fl,"InitializeReadableStream");function In(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof Dt}i(In,"IsReadableStream");function An(a){return a._reader!==void 0}i(An,"IsReadableStreamLocked");function _r(a,d){if(a._disturbed=!0,a._state==="closed")return v(void 0);if(a._state==="errored")return P(a._storedError);No(a);let _=a._reader;if(_!==void 0&&ti(_)){let N=_._readIntoRequests;_._readIntoRequests=new l,N.forEach(G=>{G._closeSteps(void 0)})}let R=a._readableStreamController[oe](d);return D(R,e)}i(_r,"ReadableStreamCancel");function No(a){a._state="closed";let d=a._reader;if(d!==void 0&&(Ke(d),pe(d))){let _=d._readRequests;d._readRequests=new l,_.forEach(R=>{R._closeSteps()})}}i(No,"ReadableStreamClose");function _h(a,d){a._state="errored",a._storedError=d;let _=a._reader;_!==void 0&&(Oe(_,d),pe(_)?nt(_,d):Ym(_,d))}i(_h,"ReadableStreamError");function oi(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}i(oi,"streamBrandCheckException$1");function Ph(a,d){ut(a,d);let _=a?.highWaterMark;return I(_,"highWaterMark","QueuingStrategyInit"),{highWaterMark:$(_)}}i(Ph,"convertQueuingStrategyInit");let wh=i(a=>a.byteLength,"byteLengthSizeFunction");o(wh,"size");class gs{static{i(this,"ByteLengthQueuingStrategy")}constructor(d){Je(d,1,"ByteLengthQueuingStrategy"),d=Ph(d,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=d.highWaterMark}get highWaterMark(){if(!Th(this))throw bh("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Th(this))throw bh("size");return wh}}Object.defineProperties(gs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(gs.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function bh(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}i(bh,"byteLengthBrandCheckException");function Th(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof gs}i(Th,"IsByteLengthQueuingStrategy");let Sh=i(()=>1,"countSizeFunction");o(Sh,"size");class ys{static{i(this,"CountQueuingStrategy")}constructor(d){Je(d,1,"CountQueuingStrategy"),d=Ph(d,"First parameter"),this._countQueuingStrategyHighWaterMark=d.highWaterMark}get highWaterMark(){if(!Eh(this))throw xh("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Eh(this))throw xh("size");return Sh}}Object.defineProperties(ys.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ys.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function xh(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}i(xh,"countBrandCheckException");function Eh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof ys}i(Eh,"IsCountQueuingStrategy");function XR(a,d){ut(a,d);let _=a?.cancel,R=a?.flush,N=a?.readableType,G=a?.start,Z=a?.transform,le=a?.writableType;return{cancel:_===void 0?void 0:r0(_,a,`${d} has member 'cancel' that`),flush:R===void 0?void 0:QR(R,a,`${d} has member 'flush' that`),readableType:N,start:G===void 0?void 0:e0(G,a,`${d} has member 'start' that`),transform:Z===void 0?void 0:t0(Z,a,`${d} has member 'transform' that`),writableType:le}}i(XR,"convertTransformer");function QR(a,d,_){return ft(a,_),R=>c(a,d,[R])}i(QR,"convertTransformerFlushCallback");function e0(a,d,_){return ft(a,_),R=>f(a,d,[R])}i(e0,"convertTransformerStartCallback");function t0(a,d,_){return ft(a,_),(R,N)=>c(a,d,[R,N])}i(t0,"convertTransformerTransformCallback");function r0(a,d,_){return ft(a,_),R=>c(a,d,[R])}i(r0,"convertTransformerCancelCallback");class vs{static{i(this,"TransformStream")}constructor(d={},_={},R={}){d===void 0&&(d=null);let N=os(_,"Second parameter"),G=os(R,"Third parameter"),Z=XR(d,"First parameter");if(Z.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(Z.writableType!==void 0)throw new RangeError("Invalid writableType specified");let le=Ro(G,0),we=is(G),ye=Ro(N,1),De=is(N),Ue,et=h(Pr=>{Ue=Pr});n0(this,et,ye,De,le,we),o0(this,Z),Z.start!==void 0?Ue(Z.start(this._transformStreamController)):Ue(void 0)}get readable(){if(!Ih(this))throw $h("readable");return this._readable}get writable(){if(!Ih(this))throw $h("writable");return this._writable}}Object.defineProperties(vs.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(vs.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function n0(a,d,_,R,N,G){function Z(){return d}i(Z,"startAlgorithm");function le(et){return u0(a,et)}i(le,"writeAlgorithm");function we(et){return c0(a,et)}i(we,"abortAlgorithm");function ye(){return l0(a)}i(ye,"closeAlgorithm"),a._writable=sR(Z,le,ye,we,_,R);function De(){return d0(a)}i(De,"pullAlgorithm");function Ue(et){return p0(a,et)}i(Ue,"cancelAlgorithm"),a._readable=Co(Z,De,Ue,N,G),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,_s(a,!0),a._transformStreamController=void 0}i(n0,"InitializeTransformStream");function Ih(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof vs}i(Ih,"IsTransformStream");function Ah(a,d){vr(a._readable._readableStreamController,d),ml(a,d)}i(Ah,"TransformStreamError");function ml(a,d){ws(a._transformStreamController),Do(a._writable._writableStreamController,d),hl(a)}i(ml,"TransformStreamErrorWritableAndUnblockWrite");function hl(a){a._backpressure&&_s(a,!1)}i(hl,"TransformStreamUnblockWrite");function _s(a,d){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=h(_=>{a._backpressureChangePromise_resolve=_}),a._backpressure=d}i(_s,"TransformStreamSetBackpressure");class Rn{static{i(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ps(this))throw bs("desiredSize");let d=this._controlledTransformStream._readable._readableStreamController;return pl(d)}enqueue(d=void 0){if(!Ps(this))throw bs("enqueue");Rh(this,d)}error(d=void 0){if(!Ps(this))throw bs("error");a0(this,d)}terminate(){if(!Ps(this))throw bs("terminate");s0(this)}}Object.defineProperties(Rn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),o(Rn.prototype.enqueue,"enqueue"),o(Rn.prototype.error,"error"),o(Rn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function Ps(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof Rn}i(Ps,"IsTransformStreamDefaultController");function i0(a,d,_,R,N){d._controlledTransformStream=a,a._transformStreamController=d,d._transformAlgorithm=_,d._flushAlgorithm=R,d._cancelAlgorithm=N,d._finishPromise=void 0,d._finishPromise_resolve=void 0,d._finishPromise_reject=void 0}i(i0,"SetUpTransformStreamDefaultController");function o0(a,d){let _=Object.create(Rn.prototype),R,N,G;d.transform!==void 0?R=i(Z=>d.transform(Z,_),"transformAlgorithm"):R=i(Z=>{try{return Rh(_,Z),v(void 0)}catch(le){return P(le)}},"transformAlgorithm"),d.flush!==void 0?N=i(()=>d.flush(_),"flushAlgorithm"):N=i(()=>v(void 0),"flushAlgorithm"),d.cancel!==void 0?G=i(Z=>d.cancel(Z),"cancelAlgorithm"):G=i(()=>v(void 0),"cancelAlgorithm"),i0(a,_,R,N,G)}i(o0,"SetUpTransformStreamDefaultControllerFromTransformer");function ws(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}i(ws,"TransformStreamDefaultControllerClearAlgorithms");function Rh(a,d){let _=a._controlledTransformStream,R=_._readable._readableStreamController;if(!Oi(R))throw new TypeError("Readable side is not in a state that permits enqueue");try{$i(R,d)}catch(G){throw ml(_,G),_._readable._storedError}kR(R)!==_._backpressure&&_s(_,!0)}i(Rh,"TransformStreamDefaultControllerEnqueue");function a0(a,d){Ah(a._controlledTransformStream,d)}i(a0,"TransformStreamDefaultControllerError");function Dh(a,d){let _=a._transformAlgorithm(d);return D(_,void 0,R=>{throw Ah(a._controlledTransformStream,R),R})}i(Dh,"TransformStreamDefaultControllerPerformTransform");function s0(a){let d=a._controlledTransformStream,_=d._readable._readableStreamController;ii(_);let R=new TypeError("TransformStream terminated");ml(d,R)}i(s0,"TransformStreamDefaultControllerTerminate");function u0(a,d){let _=a._transformStreamController;if(a._backpressure){let R=a._backpressureChangePromise;return D(R,()=>{let N=a._writable;if(N._state==="erroring")throw N._storedError;return Dh(_,d)})}return Dh(_,d)}i(u0,"TransformStreamDefaultSinkWriteAlgorithm");function c0(a,d){let _=a._transformStreamController;if(_._finishPromise!==void 0)return _._finishPromise;let R=a._readable;_._finishPromise=h((G,Z)=>{_._finishPromise_resolve=G,_._finishPromise_reject=Z});let N=_._cancelAlgorithm(d);return ws(_),T(N,()=>(R._state==="errored"?Ci(_,R._storedError):(vr(R._readableStreamController,d),gl(_)),null),G=>(vr(R._readableStreamController,G),Ci(_,G),null)),_._finishPromise}i(c0,"TransformStreamDefaultSinkAbortAlgorithm");function l0(a){let d=a._transformStreamController;if(d._finishPromise!==void 0)return d._finishPromise;let _=a._readable;d._finishPromise=h((N,G)=>{d._finishPromise_resolve=N,d._finishPromise_reject=G});let R=d._flushAlgorithm();return ws(d),T(R,()=>(_._state==="errored"?Ci(d,_._storedError):(ii(_._readableStreamController),gl(d)),null),N=>(vr(_._readableStreamController,N),Ci(d,N),null)),d._finishPromise}i(l0,"TransformStreamDefaultSinkCloseAlgorithm");function d0(a){return _s(a,!1),a._backpressureChangePromise}i(d0,"TransformStreamDefaultSourcePullAlgorithm");function p0(a,d){let _=a._transformStreamController;if(_._finishPromise!==void 0)return _._finishPromise;let R=a._writable;_._finishPromise=h((G,Z)=>{_._finishPromise_resolve=G,_._finishPromise_reject=Z});let N=_._cancelAlgorithm(d);return ws(_),T(N,()=>(R._state==="errored"?Ci(_,R._storedError):(Do(R._writableStreamController,d),hl(a),gl(_)),null),G=>(Do(R._writableStreamController,G),hl(a),Ci(_,G),null)),_._finishPromise}i(p0,"TransformStreamDefaultSourceCancelAlgorithm");function bs(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}i(bs,"defaultControllerBrandCheckException");function gl(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}i(gl,"defaultControllerFinishPromiseResolve");function Ci(a,d){a._finishPromise_reject!==void 0&&(E(a._finishPromise),a._finishPromise_reject(d),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}i(Ci,"defaultControllerFinishPromiseReject");function $h(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}i($h,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=gs,t.CountQueuingStrategy=ys,t.ReadableByteStreamController=tn,t.ReadableStream=Dt,t.ReadableStreamBYOBReader=xn,t.ReadableStreamBYOBRequest=Xn,t.ReadableStreamDefaultController=nn,t.ReadableStreamDefaultReader=X,t.TransformStream=vs,t.TransformStreamDefaultController=Rn,t.WritableStream=En,t.WritableStreamDefaultController=Di,t.WritableStreamDefaultWriter=rn}))});var ZP=L(()=>{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,WP())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=i(function(r){let n=0,o=this;return new ReadableStream({type:"bytes",async pull(s){let m=await o.slice(n,Math.min(o.size,n+65536)).arrayBuffer();n+=m.byteLength,s.enqueue(new Uint8Array(m)),n===o.size&&s.close()}})},"name"))}catch{}});async function*zd(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,o=r.byteOffset+r.byteLength;for(;n!==o;){let s=Math.min(o-n,KP),p=r.buffer.slice(n,n+s);n+=p.byteLength,yield new Uint8Array(p)}}else yield r;else{let n=0,o=r;for(;n!==o.size;){let p=await o.slice(n,Math.min(o.size,n+KP)).arrayBuffer();n+=p.byteLength,yield new Uint8Array(p)}}}var GY,KP,JP,GN,Tr,la=St(()=>{GY=ue(ZP(),1);KP=65536;i(zd,"toIterator");JP=class Ud{static{i(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 p;ArrayBuffer.isView(s)?p=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?p=new Uint8Array(s.slice(0)):s instanceof Ud?p=s:p=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(p)?p.byteLength:p.size,this.#e.push(p)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let o=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(o)?o:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of zd(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 zd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=zd(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:o}=this,s=e<0?Math.max(o+e,0):Math.min(e,o),p=r<0?Math.max(o+r,0):Math.min(r,o),m=Math.max(p-s,0),h=this.#e,v=[],P=0;for(let T of h){if(P>=m)break;let w=ArrayBuffer.isView(T)?T.byteLength:T.size;if(s&&w<=s)s-=w,p-=w;else{let S;ArrayBuffer.isView(T)?(S=T.subarray(s,Math.min(w,p)),P+=S.byteLength):(S=T.slice(s,Math.min(w,p)),P+=S.size),p-=w,v.push(S),s=0}}let x=new Ud([],{type:String(n).toLowerCase()});return x.#r=m,x.#e=v,x}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(JP.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});GN=JP,Tr=GN});var HN,WN,Bn,Md=St(()=>{la();HN=class extends Tr{static{i(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 o=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(o)||(this.#e=o),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 Tr&&/^(File)$/.test(e[Symbol.toStringTag])}},WN=HN,Bn=WN});function QP(t,e=Tr){var r=`${YP()}${YP()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],o=`--${r}\r
15
+ Content-Disposition: form-data; name="`;return t.forEach((s,p)=>typeof s=="string"?n.push(o+Fd(p)+`"\r
16
16
  \r
17
- ${a.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
17
+ ${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
18
18
  `)}\r
19
- `):n.push(i+Nd(f)+`"; filename="${Nd(a.name,1)}"\r
20
- Content-Type: ${a.type||"application/octet-stream"}\r
19
+ `):n.push(o+Fd(p)+`"; filename="${Fd(s.name,1)}"\r
20
+ Content-Type: ${s.type||"application/octet-stream"}\r
21
21
  \r
22
- `,a,`\r
23
- `)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var as,xD,SD,zP,TD,UP,Nd,so,kn,pu=Pt(()=>{ss();Cd();({toStringTag:as,iterator:xD,hasInstance:SD}=Symbol),zP=Math.random,TD="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),UP=o((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[as])?[(r=r!==void 0?r+"":e[as]=="File"?e.name:"blob",t),e.name!==r||e[as]=="blob"?new Un([e],r,e):e]:[t,e+""]),"f"),Nd=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"),so=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"),kn=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[as](){return"FormData"}[xD](){return this.entries()}static[SD](e){return e&&typeof e=="object"&&e[as]==="FormData"&&!TD.some(r=>typeof e[r]!="function")}append(...e){so("append",arguments,2),this.#e.push(UP(...e))}delete(e){so("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){so("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 so("getAll",arguments,1),r=[],e+="",this.#e.forEach(n=>n[0]===e&&r.push(n[1])),r}has(e){return so("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){so("forEach",arguments,1);for(var[n,i]of this)e.call(r,i,n,this)}set(...e){so("set",arguments,2);var r=[],n=!0;e=UP(...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(kP,"formDataToBlob")});var ln,fu=Pt(()=>{ln=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 Ot,zd=Pt(()=>{fu();Ot=class extends ln{static{o(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var mu,Ud,us,jP,MP,FP,hu=Pt(()=>{mu=Symbol.toStringTag,Ud=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[mu]==="URLSearchParams","isURLSearchParameters"),us=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[mu]),"isBlob"),jP=o(t=>typeof t=="object"&&(t[mu]==="AbortSignal"||t[mu]==="EventTarget"),"isAbortSignal"),MP=o((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),FP=o((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var qP=M((N9,LP)=>{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)}LP.exports=globalThis.DOMException});var ao,BP,VP,kd,GP,HP,WP,ZP,KP,JP,gu,jd=Pt(()=>{ao=require("node:fs"),BP=require("node:path"),VP=ze(qP(),1);Cd();ss();({stat:kd}=ao.promises),GP=o((t,e)=>KP((0,ao.statSync)(t),t,e),"blobFromSync"),HP=o((t,e)=>kd(t).then(r=>KP(r,t,e)),"blobFrom"),WP=o((t,e)=>kd(t).then(r=>JP(r,t,e)),"fileFrom"),ZP=o((t,e)=>JP((0,ao.statSync)(t),t,e),"fileFromSync"),KP=o((t,e,r="")=>new wr([new gu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),JP=o((t,e,r="")=>new Un([new gu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,BP.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),gu=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 kd(this.#e);if(e>this.lastModified)throw new VP.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,ao.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var XP={};Pa(XP,{toFormData:()=>OD});function $D(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,a)=>String.fromCharCode(a)),n}async function OD(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 Md(r[1]||r[2]),i,a,f,m,h,_,P=[],E=new kn,S=o(u=>{f+=b.decode(u,{stream:!0})},"onPartData"),w=o(u=>{P.push(u)},"appendToFile"),T=o(()=>{let u=new Un(P,_,{type:h});E.append(m,u)},"appendFileToFormData"),$=o(()=>{E.append(m,f)},"appendEntryToFormData"),b=new TextDecoder("utf-8");b.decode(),n.onPartBegin=function(){n.onPartData=S,n.onPartEnd=$,i="",a="",f="",m="",h="",_=null,P.length=0},n.onHeaderField=function(u){i+=b.decode(u,{stream:!0})},n.onHeaderValue=function(u){a+=b.decode(u,{stream:!0})},n.onHeaderEnd=function(){if(a+=b.decode(),i=i.toLowerCase(),i==="content-disposition"){let u=a.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);u&&(m=u[2]||u[3]||""),_=$D(a),_&&(n.onPartData=w,n.onPartEnd=T)}else i==="content-type"&&(h=a);a="",i=""};for await(let u of t)n.write(u);return n.end(),E}var zr,tt,YP,jn,yu,vu,ED,cs,bD,AD,ID,RD,uo,Md,QP=Pt(()=>{jd();pu();zr=0,tt={START_BOUNDARY:zr++,HEADER_FIELD_START:zr++,HEADER_FIELD:zr++,HEADER_VALUE_START:zr++,HEADER_VALUE:zr++,HEADER_VALUE_ALMOST_DONE:zr++,HEADERS_ALMOST_DONE:zr++,PART_DATA_START:zr++,PART_DATA:zr++,END:zr++},YP=1,jn={PART_BOUNDARY:YP,LAST_BOUNDARY:YP*=2},yu=10,vu=13,ED=32,cs=45,bD=58,AD=97,ID=122,RD=o(t=>t|32,"lower"),uo=o(()=>{},"noop"),Md=class{static{o(this,"MultipartParser")}constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=uo,this.onHeaderField=uo,this.onHeadersEnd=uo,this.onHeaderValue=uo,this.onPartBegin=uo,this.onPartData=uo,this.onPartEnd=uo,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=tt.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:a,boundary:f,boundaryChars:m,index:h,state:_,flags:P}=this,E=this.boundary.length,S=E-1,w=e.length,T,$,b=o(y=>{this[y+"Mark"]=r},"mark"),u=o(y=>{delete this[y+"Mark"]},"clear"),p=o((y,l,x,g)=>{(l===void 0||l!==x)&&this[y](g&&g.subarray(l,x))},"callback"),c=o((y,l)=>{let x=y+"Mark";x in this&&(l?(p(y,this[x],r,e),delete this[x]):(p(y,this[x],e.length,e),this[x]=0))},"dataCallback");for(r=0;r<n;r++)switch(T=e[r],_){case tt.START_BOUNDARY:if(h===f.length-2){if(T===cs)P|=jn.LAST_BOUNDARY;else if(T!==vu)return;h++;break}else if(h-1===f.length-2){if(P&jn.LAST_BOUNDARY&&T===cs)_=tt.END,P=0;else if(!(P&jn.LAST_BOUNDARY)&&T===yu)h=0,p("onPartBegin"),_=tt.HEADER_FIELD_START;else return;break}T!==f[h+2]&&(h=-2),T===f[h+2]&&h++;break;case tt.HEADER_FIELD_START:_=tt.HEADER_FIELD,b("onHeaderField"),h=0;case tt.HEADER_FIELD:if(T===vu){u("onHeaderField"),_=tt.HEADERS_ALMOST_DONE;break}if(h++,T===cs)break;if(T===bD){if(h===1)return;c("onHeaderField",!0),_=tt.HEADER_VALUE_START;break}if($=RD(T),$<AD||$>ID)return;break;case tt.HEADER_VALUE_START:if(T===ED)break;b("onHeaderValue"),_=tt.HEADER_VALUE;case tt.HEADER_VALUE:T===vu&&(c("onHeaderValue",!0),p("onHeaderEnd"),_=tt.HEADER_VALUE_ALMOST_DONE);break;case tt.HEADER_VALUE_ALMOST_DONE:if(T!==yu)return;_=tt.HEADER_FIELD_START;break;case tt.HEADERS_ALMOST_DONE:if(T!==yu)return;p("onHeadersEnd"),_=tt.PART_DATA_START;break;case tt.PART_DATA_START:_=tt.PART_DATA,b("onPartData");case tt.PART_DATA:if(i=h,h===0){for(r+=S;r<w&&!(e[r]in m);)r+=E;r-=S,T=e[r]}if(h<f.length)f[h]===T?(h===0&&c("onPartData",!0),h++):h=0;else if(h===f.length)h++,T===vu?P|=jn.PART_BOUNDARY:T===cs?P|=jn.LAST_BOUNDARY:h=0;else if(h-1===f.length)if(P&jn.PART_BOUNDARY){if(h=0,T===yu){P&=~jn.PART_BOUNDARY,p("onPartEnd"),p("onPartBegin"),_=tt.HEADER_FIELD_START;break}}else P&jn.LAST_BOUNDARY&&T===cs?(p("onPartEnd"),_=tt.END,P=0):h=0;if(h>0)a[h-1]=T;else if(i>0){let y=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);p("onPartData",0,i,y),i=0,b("onPartData"),r--}break;case tt.END:break;default:throw new Error(`Unexpected state entered: ${_}`)}c("onHeaderField"),c("onHeaderValue"),c("onPartData"),this.index=h,this.state=_,this.flags=P}end(){if(this.state===tt.HEADER_FIELD_START&&this.index===0||this.state===tt.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==tt.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o($D,"_fileName");o(OD,"toFormData")});async function Fd(t){if(t[jt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[jt].disturbed=!0,t[jt].error)throw t[jt].error;let{body:e}=t;if(e===null)return Wt.Buffer.alloc(0);if(!(e instanceof lr.default))return Wt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let a=new Ot(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(a),a}n+=i.length,r.push(i)}}catch(i){throw i instanceof ln?i:new Ot(`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")?Wt.Buffer.from(r.join("")):Wt.Buffer.concat(r,n)}catch(i){throw new Ot(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new Ot(`Premature close of server response while trying to fetch ${t.url}`)}var lr,dn,Wt,DD,jt,Ur,Qo,CD,_u,ew,tw,Pu=Pt(()=>{lr=ze(require("node:stream"),1),dn=require("node:util"),Wt=require("node:buffer");ss();pu();zd();fu();hu();DD=(0,dn.promisify)(lr.default.pipeline),jt=Symbol("Body internals"),Ur=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:Ud(e)?e=Wt.Buffer.from(e.toString()):us(e)||Wt.Buffer.isBuffer(e)||(dn.types.isAnyArrayBuffer(e)?e=Wt.Buffer.from(e):ArrayBuffer.isView(e)?e=Wt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof lr.default||(e instanceof kn?(e=kP(e),n=e.type.split("=")[1]):e=Wt.Buffer.from(String(e))));let i=e;Wt.Buffer.isBuffer(e)?i=lr.default.Readable.from(e):us(e)&&(i=lr.default.Readable.from(e.stream())),this[jt]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof lr.default&&e.on("error",a=>{let f=a instanceof ln?a:new Ot(`Invalid response body while trying to fetch ${this.url}: ${a.message}`,"system",a);this[jt].error=f})}get body(){return this[jt].stream}get bodyUsed(){return this[jt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await Fd(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 kn,i=new URLSearchParams(await this.text());for(let[a,f]of i)n.append(a,f);return n}let{toFormData:r}=await Promise.resolve().then(()=>(QP(),XP));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[jt].body&&this[jt].body.type||"",r=await this.arrayBuffer();return new wr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await Fd(this);return new TextDecoder().decode(e)}buffer(){return Fd(this)}};Ur.prototype.buffer=(0,dn.deprecate)(Ur.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Ur.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,dn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(Fd,"consumeBody");Qo=o((t,e)=>{let r,n,{body:i}=t[jt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof lr.default&&typeof i.getBoundary!="function"&&(r=new lr.PassThrough({highWaterMark:e}),n=new lr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[jt].stream=r,i=n),i},"clone"),CD=(0,dn.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"),_u=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Ud(t)?"application/x-www-form-urlencoded;charset=UTF-8":us(t)?t.type||null:Wt.Buffer.isBuffer(t)||dn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof kn?`multipart/form-data; boundary=${e[jt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${CD(t)}`:t instanceof lr.default?null:"text/plain;charset=UTF-8","extractContentType"),ew=o(t=>{let{body:e}=t[jt];return e===null?0:us(e)?e.size:Wt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),tw=o(async(t,{body:e})=>{e===null?t.end():await DD(e,t)},"writeToStream")});function rw(t=[]){return new Mt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return wu(e),qd(e,String(r)),!0}catch{return!1}}))}var Ld,ls,wu,qd,Mt,xu=Pt(()=>{Ld=require("node:util"),ls=ze(require("node:http"),1),wu=typeof ls.default.validateHeaderName=="function"?ls.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}},qd=typeof ls.default.validateHeaderValue=="function"?ls.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}},Mt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,a]of Object.entries(n))r.push(...a.map(f=>[i,f]))}else if(e!=null)if(typeof e=="object"&&!Ld.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"||Ld.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])=>(wu(n),qd(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,a){switch(i){case"append":case"set":return(f,m)=>(wu(f),qd(f,String(m)),URLSearchParams.prototype[i].call(n,String(f).toLowerCase(),String(m)));case"delete":case"has":case"getAll":return f=>(wu(f),URLSearchParams.prototype[i].call(n,String(f).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,a)}}})}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(Mt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(rw,"fromRawHeaders")});var ND,ds,Bd=Pt(()=>{ND=new Set([301,302,303,307,308]),ds=o(t=>ND.has(t),"isRedirect")});var xr,Zt,nw=Pt(()=>{xu();Pu();Bd();xr=Symbol("Response internals"),Zt=class t extends Ur{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new Mt(r.headers);if(e!==null&&!i.has("Content-Type")){let a=_u(e,this);a&&i.append("Content-Type",a)}this[xr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[xr].type}get url(){return this[xr].url||""}get status(){return this[xr].status}get ok(){return this[xr].status>=200&&this[xr].status<300}get redirected(){return this[xr].counter>0}get statusText(){return this[xr].statusText}get headers(){return this[xr].headers}get highWaterMark(){return this[xr].highWaterMark}clone(){return new t(Qo(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(!ds(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[xr].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 Mt(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(Zt.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 ow,iw=Pt(()=>{ow=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 sw(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 lw(t){if(!uw.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function zD(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,aw.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 ei(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:zD(t)}function dw(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,a=sw(i),f=sw(i,!0);a.toString().length>4096&&(a=f),e&&(a=e(a)),r&&(f=r(f));let m=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return f;case"unsafe-url":return a;case"strict-origin":return ei(a)&&!ei(m)?"no-referrer":f.toString();case"strict-origin-when-cross-origin":return a.origin===m.origin?a:ei(a)&&!ei(m)?"no-referrer":f;case"same-origin":return a.origin===m.origin?a:"no-referrer";case"origin-when-cross-origin":return a.origin===m.origin?a:f;case"no-referrer-when-downgrade":return ei(a)&&!ei(m)?"no-referrer":a;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function pw(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&uw.has(n)&&(r=n);return r}var aw,uw,cw,Vd=Pt(()=>{aw=require("node:net");o(sw,"stripURLForUseAsAReferrer");uw=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),cw="strict-origin-when-cross-origin";o(lw,"validateReferrerPolicy");o(zD,"isOriginPotentiallyTrustworthy");o(ei,"isUrlPotentiallyTrustworthy");o(dw,"determineRequestsReferrer");o(pw,"parseReferrerPolicyFromHeader")});var fw,mw,Tt,ps,UD,Mn,hw,gw=Pt(()=>{fw=require("node:url"),mw=require("node:util");xu();Pu();hu();iw();Vd();Tt=Symbol("Request internals"),ps=o(t=>typeof t=="object"&&typeof t[Tt]=="object","isRequest"),UD=(0,mw.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 Ur{static{o(this,"Request")}constructor(e,r={}){let n;if(ps(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()),!ps(r)&&"data"in r&&UD(),(r.body!=null||ps(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let a=r.body?r.body:ps(e)&&e.body!==null?Qo(e):null;super(a,{size:r.size||e.size||0});let f=new Mt(r.headers||e.headers||{});if(a!==null&&!f.has("Content-Type")){let _=_u(a,this);_&&f.set("Content-Type",_)}let m=ps(e)?e.signal:null;if("signal"in r&&(m=r.signal),m!=null&&!jP(m))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let h=r.referrer==null?e.referrer:r.referrer;if(h==="")h="no-referrer";else if(h){let _=new URL(h);h=/^about:(\/\/)?client$/.test(_)?"client":_}else h=void 0;this[Tt]={method:i,redirect:r.redirect||e.redirect||"follow",headers:f,parsedURL:n,signal:m,referrer:h},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[Tt].method}get url(){return(0,fw.format)(this[Tt].parsedURL)}get headers(){return this[Tt].headers}get redirect(){return this[Tt].redirect}get signal(){return this[Tt].signal}get referrer(){if(this[Tt].referrer==="no-referrer")return"";if(this[Tt].referrer==="client")return"about:client";if(this[Tt].referrer)return this[Tt].referrer.toString()}get referrerPolicy(){return this[Tt].referrerPolicy}set referrerPolicy(e){this[Tt].referrerPolicy=lw(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}});hw=o(t=>{let{parsedURL:e}=t[Tt],r=new Mt(t[Tt].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 m=ew(t);typeof m=="number"&&!Number.isNaN(m)&&(n=String(m))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=cw),t.referrer&&t.referrer!=="no-referrer"?t[Tt].referrer=dw(t):t[Tt].referrer="no-referrer",t[Tt].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 a=ow(e),f={path:e.pathname+a,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:f}},"getNodeRequestOptions")});var fs,yw=Pt(()=>{fu();fs=class extends ln{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var Pw={};Pa(Pw,{AbortError:()=>fs,Blob:()=>wr,FetchError:()=>Ot,File:()=>Un,FormData:()=>kn,Headers:()=>Mt,Request:()=>Mn,Response:()=>Zt,blobFrom:()=>HP,blobFromSync:()=>GP,default:()=>Gd,fileFrom:()=>WP,fileFromSync:()=>ZP,isRedirect:()=>ds});async function Gd(t,e){return new Promise((r,n)=>{let i=new Mn(t,e),{parsedURL:a,options:f}=hw(i);if(!kD.has(a.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${a.protocol.replace(/:$/,"")}" is not supported.`);if(a.protocol==="data:"){let T=IP(i.url),$=new Zt(T,{headers:{"Content-Type":T.typeFull}});r($);return}let m=(a.protocol==="https:"?_w.default:vw.default).request,{signal:h}=i,_=null,P=o(()=>{let T=new fs("The operation was aborted.");n(T),i.body&&i.body instanceof Kt.default.Readable&&i.body.destroy(T),!(!_||!_.body)&&_.body.emit("error",T)},"abort");if(h&&h.aborted){P();return}let E=o(()=>{P(),w()},"abortAndFinalize"),S=m(a.toString(),f);h&&h.addEventListener("abort",E);let w=o(()=>{S.abort(),h&&h.removeEventListener("abort",E)},"finalize");S.on("error",T=>{n(new Ot(`request to ${i.url} failed, reason: ${T.message}`,"system",T)),w()}),jD(S,T=>{_&&_.body&&_.body.destroy(T)}),process.version<"v14"&&S.on("socket",T=>{let $;T.prependListener("end",()=>{$=T._eventsCount}),T.prependListener("close",b=>{if(_&&$<T._eventsCount&&!b){let u=new Error("Premature close");u.code="ERR_STREAM_PREMATURE_CLOSE",_.body.emit("error",u)}})}),S.on("response",T=>{S.setTimeout(0);let $=rw(T.rawHeaders);if(ds(T.statusCode)){let y=$.get("Location"),l=null;try{l=y===null?null:new URL(y,i.url)}catch{if(i.redirect!=="manual"){n(new Ot(`uri requested responds with an invalid redirect URL: ${y}`,"invalid-redirect")),w();return}}switch(i.redirect){case"error":n(new Ot(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),w();return;case"manual":break;case"follow":{if(l===null)break;if(i.counter>=i.follow){n(new Ot(`maximum redirect reached at: ${i.url}`,"max-redirect")),w();return}let x={headers:new Mt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:Qo(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!MP(i.url,l)||!FP(i.url,l))for(let re of["authorization","www-authenticate","cookie","cookie2"])x.headers.delete(re);if(T.statusCode!==303&&i.body&&e.body instanceof Kt.default.Readable){n(new Ot("Cannot follow redirect with body being a readable stream","unsupported-redirect")),w();return}(T.statusCode===303||(T.statusCode===301||T.statusCode===302)&&i.method==="POST")&&(x.method="GET",x.body=void 0,x.headers.delete("content-length"));let g=pw($);g&&(x.referrerPolicy=g),r(Gd(new Mn(l,x))),w();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}h&&T.once("end",()=>{h.removeEventListener("abort",E)});let b=(0,Kt.pipeline)(T,new Kt.PassThrough,y=>{y&&n(y)});process.version<"v12.10"&&T.on("aborted",E);let u={url:i.url,status:T.statusCode,statusText:T.statusMessage,headers:$,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},p=$.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||p===null||T.statusCode===204||T.statusCode===304){_=new Zt(b,u),r(_);return}let c={flush:co.default.Z_SYNC_FLUSH,finishFlush:co.default.Z_SYNC_FLUSH};if(p==="gzip"||p==="x-gzip"){b=(0,Kt.pipeline)(b,co.default.createGunzip(c),y=>{y&&n(y)}),_=new Zt(b,u),r(_);return}if(p==="deflate"||p==="x-deflate"){let y=(0,Kt.pipeline)(T,new Kt.PassThrough,l=>{l&&n(l)});y.once("data",l=>{(l[0]&15)===8?b=(0,Kt.pipeline)(b,co.default.createInflate(),x=>{x&&n(x)}):b=(0,Kt.pipeline)(b,co.default.createInflateRaw(),x=>{x&&n(x)}),_=new Zt(b,u),r(_)}),y.once("end",()=>{_||(_=new Zt(b,u),r(_))});return}if(p==="br"){b=(0,Kt.pipeline)(b,co.default.createBrotliDecompress(),y=>{y&&n(y)}),_=new Zt(b,u),r(_);return}_=new Zt(b,u),r(_)}),tw(S,i).catch(n)})}function jD(t,e){let r=ms.Buffer.from(`0\r
22
+ `,s,`\r
23
+ `)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var da,ZN,KN,YP,JN,XP,Fd,di,Vn,gu=St(()=>{la();Md();({toStringTag:da,iterator:ZN,hasInstance:KN}=Symbol),YP=Math.random,JN="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),XP=i((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[da])?[(r=r!==void 0?r+"":e[da]=="File"?e.name:"blob",t),e.name!==r||e[da]=="blob"?new Bn([e],r,e):e]:[t,e+""]),"f"),Fd=i((t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r
24
+ `)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),di=i((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"),Vn=class{static{i(this,"FormData")}#e=[];constructor(...e){if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[da](){return"FormData"}[ZN](){return this.entries()}static[KN](e){return e&&typeof e=="object"&&e[da]==="FormData"&&!JN.some(r=>typeof e[r]!="function")}append(...e){di("append",arguments,2),this.#e.push(XP(...e))}delete(e){di("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){di("get",arguments,1),e+="";for(var r=this.#e,n=r.length,o=0;o<n;o++)if(r[o][0]===e)return r[o][1];return null}getAll(e,r){return di("getAll",arguments,1),r=[],e+="",this.#e.forEach(n=>n[0]===e&&r.push(n[1])),r}has(e){return di("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){di("forEach",arguments,1);for(var[n,o]of this)e.call(r,o,n,this)}set(...e){di("set",arguments,2);var r=[],n=!0;e=XP(...e),this.#e.forEach(o=>{o[0]===e[0]?n&&(n=!r.push(e)):r.push(o)}),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}};i(QP,"formDataToBlob")});var mn,yu=St(()=>{mn=class extends Error{static{i(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 Nt,Ld=St(()=>{yu();Nt=class extends mn{static{i(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var vu,jd,pa,ew,tw,rw,_u=St(()=>{vu=Symbol.toStringTag,jd=i(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[vu]==="URLSearchParams","isURLSearchParameters"),pa=i(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[vu]),"isBlob"),ew=i(t=>typeof t=="object"&&(t[vu]==="AbortSignal"||t[vu]==="EventTarget"),"isAbortSignal"),tw=i((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),rw=i((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var iw=L((lX,nw)=>{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)}nw.exports=globalThis.DOMException});var pi,ow,aw,qd,sw,uw,cw,lw,dw,pw,Pu,Bd=St(()=>{pi=require("node:fs"),ow=require("node:path"),aw=ue(iw(),1);Md();la();({stat:qd}=pi.promises),sw=i((t,e)=>dw((0,pi.statSync)(t),t,e),"blobFromSync"),uw=i((t,e)=>qd(t).then(r=>dw(r,t,e)),"blobFrom"),cw=i((t,e)=>qd(t).then(r=>pw(r,t,e)),"fileFrom"),lw=i((t,e)=>pw((0,pi.statSync)(t),t,e),"fileFromSync"),dw=i((t,e,r="")=>new Tr([new Pu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),pw=i((t,e,r="")=>new Bn([new Pu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,ow.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),Pu=class t{static{i(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 qd(this.#e);if(e>this.lastModified)throw new aw.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,pi.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var mw={};Ss(mw,{toFormData:()=>nk});function rk(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,(o,s)=>String.fromCharCode(s)),n}async function nk(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 Vd(r[1]||r[2]),o,s,p,m,h,v,P=[],x=new Vn,T=i(u=>{p+=E.decode(u,{stream:!0})},"onPartData"),w=i(u=>{P.push(u)},"appendToFile"),S=i(()=>{let u=new Bn(P,v,{type:h});x.append(m,u)},"appendFileToFormData"),D=i(()=>{x.append(m,p)},"appendEntryToFormData"),E=new TextDecoder("utf-8");E.decode(),n.onPartBegin=function(){n.onPartData=T,n.onPartEnd=D,o="",s="",p="",m="",h="",v=null,P.length=0},n.onHeaderField=function(u){o+=E.decode(u,{stream:!0})},n.onHeaderValue=function(u){s+=E.decode(u,{stream:!0})},n.onHeaderEnd=function(){if(s+=E.decode(),o=o.toLowerCase(),o==="content-disposition"){let u=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);u&&(m=u[2]||u[3]||""),v=rk(s),v&&(n.onPartData=w,n.onPartEnd=S)}else o==="content-type"&&(h=s);s="",o=""};for await(let u of t)n.write(u);return n.end(),x}var Fr,rt,fw,Gn,wu,bu,YN,fa,XN,QN,ek,tk,fi,Vd,hw=St(()=>{Bd();gu();Fr=0,rt={START_BOUNDARY:Fr++,HEADER_FIELD_START:Fr++,HEADER_FIELD:Fr++,HEADER_VALUE_START:Fr++,HEADER_VALUE:Fr++,HEADER_VALUE_ALMOST_DONE:Fr++,HEADERS_ALMOST_DONE:Fr++,PART_DATA_START:Fr++,PART_DATA:Fr++,END:Fr++},fw=1,Gn={PART_BOUNDARY:fw,LAST_BOUNDARY:fw*=2},wu=10,bu=13,YN=32,fa=45,XN=58,QN=97,ek=122,tk=i(t=>t|32,"lower"),fi=i(()=>{},"noop"),Vd=class{static{i(this,"MultipartParser")}constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=fi,this.onHeaderField=fi,this.onHeadersEnd=fi,this.onHeaderValue=fi,this.onPartBegin=fi,this.onPartData=fi,this.onPartEnd=fi,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=rt.START_BOUNDARY}write(e){let r=0,n=e.length,o=this.index,{lookbehind:s,boundary:p,boundaryChars:m,index:h,state:v,flags:P}=this,x=this.boundary.length,T=x-1,w=e.length,S,D,E=i(y=>{this[y+"Mark"]=r},"mark"),u=i(y=>{delete this[y+"Mark"]},"clear"),f=i((y,l,b,g)=>{(l===void 0||l!==b)&&this[y](g&&g.subarray(l,b))},"callback"),c=i((y,l)=>{let b=y+"Mark";b in this&&(l?(f(y,this[b],r,e),delete this[b]):(f(y,this[b],e.length,e),this[b]=0))},"dataCallback");for(r=0;r<n;r++)switch(S=e[r],v){case rt.START_BOUNDARY:if(h===p.length-2){if(S===fa)P|=Gn.LAST_BOUNDARY;else if(S!==bu)return;h++;break}else if(h-1===p.length-2){if(P&Gn.LAST_BOUNDARY&&S===fa)v=rt.END,P=0;else if(!(P&Gn.LAST_BOUNDARY)&&S===wu)h=0,f("onPartBegin"),v=rt.HEADER_FIELD_START;else return;break}S!==p[h+2]&&(h=-2),S===p[h+2]&&h++;break;case rt.HEADER_FIELD_START:v=rt.HEADER_FIELD,E("onHeaderField"),h=0;case rt.HEADER_FIELD:if(S===bu){u("onHeaderField"),v=rt.HEADERS_ALMOST_DONE;break}if(h++,S===fa)break;if(S===XN){if(h===1)return;c("onHeaderField",!0),v=rt.HEADER_VALUE_START;break}if(D=tk(S),D<QN||D>ek)return;break;case rt.HEADER_VALUE_START:if(S===YN)break;E("onHeaderValue"),v=rt.HEADER_VALUE;case rt.HEADER_VALUE:S===bu&&(c("onHeaderValue",!0),f("onHeaderEnd"),v=rt.HEADER_VALUE_ALMOST_DONE);break;case rt.HEADER_VALUE_ALMOST_DONE:if(S!==wu)return;v=rt.HEADER_FIELD_START;break;case rt.HEADERS_ALMOST_DONE:if(S!==wu)return;f("onHeadersEnd"),v=rt.PART_DATA_START;break;case rt.PART_DATA_START:v=rt.PART_DATA,E("onPartData");case rt.PART_DATA:if(o=h,h===0){for(r+=T;r<w&&!(e[r]in m);)r+=x;r-=T,S=e[r]}if(h<p.length)p[h]===S?(h===0&&c("onPartData",!0),h++):h=0;else if(h===p.length)h++,S===bu?P|=Gn.PART_BOUNDARY:S===fa?P|=Gn.LAST_BOUNDARY:h=0;else if(h-1===p.length)if(P&Gn.PART_BOUNDARY){if(h=0,S===wu){P&=~Gn.PART_BOUNDARY,f("onPartEnd"),f("onPartBegin"),v=rt.HEADER_FIELD_START;break}}else P&Gn.LAST_BOUNDARY&&S===fa?(f("onPartEnd"),v=rt.END,P=0):h=0;if(h>0)s[h-1]=S;else if(o>0){let y=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);f("onPartData",0,o,y),o=0,E("onPartData"),r--}break;case rt.END:break;default:throw new Error(`Unexpected state entered: ${v}`)}c("onHeaderField"),c("onHeaderValue"),c("onPartData"),this.index=h,this.state=v,this.flags=P}end(){if(this.state===rt.HEADER_FIELD_START&&this.index===0||this.state===rt.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==rt.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};i(rk,"_fileName");i(nk,"toFormData")});async function Gd(t){if(t[Lt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Lt].disturbed=!0,t[Lt].error)throw t[Lt].error;let{body:e}=t;if(e===null)return Jt.Buffer.alloc(0);if(!(e instanceof fr.default))return Jt.Buffer.alloc(0);let r=[],n=0;try{for await(let o of e){if(t.size>0&&n+o.length>t.size){let s=new Nt(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}n+=o.length,r.push(o)}}catch(o){throw o instanceof mn?o:new Nt(`Invalid response body while trying to fetch ${t.url}: ${o.message}`,"system",o)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(o=>typeof o=="string")?Jt.Buffer.from(r.join("")):Jt.Buffer.concat(r,n)}catch(o){throw new Nt(`Could not create Buffer from response body for ${t.url}: ${o.message}`,"system",o)}else throw new Nt(`Premature close of server response while trying to fetch ${t.url}`)}var fr,hn,Jt,ik,Lt,Lr,to,ok,Tu,gw,yw,Su=St(()=>{fr=ue(require("node:stream"),1),hn=require("node:util"),Jt=require("node:buffer");la();gu();Ld();yu();_u();ik=(0,hn.promisify)(fr.default.pipeline),Lt=Symbol("Body internals"),Lr=class{static{i(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:jd(e)?e=Jt.Buffer.from(e.toString()):pa(e)||Jt.Buffer.isBuffer(e)||(hn.types.isAnyArrayBuffer(e)?e=Jt.Buffer.from(e):ArrayBuffer.isView(e)?e=Jt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof fr.default||(e instanceof Vn?(e=QP(e),n=e.type.split("=")[1]):e=Jt.Buffer.from(String(e))));let o=e;Jt.Buffer.isBuffer(e)?o=fr.default.Readable.from(e):pa(e)&&(o=fr.default.Readable.from(e.stream())),this[Lt]={body:e,stream:o,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof fr.default&&e.on("error",s=>{let p=s instanceof mn?s:new Nt(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[Lt].error=p})}get body(){return this[Lt].stream}get bodyUsed(){return this[Lt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await Gd(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 Vn,o=new URLSearchParams(await this.text());for(let[s,p]of o)n.append(s,p);return n}let{toFormData:r}=await Promise.resolve().then(()=>(hw(),mw));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Lt].body&&this[Lt].body.type||"",r=await this.arrayBuffer();return new Tr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await Gd(this);return new TextDecoder().decode(e)}buffer(){return Gd(this)}};Lr.prototype.buffer=(0,hn.deprecate)(Lr.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Lr.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,hn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});i(Gd,"consumeBody");to=i((t,e)=>{let r,n,{body:o}=t[Lt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof fr.default&&typeof o.getBoundary!="function"&&(r=new fr.PassThrough({highWaterMark:e}),n=new fr.PassThrough({highWaterMark:e}),o.pipe(r),o.pipe(n),t[Lt].stream=r,o=n),o},"clone"),ok=(0,hn.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"),Tu=i((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":jd(t)?"application/x-www-form-urlencoded;charset=UTF-8":pa(t)?t.type||null:Jt.Buffer.isBuffer(t)||hn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Vn?`multipart/form-data; boundary=${e[Lt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${ok(t)}`:t instanceof fr.default?null:"text/plain;charset=UTF-8","extractContentType"),gw=i(t=>{let{body:e}=t[Lt];return e===null?0:pa(e)?e.size:Jt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),yw=i(async(t,{body:e})=>{e===null?t.end():await ik(e,t)},"writeToStream")});function vw(t=[]){return new jt(t.reduce((e,r,n,o)=>(n%2===0&&e.push(o.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return xu(e),Wd(e,String(r)),!0}catch{return!1}}))}var Hd,ma,xu,Wd,jt,Eu=St(()=>{Hd=require("node:util"),ma=ue(require("node:http"),1),xu=typeof ma.default.validateHeaderName=="function"?ma.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}},Wd=typeof ma.default.validateHeaderValue=="function"?ma.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}},jt=class t extends URLSearchParams{static{i(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[o,s]of Object.entries(n))r.push(...s.map(p=>[o,p]))}else if(e!=null)if(typeof e=="object"&&!Hd.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(o=>{if(typeof o!="object"||Hd.types.isBoxedPrimitive(o))throw new TypeError("Each header pair must be an iterable object");return[...o]}).map(o=>{if(o.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...o]})}}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,o])=>(xu(n),Wd(n,String(o)),[String(n).toLowerCase(),String(o)])):void 0,super(r),new Proxy(this,{get(n,o,s){switch(o){case"append":case"set":return(p,m)=>(xu(p),Wd(p,String(m)),URLSearchParams.prototype[o].call(n,String(p).toLowerCase(),String(m)));case"delete":case"has":case"getAll":return p=>(xu(p),URLSearchParams.prototype[o].call(n,String(p).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,o,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(jt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));i(vw,"fromRawHeaders")});var ak,ha,Zd=St(()=>{ak=new Set([301,302,303,307,308]),ha=i(t=>ak.has(t),"isRedirect")});var Sr,Yt,_w=St(()=>{Eu();Su();Zd();Sr=Symbol("Response internals"),Yt=class t extends Lr{static{i(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,o=new jt(r.headers);if(e!==null&&!o.has("Content-Type")){let s=Tu(e,this);s&&o.append("Content-Type",s)}this[Sr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:o,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Sr].type}get url(){return this[Sr].url||""}get status(){return this[Sr].status}get ok(){return this[Sr].status>=200&&this[Sr].status<300}get redirected(){return this[Sr].counter>0}get statusText(){return this[Sr].statusText}get headers(){return this[Sr].headers}get highWaterMark(){return this[Sr].highWaterMark}clone(){return new t(to(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(!ha(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[Sr].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 o=new jt(r&&r.headers);return o.has("content-type")||o.set("content-type","application/json"),new t(n,{...r,headers:o})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Yt.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 Pw,ww=St(()=>{Pw=i(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 bw(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 Ew(t){if(!Sw.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function sk(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,Tw.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 ro(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:sk(t)}function Iw(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 o=t.referrer,s=bw(o),p=bw(o,!0);s.toString().length>4096&&(s=p),e&&(s=e(s)),r&&(p=r(p));let m=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return p;case"unsafe-url":return s;case"strict-origin":return ro(s)&&!ro(m)?"no-referrer":p.toString();case"strict-origin-when-cross-origin":return s.origin===m.origin?s:ro(s)&&!ro(m)?"no-referrer":p;case"same-origin":return s.origin===m.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===m.origin?s:p;case"no-referrer-when-downgrade":return ro(s)&&!ro(m)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function Aw(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&Sw.has(n)&&(r=n);return r}var Tw,Sw,xw,Kd=St(()=>{Tw=require("node:net");i(bw,"stripURLForUseAsAReferrer");Sw=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),xw="strict-origin-when-cross-origin";i(Ew,"validateReferrerPolicy");i(sk,"isOriginPotentiallyTrustworthy");i(ro,"isUrlPotentiallyTrustworthy");i(Iw,"determineRequestsReferrer");i(Aw,"parseReferrerPolicyFromHeader")});var Rw,Dw,At,ga,uk,Hn,$w,Ow=St(()=>{Rw=require("node:url"),Dw=require("node:util");Eu();Su();_u();ww();Kd();At=Symbol("Request internals"),ga=i(t=>typeof t=="object"&&typeof t[At]=="object","isRequest"),uk=(0,Dw.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Hn=class t extends Lr{static{i(this,"Request")}constructor(e,r={}){let n;if(ga(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 o=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(o)&&(o=o.toUpperCase()),!ga(r)&&"data"in r&&uk(),(r.body!=null||ga(e)&&e.body!==null)&&(o==="GET"||o==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:ga(e)&&e.body!==null?to(e):null;super(s,{size:r.size||e.size||0});let p=new jt(r.headers||e.headers||{});if(s!==null&&!p.has("Content-Type")){let v=Tu(s,this);v&&p.set("Content-Type",v)}let m=ga(e)?e.signal:null;if("signal"in r&&(m=r.signal),m!=null&&!ew(m))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let h=r.referrer==null?e.referrer:r.referrer;if(h==="")h="no-referrer";else if(h){let v=new URL(h);h=/^about:(\/\/)?client$/.test(v)?"client":v}else h=void 0;this[At]={method:o,redirect:r.redirect||e.redirect||"follow",headers:p,parsedURL:n,signal:m,referrer:h},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[At].method}get url(){return(0,Rw.format)(this[At].parsedURL)}get headers(){return this[At].headers}get redirect(){return this[At].redirect}get signal(){return this[At].signal}get referrer(){if(this[At].referrer==="no-referrer")return"";if(this[At].referrer==="client")return"about:client";if(this[At].referrer)return this[At].referrer.toString()}get referrerPolicy(){return this[At].referrerPolicy}set referrerPolicy(e){this[At].referrerPolicy=Ew(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Hn.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}});$w=i(t=>{let{parsedURL:e}=t[At],r=new jt(t[At].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 m=gw(t);typeof m=="number"&&!Number.isNaN(m)&&(n=String(m))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=xw),t.referrer&&t.referrer!=="no-referrer"?t[At].referrer=Iw(t):t[At].referrer="no-referrer",t[At].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:o}=t;typeof o=="function"&&(o=o(e));let s=Pw(e),p={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:o};return{parsedURL:e,options:p}},"getNodeRequestOptions")});var ya,Cw=St(()=>{yu();ya=class extends mn{static{i(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var zw={};Ss(zw,{AbortError:()=>ya,Blob:()=>Tr,FetchError:()=>Nt,File:()=>Bn,FormData:()=>Vn,Headers:()=>jt,Request:()=>Hn,Response:()=>Yt,blobFrom:()=>uw,blobFromSync:()=>sw,default:()=>Jd,fileFrom:()=>cw,fileFromSync:()=>lw,isRedirect:()=>ha});async function Jd(t,e){return new Promise((r,n)=>{let o=new Hn(t,e),{parsedURL:s,options:p}=$w(o);if(!ck.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let S=VP(o.url),D=new Yt(S,{headers:{"Content-Type":S.typeFull}});r(D);return}let m=(s.protocol==="https:"?kw.default:Nw.default).request,{signal:h}=o,v=null,P=i(()=>{let S=new ya("The operation was aborted.");n(S),o.body&&o.body instanceof Xt.default.Readable&&o.body.destroy(S),!(!v||!v.body)&&v.body.emit("error",S)},"abort");if(h&&h.aborted){P();return}let x=i(()=>{P(),w()},"abortAndFinalize"),T=m(s.toString(),p);h&&h.addEventListener("abort",x);let w=i(()=>{T.abort(),h&&h.removeEventListener("abort",x)},"finalize");T.on("error",S=>{n(new Nt(`request to ${o.url} failed, reason: ${S.message}`,"system",S)),w()}),lk(T,S=>{v&&v.body&&v.body.destroy(S)}),process.version<"v14"&&T.on("socket",S=>{let D;S.prependListener("end",()=>{D=S._eventsCount}),S.prependListener("close",E=>{if(v&&D<S._eventsCount&&!E){let u=new Error("Premature close");u.code="ERR_STREAM_PREMATURE_CLOSE",v.body.emit("error",u)}})}),T.on("response",S=>{T.setTimeout(0);let D=vw(S.rawHeaders);if(ha(S.statusCode)){let y=D.get("Location"),l=null;try{l=y===null?null:new URL(y,o.url)}catch{if(o.redirect!=="manual"){n(new Nt(`uri requested responds with an invalid redirect URL: ${y}`,"invalid-redirect")),w();return}}switch(o.redirect){case"error":n(new Nt(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),w();return;case"manual":break;case"follow":{if(l===null)break;if(o.counter>=o.follow){n(new Nt(`maximum redirect reached at: ${o.url}`,"max-redirect")),w();return}let b={headers:new jt(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:to(o),signal:o.signal,size:o.size,referrer:o.referrer,referrerPolicy:o.referrerPolicy};if(!tw(o.url,l)||!rw(o.url,l))for(let oe of["authorization","www-authenticate","cookie","cookie2"])b.headers.delete(oe);if(S.statusCode!==303&&o.body&&e.body instanceof Xt.default.Readable){n(new Nt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),w();return}(S.statusCode===303||(S.statusCode===301||S.statusCode===302)&&o.method==="POST")&&(b.method="GET",b.body=void 0,b.headers.delete("content-length"));let g=Aw(D);g&&(b.referrerPolicy=g),r(Jd(new Hn(l,b))),w();return}default:return n(new TypeError(`Redirect option '${o.redirect}' is not a valid value of RequestRedirect`))}}h&&S.once("end",()=>{h.removeEventListener("abort",x)});let E=(0,Xt.pipeline)(S,new Xt.PassThrough,y=>{y&&n(y)});process.version<"v12.10"&&S.on("aborted",x);let u={url:o.url,status:S.statusCode,statusText:S.statusMessage,headers:D,size:o.size,counter:o.counter,highWaterMark:o.highWaterMark},f=D.get("Content-Encoding");if(!o.compress||o.method==="HEAD"||f===null||S.statusCode===204||S.statusCode===304){v=new Yt(E,u),r(v);return}let c={flush:mi.default.Z_SYNC_FLUSH,finishFlush:mi.default.Z_SYNC_FLUSH};if(f==="gzip"||f==="x-gzip"){E=(0,Xt.pipeline)(E,mi.default.createGunzip(c),y=>{y&&n(y)}),v=new Yt(E,u),r(v);return}if(f==="deflate"||f==="x-deflate"){let y=(0,Xt.pipeline)(S,new Xt.PassThrough,l=>{l&&n(l)});y.once("data",l=>{(l[0]&15)===8?E=(0,Xt.pipeline)(E,mi.default.createInflate(),b=>{b&&n(b)}):E=(0,Xt.pipeline)(E,mi.default.createInflateRaw(),b=>{b&&n(b)}),v=new Yt(E,u),r(v)}),y.once("end",()=>{v||(v=new Yt(E,u),r(v))});return}if(f==="br"){E=(0,Xt.pipeline)(E,mi.default.createBrotliDecompress(),y=>{y&&n(y)}),v=new Yt(E,u),r(v);return}v=new Yt(E,u),r(v)}),yw(T,o).catch(n)})}function lk(t,e){let r=va.Buffer.from(`0\r
26
26
  \r
27
- `),n=!1,i=!1,a;t.on("response",f=>{let{headers:m}=f;n=m["transfer-encoding"]==="chunked"&&!m["content-length"]}),t.on("socket",f=>{let m=o(()=>{if(n&&!i){let _=new Error("Premature close");_.code="ERR_STREAM_PREMATURE_CLOSE",e(_)}},"onSocketClose"),h=o(_=>{i=ms.Buffer.compare(_.slice(-5),r)===0,!i&&a&&(i=ms.Buffer.compare(a.slice(-3),r.slice(0,3))===0&&ms.Buffer.compare(_.slice(-2),r.slice(3))===0),a=_},"onData");f.prependListener("close",m),f.on("data",h),t.on("close",()=>{f.removeListener("close",m),f.removeListener("data",h)})})}var vw,_w,co,Kt,ms,kD,ww=Pt(()=>{vw=ze(require("node:http"),1),_w=ze(require("node:https"),1),co=ze(require("node:zlib"),1),Kt=ze(require("node:stream"),1),ms=require("node:buffer");RP();Pu();nw();xu();gw();zd();yw();Bd();pu();hu();Vd();jd();kD=new Set(["data:","http:","https:"]);o(Gd,"fetch");o(jD,"fixResponseChunkedTransferBadEnding")});var Tw=M(ri=>{"use strict";var MD=ri&&ri.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},ti;Object.defineProperty(ri,"__esModule",{value:!0});ri.Gaxios=void 0;var FD=MD(os()),LD=require("https"),lo=wd(),qD=rP(),xw=require("stream"),Sw=Td(),BD=o(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),VD=204,Su=class{static{o(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new Sw.GaxiosInterceptorManager,response:new Sw.GaxiosInterceptorManager}}fetch(...e){let r=e[0],n=e[1],i,a=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&&ti.mergeHeaders(a,r.headers),n&&ti.mergeHeaders(a,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:a,url:i}):this.request({...n,headers:a,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 ti.#u(),n={...e};delete n.data;let i=await r(e.url,n),a=await this.getResponseData(e,i);return Object.getOwnPropertyDescriptor(i,"data")?.configurable||Object.defineProperties(i,{data:{configurable:!0,writable:!0,enumerable:!0,value:a}}),Object.assign(i,{config:e,data:a})}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 a of r.data)i.push(a);r.data=i.toString()}let n=lo.GaxiosError.extractAPIErrorFromResponse(r,`Request failed with status code ${r.status}`);throw new lo.GaxiosError(n?.message,e,r,n)}return r}catch(r){let n;r instanceof lo.GaxiosError?n=r:r instanceof Error?n=new lo.GaxiosError(r.message,e,void 0,r):n=new lo.GaxiosError("Unexpected Gaxios Error",e,void 0,r);let{shouldRetry:i,config:a}=await(0,qD.getRetryConfig)(n);if(i&&a)return n.config.retryConfig.currentRetryAttempt=a.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===VD)return"";if(e.maxContentLength&&r.headers.has("content-length")&&e.maxContentLength<Number.parseInt(r.headers?.get("content-length")||""))throw new lo.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],a=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let f of a)i.push(f.trim());for(let f of i)if(f instanceof RegExp){if(f.test(n.toString()))return!1}else if(f instanceof URL){if(f.origin===n.origin)return!1}else if(f.startsWith("*.")||f.startsWith(".")){let m=f.replace(/^\*\./,".");if(n.hostname.endsWith(m))return!1}else if(f===n.origin||f===n.hostname||f===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);ti.mergeHeaders(r,e.headers);let n=(0,FD.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 f=n.paramsSerializer(n.params);f.startsWith("?")&&(f=f.slice(1));let m=n.url.toString().includes("?")?"&":"?";n.url=n.url+m+f}else{let f=n.url instanceof URL?n.url:new URL(n.url);for(let[m,h]of new URLSearchParams(n.params))f.searchParams.append(m,h);n.url=f}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 xw.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 f=await BD();r.set("content-type",`multipart/related; boundary=${f}`),n.body=xw.Readable.from(this.getMultipartRequest(n.multipart,f))}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 a=n.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!n.agent)if(a&&this.#e(n.url,n.noProxy)){let f=await ti.#a();this.agentCache.has(a)?n.agent=this.agentCache.get(a):(n.agent=new f(a,{cert:n.cert,key:n.key}),this.agentCache.set(a,n.agent))}else n.cert&&n.key&&(this.agentCache.has(n.key)?n.agent=this.agentCache.get(n.key):(n.agent=new LD.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!="function"&&n.errorRedactor!==!1&&(n.errorRedactor=lo.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 a=i.headers.get("Content-Type")||"application/octet-stream";yield`--${r}\r
28
- Content-Type: ${a}\r
27
+ `),n=!1,o=!1,s;t.on("response",p=>{let{headers:m}=p;n=m["transfer-encoding"]==="chunked"&&!m["content-length"]}),t.on("socket",p=>{let m=i(()=>{if(n&&!o){let v=new Error("Premature close");v.code="ERR_STREAM_PREMATURE_CLOSE",e(v)}},"onSocketClose"),h=i(v=>{o=va.Buffer.compare(v.slice(-5),r)===0,!o&&s&&(o=va.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&va.Buffer.compare(v.slice(-2),r.slice(3))===0),s=v},"onData");p.prependListener("close",m),p.on("data",h),t.on("close",()=>{p.removeListener("close",m),p.removeListener("data",h)})})}var Nw,kw,mi,Xt,va,ck,Uw=St(()=>{Nw=ue(require("node:http"),1),kw=ue(require("node:https"),1),mi=ue(require("node:zlib"),1),Xt=ue(require("node:stream"),1),va=require("node:buffer");GP();Su();_w();Eu();Ow();Ld();Cw();Zd();gu();_u();Kd();Bd();ck=new Set(["data:","http:","https:"]);i(Jd,"fetch");i(lk,"fixResponseChunkedTransferBadEnding")});var Lw=L(io=>{"use strict";var dk=io&&io.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},no;Object.defineProperty(io,"__esModule",{value:!0});io.Gaxios=void 0;var pk=dk(ua()),fk=require("https"),hi=Ed(),mk=vP(),Mw=require("stream"),Fw=Rd(),hk=i(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),gk=204,Iu=class{static{i(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new Fw.GaxiosInterceptorManager,response:new Fw.GaxiosInterceptorManager}}fetch(...e){let r=e[0],n=e[1],o,s=new Headers;return typeof r=="string"?o=new URL(r):r instanceof URL?o=r:r&&r.url&&(o=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&no.mergeHeaders(s,r.headers),n&&no.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:o}):this.request({...n,headers:s,url:o})}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 no.#u(),n={...e};delete n.data;let o=await r(e.url,n),s=await this.getResponseData(e,o);return Object.getOwnPropertyDescriptor(o,"data")?.configurable||Object.defineProperties(o,{data:{configurable:!0,writable:!0,enumerable:!0,value:s}}),Object.assign(o,{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 o=[];for await(let s of r.data)o.push(s);r.data=o.toString()}let n=hi.GaxiosError.extractAPIErrorFromResponse(r,`Request failed with status code ${r.status}`);throw new hi.GaxiosError(n?.message,e,r,n)}return r}catch(r){let n;r instanceof hi.GaxiosError?n=r:r instanceof Error?n=new hi.GaxiosError(r.message,e,void 0,r):n=new hi.GaxiosError("Unexpected Gaxios Error",e,void 0,r);let{shouldRetry:o,config:s}=await(0,mk.getRetryConfig)(n);if(o&&s)return n.config.retryConfig.currentRetryAttempt=s.retryConfig.currentRetryAttempt,e.retryConfig=n.config?.retryConfig,this.#i(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(n),n}}async getResponseData(e,r){if(r.status===gk)return"";if(e.maxContentLength&&r.headers.has("content-length")&&e.maxContentLength<Number.parseInt(r.headers?.get("content-length")||""))throw new hi.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),o=[...r],s=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let p of s)o.push(p.trim());for(let p of o)if(p instanceof RegExp){if(p.test(n.toString()))return!1}else if(p instanceof URL){if(p.origin===n.origin)return!1}else if(p.startsWith("*.")||p.startsWith(".")){let m=p.replace(/^\*\./,".");if(n.hostname.endsWith(m))return!1}else if(p===n.origin||p===n.hostname||p===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);no.mergeHeaders(r,e.headers);let n=(0,pk.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 p=n.paramsSerializer(n.params);p.startsWith("?")&&(p=p.slice(1));let m=n.url.toString().includes("?")?"&":"?";n.url=n.url+m+p}else{let p=n.url instanceof URL?n.url:new URL(n.url);for(let[m,h]of new URLSearchParams(n.params))p.searchParams.append(m,h);n.url=p}typeof e.maxContentLength=="number"&&(n.size=e.maxContentLength),typeof e.maxRedirects=="number"&&(n.follow=e.maxRedirects);let o=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 Mw.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 p=await hk();r.set("content-type",`multipart/related; boundary=${p}`),n.body=Mw.Readable.from(this.getMultipartRequest(n.multipart,p))}else o?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 p=await no.#s();this.agentCache.has(s)?n.agent=this.agentCache.get(s):(n.agent=new p(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 fk.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!="function"&&n.errorRedactor!==!1&&(n.errorRedactor=hi.defaultErrorRedactor),n.body&&!("duplex"in n)&&(n.duplex="half"),this.#i(n),Object.assign(n,{headers:r,url:n.url instanceof URL?n.url:new URL(n.url)})}#i(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 o of e){let s=o.headers.get("Content-Type")||"application/octet-stream";yield`--${r}\r
28
+ Content-Type: ${s}\r
29
29
  \r
30
- `,typeof i.content=="string"?yield i.content:yield*i.content,yield`\r
31
- `}yield n}static#i;static#s;static async#a(){return this.#i||=(await Promise.resolve().then(()=>ze(AP()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#s||=e?window.fetch:(await Promise.resolve().then(()=>(ww(),Pw))).default,this.#s}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((a,f)=>{f==="set-cookie"?e.append(f,a):e.set(f,a)});return e}};ri.Gaxios=Su;ti=Su});var pt=M(Dt=>{"use strict";var GD=Dt&&Dt.__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]}),HD=Dt&&Dt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&GD(e,t,r)};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.instance=Dt.Gaxios=Dt.GaxiosError=void 0;Dt.request=ZD;var Ew=Tw();Object.defineProperty(Dt,"Gaxios",{enumerable:!0,get:o(function(){return Ew.Gaxios},"get")});var WD=wd();Object.defineProperty(Dt,"GaxiosError",{enumerable:!0,get:o(function(){return WD.GaxiosError},"get")});HD(Td(),Dt);Dt.instance=new Ew.Gaxios;async function ZD(t){return Dt.instance.request(t)}o(ZD,"request")});var Hd=M((bw,Tu)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,a="[BigNumber Error] ",f=a+"Number primitive has more than 15 significant digits: ",m=1e14,h=14,_=9007199254740991,P=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],E=1e7,S=1e9;function w(l){var x,g,re,ee=te.prototype={constructor:te,toString:null,valueOf:null},Te=new te(1),ne=20,K=4,Z=-7,Q=21,X=-1e7,ie=1e7,ae=!1,Ie=1,De=0,We={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Xe="0123456789abcdefghijklmnopqrstuvwxyz",_t=!0;function te(A,O){var D,L,z,j,G,N,U,B,F=this;if(!(F instanceof te))return new te(A,O);if(O==null){if(A&&A._isBigNumber===!0){F.s=A.s,!A.c||A.e>ie?F.c=F.e=null:A.e<X?F.c=[F.e=0]:(F.e=A.e,F.c=A.c.slice());return}if((N=typeof A=="number")&&A*0==0){if(F.s=1/A<0?(A=-A,-1):1,A===~~A){for(j=0,G=A;G>=10;G/=10,j++);j>ie?F.c=F.e=null:(F.e=j,F.c=[A]);return}B=String(A)}else{if(!r.test(B=String(A)))return re(F,B,N);F.s=B.charCodeAt(0)==45?(B=B.slice(1),-1):1}(j=B.indexOf("."))>-1&&(B=B.replace(".","")),(G=B.search(/e/i))>0?(j<0&&(j=G),j+=+B.slice(G+1),B=B.substring(0,G)):j<0&&(j=B.length)}else{if(u(O,2,Xe.length,"Base"),O==10&&_t)return F=new te(A),He(F,ne+F.e+1,K);if(B=String(A),N=typeof A=="number"){if(A*0!=0)return re(F,B,N,O);if(F.s=1/A<0?(B=B.slice(1),-1):1,te.DEBUG&&B.replace(/^0\.0*|\./,"").length>15)throw Error(f+A)}else F.s=B.charCodeAt(0)===45?(B=B.slice(1),-1):1;for(D=Xe.slice(0,O),j=G=0,U=B.length;G<U;G++)if(D.indexOf(L=B.charAt(G))<0){if(L=="."){if(G>j){j=U;continue}}else if(!z&&(B==B.toUpperCase()&&(B=B.toLowerCase())||B==B.toLowerCase()&&(B=B.toUpperCase()))){z=!0,G=-1,j=0;continue}return re(F,String(A),N,O)}N=!1,B=g(B,O,10,F.s),(j=B.indexOf("."))>-1?B=B.replace(".",""):j=B.length}for(G=0;B.charCodeAt(G)===48;G++);for(U=B.length;B.charCodeAt(--U)===48;);if(B=B.slice(G,++U)){if(U-=G,N&&te.DEBUG&&U>15&&(A>_||A!==i(A)))throw Error(f+F.s*A);if((j=j-G-1)>ie)F.c=F.e=null;else if(j<X)F.c=[F.e=0];else{if(F.e=j,F.c=[],G=(j+1)%h,j<0&&(G+=h),G<U){for(G&&F.c.push(+B.slice(0,G)),U-=h;G<U;)F.c.push(+B.slice(G,G+=h));G=h-(B=B.slice(G)).length}else G-=U;for(;G--;B+="0");F.c.push(+B)}}else F.c=[F.e=0]}o(te,"BigNumber"),te.clone=w,te.ROUND_UP=0,te.ROUND_DOWN=1,te.ROUND_CEIL=2,te.ROUND_FLOOR=3,te.ROUND_HALF_UP=4,te.ROUND_HALF_DOWN=5,te.ROUND_HALF_EVEN=6,te.ROUND_HALF_CEIL=7,te.ROUND_HALF_FLOOR=8,te.EUCLID=9,te.config=te.set=function(A){var O,D;if(A!=null)if(typeof A=="object"){if(A.hasOwnProperty(O="DECIMAL_PLACES")&&(D=A[O],u(D,0,S,O),ne=D),A.hasOwnProperty(O="ROUNDING_MODE")&&(D=A[O],u(D,0,8,O),K=D),A.hasOwnProperty(O="EXPONENTIAL_AT")&&(D=A[O],D&&D.pop?(u(D[0],-S,0,O),u(D[1],0,S,O),Z=D[0],Q=D[1]):(u(D,-S,S,O),Z=-(Q=D<0?-D:D))),A.hasOwnProperty(O="RANGE"))if(D=A[O],D&&D.pop)u(D[0],-S,-1,O),u(D[1],1,S,O),X=D[0],ie=D[1];else if(u(D,-S,S,O),D)X=-(ie=D<0?-D:D);else throw Error(a+O+" cannot be zero: "+D);if(A.hasOwnProperty(O="CRYPTO"))if(D=A[O],D===!!D)if(D)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ae=D;else throw ae=!D,Error(a+"crypto unavailable");else ae=D;else throw Error(a+O+" not true or false: "+D);if(A.hasOwnProperty(O="MODULO_MODE")&&(D=A[O],u(D,0,9,O),Ie=D),A.hasOwnProperty(O="POW_PRECISION")&&(D=A[O],u(D,0,S,O),De=D),A.hasOwnProperty(O="FORMAT"))if(D=A[O],typeof D=="object")We=D;else throw Error(a+O+" not an object: "+D);if(A.hasOwnProperty(O="ALPHABET"))if(D=A[O],typeof D=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(D))_t=D.slice(0,10)=="0123456789",Xe=D;else throw Error(a+O+" invalid: "+D)}else throw Error(a+"Object expected: "+A);return{DECIMAL_PLACES:ne,ROUNDING_MODE:K,EXPONENTIAL_AT:[Z,Q],RANGE:[X,ie],CRYPTO:ae,MODULO_MODE:Ie,POW_PRECISION:De,FORMAT:We,ALPHABET:Xe}},te.isBigNumber=function(A){if(!A||A._isBigNumber!==!0)return!1;if(!te.DEBUG)return!0;var O,D,L=A.c,z=A.e,j=A.s;e:if({}.toString.call(L)=="[object Array]"){if((j===1||j===-1)&&z>=-S&&z<=S&&z===i(z)){if(L[0]===0){if(z===0&&L.length===1)return!0;break e}if(O=(z+1)%h,O<1&&(O+=h),String(L[0]).length==O){for(O=0;O<L.length;O++)if(D=L[O],D<0||D>=m||D!==i(D))break e;if(D!==0)return!0}}}else if(L===null&&z===null&&(j===null||j===1||j===-1))return!0;throw Error(a+"Invalid BigNumber: "+A)},te.maximum=te.max=function(){return dt(arguments,-1)},te.minimum=te.min=function(){return dt(arguments,1)},te.random=function(){var A=9007199254740992,O=Math.random()*A&2097151?function(){return i(Math.random()*A)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(D){var L,z,j,G,N,U=0,B=[],F=new te(Te);if(D==null?D=ne:u(D,0,S),G=n(D/h),ae)if(crypto.getRandomValues){for(L=crypto.getRandomValues(new Uint32Array(G*=2));U<G;)N=L[U]*131072+(L[U+1]>>>11),N>=9e15?(z=crypto.getRandomValues(new Uint32Array(2)),L[U]=z[0],L[U+1]=z[1]):(B.push(N%1e14),U+=2);U=G/2}else if(crypto.randomBytes){for(L=crypto.randomBytes(G*=7);U<G;)N=(L[U]&31)*281474976710656+L[U+1]*1099511627776+L[U+2]*4294967296+L[U+3]*16777216+(L[U+4]<<16)+(L[U+5]<<8)+L[U+6],N>=9e15?crypto.randomBytes(7).copy(L,U):(B.push(N%1e14),U+=7);U=G/7}else throw ae=!1,Error(a+"crypto unavailable");if(!ae)for(;U<G;)N=O(),N<9e15&&(B[U++]=N%1e14);for(G=B[--U],D%=h,G&&D&&(N=P[h-D],B[U]=i(G/N)*N);B[U]===0;B.pop(),U--);if(U<0)B=[j=0];else{for(j=-1;B[0]===0;B.splice(0,1),j-=h);for(U=1,N=B[0];N>=10;N/=10,U++);U<h&&(j-=h-U)}return F.e=j,F.c=B,F}}(),te.sum=function(){for(var A=1,O=arguments,D=new te(O[0]);A<O.length;)D=D.plus(O[A++]);return D},g=function(){var A="0123456789";function O(D,L,z,j){for(var G,N=[0],U,B=0,F=D.length;B<F;){for(U=N.length;U--;N[U]*=L);for(N[0]+=j.indexOf(D.charAt(B++)),G=0;G<N.length;G++)N[G]>z-1&&(N[G+1]==null&&(N[G+1]=0),N[G+1]+=N[G]/z|0,N[G]%=z)}return N.reverse()}return o(O,"toBaseOut"),function(D,L,z,j,G){var N,U,B,F,J,ue,le,Fe,rt=D.indexOf("."),nt=ne,Me=K;for(rt>=0&&(F=De,De=0,D=D.replace(".",""),Fe=new te(L),ue=Fe.pow(D.length-rt),De=F,Fe.c=O(y($(ue.c),ue.e,"0"),10,z,A),Fe.e=Fe.c.length),le=O(D,L,z,G?(N=Xe,A):(N=A,Xe)),B=F=le.length;le[--F]==0;le.pop());if(!le[0])return N.charAt(0);if(rt<0?--B:(ue.c=le,ue.e=B,ue.s=j,ue=x(ue,Fe,nt,Me,z),le=ue.c,J=ue.r,B=ue.e),U=B+nt+1,rt=le[U],F=z/2,J=J||U<0||le[U+1]!=null,J=Me<4?(rt!=null||J)&&(Me==0||Me==(ue.s<0?3:2)):rt>F||rt==F&&(Me==4||J||Me==6&&le[U-1]&1||Me==(ue.s<0?8:7)),U<1||!le[0])D=J?y(N.charAt(1),-nt,N.charAt(0)):N.charAt(0);else{if(le.length=U,J)for(--z;++le[--U]>z;)le[U]=0,U||(++B,le=[1].concat(le));for(F=le.length;!le[--F];);for(rt=0,D="";rt<=F;D+=N.charAt(le[rt++]));D=y(D,B,N.charAt(0))}return D}}(),x=function(){function A(L,z,j){var G,N,U,B,F=0,J=L.length,ue=z%E,le=z/E|0;for(L=L.slice();J--;)U=L[J]%E,B=L[J]/E|0,G=le*U+B*ue,N=ue*U+G%E*E+F,F=(N/j|0)+(G/E|0)+le*B,L[J]=N%j;return F&&(L=[F].concat(L)),L}o(A,"multiply");function O(L,z,j,G){var N,U;if(j!=G)U=j>G?1:-1;else for(N=U=0;N<j;N++)if(L[N]!=z[N]){U=L[N]>z[N]?1:-1;break}return U}o(O,"compare");function D(L,z,j,G){for(var N=0;j--;)L[j]-=N,N=L[j]<z[j]?1:0,L[j]=N*G+L[j]-z[j];for(;!L[0]&&L.length>1;L.splice(0,1));}return o(D,"subtract"),function(L,z,j,G,N){var U,B,F,J,ue,le,Fe,rt,nt,Me,Ge,gt,Po,wo,xo,qt,Kr,bt=L.s==z.s?1:-1,yt=L.c,Ke=z.c;if(!yt||!yt[0]||!Ke||!Ke[0])return new te(!L.s||!z.s||(yt?Ke&&yt[0]==Ke[0]:!Ke)?NaN:yt&&yt[0]==0||!Ke?bt*0:bt/0);for(rt=new te(bt),nt=rt.c=[],B=L.e-z.e,bt=j+B+1,N||(N=m,B=T(L.e/h)-T(z.e/h),bt=bt/h|0),F=0;Ke[F]==(yt[F]||0);F++);if(Ke[F]>(yt[F]||0)&&B--,bt<0)nt.push(1),J=!0;else{for(wo=yt.length,qt=Ke.length,F=0,bt+=2,ue=i(N/(Ke[0]+1)),ue>1&&(Ke=A(Ke,ue,N),yt=A(yt,ue,N),qt=Ke.length,wo=yt.length),Po=qt,Me=yt.slice(0,qt),Ge=Me.length;Ge<qt;Me[Ge++]=0);Kr=Ke.slice(),Kr=[0].concat(Kr),xo=Ke[0],Ke[1]>=N/2&&xo++;do{if(ue=0,U=O(Ke,Me,qt,Ge),U<0){if(gt=Me[0],qt!=Ge&&(gt=gt*N+(Me[1]||0)),ue=i(gt/xo),ue>1)for(ue>=N&&(ue=N-1),le=A(Ke,ue,N),Fe=le.length,Ge=Me.length;O(le,Me,Fe,Ge)==1;)ue--,D(le,qt<Fe?Kr:Ke,Fe,N),Fe=le.length,U=1;else ue==0&&(U=ue=1),le=Ke.slice(),Fe=le.length;if(Fe<Ge&&(le=[0].concat(le)),D(Me,le,Ge,N),Ge=Me.length,U==-1)for(;O(Ke,Me,qt,Ge)<1;)ue++,D(Me,qt<Ge?Kr:Ke,Ge,N),Ge=Me.length}else U===0&&(ue++,Me=[0]);nt[F++]=ue,Me[0]?Me[Ge++]=yt[Po]||0:(Me=[yt[Po]],Ge=1)}while((Po++<wo||Me[0]!=null)&&bt--);J=Me[0]!=null,nt[0]||nt.splice(0,1)}if(N==m){for(F=1,bt=nt[0];bt>=10;bt/=10,F++);He(rt,j+(rt.e=F+B*h-1)+1,G,J)}else rt.e=B,rt.r=+J;return rt}}();function st(A,O,D,L){var z,j,G,N,U;if(D==null?D=K:u(D,0,8),!A.c)return A.toString();if(z=A.c[0],G=A.e,O==null)U=$(A.c),U=L==1||L==2&&(G<=Z||G>=Q)?c(U,G):y(U,G,"0");else if(A=He(new te(A),O,D),j=A.e,U=$(A.c),N=U.length,L==1||L==2&&(O<=j||j<=Z)){for(;N<O;U+="0",N++);U=c(U,j)}else if(O-=G+(L===2&&j>G),U=y(U,j,"0"),j+1>N){if(--O>0)for(U+=".";O--;U+="0");}else if(O+=j-N,O>0)for(j+1==N&&(U+=".");O--;U+="0");return A.s<0&&z?"-"+U:U}o(st,"format");function dt(A,O){for(var D,L,z=1,j=new te(A[0]);z<A.length;z++)L=new te(A[z]),(!L.s||(D=b(j,L))===O||D===0&&j.s===O)&&(j=L);return j}o(dt,"maxOrMin");function Lt(A,O,D){for(var L=1,z=O.length;!O[--z];O.pop());for(z=O[0];z>=10;z/=10,L++);return(D=L+D*h-1)>ie?A.c=A.e=null:D<X?A.c=[A.e=0]:(A.e=D,A.c=O),A}o(Lt,"normalise"),re=function(){var A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,O=/^([^.]+)\.$/,D=/^\.([^.]+)$/,L=/^-?(Infinity|NaN)$/,z=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(j,G,N,U){var B,F=N?G:G.replace(z,"");if(L.test(F))j.s=isNaN(F)?null:F<0?-1:1;else{if(!N&&(F=F.replace(A,function(J,ue,le){return B=(le=le.toLowerCase())=="x"?16:le=="b"?2:8,!U||U==B?ue:J}),U&&(B=U,F=F.replace(O,"$1").replace(D,"0.$1")),G!=F))return new te(F,B);if(te.DEBUG)throw Error(a+"Not a"+(U?" base "+U:"")+" number: "+G);j.s=null}j.c=j.e=null}}();function He(A,O,D,L){var z,j,G,N,U,B,F,J=A.c,ue=P;if(J){e:{for(z=1,N=J[0];N>=10;N/=10,z++);if(j=O-z,j<0)j+=h,G=O,U=J[B=0],F=i(U/ue[z-G-1]%10);else if(B=n((j+1)/h),B>=J.length)if(L){for(;J.length<=B;J.push(0));U=F=0,z=1,j%=h,G=j-h+1}else break e;else{for(U=N=J[B],z=1;N>=10;N/=10,z++);j%=h,G=j-h+z,F=G<0?0:i(U/ue[z-G-1]%10)}if(L=L||O<0||J[B+1]!=null||(G<0?U:U%ue[z-G-1]),L=D<4?(F||L)&&(D==0||D==(A.s<0?3:2)):F>5||F==5&&(D==4||L||D==6&&(j>0?G>0?U/ue[z-G]:0:J[B-1])%10&1||D==(A.s<0?8:7)),O<1||!J[0])return J.length=0,L?(O-=A.e+1,J[0]=ue[(h-O%h)%h],A.e=-O||0):J[0]=A.e=0,A;if(j==0?(J.length=B,N=1,B--):(J.length=B+1,N=ue[h-j],J[B]=G>0?i(U/ue[z-G]%ue[G])*N:0),L)for(;;)if(B==0){for(j=1,G=J[0];G>=10;G/=10,j++);for(G=J[0]+=N,N=1;G>=10;G/=10,N++);j!=N&&(A.e++,J[0]==m&&(J[0]=1));break}else{if(J[B]+=N,J[B]!=m)break;J[B--]=0,N=1}for(j=J.length;J[--j]===0;J.pop());}A.e>ie?A.c=A.e=null:A.e<X&&(A.c=[A.e=0])}return A}o(He,"round");function Ze(A){var O,D=A.e;return D===null?A.toString():(O=$(A.c),O=D<=Z||D>=Q?c(O,D):y(O,D,"0"),A.s<0?"-"+O:O)}return o(Ze,"valueOf"),ee.absoluteValue=ee.abs=function(){var A=new te(this);return A.s<0&&(A.s=1),A},ee.comparedTo=function(A,O){return b(this,new te(A,O))},ee.decimalPlaces=ee.dp=function(A,O){var D,L,z,j=this;if(A!=null)return u(A,0,S),O==null?O=K:u(O,0,8),He(new te(j),A+j.e+1,O);if(!(D=j.c))return null;if(L=((z=D.length-1)-T(this.e/h))*h,z=D[z])for(;z%10==0;z/=10,L--);return L<0&&(L=0),L},ee.dividedBy=ee.div=function(A,O){return x(this,new te(A,O),ne,K)},ee.dividedToIntegerBy=ee.idiv=function(A,O){return x(this,new te(A,O),0,1)},ee.exponentiatedBy=ee.pow=function(A,O){var D,L,z,j,G,N,U,B,F,J=this;if(A=new te(A),A.c&&!A.isInteger())throw Error(a+"Exponent not an integer: "+Ze(A));if(O!=null&&(O=new te(O)),N=A.e>14,!J.c||!J.c[0]||J.c[0]==1&&!J.e&&J.c.length==1||!A.c||!A.c[0])return F=new te(Math.pow(+Ze(J),N?A.s*(2-p(A)):+Ze(A))),O?F.mod(O):F;if(U=A.s<0,O){if(O.c?!O.c[0]:!O.s)return new te(NaN);L=!U&&J.isInteger()&&O.isInteger(),L&&(J=J.mod(O))}else{if(A.e>9&&(J.e>0||J.e<-1||(J.e==0?J.c[0]>1||N&&J.c[1]>=24e7:J.c[0]<8e13||N&&J.c[0]<=9999975e7)))return j=J.s<0&&p(A)?-0:0,J.e>-1&&(j=1/j),new te(U?1/j:j);De&&(j=n(De/h+2))}for(N?(D=new te(.5),U&&(A.s=1),B=p(A)):(z=Math.abs(+Ze(A)),B=z%2),F=new te(Te);;){if(B){if(F=F.times(J),!F.c)break;j?F.c.length>j&&(F.c.length=j):L&&(F=F.mod(O))}if(z){if(z=i(z/2),z===0)break;B=z%2}else if(A=A.times(D),He(A,A.e+1,1),A.e>14)B=p(A);else{if(z=+Ze(A),z===0)break;B=z%2}J=J.times(J),j?J.c&&J.c.length>j&&(J.c.length=j):L&&(J=J.mod(O))}return L?F:(U&&(F=Te.div(F)),O?F.mod(O):j?He(F,De,K,G):F)},ee.integerValue=function(A){var O=new te(this);return A==null?A=K:u(A,0,8),He(O,O.e+1,A)},ee.isEqualTo=ee.eq=function(A,O){return b(this,new te(A,O))===0},ee.isFinite=function(){return!!this.c},ee.isGreaterThan=ee.gt=function(A,O){return b(this,new te(A,O))>0},ee.isGreaterThanOrEqualTo=ee.gte=function(A,O){return(O=b(this,new te(A,O)))===1||O===0},ee.isInteger=function(){return!!this.c&&T(this.e/h)>this.c.length-2},ee.isLessThan=ee.lt=function(A,O){return b(this,new te(A,O))<0},ee.isLessThanOrEqualTo=ee.lte=function(A,O){return(O=b(this,new te(A,O)))===-1||O===0},ee.isNaN=function(){return!this.s},ee.isNegative=function(){return this.s<0},ee.isPositive=function(){return this.s>0},ee.isZero=function(){return!!this.c&&this.c[0]==0},ee.minus=function(A,O){var D,L,z,j,G=this,N=G.s;if(A=new te(A,O),O=A.s,!N||!O)return new te(NaN);if(N!=O)return A.s=-O,G.plus(A);var U=G.e/h,B=A.e/h,F=G.c,J=A.c;if(!U||!B){if(!F||!J)return F?(A.s=-O,A):new te(J?G:NaN);if(!F[0]||!J[0])return J[0]?(A.s=-O,A):new te(F[0]?G:K==3?-0:0)}if(U=T(U),B=T(B),F=F.slice(),N=U-B){for((j=N<0)?(N=-N,z=F):(B=U,z=J),z.reverse(),O=N;O--;z.push(0));z.reverse()}else for(L=(j=(N=F.length)<(O=J.length))?N:O,N=O=0;O<L;O++)if(F[O]!=J[O]){j=F[O]<J[O];break}if(j&&(z=F,F=J,J=z,A.s=-A.s),O=(L=J.length)-(D=F.length),O>0)for(;O--;F[D++]=0);for(O=m-1;L>N;){if(F[--L]<J[L]){for(D=L;D&&!F[--D];F[D]=O);--F[D],F[L]+=m}F[L]-=J[L]}for(;F[0]==0;F.splice(0,1),--B);return F[0]?Lt(A,F,B):(A.s=K==3?-1:1,A.c=[A.e=0],A)},ee.modulo=ee.mod=function(A,O){var D,L,z=this;return A=new te(A,O),!z.c||!A.s||A.c&&!A.c[0]?new te(NaN):!A.c||z.c&&!z.c[0]?new te(z):(Ie==9?(L=A.s,A.s=1,D=x(z,A,0,3),A.s=L,D.s*=L):D=x(z,A,0,Ie),A=z.minus(D.times(A)),!A.c[0]&&Ie==1&&(A.s=z.s),A)},ee.multipliedBy=ee.times=function(A,O){var D,L,z,j,G,N,U,B,F,J,ue,le,Fe,rt,nt,Me=this,Ge=Me.c,gt=(A=new te(A,O)).c;if(!Ge||!gt||!Ge[0]||!gt[0])return!Me.s||!A.s||Ge&&!Ge[0]&&!gt||gt&&!gt[0]&&!Ge?A.c=A.e=A.s=null:(A.s*=Me.s,!Ge||!gt?A.c=A.e=null:(A.c=[0],A.e=0)),A;for(L=T(Me.e/h)+T(A.e/h),A.s*=Me.s,U=Ge.length,J=gt.length,U<J&&(Fe=Ge,Ge=gt,gt=Fe,z=U,U=J,J=z),z=U+J,Fe=[];z--;Fe.push(0));for(rt=m,nt=E,z=J;--z>=0;){for(D=0,ue=gt[z]%nt,le=gt[z]/nt|0,G=U,j=z+G;j>z;)B=Ge[--G]%nt,F=Ge[G]/nt|0,N=le*B+F*ue,B=ue*B+N%nt*nt+Fe[j]+D,D=(B/rt|0)+(N/nt|0)+le*F,Fe[j--]=B%rt;Fe[j]=D}return D?++L:Fe.splice(0,1),Lt(A,Fe,L)},ee.negated=function(){var A=new te(this);return A.s=-A.s||null,A},ee.plus=function(A,O){var D,L=this,z=L.s;if(A=new te(A,O),O=A.s,!z||!O)return new te(NaN);if(z!=O)return A.s=-O,L.minus(A);var j=L.e/h,G=A.e/h,N=L.c,U=A.c;if(!j||!G){if(!N||!U)return new te(z/0);if(!N[0]||!U[0])return U[0]?A:new te(N[0]?L:z*0)}if(j=T(j),G=T(G),N=N.slice(),z=j-G){for(z>0?(G=j,D=U):(z=-z,D=N),D.reverse();z--;D.push(0));D.reverse()}for(z=N.length,O=U.length,z-O<0&&(D=U,U=N,N=D,O=z),z=0;O;)z=(N[--O]=N[O]+U[O]+z)/m|0,N[O]=m===N[O]?0:N[O]%m;return z&&(N=[z].concat(N),++G),Lt(A,N,G)},ee.precision=ee.sd=function(A,O){var D,L,z,j=this;if(A!=null&&A!==!!A)return u(A,1,S),O==null?O=K:u(O,0,8),He(new te(j),A,O);if(!(D=j.c))return null;if(z=D.length-1,L=z*h+1,z=D[z]){for(;z%10==0;z/=10,L--);for(z=D[0];z>=10;z/=10,L++);}return A&&j.e+1>L&&(L=j.e+1),L},ee.shiftedBy=function(A){return u(A,-_,_),this.times("1e"+A)},ee.squareRoot=ee.sqrt=function(){var A,O,D,L,z,j=this,G=j.c,N=j.s,U=j.e,B=ne+4,F=new te("0.5");if(N!==1||!G||!G[0])return new te(!N||N<0&&(!G||G[0])?NaN:G?j:1/0);if(N=Math.sqrt(+Ze(j)),N==0||N==1/0?(O=$(G),(O.length+U)%2==0&&(O+="0"),N=Math.sqrt(+O),U=T((U+1)/2)-(U<0||U%2),N==1/0?O="5e"+U:(O=N.toExponential(),O=O.slice(0,O.indexOf("e")+1)+U),D=new te(O)):D=new te(N+""),D.c[0]){for(U=D.e,N=U+B,N<3&&(N=0);;)if(z=D,D=F.times(z.plus(x(j,z,B,1))),$(z.c).slice(0,N)===(O=$(D.c)).slice(0,N))if(D.e<U&&--N,O=O.slice(N-3,N+1),O=="9999"||!L&&O=="4999"){if(!L&&(He(z,z.e+ne+2,0),z.times(z).eq(j))){D=z;break}B+=4,N+=4,L=1}else{(!+O||!+O.slice(1)&&O.charAt(0)=="5")&&(He(D,D.e+ne+2,1),A=!D.times(D).eq(j));break}}return He(D,D.e+ne+1,K,A)},ee.toExponential=function(A,O){return A!=null&&(u(A,0,S),A++),st(this,A,O,1)},ee.toFixed=function(A,O){return A!=null&&(u(A,0,S),A=A+this.e+1),st(this,A,O)},ee.toFormat=function(A,O,D){var L,z=this;if(D==null)A!=null&&O&&typeof O=="object"?(D=O,O=null):A&&typeof A=="object"?(D=A,A=O=null):D=We;else if(typeof D!="object")throw Error(a+"Argument not an object: "+D);if(L=z.toFixed(A,O),z.c){var j,G=L.split("."),N=+D.groupSize,U=+D.secondaryGroupSize,B=D.groupSeparator||"",F=G[0],J=G[1],ue=z.s<0,le=ue?F.slice(1):F,Fe=le.length;if(U&&(j=N,N=U,U=j,Fe-=j),N>0&&Fe>0){for(j=Fe%N||N,F=le.substr(0,j);j<Fe;j+=N)F+=B+le.substr(j,N);U>0&&(F+=B+le.slice(j)),ue&&(F="-"+F)}L=J?F+(D.decimalSeparator||"")+((U=+D.fractionGroupSize)?J.replace(new RegExp("\\d{"+U+"}\\B","g"),"$&"+(D.fractionGroupSeparator||"")):J):F}return(D.prefix||"")+L+(D.suffix||"")},ee.toFraction=function(A){var O,D,L,z,j,G,N,U,B,F,J,ue,le=this,Fe=le.c;if(A!=null&&(N=new te(A),!N.isInteger()&&(N.c||N.s!==1)||N.lt(Te)))throw Error(a+"Argument "+(N.isInteger()?"out of range: ":"not an integer: ")+Ze(N));if(!Fe)return new te(le);for(O=new te(Te),B=D=new te(Te),L=U=new te(Te),ue=$(Fe),j=O.e=ue.length-le.e-1,O.c[0]=P[(G=j%h)<0?h+G:G],A=!A||N.comparedTo(O)>0?j>0?O:B:N,G=ie,ie=1/0,N=new te(ue),U.c[0]=0;F=x(N,O,0,1),z=D.plus(F.times(L)),z.comparedTo(A)!=1;)D=L,L=z,B=U.plus(F.times(z=B)),U=z,O=N.minus(F.times(z=O)),N=z;return z=x(A.minus(D),L,0,1),U=U.plus(z.times(B)),D=D.plus(z.times(L)),U.s=B.s=le.s,j=j*2,J=x(B,L,j,K).minus(le).abs().comparedTo(x(U,D,j,K).minus(le).abs())<1?[B,L]:[U,D],ie=G,J},ee.toNumber=function(){return+Ze(this)},ee.toPrecision=function(A,O){return A!=null&&u(A,1,S),st(this,A,O,2)},ee.toString=function(A){var O,D=this,L=D.s,z=D.e;return z===null?L?(O="Infinity",L<0&&(O="-"+O)):O="NaN":(A==null?O=z<=Z||z>=Q?c($(D.c),z):y($(D.c),z,"0"):A===10&&_t?(D=He(new te(D),ne+z+1,K),O=y($(D.c),D.e,"0")):(u(A,2,Xe.length,"Base"),O=g(y($(D.c),z,"0"),10,A,L,!0)),L<0&&D.c[0]&&(O="-"+O)),O},ee.valueOf=ee.toJSON=function(){return Ze(this)},ee._isBigNumber=!0,l!=null&&te.set(l),te}o(w,"clone");function T(l){var x=l|0;return l>0||l===x?x:x-1}o(T,"bitFloor");function $(l){for(var x,g,re=1,ee=l.length,Te=l[0]+"";re<ee;){for(x=l[re++]+"",g=h-x.length;g--;x="0"+x);Te+=x}for(ee=Te.length;Te.charCodeAt(--ee)===48;);return Te.slice(0,ee+1||1)}o($,"coeffToString");function b(l,x){var g,re,ee=l.c,Te=x.c,ne=l.s,K=x.s,Z=l.e,Q=x.e;if(!ne||!K)return null;if(g=ee&&!ee[0],re=Te&&!Te[0],g||re)return g?re?0:-K:ne;if(ne!=K)return ne;if(g=ne<0,re=Z==Q,!ee||!Te)return re?0:!ee^g?1:-1;if(!re)return Z>Q^g?1:-1;for(K=(Z=ee.length)<(Q=Te.length)?Z:Q,ne=0;ne<K;ne++)if(ee[ne]!=Te[ne])return ee[ne]>Te[ne]^g?1:-1;return Z==Q?0:Z>Q^g?1:-1}o(b,"compare");function u(l,x,g,re){if(l<x||l>g||l!==i(l))throw Error(a+(re||"Argument")+(typeof l=="number"?l<x||l>g?" out of range: ":" not an integer: ":" not a primitive number: ")+String(l))}o(u,"intCheck");function p(l){var x=l.c.length-1;return T(l.e/h)==x&&l.c[x]%2!=0}o(p,"isOdd");function c(l,x){return(l.length>1?l.charAt(0)+"."+l.slice(1):l)+(x<0?"e":"e+")+x}o(c,"toExponential");function y(l,x,g){var re,ee;if(x<0){for(ee=g+".";++x;ee+=g);l=ee+l}else if(re=l.length,++x>re){for(ee=g,x-=re;--x;ee+=g);l+=ee}else x<re&&(l=l.slice(0,x)+"."+l.slice(x));return l}o(y,"toFixedPoint"),e=w(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof Tu<"u"&&Tu.exports?Tu.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(bw)});var $w=M((U5,Rw)=>{var Aw=Hd(),Iw=Rw.exports;(function(){"use strict";function t(_){return _<10?"0"+_:_}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,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},f;function m(_){return r.lastIndex=0,r.test(_)?'"'+_.replace(r,function(P){var E=a[P];return typeof E=="string"?E:"\\u"+("0000"+P.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+_+'"'}o(m,"quote");function h(_,P){var E,S,w,T,$=n,b,u=P[_],p=u!=null&&(u instanceof Aw||Aw.isBigNumber(u));switch(u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON(_)),typeof f=="function"&&(u=f.call(P,_,u)),typeof u){case"string":return p?u:m(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":case"bigint":return String(u);case"object":if(!u)return"null";if(n+=i,b=[],Object.prototype.toString.apply(u)==="[object Array]"){for(T=u.length,E=0;E<T;E+=1)b[E]=h(E,u)||"null";return w=b.length===0?"[]":n?`[
32
- `+n+b.join(`,
30
+ `,typeof o.content=="string"?yield o.content:yield*o.content,yield`\r
31
+ `}yield n}static#o;static#a;static async#s(){return this.#o||=(await Promise.resolve().then(()=>ue(BP()))).HttpsProxyAgent,this.#o}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(Uw(),zw))).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,p)=>{p==="set-cookie"?e.append(p,s):e.set(p,s)});return e}};io.Gaxios=Iu;no=Iu});var mt=L(kt=>{"use strict";var yk=kt&&kt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vk=kt&&kt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yk(e,t,r)};Object.defineProperty(kt,"__esModule",{value:!0});kt.instance=kt.Gaxios=kt.GaxiosError=void 0;kt.request=Pk;var jw=Lw();Object.defineProperty(kt,"Gaxios",{enumerable:!0,get:i(function(){return jw.Gaxios},"get")});var _k=Ed();Object.defineProperty(kt,"GaxiosError",{enumerable:!0,get:i(function(){return _k.GaxiosError},"get")});vk(Rd(),kt);kt.instance=new jw.Gaxios;async function Pk(t){return kt.instance.request(t)}i(Pk,"request")});var Yd=L((qw,Au)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,o=Math.floor,s="[BigNumber Error] ",p=s+"Number primitive has more than 15 significant digits: ",m=1e14,h=14,v=9007199254740991,P=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],x=1e7,T=1e9;function w(l){var b,g,oe,ne=ie.prototype={constructor:ie,toString:null,valueOf:null},Re=new ie(1),se=20,Y=4,K=-7,re=21,te=-1e7,ce=1e7,de=!1,Oe=1,ze=0,Ke={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Qe="0123456789abcdefghijklmnopqrstuvwxyz",Tt=!0;function ie(I,$){var O,q,z,F,H,k,U,V,j=this;if(!(j instanceof ie))return new ie(I,$);if($==null){if(I&&I._isBigNumber===!0){j.s=I.s,!I.c||I.e>ce?j.c=j.e=null:I.e<te?j.c=[j.e=0]:(j.e=I.e,j.c=I.c.slice());return}if((k=typeof I=="number")&&I*0==0){if(j.s=1/I<0?(I=-I,-1):1,I===~~I){for(F=0,H=I;H>=10;H/=10,F++);F>ce?j.c=j.e=null:(j.e=F,j.c=[I]);return}V=String(I)}else{if(!r.test(V=String(I)))return oe(j,V,k);j.s=V.charCodeAt(0)==45?(V=V.slice(1),-1):1}(F=V.indexOf("."))>-1&&(V=V.replace(".","")),(H=V.search(/e/i))>0?(F<0&&(F=H),F+=+V.slice(H+1),V=V.substring(0,H)):F<0&&(F=V.length)}else{if(u($,2,Qe.length,"Base"),$==10&&Tt)return j=new ie(I),Ze(j,se+j.e+1,Y);if(V=String(I),k=typeof I=="number"){if(I*0!=0)return oe(j,V,k,$);if(j.s=1/I<0?(V=V.slice(1),-1):1,ie.DEBUG&&V.replace(/^0\.0*|\./,"").length>15)throw Error(p+I)}else j.s=V.charCodeAt(0)===45?(V=V.slice(1),-1):1;for(O=Qe.slice(0,$),F=H=0,U=V.length;H<U;H++)if(O.indexOf(q=V.charAt(H))<0){if(q=="."){if(H>F){F=U;continue}}else if(!z&&(V==V.toUpperCase()&&(V=V.toLowerCase())||V==V.toLowerCase()&&(V=V.toUpperCase()))){z=!0,H=-1,F=0;continue}return oe(j,String(I),k,$)}k=!1,V=g(V,$,10,j.s),(F=V.indexOf("."))>-1?V=V.replace(".",""):F=V.length}for(H=0;V.charCodeAt(H)===48;H++);for(U=V.length;V.charCodeAt(--U)===48;);if(V=V.slice(H,++U)){if(U-=H,k&&ie.DEBUG&&U>15&&(I>v||I!==o(I)))throw Error(p+j.s*I);if((F=F-H-1)>ce)j.c=j.e=null;else if(F<te)j.c=[j.e=0];else{if(j.e=F,j.c=[],H=(F+1)%h,F<0&&(H+=h),H<U){for(H&&j.c.push(+V.slice(0,H)),U-=h;H<U;)j.c.push(+V.slice(H,H+=h));H=h-(V=V.slice(H)).length}else H-=U;for(;H--;V+="0");j.c.push(+V)}}else j.c=[j.e=0]}i(ie,"BigNumber"),ie.clone=w,ie.ROUND_UP=0,ie.ROUND_DOWN=1,ie.ROUND_CEIL=2,ie.ROUND_FLOOR=3,ie.ROUND_HALF_UP=4,ie.ROUND_HALF_DOWN=5,ie.ROUND_HALF_EVEN=6,ie.ROUND_HALF_CEIL=7,ie.ROUND_HALF_FLOOR=8,ie.EUCLID=9,ie.config=ie.set=function(I){var $,O;if(I!=null)if(typeof I=="object"){if(I.hasOwnProperty($="DECIMAL_PLACES")&&(O=I[$],u(O,0,T,$),se=O),I.hasOwnProperty($="ROUNDING_MODE")&&(O=I[$],u(O,0,8,$),Y=O),I.hasOwnProperty($="EXPONENTIAL_AT")&&(O=I[$],O&&O.pop?(u(O[0],-T,0,$),u(O[1],0,T,$),K=O[0],re=O[1]):(u(O,-T,T,$),K=-(re=O<0?-O:O))),I.hasOwnProperty($="RANGE"))if(O=I[$],O&&O.pop)u(O[0],-T,-1,$),u(O[1],1,T,$),te=O[0],ce=O[1];else if(u(O,-T,T,$),O)te=-(ce=O<0?-O:O);else throw Error(s+$+" cannot be zero: "+O);if(I.hasOwnProperty($="CRYPTO"))if(O=I[$],O===!!O)if(O)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))de=O;else throw de=!O,Error(s+"crypto unavailable");else de=O;else throw Error(s+$+" not true or false: "+O);if(I.hasOwnProperty($="MODULO_MODE")&&(O=I[$],u(O,0,9,$),Oe=O),I.hasOwnProperty($="POW_PRECISION")&&(O=I[$],u(O,0,T,$),ze=O),I.hasOwnProperty($="FORMAT"))if(O=I[$],typeof O=="object")Ke=O;else throw Error(s+$+" not an object: "+O);if(I.hasOwnProperty($="ALPHABET"))if(O=I[$],typeof O=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(O))Tt=O.slice(0,10)=="0123456789",Qe=O;else throw Error(s+$+" invalid: "+O)}else throw Error(s+"Object expected: "+I);return{DECIMAL_PLACES:se,ROUNDING_MODE:Y,EXPONENTIAL_AT:[K,re],RANGE:[te,ce],CRYPTO:de,MODULO_MODE:Oe,POW_PRECISION:ze,FORMAT:Ke,ALPHABET:Qe}},ie.isBigNumber=function(I){if(!I||I._isBigNumber!==!0)return!1;if(!ie.DEBUG)return!0;var $,O,q=I.c,z=I.e,F=I.s;e:if({}.toString.call(q)=="[object Array]"){if((F===1||F===-1)&&z>=-T&&z<=T&&z===o(z)){if(q[0]===0){if(z===0&&q.length===1)return!0;break e}if($=(z+1)%h,$<1&&($+=h),String(q[0]).length==$){for($=0;$<q.length;$++)if(O=q[$],O<0||O>=m||O!==o(O))break e;if(O!==0)return!0}}}else if(q===null&&z===null&&(F===null||F===1||F===-1))return!0;throw Error(s+"Invalid BigNumber: "+I)},ie.maximum=ie.max=function(){return ft(arguments,-1)},ie.minimum=ie.min=function(){return ft(arguments,1)},ie.random=(function(){var I=9007199254740992,$=Math.random()*I&2097151?function(){return o(Math.random()*I)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(O){var q,z,F,H,k,U=0,V=[],j=new ie(Re);if(O==null?O=se:u(O,0,T),H=n(O/h),de)if(crypto.getRandomValues){for(q=crypto.getRandomValues(new Uint32Array(H*=2));U<H;)k=q[U]*131072+(q[U+1]>>>11),k>=9e15?(z=crypto.getRandomValues(new Uint32Array(2)),q[U]=z[0],q[U+1]=z[1]):(V.push(k%1e14),U+=2);U=H/2}else if(crypto.randomBytes){for(q=crypto.randomBytes(H*=7);U<H;)k=(q[U]&31)*281474976710656+q[U+1]*1099511627776+q[U+2]*4294967296+q[U+3]*16777216+(q[U+4]<<16)+(q[U+5]<<8)+q[U+6],k>=9e15?crypto.randomBytes(7).copy(q,U):(V.push(k%1e14),U+=7);U=H/7}else throw de=!1,Error(s+"crypto unavailable");if(!de)for(;U<H;)k=$(),k<9e15&&(V[U++]=k%1e14);for(H=V[--U],O%=h,H&&O&&(k=P[h-O],V[U]=o(H/k)*k);V[U]===0;V.pop(),U--);if(U<0)V=[F=0];else{for(F=-1;V[0]===0;V.splice(0,1),F-=h);for(U=1,k=V[0];k>=10;k/=10,U++);U<h&&(F-=h-U)}return j.e=F,j.c=V,j}})(),ie.sum=function(){for(var I=1,$=arguments,O=new ie($[0]);I<$.length;)O=O.plus($[I++]);return O},g=(function(){var I="0123456789";function $(O,q,z,F){for(var H,k=[0],U,V=0,j=O.length;V<j;){for(U=k.length;U--;k[U]*=q);for(k[0]+=F.indexOf(O.charAt(V++)),H=0;H<k.length;H++)k[H]>z-1&&(k[H+1]==null&&(k[H+1]=0),k[H+1]+=k[H]/z|0,k[H]%=z)}return k.reverse()}return i($,"toBaseOut"),function(O,q,z,F,H){var k,U,V,j,X,pe,he,Be,nt=O.indexOf("."),it=se,qe=Y;for(nt>=0&&(j=ze,ze=0,O=O.replace(".",""),Be=new ie(q),pe=Be.pow(O.length-nt),ze=j,Be.c=$(y(D(pe.c),pe.e,"0"),10,z,I),Be.e=Be.c.length),he=$(O,q,z,H?(k=Qe,I):(k=I,Qe)),V=j=he.length;he[--j]==0;he.pop());if(!he[0])return k.charAt(0);if(nt<0?--V:(pe.c=he,pe.e=V,pe.s=F,pe=b(pe,Be,it,qe,z),he=pe.c,X=pe.r,V=pe.e),U=V+it+1,nt=he[U],j=z/2,X=X||U<0||he[U+1]!=null,X=qe<4?(nt!=null||X)&&(qe==0||qe==(pe.s<0?3:2)):nt>j||nt==j&&(qe==4||X||qe==6&&he[U-1]&1||qe==(pe.s<0?8:7)),U<1||!he[0])O=X?y(k.charAt(1),-it,k.charAt(0)):k.charAt(0);else{if(he.length=U,X)for(--z;++he[--U]>z;)he[U]=0,U||(++V,he=[1].concat(he));for(j=he.length;!he[--j];);for(nt=0,O="";nt<=j;O+=k.charAt(he[nt++]));O=y(O,V,k.charAt(0))}return O}})(),b=(function(){function I(q,z,F){var H,k,U,V,j=0,X=q.length,pe=z%x,he=z/x|0;for(q=q.slice();X--;)U=q[X]%x,V=q[X]/x|0,H=he*U+V*pe,k=pe*U+H%x*x+j,j=(k/F|0)+(H/x|0)+he*V,q[X]=k%F;return j&&(q=[j].concat(q)),q}i(I,"multiply");function $(q,z,F,H){var k,U;if(F!=H)U=F>H?1:-1;else for(k=U=0;k<F;k++)if(q[k]!=z[k]){U=q[k]>z[k]?1:-1;break}return U}i($,"compare");function O(q,z,F,H){for(var k=0;F--;)q[F]-=k,k=q[F]<z[F]?1:0,q[F]=k*H+q[F]-z[F];for(;!q[0]&&q.length>1;q.splice(0,1));}return i(O,"subtract"),function(q,z,F,H,k){var U,V,j,X,pe,he,Be,nt,it,qe,He,vt,Si,xi,Ei,Gt,Qr,Rt=q.s==z.s?1:-1,_t=q.c,Ye=z.c;if(!_t||!_t[0]||!Ye||!Ye[0])return new ie(!q.s||!z.s||(_t?Ye&&_t[0]==Ye[0]:!Ye)?NaN:_t&&_t[0]==0||!Ye?Rt*0:Rt/0);for(nt=new ie(Rt),it=nt.c=[],V=q.e-z.e,Rt=F+V+1,k||(k=m,V=S(q.e/h)-S(z.e/h),Rt=Rt/h|0),j=0;Ye[j]==(_t[j]||0);j++);if(Ye[j]>(_t[j]||0)&&V--,Rt<0)it.push(1),X=!0;else{for(xi=_t.length,Gt=Ye.length,j=0,Rt+=2,pe=o(k/(Ye[0]+1)),pe>1&&(Ye=I(Ye,pe,k),_t=I(_t,pe,k),Gt=Ye.length,xi=_t.length),Si=Gt,qe=_t.slice(0,Gt),He=qe.length;He<Gt;qe[He++]=0);Qr=Ye.slice(),Qr=[0].concat(Qr),Ei=Ye[0],Ye[1]>=k/2&&Ei++;do{if(pe=0,U=$(Ye,qe,Gt,He),U<0){if(vt=qe[0],Gt!=He&&(vt=vt*k+(qe[1]||0)),pe=o(vt/Ei),pe>1)for(pe>=k&&(pe=k-1),he=I(Ye,pe,k),Be=he.length,He=qe.length;$(he,qe,Be,He)==1;)pe--,O(he,Gt<Be?Qr:Ye,Be,k),Be=he.length,U=1;else pe==0&&(U=pe=1),he=Ye.slice(),Be=he.length;if(Be<He&&(he=[0].concat(he)),O(qe,he,He,k),He=qe.length,U==-1)for(;$(Ye,qe,Gt,He)<1;)pe++,O(qe,Gt<He?Qr:Ye,He,k),He=qe.length}else U===0&&(pe++,qe=[0]);it[j++]=pe,qe[0]?qe[He++]=_t[Si]||0:(qe=[_t[Si]],He=1)}while((Si++<xi||qe[0]!=null)&&Rt--);X=qe[0]!=null,it[0]||it.splice(0,1)}if(k==m){for(j=1,Rt=it[0];Rt>=10;Rt/=10,j++);Ze(nt,F+(nt.e=j+V*h-1)+1,H,X)}else nt.e=V,nt.r=+X;return nt}})();function ut(I,$,O,q){var z,F,H,k,U;if(O==null?O=Y:u(O,0,8),!I.c)return I.toString();if(z=I.c[0],H=I.e,$==null)U=D(I.c),U=q==1||q==2&&(H<=K||H>=re)?c(U,H):y(U,H,"0");else if(I=Ze(new ie(I),$,O),F=I.e,U=D(I.c),k=U.length,q==1||q==2&&($<=F||F<=K)){for(;k<$;U+="0",k++);U=c(U,F)}else if($-=H+(q===2&&F>H),U=y(U,F,"0"),F+1>k){if(--$>0)for(U+=".";$--;U+="0");}else if($+=F-k,$>0)for(F+1==k&&(U+=".");$--;U+="0");return I.s<0&&z?"-"+U:U}i(ut,"format");function ft(I,$){for(var O,q,z=1,F=new ie(I[0]);z<I.length;z++)q=new ie(I[z]),(!q.s||(O=E(F,q))===$||O===0&&F.s===$)&&(F=q);return F}i(ft,"maxOrMin");function Vt(I,$,O){for(var q=1,z=$.length;!$[--z];$.pop());for(z=$[0];z>=10;z/=10,q++);return(O=q+O*h-1)>ce?I.c=I.e=null:O<te?I.c=[I.e=0]:(I.e=O,I.c=$),I}i(Vt,"normalise"),oe=(function(){var I=/^(-?)0([xbo])(?=\w[\w.]*$)/i,$=/^([^.]+)\.$/,O=/^\.([^.]+)$/,q=/^-?(Infinity|NaN)$/,z=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,H,k,U){var V,j=k?H:H.replace(z,"");if(q.test(j))F.s=isNaN(j)?null:j<0?-1:1;else{if(!k&&(j=j.replace(I,function(X,pe,he){return V=(he=he.toLowerCase())=="x"?16:he=="b"?2:8,!U||U==V?pe:X}),U&&(V=U,j=j.replace($,"$1").replace(O,"0.$1")),H!=j))return new ie(j,V);if(ie.DEBUG)throw Error(s+"Not a"+(U?" base "+U:"")+" number: "+H);F.s=null}F.c=F.e=null}})();function Ze(I,$,O,q){var z,F,H,k,U,V,j,X=I.c,pe=P;if(X){e:{for(z=1,k=X[0];k>=10;k/=10,z++);if(F=$-z,F<0)F+=h,H=$,U=X[V=0],j=o(U/pe[z-H-1]%10);else if(V=n((F+1)/h),V>=X.length)if(q){for(;X.length<=V;X.push(0));U=j=0,z=1,F%=h,H=F-h+1}else break e;else{for(U=k=X[V],z=1;k>=10;k/=10,z++);F%=h,H=F-h+z,j=H<0?0:o(U/pe[z-H-1]%10)}if(q=q||$<0||X[V+1]!=null||(H<0?U:U%pe[z-H-1]),q=O<4?(j||q)&&(O==0||O==(I.s<0?3:2)):j>5||j==5&&(O==4||q||O==6&&(F>0?H>0?U/pe[z-H]:0:X[V-1])%10&1||O==(I.s<0?8:7)),$<1||!X[0])return X.length=0,q?($-=I.e+1,X[0]=pe[(h-$%h)%h],I.e=-$||0):X[0]=I.e=0,I;if(F==0?(X.length=V,k=1,V--):(X.length=V+1,k=pe[h-F],X[V]=H>0?o(U/pe[z-H]%pe[H])*k:0),q)for(;;)if(V==0){for(F=1,H=X[0];H>=10;H/=10,F++);for(H=X[0]+=k,k=1;H>=10;H/=10,k++);F!=k&&(I.e++,X[0]==m&&(X[0]=1));break}else{if(X[V]+=k,X[V]!=m)break;X[V--]=0,k=1}for(F=X.length;X[--F]===0;X.pop());}I.e>ce?I.c=I.e=null:I.e<te&&(I.c=[I.e=0])}return I}i(Ze,"round");function Je(I){var $,O=I.e;return O===null?I.toString():($=D(I.c),$=O<=K||O>=re?c($,O):y($,O,"0"),I.s<0?"-"+$:$)}return i(Je,"valueOf"),ne.absoluteValue=ne.abs=function(){var I=new ie(this);return I.s<0&&(I.s=1),I},ne.comparedTo=function(I,$){return E(this,new ie(I,$))},ne.decimalPlaces=ne.dp=function(I,$){var O,q,z,F=this;if(I!=null)return u(I,0,T),$==null?$=Y:u($,0,8),Ze(new ie(F),I+F.e+1,$);if(!(O=F.c))return null;if(q=((z=O.length-1)-S(this.e/h))*h,z=O[z])for(;z%10==0;z/=10,q--);return q<0&&(q=0),q},ne.dividedBy=ne.div=function(I,$){return b(this,new ie(I,$),se,Y)},ne.dividedToIntegerBy=ne.idiv=function(I,$){return b(this,new ie(I,$),0,1)},ne.exponentiatedBy=ne.pow=function(I,$){var O,q,z,F,H,k,U,V,j,X=this;if(I=new ie(I),I.c&&!I.isInteger())throw Error(s+"Exponent not an integer: "+Je(I));if($!=null&&($=new ie($)),k=I.e>14,!X.c||!X.c[0]||X.c[0]==1&&!X.e&&X.c.length==1||!I.c||!I.c[0])return j=new ie(Math.pow(+Je(X),k?I.s*(2-f(I)):+Je(I))),$?j.mod($):j;if(U=I.s<0,$){if($.c?!$.c[0]:!$.s)return new ie(NaN);q=!U&&X.isInteger()&&$.isInteger(),q&&(X=X.mod($))}else{if(I.e>9&&(X.e>0||X.e<-1||(X.e==0?X.c[0]>1||k&&X.c[1]>=24e7:X.c[0]<8e13||k&&X.c[0]<=9999975e7)))return F=X.s<0&&f(I)?-0:0,X.e>-1&&(F=1/F),new ie(U?1/F:F);ze&&(F=n(ze/h+2))}for(k?(O=new ie(.5),U&&(I.s=1),V=f(I)):(z=Math.abs(+Je(I)),V=z%2),j=new ie(Re);;){if(V){if(j=j.times(X),!j.c)break;F?j.c.length>F&&(j.c.length=F):q&&(j=j.mod($))}if(z){if(z=o(z/2),z===0)break;V=z%2}else if(I=I.times(O),Ze(I,I.e+1,1),I.e>14)V=f(I);else{if(z=+Je(I),z===0)break;V=z%2}X=X.times(X),F?X.c&&X.c.length>F&&(X.c.length=F):q&&(X=X.mod($))}return q?j:(U&&(j=Re.div(j)),$?j.mod($):F?Ze(j,ze,Y,H):j)},ne.integerValue=function(I){var $=new ie(this);return I==null?I=Y:u(I,0,8),Ze($,$.e+1,I)},ne.isEqualTo=ne.eq=function(I,$){return E(this,new ie(I,$))===0},ne.isFinite=function(){return!!this.c},ne.isGreaterThan=ne.gt=function(I,$){return E(this,new ie(I,$))>0},ne.isGreaterThanOrEqualTo=ne.gte=function(I,$){return($=E(this,new ie(I,$)))===1||$===0},ne.isInteger=function(){return!!this.c&&S(this.e/h)>this.c.length-2},ne.isLessThan=ne.lt=function(I,$){return E(this,new ie(I,$))<0},ne.isLessThanOrEqualTo=ne.lte=function(I,$){return($=E(this,new ie(I,$)))===-1||$===0},ne.isNaN=function(){return!this.s},ne.isNegative=function(){return this.s<0},ne.isPositive=function(){return this.s>0},ne.isZero=function(){return!!this.c&&this.c[0]==0},ne.minus=function(I,$){var O,q,z,F,H=this,k=H.s;if(I=new ie(I,$),$=I.s,!k||!$)return new ie(NaN);if(k!=$)return I.s=-$,H.plus(I);var U=H.e/h,V=I.e/h,j=H.c,X=I.c;if(!U||!V){if(!j||!X)return j?(I.s=-$,I):new ie(X?H:NaN);if(!j[0]||!X[0])return X[0]?(I.s=-$,I):new ie(j[0]?H:Y==3?-0:0)}if(U=S(U),V=S(V),j=j.slice(),k=U-V){for((F=k<0)?(k=-k,z=j):(V=U,z=X),z.reverse(),$=k;$--;z.push(0));z.reverse()}else for(q=(F=(k=j.length)<($=X.length))?k:$,k=$=0;$<q;$++)if(j[$]!=X[$]){F=j[$]<X[$];break}if(F&&(z=j,j=X,X=z,I.s=-I.s),$=(q=X.length)-(O=j.length),$>0)for(;$--;j[O++]=0);for($=m-1;q>k;){if(j[--q]<X[q]){for(O=q;O&&!j[--O];j[O]=$);--j[O],j[q]+=m}j[q]-=X[q]}for(;j[0]==0;j.splice(0,1),--V);return j[0]?Vt(I,j,V):(I.s=Y==3?-1:1,I.c=[I.e=0],I)},ne.modulo=ne.mod=function(I,$){var O,q,z=this;return I=new ie(I,$),!z.c||!I.s||I.c&&!I.c[0]?new ie(NaN):!I.c||z.c&&!z.c[0]?new ie(z):(Oe==9?(q=I.s,I.s=1,O=b(z,I,0,3),I.s=q,O.s*=q):O=b(z,I,0,Oe),I=z.minus(O.times(I)),!I.c[0]&&Oe==1&&(I.s=z.s),I)},ne.multipliedBy=ne.times=function(I,$){var O,q,z,F,H,k,U,V,j,X,pe,he,Be,nt,it,qe=this,He=qe.c,vt=(I=new ie(I,$)).c;if(!He||!vt||!He[0]||!vt[0])return!qe.s||!I.s||He&&!He[0]&&!vt||vt&&!vt[0]&&!He?I.c=I.e=I.s=null:(I.s*=qe.s,!He||!vt?I.c=I.e=null:(I.c=[0],I.e=0)),I;for(q=S(qe.e/h)+S(I.e/h),I.s*=qe.s,U=He.length,X=vt.length,U<X&&(Be=He,He=vt,vt=Be,z=U,U=X,X=z),z=U+X,Be=[];z--;Be.push(0));for(nt=m,it=x,z=X;--z>=0;){for(O=0,pe=vt[z]%it,he=vt[z]/it|0,H=U,F=z+H;F>z;)V=He[--H]%it,j=He[H]/it|0,k=he*V+j*pe,V=pe*V+k%it*it+Be[F]+O,O=(V/nt|0)+(k/it|0)+he*j,Be[F--]=V%nt;Be[F]=O}return O?++q:Be.splice(0,1),Vt(I,Be,q)},ne.negated=function(){var I=new ie(this);return I.s=-I.s||null,I},ne.plus=function(I,$){var O,q=this,z=q.s;if(I=new ie(I,$),$=I.s,!z||!$)return new ie(NaN);if(z!=$)return I.s=-$,q.minus(I);var F=q.e/h,H=I.e/h,k=q.c,U=I.c;if(!F||!H){if(!k||!U)return new ie(z/0);if(!k[0]||!U[0])return U[0]?I:new ie(k[0]?q:z*0)}if(F=S(F),H=S(H),k=k.slice(),z=F-H){for(z>0?(H=F,O=U):(z=-z,O=k),O.reverse();z--;O.push(0));O.reverse()}for(z=k.length,$=U.length,z-$<0&&(O=U,U=k,k=O,$=z),z=0;$;)z=(k[--$]=k[$]+U[$]+z)/m|0,k[$]=m===k[$]?0:k[$]%m;return z&&(k=[z].concat(k),++H),Vt(I,k,H)},ne.precision=ne.sd=function(I,$){var O,q,z,F=this;if(I!=null&&I!==!!I)return u(I,1,T),$==null?$=Y:u($,0,8),Ze(new ie(F),I,$);if(!(O=F.c))return null;if(z=O.length-1,q=z*h+1,z=O[z]){for(;z%10==0;z/=10,q--);for(z=O[0];z>=10;z/=10,q++);}return I&&F.e+1>q&&(q=F.e+1),q},ne.shiftedBy=function(I){return u(I,-v,v),this.times("1e"+I)},ne.squareRoot=ne.sqrt=function(){var I,$,O,q,z,F=this,H=F.c,k=F.s,U=F.e,V=se+4,j=new ie("0.5");if(k!==1||!H||!H[0])return new ie(!k||k<0&&(!H||H[0])?NaN:H?F:1/0);if(k=Math.sqrt(+Je(F)),k==0||k==1/0?($=D(H),($.length+U)%2==0&&($+="0"),k=Math.sqrt(+$),U=S((U+1)/2)-(U<0||U%2),k==1/0?$="5e"+U:($=k.toExponential(),$=$.slice(0,$.indexOf("e")+1)+U),O=new ie($)):O=new ie(k+""),O.c[0]){for(U=O.e,k=U+V,k<3&&(k=0);;)if(z=O,O=j.times(z.plus(b(F,z,V,1))),D(z.c).slice(0,k)===($=D(O.c)).slice(0,k))if(O.e<U&&--k,$=$.slice(k-3,k+1),$=="9999"||!q&&$=="4999"){if(!q&&(Ze(z,z.e+se+2,0),z.times(z).eq(F))){O=z;break}V+=4,k+=4,q=1}else{(!+$||!+$.slice(1)&&$.charAt(0)=="5")&&(Ze(O,O.e+se+2,1),I=!O.times(O).eq(F));break}}return Ze(O,O.e+se+1,Y,I)},ne.toExponential=function(I,$){return I!=null&&(u(I,0,T),I++),ut(this,I,$,1)},ne.toFixed=function(I,$){return I!=null&&(u(I,0,T),I=I+this.e+1),ut(this,I,$)},ne.toFormat=function(I,$,O){var q,z=this;if(O==null)I!=null&&$&&typeof $=="object"?(O=$,$=null):I&&typeof I=="object"?(O=I,I=$=null):O=Ke;else if(typeof O!="object")throw Error(s+"Argument not an object: "+O);if(q=z.toFixed(I,$),z.c){var F,H=q.split("."),k=+O.groupSize,U=+O.secondaryGroupSize,V=O.groupSeparator||"",j=H[0],X=H[1],pe=z.s<0,he=pe?j.slice(1):j,Be=he.length;if(U&&(F=k,k=U,U=F,Be-=F),k>0&&Be>0){for(F=Be%k||k,j=he.substr(0,F);F<Be;F+=k)j+=V+he.substr(F,k);U>0&&(j+=V+he.slice(F)),pe&&(j="-"+j)}q=X?j+(O.decimalSeparator||"")+((U=+O.fractionGroupSize)?X.replace(new RegExp("\\d{"+U+"}\\B","g"),"$&"+(O.fractionGroupSeparator||"")):X):j}return(O.prefix||"")+q+(O.suffix||"")},ne.toFraction=function(I){var $,O,q,z,F,H,k,U,V,j,X,pe,he=this,Be=he.c;if(I!=null&&(k=new ie(I),!k.isInteger()&&(k.c||k.s!==1)||k.lt(Re)))throw Error(s+"Argument "+(k.isInteger()?"out of range: ":"not an integer: ")+Je(k));if(!Be)return new ie(he);for($=new ie(Re),V=O=new ie(Re),q=U=new ie(Re),pe=D(Be),F=$.e=pe.length-he.e-1,$.c[0]=P[(H=F%h)<0?h+H:H],I=!I||k.comparedTo($)>0?F>0?$:V:k,H=ce,ce=1/0,k=new ie(pe),U.c[0]=0;j=b(k,$,0,1),z=O.plus(j.times(q)),z.comparedTo(I)!=1;)O=q,q=z,V=U.plus(j.times(z=V)),U=z,$=k.minus(j.times(z=$)),k=z;return z=b(I.minus(O),q,0,1),U=U.plus(z.times(V)),O=O.plus(z.times(q)),U.s=V.s=he.s,F=F*2,X=b(V,q,F,Y).minus(he).abs().comparedTo(b(U,O,F,Y).minus(he).abs())<1?[V,q]:[U,O],ce=H,X},ne.toNumber=function(){return+Je(this)},ne.toPrecision=function(I,$){return I!=null&&u(I,1,T),ut(this,I,$,2)},ne.toString=function(I){var $,O=this,q=O.s,z=O.e;return z===null?q?($="Infinity",q<0&&($="-"+$)):$="NaN":(I==null?$=z<=K||z>=re?c(D(O.c),z):y(D(O.c),z,"0"):I===10&&Tt?(O=Ze(new ie(O),se+z+1,Y),$=y(D(O.c),O.e,"0")):(u(I,2,Qe.length,"Base"),$=g(y(D(O.c),z,"0"),10,I,q,!0)),q<0&&O.c[0]&&($="-"+$)),$},ne.valueOf=ne.toJSON=function(){return Je(this)},ne._isBigNumber=!0,l!=null&&ie.set(l),ie}i(w,"clone");function S(l){var b=l|0;return l>0||l===b?b:b-1}i(S,"bitFloor");function D(l){for(var b,g,oe=1,ne=l.length,Re=l[0]+"";oe<ne;){for(b=l[oe++]+"",g=h-b.length;g--;b="0"+b);Re+=b}for(ne=Re.length;Re.charCodeAt(--ne)===48;);return Re.slice(0,ne+1||1)}i(D,"coeffToString");function E(l,b){var g,oe,ne=l.c,Re=b.c,se=l.s,Y=b.s,K=l.e,re=b.e;if(!se||!Y)return null;if(g=ne&&!ne[0],oe=Re&&!Re[0],g||oe)return g?oe?0:-Y:se;if(se!=Y)return se;if(g=se<0,oe=K==re,!ne||!Re)return oe?0:!ne^g?1:-1;if(!oe)return K>re^g?1:-1;for(Y=(K=ne.length)<(re=Re.length)?K:re,se=0;se<Y;se++)if(ne[se]!=Re[se])return ne[se]>Re[se]^g?1:-1;return K==re?0:K>re^g?1:-1}i(E,"compare");function u(l,b,g,oe){if(l<b||l>g||l!==o(l))throw Error(s+(oe||"Argument")+(typeof l=="number"?l<b||l>g?" out of range: ":" not an integer: ":" not a primitive number: ")+String(l))}i(u,"intCheck");function f(l){var b=l.c.length-1;return S(l.e/h)==b&&l.c[b]%2!=0}i(f,"isOdd");function c(l,b){return(l.length>1?l.charAt(0)+"."+l.slice(1):l)+(b<0?"e":"e+")+b}i(c,"toExponential");function y(l,b,g){var oe,ne;if(b<0){for(ne=g+".";++b;ne+=g);l=ne+l}else if(oe=l.length,++b>oe){for(ne=g,b-=oe;--b;ne+=g);l+=ne}else b<oe&&(l=l.slice(0,b)+"."+l.slice(b));return l}i(y,"toFixedPoint"),e=w(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof Au<"u"&&Au.exports?Au.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(qw)});var Hw=L((p7,Gw)=>{var Bw=Yd(),Vw=Gw.exports;(function(){"use strict";function t(v){return v<10?"0"+v:v}i(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,o,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},p;function m(v){return r.lastIndex=0,r.test(v)?'"'+v.replace(r,function(P){var x=s[P];return typeof x=="string"?x:"\\u"+("0000"+P.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+v+'"'}i(m,"quote");function h(v,P){var x,T,w,S,D=n,E,u=P[v],f=u!=null&&(u instanceof Bw||Bw.isBigNumber(u));switch(u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON(v)),typeof p=="function"&&(u=p.call(P,v,u)),typeof u){case"string":return f?u:m(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":case"bigint":return String(u);case"object":if(!u)return"null";if(n+=o,E=[],Object.prototype.toString.apply(u)==="[object Array]"){for(S=u.length,x=0;x<S;x+=1)E[x]=h(x,u)||"null";return w=E.length===0?"[]":n?`[
32
+ `+n+E.join(`,
33
33
  `+n)+`
34
- `+$+"]":"["+b.join(",")+"]",n=$,w}if(f&&typeof f=="object")for(T=f.length,E=0;E<T;E+=1)typeof f[E]=="string"&&(S=f[E],w=h(S,u),w&&b.push(m(S)+(n?": ":":")+w));else Object.keys(u).forEach(function(c){var y=h(c,u);y&&b.push(m(c)+(n?": ":":")+y)});return w=b.length===0?"{}":n?`{
35
- `+n+b.join(`,
34
+ `+D+"]":"["+E.join(",")+"]",n=D,w}if(p&&typeof p=="object")for(S=p.length,x=0;x<S;x+=1)typeof p[x]=="string"&&(T=p[x],w=h(T,u),w&&E.push(m(T)+(n?": ":":")+w));else Object.keys(u).forEach(function(c){var y=h(c,u);y&&E.push(m(c)+(n?": ":":")+y)});return w=E.length===0?"{}":n?`{
35
+ `+n+E.join(`,
36
36
  `+n)+`
37
- `+$+"}":"{"+b.join(",")+"}",n=$,w}}o(h,"str"),typeof Iw.stringify!="function"&&(Iw.stringify=function(_,P,E){var S;if(n="",i="",typeof E=="number")for(S=0;S<E;S+=1)i+=" ";else typeof E=="string"&&(i=E);if(f=P,P&&typeof P!="function"&&(typeof P!="object"||typeof P.length!="number"))throw new Error("JSON.stringify");return h("",{"":_})})})()});var Dw=M((j5,Ow)=>{var Eu=null,KD=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,JD=/(?: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)/,YD=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:" "},a,f=o(function($){throw{name:"SyntaxError",message:$,at:r,text:a}},"error"),m=o(function($){return $&&$!==n&&f("Expected '"+$+"' instead of '"+n+"'"),n=a.charAt(r),r+=1,n},"next"),h=o(function(){var $,b="";for(n==="-"&&(b="-",m("-"));n>="0"&&n<="9";)b+=n,m();if(n===".")for(b+=".";m()&&n>="0"&&n<="9";)b+=n;if(n==="e"||n==="E")for(b+=n,m(),(n==="-"||n==="+")&&(b+=n,m());n>="0"&&n<="9";)b+=n,m();if($=+b,!isFinite($))f("Bad number");else return Eu==null&&(Eu=Hd()),b.length>15?e.storeAsString?b:e.useNativeBigInt?BigInt(b):new Eu(b):e.alwaysParseAsBig?e.useNativeBigInt?BigInt($):new Eu($):$},"number"),_=o(function(){var $,b,u="",p;if(n==='"')for(var c=r;m();){if(n==='"')return r-1>c&&(u+=a.substring(c,r-1)),m(),u;if(n==="\\"){if(r-1>c&&(u+=a.substring(c,r-1)),m(),n==="u"){for(p=0,b=0;b<4&&($=parseInt(m(),16),!!isFinite($));b+=1)p=p*16+$;u+=String.fromCharCode(p)}else if(typeof i[n]=="string")u+=i[n];else break;c=r}}f("Bad string")},"string"),P=o(function(){for(;n&&n<=" ";)m()},"white"),E=o(function(){switch(n){case"t":return m("t"),m("r"),m("u"),m("e"),!0;case"f":return m("f"),m("a"),m("l"),m("s"),m("e"),!1;case"n":return m("n"),m("u"),m("l"),m("l"),null}f("Unexpected '"+n+"'")},"word"),S,w=o(function(){var $=[];if(n==="["){if(m("["),P(),n==="]")return m("]"),$;for(;n;){if($.push(S()),P(),n==="]")return m("]"),$;m(","),P()}}f("Bad array")},"array"),T=o(function(){var $,b=Object.create(null);if(n==="{"){if(m("{"),P(),n==="}")return m("}"),b;for(;n;){if($=_(),P(),m(":"),e.strict===!0&&Object.hasOwnProperty.call(b,$)&&f('Duplicate key "'+$+'"'),KD.test($)===!0?e.protoAction==="error"?f("Object contains forbidden prototype property"):e.protoAction==="ignore"?S():b[$]=S():JD.test($)===!0?e.constructorAction==="error"?f("Object contains forbidden constructor property"):e.constructorAction==="ignore"?S():b[$]=S():b[$]=S(),P(),n==="}")return m("}"),b;m(","),P()}}f("Bad object")},"object");return S=o(function(){switch(P(),n){case"{":return T();case"[":return w();case'"':return _();case"-":return h();default:return n>="0"&&n<="9"?h():E()}},"value"),function($,b){var u;return a=$+"",r=0,n=" ",u=S(),P(),n&&f("Syntax error"),typeof b=="function"?o(function p(c,y){var l,x,g=c[y];return g&&typeof g=="object"&&Object.keys(g).forEach(function(re){x=p(g,re),x!==void 0?g[re]=x:delete g[re]}),b.call(c,y,g)},"walk")({"":u},""):u}},"json_parse");Ow.exports=YD});var zw=M((F5,bu)=>{var Cw=$w().stringify,Nw=Dw();bu.exports=function(t){return{parse:Nw(t),stringify:Cw}};bu.exports.parse=Nw();bu.exports.stringify=Cw});var Wd=M(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.GCE_LINUX_BIOS_PATHS=void 0;Sr.isGoogleCloudServerless=jw;Sr.isGoogleComputeEngineLinux=Mw;Sr.isGoogleComputeEngineMACAddress=Fw;Sr.isGoogleComputeEngine=Lw;Sr.detectGCPResidency=QD;var Uw=require("fs"),kw=require("os");Sr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var XD=/^42:01/;function jw(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(jw,"isGoogleCloudServerless");function Mw(){if((0,kw.platform)()!=="linux")return!1;try{(0,Uw.statSync)(Sr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,Uw.readFileSync)(Sr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(Mw,"isGoogleComputeEngineLinux");function Fw(){let t=(0,kw.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(XD.test(r))return!0}return!1}o(Fw,"isGoogleComputeEngineMACAddress");function Lw(){return Mw()||Fw()}o(Lw,"isGoogleComputeEngine");function QD(){return jw()||Lw()}o(QD,"detectGCPResidency")});var qw=M(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.Colours=void 0;var It=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="")}};Au.Colours=It;It.enabled=!1;It.reset="";It.bright="";It.dim="";It.red="";It.green="";It.yellow="";It.blue="";It.magenta="";It.cyan="";It.white="";It.grey="";It.refresh()});var Hw=M(Ye=>{"use strict";var eC=Ye&&Ye.__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]}),tC=Ye&&Ye.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Bw=Ye&&Ye.__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"&&eC(r,e,n[i]);return tC(r,e),r}}();Object.defineProperty(Ye,"__esModule",{value:!0});Ye.env=Ye.DebugLogBackendBase=Ye.placeholder=Ye.AdhocDebugLogger=Ye.LogSeverity=void 0;Ye.getNodeBackend=Kd;Ye.getDebugBackend=nC;Ye.getStructuredBackend=oC;Ye.setBackend=iC;Ye.log=Gw;var rC=require("events"),hs=Bw(require("process")),Vw=Bw(require("util")),Jt=qw(),Tr;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(Tr||(Ye.LogSeverity=Tr={}));var gs=class extends rC.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(Tr.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(Tr.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(Tr.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(Tr.ERROR,...n),this.func.sublog=n=>Gw(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)}};Ye.AdhocDebugLogger=gs;Ye.placeholder=new gs("",()=>{}).func;var ni=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=hs.env[Ye.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)}}};Ye.DebugLogBackendBase=ni;var Zd=class extends ni{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 a=`${Jt.Colours.green}${e}${Jt.Colours.reset}`,f=`${Jt.Colours.yellow}${hs.pid}${Jt.Colours.reset}`,m;switch(r.severity){case Tr.ERROR:m=`${Jt.Colours.red}${r.severity}${Jt.Colours.reset}`;break;case Tr.INFO:m=`${Jt.Colours.magenta}${r.severity}${Jt.Colours.reset}`;break;case Tr.WARNING:m=`${Jt.Colours.yellow}${r.severity}${Jt.Colours.reset}`;break;default:m=(i=r.severity)!==null&&i!==void 0?i:Tr.DEFAULT;break}let h=Vw.formatWithOptions({colors:Jt.Colours.enabled},...n),_=Object.assign({},r);delete _.severity;let P=Object.getOwnPropertyNames(_).length?JSON.stringify(_):"",E=P?`${Jt.Colours.grey}${P}${Jt.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",f,a,m,h,P?` ${E}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function Kd(){return new Zd}o(Kd,"getNodeBackend");var Jd=class extends ni{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=hs.env.NODE_DEBUG)!==null&&e!==void 0?e:"";hs.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function nC(t){return new Jd(t)}o(nC,"getDebugBackend");var Yd=class extends ni{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,...a)=>{var f;let m=(f=i.severity)!==null&&f!==void 0?f:Tr.INFO,h=Object.assign({severity:m,message:Vw.format(...a)},i),_=JSON.stringify(h);n?n(i,_):console.log("%s",_)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function oC(t){return new Yd(t)}o(oC,"getStructuredBackend");Ye.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var Xd=new Map,Yt;function iC(t){Yt=t,Xd.clear()}o(iC,"setBackend");function Gw(t,e){if(!Yt&&!hs.env[Ye.env.nodeEnables]||!t)return Ye.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=Xd.get(t);if(r)return r.func;if(Yt===null)return Ye.placeholder;Yt===void 0&&(Yt=Kd());let n=(()=>{let i;return new gs(t,(f,...m)=>{if(i!==Yt){if(Yt===null)return;Yt===void 0&&(Yt=Kd()),i=Yt}Yt?.log(t,f,...m)})})();return Xd.set(t,n),n.func}o(Gw,"log")});var Qd=M(po=>{"use strict";var sC=po&&po.__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]}),aC=po&&po.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sC(e,t,r)};Object.defineProperty(po,"__esModule",{value:!0});aC(Hw(),po)});var vs=M(he=>{"use strict";var Zw=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]}),uC=he&&he.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),cC=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"&&Zw(r,e,n[i]);return uC(r,e),r}}(),lC=he&&he.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zw(e,t,r)};Object.defineProperty(he,"__esModule",{value:!0});he.gcpResidencyCache=he.METADATA_SERVER_DETECTION=he.HEADERS=he.HEADER_VALUE=he.HEADER_NAME=he.SECONDARY_HOST_ADDRESS=he.HOST_ADDRESS=he.BASE_PATH=void 0;he.instance=gC;he.project=yC;he.universe=vC;he.bulk=_C;he.isAvailable=wC;he.resetIsAvailableCache=xC;he.getGCPResidency=rp;he.setGCPResidency=Kw;he.requestTimeout=Jw;var ep=pt(),dC=zw(),pC=Wd(),fC=cC(Qd());he.BASE_PATH="/computeMetadata/v1";he.HOST_ADDRESS="http://169.254.169.254";he.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";he.HEADER_NAME="Metadata-Flavor";he.HEADER_VALUE="Google";he.HEADERS=Object.freeze({[he.HEADER_NAME]:he.HEADER_VALUE});var Ww=fC.log("gcp-metadata");he.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 tp(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||he.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(he.BASE_PATH,t).href}o(tp,"getBaseUrl");function mC(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(mC,"validate");async function ys(t,e={},r=3,n=!1){let i=new Headers(he.HEADERS),a="",f={};if(typeof t=="object"){let E=t;new Headers(E.headers).forEach((S,w)=>i.set(w,S)),a=E.metadataKey,f=E.params||f,r=E.noResponseRetries||r,n=E.fastFail||n}else a=t;typeof e=="string"?a+=`/${e}`:(mC(e),e.property&&(a+=`/${e.property}`),new Headers(e.headers).forEach((E,S)=>i.set(S,E)),f=e.params||f);let m=n?hC:ep.request,h={url:`${tp()}/${a}`,headers:i,retryConfig:{noResponseRetries:r},params:f,responseType:"text",timeout:Jw()};Ww.info("instance request %j",h);let _=await m(h);Ww.info("instance metadata is %s",_.data);let P=_.headers.get(he.HEADER_NAME);if(P!==he.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${he.HEADER_NAME} header. Expected '${he.HEADER_VALUE}', got ${P?`'${P}'`:"no header"}`);if(typeof _.data=="string")try{return dC.parse(_.data)}catch{}return _.data}o(ys,"metadataAccessor");async function hC(t){let e={...t,url:t.url?.toString().replace(tp(),tp(he.SECONDARY_HOST_ADDRESS))},r=(0,ep.request)(t),n=(0,ep.request)(e);return Promise.any([r,n])}o(hC,"fastFailMetadataRequest");function gC(t){return ys("instance",t)}o(gC,"instance");function yC(t){return ys("project",t)}o(yC,"project");function vC(t){return ys("universe",t)}o(vC,"universe");async function _C(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await ys(r),i=r.metadataKey;e[i]=n})())),e}o(_C,"bulk");function PC(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(PC,"detectGCPAvailableRetries");var Iu;async function wC(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in he.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(he.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return rp();case"ping-only":}}try{return Iu===void 0&&(Iu=ys("instance",void 0,PC(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Iu,!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(wC,"isAvailable");function xC(){Iu=void 0}o(xC,"resetIsAvailableCache");he.gcpResidencyCache=null;function rp(){return he.gcpResidencyCache===null&&Kw(),he.gcpResidencyCache}o(rp,"getGCPResidency");function Kw(t=null){he.gcpResidencyCache=t!==null?t:(0,pC.detectGCPResidency)()}o(Kw,"setGCPResidency");function Jw(){return rp()?0:3e3}o(Jw,"requestTimeout");lC(Wd(),he)});var Qw=M(Ru=>{"use strict";Ru.byteLength=TC;Ru.toByteArray=bC;Ru.fromByteArray=RC;var kr=[],dr=[],SC=typeof Uint8Array<"u"?Uint8Array:Array,np="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(fo=0,Yw=np.length;fo<Yw;++fo)kr[fo]=np[fo],dr[np.charCodeAt(fo)]=fo;var fo,Yw;dr[45]=62;dr[95]=63;function Xw(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(Xw,"getLens");function TC(t){var e=Xw(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(TC,"byteLength");function EC(t,e,r){return(e+r)*3/4-r}o(EC,"_byteLength");function bC(t){var e,r=Xw(t),n=r[0],i=r[1],a=new SC(EC(t,n,i)),f=0,m=i>0?n-4:n,h;for(h=0;h<m;h+=4)e=dr[t.charCodeAt(h)]<<18|dr[t.charCodeAt(h+1)]<<12|dr[t.charCodeAt(h+2)]<<6|dr[t.charCodeAt(h+3)],a[f++]=e>>16&255,a[f++]=e>>8&255,a[f++]=e&255;return i===2&&(e=dr[t.charCodeAt(h)]<<2|dr[t.charCodeAt(h+1)]>>4,a[f++]=e&255),i===1&&(e=dr[t.charCodeAt(h)]<<10|dr[t.charCodeAt(h+1)]<<4|dr[t.charCodeAt(h+2)]>>2,a[f++]=e>>8&255,a[f++]=e&255),a}o(bC,"toByteArray");function AC(t){return kr[t>>18&63]+kr[t>>12&63]+kr[t>>6&63]+kr[t&63]}o(AC,"tripletToBase64");function IC(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(AC(n));return i.join("")}o(IC,"encodeChunk");function RC(t){for(var e,r=t.length,n=r%3,i=[],a=16383,f=0,m=r-n;f<m;f+=a)i.push(IC(t,f,f+a>m?m:f+a));return n===1?(e=t[r-1],i.push(kr[e>>2]+kr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(kr[e>>10]+kr[e>>4&63]+kr[e<<2&63]+"=")),i.join("")}o(RC,"fromByteArray")});var ip=M(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.fromArrayBufferToHex=$C;function $C(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o($C,"fromArrayBufferToHex")});var ex=M($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.BrowserCrypto=void 0;var oi=Qw(),OC=ip(),sp=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 oi.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),oi.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"}},a=new TextEncoder().encode(r),f=oi.toByteArray(t.padBase64(n)),m=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,m,f,a)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),a=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),f=await window.crypto.subtle.sign(n,a,i);return oi.fromByteArray(new Uint8Array(f))}decodeBase64StringUtf8(e){let r=oi.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return oi.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,OC.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),i=new TextEncoder,a=await window.crypto.subtle.importKey("raw",i.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",a,i.encode(r))}};$u.BrowserCrypto=sp});var tx=M(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.NodeCrypto=void 0;var ii=require("crypto"),ap=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return ii.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return ii.randomBytes(e).toString("base64")}async verify(e,r,n){let i=ii.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=ii.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 ii.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:CC(e);return DC(ii.createHmac("sha256",n).update(r).digest())}};Ou.NodeCrypto=ap;function DC(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(DC,"toArrayBuffer");function CC(t){return Buffer.from(t)}o(CC,"toBuffer")});var _s=M(pn=>{"use strict";var NC=pn&&pn.__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]}),zC=pn&&pn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NC(e,t,r)};Object.defineProperty(pn,"__esModule",{value:!0});pn.createCrypto=jC;pn.hasBrowserCrypto=rx;var UC=ex(),kC=tx();zC(ip(),pn);function jC(){return rx()?new UC.BrowserCrypto:new kC.NodeCrypto}o(jC,"createCrypto");function rx(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(rx,"hasBrowserCrypto")});var si=M((up,ox)=>{var Du=require("buffer"),jr=Du.Buffer;function nx(t,e){for(var r in t)e[r]=t[r]}o(nx,"copyProps");jr.from&&jr.alloc&&jr.allocUnsafe&&jr.allocUnsafeSlow?ox.exports=Du:(nx(Du,up),up.Buffer=mo);function mo(t,e,r){return jr(t,e,r)}o(mo,"SafeBuffer");mo.prototype=Object.create(jr.prototype);nx(jr,mo);mo.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return jr(t,e,r)};mo.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=jr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};mo.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return jr(t)};mo.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Du.SlowBuffer(t)}});var sx=M((uY,ix)=>{"use strict";function cp(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(cp,"getParamSize");var MC={ES256:cp(256),ES384:cp(384),ES512:cp(521)};function FC(t){var e=MC[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(FC,"getParamBytesForAlg");ix.exports=FC});var lp=M((lY,px)=>{"use strict";var Cu=si().Buffer,ux=sx(),Nu=128,cx=0,LC=32,qC=16,BC=2,lx=qC|LC|cx<<6,zu=BC|cx<<6;function VC(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(VC,"base64Url");function dx(t){if(Cu.isBuffer(t))return t;if(typeof t=="string")return Cu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}o(dx,"signatureAsBuffer");function GC(t,e){t=dx(t);var r=ux(e),n=r+1,i=t.length,a=0;if(t[a++]!==lx)throw new Error('Could not find expected "seq"');var f=t[a++];if(f===(Nu|1)&&(f=t[a++]),i-a<f)throw new Error('"seq" specified length of "'+f+'", only "'+(i-a)+'" remaining');if(t[a++]!==zu)throw new Error('Could not find expected "int" for "r"');var m=t[a++];if(i-a-2<m)throw new Error('"r" specified length of "'+m+'", only "'+(i-a-2)+'" available');if(n<m)throw new Error('"r" specified length of "'+m+'", max of "'+n+'" is acceptable');var h=a;if(a+=m,t[a++]!==zu)throw new Error('Could not find expected "int" for "s"');var _=t[a++];if(i-a!==_)throw new Error('"s" specified length of "'+_+'", expected "'+(i-a)+'"');if(n<_)throw new Error('"s" specified length of "'+_+'", max of "'+n+'" is acceptable');var P=a;if(a+=_,a!==i)throw new Error('Expected to consume entire buffer, but "'+(i-a)+'" bytes remain');var E=r-m,S=r-_,w=Cu.allocUnsafe(E+m+S+_);for(a=0;a<E;++a)w[a]=0;t.copy(w,a,h+Math.max(-E,0),h+m),a=r;for(var T=a;a<T+S;++a)w[a]=0;return t.copy(w,a,P+Math.max(-S,0),P+_),w=w.toString("base64"),w=VC(w),w}o(GC,"derToJose");function ax(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=Nu;return i&&--n,n}o(ax,"countPadding");function HC(t,e){t=dx(t);var r=ux(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=ax(t,0,r),a=ax(t,r,t.length),f=r-i,m=r-a,h=2+f+1+1+m,_=h<Nu,P=Cu.allocUnsafe((_?2:3)+h),E=0;return P[E++]=lx,_?P[E++]=h:(P[E++]=Nu|1,P[E++]=h&255),P[E++]=zu,P[E++]=f,i<0?(P[E++]=0,E+=t.copy(P,E,0,r)):E+=t.copy(P,E,i,r),P[E++]=zu,P[E++]=m,a<0?(P[E++]=0,t.copy(P,E,r)):t.copy(P,E,r+a),P}o(HC,"joseToDer");px.exports={derToJose:GC,joseToDer:HC}});var Er=M(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.LRUCache=void 0;fn.snakeToCamel=mx;fn.originalOrCamelOptions=JC;fn.removeUndefinedValuesInObject=YC;fn.isValidFile=XC;fn.getWellKnownCertificateConfigFileLocation=QC;var WC=require("fs"),ZC=require("os"),dp=require("path"),KC="certificate_config.json",fx="gcloud";function mx(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(mx,"snakeToCamel");function JC(t){function e(r){let n=t||{};return n[r]??n[mx(r)]}return o(e,"get"),{get:e}}o(JC,"originalOrCamelOptions");var pp=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()}};fn.LRUCache=pp;function YC(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(YC,"removeUndefinedValuesInObject");async function XC(t){try{return(await WC.promises.lstat(t)).isFile()}catch{return!1}}o(XC,"isValidFile");function QC(){let t=process.env.CLOUDSDK_CONFIG||(eN()?dp.join(process.env.APPDATA||"",fx):dp.join(process.env.HOME||"",".config",fx));return dp.join(t,KC)}o(QC,"getWellKnownCertificateConfigFileLocation");function eN(){return ZC.platform().startsWith("win")}o(eN,"_isWindows")});var hx=M((mY,tN)=>{tN.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 fp=M(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.USER_AGENT=Fn.PRODUCT_NAME=Fn.pkg=void 0;var gx=hx();Fn.pkg=gx;var yx="google-api-nodejs-client";Fn.PRODUCT_NAME=yx;var rN=`${yx}/${gx.version}`;Fn.USER_AGENT=rN});var Xt=M(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.AuthClient=br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=br.DEFAULT_UNIVERSE=void 0;var nN=require("events"),mp=pt(),oN=Er(),iN=Qd(),hp=fp();br.DEFAULT_UNIVERSE="googleapis.com";br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=5*60*1e3;var gp=class t extends nN.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,oN.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 mp.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,a=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&&mp.Gaxios.mergeHeaders(a,r.headers),n&&mp.Gaxios.mergeHeaders(a,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:a,url:i}):this.request({...n,headers:a,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,iN.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(`${hp.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${hp.USER_AGENT}`):e.headers.set("User-Agent",hp.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],a=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=a;let f={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,a,f):t.log.info("[%s] request %j",a,f)}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=gp});var vp=M(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.LoginTicket=void 0;var yp=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()}}};Uu.LoginTicket=yp});var ho=M(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.OAuth2Client=Mr.ClientAuthentication=Mr.CertificateFormat=Mr.CodeChallengeMethod=void 0;var vx=pt(),sN=require("querystring"),aN=require("stream"),uN=lp(),_x=Er(),_p=_s(),ai=Xt(),cN=vp(),Px;(function(t){t.Plain="plain",t.S256="S256"})(Px||(Mr.CodeChallengeMethod=Px={}));var mn;(function(t){t.PEM="PEM",t.JWK="JWK"})(mn||(Mr.CertificateFormat=mn={}));var Ps;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(Ps||(Mr.ClientAuthentication=Ps={}));var Pp=class t extends ai.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=mn.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||Ps.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()+"?"+sN.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,_p.createCrypto)(),n=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),a=(await e.sha256DigestBase64(n)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:n,codeChallenge:a}}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===Ps.ClientSecretBasic){let h=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${h.toString("base64")}`)}this.clientAuthentication===Ps.ClientSecretPost&&(i.client_secret=this._clientSecret);let a={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,_x.removeUndefinedValuesInObject)(i)),headers:n};ai.AuthClient.setMethodName(a,"getTokenAsync");let f=await this.transporter.request(a),m=f.data;return f.data&&f.data.expires_in&&(m.expiry_date=new Date().getTime()+f.data.expires_in*1e3,delete m.expires_in),this.emit("tokens",m),{tokens:m,res:f}}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 f={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,_x.removeUndefinedValuesInObject)(n))};ai.AuthClient.setMethodName(f,"refreshTokenNoCache"),i=await this.transporter.request(f)}catch(f){throw f instanceof vx.GaxiosError&&f.message==="invalid_grant"&&f.response?.data&&/ReAuth/i.test(f.response.data.error_description)&&(f.message=JSON.stringify(f.response.data)),f}let a=i.data;return i.data&&i.data.expires_in&&(a.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete a.expires_in),this.emit("tokens",a),{tokens:a,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 m=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(m)}}if(this.refreshHandler){let m=await this.processAndValidateRefreshHandler();if(m?.access_token){this.setCredentials(m);let h=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(h)}}}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(m){let h=m;throw h.response&&(h.response.status===403||h.response.status===404)&&(h.message=`Could not refresh access token: ${h.message}`),h}let a=this.credentials;a.token_type=a.token_type||"Bearer",i.refresh_token=a.refresh_token,this.credentials=i;let f=new Headers({authorization:a.token_type+" "+i.access_token});return{headers:this.addSharedMetadataHeaders(f),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(ai.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=vx.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 a=i.status,f=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),m=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,h=i.config.data instanceof aN.Readable,_=a===401||a===403;if(!r&&_&&!h&&f)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&_&&!h&&m){let P=await this.processAndValidateRefreshHandler();return P?.access_token&&this.setCredentials(P),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,_p.hasBrowserCrypto)()?mn.JWK:mn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case mn.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case mn.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let _={...t.RETRY_CONFIG,url:i};ai.AuthClient.setMethodName(_,"getFederatedSignonCertsAsync"),n=await this.transporter.request(_)}catch(_){throw _ instanceof Error&&(_.message=`Failed to retrieve verification certificates: ${_.message}`),_}let a=n?.headers.get("cache-control"),f=-1;if(a){let _=/max-age=(?<maxAge>[0-9]+)/.exec(a)?.groups?.maxAge;_&&(f=Number(_)*1e3)}let m={};switch(r){case mn.PEM:m=n.data;break;case mn.JWK:for(let _ of n.data.keys)m[_.kid]=_;break;default:throw new Error(`Unsupported certificate format ${r}`)}let h=new Date;return this.certificateExpiry=f===-1?null:new Date(h.getTime()+f),this.certificateCache=m,this.certificateCacheFormat=r,{certs:m,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};ai.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,a){let f=(0,_p.createCrypto)();a||(a=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let m=e.split(".");if(m.length!==3)throw new Error("Wrong number of segments in token: "+e);let h=m[0]+"."+m[1],_=m[2],P,E;try{P=JSON.parse(f.decodeBase64StringUtf8(m[0]))}catch(c){throw c instanceof Error&&(c.message=`Can't parse token envelope: ${m[0]}': ${c.message}`),c}if(!P)throw new Error("Can't parse token envelope: "+m[0]);try{E=JSON.parse(f.decodeBase64StringUtf8(m[1]))}catch(c){throw c instanceof Error&&(c.message=`Can't parse token payload '${m[0]}`),c}if(!E)throw new Error("Can't parse token payload: "+m[1]);if(!Object.prototype.hasOwnProperty.call(r,P.kid))throw new Error("No pem found for envelope: "+JSON.stringify(P));let S=r[P.kid];if(P.alg==="ES256"&&(_=uN.joseToDer(_,"ES256").toString("base64")),!await f.verify(S,h,_))throw new Error("Invalid token signature: "+e);if(!E.iat)throw new Error("No issue time in token: "+JSON.stringify(E));if(!E.exp)throw new Error("No expiration time in token: "+JSON.stringify(E));let T=Number(E.iat);if(isNaN(T))throw new Error("iat field using invalid format");let $=Number(E.exp);if(isNaN($))throw new Error("exp field using invalid format");let b=new Date().getTime()/1e3;if($>=b+a)throw new Error("Expiration time too far in future: "+JSON.stringify(E));let u=T-t.CLOCK_SKEW_SECS_,p=$+t.CLOCK_SKEW_SECS_;if(b<u)throw new Error("Token used too early, "+b+" < "+u+": "+JSON.stringify(E));if(b>p)throw new Error("Token used too late, "+b+" > "+p+": "+JSON.stringify(E));if(i&&i.indexOf(E.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+E.iss);if(typeof n<"u"&&n!==null){let c=E.aud,y=!1;if(n.constructor===Array?y=n.indexOf(c)>-1:y=c===n,!y)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new cN.LoginTicket(P,E)}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}};Mr.OAuth2Client=Pp});var xp=M(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.Compute=void 0;var lN=pt(),wx=vs(),dN=ho(),wp=class extends dN.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 wx.instance(i)}catch(i){throw i instanceof lN.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 wx.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))}};ku.Compute=wp});var Tp=M(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.IdTokenClient=void 0;var pN=ho(),Sp=class extends pN.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}};ju.IdTokenClient=Sp});var Ep=M(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.GCPEnv=void 0;ui.clear=fN;ui.getEnv=mN;var xx=vs(),Fr;(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"})(Fr||(ui.GCPEnv=Fr={}));var ws;function fN(){ws=void 0}o(fN,"clear");async function mN(){return ws||(ws=hN(),ws)}o(mN,"getEnv");async function hN(){let t=Fr.NONE;return gN()?t=Fr.APP_ENGINE:yN()?t=Fr.CLOUD_FUNCTIONS:await wN()?await PN()?t=Fr.KUBERNETES_ENGINE:vN()?t=Fr.CLOUD_RUN:_N()?t=Fr.CLOUD_RUN_JOBS:t=Fr.COMPUTE_ENGINE:t=Fr.NONE,t}o(hN,"getEnvMemoized");function gN(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(gN,"isAppEngine");function yN(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o(yN,"isCloudFunction");function vN(){return!!process.env.K_CONFIGURATION}o(vN,"isCloudRun");function _N(){return!!process.env.CLOUD_RUN_JOB}o(_N,"isCloudRunJob");async function PN(){try{return await xx.instance("attributes/cluster-name"),!0}catch{return!1}}o(PN,"isKubernetesEngine");async function wN(){return xx.isAvailable()}o(wN,"isComputeEngine")});var bp=M((IY,Sx)=>{var Mu=si().Buffer,xN=require("stream"),SN=require("util");function Fu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Mu.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Mu.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(Fu,"DataStream");SN.inherits(Fu,xN);Fu.prototype.write=o(function(e){this.buffer=Mu.concat([this.buffer,Mu.from(e)]),this.emit("data",e)},"write");Fu.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");Sx.exports=Fu});var Ex=M(($Y,Tx)=>{"use strict";var xs=require("buffer").Buffer,Ap=require("buffer").SlowBuffer;Tx.exports=Lu;function Lu(t,e){if(!xs.isBuffer(t)||!xs.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(Lu,"bufferEq");Lu.install=function(){xs.prototype.equal=Ap.prototype.equal=o(function(e){return Lu(this,e)},"equal")};var TN=xs.prototype.equal,EN=Ap.prototype.equal;Lu.restore=function(){xs.prototype.equal=TN,Ap.prototype.equal=EN}});var Op=M((DY,Nx)=>{var li=si().Buffer,pr=require("crypto"),Ax=lp(),bx=require("util"),bN=`"%s" is not a valid algorithm.
37
+ `+D+"}":"{"+E.join(",")+"}",n=D,w}}i(h,"str"),typeof Vw.stringify!="function"&&(Vw.stringify=function(v,P,x){var T;if(n="",o="",typeof x=="number")for(T=0;T<x;T+=1)o+=" ";else typeof x=="string"&&(o=x);if(p=P,P&&typeof P!="function"&&(typeof P!="object"||typeof P.length!="number"))throw new Error("JSON.stringify");return h("",{"":v})})})()});var Zw=L((m7,Ww)=>{var Ru=null,wk=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,bk=/(?: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)/,Tk=i(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,o={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
38
+ `,r:"\r",t:" "},s,p=i(function(D){throw{name:"SyntaxError",message:D,at:r,text:s}},"error"),m=i(function(D){return D&&D!==n&&p("Expected '"+D+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),h=i(function(){var D,E="";for(n==="-"&&(E="-",m("-"));n>="0"&&n<="9";)E+=n,m();if(n===".")for(E+=".";m()&&n>="0"&&n<="9";)E+=n;if(n==="e"||n==="E")for(E+=n,m(),(n==="-"||n==="+")&&(E+=n,m());n>="0"&&n<="9";)E+=n,m();if(D=+E,!isFinite(D))p("Bad number");else return Ru==null&&(Ru=Yd()),E.length>15?e.storeAsString?E:e.useNativeBigInt?BigInt(E):new Ru(E):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(D):new Ru(D):D},"number"),v=i(function(){var D,E,u="",f;if(n==='"')for(var c=r;m();){if(n==='"')return r-1>c&&(u+=s.substring(c,r-1)),m(),u;if(n==="\\"){if(r-1>c&&(u+=s.substring(c,r-1)),m(),n==="u"){for(f=0,E=0;E<4&&(D=parseInt(m(),16),!!isFinite(D));E+=1)f=f*16+D;u+=String.fromCharCode(f)}else if(typeof o[n]=="string")u+=o[n];else break;c=r}}p("Bad string")},"string"),P=i(function(){for(;n&&n<=" ";)m()},"white"),x=i(function(){switch(n){case"t":return m("t"),m("r"),m("u"),m("e"),!0;case"f":return m("f"),m("a"),m("l"),m("s"),m("e"),!1;case"n":return m("n"),m("u"),m("l"),m("l"),null}p("Unexpected '"+n+"'")},"word"),T,w=i(function(){var D=[];if(n==="["){if(m("["),P(),n==="]")return m("]"),D;for(;n;){if(D.push(T()),P(),n==="]")return m("]"),D;m(","),P()}}p("Bad array")},"array"),S=i(function(){var D,E=Object.create(null);if(n==="{"){if(m("{"),P(),n==="}")return m("}"),E;for(;n;){if(D=v(),P(),m(":"),e.strict===!0&&Object.hasOwnProperty.call(E,D)&&p('Duplicate key "'+D+'"'),wk.test(D)===!0?e.protoAction==="error"?p("Object contains forbidden prototype property"):e.protoAction==="ignore"?T():E[D]=T():bk.test(D)===!0?e.constructorAction==="error"?p("Object contains forbidden constructor property"):e.constructorAction==="ignore"?T():E[D]=T():E[D]=T(),P(),n==="}")return m("}"),E;m(","),P()}}p("Bad object")},"object");return T=i(function(){switch(P(),n){case"{":return S();case"[":return w();case'"':return v();case"-":return h();default:return n>="0"&&n<="9"?h():x()}},"value"),function(D,E){var u;return s=D+"",r=0,n=" ",u=T(),P(),n&&p("Syntax error"),typeof E=="function"?i((function f(c,y){var l,b,g=c[y];return g&&typeof g=="object"&&Object.keys(g).forEach(function(oe){b=f(g,oe),b!==void 0?g[oe]=b:delete g[oe]}),E.call(c,y,g)}),"walk")({"":u},""):u}},"json_parse");Ww.exports=Tk});var Yw=L((g7,Du)=>{var Kw=Hw().stringify,Jw=Zw();Du.exports=function(t){return{parse:Jw(t),stringify:Kw}};Du.exports.parse=Jw();Du.exports.stringify=Kw});var Xd=L(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.GCE_LINUX_BIOS_PATHS=void 0;xr.isGoogleCloudServerless=eb;xr.isGoogleComputeEngineLinux=tb;xr.isGoogleComputeEngineMACAddress=rb;xr.isGoogleComputeEngine=nb;xr.detectGCPResidency=xk;var Xw=require("fs"),Qw=require("os");xr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var Sk=/^42:01/;function eb(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}i(eb,"isGoogleCloudServerless");function tb(){if((0,Qw.platform)()!=="linux")return!1;try{(0,Xw.statSync)(xr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,Xw.readFileSync)(xr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}i(tb,"isGoogleComputeEngineLinux");function rb(){let t=(0,Qw.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(Sk.test(r))return!0}return!1}i(rb,"isGoogleComputeEngineMACAddress");function nb(){return tb()||rb()}i(nb,"isGoogleComputeEngine");function xk(){return eb()||nb()}i(xk,"detectGCPResidency")});var ib=L($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.Colours=void 0;var $t=class t{static{i(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="")}};$u.Colours=$t;$t.enabled=!1;$t.reset="";$t.bright="";$t.dim="";$t.red="";$t.green="";$t.yellow="";$t.blue="";$t.magenta="";$t.cyan="";$t.white="";$t.grey="";$t.refresh()});var ub=L(Xe=>{"use strict";var Ek=Xe&&Xe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ik=Xe&&Xe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ob=Xe&&Xe.__importStar||(function(){var t=i(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o<n.length;o++)n[o]!=="default"&&Ek(r,e,n[o]);return Ik(r,e),r}})();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.env=Xe.DebugLogBackendBase=Xe.placeholder=Xe.AdhocDebugLogger=Xe.LogSeverity=void 0;Xe.getNodeBackend=ep;Xe.getDebugBackend=Rk;Xe.getStructuredBackend=Dk;Xe.setBackend=$k;Xe.log=sb;var Ak=require("events"),_a=ob(require("process")),ab=ob(require("util")),Qt=ib(),Er;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(Er||(Xe.LogSeverity=Er={}));var Pa=class extends Ak.EventEmitter{static{i(this,"AdhocDebugLogger")}constructor(e,r){super(),this.namespace=e,this.upstream=r,this.func=Object.assign(this.invoke.bind(this),{instance:this,on:i((n,o)=>this.on(n,o),"on")}),this.func.debug=(...n)=>this.invokeSeverity(Er.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(Er.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(Er.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(Er.ERROR,...n),this.func.sublog=n=>sb(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)}};Xe.AdhocDebugLogger=Pa;Xe.placeholder=new Pa("",()=>{}).func;var oo=class{static{i(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=_a.env[Xe.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 o=this.cached.get(e);o||(o=this.makeLogger(e),this.cached.set(e,o)),o(r,...n)}catch(o){console.error(o)}}};Xe.DebugLogBackendBase=oo;var Qd=class extends oo{static{i(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 o;let s=`${Qt.Colours.green}${e}${Qt.Colours.reset}`,p=`${Qt.Colours.yellow}${_a.pid}${Qt.Colours.reset}`,m;switch(r.severity){case Er.ERROR:m=`${Qt.Colours.red}${r.severity}${Qt.Colours.reset}`;break;case Er.INFO:m=`${Qt.Colours.magenta}${r.severity}${Qt.Colours.reset}`;break;case Er.WARNING:m=`${Qt.Colours.yellow}${r.severity}${Qt.Colours.reset}`;break;default:m=(o=r.severity)!==null&&o!==void 0?o:Er.DEFAULT;break}let h=ab.formatWithOptions({colors:Qt.Colours.enabled},...n),v=Object.assign({},r);delete v.severity;let P=Object.getOwnPropertyNames(v).length?JSON.stringify(v):"",x=P?`${Qt.Colours.grey}${P}${Qt.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",p,s,m,h,P?` ${x}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function ep(){return new Qd}i(ep,"getNodeBackend");var tp=class extends oo{static{i(this,"DebugBackend")}constructor(e){super(),this.debugPkg=e}makeLogger(e){let r=this.debugPkg(e);return(n,...o)=>{r(o[0],...o.slice(1))}}setFilters(){var e;let r=(e=_a.env.NODE_DEBUG)!==null&&e!==void 0?e:"";_a.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function Rk(t){return new tp(t)}i(Rk,"getDebugBackend");var rp=class extends oo{static{i(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(o,...s)=>{var p;let m=(p=o.severity)!==null&&p!==void 0?p:Er.INFO,h=Object.assign({severity:m,message:ab.format(...s)},o),v=JSON.stringify(h);n?n(o,v):console.log("%s",v)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function Dk(t){return new rp(t)}i(Dk,"getStructuredBackend");Xe.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var np=new Map,er;function $k(t){er=t,np.clear()}i($k,"setBackend");function sb(t,e){if(!er&&!_a.env[Xe.env.nodeEnables]||!t)return Xe.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=np.get(t);if(r)return r.func;if(er===null)return Xe.placeholder;er===void 0&&(er=ep());let n=(()=>{let o;return new Pa(t,(p,...m)=>{if(o!==er){if(er===null)return;er===void 0&&(er=ep()),o=er}er?.log(t,p,...m)})})();return np.set(t,n),n.func}i(sb,"log")});var ip=L(gi=>{"use strict";var Ok=gi&&gi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ck=gi&&gi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ok(e,t,r)};Object.defineProperty(gi,"__esModule",{value:!0});Ck(ub(),gi)});var ba=L(Pe=>{"use strict";var lb=Pe&&Pe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Nk=Pe&&Pe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kk=Pe&&Pe.__importStar||(function(){var t=i(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o<n.length;o++)n[o]!=="default"&&lb(r,e,n[o]);return Nk(r,e),r}})(),zk=Pe&&Pe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lb(e,t,r)};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.gcpResidencyCache=Pe.METADATA_SERVER_DETECTION=Pe.HEADERS=Pe.HEADER_VALUE=Pe.HEADER_NAME=Pe.SECONDARY_HOST_ADDRESS=Pe.HOST_ADDRESS=Pe.BASE_PATH=void 0;Pe.instance=qk;Pe.project=Bk;Pe.universe=Vk;Pe.bulk=Gk;Pe.isAvailable=Wk;Pe.resetIsAvailableCache=Zk;Pe.getGCPResidency=sp;Pe.setGCPResidency=db;Pe.requestTimeout=pb;var op=mt(),Uk=Yw(),Mk=Xd(),Fk=kk(ip());Pe.BASE_PATH="/computeMetadata/v1";Pe.HOST_ADDRESS="http://169.254.169.254";Pe.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";Pe.HEADER_NAME="Metadata-Flavor";Pe.HEADER_VALUE="Google";Pe.HEADERS=Object.freeze({[Pe.HEADER_NAME]:Pe.HEADER_VALUE});var cb=Fk.log("gcp-metadata");Pe.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 ap(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||Pe.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(Pe.BASE_PATH,t).href}i(ap,"getBaseUrl");function Lk(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.`)}})}i(Lk,"validate");async function wa(t,e={},r=3,n=!1){let o=new Headers(Pe.HEADERS),s="",p={};if(typeof t=="object"){let x=t;new Headers(x.headers).forEach((T,w)=>o.set(w,T)),s=x.metadataKey,p=x.params||p,r=x.noResponseRetries||r,n=x.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(Lk(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((x,T)=>o.set(T,x)),p=e.params||p);let m=n?jk:op.request,h={url:`${ap()}/${s}`,headers:o,retryConfig:{noResponseRetries:r},params:p,responseType:"text",timeout:pb()};cb.info("instance request %j",h);let v=await m(h);cb.info("instance metadata is %s",v.data);let P=v.headers.get(Pe.HEADER_NAME);if(P!==Pe.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${Pe.HEADER_NAME} header. Expected '${Pe.HEADER_VALUE}', got ${P?`'${P}'`:"no header"}`);if(typeof v.data=="string")try{return Uk.parse(v.data)}catch{}return v.data}i(wa,"metadataAccessor");async function jk(t){let e={...t,url:t.url?.toString().replace(ap(),ap(Pe.SECONDARY_HOST_ADDRESS))},r=(0,op.request)(t),n=(0,op.request)(e);return Promise.any([r,n])}i(jk,"fastFailMetadataRequest");function qk(t){return wa("instance",t)}i(qk,"instance");function Bk(t){return wa("project",t)}i(Bk,"project");function Vk(t){return wa("universe",t)}i(Vk,"universe");async function Gk(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await wa(r),o=r.metadataKey;e[o]=n})())),e}i(Gk,"bulk");function Hk(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}i(Hk,"detectGCPAvailableRetries");var Ou;async function Wk(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in Pe.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(Pe.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return sp();case"ping-only":}}try{return Ou===void 0&&(Ou=wa("instance",void 0,Hk(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Ou,!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}}i(Wk,"isAvailable");function Zk(){Ou=void 0}i(Zk,"resetIsAvailableCache");Pe.gcpResidencyCache=null;function sp(){return Pe.gcpResidencyCache===null&&db(),Pe.gcpResidencyCache}i(sp,"getGCPResidency");function db(t=null){Pe.gcpResidencyCache=t!==null?t:(0,Mk.detectGCPResidency)()}i(db,"setGCPResidency");function pb(){return sp()?0:3e3}i(pb,"requestTimeout");zk(Xd(),Pe)});var hb=L(Cu=>{"use strict";Cu.byteLength=Jk;Cu.toByteArray=Xk;Cu.fromByteArray=tz;var jr=[],mr=[],Kk=typeof Uint8Array<"u"?Uint8Array:Array,up="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(yi=0,fb=up.length;yi<fb;++yi)jr[yi]=up[yi],mr[up.charCodeAt(yi)]=yi;var yi,fb;mr[45]=62;mr[95]=63;function mb(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]}i(mb,"getLens");function Jk(t){var e=mb(t),r=e[0],n=e[1];return(r+n)*3/4-n}i(Jk,"byteLength");function Yk(t,e,r){return(e+r)*3/4-r}i(Yk,"_byteLength");function Xk(t){var e,r=mb(t),n=r[0],o=r[1],s=new Kk(Yk(t,n,o)),p=0,m=o>0?n-4:n,h;for(h=0;h<m;h+=4)e=mr[t.charCodeAt(h)]<<18|mr[t.charCodeAt(h+1)]<<12|mr[t.charCodeAt(h+2)]<<6|mr[t.charCodeAt(h+3)],s[p++]=e>>16&255,s[p++]=e>>8&255,s[p++]=e&255;return o===2&&(e=mr[t.charCodeAt(h)]<<2|mr[t.charCodeAt(h+1)]>>4,s[p++]=e&255),o===1&&(e=mr[t.charCodeAt(h)]<<10|mr[t.charCodeAt(h+1)]<<4|mr[t.charCodeAt(h+2)]>>2,s[p++]=e>>8&255,s[p++]=e&255),s}i(Xk,"toByteArray");function Qk(t){return jr[t>>18&63]+jr[t>>12&63]+jr[t>>6&63]+jr[t&63]}i(Qk,"tripletToBase64");function ez(t,e,r){for(var n,o=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),o.push(Qk(n));return o.join("")}i(ez,"encodeChunk");function tz(t){for(var e,r=t.length,n=r%3,o=[],s=16383,p=0,m=r-n;p<m;p+=s)o.push(ez(t,p,p+s>m?m:p+s));return n===1?(e=t[r-1],o.push(jr[e>>2]+jr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],o.push(jr[e>>10]+jr[e>>4&63]+jr[e<<2&63]+"=")),o.join("")}i(tz,"fromByteArray")});var lp=L(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.fromArrayBufferToHex=rz;function rz(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}i(rz,"fromArrayBufferToHex")});var gb=L(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.BrowserCrypto=void 0;var ao=hb(),nz=lp(),dp=class t{static{i(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 ao.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),ao.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let o={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),p=ao.toByteArray(t.padBase64(n)),m=await window.crypto.subtle.importKey("jwk",e,o,!0,["verify"]);return await window.crypto.subtle.verify(o,m,p,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},o=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),p=await window.crypto.subtle.sign(n,s,o);return ao.fromByteArray(new Uint8Array(p))}decodeBase64StringUtf8(e){let r=ao.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return ao.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,nz.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),o=new TextEncoder,s=await window.crypto.subtle.importKey("raw",o.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",s,o.encode(r))}};Nu.BrowserCrypto=dp});var yb=L(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.NodeCrypto=void 0;var so=require("crypto"),pp=class{static{i(this,"NodeCrypto")}async sha256DigestBase64(e){return so.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return so.randomBytes(e).toString("base64")}async verify(e,r,n){let o=so.createVerify("RSA-SHA256");return o.update(r),o.end(),o.verify(e,n,"base64")}async sign(e,r){let n=so.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 so.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:oz(e);return iz(so.createHmac("sha256",n).update(r).digest())}};ku.NodeCrypto=pp;function iz(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}i(iz,"toArrayBuffer");function oz(t){return Buffer.from(t)}i(oz,"toBuffer")});var Ta=L(gn=>{"use strict";var az=gn&&gn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sz=gn&&gn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&az(e,t,r)};Object.defineProperty(gn,"__esModule",{value:!0});gn.createCrypto=lz;gn.hasBrowserCrypto=vb;var uz=gb(),cz=yb();sz(lp(),gn);function lz(){return vb()?new uz.BrowserCrypto:new cz.NodeCrypto}i(lz,"createCrypto");function vb(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}i(vb,"hasBrowserCrypto")});var uo=L((fp,Pb)=>{var zu=require("buffer"),qr=zu.Buffer;function _b(t,e){for(var r in t)e[r]=t[r]}i(_b,"copyProps");qr.from&&qr.alloc&&qr.allocUnsafe&&qr.allocUnsafeSlow?Pb.exports=zu:(_b(zu,fp),fp.Buffer=vi);function vi(t,e,r){return qr(t,e,r)}i(vi,"SafeBuffer");vi.prototype=Object.create(qr.prototype);_b(qr,vi);vi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return qr(t,e,r)};vi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=qr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};vi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return qr(t)};vi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return zu.SlowBuffer(t)}});var bb=L((M7,wb)=>{"use strict";function mp(t){var e=(t/8|0)+(t%8===0?0:1);return e}i(mp,"getParamSize");var dz={ES256:mp(256),ES384:mp(384),ES512:mp(521)};function pz(t){var e=dz[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}i(pz,"getParamBytesForAlg");wb.exports=pz});var hp=L((L7,Ab)=>{"use strict";var Uu=uo().Buffer,Sb=bb(),Mu=128,xb=0,fz=32,mz=16,hz=2,Eb=mz|fz|xb<<6,Fu=hz|xb<<6;function gz(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}i(gz,"base64Url");function Ib(t){if(Uu.isBuffer(t))return t;if(typeof t=="string")return Uu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}i(Ib,"signatureAsBuffer");function yz(t,e){t=Ib(t);var r=Sb(e),n=r+1,o=t.length,s=0;if(t[s++]!==Eb)throw new Error('Could not find expected "seq"');var p=t[s++];if(p===(Mu|1)&&(p=t[s++]),o-s<p)throw new Error('"seq" specified length of "'+p+'", only "'+(o-s)+'" remaining');if(t[s++]!==Fu)throw new Error('Could not find expected "int" for "r"');var m=t[s++];if(o-s-2<m)throw new Error('"r" specified length of "'+m+'", only "'+(o-s-2)+'" available');if(n<m)throw new Error('"r" specified length of "'+m+'", max of "'+n+'" is acceptable');var h=s;if(s+=m,t[s++]!==Fu)throw new Error('Could not find expected "int" for "s"');var v=t[s++];if(o-s!==v)throw new Error('"s" specified length of "'+v+'", expected "'+(o-s)+'"');if(n<v)throw new Error('"s" specified length of "'+v+'", max of "'+n+'" is acceptable');var P=s;if(s+=v,s!==o)throw new Error('Expected to consume entire buffer, but "'+(o-s)+'" bytes remain');var x=r-m,T=r-v,w=Uu.allocUnsafe(x+m+T+v);for(s=0;s<x;++s)w[s]=0;t.copy(w,s,h+Math.max(-x,0),h+m),s=r;for(var S=s;s<S+T;++s)w[s]=0;return t.copy(w,s,P+Math.max(-T,0),P+v),w=w.toString("base64"),w=gz(w),w}i(yz,"derToJose");function Tb(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var o=t[e+n]>=Mu;return o&&--n,n}i(Tb,"countPadding");function vz(t,e){t=Ib(t);var r=Sb(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=Tb(t,0,r),s=Tb(t,r,t.length),p=r-o,m=r-s,h=2+p+1+1+m,v=h<Mu,P=Uu.allocUnsafe((v?2:3)+h),x=0;return P[x++]=Eb,v?P[x++]=h:(P[x++]=Mu|1,P[x++]=h&255),P[x++]=Fu,P[x++]=p,o<0?(P[x++]=0,x+=t.copy(P,x,0,r)):x+=t.copy(P,x,o,r),P[x++]=Fu,P[x++]=m,s<0?(P[x++]=0,t.copy(P,x,r)):t.copy(P,x,r+s),P}i(vz,"joseToDer");Ab.exports={derToJose:yz,joseToDer:vz}});var Ir=L(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.LRUCache=void 0;yn.snakeToCamel=Db;yn.originalOrCamelOptions=bz;yn.removeUndefinedValuesInObject=Tz;yn.isValidFile=Sz;yn.getWellKnownCertificateConfigFileLocation=xz;var _z=require("fs"),Pz=require("os"),gp=require("path"),wz="certificate_config.json",Rb="gcloud";function Db(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}i(Db,"snakeToCamel");function bz(t){function e(r){let n=t||{};return n[r]??n[Db(r)]}return i(e,"get"),{get:e}}i(bz,"originalOrCamelOptions");var yp=class{static{i(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()}};yn.LRUCache=yp;function Tz(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}i(Tz,"removeUndefinedValuesInObject");async function Sz(t){try{return(await _z.promises.lstat(t)).isFile()}catch{return!1}}i(Sz,"isValidFile");function xz(){let t=process.env.CLOUDSDK_CONFIG||(Ez()?gp.join(process.env.APPDATA||"",Rb):gp.join(process.env.HOME||"",".config",Rb));return gp.join(t,wz)}i(xz,"getWellKnownCertificateConfigFileLocation");function Ez(){return Pz.platform().startsWith("win")}i(Ez,"_isWindows")});var $b=L((V7,Iz)=>{Iz.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 vp=L(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.USER_AGENT=Wn.PRODUCT_NAME=Wn.pkg=void 0;var Ob=$b();Wn.pkg=Ob;var Cb="google-api-nodejs-client";Wn.PRODUCT_NAME=Cb;var Az=`${Cb}/${Ob.version}`;Wn.USER_AGENT=Az});var tr=L(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.AuthClient=Ar.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=Ar.DEFAULT_UNIVERSE=void 0;var Rz=require("events"),_p=mt(),Dz=Ir(),$z=ip(),Pp=vp();Ar.DEFAULT_UNIVERSE="googleapis.com";Ar.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var wp=class t extends Rz.EventEmitter{static{i(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=Ar.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=Ar.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,Dz.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")??Ar.DEFAULT_UNIVERSE,this.transporter=e.transporter??new _p.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],o,s=new Headers;return typeof r=="string"?o=new URL(r):r instanceof URL?o=r:r&&r.url&&(o=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&_p.Gaxios.mergeHeaders(s,r.headers),n&&_p.Gaxios.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:o}):this.request({...n,headers:s,url:o})}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"),o=r.get("authorization");return n&&e.set("x-goog-user-project",n),o&&e.set("authorization",o),e}static log=(0,$z.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:i(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(`${Pp.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${Pp.USER_AGENT}`):e.headers.set("User-Agent",Pp.USER_AGENT);try{let n=e,o=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let p={url:e.url,headers:e.headers};o?t.log.info("%s [%s] request %j",o,s,p):t.log.info("[%s] request %j",s,p)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:i(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],o=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,o,e.data):t.log.info("[%s] response %j",o,e.data)}catch{}return e},"resolved"),rejected:i(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],o=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,o,e.response?.data):t.log.error("[%s] error %j",o,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"]}}}};Ar.AuthClient=wp});var Tp=L(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.LoginTicket=void 0;var bp=class{static{i(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()}}};Lu.LoginTicket=bp});var _i=L(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.OAuth2Client=Br.ClientAuthentication=Br.CertificateFormat=Br.CodeChallengeMethod=void 0;var Nb=mt(),Oz=require("querystring"),Cz=require("stream"),Nz=hp(),kb=Ir(),Sp=Ta(),co=tr(),kz=Tp(),zb;(function(t){t.Plain="plain",t.S256="S256"})(zb||(Br.CodeChallengeMethod=zb={}));var vn;(function(t){t.PEM="PEM",t.JWK="JWK"})(vn||(Br.CertificateFormat=vn={}));var Sa;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(Sa||(Br.ClientAuthentication=Sa={}));var xp=class t extends co.AuthClient{static{i(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=vn.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||Sa.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()+"?"+Oz.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,Sp.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(o=>r(null,o.tokens,o.res),o=>r(o,null,o.response));else return this.getTokenAsync(n)}async getTokenAsync(e){let r=this.endpoints.oauth2TokenUrl.toString(),n=new Headers,o={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===Sa.ClientSecretBasic){let h=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${h.toString("base64")}`)}this.clientAuthentication===Sa.ClientSecretPost&&(o.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,kb.removeUndefinedValuesInObject)(o)),headers:n};co.AuthClient.setMethodName(s,"getTokenAsync");let p=await this.transporter.request(s),m=p.data;return p.data&&p.data.expires_in&&(m.expiry_date=new Date().getTime()+p.data.expires_in*1e3,delete m.expires_in),this.emit("tokens",m),{tokens:m,res:p}}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"},o;try{let p={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,kb.removeUndefinedValuesInObject)(n))};co.AuthClient.setMethodName(p,"refreshTokenNoCache"),o=await this.transporter.request(p)}catch(p){throw p instanceof Nb.GaxiosError&&p.message==="invalid_grant"&&p.response?.data&&/ReAuth/i.test(p.response.data.error_description)&&(p.message=JSON.stringify(p.response.data)),p}let s=o.data;return o.data&&o.data.expires_in&&(s.expiry_date=new Date().getTime()+o.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:o}}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 m=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(m)}}if(this.refreshHandler){let m=await this.processAndValidateRefreshHandler();if(m?.access_token){this.setCredentials(m);let h=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(h)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,o=null;try{n=await this.refreshToken(r.refresh_token),o=n.tokens}catch(m){let h=m;throw h.response&&(h.response.status===403||h.response.status===404)&&(h.message=`Could not refresh access token: ${h.message}`),h}let s=this.credentials;s.token_type=s.token_type||"Bearer",o.refresh_token=s.refresh_token,this.credentials=o;let p=new Headers({authorization:s.token_type+" "+o.access_token});return{headers:this.addSharedMetadataHeaders(p),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(co.AuthClient.setMethodName(n,"revokeToken"),r)this.transporter.request(n).then(o=>r(null,o),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=Nb.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 o=n.response;if(o){let s=o.status,p=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),m=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,h=o.config.data instanceof Cz.Readable,v=s===401||s===403;if(!r&&v&&!h&&p)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&v&&!h&&m){let P=await this.processAndValidateRefreshHandler();return P?.access_token&&this.setCredentials(P),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,Sp.hasBrowserCrypto)()?vn.JWK:vn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,o;switch(r){case vn.PEM:o=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case vn.JWK:o=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let v={...t.RETRY_CONFIG,url:o};co.AuthClient.setMethodName(v,"getFederatedSignonCertsAsync"),n=await this.transporter.request(v)}catch(v){throw v instanceof Error&&(v.message=`Failed to retrieve verification certificates: ${v.message}`),v}let s=n?.headers.get("cache-control"),p=-1;if(s){let v=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;v&&(p=Number(v)*1e3)}let m={};switch(r){case vn.PEM:m=n.data;break;case vn.JWK:for(let v of n.data.keys)m[v.kid]=v;break;default:throw new Error(`Unsupported certificate format ${r}`)}let h=new Date;return this.certificateExpiry=p===-1?null:new Date(h.getTime()+p),this.certificateCache=m,this.certificateCacheFormat=r,{certs:m,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};co.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,o,s){let p=(0,Sp.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let m=e.split(".");if(m.length!==3)throw new Error("Wrong number of segments in token: "+e);let h=m[0]+"."+m[1],v=m[2],P,x;try{P=JSON.parse(p.decodeBase64StringUtf8(m[0]))}catch(c){throw c instanceof Error&&(c.message=`Can't parse token envelope: ${m[0]}': ${c.message}`),c}if(!P)throw new Error("Can't parse token envelope: "+m[0]);try{x=JSON.parse(p.decodeBase64StringUtf8(m[1]))}catch(c){throw c instanceof Error&&(c.message=`Can't parse token payload '${m[0]}`),c}if(!x)throw new Error("Can't parse token payload: "+m[1]);if(!Object.prototype.hasOwnProperty.call(r,P.kid))throw new Error("No pem found for envelope: "+JSON.stringify(P));let T=r[P.kid];if(P.alg==="ES256"&&(v=Nz.joseToDer(v,"ES256").toString("base64")),!await p.verify(T,h,v))throw new Error("Invalid token signature: "+e);if(!x.iat)throw new Error("No issue time in token: "+JSON.stringify(x));if(!x.exp)throw new Error("No expiration time in token: "+JSON.stringify(x));let S=Number(x.iat);if(isNaN(S))throw new Error("iat field using invalid format");let D=Number(x.exp);if(isNaN(D))throw new Error("exp field using invalid format");let E=new Date().getTime()/1e3;if(D>=E+s)throw new Error("Expiration time too far in future: "+JSON.stringify(x));let u=S-t.CLOCK_SKEW_SECS_,f=D+t.CLOCK_SKEW_SECS_;if(E<u)throw new Error("Token used too early, "+E+" < "+u+": "+JSON.stringify(x));if(E>f)throw new Error("Token used too late, "+E+" > "+f+": "+JSON.stringify(x));if(o&&o.indexOf(x.iss)<0)throw new Error("Invalid issuer, expected one of ["+o+"], but got "+x.iss);if(typeof n<"u"&&n!==null){let c=x.aud,y=!1;if(n.constructor===Array?y=n.indexOf(c)>-1:y=c===n,!y)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new kz.LoginTicket(P,x)}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}};Br.OAuth2Client=xp});var Ip=L(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.Compute=void 0;var zz=mt(),Ub=ba(),Uz=_i(),Ep=class extends Uz.OAuth2Client{static{i(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 o={property:e};this.scopes.length>0&&(o.params={scopes:this.scopes.join(",")}),r=await Ub.instance(o)}catch(o){throw o instanceof zz.GaxiosError&&(o.message=`Could not refresh access token: ${o.message}`,this.wrapError(o)),o}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 o={property:r};n=await Ub.instance(o)}catch(o){throw o instanceof Error&&(o.message=`Could not fetch ID token: ${o.message}`),o}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))}};ju.Compute=Ep});var Rp=L(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.IdTokenClient=void 0;var Mz=_i(),Ap=class extends Mz.OAuth2Client{static{i(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}};qu.IdTokenClient=Ap});var Dp=L(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.GCPEnv=void 0;lo.clear=Fz;lo.getEnv=Lz;var Mb=ba(),Vr;(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"})(Vr||(lo.GCPEnv=Vr={}));var xa;function Fz(){xa=void 0}i(Fz,"clear");async function Lz(){return xa||(xa=jz(),xa)}i(Lz,"getEnv");async function jz(){let t=Vr.NONE;return qz()?t=Vr.APP_ENGINE:Bz()?t=Vr.CLOUD_FUNCTIONS:await Wz()?await Hz()?t=Vr.KUBERNETES_ENGINE:Vz()?t=Vr.CLOUD_RUN:Gz()?t=Vr.CLOUD_RUN_JOBS:t=Vr.COMPUTE_ENGINE:t=Vr.NONE,t}i(jz,"getEnvMemoized");function qz(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}i(qz,"isAppEngine");function Bz(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}i(Bz,"isCloudFunction");function Vz(){return!!process.env.K_CONFIGURATION}i(Vz,"isCloudRun");function Gz(){return!!process.env.CLOUD_RUN_JOB}i(Gz,"isCloudRunJob");async function Hz(){try{return await Mb.instance("attributes/cluster-name"),!0}catch{return!1}}i(Hz,"isKubernetesEngine");async function Wz(){return Mb.isAvailable()}i(Wz,"isComputeEngine")});var $p=L((iQ,Fb)=>{var Bu=uo().Buffer,Zz=require("stream"),Kz=require("util");function Vu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Bu.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Bu.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+")")}i(Vu,"DataStream");Kz.inherits(Vu,Zz);Vu.prototype.write=i(function(e){this.buffer=Bu.concat([this.buffer,Bu.from(e)]),this.emit("data",e)},"write");Vu.prototype.end=i(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");Fb.exports=Vu});var jb=L((aQ,Lb)=>{"use strict";var Ea=require("buffer").Buffer,Op=require("buffer").SlowBuffer;Lb.exports=Gu;function Gu(t,e){if(!Ea.isBuffer(t)||!Ea.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}i(Gu,"bufferEq");Gu.install=function(){Ea.prototype.equal=Op.prototype.equal=i(function(e){return Gu(this,e)},"equal")};var Jz=Ea.prototype.equal,Yz=Op.prototype.equal;Gu.restore=function(){Ea.prototype.equal=Jz,Op.prototype.equal=Yz}});var zp=L((uQ,Jb)=>{var fo=uo().Buffer,hr=require("crypto"),Bb=hp(),qb=require("util"),Xz=`"%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".`,Ss="secret must be a string or buffer",ci="key must be a string or a buffer",AN="key must be a string, a buffer or an object",Rp=typeof pr.createPublicKey=="function";Rp&&(ci+=" or a KeyObject",Ss+="or a KeyObject");function Ix(t){if(!li.isBuffer(t)&&typeof t!="string"&&(!Rp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Ar(ci)}o(Ix,"checkIsPublicKey");function Rx(t){if(!li.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Ar(AN)}o(Rx,"checkIsPrivateKey");function IN(t){if(!li.isBuffer(t)){if(typeof t=="string")return t;if(!Rp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Ar(Ss)}}o(IN,"checkIsSecretKey");function $p(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o($p,"fromBase64");function $x(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($x,"toBase64");function Ar(t){var e=[].slice.call(arguments,1),r=bx.format.bind(bx,t).apply(null,e);return new TypeError(r)}o(Ar,"typeError");function RN(t){return li.isBuffer(t)||typeof t=="string"}o(RN,"bufferOrString");function Ts(t){return RN(t)||(t=JSON.stringify(t)),t}o(Ts,"normalizeInput");function Ox(t){return o(function(r,n){IN(n),r=Ts(r);var i=pr.createHmac("sha"+t,n),a=(i.update(r),i.digest("base64"));return $p(a)},"sign")}o(Ox,"createHmacSigner");var Ip,$N="timingSafeEqual"in pr?o(function(e,r){return e.byteLength!==r.byteLength?!1:pr.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return Ip||(Ip=Ex()),Ip(e,r)},"timingSafeEqual");function ON(t){return o(function(r,n,i){var a=Ox(t)(r,i);return $N(li.from(n),li.from(a))},"verify")}o(ON,"createHmacVerifier");function Dx(t){return o(function(r,n){Rx(n),r=Ts(r);var i=pr.createSign("RSA-SHA"+t),a=(i.update(r),i.sign(n,"base64"));return $p(a)},"sign")}o(Dx,"createKeySigner");function Cx(t){return o(function(r,n,i){Ix(i),r=Ts(r),n=$x(n);var a=pr.createVerify("RSA-SHA"+t);return a.update(r),a.verify(i,n,"base64")},"verify")}o(Cx,"createKeyVerifier");function DN(t){return o(function(r,n){Rx(n),r=Ts(r);var i=pr.createSign("RSA-SHA"+t),a=(i.update(r),i.sign({key:n,padding:pr.constants.RSA_PKCS1_PSS_PADDING,saltLength:pr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return $p(a)},"sign")}o(DN,"createPSSKeySigner");function CN(t){return o(function(r,n,i){Ix(i),r=Ts(r),n=$x(n);var a=pr.createVerify("RSA-SHA"+t);return a.update(r),a.verify({key:i,padding:pr.constants.RSA_PKCS1_PSS_PADDING,saltLength:pr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(CN,"createPSSKeyVerifier");function NN(t){var e=Dx(t);return o(function(){var n=e.apply(null,arguments);return n=Ax.derToJose(n,"ES"+t),n},"sign")}o(NN,"createECDSASigner");function zN(t){var e=Cx(t);return o(function(n,i,a){i=Ax.joseToDer(i,"ES"+t).toString("base64");var f=e(n,i,a);return f},"verify")}o(zN,"createECDSAVerifer");function UN(){return o(function(){return""},"sign")}o(UN,"createNoneSigner");function kN(){return o(function(e,r){return r===""},"verify")}o(kN,"createNoneVerifier");Nx.exports=o(function(e){var r={hs:Ox,rs:Dx,ps:DN,es:NN,none:UN},n={hs:ON,rs:Cx,ps:CN,es:zN,none:kN},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Ar(bN,e);var a=(i[1]||i[3]).toLowerCase(),f=i[2];return{sign:r[a](f),verify:n[a](f)}},"jwa")});var Dp=M((NY,zx)=>{var jN=require("buffer").Buffer;zx.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||jN.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var Lx=M((UY,Fx)=>{var MN=si().Buffer,Ux=bp(),FN=Op(),LN=require("stream"),kx=Dp(),Cp=require("util");function jx(t,e){return MN.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(jx,"base64url");function qN(t,e,r){r=r||"utf8";var n=jx(kx(t),"binary"),i=jx(kx(e),r);return Cp.format("%s.%s",n,i)}o(qN,"jwsSecuredInput");function Mx(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,a=FN(e.alg),f=qN(e,r,i),m=a.sign(f,n);return Cp.format("%s.%s",f,m)}o(Mx,"jwsSign");function qu(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 Ux(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Ux(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(qu,"SignStream");Cp.inherits(qu,LN);qu.prototype.sign=o(function(){try{var e=Mx({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");qu.sign=Mx;Fx.exports=qu});var Yx=M((jY,Jx)=>{var Bx=si().Buffer,qx=bp(),BN=Op(),VN=require("stream"),Vx=Dp(),GN=require("util"),HN=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function WN(t){return Object.prototype.toString.call(t)==="[object Object]"}o(WN,"isObject");function ZN(t){if(WN(t))return t;try{return JSON.parse(t)}catch{return}}o(ZN,"safeJsonParse");function Gx(t){var e=t.split(".",1)[0];return ZN(Bx.from(e,"base64").toString("binary"))}o(Gx,"headerFromJWS");function KN(t){return t.split(".",2).join(".")}o(KN,"securedInputFromJWS");function Hx(t){return t.split(".")[2]}o(Hx,"signatureFromJWS");function JN(t,e){e=e||"utf8";var r=t.split(".")[1];return Bx.from(r,"base64").toString(e)}o(JN,"payloadFromJWS");function Wx(t){return HN.test(t)&&!!Gx(t)}o(Wx,"isValidJws");function Zx(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=Vx(t);var i=Hx(t),a=KN(t),f=BN(e);return f.verify(a,i,r)}o(Zx,"jwsVerify");function Kx(t,e){if(e=e||{},t=Vx(t),!Wx(t))return null;var r=Gx(t);if(!r)return null;var n=JN(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:Hx(t)}}o(Kx,"jwsDecode");function di(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 qx(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new qx(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(di,"VerifyStream");GN.inherits(di,VN);di.prototype.verify=o(function(){try{var e=Zx(this.signature.buffer,this.algorithm,this.key.buffer),r=Kx(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");di.decode=Kx;di.isValid=Wx;di.verify=Zx;Jx.exports=di});var Np=M(Ln=>{var Xx=Lx(),Bu=Yx(),YN=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Ln.ALGORITHMS=YN;Ln.sign=Xx.sign;Ln.verify=Bu.verify;Ln.decode=Bu.decode;Ln.isValid=Bu.isValid;Ln.createSign=o(function(e){return new Xx(e)},"createSign");Ln.createVerify=o(function(e){return new Bu(e)},"createVerify")});var fS=M(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.GoogleToken=void 0;var Qx=Vu(require("fs")),XN=pt(),QN=Vu(Np()),ez=Vu(require("path")),tz=require("util");function Vu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Vu=o(function(a,f){if(!f&&a&&a.__esModule)return a;var m,h,_={__proto__:null,default:a};if(a===null||hn(a)!="object"&&typeof a!="function")return _;if(m=f?n:r){if(m.has(a))return m.get(a);m.set(a,_)}for(var P in a)P!=="default"&&{}.hasOwnProperty.call(a,P)&&((h=(m=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,P))&&(h.get||h.set)?m(_,P,h):_[P]=a[P]);return _},"_interopRequireWildcard"))(t,e)}o(Vu,"_interopRequireWildcard");function hn(t){"@babel/helpers - typeof";return hn=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},hn(t)}o(hn,"_typeof");function rz(t,e){uS(t,e),e.add(t)}o(rz,"_classPrivateMethodInitSpec");function nz(t,e,r){uS(t,e),e.set(t,r)}o(nz,"_classPrivateFieldInitSpec");function uS(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(uS,"_checkPrivateRedeclaration");function eS(t,e,r){return t.set(Ir(t,e),r),r}o(eS,"_classPrivateFieldSet");function tS(t,e){return t.get(Ir(t,e))}o(tS,"_classPrivateFieldGet");function Ir(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(Ir,"_assertClassBrand");function rS(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,dS(n.key),n)}}o(rS,"_defineProperties");function cS(t,e,r){return e&&rS(t.prototype,e),r&&rS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(cS,"_createClass");function lS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(lS,"_classCallCheck");function oz(t,e,r){return e=Is(e),iz(t,Fp()?Reflect.construct(e,r||[],Is(t).constructor):e.apply(t,r))}o(oz,"_callSuper");function iz(t,e){if(e&&(hn(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sz(t)}o(iz,"_possibleConstructorReturn");function sz(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(sz,"_assertThisInitialized");function az(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&&As(t,e)}o(az,"_inherits");function zp(t){var e=typeof Map=="function"?new Map:void 0;return zp=o(function(n){if(n===null||!cz(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 uz(n,arguments,Is(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),As(i,n)},"_wrapNativeSuper"),zp(t)}o(zp,"_wrapNativeSuper");function uz(t,e,r){if(Fp())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&As(i,r.prototype),i}o(uz,"_construct");function Fp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Fp=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(Fp,"_isNativeReflectConstruct");function cz(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(cz,"_isNativeFunction");function As(t,e){return As=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},As(t,e)}o(As,"_setPrototypeOf");function Is(t){return Is=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Is(t)}o(Is,"_getPrototypeOf");function Qt(t,e,r){return(e=dS(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(Qt,"_defineProperty");function dS(t){var e=lz(t,"string");return hn(e)=="symbol"?e:e+""}o(dS,"_toPropertyKey");function lz(t,e){if(hn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(hn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(lz,"_toPrimitive");function tr(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(w,T,$,b){var u=T&&T.prototype instanceof m?T:m,p=Object.create(u.prototype);return er(p,"_invoke",function(c,y,l){var x,g,re,ee=0,Te=l||[],ne=!1,K={p:0,n:0,v:t,a:Z,f:Z.bind(t,4),d:o(function(X,ie){return x=X,g=0,re=t,K.n=ie,f},"d")};function Z(Q,X){for(g=Q,re=X,e=0;!ne&&ee&&!ie&&e<Te.length;e++){var ie,ae=Te[e],Ie=K.p,De=ae[2];Q>3?(ie=De===X)&&(re=ae[(g=ae[4])?5:(g=3,3)],ae[4]=ae[5]=t):ae[0]<=Ie&&((ie=Q<2&&Ie<ae[1])?(g=0,K.v=X,K.n=ae[1]):Ie<De&&(ie=Q<3||ae[0]>X||X>De)&&(ae[4]=Q,ae[5]=X,K.n=De,g=0))}if(ie||Q>1)return f;throw ne=!0,X}return o(Z,"d"),function(Q,X,ie){if(ee>1)throw TypeError("Generator is already running");for(ne&&X===1&&Z(X,ie),g=X,re=ie;(e=g<2?t:re)||!ne;){x||(g?g<3?(g>1&&(K.n=-1),Z(g,re)):K.n=re:K.v=re);try{if(ee=2,x){if(g||(Q="next"),e=x[Q]){if(!(e=e.call(x,re)))throw TypeError("iterator result is not an object");if(!e.done)return e;re=e.value,g<2&&(g=0)}else g===1&&(e=x.return)&&e.call(x),g<2&&(re=TypeError("The iterator does not provide a '"+Q+"' method"),g=1);x=t}else if((e=(ne=K.n<0)?re:c.call(y,K))!==f)break}catch(ae){x=t,g=1,re=ae}finally{ee=1}}return{value:e,done:ne}}}(w,$,b),!0),p}o(a,"i");var f={};function m(){}o(m,"Generator");function h(){}o(h,"GeneratorFunction");function _(){}o(_,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var P=[][n]?e(e([][n]())):(er(e={},n,function(){return this}),e),E=_.prototype=m.prototype=Object.create(P);function S(w){return Object.setPrototypeOf?Object.setPrototypeOf(w,_):(w.__proto__=_,er(w,i,"GeneratorFunction")),w.prototype=Object.create(E),w}return o(S,"f"),h.prototype=_,er(E,"constructor",_),er(_,"constructor",h),h.displayName="GeneratorFunction",er(_,i,"GeneratorFunction"),er(E),er(E,i,"Generator"),er(E,n,function(){return this}),er(E,"toString",function(){return"[object Generator]"}),(tr=o(function(){return{w:a,m:S}},"_regenerator"))()}o(tr,"_regenerator");function er(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}er=o(function(f,m,h,_){if(m)i?i(f,m,{value:h,enumerable:!_,configurable:!_,writable:!_}):f[m]=h;else{var P=o(function(S,w){er(f,S,function(T){return this._invoke(S,w,T)})},"o");P("next",0),P("throw",1),P("return",2)}},"_regeneratorDefine"),er(t,e,r,n)}o(er,"_regeneratorDefine2");function nS(t,e,r,n,i,a,f){try{var m=t[a](f),h=m.value}catch(_){return void r(_)}m.done?e(h):Promise.resolve(h).then(n,i)}o(nS,"asyncGeneratorStep");function pi(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var a=t.apply(e,r);function f(h){nS(a,n,i,f,m,"next",h)}o(f,"_next");function m(h){nS(a,n,i,f,m,"throw",h)}o(m,"_throw"),f(void 0)})}}o(pi,"_asyncToGenerator");var oS=Qx.readFile?(0,tz.promisify)(Qx.readFile):pi(tr().m(o(function t(){return tr().w(function(e){for(;;)switch(e.n){case 0:throw new bs("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),iS="https://oauth2.googleapis.com/token",dz="https://oauth2.googleapis.com/revoke?token=",bs=function(t){function e(r,n){var i;return lS(this,e),i=oz(this,e,[r]),Qt(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),az(e,t),cS(e)}(zp(Error)),Es=new WeakMap,Lr=new WeakSet,qY=Gu.GoogleToken=function(){function t(e){lS(this,t),rz(this,Lr),Qt(this,"expiresAt",void 0),Qt(this,"key",void 0),Qt(this,"keyFile",void 0),Qt(this,"iss",void 0),Qt(this,"sub",void 0),Qt(this,"scope",void 0),Qt(this,"rawToken",void 0),Qt(this,"tokenExpires",void 0),Qt(this,"email",void 0),Qt(this,"additionalClaims",void 0),Qt(this,"eagerRefreshThresholdMillis",void 0),Qt(this,"transporter",{request:o(function(n){return(0,XN.request)(n)},"request")}),nz(this,Es,void 0),Ir(Lr,this,pS).call(this,e)}return o(t,"GoogleToken"),cS(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(hn(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;Ir(Lr,this,sS).call(this,n).then(function(a){return i(null,a)},r);return}return Ir(Lr,this,sS).call(this,n)},"getToken")},{key:"getCredentials",value:function(){var e=pi(tr().m(o(function n(i){var a,f,m,h,_,P,E;return tr().w(function(S){for(;;)switch(S.n){case 0:a=ez.extname(i),E=a,S.n=E===".json"?1:E===".der"||E===".crt"||E===".pem"?4:E===".p12"||E===".pfx"?6:7;break;case 1:return S.n=2,oS(i,"utf8");case 2:if(f=S.v,m=JSON.parse(f),h=m.private_key,_=m.client_email,!(!h||!_)){S.n=3;break}throw new bs("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return S.a(2,{privateKey:h,clientEmail:_});case 4:return S.n=5,oS(i,"utf8");case 5:return P=S.v,S.a(2,{privateKey:P});case 6:throw new bs("*.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 bs("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return S.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){Ir(Lr,this,aS).call(this).then(function(){return r()},r);return}return Ir(Lr,this,aS).call(this)},"revokeToken")}])}();function sS(t){return Up.apply(this,arguments)}o(sS,"_getTokenAsync");function Up(){return Up=pi(tr().m(o(function t(e){return tr().w(function(r){for(;;)switch(r.n){case 0:if(!(tS(Es,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,tS(Es,this));case 1:return r.p=1,r.n=2,eS(Es,this,Ir(Lr,this,pz).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,eS(Es,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),Up.apply(this,arguments)}o(Up,"_getTokenAsync2");function pz(t){return kp.apply(this,arguments)}o(pz,"_getTokenAsyncInner");function kp(){return kp=pi(tr().m(o(function t(e){var r;return tr().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||Ir(Lr,this,fz).call(this);case 4:return n.a(2,Ir(Lr,this,mz).call(this))}},t,this)},"_callee4"))),kp.apply(this,arguments)}o(kp,"_getTokenAsyncInner2");function fz(){if(!this.iss)throw new bs("email is required.","MISSING_CREDENTIALS")}o(fz,"_ensureEmail");function aS(){return jp.apply(this,arguments)}o(aS,"_revokeTokenAsync");function jp(){return jp=pi(tr().m(o(function t(){var e;return tr().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=dz+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Ir(Lr,this,pS).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"))),jp.apply(this,arguments)}o(jp,"_revokeTokenAsync2");function pS(){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,hn(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(pS,"_configure");function mz(){return Mp.apply(this,arguments)}o(mz,"_requestToken");function Mp(){return Mp=pi(tr().m(o(function t(){var e,r,n,i,a,f,m,h,_,P;return tr().w(function(E){for(;;)switch(E.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:iS,exp:e+3600,iat:e,sub:this.sub},r),i=QN.sign({header:{alg:"RS256"},payload:n,secret:this.key}),E.p=1,E.n=2,this.transporter.request({method:"POST",url:iS,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return a=E.v,this.rawToken=a.data,this.expiresAt=a.data.expires_in===null||a.data.expires_in===void 0?void 0:(e+a.data.expires_in)*1e3,E.a(2,this.rawToken);case 3:throw E.p=3,P=E.v,this.rawToken=void 0,this.tokenExpires=void 0,h=P.response&&(f=P.response)!==null&&f!==void 0&&f.data?(m=P.response)===null||m===void 0?void 0:m.data:{},h.error&&(_=h.error_description?": ".concat(h.error_description):"",P.message="".concat(h.error).concat(_)),P;case 4:return E.a(2)}},t,this,[[1,3]])},"_callee6"))),Mp.apply(this,arguments)}o(Mp,"_requestToken2")});var qp=M(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.JWTAccess=void 0;var hz=Np(),gz=Er(),mS={alg:"RS256",typ:"JWT"},Lp=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new gz.LRUCache({capacity:500,maxAge:60*60*1e3});constructor(e,r,n,i){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=i??5*60*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),a=this.cache.get(i),f=Date.now();if(a&&a.expiration-f>this.eagerRefreshThresholdMillis)return new Headers(a.headers);let m=Math.floor(Date.now()/1e3),h=t.getExpirationTime(m),_;if(Array.isArray(n)&&(n=n.join(" ")),n?_={iss:this.email,sub:this.email,scope:n,exp:h,iat:m}:_={iss:this.email,sub:this.email,aud:e,exp:h,iat:m},r){for(let T in _)if(r[T])throw new Error(`The '${T}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let P=this.keyId?{...mS,kid:this.keyId}:mS,E=Object.assign(_,r),S=hz.sign({header:P,payload:E,secret:this.key}),w=new Headers({authorization:`Bearer ${S}`});return this.cache.set(i,{expiration:h*1e3,headers:w}),w}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",a=>i+=a).on("error",n).on("end",()=>{try{let a=JSON.parse(i);this.fromJSON(a),r()}catch(a){n(a)}})})}};Hu.JWTAccess=Lp});var Vp=M(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.JWT=void 0;var hS=fS(),yz=qp(),vz=ho(),Wu=Xt(),Bp=class t extends vz.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!==Wu.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==Wu.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${Wu.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 yz.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!==Wu.DEFAULT_UNIVERSE,a=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,i?n:void 0);return{headers:this.addSharedMetadataHeaders(a)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let r=new hS.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 hS.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",a=>i+=a).on("end",()=>{try{let a=JSON.parse(i);this.fromJSON(a),r()}catch(a){n(a)}})})}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.")}};Zu.JWT=Bp});var Hp=M(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.UserRefreshClient=fi.USER_REFRESH_ACCOUNT_TYPE=void 0;var _z=ho(),Pz=Xt();fi.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var Gp=class t extends _z.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,a){let f=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:a};super(f),this._refreshToken=f.refreshToken,this.credentials.refresh_token=f.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 Pz.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",a=>i+=a).on("end",()=>{try{let a=JSON.parse(i);return this.fromJSON(a),r()}catch(a){return n(a)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};fi.UserRefreshClient=Gp});var Zp=M(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.Impersonated=mi.IMPERSONATED_ACCOUNT_TYPE=void 0;var gS=ho(),wz=pt(),xz=Er();mi.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var Wp=class t extends gS.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 gS.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,xz.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"}),a=i.data;return this.credentials.access_token=a.accessToken,this.credentials.expiry_date=Date.parse(a.expireTime),{tokens:this.credentials,res:i}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof wz.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`,a={delegates:this.delegates,audience:e,includeEmail:r?.includeEmail??!0,useEmailAzp:r?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:i,data:a,method:"POST"})).data.token}};mi.Impersonated=Wp});var Jp=M(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.OAuthClientAuthHandler=void 0;Rs.getErrorFromOAuthErrorResponse=Ez;var hi=pt(),Sz=_s(),Tz=["PUT","POST","PATCH"],Kp=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,Sz.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new hi.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new hi.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=hi.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=hi.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=hi.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",a=this.#e.encodeBase64StringUtf8(`${n}:${i}`);hi.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${a}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!Tz.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 a=new URLSearchParams(e.data??"");a.append("client_id",this.#t.clientId),a.append("client_secret",this.#t.clientSecret||""),e.data=a}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"]}}}};Rs.OAuthClientAuthHandler=Kp;function Ez(t,e){let r=t.error,n=t.error_description,i=t.error_uri,a=`Error code ${r}`;typeof n<"u"&&(a+=`: ${n}`),typeof i<"u"&&(a+=` - ${i}`);let f=new Error(a);if(e){let m=Object.keys(e);e.stack&&m.push("stack"),m.forEach(h=>{h!=="message"&&Object.defineProperty(f,h,{value:e[h],writable:!1,enumerable:!0})})}return f}o(Ez,"getErrorFromOAuthErrorResponse")});var Ju=M(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.StsCredentials=void 0;var bz=pt(),Az=Xt(),yS=Jp(),Iz=Er(),Yp=class t extends yS.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)},a={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:r,data:new URLSearchParams((0,Iz.removeUndefinedValuesInObject)(i))};Az.AuthClient.setMethodName(a,"exchangeToken"),this.applyClientAuthenticationOptions(a);try{let f=await this.transporter.request(a),m=f.data;return m.res=f,m}catch(f){throw f instanceof bz.GaxiosError&&f.response?(0,yS.getErrorFromOAuthErrorResponse)(f.response.data,f):f}}};Ku.StsCredentials=Yp});var qn=M(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.BaseExternalAccountClient=fr.CLOUD_RESOURCE_MANAGER=fr.EXTERNAL_ACCOUNT_TYPE=fr.EXPIRATION_TIME_OFFSET=void 0;var Rz=pt(),$z=require("stream"),Xp=Xt(),Oz=Ju(),vS=Er(),Dz=fp(),Cz="urn:ietf:params:oauth:grant-type:token-exchange",Nz="urn:ietf:params:oauth:token-type:access_token",Qp="https://www.googleapis.com/auth/cloud-platform",zz=3600;fr.EXPIRATION_TIME_OFFSET=5*60*1e3;fr.EXTERNAL_ACCOUNT_TYPE="external_account";fr.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var Uz="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",kz="https://sts.{universeDomain}/v1/token",ef=class t extends Xp.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,vS.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==fr.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${fr.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let i=r.get("client_id"),a=r.get("client_secret");this.tokenUrl=r.get("token_url")??kz.replace("{universeDomain}",this.universeDomain);let f=r.get("subject_token_type"),m=r.get("workforce_pool_user_project"),h=r.get("service_account_impersonation_url"),_=r.get("service_account_impersonation"),P=(0,vS.originalOrCamelOptions)(_).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:a}),this.stsCredential=new Oz.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[Qp],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=f,this.workforcePoolUserProject=m;let E=new RegExp(Uz);if(this.workforcePoolUserProject&&!this.audience.match(E))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=h,this.serviceAccountImpersonationLifetime=P,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=zz),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}`};Xp.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=Rz.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let a=i.response;if(a){let f=a.status,m=a.config.data instanceof $z.Readable;if(!r&&(f===401||f===403)&&!m&&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:Cz,audience:this.audience,requestedTokenType:Nz,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[Qp]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,i=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),a=await this.stsCredential.exchangeToken(r,i,n);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(a.access_token):a.expires_in?this.cachedAccessToken={access_token:a.access_token,expiry_date:new Date().getTime()+a.expires_in*1e3,res:a.res}:this.cachedAccessToken={access_token:a.access_token,res:a.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"}};Xp.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||[Qp]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${Dz.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};fr.BaseExternalAccountClient=ef});var _S=M(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.FileSubjectTokenSupplier=void 0;var rf=require("util"),nf=require("fs"),jz=(0,rf.promisify)(nf.readFile??(()=>{})),Mz=(0,rf.promisify)(nf.realpath??(()=>{})),Fz=(0,rf.promisify)(nf.lstat??(()=>{})),tf=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 Mz(e),!(await Fz(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 jz(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}};Yu.FileSubjectTokenSupplier=tf});var PS=M(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.UrlSubjectTokenSupplier=void 0;var Lz=Xt(),of=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};Lz.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}};Xu.UrlSubjectTokenSupplier=of});var wS=M(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.CertificateSubjectTokenSupplier=rr.InvalidConfigurationError=rr.CertificateSourceUnavailableError=rr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var Qu=Er(),ec=require("fs"),tc=require("crypto"),qz=require("https");rr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var qr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};rr.CertificateSourceUnavailableError=qr;var mr=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};rr.InvalidConfigurationError=mr;var sf=class{static{o(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new mr("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new mr("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new mr("Cannot create mTLS Agent with missing certificate or key");return new qz.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,Qu.isValidFile)(e))return e;throw new qr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[rr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,Qu.isValidFile)(r))return r;throw new qr(`Path from environment variable "${rr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,Qu.getWellKnownCertificateConfigFileLocation)();if(await(0,Qu.isValidFile)(n))return n;throw new qr(`Could not find certificate configuration file. Searched override path, the "${rr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await ec.promises.readFile(e,"utf8")}catch{throw new qr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),i=n?.cert_configs?.workload?.cert_path,a=n?.cert_configs?.workload?.key_path;if(!i||!a)throw new mr(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:i,keyPath:a}}catch(n){throw n instanceof mr?n:new mr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await ec.promises.readFile(e),new tc.X509Certificate(n)}catch(a){let f=a instanceof Error?a.message:String(a);throw new qr(`Failed to read certificate file at ${e}: ${f}`)}try{i=await ec.promises.readFile(r),(0,tc.createPrivateKey)(i)}catch(a){let f=a instanceof Error?a.message:String(a);throw new qr(`Failed to read private key file at ${r}: ${f}`)}return{cert:n,key:i}}async#n(e){let r=new tc.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let a=((await ec.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((h,_)=>{try{return new tc.X509Certificate(h)}catch(P){let E=P instanceof Error?P.message:String(P);throw new mr(`Failed to parse certificate at index ${_} in trust chain file ${this.trustChainPath}: ${E}`)}}),f=a.findIndex(h=>r.raw.equals(h.raw)),m;if(f===-1)m=[r,...a];else if(f===0)m=a;else throw new mr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${f}).`);return JSON.stringify(m.map(h=>h.raw.toString("base64")))}catch(n){if(n instanceof mr)throw n;let i=n instanceof Error?n.message:String(n);throw new qr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};rr.CertificateSubjectTokenSupplier=sf});var cf=M(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.IdentityPoolClient=void 0;var Bz=qn(),af=Er(),Vz=_S(),Gz=PS(),xS=wS(),Hz=Ju(),SS=pt(),uf=class t extends Bz.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,af.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 a=(0,af.originalOrCamelOptions)(n),f=(0,af.originalOrCamelOptions)(a.get("format")),m=f.get("type")||"text",h=f.get("subject_token_field_name");if(m!=="json"&&m!=="text")throw new Error(`Invalid credential_source format "${m}"`);if(m==="json"&&!h)throw new Error("Missing subject_token_field_name for JSON credential_source format");let _=a.get("file"),P=a.get("url"),E=a.get("certificate"),S=a.get("headers");if(_&&P||P&&E||_&&E)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(_)this.credentialSourceType="file",this.subjectTokenSupplier=new Vz.FileSubjectTokenSupplier({filePath:_,formatType:m,subjectTokenFieldName:h});else if(P)this.credentialSourceType="url",this.subjectTokenSupplier=new Gz.UrlSubjectTokenSupplier({url:P,formatType:m,subjectTokenFieldName:h,headers:S,additionalGaxiosOptions:t.RETRY_CONFIG});else if(E){this.credentialSourceType="certificate";let w=new xS.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:E.use_default_certificate_config,certificateConfigLocation:E.certificate_config_location,trustChainPath:E.trust_chain_path});this.subjectTokenSupplier=w}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 xS.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new Hz.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new SS.Gaxios({agent:r})}),this.transporter=new SS.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};rc.IdentityPoolClient=uf});var df=M(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.AwsRequestSigner=void 0;var nc=pt(),ES=_s(),TS="AWS4-HMAC-SHA256",Wz="aws4_request",lf=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,ES.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",a=e.body||r,f=e.headers,m=await this.getCredentials(),h=new URL(n);if(typeof a!="string"&&a!==void 0)throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${a}`);let _=await Kz({crypto:this.crypto,host:h.host,canonicalUri:h.pathname,canonicalQuerystring:h.search.slice(1),method:i,region:this.region,securityCredentials:m,requestPayload:a,additionalAmzHeaders:f}),P=nc.Gaxios.mergeHeaders(_.amzDate?{"x-amz-date":_.amzDate}:{},{authorization:_.authorizationHeader,host:h.host},f||{});m.token&&nc.Gaxios.mergeHeaders(P,{"x-amz-security-token":m.token});let E={url:n,method:i,headers:P};return a!==void 0&&(E.body=a),E}};oc.AwsRequestSigner=lf;async function $s(t,e,r){return await t.signWithHmacSha256(e,r)}o($s,"sign");async function Zz(t,e,r,n,i){let a=await $s(t,`AWS4${e}`,r),f=await $s(t,a,n),m=await $s(t,f,i);return await $s(t,m,"aws4_request")}o(Zz,"getSigningKey");async function Kz(t){let e=nc.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,a=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),f=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let m=nc.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":a},e),h="",_=[...m.keys()].sort();_.forEach(p=>{h+=`${p}:${m.get(p)}
41
- `});let P=_.join(";"),E=await t.crypto.sha256DigestHex(r),S=`${t.method.toUpperCase()}
40
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Ia="secret must be a string or buffer",po="key must be a string or a buffer",Qz="key must be a string, a buffer or an object",Np=typeof hr.createPublicKey=="function";Np&&(po+=" or a KeyObject",Ia+="or a KeyObject");function Vb(t){if(!fo.isBuffer(t)&&typeof t!="string"&&(!Np||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Rr(po)}i(Vb,"checkIsPublicKey");function Gb(t){if(!fo.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Rr(Qz)}i(Gb,"checkIsPrivateKey");function eU(t){if(!fo.isBuffer(t)){if(typeof t=="string")return t;if(!Np||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Rr(Ia)}}i(eU,"checkIsSecretKey");function kp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}i(kp,"fromBase64");function Hb(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,"/")}i(Hb,"toBase64");function Rr(t){var e=[].slice.call(arguments,1),r=qb.format.bind(qb,t).apply(null,e);return new TypeError(r)}i(Rr,"typeError");function tU(t){return fo.isBuffer(t)||typeof t=="string"}i(tU,"bufferOrString");function Aa(t){return tU(t)||(t=JSON.stringify(t)),t}i(Aa,"normalizeInput");function Wb(t){return i(function(r,n){eU(n),r=Aa(r);var o=hr.createHmac("sha"+t,n),s=(o.update(r),o.digest("base64"));return kp(s)},"sign")}i(Wb,"createHmacSigner");var Cp,rU="timingSafeEqual"in hr?i(function(e,r){return e.byteLength!==r.byteLength?!1:hr.timingSafeEqual(e,r)},"timingSafeEqual"):i(function(e,r){return Cp||(Cp=jb()),Cp(e,r)},"timingSafeEqual");function nU(t){return i(function(r,n,o){var s=Wb(t)(r,o);return rU(fo.from(n),fo.from(s))},"verify")}i(nU,"createHmacVerifier");function Zb(t){return i(function(r,n){Gb(n),r=Aa(r);var o=hr.createSign("RSA-SHA"+t),s=(o.update(r),o.sign(n,"base64"));return kp(s)},"sign")}i(Zb,"createKeySigner");function Kb(t){return i(function(r,n,o){Vb(o),r=Aa(r),n=Hb(n);var s=hr.createVerify("RSA-SHA"+t);return s.update(r),s.verify(o,n,"base64")},"verify")}i(Kb,"createKeyVerifier");function iU(t){return i(function(r,n){Gb(n),r=Aa(r);var o=hr.createSign("RSA-SHA"+t),s=(o.update(r),o.sign({key:n,padding:hr.constants.RSA_PKCS1_PSS_PADDING,saltLength:hr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return kp(s)},"sign")}i(iU,"createPSSKeySigner");function oU(t){return i(function(r,n,o){Vb(o),r=Aa(r),n=Hb(n);var s=hr.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:o,padding:hr.constants.RSA_PKCS1_PSS_PADDING,saltLength:hr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}i(oU,"createPSSKeyVerifier");function aU(t){var e=Zb(t);return i(function(){var n=e.apply(null,arguments);return n=Bb.derToJose(n,"ES"+t),n},"sign")}i(aU,"createECDSASigner");function sU(t){var e=Kb(t);return i(function(n,o,s){o=Bb.joseToDer(o,"ES"+t).toString("base64");var p=e(n,o,s);return p},"verify")}i(sU,"createECDSAVerifer");function uU(){return i(function(){return""},"sign")}i(uU,"createNoneSigner");function cU(){return i(function(e,r){return r===""},"verify")}i(cU,"createNoneVerifier");Jb.exports=i(function(e){var r={hs:Wb,rs:Zb,ps:iU,es:aU,none:uU},n={hs:nU,rs:Kb,ps:oU,es:sU,none:cU},o=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!o)throw Rr(Xz,e);var s=(o[1]||o[3]).toLowerCase(),p=o[2];return{sign:r[s](p),verify:n[s](p)}},"jwa")});var Up=L((lQ,Yb)=>{var lU=require("buffer").Buffer;Yb.exports=i(function(e){return typeof e=="string"?e:typeof e=="number"||lU.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var nT=L((pQ,rT)=>{var dU=uo().Buffer,Xb=$p(),pU=zp(),fU=require("stream"),Qb=Up(),Mp=require("util");function eT(t,e){return dU.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}i(eT,"base64url");function mU(t,e,r){r=r||"utf8";var n=eT(Qb(t),"binary"),o=eT(Qb(e),r);return Mp.format("%s.%s",n,o)}i(mU,"jwsSecuredInput");function tT(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=pU(e.alg),p=mU(e,r,o),m=s.sign(p,n);return Mp.format("%s.%s",p,m)}i(tT,"jwsSign");function Hu(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 Xb(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Xb(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))}i(Hu,"SignStream");Mp.inherits(Hu,fU);Hu.prototype.sign=i(function(){try{var e=tT({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");Hu.sign=tT;rT.exports=Hu});var fT=L((mQ,pT)=>{var oT=uo().Buffer,iT=$p(),hU=zp(),gU=require("stream"),aT=Up(),yU=require("util"),vU=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function _U(t){return Object.prototype.toString.call(t)==="[object Object]"}i(_U,"isObject");function PU(t){if(_U(t))return t;try{return JSON.parse(t)}catch{return}}i(PU,"safeJsonParse");function sT(t){var e=t.split(".",1)[0];return PU(oT.from(e,"base64").toString("binary"))}i(sT,"headerFromJWS");function wU(t){return t.split(".",2).join(".")}i(wU,"securedInputFromJWS");function uT(t){return t.split(".")[2]}i(uT,"signatureFromJWS");function bU(t,e){e=e||"utf8";var r=t.split(".")[1];return oT.from(r,"base64").toString(e)}i(bU,"payloadFromJWS");function cT(t){return vU.test(t)&&!!sT(t)}i(cT,"isValidJws");function lT(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=aT(t);var o=uT(t),s=wU(t),p=hU(e);return p.verify(s,o,r)}i(lT,"jwsVerify");function dT(t,e){if(e=e||{},t=aT(t),!cT(t))return null;var r=sT(t);if(!r)return null;var n=bU(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:uT(t)}}i(dT,"jwsDecode");function mo(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 iT(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new iT(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))}i(mo,"VerifyStream");yU.inherits(mo,gU);mo.prototype.verify=i(function(){try{var e=lT(this.signature.buffer,this.algorithm,this.key.buffer),r=dT(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");mo.decode=dT;mo.isValid=cT;mo.verify=lT;pT.exports=mo});var Fp=L(Zn=>{var mT=nT(),Wu=fT(),TU=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Zn.ALGORITHMS=TU;Zn.sign=mT.sign;Zn.verify=Wu.verify;Zn.decode=Wu.decode;Zn.isValid=Wu.isValid;Zn.createSign=i(function(e){return new mT(e)},"createSign");Zn.createVerify=i(function(e){return new Wu(e)},"createVerify")});var RT=L(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.GoogleToken=void 0;var hT=Zu(require("fs")),SU=mt(),xU=Zu(Fp()),EU=Zu(require("path")),IU=require("util");function Zu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Zu=i(function(s,p){if(!p&&s&&s.__esModule)return s;var m,h,v={__proto__:null,default:s};if(s===null||_n(s)!="object"&&typeof s!="function")return v;if(m=p?n:r){if(m.has(s))return m.get(s);m.set(s,v)}for(var P in s)P!=="default"&&{}.hasOwnProperty.call(s,P)&&((h=(m=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,P))&&(h.get||h.set)?m(v,P,h):v[P]=s[P]);return v},"_interopRequireWildcard"))(t,e)}i(Zu,"_interopRequireWildcard");function _n(t){"@babel/helpers - typeof";return _n=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},_n(t)}i(_n,"_typeof");function AU(t,e){ST(t,e),e.add(t)}i(AU,"_classPrivateMethodInitSpec");function RU(t,e,r){ST(t,e),e.set(t,r)}i(RU,"_classPrivateFieldInitSpec");function ST(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(ST,"_checkPrivateRedeclaration");function gT(t,e,r){return t.set(Dr(t,e),r),r}i(gT,"_classPrivateFieldSet");function yT(t,e){return t.get(Dr(t,e))}i(yT,"_classPrivateFieldGet");function Dr(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")}i(Dr,"_assertClassBrand");function vT(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,IT(n.key),n)}}i(vT,"_defineProperties");function xT(t,e,r){return e&&vT(t.prototype,e),r&&vT(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}i(xT,"_createClass");function ET(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}i(ET,"_classCallCheck");function DU(t,e,r){return e=Oa(e),$U(t,Gp()?Reflect.construct(e,r||[],Oa(t).constructor):e.apply(t,r))}i(DU,"_callSuper");function $U(t,e){if(e&&(_n(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return OU(t)}i($U,"_possibleConstructorReturn");function OU(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}i(OU,"_assertThisInitialized");function CU(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&&$a(t,e)}i(CU,"_inherits");function Lp(t){var e=typeof Map=="function"?new Map:void 0;return Lp=i(function(n){if(n===null||!kU(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,o)}function o(){return NU(n,arguments,Oa(this).constructor)}return i(o,"Wrapper"),o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),$a(o,n)},"_wrapNativeSuper"),Lp(t)}i(Lp,"_wrapNativeSuper");function NU(t,e,r){if(Gp())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&$a(o,r.prototype),o}i(NU,"_construct");function Gp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Gp=i(function(){return!!t},"_isNativeReflectConstruct"))()}i(Gp,"_isNativeReflectConstruct");function kU(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}i(kU,"_isNativeFunction");function $a(t,e){return $a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},$a(t,e)}i($a,"_setPrototypeOf");function Oa(t){return Oa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Oa(t)}i(Oa,"_getPrototypeOf");function rr(t,e,r){return(e=IT(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}i(rr,"_defineProperty");function IT(t){var e=zU(t,"string");return _n(e)=="symbol"?e:e+""}i(IT,"_toPropertyKey");function zU(t,e){if(_n(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(_n(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}i(zU,"_toPrimitive");function ir(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function s(w,S,D,E){var u=S&&S.prototype instanceof m?S:m,f=Object.create(u.prototype);return nr(f,"_invoke",(function(c,y,l){var b,g,oe,ne=0,Re=l||[],se=!1,Y={p:0,n:0,v:t,a:K,f:K.bind(t,4),d:i(function(te,ce){return b=te,g=0,oe=t,Y.n=ce,p},"d")};function K(re,te){for(g=re,oe=te,e=0;!se&&ne&&!ce&&e<Re.length;e++){var ce,de=Re[e],Oe=Y.p,ze=de[2];re>3?(ce=ze===te)&&(oe=de[(g=de[4])?5:(g=3,3)],de[4]=de[5]=t):de[0]<=Oe&&((ce=re<2&&Oe<de[1])?(g=0,Y.v=te,Y.n=de[1]):Oe<ze&&(ce=re<3||de[0]>te||te>ze)&&(de[4]=re,de[5]=te,Y.n=ze,g=0))}if(ce||re>1)return p;throw se=!0,te}return i(K,"d"),function(re,te,ce){if(ne>1)throw TypeError("Generator is already running");for(se&&te===1&&K(te,ce),g=te,oe=ce;(e=g<2?t:oe)||!se;){b||(g?g<3?(g>1&&(Y.n=-1),K(g,oe)):Y.n=oe:Y.v=oe);try{if(ne=2,b){if(g||(re="next"),e=b[re]){if(!(e=e.call(b,oe)))throw TypeError("iterator result is not an object");if(!e.done)return e;oe=e.value,g<2&&(g=0)}else g===1&&(e=b.return)&&e.call(b),g<2&&(oe=TypeError("The iterator does not provide a '"+re+"' method"),g=1);b=t}else if((e=(se=Y.n<0)?oe:c.call(y,Y))!==p)break}catch(de){b=t,g=1,oe=de}finally{ne=1}}return{value:e,done:se}}})(w,D,E),!0),f}i(s,"i");var p={};function m(){}i(m,"Generator");function h(){}i(h,"GeneratorFunction");function v(){}i(v,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var P=[][n]?e(e([][n]())):(nr(e={},n,function(){return this}),e),x=v.prototype=m.prototype=Object.create(P);function T(w){return Object.setPrototypeOf?Object.setPrototypeOf(w,v):(w.__proto__=v,nr(w,o,"GeneratorFunction")),w.prototype=Object.create(x),w}return i(T,"f"),h.prototype=v,nr(x,"constructor",v),nr(v,"constructor",h),h.displayName="GeneratorFunction",nr(v,o,"GeneratorFunction"),nr(x),nr(x,o,"Generator"),nr(x,n,function(){return this}),nr(x,"toString",function(){return"[object Generator]"}),(ir=i(function(){return{w:s,m:T}},"_regenerator"))()}i(ir,"_regenerator");function nr(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch{o=0}nr=i(function(p,m,h,v){if(m)o?o(p,m,{value:h,enumerable:!v,configurable:!v,writable:!v}):p[m]=h;else{var P=i(function(T,w){nr(p,T,function(S){return this._invoke(T,w,S)})},"o");P("next",0),P("throw",1),P("return",2)}},"_regeneratorDefine"),nr(t,e,r,n)}i(nr,"_regeneratorDefine2");function _T(t,e,r,n,o,s,p){try{var m=t[s](p),h=m.value}catch(v){return void r(v)}m.done?e(h):Promise.resolve(h).then(n,o)}i(_T,"asyncGeneratorStep");function ho(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var s=t.apply(e,r);function p(h){_T(s,n,o,p,m,"next",h)}i(p,"_next");function m(h){_T(s,n,o,p,m,"throw",h)}i(m,"_throw"),p(void 0)})}}i(ho,"_asyncToGenerator");var PT=hT.readFile?(0,IU.promisify)(hT.readFile):ho(ir().m(i(function t(){return ir().w(function(e){for(;;)switch(e.n){case 0:throw new Da("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),wT="https://oauth2.googleapis.com/token",UU="https://oauth2.googleapis.com/revoke?token=",Da=(function(t){function e(r,n){var o;return ET(this,e),o=DU(this,e,[r]),rr(o,"code",void 0),o.code=n,o}return i(e,"ErrorWithCode"),CU(e,t),xT(e)})(Lp(Error)),Ra=new WeakMap,Gr=new WeakSet,vQ=Ku.GoogleToken=(function(){function t(e){ET(this,t),AU(this,Gr),rr(this,"expiresAt",void 0),rr(this,"key",void 0),rr(this,"keyFile",void 0),rr(this,"iss",void 0),rr(this,"sub",void 0),rr(this,"scope",void 0),rr(this,"rawToken",void 0),rr(this,"tokenExpires",void 0),rr(this,"email",void 0),rr(this,"additionalClaims",void 0),rr(this,"eagerRefreshThresholdMillis",void 0),rr(this,"transporter",{request:i(function(n){return(0,SU.request)(n)},"request")}),RU(this,Ra,void 0),Dr(Gr,this,AT).call(this,e)}return i(t,"GoogleToken"),xT(t,[{key:"accessToken",get:i(function(){return this.rawToken?this.rawToken.access_token:void 0},"get")},{key:"idToken",get:i(function(){return this.rawToken?this.rawToken.id_token:void 0},"get")},{key:"tokenType",get:i(function(){return this.rawToken?this.rawToken.token_type:void 0},"get")},{key:"refreshToken",get:i(function(){return this.rawToken?this.rawToken.refresh_token:void 0},"get")},{key:"hasExpired",value:i(function(){var r=new Date().getTime();return this.rawToken&&this.expiresAt?r>=this.expiresAt:!0},"hasExpired")},{key:"isTokenExpiring",value:i(function(){var r,n=new Date().getTime(),o=(r=this.eagerRefreshThresholdMillis)!==null&&r!==void 0?r:0;return this.rawToken&&this.expiresAt?this.expiresAt<=n+o:!0},"isTokenExpiring")},{key:"getToken",value:i(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(_n(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var o=r;Dr(Gr,this,bT).call(this,n).then(function(s){return o(null,s)},r);return}return Dr(Gr,this,bT).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=ho(ir().m(i(function n(o){var s,p,m,h,v,P,x;return ir().w(function(T){for(;;)switch(T.n){case 0:s=EU.extname(o),x=s,T.n=x===".json"?1:x===".der"||x===".crt"||x===".pem"?4:x===".p12"||x===".pfx"?6:7;break;case 1:return T.n=2,PT(o,"utf8");case 2:if(p=T.v,m=JSON.parse(p),h=m.private_key,v=m.client_email,!(!h||!v)){T.n=3;break}throw new Da("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return T.a(2,{privateKey:h,clientEmail:v});case 4:return T.n=5,PT(o,"utf8");case 5:return P=T.v,T.a(2,{privateKey:P});case 6:throw new Da("*.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 Da("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return T.a(2)}},n)},"_callee2")));function r(n){return e.apply(this,arguments)}return i(r,"getCredentials"),r})()},{key:"revokeToken",value:i(function(r){if(r){Dr(Gr,this,TT).call(this).then(function(){return r()},r);return}return Dr(Gr,this,TT).call(this)},"revokeToken")}])})();function bT(t){return jp.apply(this,arguments)}i(bT,"_getTokenAsync");function jp(){return jp=ho(ir().m(i(function t(e){return ir().w(function(r){for(;;)switch(r.n){case 0:if(!(yT(Ra,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,yT(Ra,this));case 1:return r.p=1,r.n=2,gT(Ra,this,Dr(Gr,this,MU).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,gT(Ra,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),jp.apply(this,arguments)}i(jp,"_getTokenAsync2");function MU(t){return qp.apply(this,arguments)}i(MU,"_getTokenAsyncInner");function qp(){return qp=ho(ir().m(i(function t(e){var r;return ir().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||Dr(Gr,this,FU).call(this);case 4:return n.a(2,Dr(Gr,this,LU).call(this))}},t,this)},"_callee4"))),qp.apply(this,arguments)}i(qp,"_getTokenAsyncInner2");function FU(){if(!this.iss)throw new Da("email is required.","MISSING_CREDENTIALS")}i(FU,"_ensureEmail");function TT(){return Bp.apply(this,arguments)}i(TT,"_revokeTokenAsync");function Bp(){return Bp=ho(ir().m(i(function t(){var e;return ir().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=UU+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Dr(Gr,this,AT).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"))),Bp.apply(this,arguments)}i(Bp,"_revokeTokenAsync2");function AT(){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,_n(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}i(AT,"_configure");function LU(){return Vp.apply(this,arguments)}i(LU,"_requestToken");function Vp(){return Vp=ho(ir().m(i(function t(){var e,r,n,o,s,p,m,h,v,P;return ir().w(function(x){for(;;)switch(x.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:wT,exp:e+3600,iat:e,sub:this.sub},r),o=xU.sign({header:{alg:"RS256"},payload:n,secret:this.key}),x.p=1,x.n=2,this.transporter.request({method:"POST",url:wT,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:o}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=x.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,x.a(2,this.rawToken);case 3:throw x.p=3,P=x.v,this.rawToken=void 0,this.tokenExpires=void 0,h=P.response&&(p=P.response)!==null&&p!==void 0&&p.data?(m=P.response)===null||m===void 0?void 0:m.data:{},h.error&&(v=h.error_description?": ".concat(h.error_description):"",P.message="".concat(h.error).concat(v)),P;case 4:return x.a(2)}},t,this,[[1,3]])},"_callee6"))),Vp.apply(this,arguments)}i(Vp,"_requestToken2")});var Wp=L(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.JWTAccess=void 0;var jU=Fp(),qU=Ir(),DT={alg:"RS256",typ:"JWT"},Hp=class t{static{i(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new qU.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,r,n,o){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=o??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 o=this.getCachedKey(e,n),s=this.cache.get(o),p=Date.now();if(s&&s.expiration-p>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let m=Math.floor(Date.now()/1e3),h=t.getExpirationTime(m),v;if(Array.isArray(n)&&(n=n.join(" ")),n?v={iss:this.email,sub:this.email,scope:n,exp:h,iat:m}:v={iss:this.email,sub:this.email,aud:e,exp:h,iat:m},r){for(let S in v)if(r[S])throw new Error(`The '${S}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let P=this.keyId?{...DT,kid:this.keyId}:DT,x=Object.assign(v,r),T=jU.sign({header:P,payload:x,secret:this.key}),w=new Headers({authorization:`Bearer ${T}`});return this.cache.set(o,{expiration:h*1e3,headers:w}),w}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 o="";e.setEncoding("utf8").on("data",s=>o+=s).on("error",n).on("end",()=>{try{let s=JSON.parse(o);this.fromJSON(s),r()}catch(s){n(s)}})})}};Ju.JWTAccess=Hp});var Kp=L(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.JWT=void 0;var $T=RT(),BU=Wp(),VU=_i(),Yu=tr(),Zp=class t extends VU.OAuth2Client{static{i(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!==Yu.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==Yu.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${Yu.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 BU.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let n;this.hasUserScopes()?n=this.scopes:e||(n=this.defaultScopes);let o=this.useJWTAccessWithScope||this.universeDomain!==Yu.DEFAULT_UNIVERSE,s=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,o?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 $T.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 $T.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 o="";e.setEncoding("utf8").on("error",n).on("data",s=>o+=s).on("end",()=>{try{let s=JSON.parse(o);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.")}};Xu.JWT=Zp});var Yp=L(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.UserRefreshClient=go.USER_REFRESH_ACCOUNT_TYPE=void 0;var GU=_i(),HU=tr();go.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var Jp=class t extends GU.OAuth2Client{static{i(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,o,s){let p=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:o,forceRefreshOnFailure:s};super(p),this._refreshToken=p.refreshToken,this.credentials.refresh_token=p.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 HU.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 o="";e.setEncoding("utf8").on("error",n).on("data",s=>o+=s).on("end",()=>{try{let s=JSON.parse(o);return this.fromJSON(s),r()}catch(s){return n(s)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};go.UserRefreshClient=Jp});var Qp=L(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.Impersonated=yo.IMPERSONATED_ACCOUNT_TYPE=void 0;var OT=_i(),WU=mt(),ZU=Ir();yo.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var Xp=class t extends OT.OAuth2Client{static{i(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 OT.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,ZU.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`,o={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:o,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"},o=await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:n,method:"POST"}),s=o.data;return this.credentials.access_token=s.accessToken,this.credentials.expiry_date=Date.parse(s.expireTime),{tokens:this.credentials,res:o}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof WU.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}`,o=`${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:o,data:s,method:"POST"})).data.token}};yo.Impersonated=Xp});var tf=L(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.OAuthClientAuthHandler=void 0;Ca.getErrorFromOAuthErrorResponse=YU;var vo=mt(),KU=Ta(),JU=["PUT","POST","PATCH"],ef=class{static{i(this,"OAuthClientAuthHandler")}#e=(0,KU.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new vo.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new vo.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=vo.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=vo.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=vo.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,o=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${o}`);vo.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!JU.includes(r))throw new Error(`${r} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let o=new Headers(e.headers).get("content-type");if(o?.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(o?.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(`${o} 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"]}}}};Ca.OAuthClientAuthHandler=ef;function YU(t,e){let r=t.error,n=t.error_description,o=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof o<"u"&&(s+=` - ${o}`);let p=new Error(s);if(e){let m=Object.keys(e);e.stack&&m.push("stack"),m.forEach(h=>{h!=="message"&&Object.defineProperty(p,h,{value:e[h],writable:!1,enumerable:!0})})}return p}i(YU,"getErrorFromOAuthErrorResponse")});var ec=L(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.StsCredentials=void 0;var XU=mt(),QU=tr(),CT=tf(),eM=Ir(),rf=class t extends CT.OAuthClientAuthHandler{static{i(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 o={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,eM.removeUndefinedValuesInObject)(o))};QU.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let p=await this.transporter.request(s),m=p.data;return m.res=p,m}catch(p){throw p instanceof XU.GaxiosError&&p.response?(0,CT.getErrorFromOAuthErrorResponse)(p.response.data,p):p}}};Qu.StsCredentials=rf});var Kn=L(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.BaseExternalAccountClient=gr.CLOUD_RESOURCE_MANAGER=gr.EXTERNAL_ACCOUNT_TYPE=gr.EXPIRATION_TIME_OFFSET=void 0;var tM=mt(),rM=require("stream"),nf=tr(),nM=ec(),NT=Ir(),iM=vp(),oM="urn:ietf:params:oauth:grant-type:token-exchange",aM="urn:ietf:params:oauth:token-type:access_token",of="https://www.googleapis.com/auth/cloud-platform",sM=3600;gr.EXPIRATION_TIME_OFFSET=300*1e3;gr.EXTERNAL_ACCOUNT_TYPE="external_account";gr.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var uM="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",cM="https://sts.{universeDomain}/v1/token",af=class t extends nf.AuthClient{static{i(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,NT.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==gr.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${gr.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let o=r.get("client_id"),s=r.get("client_secret");this.tokenUrl=r.get("token_url")??cM.replace("{universeDomain}",this.universeDomain);let p=r.get("subject_token_type"),m=r.get("workforce_pool_user_project"),h=r.get("service_account_impersonation_url"),v=r.get("service_account_impersonation"),P=(0,NT.originalOrCamelOptions)(v).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(r.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),o&&(this.clientAuth={confidentialClientType:"basic",clientId:o,clientSecret:s}),this.stsCredential=new nM.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[of],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=p,this.workforcePoolUserProject=m;let x=new RegExp(uM);if(this.workforcePoolUserProject&&!this.audience.match(x))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=h,this.serviceAccountImpersonationLifetime=P,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=sM),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}`};nf.AuthClient.setMethodName(n,"getProjectId");let o=await this.transporter.request(n);return this.projectId=o.data.projectId,this.projectId}return null}async requestAsync(e,r=!1){let n;try{let o=await this.getRequestHeaders();e.headers=tM.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,o),n=await this.transporter.request(e)}catch(o){let s=o.response;if(s){let p=s.status,m=s.config.data instanceof rM.Readable;if(!r&&(p===401||p===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw o}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:oM,audience:this.audience,requestedTokenType:aM,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[of]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,o=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),s=await this.stsCredential.exchangeToken(r,o,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"}};nf.AuthClient.setMethodName(r,"getImpersonatedAccessToken");let n=await this.transporter.request(r),o=n.data;return{access_token:o.accessToken,expiry_date:new Date(o.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||[of]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${iM.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};gr.BaseExternalAccountClient=af});var kT=L(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.FileSubjectTokenSupplier=void 0;var uf=require("util"),cf=require("fs"),lM=(0,uf.promisify)(cf.readFile??(()=>{})),dM=(0,uf.promisify)(cf.realpath??(()=>{})),pM=(0,uf.promisify)(cf.lstat??(()=>{})),sf=class{static{i(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 dM(e),!(await pM(e)).isFile())throw new Error}catch(o){throw o instanceof Error&&(o.message=`The file at ${e} does not exist, or it is not a file. ${o.message}`),o}let r,n=await lM(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}};tc.FileSubjectTokenSupplier=sf});var zT=L(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.UrlSubjectTokenSupplier=void 0;var fM=tr(),lf=class{static{i(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};fM.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}};rc.UrlSubjectTokenSupplier=lf});var UT=L(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.CertificateSubjectTokenSupplier=or.InvalidConfigurationError=or.CertificateSourceUnavailableError=or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var nc=Ir(),ic=require("fs"),oc=require("crypto"),mM=require("https");or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Hr=class extends Error{static{i(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};or.CertificateSourceUnavailableError=Hr;var yr=class extends Error{static{i(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};or.InvalidConfigurationError=yr;var df=class{static{i(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new yr("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new yr("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new yr("Cannot create mTLS Agent with missing certificate or key");return new mM.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,nc.isValidFile)(e))return e;throw new Hr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,nc.isValidFile)(r))return r;throw new Hr(`Path from environment variable "${or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,nc.getWellKnownCertificateConfigFileLocation)();if(await(0,nc.isValidFile)(n))return n;throw new Hr(`Could not find certificate configuration file. Searched override path, the "${or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await ic.promises.readFile(e,"utf8")}catch{throw new Hr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),o=n?.cert_configs?.workload?.cert_path,s=n?.cert_configs?.workload?.key_path;if(!o||!s)throw new yr(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:o,keyPath:s}}catch(n){throw n instanceof yr?n:new yr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,o;try{n=await ic.promises.readFile(e),new oc.X509Certificate(n)}catch(s){let p=s instanceof Error?s.message:String(s);throw new Hr(`Failed to read certificate file at ${e}: ${p}`)}try{o=await ic.promises.readFile(r),(0,oc.createPrivateKey)(o)}catch(s){let p=s instanceof Error?s.message:String(s);throw new Hr(`Failed to read private key file at ${r}: ${p}`)}return{cert:n,key:o}}async#n(e){let r=new oc.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await ic.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((h,v)=>{try{return new oc.X509Certificate(h)}catch(P){let x=P instanceof Error?P.message:String(P);throw new yr(`Failed to parse certificate at index ${v} in trust chain file ${this.trustChainPath}: ${x}`)}}),p=s.findIndex(h=>r.raw.equals(h.raw)),m;if(p===-1)m=[r,...s];else if(p===0)m=s;else throw new yr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${p}).`);return JSON.stringify(m.map(h=>h.raw.toString("base64")))}catch(n){if(n instanceof yr)throw n;let o=n instanceof Error?n.message:String(n);throw new Hr(`Failed to process certificate chain from ${this.trustChainPath}: ${o}`)}}};or.CertificateSubjectTokenSupplier=df});var mf=L(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.IdentityPoolClient=void 0;var hM=Kn(),pf=Ir(),gM=kT(),yM=zT(),MT=UT(),vM=ec(),FT=mt(),ff=class t extends hM.BaseExternalAccountClient{static{i(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,pf.originalOrCamelOptions)(e),n=r.get("credential_source"),o=r.get("subject_token_supplier");if(!n&&!o)throw new Error("A credential source or subject token supplier must be specified.");if(n&&o)throw new Error("Only one of credential source or subject token supplier can be specified.");if(o)this.subjectTokenSupplier=o,this.credentialSourceType="programmatic";else{let s=(0,pf.originalOrCamelOptions)(n),p=(0,pf.originalOrCamelOptions)(s.get("format")),m=p.get("type")||"text",h=p.get("subject_token_field_name");if(m!=="json"&&m!=="text")throw new Error(`Invalid credential_source format "${m}"`);if(m==="json"&&!h)throw new Error("Missing subject_token_field_name for JSON credential_source format");let v=s.get("file"),P=s.get("url"),x=s.get("certificate"),T=s.get("headers");if(v&&P||P&&x||v&&x)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(v)this.credentialSourceType="file",this.subjectTokenSupplier=new gM.FileSubjectTokenSupplier({filePath:v,formatType:m,subjectTokenFieldName:h});else if(P)this.credentialSourceType="url",this.subjectTokenSupplier=new yM.UrlSubjectTokenSupplier({url:P,formatType:m,subjectTokenFieldName:h,headers:T,additionalGaxiosOptions:t.RETRY_CONFIG});else if(x){this.credentialSourceType="certificate";let w=new MT.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:x.use_default_certificate_config,certificateConfigLocation:x.certificate_config_location,trustChainPath:x.trust_chain_path});this.subjectTokenSupplier=w}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 MT.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new vM.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new FT.Gaxios({agent:r})}),this.transporter=new FT.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};ac.IdentityPoolClient=ff});var gf=L(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.AwsRequestSigner=void 0;var sc=mt(),jT=Ta(),LT="AWS4-HMAC-SHA256",_M="aws4_request",hf=class{static{i(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,jT.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,o=e.method||"GET",s=e.body||r,p=e.headers,m=await this.getCredentials(),h=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 v=await wM({crypto:this.crypto,host:h.host,canonicalUri:h.pathname,canonicalQuerystring:h.search.slice(1),method:o,region:this.region,securityCredentials:m,requestPayload:s,additionalAmzHeaders:p}),P=sc.Gaxios.mergeHeaders(v.amzDate?{"x-amz-date":v.amzDate}:{},{authorization:v.authorizationHeader,host:h.host},p||{});m.token&&sc.Gaxios.mergeHeaders(P,{"x-amz-security-token":m.token});let x={url:n,method:o,headers:P};return s!==void 0&&(x.body=s),x}};uc.AwsRequestSigner=hf;async function Na(t,e,r){return await t.signWithHmacSha256(e,r)}i(Na,"sign");async function PM(t,e,r,n,o){let s=await Na(t,`AWS4${e}`,r),p=await Na(t,s,n),m=await Na(t,p,o);return await Na(t,m,"aws4_request")}i(PM,"getSigningKey");async function wM(t){let e=sc.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],o=new Date,s=o.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),p=o.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let m=sc.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),h="",v=[...m.keys()].sort();v.forEach(f=>{h+=`${f}:${m.get(f)}
41
+ `});let P=v.join(";"),x=await t.crypto.sha256DigestHex(r),T=`${t.method.toUpperCase()}
42
42
  ${t.canonicalUri}
43
43
  ${t.canonicalQuerystring}
44
44
  ${h}
45
45
  ${P}
46
- ${E}`,w=`${f}/${t.region}/${n}/${Wz}`,T=`${TS}
47
- ${a}
46
+ ${x}`,w=`${p}/${t.region}/${n}/${_M}`,S=`${LT}
47
+ ${s}
48
48
  ${w}
49
- `+await t.crypto.sha256DigestHex(S),$=await Zz(t.crypto,t.securityCredentials.secretAccessKey,f,t.region,n),b=await $s(t.crypto,$,T),u=`${TS} Credential=${t.securityCredentials.accessKeyId}/${w}, SignedHeaders=${P}, Signature=${(0,ES.fromArrayBufferToHex)(b)}`;return{amzDate:e.has("date")?void 0:a,authorizationHeader:u,canonicalQuerystring:t.canonicalQuerystring}}o(Kz,"generateAuthenticationHeaderMap")});var bS=M(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.DefaultAwsSecurityCredentialsSupplier=void 0;var ic=Xt(),pf=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};ic.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 ic.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 ic.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 ic.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}};sc.DefaultAwsSecurityCredentialsSupplier=pf});var mf=M(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.AwsClient=void 0;var Jz=df(),Yz=qn(),Xz=bS(),AS=Er(),Qz=pt(),ff=class t extends Yz.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,AS.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 a=(0,AS.originalOrCamelOptions)(n);this.environmentId=a.get("environment_id");let f=a.get("region_url"),m=a.get("url"),h=a.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new Xz.DefaultAwsSecurityCredentialsSupplier({regionUrl:f,securityCredentialsUrl:m,imdsV2SessionTokenUrl:h}),this.regionalCredVerificationUrl=a.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 Jz.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 Qz.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((i,a)=>r.push({key:a,value:i})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};ac.AwsClient=ff});var _f=M(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.InvalidSubjectTokenError=ht.InvalidMessageFieldError=ht.InvalidCodeFieldError=ht.InvalidTokenTypeFieldError=ht.InvalidExpirationTimeFieldError=ht.InvalidSuccessFieldError=ht.InvalidVersionFieldError=ht.ExecutableResponseError=ht.ExecutableResponse=void 0;var uc="urn:ietf:params:oauth:token-type:saml2",hf="urn:ietf:params:oauth:token-type:id_token",gf="urn:ietf:params:oauth:token-type:jwt",yf=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new cc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new lc("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!==uc&&this.tokenType!==hf&&this.tokenType!==gf)throw new dc(`Executable response must contain a 'token_type' field when successful and it must be one of ${hf}, ${gf}, or ${uc}.`);if(this.tokenType===uc){if(!e.saml_response)throw new Os(`Executable response must contain a 'saml_response' field when token_type=${uc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new Os(`Executable response must contain a 'id_token' field when token_type=${hf} or ${gf}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new pc("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new fc("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)}};ht.ExecutableResponse=yf;var Br=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};ht.ExecutableResponseError=Br;var cc=class extends Br{static{o(this,"InvalidVersionFieldError")}};ht.InvalidVersionFieldError=cc;var lc=class extends Br{static{o(this,"InvalidSuccessFieldError")}};ht.InvalidSuccessFieldError=lc;var vf=class extends Br{static{o(this,"InvalidExpirationTimeFieldError")}};ht.InvalidExpirationTimeFieldError=vf;var dc=class extends Br{static{o(this,"InvalidTokenTypeFieldError")}};ht.InvalidTokenTypeFieldError=dc;var pc=class extends Br{static{o(this,"InvalidCodeFieldError")}};ht.InvalidCodeFieldError=pc;var fc=class extends Br{static{o(this,"InvalidMessageFieldError")}};ht.InvalidMessageFieldError=fc;var Os=class extends Br{static{o(this,"InvalidSubjectTokenError")}};ht.InvalidSubjectTokenError=Os});var xf=M(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.PluggableAuthHandler=gi.ExecutableError=void 0;var go=_f(),eU=require("child_process"),Pf=require("fs"),mc=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)}};gi.ExecutableError=mc;var wf=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=eU.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),a="";i.stdout.on("data",m=>{a+=m}),i.stderr.on("data",m=>{a+=m});let f=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",m=>{if(clearTimeout(f),m===0)try{let h=JSON.parse(a),_=new go.ExecutableResponse(h);return r(_)}catch(h){return h instanceof go.ExecutableResponseError?n(h):n(new go.ExecutableResponseError(`The executable returned an invalid response: ${a}`))}else return n(new mc(a,m.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await Pf.promises.realpath(this.outputFile)}catch{return}if(!(await Pf.promises.lstat(e)).isFile())return;let r=await Pf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new go.ExecutableResponse(n).isValid()?new go.ExecutableResponse(n):void 0}catch(n){throw n instanceof go.ExecutableResponseError?n:new go.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}};gi.PluggableAuthHandler=wf});var Tf=M(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.PluggableAuthClient=yi.ExecutableError=void 0;var tU=qn(),rU=_f(),IS=xf(),nU=xf();Object.defineProperty(yi,"ExecutableError",{enumerable:!0,get:o(function(){return nU.ExecutableError},"get")});var oU=30*1e3,RS=5*1e3,$S=120*1e3,iU="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",OS=1,Sf=class extends tU.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=oU;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<RS||this.timeoutMillis>$S)throw new Error(`Timeout must be between ${RS} and ${$S} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new IS.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[iU]!=="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>OS)throw new Error(`Version of executable is not currently supported, maximum supported version is ${OS}.`);if(!e.success)throw new IS.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new rU.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}};yi.PluggableAuthClient=Sf});var bf=M(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.ExternalAccountClient=void 0;var sU=qn(),aU=cf(),uU=mf(),cU=Tf(),Ef=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===sU.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new uU.AwsClient(e):e.credential_source?.executable?new cU.PluggableAuthClient(e):new aU.IdentityPoolClient(e):null}};hc.ExternalAccountClient=Ef});var Rf=M(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.ExternalAccountAuthorizedUserClient=vi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var CS=Xt(),DS=Jp(),NS=pt(),lU=require("stream"),dU=qn();vi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var pU="https://sts.{universeDomain}/v1/oauthtoken",Af=class t extends DS.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})};CS.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let i=await this.transporter.request(n),a=i.data;return a.res=i,a}catch(i){throw i instanceof NS.GaxiosError&&i.response?(0,DS.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},If=class extends CS.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 Af({tokenRefreshEndpoint:e.token_url??pU.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=dU.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=NS.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let a=i.response;if(a){let f=a.status,m=a.config.data instanceof lU.Readable;if(!r&&(f===401||f===403)&&!m&&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}};vi.ExternalAccountAuthorizedUserClient=If});var jS=M(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.GoogleAuth=Rr.GoogleAuthExceptionMessages=void 0;var fU=require("child_process"),Ds=require("fs"),mU=pt(),Cs=vs(),hU=require("os"),$f=require("path"),gU=_s(),yU=xp(),vU=Tp(),_U=Ep(),_i=Vp(),zS=Hp(),Pi=Zp(),PU=bf(),Ns=qn(),Of=Xt(),US=Rf(),kS=Er();Rr.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(T),D=await PM(t.crypto,t.securityCredentials.secretAccessKey,p,t.region,n),E=await Na(t.crypto,D,S),u=`${LT} Credential=${t.securityCredentials.accessKeyId}/${w}, SignedHeaders=${P}, Signature=${(0,jT.fromArrayBufferToHex)(E)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:u,canonicalQuerystring:t.canonicalQuerystring}}i(wM,"generateAuthenticationHeaderMap")});var qT=L(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.DefaultAwsSecurityCredentialsSupplier=void 0;var cc=tr(),yf=class{static{i(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};cc.AuthClient.setMethodName(n,"getAwsRegion");let o=await e.transporter.request(n);return o.data.substr(0,o.data.length-1)}async getAwsSecurityCredentials(e){if(this.#i)return this.#i;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),o=await this.#r(n,r,e.transporter);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,token:o.Token}}async#e(e){let r={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return cc.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 cc.AuthClient.setMethodName(n,"#getAwsRoleName"),(await r.request(n)).data}async#r(e,r,n){let o={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,headers:r};return cc.AuthClient.setMethodName(o,"#retrieveAwsSecurityCredentials"),(await n.request(o)).data}get#n(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null}get#i(){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}};lc.DefaultAwsSecurityCredentialsSupplier=yf});var _f=L(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.AwsClient=void 0;var bM=gf(),TM=Kn(),SM=qT(),BT=Ir(),xM=mt(),vf=class t extends TM.BaseExternalAccountClient{static{i(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,BT.originalOrCamelOptions)(e),n=r.get("credential_source"),o=r.get("aws_security_credentials_supplier");if(!n&&!o)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(n&&o)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(o)this.awsSecurityCredentialsSupplier=o,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let s=(0,BT.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let p=s.get("region_url"),m=s.get("url"),h=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new SM.DefaultAwsSecurityCredentialsSupplier({regionUrl:p,securityCredentialsUrl:m,imdsV2SessionTokenUrl:h}),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 bM.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 xM.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((o,s)=>r.push({key:s,value:o})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};dc.AwsClient=vf});var Sf=L(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.InvalidSubjectTokenError=yt.InvalidMessageFieldError=yt.InvalidCodeFieldError=yt.InvalidTokenTypeFieldError=yt.InvalidExpirationTimeFieldError=yt.InvalidSuccessFieldError=yt.InvalidVersionFieldError=yt.ExecutableResponseError=yt.ExecutableResponse=void 0;var pc="urn:ietf:params:oauth:token-type:saml2",Pf="urn:ietf:params:oauth:token-type:id_token",wf="urn:ietf:params:oauth:token-type:jwt",bf=class{static{i(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new fc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new mc("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!==pc&&this.tokenType!==Pf&&this.tokenType!==wf)throw new hc(`Executable response must contain a 'token_type' field when successful and it must be one of ${Pf}, ${wf}, or ${pc}.`);if(this.tokenType===pc){if(!e.saml_response)throw new ka(`Executable response must contain a 'saml_response' field when token_type=${pc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new ka(`Executable response must contain a 'id_token' field when token_type=${Pf} or ${wf}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new gc("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new yc("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)}};yt.ExecutableResponse=bf;var Wr=class extends Error{static{i(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};yt.ExecutableResponseError=Wr;var fc=class extends Wr{static{i(this,"InvalidVersionFieldError")}};yt.InvalidVersionFieldError=fc;var mc=class extends Wr{static{i(this,"InvalidSuccessFieldError")}};yt.InvalidSuccessFieldError=mc;var Tf=class extends Wr{static{i(this,"InvalidExpirationTimeFieldError")}};yt.InvalidExpirationTimeFieldError=Tf;var hc=class extends Wr{static{i(this,"InvalidTokenTypeFieldError")}};yt.InvalidTokenTypeFieldError=hc;var gc=class extends Wr{static{i(this,"InvalidCodeFieldError")}};yt.InvalidCodeFieldError=gc;var yc=class extends Wr{static{i(this,"InvalidMessageFieldError")}};yt.InvalidMessageFieldError=yc;var ka=class extends Wr{static{i(this,"InvalidSubjectTokenError")}};yt.InvalidSubjectTokenError=ka});var If=L(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.PluggableAuthHandler=_o.ExecutableError=void 0;var Pi=Sf(),EM=require("child_process"),xf=require("fs"),vc=class extends Error{static{i(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)}};_o.ExecutableError=vc;var Ef=class t{static{i(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 o=EM.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";o.stdout.on("data",m=>{s+=m}),o.stderr.on("data",m=>{s+=m});let p=setTimeout(()=>(o.removeAllListeners(),o.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);o.on("close",m=>{if(clearTimeout(p),m===0)try{let h=JSON.parse(s),v=new Pi.ExecutableResponse(h);return r(v)}catch(h){return h instanceof Pi.ExecutableResponseError?n(h):n(new Pi.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new vc(s,m.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await xf.promises.realpath(this.outputFile)}catch{return}if(!(await xf.promises.lstat(e)).isFile())return;let r=await xf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new Pi.ExecutableResponse(n).isValid()?new Pi.ExecutableResponse(n):void 0}catch(n){throw n instanceof Pi.ExecutableResponseError?n:new Pi.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}};_o.PluggableAuthHandler=Ef});var Rf=L(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.PluggableAuthClient=Po.ExecutableError=void 0;var IM=Kn(),AM=Sf(),VT=If(),RM=If();Object.defineProperty(Po,"ExecutableError",{enumerable:!0,get:i(function(){return RM.ExecutableError},"get")});var DM=30*1e3,GT=5*1e3,HT=120*1e3,$M="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",WT=1,Af=class extends IM.BaseExternalAccountClient{static{i(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=DM;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<GT||this.timeoutMillis>HT)throw new Error(`Timeout must be between ${GT} and ${HT} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new VT.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[$M]!=="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>WT)throw new Error(`Version of executable is not currently supported, maximum supported version is ${WT}.`);if(!e.success)throw new VT.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new AM.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}};Po.PluggableAuthClient=Af});var $f=L(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.ExternalAccountClient=void 0;var OM=Kn(),CM=mf(),NM=_f(),kM=Rf(),Df=class{static{i(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===OM.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new NM.AwsClient(e):e.credential_source?.executable?new kM.PluggableAuthClient(e):new CM.IdentityPoolClient(e):null}};_c.ExternalAccountClient=Df});var Nf=L(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.ExternalAccountAuthorizedUserClient=wo.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var KT=tr(),ZT=tf(),JT=mt(),zM=require("stream"),UM=Kn();wo.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var MM="https://sts.{universeDomain}/v1/oauthtoken",Of=class t extends ZT.OAuthClientAuthHandler{static{i(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})};KT.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let o=await this.transporter.request(n),s=o.data;return s.res=o,s}catch(o){throw o instanceof JT.GaxiosError&&o.response?(0,ZT.getErrorFromOAuthErrorResponse)(o.response.data,o):o}}},Cf=class extends KT.AuthClient{static{i(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 Of({tokenRefreshEndpoint:e.token_url??MM.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=UM.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 o=await this.getRequestHeaders();e.headers=JT.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,o),n=await this.transporter.request(e)}catch(o){let s=o.response;if(s){let p=s.status,m=s.config.data instanceof zM.Readable;if(!r&&(p===401||p===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw o}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}};wo.ExternalAccountAuthorizedUserClient=Cf});var eS=L($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.GoogleAuth=$r.GoogleAuthExceptionMessages=void 0;var FM=require("child_process"),za=require("fs"),LM=mt(),Ua=ba(),jM=require("os"),kf=require("path"),qM=Ta(),BM=Ip(),VM=Rp(),GM=Dp(),bo=Kp(),YT=Yp(),To=Qp(),HM=$f(),Ma=Kn(),zf=tr(),XT=Nf(),QT=Ir();$r.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 Df=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(Rr.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===Rr.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(Rr.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 Cs.universe("universe-domain"),e||=Of.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Of.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,kS.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Of.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 _i.JWT?r.scopes=this.scopes:r instanceof Ns.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof _i.JWT?r.scopes=this.scopes:r instanceof Ns.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new yU.Compute(e));throw new Error(Rr.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=Cs.getGCPResidency()||await Cs.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=$f.join(i,".config"))}return r&&(r=$f.join(r,"gcloud","application_default_credentials.json"),Ds.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=Ds.realpathSync(e),!Ds.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=Ds.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!==Pi.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${Pi.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 Pi.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,r={}){let n,i=(0,kS.originalOrCamelOptions)(r).get("universe_domain");return e.type===zS.USER_REFRESH_ACCOUNT_TYPE?(n=new zS.UserRefreshClient(r),n.fromJSON(e)):e.type===Pi.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===Ns.EXTERNAL_ACCOUNT_TYPE?(n=PU.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===US.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new US.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new _i.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(a=>n(null,a),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 a=[];e.setEncoding("utf8").on("error",i).on("data",f=>a.push(f)).on("end",()=>{try{try{let f=JSON.parse(a.join("")),m=this._cacheClientFromJSON(f,r);return n(m)}catch(f){if(!this.keyFilename)throw f;let m=new _i.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=m,this.setGapicJWTValues(m),n(m)}}catch(f){return i(f)}})})}fromAPIKey(e,r={}){return new _i.JWT({...r,apiKey:e})}_isWindows(){let e=hU.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,fU.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!==Ns.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await Cs.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 Pi.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof Ns.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([Cs.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(Rr.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=$f.resolve(this.keyFilename),r=Ds.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 vU.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=mU.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,_U.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 Pi.Impersonated)return(await n.sign(e)).signedBlob;let a=(0,gU.createCrypto)();if(n instanceof _i.JWT&&n.key)return await a.sign(n.key,e);let f=await this.getCredentials();if(!f.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(a,f.client_email,e,r)}async signBlob(e,r,n,i){let a=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:a.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};Rr.GoogleAuth=Df});var MS=M(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.IAMAuth=void 0;var Cf=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}}};gc.IAMAuth=Cf});var FS=M(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.DownscopedClient=Vr.EXPIRATION_TIME_OFFSET=Vr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var wU=pt(),xU=require("stream"),Nf=Xt(),SU=Ju(),TU="urn:ietf:params:oauth:grant-type:token-exchange",EU="urn:ietf:params:oauth:token-type:access_token",bU="urn:ietf:params:oauth:token-type:access_token";Vr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Vr.EXPIRATION_TIME_OFFSET=5*60*1e3;var zf=class extends Nf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Nf.AuthClient?{}:e),e instanceof Nf.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>Vr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Vr.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 SU.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=wU.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let a=i.response;if(a){let f=a.status,m=a.config.data instanceof xU.Readable;if(!r&&(f===401||f===403)&&!m&&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:TU,requestedTokenType:EU,subjectToken:e,subjectTokenType:bU},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),i=this.authClient.credentials?.expiry_date||null,a=n.expires_in?new Date().getTime()+n.expires_in*1e3:i;return this.cachedDownscopedAccessToken={access_token:n.access_token,expiry_date:a,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}};Vr.DownscopedClient=zf});var LS=M(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.PassThroughClient=void 0;var AU=Xt(),Uf=class extends AU.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};yc.PassThroughClient=Uf});var zs=M(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.GoogleAuth=ce.auth=ce.PassThroughClient=ce.ExternalAccountAuthorizedUserClient=ce.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=ce.ExecutableError=ce.PluggableAuthClient=ce.DownscopedClient=ce.BaseExternalAccountClient=ce.ExternalAccountClient=ce.IdentityPoolClient=ce.AwsRequestSigner=ce.AwsClient=ce.UserRefreshClient=ce.LoginTicket=ce.ClientAuthentication=ce.OAuth2Client=ce.CodeChallengeMethod=ce.Impersonated=ce.JWT=ce.JWTAccess=ce.IdTokenClient=ce.IAMAuth=ce.GCPEnv=ce.Compute=ce.DEFAULT_UNIVERSE=ce.AuthClient=ce.gaxios=ce.gcpMetadata=void 0;var qS=jS();Object.defineProperty(ce,"GoogleAuth",{enumerable:!0,get:o(function(){return qS.GoogleAuth},"get")});ce.gcpMetadata=vs();ce.gaxios=pt();var BS=Xt();Object.defineProperty(ce,"AuthClient",{enumerable:!0,get:o(function(){return BS.AuthClient},"get")});Object.defineProperty(ce,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return BS.DEFAULT_UNIVERSE},"get")});var IU=xp();Object.defineProperty(ce,"Compute",{enumerable:!0,get:o(function(){return IU.Compute},"get")});var RU=Ep();Object.defineProperty(ce,"GCPEnv",{enumerable:!0,get:o(function(){return RU.GCPEnv},"get")});var $U=MS();Object.defineProperty(ce,"IAMAuth",{enumerable:!0,get:o(function(){return $U.IAMAuth},"get")});var OU=Tp();Object.defineProperty(ce,"IdTokenClient",{enumerable:!0,get:o(function(){return OU.IdTokenClient},"get")});var DU=qp();Object.defineProperty(ce,"JWTAccess",{enumerable:!0,get:o(function(){return DU.JWTAccess},"get")});var CU=Vp();Object.defineProperty(ce,"JWT",{enumerable:!0,get:o(function(){return CU.JWT},"get")});var NU=Zp();Object.defineProperty(ce,"Impersonated",{enumerable:!0,get:o(function(){return NU.Impersonated},"get")});var kf=ho();Object.defineProperty(ce,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return kf.CodeChallengeMethod},"get")});Object.defineProperty(ce,"OAuth2Client",{enumerable:!0,get:o(function(){return kf.OAuth2Client},"get")});Object.defineProperty(ce,"ClientAuthentication",{enumerable:!0,get:o(function(){return kf.ClientAuthentication},"get")});var zU=vp();Object.defineProperty(ce,"LoginTicket",{enumerable:!0,get:o(function(){return zU.LoginTicket},"get")});var UU=Hp();Object.defineProperty(ce,"UserRefreshClient",{enumerable:!0,get:o(function(){return UU.UserRefreshClient},"get")});var kU=mf();Object.defineProperty(ce,"AwsClient",{enumerable:!0,get:o(function(){return kU.AwsClient},"get")});var jU=df();Object.defineProperty(ce,"AwsRequestSigner",{enumerable:!0,get:o(function(){return jU.AwsRequestSigner},"get")});var MU=cf();Object.defineProperty(ce,"IdentityPoolClient",{enumerable:!0,get:o(function(){return MU.IdentityPoolClient},"get")});var FU=bf();Object.defineProperty(ce,"ExternalAccountClient",{enumerable:!0,get:o(function(){return FU.ExternalAccountClient},"get")});var LU=qn();Object.defineProperty(ce,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return LU.BaseExternalAccountClient},"get")});var qU=FS();Object.defineProperty(ce,"DownscopedClient",{enumerable:!0,get:o(function(){return qU.DownscopedClient},"get")});var VS=Tf();Object.defineProperty(ce,"PluggableAuthClient",{enumerable:!0,get:o(function(){return VS.PluggableAuthClient},"get")});Object.defineProperty(ce,"ExecutableError",{enumerable:!0,get:o(function(){return VS.ExecutableError},"get")});var GS=Rf();Object.defineProperty(ce,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return GS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(ce,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return GS.ExternalAccountAuthorizedUserClient},"get")});var BU=LS();Object.defineProperty(ce,"PassThroughClient",{enumerable:!0,get:o(function(){return BU.PassThroughClient},"get")});var VU=new qS.GoogleAuth;ce.auth=VU});var WS=M(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});jf.getAPI=GU;function GU(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 a=r[i],f=new a(e,n);return Object.freeze(f)}catch(a){throw new Error(`Unable to load endpoint ${t}("${i}"): ${a.message}`)}}o(GU,"getAPI")});var KS=M((HX,ZS)=>{ZS.exports=require("util").inspect});var Fs=M((WX,hT)=>{var Zf=typeof Map=="function"&&Map.prototype,Mf=Object.getOwnPropertyDescriptor&&Zf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Pc=Zf&&Mf&&typeof Mf.get=="function"?Mf.get:null,JS=Zf&&Map.prototype.forEach,Kf=typeof Set=="function"&&Set.prototype,Ff=Object.getOwnPropertyDescriptor&&Kf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,wc=Kf&&Ff&&typeof Ff.get=="function"?Ff.get:null,YS=Kf&&Set.prototype.forEach,HU=typeof WeakMap=="function"&&WeakMap.prototype,ks=HU?WeakMap.prototype.has:null,WU=typeof WeakSet=="function"&&WeakSet.prototype,js=WU?WeakSet.prototype.has:null,ZU=typeof WeakRef=="function"&&WeakRef.prototype,XS=ZU?WeakRef.prototype.deref:null,KU=Boolean.prototype.valueOf,JU=Object.prototype.toString,YU=Function.prototype.toString,XU=String.prototype.match,Jf=String.prototype.slice,Bn=String.prototype.replace,QU=String.prototype.toUpperCase,QS=String.prototype.toLowerCase,uT=RegExp.prototype.test,eT=Array.prototype.concat,Gr=Array.prototype.join,ek=Array.prototype.slice,tT=Math.floor,Bf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Lf=Object.getOwnPropertySymbols,Vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,wi=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ms=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===wi||!0)?Symbol.toStringTag:null,cT=Object.prototype.propertyIsEnumerable,rT=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function nT(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||uT.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-tT(-t):tT(t);if(n!==t){var i=String(n),a=Jf.call(e,i.length+1);return Bn.call(i,r,"$&_")+"."+Bn.call(Bn.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Bn.call(e,r,"$&_")}o(nT,"addNumericSeparator");var Gf=KS(),oT=Gf.custom,iT=pT(oT)?oT:null,lT={__proto__:null,double:'"',single:"'"},tk={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};hT.exports=o(function t(e,r,n,i){var a=r||{};if(gn(a,"quoteStyle")&&!gn(lT,a.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(gn(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=gn(a,"customInspect")?a.customInspect:!0;if(typeof f!="boolean"&&f!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(gn(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(gn(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var m=a.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 mT(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var h=String(e);return m?nT(e,h):h}if(typeof e=="bigint"){var _=String(e)+"n";return m?nT(e,_):_}var P=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=P&&P>0&&typeof e=="object")return Hf(e)?"[Array]":"[Object]";var E=_k(a,n);if(typeof i>"u")i=[];else if(fT(i,e)>=0)return"[Circular]";function S(Z,Q,X){if(Q&&(i=ek.call(i),i.push(Q)),X){var ie={depth:a.depth};return gn(a,"quoteStyle")&&(ie.quoteStyle=a.quoteStyle),t(Z,ie,n+1,i)}return t(Z,a,n+1,i)}if(o(S,"inspect"),typeof e=="function"&&!sT(e)){var w=lk(e),T=_c(e,S);return"[Function"+(w?": "+w:" (anonymous)")+"]"+(T.length>0?" { "+Gr.call(T,", ")+" }":"")}if(pT(e)){var $=wi?Bn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Vf.call(e);return typeof e=="object"&&!wi?Us($):$}if(gk(e)){for(var b="<"+QS.call(String(e.nodeName)),u=e.attributes||[],p=0;p<u.length;p++)b+=" "+u[p].name+"="+dT(rk(u[p].value),"double",a);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+QS.call(String(e.nodeName))+">",b}if(Hf(e)){if(e.length===0)return"[]";var c=_c(e,S);return E&&!vk(c)?"["+Wf(c,E)+"]":"[ "+Gr.call(c,", ")+" ]"}if(ok(e)){var y=_c(e,S);return!("cause"in Error.prototype)&&"cause"in e&&!cT.call(e,"cause")?"{ ["+String(e)+"] "+Gr.call(eT.call("[cause]: "+S(e.cause),y),", ")+" }":y.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Gr.call(y,", ")+" }"}if(typeof e=="object"&&f){if(iT&&typeof e[iT]=="function"&&Gf)return Gf(e,{depth:P-n});if(f!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(dk(e)){var l=[];return JS&&JS.call(e,function(Z,Q){l.push(S(Q,e,!0)+" => "+S(Z,e))}),aT("Map",Pc.call(e),l,E)}if(mk(e)){var x=[];return YS&&YS.call(e,function(Z){x.push(S(Z,e))}),aT("Set",wc.call(e),x,E)}if(pk(e))return qf("WeakMap");if(hk(e))return qf("WeakSet");if(fk(e))return qf("WeakRef");if(sk(e))return Us(S(Number(e)));if(uk(e))return Us(S(Bf.call(e)));if(ak(e))return Us(KU.call(e));if(ik(e))return Us(S(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(!nk(e)&&!sT(e)){var g=_c(e,S),re=rT?rT(e)===Object.prototype:e instanceof Object||e.constructor===Object,ee=e instanceof Object?"":"null prototype",Te=!re&&Ms&&Object(e)===e&&Ms in e?Jf.call(Vn(e),8,-1):ee?"Object":"",ne=re||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",K=ne+(Te||ee?"["+Gr.call(eT.call([],Te||[],ee||[]),": ")+"] ":"");return g.length===0?K+"{}":E?K+"{"+Wf(g,E)+"}":K+"{ "+Gr.call(g,", ")+" }"}return String(e)},"inspect_");function dT(t,e,r){var n=r.quoteStyle||e,i=lT[n];return i+t+i}o(dT,"wrapQuotes");function rk(t){return Bn.call(String(t),/"/g,"&quot;")}o(rk,"quote");function yo(t){return!Ms||!(typeof t=="object"&&(Ms in t||typeof t[Ms]<"u"))}o(yo,"canTrustToString");function Hf(t){return Vn(t)==="[object Array]"&&yo(t)}o(Hf,"isArray");function nk(t){return Vn(t)==="[object Date]"&&yo(t)}o(nk,"isDate");function sT(t){return Vn(t)==="[object RegExp]"&&yo(t)}o(sT,"isRegExp");function ok(t){return Vn(t)==="[object Error]"&&yo(t)}o(ok,"isError");function ik(t){return Vn(t)==="[object String]"&&yo(t)}o(ik,"isString");function sk(t){return Vn(t)==="[object Number]"&&yo(t)}o(sk,"isNumber");function ak(t){return Vn(t)==="[object Boolean]"&&yo(t)}o(ak,"isBoolean");function pT(t){if(wi)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Vf)return!1;try{return Vf.call(t),!0}catch{}return!1}o(pT,"isSymbol");function uk(t){if(!t||typeof t!="object"||!Bf)return!1;try{return Bf.call(t),!0}catch{}return!1}o(uk,"isBigInt");var ck=Object.prototype.hasOwnProperty||function(t){return t in this};function gn(t,e){return ck.call(t,e)}o(gn,"has");function Vn(t){return JU.call(t)}o(Vn,"toStr");function lk(t){if(t.name)return t.name;var e=XU.call(YU.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(lk,"nameOf");function fT(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(fT,"indexOf");function dk(t){if(!Pc||!t||typeof t!="object")return!1;try{Pc.call(t);try{wc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(dk,"isMap");function pk(t){if(!ks||!t||typeof t!="object")return!1;try{ks.call(t,ks);try{js.call(t,js)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(pk,"isWeakMap");function fk(t){if(!XS||!t||typeof t!="object")return!1;try{return XS.call(t),!0}catch{}return!1}o(fk,"isWeakRef");function mk(t){if(!wc||!t||typeof t!="object")return!1;try{wc.call(t);try{Pc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(mk,"isSet");function hk(t){if(!js||!t||typeof t!="object")return!1;try{js.call(t,js);try{ks.call(t,ks)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(hk,"isWeakSet");function gk(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(gk,"isElement");function mT(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return mT(Jf.call(t,0,e.maxStringLength),e)+n}var i=tk[e.quoteStyle||"single"];i.lastIndex=0;var a=Bn.call(Bn.call(t,i,"\\$1"),/[\x00-\x1f]/g,yk);return dT(a,"single",e)}o(mT,"inspectString");function yk(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":"")+QU.call(e.toString(16))}o(yk,"lowbyte");function Us(t){return"Object("+t+")"}o(Us,"markBoxed");function qf(t){return t+" { ? }"}o(qf,"weakCollectionOf");function aT(t,e,r,n){var i=n?Wf(r,n):Gr.call(r,", ");return t+" ("+e+") {"+i+"}"}o(aT,"collectionOf");function vk(t){for(var e=0;e<t.length;e++)if(fT(t[e],`
56
- `)>=0)return!1;return!0}o(vk,"singleLineValues");function _k(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Gr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Gr.call(Array(e+1),r)}}o(_k,"getIndent");function Wf(t,e){if(t.length===0)return"";var r=`
57
- `+e.prev+e.base;return r+Gr.call(t,","+r)+`
58
- `+e.prev}o(Wf,"indentedJoin");function _c(t,e){var r=Hf(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=gn(t,i)?e(t[i],t):""}var a=typeof Lf=="function"?Lf(t):[],f;if(wi){f={};for(var m=0;m<a.length;m++)f["$"+a[m]]=a[m]}for(var h in t)gn(t,h)&&(r&&String(Number(h))===h&&h<t.length||wi&&f["$"+h]instanceof Symbol||(uT.call(/[^\w$]/,h)?n.push(e(h,t)+": "+e(t[h],t)):n.push(h+": "+e(t[h],t))));if(typeof Lf=="function")for(var _=0;_<a.length;_++)cT.call(t,a[_])&&n.push("["+e(a[_])+"]: "+e(t[a[_]],t));return n}o(_c,"arrObjKeys")});var yT=M((KX,gT)=>{"use strict";var Pk=Fs(),wk=Cn(),xc=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"),xk=o(function(t,e){if(t){var r=xc(t,e);return r&&r.value}},"listGet"),Sk=o(function(t,e,r){var n=xc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),Tk=o(function(t,e){return t?!!xc(t,e):!1},"listHas"),Ek=o(function(t,e){if(t)return xc(t,e,!0)},"listDelete");gT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new wk("Side channel does not contain "+Pk(n))},"assert"),delete:o(function(n){var i=Ek(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return xk(e,n)},"get"),has:o(function(n){return Tk(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),Sk(e,n,i)},"set")};return r},"getSideChannelList")});var Yf=M((YX,PT)=>{"use strict";var vT=ns(),_T=ld(),bk=_T([vT("%String.prototype.indexOf%")]);PT.exports=o(function(e,r){var n=vT(e,!!r);return typeof n=="function"&&bk(e,".prototype.")>-1?_T([n]):n},"callBoundIntrinsic")});var Xf=M((QX,xT)=>{"use strict";var Ak=ns(),Ls=Yf(),Ik=Fs(),Rk=Cn(),wT=Ak("%Map%",!0),$k=Ls("Map.prototype.get",!0),Ok=Ls("Map.prototype.set",!0),Dk=Ls("Map.prototype.has",!0),Ck=Ls("Map.prototype.delete",!0),Nk=Ls("Map.prototype.size",!0);xT.exports=!!wT&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new Rk("Side channel does not contain "+Ik(n))},"assert"),delete:o(function(n){if(e){var i=Ck(e,n);return Nk(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return $k(e,n)},"get"),has:o(function(n){return e?Dk(e,n):!1},"has"),set:o(function(n,i){e||(e=new wT),Ok(e,n,i)},"set")};return r},"getSideChannelMap")});var TT=M((t7,ST)=>{"use strict";var zk=ns(),Tc=Yf(),Uk=Fs(),Sc=Xf(),kk=Cn(),xi=zk("%WeakMap%",!0),jk=Tc("WeakMap.prototype.get",!0),Mk=Tc("WeakMap.prototype.set",!0),Fk=Tc("WeakMap.prototype.has",!0),Lk=Tc("WeakMap.prototype.delete",!0);ST.exports=xi?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new kk("Side channel does not contain "+Uk(i))},"assert"),delete:o(function(i){if(xi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return Lk(e,i)}else if(Sc&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return xi&&i&&(typeof i=="object"||typeof i=="function")&&e?jk(e,i):r&&r.get(i)},"get"),has:o(function(i){return xi&&i&&(typeof i=="object"||typeof i=="function")&&e?Fk(e,i):!!r&&r.has(i)},"has"),set:o(function(i,a){xi&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new xi),Mk(e,i,a)):Sc&&(r||(r=Sc()),r.set(i,a))},"set")};return n},"getSideChannelWeakMap"):Sc});var Qf=M((n7,ET)=>{"use strict";var qk=Cn(),Bk=Fs(),Vk=yT(),Gk=Xf(),Hk=TT(),Wk=Hk||Gk||Vk;ET.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new qk("Side channel does not contain "+Bk(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=Wk()),e.set(n,i)},"set")};return r},"getSideChannel")});var Ec=M((i7,bT)=>{"use strict";var Zk=String.prototype.replace,Kk=/%20/g,em={RFC1738:"RFC1738",RFC3986:"RFC3986"};bT.exports={default:em.RFC3986,formatters:{RFC1738:o(function(t){return Zk.call(t,Kk,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:em.RFC1738,RFC3986:em.RFC3986}});var om=M((a7,AT)=>{"use strict";var Jk=Ec(),Yk=Qf(),tm=Object.prototype.hasOwnProperty,vo=Array.isArray,bc=Yk(),Si=o(function(e,r){return bc.set(e,r),e},"markOverflow"),_o=o(function(e){return bc.has(e)},"isOverflow"),qs=o(function(e){return bc.get(e)},"getMaxIndex"),nm=o(function(e,r){bc.set(e,r)},"setMaxIndex"),Hr=function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t}(),Xk=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(vo(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&(i[i.length]=n[a]);r.obj[r.prop]=i}}},"compactQueue"),Bs=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"),Qk=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(vo(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return Si(Bs(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(_o(e)){var a=qs(e)+1;e[a]=r,nm(e,a)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!tm.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(_o(r)){for(var f=Object.keys(r),m=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},h=0;h<f.length;h++){var _=parseInt(f[h],10);m[_+1]=r[f[h]]}return Si(m,qs(r)+1)}var P=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&P.length>n.arrayLimit?Si(Bs(P,n),P.length-1):P}var E=e;return vo(e)&&!vo(r)&&(E=Bs(e,n)),vo(e)&&vo(r)?(r.forEach(function(S,w){if(tm.call(e,w)){var T=e[w];T&&typeof T=="object"&&S&&typeof S=="object"?e[w]=t(T,S,n):e[e.length]=S}else e[w]=S}),e):Object.keys(r).reduce(function(S,w){var T=r[w];if(tm.call(S,w)?S[w]=t(S[w],T,n):S[w]=T,_o(r)&&!_o(S)&&Si(S,qs(r)),_o(S)){var $=parseInt(w,10);String($)===w&&$>=0&&$>qs(S)&&nm(S,$)}return S},E)},"merge"),e1=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),t1=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"),rm=1024,r1=o(function(e,r,n,i,a){if(e.length===0)return e;var f=e;if(typeof e=="symbol"?f=Symbol.prototype.toString.call(e):typeof e!="string"&&(f=String(e)),n==="iso-8859-1")return escape(f).replace(/%u[0-9a-f]{4}/gi,function(w){return"%26%23"+parseInt(w.slice(2),16)+"%3B"});for(var m="",h=0;h<f.length;h+=rm){for(var _=f.length>=rm?f.slice(h,h+rm):f,P=[],E=0;E<_.length;++E){var S=_.charCodeAt(E);if(S===45||S===46||S===95||S===126||S>=48&&S<=57||S>=65&&S<=90||S>=97&&S<=122||a===Jk.RFC1738&&(S===40||S===41)){P[P.length]=_.charAt(E);continue}if(S<128){P[P.length]=Hr[S];continue}if(S<2048){P[P.length]=Hr[192|S>>6]+Hr[128|S&63];continue}if(S<55296||S>=57344){P[P.length]=Hr[224|S>>12]+Hr[128|S>>6&63]+Hr[128|S&63];continue}E+=1,S=65536+((S&1023)<<10|_.charCodeAt(E)&1023),P[P.length]=Hr[240|S>>18]+Hr[128|S>>12&63]+Hr[128|S>>6&63]+Hr[128|S&63]}m+=P.join("")}return m},"encode"),n1=o(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var a=r[i],f=a.obj[a.prop],m=Object.keys(f),h=0;h<m.length;++h){var _=m[h],P=f[_];typeof P=="object"&&P!==null&&n.indexOf(P)===-1&&(r[r.length]={obj:f,prop:_},n[n.length]=P)}return Xk(r),e},"compact"),o1=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),i1=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),s1=o(function(e,r,n,i){if(_o(e)){var a=qs(e)+1;return e[a]=r,nm(e,a),e}var f=[].concat(e,r);return f.length>n?Si(Bs(f,{plainObjects:i}),f.length-1):f},"combine"),a1=o(function(e,r){if(vo(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");AT.exports={arrayToObject:Bs,assign:e1,combine:s1,compact:n1,decode:t1,encode:r1,isBuffer:i1,isOverflow:_o,isRegExp:o1,markOverflow:Si,maybeMap:a1,merge:Qk}});var CT=M((c7,DT)=>{"use strict";var RT=Qf(),Ac=om(),Vs=Ec(),u1=Object.prototype.hasOwnProperty,$T={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")},Wr=Array.isArray,c1=Array.prototype.push,OT=o(function(t,e){c1.apply(t,Wr(e)?e:[e])},"pushToArray"),l1=Date.prototype.toISOString,IT=Vs.default,vt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Ac.encode,encodeValuesOnly:!1,filter:void 0,format:IT,formatter:Vs.formatters[IT],indices:!1,serializeDate:o(function(e){return l1.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},d1=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),im={},p1=o(function t(e,r,n,i,a,f,m,h,_,P,E,S,w,T,$,b,u,p){for(var c=e,y=p,l=0,x=!1;(y=y.get(im))!==void 0&&!x;){var g=y.get(e);if(l+=1,typeof g<"u"){if(g===l)throw new RangeError("Cyclic object value");x=!0}typeof y.get(im)>"u"&&(l=0)}if(typeof P=="function"?c=P(r,c):c instanceof Date?c=w(c):n==="comma"&&Wr(c)&&(c=Ac.maybeMap(c,function(We){return We instanceof Date?w(We):We})),c===null){if(f)return _&&!b?_(r,vt.encoder,u,"key",T):r;c=""}if(d1(c)||Ac.isBuffer(c)){if(_){var re=b?r:_(r,vt.encoder,u,"key",T);return[$(re)+"="+$(_(c,vt.encoder,u,"value",T))]}return[$(r)+"="+$(String(c))]}var ee=[];if(typeof c>"u")return ee;var Te;if(n==="comma"&&Wr(c))b&&_&&(c=Ac.maybeMap(c,_)),Te=[{value:c.length>0?c.join(",")||null:void 0}];else if(Wr(P))Te=P;else{var ne=Object.keys(c);Te=E?ne.sort(E):ne}var K=h?String(r).replace(/\./g,"%2E"):String(r),Z=i&&Wr(c)&&c.length===1?K+"[]":K;if(a&&Wr(c)&&c.length===0)return Z+"[]";for(var Q=0;Q<Te.length;++Q){var X=Te[Q],ie=typeof X=="object"&&X&&typeof X.value<"u"?X.value:c[X];if(!(m&&ie===null)){var ae=S&&h?String(X).replace(/\./g,"%2E"):String(X),Ie=Wr(c)?typeof n=="function"?n(Z,ae):Z:Z+(S?"."+ae:"["+ae+"]");p.set(e,l);var De=RT();De.set(im,p),OT(ee,t(ie,Ie,n,i,a,f,m,h,n==="comma"&&b&&Wr(c)?null:_,P,E,S,w,T,$,b,u,De))}}return ee},"stringify"),f1=o(function(e){if(!e)return vt;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||vt.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=Vs.default;if(typeof e.format<"u"){if(!u1.call(Vs.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Vs.formatters[n],a=vt.filter;(typeof e.filter=="function"||Wr(e.filter))&&(a=e.filter);var f;if(e.arrayFormat in $T?f=e.arrayFormat:"indices"in e?f=e.indices?"indices":"repeat":f=vt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var m=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:vt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:vt.addQueryPrefix,allowDots:m,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:vt.allowEmptyArrays,arrayFormat:f,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:vt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?vt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:vt.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:vt.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:vt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:vt.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:vt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:vt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:vt.strictNullHandling}},"normalizeStringifyOptions");DT.exports=function(t,e){var r=t,n=f1(e),i,a;typeof n.filter=="function"?(a=n.filter,r=a("",r)):Wr(n.filter)&&(a=n.filter,i=a);var f=[];if(typeof r!="object"||r===null)return"";var m=$T[n.arrayFormat],h=m==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var _=RT(),P=0;P<i.length;++P){var E=i[P],S=r[E];n.skipNulls&&S===null||OT(f,p1(S,E,m,h,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,_))}var w=f.join(n.delimiter),T=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?T+="utf8=%26%2310003%3B&":T+="utf8=%E2%9C%93&"),w.length>0?T+w:""}});var UT=M((d7,zT)=>{"use strict";var Zr=om(),Ic=Object.prototype.hasOwnProperty,sm=Array.isArray,it={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Zr.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},m1=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),NT=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"),h1="utf8=%26%2310003%3B",g1="utf8=%E2%9C%93",y1=o(function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=r.parameterLimit===1/0?void 0:r.parameterLimit,f=i.split(r.delimiter,r.throwOnLimitExceeded&&typeof a<"u"?a+1:a);if(r.throwOnLimitExceeded&&typeof a<"u"&&f.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(a===1?"":"s")+" allowed.");var m=-1,h,_=r.charset;if(r.charsetSentinel)for(h=0;h<f.length;++h)f[h].indexOf("utf8=")===0&&(f[h]===g1?_="utf-8":f[h]===h1&&(_="iso-8859-1"),m=h,h=f.length);for(h=0;h<f.length;++h)if(h!==m){var P=f[h],E=P.indexOf("]="),S=E===-1?P.indexOf("="):E+1,w,T;if(S===-1?(w=r.decoder(P,it.decoder,_,"key"),T=r.strictNullHandling?null:""):(w=r.decoder(P.slice(0,S),it.decoder,_,"key"),w!==null&&(T=Zr.maybeMap(NT(P.slice(S+1),r,sm(n[w])?n[w].length:0),function(b){return r.decoder(b,it.decoder,_,"value")}))),T&&r.interpretNumericEntities&&_==="iso-8859-1"&&(T=m1(String(T))),P.indexOf("[]=")>-1&&(T=sm(T)?[T]:T),r.comma&&sm(T)&&T.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");T=Zr.combine([],T,r.arrayLimit,r.plainObjects)}if(w!==null){var $=Ic.call(n,w);$&&(r.duplicates==="combine"||P.indexOf("[]=")>-1)?n[w]=Zr.combine(n[w],T,r.arrayLimit,r.plainObjects):(!$||r.duplicates==="last")&&(n[w]=T)}}return n},"parseQueryStringValues"),v1=o(function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var a=t.slice(0,-1).join("");i=Array.isArray(e)&&e[a]?e[a].length:0}for(var f=n?e:NT(e,r,i),m=t.length-1;m>=0;--m){var h,_=t[m];if(_==="[]"&&r.parseArrays)Zr.isOverflow(f)?h=f:h=r.allowEmptyArrays&&(f===""||r.strictNullHandling&&f===null)?[]:Zr.combine([],f,r.arrayLimit,r.plainObjects);else{h=r.plainObjects?{__proto__:null}:{};var P=_.charAt(0)==="["&&_.charAt(_.length-1)==="]"?_.slice(1,-1):_,E=r.decodeDotInKeys?P.replace(/%2E/g,"."):P,S=parseInt(E,10),w=!isNaN(S)&&_!==E&&String(S)===E&&S>=0&&r.parseArrays;if(!r.parseArrays&&E==="")h={0:f};else if(w&&S<r.arrayLimit)h=[],h[S]=f;else{if(w&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");w?(h[S]=f,Zr.markOverflow(h,S)):E!=="__proto__"&&(h[E]=f)}}f=h}return f},"parseObject"),_1=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&Ic.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,f=i.exec(n),m=f?n.slice(0,f.index):n,h=[];if(m){if(!r.plainObjects&&Ic.call(Object.prototype,m)&&!r.allowPrototypes)return;h[h.length]=m}for(var _=0;(f=a.exec(n))!==null&&_<r.depth;){_+=1;var P=f[1].slice(1,-1);if(!r.plainObjects&&Ic.call(Object.prototype,P)&&!r.allowPrototypes)return;h[h.length]=f[1]}if(f){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");h[h.length]="["+n.slice(f.index)+"]"}return h},"splitKeyIntoSegments"),P1=o(function(e,r,n,i){if(e){var a=_1(e,n);if(a)return v1(a,r,n,i)}},"parseQueryStringKeys"),w1=o(function(e){if(!e)return it;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"?it.charset:e.charset,n=typeof e.duplicates>"u"?it.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:it.allowDots:!!e.allowDots;return{allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:it.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:it.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:it.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:it.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:it.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:it.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:it.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:it.decoder,delimiter:typeof e.delimiter=="string"||Zr.isRegExp(e.delimiter)?e.delimiter:it.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:it.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:it.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:it.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:it.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:it.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:it.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:it.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");zT.exports=function(t,e){var r=w1(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?y1(t,r):t,i=r.plainObjects?{__proto__:null}:{},a=Object.keys(n),f=0;f<a.length;++f){var m=a[f],h=P1(m,n[m],r,typeof t=="string");i=Zr.merge(i,h,r)}return r.allowSparse===!0?i:Zr.compact(i)}});var am=M((f7,kT)=>{"use strict";var x1=CT(),S1=UT(),T1=Ec();kT.exports={formats:T1,parse:S1,stringify:x1}});var MT=M((um,jT)=>{(function(t,e){typeof um=="object"?jT.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(um,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 a=e[n],f=[];if(this.isDefined(a)&&a!=="")if(typeof a=="string"||typeof a=="number"||typeof a=="boolean")a=a.toString(),i&&i!=="*"&&(a=a.substring(0,parseInt(i,10))),f.push(this.encodeValue(r,a,this.isKeyOperator(r)?n:null));else if(i==="*")Array.isArray(a)?a.filter(this.isDefined).forEach(function(h){f.push(this.encodeValue(r,h,this.isKeyOperator(r)?n:null))},this):Object.keys(a).forEach(function(h){this.isDefined(a[h])&&f.push(this.encodeValue(r,a[h],h))},this);else{var m=[];Array.isArray(a)?a.filter(this.isDefined).forEach(function(h){m.push(this.encodeValue(r,h))},this):Object.keys(a).forEach(function(h){this.isDefined(a[h])&&(m.push(this.encodeUnreserved(h)),m.push(this.encodeValue(r,a[h].toString())))},this),this.isKeyOperator(r)?f.push(this.encodeUnreserved(n)+"="+m.join(",")):m.length!==0&&f.push(m.join(","))}else r===";"?this.isDefined(a)&&f.push(this.encodeUnreserved(n)):a===""&&(r==="&"||r==="?")?f.push(this.encodeUnreserved(n)+"="):a===""&&f.push("");return f},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:o(function(i){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(a,f,m){if(f){var h=null,_=[];if(n.indexOf(f.charAt(0))!==-1&&(h=f.charAt(0),f=f.substr(1)),f.split(/,/g).forEach(function(E){var S=/([^:\*]*)(?::(\d+)|(\*))?/.exec(E);_.push.apply(_,r.getValues(i,h,S[1],S[2]||S[3]))}),h&&h!=="+"){var P=",";return h==="?"?P="&":h!=="#"&&(P=h),(_.length!==0?h:"")+_.join(P)}else return _.join(",")}else return r.encodeReserved(m)})},"expand")}},new t})});var FT=M(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.isBrowser=E1;function E1(){return typeof window<"u"}o(E1,"isBrowser")});var $c=M(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.headersToClassicHeaders=LT;Rc.marshallGaxiosResponse=b1;function LT(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(LT,"headersToClassicHeaders");function b1(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:LT(t?.headers)}})}o(b1,"marshallGaxiosResponse")});var VT=M(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.sessions=void 0;nr.request=M1;nr.closeSession=lm;var BT=require("http2"),A1=require("zlib"),I1=require("url"),R1=am(),$1=os(),O1=require("stream"),D1=require("util"),C1=require("process"),N1=$c(),{HTTP2_HEADER_CONTENT_ENCODING:z1,HTTP2_HEADER_CONTENT_TYPE:qT,HTTP2_HEADER_METHOD:U1,HTTP2_HEADER_PATH:k1,HTTP2_HEADER_STATUS:j1}=BT.constants,Gs=!!C1.env.HTTP2_DEBUG;nr.sessions={};async function M1(t){let e=$1(!0,{},t);e.validateStatus=e.validateStatus||F1,e.responseType=e.responseType||"json";let r=new I1.URL(e.url),n=L1(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let E=(t.paramsSerializer||R1.stringify)(e.params);i+=`?${E}`}let a=(0,N1.headersToClassicHeaders)(e.headers);a[k1]=i,a[U1]=t.method||"GET",e.headers=a,a[qT]||e.responseType!=="text"&&(a[qT]="application/json");let f={config:t,headers:{},status:0,data:{},statusText:""},m=[],h=n.session,_;return new Promise((P,E)=>{try{_=h.request(a).on("response",S=>{Object.assign(f,{headers:S,status:S[j1]});let w=_;if(S[z1]==="gzip"&&(w=_.pipe(A1.createGunzip())),e.responseType==="stream"){f.data=w,P(f);return}w.on("data",T=>{m.push(T)}).on("error",T=>{E(T)}).on("end",()=>{let T=Buffer.concat(m),$=T;if(T){if(e.responseType==="json")try{$=JSON.parse(T.toString("utf8"))}catch{$=T.toString("utf8")}else e.responseType==="text"?$=T.toString("utf8"):e.responseType==="arraybuffer"&&($=T.buffer);f.data=$}if(!e.validateStatus(f.status)){let b=`Request failed with status code ${f.status}. `;if(f.data&&typeof f.data=="object"){let u=D1.inspect(f.data,{depth:5});b=`${b}
59
- '${u}`}E(new Error(b,{cause:f}))}P(f)})}).on("error",S=>{E(S)})}catch(S){lm(r).then(()=>E(S)).catch(E);return}if(f.request=_,t.data){if(t.data instanceof O1.Stream)t.data.pipe(_);else if(typeof t.data=="string"){let S=Buffer.from(t.data);_.end(S)}else if(typeof t.data=="object"){let S=JSON.stringify(t.data);_.end(S)}}n.timeoutHandle=setTimeout(()=>lm(r),500)})}o(M1,"request");function F1(t){return t>=200&&t<300}o(F1,"validateStatus");function L1(t){if(nr.sessions[t])Gs&&console.log(`Used cached client for ${t}`);else{Gs&&console.log(`Creating client for ${t}`);let e=BT.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete nr.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete nr.sessions[t]}),nr.sessions[t]={session:e}}return nr.sessions[t]}o(L1,"_getClient");async function lm(t){let e=nr.sessions[t.host];if(!e)return;let{session:r}=e;delete nr.sessions[t.host],Gs&&console.error(`Closing ${t.host}`),r.close(()=>{Gs&&console.error(`Closed ${t.host}`)}),setTimeout(()=>{r&&!r.destroyed&&(Gs&&console.log(`Forcing close ${t.host}`),r&&r.destroy())},1e3)}o(lm,"closeSession")});var GT=M((w7,q1)=>{q1.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 Oc=M(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.createAPIRequest=W1;var dm=pt(),B1=am(),JT=require("stream"),HT=MT(),WT=os(),fm=FT(),V1=VT(),pm=$c(),YT=GT(),ZT=o(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function G1(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}o(G1,"isReadableStream");function H1(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}o(H1,"getMissingParams");function W1(t,e){if(e)KT(t).then(r=>e(null,r),e);else return KT(t)}o(W1,"createAPIRequest");async function KT(t){let e=WT(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=WT(!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 a=r.auth||e.auth,f=typeof n.body=="string"?"text/plain":"application/octet-stream";delete r.media,delete r.auth;let m=(0,pm.headersToClassicHeaders)(r.headers||{});Z1(m,e.apiVersion),delete r.headers,Object.keys(r).forEach(w=>{if(w.slice(-1)==="_"){let T=w.slice(0,-1);r[T]=r[w],delete r[w]}});let h=H1(r,t.requiredParams);if(h)throw new Error("Missing required parameters: "+h.join(", "));if(e.url){let w=e.url;typeof w=="object"&&(w=w.toString()),e.url=HT.parse(w).expand(r)}if(t.mediaUrl&&(t.mediaUrl=HT.parse(t.mediaUrl).expand(r)),t.context._options.rootUrl!==void 0&&e.url!==void 0){let w=new URL(e.url),T=w.href.substr(w.origin.length);e.url=new URL(T,t.context._options.rootUrl).href}e.paramsSerializer=w=>B1.stringify(w,{arrayFormat:"repeat"}),t.pathParams.forEach(w=>delete r[w]),typeof a=="string"&&(r.key=r.key||a,a=void 0);function _(w){let T=ZT(),$=`--${T}--`,b=new JT.PassThrough({flush(c){this.push(`\r
60
- `),this.push($),c()}}),u=new mm,p=G1(w[1].body);m["content-type"]=`multipart/related; boundary=${T}`;for(let c of w){let y=`--${T}\r
55
+ https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var Uf=class{static{i(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($r.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===$r.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($r.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 Ua.universe("universe-domain"),e||=zf.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=zf.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,QT.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=zf.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(o=>r(null,o.credential,o.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 bo.JWT?r.scopes=this.scopes:r instanceof Ma.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof bo.JWT?r.scopes=this.scopes:r instanceof Ma.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new BM.Compute(e));throw new Error($r.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=Ua.getGCPResidency()||await Ua.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 o=process.env.HOME;o&&(r=kf.join(o,".config"))}return r&&(r=kf.join(r,"gcloud","application_default_credentials.json"),za.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=za.realpathSync(e),!za.lstatSync(e).isFile())throw new Error}catch(o){throw o instanceof Error&&(o.message=`The file at ${e} does not exist, or it is not a file. ${o.message}`),o}let n=za.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!==To.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${To.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 o=(this.scopes||e.scopes||this.defaultScopes)??[];return new To.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(o)?o:[o]})}fromJSON(e,r={}){let n,o=(0,QT.originalOrCamelOptions)(r).get("universe_domain");return e.type===YT.USER_REFRESH_ACCOUNT_TYPE?(n=new YT.UserRefreshClient(r),n.fromJSON(e)):e.type===To.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===Ma.EXTERNAL_ACCOUNT_TYPE?(n=HM.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===XT.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new XT.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new bo.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),o&&(n.universeDomain=o),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let o={};if(typeof r=="function"?n=r:o=r,n)this.fromStreamAsync(e,o).then(s=>n(null,s),n);else return this.fromStreamAsync(e,o)}fromStreamAsync(e,r){return new Promise((n,o)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",o).on("data",p=>s.push(p)).on("end",()=>{try{try{let p=JSON.parse(s.join("")),m=this._cacheClientFromJSON(p,r);return n(m)}catch(p){if(!this.keyFilename)throw p;let m=new bo.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=m,this.setGapicJWTValues(m),n(m)}}catch(p){return o(p)}})})}fromAPIKey(e,r={}){return new bo.JWT({...r,apiKey:e})}_isWindows(){let e=jM.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,FM.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n)try{let o=JSON.parse(n).configuration.properties.core.project;e(o);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!==Ma.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await Ua.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 To.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof Ma.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([Ua.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error($r.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=kf.resolve(this.keyFilename),r=za.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 VM.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,o=await(await this.getClient()).getRequestHeaders(r);return e.headers=LM.Gaxios.mergeHeaders(e.headers,o),e}async fetch(...e){return(await this.getClient()).fetch(...e)}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,GM.getEnv)()}async sign(e,r){let n=await this.getClient(),o=await this.getUniverseDomain();if(r=r||`https://iamcredentials.${o}/v1/projects/-/serviceAccounts/`,n instanceof To.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,qM.createCrypto)();if(n instanceof bo.JWT&&n.key)return await s.sign(n.key,e);let p=await this.getCredentials();if(!p.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,p.client_email,e,r)}async signBlob(e,r,n,o){let s=new URL(o+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};$r.GoogleAuth=Uf});var tS=L(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.IAMAuth=void 0;var Mf=class{static{i(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}}};Pc.IAMAuth=Mf});var rS=L(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.DownscopedClient=Zr.EXPIRATION_TIME_OFFSET=Zr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var WM=mt(),ZM=require("stream"),Ff=tr(),KM=ec(),JM="urn:ietf:params:oauth:grant-type:token-exchange",YM="urn:ietf:params:oauth:token-type:access_token",XM="urn:ietf:params:oauth:token-type:access_token";Zr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Zr.EXPIRATION_TIME_OFFSET=300*1e3;var Lf=class extends Ff.AuthClient{static{i(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Ff.AuthClient?{}:e),e instanceof Ff.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>Zr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Zr.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 KM.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 o=await this.getRequestHeaders();e.headers=WM.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,o),n=await this.transporter.request(e)}catch(o){let s=o.response;if(s){let p=s.status,m=s.config.data instanceof ZM.Readable;if(!r&&(p===401||p===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw o}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:JM,requestedTokenType:YM,subjectToken:e,subjectTokenType:XM},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),o=this.authClient.credentials?.expiry_date||null,s=n.expires_in?new Date().getTime()+n.expires_in*1e3:o;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}};Zr.DownscopedClient=Lf});var nS=L(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.PassThroughClient=void 0;var QM=tr(),jf=class extends QM.AuthClient{static{i(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};wc.PassThroughClient=jf});var Fa=L(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.GoogleAuth=me.auth=me.PassThroughClient=me.ExternalAccountAuthorizedUserClient=me.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=me.ExecutableError=me.PluggableAuthClient=me.DownscopedClient=me.BaseExternalAccountClient=me.ExternalAccountClient=me.IdentityPoolClient=me.AwsRequestSigner=me.AwsClient=me.UserRefreshClient=me.LoginTicket=me.ClientAuthentication=me.OAuth2Client=me.CodeChallengeMethod=me.Impersonated=me.JWT=me.JWTAccess=me.IdTokenClient=me.IAMAuth=me.GCPEnv=me.Compute=me.DEFAULT_UNIVERSE=me.AuthClient=me.gaxios=me.gcpMetadata=void 0;var iS=eS();Object.defineProperty(me,"GoogleAuth",{enumerable:!0,get:i(function(){return iS.GoogleAuth},"get")});me.gcpMetadata=ba();me.gaxios=mt();var oS=tr();Object.defineProperty(me,"AuthClient",{enumerable:!0,get:i(function(){return oS.AuthClient},"get")});Object.defineProperty(me,"DEFAULT_UNIVERSE",{enumerable:!0,get:i(function(){return oS.DEFAULT_UNIVERSE},"get")});var eF=Ip();Object.defineProperty(me,"Compute",{enumerable:!0,get:i(function(){return eF.Compute},"get")});var tF=Dp();Object.defineProperty(me,"GCPEnv",{enumerable:!0,get:i(function(){return tF.GCPEnv},"get")});var rF=tS();Object.defineProperty(me,"IAMAuth",{enumerable:!0,get:i(function(){return rF.IAMAuth},"get")});var nF=Rp();Object.defineProperty(me,"IdTokenClient",{enumerable:!0,get:i(function(){return nF.IdTokenClient},"get")});var iF=Wp();Object.defineProperty(me,"JWTAccess",{enumerable:!0,get:i(function(){return iF.JWTAccess},"get")});var oF=Kp();Object.defineProperty(me,"JWT",{enumerable:!0,get:i(function(){return oF.JWT},"get")});var aF=Qp();Object.defineProperty(me,"Impersonated",{enumerable:!0,get:i(function(){return aF.Impersonated},"get")});var qf=_i();Object.defineProperty(me,"CodeChallengeMethod",{enumerable:!0,get:i(function(){return qf.CodeChallengeMethod},"get")});Object.defineProperty(me,"OAuth2Client",{enumerable:!0,get:i(function(){return qf.OAuth2Client},"get")});Object.defineProperty(me,"ClientAuthentication",{enumerable:!0,get:i(function(){return qf.ClientAuthentication},"get")});var sF=Tp();Object.defineProperty(me,"LoginTicket",{enumerable:!0,get:i(function(){return sF.LoginTicket},"get")});var uF=Yp();Object.defineProperty(me,"UserRefreshClient",{enumerable:!0,get:i(function(){return uF.UserRefreshClient},"get")});var cF=_f();Object.defineProperty(me,"AwsClient",{enumerable:!0,get:i(function(){return cF.AwsClient},"get")});var lF=gf();Object.defineProperty(me,"AwsRequestSigner",{enumerable:!0,get:i(function(){return lF.AwsRequestSigner},"get")});var dF=mf();Object.defineProperty(me,"IdentityPoolClient",{enumerable:!0,get:i(function(){return dF.IdentityPoolClient},"get")});var pF=$f();Object.defineProperty(me,"ExternalAccountClient",{enumerable:!0,get:i(function(){return pF.ExternalAccountClient},"get")});var fF=Kn();Object.defineProperty(me,"BaseExternalAccountClient",{enumerable:!0,get:i(function(){return fF.BaseExternalAccountClient},"get")});var mF=rS();Object.defineProperty(me,"DownscopedClient",{enumerable:!0,get:i(function(){return mF.DownscopedClient},"get")});var aS=Rf();Object.defineProperty(me,"PluggableAuthClient",{enumerable:!0,get:i(function(){return aS.PluggableAuthClient},"get")});Object.defineProperty(me,"ExecutableError",{enumerable:!0,get:i(function(){return aS.ExecutableError},"get")});var sS=Nf();Object.defineProperty(me,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:i(function(){return sS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(me,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:i(function(){return sS.ExternalAccountAuthorizedUserClient},"get")});var hF=nS();Object.defineProperty(me,"PassThroughClient",{enumerable:!0,get:i(function(){return hF.PassThroughClient},"get")});var gF=new iS.GoogleAuth;me.auth=gF});var cS=L(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});Bf.getAPI=yF;function yF(t,e,r,n){let o;if(typeof e=="string")o=e,e={};else if(typeof e=="object")o=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[o],p=new s(e,n);return Object.freeze(p)}catch(s){throw new Error(`Unable to load endpoint ${t}("${o}"): ${s.message}`)}}i(yF,"getAPI")});var dS=L((bee,lS)=>{lS.exports=require("util").inspect});var Va=L((Tee,$S)=>{var Qf=typeof Map=="function"&&Map.prototype,Vf=Object.getOwnPropertyDescriptor&&Qf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Sc=Qf&&Vf&&typeof Vf.get=="function"?Vf.get:null,pS=Qf&&Map.prototype.forEach,em=typeof Set=="function"&&Set.prototype,Gf=Object.getOwnPropertyDescriptor&&em?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,xc=em&&Gf&&typeof Gf.get=="function"?Gf.get:null,fS=em&&Set.prototype.forEach,vF=typeof WeakMap=="function"&&WeakMap.prototype,ja=vF?WeakMap.prototype.has:null,_F=typeof WeakSet=="function"&&WeakSet.prototype,qa=_F?WeakSet.prototype.has:null,PF=typeof WeakRef=="function"&&WeakRef.prototype,mS=PF?WeakRef.prototype.deref:null,wF=Boolean.prototype.valueOf,bF=Object.prototype.toString,TF=Function.prototype.toString,SF=String.prototype.match,tm=String.prototype.slice,Jn=String.prototype.replace,xF=String.prototype.toUpperCase,hS=String.prototype.toLowerCase,SS=RegExp.prototype.test,gS=Array.prototype.concat,Kr=Array.prototype.join,EF=Array.prototype.slice,yS=Math.floor,Zf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Hf=Object.getOwnPropertySymbols,Kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,So=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ba=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===So||!0)?Symbol.toStringTag:null,xS=Object.prototype.propertyIsEnumerable,vS=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function _S(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||SS.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-yS(-t):yS(t);if(n!==t){var o=String(n),s=tm.call(e,o.length+1);return Jn.call(o,r,"$&_")+"."+Jn.call(Jn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Jn.call(e,r,"$&_")}i(_S,"addNumericSeparator");var Jf=dS(),PS=Jf.custom,wS=AS(PS)?PS:null,ES={__proto__:null,double:'"',single:"'"},IF={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};$S.exports=i(function t(e,r,n,o){var s=r||{};if(Pn(s,"quoteStyle")&&!Pn(ES,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Pn(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 p=Pn(s,"customInspect")?s.customInspect:!0;if(typeof p!="boolean"&&p!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Pn(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(Pn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var m=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 DS(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var h=String(e);return m?_S(e,h):h}if(typeof e=="bigint"){var v=String(e)+"n";return m?_S(e,v):v}var P=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=P&&P>0&&typeof e=="object")return Yf(e)?"[Array]":"[Object]";var x=GF(s,n);if(typeof o>"u")o=[];else if(RS(o,e)>=0)return"[Circular]";function T(K,re,te){if(re&&(o=EF.call(o),o.push(re)),te){var ce={depth:s.depth};return Pn(s,"quoteStyle")&&(ce.quoteStyle=s.quoteStyle),t(K,ce,n+1,o)}return t(K,s,n+1,o)}if(i(T,"inspect"),typeof e=="function"&&!bS(e)){var w=zF(e),S=Tc(e,T);return"[Function"+(w?": "+w:" (anonymous)")+"]"+(S.length>0?" { "+Kr.call(S,", ")+" }":"")}if(AS(e)){var D=So?Jn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Kf.call(e);return typeof e=="object"&&!So?La(D):D}if(qF(e)){for(var E="<"+hS.call(String(e.nodeName)),u=e.attributes||[],f=0;f<u.length;f++)E+=" "+u[f].name+"="+IS(AF(u[f].value),"double",s);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+hS.call(String(e.nodeName))+">",E}if(Yf(e)){if(e.length===0)return"[]";var c=Tc(e,T);return x&&!VF(c)?"["+Xf(c,x)+"]":"[ "+Kr.call(c,", ")+" ]"}if(DF(e)){var y=Tc(e,T);return!("cause"in Error.prototype)&&"cause"in e&&!xS.call(e,"cause")?"{ ["+String(e)+"] "+Kr.call(gS.call("[cause]: "+T(e.cause),y),", ")+" }":y.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Kr.call(y,", ")+" }"}if(typeof e=="object"&&p){if(wS&&typeof e[wS]=="function"&&Jf)return Jf(e,{depth:P-n});if(p!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(UF(e)){var l=[];return pS&&pS.call(e,function(K,re){l.push(T(re,e,!0)+" => "+T(K,e))}),TS("Map",Sc.call(e),l,x)}if(LF(e)){var b=[];return fS&&fS.call(e,function(K){b.push(T(K,e))}),TS("Set",xc.call(e),b,x)}if(MF(e))return Wf("WeakMap");if(jF(e))return Wf("WeakSet");if(FF(e))return Wf("WeakRef");if(OF(e))return La(T(Number(e)));if(NF(e))return La(T(Zf.call(e)));if(CF(e))return La(wF.call(e));if($F(e))return La(T(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(!RF(e)&&!bS(e)){var g=Tc(e,T),oe=vS?vS(e)===Object.prototype:e instanceof Object||e.constructor===Object,ne=e instanceof Object?"":"null prototype",Re=!oe&&Ba&&Object(e)===e&&Ba in e?tm.call(Yn(e),8,-1):ne?"Object":"",se=oe||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Y=se+(Re||ne?"["+Kr.call(gS.call([],Re||[],ne||[]),": ")+"] ":"");return g.length===0?Y+"{}":x?Y+"{"+Xf(g,x)+"}":Y+"{ "+Kr.call(g,", ")+" }"}return String(e)},"inspect_");function IS(t,e,r){var n=r.quoteStyle||e,o=ES[n];return o+t+o}i(IS,"wrapQuotes");function AF(t){return Jn.call(String(t),/"/g,"&quot;")}i(AF,"quote");function wi(t){return!Ba||!(typeof t=="object"&&(Ba in t||typeof t[Ba]<"u"))}i(wi,"canTrustToString");function Yf(t){return Yn(t)==="[object Array]"&&wi(t)}i(Yf,"isArray");function RF(t){return Yn(t)==="[object Date]"&&wi(t)}i(RF,"isDate");function bS(t){return Yn(t)==="[object RegExp]"&&wi(t)}i(bS,"isRegExp");function DF(t){return Yn(t)==="[object Error]"&&wi(t)}i(DF,"isError");function $F(t){return Yn(t)==="[object String]"&&wi(t)}i($F,"isString");function OF(t){return Yn(t)==="[object Number]"&&wi(t)}i(OF,"isNumber");function CF(t){return Yn(t)==="[object Boolean]"&&wi(t)}i(CF,"isBoolean");function AS(t){if(So)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Kf)return!1;try{return Kf.call(t),!0}catch{}return!1}i(AS,"isSymbol");function NF(t){if(!t||typeof t!="object"||!Zf)return!1;try{return Zf.call(t),!0}catch{}return!1}i(NF,"isBigInt");var kF=Object.prototype.hasOwnProperty||function(t){return t in this};function Pn(t,e){return kF.call(t,e)}i(Pn,"has");function Yn(t){return bF.call(t)}i(Yn,"toStr");function zF(t){if(t.name)return t.name;var e=SF.call(TF.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}i(zF,"nameOf");function RS(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}i(RS,"indexOf");function UF(t){if(!Sc||!t||typeof t!="object")return!1;try{Sc.call(t);try{xc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}i(UF,"isMap");function MF(t){if(!ja||!t||typeof t!="object")return!1;try{ja.call(t,ja);try{qa.call(t,qa)}catch{return!0}return t instanceof WeakMap}catch{}return!1}i(MF,"isWeakMap");function FF(t){if(!mS||!t||typeof t!="object")return!1;try{return mS.call(t),!0}catch{}return!1}i(FF,"isWeakRef");function LF(t){if(!xc||!t||typeof t!="object")return!1;try{xc.call(t);try{Sc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}i(LF,"isSet");function jF(t){if(!qa||!t||typeof t!="object")return!1;try{qa.call(t,qa);try{ja.call(t,ja)}catch{return!0}return t instanceof WeakSet}catch{}return!1}i(jF,"isWeakSet");function qF(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}i(qF,"isElement");function DS(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return DS(tm.call(t,0,e.maxStringLength),e)+n}var o=IF[e.quoteStyle||"single"];o.lastIndex=0;var s=Jn.call(Jn.call(t,o,"\\$1"),/[\x00-\x1f]/g,BF);return IS(s,"single",e)}i(DS,"inspectString");function BF(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":"")+xF.call(e.toString(16))}i(BF,"lowbyte");function La(t){return"Object("+t+")"}i(La,"markBoxed");function Wf(t){return t+" { ? }"}i(Wf,"weakCollectionOf");function TS(t,e,r,n){var o=n?Xf(r,n):Kr.call(r,", ");return t+" ("+e+") {"+o+"}"}i(TS,"collectionOf");function VF(t){for(var e=0;e<t.length;e++)if(RS(t[e],`
56
+ `)>=0)return!1;return!0}i(VF,"singleLineValues");function GF(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Kr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Kr.call(Array(e+1),r)}}i(GF,"getIndent");function Xf(t,e){if(t.length===0)return"";var r=`
57
+ `+e.prev+e.base;return r+Kr.call(t,","+r)+`
58
+ `+e.prev}i(Xf,"indentedJoin");function Tc(t,e){var r=Yf(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=Pn(t,o)?e(t[o],t):""}var s=typeof Hf=="function"?Hf(t):[],p;if(So){p={};for(var m=0;m<s.length;m++)p["$"+s[m]]=s[m]}for(var h in t)Pn(t,h)&&(r&&String(Number(h))===h&&h<t.length||So&&p["$"+h]instanceof Symbol||(SS.call(/[^\w$]/,h)?n.push(e(h,t)+": "+e(t[h],t)):n.push(h+": "+e(t[h],t))));if(typeof Hf=="function")for(var v=0;v<s.length;v++)xS.call(t,s[v])&&n.push("["+e(s[v])+"]: "+e(t[s[v]],t));return n}i(Tc,"arrObjKeys")});var CS=L((xee,OS)=>{"use strict";var HF=Va(),WF=Ln(),Ec=i(function(t,e,r){for(var n=t,o;(o=n.next)!=null;n=o)if(o.key===e)return n.next=o.next,r||(o.next=t.next,t.next=o),o},"listGetNode"),ZF=i(function(t,e){if(t){var r=Ec(t,e);return r&&r.value}},"listGet"),KF=i(function(t,e,r){var n=Ec(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),JF=i(function(t,e){return t?!!Ec(t,e):!1},"listHas"),YF=i(function(t,e){if(t)return Ec(t,e,!0)},"listDelete");OS.exports=i(function(){var e,r={assert:i(function(n){if(!r.has(n))throw new WF("Side channel does not contain "+HF(n))},"assert"),delete:i(function(n){var o=YF(e,n);return o&&e&&!e.next&&(e=void 0),!!o},"delete"),get:i(function(n){return ZF(e,n)},"get"),has:i(function(n){return JF(e,n)},"has"),set:i(function(n,o){e||(e={next:void 0}),KF(e,n,o)},"set")};return r},"getSideChannelList")});var rm=L((Iee,zS)=>{"use strict";var NS=aa(),kS=hd(),XF=kS([NS("%String.prototype.indexOf%")]);zS.exports=i(function(e,r){var n=NS(e,!!r);return typeof n=="function"&&XF(e,".prototype.")>-1?kS([n]):n},"callBoundIntrinsic")});var nm=L((Ree,MS)=>{"use strict";var QF=aa(),Ga=rm(),e1=Va(),t1=Ln(),US=QF("%Map%",!0),r1=Ga("Map.prototype.get",!0),n1=Ga("Map.prototype.set",!0),i1=Ga("Map.prototype.has",!0),o1=Ga("Map.prototype.delete",!0),a1=Ga("Map.prototype.size",!0);MS.exports=!!US&&i(function(){var e,r={assert:i(function(n){if(!r.has(n))throw new t1("Side channel does not contain "+e1(n))},"assert"),delete:i(function(n){if(e){var o=o1(e,n);return a1(e)===0&&(e=void 0),o}return!1},"delete"),get:i(function(n){if(e)return r1(e,n)},"get"),has:i(function(n){return e?i1(e,n):!1},"has"),set:i(function(n,o){e||(e=new US),n1(e,n,o)},"set")};return r},"getSideChannelMap")});var LS=L(($ee,FS)=>{"use strict";var s1=aa(),Ac=rm(),u1=Va(),Ic=nm(),c1=Ln(),xo=s1("%WeakMap%",!0),l1=Ac("WeakMap.prototype.get",!0),d1=Ac("WeakMap.prototype.set",!0),p1=Ac("WeakMap.prototype.has",!0),f1=Ac("WeakMap.prototype.delete",!0);FS.exports=xo?i(function(){var e,r,n={assert:i(function(o){if(!n.has(o))throw new c1("Side channel does not contain "+u1(o))},"assert"),delete:i(function(o){if(xo&&o&&(typeof o=="object"||typeof o=="function")){if(e)return f1(e,o)}else if(Ic&&r)return r.delete(o);return!1},"delete"),get:i(function(o){return xo&&o&&(typeof o=="object"||typeof o=="function")&&e?l1(e,o):r&&r.get(o)},"get"),has:i(function(o){return xo&&o&&(typeof o=="object"||typeof o=="function")&&e?p1(e,o):!!r&&r.has(o)},"has"),set:i(function(o,s){xo&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new xo),d1(e,o,s)):Ic&&(r||(r=Ic()),r.set(o,s))},"set")};return n},"getSideChannelWeakMap"):Ic});var im=L((Cee,jS)=>{"use strict";var m1=Ln(),h1=Va(),g1=CS(),y1=nm(),v1=LS(),_1=v1||y1||g1;jS.exports=i(function(){var e,r={assert:i(function(n){if(!r.has(n))throw new m1("Side channel does not contain "+h1(n))},"assert"),delete:i(function(n){return!!e&&e.delete(n)},"delete"),get:i(function(n){return e&&e.get(n)},"get"),has:i(function(n){return!!e&&e.has(n)},"has"),set:i(function(n,o){e||(e=_1()),e.set(n,o)},"set")};return r},"getSideChannel")});var Rc=L((kee,qS)=>{"use strict";var P1=String.prototype.replace,w1=/%20/g,om={RFC1738:"RFC1738",RFC3986:"RFC3986"};qS.exports={default:om.RFC3986,formatters:{RFC1738:i(function(t){return P1.call(t,w1,"+")},"RFC1738"),RFC3986:i(function(t){return String(t)},"RFC3986")},RFC1738:om.RFC1738,RFC3986:om.RFC3986}});var cm=L((Uee,BS)=>{"use strict";var b1=Rc(),T1=im(),am=Object.prototype.hasOwnProperty,bi=Array.isArray,Dc=T1(),Eo=i(function(e,r){return Dc.set(e,r),e},"markOverflow"),Ti=i(function(e){return Dc.has(e)},"isOverflow"),Ha=i(function(e){return Dc.get(e)},"getMaxIndex"),um=i(function(e,r){Dc.set(e,r)},"setMaxIndex"),Jr=(function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t})(),S1=i(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(bi(n)){for(var o=[],s=0;s<n.length;++s)typeof n[s]<"u"&&(o[o.length]=n[s]);r.obj[r.prop]=o}}},"compactQueue"),Wa=i(function(e,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},o=0;o<e.length;++o)typeof e[o]<"u"&&(n[o]=e[o]);return n},"arrayToObject"),x1=i(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(bi(e)){var o=e.length;if(n&&typeof n.arrayLimit=="number"&&o>n.arrayLimit)return Eo(Wa(e.concat(r),n),o);e[o]=r}else if(e&&typeof e=="object")if(Ti(e)){var s=Ha(e)+1;e[s]=r,um(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!am.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(Ti(r)){for(var p=Object.keys(r),m=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},h=0;h<p.length;h++){var v=parseInt(p[h],10);m[v+1]=r[p[h]]}return Eo(m,Ha(r)+1)}var P=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&P.length>n.arrayLimit?Eo(Wa(P,n),P.length-1):P}var x=e;return bi(e)&&!bi(r)&&(x=Wa(e,n)),bi(e)&&bi(r)?(r.forEach(function(T,w){if(am.call(e,w)){var S=e[w];S&&typeof S=="object"&&T&&typeof T=="object"?e[w]=t(S,T,n):e[e.length]=T}else e[w]=T}),e):Object.keys(r).reduce(function(T,w){var S=r[w];if(am.call(T,w)?T[w]=t(T[w],S,n):T[w]=S,Ti(r)&&!Ti(T)&&Eo(T,Ha(r)),Ti(T)){var D=parseInt(w,10);String(D)===w&&D>=0&&D>Ha(T)&&um(T,D)}return T},x)},"merge"),E1=i(function(e,r){return Object.keys(r).reduce(function(n,o){return n[o]=r[o],n},e)},"assignSingleSource"),I1=i(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"),sm=1024,A1=i(function(e,r,n,o,s){if(e.length===0)return e;var p=e;if(typeof e=="symbol"?p=Symbol.prototype.toString.call(e):typeof e!="string"&&(p=String(e)),n==="iso-8859-1")return escape(p).replace(/%u[0-9a-f]{4}/gi,function(w){return"%26%23"+parseInt(w.slice(2),16)+"%3B"});for(var m="",h=0;h<p.length;h+=sm){for(var v=p.length>=sm?p.slice(h,h+sm):p,P=[],x=0;x<v.length;++x){var T=v.charCodeAt(x);if(T===45||T===46||T===95||T===126||T>=48&&T<=57||T>=65&&T<=90||T>=97&&T<=122||s===b1.RFC1738&&(T===40||T===41)){P[P.length]=v.charAt(x);continue}if(T<128){P[P.length]=Jr[T];continue}if(T<2048){P[P.length]=Jr[192|T>>6]+Jr[128|T&63];continue}if(T<55296||T>=57344){P[P.length]=Jr[224|T>>12]+Jr[128|T>>6&63]+Jr[128|T&63];continue}x+=1,T=65536+((T&1023)<<10|v.charCodeAt(x)&1023),P[P.length]=Jr[240|T>>18]+Jr[128|T>>12&63]+Jr[128|T>>6&63]+Jr[128|T&63]}m+=P.join("")}return m},"encode"),R1=i(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o<r.length;++o)for(var s=r[o],p=s.obj[s.prop],m=Object.keys(p),h=0;h<m.length;++h){var v=m[h],P=p[v];typeof P=="object"&&P!==null&&n.indexOf(P)===-1&&(r[r.length]={obj:p,prop:v},n[n.length]=P)}return S1(r),e},"compact"),D1=i(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),$1=i(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),O1=i(function(e,r,n,o){if(Ti(e)){var s=Ha(e)+1;return e[s]=r,um(e,s),e}var p=[].concat(e,r);return p.length>n?Eo(Wa(p,{plainObjects:o}),p.length-1):p},"combine"),C1=i(function(e,r){if(bi(e)){for(var n=[],o=0;o<e.length;o+=1)n[n.length]=r(e[o]);return n}return r(e)},"maybeMap");BS.exports={arrayToObject:Wa,assign:E1,combine:O1,compact:R1,decode:I1,encode:A1,isBuffer:$1,isOverflow:Ti,isRegExp:D1,markOverflow:Eo,maybeMap:C1,merge:x1}});var KS=L((Fee,ZS)=>{"use strict";var GS=im(),$c=cm(),Za=Rc(),N1=Object.prototype.hasOwnProperty,HS={brackets:i(function(e){return e+"[]"},"brackets"),comma:"comma",indices:i(function(e,r){return e+"["+r+"]"},"indices"),repeat:i(function(e){return e},"repeat")},Yr=Array.isArray,k1=Array.prototype.push,WS=i(function(t,e){k1.apply(t,Yr(e)?e:[e])},"pushToArray"),z1=Date.prototype.toISOString,VS=Za.default,bt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:$c.encode,encodeValuesOnly:!1,filter:void 0,format:VS,formatter:Za.formatters[VS],indices:!1,serializeDate:i(function(e){return z1.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},U1=i(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),lm={},M1=i(function t(e,r,n,o,s,p,m,h,v,P,x,T,w,S,D,E,u,f){for(var c=e,y=f,l=0,b=!1;(y=y.get(lm))!==void 0&&!b;){var g=y.get(e);if(l+=1,typeof g<"u"){if(g===l)throw new RangeError("Cyclic object value");b=!0}typeof y.get(lm)>"u"&&(l=0)}if(typeof P=="function"?c=P(r,c):c instanceof Date?c=w(c):n==="comma"&&Yr(c)&&(c=$c.maybeMap(c,function(Ke){return Ke instanceof Date?w(Ke):Ke})),c===null){if(p)return v&&!E?v(r,bt.encoder,u,"key",S):r;c=""}if(U1(c)||$c.isBuffer(c)){if(v){var oe=E?r:v(r,bt.encoder,u,"key",S);return[D(oe)+"="+D(v(c,bt.encoder,u,"value",S))]}return[D(r)+"="+D(String(c))]}var ne=[];if(typeof c>"u")return ne;var Re;if(n==="comma"&&Yr(c))E&&v&&(c=$c.maybeMap(c,v)),Re=[{value:c.length>0?c.join(",")||null:void 0}];else if(Yr(P))Re=P;else{var se=Object.keys(c);Re=x?se.sort(x):se}var Y=h?String(r).replace(/\./g,"%2E"):String(r),K=o&&Yr(c)&&c.length===1?Y+"[]":Y;if(s&&Yr(c)&&c.length===0)return K+"[]";for(var re=0;re<Re.length;++re){var te=Re[re],ce=typeof te=="object"&&te&&typeof te.value<"u"?te.value:c[te];if(!(m&&ce===null)){var de=T&&h?String(te).replace(/\./g,"%2E"):String(te),Oe=Yr(c)?typeof n=="function"?n(K,de):K:K+(T?"."+de:"["+de+"]");f.set(e,l);var ze=GS();ze.set(lm,f),WS(ne,t(ce,Oe,n,o,s,p,m,h,n==="comma"&&E&&Yr(c)?null:v,P,x,T,w,S,D,E,u,ze))}}return ne},"stringify"),F1=i(function(e){if(!e)return bt;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||bt.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=Za.default;if(typeof e.format<"u"){if(!N1.call(Za.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var o=Za.formatters[n],s=bt.filter;(typeof e.filter=="function"||Yr(e.filter))&&(s=e.filter);var p;if(e.arrayFormat in HS?p=e.arrayFormat:"indices"in e?p=e.indices?"indices":"repeat":p=bt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var m=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:bt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:bt.addQueryPrefix,allowDots:m,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:bt.allowEmptyArrays,arrayFormat:p,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:bt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?bt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:bt.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:bt.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:bt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:bt.encodeValuesOnly,filter:s,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:bt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:bt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:bt.strictNullHandling}},"normalizeStringifyOptions");ZS.exports=function(t,e){var r=t,n=F1(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Yr(n.filter)&&(s=n.filter,o=s);var p=[];if(typeof r!="object"||r===null)return"";var m=HS[n.arrayFormat],h=m==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var v=GS(),P=0;P<o.length;++P){var x=o[P],T=r[x];n.skipNulls&&T===null||WS(p,M1(T,x,m,h,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,v))}var w=p.join(n.delimiter),S=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?S+="utf8=%26%2310003%3B&":S+="utf8=%E2%9C%93&"),w.length>0?S+w:""}});var XS=L((jee,YS)=>{"use strict";var Xr=cm(),Oc=Object.prototype.hasOwnProperty,dm=Array.isArray,st={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Xr.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},L1=i(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),JS=i(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"),j1="utf8=%26%2310003%3B",q1="utf8=%E2%9C%93",B1=i(function(e,r){var n={__proto__:null},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,p=o.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&p.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var m=-1,h,v=r.charset;if(r.charsetSentinel)for(h=0;h<p.length;++h)p[h].indexOf("utf8=")===0&&(p[h]===q1?v="utf-8":p[h]===j1&&(v="iso-8859-1"),m=h,h=p.length);for(h=0;h<p.length;++h)if(h!==m){var P=p[h],x=P.indexOf("]="),T=x===-1?P.indexOf("="):x+1,w,S;if(T===-1?(w=r.decoder(P,st.decoder,v,"key"),S=r.strictNullHandling?null:""):(w=r.decoder(P.slice(0,T),st.decoder,v,"key"),w!==null&&(S=Xr.maybeMap(JS(P.slice(T+1),r,dm(n[w])?n[w].length:0),function(E){return r.decoder(E,st.decoder,v,"value")}))),S&&r.interpretNumericEntities&&v==="iso-8859-1"&&(S=L1(String(S))),P.indexOf("[]=")>-1&&(S=dm(S)?[S]:S),r.comma&&dm(S)&&S.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");S=Xr.combine([],S,r.arrayLimit,r.plainObjects)}if(w!==null){var D=Oc.call(n,w);D&&(r.duplicates==="combine"||P.indexOf("[]=")>-1)?n[w]=Xr.combine(n[w],S,r.arrayLimit,r.plainObjects):(!D||r.duplicates==="last")&&(n[w]=S)}}return n},"parseQueryStringValues"),V1=i(function(t,e,r,n){var o=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");o=Array.isArray(e)&&e[s]?e[s].length:0}for(var p=n?e:JS(e,r,o),m=t.length-1;m>=0;--m){var h,v=t[m];if(v==="[]"&&r.parseArrays)Xr.isOverflow(p)?h=p:h=r.allowEmptyArrays&&(p===""||r.strictNullHandling&&p===null)?[]:Xr.combine([],p,r.arrayLimit,r.plainObjects);else{h=r.plainObjects?{__proto__:null}:{};var P=v.charAt(0)==="["&&v.charAt(v.length-1)==="]"?v.slice(1,-1):v,x=r.decodeDotInKeys?P.replace(/%2E/g,"."):P,T=parseInt(x,10),w=!isNaN(T)&&v!==x&&String(T)===x&&T>=0&&r.parseArrays;if(!r.parseArrays&&x==="")h={0:p};else if(w&&T<r.arrayLimit)h=[],h[T]=p;else{if(w&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");w?(h[T]=p,Xr.markOverflow(h,T)):x!=="__proto__"&&(h[x]=p)}}p=h}return p},"parseObject"),G1=i(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&Oc.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,p=o.exec(n),m=p?n.slice(0,p.index):n,h=[];if(m){if(!r.plainObjects&&Oc.call(Object.prototype,m)&&!r.allowPrototypes)return;h[h.length]=m}for(var v=0;(p=s.exec(n))!==null&&v<r.depth;){v+=1;var P=p[1].slice(1,-1);if(!r.plainObjects&&Oc.call(Object.prototype,P)&&!r.allowPrototypes)return;h[h.length]=p[1]}if(p){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");h[h.length]="["+n.slice(p.index)+"]"}return h},"splitKeyIntoSegments"),H1=i(function(e,r,n,o){if(e){var s=G1(e,n);if(s)return V1(s,r,n,o)}},"parseQueryStringKeys"),W1=i(function(e){if(!e)return st;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"?st.charset:e.charset,n=typeof e.duplicates>"u"?st.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:st.allowDots:!!e.allowDots;return{allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:st.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:st.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:st.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:st.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:st.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:st.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:st.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:st.decoder,delimiter:typeof e.delimiter=="string"||Xr.isRegExp(e.delimiter)?e.delimiter:st.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:st.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:st.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:st.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:st.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:st.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:st.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:st.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");YS.exports=function(t,e){var r=W1(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?B1(t,r):t,o=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),p=0;p<s.length;++p){var m=s[p],h=H1(m,n[m],r,typeof t=="string");o=Xr.merge(o,h,r)}return r.allowSparse===!0?o:Xr.compact(o)}});var pm=L((Bee,QS)=>{"use strict";var Z1=KS(),K1=XS(),J1=Rc();QS.exports={formats:J1,parse:K1,stringify:Z1}});var tx=L((fm,ex)=>{(function(t,e){typeof fm=="object"?ex.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(fm,function(){function t(){}return i(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,o){var s=e[n],p=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),o&&o!=="*"&&(s=s.substring(0,parseInt(o,10))),p.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(o==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(h){p.push(this.encodeValue(r,h,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(h){this.isDefined(s[h])&&p.push(this.encodeValue(r,s[h],h))},this);else{var m=[];Array.isArray(s)?s.filter(this.isDefined).forEach(function(h){m.push(this.encodeValue(r,h))},this):Object.keys(s).forEach(function(h){this.isDefined(s[h])&&(m.push(this.encodeUnreserved(h)),m.push(this.encodeValue(r,s[h].toString())))},this),this.isKeyOperator(r)?p.push(this.encodeUnreserved(n)+"="+m.join(",")):m.length!==0&&p.push(m.join(","))}else r===";"?this.isDefined(s)&&p.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?p.push(this.encodeUnreserved(n)+"="):s===""&&p.push("");return p},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:i(function(o){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,p,m){if(p){var h=null,v=[];if(n.indexOf(p.charAt(0))!==-1&&(h=p.charAt(0),p=p.substr(1)),p.split(/,/g).forEach(function(x){var T=/([^:\*]*)(?::(\d+)|(\*))?/.exec(x);v.push.apply(v,r.getValues(o,h,T[1],T[2]||T[3]))}),h&&h!=="+"){var P=",";return h==="?"?P="&":h!=="#"&&(P=h),(v.length!==0?h:"")+v.join(P)}else return v.join(",")}else return r.encodeReserved(m)})},"expand")}},new t})});var rx=L(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});mm.isBrowser=Y1;function Y1(){return typeof window<"u"}i(Y1,"isBrowser")});var Nc=L(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.headersToClassicHeaders=nx;Cc.marshallGaxiosResponse=X1;function nx(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}i(nx,"headersToClassicHeaders");function X1(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:nx(t?.headers)}})}i(X1,"marshallGaxiosResponse")});var ax=L(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.sessions=void 0;ar.request=dL;ar.closeSession=hm;var ox=require("http2"),Q1=require("zlib"),eL=require("url"),tL=pm(),rL=ua(),nL=require("stream"),iL=require("util"),oL=require("process"),aL=Nc(),{HTTP2_HEADER_CONTENT_ENCODING:sL,HTTP2_HEADER_CONTENT_TYPE:ix,HTTP2_HEADER_METHOD:uL,HTTP2_HEADER_PATH:cL,HTTP2_HEADER_STATUS:lL}=ox.constants,Ka=!!oL.env.HTTP2_DEBUG;ar.sessions={};async function dL(t){let e=rL(!0,{},t);e.validateStatus=e.validateStatus||pL,e.responseType=e.responseType||"json";let r=new eL.URL(e.url),n=fL(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let o=r.pathname;if(t.params&&Object.keys(t.params).length>0){let x=(t.paramsSerializer||tL.stringify)(e.params);o+=`?${x}`}let s=(0,aL.headersToClassicHeaders)(e.headers);s[cL]=o,s[uL]=t.method||"GET",e.headers=s,s[ix]||e.responseType!=="text"&&(s[ix]="application/json");let p={config:t,headers:{},status:0,data:{},statusText:""},m=[],h=n.session,v;return new Promise((P,x)=>{try{v=h.request(s).on("response",T=>{Object.assign(p,{headers:T,status:T[lL]});let w=v;if(T[sL]==="gzip"&&(w=v.pipe(Q1.createGunzip())),e.responseType==="stream"){p.data=w,P(p);return}w.on("data",S=>{m.push(S)}).on("error",S=>{x(S)}).on("end",()=>{let S=Buffer.concat(m),D=S;if(S){if(e.responseType==="json")try{D=JSON.parse(S.toString("utf8"))}catch{D=S.toString("utf8")}else e.responseType==="text"?D=S.toString("utf8"):e.responseType==="arraybuffer"&&(D=S.buffer);p.data=D}if(!e.validateStatus(p.status)){let E=`Request failed with status code ${p.status}. `;if(p.data&&typeof p.data=="object"){let u=iL.inspect(p.data,{depth:5});E=`${E}
59
+ '${u}`}x(new Error(E,{cause:p}))}P(p)})}).on("error",T=>{x(T)})}catch(T){hm(r).then(()=>x(T)).catch(x);return}if(p.request=v,t.data){if(t.data instanceof nL.Stream)t.data.pipe(v);else if(typeof t.data=="string"){let T=Buffer.from(t.data);v.end(T)}else if(typeof t.data=="object"){let T=JSON.stringify(t.data);v.end(T)}}n.timeoutHandle=setTimeout(()=>hm(r),500)})}i(dL,"request");function pL(t){return t>=200&&t<300}i(pL,"validateStatus");function fL(t){if(ar.sessions[t])Ka&&console.log(`Used cached client for ${t}`);else{Ka&&console.log(`Creating client for ${t}`);let e=ox.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete ar.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete ar.sessions[t]}),ar.sessions[t]={session:e}}return ar.sessions[t]}i(fL,"_getClient");async function hm(t){let e=ar.sessions[t.host];if(!e)return;let{session:r}=e;delete ar.sessions[t.host],Ka&&console.error(`Closing ${t.host}`),r.close(()=>{Ka&&console.error(`Closed ${t.host}`)}),setTimeout(()=>{r&&!r.destroyed&&(Ka&&console.log(`Forcing close ${t.host}`),r&&r.destroy())},1e3)}i(hm,"closeSession")});var sx=L((Yee,mL)=>{mL.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 kc=L(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.createAPIRequest=_L;var gm=mt(),hL=pm(),px=require("stream"),ux=tx(),cx=ua(),vm=rx(),gL=ax(),ym=Nc(),fx=sx(),lx=i(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function yL(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}i(yL,"isReadableStream");function vL(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}i(vL,"getMissingParams");function _L(t,e){if(e)dx(t).then(r=>e(null,r),e);else return dx(t)}i(_L,"createAPIRequest");async function dx(t){let e=cx(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=cx(!0,{},e.params,t.params);e.userAgentDirectives=e.userAgentDirectives||[];let n=r.media||{},o=r.requestBody;!r.requestBody&&r.resource&&(!t.requiredParams.includes("resource")||typeof r.resource!="string")&&(o=r.resource,delete r.resource),delete r.requestBody;let s=r.auth||e.auth,p=typeof n.body=="string"?"text/plain":"application/octet-stream";delete r.media,delete r.auth;let m=(0,ym.headersToClassicHeaders)(r.headers||{});PL(m,e.apiVersion),delete r.headers,Object.keys(r).forEach(w=>{if(w.slice(-1)==="_"){let S=w.slice(0,-1);r[S]=r[w],delete r[w]}});let h=vL(r,t.requiredParams);if(h)throw new Error("Missing required parameters: "+h.join(", "));if(e.url){let w=e.url;typeof w=="object"&&(w=w.toString()),e.url=ux.parse(w).expand(r)}if(t.mediaUrl&&(t.mediaUrl=ux.parse(t.mediaUrl).expand(r)),t.context._options.rootUrl!==void 0&&e.url!==void 0){let w=new URL(e.url),S=w.href.substr(w.origin.length);e.url=new URL(S,t.context._options.rootUrl).href}e.paramsSerializer=w=>hL.stringify(w,{arrayFormat:"repeat"}),t.pathParams.forEach(w=>delete r[w]),typeof s=="string"&&(r.key=r.key||s,s=void 0);function v(w){let S=lx(),D=`--${S}--`,E=new px.PassThrough({flush(c){this.push(`\r
60
+ `),this.push(D),c()}}),u=new _m,f=yL(w[1].body);m["content-type"]=`multipart/related; boundary=${S}`;for(let c of w){let y=`--${S}\r
61
61
  content-type: ${c["content-type"]}\r
62
62
  \r
63
- `;b.push(y),typeof c.body=="string"?(b.push(c.body),b.push(`\r
64
- `)):(u.on("progress",l=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:l})}),c.body.pipe(u).pipe(b))}p||(b.push($),b.push(null)),e.data=b}o(_,"multipartUpload");function P(w){let T=ZT(),$=`--${T}--`;m["content-type"]=`multipart/related; boundary=${T}`;let b="";for(let u of w){let p=`--${T}\r
63
+ `;E.push(y),typeof c.body=="string"?(E.push(c.body),E.push(`\r
64
+ `)):(u.on("progress",l=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:l})}),c.body.pipe(u).pipe(E))}f||(E.push(D),E.push(null)),e.data=E}i(v,"multipartUpload");function P(w){let S=lx(),D=`--${S}--`;m["content-type"]=`multipart/related; boundary=${S}`;let E="";for(let u of w){let f=`--${S}\r
65
65
  content-type: ${u["content-type"]}\r
66
66
  \r
67
- `;b+=p,typeof u.body=="string"&&(b+=u.body,b+=`\r
68
- `)}b+=$,e.data=b}if(o(P,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,i){r.uploadType="multipart";let w=[{"content-type":"application/json",body:JSON.stringify(i)},{"content-type":n.mimeType||i&&i.mimeType||f,body:n.body}];(0,fm.isBrowser)()?P(w):_(w)}else r.uploadType="media",Object.assign(m,{"content-type":n.mimeType||f}),e.data=n.body;else e.data=i||void 0;if(e.headers=dm.Gaxios.mergeHeaders(e.headers||{},m),e.params=r,!(0,fm.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:YT.version,comment:"gzip"});let w=e.userAgentDirectives.map(T=>{let $=`${T.product}/${T.version}`;return T.comment&&($+=` (${T.comment})`),$}).join(" ");e.headers.set("User-Agent",w)}if(e.validateStatus||(e.validateStatus=w=>w>=200&&w<300||w===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 E=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,S=e.universeDomain??e.universe_domain??E??"googleapis.com";if(S!=="googleapis.com"&&e.url){let w=new URL(e.url);w.hostname.endsWith(".googleapis.com")&&(w.hostname=w.hostname.replace(/googleapis\.com$/,S),e.url=w.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),a&&typeof a=="object"){let w=typeof a.getUniverseDomain=="function"?await a.getUniverseDomain():void 0;if(w&&S!==w)throw new Error(`The configured universe domain (${S}) does not match the universe domain found in the credentials (${w}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let T=await a.getRequestHeaders(e.url),$=Object.assign({},e);return $.headers=dm.Gaxios.mergeHeaders($.headers,T),V1.request($)}else{let T=await a.request(e);return(0,pm.marshallGaxiosResponse)(T)}}else return new dm.Gaxios().request(e).then(w=>(0,pm.marshallGaxiosResponse)(w))}o(KT,"createAPIRequestAsync");var mm=class extends JT.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 Z1(t,e){(0,fm.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${YT.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o(Z1,"populateAPIHeader")});var XT=M(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.AuthPlus=void 0;var yn=zs(),gm=class extends yn.GoogleAuth{static{o(this,"AuthPlus")}JWT=yn.JWT;Compute=yn.Compute;OAuth2=yn.OAuth2Client;GoogleAuth=yn.GoogleAuth;AwsClient=yn.AwsClient;IdentityPoolClient=yn.IdentityPoolClient;ExternalAccountClient=yn.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new yn.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()}};Dc.AuthPlus=gm});var vm=M(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.Endpoint=void 0;var QT=Oc(),ym=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 a in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,a)){let f=n.resources[a];e[a]||(e[a]={}),this.applySchema(e[a],r,f,i)}}}applyMethodsFromSchema(e,r,n,i){if(n.methods){for(let a in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,a)){let f=n.methods[a];e[a]=this.makeMethod(r,f,i)}}}makeMethod(e,r,n){return(i,a)=>{let f=typeof i=="function"?{}:i;a=typeof i=="function"?i:a;let m=eE(e.rootUrl+e.servicePath+r.path),h={options:{url:m.substring(1,m.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:f,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 _=eE(e.rootUrl+r.mediaUpload.protocols.simple.path);h.mediaUrl=_.substring(1,_.length-1)}if(!a)return(0,QT.createAPIRequest)(h);(0,QT.createAPIRequest)(h,a)}}getPathParams(e){let r=new Array;return typeof e!="object"&&(e={}),Object.keys(e).forEach(n=>{e[n].location==="path"&&r.push(n)}),r}};Cc.Endpoint=ym;function eE(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(eE,"buildurl")});var rE=M(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.Discovery=void 0;var K1=require("fs"),J1=pt(),Y1=require("url"),tE=require("util"),X1=Oc(),Q1=vm(),ej=tE.promisify(K1.readFile),_m=class{static{o(this,"Discovery")}transporter=new J1.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new Q1.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,a=await Promise.all(i.map(async h=>{let _=await this.discoverAPI(h.discoveryRestUrl);return{api:h,endpointCreator:_}})),f={},m={};for(let h of a)m[h.api.name]||(f[h.api.name]={},m[h.api.name]=_=>{let P=typeof _,E;if(P==="string")E=_,_={};else if(P==="object")E=_.version,delete _.version;else throw new Error("Argument error: Accepts only string or object");try{let S=h.endpointCreator(_,this);return Object.freeze(S)}catch(S){throw new Error(tE.format('Unable to load endpoint %s("%s"): %s',h.api.name,E,S.message))}}),f[h.api.name][h.api.version]=h.endpointCreator;return m}async discoverAPI(e){if(typeof e=="string"){let r=Y1.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await ej(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:{}}},a=await(0,X1.createAPIRequest)(i);return this.makeEndpoint(a.data)}}};Nc.Discovery=_m});var Hs=M(Ae=>{"use strict";var tj=Ae&&Ae.__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]}),rj=Ae&&Ae.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tj(e,t,r)};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.Endpoint=Ae.Discovery=Ae.AuthPlus=Ae.createAPIRequest=Ae.getAPI=Ae.GaxiosError=Ae.Gaxios=Ae.AwsClient=Ae.IdentityPoolClient=Ae.BaseExternalAccountClient=Ae.ExternalAccountClient=Ae.GoogleAuth=Ae.UserRefreshClient=Ae.Compute=Ae.JWT=Ae.OAuth2Client=Ae.gaxios=Ae.googleAuthLibrary=void 0;Ae.googleAuthLibrary=zs();Ae.gaxios=pt();var vn=zs();Object.defineProperty(Ae,"OAuth2Client",{enumerable:!0,get:o(function(){return vn.OAuth2Client},"get")});Object.defineProperty(Ae,"JWT",{enumerable:!0,get:o(function(){return vn.JWT},"get")});Object.defineProperty(Ae,"Compute",{enumerable:!0,get:o(function(){return vn.Compute},"get")});Object.defineProperty(Ae,"UserRefreshClient",{enumerable:!0,get:o(function(){return vn.UserRefreshClient},"get")});Object.defineProperty(Ae,"GoogleAuth",{enumerable:!0,get:o(function(){return vn.GoogleAuth},"get")});Object.defineProperty(Ae,"ExternalAccountClient",{enumerable:!0,get:o(function(){return vn.ExternalAccountClient},"get")});Object.defineProperty(Ae,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return vn.BaseExternalAccountClient},"get")});Object.defineProperty(Ae,"IdentityPoolClient",{enumerable:!0,get:o(function(){return vn.IdentityPoolClient},"get")});Object.defineProperty(Ae,"AwsClient",{enumerable:!0,get:o(function(){return vn.AwsClient},"get")});var nE=pt();Object.defineProperty(Ae,"Gaxios",{enumerable:!0,get:o(function(){return nE.Gaxios},"get")});Object.defineProperty(Ae,"GaxiosError",{enumerable:!0,get:o(function(){return nE.GaxiosError},"get")});var nj=WS();Object.defineProperty(Ae,"getAPI",{enumerable:!0,get:o(function(){return nj.getAPI},"get")});var oj=Oc();Object.defineProperty(Ae,"createAPIRequest",{enumerable:!0,get:o(function(){return oj.createAPIRequest},"get")});var ij=XT();Object.defineProperty(Ae,"AuthPlus",{enumerable:!0,get:o(function(){return ij.AuthPlus},"get")});var sj=rE();Object.defineProperty(Ae,"Discovery",{enumerable:!0,get:o(function(){return sj.Discovery},"get")});var aj=vm();Object.defineProperty(Ae,"Endpoint",{enumerable:!0,get:o(function(){return aj.Endpoint},"get")});rj($c(),Ae)});var iE=M(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.drive_v2=void 0;var q=Hs(),oE;(function(t){class e{static{o(this,"Drive")}context;about;apps;changes;channels;children;comments;drives;files;parents;permissions;properties;replies;revisions;teamdrives;constructor(u,p){this.context={_options:u||{},google:p},this.about=new r(this.context),this.apps=new n(this.context),this.changes=new i(this.context),this.channels=new a(this.context),this.children=new f(this.context),this.comments=new m(this.context),this.drives=new h(this.context),this.files=new _(this.context),this.parents=new P(this.context),this.permissions=new E(this.context),this.properties=new S(this.context),this.replies=new w(this.context),this.revisions=new T(this.context),this.teamdrives=new $(this.context)}}t.Drive=e;class r{static{o(this,"Resource$About")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/about").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$About=r;class n{static{o(this,"Resource$Apps")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/apps/{appId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["appId"],pathParams:["appId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/apps").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Apps=n;class i{static{o(this,"Resource$Changes")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/changes/{changeId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["changeId"],pathParams:["changeId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}getStartPageToken(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/changes/startPageToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/changes").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}watch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/changes/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Changes=i;class a{static{o(this,"Resource$Channels")}context;constructor(u){this.context=u}stop(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Channels=a;class f{static{o(this,"Resource$Children")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{folderId}/children/{childId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["folderId","childId"],pathParams:["childId","folderId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{folderId}/children/{childId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["folderId","childId"],pathParams:["childId","folderId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{folderId}/children").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["folderId"],pathParams:["folderId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{folderId}/children").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["folderId"],pathParams:["folderId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Children=f;class m{static{o(this,"Resource$Comments")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}patch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Comments=m;class h{static{o(this,"Resource$Drives")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}hide(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives/{driveId}/hide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}unhide(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives/{driveId}/unhide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Drives=h;class _{static{o(this,"Resource$Files")}context;constructor(u){this.context=u}copy(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/copy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}emptyTrash(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/trash").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}export(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/export").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","mimeType"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}generateCseToken(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/generateCseToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}generateIds(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/generateIds").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,mediaUrl:(x+"/upload/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}listLabels(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/listLabels").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}modifyLabels(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/modifyLabels").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}patch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}touch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/touch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}trash(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/trash").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}untrash(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/untrash").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,mediaUrl:(x+"/upload/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}watch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Files=_;class P{static{o(this,"Resource$Parents")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/parents/{parentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","parentId"],pathParams:["fileId","parentId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/parents/{parentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","parentId"],pathParams:["fileId","parentId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/parents").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/parents").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Parents=P;class E{static{o(this,"Resource$Permissions")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}getIdForEmail(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/permissionIds/{email}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["email"],pathParams:["email"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}patch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Permissions=E;class S{static{o(this,"Resource$Properties")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/properties").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/properties").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}patch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Properties=S;class w{static{o(this,"Resource$Replies")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}patch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Replies=w;class T{static{o(this,"Resource$Revisions")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/revisions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}patch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Revisions=T;class ${static{o(this,"Resource$Teamdrives")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Teamdrives=$})(oE||(zc.drive_v2=oE={}))});var aE=M(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.drive_v3=void 0;var H=Hs(),sE;(function(t){class e{static{o(this,"Drive")}context;about;accessproposals;approvals;apps;changes;channels;comments;drives;files;operations;permissions;replies;revisions;teamdrives;constructor(u,p){this.context={_options:u||{},google:p},this.about=new r(this.context),this.accessproposals=new n(this.context),this.approvals=new i(this.context),this.apps=new a(this.context),this.changes=new f(this.context),this.channels=new m(this.context),this.comments=new h(this.context),this.drives=new _(this.context),this.files=new P(this.context),this.operations=new E(this.context),this.permissions=new S(this.context),this.replies=new w(this.context),this.revisions=new T(this.context),this.teamdrives=new $(this.context)}}t.Drive=e;class r{static{o(this,"Resource$About")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/about").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$About=r;class n{static{o(this,"Resource$Accessproposals")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/accessproposals/{proposalId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","proposalId"],pathParams:["fileId","proposalId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/accessproposals").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}resolve(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/accessproposals/{proposalId}:resolve").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","proposalId"],pathParams:["fileId","proposalId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Accessproposals=n;class i{static{o(this,"Resource$Approvals")}context;constructor(u){this.context=u}approve(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals/{approvalId}:approve").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}cancel(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals/{approvalId}:cancel").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}comment(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals/{approvalId}:comment").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}decline(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals/{approvalId}:decline").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals/{approvalId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}reassign(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals/{approvalId}:reassign").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}start(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals:start").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Approvals=i;class a{static{o(this,"Resource$Apps")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/apps/{appId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["appId"],pathParams:["appId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/apps").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Apps=a;class f{static{o(this,"Resource$Changes")}context;constructor(u){this.context=u}getStartPageToken(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/changes/startPageToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/changes").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["pageToken"],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}watch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/changes/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["pageToken"],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Changes=f;class m{static{o(this,"Resource$Channels")}context;constructor(u){this.context=u}stop(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Channels=m;class h{static{o(this,"Resource$Comments")}context;constructor(u){this.context=u}create(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Comments=h;class _{static{o(this,"Resource$Drives")}context;constructor(u){this.context=u}create(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}hide(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives/{driveId}/hide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}unhide(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives/{driveId}/unhide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Drives=_;class P{static{o(this,"Resource$Files")}context;constructor(u){this.context=u}copy(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/copy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}create(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,mediaUrl:(x+"/upload/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}download(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/download").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}emptyTrash(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/trash").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}export(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/export").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","mimeType"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}generateCseToken(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/generateCseToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}generateIds(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/generateIds").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}listLabels(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/listLabels").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}modifyLabels(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/modifyLabels").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,mediaUrl:(x+"/upload/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}watch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Files=P;class E{static{o(this,"Resource$Operations")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/operations/{name}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["name"],pathParams:["name"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Operations=E;class S{static{o(this,"Resource$Permissions")}context;constructor(u){this.context=u}create(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Permissions=S;class w{static{o(this,"Resource$Replies")}context;constructor(u){this.context=u}create(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Replies=w;class T{static{o(this,"Resource$Revisions")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/revisions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Revisions=T;class ${static{o(this,"Resource$Teamdrives")}context;constructor(u){this.context=u}create(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Teamdrives=$})(sE||(Uc.drive_v3=sE={}))});var Ct=M(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.AuthPlus=Ft.drive_v3=Ft.drive_v2=Ft.auth=Ft.VERSIONS=void 0;Ft.drive=uj;var uE=Hs(),cE=iE();Object.defineProperty(Ft,"drive_v2",{enumerable:!0,get:o(function(){return cE.drive_v2},"get")});var lE=aE();Object.defineProperty(Ft,"drive_v3",{enumerable:!0,get:o(function(){return lE.drive_v3},"get")});Ft.VERSIONS={v2:cE.drive_v2.Drive,v3:lE.drive_v3.Drive};function uj(t){return(0,uE.getAPI)("drive",t,Ft.VERSIONS,this)}o(uj,"drive");var cj=new uE.AuthPlus;Ft.auth=cj;var lj=Hs();Object.defineProperty(Ft,"AuthPlus",{enumerable:!0,get:o(function(){return lj.AuthPlus},"get")})});var kc=M((Pm,wm)=>{(function(t,e){typeof Pm=="object"&&typeof wm<"u"?wm.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Pm,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",a="minute",f="hour",m="day",h="week",_="month",P="quarter",E="year",S="date",w="Invalid Date",T=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,$=/\[([^\]]+)]|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,b={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(ne){var K=["th","st","nd","rd"],Z=ne%100;return"["+ne+(K[(Z-20)%10]||K[Z]||K[0])+"]"},"ordinal")},u=o(function(ne,K,Z){var Q=String(ne);return!Q||Q.length>=K?ne:""+Array(K+1-Q.length).join(Z)+ne},"m"),p={s:u,z:o(function(ne){var K=-ne.utcOffset(),Z=Math.abs(K),Q=Math.floor(Z/60),X=Z%60;return(K<=0?"+":"-")+u(Q,2,"0")+":"+u(X,2,"0")},"z"),m:o(function ne(K,Z){if(K.date()<Z.date())return-ne(Z,K);var Q=12*(Z.year()-K.year())+(Z.month()-K.month()),X=K.clone().add(Q,_),ie=Z-X<0,ae=K.clone().add(Q+(ie?-1:1),_);return+(-(Q+(Z-X)/(ie?X-ae:ae-X))||0)},"t"),a:o(function(ne){return ne<0?Math.ceil(ne)||0:Math.floor(ne)},"a"),p:o(function(ne){return{M:_,y:E,w:h,d:m,D:S,h:f,m:a,s:i,ms:n,Q:P}[ne]||String(ne||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(ne){return ne===void 0},"u")},c="en",y={};y[c]=b;var l=o(function(ne){return ne instanceof ee},"p"),x=o(function ne(K,Z,Q){var X;if(!K)return c;if(typeof K=="string"){var ie=K.toLowerCase();y[ie]&&(X=ie),Z&&(y[ie]=Z,X=ie);var ae=K.split("-");if(!X&&ae.length>1)return ne(ae[0])}else{var Ie=K.name;y[Ie]=K,X=Ie}return!Q&&X&&(c=X),X||!Q&&c},"t"),g=o(function(ne,K){if(l(ne))return ne.clone();var Z=typeof K=="object"?K:{};return Z.date=ne,Z.args=arguments,new ee(Z)},"w"),re=p;re.l=x,re.i=l,re.w=function(ne,K){return g(ne,{locale:K.$L,utc:K.$u,x:K.$x,$offset:K.$offset})};var ee=function(){function ne(Z){this.$L=x(Z.locale,null,!0),this.parse(Z)}o(ne,"M");var K=ne.prototype;return K.parse=function(Z){this.$d=function(Q){var X=Q.date,ie=Q.utc;if(X===null)return new Date(NaN);if(re.u(X))return new Date;if(X instanceof Date)return new Date(X);if(typeof X=="string"&&!/Z$/i.test(X)){var ae=X.match(T);if(ae){var Ie=ae[2]-1||0,De=(ae[7]||"0").substring(0,3);return ie?new Date(Date.UTC(ae[1],Ie,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,De)):new Date(ae[1],Ie,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,De)}}return new Date(X)}(Z),this.$x=Z.x||{},this.init()},K.init=function(){var Z=this.$d;this.$y=Z.getFullYear(),this.$M=Z.getMonth(),this.$D=Z.getDate(),this.$W=Z.getDay(),this.$H=Z.getHours(),this.$m=Z.getMinutes(),this.$s=Z.getSeconds(),this.$ms=Z.getMilliseconds()},K.$utils=function(){return re},K.isValid=function(){return this.$d.toString()!==w},K.isSame=function(Z,Q){var X=g(Z);return this.startOf(Q)<=X&&X<=this.endOf(Q)},K.isAfter=function(Z,Q){return g(Z)<this.startOf(Q)},K.isBefore=function(Z,Q){return this.endOf(Q)<g(Z)},K.$g=function(Z,Q,X){return re.u(Z)?this[Q]:this.set(X,Z)},K.unix=function(){return Math.floor(this.valueOf()/1e3)},K.valueOf=function(){return this.$d.getTime()},K.startOf=function(Z,Q){var X=this,ie=!!re.u(Q)||Q,ae=re.p(Z),Ie=o(function(Lt,He){var Ze=re.w(X.$u?Date.UTC(X.$y,He,Lt):new Date(X.$y,He,Lt),X);return ie?Ze:Ze.endOf(m)},"l"),De=o(function(Lt,He){return re.w(X.toDate()[Lt].apply(X.toDate("s"),(ie?[0,0,0,0]:[23,59,59,999]).slice(He)),X)},"$"),We=this.$W,Xe=this.$M,_t=this.$D,te="set"+(this.$u?"UTC":"");switch(ae){case E:return ie?Ie(1,0):Ie(31,11);case _:return ie?Ie(1,Xe):Ie(0,Xe+1);case h:var st=this.$locale().weekStart||0,dt=(We<st?We+7:We)-st;return Ie(ie?_t-dt:_t+(6-dt),Xe);case m:case S:return De(te+"Hours",0);case f:return De(te+"Minutes",1);case a:return De(te+"Seconds",2);case i:return De(te+"Milliseconds",3);default:return this.clone()}},K.endOf=function(Z){return this.startOf(Z,!1)},K.$set=function(Z,Q){var X,ie=re.p(Z),ae="set"+(this.$u?"UTC":""),Ie=(X={},X[m]=ae+"Date",X[S]=ae+"Date",X[_]=ae+"Month",X[E]=ae+"FullYear",X[f]=ae+"Hours",X[a]=ae+"Minutes",X[i]=ae+"Seconds",X[n]=ae+"Milliseconds",X)[ie],De=ie===m?this.$D+(Q-this.$W):Q;if(ie===_||ie===E){var We=this.clone().set(S,1);We.$d[Ie](De),We.init(),this.$d=We.set(S,Math.min(this.$D,We.daysInMonth())).$d}else Ie&&this.$d[Ie](De);return this.init(),this},K.set=function(Z,Q){return this.clone().$set(Z,Q)},K.get=function(Z){return this[re.p(Z)]()},K.add=function(Z,Q){var X,ie=this;Z=Number(Z);var ae=re.p(Q),Ie=o(function(Xe){var _t=g(ie);return re.w(_t.date(_t.date()+Math.round(Xe*Z)),ie)},"y");if(ae===_)return this.set(_,this.$M+Z);if(ae===E)return this.set(E,this.$y+Z);if(ae===m)return Ie(1);if(ae===h)return Ie(7);var De=(X={},X[a]=e,X[f]=r,X[i]=t,X)[ae]||1,We=this.$d.getTime()+Z*De;return re.w(We,this)},K.subtract=function(Z,Q){return this.add(-1*Z,Q)},K.format=function(Z){var Q=this,X=this.$locale();if(!this.isValid())return X.invalidDate||w;var ie=Z||"YYYY-MM-DDTHH:mm:ssZ",ae=re.z(this),Ie=this.$H,De=this.$m,We=this.$M,Xe=X.weekdays,_t=X.months,te=X.meridiem,st=o(function(He,Ze,A,O){return He&&(He[Ze]||He(Q,ie))||A[Ze].slice(0,O)},"h"),dt=o(function(He){return re.s(Ie%12||12,He,"0")},"d"),Lt=te||function(He,Ze,A){var O=He<12?"AM":"PM";return A?O.toLowerCase():O};return ie.replace($,function(He,Ze){return Ze||function(A){switch(A){case"YY":return String(Q.$y).slice(-2);case"YYYY":return re.s(Q.$y,4,"0");case"M":return We+1;case"MM":return re.s(We+1,2,"0");case"MMM":return st(X.monthsShort,We,_t,3);case"MMMM":return st(_t,We);case"D":return Q.$D;case"DD":return re.s(Q.$D,2,"0");case"d":return String(Q.$W);case"dd":return st(X.weekdaysMin,Q.$W,Xe,2);case"ddd":return st(X.weekdaysShort,Q.$W,Xe,3);case"dddd":return Xe[Q.$W];case"H":return String(Ie);case"HH":return re.s(Ie,2,"0");case"h":return dt(1);case"hh":return dt(2);case"a":return Lt(Ie,De,!0);case"A":return Lt(Ie,De,!1);case"m":return String(De);case"mm":return re.s(De,2,"0");case"s":return String(Q.$s);case"ss":return re.s(Q.$s,2,"0");case"SSS":return re.s(Q.$ms,3,"0");case"Z":return ae}return null}(He)||ae.replace(":","")})},K.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},K.diff=function(Z,Q,X){var ie,ae=this,Ie=re.p(Q),De=g(Z),We=(De.utcOffset()-this.utcOffset())*e,Xe=this-De,_t=o(function(){return re.m(ae,De)},"D");switch(Ie){case E:ie=_t()/12;break;case _:ie=_t();break;case P:ie=_t()/3;break;case h:ie=(Xe-We)/6048e5;break;case m:ie=(Xe-We)/864e5;break;case f:ie=Xe/r;break;case a:ie=Xe/e;break;case i:ie=Xe/t;break;default:ie=Xe}return X?ie:re.a(ie)},K.daysInMonth=function(){return this.endOf(_).$D},K.$locale=function(){return y[this.$L]},K.locale=function(Z,Q){if(!Z)return this.$L;var X=this.clone(),ie=x(Z,Q,!0);return ie&&(X.$L=ie),X},K.clone=function(){return re.w(this.$d,this)},K.toDate=function(){return new Date(this.valueOf())},K.toJSON=function(){return this.isValid()?this.toISOString():null},K.toISOString=function(){return this.$d.toISOString()},K.toString=function(){return this.$d.toUTCString()},ne}(),Te=ee.prototype;return g.prototype=Te,[["$ms",n],["$s",i],["$m",a],["$H",f],["$W",m],["$M",_],["$y",E],["$D",S]].forEach(function(ne){Te[ne[1]]=function(K){return this.$g(K,ne[0],ne[1])}}),g.extend=function(ne,K){return ne.$i||(ne(K,ee,g),ne.$i=!0),g},g.locale=x,g.isDayjs=l,g.unix=function(ne){return g(1e3*ne)},g.en=y[c],g.Ls=y,g.p={},g})});var hj={};Pa(hj,{createGoogleClient:()=>Ve,getAccessToken:()=>hr,googleDrive:()=>mj,googleDriveAuth:()=>Oe});module.exports=QA(hj);var eI=Object.freeze({status:"aborted"});function de(t,e,r){function n(m,h){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:h,constr:f,traits:new Set},enumerable:!1}),m._zod.traits.has(t))return;m._zod.traits.add(t),e(m,h);let _=f.prototype,P=Object.keys(_);for(let E=0;E<P.length;E++){let S=P[E];S in m||(m[S]=_[S].bind(m))}}o(n,"init");let i=r?.Parent??Object;class a extends i{static{o(this,"Definition")}}Object.defineProperty(a,"name",{value:t});function f(m){var h;let _=r?.Parent?new a:this;n(_,m),(h=_._zod).deferred??(h.deferred=[]);for(let P of _._zod.deferred)P();return _}return o(f,"_"),Object.defineProperty(f,"init",{value:n}),Object.defineProperty(f,Symbol.hasInstance,{value:o(m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(t),"value")}),Object.defineProperty(f,"name",{value:t}),f}o(de,"$constructor");var tI=Symbol("zod_brand"),Or=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},wa=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},fl={};function rn(t){return t&&Object.assign(fl,t),fl}o(rn,"config");function hl(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(hl,"getEnumValues");function Rh(t,e){return typeof e=="bigint"?e.toString():e}o(Rh,"jsonStringifyReplacer");function Sa(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Sa,"cached");function $h(t){return t==null}o($h,"nullish");function Ta(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(Ta,"cleanRegex");var Ih=Symbol("evaluating");function ft(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Ih)return n===void 0&&(n=Ih,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(ft,"defineLazy");var gl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Ci(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(Ci,"isObject");var rI=Sa(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Oh(t){if(Ci(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Ci(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Oh,"isPlainObject");var Dh=new Set(["string","number","symbol"]);function No(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(No,"escapeRegex");function Ea(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}o(Ea,"clone");function at(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(at,"normalizeParams");function Ch(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(Ch,"optionalKeys");var nI={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 zo(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(zo,"aborted");function An(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(An,"prefixIssues");function xa(t){return typeof t=="string"?t:t?.message}o(xa,"unwrapMessage");function In(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=xa(t.inst?._zod.def?.error?.(t))??xa(e?.error?.(t))??xa(r.customError?.(t))??xa(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(In,"finalizeIssue");function Nh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(Nh,"getLengthableOrigin");function yl(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o(yl,"issue");var zh=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,Rh,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),Uh=de("$ZodError",zh),Ni=de("$ZodError",zh,{Parent:Error});var iI=o(t=>(e,r,n,i)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},f=e._zod.run({value:r,issues:[]},a);if(f instanceof Promise)throw new Or;if(f.issues.length){let m=new(i?.Err??t)(f.issues.map(h=>In(h,a,rn())));throw gl(m,i?.callee),m}return f.value},"_parse"),ba=iI(Ni),sI=o(t=>async(e,r,n,i)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},f=e._zod.run({value:r,issues:[]},a);if(f instanceof Promise&&(f=await f),f.issues.length){let m=new(i?.Err??t)(f.issues.map(h=>In(h,a,rn())));throw gl(m,i?.callee),m}return f.value},"_parseAsync"),Aa=sI(Ni),aI=o(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Or;return a.issues.length?{success:!1,error:new(t??Uh)(a.issues.map(f=>In(f,i,rn())))}:{success:!0,data:a.value}},"_safeParse"),zi=aI(Ni),uI=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},a=e._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new t(a.issues.map(f=>In(f,i,rn())))}:{success:!0,data:a.value}},"_safeParseAsync"),Ui=uI(Ni);var cI="(?:(?:\\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])))",lI=new RegExp(`^${cI}$`);var kh=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),jh=/^-?\d+n?$/;var vl=/^-?\d+(?:\.\d+)?$/,Mh=/^(?:true|false)$/i;var Uo=de("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])});var Fh=de("$ZodCheckMinLength",(t,e)=>{var r;Uo.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 f=Nh(i);n.issues.push({origin:f,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var _l=de("$ZodCheckStringFormat",(t,e)=>{var r,n;Uo.init(t,e),t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,e.pattern&&(a.patterns??(a.patterns=new Set),a.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=()=>{})}),Lh=de("$ZodCheckRegex",(t,e)=>{_l.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 Bh={major:4,minor:3,patch:6};var ut=de("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Bh;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let a of i._zod.onattach)a(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((f,m,h)=>{let _=zo(f),P;for(let E of m){if(E._zod.def.when){if(!E._zod.def.when(f))continue}else if(_)continue;let S=f.issues.length,w=E._zod.check(f);if(w instanceof Promise&&h?.async===!1)throw new Or;if(P||w instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await w,f.issues.length!==S&&(_||(_=zo(f,S)))});else{if(f.issues.length===S)continue;_||(_=zo(f,S))}}return P?P.then(()=>f):f},"runChecks"),a=o((f,m,h)=>{if(zo(f))return f.aborted=!0,f;let _=i(m,n,h);if(_ instanceof Promise){if(h.async===!1)throw new Or;return _.then(P=>t._zod.parse(P,h))}return t._zod.parse(_,h)},"handleCanaryResult");t._zod.run=(f,m)=>{if(m.skipChecks)return t._zod.parse(f,m);if(m.direction==="backward"){let _=t._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return _ instanceof Promise?_.then(P=>a(P,f,m)):a(_,f,m)}let h=t._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new Or;return h.then(_=>i(_,n,m))}return i(h,n,m)}}ft(t,"~standard",()=>({validate:o(i=>{try{let a=zi(t,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Ui(t,i).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},"validate"),vendor:"zod",version:1}))}),$a=de("$ZodString",(t,e)=>{ut.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??kh(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}}),Pl=de("$ZodStringFormat",(t,e)=>{_l.init(t,e),$a.init(t,e)});var Zh=de("$ZodURL",(t,e)=>{Pl.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 Kh=de("$ZodNumber",(t,e)=>{ut.init(t,e),t._zod.pattern=t._zod.bag.pattern??vl,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 a=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,...a?{received:a}:{}}),r}});var wl=de("$ZodBoolean",(t,e)=>{ut.init(t,e),t._zod.pattern=Mh,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}}),Jh=de("$ZodBigInt",(t,e)=>{ut.init(t,e),t._zod.pattern=jh,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 Yh=de("$ZodAny",(t,e)=>{ut.init(t,e),t._zod.parse=r=>r}),Xh=de("$ZodUnknown",(t,e)=>{ut.init(t,e),t._zod.parse=r=>r});var Qh=de("$ZodVoid",(t,e)=>{ut.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}}),eg=de("$ZodDate",(t,e)=>{ut.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:t}),r}});function Vh(t,e,r){t.issues.length&&e.issues.push(...An(r,t.issues)),e.value[r]=t.value}o(Vh,"handleArrayResult");var tg=de("$ZodArray",(t,e)=>{ut.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 a=[];for(let f=0;f<i.length;f++){let m=i[f],h=e.element._zod.run({value:m,issues:[]},n);h instanceof Promise?a.push(h.then(_=>Vh(_,r,f))):Vh(h,r,f)}return a.length?Promise.all(a).then(()=>r):r}});function Ra(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...An(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(Ra,"handlePropertyResult");function dI(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=Ch(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(dI,"normalizeDef");function pI(t,e,r,n,i,a){let f=[],m=i.keySet,h=i.catchall._zod,_=h.def.type,P=h.optout==="optional";for(let E in e){if(m.has(E))continue;if(_==="never"){f.push(E);continue}let S=h.run({value:e[E],issues:[]},n);S instanceof Promise?t.push(S.then(w=>Ra(w,r,E,e,P))):Ra(S,r,E,e,P)}return f.length&&r.issues.push({code:"unrecognized_keys",keys:f,input:e,inst:a}),t.length?Promise.all(t).then(()=>r):r}o(pI,"handleCatchall");var rg=de("$ZodObject",(t,e)=>{if(ut.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let m=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let h={...m};return Object.defineProperty(e,"shape",{value:h}),h},"get")})}let n=Sa(()=>dI(e));ft(t._zod,"propValues",()=>{let m=e.shape,h={};for(let _ in m){let P=m[_]._zod;if(P.values){h[_]??(h[_]=new Set);for(let E of P.values)h[_].add(E)}}return h});let i=Ci,a=e.catchall,f;t._zod.parse=(m,h)=>{f??(f=n.value);let _=m.value;if(!i(_))return m.issues.push({expected:"object",code:"invalid_type",input:_,inst:t}),m;m.value={};let P=[],E=f.shape;for(let S of f.keys){let w=E[S],T=w._zod.optout==="optional",$=w._zod.run({value:_[S],issues:[]},h);$ instanceof Promise?P.push($.then(b=>Ra(b,m,S,_,T))):Ra($,m,S,_,T)}return a?pI(P,_,m,h,n.value,t):P.length?Promise.all(P).then(()=>m):m}});function Gh(t,e,r,n){for(let a of t)if(a.issues.length===0)return e.value=a.value,e;let i=t.filter(a=>!zo(a));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(a=>a.issues.map(f=>In(f,n,rn())))}),e)}o(Gh,"handleUnionResults");var xl=de("$ZodUnion",(t,e)=>{ut.init(t,e),ft(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ft(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ft(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),ft(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>Ta(a.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,a)=>{if(r)return n(i,a);let f=!1,m=[];for(let h of e.options){let _=h._zod.run({value:i.value,issues:[]},a);if(_ instanceof Promise)m.push(_),f=!0;else{if(_.issues.length===0)return _;m.push(_)}}return f?Promise.all(m).then(h=>Gh(h,i,t,a)):Gh(m,i,t,a)}});var ng=de("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,xl.init(t,e);let r=t._zod.parse;ft(t._zod,"propValues",()=>{let i={};for(let a of e.options){let f=a._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let[m,h]of Object.entries(f)){i[m]||(i[m]=new Set);for(let _ of h)i[m].add(_)}}return i});let n=Sa(()=>{let i=e.options,a=new Map;for(let f of i){let m=f._zod.propValues?.[e.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(f)}"`);for(let h of m){if(a.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);a.set(h,f)}}return a});t._zod.parse=(i,a)=>{let f=i.value;if(!Ci(f))return i.issues.push({code:"invalid_type",expected:"object",input:f,inst:t}),i;let m=n.value.get(f?.[e.discriminator]);return m?m._zod.run(i,a):e.unionFallback?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:f,path:[e.discriminator],inst:t}),i)}});var og=de("$ZodRecord",(t,e)=>{ut.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Oh(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let a=[],f=e.keyType._zod.values;if(f){r.value={};let m=new Set;for(let _ of f)if(typeof _=="string"||typeof _=="number"||typeof _=="symbol"){m.add(typeof _=="number"?_.toString():_);let P=e.valueType._zod.run({value:i[_],issues:[]},n);P instanceof Promise?a.push(P.then(E=>{E.issues.length&&r.issues.push(...An(_,E.issues)),r.value[_]=E.value})):(P.issues.length&&r.issues.push(...An(_,P.issues)),r.value[_]=P.value)}let h;for(let _ in i)m.has(_)||(h=h??[],h.push(_));h&&h.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:h})}else{r.value={};for(let m of Reflect.ownKeys(i)){if(m==="__proto__")continue;let h=e.keyType._zod.run({value:m,issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&vl.test(m)&&h.issues.length){let E=e.keyType._zod.run({value:Number(m),issues:[]},n);if(E instanceof Promise)throw new Error("Async schemas not supported in object keys currently");E.issues.length===0&&(h=E)}if(h.issues.length){e.mode==="loose"?r.value[m]=i[m]:r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(E=>In(E,n,rn())),input:m,path:[m],inst:t});continue}let P=e.valueType._zod.run({value:i[m],issues:[]},n);P instanceof Promise?a.push(P.then(E=>{E.issues.length&&r.issues.push(...An(m,E.issues)),r.value[h.value]=E.value})):(P.issues.length&&r.issues.push(...An(m,P.issues)),r.value[h.value]=P.value)}}return a.length?Promise.all(a).then(()=>r):r}});var ig=de("$ZodEnum",(t,e)=>{ut.init(t,e);let r=hl(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>Dh.has(typeof i)).map(i=>typeof i=="string"?No(i):i.toString()).join("|")})$`),t._zod.parse=(i,a)=>{let f=i.value;return n.has(f)||i.issues.push({code:"invalid_value",values:r,input:f,inst:t}),i}}),sg=de("$ZodLiteral",(t,e)=>{if(ut.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"?No(n):n?No(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:e.values,input:a,inst:t}),n}});var ag=de("$ZodTransform",(t,e)=>{ut.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new wa(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(f=>(r.value=f,r));if(i instanceof Promise)throw new Or;return r.value=i,r}});function Hh(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(Hh,"handleOptionalResult");var ug=de("$ZodOptional",(t,e)=>{ut.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ft(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ft(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Ta(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(a=>Hh(a,r.value)):Hh(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var cg=de("$ZodNullable",(t,e)=>{ut.init(t,e),ft(t._zod,"optin",()=>e.innerType._zod.optin),ft(t._zod,"optout",()=>e.innerType._zod.optout),ft(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Ta(r.source)}|null)$`):void 0}),ft(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 lg=de("$ZodPipe",(t,e)=>{ut.init(t,e),ft(t._zod,"values",()=>e.in._zod.values),ft(t._zod,"optin",()=>e.in._zod.optin),ft(t._zod,"optout",()=>e.out._zod.optout),ft(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let a=e.out._zod.run(r,n);return a instanceof Promise?a.then(f=>Ia(f,e.in,n)):Ia(a,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(a=>Ia(a,e.out,n)):Ia(i,e.out,n)}});function Ia(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(Ia,"handlePipeResult");var dg=de("$ZodCustom",(t,e)=>{Uo.init(t,e),ut.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(a=>Wh(a,r,n,t));Wh(i,r,n,t)}});function Wh(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(yl(i))}}o(Wh,"handleRefineResult");var fg,gI=Symbol("ZodOutput"),yI=Symbol("ZodInput"),Sl=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 mg(){return new Sl}o(mg,"registry");(fg=globalThis).__zod_globalRegistry??(fg.__zod_globalRegistry=mg());var Tl=globalThis.__zod_globalRegistry;function hg(t,e){return new t({type:"string",...at(e)})}o(hg,"_string");function gg(t,e){return new t({type:"string",coerce:!0,...at(e)})}o(gg,"_coercedString");function yg(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...at(e)})}o(yg,"_url");function vg(t,e){return new t({type:"number",checks:[],...at(e)})}o(vg,"_number");function _g(t,e){return new t({type:"number",coerce:!0,checks:[],...at(e)})}o(_g,"_coercedNumber");function Pg(t,e){return new t({type:"boolean",...at(e)})}o(Pg,"_boolean");function wg(t,e){return new t({type:"boolean",coerce:!0,...at(e)})}o(wg,"_coercedBoolean");function xg(t,e){return new t({type:"bigint",coerce:!0,...at(e)})}o(xg,"_coercedBigint");function Sg(t){return new t({type:"any"})}o(Sg,"_any");function Tg(t){return new t({type:"unknown"})}o(Tg,"_unknown");function Eg(t,e){return new t({type:"void",...at(e)})}o(Eg,"_void");function bg(t,e){return new t({type:"date",coerce:!0,...at(e)})}o(bg,"_coercedDate");function _r(t,e){return new Fh({check:"min_length",...at(e),minimum:t})}o(_r,"_minLength");function Rn(t,e){return new Lh({check:"string_format",format:"regex",...at(e),pattern:t})}o(Rn,"_regex");function Ag(t,e,r){let n=at(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(Ag,"_custom");var mt=de("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");ut.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>ba(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>zi(t,r,n),t.parseAsync=async(r,n)=>Aa(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Ui(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)=>Ea(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.apply=r=>r(t)}),Da=de("ZodMiniString",(t,e)=>{$a.init(t,e),mt.init(t,e)});function I(t){return hg(Da,t)}o(I,"string");var Ig=de("ZodMiniStringFormat",(t,e)=>{Pl.init(t,e),Da.init(t,e)});var AI=de("ZodMiniURL",(t,e)=>{Zh.init(t,e),Ig.init(t,e)});function Rg(t){return yg(AI,t)}o(Rg,"url");var El=de("ZodMiniNumber",(t,e)=>{Kh.init(t,e),mt.init(t,e)});function $t(t){return vg(El,t)}o($t,"number");var bl=de("ZodMiniBoolean",(t,e)=>{wl.init(t,e),mt.init(t,e)});function Je(t){return Pg(bl,t)}o(Je,"boolean");var $g=de("ZodMiniBigInt",(t,e)=>{Jh.init(t,e),mt.init(t,e)});var II=de("ZodMiniAny",(t,e)=>{Yh.init(t,e),mt.init(t,e)});function ji(){return Sg(II)}o(ji,"any");var RI=de("ZodMiniUnknown",(t,e)=>{Xh.init(t,e),mt.init(t,e)});function we(){return Tg(RI)}o(we,"unknown");var $I=de("ZodMiniVoid",(t,e)=>{Qh.init(t,e),mt.init(t,e)});function Og(t){return Eg($I,t)}o(Og,"_void");var Dg=de("ZodMiniDate",(t,e)=>{eg.init(t,e),mt.init(t,e)});var OI=de("ZodMiniArray",(t,e)=>{tg.init(t,e),mt.init(t,e)});function be(t,e){return new OI({type:"array",element:t,...at(e)})}o(be,"array");var DI=de("ZodMiniObject",(t,e)=>{rg.init(t,e),mt.init(t,e),ft(t,"shape",()=>e.shape)});function k(t,e){let r={type:"object",shape:t??{},...at(e)};return new DI(r)}o(k,"object");var CI=de("ZodMiniUnion",(t,e)=>{xl.init(t,e),mt.init(t,e)});function Re(t,e){return new CI({type:"union",options:t,...at(e)})}o(Re,"union");var NI=de("ZodMiniDiscriminatedUnion",(t,e)=>{ng.init(t,e),mt.init(t,e)});function ko(t,e,r){return new NI({type:"union",options:e,discriminator:t,...at(r)})}o(ko,"discriminatedUnion");var zI=de("ZodMiniRecord",(t,e)=>{og.init(t,e),mt.init(t,e)});function xe(t,e,r){return new zI({type:"record",keyType:t,valueType:e,...at(r)})}o(xe,"record");var UI=de("ZodMiniEnum",(t,e)=>{ig.init(t,e),mt.init(t,e),t.options=Object.values(e.entries)});function Ne(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new UI({type:"enum",entries:r,...at(e)})}o(Ne,"_enum");var kI=de("ZodMiniLiteral",(t,e)=>{sg.init(t,e),mt.init(t,e)});function ge(t,e){return new kI({type:"literal",values:Array.isArray(t)?t:[t],...at(e)})}o(ge,"literal");var jI=de("ZodMiniTransform",(t,e)=>{ag.init(t,e),mt.init(t,e)});function $n(t){return new jI({type:"transform",transform:t})}o($n,"transform");var MI=de("ZodMiniOptional",(t,e)=>{ug.init(t,e),mt.init(t,e)});function Y(t){return new MI({type:"optional",innerType:t})}o(Y,"optional");var FI=de("ZodMiniNullable",(t,e)=>{cg.init(t,e),mt.init(t,e)});function Mi(t){return new FI({type:"nullable",innerType:t})}o(Mi,"nullable");var LI=de("ZodMiniPipe",(t,e)=>{lg.init(t,e),mt.init(t,e)});function On(t,e){return new LI({type:"pipe",in:t,out:e})}o(On,"pipe");var qI=de("ZodMiniCustom",(t,e)=>{dg.init(t,e),mt.init(t,e)});function Ca(t,e){return Ag(qI,t??(()=>!0),e)}o(Ca,"custom");var Fi={};Pa(Fi,{bigint:()=>KI,boolean:()=>ZI,date:()=>JI,number:()=>WI,string:()=>HI});function HI(t){return gg(Da,t)}o(HI,"string");function WI(t){return _g(El,t)}o(WI,"number");function ZI(t){return wg(bl,t)}o(ZI,"boolean");function KI(t){return xg($g,t)}o(KI,"bigint");function JI(t){return bg(Dg,t)}o(JI,"date");var Il=k({retryOnFailure:k({defaultValue:Y(Je()),hide:Y(Je())}),continueOnFailure:k({defaultValue:Y(Je()),hide:Y(Je())})}),Al=class{constructor(e,r,n,i,a,f,m,h,_,P,E){this.name=e;this.displayName=r;this.description=n;this.props=i;this.run=a;this.test=f;this.requireAuth=m;this.errorHandlingOptions=h;this.outputSchema=_;this.audience=P;this.aiMetadata=E}static{o(this,"IAction")}},qe=o(t=>new Al(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 Be=k({displayName:I(),description:Y(I())}),$e=o((t,e)=>k({type:ge(e),required:Je(),defaultValue:Y(ji())}),"TPropertyValue");var Vt=k({...Be.shape,...$e(I(),"SHORT_TEXT").shape}),nn=k({...Be.shape,...$e(I(),"LONG_TEXT").shape});var Ng=k({label:I(),value:we()}),Na=k({disabled:Y(Je()),placeholder:Y(I()),options:be(Ng)});var Gt=k({...Be.shape,options:Na,...$e(we(),"STATIC_DROPDOWN").shape}),on=k({...Be.shape,options:Na,...$e(be(we()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Rl=k({...Be.shape,...$e(we(),"DROPDOWN").shape,refreshers:be(I())}),Li=k({...Be.shape,...$e(be(we()),"MULTI_SELECT_DROPDOWN").shape,refreshers:be(I())});var sn=k({...Be.shape,...$e(Je(),"CHECKBOX").shape});var an=k({...Be.shape,...$e($t(),"NUMBER").shape});var qi=k({...Be.shape,...$e(we(),"FILE").shape});var Bi=k({...Be.shape,...$e(I(),"DATE_TIME").shape});var zg=xe(I(),Re([Vt,nn,Gt,Li,on,sn,an,qi,Bi])),Vi=k({...Be.shape,properties:zg,...$e(be(we()),"ARRAY").shape});var Gi=k({...Be.shape,...$e(Re([xe(I(),we())]),"JSON").shape});var Ug=Re([Vt,Gt,Gi,Vi,on]),XI=xe(I(),Ug),$l=k({refreshers:be(I()),...Be.shape,...$e(we(),"DYNAMIC").shape});var za=k({...Be.shape,...$e(Og(),"MARKDOWN").shape});var Hi=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Hi||{}),jo=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(jo||{}),Mo=(u=>(u.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",u.COMMUNICATION="COMMUNICATION",u.COMMERCE="COMMERCE",u.CORE="CORE",u.UNIVERSAL_AI="UNIVERSAL_AI",u.FLOW_CONTROL="FLOW_CONTROL",u.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",u.ACCOUNTING="ACCOUNTING",u.PRODUCTIVITY="PRODUCTIVITY",u.CONTENT_AND_FILES="CONTENT_AND_FILES",u.DEVELOPER_TOOLS="DEVELOPER_TOOLS",u.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",u.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",u.HUMAN_RESOURCES="HUMAN_RESOURCES",u.PAYMENT_PROCESSING="PAYMENT_PROCESSING",u.MARKETING="MARKETING",u.SALES_AND_CRM="SALES_AND_CRM",u))(Mo||{});var Wi=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Wi||{}),Ol="both_client_credentials_and_authorization_code";var un=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(un||{}),Zi=(a=>(a.NONE="NONE",a.HEADER_PRESENT="HEADER_PRESENT",a.QUERY_PRESENT="QUERY_PRESENT",a.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",a.HEAD_REQUEST="HEAD_REQUEST",a))(Zi||{}),QI=k({strategy:Ne(Zi),paramName:Y(I())}),Ki=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Ki||{});var Ua=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ua||{}),kg=k({status:Y($t()),body:Y(we()),headers:Y(xe(I(),I()))}),jg=k({type:ge("DELAY"),resumeDateTime:I(),requestIdToReply:Y(I()),handlerId:Y(I()),streamStepProgress:Y(Ne(Ua))}),Mg=k({type:ge("WEBHOOK"),requestId:I(),requestIdToReply:Y(I()),response:kg,handlerId:Y(I()),streamStepProgress:Y(Ne(Ua))}),eR=Re([jg,Mg]);var tR=k({body:we(),rawBody:Y(we()),headers:xe(I(),I()),queryParams:xe(I(),I())});function Et(t){return t==null}o(Et,"isNil");function Ji(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(Ji,"isEmpty");function ka(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(ka,"assertNotNullOrUndefined");var Dl=ze(require("crypto"),1);var rR=128,eo,Fo,nR=o(t=>{!eo||eo.length<t?(eo=Buffer.allocUnsafe(t*rR),Dl.default.randomFillSync(eo),Fo=0):Fo+t>eo.length&&(Dl.default.randomFillSync(eo),Fo=0),Fo+=t},"fillPool"),oR=o(t=>(nR(t|=0),eo.subarray(Fo-t,Fo)),"random"),iR=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(a=e)=>{let f="";for(;;){let m=r(i),h=i;for(;h--;)if(f+=t[m[h]&n]||"",f.length===a)return f}}},"customRandom"),Lg=o((t,e=21)=>iR(t,e,oR),"customAlphabet");var sR="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",qg=21,Y2=I().check(Rn(new RegExp(`^[0-9a-zA-Z]{${qg}}$`))),aR=Lg(sR,qg);var Dn=On($n(t=>t instanceof Date?t.toISOString():t),I()),sr={id:I(),created:Dn,updated:Dn},ot=o(t=>Y(Mi(t)),"Nullable");function Cl(t){return Y(Mi(Ne(t)))}o(Cl,"NullableEnum");var eG=On($n(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),Y(Je())),ja=o(t=>On($n(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),Y(be(t))),"OptionalArrayFromQuery");var nG=xe(I(),we());var Yi=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(Yi||{});var hG=I().check(Rn(/^#[0-9A-Fa-f]{6}$/));var yG=k({filename:I(),data:we(),type:ge("file"),mimetype:Y(I())});var uR=ze(Vg());var TG=k({...sr,name:I(),permissions:be(I()),platformId:ot(I()),type:I(),userCount:Y($t())});var Gg=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Gg||{}),Nl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Nl||{}),zl=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(zl||{});var Ul=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Ul||{});var kl=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(kl||{});var cR=k({mode:Ne(Gg),value:we()}),lR=k({auth:Y(I()),fields:xe(I(),cR)}),dR=k({pieceName:I(),pieceVersion:I(),actionName:I(),predefinedInput:Y(lR)}),pR=k({type:ge("PIECE"),toolName:I().check(_r(1)),pieceMetadata:dR}),fR=k({type:ge("none")}),mR=k({type:ge("access_token"),accessToken:I()}),hR=k({type:ge("api_key"),apiKey:I(),apiKeyHeader:I()}),gR=k({type:ge("headers"),headers:xe(I(),I())}),yR=ko("type",[fR,mR,hR,gR]),Hg=k({type:ge("FLOW"),toolName:I().check(_r(1)),externalFlowId:I(),flowDisplayName:Y(I())}),Wg=k({type:ge("MCP"),toolName:I().check(_r(1)),serverUrl:Rg(),protocol:Ne(zl),auth:yR}),Zg=k({type:ge("KNOWLEDGE_BASE"),toolName:I().check(_r(1)),sourceType:Ne(Nl),sourceId:I(),sourceName:I()}),vR=ko("type",[pR,Hg,Wg,Zg]),_R=k({displayName:I(),description:Y(I()),type:Ne(Ul)}),Kg=k({type:ge("MARKDOWN"),markdown:I()}),Lo={type:ge("TOOL_CALL"),input:ot(xe(I(),we())),output:Y(we()),toolName:I(),status:Ne(kl),toolCallId:I(),startTime:I(),endTime:Y(I())},YG=k(Lo),Jg=ko("toolCallType",[k({...Lo,toolCallType:ge("PIECE"),pieceName:I(),pieceVersion:I(),actionName:I()}),k({...Lo,toolCallType:ge("FLOW"),displayName:I(),externalFlowId:I()}),k({...Lo,toolCallType:ge("MCP"),displayName:I(),serverUrl:I()}),k({...Lo,toolCallType:ge("KNOWLEDGE_BASE"),displayName:I(),sourceType:I()}),k({...Lo,toolCallType:ge("UNKNOWN"),displayName:I()})]),PR=Re([Kg,Jg]);var jl=(r=>(r.IMAGE="image",r.TEXT="text",r))(jl||{}),cn=k({apiKey:I()}),wR=cn,xR=k({apiKey:I(),apiKeyHash:I()}),SR=cn,TR=cn,ER=cn,bR=cn,AR=cn,IR=cn,RR=cn,Yg=k({accessKeyId:I().check(_r(1)),secretAccessKey:I().check(_r(1))}),$R=k({}),OR=k({}),DR=k({}),CR=k({}),NR=k({}),zR=k({}),Xg=k({modelId:I(),modelName:I(),modelType:Ne(jl)}),Qg=k({apiKeyHeader:I(),baseUrl:I(),models:be(Xg),defaultHeaders:Y(xe(I(),I()))}),ey=k({accountId:I(),gatewayId:I(),models:be(Xg),vertexProject:Y(I()),vertexRegion:Y(I())}),ty=k({resourceName:I(),apiVersion:On($n(t=>typeof t=="string"&&t.trim().length===0?void 0:t),Y(I()))}),ry=k({region:I().check(_r(1))}),UR=Re([wR,ER,bR,AR,IR,TR,SR,xR,Yg,RR]),ny=Re([Qg,ey,ty,ry,$R,DR,CR,NR,OR,zR]),kR=k({id:I(),name:I(),type:Ne(jl)}),jR=k({id:I(),name:I(),provider:Ne(Yi),config:ny,enabledForChat:Je()}),MR=k({provider:Ne(Yi),config:ny,auth:UR,platformId:I()});var tH={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var FR=k({base64Url:I(),fileName:I(),extension:Y(I())}),LR=k({mimeType:I(),url:I(),fileName:Y(I())}),Ml=Re([FR,LR]);var qR=Re([k({type:ge("file"),value:Ml}),k({type:ge("markdown"),value:I(),files:Y(be(Ml))})]),BR=k({sessionId:I(),message:I(),files:Y(be(I()))});var iy=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(iy||{}),sy=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(sy||{}),Fl=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Fl||{});var VR=Re([k({...sr,name:I(),externalId:I(),type:ge("STATIC_DROPDOWN"),tableId:I(),projectId:I(),data:k({options:be(k({value:I()}))})}),k({...sr,name:I(),externalId:I(),type:Re([ge("TEXT"),ge("NUMBER"),ge("DATE")]),tableId:I(),projectId:I()})]),GR=k({...sr,name:I(),folderId:ot(I()),projectId:I(),externalId:I(),status:Cl(sy),trigger:Cl(iy)}),HR=k({...sr,tableId:I(),projectId:I(),cells:xe(I(),k({updated:I(),created:I(),value:we(),fieldName:I()}))}),WR=k({events:be(Ne(Fl)),webhookUrl:I(),flowId:I()}),ZR=k({fields:be(k({id:I(),name:I()})),rows:be(xe(I(),I())),name:I()}),KR=k({projectId:I(),limit:Y(Fi.number()),cursor:Y(I()),name:Y(I()),externalIds:ja(I()),folderId:Y(I()),folderIds:ja(I())}),JR=k({records:be(be(k({fieldId:I(),value:uy()}))),tableId:I()}),YR=k({cells:Y(be(k({fieldId:I(),value:uy()}))),tableId:I(),agentUpdate:Y(Je())}),ay=ko("operator",[to("eq"),to("neq"),to("gt"),to("gte"),to("lt"),to("lte"),to("co"),oy("exists"),oy("not_exists")]),XR=k({tableId:I(),limit:Y(Fi.number()),cursor:Y(I()),filters:ja(ay)});function uy(){return On($n(t=>t==null?t:String(t)),Mi(I()))}o(uy,"coerceToString");function to(t){return k({fieldId:I(),operator:ge(t),value:I()})}o(to,"valueFilter");function oy(t){return k({fieldId:I(),operator:ge(t)})}o(oy,"existenceFilter");var QR=k({status:Y($t()),body:Y(we()),headers:Y(xe(I(),I()))}),e0=k({...sr,deleted:ot(Dn),ownerId:I(),displayName:I(),platformId:I(),externalId:ot(I())});var cy=k({name:I(),description:Y(I()),type:I(),required:Je()}),t0=k({pieceName:I(),triggerName:I(),input:k({toolName:I(),toolDescription:I(),inputSchema:be(cy),returnsResponse:Je()})});var ly="^[0-9]+\\.[0-9]+\\.[0-9]+$",PH=new RegExp(ly),n0="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",wH=I().check(Rn(new RegExp(ly))),xH=I().check(Rn(new RegExp(n0))),o0=k({packageType:ge("ARCHIVE"),pieceType:Ne(jo),pieceName:I(),pieceVersion:I(),archiveId:I(),platformId:I()}),dy=k({packageType:ge("REGISTRY"),pieceType:ge("OFFICIAL"),pieceName:I(),pieceVersion:I()}),py=k({packageType:ge("REGISTRY"),pieceType:ge("CUSTOM"),pieceName:I(),pieceVersion:I(),platformId:I()}),SH=Re([dy,py]),TH=Re([o0,dy,py]),fy=(e=>(e.CRON_EXPRESSION="CRON_EXPRESSION",e))(fy||{}),i0=k({type:Ne(fy),cronExpression:I(),timezone:I()}),EH=k({...sr,type:Ne(un),projectId:I(),flowId:I(),triggerName:I(),schedule:ot(i0),flowVersionId:I(),pieceName:I(),pieceVersion:I(),deleted:ot(I()),simulate:Je()}),my=(b=>(b.UNKNOWN="UNKNOWN",b.FLOW_RUN_LOG="FLOW_RUN_LOG",b.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",b.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",b.FLOW_STEP_FILE="FLOW_STEP_FILE",b.SAMPLE_DATA="SAMPLE_DATA",b.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",b.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",b.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",b.PROJECT_RELEASE="PROJECT_RELEASE",b.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",b.PLATFORM_ASSET="PLATFORM_ASSET",b.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",b.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",b.KNOWLEDGE_BASE="KNOWLEDGE_BASE",b.FLOW_BUNDLE="FLOW_BUNDLE",b))(my||{}),hy=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(hy||{}),gy=(r=>(r.S3="S3",r.DB="DB",r))(gy||{}),bH=k({...sr,projectId:ot(I()),platformId:ot(I()),type:Ne(my),compression:Ne(hy),data:Y(we()),location:Ne(gy),size:ot($t()),fileName:ot(I()),s3Key:ot(I()),metadata:ot(xe(I(),I()))}),yy=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(yy||{}),vy=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(vy||{}),AH=k({id:I(),email:I(),firstName:I(),status:Ne(vy),externalId:ot(I()),platformId:ot(I()),platformRole:Ne(yy),lastName:I(),created:Dn,updated:Dn,lastActiveDate:ot(Dn),imageUrl:ot(I())});var ql=k({...Be.shape,...$e(xe(I(),we()),"OBJECT").shape});var wy=k({...Be.shape,...$e(I(),"COLOR").shape});var Bl=Re([Vt,nn,za,sn,Gt,on,Rl,Li,$l,an,Vi,ql,Gi,Bi,qi,wy]),oe={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 Dr=k({displayName:I(),description:Y(I())});var xy=k({username:I(),password:I()}),Vl=k({...Dr.shape,username:k({displayName:I(),description:Y(I())}),password:k({displayName:I(),description:Y(I())}),...$e(xy,"BASIC_AUTH").shape});var c0=xe(I(),Re([Vt,nn,an,sn,Gt])),Gl=k({...Dr.shape,props:c0,...$e(we(),"CUSTOM_AUTH").shape});var ro=k({...Dr.shape,...$e(k({auth:I()}),"SECRET_TEXT").shape});var l0=xe(I(),Re([Vt,nn,ro,an,sn,Gt,on,za])),Sy=k({...Dr.shape,props:l0,...$e(we(),"OIDC").shape});var Hl=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Hl||{}),Ty=Re([Vt,ro,Gt]),Ey=xe(I(),Ty),d0=k({props:Y(xe(I(),Ty)),authUrl:I(),tokenUrl:I(),scope:be(I()),prompt:Y(Re([ge("none"),ge("consent"),ge("login"),ge("omit")])),pkce:Y(Je()),pkceMethod:Y(Re([ge("plain"),ge("S256")])),authorizationMethod:Y(Ne(Hl)),grantType:Y(Re([Ne(Wi),ge(Ol)])),extra:Y(xe(I(),I()))}),by=k({access_token:I(),props:Y(Ey),data:xe(I(),ji())}),Wl=k({...Dr.shape,...d0.shape,...$e(by,"OAUTH2").shape});var qo=Re([Vl,Gl,Sy,Wl,ro]),Xi="Connection",Fa={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||Xi}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||Xi,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||Xi}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||Xi}},None(){}};var iZ={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 p0=k({...Be.shape,...$e(we(),"CUSTOM").shape,code:I()});var f0=Re([Bl,qo]),Zl=xe(I(),f0),EZ=xe(I(),Bl);var Ay=Re([k({strategy:ge("CRON"),cronExpression:I()}),k({strategy:ge("NONE")})]),Bo=class{constructor(e,r,n,i,a,f,m,h,_,P,E,S,w,T,$,b,u,p,c){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=a;this.type=f;this.handshakeConfiguration=m;this.onHandshake=h;this.renewConfiguration=_;this.onRenew=P;this.onEnable=E;this.onDisable=S;this.onStart=w;this.run=T;this.test=$;this.sampleData=b;this.testStrategy=u;this.outputSchema=p;this.aiMetadata=c}static{o(this,"ITrigger")}},La=o(t=>{switch(t.type){case"WEBHOOK":return new Bo(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 Bo(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 Bo(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 Bo(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,Et(t.sampleData)&&Et(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var Iy="2",qa="0.82.0";var Kl=class{constructor(e,r,n,i,a,f,m,h,_=qa,P,E=""){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=m;this.auth=h;this.minimumSupportedRelease=_;this.maximumSupportedRelease=P;this.description=E;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Iy}),"getContextInfo");(!m0(_)||h0(_,qa))&&(this.minimumSupportedRelease=qa),a.forEach(S=>this._actions[S.name]=S),f.forEach(S=>this._triggers[S.name]=S)}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,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(a=>a.type===r.type)))throw new Error("Auth properties must be unique by type");return new Kl(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description)},"createPiece");function m0(t){return/^\d+\.\d+\.\d+$/.test(t)}o(m0,"isValidSimpleSemver");function h0(t,e){let[r,n,i]=t.split(".").map(Number),[a,f,m]=e.split(".").map(Number);return r!==a?r<a:n!==f?n<f:i<m}o(h0,"isSemverLessThan");var g0=Y(xe(I(),xe(I(),I()))),$y=k({id:Y(I()),name:I(),displayName:I(),logoUrl:I(),description:I(),authors:be(I()),platformId:Y(I()),directoryPath:Y(I()),auth:Y(Re([qo,be(qo)])),version:I(),categories:Y(be(Ne(Mo))),minimumSupportedRelease:Y(I()),maximumSupportedRelease:Y(I()),i18n:g0}),y0=Ne(["human","ai","both"]),Oy=k({description:Y(I()),idempotent:Y(Je())}),Dy=k({name:I(),displayName:I(),description:I(),props:Zl,requireAuth:Je(),errorHandlingOptions:Y(Il),outputSchema:Y(Ca()),audience:Y(y0),aiMetadata:Y(Oy)}),Cy=k({name:I(),displayName:I(),description:I(),props:Zl,errorHandlingOptions:Y(Il),type:Ne(un),sampleData:we(),handshakeConfiguration:Y(Ca()),renewConfiguration:Y(Ay),testStrategy:Ne(Ki),outputSchema:Y(Ca()),aiMetadata:Y(Oy)}),v0=k({...$y.shape,actions:xe(I(),Dy),triggers:xe(I(),Cy)}),_0=k({...$y.shape,actions:$t(),triggers:$t(),suggestedActions:Y(be(Cy)),suggestedTriggers:Y(be(Dy))}),Ny=k({projectUsage:$t(),tags:Y(be(I())),pieceType:Ne(jo),packageType:Ne(Hi),platformId:Y(I()),archiveId:Y(I())}),E3=k({...v0.shape,...Ny.shape}),b3=k({..._0.shape,...Ny.shape}),A3=k({name:I(),version:I()});var P0=ze(require("path")),w0=ze(require("fs/promises"));var Ba=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((a,f)=>{i.append(f,a)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};if(e.authentication&&this.populateAuthentication(e.authentication,r),e.body)switch(e.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return e.headers&&(r={...r,...e.headers}),r}populateAuthentication(e,r){this.authenticationConverter.convert(e,r)}};var Va=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new Jl,r=new Yl){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},Jl=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},Yl=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 Ga=class extends Error{constructor(r,n){let i=n.status||500,a=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:a},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=a}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}}};var Ha=class extends Ba{static{o(this,"FetchHttpClient")}constructor(e="",r=new Va){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),a=this.getHeaders(e),f=e.queryParams??{};for(let[c,y]of Object.entries(f))i.append(c,y);let m=i.toString(),h=m?`${n}?${m}`:n,_=e.responseType??"json",P=e.followRedirects??!0,E=e.retries??0,{body:S,extraHeaders:w,isStream:T}=x0(e.body,a),$=T0({...a,...w}),b=await S0(async()=>{let c=new AbortController,y=e.timeout&&e.timeout>0?setTimeout(()=>c.abort(),e.timeout):void 0;try{let l={method:e.method.toString(),headers:$,body:S,redirect:P?"follow":"manual",signal:c.signal};return T&&(l.duplex="half"),r?.dispatcher!==void 0&&(l.dispatcher=r.dispatcher),await fetch(h,l)}finally{y!==void 0&&clearTimeout(y)}},E),u=P?300:400;if(b.status<200||b.status>=u){let c=await zy(b,_),y=new Ga(e.body,{status:b.status,responseBody:c});throw console.error("[HttpClient#(sanitized error message)] Request failed:",y),y}let p=await zy(b,_);return{status:b.status,headers:E0(b.headers),body:p}}};function x0(t,e){return A0(t)?{body:void 0,extraHeaders:{},isStream:!1}:b0(t)?{body:t,extraHeaders:t.getHeaders(),isStream:!0}: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(x0,"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();case"json":default:{let r=await t.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(zy,"parseResponseBody");async function S0(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(S0,"sendWithRetries");function Uy(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(Uy,"backoff");function T0(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&(e[r]=Array.isArray(n)?n.join(", "):n);return e}o(T0,"normalizeHeaders");function E0(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(E0,"toHttpHeaders");function b0(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"}o(b0,"isNodeFormData");function A0(t){return t==null}o(A0,"isNil");var no=new Ha;var Qi=(f=>(f.GET="GET",f.POST="POST",f.PATCH="PATCH",f.PUT="PUT",f.DELETE="DELETE",f.HEAD="HEAD",f))(Qi||{});var mO=ze(require("fs")),M_=ze(j_());var hO={"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 gO(t){let e=t.split(";")[0].trim().toLowerCase();return hO[e]??""}o(gO,"contentTypeToExtension");var yO=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),vO=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 F_({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:a,props:f,extraProps:m,authLocation:h="headers"}){return qe({audience:"human",name:a||"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:oe.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:_})=>({url:oe.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
69
- i.e ${vO(e,_)}/resource or /resource`,required:!0,defaultValue:_?e(_):"",...f?.url??{}})}),"props")}),method:oe.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Qi).map(_=>({label:_,value:_}))},...f?.method??{}}),headers:oe.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...f?.headers??{}}),queryParams:oe.Object({displayName:"Query Parameters",required:!0,...f?.queryParams??{}}),body_type:oe.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:oe.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:_})=>{if(!_)return{};let P=_,E={};switch(P){case"none":break;case"json":E.data=oe.Json({displayName:"JSON Body",required:!0,...f?.body??{}});break;case"raw":E.data=oe.LongText({displayName:"Raw Body",required:!0});break;case"form_data":E.data=oe.Array({displayName:"Form Data",required:!0,properties:{fieldName:oe.ShortText({displayName:"Field Name",required:!0}),fieldType:oe.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:oe.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:oe.File({displayName:"File Field Value",required:!1})}});break}return E},"props")}),response_is_binary:oe.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:oe.Checkbox({displayName:"No Error on Failure",required:!1,...f?.failsafe??{}}),timeout:oe.Number({displayName:"Timeout (in seconds)",required:!1,...f?.timeout??{}}),followRedirects:oe.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...m},run:o(async _=>{let{method:P,url:E,headers:S,queryParams:w,body:T,body_type:$,failsafe:b,timeout:u,response_is_binary:p,followRedirects:c}=_.propsValue;ka(P,"Method"),ka(E,"URL");let y=Et(r)?{}:await r(_.auth,_.propsValue),l=E.url,x=l.startsWith("http://")||l.startsWith("https://")?l:yO({baseUrl:e(_.auth),relativePath:l}),g={method:P,url:x,headers:{...S??{},...h==="headers"||!Et(h)?y:{}},queryParams:{...h==="queryParams"?y:{},...w??{}},timeout:u?u*1e3:0,followRedirects:c};if(p&&(g.responseType="arraybuffer"),T)if($&&$!=="none"){let re=T.data;if($==="form_data"){let ee=re,Te=new M_.default;for(let{fieldName:ne,fieldType:K,textFieldValue:Z,fileFieldValue:Q}of ee)K==="text"&&!Ji(Z)?Te.append(ne,Z):K==="file"&&!Ji(Q)&&Te.append(ne,Q.data,{filename:Q?.filename});g.body=Te,g.headers={...g.headers,...Te.getHeaders()}}else g.body=re}else $||(g.body=T);try{let re=await no.sendRequest(g);return await _O(_.files,re.body,re.status,re.headers,p)}catch(re){if(b)return re.errorMessage();throw re}},"run")})}o(F_,"createCustomApiCallAction");var _O=o(async(t,e,r,n,i)=>{let a;if(i&&PO(e)){let f=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],m=gO(f??"")||"txt",h;e instanceof ArrayBuffer?h=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?h=e:h=Buffer.from(e),a=await t.write({fileName:`output.${m}`,data:h})}else a=e;return{status:r,headers:n,body:a}},"handleBinaryResponse"),PO=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var Cr={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:a,server:f}){switch(t.strategy){case 0:{let m=await e.get("lastPoll");if(Et(m))throw new Error("lastPoll doesn't exist in the store.");let h=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:m,server:f}),_=h.reduce((P,E)=>Math.max(P,E.epochMilliSeconds),m);return await e.put("lastPoll",_),h.filter(P=>P.epochMilliSeconds>m).map(P=>P.data)}case 1:{let m=await e.get("lastItem"),h=await t.items({store:e,auth:r,propsValue:n,lastItemId:m,files:a,server:f}),_=h.findIndex(S=>S.id===m),P=[];Et(m)||_==-1?P=h??[]:P=h?.slice(0,_)??[],Et(i)||(P=P.slice(-i));let E=P?.[0]?.id;return Et(E)||await e.put("lastItem",E),P.map(S=>S.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 f=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;Et(f)?await e.delete("lastItem"):await e.put("lastItem",f);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:a}){let f=[];switch(t.strategy){case 0:{f=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:a});break}case 1:{f=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:a});break}}return wO(f.map(m=>m.data))}};function wO(t){return t.length<=5?t:t.slice(0,5)}o(wO,"getFirstFiveOrAll");var vc=ze(zs());var HS=["https://www.googleapis.com/auth/drive"],Oe=[Fa.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:HS}),Fa.CustomAuth({displayName:"Service Account (Advanced)",description:"Authenticate via service account from https://console.cloud.google.com/ > IAM & Admin > Service Accounts > Create Service Account > Keys > Add key. <br> <br> You can optionally use domain-wide delegation (https://support.google.com/a/answer/162106?hl=en#zippy=%2Cset-up-domain-wide-delegation-for-a-client) to access files without adding the service account to each one. <br> <br> **Note:** Without a user email, the service account only has access to files/folders you explicitly share with it.",required:!0,props:{serviceAccount:oe.LongText({displayName:"Service Account JSON Key",required:!0}),userEmail:oe.ShortText({displayName:"User Email",required:!1,description:"Email address of the user to impersonate for domain-wide delegation."})},validate:o(async({auth:t})=>{try{await hr({type:"CUSTOM_AUTH",props:{...t}})}catch(e){return{valid:!1,error:e.message}}return{valid:!0}},"validate")})];async function Ve(t){if(t.type==="CUSTOM_AUTH"){let r;try{r=JSON.parse(t.props.serviceAccount)}catch{throw new Error("Invalid Service Account JSON Key. Please provide a valid JSON string.")}return new vc.JWT({email:r.client_email,key:r.private_key,scopes:HS,subject:t.props.userEmail})}let e=new vc.OAuth2Client;return e.setCredentials(t),e}o(Ve,"createGoogleClient");var hr=o(async t=>{if(t.type==="CUSTOM_AUTH"){let r=await(await Ve(t)).getAccessToken();if(r.token)return r.token;throw new Error("Could not retrieve access token from service account json")}return t.access_token},"getAccessToken");var AE=ze(Ct());var xm=ze(kc()),Sm=ze(Ct());var dj=1e3,pj=o(t=>t.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),"escapeDriveQueryLiteral"),ke={properties:{parentFolder:oe.Dropdown({displayName:"Parent Folder",description:"The Drive folder to target. Leave empty to use the root of My Drive. Type in the box to search your Drive by folder name. If the folder still isn't listed, switch this field to 'Dynamic value' (the toggle next to the field) and paste the folder ID \u2014 you can copy it from the folder's URL in Drive, after /folders/ (e.g. https://drive.google.com/drive/folders/<FOLDER_ID>).",required:!1,auth:Oe,refreshers:["include_team_drives"],refreshOnSearch:!0,options:o(async({auth:t,include_team_drives:e},r)=>{if(!t)return{disabled:!0,options:[],placeholder:"Please authenticate first"};let i=await hr(t),a=r?.searchValue?.trim()??"",f=["mimeType='application/vnd.google-apps.folder'","trashed = false"];a.length>0&&f.push(`name contains '${pj(a)}'`);let m={method:"GET",url:"https://www.googleapis.com/drive/v3/files",queryParams:{q:f.join(" and "),includeItemsFromAllDrives:e?"true":"false",supportsAllDrives:"true",corpora:e?"allDrives":"user",pageSize:String(dj),fields:"nextPageToken, files(id, name)"},authentication:{type:"BEARER_TOKEN",token:i}},h=[],_=!1;try{let P=await no.sendRequest(m);h=P.body.files??[],_=!!P.body.nextPageToken}catch(P){throw new Error(`Failed to get folders
70
- Error:${P}`)}return{disabled:!1,placeholder:_?`Showing first ${h.length} matches \u2014 type to narrow the list, or switch to Dynamic value to paste an ID.`:void 0,options:h.map(P=>({label:P.name,value:P.id}))}},"options")}),include_team_drives:oe.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},async getFiles(t,e,r){let n=await Ve(t),i=(0,Sm.drive)({version:"v3",auth:n}),a=[];e?.parent&&a.push(`'${e.parent}' in parents`),e?.createdTime&&a.push(`createdTime ${e.createdTimeOp??">"} '${(0,xm.default)(e.createdTime).format()}'`),a.push("trashed = false");let f=[],m;do{let h={q:a.concat("mimeType!='application/vnd.google-apps.folder'").join(" and "),fields:"nextPageToken, files(id, name, mimeType, webViewLink, kind, createdTime)",orderBy:r??"createdTime desc",supportsAllDrives:!0,includeItemsFromAllDrives:e?.includeTeamDrive,corpora:e?.includeTeamDrive?"allDrives":"user"};m&&(h.pageToken=m);let _=await i.files.list(h);f.push(..._.data.files??[]),m=_.data.nextPageToken??void 0}while(m);return f},async getFolders(t,e,r){let n=await Ve(t),i=(0,Sm.drive)({version:"v3",auth:n}),a=["mimeType='application/vnd.google-apps.folder'"];e?.parent&&a.push(`'${e.parent}' in parents`),e?.createdTime&&a.push(`createdTime ${e.createdTimeOp??">"} '${(0,xm.default)(e.createdTime).format()}'`),a.push("trashed = false");let f=[],m;do{let h={q:a.join(" and "),fields:"nextPageToken, files(id, name, createdTime)",orderBy:r??"createdTime desc",supportsAllDrives:!0,includeItemsFromAllDrives:e?.includeTeamDrive,corpora:e?.includeTeamDrive?"allDrives":"user"};m&&(h.pageToken=m);let _=await i.files.list(h);f.push(..._.data.files??[]),m=_.data.nextPageToken??void 0}while(m);return f}};var dE={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},pE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},fE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},mE={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},hE={fields:[{key:"name",label:"Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},gE={fields:[{key:"files",label:"Files",labelKey:"name",listItems:[{key:"name",label:"Name",value:"name"},{key:"id",label:"File ID",value:"id"},{key:"mimeType",label:"MIME Type",value:"mimeType"},{key:"trashed",label:"Trashed",value:"trashed",format:"boolean"},{key:"parents",label:"Parent Folder ID",value:"parents[0]"}]},{key:"incompleteSearch",label:"Incomplete Search",value:"incompleteSearch",format:"boolean"}]},yE={fields:[{key:"results",label:"Results",value:"",labelKey:"name",listItems:[{key:"name",label:"Name",value:"name"},{key:"mimeType",label:"MIME Type",value:"mimeType"},{key:"id",label:"File ID",value:"id"},{key:"createdTime",label:"Created Time",value:"createdTime",format:"datetime"},{key:"modifiedTime",label:"Modified Time",value:"modifiedTime",format:"datetime"}]}]},vE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},_E={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},PE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"iconLink",label:"Icon",format:"image"},{key:"size",label:"Size",format:"filesize"},{key:"fileExtension",label:"File Extension"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"shared",label:"Shared",format:"boolean"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]},{key:"lastModifyingUser",label:"Last Modifying User",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]},{key:"permissions",label:"Permissions",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"role",label:"Role"},{key:"type",label:"Type"},{key:"id",label:"Permission ID"}]}]},wE={fields:[{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"id",label:"Permission ID"},{key:"allowFileDiscovery",label:"Allow File Discovery",format:"boolean"},{key:"downloadUrl",label:"Download URL",format:"url"},{key:"kind",label:"Kind"}]},xE={fields:[{key:"role",label:"Role"},{key:"type",label:"Type"},{key:"id",label:"Permission ID"}]},SE={fields:[{key:"removed",label:"Removed",value:"removed",format:"boolean"},{key:"message",label:"Message",value:"message"}]},TE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},EE={fields:[{key:"name",label:"File Name"},{key:"webViewLink",label:"View Link",format:"url"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"id",label:"File ID"}]},bE={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"createdTime",label:"Created Time",format:"datetime"}]};var IE=qe({auth:Oe,name:"update_permissions",description:"Update permissions for a file or folder",audience:"both",aiMetadata:{description:"Grants a specified role (reader, commenter, writer, fileOrganizer, or organizer) on a Drive file or folder to a user identified by email, optionally sending a notification email. Use to share a resource with a person. Requires the file/folder ID and target email. Not idempotent: each call creates a new permission grant.",idempotent:!1},displayName:"Update permissions",props:{fileId:oe.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:oe.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:oe.StaticDropdown({displayName:"Role",description:"The role to grant to user. See more at: https://developers.google.com/drive/api/guides/ref-roles",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}}),include_team_drives:ke.properties.include_team_drives,send_invitation_email:oe.Checkbox({displayName:"Send invitation email",description:"Send an email to the user to notify them of the new permissions",required:!0})},outputSchema:xE,async run(t){let{fileId:e,user_email:r,permission_name:n,send_invitation_email:i,include_team_drives:a}=t.propsValue,f=await Ve(t.auth),m=(0,AE.drive)({version:"v3",auth:f}),h={type:"user",role:n,emailAddress:r};return(await m.permissions.create({requestBody:h,fileId:e,sendNotificationEmail:i,supportsAllDrives:a})).data}});var RE=ze(Ct());var $E=qe({auth:Oe,name:"create_new_gdrive_folder",description:"Create a new empty folder in your Google Drive",audience:"both",aiMetadata:{description:"Creates a new empty folder in Google Drive, optionally nested under a parent folder. Use to set up a destination before uploading or moving files. Not idempotent: each call creates a distinct folder even with the same name (Drive permits duplicate folder names).",idempotent:!1},displayName:"Create new folder",props:{folderName:oe.ShortText({displayName:"Folder name",description:"The name of the new folder",required:!0}),parentFolder:ke.properties.parentFolder,include_team_drives:ke.properties.include_team_drives},outputSchema:dE,async run(t){let e=await Ve(t.auth);return(await(0,RE.drive)({version:"v3",auth:e}).files.create({requestBody:{mimeType:"application/vnd.google-apps.folder",name:t.propsValue.folderName,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},supportsAllDrives:t.propsValue.include_team_drives})).data}});var OE=ze(Ct());var DE=qe({auth:Oe,name:"create_new_gdrive_file",description:"Create a new text file in your Google Drive from text",audience:"both",aiMetadata:{description:"Creates a new file in Google Drive from inline text content as plain text, CSV, or XML, optionally inside a parent folder. Use when an agent has generated text it needs to persist as a Drive file. Not idempotent: each call creates a new file.",idempotent:!1},displayName:"Create new file",props:{fileName:oe.ShortText({displayName:"File name",description:"The name of the new text file",required:!0}),text:oe.LongText({displayName:"Text",description:"The text content to add to file",required:!0}),fileType:oe.StaticDropdown({displayName:"Content type",description:"Select file type",required:!0,defaultValue:"text/plain",options:{options:[{label:"Text",value:"text/plain"},{label:"CSV",value:"text/csv"},{label:"XML",value:"text/xml"}]}}),parentFolder:ke.properties.parentFolder,include_team_drives:ke.properties.include_team_drives},outputSchema:pE,async run(t){let e=await Ve(t.auth),r=(0,OE.drive)({version:"v3",auth:e}),n=t.propsValue.fileType==="plain/text"?"text/plain":t.propsValue.fileType;return(await r.files.create({requestBody:{name:t.propsValue.fileName,mimeType:n,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},media:{mimeType:n,body:t.propsValue.text},supportsAllDrives:t.propsValue.include_team_drives??!1,fields:"id, name, mimeType, kind"})).data}});var CE=ze(Ct());var NE=qe({auth:Oe,name:"delete_permissions",description:"Removes a role from an user for a file or folder",audience:"both",aiMetadata:{description:"Revokes a specific role from a user (matched by email and role) on a Drive file or folder. Use to unshare or downgrade access for someone. Requires the file/folder ID, the user email, and the role to remove. Idempotent: if no matching permission exists, the call is a no-op.",idempotent:!0},displayName:"Delete permissions",props:{fileId:oe.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:oe.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:oe.StaticDropdown({displayName:"Role",description:"The role to remove from user.",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}})},outputSchema:SE,async run(t){let[e,r]=[t.propsValue.fileId,t.propsValue.user_email],n=await Ve(t.auth),i=(0,CE.drive)({version:"v3",auth:n}),a=await i.permissions.list({fileId:e,fields:"permissions(id, emailAddress, role)"});if(a.data.permissions){for(let f of a.data.permissions)if(f.emailAddress===r&&f.role===t.propsValue.permission_name)return await i.permissions.delete({fileId:e,permissionId:f.id?f.id:""}),{removed:!0,message:"Permission removed"}}return{removed:!1,message:"Permission not found"}}});var zE=ze(Ct());var UE=qe({displayName:"Duplicate File",auth:Oe,name:"duplicate_file",description:"Duplicate a file from Google Drive. Returns the new file ID.",audience:"both",aiMetadata:{description:"Copies an existing Drive file into a target folder under a new name, optionally converting it to a Google Sheet or Google Doc. Use to clone a file or create an editable Google-format copy. Requires the source file ID and destination folder ID. Not idempotent: each call creates a new copy.",idempotent:!1},props:{fileId:oe.ShortText({displayName:"File ID",description:"The ID of the file to duplicate",required:!0}),name:oe.ShortText({displayName:"Name",description:"The name of the new file",required:!0}),folderId:oe.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be duplicated",required:!0}),mimeType:oe.StaticDropdown({displayName:"Duplicate as",description:"If left unselected the file will be duplicated as it is",required:!1,options:{options:[{label:"Google Sheets",value:"application/vnd.google-apps.spreadsheet"},{label:"Google Docs",value:"application/vnd.google-apps.document"}]}}),include_team_drives:ke.properties.include_team_drives},outputSchema:vE,async run(t){let e=await Ve(t.auth),r=t.propsValue.fileId,n=t.propsValue.name,i=t.propsValue.folderId,a=t.propsValue.mimeType,f=(0,zE.drive)({version:"v3",auth:e}),m={name:n,parents:[i]};a&&(m.mimeType=a);let h=await f.files.copy({fileId:r,auth:e,requestBody:m,supportsAllDrives:t.propsValue.include_team_drives});if(h.status!==200)throw new Error("Error duplicating file");return h.data}});var kE=ze(Ct());var jE=qe({auth:Oe,name:"get-file-or-folder-by-id",displayName:"Get File Information",description:"Get a file folder for files/sub-folders",audience:"both",aiMetadata:{description:"Fetches metadata for a single file or folder in Google Drive by its exact ID (name, MIME type, parents, etc.). Use when an agent already has a file/folder ID and needs its details. Read-only and idempotent. Requires the resource ID, not a name or path.",idempotent:!0},props:{id:oe.ShortText({displayName:"File / Folder Id",description:"The Id of the file/folder to search for.",required:!0}),include_team_drives:ke.properties.include_team_drives},outputSchema:hE,async run(t){let e=await Ve(t.auth),n=await(0,kE.drive)({version:"v3",auth:e}).files.get({fileId:t.propsValue.id,supportsAllDrives:t.propsValue.include_team_drives});return n.data?n.data:(console.log("The specified ID corresponds to a folder. Returning null."),null)}});var Tm=ze(require("querystring"));var FE=ze(Za());async function LE(t,e){let r=await hr(t);return(await fetch(`https://www.googleapis.com/drive/v3/files/${e}?fields=mimeType&supportsAllDrives=true`,{headers:{Authorization:`Bearer ${r}`}}).then(i=>i.json())).mimeType}o(LE,"getMimeType");var ME=o(async(t,e,r,n,i)=>{let a=await LE(e,r),f=await hr(e),m=await fetch(t,{headers:{Authorization:`Bearer ${f}`}}).then(E=>E.ok?E.blob():Promise.reject(E)).catch(E=>Promise.reject(new Error(`Error when download file:
71
- Download file response: ${E.message??E}`))),h=(0,FE.extension)(a),_=h?"."+h:"",P=i??r+_;return n.write({fileName:P,data:Buffer.from(await m.arrayBuffer())})},"googledlCall");async function Gn(t,e,r,n){let i=await LE(t,r);if(["application/vnd.google-apps.document","application/vnd.google-apps.spreadsheet","application/vnd.google-apps.presentation"].includes(i)){switch(i){case"application/vnd.google-apps.document":i="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case"application/vnd.google-apps.spreadsheet":i="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;case"application/vnd.google-apps.presentation":i="application/vnd.openxmlformats-officedocument.presentationml.presentation";break}return await ME(`https://www.googleapis.com/drive/v3/files/${r}/export?mimeType=${i}&supportsAllDrives=true`,t,r,e,n)}else return await ME(`https://www.googleapis.com/drive/v3/files/${r}?alt=media&supportsAllDrives=true`,t,r,e,n)}o(Gn,"downloadFileFromDrive");async function qE(t,e,r,n,i,a=0){let f=[];if(a>r)return f;let m=await hr(t),h=`'${e}' in parents`;n||(h+=" and trashed=false");let _={q:h,fields:"nextPageToken,files(id,kind,mimeType,name,trashed,parents)",supportsAllDrives:"true",includeItemsFromAllDrives:i?"true":"false",corpora:i?"allDrives":"user",pageSize:"1000"},P=await no.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Tm.default.stringify(_)}`,headers:{Authorization:`Bearer ${m}`}});for(let E of P.body.files)f.push({file:E,level:a,parentFolder:e});for(;P.body.nextPageToken;){_.pageToken=P.body.nextPageToken,P=await no.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Tm.default.stringify(_)}`,headers:{Authorization:`Bearer ${m}`}});for(let E of P.body.files)f.push({file:E,level:a,parentFolder:e})}if(a+1<r){let E=f.filter(S=>S.file.mimeType==="application/vnd.google-apps.folder");for(let S of E){let w=await qE(t,S.file.id,r,n,i,a+1);f.push(...w)}}return f}o(qE,"getFilesRecursively");var BE=qe({auth:Oe,name:"list-files",displayName:"List files",description:"List files from a Google Drive folder",audience:"both",aiMetadata:{description:"Lists files and subfolders inside a given Drive folder, with optional recursion to a chosen depth and optional download of each file's content. Use to enumerate the contents of a known folder ID. Read-only and idempotent. Requires the folder ID, not a name.",idempotent:!0},props:{folderId:oe.ShortText({displayName:"Folder ID",description:"Folder ID coming from | New Folder -> id | (or any other source)",required:!0}),include_team_drives:ke.properties.include_team_drives,includeTrashed:oe.Checkbox({displayName:"Include Trashed",description:"Include new files that have been trashed.",required:!1,defaultValue:!1}),depthLevel:oe.Number({displayName:"Depth Level",description:"How many levels deep to search for files. 1 = current folder only, 2 = current + next level, etc.",required:!1,defaultValue:1}),downloadFiles:oe.Checkbox({displayName:"Download Files",description:"Download all file contents in a list",required:!1,defaultValue:!1})},outputSchema:gE,async run(t){let e={type:"drive#fileList",incompleteSearch:!1,files:[]},r=t.propsValue.depthLevel||1,n=await qE(t.auth,t.propsValue.folderId,r,t.propsValue.includeTrashed??!1,t.propsValue.include_team_drives??!1);if(e.files=n.map(i=>i.file),t.propsValue.downloadFiles){let i=[],a={"application/pdf":".pdf","image/jpeg":".jpg","image/png":".png","image/tiff":".tiff","text/plain":".txt","text/csv":".csv","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":".xlsx"};for(let f of n){let m=f.file;if(m.mimeType==="application/vnd.google-apps.folder")continue;let h=m.name,_=a[m.mimeType];_&&!h.toLowerCase().endsWith(_)&&(m.mimeType==="image/jpeg"&&h.toLowerCase().endsWith(".jpeg")||(h=h+_));try{let P=await Gn(t.auth,t.files,m.id,h);i.push(P)}catch(P){console.warn(`Failed to download file ${m.name}: ${P instanceof Error?P.message:"Download failed"}`)}}e.downloadedFiles=i}return e}});var VE=qe({auth:Oe,name:"read-file",displayName:"Read File Content",description:"Read a selected file from google drive file",audience:"both",aiMetadata:{description:"Downloads the content of a Drive file by its file ID and returns it as a usable file reference. Use to retrieve a file an agent already knows the ID of (e.g. from a trigger or search). Read-only and idempotent. Requires the exact file ID, not a name.",idempotent:!0},props:{fileId:oe.ShortText({displayName:"File ID",description:"File ID coming from | New File -> id |",required:!0}),fileName:oe.ShortText({displayName:"Destination File name",required:!1})},outputSchema:mE,run:o(async({auth:t,propsValue:e,files:r})=>Gn(t,r,e.fileId,e.fileName),"run")});var GE=ze(Ct()),HE=require("stream");var WE=qe({displayName:"Save Document as PDF",auth:Oe,name:"save_file_as_pdf",description:"Save a document as PDF in a Google Drive folder",audience:"both",aiMetadata:{description:"Exports a Google document to PDF and saves it as a new file in a target Drive folder. Use to produce a PDF rendition of a Google Doc/Sheet/Slides for sharing or archival. Requires the source document ID and destination folder ID. Not idempotent: each call creates a new PDF file.",idempotent:!1},props:{documentId:oe.ShortText({displayName:"Document ID",description:"The ID of the document to export",required:!0}),folderId:oe.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be exported",required:!0}),name:oe.ShortText({displayName:"Name",description:"The name of the new file (do not include the extension)",required:!0}),include_team_drives:ke.properties.include_team_drives},outputSchema:_E,async run(t){let e=await Ve(t.auth),r=t.propsValue.documentId,n=t.propsValue.folderId,i=t.propsValue.name,a=(0,GE.drive)({version:"v3",auth:e}),f=await a.files.export({fileId:r,mimeType:"application/pdf"},{responseType:"arraybuffer"}),m={name:i+".pdf",parents:[n]},h=Buffer.from(f.data,"base64"),P={mimeType:"application/pdf",body:new HE.Stream.PassThrough().end(h)};return(await a.files.create({requestBody:m,media:P,supportsAllDrives:t.propsValue.include_team_drives})).data}});var ZE=ze(Ct());var KE=qe({auth:Oe,name:"search-folder",displayName:"Search",description:"Search a Google Drive folder for files/sub-folders",audience:"both",aiMetadata:{description:"Searches Google Drive for files or folders matching a name, full-text, or MIME-type query, optionally scoped to a parent folder and filtered to files or folders only. Use to resolve a file/folder ID from a human-readable name before acting on it. Read-only and idempotent.",idempotent:!0},props:{queryTerm:oe.StaticDropdown({displayName:"Query Term",description:"The Query term or field of file/folder to search upon.",defaultValue:"name",options:{options:[{label:"File name",value:"name"},{label:"Full text search",value:"fullText"},{label:"Content type",value:"mimeType"}]},required:!0}),operator:oe.StaticDropdown({displayName:"Operator",description:"The operator to create criteria.",required:!0,options:{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"="}]},defaultValue:"contains"}),query:oe.ShortText({displayName:"Value",description:"Value of the field of file/folder to search for.",required:!0}),type:oe.StaticDropdown({displayName:"File Type",description:"(Optional) Choose between files and folders.",required:!1,options:{options:[{label:"All",value:"all"},{label:"Files",value:"file"},{label:"Folders",value:"folder"}]},defaultValue:"all"}),parentFolder:ke.properties.parentFolder,include_team_drives:ke.properties.include_team_drives},outputSchema:yE,async run(t){let e=await Ve(t.auth),r=(0,ZE.drive)({version:"v3",auth:e}),n=t.propsValue.operator??"contains",a=`${t.propsValue.queryTerm??"name"} ${n} '${t.propsValue.query}'`;switch(t.propsValue.parentFolder&&(a=`${a} and '${t.propsValue.parentFolder}' in parents`),t.propsValue.type??"all"){case"file":a=`${a} and mimeType!='application/vnd.google-apps.folder'`;break;case"folder":a=`${a} and mimeType='application/vnd.google-apps.folder'`;break;default:break}let m=[],h;do{let _={q:a,fields:"nextPageToken, files(id, name, mimeType, createdTime, modifiedTime)",includeItemsFromAllDrives:t.propsValue.include_team_drives,supportsAllDrives:!0,corpora:t.propsValue.include_team_drives?"allDrives":"user",pageSize:1e3};h&&(_.pageToken=h);let P=await r.files.list(_);if(P.status!==200)throw console.error(P),new Error("Error searching for the file/folder");m.push(...P.data.files??[]),h=P.data.nextPageToken??void 0}while(h);return m.length>0?m:(console.log("Resource not found"),[])}});var JE=require("stream"),YE=ze(Za()),XE=ze(Ct());var QE=qe({auth:Oe,name:"upload_gdrive_file",description:"Upload a file in your Google Drive",audience:"both",aiMetadata:{description:"Uploads a binary file (from a URL or base64 input) into Google Drive, optionally inside a parent folder. Use to store an existing file or attachment in Drive; the MIME type is inferred from the file extension. Not idempotent: each call creates a new file.",idempotent:!1},displayName:"Upload file",props:{fileName:oe.ShortText({displayName:"File name",description:"The name of the file",required:!0}),file:oe.File({displayName:"File",description:"The file URL or base64 to upload",required:!0}),parentFolder:ke.properties.parentFolder,include_team_drives:ke.properties.include_team_drives},outputSchema:fE,async run(t){let e=t.propsValue.file,r=YE.default.lookup(e.extension??"")||"application/octet-stream",n=await Ve(t.auth);return(await(0,XE.drive)({version:"v3",auth:n}).files.create({requestBody:{name:t.propsValue.fileName,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},media:{mimeType:r,body:JE.Readable.from(Buffer.from(e.base64,"base64"))},supportsAllDrives:t.propsValue.include_team_drives??!1,fields:"id, name, mimeType, kind"})).data}});var tb=ze(kc());var jc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await ke.getFiles(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(a=>({epochMilliSeconds:(0,tb.default)(a.createdTime).valueOf(),data:a})),"items")},rb=La({auth:Oe,name:"new_file",displayName:"New File",description:"Trigger when a new file is uploaded.",aiMetadata:{description:"Fires when a new file appears in Google Drive, optionally scoped to a specific parent folder. Each event represents one newly created file and its metadata, with optional inclusion of the file content."},props:{parentFolder:ke.properties.parentFolder,include_team_drives:ke.properties.include_team_drives,include_file_content:oe.Checkbox({displayName:"Include File Content",description:"Include the file content in the output. This will increase the time taken to fetch the files and might cause issues with large files.",required:!1,defaultValue:!1})},outputSchema:EE,type:"POLLING",onEnable:o(async t=>{await Cr.onEnable(jc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:o(async t=>{await Cr.onDisable(jc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:o(async t=>{let e=await Cr.poll(jc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await eb(e,t)},"run"),test:o(async t=>{let e=await Cr.test(jc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await eb(e,t)},"test"),sampleData:{kind:"drive#file",mimeType:"image/png",id:"1dpv4-sKJfKRwI9qx1vWqQhEGEn3EpbI5",name:"google-drive.png",link:"https://cdn.activepieces.com/pieces/google-drive.png"}});async function eb(t,e){let r=JSON.parse(JSON.stringify(t));if(e.propsValue.include_file_content){let n=[];for(let a of r)n.push(Gn(e.auth,e.files,a.id,a.name));let i=await Promise.all(n);for(let a=0;a<r.length;a++)r[a].content=i[a]}return r}o(eb,"handleFileContent");var nb=ze(kc());var Mc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await ke.getFolders(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(a=>({epochMilliSeconds:(0,nb.default)(a.createdTime).valueOf(),data:a})),"items")},ob=La({auth:Oe,name:"new_folder",displayName:"New Folder",description:"Trigger when a new folder is created or uploaded.",aiMetadata:{description:"Fires when a new folder is created in Google Drive, optionally scoped to a specific parent folder. Each event represents one newly created folder and its metadata."},props:{parentFolder:ke.properties.parentFolder,include_team_drives:ke.properties.include_team_drives},outputSchema:bE,type:"POLLING",onEnable:o(async t=>{await Cr.onEnable(Mc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:o(async t=>{await Cr.onDisable(Mc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:o(async t=>await Cr.poll(Mc,t),"run"),test:o(async t=>await Cr.test(Mc,t),"test"),sampleData:{kind:"drive#file",mimeType:"application/vnd.google-apps.folder",id:"1aMEtTqIYn5651wdK7WLxaK_SDim4mvXW",name:"New Folder WOOOO"}});var ib=ze(Ct());var sb=qe({auth:Oe,name:"set_public_access",description:"Set public access for a file or folder",audience:"both",aiMetadata:{description:"Makes a Drive file or folder accessible to anyone with the link at the chosen role (reader, commenter, or writer) and returns its shareable view/download URL. Use to publish a resource publicly. Requires the file/folder ID. Not idempotent: each call adds a new anyone-with-link permission.",idempotent:!1},displayName:"Set public access",props:{fileId:oe.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),role:oe.StaticDropdown({displayName:"Role",description:"The role to assign for public access",options:{options:[{label:"Reader",value:"reader"},{label:"Commenter",value:"commenter"},{label:"Editor",value:"writer"}]},defaultValue:"reader",required:!0})},outputSchema:wE,async run(t){let e=await Ve(t.auth),r=t.propsValue.fileId,n=t.propsValue.role,i=(0,ib.drive)({version:"v3",auth:e}),a={role:n,type:"anyone"},f=await i.permissions.create({fileId:r,requestBody:a}),m=await i.files.get({fileId:r,fields:"name,mimeType,webContentLink,webViewLink"});if(m.data.mimeType==="application/vnd.google-apps.folder")return{...f.data,webViewLink:m.data.webViewLink,downloadUrl:null};let h=await Gn(t.auth,t.files,r,m.data.name);return{...f.data,downloadUrl:h}}});var ab=ze(Ct());var ub=qe({auth:Oe,name:"google-drive-move-file",displayName:"Move File",description:"Moves a file from one folder to another.",audience:"both",aiMetadata:{description:"Relocates a Drive file to a target folder, detaching it from its current parents and attaching it to the new one. Use to reorganize a file once you know its ID and the destination folder ID. Idempotent: repeating with the same destination leaves the file in the same folder.",idempotent:!0},props:{fileId:oe.ShortText({displayName:"File ID",description:"You can use **Search Folder/File** action to retrieve ID.",required:!0}),include_team_drives:ke.properties.include_team_drives,folderId:ke.properties.parentFolder},outputSchema:PE,async run(t){let e=t.propsValue.fileId,r=t.propsValue.folderId,n=await Ve(t.auth),i=(0,ab.drive)({version:"v3",auth:n}),a=await i.files.get({fileId:e,supportsAllDrives:t.propsValue.include_team_drives,fields:"id,parents"});return(await i.files.update({fileId:e,fields:"*",removeParents:a.data.parents?.join(","),addParents:r,supportsAllDrives:t.propsValue.include_team_drives})).data}});var cb=ze(Ct()),lb=qe({auth:Oe,name:"delete_gdrive_file",description:"Delete permanently a file from your Google Drive",audience:"both",aiMetadata:{description:"Permanently deletes a file from Google Drive by its ID, bypassing the trash and making it unrecoverable. Use only when permanent removal is intended; prefer Trash file for reversible deletion. Requires the file ID. Not idempotent: a repeat call fails because the file no longer exists.",idempotent:!1},displayName:"Delete file",props:{fileId:oe.ShortText({displayName:"File ID",description:"The ID of the file to delete",required:!0}),include_team_drives:ke.properties.include_team_drives},async run(t){let e=await Ve(t.auth);return(await(0,cb.drive)({version:"v3",auth:e}).files.delete({fileId:t.propsValue.fileId,supportsAllDrives:t.propsValue.include_team_drives})).data}});var db=ze(Ct());var pb=qe({auth:Oe,name:"trash_gdrive_file",description:"Move a file to the trash in your Google Drive",audience:"both",aiMetadata:{description:"Moves a Drive file to the trash by its ID, a reversible deletion that can be restored from Drive. Use for safe removal instead of permanent deletion. Requires the file ID. Idempotent: re-trashing an already-trashed file leaves it in the same state.",idempotent:!0},displayName:"Trash file",props:{fileId:oe.ShortText({displayName:"File ID",description:"The ID of the file to trash",required:!0}),include_team_drives:ke.properties.include_team_drives},outputSchema:TE,async run(t){let e=await Ve(t.auth),r=(0,db.drive)({version:"v3",auth:e}),n={trashed:!0};return(await r.files.update({fileId:t.propsValue.fileId,supportsAllDrives:t.propsValue.include_team_drives,requestBody:n})).data}});var mj=Ry({minimumSupportedRelease:"0.5.6",logoUrl:"https://cdn.activepieces.com/pieces/google-drive.png",categories:["CONTENT_AND_FILES"],displayName:"Google Drive",description:"Cloud storage and file backup",authors:["BastienMe","ArmanGiau3","Vitalini","pfernandez98","kanarelo","Salem-Alaa","kishanprmr","MoShizzle","AbdulTheActivePiecer","khaledmashaly","abuaboud","geekyme"],triggers:[rb,ob],actions:[$E,DE,QE,VE,jE,BE,KE,UE,WE,IE,NE,sb,ub,lb,pb,F_({baseUrl:o(()=>"https://www.googleapis.com/drive/v3","baseUrl"),auth:Oe,authMapping:o(async t=>({Authorization:`Bearer ${await hr(t)}`}),"authMapping")})],auth:Oe});0&&(module.exports={createGoogleClient,getAccessToken,googleDrive,googleDriveAuth});
67
+ `;E+=f,typeof u.body=="string"&&(E+=u.body,E+=`\r
68
+ `)}E+=D,e.data=E}if(i(P,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,o){r.uploadType="multipart";let w=[{"content-type":"application/json",body:JSON.stringify(o)},{"content-type":n.mimeType||o&&o.mimeType||p,body:n.body}];(0,vm.isBrowser)()?P(w):v(w)}else r.uploadType="media",Object.assign(m,{"content-type":n.mimeType||p}),e.data=n.body;else e.data=o||void 0;if(e.headers=gm.Gaxios.mergeHeaders(e.headers||{},m),e.params=r,!(0,vm.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:fx.version,comment:"gzip"});let w=e.userAgentDirectives.map(S=>{let D=`${S.product}/${S.version}`;return S.comment&&(D+=` (${S.comment})`),D}).join(" ");e.headers.set("User-Agent",w)}if(e.validateStatus||(e.validateStatus=w=>w>=200&&w<300||w===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 x=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,T=e.universeDomain??e.universe_domain??x??"googleapis.com";if(T!=="googleapis.com"&&e.url){let w=new URL(e.url);w.hostname.endsWith(".googleapis.com")&&(w.hostname=w.hostname.replace(/googleapis\.com$/,T),e.url=w.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let w=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(w&&T!==w)throw new Error(`The configured universe domain (${T}) does not match the universe domain found in the credentials (${w}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let S=await s.getRequestHeaders(e.url),D=Object.assign({},e);return D.headers=gm.Gaxios.mergeHeaders(D.headers,S),gL.request(D)}else{let S=await s.request(e);return(0,ym.marshallGaxiosResponse)(S)}}else return new gm.Gaxios().request(e).then(w=>(0,ym.marshallGaxiosResponse)(w))}i(dx,"createAPIRequestAsync");var _m=class extends px.Transform{static{i(this,"ProgressStream")}bytesRead=0;_transform(e,r,n){this.bytesRead+=e.length,this.emit("progress",this.bytesRead),this.push(e),n()}};function PL(t,e){(0,vm.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${fx.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}i(PL,"populateAPIHeader")});var mx=L(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.AuthPlus=void 0;var wn=Fa(),wm=class extends wn.GoogleAuth{static{i(this,"AuthPlus")}JWT=wn.JWT;Compute=wn.Compute;OAuth2=wn.OAuth2Client;GoogleAuth=wn.GoogleAuth;AwsClient=wn.AwsClient;IdentityPoolClient=wn.IdentityPoolClient;ExternalAccountClient=wn.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new wn.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()}};zc.AuthPlus=wm});var Tm=L(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.Endpoint=void 0;var hx=kc(),bm=class{static{i(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,o){if(this.applyMethodsFromSchema(e,r,n,o),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let p=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,p,o)}}}applyMethodsFromSchema(e,r,n,o){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let p=n.methods[s];e[s]=this.makeMethod(r,p,o)}}}makeMethod(e,r,n){return(o,s)=>{let p=typeof o=="function"?{}:o;s=typeof o=="function"?o:s;let m=gx(e.rootUrl+e.servicePath+r.path),h={options:{url:m.substring(1,m.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:p,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 v=gx(e.rootUrl+r.mediaUpload.protocols.simple.path);h.mediaUrl=v.substring(1,v.length-1)}if(!s)return(0,hx.createAPIRequest)(h);(0,hx.createAPIRequest)(h,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}};Uc.Endpoint=bm;function gx(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}i(gx,"buildurl")});var vx=L(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.Discovery=void 0;var wL=require("fs"),bL=mt(),TL=require("url"),yx=require("util"),SL=kc(),xL=Tm(),EL=yx.promisify(wL.readFile),Sm=class{static{i(this,"Discovery")}transporter=new bL.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new xL.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"}),o=(await this.transporter.request({url:e,headers:r})).data.items,s=await Promise.all(o.map(async h=>{let v=await this.discoverAPI(h.discoveryRestUrl);return{api:h,endpointCreator:v}})),p={},m={};for(let h of s)m[h.api.name]||(p[h.api.name]={},m[h.api.name]=v=>{let P=typeof v,x;if(P==="string")x=v,v={};else if(P==="object")x=v.version,delete v.version;else throw new Error("Argument error: Accepts only string or object");try{let T=h.endpointCreator(v,this);return Object.freeze(T)}catch(T){throw new Error(yx.format('Unable to load endpoint %s("%s"): %s',h.api.name,x,T.message))}}),p[h.api.name][h.api.version]=h.endpointCreator;return m}async discoverAPI(e){if(typeof e=="string"){let r=TL.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await EL(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 o={options:{url:n,method:"GET"},requiredParams:[],pathParams:[],params:r,context:{google:{_options:{}},_options:{}}},s=await(0,SL.createAPIRequest)(o);return this.makeEndpoint(s.data)}}};Mc.Discovery=Sm});var Ja=L($e=>{"use strict";var IL=$e&&$e.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),AL=$e&&$e.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IL(e,t,r)};Object.defineProperty($e,"__esModule",{value:!0});$e.Endpoint=$e.Discovery=$e.AuthPlus=$e.createAPIRequest=$e.getAPI=$e.GaxiosError=$e.Gaxios=$e.AwsClient=$e.IdentityPoolClient=$e.BaseExternalAccountClient=$e.ExternalAccountClient=$e.GoogleAuth=$e.UserRefreshClient=$e.Compute=$e.JWT=$e.OAuth2Client=$e.gaxios=$e.googleAuthLibrary=void 0;$e.googleAuthLibrary=Fa();$e.gaxios=mt();var bn=Fa();Object.defineProperty($e,"OAuth2Client",{enumerable:!0,get:i(function(){return bn.OAuth2Client},"get")});Object.defineProperty($e,"JWT",{enumerable:!0,get:i(function(){return bn.JWT},"get")});Object.defineProperty($e,"Compute",{enumerable:!0,get:i(function(){return bn.Compute},"get")});Object.defineProperty($e,"UserRefreshClient",{enumerable:!0,get:i(function(){return bn.UserRefreshClient},"get")});Object.defineProperty($e,"GoogleAuth",{enumerable:!0,get:i(function(){return bn.GoogleAuth},"get")});Object.defineProperty($e,"ExternalAccountClient",{enumerable:!0,get:i(function(){return bn.ExternalAccountClient},"get")});Object.defineProperty($e,"BaseExternalAccountClient",{enumerable:!0,get:i(function(){return bn.BaseExternalAccountClient},"get")});Object.defineProperty($e,"IdentityPoolClient",{enumerable:!0,get:i(function(){return bn.IdentityPoolClient},"get")});Object.defineProperty($e,"AwsClient",{enumerable:!0,get:i(function(){return bn.AwsClient},"get")});var _x=mt();Object.defineProperty($e,"Gaxios",{enumerable:!0,get:i(function(){return _x.Gaxios},"get")});Object.defineProperty($e,"GaxiosError",{enumerable:!0,get:i(function(){return _x.GaxiosError},"get")});var RL=cS();Object.defineProperty($e,"getAPI",{enumerable:!0,get:i(function(){return RL.getAPI},"get")});var DL=kc();Object.defineProperty($e,"createAPIRequest",{enumerable:!0,get:i(function(){return DL.createAPIRequest},"get")});var $L=mx();Object.defineProperty($e,"AuthPlus",{enumerable:!0,get:i(function(){return $L.AuthPlus},"get")});var OL=vx();Object.defineProperty($e,"Discovery",{enumerable:!0,get:i(function(){return OL.Discovery},"get")});var CL=Tm();Object.defineProperty($e,"Endpoint",{enumerable:!0,get:i(function(){return CL.Endpoint},"get")});AL(Nc(),$e)});var wx=L(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.drive_v2=void 0;var B=Ja(),Px;(function(t){class e{static{i(this,"Drive")}context;about;apps;changes;channels;children;comments;drives;files;parents;permissions;properties;replies;revisions;teamdrives;constructor(u,f){this.context={_options:u||{},google:f},this.about=new r(this.context),this.apps=new n(this.context),this.changes=new o(this.context),this.channels=new s(this.context),this.children=new p(this.context),this.comments=new m(this.context),this.drives=new h(this.context),this.files=new v(this.context),this.parents=new P(this.context),this.permissions=new x(this.context),this.properties=new T(this.context),this.replies=new w(this.context),this.revisions=new S(this.context),this.teamdrives=new D(this.context)}}t.Drive=e;class r{static{i(this,"Resource$About")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/about").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$About=r;class n{static{i(this,"Resource$Apps")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/apps/{appId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["appId"],pathParams:["appId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/apps").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Apps=n;class o{static{i(this,"Resource$Changes")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/changes/{changeId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["changeId"],pathParams:["changeId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}getStartPageToken(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/changes/startPageToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/changes").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}watch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/changes/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Changes=o;class s{static{i(this,"Resource$Channels")}context;constructor(u){this.context=u}stop(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Channels=s;class p{static{i(this,"Resource$Children")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{folderId}/children/{childId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["folderId","childId"],pathParams:["childId","folderId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{folderId}/children/{childId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["folderId","childId"],pathParams:["childId","folderId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{folderId}/children").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["folderId"],pathParams:["folderId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{folderId}/children").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["folderId"],pathParams:["folderId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Children=p;class m{static{i(this,"Resource$Comments")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Comments=m;class h{static{i(this,"Resource$Drives")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}hide(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}/hide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}unhide(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}/unhide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Drives=h;class v{static{i(this,"Resource$Files")}context;constructor(u){this.context=u}copy(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/copy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}emptyTrash(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/trash").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}export(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/export").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","mimeType"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}generateCseToken(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/generateCseToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}generateIds(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/generateIds").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,mediaUrl:(b+"/upload/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}listLabels(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/listLabels").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}modifyLabels(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/modifyLabels").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}touch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/touch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}trash(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/trash").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}untrash(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/untrash").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,mediaUrl:(b+"/upload/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}watch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Files=v;class P{static{i(this,"Resource$Parents")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/parents/{parentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","parentId"],pathParams:["fileId","parentId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/parents/{parentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","parentId"],pathParams:["fileId","parentId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/parents").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/parents").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Parents=P;class x{static{i(this,"Resource$Permissions")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}getIdForEmail(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/permissionIds/{email}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["email"],pathParams:["email"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Permissions=x;class T{static{i(this,"Resource$Properties")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Properties=T;class w{static{i(this,"Resource$Replies")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Replies=w;class S{static{i(this,"Resource$Revisions")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Revisions=S;class D{static{i(this,"Resource$Teamdrives")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Teamdrives=D})(Px||(Fc.drive_v2=Px={}))});var Tx=L(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.drive_v3=void 0;var W=Ja(),bx;(function(t){class e{static{i(this,"Drive")}context;about;accessproposals;approvals;apps;changes;channels;comments;drives;files;operations;permissions;replies;revisions;teamdrives;constructor(u,f){this.context={_options:u||{},google:f},this.about=new r(this.context),this.accessproposals=new n(this.context),this.approvals=new o(this.context),this.apps=new s(this.context),this.changes=new p(this.context),this.channels=new m(this.context),this.comments=new h(this.context),this.drives=new v(this.context),this.files=new P(this.context),this.operations=new x(this.context),this.permissions=new T(this.context),this.replies=new w(this.context),this.revisions=new S(this.context),this.teamdrives=new D(this.context)}}t.Drive=e;class r{static{i(this,"Resource$About")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/about").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$About=r;class n{static{i(this,"Resource$Accessproposals")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/accessproposals/{proposalId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","proposalId"],pathParams:["fileId","proposalId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/accessproposals").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}resolve(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/accessproposals/{proposalId}:resolve").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","proposalId"],pathParams:["fileId","proposalId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Accessproposals=n;class o{static{i(this,"Resource$Approvals")}context;constructor(u){this.context=u}approve(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:approve").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}cancel(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:cancel").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}comment(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:comment").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}decline(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:decline").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}reassign(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:reassign").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}start(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals:start").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Approvals=o;class s{static{i(this,"Resource$Apps")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/apps/{appId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["appId"],pathParams:["appId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/apps").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Apps=s;class p{static{i(this,"Resource$Changes")}context;constructor(u){this.context=u}getStartPageToken(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/changes/startPageToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/changes").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["pageToken"],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}watch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/changes/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["pageToken"],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Changes=p;class m{static{i(this,"Resource$Channels")}context;constructor(u){this.context=u}stop(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Channels=m;class h{static{i(this,"Resource$Comments")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Comments=h;class v{static{i(this,"Resource$Drives")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}hide(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}/hide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}unhide(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}/unhide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Drives=v;class P{static{i(this,"Resource$Files")}context;constructor(u){this.context=u}copy(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/copy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,mediaUrl:(b+"/upload/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),requiredParams:[],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}download(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/download").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}emptyTrash(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/trash").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}export(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/export").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","mimeType"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}generateCseToken(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/generateCseToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}generateIds(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/generateIds").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}listLabels(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/listLabels").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}modifyLabels(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/modifyLabels").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,mediaUrl:(b+"/upload/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}watch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Files=P;class x{static{i(this,"Resource$Operations")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/operations/{name}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["name"],pathParams:["name"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Operations=x;class T{static{i(this,"Resource$Permissions")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Permissions=T;class w{static{i(this,"Resource$Replies")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Replies=w;class S{static{i(this,"Resource$Revisions")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/revisions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Revisions=S;class D{static{i(this,"Resource$Teamdrives")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Teamdrives=D})(bx||(Lc.drive_v3=bx={}))});var Ae=L(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.AuthPlus=qt.drive_v3=qt.drive_v2=qt.auth=qt.VERSIONS=void 0;qt.drive=NL;var Sx=Ja(),xx=wx();Object.defineProperty(qt,"drive_v2",{enumerable:!0,get:i(function(){return xx.drive_v2},"get")});var Ex=Tx();Object.defineProperty(qt,"drive_v3",{enumerable:!0,get:i(function(){return Ex.drive_v3},"get")});qt.VERSIONS={v2:xx.drive_v2.Drive,v3:Ex.drive_v3.Drive};function NL(t){return(0,Sx.getAPI)("drive",t,qt.VERSIONS,this)}i(NL,"drive");var kL=new Sx.AuthPlus;qt.auth=kL;var zL=Ja();Object.defineProperty(qt,"AuthPlus",{enumerable:!0,get:i(function(){return zL.AuthPlus},"get")})});var jc=L((xm,Em)=>{(function(t,e){typeof xm=="object"&&typeof Em<"u"?Em.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(xm,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",o="second",s="minute",p="hour",m="day",h="week",v="month",P="quarter",x="year",T="date",w="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,D=/\[([^\]]+)]|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,E={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:i(function(se){var Y=["th","st","nd","rd"],K=se%100;return"["+se+(Y[(K-20)%10]||Y[K]||Y[0])+"]"},"ordinal")},u=i(function(se,Y,K){var re=String(se);return!re||re.length>=Y?se:""+Array(Y+1-re.length).join(K)+se},"m"),f={s:u,z:i(function(se){var Y=-se.utcOffset(),K=Math.abs(Y),re=Math.floor(K/60),te=K%60;return(Y<=0?"+":"-")+u(re,2,"0")+":"+u(te,2,"0")},"z"),m:i(function se(Y,K){if(Y.date()<K.date())return-se(K,Y);var re=12*(K.year()-Y.year())+(K.month()-Y.month()),te=Y.clone().add(re,v),ce=K-te<0,de=Y.clone().add(re+(ce?-1:1),v);return+(-(re+(K-te)/(ce?te-de:de-te))||0)},"t"),a:i(function(se){return se<0?Math.ceil(se)||0:Math.floor(se)},"a"),p:i(function(se){return{M:v,y:x,w:h,d:m,D:T,h:p,m:s,s:o,ms:n,Q:P}[se]||String(se||"").toLowerCase().replace(/s$/,"")},"p"),u:i(function(se){return se===void 0},"u")},c="en",y={};y[c]=E;var l=i(function(se){return se instanceof ne},"p"),b=i(function se(Y,K,re){var te;if(!Y)return c;if(typeof Y=="string"){var ce=Y.toLowerCase();y[ce]&&(te=ce),K&&(y[ce]=K,te=ce);var de=Y.split("-");if(!te&&de.length>1)return se(de[0])}else{var Oe=Y.name;y[Oe]=Y,te=Oe}return!re&&te&&(c=te),te||!re&&c},"t"),g=i(function(se,Y){if(l(se))return se.clone();var K=typeof Y=="object"?Y:{};return K.date=se,K.args=arguments,new ne(K)},"w"),oe=f;oe.l=b,oe.i=l,oe.w=function(se,Y){return g(se,{locale:Y.$L,utc:Y.$u,x:Y.$x,$offset:Y.$offset})};var ne=(function(){function se(K){this.$L=b(K.locale,null,!0),this.parse(K)}i(se,"M");var Y=se.prototype;return Y.parse=function(K){this.$d=(function(re){var te=re.date,ce=re.utc;if(te===null)return new Date(NaN);if(oe.u(te))return new Date;if(te instanceof Date)return new Date(te);if(typeof te=="string"&&!/Z$/i.test(te)){var de=te.match(S);if(de){var Oe=de[2]-1||0,ze=(de[7]||"0").substring(0,3);return ce?new Date(Date.UTC(de[1],Oe,de[3]||1,de[4]||0,de[5]||0,de[6]||0,ze)):new Date(de[1],Oe,de[3]||1,de[4]||0,de[5]||0,de[6]||0,ze)}}return new Date(te)})(K),this.$x=K.x||{},this.init()},Y.init=function(){var K=this.$d;this.$y=K.getFullYear(),this.$M=K.getMonth(),this.$D=K.getDate(),this.$W=K.getDay(),this.$H=K.getHours(),this.$m=K.getMinutes(),this.$s=K.getSeconds(),this.$ms=K.getMilliseconds()},Y.$utils=function(){return oe},Y.isValid=function(){return this.$d.toString()!==w},Y.isSame=function(K,re){var te=g(K);return this.startOf(re)<=te&&te<=this.endOf(re)},Y.isAfter=function(K,re){return g(K)<this.startOf(re)},Y.isBefore=function(K,re){return this.endOf(re)<g(K)},Y.$g=function(K,re,te){return oe.u(K)?this[re]:this.set(te,K)},Y.unix=function(){return Math.floor(this.valueOf()/1e3)},Y.valueOf=function(){return this.$d.getTime()},Y.startOf=function(K,re){var te=this,ce=!!oe.u(re)||re,de=oe.p(K),Oe=i(function(Vt,Ze){var Je=oe.w(te.$u?Date.UTC(te.$y,Ze,Vt):new Date(te.$y,Ze,Vt),te);return ce?Je:Je.endOf(m)},"l"),ze=i(function(Vt,Ze){return oe.w(te.toDate()[Vt].apply(te.toDate("s"),(ce?[0,0,0,0]:[23,59,59,999]).slice(Ze)),te)},"$"),Ke=this.$W,Qe=this.$M,Tt=this.$D,ie="set"+(this.$u?"UTC":"");switch(de){case x:return ce?Oe(1,0):Oe(31,11);case v:return ce?Oe(1,Qe):Oe(0,Qe+1);case h:var ut=this.$locale().weekStart||0,ft=(Ke<ut?Ke+7:Ke)-ut;return Oe(ce?Tt-ft:Tt+(6-ft),Qe);case m:case T:return ze(ie+"Hours",0);case p:return ze(ie+"Minutes",1);case s:return ze(ie+"Seconds",2);case o:return ze(ie+"Milliseconds",3);default:return this.clone()}},Y.endOf=function(K){return this.startOf(K,!1)},Y.$set=function(K,re){var te,ce=oe.p(K),de="set"+(this.$u?"UTC":""),Oe=(te={},te[m]=de+"Date",te[T]=de+"Date",te[v]=de+"Month",te[x]=de+"FullYear",te[p]=de+"Hours",te[s]=de+"Minutes",te[o]=de+"Seconds",te[n]=de+"Milliseconds",te)[ce],ze=ce===m?this.$D+(re-this.$W):re;if(ce===v||ce===x){var Ke=this.clone().set(T,1);Ke.$d[Oe](ze),Ke.init(),this.$d=Ke.set(T,Math.min(this.$D,Ke.daysInMonth())).$d}else Oe&&this.$d[Oe](ze);return this.init(),this},Y.set=function(K,re){return this.clone().$set(K,re)},Y.get=function(K){return this[oe.p(K)]()},Y.add=function(K,re){var te,ce=this;K=Number(K);var de=oe.p(re),Oe=i(function(Qe){var Tt=g(ce);return oe.w(Tt.date(Tt.date()+Math.round(Qe*K)),ce)},"y");if(de===v)return this.set(v,this.$M+K);if(de===x)return this.set(x,this.$y+K);if(de===m)return Oe(1);if(de===h)return Oe(7);var ze=(te={},te[s]=e,te[p]=r,te[o]=t,te)[de]||1,Ke=this.$d.getTime()+K*ze;return oe.w(Ke,this)},Y.subtract=function(K,re){return this.add(-1*K,re)},Y.format=function(K){var re=this,te=this.$locale();if(!this.isValid())return te.invalidDate||w;var ce=K||"YYYY-MM-DDTHH:mm:ssZ",de=oe.z(this),Oe=this.$H,ze=this.$m,Ke=this.$M,Qe=te.weekdays,Tt=te.months,ie=te.meridiem,ut=i(function(Ze,Je,I,$){return Ze&&(Ze[Je]||Ze(re,ce))||I[Je].slice(0,$)},"h"),ft=i(function(Ze){return oe.s(Oe%12||12,Ze,"0")},"d"),Vt=ie||function(Ze,Je,I){var $=Ze<12?"AM":"PM";return I?$.toLowerCase():$};return ce.replace(D,(function(Ze,Je){return Je||(function(I){switch(I){case"YY":return String(re.$y).slice(-2);case"YYYY":return oe.s(re.$y,4,"0");case"M":return Ke+1;case"MM":return oe.s(Ke+1,2,"0");case"MMM":return ut(te.monthsShort,Ke,Tt,3);case"MMMM":return ut(Tt,Ke);case"D":return re.$D;case"DD":return oe.s(re.$D,2,"0");case"d":return String(re.$W);case"dd":return ut(te.weekdaysMin,re.$W,Qe,2);case"ddd":return ut(te.weekdaysShort,re.$W,Qe,3);case"dddd":return Qe[re.$W];case"H":return String(Oe);case"HH":return oe.s(Oe,2,"0");case"h":return ft(1);case"hh":return ft(2);case"a":return Vt(Oe,ze,!0);case"A":return Vt(Oe,ze,!1);case"m":return String(ze);case"mm":return oe.s(ze,2,"0");case"s":return String(re.$s);case"ss":return oe.s(re.$s,2,"0");case"SSS":return oe.s(re.$ms,3,"0");case"Z":return de}return null})(Ze)||de.replace(":","")}))},Y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Y.diff=function(K,re,te){var ce,de=this,Oe=oe.p(re),ze=g(K),Ke=(ze.utcOffset()-this.utcOffset())*e,Qe=this-ze,Tt=i(function(){return oe.m(de,ze)},"D");switch(Oe){case x:ce=Tt()/12;break;case v:ce=Tt();break;case P:ce=Tt()/3;break;case h:ce=(Qe-Ke)/6048e5;break;case m:ce=(Qe-Ke)/864e5;break;case p:ce=Qe/r;break;case s:ce=Qe/e;break;case o:ce=Qe/t;break;default:ce=Qe}return te?ce:oe.a(ce)},Y.daysInMonth=function(){return this.endOf(v).$D},Y.$locale=function(){return y[this.$L]},Y.locale=function(K,re){if(!K)return this.$L;var te=this.clone(),ce=b(K,re,!0);return ce&&(te.$L=ce),te},Y.clone=function(){return oe.w(this.$d,this)},Y.toDate=function(){return new Date(this.valueOf())},Y.toJSON=function(){return this.isValid()?this.toISOString():null},Y.toISOString=function(){return this.$d.toISOString()},Y.toString=function(){return this.$d.toUTCString()},se})(),Re=ne.prototype;return g.prototype=Re,[["$ms",n],["$s",o],["$m",s],["$H",p],["$W",m],["$M",v],["$y",x],["$D",T]].forEach((function(se){Re[se[1]]=function(Y){return this.$g(Y,se[0],se[1])}})),g.extend=function(se,Y){return se.$i||(se(Y,ne,g),se.$i=!0),g},g.locale=b,g.isDayjs=l,g.unix=function(se){return g(1e3*se)},g.en=y[c],g.Ls=y,g.p={},g}))});var qL={};Ss(qL,{createGoogleClient:()=>ae,getAccessToken:()=>pt,googleDrive:()=>jL,googleDriveAuth:()=>J});module.exports=v0(qL);var _0=Object.freeze({status:"aborted"});function fe(t,e,r){function n(m,h){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:h,constr:p,traits:new Set},enumerable:!1}),m._zod.traits.has(t))return;m._zod.traits.add(t),e(m,h);let v=p.prototype,P=Object.keys(v);for(let x=0;x<P.length;x++){let T=P[x];T in m||(m[T]=v[T].bind(m))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function p(m){var h;let v=r?.Parent?new s:this;n(v,m),(h=v._zod).deferred??(h.deferred=[]);for(let P of v._zod.deferred)P();return v}return i(p,"_"),Object.defineProperty(p,"init",{value:n}),Object.defineProperty(p,Symbol.hasInstance,{value:i(m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(t),"value")}),Object.defineProperty(p,"name",{value:t}),p}i(fe,"$constructor");var Cr=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},xs=class extends Error{static{i(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},vl={};function sn(t){return t&&Object.assign(vl,t),vl}i(sn,"config");function Pl(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}i(Pl,"getEnumValues");function kh(t,e){return typeof e=="bigint"?e.toString():e}i(kh,"jsonStringifyReplacer");function Is(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Is,"cached");function zh(t){return t==null}i(zh,"nullish");function As(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}i(As,"cleanRegex");var Nh=Symbol("evaluating");function ht(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Nh)return n===void 0&&(n=Nh,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}i(ht,"defineLazy");var wl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function zo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}i(zo,"isObject");var P0=Is(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Uh(t){if(zo(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(zo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(Uh,"isPlainObject");var Mh=new Set(["string","number","symbol"]);function Mi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Mi,"escapeRegex");function Rs(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}i(Rs,"clone");function ot(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:i(()=>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:i(()=>e.error,"error")}:e}i(ot,"normalizeParams");function Fh(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}i(Fh,"optionalKeys");var Lh={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 Fi(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}i(Fi,"aborted");function $n(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}i($n,"prefixIssues");function Es(t){return typeof t=="string"?t:t?.message}i(Es,"unwrapMessage");function On(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=Es(t.inst?._zod.def?.error?.(t))??Es(e?.error?.(t))??Es(r.customError?.(t))??Es(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}i(On,"finalizeIssue");function jh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}i(jh,"getLengthableOrigin");function bl(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}i(bl,"issue");var qh=i((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,kh,2),Object.defineProperty(t,"toString",{value:i(()=>t.message,"value"),enumerable:!1})},"initializer"),Bh=fe("$ZodError",qh),Uo=fe("$ZodError",qh,{Parent:Error});var b0=i(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},p=e._zod.run({value:r,issues:[]},s);if(p instanceof Promise)throw new Cr;if(p.issues.length){let m=new(o?.Err??t)(p.issues.map(h=>On(h,s,sn())));throw wl(m,o?.callee),m}return p.value},"_parse"),Ds=b0(Uo),T0=i(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},p=e._zod.run({value:r,issues:[]},s);if(p instanceof Promise&&(p=await p),p.issues.length){let m=new(o?.Err??t)(p.issues.map(h=>On(h,s,sn())));throw wl(m,o?.callee),m}return p.value},"_parseAsync"),$s=T0(Uo),S0=i(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Cr;return s.issues.length?{success:!1,error:new(t??Bh)(s.issues.map(p=>On(p,o,sn())))}:{success:!0,data:s.value}},"_safeParse"),Mo=S0(Uo),x0=i(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(p=>On(p,o,sn())))}:{success:!0,data:s.value}},"_safeParseAsync"),Fo=x0(Uo);var E0="(?:(?:\\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])))",I0=new RegExp(`^${E0}$`);var Vh=i(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),Gh=/^-?\d+n?$/,Hh=/^-?\d+$/,Tl=/^-?\d+(?:\.\d+)?$/,Wh=/^(?:true|false)$/i;var Cn=fe("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),A0={number:"number",bigint:"bigint",object:"date"};var Zh=fe("$ZodCheckGreaterThan",(t,e)=>{Cn.init(t,e);let r=A0[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.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 Kh=fe("$ZodCheckNumberFormat",(t,e)=>{Cn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=Lh[e.format];t._zod.onattach.push(p=>{let m=p._zod.bag;m.format=e.format,m.minimum=o,m.maximum=s,r&&(m.pattern=Hh)}),t._zod.check=p=>{let m=p.value;if(r){if(!Number.isInteger(m)){p.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:m,inst:t});return}if(!Number.isSafeInteger(m)){m>0?p.issues.push({input:m,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}):p.issues.push({input:m,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}}m<o&&p.issues.push({origin:"number",input:m,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),m>s&&p.issues.push({origin:"number",input:m,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var Jh=fe("$ZodCheckMinLength",(t,e)=>{var r;Cn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!zh(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let p=jh(o);n.issues.push({origin:p,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}});var Sl=fe("$ZodCheckStringFormat",(t,e)=>{var r,n;Cn.init(t,e),t._zod.onattach.push(o=>{let s=o._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=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),Yh=fe("$ZodCheckRegex",(t,e)=>{Sl.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 Qh={major:4,minor:3,patch:6};var ct=fe("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Qh;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._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 o=i((p,m,h)=>{let v=Fi(p),P;for(let x of m){if(x._zod.def.when){if(!x._zod.def.when(p))continue}else if(v)continue;let T=p.issues.length,w=x._zod.check(p);if(w instanceof Promise&&h?.async===!1)throw new Cr;if(P||w instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await w,p.issues.length!==T&&(v||(v=Fi(p,T)))});else{if(p.issues.length===T)continue;v||(v=Fi(p,T))}}return P?P.then(()=>p):p},"runChecks"),s=i((p,m,h)=>{if(Fi(p))return p.aborted=!0,p;let v=o(m,n,h);if(v instanceof Promise){if(h.async===!1)throw new Cr;return v.then(P=>t._zod.parse(P,h))}return t._zod.parse(v,h)},"handleCanaryResult");t._zod.run=(p,m)=>{if(m.skipChecks)return t._zod.parse(p,m);if(m.direction==="backward"){let v=t._zod.parse({value:p.value,issues:[]},{...m,skipChecks:!0});return v instanceof Promise?v.then(P=>s(P,p,m)):s(v,p,m)}let h=t._zod.parse(p,m);if(h instanceof Promise){if(m.async===!1)throw new Cr;return h.then(v=>o(v,n,m))}return o(h,n,m)}}ht(t,"~standard",()=>({validate:i(o=>{try{let s=Mo(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Fo(t,o).then(p=>p.success?{value:p.data}:{issues:p.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ns=fe("$ZodString",(t,e)=>{ct.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Vh(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}}),xl=fe("$ZodStringFormat",(t,e)=>{Sl.init(t,e),Ns.init(t,e)});var ig=fe("$ZodURL",(t,e)=>{xl.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.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(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}});var El=fe("$ZodNumber",(t,e)=>{ct.init(t,e),t._zod.pattern=t._zod.bag.pattern??Tl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),og=fe("$ZodNumberFormat",(t,e)=>{Kh.init(t,e),El.init(t,e)}),Il=fe("$ZodBoolean",(t,e)=>{ct.init(t,e),t._zod.pattern=Wh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),ag=fe("$ZodBigInt",(t,e)=>{ct.init(t,e),t._zod.pattern=Gh,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 sg=fe("$ZodAny",(t,e)=>{ct.init(t,e),t._zod.parse=r=>r}),ug=fe("$ZodUnknown",(t,e)=>{ct.init(t,e),t._zod.parse=r=>r});var cg=fe("$ZodVoid",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),lg=fe("$ZodDate",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});function eg(t,e,r){t.issues.length&&e.issues.push(...$n(r,t.issues)),e.value[r]=t.value}i(eg,"handleArrayResult");var dg=fe("$ZodArray",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let p=0;p<o.length;p++){let m=o[p],h=e.element._zod.run({value:m,issues:[]},n);h instanceof Promise?s.push(h.then(v=>eg(v,r,p))):eg(h,r,p)}return s.length?Promise.all(s).then(()=>r):r}});function Cs(t,e,r,n,o){if(t.issues.length){if(o&&!(r in n))return;e.issues.push(...$n(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}i(Cs,"handlePropertyResult");function R0(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=Fh(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}i(R0,"normalizeDef");function D0(t,e,r,n,o,s){let p=[],m=o.keySet,h=o.catchall._zod,v=h.def.type,P=h.optout==="optional";for(let x in e){if(m.has(x))continue;if(v==="never"){p.push(x);continue}let T=h.run({value:e[x],issues:[]},n);T instanceof Promise?t.push(T.then(w=>Cs(w,r,x,e,P))):Cs(T,r,x,e,P)}return p.length&&r.issues.push({code:"unrecognized_keys",keys:p,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}i(D0,"handleCatchall");var pg=fe("$ZodObject",(t,e)=>{if(ct.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let m=e.shape;Object.defineProperty(e,"shape",{get:i(()=>{let h={...m};return Object.defineProperty(e,"shape",{value:h}),h},"get")})}let n=Is(()=>R0(e));ht(t._zod,"propValues",()=>{let m=e.shape,h={};for(let v in m){let P=m[v]._zod;if(P.values){h[v]??(h[v]=new Set);for(let x of P.values)h[v].add(x)}}return h});let o=zo,s=e.catchall,p;t._zod.parse=(m,h)=>{p??(p=n.value);let v=m.value;if(!o(v))return m.issues.push({expected:"object",code:"invalid_type",input:v,inst:t}),m;m.value={};let P=[],x=p.shape;for(let T of p.keys){let w=x[T],S=w._zod.optout==="optional",D=w._zod.run({value:v[T],issues:[]},h);D instanceof Promise?P.push(D.then(E=>Cs(E,m,T,v,S))):Cs(D,m,T,v,S)}return s?D0(P,v,m,h,n.value,t):P.length?Promise.all(P).then(()=>m):m}});function tg(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let o=t.filter(s=>!Fi(s));return o.length===1?(e.value=o[0].value,o[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(p=>On(p,n,sn())))}),e)}i(tg,"handleUnionResults");var Al=fe("$ZodUnion",(t,e)=>{ct.init(t,e),ht(t._zod,"optin",()=>e.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ht(t._zod,"optout",()=>e.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ht(t._zod,"values",()=>{if(e.options.every(o=>o._zod.values))return new Set(e.options.flatMap(o=>Array.from(o._zod.values)))}),ht(t._zod,"pattern",()=>{if(e.options.every(o=>o._zod.pattern)){let o=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>As(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(o,s)=>{if(r)return n(o,s);let p=!1,m=[];for(let h of e.options){let v=h._zod.run({value:o.value,issues:[]},s);if(v instanceof Promise)m.push(v),p=!0;else{if(v.issues.length===0)return v;m.push(v)}}return p?Promise.all(m).then(h=>tg(h,o,t,s)):tg(m,o,t,s)}});var fg=fe("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Al.init(t,e);let r=t._zod.parse;ht(t._zod,"propValues",()=>{let o={};for(let s of e.options){let p=s._zod.propValues;if(!p||Object.keys(p).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[m,h]of Object.entries(p)){o[m]||(o[m]=new Set);for(let v of h)o[m].add(v)}}return o});let n=Is(()=>{let o=e.options,s=new Map;for(let p of o){let m=p._zod.propValues?.[e.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(p)}"`);for(let h of m){if(s.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);s.set(h,p)}}return s});t._zod.parse=(o,s)=>{let p=o.value;if(!zo(p))return o.issues.push({code:"invalid_type",expected:"object",input:p,inst:t}),o;let m=n.value.get(p?.[e.discriminator]);return m?m._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:p,path:[e.discriminator],inst:t}),o)}});var mg=fe("$ZodRecord",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Uh(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[],p=e.keyType._zod.values;if(p){r.value={};let m=new Set;for(let v of p)if(typeof v=="string"||typeof v=="number"||typeof v=="symbol"){m.add(typeof v=="number"?v.toString():v);let P=e.valueType._zod.run({value:o[v],issues:[]},n);P instanceof Promise?s.push(P.then(x=>{x.issues.length&&r.issues.push(...$n(v,x.issues)),r.value[v]=x.value})):(P.issues.length&&r.issues.push(...$n(v,P.issues)),r.value[v]=P.value)}let h;for(let v in o)m.has(v)||(h=h??[],h.push(v));h&&h.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:h})}else{r.value={};for(let m of Reflect.ownKeys(o)){if(m==="__proto__")continue;let h=e.keyType._zod.run({value:m,issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&Tl.test(m)&&h.issues.length){let x=e.keyType._zod.run({value:Number(m),issues:[]},n);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(h=x)}if(h.issues.length){e.mode==="loose"?r.value[m]=o[m]:r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(x=>On(x,n,sn())),input:m,path:[m],inst:t});continue}let P=e.valueType._zod.run({value:o[m],issues:[]},n);P instanceof Promise?s.push(P.then(x=>{x.issues.length&&r.issues.push(...$n(m,x.issues)),r.value[h.value]=x.value})):(P.issues.length&&r.issues.push(...$n(m,P.issues)),r.value[h.value]=P.value)}}return s.length?Promise.all(s).then(()=>r):r}});var hg=fe("$ZodEnum",(t,e)=>{ct.init(t,e);let r=Pl(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>Mh.has(typeof o)).map(o=>typeof o=="string"?Mi(o):o.toString()).join("|")})$`),t._zod.parse=(o,s)=>{let p=o.value;return n.has(p)||o.issues.push({code:"invalid_value",values:r,input:p,inst:t}),o}}),gg=fe("$ZodLiteral",(t,e)=>{if(ct.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"?Mi(n):n?Mi(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var yg=fe("$ZodTransform",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new xs(t.constructor.name);let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(p=>(r.value=p,r));if(o instanceof Promise)throw new Cr;return r.value=o,r}});function rg(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}i(rg,"handleOptionalResult");var vg=fe("$ZodOptional",(t,e)=>{ct.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ht(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ht(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${As(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>rg(s,r.value)):rg(o,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var _g=fe("$ZodNullable",(t,e)=>{ct.init(t,e),ht(t._zod,"optin",()=>e.innerType._zod.optin),ht(t._zod,"optout",()=>e.innerType._zod.optout),ht(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${As(r.source)}|null)$`):void 0}),ht(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 Pg=fe("$ZodPipe",(t,e)=>{ct.init(t,e),ht(t._zod,"values",()=>e.in._zod.values),ht(t._zod,"optin",()=>e.in._zod.optin),ht(t._zod,"optout",()=>e.out._zod.optout),ht(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(p=>Os(p,e.in,n)):Os(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Os(s,e.out,n)):Os(o,e.out,n)}});function Os(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}i(Os,"handlePipeResult");var wg=fe("$ZodCustom",(t,e)=>{Cn.init(t,e),ct.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>ng(s,r,n,t));ng(o,r,n,t)}});function ng(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(bl(o))}}i(ng,"handleRefineResult");var Tg;var Rl=class{static{i(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 o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Sg(){return new Rl}i(Sg,"registry");(Tg=globalThis).__zod_globalRegistry??(Tg.__zod_globalRegistry=Sg());var Dl=globalThis.__zod_globalRegistry;function xg(t,e){return new t({type:"string",...ot(e)})}i(xg,"_string");function Eg(t,e){return new t({type:"string",coerce:!0,...ot(e)})}i(Eg,"_coercedString");function Ig(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...ot(e)})}i(Ig,"_url");function Ag(t,e){return new t({type:"number",checks:[],...ot(e)})}i(Ag,"_number");function Rg(t,e){return new t({type:"number",coerce:!0,checks:[],...ot(e)})}i(Rg,"_coercedNumber");function Dg(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...ot(e)})}i(Dg,"_int");function $g(t,e){return new t({type:"boolean",...ot(e)})}i($g,"_boolean");function Og(t,e){return new t({type:"boolean",coerce:!0,...ot(e)})}i(Og,"_coercedBoolean");function Cg(t,e){return new t({type:"bigint",coerce:!0,...ot(e)})}i(Cg,"_coercedBigint");function Ng(t){return new t({type:"any"})}i(Ng,"_any");function kg(t){return new t({type:"unknown"})}i(kg,"_unknown");function zg(t,e){return new t({type:"void",...ot(e)})}i(zg,"_void");function Ug(t,e){return new t({type:"date",coerce:!0,...ot(e)})}i(Ug,"_coercedDate");function ks(t,e){return new Zh({check:"greater_than",...ot(e),value:t,inclusive:!0})}i(ks,"_gte");function wr(t,e){return new Jh({check:"min_length",...ot(e),minimum:t})}i(wr,"_minLength");function Nn(t,e){return new Yh({check:"string_format",format:"regex",...ot(e),pattern:t})}i(Nn,"_regex");function Mg(t,e,r){let n=ot(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}i(Mg,"_custom");var gt=fe("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");ct.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>Ds(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Mo(t,r,n),t.parseAsync=async(r,n)=>$s(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Fo(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)=>Rs(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),Us=fe("ZodMiniString",(t,e)=>{Ns.init(t,e),gt.init(t,e)});function A(t){return xg(Us,t)}i(A,"string");var Fg=fe("ZodMiniStringFormat",(t,e)=>{xl.init(t,e),Us.init(t,e)});var B0=fe("ZodMiniURL",(t,e)=>{ig.init(t,e),Fg.init(t,e)});function Lg(t){return Ig(B0,t)}i(Lg,"url");var Ms=fe("ZodMiniNumber",(t,e)=>{El.init(t,e),gt.init(t,e)});function Ct(t){return Ag(Ms,t)}i(Ct,"number");var V0=fe("ZodMiniNumberFormat",(t,e)=>{og.init(t,e),Ms.init(t,e)});function jg(t){return Dg(V0,t)}i(jg,"int");var $l=fe("ZodMiniBoolean",(t,e)=>{Il.init(t,e),gt.init(t,e)});function We(t){return $g($l,t)}i(We,"boolean");var qg=fe("ZodMiniBigInt",(t,e)=>{ag.init(t,e),gt.init(t,e)});var G0=fe("ZodMiniAny",(t,e)=>{sg.init(t,e),gt.init(t,e)});function jo(){return Ng(G0)}i(jo,"any");var H0=fe("ZodMiniUnknown",(t,e)=>{ug.init(t,e),gt.init(t,e)});function xe(){return kg(H0)}i(xe,"unknown");var W0=fe("ZodMiniVoid",(t,e)=>{cg.init(t,e),gt.init(t,e)});function Bg(t){return zg(W0,t)}i(Bg,"_void");var Vg=fe("ZodMiniDate",(t,e)=>{lg.init(t,e),gt.init(t,e)});var Z0=fe("ZodMiniArray",(t,e)=>{dg.init(t,e),gt.init(t,e)});function Ce(t,e){return new Z0({type:"array",element:t,...ot(e)})}i(Ce,"array");var K0=fe("ZodMiniObject",(t,e)=>{pg.init(t,e),gt.init(t,e),ht(t,"shape",()=>e.shape)});function M(t,e){let r={type:"object",shape:t??{},...ot(e)};return new K0(r)}i(M,"object");var J0=fe("ZodMiniUnion",(t,e)=>{Al.init(t,e),gt.init(t,e)});function Ne(t,e){return new J0({type:"union",options:t,...ot(e)})}i(Ne,"union");var Y0=fe("ZodMiniDiscriminatedUnion",(t,e)=>{fg.init(t,e),gt.init(t,e)});function kn(t,e,r){return new Y0({type:"union",options:e,discriminator:t,...ot(r)})}i(kn,"discriminatedUnion");var X0=fe("ZodMiniRecord",(t,e)=>{mg.init(t,e),gt.init(t,e)});function Ee(t,e,r){return new X0({type:"record",keyType:t,valueType:e,...ot(r)})}i(Ee,"record");var Q0=fe("ZodMiniEnum",(t,e)=>{hg.init(t,e),gt.init(t,e),t.options=Object.values(e.entries)});function Me(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Q0({type:"enum",entries:r,...ot(e)})}i(Me,"_enum");var eD=fe("ZodMiniLiteral",(t,e)=>{gg.init(t,e),gt.init(t,e)});function _e(t,e){return new eD({type:"literal",values:Array.isArray(t)?t:[t],...ot(e)})}i(_e,"literal");var tD=fe("ZodMiniTransform",(t,e)=>{yg.init(t,e),gt.init(t,e)});function zn(t){return new tD({type:"transform",transform:t})}i(zn,"transform");var rD=fe("ZodMiniOptional",(t,e)=>{vg.init(t,e),gt.init(t,e)});function Q(t){return new rD({type:"optional",innerType:t})}i(Q,"optional");var nD=fe("ZodMiniNullable",(t,e)=>{_g.init(t,e),gt.init(t,e)});function qo(t){return new nD({type:"nullable",innerType:t})}i(qo,"nullable");var iD=fe("ZodMiniPipe",(t,e)=>{Pg.init(t,e),gt.init(t,e)});function Un(t,e){return new iD({type:"pipe",in:t,out:e})}i(Un,"pipe");var oD=fe("ZodMiniCustom",(t,e)=>{wg.init(t,e),gt.init(t,e)});function Fs(t,e){return Mg(oD,t??(()=>!0),e)}i(Fs,"custom");var Bo={};Ss(Bo,{bigint:()=>dD,boolean:()=>lD,date:()=>pD,number:()=>cD,string:()=>uD});function uD(t){return Eg(Us,t)}i(uD,"string");function cD(t){return Rg(Ms,t)}i(cD,"number");function lD(t){return Og($l,t)}i(lD,"boolean");function dD(t){return Cg(qg,t)}i(dD,"bigint");function pD(t){return Ug(Vg,t)}i(pD,"date");var Cl=M({retryOnFailure:M({defaultValue:Q(We()),hide:Q(We())}),continueOnFailure:M({defaultValue:Q(We()),hide:Q(We())})}),Ol=class{constructor(e,r,n,o,s,p,m,h,v,P,x){this.name=e;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=p;this.requireAuth=m;this.errorHandlingOptions=h;this.outputSchema=v;this.audience=P;this.aiMetadata=x}static{i(this,"IAction")}},ee=i(t=>new Ol(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 Ge=M({displayName:A(),description:Q(A())}),ke=i((t,e)=>M({type:_e(e),required:We(),defaultValue:Q(jo())}),"TPropertyValue");var Wt=M({...Ge.shape,...ke(A(),"SHORT_TEXT").shape}),un=M({...Ge.shape,...ke(A(),"LONG_TEXT").shape});var Hg=M({label:A(),value:xe()}),Ls=M({disabled:Q(We()),placeholder:Q(A()),options:Ce(Hg)});var Zt=M({...Ge.shape,options:Ls,...ke(xe(),"STATIC_DROPDOWN").shape}),cn=M({...Ge.shape,options:Ls,...ke(Ce(xe()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Nl=M({...Ge.shape,...ke(xe(),"DROPDOWN").shape,refreshers:Ce(A())}),Vo=M({...Ge.shape,...ke(Ce(xe()),"MULTI_SELECT_DROPDOWN").shape,refreshers:Ce(A())});var ln=M({...Ge.shape,...ke(We(),"CHECKBOX").shape});var dn=M({...Ge.shape,...ke(Ct(),"NUMBER").shape});var Go=M({...Ge.shape,streaming:Q(We()),...ke(xe(),"FILE").shape});var Ho=M({...Ge.shape,...ke(A(),"DATE_TIME").shape});var Wg=Ee(A(),Ne([Wt,un,Zt,Vo,cn,ln,dn,Go,Ho])),Wo=M({...Ge.shape,properties:Wg,...ke(Ce(xe()),"ARRAY").shape});var Zo=M({...Ge.shape,...ke(Ne([Ee(A(),xe())]),"JSON").shape});var Zg=Ne([Wt,Zt,Zo,Wo,cn]),mD=Ee(A(),Zg),kl=M({refreshers:Ce(A()),...Ge.shape,...ke(xe(),"DYNAMIC").shape});var js=M({...Ge.shape,...ke(Bg(),"MARKDOWN").shape});var Ko=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Ko||{}),Li=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Li||{}),ji=(u=>(u.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",u.COMMUNICATION="COMMUNICATION",u.COMMERCE="COMMERCE",u.CORE="CORE",u.UNIVERSAL_AI="UNIVERSAL_AI",u.FLOW_CONTROL="FLOW_CONTROL",u.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",u.ACCOUNTING="ACCOUNTING",u.PRODUCTIVITY="PRODUCTIVITY",u.CONTENT_AND_FILES="CONTENT_AND_FILES",u.DEVELOPER_TOOLS="DEVELOPER_TOOLS",u.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",u.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",u.HUMAN_RESOURCES="HUMAN_RESOURCES",u.PAYMENT_PROCESSING="PAYMENT_PROCESSING",u.MARKETING="MARKETING",u.SALES_AND_CRM="SALES_AND_CRM",u))(ji||{});var Jo=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Jo||{}),zl="both_client_credentials_and_authorization_code";var pn=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(pn||{}),Yo=(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))(Yo||{}),hD=M({strategy:Me(Yo),paramName:Q(A())}),Xo=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Xo||{});var qs=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(qs||{}),Kg=M({status:Q(Ct()),body:Q(xe()),headers:Q(Ee(A(),A()))}),Jg=M({type:_e("DELAY"),resumeDateTime:A(),requestIdToReply:Q(A()),handlerId:Q(A()),streamStepProgress:Q(Me(qs))}),Yg=M({type:_e("WEBHOOK"),requestId:A(),requestIdToReply:Q(A()),response:Kg,handlerId:Q(A()),streamStepProgress:Q(Me(qs))}),gD=Ne([Jg,Yg]);var yD=M({body:xe(),rawBody:Q(xe()),headers:Ee(A(),A()),queryParams:Ee(A(),A())});function Pt(t){return t==null}i(Pt,"isNil");function Qo(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}i(Qo,"isEmpty");function Bs(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}i(Bs,"assertNotNullOrUndefined");var Ul=ue(require("crypto"),1);var vD=128,ai,qi,_D=i(t=>{!ai||ai.length<t?(ai=Buffer.allocUnsafe(t*vD),Ul.default.randomFillSync(ai),qi=0):qi+t>ai.length&&(Ul.default.randomFillSync(ai),qi=0),qi+=t},"fillPool"),PD=i(t=>(_D(t|=0),ai.subarray(qi-t,qi)),"random"),wD=i((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,o=Math.ceil(1.6*n*e/t.length);return(s=e)=>{let p="";for(;;){let m=r(o),h=o;for(;h--;)if(p+=t[m[h]&n]||"",p.length===s)return p}}},"customRandom"),Qg=i((t,e=21)=>wD(t,e,PD),"customAlphabet");var bD="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ey=21,bW=A().check(Nn(new RegExp(`^[0-9a-zA-Z]{${ey}}$`))),TD=Qg(bD,ey);var Mn=Un(zn(t=>t instanceof Date?t.toISOString():t),A()),cr={id:A(),created:Mn,updated:Mn},at=i(t=>Q(qo(t)),"Nullable");function Ml(t){return Q(qo(Me(t)))}i(Ml,"NullableEnum");var xW=Un(zn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),Q(We())),Vs=i(t=>Un(zn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),Q(Ce(t))),"OptionalArrayFromQuery");var AW=Ee(A(),xe());var ea=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(ea||{});var LW=A().check(Nn(/^#[0-9A-Fa-f]{6}$/));var qW=M({filename:A(),data:xe(),type:_e("file"),mimetype:Q(A())});var SD=ue(ry());var KW=M({...cr,name:A(),permissions:Ce(A()),platformId:at(A()),type:A(),userCount:Q(Ct())});var ny=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ny||{}),Fl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Fl||{}),Ll=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Ll||{});var jl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(jl||{});var ql=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(ql||{});var xD=M({mode:Me(ny),value:xe()}),ED=M({auth:Q(A()),fields:Ee(A(),xD)}),ID=M({pieceName:A(),pieceVersion:A(),actionName:A(),predefinedInput:Q(ED)}),AD=M({type:_e("PIECE"),toolName:A().check(wr(1)),pieceMetadata:ID}),RD=M({type:_e("none")}),DD=M({type:_e("access_token"),accessToken:A()}),$D=M({type:_e("api_key"),apiKey:A(),apiKeyHeader:A()}),OD=M({type:_e("headers"),headers:Ee(A(),A())}),CD=kn("type",[RD,DD,$D,OD]),iy=M({type:_e("FLOW"),toolName:A().check(wr(1)),externalFlowId:A(),flowDisplayName:Q(A())}),oy=M({type:_e("MCP"),toolName:A().check(wr(1)),serverUrl:Lg(),protocol:Me(Ll),auth:CD}),ay=M({type:_e("KNOWLEDGE_BASE"),toolName:A().check(wr(1)),sourceType:Me(Fl),sourceId:A(),sourceName:A()}),ND=kn("type",[AD,iy,oy,ay]),kD=M({displayName:A(),description:Q(A()),type:Me(jl)}),sy=M({type:_e("MARKDOWN"),markdown:A()}),Bi={type:_e("TOOL_CALL"),input:at(Ee(A(),xe())),output:Q(xe()),toolName:A(),status:Me(ql),toolCallId:A(),startTime:A(),endTime:Q(A())},EZ=M(Bi),uy=kn("toolCallType",[M({...Bi,toolCallType:_e("PIECE"),pieceName:A(),pieceVersion:A(),actionName:A()}),M({...Bi,toolCallType:_e("FLOW"),displayName:A(),externalFlowId:A()}),M({...Bi,toolCallType:_e("MCP"),displayName:A(),serverUrl:A()}),M({...Bi,toolCallType:_e("KNOWLEDGE_BASE"),displayName:A(),sourceType:A()}),M({...Bi,toolCallType:_e("UNKNOWN"),displayName:A()})]),zD=Ne([sy,uy]);var Bl=(r=>(r.IMAGE="image",r.TEXT="text",r))(Bl||{}),fn=M({apiKey:A()}),UD=fn,MD=M({apiKey:A(),apiKeyHash:A()}),FD=fn,LD=fn,jD=fn,qD=fn,BD=fn,VD=fn,GD=fn,fy=M({accessKeyId:A().check(wr(1)),secretAccessKey:A().check(wr(1))}),HD=M({}),WD=M({}),ZD=M({}),KD=M({}),JD=M({}),YD=M({}),my=M({modelId:A(),modelName:A(),modelType:Me(Bl)}),hy=M({apiKeyHeader:A(),baseUrl:A(),models:Ce(my),defaultHeaders:Q(Ee(A(),A()))}),gy=M({accountId:A(),gatewayId:A(),models:Ce(my),vertexProject:Q(A()),vertexRegion:Q(A())}),yy=M({resourceName:A(),apiVersion:Un(zn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),Q(A()))}),vy=M({region:A().check(wr(1))}),XD=Ne([UD,jD,qD,BD,VD,LD,FD,MD,fy,GD]),_y=Ne([hy,gy,yy,vy,HD,ZD,KD,JD,WD,YD]),QD=M({id:A(),name:A(),type:Me(Bl)}),e$=M({id:A(),name:A(),provider:Me(ea),config:_y,enabledForChat:We()}),t$=M({provider:Me(ea),config:_y,auth:XD,platformId:A()});var DZ={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},cy=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],r$=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],n$=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],ly=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],i$=["grok-4.20","grok-4.1-fast"],o$={openai:cy,anthropic:r$,google:ly,activepieces:[...n$.map(t=>`anthropic/${t}`),...cy.map(t=>`openai/${t}`),...ly.map(t=>`google/${t}`),...i$.map(t=>`x-ai/${t}`)]};var dy=128e3,a$={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function s$({provider:t}){return t?a$[t]??dy:dy}i(s$,"getMaxContextTokens");var py={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"},u$={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},c$=new Set(["anthropic","mistral"]);function Nr(t){return{chatModels:o$[t],maxContextTokens:s$({provider:t}),defaultEmbeddingModel:py[t],supportsEmbedding:py[t]!==void 0,supportsImageGeneration:!c$.has(t),webSearch:u$[t]}}i(Nr,"buildProviderCapabilities");var l$={openai:Nr("openai"),anthropic:Nr("anthropic"),openrouter:Nr("openrouter"),azure:Nr("azure"),google:Nr("google"),"cloudflare-gateway":Nr("cloudflare-gateway"),custom:Nr("custom"),bedrock:Nr("bedrock"),mistral:Nr("mistral"),activepieces:Nr("activepieces")};var d$=M({base64Url:A(),fileName:A(),extension:Q(A())}),p$=M({mimeType:A(),url:A(),fileName:Q(A())}),Vl=Ne([d$,p$]);var f$=Ne([M({type:_e("file"),value:Vl}),M({type:_e("markdown"),value:A(),files:Q(Ce(Vl))})]),m$=M({sessionId:A(),message:A(),files:Q(Ce(A()))});var wy=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(wy||{}),by=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(by||{}),Gl=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Gl||{});var h$=Ne([M({...cr,name:A(),externalId:A(),type:_e("STATIC_DROPDOWN"),tableId:A(),projectId:A(),data:M({options:Ce(M({value:A()}))})}),M({...cr,name:A(),externalId:A(),type:Ne([_e("TEXT"),_e("NUMBER"),_e("DATE")]),tableId:A(),projectId:A()})]),g$=M({...cr,name:A(),folderId:at(A()),projectId:A(),externalId:A(),status:Ml(by),trigger:Ml(wy)}),y$=M({...cr,tableId:A(),projectId:A(),cells:Ee(A(),M({updated:A(),created:A(),value:xe(),fieldName:A()}))}),v$=M({events:Ce(Me(Gl)),webhookUrl:A(),flowId:A()}),_$=M({fields:Ce(M({id:A(),name:A()})),rows:Ce(Ee(A(),A())),name:A()}),P$=M({projectId:A(),limit:Q(Bo.number()),cursor:Q(A()),name:Q(A()),externalIds:Vs(A()),folderId:Q(A()),folderIds:Vs(A())}),w$=M({records:Ce(Ce(M({fieldId:A(),value:Sy()}))),tableId:A()}),b$=M({cells:Q(Ce(M({fieldId:A(),value:Sy()}))),tableId:A(),agentUpdate:Q(We())}),Ty=kn("operator",[si("eq"),si("neq"),si("gt"),si("gte"),si("lt"),si("lte"),si("co"),Py("exists"),Py("not_exists")]),T$=M({tableId:A(),limit:Q(Bo.number()),cursor:Q(A()),filters:Vs(Ty)});function Sy(){return Un(zn(t=>t==null?t:String(t)),qo(A()))}i(Sy,"coerceToString");function si(t){return M({fieldId:A(),operator:_e(t),value:A()})}i(si,"valueFilter");function Py(t){return M({fieldId:A(),operator:_e(t)})}i(Py,"existenceFilter");var S$=M({status:Q(Ct()),body:Q(xe()),headers:Q(Ee(A(),A()))}),x$=M({...cr,deleted:at(Mn),ownerId:A(),displayName:A(),platformId:A(),externalId:at(A())});var xy=M({name:A(),description:Q(A()),type:A(),required:We()}),E$=M({pieceName:A(),triggerName:A(),input:M({toolName:A(),toolDescription:A(),inputSchema:Ce(xy),returnsResponse:We()})});var Ey="^[0-9]+\\.[0-9]+\\.[0-9]+$",KZ=new RegExp(Ey),A$="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",JZ=A().check(Nn(new RegExp(Ey))),YZ=A().check(Nn(new RegExp(A$))),R$=M({packageType:_e("ARCHIVE"),pieceType:Me(Li),pieceName:A(),pieceVersion:A(),archiveId:A(),platformId:A()}),Iy=M({packageType:_e("REGISTRY"),pieceType:_e("OFFICIAL"),pieceName:A(),pieceVersion:A()}),Ay=M({packageType:_e("REGISTRY"),pieceType:_e("CUSTOM"),pieceName:A(),pieceVersion:A(),platformId:A()}),XZ=Ne([Iy,Ay]),QZ=Ne([R$,Iy,Ay]);var D$=kn("type",[M({type:_e("CRON_EXPRESSION"),cronExpression:A(),timezone:A()}),M({type:_e("INTERVAL"),intervalMs:jg().check(ks(6e4))})]),e3=M({...cr,type:Me(pn),projectId:A(),flowId:A(),triggerName:A(),schedule:at(D$),flowVersionId:A(),pieceName:A(),pieceVersion:A(),deleted:at(A()),simulate:We()}),Ry=(E=>(E.UNKNOWN="UNKNOWN",E.FLOW_RUN_LOG="FLOW_RUN_LOG",E.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",E.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",E.FLOW_STEP_FILE="FLOW_STEP_FILE",E.SAMPLE_DATA="SAMPLE_DATA",E.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",E.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",E.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",E.PROJECT_RELEASE="PROJECT_RELEASE",E.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",E.PLATFORM_ASSET="PLATFORM_ASSET",E.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",E.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",E.KNOWLEDGE_BASE="KNOWLEDGE_BASE",E.FLOW_BUNDLE="FLOW_BUNDLE",E))(Ry||{}),Dy=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Dy||{}),$y=(r=>(r.S3="S3",r.DB="DB",r))($y||{}),t3=M({...cr,projectId:at(A()),platformId:at(A()),type:Me(Ry),compression:Me(Dy),data:Q(xe()),location:Me($y),size:at(Ct()),fileName:at(A()),s3Key:at(A()),metadata:at(Ee(A(),A()))}),Oy=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Oy||{}),Cy=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Cy||{}),r3=M({id:A(),email:A(),firstName:A(),status:Me(Cy),externalId:at(A()),platformId:at(A()),platformRole:Me(Oy),lastName:A(),created:Mn,updated:Mn,lastActiveDate:at(Mn),imageUrl:at(A())});var Wl=M({...Ge.shape,...ke(Ee(A(),xe()),"OBJECT").shape});var zy=M({...Ge.shape,...ke(A(),"COLOR").shape});var Zl=Ne([Wt,un,js,ln,Zt,cn,Nl,Vo,kl,dn,Wo,Wl,Zo,Ho,Go,zy]),C={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 kr=M({displayName:A(),description:Q(A())});var Uy=M({username:A(),password:A()}),Kl=M({...kr.shape,username:M({displayName:A(),description:Q(A())}),password:M({displayName:A(),description:Q(A())}),...ke(Uy,"BASIC_AUTH").shape});var N$=Ee(A(),Ne([Wt,un,dn,ln,Zt])),Jl=M({...kr.shape,props:N$,...ke(xe(),"CUSTOM_AUTH").shape});var ui=M({...kr.shape,...ke(M({auth:A()}),"SECRET_TEXT").shape});var k$=Ee(A(),Ne([Wt,un,ui,dn,ln,Zt,cn,js])),My=M({...kr.shape,props:k$,...ke(xe(),"OIDC").shape});var Yl=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Yl||{}),Fy=Ne([Wt,ui,Zt]),Ly=Ee(A(),Fy),z$=M({props:Q(Ee(A(),Fy)),authUrl:A(),tokenUrl:A(),scope:Ce(A()),prompt:Q(Ne([_e("none"),_e("consent"),_e("login"),_e("omit")])),pkce:Q(We()),pkceMethod:Q(Ne([_e("plain"),_e("S256")])),authorizationMethod:Q(Me(Yl)),grantType:Q(Ne([Me(Jo),_e(zl)])),extra:Q(Ee(A(),A()))}),jy=M({access_token:A(),props:Q(Ly),data:Ee(A(),jo())}),Xl=M({...kr.shape,...z$.shape,...ke(jy,"OAUTH2").shape});var Vi=Ne([Kl,Jl,My,Xl,ui]),ta="Connection",Hs={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||ta}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||ta,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||ta}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||ta}},None(){}};var NK={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 U$=M({...Ge.shape,...ke(xe(),"CUSTOM").shape,code:A()});var M$=Ne([Zl,Vi]),Ql=Ee(A(),M$),eJ=Ee(A(),Zl);var qy=Ne([M({strategy:_e("CRON"),cronExpression:A()}),M({strategy:_e("NONE")})]),Gi=class{constructor(e,r,n,o,s,p,m,h,v,P,x,T,w,S,D,E,u,f,c){this.name=e;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=p;this.handshakeConfiguration=m;this.onHandshake=h;this.renewConfiguration=v;this.onRenew=P;this.onEnable=x;this.onDisable=T;this.onStart=w;this.run=S;this.test=D;this.sampleData=E;this.testStrategy=u;this.outputSchema=f;this.aiMetadata=c}static{i(this,"ITrigger")}},Ws=i(t=>{switch(t.type){case"WEBHOOK":return new Gi(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 Gi(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 Gi(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 Gi(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,Pt(t.sampleData)&&Pt(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var By="2",Zs="0.82.0";var ed=class{constructor(e,r,n,o,s,p,m,h,v=Zs,P,x="",T){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=o;this.categories=m;this.auth=h;this.minimumSupportedRelease=v;this.maximumSupportedRelease=P;this.description=x;this.deprecated=T;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:By}),"getContextInfo");(!F$(v)||L$(v,Zs))&&(this.minimumSupportedRelease=Zs),s.forEach(w=>this._actions[w.name]=w),p.forEach(w=>this._triggers[w.name]=w)}static{i(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}},Vy=i(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new ed(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 F$(t){return/^\d+\.\d+\.\d+$/.test(t)}i(F$,"isValidSimpleSemver");function L$(t,e){let[r,n,o]=t.split(".").map(Number),[s,p,m]=e.split(".").map(Number);return r!==s?r<s:n!==p?n<p:o<m}i(L$,"isSemverLessThan");var j$=Q(Ee(A(),Ee(A(),A()))),Gy=M({id:Q(A()),name:A(),displayName:A(),logoUrl:A(),description:A(),authors:Ce(A()),platformId:Q(A()),directoryPath:Q(A()),auth:Q(Ne([Vi,Ce(Vi)])),version:A(),categories:Q(Ce(Me(ji))),minimumSupportedRelease:Q(A()),maximumSupportedRelease:Q(A()),deprecated:Q(We()),i18n:j$}),q$=Me(["human","ai","both"]),Hy=M({description:Q(A()),idempotent:Q(We())}),Wy=M({name:A(),displayName:A(),description:A(),props:Ql,requireAuth:We(),errorHandlingOptions:Q(Cl),outputSchema:Q(Fs()),audience:Q(q$),aiMetadata:Q(Hy)}),Zy=M({name:A(),displayName:A(),description:A(),props:Ql,errorHandlingOptions:Q(Cl),type:Me(pn),sampleData:xe(),handshakeConfiguration:Q(Fs()),renewConfiguration:Q(qy),testStrategy:Me(Xo),outputSchema:Q(Fs()),aiMetadata:Q(Hy)}),B$=M({...Gy.shape,actions:Ee(A(),Wy),triggers:Ee(A(),Zy)}),V$=M({...Gy.shape,actions:Ct(),triggers:Ct(),suggestedActions:Q(Ce(Wy)),suggestedTriggers:Q(Ce(Zy))}),Ky=M({projectUsage:Ct(),pieceType:Me(Li),packageType:Me(Ko),platformId:Q(A()),archiveId:Q(A())}),e8=M({...B$.shape,...Ky.shape}),t8=M({...V$.shape,...Ky.shape}),r8=M({name:A(),version:A()});var G$=ue(require("path")),H$=ue(require("fs/promises"));var Qy=require("node:stream");var Ks=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,p)=>{o.append(p,s)}),{urlWithoutQueryParams:n,queryParams:o}}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 Js=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(e=new td,r=new rd){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},td=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},rd=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(e,r){let n=`${e.username}:${e.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var ra=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(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 Jy({error:t,requestBody:e}){return t instanceof ra?t.errorMessage():{response:{status:0,body:t instanceof Error?t.message:String(t)},request:{body:e}}}i(Jy,"toFailsafeOutput");var zr=(p=>(p.GET="GET",p.POST="POST",p.PATCH="PATCH",p.PUT="PUT",p.DELETE="DELETE",p.HEAD="HEAD",p))(zr||{});var Ys=class extends Ks{static{i(this,"FetchHttpClient")}constructor(e="",r=new Js){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(e),s=this.getHeaders(e),p=e.queryParams??{};for(let[c,y]of Object.entries(p))o.append(c,y);let m=o.toString(),h=m?`${n}?${m}`:n,v=e.responseType??"json",P=e.followRedirects??!0,x=e.retries??0,{body:T,extraHeaders:w,isStream:S}=W$(e.method)?Z$(e.body,s):{body:void 0,extraHeaders:{},isStream:!1},D=J$({...s,...w}),E=await K$(async()=>{let c=new AbortController,y=e.timeout&&e.timeout>0?setTimeout(()=>c.abort(),e.timeout):void 0;try{let l={method:e.method.toString(),headers:D,body:T,redirect:P?"follow":"manual",signal:c.signal};return S&&(l.duplex="half"),r?.dispatcher!==void 0&&(l.dispatcher=r.dispatcher),await fetch(h,l)}finally{y!==void 0&&clearTimeout(y)}},x),u=P?300:400;if(E.status<200||E.status>=u){let c=await Yy(E,v),y=new ra(e.body,{status:E.status,responseBody:c});throw console.error("[HttpClient#(sanitized error message)] Request failed:",y),y}let f=await Yy(E,v);return{status:E.status,headers:Y$(E.headers),body:f}}};function W$(t){return t!=="GET"&&t!=="HEAD"}i(W$,"acceptsRequestBody");function Z$(t,e){if(Q$(t))return{body:void 0,extraHeaders:{},isStream:!1};if(X$(t)){let n=new Qy.PassThrough;return t.on("error",o=>n.destroy(o)),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}}i(Z$,"serializeBody");async function Yy(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}}}}i(Yy,"parseResponseBody");async function K$(t,e){let r;for(let n=0;n<=e;n++)try{let o=await t();if(o.status>=500&&n<e){await Xy(n);continue}return o}catch(o){if(r=o,n<e){await Xy(n);continue}throw o}throw r}i(K$,"sendWithRetries");function Xy(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}i(Xy,"backoff");function J$(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}i(J$,"normalizeHeaders");function Y$(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}i(Y$,"toHttpHeaders");function X$(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}i(X$,"isNodeFormData");function Q$(t){return t==null}i(Q$,"isNil");var wt=new Ys;var LC=ue(require("fs")),tP=ue(sa());var jC={"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 qC(t){let e=t.split(";")[0].trim().toLowerCase();return jC[e]??""}i(qC,"contentTypeToExtension");var BC=i(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),VC=i((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 rP({auth:t,baseUrl:e,authMapping:r,description:n,displayName:o,name:s,props:p,extraProps:m,authLocation:h="headers"}){return ee({audience:"human",name:s||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:C.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:i(async({auth:v})=>({url:C.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
69
+ i.e ${VC(e,v)}/resource or /resource`,required:!0,defaultValue:v?e(v):"",...p?.url??{}})}),"props")}),method:C.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(zr).map(v=>({label:v,value:v}))},...p?.method??{}}),headers:C.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...p?.headers??{}}),queryParams:C.Object({displayName:"Query Parameters",required:!0,...p?.queryParams??{}}),body_type:C.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:C.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:v})=>{if(!v)return{};let P=v,x={};switch(P){case"none":break;case"json":x.data=C.Json({displayName:"JSON Body",required:!0,...p?.body??{}});break;case"raw":x.data=C.LongText({displayName:"Raw Body",required:!0});break;case"form_data":x.data=C.Array({displayName:"Form Data",required:!0,properties:{fieldName:C.ShortText({displayName:"Field Name",required:!0}),fieldType:C.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:C.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:C.File({displayName:"File Field Value",required:!1})}});break}return x},"props")}),response_is_binary:C.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:C.Checkbox({displayName:"No Error on Failure",required:!1,...p?.failsafe??{}}),timeout:C.Number({displayName:"Timeout (in seconds)",required:!1,...p?.timeout??{}}),followRedirects:C.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...m},run:i(async v=>{let{method:P,url:x,headers:T,queryParams:w,body:S,body_type:D,failsafe:E,timeout:u,response_is_binary:f,followRedirects:c}=v.propsValue;Bs(P,"Method"),Bs(x,"URL");let y=Pt(r)?{}:await r(v.auth,v.propsValue),l=x.url,b=l.startsWith("http://")||l.startsWith("https://")?l:BC({baseUrl:e(v.auth),relativePath:l}),g={method:P,url:b,headers:{...T??{},...h==="headers"||!Pt(h)?y:{}},queryParams:{...h==="queryParams"?y:{},...w??{}},timeout:u?u*1e3:0,followRedirects:c};if(f&&(g.responseType="arraybuffer"),S)if(D&&D!=="none"){let oe=S.data;if(D==="form_data"){let ne=oe,Re=new tP.default;for(let{fieldName:se,fieldType:Y,textFieldValue:K,fileFieldValue:re}of ne)Y==="text"&&!Qo(K)?Re.append(se,K):Y==="file"&&!Qo(re)&&Re.append(se,re.data,{filename:re?.filename});g.body=Re,g.headers={...g.headers,...Re.getHeaders()}}else g.body=oe}else D||(g.body=S);try{let oe=await wt.sendRequest(g);return await GC(v.files,oe.body,oe.status,oe.headers,f)}catch(oe){if(E)return Jy({error:oe,requestBody:g.body});throw oe}},"run")})}i(rP,"createCustomApiCallAction");var GC=i(async(t,e,r,n,o)=>{let s;if(o&&HC(e)){let p=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],m=qC(p??"")||"txt",h;e instanceof ArrayBuffer?h=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?h=e:h=Buffer.from(e),s=await t.write({fileName:`output.${m}`,data:h})}else s=e;return{status:r,headers:n,body:s}},"handleBinaryResponse"),HC=i(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var Ur={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:o,files:s,server:p}){switch(t.strategy){case 0:{let m=await e.get("lastPoll");if(Pt(m))throw new Error("lastPoll doesn't exist in the store.");let h=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:m,server:p}),v=h.reduce((P,x)=>Math.max(P,x.epochMilliSeconds),m);return await e.put("lastPoll",v),h.filter(P=>P.epochMilliSeconds>m).map(P=>P.data)}case 1:{let m=await e.get("lastItem"),h=await t.items({store:e,auth:r,propsValue:n,lastItemId:m,files:s,server:p}),v=h.findIndex(T=>T.id===m),P=[];Pt(m)||v==-1?P=h??[]:P=h?.slice(0,v)??[],Pt(o)||(P=P.slice(-o));let x=P?.[0]?.id;return Pt(x)||await e.put("lastItem",x),P.map(T=>T.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:o}){switch(t.strategy){case 0:{await e.put("lastPoll",Date.now());break}case 1:{let p=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;Pt(p)?await e.delete("lastItem"):await e.put("lastItem",p);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:o,server:s}){let p=[];switch(t.strategy){case 0:{p=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{p=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:o,server:s});break}}return WC(p.map(m=>m.data))}};function WC(t){return t.length<=5?t:t.slice(0,5)}i(WC,"getFirstFiveOrAll");var bc=ue(Fa());var uS=["https://www.googleapis.com/auth/drive"],J=[Hs.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:uS}),Hs.CustomAuth({displayName:"Service Account (Advanced)",description:"Authenticate via service account from https://console.cloud.google.com/ > IAM & Admin > Service Accounts > Create Service Account > Keys > Add key. <br> <br> You can optionally use domain-wide delegation (https://support.google.com/a/answer/162106?hl=en#zippy=%2Cset-up-domain-wide-delegation-for-a-client) to access files without adding the service account to each one. <br> <br> **Note:** Without a user email, the service account only has access to files/folders you explicitly share with it.",required:!0,props:{serviceAccount:C.LongText({displayName:"Service Account JSON Key",required:!0}),userEmail:C.ShortText({displayName:"User Email",required:!1,description:"Email address of the user to impersonate for domain-wide delegation."})},validate:i(async({auth:t})=>{try{await pt({type:"CUSTOM_AUTH",props:{...t}})}catch(e){return{valid:!1,error:e.message}}return{valid:!0}},"validate")})];async function ae(t){if(t.type==="CUSTOM_AUTH"){let r;try{r=JSON.parse(t.props.serviceAccount)}catch{throw new Error("Invalid Service Account JSON Key. Please provide a valid JSON string.")}return new bc.JWT({email:r.client_email,key:r.private_key,scopes:uS,subject:t.props.userEmail})}let e=new bc.OAuth2Client;return e.setCredentials(t),e}i(ae,"createGoogleClient");var pt=i(async t=>{if(t.type==="CUSTOM_AUTH"){let r=await(await ae(t)).getAccessToken();if(r.token)return r.token;throw new Error("Could not retrieve access token from service account json")}return t.access_token},"getAccessToken");var SE=ue(Ae());var Im=ue(jc()),Am=ue(Ae());var UL=1e3,ML=i(t=>t.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),"escapeDriveQueryLiteral"),Le={properties:{parentFolder:C.Dropdown({displayName:"Parent Folder",description:"The Drive folder to target. Leave empty to use the root of My Drive. Type in the box to search your Drive by folder name. If the folder still isn't listed, switch this field to 'Dynamic value' (the toggle next to the field) and paste the folder ID \u2014 you can copy it from the folder's URL in Drive, after /folders/ (e.g. https://drive.google.com/drive/folders/<FOLDER_ID>).",required:!1,auth:J,refreshers:["include_team_drives"],refreshOnSearch:!0,options:i(async({auth:t,include_team_drives:e},r)=>{if(!t)return{disabled:!0,options:[],placeholder:"Please authenticate first"};let o=await pt(t),s=r?.searchValue?.trim()??"",p=["mimeType='application/vnd.google-apps.folder'","trashed = false"];s.length>0&&p.push(`name contains '${ML(s)}'`);let m={method:"GET",url:"https://www.googleapis.com/drive/v3/files",queryParams:{q:p.join(" and "),includeItemsFromAllDrives:e?"true":"false",supportsAllDrives:"true",corpora:e?"allDrives":"user",pageSize:String(UL),fields:"nextPageToken, files(id, name)"},authentication:{type:"BEARER_TOKEN",token:o}},h=[],v=!1;try{let P=await wt.sendRequest(m);h=P.body.files??[],v=!!P.body.nextPageToken}catch(P){throw new Error(`Failed to get folders
70
+ Error:${P}`)}return{disabled:!1,placeholder:v?`Showing first ${h.length} matches \u2014 type to narrow the list, or switch to Dynamic value to paste an ID.`:void 0,options:h.map(P=>({label:P.name,value:P.id}))}},"options")}),include_team_drives:C.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},async getFiles(t,e,r){let n=await ae(t),o=(0,Am.drive)({version:"v3",auth:n}),s=[];e?.parent&&s.push(`'${e.parent}' in parents`),e?.createdTime&&s.push(`createdTime ${e.createdTimeOp??">"} '${(0,Im.default)(e.createdTime).format()}'`),s.push("trashed = false");let p=[],m;do{let h={q:s.concat("mimeType!='application/vnd.google-apps.folder'").join(" and "),fields:"nextPageToken, files(id, name, mimeType, webViewLink, kind, createdTime)",orderBy:r??"createdTime desc",supportsAllDrives:!0,includeItemsFromAllDrives:e?.includeTeamDrive,corpora:e?.includeTeamDrive?"allDrives":"user"};m&&(h.pageToken=m);let v=await o.files.list(h);p.push(...v.data.files??[]),m=v.data.nextPageToken??void 0}while(m);return p},async getFolders(t,e,r){let n=await ae(t),o=(0,Am.drive)({version:"v3",auth:n}),s=["mimeType='application/vnd.google-apps.folder'"];e?.parent&&s.push(`'${e.parent}' in parents`),e?.createdTime&&s.push(`createdTime ${e.createdTimeOp??">"} '${(0,Im.default)(e.createdTime).format()}'`),s.push("trashed = false");let p=[],m;do{let h={q:s.join(" and "),fields:"nextPageToken, files(id, name, createdTime)",orderBy:r??"createdTime desc",supportsAllDrives:!0,includeItemsFromAllDrives:e?.includeTeamDrive,corpora:e?.includeTeamDrive?"allDrives":"user"};m&&(h.pageToken=m);let v=await o.files.list(h);p.push(...v.data.files??[]),m=v.data.nextPageToken??void 0}while(m);return p}};var Ix={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Ax={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Rx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Dx={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},$x={fields:[{key:"name",label:"Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Ox={fields:[{key:"files",label:"Files",labelKey:"name",listItems:[{key:"name",label:"Name",value:"name"},{key:"id",label:"File ID",value:"id"},{key:"mimeType",label:"MIME Type",value:"mimeType"},{key:"trashed",label:"Trashed",value:"trashed",format:"boolean"},{key:"parents",label:"Parent Folder ID",value:"parents[0]"}]},{key:"incompleteSearch",label:"Incomplete Search",value:"incompleteSearch",format:"boolean"}]},Cx={fields:[{key:"results",label:"Results",value:"",labelKey:"name",listItems:[{key:"name",label:"Name",value:"name"},{key:"mimeType",label:"MIME Type",value:"mimeType"},{key:"id",label:"File ID",value:"id"},{key:"createdTime",label:"Created Time",value:"createdTime",format:"datetime"},{key:"modifiedTime",label:"Modified Time",value:"modifiedTime",format:"datetime"}]}]},Nx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},kx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},zx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"iconLink",label:"Icon",format:"image"},{key:"size",label:"Size",format:"filesize"},{key:"fileExtension",label:"File Extension"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"shared",label:"Shared",format:"boolean"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]},{key:"lastModifyingUser",label:"Last Modifying User",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]},{key:"permissions",label:"Permissions",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"role",label:"Role"},{key:"type",label:"Type"},{key:"id",label:"Permission ID"}]}]},Ux={fields:[{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"id",label:"Permission ID"},{key:"allowFileDiscovery",label:"Allow File Discovery",format:"boolean"},{key:"downloadUrl",label:"Download URL",format:"url"},{key:"kind",label:"Kind"}]},Mx={fields:[{key:"role",label:"Role"},{key:"type",label:"Type"},{key:"id",label:"Permission ID"}]},Fx={fields:[{key:"removed",label:"Removed",value:"removed",format:"boolean"},{key:"message",label:"Message",value:"message"}]},Lx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},jx={fields:[{key:"name",label:"File Name"},{key:"webViewLink",label:"View Link",format:"url"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"id",label:"File ID"}]},qx={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"createdTime",label:"Created Time",format:"datetime"}]},FL=[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"iconLink",label:"Icon",format:"image"},{key:"fileExtension",label:"File Extension"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"shared",label:"Shared",format:"boolean"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]},{key:"lastModifyingUser",label:"Last Modifying User",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]}],Bx={fields:FL},Vx={fields:[{key:"files",label:"Files",labelKey:"name",listItems:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"shared",label:"Shared",format:"boolean"}]},{key:"incompleteSearch",label:"Incomplete Search",format:"boolean"}]},Gx={fields:[{key:"files",label:"Search Results",labelKey:"name",listItems:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"}]}]},Hx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"},{key:"size",label:"Size",format:"filesize"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]},{key:"lastModifyingUser",label:"Last Modifying User",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]},{key:"shared",label:"Shared",format:"boolean"}]},Wx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"iconLink",label:"Icon",format:"image"},{key:"fileExtension",label:"File Extension"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"me",label:"Is Me",format:"boolean"}]}]},Zx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"me",label:"Is Me",format:"boolean"}]}]},Kx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"},{key:"parents",label:"Parent Folder IDs"},{key:"shared",label:"Shared",format:"boolean"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"me",label:"Is Me",format:"boolean"}]}]},Jx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"description",label:"Description"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"webViewLink",label:"View Link",format:"url"},{key:"size",label:"Size",format:"filesize"}]},Yx={fields:[{key:"id",label:"Permission ID"},{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"emailAddress",label:"Email Address",format:"email"},{key:"displayName",label:"Display Name"},{key:"photoLink",label:"Photo",format:"image"},{key:"pendingOwner",label:"Pending Owner",format:"boolean"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"permissionDetails",label:"Permission Details",labelKey:"role",listItems:[{key:"role",label:"Role"},{key:"permissionType",label:"Permission Type"},{key:"inherited",label:"Inherited",format:"boolean"}]}]},Xx={fields:[{key:"permissions",label:"Permissions",labelKey:"displayName",listItems:[{key:"id",label:"Permission ID"},{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"emailAddress",label:"Email Address",format:"email"},{key:"displayName",label:"Display Name"},{key:"photoLink",label:"Photo",format:"image"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"pendingOwner",label:"Pending Owner",format:"boolean"}]}]},Qx={fields:[{key:"id",label:"Permission ID"},{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"allowFileDiscovery",label:"Allow File Discovery",format:"boolean"},{key:"permissionDetails",label:"Permission Details",labelKey:"role",listItems:[{key:"role",label:"Role"},{key:"permissionType",label:"Permission Type"},{key:"inherited",label:"Inherited",format:"boolean"}]}]},eE={fields:[{key:"id",label:"Permission ID"},{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"emailAddress",label:"Email Address",format:"email"},{key:"displayName",label:"Display Name"},{key:"photoLink",label:"Photo",format:"image"}]},tE={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"}]},rE={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"}]},nE={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"}]},iE={fields:[{key:"user",label:"Current User",children:[{key:"displayName",label:"Display Name"},{key:"emailAddress",label:"Email Address",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"},{key:"permissionId",label:"Permission ID"}]},{key:"storageQuota",label:"Storage Quota",children:[{key:"limit",label:"Total Limit",format:"filesize"},{key:"usage",label:"Used Space",format:"filesize"},{key:"usageInDrive",label:"Used in Drive",format:"filesize"},{key:"usageInDriveTrash",label:"Used in Trash",format:"filesize"}]},{key:"maxUploadSize",label:"Max Upload Size",format:"filesize"}]},oE={fields:[{key:"drives",label:"Shared Drives",labelKey:"name",listItems:[{key:"id",label:"Drive ID"},{key:"name",label:"Drive Name"},{key:"kind",label:"Kind"},{key:"colorRgb",label:"Color"},{key:"createdTime",label:"Created Time",format:"datetime"}]}]},aE={fields:[{key:"id",label:"Drive ID"},{key:"name",label:"Drive Name"},{key:"kind",label:"Kind"},{key:"colorRgb",label:"Color"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"restrictions",label:"Restrictions",children:[{key:"adminManagedRestrictions",label:"Admin Managed",format:"boolean"},{key:"copyRequiresWriterPermission",label:"Copy Requires Writer Permission",format:"boolean"},{key:"domainUsersOnly",label:"Domain Users Only",format:"boolean"},{key:"driveMembersOnly",label:"Drive Members Only",format:"boolean"}]}]},sE={fields:[{key:"comments",label:"Comments",labelKey:"content",listItems:[{key:"id",label:"Comment ID"},{key:"content",label:"Content"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]}]}]},uE={fields:[{key:"id",label:"Reply ID"},{key:"content",label:"Content"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]}]},cE={fields:[{key:"id",label:"Comment ID"},{key:"content",label:"Content"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]}]},lE={fields:[{key:"id",label:"Reply ID"},{key:"content",label:"Content"},{key:"htmlContent",label:"HTML Content",format:"html"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]}]},dE={fields:[{key:"replies",label:"Replies",labelKey:"content",listItems:[{key:"id",label:"Reply ID"},{key:"content",label:"Content"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]}]}]},pE={fields:[{key:"id",label:"Reply ID"},{key:"content",label:"Content"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]}]},fE={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"}]},mE={fields:[{key:"id",label:"Folder ID"},{key:"name",label:"Folder Name"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"parents",label:"Parent Folder IDs"},{key:"webViewLink",label:"View Link",format:"url"}]},hE={fields:[{key:"id",label:"Drive ID"},{key:"name",label:"Drive Name"},{key:"kind",label:"Kind"},{key:"colorRgb",label:"Color"},{key:"createdTime",label:"Created Time",format:"datetime"}]},gE={fields:[{key:"id",label:"Drive ID"},{key:"name",label:"Drive Name"},{key:"kind",label:"Kind"},{key:"colorRgb",label:"Color"},{key:"createdTime",label:"Created Time",format:"datetime"}]},yE={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},vE={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},_E={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},PE={fields:[{key:"success",label:"Success",format:"boolean"},{key:"reply_id",label:"Reply ID"}]},wE={fields:[{key:"deleted",label:"Deleted",format:"boolean"},{key:"driveId",label:"Drive ID"}]},bE={fields:[{key:"success",label:"Success",format:"boolean"},{key:"driveId",label:"Drive ID"}]},TE={fields:[{key:"removed",label:"Removed",format:"boolean"},{key:"message",label:"Message"}]};var xE=ee({auth:J,name:"update_permissions",description:"Update permissions for a file or folder",audience:"human",aiMetadata:{description:"Grants a specified role (reader, commenter, writer, fileOrganizer, or organizer) on a Drive file or folder to a user identified by email, optionally sending a notification email. Use to share a resource with a person. Requires the file/folder ID and target email. Not idempotent: each call creates a new permission grant.",idempotent:!1},displayName:"Update permissions",props:{fileId:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:C.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:C.StaticDropdown({displayName:"Role",description:"The role to grant to user. See more at: https://developers.google.com/drive/api/guides/ref-roles",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}}),include_team_drives:Le.properties.include_team_drives,send_invitation_email:C.Checkbox({displayName:"Send invitation email",description:"Send an email to the user to notify them of the new permissions",required:!0})},outputSchema:Mx,async run(t){let{fileId:e,user_email:r,permission_name:n,send_invitation_email:o,include_team_drives:s}=t.propsValue,p=await ae(t.auth),m=(0,SE.drive)({version:"v3",auth:p}),h={type:"user",role:n,emailAddress:r};return(await m.permissions.create({requestBody:h,fileId:e,sendNotificationEmail:o,supportsAllDrives:s})).data}});var EE=ue(Ae());var IE=ee({auth:J,name:"create_new_gdrive_folder",description:"Create a new empty folder in your Google Drive",audience:"human",aiMetadata:{description:"Creates a new empty folder in Google Drive, optionally nested under a parent folder. Use to set up a destination before uploading or moving files. Not idempotent: each call creates a distinct folder even with the same name (Drive permits duplicate folder names).",idempotent:!1},displayName:"Create new folder",props:{folderName:C.ShortText({displayName:"Folder name",description:"The name of the new folder",required:!0}),parentFolder:Le.properties.parentFolder,include_team_drives:Le.properties.include_team_drives},outputSchema:Ix,async run(t){let e=await ae(t.auth);return(await(0,EE.drive)({version:"v3",auth:e}).files.create({requestBody:{mimeType:"application/vnd.google-apps.folder",name:t.propsValue.folderName,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},supportsAllDrives:t.propsValue.include_team_drives})).data}});var AE=ue(Ae());var RE=ee({auth:J,name:"create_new_gdrive_file",description:"Create a new text file in your Google Drive from text",audience:"human",aiMetadata:{description:"Creates a new file in Google Drive from inline text content as plain text, CSV, or XML, optionally inside a parent folder. Use when an agent has generated text it needs to persist as a Drive file. Not idempotent: each call creates a new file.",idempotent:!1},displayName:"Create new file",props:{fileName:C.ShortText({displayName:"File name",description:"The name of the new text file",required:!0}),text:C.LongText({displayName:"Text",description:"The text content to add to file",required:!0}),fileType:C.StaticDropdown({displayName:"Content type",description:"Select file type",required:!0,defaultValue:"text/plain",options:{options:[{label:"Text",value:"text/plain"},{label:"CSV",value:"text/csv"},{label:"XML",value:"text/xml"}]}}),parentFolder:Le.properties.parentFolder,include_team_drives:Le.properties.include_team_drives},outputSchema:Ax,async run(t){let e=await ae(t.auth),r=(0,AE.drive)({version:"v3",auth:e}),n=t.propsValue.fileType==="plain/text"?"text/plain":t.propsValue.fileType;return(await r.files.create({requestBody:{name:t.propsValue.fileName,mimeType:n,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},media:{mimeType:n,body:t.propsValue.text},supportsAllDrives:t.propsValue.include_team_drives??!1,fields:"id, name, mimeType, kind"})).data}});var DE=ue(Ae());var $E=ee({auth:J,name:"delete_permissions",description:"Removes a role from an user for a file or folder",audience:"human",aiMetadata:{description:"Revokes a specific role from a user (matched by email and role) on a Drive file or folder. Use to unshare or downgrade access for someone. Requires the file/folder ID, the user email, and the role to remove. Idempotent: if no matching permission exists, the call is a no-op.",idempotent:!0},displayName:"Delete permissions",props:{fileId:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:C.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:C.StaticDropdown({displayName:"Role",description:"The role to remove from user.",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}})},outputSchema:Fx,async run(t){let[e,r]=[t.propsValue.fileId,t.propsValue.user_email],n=await ae(t.auth),o=(0,DE.drive)({version:"v3",auth:n}),s=await o.permissions.list({fileId:e,fields:"permissions(id, emailAddress, role)"});if(s.data.permissions){for(let p of s.data.permissions)if(p.emailAddress===r&&p.role===t.propsValue.permission_name)return await o.permissions.delete({fileId:e,permissionId:p.id?p.id:""}),{removed:!0,message:"Permission removed"}}return{removed:!1,message:"Permission not found"}}});var OE=ue(Ae());var CE=ee({displayName:"Duplicate File",auth:J,name:"duplicate_file",description:"Duplicate a file from Google Drive. Returns the new file ID.",audience:"human",aiMetadata:{description:"Copies an existing Drive file into a target folder under a new name, optionally converting it to a Google Sheet or Google Doc. Use to clone a file or create an editable Google-format copy. Requires the source file ID and destination folder ID. Not idempotent: each call creates a new copy.",idempotent:!1},props:{fileId:C.ShortText({displayName:"File ID",description:"The ID of the file to duplicate",required:!0}),name:C.ShortText({displayName:"Name",description:"The name of the new file",required:!0}),folderId:C.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be duplicated",required:!0}),mimeType:C.StaticDropdown({displayName:"Duplicate as",description:"If left unselected the file will be duplicated as it is",required:!1,options:{options:[{label:"Google Sheets",value:"application/vnd.google-apps.spreadsheet"},{label:"Google Docs",value:"application/vnd.google-apps.document"}]}}),include_team_drives:Le.properties.include_team_drives},outputSchema:Nx,async run(t){let e=await ae(t.auth),r=t.propsValue.fileId,n=t.propsValue.name,o=t.propsValue.folderId,s=t.propsValue.mimeType,p=(0,OE.drive)({version:"v3",auth:e}),m={name:n,parents:[o]};s&&(m.mimeType=s);let h=await p.files.copy({fileId:r,auth:e,requestBody:m,supportsAllDrives:t.propsValue.include_team_drives});if(h.status!==200)throw new Error("Error duplicating file");return h.data}});var NE=ue(Ae());var kE=ee({auth:J,name:"get-file-or-folder-by-id",displayName:"Get File Information",description:"Get a file folder for files/sub-folders",audience:"human",aiMetadata:{description:"Fetches metadata for a single file or folder in Google Drive by its exact ID (name, MIME type, parents, etc.). Use when an agent already has a file/folder ID and needs its details. Read-only and idempotent. Requires the resource ID, not a name or path.",idempotent:!0},props:{id:C.ShortText({displayName:"File / Folder Id",description:"The Id of the file/folder to search for.",required:!0}),include_team_drives:Le.properties.include_team_drives},outputSchema:$x,async run(t){let e=await ae(t.auth),n=await(0,NE.drive)({version:"v3",auth:e}).files.get({fileId:t.propsValue.id,supportsAllDrives:t.propsValue.include_team_drives});return n.data?n.data:null}});var Rm=ue(require("querystring"));var UE=ue(Fn());async function ME(t,e){let r=await pt(t);return(await fetch(`https://www.googleapis.com/drive/v3/files/${e}?fields=mimeType&supportsAllDrives=true`,{headers:{Authorization:`Bearer ${r}`}}).then(o=>o.json())).mimeType}i(ME,"getMimeType");var zE=i(async(t,e,r,n,o)=>{let s=await ME(e,r),p=await pt(e),m=await fetch(t,{headers:{Authorization:`Bearer ${p}`}}).then(x=>x.ok?x.blob():Promise.reject(x)).catch(x=>Promise.reject(new Error(`Error when download file:
71
+ Download file response: ${x.message??x}`))),h=(0,UE.extension)(s),v=h?"."+h:"",P=o??r+v;return n.write({fileName:P,data:Buffer.from(await m.arrayBuffer())})},"googledlCall");async function Bt(t,e,r,n){let o=await ME(t,r);if(["application/vnd.google-apps.document","application/vnd.google-apps.spreadsheet","application/vnd.google-apps.presentation"].includes(o)){switch(o){case"application/vnd.google-apps.document":o="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case"application/vnd.google-apps.spreadsheet":o="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;case"application/vnd.google-apps.presentation":o="application/vnd.openxmlformats-officedocument.presentationml.presentation";break}return await zE(`https://www.googleapis.com/drive/v3/files/${r}/export?mimeType=${o}&supportsAllDrives=true`,t,r,e,n)}else return await zE(`https://www.googleapis.com/drive/v3/files/${r}?alt=media&supportsAllDrives=true`,t,r,e,n)}i(Bt,"downloadFileFromDrive");async function FE(t,e,r,n,o,s=0){let p=[];if(s>r)return p;let m=await pt(t),h=`'${e}' in parents`;n||(h+=" and trashed=false");let v={q:h,fields:"nextPageToken,files(id,kind,mimeType,name,trashed,parents)",supportsAllDrives:"true",includeItemsFromAllDrives:o?"true":"false",corpora:o?"allDrives":"user",pageSize:"1000"},P=await wt.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Rm.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of P.body.files)p.push({file:x,level:s,parentFolder:e});for(;P.body.nextPageToken;){v.pageToken=P.body.nextPageToken,P=await wt.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Rm.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of P.body.files)p.push({file:x,level:s,parentFolder:e})}if(s+1<r){let x=p.filter(T=>T.file.mimeType==="application/vnd.google-apps.folder");for(let T of x){let w=await FE(t,T.file.id,r,n,o,s+1);p.push(...w)}}return p}i(FE,"getFilesRecursively");var LE=ee({auth:J,name:"list-files",displayName:"List files",description:"List files from a Google Drive folder",audience:"human",aiMetadata:{description:"Lists files and subfolders inside a given Drive folder, with optional recursion to a chosen depth and optional download of each file's content. Use to enumerate the contents of a known folder ID. Read-only and idempotent. Requires the folder ID, not a name.",idempotent:!0},props:{folderId:C.ShortText({displayName:"Folder ID",description:"Folder ID coming from | New Folder -> id | (or any other source)",required:!0}),include_team_drives:Le.properties.include_team_drives,includeTrashed:C.Checkbox({displayName:"Include Trashed",description:"Include new files that have been trashed.",required:!1,defaultValue:!1}),depthLevel:C.Number({displayName:"Depth Level",description:"How many levels deep to search for files. 1 = current folder only, 2 = current + next level, etc.",required:!1,defaultValue:1}),downloadFiles:C.Checkbox({displayName:"Download Files",description:"Download all file contents in a list",required:!1,defaultValue:!1})},outputSchema:Ox,async run(t){let e={type:"drive#fileList",incompleteSearch:!1,files:[]},r=t.propsValue.depthLevel||1,n=await FE(t.auth,t.propsValue.folderId,r,t.propsValue.includeTrashed??!1,t.propsValue.include_team_drives??!1);if(e.files=n.map(o=>o.file),t.propsValue.downloadFiles){let o=[],s={"application/pdf":".pdf","image/jpeg":".jpg","image/png":".png","image/tiff":".tiff","text/plain":".txt","text/csv":".csv","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":".xlsx"};for(let p of n){let m=p.file;if(m.mimeType==="application/vnd.google-apps.folder")continue;let h=m.name,v=s[m.mimeType];v&&!h.toLowerCase().endsWith(v)&&(m.mimeType==="image/jpeg"&&h.toLowerCase().endsWith(".jpeg")||(h=h+v));try{let P=await Bt(t.auth,t.files,m.id,h);o.push(P)}catch(P){console.warn(`Failed to download file ${m.name}: ${P instanceof Error?P.message:"Download failed"}`)}}e.downloadedFiles=o}return e}});var jE=ee({auth:J,name:"read-file",displayName:"Read File Content",description:"Read a selected file from google drive file",audience:"human",aiMetadata:{description:"Downloads the content of a Drive file by its file ID and returns it as a usable file reference. Use to retrieve a file an agent already knows the ID of (e.g. from a trigger or search). Read-only and idempotent. Requires the exact file ID, not a name.",idempotent:!0},props:{fileId:C.ShortText({displayName:"File ID",description:"File ID coming from | New File -> id |",required:!0}),fileName:C.ShortText({displayName:"Destination File name",required:!1})},outputSchema:Dx,run:i(async({auth:t,propsValue:e,files:r})=>Bt(t,r,e.fileId,e.fileName),"run")});var qE=ue(Ae()),BE=require("stream");var VE=ee({displayName:"Save Document as PDF",auth:J,name:"save_file_as_pdf",description:"Save a document as PDF in a Google Drive folder",audience:"human",aiMetadata:{description:"Exports a Google document to PDF and saves it as a new file in a target Drive folder. Use to produce a PDF rendition of a Google Doc/Sheet/Slides for sharing or archival. Requires the source document ID and destination folder ID. Not idempotent: each call creates a new PDF file.",idempotent:!1},props:{documentId:C.ShortText({displayName:"Document ID",description:"The ID of the document to export",required:!0}),folderId:C.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be exported",required:!0}),name:C.ShortText({displayName:"Name",description:"The name of the new file (do not include the extension)",required:!0}),include_team_drives:Le.properties.include_team_drives},outputSchema:kx,async run(t){let e=await ae(t.auth),r=t.propsValue.documentId,n=t.propsValue.folderId,o=t.propsValue.name,s=(0,qE.drive)({version:"v3",auth:e}),p=await s.files.export({fileId:r,mimeType:"application/pdf"},{responseType:"arraybuffer"}),m={name:o+".pdf",parents:[n]},h=Buffer.from(p.data,"base64"),P={mimeType:"application/pdf",body:new BE.Stream.PassThrough().end(h)};return(await s.files.create({requestBody:m,media:P,supportsAllDrives:t.propsValue.include_team_drives})).data}});var GE=ue(Ae());var HE=ee({auth:J,name:"search-folder",displayName:"Search",description:"Search a Google Drive folder for files/sub-folders",audience:"human",aiMetadata:{description:"Searches Google Drive for files or folders matching a name, full-text, or MIME-type query, optionally scoped to a parent folder and filtered to files or folders only. Use to resolve a file/folder ID from a human-readable name before acting on it. Read-only and idempotent.",idempotent:!0},props:{queryTerm:C.StaticDropdown({displayName:"Query Term",description:"The Query term or field of file/folder to search upon.",defaultValue:"name",options:{options:[{label:"File name",value:"name"},{label:"Full text search",value:"fullText"},{label:"Content type",value:"mimeType"}]},required:!0}),operator:C.StaticDropdown({displayName:"Operator",description:"The operator to create criteria.",required:!0,options:{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"="}]},defaultValue:"contains"}),query:C.ShortText({displayName:"Value",description:"Value of the field of file/folder to search for.",required:!0}),type:C.StaticDropdown({displayName:"File Type",description:"(Optional) Choose between files and folders.",required:!1,options:{options:[{label:"All",value:"all"},{label:"Files",value:"file"},{label:"Folders",value:"folder"}]},defaultValue:"all"}),parentFolder:Le.properties.parentFolder,include_team_drives:Le.properties.include_team_drives},outputSchema:Cx,async run(t){let e=await ae(t.auth),r=(0,GE.drive)({version:"v3",auth:e}),n=t.propsValue.operator??"contains",s=`${t.propsValue.queryTerm??"name"} ${n} '${t.propsValue.query}'`;switch(t.propsValue.parentFolder&&(s=`${s} and '${t.propsValue.parentFolder}' in parents`),t.propsValue.type??"all"){case"file":s=`${s} and mimeType!='application/vnd.google-apps.folder'`;break;case"folder":s=`${s} and mimeType='application/vnd.google-apps.folder'`;break;default:break}let m=[],h;do{let v={q:s,fields:"nextPageToken, files(id, name, mimeType, createdTime, modifiedTime)",includeItemsFromAllDrives:t.propsValue.include_team_drives,supportsAllDrives:!0,corpora:t.propsValue.include_team_drives?"allDrives":"user",pageSize:1e3};h&&(v.pageToken=h);let P=await r.files.list(v);if(P.status!==200)throw console.error(P),new Error("Error searching for the file/folder");m.push(...P.data.files??[]),h=P.data.nextPageToken??void 0}while(h);return m.length>0?m:[]}});var WE=require("stream"),ZE=ue(Fn()),KE=ue(Ae());var JE=ee({auth:J,name:"upload_gdrive_file",description:"Upload a file in your Google Drive",audience:"human",aiMetadata:{description:"Uploads a binary file (from a URL or base64 input) into Google Drive, optionally inside a parent folder. Use to store an existing file or attachment in Drive; the MIME type is inferred from the file extension. Not idempotent: each call creates a new file.",idempotent:!1},displayName:"Upload file",props:{fileName:C.ShortText({displayName:"File name",description:"The name of the file",required:!0}),file:C.File({displayName:"File",description:"The file URL or base64 to upload",required:!0}),parentFolder:Le.properties.parentFolder,include_team_drives:Le.properties.include_team_drives},outputSchema:Rx,async run(t){let e=t.propsValue.file,r=ZE.default.lookup(e.extension??"")||"application/octet-stream",n=await ae(t.auth);return(await(0,KE.drive)({version:"v3",auth:n}).files.create({requestBody:{name:t.propsValue.fileName,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},media:{mimeType:r,body:WE.Readable.from(Buffer.from(e.base64,"base64"))},supportsAllDrives:t.propsValue.include_team_drives??!1,fields:"id, name, mimeType, kind"})).data}});var XE=ue(jc());var Bc={strategy:0,items:i(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await Le.getFiles(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(s=>({epochMilliSeconds:(0,XE.default)(s.createdTime).valueOf(),data:s})),"items")},QE=Ws({auth:J,name:"new_file",displayName:"New File",description:"Trigger when a new file is uploaded.",aiMetadata:{description:"Fires when a new file appears in Google Drive, optionally scoped to a specific parent folder. Each event represents one newly created file and its metadata, with optional inclusion of the file content."},props:{parentFolder:Le.properties.parentFolder,include_team_drives:Le.properties.include_team_drives,include_file_content:C.Checkbox({displayName:"Include File Content",description:"Include the file content in the output. This will increase the time taken to fetch the files and might cause issues with large files.",required:!1,defaultValue:!1})},outputSchema:jx,type:"POLLING",onEnable:i(async t=>{await Ur.onEnable(Bc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:i(async t=>{await Ur.onDisable(Bc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:i(async t=>{let e=await Ur.poll(Bc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await YE(e,t)},"run"),test:i(async t=>{let e=await Ur.test(Bc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await YE(e,t)},"test"),sampleData:{kind:"drive#file",mimeType:"image/png",id:"1dpv4-sKJfKRwI9qx1vWqQhEGEn3EpbI5",name:"google-drive.png",link:"https://cdn.activepieces.com/pieces/google-drive.png"}});async function YE(t,e){let r=JSON.parse(JSON.stringify(t));if(e.propsValue.include_file_content){let n=[];for(let s of r)n.push(Bt(e.auth,e.files,s.id,s.name));let o=await Promise.all(n);for(let s=0;s<r.length;s++)r[s].content=o[s]}return r}i(YE,"handleFileContent");var eI=ue(jc());var Vc={strategy:0,items:i(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await Le.getFolders(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(s=>({epochMilliSeconds:(0,eI.default)(s.createdTime).valueOf(),data:s})),"items")},tI=Ws({auth:J,name:"new_folder",displayName:"New Folder",description:"Trigger when a new folder is created or uploaded.",aiMetadata:{description:"Fires when a new folder is created in Google Drive, optionally scoped to a specific parent folder. Each event represents one newly created folder and its metadata."},props:{parentFolder:Le.properties.parentFolder,include_team_drives:Le.properties.include_team_drives},outputSchema:qx,type:"POLLING",onEnable:i(async t=>{await Ur.onEnable(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:i(async t=>{await Ur.onDisable(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:i(async t=>await Ur.poll(Vc,t),"run"),test:i(async t=>await Ur.test(Vc,t),"test"),sampleData:{kind:"drive#file",mimeType:"application/vnd.google-apps.folder",id:"1aMEtTqIYn5651wdK7WLxaK_SDim4mvXW",name:"New Folder WOOOO"}});var rI=ue(Ae());var nI=ee({auth:J,name:"set_public_access",description:"Set public access for a file or folder",audience:"human",aiMetadata:{description:"Makes a Drive file or folder accessible to anyone with the link at the chosen role (reader, commenter, or writer) and returns its shareable view/download URL. Use to publish a resource publicly. Requires the file/folder ID. Not idempotent: each call adds a new anyone-with-link permission.",idempotent:!1},displayName:"Set public access",props:{fileId:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),role:C.StaticDropdown({displayName:"Role",description:"The role to assign for public access",options:{options:[{label:"Reader",value:"reader"},{label:"Commenter",value:"commenter"},{label:"Editor",value:"writer"}]},defaultValue:"reader",required:!0})},outputSchema:Ux,async run(t){let e=await ae(t.auth),r=t.propsValue.fileId,n=t.propsValue.role,o=(0,rI.drive)({version:"v3",auth:e}),s={role:n,type:"anyone"},p=await o.permissions.create({fileId:r,requestBody:s}),m=await o.files.get({fileId:r,fields:"name,mimeType,webContentLink,webViewLink"});if(m.data.mimeType==="application/vnd.google-apps.folder")return{...p.data,webViewLink:m.data.webViewLink,downloadUrl:null};let h=await Bt(t.auth,t.files,r,m.data.name);return{...p.data,downloadUrl:h}}});var iI=ue(Ae());var oI=ee({auth:J,name:"google-drive-move-file",displayName:"Move File",description:"Moves a file from one folder to another.",audience:"human",aiMetadata:{description:"Relocates a Drive file to a target folder, detaching it from its current parents and attaching it to the new one. Use to reorganize a file once you know its ID and the destination folder ID. Idempotent: repeating with the same destination leaves the file in the same folder.",idempotent:!0},props:{fileId:C.ShortText({displayName:"File ID",description:"You can use **Search Folder/File** action to retrieve ID.",required:!0}),include_team_drives:Le.properties.include_team_drives,folderId:Le.properties.parentFolder},outputSchema:zx,async run(t){let e=t.propsValue.fileId,r=t.propsValue.folderId,n=await ae(t.auth),o=(0,iI.drive)({version:"v3",auth:n}),s=await o.files.get({fileId:e,supportsAllDrives:t.propsValue.include_team_drives,fields:"id,parents"});return(await o.files.update({fileId:e,fields:"*",removeParents:s.data.parents?.join(","),addParents:r,supportsAllDrives:t.propsValue.include_team_drives})).data}});var aI=ue(Ae()),sI=ee({auth:J,name:"delete_gdrive_file",description:"Delete permanently a file from your Google Drive",audience:"human",aiMetadata:{description:"Permanently deletes a file from Google Drive by its ID, bypassing the trash and making it unrecoverable. Use only when permanent removal is intended; prefer Trash file for reversible deletion. Requires the file ID. Not idempotent: a repeat call fails because the file no longer exists.",idempotent:!1},displayName:"Delete file",props:{fileId:C.ShortText({displayName:"File ID",description:"The ID of the file to delete",required:!0}),include_team_drives:Le.properties.include_team_drives},async run(t){let e=await ae(t.auth);return(await(0,aI.drive)({version:"v3",auth:e}).files.delete({fileId:t.propsValue.fileId,supportsAllDrives:t.propsValue.include_team_drives})).data}});var uI=ue(Ae());var cI=ee({auth:J,name:"trash_gdrive_file",description:"Move a file to the trash in your Google Drive",audience:"human",aiMetadata:{description:"Moves a Drive file to the trash by its ID, a reversible deletion that can be restored from Drive. Use for safe removal instead of permanent deletion. Requires the file ID. Idempotent: re-trashing an already-trashed file leaves it in the same state.",idempotent:!0},displayName:"Trash file",props:{fileId:C.ShortText({displayName:"File ID",description:"The ID of the file to trash",required:!0}),include_team_drives:Le.properties.include_team_drives},outputSchema:Lx,async run(t){let e=await ae(t.auth),r=(0,uI.drive)({version:"v3",auth:e}),n={trashed:!0};return(await r.files.update({fileId:t.propsValue.fileId,supportsAllDrives:t.propsValue.include_team_drives,requestBody:n})).data}});var lI=ue(Ae());var dI=ee({auth:J,name:"drive_create_folder",displayName:"Create Folder",description:"Create a new empty folder in your Google Drive",audience:"ai",aiMetadata:{description:"Creates a new empty folder in Google Drive, optionally nested under a parent folder (resolve the parent ID via `drive_search_files`). Use to set up a destination before uploading or moving files. Each call creates a distinct folder even with the same name, so retries duplicate.",idempotent:!1},outputSchema:mE,props:{folder_name:C.ShortText({displayName:"Folder name",description:"The name of the new folder",required:!0}),parent_folder_id:C.ShortText({displayName:"Parent Folder ID",description:"The ID of the folder to create the new folder inside. Leave empty to create it in the root of My Drive. Resolve a folder ID with `drive_search_files`.",required:!1})},async run(t){let e=await ae(t.auth);return(await(0,lI.drive)({version:"v3",auth:e}).files.create({requestBody:{mimeType:"application/vnd.google-apps.folder",name:t.propsValue.folder_name,...t.propsValue.parent_folder_id?{parents:[t.propsValue.parent_folder_id]}:{}},supportsAllDrives:!0})).data}});var pI=ue(sa());var fI=ee({auth:J,name:"drive_create_file_from_text",displayName:"Create File from Text",description:"Create a new text file in your Google Drive from text",audience:"ai",aiMetadata:{description:"Creates a new Drive file from inline text content as plain text, CSV, or XML. Use when an agent has generated text it needs to persist as a Drive file; for binary or existing files use `drive_upload_file` instead. Each call creates a new file.",idempotent:!1},outputSchema:Hx,props:{file_name:C.ShortText({displayName:"File name",description:"The name of the new text file",required:!0}),text:C.LongText({displayName:"Text",description:"The text content to add to file",required:!0}),content_type:C.StaticDropdown({displayName:"Content type",description:"Select file type",required:!0,defaultValue:"plain/text",options:{options:[{label:"Text",value:"plain/text"},{label:"CSV",value:"text/csv"},{label:"XML",value:"text/xml"}]}}),parent_folder_id:C.ShortText({displayName:"Parent Folder ID",description:"The ID of the folder to create the file inside. Leave empty to create it in the root of My Drive. Resolve a folder ID with `drive_search_files`.",required:!1})},async run(t){let e={mimeType:t.propsValue.content_type,name:t.propsValue.file_name,...t.propsValue.parent_folder_id?{parents:[t.propsValue.parent_folder_id]}:{}},r=Buffer.from(JSON.stringify(e),"utf-8"),n=Buffer.from(t.propsValue.text,"utf-8"),o=new pI.default;return o.append("Metadata",r,{contentType:"application/json"}),o.append("Media",n,{contentType:t.propsValue.content_type}),(await wt.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart",body:o,headers:{...o.getHeaders()},queryParams:{supportsAllDrives:"true"},authentication:{type:"BEARER_TOKEN",token:await pt(t.auth)}})).body}});var mI=ue(sa());var hI=ue(Fn());var gI=ee({auth:J,name:"drive_upload_file",displayName:"Upload File",description:"Upload a file in your Google Drive",audience:"ai",aiMetadata:{description:"Uploads a binary file (from a URL or base64 input) into Drive; MIME type is inferred from the extension. Use to store an existing file or attachment; for plain generated text use `drive_create_file_from_text`, and to fetch a remote URL server-side use `drive_upload_from_url`. Each call creates a new file.",idempotent:!1},outputSchema:Wx,props:{file_name:C.ShortText({displayName:"File name",description:"The name of the file",required:!0}),file:C.File({displayName:"File",description:"The file URL or base64 to upload",required:!0}),parent_folder_id:C.ShortText({displayName:"Parent Folder ID",description:"The ID of the folder to upload the file into. Leave empty to upload to the root of My Drive. Resolve a folder ID with `drive_search_files`.",required:!1})},async run(t){let e=t.propsValue.file,n={mimeType:hI.default.lookup(e.extension?e.extension:""),name:t.propsValue.file_name,...t.propsValue.parent_folder_id?{parents:[t.propsValue.parent_folder_id]}:{}},o=Buffer.from(JSON.stringify(n),"utf-8"),s=Buffer.from(e.base64,"base64"),p=new mI.default;return p.append("Metadata",o,{contentType:"application/json"}),p.append("Media",s),(await wt.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files",queryParams:{uploadType:"multipart",supportsAllDrives:"true"},body:p,headers:{...p.getHeaders()},authentication:{type:"BEARER_TOKEN",token:await pt(t.auth)}})).body}});var yI=ue(sa());var vI=ue(Fn());var _I=ee({auth:J,name:"drive_upload_from_url",displayName:"Upload File from URL",description:"Fetch a file from a public URL and upload it into Google Drive.",audience:"ai",aiMetadata:{description:"Fetches a file from a public URL and uploads it into Drive in one step (server-side fetch, no base64 round-trip). Use when the agent has a downloadable link rather than file bytes; for bytes already in hand use `drive_upload_file`, and for plain generated text use `drive_create_file_from_text`. Each call creates a new file.",idempotent:!1},outputSchema:yE,props:{source_url:C.ShortText({displayName:"Source URL",description:"The publicly accessible URL to fetch the file from. Only public URLs are supported (no authentication headers are sent).",required:!0}),file_name:C.ShortText({displayName:"File name",description:"The name to give the uploaded file in Drive.",required:!0}),mime_type:C.ShortText({displayName:"MIME Type",description:"Optional MIME type for the uploaded file (e.g. application/pdf). Provide this when the URL has no file extension; otherwise the type is inferred from the URL.",required:!1}),parent_folder_id:C.ShortText({displayName:"Parent Folder ID",description:"The ID of the folder to upload the file into. Leave empty to upload to the root of My Drive. Resolve a folder ID with `drive_search_files`.",required:!1})},async run(t){let{source_url:e,file_name:r,mime_type:n,parent_folder_id:o}=t.propsValue,s;try{s=await wt.sendRequest({method:"GET",url:e,responseType:"arraybuffer"})}catch(T){throw new Error(`Failed to fetch the file from the source URL (${e}). Ensure it is a publicly accessible link. Underlying error: ${T?.message??T}`)}let p=n||vI.default.lookup(e)||"application/octet-stream",m={mimeType:p,name:r,...o?{parents:[o]}:{}},h=Buffer.from(JSON.stringify(m),"utf-8"),v=Buffer.from(s.body),P=new yI.default;return P.append("Metadata",h,{contentType:"application/json"}),P.append("Media",v,{contentType:p}),(await wt.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files",queryParams:{uploadType:"multipart",supportsAllDrives:"true"},body:P,headers:{...P.getHeaders()},authentication:{type:"BEARER_TOKEN",token:await pt(t.auth)}})).body}});var PI=ue(Fn());var wI=ee({auth:J,name:"drive_replace_file_content",displayName:"Replace File Content",description:"Replace an existing Drive file's bytes, keeping its ID and name.",audience:"ai",aiMetadata:{description:"Replaces the contents of an existing Drive file with new bytes, keeping the same file ID, name, and location. Use to update a file in place (e.g. overwrite a report); to create a brand-new file use `drive_upload_file`, and to rename without changing content use `drive_update_file_metadata`. Each call overwrites the previous content.",idempotent:!1},outputSchema:nE,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the existing file whose content to replace. Resolve it via `drive_search_files` or `drive_get_file`.",required:!0}),file:C.File({displayName:"New File Content",description:"The file URL or base64 whose bytes will replace the existing content.",required:!0}),mime_type:C.ShortText({displayName:"MIME Type",description:"Optional MIME type for the new content (e.g. application/pdf). Provide this when the source has no file extension; otherwise the type is inferred from the extension.",required:!1})},async run(t){let{file_id:e,file:r,mime_type:n}=t.propsValue,o=n||PI.default.lookup(r.extension?r.extension:"")||"application/octet-stream",s=Buffer.from(r.base64,"base64");return(await wt.sendRequest({method:"PATCH",url:`https://www.googleapis.com/upload/drive/v3/files/${e}`,queryParams:{uploadType:"media",supportsAllDrives:"true"},body:s,headers:{"Content-Type":o},authentication:{type:"BEARER_TOKEN",token:await pt(t.auth)}})).body}});var bI=ee({auth:J,name:"drive_download_file",displayName:"Download File Content",description:"Read a selected file from google drive file",audience:"ai",aiMetadata:{description:"Downloads a Drive file's bytes by ID and returns a file reference; native Google files (Docs/Sheets/Slides) are auto-exported to their default Office format. Use to retrieve content of a file you have the ID for (obtain it from `drive_search_files` or `drive_get_file`). Read-only.",idempotent:!0},outputSchema:vE,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file to download. Resolve it via `drive_search_files` or `drive_get_file`.",required:!0}),destination_file_name:C.ShortText({displayName:"Destination File name",required:!1})},run:i(async({auth:t,propsValue:e,files:r})=>Bt(t,r,e.file_id,e.destination_file_name),"run")});var TI=ue(Ae()),SI=ue(Fn());var xI=ee({auth:J,name:"drive_export_workspace_file",displayName:"Export Google Doc/Sheet/Slides",description:"Export a native Google Workspace file (Doc/Sheet/Slides) to a chosen format.",audience:"ai",aiMetadata:{description:"Exports a native Google Workspace file (Doc/Sheet/Slides) to a caller-chosen format and returns the bytes. Use when you need a specific format such as PDF, HTML, CSV, or Markdown; for the default rendition or for ordinary binary files use `drive_download_file`. The chosen format must match the source type (Doc formats for a Doc, Sheet formats for a Sheet, etc.). Read-only. Export size is capped at ~10 MB by Drive.",idempotent:!0},outputSchema:_E,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the native Google Workspace file to export. Resolve it via `drive_search_files` or `drive_get_file`.",required:!0}),mime_type:C.StaticDropdown({displayName:"Export Format",description:"The target format. It must match the source type: Doc formats for a Google Doc, Sheet formats for a Google Sheet, Slides formats for Google Slides. An incompatible pairing returns an error.",required:!0,options:{options:[{label:"Word (DOCX) \u2014 Docs",value:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{label:"PDF \u2014 Docs/Sheets/Slides",value:"application/pdf"},{label:"HTML \u2014 Docs",value:"text/html"},{label:"Plain Text (TXT) \u2014 Docs",value:"text/plain"},{label:"Rich Text (RTF) \u2014 Docs",value:"application/rtf"},{label:"OpenDocument Text (ODT) \u2014 Docs",value:"application/vnd.oasis.opendocument.text"},{label:"EPUB \u2014 Docs",value:"application/epub+zip"},{label:"Markdown (MD) \u2014 Docs",value:"text/markdown"},{label:"Excel (XLSX) \u2014 Sheets",value:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{label:"CSV \u2014 Sheets",value:"text/csv"},{label:"TSV \u2014 Sheets",value:"text/tab-separated-values"},{label:"OpenDocument Spreadsheet (ODS) \u2014 Sheets",value:"application/vnd.oasis.opendocument.spreadsheet"},{label:"PowerPoint (PPTX) \u2014 Slides",value:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{label:"OpenDocument Presentation (ODP) \u2014 Slides",value:"application/vnd.oasis.opendocument.presentation"},{label:"PNG \u2014 Slides",value:"image/png"},{label:"SVG \u2014 Slides",value:"image/svg+xml"}]}})},async run(t){let{file_id:e,mime_type:r}=t.propsValue,n=await ae(t.auth),o=(0,TI.drive)({version:"v3",auth:n});try{let s=await o.files.export({fileId:e,mimeType:r},{responseType:"arraybuffer"}),p=(0,SI.extension)(r),m=p?"."+p:"";return t.files.write({fileName:e+m,data:Buffer.from(s.data)})}catch(s){throw(s?.errors?.[0]?.reason??s?.response?.data?.error?.errors?.[0]?.reason)==="exportSizeLimitExceeded"?new Error(`Export failed: the file exceeds Drive's ~10 MB export size limit (file ID: ${e}). Use drive_download_file to fetch the source directly instead.`):s.code===403?new Error(`Permission denied exporting file ${e}. You may lack access to this file.`):s.code===400?new Error(`Invalid export for file ${e}: the chosen format does not match the source type, or this is not a native Google Workspace file. Use drive_download_file for ordinary binary files.`):s.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):s}}});var EI=ue(Ae());var II=ee({auth:J,name:"drive_get_file",displayName:"Get File or Folder",description:"Get a file folder for files/sub-folders",audience:"ai",aiMetadata:{description:"Fetches metadata for a single file or folder by its exact ID (name, MIME type, parents, owners, links). Use when you already have an ID (e.g. from a trigger or `drive_search_files`) and need its details, including its parent folder IDs. Read-only and safe to retry.",idempotent:!0},outputSchema:Bx,props:{file_id:C.ShortText({displayName:"File / Folder ID",description:"The ID of the file/folder to fetch. Resolve it via `drive_search_files` or `drive_list_files`.",required:!0})},async run(t){let e=await ae(t.auth),n=await(0,EI.drive)({version:"v3",auth:e}).files.get({fileId:t.propsValue.file_id,supportsAllDrives:!0});return n.data?n.data:null}});var Dm=ue(require("querystring"));async function AI(t,e,r,n,o,s=0){let p=[];if(s>r)return p;let m=await pt(t),h=`'${e}' in parents`;n||(h+=" and trashed=false");let v={q:h,fields:"nextPageToken,files(id,kind,mimeType,name,trashed,parents)",supportsAllDrives:"true",includeItemsFromAllDrives:o?"true":"false",corpora:o?"allDrives":"user",pageSize:"1000"},P=await wt.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Dm.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of P.body.files)p.push({file:x,level:s,parentFolder:e});for(;P.body.nextPageToken;){v.pageToken=P.body.nextPageToken,P=await wt.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Dm.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of P.body.files)p.push({file:x,level:s,parentFolder:e})}if(s+1<r){let x=p.filter(T=>T.file.mimeType==="application/vnd.google-apps.folder");for(let T of x){let w=await AI(t,T.file.id,r,n,o,s+1);p.push(...w)}}return p}i(AI,"getFilesRecursively");var RI=ee({auth:J,name:"drive_list_files",displayName:"List Folder Contents",description:"List files from a Google Drive folder",audience:"ai",aiMetadata:{description:"Lists files and subfolders inside a given folder ID, optionally recursing to a chosen depth and downloading each file's content. Use to enumerate the contents of a known folder; to find a file by name across Drive use `drive_search_files`. Read-only. Requires the folder ID, not a name.",idempotent:!0},outputSchema:Vx,props:{folder_id:C.ShortText({displayName:"Folder ID",description:"The ID of the folder to list. Resolve it via `drive_search_files` (or any other source).",required:!0}),include_trashed:C.Checkbox({displayName:"Include Trashed",description:"Include new files that have been trashed.",required:!1,defaultValue:!1}),depth_level:C.Number({displayName:"Depth Level",description:"How many levels deep to search for files. 1 = current folder only, 2 = current + next level, etc.",required:!1,defaultValue:1}),download_files:C.Checkbox({displayName:"Download Files",description:"Download all file contents in a list",required:!1,defaultValue:!1}),include_team_drives:C.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},async run(t){let e={type:"drive#fileList",incompleteSearch:!1,files:[]},r=t.propsValue.depth_level||1,n=await AI(t.auth,t.propsValue.folder_id,r,t.propsValue.include_trashed??!1,t.propsValue.include_team_drives??!1);if(e.files=n.map(o=>o.file),t.propsValue.download_files){let o=[],s={"application/pdf":".pdf","image/jpeg":".jpg","image/png":".png","image/tiff":".tiff","text/plain":".txt","text/csv":".csv","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":".xlsx"};for(let p of n){let m=p.file;if(m.mimeType==="application/vnd.google-apps.folder")continue;let h=m.name,v=s[m.mimeType];v&&!h.toLowerCase().endsWith(v)&&(m.mimeType==="image/jpeg"&&h.toLowerCase().endsWith(".jpeg")||(h=h+v));try{let P=await Bt(t.auth,t.files,m.id,h);o.push(P)}catch(P){console.warn(`Failed to download file ${m.name}: ${P instanceof Error?P.message:"Download failed"}`)}}e.downloadedFiles=o}return e}});var DI=ue(Ae());var $I=ee({auth:J,name:"drive_search_files",displayName:"Search Files and Folders",description:"Search a Google Drive folder for files/sub-folders",audience:"ai",aiMetadata:{description:"Searches Drive for files or folders matching a name, full-text, or MIME-type query, optionally scoped to a parent folder. Use this to resolve a human-readable name into a file/folder ID before acting on it; to list a known folder's children use `drive_list_files` instead. Read-only.",idempotent:!0},outputSchema:Gx,props:{query_term:C.StaticDropdown({displayName:"Query Term",description:"The Query term or field of file/folder to search upon.",defaultValue:"name",options:{options:[{label:"File name",value:"name"},{label:"Full text search",value:"fullText"},{label:"Content type",value:"mimeType"}]},required:!0}),operator:C.StaticDropdown({displayName:"Operator",description:"The operator to create criteria.",required:!0,options:{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"="}]},defaultValue:"contains"}),value:C.ShortText({displayName:"Value",description:"Value of the field of file/folder to search for.",required:!0}),type:C.StaticDropdown({displayName:"File Type",description:"(Optional) Choose between files and folders.",required:!1,options:{options:[{label:"All",value:"all"},{label:"Files",value:"file"},{label:"Folders",value:"folder"}]},defaultValue:"all"}),parent_folder_id:C.ShortText({displayName:"Parent Folder ID",description:"(Optional) Restrict the search to files/folders inside this folder ID.",required:!1}),include_team_drives:C.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},async run(t){let e=await ae(t.auth),r=(0,DI.drive)({version:"v3",auth:e}),n=t.propsValue.operator??"contains",s=`${t.propsValue.query_term??"name"} ${n} '${t.propsValue.value}'`;switch(t.propsValue.parent_folder_id&&(s=`${s} and '${t.propsValue.parent_folder_id}' in parents`),t.propsValue.type??"all"){case"file":s=`${s} and mimeType!='application/vnd.google-apps.folder'`;break;case"folder":s=`${s} and mimeType='application/vnd.google-apps.folder'`;break;default:break}let m=[],h;do{let v={q:s,fields:"nextPageToken, files(id, name, mimeType, createdTime, modifiedTime)",includeItemsFromAllDrives:t.propsValue.include_team_drives,supportsAllDrives:!0,corpora:t.propsValue.include_team_drives?"allDrives":"user",pageSize:1e3};h&&(v.pageToken=h);let P=await r.files.list(v);if(P.status!==200)throw console.error(P),new Error("Error searching for the file/folder");m.push(...P.data.files??[]),h=P.data.nextPageToken??void 0}while(h);return m.length>0?m:[]}});var OI=ue(Ae());var CI=ee({auth:J,name:"drive_copy_file",displayName:"Copy File",description:"Duplicate a file from Google Drive. Returns the new file ID.",audience:"ai",aiMetadata:{description:"Copies an existing Drive file into a target folder under a new name, optionally converting it to a Google Sheet or Doc. Use to clone a file or make an editable Google-format copy; to relocate the original instead of copying use `drive_move_file`. Requires source file ID and destination folder ID. Each call creates a new copy.",idempotent:!1},outputSchema:Zx,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file to duplicate. Resolve it via `drive_search_files`.",required:!0}),name:C.ShortText({displayName:"Name",description:"The name of the new file",required:!0}),folder_id:C.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be duplicated. Resolve it via `drive_search_files`.",required:!0}),convert_to:C.StaticDropdown({displayName:"Duplicate as",description:"If left unselected the file will be duplicated as it is",required:!1,options:{options:[{label:"Google Sheets",value:"application/vnd.google-apps.spreadsheet"},{label:"Google Docs",value:"application/vnd.google-apps.document"}]}})},async run(t){let e=await ae(t.auth),r=t.propsValue.file_id,n=t.propsValue.name,o=t.propsValue.folder_id,s=t.propsValue.convert_to,p=(0,OI.drive)({version:"v3",auth:e}),m={name:n,parents:[o]};s&&(m.mimeType=s);let h=await p.files.copy({fileId:r,auth:e,requestBody:m,supportsAllDrives:!0});if(h.status!==200)throw new Error("Error duplicating file");return h.data}});var NI=ue(Ae());var kI=ee({auth:J,name:"drive_move_file",displayName:"Move File",description:"Move a Drive file from its current folder(s) to a target folder.",audience:"ai",aiMetadata:{description:"Relocates a file to a target folder, detaching it from its current parents and attaching the new one. Use to reorganize a file by ID; to copy instead of move use drive_copy_file, and to rename without moving use drive_update_file_metadata. Safe to retry \u2014 repeating leaves the file in the same destination.",idempotent:!0},outputSchema:Kx,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file to move. Resolve it via drive_search_files or drive_get_file.",required:!0}),folder_id:C.ShortText({displayName:"Destination Folder ID",description:"The ID of the folder to move the file into. Resolve it via drive_search_files; leave empty for the root of My Drive.",required:!0})},async run(t){let e=t.propsValue.file_id,r=t.propsValue.folder_id,n=await ae(t.auth),o=(0,NI.drive)({version:"v3",auth:n}),s=await o.files.get({fileId:e,supportsAllDrives:!0,fields:"id,parents"});return(await o.files.update({fileId:e,fields:"*",removeParents:s.data.parents?.join(","),addParents:r,supportsAllDrives:!0})).data}});var zI=ue(Ae());var UI=ee({auth:J,name:"drive_update_file_metadata",displayName:"Update File Metadata (Rename)",description:"Rename a Drive file/folder or update its description or starred flag (metadata only).",audience:"ai",aiMetadata:{description:"Renames a file/folder or updates its description or starred flag via a metadata-only PATCH. Use to rename or annotate a resource; this never changes the file's location \u2014 to re-parent use `drive_move_file`, and to replace the file's bytes use `drive_replace_file_content`. Safe to retry \u2014 re-applying the same values is a no-op.",idempotent:!0},outputSchema:Jx,props:{file_id:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update. Resolve it via `drive_search_files` or `drive_get_file`.",required:!0}),name:C.ShortText({displayName:"New Name",description:"A new name for the file or folder. Leave empty to keep the current name.",required:!1}),description:C.ShortText({displayName:"Description",description:"A new description for the file or folder. Leave empty to keep the current description.",required:!1}),starred:C.Checkbox({displayName:"Starred",description:"Whether to mark the file or folder as starred.",required:!1})},async run(t){let{file_id:e,name:r,description:n,starred:o}=t.propsValue,s={};r!=null&&r!==""&&(s.name=r),n!=null&&(s.description=n),o!=null&&(s.starred=o);let p=await ae(t.auth),m=(0,zI.drive)({version:"v3",auth:p});try{return(await m.files.update({fileId:e,supportsAllDrives:!0,requestBody:s})).data}catch(h){throw h.code===404?new Error(`File or folder not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):h.code===403?new Error(`Permission denied updating file ${e}. You may lack edit permission on this resource.`):h}}});var MI=ue(Ae()),FI=require("stream");var LI=ee({auth:J,name:"drive_save_file_as_pdf",displayName:"Save File as PDF",description:"Save a document as PDF in a Google Drive folder",audience:"ai",aiMetadata:{description:"Exports a native Google document to PDF and saves it as a new file in a target Drive folder. Use to produce a PDF rendition of a Google Doc/Sheet/Slides for sharing or archival (resolve the source and folder IDs via `drive_search_files`). Each call creates a new PDF file.",idempotent:!1},outputSchema:fE,props:{document_id:C.ShortText({displayName:"Document ID",description:"The ID of the document to export. Resolve it via `drive_search_files`.",required:!0}),folder_id:C.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be exported. Resolve it via `drive_search_files`.",required:!0}),name:C.ShortText({displayName:"Name",description:"The name of the new file (do not include the extension)",required:!0})},async run(t){let e=await ae(t.auth),r=t.propsValue.document_id,n=t.propsValue.folder_id,o=t.propsValue.name,s=(0,MI.drive)({version:"v3",auth:e}),p=await s.files.export({fileId:r,mimeType:"application/pdf"},{responseType:"arraybuffer"}),m={name:o+".pdf",parents:[n]},h=Buffer.from(p.data,"base64"),P={mimeType:"application/pdf",body:new FI.Stream.PassThrough().end(h)};return(await s.files.create({requestBody:m,media:P,supportsAllDrives:!0})).data}});var jI=ue(Ae());var qI=ee({auth:J,name:"drive_trash_file",displayName:"Trash File",description:"Move a Drive file to the trash by ID (reversible deletion).",audience:"ai",aiMetadata:{description:"Moves a file to the trash by ID \u2014 a reversible deletion restorable from Drive. Use for safe removal; for irreversible removal use drive_delete_file, and to restore use drive_untrash_file. Safe to retry \u2014 re-trashing leaves it trashed.",idempotent:!0},outputSchema:tE,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file to trash. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let e=await ae(t.auth),r=(0,jI.drive)({version:"v3",auth:e}),n={trashed:!0};return(await r.files.update({fileId:t.propsValue.file_id,supportsAllDrives:!0,requestBody:n})).data}});var BI=ue(Ae());var VI=ee({auth:J,name:"drive_untrash_file",displayName:"Restore File from Trash",description:"Restore a trashed Drive file by ID back to its original location.",audience:"ai",aiMetadata:{description:"Restores a trashed file by ID back to its original location. Use to undo a `drive_trash_file`; to permanently purge instead use `drive_empty_trash` or `drive_delete_file`. Safe to retry \u2014 re-restoring an active file is a no-op.",idempotent:!0},outputSchema:rE,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the trashed file to restore. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let{file_id:e}=t.propsValue,r=await ae(t.auth),n=(0,BI.drive)({version:"v3",auth:r});try{return(await n.files.update({fileId:e,supportsAllDrives:!0,requestBody:{trashed:!1}})).data}catch(o){throw o.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):o.code===403?new Error(`Permission denied restoring file ${e}. You may lack permission to restore this resource.`):o}}});var GI=ue(Ae()),HI=ee({auth:J,name:"drive_delete_file",displayName:"Delete File Permanently",description:"Permanently delete a Drive file by ID, bypassing the trash.",audience:"ai",aiMetadata:{description:"Permanently deletes a file by ID, bypassing the trash \u2014 unrecoverable. Use only when permanent removal is intended; for reversible deletion prefer drive_trash_file. A repeat call fails because the file no longer exists.",idempotent:!1},props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file to permanently delete. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let e=await ae(t.auth);return(await(0,GI.drive)({version:"v3",auth:e}).files.delete({fileId:t.propsValue.file_id,supportsAllDrives:!0})).data}});var WI=ue(Ae());var ZI=ee({auth:J,name:"drive_empty_trash",displayName:"Empty Trash",description:"Permanently delete ALL files in the trash (irreversible, account-wide).",audience:"ai",aiMetadata:{description:"DESTRUCTIVE: permanently deletes EVERY file currently in the trash \u2014 this is an irreversible, account-wide purge (not a single file), or scoped to one shared drive if `drive_id` is given. The entire trash is emptied, so any file the user trashed is gone for good. Use only as a deliberate cleanup step; to remove a single file reversibly use `drive_trash_file`, and to permanently remove one specific file use `drive_delete_file`. Not safe to retry casually \u2014 it purges whatever is in the trash at call time.",idempotent:!1},outputSchema:bE,props:{drive_id:C.ShortText({displayName:"Shared Drive ID",description:"Optional. Restrict the purge to a single shared drive's trash (resolve via drive_list_shared_drives). Leave empty to empty the entire My Drive trash for the connected account.",required:!1})},async run(t){let{drive_id:e}=t.propsValue,r=await ae(t.auth),n=(0,WI.drive)({version:"v3",auth:r});try{return await n.files.emptyTrash({...e?{driveId:e}:{}}),{success:!0,driveId:e??null}}catch(o){throw o.code===403?new Error("Permission denied emptying the trash. You may lack permission to empty this trash."):o}}});var KI=ue(Ae());var JI=ee({auth:J,name:"drive_share_file",displayName:"Share File with User",description:"Grant a role on a Drive file or folder to a user by email.",audience:"ai",aiMetadata:{description:"Grants a role to a user (by email) on a file or folder, optionally emailing them. Use to share with a specific person; to share with anyone-with-the-link use drive_set_public_access, and to change an existing collaborator's role use drive_update_permission. Each call creates a new permission grant.",idempotent:!1},outputSchema:Yx,props:{file_id:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to share. Resolve it via drive_search_files or drive_get_file.",required:!0}),user_email:C.ShortText({displayName:"User Email",description:"The email address of the user to grant access to.",required:!0}),role:C.StaticDropdown({displayName:"Role",description:"The role to grant to the user. See https://developers.google.com/drive/api/guides/ref-roles",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}}),send_invitation_email:C.Checkbox({displayName:"Send Invitation Email",description:"Send an email to the user to notify them of the new permission.",required:!0})},async run(t){let{file_id:e,user_email:r,role:n,send_invitation_email:o}=t.propsValue,s=await ae(t.auth),p=(0,KI.drive)({version:"v3",auth:s}),m={type:"user",role:n,emailAddress:r};return(await p.permissions.create({requestBody:m,fileId:e,sendNotificationEmail:o,supportsAllDrives:!0})).data}});var YI=ue(Ae());var XI=ee({auth:J,name:"drive_set_public_access",displayName:"Set Public Access",description:"Make a Drive file or folder accessible to anyone with the link.",audience:"ai",aiMetadata:{description:"Makes a file or folder accessible to anyone with the link at the chosen role and returns its shareable view/download URL. Use to publish a resource publicly; to share with a named person instead use drive_share_file. Each call adds a new anyone-with-link permission.",idempotent:!1},outputSchema:Qx,props:{file_id:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to make public. Resolve it via drive_search_files or drive_get_file.",required:!0}),role:C.StaticDropdown({displayName:"Role",description:"The role to assign for public access.",options:{options:[{label:"Reader",value:"reader"},{label:"Commenter",value:"commenter"},{label:"Editor",value:"writer"}]},defaultValue:"reader",required:!0})},async run(t){let e=await ae(t.auth),r=t.propsValue.file_id,n=t.propsValue.role,o=(0,YI.drive)({version:"v3",auth:e}),s={role:n,type:"anyone"},p=await o.permissions.create({fileId:r,requestBody:s,supportsAllDrives:!0}),m=await o.files.get({fileId:r,fields:"name,mimeType,webContentLink,webViewLink",supportsAllDrives:!0});if(m.data.mimeType==="application/vnd.google-apps.folder")return{...p.data,webViewLink:m.data.webViewLink,downloadUrl:null};let h=await Bt(t.auth,t.files,r,m.data.name);return{...p.data,downloadUrl:h}}});var QI=ue(Ae());var eA=ee({auth:J,name:"drive_list_permissions",displayName:"List Permissions",description:"List every permission on a Drive file or folder.",audience:"ai",aiMetadata:{description:"Lists every permission (who has access and at what role) on a file or folder, with each permission's id, type, role, and email/domain. Use to audit sharing before granting or revoking; it is the resolver for the permissionId other sharing atomics need. Read-only.",idempotent:!0},outputSchema:Xx,props:{file_id:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder whose permissions to list. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let{file_id:e}=t.propsValue,r=await ae(t.auth),n=(0,QI.drive)({version:"v3",auth:r});try{let s=(await n.permissions.list({fileId:e,fields:"permissions(id,type,role,emailAddress,domain)",supportsAllDrives:!0})).data.permissions??[];return{permissions:s,count:s.length}}catch(o){throw o.code===404?new Error(`File or folder not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):o.code===403?new Error(`Permission denied listing permissions for file ${e}. You may lack access to this resource.`):o}}});var tA=ue(Ae());var rA=ee({auth:J,name:"drive_update_permission",displayName:"Update Permission Role",description:"Change an existing collaborator's role on a Drive file or folder.",audience:"ai",aiMetadata:{description:"Changes an existing collaborator's role in place (e.g. reader to writer), resolving the permission by their email internally. Use to upgrade or downgrade access without unsharing; to grant net-new access use drive_share_file. If the user has no existing grant it is a no-op (it never silently creates one). Safe to retry.",idempotent:!0},outputSchema:eE,props:{file_id:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder whose permission to update. Resolve it via drive_search_files or drive_get_file.",required:!0}),user_email:C.ShortText({displayName:"User Email",description:"The email address of the collaborator whose role to change. The existing permission is matched by this email; list current grants via drive_list_permissions.",required:!0}),new_role:C.StaticDropdown({displayName:"New Role",description:"The role to set for the user. See https://developers.google.com/drive/api/guides/ref-roles",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}})},async run(t){let{file_id:e,user_email:r,new_role:n}=t.propsValue,o=await ae(t.auth),s=(0,tA.drive)({version:"v3",auth:o});try{let h=((await s.permissions.list({fileId:e,fields:"permissions(id,emailAddress,role)",supportsAllDrives:!0})).data.permissions??[]).find(P=>P.emailAddress===r);return!h||!h.id?{updated:!1,message:`No existing permission found for ${r}. Use drive_share_file to grant new access.`}:{updated:!0,permission:(await s.permissions.update({fileId:e,permissionId:h.id,requestBody:{role:n},supportsAllDrives:!0})).data}}catch(p){throw p.code===404?new Error(`File or folder not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):p.code===403?new Error(`Permission denied updating the role on file ${e}. You may lack permission to manage sharing on this resource.`):p}}});var nA=ue(Ae());var iA=ee({auth:J,name:"drive_remove_permission",displayName:"Remove Permission",description:"Revoke a role from a user on a Drive file or folder.",audience:"ai",aiMetadata:{description:"Revokes a specific role from a user (matched by email and role) on a file or folder, resolving the permission ID internally. Use to unshare or remove access; to lower a role instead of removing it use drive_update_permission. Safe to retry \u2014 if no matching permission exists it is a no-op.",idempotent:!0},outputSchema:TE,props:{file_id:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to remove the permission from. Resolve it via drive_search_files or drive_get_file.",required:!0}),user_email:C.ShortText({displayName:"User Email",description:"The email address of the user whose access to revoke.",required:!0}),role:C.StaticDropdown({displayName:"Role",description:"The role to remove from the user. The grant is matched by email and role.",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}})},async run(t){let[e,r]=[t.propsValue.file_id,t.propsValue.user_email],n=await ae(t.auth),o=(0,nA.drive)({version:"v3",auth:n}),s=await o.permissions.list({fileId:e,fields:"permissions(id, emailAddress, role)",supportsAllDrives:!0});if(s.data.permissions){for(let p of s.data.permissions)if(p.emailAddress===r&&p.role===t.propsValue.role)return await o.permissions.delete({fileId:e,permissionId:p.id?p.id:"",supportsAllDrives:!0}),{removed:!0,message:"Permission removed"}}return{removed:!1,message:"Permission not found"}}});var oA=ue(Ae());var aA=ee({auth:J,name:"drive_list_shared_drives",displayName:"List Shared Drives",description:"List the shared drives the account can access.",audience:"ai",aiMetadata:{description:"Lists the shared drives the account can access, with each drive's id and name. Use to discover a driveId before creating or listing content in a shared drive or before drive_get_shared_drive, drive_update_shared_drive, or drive_delete_shared_drive. Read-only.",idempotent:!0},outputSchema:oE,props:{query:C.ShortText({displayName:"Query",description:"Optional search query to filter shared drives, e.g. name contains 'marketing'. See https://developers.google.com/drive/api/guides/search-shareddrives",required:!1}),page_size:C.Number({displayName:"Page Size",description:"Maximum number of shared drives to return (1-100). Defaults to 100.",required:!1})},async run(t){let{query:e,page_size:r}=t.propsValue,n=await ae(t.auth),o=(0,oA.drive)({version:"v3",auth:n});try{let p=(await o.drives.list({q:e||void 0,pageSize:r||void 0})).data.drives??[];return{drives:p,count:p.length}}catch(s){throw s.code===403?new Error("Permission denied listing shared drives. Your account may not have shared-drive access."):s}}});var sA=ue(Ae());var uA=ee({auth:J,name:"drive_get_shared_drive",displayName:"Get Shared Drive",description:"Fetch metadata for one shared drive by ID.",audience:"ai",aiMetadata:{description:"Fetches metadata and capabilities for one shared drive by ID (resolve the ID via drive_list_shared_drives). Use to inspect a shared drive's settings before modifying it. Read-only.",idempotent:!0},outputSchema:aE,props:{drive_id:C.ShortText({displayName:"Shared Drive ID",description:"The ID of the shared drive. Resolve it via drive_list_shared_drives.",required:!0})},async run(t){let{drive_id:e}=t.propsValue,r=await ae(t.auth),n=(0,sA.drive)({version:"v3",auth:r});try{return(await n.drives.get({driveId:e})).data}catch(o){throw o.code===404?new Error(`Shared drive not found (ID: ${e}). Resolve a valid ID via drive_list_shared_drives.`):o.code===403?new Error(`Permission denied accessing shared drive ${e}. You may not be a member of this drive.`):o}}});var cA=require("crypto");var lA=ue(Ae());var dA=ee({auth:J,name:"drive_create_shared_drive",displayName:"Create Shared Drive",description:"Create a new shared drive (Team Drive).",audience:"ai",aiMetadata:{description:"Creates a new shared drive (Team Drive) with the given name; the action supplies the required idempotency requestId internally. Use to set up a shared workspace. Each call creates a distinct shared drive. Your Workspace admin must have shared-drive creation enabled (a 403 here is an admin-policy issue, not a scope issue).",idempotent:!1},outputSchema:hE,props:{name:C.ShortText({displayName:"Name",description:"The name of the new shared drive.",required:!0})},async run(t){let{name:e}=t.propsValue,r=await ae(t.auth),n=(0,lA.drive)({version:"v3",auth:r}),o=(0,cA.randomUUID)();try{return(await n.drives.create({requestId:o,requestBody:{name:e}})).data}catch(s){throw s.code===403?new Error("Permission denied creating a shared drive. Your Google Workspace admin may have disabled shared-drive creation for your account."):s}}});var pA=ue(Ae());var fA=ee({auth:J,name:"drive_update_shared_drive",displayName:"Update Shared Drive",description:"Rename or update a shared drive by ID.",audience:"ai",aiMetadata:{description:"Renames or updates a shared drive's settings by ID (resolve via drive_list_shared_drives). Use to rename a shared drive; to remove it entirely use drive_delete_shared_drive. Safe to retry \u2014 re-applying the same values is a no-op.",idempotent:!0},outputSchema:gE,props:{drive_id:C.ShortText({displayName:"Shared Drive ID",description:"The ID of the shared drive to update. Resolve it via drive_list_shared_drives.",required:!0}),name:C.ShortText({displayName:"Name",description:"The new name for the shared drive. Leave empty to keep the current name.",required:!1})},async run(t){let{drive_id:e,name:r}=t.propsValue,n=await ae(t.auth),o=(0,pA.drive)({version:"v3",auth:n}),s={};r&&(s.name=r);try{return(await o.drives.update({driveId:e,requestBody:s})).data}catch(p){throw p.code===404?new Error(`Shared drive not found (ID: ${e}). Resolve a valid ID via drive_list_shared_drives.`):p.code===403?new Error(`Permission denied updating shared drive ${e}. You must be an organizer of this drive.`):p}}});var mA=ue(Ae());var hA=ee({auth:J,name:"drive_delete_shared_drive",displayName:"Delete Shared Drive",description:"Permanently delete a shared drive by ID.",audience:"ai",aiMetadata:{description:"Permanently deletes a shared drive by ID (it must already be empty). Irreversible. Use only to remove a no-longer-needed shared drive. A repeat call fails because the drive no longer exists.",idempotent:!1},outputSchema:wE,props:{drive_id:C.ShortText({displayName:"Shared Drive ID",description:"The ID of the shared drive to delete. Resolve it via drive_list_shared_drives.",required:!0})},async run(t){let{drive_id:e}=t.propsValue,r=await ae(t.auth),n=(0,mA.drive)({version:"v3",auth:r});try{return await n.drives.delete({driveId:e}),{deleted:!0,driveId:e}}catch(o){throw o.code===404?new Error(`Shared drive not found (ID: ${e}). It may have already been deleted. Resolve a valid ID via drive_list_shared_drives.`):o.code===400?new Error(`Cannot delete shared drive ${e}: it must be empty before deletion. Remove or trash all of its files first.`):o.code===403?new Error(`Permission denied deleting shared drive ${e}. You must be an organizer of this drive.`):o}}});var gA=ue(Ae());var yA=ee({auth:J,name:"drive_create_comment",displayName:"Create Comment",description:"Add a new comment to a Drive file.",audience:"ai",aiMetadata:{description:"Adds a new top-level comment to a file. Use to leave feedback or a note on a file (resolve the file ID via drive_search_files); to respond to an existing comment use drive_create_reply instead. Each call creates a new comment, so retries duplicate.",idempotent:!1},outputSchema:cE,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file to comment on. Resolve it via drive_search_files or drive_get_file.",required:!0}),content:C.LongText({displayName:"Content",description:"The plain-text content of the comment.",required:!0})},async run(t){let{file_id:e,content:r}=t.propsValue,n=await ae(t.auth),o=(0,gA.drive)({version:"v3",auth:n});try{return(await o.comments.create({fileId:e,fields:"*",requestBody:{content:r}})).data}catch(s){throw s.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):s.code===403?new Error(`Permission denied commenting on file ${e}. You may lack comment access to this file.`):s}}});var vA=ue(Ae());var _A=ee({auth:J,name:"drive_list_comments",displayName:"List Comments",description:"List the comments on a Drive file.",audience:"ai",aiMetadata:{description:"Lists the comments on a file with each comment's id, author, content, and resolved state. Use to read discussion on a file or to resolve a commentId before replying (drive_create_reply) or listing its replies (drive_list_replies). Read-only.",idempotent:!0},outputSchema:sE,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file whose comments to list. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let{file_id:e}=t.propsValue,r=await ae(t.auth),n=(0,vA.drive)({version:"v3",auth:r});try{let s=(await n.comments.list({fileId:e,fields:"*",includeDeleted:!1})).data.comments??[];return{comments:s,count:s.length}}catch(o){throw o.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):o.code===403?new Error(`Permission denied listing comments for file ${e}. You may lack access to this file.`):o}}});var PA=ue(Ae());var wA=ee({auth:J,name:"drive_create_reply",displayName:"Reply to Comment",description:"Add a reply to an existing comment on a Drive file.",audience:"ai",aiMetadata:{description:"Adds a reply to an existing comment, optionally resolving or reopening the comment via the action field. Use to respond to a comment (resolve the commentId via drive_list_comments); to start a new top-level comment use drive_create_comment instead. Each call creates a new reply, so retries duplicate.",idempotent:!1},outputSchema:uE,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:C.ShortText({displayName:"Comment ID",description:"The ID of the comment to reply to. Resolve it via drive_list_comments.",required:!0}),content:C.LongText({displayName:"Content",description:"The plain-text content of the reply.",required:!0}),action:C.StaticDropdown({displayName:"Action",description:"Optionally change the parent comment's state: resolve (mark resolved) or reopen.",required:!1,options:{options:[{label:"Resolve",value:"resolve"},{label:"Reopen",value:"reopen"}]}})},async run(t){let{file_id:e,comment_id:r,content:n,action:o}=t.propsValue,s=await ae(t.auth),p=(0,PA.drive)({version:"v3",auth:s}),m={content:n};o&&(m.action=o);try{return(await p.replies.create({fileId:e,commentId:r,fields:"*",requestBody:m})).data}catch(h){throw h.code===404?new Error(`File or comment not found (file ID: ${e}, comment ID: ${r}). Resolve the comment ID via drive_list_comments.`):h.code===403?new Error(`Permission denied replying to comment ${r} on file ${e}. You may lack comment access to this file.`):h}}});var bA=ue(Ae());var TA=ee({auth:J,name:"drive_get_reply",displayName:"Get Reply",description:"Fetch a single reply on a Drive comment by ID.",audience:"ai",aiMetadata:{description:"Fetches a single reply by ID, including its author, content, and action. Use when you already have a replyId (resolve it via drive_list_replies) and need that one reply's details. Read-only.",idempotent:!0},outputSchema:lE,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:C.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:C.ShortText({displayName:"Reply ID",description:"The ID of the reply to fetch. Resolve it via drive_list_replies.",required:!0})},async run(t){let{file_id:e,comment_id:r,reply_id:n}=t.propsValue,o=await ae(t.auth),s=(0,bA.drive)({version:"v3",auth:o});try{return(await s.replies.get({fileId:e,commentId:r,replyId:n,fields:"*"})).data}catch(p){throw p.code===404?new Error(`File, comment, or reply not found (file ID: ${e}, comment ID: ${r}, reply ID: ${n}). Resolve the reply ID via drive_list_replies.`):p.code===403?new Error(`Permission denied fetching reply ${n} on file ${e}. You may lack access to this file.`):p}}});var SA=ue(Ae());var xA=ee({auth:J,name:"drive_list_replies",displayName:"List Replies",description:"List the replies under a Drive comment.",audience:"ai",aiMetadata:{description:"Lists the replies under a given comment with each reply's id, author, content, and action. Use to read a comment thread or to resolve a replyId before fetching (drive_get_reply), editing (drive_update_reply), or deleting (drive_delete_reply) a reply. Read-only.",idempotent:!0},outputSchema:dE,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:C.ShortText({displayName:"Comment ID",description:"The ID of the comment whose replies to list. Resolve it via drive_list_comments.",required:!0})},async run(t){let{file_id:e,comment_id:r}=t.propsValue,n=await ae(t.auth),o=(0,SA.drive)({version:"v3",auth:n});try{let p=(await o.replies.list({fileId:e,commentId:r,fields:"*"})).data.replies??[];return{replies:p,count:p.length}}catch(s){throw s.code===404?new Error(`File or comment not found (file ID: ${e}, comment ID: ${r}). Resolve the comment ID via drive_list_comments.`):s.code===403?new Error(`Permission denied listing replies for comment ${r} on file ${e}. You may lack access to this file.`):s}}});var EA=ue(Ae());var IA=ee({auth:J,name:"drive_update_reply",displayName:"Update Reply",description:"Edit the text of an existing reply on a Drive comment.",audience:"ai",aiMetadata:{description:"Edits the text of an existing reply by ID (resolve via drive_list_replies). Use to correct or revise a reply you control; to add a new reply instead use drive_create_reply. Safe to retry \u2014 re-applying the same content is a no-op.",idempotent:!0},outputSchema:pE,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:C.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:C.ShortText({displayName:"Reply ID",description:"The ID of the reply to update. Resolve it via drive_list_replies.",required:!0}),content:C.LongText({displayName:"Content",description:"The new plain-text content for the reply.",required:!0})},async run(t){let{file_id:e,comment_id:r,reply_id:n,content:o}=t.propsValue,s=await ae(t.auth),p=(0,EA.drive)({version:"v3",auth:s});try{return(await p.replies.update({fileId:e,commentId:r,replyId:n,fields:"*",requestBody:{content:o}})).data}catch(m){throw m.code===404?new Error(`File, comment, or reply not found (file ID: ${e}, comment ID: ${r}, reply ID: ${n}). Resolve the reply ID via drive_list_replies.`):m.code===403?new Error(`Permission denied updating reply ${n} on file ${e}. You can only edit your own replies.`):m}}});var AA=ue(Ae());var RA=ee({auth:J,name:"drive_delete_reply",displayName:"Delete Reply",description:"Permanently delete a reply on a Drive comment by ID.",audience:"ai",aiMetadata:{description:"Permanently deletes a reply by ID (resolve via drive_list_replies). Use to remove a reply you control; to edit it instead use drive_update_reply. A repeat call fails because the reply is already gone, so it is not safe to retry blindly.",idempotent:!1},outputSchema:PE,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:C.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:C.ShortText({displayName:"Reply ID",description:"The ID of the reply to delete. Resolve it via drive_list_replies.",required:!0})},async run(t){let{file_id:e,comment_id:r,reply_id:n}=t.propsValue,o=await ae(t.auth),s=(0,AA.drive)({version:"v3",auth:o});try{return await s.replies.delete({fileId:e,commentId:r,replyId:n}),{success:!0,reply_id:n}}catch(p){throw p.code===404?new Error(`File, comment, or reply not found (file ID: ${e}, comment ID: ${r}, reply ID: ${n}). It may already be deleted. Resolve the reply ID via drive_list_replies.`):p.code===403?new Error(`Permission denied deleting reply ${n} on file ${e}. You can only delete your own replies.`):p}}});var DA=ue(Ae());var $A=ee({auth:J,name:"drive_get_about",displayName:"Get Account & Storage Info",description:"Get the authenticated Drive account, storage quota, and supported formats.",audience:"ai",aiMetadata:{description:"Returns the authenticated user's Drive info: account identity, storage quota and usage, and supported import/export formats. Use to check available space before a large upload, confirm which account is connected, or look up valid export MIME types. Read-only.",idempotent:!0},outputSchema:iE,props:{},async run(t){let e=await ae(t.auth),r=(0,DA.drive)({version:"v3",auth:e});try{return(await r.about.get({fields:"user,storageQuota,maxImportSizes,exportFormats"})).data}catch(n){throw n.code===403?new Error("Permission denied fetching Drive account info. The connection may lack the required Drive scope."):n}}});var jL=Vy({minimumSupportedRelease:"0.86.4",logoUrl:"https://cdn.activepieces.com/pieces/google-drive.png",categories:["CONTENT_AND_FILES"],displayName:"Google Drive",description:"Cloud storage and file backup",authors:["BastienMe","ArmanGiau3","Vitalini","pfernandez98","kanarelo","Salem-Alaa","kishanprmr","MoShizzle","AbdulTheActivePiecer","khaledmashaly","abuaboud","geekyme"],triggers:[QE,tI],actions:[IE,RE,JE,jE,kE,LE,HE,CE,VE,xE,$E,nI,oI,sI,cI,dI,fI,gI,_I,wI,bI,xI,II,RI,$I,CI,kI,UI,LI,qI,VI,HI,ZI,JI,XI,eA,rA,iA,aA,uA,dA,fA,hA,yA,_A,wA,TA,xA,IA,RA,$A,rP({baseUrl:i(()=>"https://www.googleapis.com/drive/v3","baseUrl"),auth:J,authMapping:i(async t=>({Authorization:`Bearer ${await pt(t)}`}),"authMapping")})],auth:J});0&&(module.exports={createGoogleClient,getAccessToken,googleDrive,googleDriveAuth});
72
72
  /*! Bundled license information:
73
73
 
74
74
  mime-types/index.js: