@activepieces/piece-google-calendar 0.9.4 → 0.9.5
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/package.json +1 -1
- package/src/index.js +29 -29
package/src/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";var RA=Object.create;var Di=Object.defineProperty;var CA=Object.getOwnPropertyDescriptor;var OA=Object.getOwnPropertyNames;var $A=Object.getPrototypeOf,kA=Object.prototype.hasOwnProperty;var o=(t,e)=>Di(t,"name",{value:e,configurable:!0});var St=(t,e)=>()=>(t&&(e=t(t=0)),e);var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ws=(t,e)=>{for(var r in e)Di(t,r,{get:e[r],enumerable:!0})},Lh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of OA(e))!kA.call(t,i)&&i!==r&&Di(t,i,{get:()=>e[i],enumerable:!(n=CA(e,i))||n.enumerable});return t};var rt=(t,e,r)=>(r=t!=null?RA($A(t)):{},Lh(e||!t||!t.__esModule?Di(r,"default",{value:t,enumerable:!0}):r,t)),DA=t=>Lh(Di({},"__esModule",{value:!0}),t);var ny=D((ry,Vs)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function p(l,g){if(l.indexOf("::")!==l.lastIndexOf("::"))return null;let v=0,b=-1,E=(l.match(d.zoneIndex)||[])[0],k,L;for(E&&(E=E.substring(1),l=l.replace(/%.+$/,""));(b=l.indexOf(":",b+1))>=0;)v++;if(l.substr(0,2)==="::"&&v--,l.substr(-2,2)==="::"&&v--,v>g)return null;for(L=g-v,k=":";L--;)k+="0:";return l=l.replace("::",k),l[0]===":"&&(l=l.slice(1)),l[l.length-1]===":"&&(l=l.slice(0,-1)),g=function(){let J=l.split(":"),W=[];for(let G=0;G<J.length;G++)W.push(parseInt(J[G],16));return W}(),{parts:g,zoneId:E}}o(p,"expandIPv6");function h(l,g,v,b){if(l.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let E=0,k;for(;b>0;){if(k=v-b,k<0&&(k=0),l[E]>>k!==g[E]>>k)return!1;b-=v,E+=1}return!0}o(h,"matchCIDR");function _(l){if(i.test(l))return parseInt(l,16);if(l[0]==="0"&&!isNaN(parseInt(l[1],10))){if(n.test(l))return parseInt(l,8);throw new Error(`ipaddr: cannot parse ${l} as octal`)}return parseInt(l,10)}o(_,"parseIntAuto");function m(l,g){for(;l.length<g;)l=`0${l}`;return l}o(m,"padPart");let f={};f.IPv4=function(){function l(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let v,b;for(v=0;v<g.length;v++)if(b=g[v],!(0<=b&&b<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return o(l,"IPv4"),l.prototype.SpecialRanges={unspecified:[[new l([0,0,0,0]),8]],broadcast:[[new l([255,255,255,255]),32]],multicast:[[new l([224,0,0,0]),4]],linkLocal:[[new l([169,254,0,0]),16]],loopback:[[new l([127,0,0,0]),8]],carrierGradeNat:[[new l([100,64,0,0]),10]],private:[[new l([10,0,0,0]),8],[new l([172,16,0,0]),12],[new l([192,168,0,0]),16]],reserved:[[new l([192,0,0,0]),24],[new l([192,0,2,0]),24],[new l([192,88,99,0]),24],[new l([198,18,0,0]),15],[new l([198,51,100,0]),24],[new l([203,0,113,0]),24],[new l([240,0,0,0]),4]],as112:[[new l([192,175,48,0]),24],[new l([192,31,196,0]),24]],amt:[[new l([192,52,193,0]),24]]},l.prototype.kind=function(){return"ipv4"},l.prototype.match=function(g,v){let b;if(v===void 0&&(b=g,g=b[0],v=b[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,g.octets,8,v)},l.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!1,b={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},E,k,L;for(E=3;E>=0;E-=1)if(k=this.octets[E],k in b){if(L=b[k],v&&L!==0)return null;L!==8&&(v=!0),g+=L}else return null;return 32-g},l.prototype.range=function(){return f.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){return this.octets.slice(0)},l.prototype.toIPv4MappedAddress=function(){return f.IPv6.parse(`::ffff:${this.toString()}`)},l.prototype.toNormalizedString=function(){return this.toString()},l.prototype.toString=function(){return this.octets.join(".")},l}(),f.IPv4.broadcastAddressFromCIDR=function(l){try{let g=this.parseCIDR(l),v=g[0].toByteArray(),b=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),E=[],k=0;for(;k<4;)E.push(parseInt(v[k],10)|parseInt(b[k],10)^255),k++;return new this(E)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},f.IPv4.isIPv4=function(l){return this.parser(l)!==null},f.IPv4.isValid=function(l){try{return new this(this.parser(l)),!0}catch{return!1}},f.IPv4.isValidCIDR=function(l){try{return this.parseCIDR(l),!0}catch{return!1}},f.IPv4.isValidFourPartDecimal=function(l){return!!(f.IPv4.isValid(l)&&l.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},f.IPv4.isValidCIDRFourPartDecimal=function(l){let g=l.match(/^(.+)\/(\d+)$/);return!f.IPv4.isValidCIDR(l)||!g?!1:f.IPv4.isValidFourPartDecimal(g[1])},f.IPv4.networkAddressFromCIDR=function(l){let g,v,b,E,k;try{for(g=this.parseCIDR(l),b=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),E=[],v=0;v<4;)E.push(parseInt(b[v],10)&parseInt(k[v],10)),v++;return new this(E)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},f.IPv4.parse=function(l){let g=this.parser(l);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},f.IPv4.parseCIDR=function(l){let g;if(g=l.match(/^(.+)\/(\d+)$/)){let v=parseInt(g[2]);if(v>=0&&v<=32){let b=[this.parse(g[1]),v];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")},f.IPv4.parser=function(l){let g,v,b;if(g=l.match(r.fourOctet))return function(){let E=g.slice(1,6),k=[];for(let L=0;L<E.length;L++)v=E[L],k.push(_(v));return k}();if(g=l.match(r.longValue)){if(b=_(g[1]),b>4294967295||b<0)throw new Error("ipaddr: address outside defined range");return function(){let E=[],k;for(k=0;k<=24;k+=8)E.push(b>>k&255);return E}().reverse()}else return(g=l.match(r.twoOctet))?function(){let E=g.slice(1,4),k=[];if(b=_(E[1]),b>16777215||b<0)throw new Error("ipaddr: address outside defined range");return k.push(_(E[0])),k.push(b>>16&255),k.push(b>>8&255),k.push(b&255),k}():(g=l.match(r.threeOctet))?function(){let E=g.slice(1,5),k=[];if(b=_(E[2]),b>65535||b<0)throw new Error("ipaddr: address outside defined range");return k.push(_(E[0])),k.push(_(E[1])),k.push(b>>8&255),k.push(b&255),k}():null},f.IPv4.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>32)throw new Error("ipaddr: invalid IPv4 prefix length");let g=[0,0,0,0],v=0,b=Math.floor(l/8);for(;v<b;)g[v]=255,v++;return b<4&&(g[b]=Math.pow(2,l%8)-1<<8-l%8),new this(g)},f.IPv6=function(){function l(g,v){let b,E;if(g.length===16)for(this.parts=[],b=0;b<=14;b+=2)this.parts.push(g[b]<<8|g[b+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(b=0;b<this.parts.length;b++)if(E=this.parts[b],!(0<=E&&E<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");v&&(this.zoneId=v)}return o(l,"IPv6"),l.prototype.SpecialRanges={unspecified:[new l([0,0,0,0,0,0,0,0]),128],linkLocal:[new l([65152,0,0,0,0,0,0,0]),10],multicast:[new l([65280,0,0,0,0,0,0,0]),8],loopback:[new l([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new l([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new l([0,0,0,0,0,65535,0,0]),96],discard:[new l([256,0,0,0,0,0,0,0]),64],rfc6145:[new l([0,0,0,0,65535,0,0,0]),96],rfc6052:[new l([100,65435,0,0,0,0,0,0]),96],"6to4":[new l([8194,0,0,0,0,0,0,0]),16],teredo:[new l([8193,0,0,0,0,0,0,0]),32],benchmarking:[new l([8193,2,0,0,0,0,0,0]),48],amt:[new l([8193,3,0,0,0,0,0,0]),32],as112v6:[[new l([8193,4,274,0,0,0,0,0]),48],[new l([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new l([8193,16,0,0,0,0,0,0]),28],orchid2:[new l([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new l([8193,48,0,0,0,0,0,0]),28],reserved:[[new l([8193,0,0,0,0,0,0,0]),23],[new l([8193,3512,0,0,0,0,0,0]),32]]},l.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},l.prototype.kind=function(){return"ipv6"},l.prototype.match=function(g,v){let b;if(v===void 0&&(b=g,g=b[0],v=b[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,g.parts,16,v)},l.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!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},E,k;for(let L=7;L>=0;L-=1)if(E=this.parts[L],E in b){if(k=b[E],v&&k!==0)return null;k!==16&&(v=!0),g+=k}else return null;return 128-g},l.prototype.range=function(){return f.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){let g,v=[],b=this.parts;for(let E=0;E<b.length;E++)g=b[E],v.push(g>>8),v.push(g&255);return v},l.prototype.toFixedLengthString=function(){let g=function(){let b=[];for(let E=0;E<this.parts.length;E++)b.push(m(this.parts[E].toString(16),4));return b}.call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},l.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let g=this.parts.slice(-2),v=g[0],b=g[1];return new f.IPv4([v>>8,v&255,b>>8,b&255])},l.prototype.toNormalizedString=function(){let g=function(){let b=[];for(let E=0;E<this.parts.length;E++)b.push(this.parts[E].toString(16));return b}.call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},l.prototype.toRFC5952String=function(){let g=/((^|:)(0(:|$)){2,})/g,v=this.toNormalizedString(),b=0,E=-1,k;for(;k=g.exec(v);)k[0].length>E&&(b=k.index,E=k[0].length);return E<0?v:`${v.substring(0,b)}::${v.substring(b+E)}`},l.prototype.toString=function(){return this.toRFC5952String()},l}(),f.IPv6.broadcastAddressFromCIDR=function(l){try{let g=this.parseCIDR(l),v=g[0].toByteArray(),b=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),E=[],k=0;for(;k<16;)E.push(parseInt(v[k],10)|parseInt(b[k],10)^255),k++;return new this(E)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},f.IPv6.isIPv6=function(l){return this.parser(l)!==null},f.IPv6.isValid=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{let g=this.parser(l);return new this(g.parts,g.zoneId),!0}catch{return!1}},f.IPv6.isValidCIDR=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{return this.parseCIDR(l),!0}catch{return!1}},f.IPv6.networkAddressFromCIDR=function(l){let g,v,b,E,k;try{for(g=this.parseCIDR(l),b=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),E=[],v=0;v<16;)E.push(parseInt(b[v],10)&parseInt(k[v],10)),v++;return new this(E)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},f.IPv6.parse=function(l){let g=this.parser(l);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},f.IPv6.parseCIDR=function(l){let g,v,b;if((v=l.match(/^(.+)\/(\d+)$/))&&(g=parseInt(v[2]),g>=0&&g<=128))return b=[this.parse(v[1]),g],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")},f.IPv6.parser=function(l){let g,v,b,E,k,L;if(b=l.match(d.deprecatedTransitional))return this.parser(`::ffff:${b[1]}`);if(d.native.test(l))return p(l,8);if((b=l.match(d.transitional))&&(L=b[6]||"",g=b[1],b[1].endsWith("::")||(g=g.slice(0,-1)),g=p(g+L,6),g.parts)){for(k=[parseInt(b[2]),parseInt(b[3]),parseInt(b[4]),parseInt(b[5])],v=0;v<k.length;v++)if(E=k[v],!(0<=E&&E<=255))return null;return g.parts.push(k[0]<<8|k[1]),g.parts.push(k[2]<<8|k[3]),{parts:g.parts,zoneId:g.zoneId}}return null},f.IPv6.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>128)throw new Error("ipaddr: invalid IPv6 prefix length");let g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=0,b=Math.floor(l/8);for(;v<b;)g[v]=255,v++;return b<16&&(g[b]=Math.pow(2,l%8)-1<<8-l%8),new this(g)},f.fromByteArray=function(l){let g=l.length;if(g===4)return new f.IPv4(l);if(g===16)return new f.IPv6(l);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},f.isValid=function(l){return f.IPv6.isValid(l)||f.IPv4.isValid(l)},f.isValidCIDR=function(l){return f.IPv6.isValidCIDR(l)||f.IPv4.isValidCIDR(l)},f.parse=function(l){if(f.IPv6.isValid(l))return f.IPv6.parse(l);if(f.IPv4.isValid(l))return f.IPv4.parse(l);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},f.parseCIDR=function(l){try{return f.IPv6.parseCIDR(l)}catch{try{return f.IPv4.parseCIDR(l)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},f.process=function(l){let g=this.parse(l);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},f.subnetMatch=function(l,g,v){let b,E,k,L;v==null&&(v="unicast");for(E in g)if(Object.prototype.hasOwnProperty.call(g,E)){for(k=g[E],k[0]&&!(k[0]instanceof Array)&&(k=[k]),b=0;b<k.length;b++)if(L=k[b],l.kind()===L[0].kind()&&l.match.apply(l,L))return E}return v},typeof Vs<"u"&&Vs.exports?Vs.exports=f:t.ipaddr=f})(ry)});var Xy=D((EK,Yy)=>{var Jy=require("stream").Stream,c0=require("util");Yy.exports=Tr;function Tr(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(Tr,"DelayedStream");c0.inherits(Tr,Jy);Tr.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(Tr.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});Tr.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Tr.prototype.resume=function(){this._released||this.release(),this.source.resume()};Tr.prototype.pause=function(){this.source.pause()};Tr.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};Tr.prototype.pipe=function(){var t=Jy.prototype.pipe.apply(this,arguments);return this.resume(),t};Tr.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)};Tr.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 rv=D((PK,tv)=>{var l0=require("util"),ev=require("stream").Stream,Qy=Xy();tv.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}o(dt,"CombinedStream");l0.inherits(dt,ev);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 Qy)){var r=Qy.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 ev.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 ov=D((wK,nv)=>{"use strict";nv.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 sv=D(Mt=>{"use strict";var Ys=ov(),d0=require("path").extname,iv=/^\s*([^;\s]*)(?:;|\s|$)/,p0=/^text\//i;Mt.charset=av;Mt.charsets={lookup:av};Mt.contentType=f0;Mt.extension=m0;Mt.extensions=Object.create(null);Mt.lookup=h0;Mt.types=Object.create(null);g0(Mt.extensions,Mt.types);function av(t){if(!t||typeof t!="string")return!1;var e=iv.exec(t),r=e&&Ys[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&p0.test(e[1])?"UTF-8":!1}o(av,"charset");function f0(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Mt.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Mt.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(f0,"contentType");function m0(t){if(!t||typeof t!="string")return!1;var e=iv.exec(t),r=e&&Mt.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(m0,"extension");function h0(t){if(!t||typeof t!="string")return!1;var e=d0("x."+t).toLowerCase().substr(1);return e&&Mt.types[e]||!1}o(h0,"lookup");function g0(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(Ys).forEach(o(function(i){var s=Ys[i],c=s.extensions;if(!(!c||!c.length)){t[i]=c;for(var d=0;d<c.length;d++){var p=c[d];if(e[p]){var h=r.indexOf(Ys[e[p]].source),_=r.indexOf(s.source);if(e[p]!=="application/octet-stream"&&(h>_||h===_&&e[p].substr(0,12)==="application/"))continue}e[p]=i}}},"forEachMimeType"))}o(g0,"populateMaps")});var cv=D((IK,uv)=>{uv.exports=y0;function y0(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(y0,"defer")});var sd=D((CK,dv)=>{var lv=cv();dv.exports=v0;function v0(t){var e=!1;return lv(function(){e=!0}),o(function(n,i){e?t(n,i):lv(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(v0,"async")});var ud=D(($K,pv)=>{pv.exports=_0;function _0(t){Object.keys(t.jobs).forEach(b0.bind(t)),t.jobs={}}o(_0,"abort");function b0(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(b0,"clean")});var cd=D((DK,mv)=>{var fv=sd(),E0=ud();mv.exports=S0;function S0(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=P0(e,i,t[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?E0(r):r.results[i]=c,n(s,r.results))})}o(S0,"iterate");function P0(t,e,r,n){var i;return t.length==2?i=t(r,fv(n)):i=t(r,e,fv(n)),i}o(P0,"runJob")});var ld=D((zK,hv)=>{hv.exports=T0;function T0(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};return e&&n.keyedList.sort(r?e:function(i,s){return e(t[i],t[s])}),n}o(T0,"state")});var dd=D((MK,gv)=>{var w0=ud(),x0=sd();gv.exports=A0;function A0(t){Object.keys(this.jobs).length&&(this.index=this.size,w0(this),x0(t)(null,this.results))}o(A0,"terminator")});var vv=D((LK,yv)=>{var I0=cd(),R0=ld(),C0=dd();yv.exports=O0;function O0(t,e,r){for(var n=R0(t);n.index<(n.keyedList||t).length;)I0(t,e,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return C0.bind(n,r)}o(O0,"parallel")});var pd=D((qK,Xs)=>{var _v=cd(),$0=ld(),k0=dd();Xs.exports=D0;Xs.exports.ascending=bv;Xs.exports.descending=N0;function D0(t,e,r,n){var i=$0(t,r);return _v(t,e,i,o(function s(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||t).length){_v(t,e,i,s);return}n(null,i.results)},"iteratorHandler")),k0.bind(i,n)}o(D0,"serialOrdered");function bv(t,e){return t<e?-1:t>e?1:0}o(bv,"ascending");function N0(t,e){return-1*bv(t,e)}o(N0,"descending")});var Sv=D((VK,Ev)=>{var z0=pd();Ev.exports=U0;function U0(t,e,r){return z0(t,e,null,r)}o(U0,"serial")});var Tv=D((HK,Pv)=>{Pv.exports={parallel:vv(),serial:Sv(),serialOrdered:pd()}});var fd=D((WK,wv)=>{"use strict";wv.exports=Object});var Av=D((ZK,xv)=>{"use strict";xv.exports=Error});var Rv=D((KK,Iv)=>{"use strict";Iv.exports=EvalError});var Ov=D((JK,Cv)=>{"use strict";Cv.exports=RangeError});var kv=D((YK,$v)=>{"use strict";$v.exports=ReferenceError});var Nv=D((XK,Dv)=>{"use strict";Dv.exports=SyntaxError});var Nn=D((QK,zv)=>{"use strict";zv.exports=TypeError});var Mv=D((eJ,Uv)=>{"use strict";Uv.exports=URIError});var Lv=D((tJ,jv)=>{"use strict";jv.exports=Math.abs});var qv=D((rJ,Fv)=>{"use strict";Fv.exports=Math.floor});var Vv=D((nJ,Bv)=>{"use strict";Bv.exports=Math.max});var Hv=D((oJ,Gv)=>{"use strict";Gv.exports=Math.min});var Zv=D((iJ,Wv)=>{"use strict";Wv.exports=Math.pow});var Jv=D((aJ,Kv)=>{"use strict";Kv.exports=Math.round});var Xv=D((sJ,Yv)=>{"use strict";Yv.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var e_=D((cJ,Qv)=>{"use strict";var M0=Xv();Qv.exports=o(function(e){return M0(e)||e===0?e:e<0?-1:1},"sign")});var r_=D((dJ,t_)=>{"use strict";t_.exports=Object.getOwnPropertyDescriptor});var md=D((pJ,n_)=>{"use strict";var Qs=r_();if(Qs)try{Qs([],"length")}catch{Qs=null}n_.exports=Qs});var i_=D((fJ,o_)=>{"use strict";var eu=Object.defineProperty||!1;if(eu)try{eu({},"a",{value:1})}catch{eu=!1}o_.exports=eu});var hd=D((mJ,a_)=>{"use strict";a_.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var c=Object.getOwnPropertySymbols(e);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(e,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var c_=D((gJ,u_)=>{"use strict";var s_=typeof Symbol<"u"&&Symbol,j0=hd();u_.exports=o(function(){return typeof s_!="function"||typeof Symbol!="function"||typeof s_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:j0()},"hasNativeSymbols")});var gd=D((vJ,l_)=>{"use strict";l_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var yd=D((_J,d_)=>{"use strict";var L0=fd();d_.exports=L0.getPrototypeOf||null});var m_=D((bJ,f_)=>{"use strict";var F0="Function.prototype.bind called on incompatible ",q0=Object.prototype.toString,B0=Math.max,V0="[object Function]",p_=o(function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var s=0;s<r.length;s+=1)n[s+e.length]=r[s];return n},"concatty"),G0=o(function(e,r){for(var n=[],i=r||0,s=0;i<e.length;i+=1,s+=1)n[s]=e[i];return n},"slicy"),H0=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");f_.exports=o(function(e){var r=this;if(typeof r!="function"||q0.apply(r)!==V0)throw new TypeError(F0+r);for(var n=G0(arguments,1),i,s=o(function(){if(this instanceof i){var _=r.apply(this,p_(n,arguments));return Object(_)===_?_:this}return r.apply(e,p_(n,arguments))},"binder"),c=B0(0,r.length-n.length),d=[],p=0;p<c;p++)d[p]="$"+p;if(i=Function("binder","return function ("+H0(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var ta=D((SJ,h_)=>{"use strict";var W0=m_();h_.exports=Function.prototype.bind||W0});var tu=D((PJ,g_)=>{"use strict";g_.exports=Function.prototype.call});var vd=D((TJ,y_)=>{"use strict";y_.exports=Function.prototype.apply});var __=D((wJ,v_)=>{"use strict";v_.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var E_=D((xJ,b_)=>{"use strict";var Z0=ta(),K0=vd(),J0=tu(),Y0=__();b_.exports=Y0||Z0.call(J0,K0)});var _d=D((AJ,S_)=>{"use strict";var X0=ta(),Q0=Nn(),eC=tu(),tC=E_();S_.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new Q0("a function is required");return tC(X0,eC,e)},"callBindBasic")});var I_=D((RJ,A_)=>{"use strict";var rC=_d(),P_=md(),w_;try{w_=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var bd=!!w_&&P_&&P_(Object.prototype,"__proto__"),x_=Object,T_=x_.getPrototypeOf;A_.exports=bd&&typeof bd.get=="function"?rC([bd.get]):typeof T_=="function"?o(function(e){return T_(e==null?e:x_(e))},"getDunder"):!1});var k_=D((OJ,$_)=>{"use strict";var R_=gd(),C_=yd(),O_=I_();$_.exports=R_?o(function(e){return R_(e)},"getProto"):C_?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return C_(e)},"getProto"):O_?o(function(e){return O_(e)},"getProto"):null});var ru=D((kJ,D_)=>{"use strict";var nC=Function.prototype.call,oC=Object.prototype.hasOwnProperty,iC=ta();D_.exports=iC.call(nC,oC)});var ia=D((DJ,L_)=>{"use strict";var Ne,aC=fd(),sC=Av(),uC=Rv(),cC=Ov(),lC=kv(),Ko=Nv(),Zo=Nn(),dC=Mv(),pC=Lv(),fC=qv(),mC=Vv(),hC=Hv(),gC=Zv(),yC=Jv(),vC=e_(),M_=Function,Ed=o(function(t){try{return M_('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),ra=md(),_C=i_(),Sd=o(function(){throw new Zo},"throwTypeError"),bC=ra?function(){try{return arguments.callee,Sd}catch{try{return ra(arguments,"callee").get}catch{return Sd}}}():Sd,Ho=c_()(),Tt=k_(),EC=yd(),SC=gd(),j_=vd(),na=tu(),Wo={},PC=typeof Uint8Array>"u"||!Tt?Ne:Tt(Uint8Array),ao={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Ne:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ne:ArrayBuffer,"%ArrayIteratorPrototype%":Ho&&Tt?Tt([][Symbol.iterator]()):Ne,"%AsyncFromSyncIteratorPrototype%":Ne,"%AsyncFunction%":Wo,"%AsyncGenerator%":Wo,"%AsyncGeneratorFunction%":Wo,"%AsyncIteratorPrototype%":Wo,"%Atomics%":typeof Atomics>"u"?Ne:Atomics,"%BigInt%":typeof BigInt>"u"?Ne:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ne:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ne:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ne:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":sC,"%eval%":eval,"%EvalError%":uC,"%Float16Array%":typeof Float16Array>"u"?Ne:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Ne:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ne:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ne:FinalizationRegistry,"%Function%":M_,"%GeneratorFunction%":Wo,"%Int8Array%":typeof Int8Array>"u"?Ne:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ne:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ne:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ho&&Tt?Tt(Tt([][Symbol.iterator]())):Ne,"%JSON%":typeof JSON=="object"?JSON:Ne,"%Map%":typeof Map>"u"?Ne:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ho||!Tt?Ne:Tt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":aC,"%Object.getOwnPropertyDescriptor%":ra,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ne:Promise,"%Proxy%":typeof Proxy>"u"?Ne:Proxy,"%RangeError%":cC,"%ReferenceError%":lC,"%Reflect%":typeof Reflect>"u"?Ne:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ne:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ho||!Tt?Ne:Tt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ne:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ho&&Tt?Tt(""[Symbol.iterator]()):Ne,"%Symbol%":Ho?Symbol:Ne,"%SyntaxError%":Ko,"%ThrowTypeError%":bC,"%TypedArray%":PC,"%TypeError%":Zo,"%Uint8Array%":typeof Uint8Array>"u"?Ne:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ne:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ne:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ne:Uint32Array,"%URIError%":dC,"%WeakMap%":typeof WeakMap>"u"?Ne:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ne:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ne:WeakSet,"%Function.prototype.call%":na,"%Function.prototype.apply%":j_,"%Object.defineProperty%":_C,"%Object.getPrototypeOf%":EC,"%Math.abs%":pC,"%Math.floor%":fC,"%Math.max%":mC,"%Math.min%":hC,"%Math.pow%":gC,"%Math.round%":yC,"%Math.sign%":vC,"%Reflect.getPrototypeOf%":SC};if(Tt)try{null.error}catch(t){N_=Tt(Tt(t)),ao["%Error.prototype%"]=N_}var N_,TC=o(function t(e){var r;if(e==="%AsyncFunction%")r=Ed("async function () {}");else if(e==="%GeneratorFunction%")r=Ed("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Ed("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Tt&&(r=Tt(i.prototype))}return ao[e]=r,r},"doEval"),z_={__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=ta(),nu=ru(),wC=oa.call(na,Array.prototype.concat),xC=oa.call(j_,Array.prototype.splice),U_=oa.call(na,String.prototype.replace),ou=oa.call(na,String.prototype.slice),AC=oa.call(na,RegExp.prototype.exec),IC=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,RC=/\\(\\)?/g,CC=o(function(e){var r=ou(e,0,1),n=ou(e,-1);if(r==="%"&&n!=="%")throw new Ko("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ko("invalid intrinsic syntax, expected opening `%`");var i=[];return U_(e,IC,function(s,c,d,p){i[i.length]=d?U_(p,RC,"$1"):c||s}),i},"stringToPath"),OC=o(function(e,r){var n=e,i;if(nu(z_,n)&&(i=z_[n],n="%"+i[0]+"%"),nu(ao,n)){var s=ao[n];if(s===Wo&&(s=TC(n)),typeof s>"u"&&!r)throw new Zo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Ko("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");L_.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new Zo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Zo('"allowMissing" argument must be a boolean');if(AC(/^%?[^%]*%?$/,e)===null)throw new Ko("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=CC(e),i=n.length>0?n[0]:"",s=OC("%"+i+"%",r),c=s.name,d=s.value,p=!1,h=s.alias;h&&(i=h[0],xC(n,wC([0,1],h)));for(var _=1,m=!0;_<n.length;_+=1){var f=n[_],l=ou(f,0,1),g=ou(f,-1);if((l==='"'||l==="'"||l==="`"||g==='"'||g==="'"||g==="`")&&l!==g)throw new Ko("property names with quotes must have matching quotes");if((f==="constructor"||!m)&&(p=!0),i+="."+f,c="%"+i+"%",nu(ao,c))d=ao[c];else if(d!=null){if(!(f in d)){if(!r)throw new Zo("base intrinsic for "+e+" exists, but the property is not available.");return}if(ra&&_+1>=n.length){var v=ra(d,f);m=!!v,m&&"get"in v&&!("originalValue"in v.get)?d=v.get:d=d[f]}else m=nu(d,f),d=d[f];m&&!p&&(ao[c]=d)}}return d},"GetIntrinsic")});var q_=D((zJ,F_)=>{"use strict";var $C=hd();F_.exports=o(function(){return $C()&&!!Symbol.toStringTag},"hasToStringTagShams")});var G_=D((MJ,V_)=>{"use strict";var kC=ia(),B_=kC("%Object.defineProperty%",!0),DC=q_()(),NC=ru(),zC=Nn(),iu=DC?Symbol.toStringTag:null;V_.exports=o(function(e,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new zC("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");iu&&(n||!NC(e,iu))&&(B_?B_(e,iu,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[iu]=r)},"setToStringTag")});var W_=D((LJ,H_)=>{"use strict";H_.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var K_=D((FJ,Z_)=>{"use strict";var xd=rv(),UC=require("util"),Pd=require("path"),MC=require("http"),jC=require("https"),LC=require("url").parse,FC=require("fs"),qC=require("stream").Stream,BC=require("crypto"),Td=sv(),VC=Tv(),GC=G_(),zn=ru(),wd=W_();function je(t){if(!(this instanceof je))return new je(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],xd.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(je,"FormData");UC.inherits(je,xd);je.LINE_BREAK=`\r
|
|
2
|
-
`;je.DEFAULT_CONTENT_TYPE="application/octet-stream";je.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=xd.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r),s=this._multiPartFooter();n(i),n(e),n(s),this._trackLength(i,e,r)};je.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)+je.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&zn(e,"httpVersion"))&&!(e instanceof qC))&&(r.knownLength||this._valuesToMeasure.push(e))};je.prototype._lengthRetriever=function(t,e){zn(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):FC.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):zn(t,"httpVersion")?e(null,Number(t.headers["content-length"])):zn(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};je.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),i=this._getContentType(e,r),s="",c={"Content-Disposition":["form-data",'name="'+t+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&wd(c,r.header);var d;for(var p in c)if(zn(c,p)){if(d=c[p],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=p+": "+d.join("; ")+je.LINE_BREAK)}return"--"+this.getBoundary()+je.LINE_BREAK+s+je.LINE_BREAK};je.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&&zn(t,"httpVersion")&&(r=Pd.basename(t.client._httpMessage.path||"")),r)return'filename="'+r+'"'};je.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=Td.lookup(t.name)),!r&&t&&t.path&&(r=Td.lookup(t.path)),!r&&t&&t.readable&&zn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=Td.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=je.DEFAULT_CONTENT_TYPE),r};je.prototype._multiPartFooter=function(){return function(t){var e=je.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};je.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+je.LINE_BREAK};je.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)zn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};je.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};je.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};je.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(je.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};je.prototype._generateBoundary=function(){this._boundary="--------------------------"+BC.randomBytes(12).toString("hex")};je.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};je.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};je.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}VC.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};je.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=LC(t),n=wd({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=wd(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=jC.request(n):r=MC.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),e){var d,p=o(function(h,_){return r.removeListener("error",p),r.removeListener("response",d),e.call(this,h,_)},"callback");d=p.bind(this,null),r.on("error",p),r.on("response",d)}}.bind(this)),r};je.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};je.prototype.toString=function(){return"[object FormData]"};GC(je,"FormData");Z_.exports=je});var sa=D((w8,lb)=>{"use strict";var su=Object.prototype.hasOwnProperty,cb=Object.prototype.toString,nb=Object.defineProperty,ob=Object.getOwnPropertyDescriptor,ib=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):cb.call(e)==="[object Array]"},"isArray"),ab=o(function(e){if(!e||cb.call(e)!=="[object Object]")return!1;var r=su.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&su.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||su.call(e,i)},"isPlainObject"),sb=o(function(e,r){nb&&r.name==="__proto__"?nb(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),ub=o(function(e,r){if(r==="__proto__")if(su.call(e,r)){if(ob)return ob(e,r).value}else return;return e[r]},"getProperty");lb.exports=o(function t(){var e,r,n,i,s,c,d=arguments[0],p=1,h=arguments.length,_=!1;for(typeof d=="boolean"&&(_=d,d=arguments[1]||{},p=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});p<h;++p)if(e=arguments[p],e!=null)for(r in e)n=ub(d,r),i=ub(e,r),d!==i&&(_&&i&&(ab(i)||(s=ib(i)))?(s?(s=!1,c=n&&ib(n)?n:[]):c=n&&ab(n)?n:{},sb(d,{name:r,newValue:t(_,c,i)})):typeof i<"u"&&sb(d,{name:r,newValue:i}));return d},"extend")});var db=D((A8,eO)=>{eO.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 fb=D((I8,pb)=>{"use strict";var tO=db();pb.exports={pkg:tO}});var Od=D(lr=>{"use strict";var hb=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=gb;var mb=hb(sa()),rO=hb(fb()),Rd=rO.default.pkg;lr.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Rd.name}-gaxios-error`);var Cd=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[lr.GAXIOS_ERROR_SYMBOL]=Rd.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&lr.GAXIOS_ERROR_SYMBOL in e&&e[lr.GAXIOS_ERROR_SYMBOL]===Rd.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,mb.default)(!0,{},r),this.response&&(this.response.config=(0,mb.default)(!0,{},this.response.config)),this.response){try{this.response.data=nO(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}i instanceof DOMException?this.code=i.name:i&&typeof i=="object"&&"code"in i&&(typeof i.code=="string"||typeof i.code=="number")&&(this.code=i.code)}static extractAPIErrorFromResponse(e,r="The request failed"){let n=r;if(typeof e.data=="string"&&(n=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){n="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:n;let i="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,s="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let c=[];for(let d of e.data.error.errors)typeof d=="object"&&"message"in d&&typeof d.message=="string"&&c.push(d.message);return Object.assign({message:c.join(`
|
|
3
|
-
`)||n,code:s,status:i},e.data.error)}return Object.assign({message:n,code:s,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};lr.GaxiosError=Cd;function nO(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(nO,"translateData");function gb(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((c,d)=>{(/^authentication$/i.test(d)||/^authorization$/i.test(d)||/secret/i.test(d))&&s.set(d,e)})}o(r,"redactHeaders");function n(s,c){if(typeof s=="object"&&s!==null&&typeof s[c]=="string"){let d=s[c];(/grant_type=/i.test(d)||/assertion=/i.test(d)||/secret/i.test(d))&&(s[c]=e)}}o(n,"redactString");function i(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((c,d)=>{(["grant_type","assertion"].includes(d)||/secret/.test(d))&&s.set(d,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return o(i,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),i(t.config.data),n(t.config,"body"),i(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(gb({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(gb,"defaultErrorRedactor")});var vb=D($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.getRetryConfig=oO;async function oO(t){let e=yb(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||iO)(t))return{shouldRetry:!1,config:t.config};let i=aO(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,i):new Promise(c=>{setTimeout(c,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}o(oO,"getRetryConfig");function iO(t){let e=yb(t);if(t.config.signal?.aborted&&t.code!=="TimeoutError"||t.code==="AbortError"||!e||e.retry===0||!t.response&&(e.currentRetryAttempt||0)>=e.noResponseRetries||!e.httpMethodsToRetry||!e.httpMethodsToRetry.includes(t.config.method?.toUpperCase()||"GET"))return!1;if(t.response&&t.response.status){let r=!1;for(let[n,i]of e.statusCodesToRetry){let s=t.response.status;if(s>=n&&s<=i){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}o(iO,"shouldRetryRequest");function yb(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(yb,"getConfig");function aO(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(aO,"getNextRetryDelay")});var Dd=D(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.GaxiosInterceptorManager=void 0;var kd=class extends Set{static{o(this,"GaxiosInterceptorManager")}};uu.GaxiosInterceptorManager=kd});var bb=D((N8,_b)=>{var Jo=1e3,Yo=Jo*60,Xo=Yo*60,so=Xo*24,sO=so*7,uO=so*365.25;_b.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return cO(t);if(r==="number"&&isFinite(t))return e.long?dO(t):lO(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function cO(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*uO;case"weeks":case"week":case"w":return r*sO;case"days":case"day":case"d":return r*so;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Xo;case"minutes":case"minute":case"mins":case"min":case"m":return r*Yo;case"seconds":case"second":case"secs":case"sec":case"s":return r*Jo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(cO,"parse");function lO(t){var e=Math.abs(t);return e>=so?Math.round(t/so)+"d":e>=Xo?Math.round(t/Xo)+"h":e>=Yo?Math.round(t/Yo)+"m":e>=Jo?Math.round(t/Jo)+"s":t+"ms"}o(lO,"fmtShort");function dO(t){var e=Math.abs(t);return e>=so?cu(t,e,so,"day"):e>=Xo?cu(t,e,Xo,"hour"):e>=Yo?cu(t,e,Yo,"minute"):e>=Jo?cu(t,e,Jo,"second"):t+" ms"}o(dO,"fmtLong");function cu(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(cu,"plural")});var Nd=D((U8,Eb)=>{function pO(t){r.debug=r,r.default=r,r.coerce=p,r.disable=c,r.enable=i,r.enabled=d,r.humanize=bb(),r.destroy=h,Object.keys(t).forEach(_=>{r[_]=t[_]}),r.names=[],r.skips=[],r.formatters={};function e(_){let m=0;for(let f=0;f<_.length;f++)m=(m<<5)-m+_.charCodeAt(f),m|=0;return r.colors[Math.abs(m)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(_){let m,f=null,l,g;function v(...b){if(!v.enabled)return;let E=v,k=Number(new Date),L=k-(m||k);E.diff=L,E.prev=m,E.curr=k,m=k,b[0]=r.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let J=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(G,K)=>{if(G==="%%")return"%";J++;let te=r.formatters[K];if(typeof te=="function"){let X=b[J];G=te.call(E,X),b.splice(J,1),J--}return G}),r.formatArgs.call(E,b),(E.log||r.log).apply(E,b)}return o(v,"debug"),v.namespace=_,v.useColors=r.useColors(),v.color=r.selectColor(_),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:o(()=>f!==null?f:(l!==r.namespaces&&(l=r.namespaces,g=r.enabled(_)),g),"get"),set:o(b=>{f=b},"set")}),typeof r.init=="function"&&r.init(v),v}o(r,"createDebug");function n(_,m){let f=r(this.namespace+(typeof m>"u"?":":m)+_);return f.log=this.log,f}o(n,"extend");function i(_){r.save(_),r.namespaces=_,r.names=[],r.skips=[];let m=(typeof _=="string"?_:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of m)f[0]==="-"?r.skips.push(f.slice(1)):r.names.push(f)}o(i,"enable");function s(_,m){let f=0,l=0,g=-1,v=0;for(;f<_.length;)if(l<m.length&&(m[l]===_[f]||m[l]==="*"))m[l]==="*"?(g=l,v=f,l++):(f++,l++);else if(g!==-1)l=g+1,v++,f=v;else return!1;for(;l<m.length&&m[l]==="*";)l++;return l===m.length}o(s,"matchesTemplate");function c(){let _=[...r.names,...r.skips.map(m=>"-"+m)].join(",");return r.enable(""),_}o(c,"disable");function d(_){for(let m of r.skips)if(s(_,m))return!1;for(let m of r.names)if(s(_,m))return!0;return!1}o(d,"enabled");function p(_){return _ instanceof Error?_.stack||_.message:_}o(p,"coerce");function h(){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(h,"destroy"),r.enable(r.load()),r}o(pO,"setup");Eb.exports=pO});var Sb=D((jt,lu)=>{jt.formatArgs=mO;jt.save=hO;jt.load=gO;jt.useColors=fO;jt.storage=yO();jt.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`."))}})();jt.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 fO(){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(fO,"useColors");function mO(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+lu.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(mO,"formatArgs");jt.log=console.debug||console.log||(()=>{});function hO(t){try{t?jt.storage.setItem("debug",t):jt.storage.removeItem("debug")}catch{}}o(hO,"save");function gO(){let t;try{t=jt.storage.getItem("debug")||jt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(gO,"load");function yO(){try{return localStorage}catch{}}o(yO,"localstorage");lu.exports=Nd()(jt);var{formatters:vO}=lu.exports;vO.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Tb=D((L8,Pb)=>{"use strict";Pb.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 Ab=D((F8,xb)=>{"use strict";var _O=require("os"),wb=require("tty"),dr=Tb(),{env:wt}=process,jn;dr("no-color")||dr("no-colors")||dr("color=false")||dr("color=never")?jn=0:(dr("color")||dr("colors")||dr("color=true")||dr("color=always"))&&(jn=1);"FORCE_COLOR"in wt&&(wt.FORCE_COLOR==="true"?jn=1:wt.FORCE_COLOR==="false"?jn=0:jn=wt.FORCE_COLOR.length===0?1:Math.min(parseInt(wt.FORCE_COLOR,10),3));function zd(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(zd,"translateLevel");function Ud(t,e){if(jn===0)return 0;if(dr("color=16m")||dr("color=full")||dr("color=truecolor"))return 3;if(dr("color=256"))return 2;if(t&&!e&&jn===void 0)return 0;let r=jn||0;if(wt.TERM==="dumb")return r;if(process.platform==="win32"){let n=_O.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in wt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in wt)||wt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in wt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(wt.TEAMCITY_VERSION)?1:0;if(wt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in wt){let n=parseInt((wt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(wt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(wt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(wt.TERM)||"COLORTERM"in wt?1:r}o(Ud,"supportsColor");function bO(t){let e=Ud(t,t&&t.isTTY);return zd(e)}o(bO,"getSupportLevel");xb.exports={supportsColor:bO,stdout:zd(Ud(!0,wb.isatty(1))),stderr:zd(Ud(!0,wb.isatty(2)))}});var Rb=D((xt,pu)=>{var EO=require("tty"),du=require("util");xt.init=IO;xt.log=wO;xt.formatArgs=PO;xt.save=xO;xt.load=AO;xt.useColors=SO;xt.destroy=du.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");xt.colors=[6,2,3,4,5,1];try{let t=Ab();t&&(t.stderr||t).level>=2&&(xt.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{}xt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function SO(){return"colors"in xt.inspectOpts?!!xt.inspectOpts.colors:EO.isatty(process.stderr.fd)}o(SO,"useColors");function PO(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
1
|
+
"use strict";var $A=Object.create;var Ni=Object.defineProperty;var kA=Object.getOwnPropertyDescriptor;var DA=Object.getOwnPropertyNames;var NA=Object.getPrototypeOf,zA=Object.prototype.hasOwnProperty;var o=(t,e)=>Ni(t,"name",{value:e,configurable:!0});var St=(t,e)=>()=>(t&&(e=t(t=0)),e);var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ws=(t,e)=>{for(var r in e)Ni(t,r,{get:e[r],enumerable:!0})},Lh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of DA(e))!zA.call(t,i)&&i!==r&&Ni(t,i,{get:()=>e[i],enumerable:!(n=kA(e,i))||n.enumerable});return t};var rt=(t,e,r)=>(r=t!=null?$A(NA(t)):{},Lh(e||!t||!t.__esModule?Ni(r,"default",{value:t,enumerable:!0}):r,t)),UA=t=>Lh(Ni({},"__esModule",{value:!0}),t);var ny=D((ry,Vs)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function p(l,g){if(l.indexOf("::")!==l.lastIndexOf("::"))return null;let v=0,b=-1,E=(l.match(d.zoneIndex)||[])[0],k,L;for(E&&(E=E.substring(1),l=l.replace(/%.+$/,""));(b=l.indexOf(":",b+1))>=0;)v++;if(l.substr(0,2)==="::"&&v--,l.substr(-2,2)==="::"&&v--,v>g)return null;for(L=g-v,k=":";L--;)k+="0:";return l=l.replace("::",k),l[0]===":"&&(l=l.slice(1)),l[l.length-1]===":"&&(l=l.slice(0,-1)),g=function(){let J=l.split(":"),W=[];for(let G=0;G<J.length;G++)W.push(parseInt(J[G],16));return W}(),{parts:g,zoneId:E}}o(p,"expandIPv6");function h(l,g,v,b){if(l.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let E=0,k;for(;b>0;){if(k=v-b,k<0&&(k=0),l[E]>>k!==g[E]>>k)return!1;b-=v,E+=1}return!0}o(h,"matchCIDR");function _(l){if(i.test(l))return parseInt(l,16);if(l[0]==="0"&&!isNaN(parseInt(l[1],10))){if(n.test(l))return parseInt(l,8);throw new Error(`ipaddr: cannot parse ${l} as octal`)}return parseInt(l,10)}o(_,"parseIntAuto");function m(l,g){for(;l.length<g;)l=`0${l}`;return l}o(m,"padPart");let f={};f.IPv4=function(){function l(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let v,b;for(v=0;v<g.length;v++)if(b=g[v],!(0<=b&&b<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return o(l,"IPv4"),l.prototype.SpecialRanges={unspecified:[[new l([0,0,0,0]),8]],broadcast:[[new l([255,255,255,255]),32]],multicast:[[new l([224,0,0,0]),4]],linkLocal:[[new l([169,254,0,0]),16]],loopback:[[new l([127,0,0,0]),8]],carrierGradeNat:[[new l([100,64,0,0]),10]],private:[[new l([10,0,0,0]),8],[new l([172,16,0,0]),12],[new l([192,168,0,0]),16]],reserved:[[new l([192,0,0,0]),24],[new l([192,0,2,0]),24],[new l([192,88,99,0]),24],[new l([198,18,0,0]),15],[new l([198,51,100,0]),24],[new l([203,0,113,0]),24],[new l([240,0,0,0]),4]],as112:[[new l([192,175,48,0]),24],[new l([192,31,196,0]),24]],amt:[[new l([192,52,193,0]),24]]},l.prototype.kind=function(){return"ipv4"},l.prototype.match=function(g,v){let b;if(v===void 0&&(b=g,g=b[0],v=b[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,g.octets,8,v)},l.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!1,b={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},E,k,L;for(E=3;E>=0;E-=1)if(k=this.octets[E],k in b){if(L=b[k],v&&L!==0)return null;L!==8&&(v=!0),g+=L}else return null;return 32-g},l.prototype.range=function(){return f.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){return this.octets.slice(0)},l.prototype.toIPv4MappedAddress=function(){return f.IPv6.parse(`::ffff:${this.toString()}`)},l.prototype.toNormalizedString=function(){return this.toString()},l.prototype.toString=function(){return this.octets.join(".")},l}(),f.IPv4.broadcastAddressFromCIDR=function(l){try{let g=this.parseCIDR(l),v=g[0].toByteArray(),b=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),E=[],k=0;for(;k<4;)E.push(parseInt(v[k],10)|parseInt(b[k],10)^255),k++;return new this(E)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},f.IPv4.isIPv4=function(l){return this.parser(l)!==null},f.IPv4.isValid=function(l){try{return new this(this.parser(l)),!0}catch{return!1}},f.IPv4.isValidCIDR=function(l){try{return this.parseCIDR(l),!0}catch{return!1}},f.IPv4.isValidFourPartDecimal=function(l){return!!(f.IPv4.isValid(l)&&l.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},f.IPv4.isValidCIDRFourPartDecimal=function(l){let g=l.match(/^(.+)\/(\d+)$/);return!f.IPv4.isValidCIDR(l)||!g?!1:f.IPv4.isValidFourPartDecimal(g[1])},f.IPv4.networkAddressFromCIDR=function(l){let g,v,b,E,k;try{for(g=this.parseCIDR(l),b=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),E=[],v=0;v<4;)E.push(parseInt(b[v],10)&parseInt(k[v],10)),v++;return new this(E)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},f.IPv4.parse=function(l){let g=this.parser(l);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},f.IPv4.parseCIDR=function(l){let g;if(g=l.match(/^(.+)\/(\d+)$/)){let v=parseInt(g[2]);if(v>=0&&v<=32){let b=[this.parse(g[1]),v];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")},f.IPv4.parser=function(l){let g,v,b;if(g=l.match(r.fourOctet))return function(){let E=g.slice(1,6),k=[];for(let L=0;L<E.length;L++)v=E[L],k.push(_(v));return k}();if(g=l.match(r.longValue)){if(b=_(g[1]),b>4294967295||b<0)throw new Error("ipaddr: address outside defined range");return function(){let E=[],k;for(k=0;k<=24;k+=8)E.push(b>>k&255);return E}().reverse()}else return(g=l.match(r.twoOctet))?function(){let E=g.slice(1,4),k=[];if(b=_(E[1]),b>16777215||b<0)throw new Error("ipaddr: address outside defined range");return k.push(_(E[0])),k.push(b>>16&255),k.push(b>>8&255),k.push(b&255),k}():(g=l.match(r.threeOctet))?function(){let E=g.slice(1,5),k=[];if(b=_(E[2]),b>65535||b<0)throw new Error("ipaddr: address outside defined range");return k.push(_(E[0])),k.push(_(E[1])),k.push(b>>8&255),k.push(b&255),k}():null},f.IPv4.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>32)throw new Error("ipaddr: invalid IPv4 prefix length");let g=[0,0,0,0],v=0,b=Math.floor(l/8);for(;v<b;)g[v]=255,v++;return b<4&&(g[b]=Math.pow(2,l%8)-1<<8-l%8),new this(g)},f.IPv6=function(){function l(g,v){let b,E;if(g.length===16)for(this.parts=[],b=0;b<=14;b+=2)this.parts.push(g[b]<<8|g[b+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(b=0;b<this.parts.length;b++)if(E=this.parts[b],!(0<=E&&E<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");v&&(this.zoneId=v)}return o(l,"IPv6"),l.prototype.SpecialRanges={unspecified:[new l([0,0,0,0,0,0,0,0]),128],linkLocal:[new l([65152,0,0,0,0,0,0,0]),10],multicast:[new l([65280,0,0,0,0,0,0,0]),8],loopback:[new l([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new l([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new l([0,0,0,0,0,65535,0,0]),96],discard:[new l([256,0,0,0,0,0,0,0]),64],rfc6145:[new l([0,0,0,0,65535,0,0,0]),96],rfc6052:[new l([100,65435,0,0,0,0,0,0]),96],"6to4":[new l([8194,0,0,0,0,0,0,0]),16],teredo:[new l([8193,0,0,0,0,0,0,0]),32],benchmarking:[new l([8193,2,0,0,0,0,0,0]),48],amt:[new l([8193,3,0,0,0,0,0,0]),32],as112v6:[[new l([8193,4,274,0,0,0,0,0]),48],[new l([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new l([8193,16,0,0,0,0,0,0]),28],orchid2:[new l([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new l([8193,48,0,0,0,0,0,0]),28],reserved:[[new l([8193,0,0,0,0,0,0,0]),23],[new l([8193,3512,0,0,0,0,0,0]),32]]},l.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},l.prototype.kind=function(){return"ipv6"},l.prototype.match=function(g,v){let b;if(v===void 0&&(b=g,g=b[0],v=b[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,g.parts,16,v)},l.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!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},E,k;for(let L=7;L>=0;L-=1)if(E=this.parts[L],E in b){if(k=b[E],v&&k!==0)return null;k!==16&&(v=!0),g+=k}else return null;return 128-g},l.prototype.range=function(){return f.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){let g,v=[],b=this.parts;for(let E=0;E<b.length;E++)g=b[E],v.push(g>>8),v.push(g&255);return v},l.prototype.toFixedLengthString=function(){let g=function(){let b=[];for(let E=0;E<this.parts.length;E++)b.push(m(this.parts[E].toString(16),4));return b}.call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},l.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let g=this.parts.slice(-2),v=g[0],b=g[1];return new f.IPv4([v>>8,v&255,b>>8,b&255])},l.prototype.toNormalizedString=function(){let g=function(){let b=[];for(let E=0;E<this.parts.length;E++)b.push(this.parts[E].toString(16));return b}.call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},l.prototype.toRFC5952String=function(){let g=/((^|:)(0(:|$)){2,})/g,v=this.toNormalizedString(),b=0,E=-1,k;for(;k=g.exec(v);)k[0].length>E&&(b=k.index,E=k[0].length);return E<0?v:`${v.substring(0,b)}::${v.substring(b+E)}`},l.prototype.toString=function(){return this.toRFC5952String()},l}(),f.IPv6.broadcastAddressFromCIDR=function(l){try{let g=this.parseCIDR(l),v=g[0].toByteArray(),b=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),E=[],k=0;for(;k<16;)E.push(parseInt(v[k],10)|parseInt(b[k],10)^255),k++;return new this(E)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},f.IPv6.isIPv6=function(l){return this.parser(l)!==null},f.IPv6.isValid=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{let g=this.parser(l);return new this(g.parts,g.zoneId),!0}catch{return!1}},f.IPv6.isValidCIDR=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{return this.parseCIDR(l),!0}catch{return!1}},f.IPv6.networkAddressFromCIDR=function(l){let g,v,b,E,k;try{for(g=this.parseCIDR(l),b=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),E=[],v=0;v<16;)E.push(parseInt(b[v],10)&parseInt(k[v],10)),v++;return new this(E)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},f.IPv6.parse=function(l){let g=this.parser(l);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},f.IPv6.parseCIDR=function(l){let g,v,b;if((v=l.match(/^(.+)\/(\d+)$/))&&(g=parseInt(v[2]),g>=0&&g<=128))return b=[this.parse(v[1]),g],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")},f.IPv6.parser=function(l){let g,v,b,E,k,L;if(b=l.match(d.deprecatedTransitional))return this.parser(`::ffff:${b[1]}`);if(d.native.test(l))return p(l,8);if((b=l.match(d.transitional))&&(L=b[6]||"",g=b[1],b[1].endsWith("::")||(g=g.slice(0,-1)),g=p(g+L,6),g.parts)){for(k=[parseInt(b[2]),parseInt(b[3]),parseInt(b[4]),parseInt(b[5])],v=0;v<k.length;v++)if(E=k[v],!(0<=E&&E<=255))return null;return g.parts.push(k[0]<<8|k[1]),g.parts.push(k[2]<<8|k[3]),{parts:g.parts,zoneId:g.zoneId}}return null},f.IPv6.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>128)throw new Error("ipaddr: invalid IPv6 prefix length");let g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=0,b=Math.floor(l/8);for(;v<b;)g[v]=255,v++;return b<16&&(g[b]=Math.pow(2,l%8)-1<<8-l%8),new this(g)},f.fromByteArray=function(l){let g=l.length;if(g===4)return new f.IPv4(l);if(g===16)return new f.IPv6(l);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},f.isValid=function(l){return f.IPv6.isValid(l)||f.IPv4.isValid(l)},f.isValidCIDR=function(l){return f.IPv6.isValidCIDR(l)||f.IPv4.isValidCIDR(l)},f.parse=function(l){if(f.IPv6.isValid(l))return f.IPv6.parse(l);if(f.IPv4.isValid(l))return f.IPv4.parse(l);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},f.parseCIDR=function(l){try{return f.IPv6.parseCIDR(l)}catch{try{return f.IPv4.parseCIDR(l)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},f.process=function(l){let g=this.parse(l);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},f.subnetMatch=function(l,g,v){let b,E,k,L;v==null&&(v="unicast");for(E in g)if(Object.prototype.hasOwnProperty.call(g,E)){for(k=g[E],k[0]&&!(k[0]instanceof Array)&&(k=[k]),b=0;b<k.length;b++)if(L=k[b],l.kind()===L[0].kind()&&l.match.apply(l,L))return E}return v},typeof Vs<"u"&&Vs.exports?Vs.exports=f:t.ipaddr=f})(ry)});var Xy=D((AK,Yy)=>{var Jy=require("stream").Stream,p0=require("util");Yy.exports=Tr;function Tr(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(Tr,"DelayedStream");p0.inherits(Tr,Jy);Tr.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(Tr.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});Tr.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Tr.prototype.resume=function(){this._released||this.release(),this.source.resume()};Tr.prototype.pause=function(){this.source.pause()};Tr.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};Tr.prototype.pipe=function(){var t=Jy.prototype.pipe.apply(this,arguments);return this.resume(),t};Tr.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)};Tr.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 rv=D((RK,tv)=>{var f0=require("util"),ev=require("stream").Stream,Qy=Xy();tv.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}o(dt,"CombinedStream");f0.inherits(dt,ev);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 Qy)){var r=Qy.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 ev.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 ov=D((OK,nv)=>{"use strict";nv.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 sv=D(Mt=>{"use strict";var Ys=ov(),m0=require("path").extname,iv=/^\s*([^;\s]*)(?:;|\s|$)/,h0=/^text\//i;Mt.charset=av;Mt.charsets={lookup:av};Mt.contentType=g0;Mt.extension=y0;Mt.extensions=Object.create(null);Mt.lookup=v0;Mt.types=Object.create(null);_0(Mt.extensions,Mt.types);function av(t){if(!t||typeof t!="string")return!1;var e=iv.exec(t),r=e&&Ys[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&h0.test(e[1])?"UTF-8":!1}o(av,"charset");function g0(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Mt.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Mt.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(g0,"contentType");function y0(t){if(!t||typeof t!="string")return!1;var e=iv.exec(t),r=e&&Mt.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(y0,"extension");function v0(t){if(!t||typeof t!="string")return!1;var e=m0("x."+t).toLowerCase().substr(1);return e&&Mt.types[e]||!1}o(v0,"lookup");function _0(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(Ys).forEach(o(function(i){var s=Ys[i],c=s.extensions;if(!(!c||!c.length)){t[i]=c;for(var d=0;d<c.length;d++){var p=c[d];if(e[p]){var h=r.indexOf(Ys[e[p]].source),_=r.indexOf(s.source);if(e[p]!=="application/octet-stream"&&(h>_||h===_&&e[p].substr(0,12)==="application/"))continue}e[p]=i}}},"forEachMimeType"))}o(_0,"populateMaps")});var cv=D((DK,uv)=>{uv.exports=b0;function b0(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(b0,"defer")});var ad=D((zK,dv)=>{var lv=cv();dv.exports=E0;function E0(t){var e=!1;return lv(function(){e=!0}),o(function(n,i){e?t(n,i):lv(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(E0,"async")});var sd=D((MK,pv)=>{pv.exports=S0;function S0(t){Object.keys(t.jobs).forEach(P0.bind(t)),t.jobs={}}o(S0,"abort");function P0(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(P0,"clean")});var ud=D((LK,mv)=>{var fv=ad(),T0=sd();mv.exports=w0;function w0(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=x0(e,i,t[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?T0(r):r.results[i]=c,n(s,r.results))})}o(w0,"iterate");function x0(t,e,r,n){var i;return t.length==2?i=t(r,fv(n)):i=t(r,e,fv(n)),i}o(x0,"runJob")});var cd=D((qK,hv)=>{hv.exports=A0;function A0(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};return e&&n.keyedList.sort(r?e:function(i,s){return e(t[i],t[s])}),n}o(A0,"state")});var ld=D((VK,gv)=>{var I0=sd(),R0=ad();gv.exports=C0;function C0(t){Object.keys(this.jobs).length&&(this.index=this.size,I0(this),R0(t)(null,this.results))}o(C0,"terminator")});var vv=D((HK,yv)=>{var O0=ud(),$0=cd(),k0=ld();yv.exports=D0;function D0(t,e,r){for(var n=$0(t);n.index<(n.keyedList||t).length;)O0(t,e,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return k0.bind(n,r)}o(D0,"parallel")});var dd=D((ZK,Xs)=>{var _v=ud(),N0=cd(),z0=ld();Xs.exports=U0;Xs.exports.ascending=bv;Xs.exports.descending=M0;function U0(t,e,r,n){var i=N0(t,r);return _v(t,e,i,o(function s(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||t).length){_v(t,e,i,s);return}n(null,i.results)},"iteratorHandler")),z0.bind(i,n)}o(U0,"serialOrdered");function bv(t,e){return t<e?-1:t>e?1:0}o(bv,"ascending");function M0(t,e){return-1*bv(t,e)}o(M0,"descending")});var Sv=D((JK,Ev)=>{var j0=dd();Ev.exports=L0;function L0(t,e,r){return j0(t,e,null,r)}o(L0,"serial")});var Tv=D((XK,Pv)=>{Pv.exports={parallel:vv(),serial:Sv(),serialOrdered:dd()}});var pd=D((QK,wv)=>{"use strict";wv.exports=Object});var Av=D((eJ,xv)=>{"use strict";xv.exports=Error});var Rv=D((tJ,Iv)=>{"use strict";Iv.exports=EvalError});var Ov=D((rJ,Cv)=>{"use strict";Cv.exports=RangeError});var kv=D((nJ,$v)=>{"use strict";$v.exports=ReferenceError});var Nv=D((oJ,Dv)=>{"use strict";Dv.exports=SyntaxError});var Nn=D((iJ,zv)=>{"use strict";zv.exports=TypeError});var Mv=D((aJ,Uv)=>{"use strict";Uv.exports=URIError});var Lv=D((sJ,jv)=>{"use strict";jv.exports=Math.abs});var qv=D((uJ,Fv)=>{"use strict";Fv.exports=Math.floor});var Vv=D((cJ,Bv)=>{"use strict";Bv.exports=Math.max});var Hv=D((lJ,Gv)=>{"use strict";Gv.exports=Math.min});var Zv=D((dJ,Wv)=>{"use strict";Wv.exports=Math.pow});var Jv=D((pJ,Kv)=>{"use strict";Kv.exports=Math.round});var Xv=D((fJ,Yv)=>{"use strict";Yv.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var e_=D((hJ,Qv)=>{"use strict";var F0=Xv();Qv.exports=o(function(e){return F0(e)||e===0?e:e<0?-1:1},"sign")});var r_=D((yJ,t_)=>{"use strict";t_.exports=Object.getOwnPropertyDescriptor});var fd=D((vJ,n_)=>{"use strict";var Qs=r_();if(Qs)try{Qs([],"length")}catch{Qs=null}n_.exports=Qs});var i_=D((_J,o_)=>{"use strict";var eu=Object.defineProperty||!1;if(eu)try{eu({},"a",{value:1})}catch{eu=!1}o_.exports=eu});var md=D((bJ,a_)=>{"use strict";a_.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var c=Object.getOwnPropertySymbols(e);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(e,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var c_=D((SJ,u_)=>{"use strict";var s_=typeof Symbol<"u"&&Symbol,q0=md();u_.exports=o(function(){return typeof s_!="function"||typeof Symbol!="function"||typeof s_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:q0()},"hasNativeSymbols")});var hd=D((TJ,l_)=>{"use strict";l_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var gd=D((wJ,d_)=>{"use strict";var B0=pd();d_.exports=B0.getPrototypeOf||null});var m_=D((xJ,f_)=>{"use strict";var V0="Function.prototype.bind called on incompatible ",G0=Object.prototype.toString,H0=Math.max,W0="[object Function]",p_=o(function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var s=0;s<r.length;s+=1)n[s+e.length]=r[s];return n},"concatty"),Z0=o(function(e,r){for(var n=[],i=r||0,s=0;i<e.length;i+=1,s+=1)n[s]=e[i];return n},"slicy"),K0=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");f_.exports=o(function(e){var r=this;if(typeof r!="function"||G0.apply(r)!==W0)throw new TypeError(V0+r);for(var n=Z0(arguments,1),i,s=o(function(){if(this instanceof i){var _=r.apply(this,p_(n,arguments));return Object(_)===_?_:this}return r.apply(e,p_(n,arguments))},"binder"),c=H0(0,r.length-n.length),d=[],p=0;p<c;p++)d[p]="$"+p;if(i=Function("binder","return function ("+K0(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var Ho=D((IJ,h_)=>{"use strict";var J0=m_();h_.exports=Function.prototype.bind||J0});var tu=D((RJ,g_)=>{"use strict";g_.exports=Function.prototype.call});var yd=D((CJ,y_)=>{"use strict";y_.exports=Function.prototype.apply});var __=D((OJ,v_)=>{"use strict";v_.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var E_=D(($J,b_)=>{"use strict";var Y0=Ho(),X0=yd(),Q0=tu(),eC=__();b_.exports=eC||Y0.call(Q0,X0)});var vd=D((kJ,S_)=>{"use strict";var tC=Ho(),rC=Nn(),nC=tu(),oC=E_();S_.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new rC("a function is required");return oC(tC,nC,e)},"callBindBasic")});var I_=D((NJ,A_)=>{"use strict";var iC=vd(),P_=fd(),w_;try{w_=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var _d=!!w_&&P_&&P_(Object.prototype,"__proto__"),x_=Object,T_=x_.getPrototypeOf;A_.exports=_d&&typeof _d.get=="function"?iC([_d.get]):typeof T_=="function"?o(function(e){return T_(e==null?e:x_(e))},"getDunder"):!1});var k_=D((UJ,$_)=>{"use strict";var R_=hd(),C_=gd(),O_=I_();$_.exports=R_?o(function(e){return R_(e)},"getProto"):C_?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return C_(e)},"getProto"):O_?o(function(e){return O_(e)},"getProto"):null});var bd=D((jJ,D_)=>{"use strict";var aC=Function.prototype.call,sC=Object.prototype.hasOwnProperty,uC=Ho();D_.exports=uC.call(aC,sC)});var ia=D((LJ,L_)=>{"use strict";var Ne,cC=pd(),lC=Av(),dC=Rv(),pC=Ov(),fC=kv(),Jo=Nv(),Ko=Nn(),mC=Mv(),hC=Lv(),gC=qv(),yC=Vv(),vC=Hv(),_C=Zv(),bC=Jv(),EC=e_(),M_=Function,Ed=o(function(t){try{return M_('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),ra=fd(),SC=i_(),Sd=o(function(){throw new Ko},"throwTypeError"),PC=ra?function(){try{return arguments.callee,Sd}catch{try{return ra(arguments,"callee").get}catch{return Sd}}}():Sd,Wo=c_()(),Tt=k_(),TC=gd(),wC=hd(),j_=yd(),na=tu(),Zo={},xC=typeof Uint8Array>"u"||!Tt?Ne:Tt(Uint8Array),ao={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Ne:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ne:ArrayBuffer,"%ArrayIteratorPrototype%":Wo&&Tt?Tt([][Symbol.iterator]()):Ne,"%AsyncFromSyncIteratorPrototype%":Ne,"%AsyncFunction%":Zo,"%AsyncGenerator%":Zo,"%AsyncGeneratorFunction%":Zo,"%AsyncIteratorPrototype%":Zo,"%Atomics%":typeof Atomics>"u"?Ne:Atomics,"%BigInt%":typeof BigInt>"u"?Ne:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ne:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ne:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ne:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":lC,"%eval%":eval,"%EvalError%":dC,"%Float16Array%":typeof Float16Array>"u"?Ne:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Ne:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ne:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ne:FinalizationRegistry,"%Function%":M_,"%GeneratorFunction%":Zo,"%Int8Array%":typeof Int8Array>"u"?Ne:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ne:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ne:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Wo&&Tt?Tt(Tt([][Symbol.iterator]())):Ne,"%JSON%":typeof JSON=="object"?JSON:Ne,"%Map%":typeof Map>"u"?Ne:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Wo||!Tt?Ne:Tt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":cC,"%Object.getOwnPropertyDescriptor%":ra,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ne:Promise,"%Proxy%":typeof Proxy>"u"?Ne:Proxy,"%RangeError%":pC,"%ReferenceError%":fC,"%Reflect%":typeof Reflect>"u"?Ne:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ne:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Wo||!Tt?Ne:Tt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ne:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Wo&&Tt?Tt(""[Symbol.iterator]()):Ne,"%Symbol%":Wo?Symbol:Ne,"%SyntaxError%":Jo,"%ThrowTypeError%":PC,"%TypedArray%":xC,"%TypeError%":Ko,"%Uint8Array%":typeof Uint8Array>"u"?Ne:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ne:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ne:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ne:Uint32Array,"%URIError%":mC,"%WeakMap%":typeof WeakMap>"u"?Ne:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ne:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ne:WeakSet,"%Function.prototype.call%":na,"%Function.prototype.apply%":j_,"%Object.defineProperty%":SC,"%Object.getPrototypeOf%":TC,"%Math.abs%":hC,"%Math.floor%":gC,"%Math.max%":yC,"%Math.min%":vC,"%Math.pow%":_C,"%Math.round%":bC,"%Math.sign%":EC,"%Reflect.getPrototypeOf%":wC};if(Tt)try{null.error}catch(t){N_=Tt(Tt(t)),ao["%Error.prototype%"]=N_}var N_,AC=o(function t(e){var r;if(e==="%AsyncFunction%")r=Ed("async function () {}");else if(e==="%GeneratorFunction%")r=Ed("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Ed("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Tt&&(r=Tt(i.prototype))}return ao[e]=r,r},"doEval"),z_={__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=Ho(),ru=bd(),IC=oa.call(na,Array.prototype.concat),RC=oa.call(j_,Array.prototype.splice),U_=oa.call(na,String.prototype.replace),nu=oa.call(na,String.prototype.slice),CC=oa.call(na,RegExp.prototype.exec),OC=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$C=/\\(\\)?/g,kC=o(function(e){var r=nu(e,0,1),n=nu(e,-1);if(r==="%"&&n!=="%")throw new Jo("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Jo("invalid intrinsic syntax, expected opening `%`");var i=[];return U_(e,OC,function(s,c,d,p){i[i.length]=d?U_(p,$C,"$1"):c||s}),i},"stringToPath"),DC=o(function(e,r){var n=e,i;if(ru(z_,n)&&(i=z_[n],n="%"+i[0]+"%"),ru(ao,n)){var s=ao[n];if(s===Zo&&(s=AC(n)),typeof s>"u"&&!r)throw new Ko("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Jo("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");L_.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new Ko("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ko('"allowMissing" argument must be a boolean');if(CC(/^%?[^%]*%?$/,e)===null)throw new Jo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=kC(e),i=n.length>0?n[0]:"",s=DC("%"+i+"%",r),c=s.name,d=s.value,p=!1,h=s.alias;h&&(i=h[0],RC(n,IC([0,1],h)));for(var _=1,m=!0;_<n.length;_+=1){var f=n[_],l=nu(f,0,1),g=nu(f,-1);if((l==='"'||l==="'"||l==="`"||g==='"'||g==="'"||g==="`")&&l!==g)throw new Jo("property names with quotes must have matching quotes");if((f==="constructor"||!m)&&(p=!0),i+="."+f,c="%"+i+"%",ru(ao,c))d=ao[c];else if(d!=null){if(!(f in d)){if(!r)throw new Ko("base intrinsic for "+e+" exists, but the property is not available.");return}if(ra&&_+1>=n.length){var v=ra(d,f);m=!!v,m&&"get"in v&&!("originalValue"in v.get)?d=v.get:d=d[f]}else m=ru(d,f),d=d[f];m&&!p&&(ao[c]=d)}}return d},"GetIntrinsic")});var q_=D((qJ,F_)=>{"use strict";var NC=md();F_.exports=o(function(){return NC()&&!!Symbol.toStringTag},"hasToStringTagShams")});var G_=D((VJ,V_)=>{"use strict";var zC=ia(),B_=zC("%Object.defineProperty%",!0),UC=q_()(),MC=bd(),jC=Nn(),ou=UC?Symbol.toStringTag:null;V_.exports=o(function(e,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new jC("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ou&&(n||!MC(e,ou))&&(B_?B_(e,ou,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[ou]=r)},"setToStringTag")});var W_=D((HJ,H_)=>{"use strict";var LC=Function.prototype.call,FC=Object.prototype.hasOwnProperty,qC=Ho();H_.exports=qC.call(LC,FC)});var K_=D((WJ,Z_)=>{"use strict";Z_.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var X_=D((ZJ,Y_)=>{"use strict";var xd=rv(),BC=require("util"),Pd=require("path"),VC=require("http"),GC=require("https"),HC=require("url").parse,WC=require("fs"),ZC=require("stream").Stream,KC=require("crypto"),Td=sv(),JC=Tv(),YC=G_(),zn=W_(),wd=K_();function J_(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(J_,"escapeHeaderParam");function je(t){if(!(this instanceof je))return new je(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],xd.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(je,"FormData");BC.inherits(je,xd);je.LINE_BREAK=`\r
|
|
2
|
+
`;je.DEFAULT_CONTENT_TYPE="application/octet-stream";je.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=xd.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r),s=this._multiPartFooter();n(i),n(e),n(s),this._trackLength(i,e,r)};je.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)+je.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&zn(e,"httpVersion"))&&!(e instanceof ZC))&&(r.knownLength||this._valuesToMeasure.push(e))};je.prototype._lengthRetriever=function(t,e){zn(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):WC.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):zn(t,"httpVersion")?e(null,Number(t.headers["content-length"])):zn(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};je.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),i=this._getContentType(e,r),s="",c={"Content-Disposition":["form-data",'name="'+J_(t)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&wd(c,r.header);var d;for(var p in c)if(zn(c,p)){if(d=c[p],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=p+": "+d.join("; ")+je.LINE_BREAK)}return"--"+this.getBoundary()+je.LINE_BREAK+s+je.LINE_BREAK};je.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&&zn(t,"httpVersion")&&(r=Pd.basename(t.client._httpMessage.path||"")),r)return'filename="'+J_(r)+'"'};je.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=Td.lookup(t.name)),!r&&t&&t.path&&(r=Td.lookup(t.path)),!r&&t&&t.readable&&zn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=Td.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=je.DEFAULT_CONTENT_TYPE),r};je.prototype._multiPartFooter=function(){return function(t){var e=je.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};je.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+je.LINE_BREAK};je.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)zn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};je.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};je.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};je.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(je.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};je.prototype._generateBoundary=function(){this._boundary="--------------------------"+KC.randomBytes(12).toString("hex")};je.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};je.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};je.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}JC.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};je.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=HC(t),n=wd({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=wd(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=GC.request(n):r=VC.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),e){var d,p=o(function(h,_){return r.removeListener("error",p),r.removeListener("response",d),e.call(this,h,_)},"callback");d=p.bind(this,null),r.on("error",p),r.on("response",d)}}.bind(this)),r};je.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};je.prototype.toString=function(){return"[object FormData]"};YC(je.prototype,"FormData");Y_.exports=je});var sa=D(($8,fb)=>{"use strict";var au=Object.prototype.hasOwnProperty,pb=Object.prototype.toString,ab=Object.defineProperty,sb=Object.getOwnPropertyDescriptor,ub=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):pb.call(e)==="[object Array]"},"isArray"),cb=o(function(e){if(!e||pb.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 i;for(i in e);return typeof i>"u"||au.call(e,i)},"isPlainObject"),lb=o(function(e,r){ab&&r.name==="__proto__"?ab(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),db=o(function(e,r){if(r==="__proto__")if(au.call(e,r)){if(sb)return sb(e,r).value}else return;return e[r]},"getProperty");fb.exports=o(function t(){var e,r,n,i,s,c,d=arguments[0],p=1,h=arguments.length,_=!1;for(typeof d=="boolean"&&(_=d,d=arguments[1]||{},p=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});p<h;++p)if(e=arguments[p],e!=null)for(r in e)n=db(d,r),i=db(e,r),d!==i&&(_&&i&&(cb(i)||(s=ub(i)))?(s?(s=!1,c=n&&ub(n)?n:[]):c=n&&cb(n)?n:{},lb(d,{name:r,newValue:t(_,c,i)})):typeof i<"u"&&lb(d,{name:r,newValue:i}));return d},"extend")});var mb=D((D8,aO)=>{aO.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 gb=D((N8,hb)=>{"use strict";var sO=mb();hb.exports={pkg:sO}});var Od=D(lr=>{"use strict";var vb=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=_b;var yb=vb(sa()),uO=vb(gb()),Rd=uO.default.pkg;lr.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Rd.name}-gaxios-error`);var Cd=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[lr.GAXIOS_ERROR_SYMBOL]=Rd.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&lr.GAXIOS_ERROR_SYMBOL in e&&e[lr.GAXIOS_ERROR_SYMBOL]===Rd.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,yb.default)(!0,{},r),this.response&&(this.response.config=(0,yb.default)(!0,{},this.response.config)),this.response){try{this.response.data=cO(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}i instanceof DOMException?this.code=i.name:i&&typeof i=="object"&&"code"in i&&(typeof i.code=="string"||typeof i.code=="number")&&(this.code=i.code)}static extractAPIErrorFromResponse(e,r="The request failed"){let n=r;if(typeof e.data=="string"&&(n=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){n="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:n;let i="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,s="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let c=[];for(let d of e.data.error.errors)typeof d=="object"&&"message"in d&&typeof d.message=="string"&&c.push(d.message);return Object.assign({message:c.join(`
|
|
3
|
+
`)||n,code:s,status:i},e.data.error)}return Object.assign({message:n,code:s,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};lr.GaxiosError=Cd;function cO(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(cO,"translateData");function _b(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((c,d)=>{(/^authentication$/i.test(d)||/^authorization$/i.test(d)||/secret/i.test(d))&&s.set(d,e)})}o(r,"redactHeaders");function n(s,c){if(typeof s=="object"&&s!==null&&typeof s[c]=="string"){let d=s[c];(/grant_type=/i.test(d)||/assertion=/i.test(d)||/secret/i.test(d))&&(s[c]=e)}}o(n,"redactString");function i(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((c,d)=>{(["grant_type","assertion"].includes(d)||/secret/.test(d))&&s.set(d,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return o(i,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),i(t.config.data),n(t.config,"body"),i(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(_b({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(_b,"defaultErrorRedactor")});var Eb=D($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.getRetryConfig=lO;async function lO(t){let e=bb(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||dO)(t))return{shouldRetry:!1,config:t.config};let i=pO(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,i):new Promise(c=>{setTimeout(c,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}o(lO,"getRetryConfig");function dO(t){let e=bb(t);if(t.config.signal?.aborted&&t.code!=="TimeoutError"||t.code==="AbortError"||!e||e.retry===0||!t.response&&(e.currentRetryAttempt||0)>=e.noResponseRetries||!e.httpMethodsToRetry||!e.httpMethodsToRetry.includes(t.config.method?.toUpperCase()||"GET"))return!1;if(t.response&&t.response.status){let r=!1;for(let[n,i]of e.statusCodesToRetry){let s=t.response.status;if(s>=n&&s<=i){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}o(dO,"shouldRetryRequest");function bb(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(bb,"getConfig");function pO(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(pO,"getNextRetryDelay")});var Dd=D(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.GaxiosInterceptorManager=void 0;var kd=class extends Set{static{o(this,"GaxiosInterceptorManager")}};su.GaxiosInterceptorManager=kd});var Pb=D((q8,Sb)=>{var Yo=1e3,Xo=Yo*60,Qo=Xo*60,so=Qo*24,fO=so*7,mO=so*365.25;Sb.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return hO(t);if(r==="number"&&isFinite(t))return e.long?yO(t):gO(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function hO(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*mO;case"weeks":case"week":case"w":return r*fO;case"days":case"day":case"d":return r*so;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Qo;case"minutes":case"minute":case"mins":case"min":case"m":return r*Xo;case"seconds":case"second":case"secs":case"sec":case"s":return r*Yo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(hO,"parse");function gO(t){var e=Math.abs(t);return e>=so?Math.round(t/so)+"d":e>=Qo?Math.round(t/Qo)+"h":e>=Xo?Math.round(t/Xo)+"m":e>=Yo?Math.round(t/Yo)+"s":t+"ms"}o(gO,"fmtShort");function yO(t){var e=Math.abs(t);return e>=so?uu(t,e,so,"day"):e>=Qo?uu(t,e,Qo,"hour"):e>=Xo?uu(t,e,Xo,"minute"):e>=Yo?uu(t,e,Yo,"second"):t+" ms"}o(yO,"fmtLong");function uu(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(uu,"plural")});var Nd=D((V8,Tb)=>{function vO(t){r.debug=r,r.default=r,r.coerce=p,r.disable=c,r.enable=i,r.enabled=d,r.humanize=Pb(),r.destroy=h,Object.keys(t).forEach(_=>{r[_]=t[_]}),r.names=[],r.skips=[],r.formatters={};function e(_){let m=0;for(let f=0;f<_.length;f++)m=(m<<5)-m+_.charCodeAt(f),m|=0;return r.colors[Math.abs(m)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(_){let m,f=null,l,g;function v(...b){if(!v.enabled)return;let E=v,k=Number(new Date),L=k-(m||k);E.diff=L,E.prev=m,E.curr=k,m=k,b[0]=r.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let J=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(G,K)=>{if(G==="%%")return"%";J++;let te=r.formatters[K];if(typeof te=="function"){let X=b[J];G=te.call(E,X),b.splice(J,1),J--}return G}),r.formatArgs.call(E,b),(E.log||r.log).apply(E,b)}return o(v,"debug"),v.namespace=_,v.useColors=r.useColors(),v.color=r.selectColor(_),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:o(()=>f!==null?f:(l!==r.namespaces&&(l=r.namespaces,g=r.enabled(_)),g),"get"),set:o(b=>{f=b},"set")}),typeof r.init=="function"&&r.init(v),v}o(r,"createDebug");function n(_,m){let f=r(this.namespace+(typeof m>"u"?":":m)+_);return f.log=this.log,f}o(n,"extend");function i(_){r.save(_),r.namespaces=_,r.names=[],r.skips=[];let m=(typeof _=="string"?_:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of m)f[0]==="-"?r.skips.push(f.slice(1)):r.names.push(f)}o(i,"enable");function s(_,m){let f=0,l=0,g=-1,v=0;for(;f<_.length;)if(l<m.length&&(m[l]===_[f]||m[l]==="*"))m[l]==="*"?(g=l,v=f,l++):(f++,l++);else if(g!==-1)l=g+1,v++,f=v;else return!1;for(;l<m.length&&m[l]==="*";)l++;return l===m.length}o(s,"matchesTemplate");function c(){let _=[...r.names,...r.skips.map(m=>"-"+m)].join(",");return r.enable(""),_}o(c,"disable");function d(_){for(let m of r.skips)if(s(_,m))return!1;for(let m of r.names)if(s(_,m))return!0;return!1}o(d,"enabled");function p(_){return _ instanceof Error?_.stack||_.message:_}o(p,"coerce");function h(){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(h,"destroy"),r.enable(r.load()),r}o(vO,"setup");Tb.exports=vO});var wb=D((jt,cu)=>{jt.formatArgs=bO;jt.save=EO;jt.load=SO;jt.useColors=_O;jt.storage=PO();jt.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`."))}})();jt.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 _O(){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(_O,"useColors");function bO(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,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}o(bO,"formatArgs");jt.log=console.debug||console.log||(()=>{});function EO(t){try{t?jt.storage.setItem("debug",t):jt.storage.removeItem("debug")}catch{}}o(EO,"save");function SO(){let t;try{t=jt.storage.getItem("debug")||jt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(SO,"load");function PO(){try{return localStorage}catch{}}o(PO,"localstorage");cu.exports=Nd()(jt);var{formatters:TO}=cu.exports;TO.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Ab=D((W8,xb)=>{"use strict";xb.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 Cb=D((Z8,Rb)=>{"use strict";var wO=require("os"),Ib=require("tty"),dr=Ab(),{env:wt}=process,jn;dr("no-color")||dr("no-colors")||dr("color=false")||dr("color=never")?jn=0:(dr("color")||dr("colors")||dr("color=true")||dr("color=always"))&&(jn=1);"FORCE_COLOR"in wt&&(wt.FORCE_COLOR==="true"?jn=1:wt.FORCE_COLOR==="false"?jn=0:jn=wt.FORCE_COLOR.length===0?1:Math.min(parseInt(wt.FORCE_COLOR,10),3));function zd(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(zd,"translateLevel");function Ud(t,e){if(jn===0)return 0;if(dr("color=16m")||dr("color=full")||dr("color=truecolor"))return 3;if(dr("color=256"))return 2;if(t&&!e&&jn===void 0)return 0;let r=jn||0;if(wt.TERM==="dumb")return r;if(process.platform==="win32"){let n=wO.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in wt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in wt)||wt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in wt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(wt.TEAMCITY_VERSION)?1:0;if(wt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in wt){let n=parseInt((wt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(wt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(wt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(wt.TERM)||"COLORTERM"in wt?1:r}o(Ud,"supportsColor");function xO(t){let e=Ud(t,t&&t.isTTY);return zd(e)}o(xO,"getSupportLevel");Rb.exports={supportsColor:xO,stdout:zd(Ud(!0,Ib.isatty(1))),stderr:zd(Ud(!0,Ib.isatty(2)))}});var $b=D((xt,du)=>{var AO=require("tty"),lu=require("util");xt.init=DO;xt.log=OO;xt.formatArgs=RO;xt.save=$O;xt.load=kO;xt.useColors=IO;xt.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`.");xt.colors=[6,2,3,4,5,1];try{let t=Cb();t&&(t.stderr||t).level>=2&&(xt.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{}xt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function IO(){return"colors"in xt.inspectOpts?!!xt.inspectOpts.colors:AO.isatty(process.stderr.fd)}o(IO,"useColors");function RO(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
4
4
|
`).join(`
|
|
5
|
-
`+s),t.push(i+"m+"+
|
|
6
|
-
`)}o(
|
|
7
|
-
`).map(e=>e.trim()).join(" ")};
|
|
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
|
|
5
|
+
`+s),t.push(i+"m+"+du.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=CO()+e+" "+t[0]}o(RO,"formatArgs");function CO(){return xt.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(CO,"getDate");function OO(...t){return process.stderr.write(lu.formatWithOptions(xt.inspectOpts,...t)+`
|
|
6
|
+
`)}o(OO,"log");function $O(t){t?process.env.DEBUG=t:delete process.env.DEBUG}o($O,"save");function kO(){return process.env.DEBUG}o(kO,"load");function DO(t){t.inspectOpts={};let e=Object.keys(xt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=xt.inspectOpts[e[r]]}o(DO,"init");du.exports=Nd()(xt);var{formatters:Ob}=du.exports;Ob.o=function(t){return this.inspectOpts.colors=this.useColors,lu.inspect(t,this.inspectOpts).split(`
|
|
7
|
+
`).map(e=>e.trim()).join(" ")};Ob.O=function(t){return this.inspectOpts.colors=this.useColors,lu.inspect(t,this.inspectOpts)}});var jd=D((Y8,Md)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Md.exports=wb():Md.exports=$b()});var Nb=D(Lt=>{"use strict";var NO=Lt&&Lt.__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]}),zO=Lt&&Lt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kb=Lt&&Lt.__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)&&NO(e,t,r);return zO(e,t),e};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.req=Lt.json=Lt.toBuffer=void 0;var UO=kb(require("http")),MO=kb(require("https"));async function Db(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}o(Db,"toBuffer");Lt.toBuffer=Db;async function jO(t){let r=(await Db(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let i=n;throw i.message+=` (input: ${r})`,i}}o(jO,"json");Lt.json=jO;function LO(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?MO:UO).request(t,e),i=new Promise((s,c)=>{n.once("response",s).once("error",c).end()});return n.then=i.then.bind(i),n}o(LO,"req");Lt.req=LO});var jb=D(Zt=>{"use strict";var Ub=Zt&&Zt.__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]}),FO=Zt&&Zt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Mb=Zt&&Zt.__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)&&Ub(e,t,r);return FO(e,t),e},qO=Zt&&Zt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ub(e,t,r)};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.Agent=void 0;var BO=Mb(require("net")),zb=Mb(require("http")),VO=require("https");qO(Nb(),Zt);var Ur=Symbol("AgentBaseInternalState"),Ld=class extends zb.Agent{static{o(this,"Agent")}constructor(e){super(e),this[Ur]={}}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 BO.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)?VO.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let i={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(i),c=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(d=>{if(this.decrementSockets(s,c),d instanceof zb.Agent)try{return d.addRequest(e,i)}catch(p){return n(p)}this[Ur].currentSocket=d,super.createSocket(e,r,n)},d=>{this.decrementSockets(s,c),n(d)})}createConnection(){let e=this[Ur].currentSocket;if(this[Ur].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Ur].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Ur]&&(this[Ur].defaultPort=e)}get protocol(){return this[Ur].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Ur]&&(this[Ur].protocol=e)}};Zt.Agent=Ld});var Lb=D(ei=>{"use strict";var GO=ei&&ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ei,"__esModule",{value:!0});ei.parseProxyResponse=void 0;var HO=GO(jd()),pu=(0,HO.default)("https-proxy-agent:parse-proxy-response");function WO(t){return new Promise((e,r)=>{let n=0,i=[];function s(){let _=t.read();_?h(_):t.once("readable",s)}o(s,"read");function c(){t.removeListener("end",d),t.removeListener("error",p),t.removeListener("readable",s)}o(c,"cleanup");function d(){c(),pu("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}o(d,"onend");function p(_){c(),pu("onerror %o",_),r(_)}o(p,"onerror");function h(_){i.push(_),n+=_.length;let m=Buffer.concat(i,n),f=m.indexOf(`\r
|
|
9
9
|
\r
|
|
10
|
-
`);if(f===-1){
|
|
11
|
-
`),g=l.shift();if(!g)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let v=g.split(" "),b=+v[1],E=v.slice(2).join(" "),k={};for(let L of l){if(!L)continue;let J=L.indexOf(":");if(J===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${L}"`));let W=L.slice(0,J).toLowerCase(),G=L.slice(J+1).trimStart(),K=k[W];typeof K=="string"?k[W]=[K,G]:Array.isArray(K)?K.push(G):k[W]=G}
|
|
10
|
+
`);if(f===-1){pu("have not received end of HTTP headers yet..."),s();return}let l=m.slice(0,f).toString("ascii").split(`\r
|
|
11
|
+
`),g=l.shift();if(!g)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let v=g.split(" "),b=+v[1],E=v.slice(2).join(" "),k={};for(let L of l){if(!L)continue;let J=L.indexOf(":");if(J===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${L}"`));let W=L.slice(0,J).toLowerCase(),G=L.slice(J+1).trimStart(),K=k[W];typeof K=="string"?k[W]=[K,G]:Array.isArray(K)?K.push(G):k[W]=G}pu("got proxy server response: %o %o",g,k),c(),e({connect:{statusCode:b,statusText:E,headers:k},buffered:m})}o(h,"ondata"),t.on("error",p),t.on("end",d),s()})}o(WO,"parseProxyResponse");ei.parseProxyResponse=WO});var Hb=D(pr=>{"use strict";var ZO=pr&&pr.__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]}),KO=pr&&pr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Vb=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)&&ZO(e,t,r);return KO(e,t),e},Gb=pr&&pr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pr,"__esModule",{value:!0});pr.HttpsProxyAgent=void 0;var fu=Vb(require("net")),Fb=Vb(require("tls")),JO=Gb(require("assert")),YO=Gb(jd()),XO=jb(),QO=require("url"),e$=Lb(),ua=(0,YO.default)("https-proxy-agent"),qb=o(t=>t.servername===void 0&&t.host&&!fu.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),mu=class extends XO.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new QO.URL(e):e,this.proxyHeaders=r?.headers??{},ua("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?Bb(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:"?(ua("Creating `tls.Socket`: %o",this.connectOpts),i=Fb.connect(qb(this.connectOpts))):(ua("Creating `net.Socket`: %o",this.connectOpts),i=fu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=fu.isIPv6(r.host)?`[${r.host}]`:r.host,d=`CONNECT ${c}:${r.port} HTTP/1.1\r
|
|
12
12
|
`;if(n.username||n.password){let f=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(f).toString("base64")}`}s.Host=`${c}:${r.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let f of Object.keys(s))d+=`${f}: ${s[f]}\r
|
|
13
|
-
`;let p=(0,
|
|
14
|
-
`);let{connect:h,buffered:_}=await p;if(e.emit("proxyConnect",h),this.emit("proxyConnect",h,e),h.statusCode===200)return e.once("socket",KO),r.secureEndpoint?(ua("Upgrading socket connection to TLS"),Mb.connect({...Lb(jb(r),"host","path","port"),socket:i})):i;i.destroy();let m=new mu.Socket({writable:!1});return m.readable=!0,e.once("socket",f=>{ua("Replaying proxy buffer for failed request"),(0,VO.default)(f.listenerCount("data")>0),f.push(_),f.push(null)}),m}};hu.protocols=["http","https"];pr.HttpsProxyAgent=hu;function KO(t){t.resume()}o(KO,"resume");function Lb(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(Lb,"omit")});function JO(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,s=r[0]||"text/plain",c=s;for(let _=1;_<r.length;_++)r[_]==="base64"?i=!0:r[_]&&(c+=`;${r[_]}`,r[_].indexOf("charset=")===0&&(n=r[_].substring(8)));!r[0]&&!n.length&&(c+=";charset=US-ASCII",n="US-ASCII");let d=i?"base64":"ascii",p=unescape(t.substring(e+1)),h=Buffer.from(p,d);return h.type=s,h.typeFull=c,h.charset=n,h}var Vb,Gb=St(()=>{o(JO,"dataUriToBuffer");Vb=JO});var Wb=D((gu,Hb)=>{(function(t,e){typeof gu=="object"&&typeof Hb<"u"?e(gu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(gu,function(t){"use strict";function e(){}o(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(r,"typeIsObject");let n=e;function i(a,u){try{Object.defineProperty(a,"name",{value:u,configurable:!0})}catch{}}o(i,"setFunctionName");let s=Promise,c=Promise.prototype.then,d=Promise.reject.bind(s);function p(a){return new s(a)}o(p,"newPromise");function h(a){return p(u=>u(a))}o(h,"promiseResolvedWith");function _(a){return d(a)}o(_,"promiseRejectedWith");function m(a,u,y){return c.call(a,u,y)}o(m,"PerformPromiseThen");function f(a,u,y){m(m(a,u,y),void 0,n)}o(f,"uponPromise");function l(a,u){f(a,u)}o(l,"uponFulfillment");function g(a,u){f(a,void 0,u)}o(g,"uponRejection");function v(a,u,y){return m(a,u,y)}o(v,"transformPromiseWith");function b(a){m(a,void 0,n)}o(b,"setPromiseIsHandledToTrue");let E=o(a=>{if(typeof queueMicrotask=="function")E=queueMicrotask;else{let u=h(void 0);E=o(y=>m(u,y),"_queueMicrotask")}return E(a)},"_queueMicrotask");function k(a,u,y){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,u,y)}o(k,"reflectCall");function L(a,u,y){try{return h(k(a,u,y))}catch(T){return _(T)}}o(L,"promiseCall");let J=16384;class W{static{o(this,"SimpleQueue")}constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(u){let y=this._back,T=y;y._elements.length===J-1&&(T={_elements:[],_next:void 0}),y._elements.push(u),T!==y&&(this._back=T,y._next=T),++this._size}shift(){let u=this._front,y=u,T=this._cursor,A=T+1,M=u._elements,F=M[T];return A===J&&(y=u._next,A=0),--this._size,this._cursor=A,u!==y&&(this._front=y),M[T]=void 0,F}forEach(u){let y=this._cursor,T=this._front,A=T._elements;for(;(y!==A.length||T._next!==void 0)&&!(y===A.length&&(T=T._next,A=T._elements,y=0,A.length===0));)u(A[y]),++y}peek(){let u=this._front,y=this._cursor;return u._elements[y]}}let G=Symbol("[[AbortSteps]]"),K=Symbol("[[ErrorSteps]]"),te=Symbol("[[CancelSteps]]"),X=Symbol("[[PullSteps]]"),Te=Symbol("[[ReleaseSteps]]");function re(a,u){a._ownerReadableStream=u,u._reader=a,u._state==="readable"?Z(a):u._state==="closed"?ae(a):oe(a,u._storedError)}o(re,"ReadableStreamReaderGenericInitialize");function B(a,u){let y=a._ownerReadableStream;return Er(y,u)}o(B,"ReadableStreamReaderGenericCancel");function q(a){let u=a._ownerReadableStream;u._state==="readable"?Ie(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):$e(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._readableStreamController[Te](),u._reader=void 0,a._ownerReadableStream=void 0}o(q,"ReadableStreamReaderGenericRelease");function Y(a){return new TypeError("Cannot "+a+" a stream using a released reader")}o(Y,"readerLockException");function Z(a){a._closedPromise=p((u,y)=>{a._closedPromise_resolve=u,a._closedPromise_reject=y})}o(Z,"defaultReaderClosedPromiseInitialize");function oe(a,u){Z(a),Ie(a,u)}o(oe,"defaultReaderClosedPromiseInitializeAsRejected");function ae(a){Z(a),Ve(a)}o(ae,"defaultReaderClosedPromiseInitializeAsResolved");function Ie(a,u){a._closedPromise_reject!==void 0&&(b(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ie,"defaultReaderClosedPromiseReject");function $e(a,u){oe(a,u)}o($e,"defaultReaderClosedPromiseResetToRejected");function Ve(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ve,"defaultReaderClosedPromiseResolve");let Ye=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Et=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function ee(a){return typeof a=="object"||typeof a=="function"}o(ee,"isDictionary");function st(a,u){if(a!==void 0&&!ee(a))throw new TypeError(`${u} is not an object.`)}o(st,"assertDictionary");function pt(a,u){if(typeof a!="function")throw new TypeError(`${u} is not a function.`)}o(pt,"assertFunction");function Bt(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(Bt,"isObject");function Be(a,u){if(!Bt(a))throw new TypeError(`${u} is not an object.`)}o(Be,"assertObject");function We(a,u,y){if(a===void 0)throw new TypeError(`Parameter ${u} is required in '${y}'.`)}o(We,"assertRequiredArgument");function S(a,u,y){if(a===void 0)throw new TypeError(`${u} is required in '${y}'.`)}o(S,"assertRequiredField");function w(a){return Number(a)}o(w,"convertUnrestrictedDouble");function x(a){return a===0?0:a}o(x,"censorNegativeZero");function z(a){return x(Et(a))}o(z,"integerPart");function R(a,u){let T=Number.MAX_SAFE_INTEGER,A=Number(a);if(A=x(A),!Ye(A))throw new TypeError(`${u} is not a finite number`);if(A=z(A),A<0||A>T)throw new TypeError(`${u} is outside the accepted range of 0 to ${T}, inclusive`);return!Ye(A)||A===0?0:A}o(R,"convertUnsignedLongLongWithEnforceRange");function $(a,u){if(!wn(a))throw new TypeError(`${u} is not a ReadableStream.`)}o($,"assertReadableStream");function j(a){return new V(a)}o(j,"AcquireReadableStreamDefaultReader");function I(a,u){a._reader._readRequests.push(u)}o(I,"ReadableStreamAddReadRequest");function C(a,u,y){let A=a._reader._readRequests.shift();y?A._closeSteps():A._chunkSteps(u)}o(C,"ReadableStreamFulfillReadRequest");function U(a){return a._reader._readRequests.length}o(U,"ReadableStreamGetNumReadRequests");function N(a){let u=a._reader;return!(u===void 0||!se(u))}o(N,"ReadableStreamHasDefaultReader");class V{static{o(this,"ReadableStreamDefaultReader")}constructor(u){if(We(u,1,"ReadableStreamDefaultReader"),$(u,"First parameter"),xn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");re(this,u),this._readRequests=new W}get closed(){return se(this)?this._closedPromise:_(nt("closed"))}cancel(u=void 0){return se(this)?this._ownerReadableStream===void 0?_(Y("cancel")):B(this,u):_(nt("cancel"))}read(){if(!se(this))return _(nt("read"));if(this._ownerReadableStream===void 0)return _(Y("read from"));let u,y,T=p((M,F)=>{u=M,y=F});return ce(this,{_chunkSteps:o(M=>u({value:M,done:!1}),"_chunkSteps"),_closeSteps:o(()=>u({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(M=>y(M),"_errorSteps")}),T}releaseLock(){if(!se(this))throw nt("releaseLock");this._ownerReadableStream!==void 0&&Me(this)}}Object.defineProperties(V.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(V.prototype.cancel,"cancel"),i(V.prototype.read,"read"),i(V.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(V.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function se(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof V}o(se,"IsReadableStreamDefaultReader");function ce(a,u){let y=a._ownerReadableStream;y._disturbed=!0,y._state==="closed"?u._closeSteps():y._state==="errored"?u._errorSteps(y._storedError):y._readableStreamController[X](u)}o(ce,"ReadableStreamDefaultReaderRead");function Me(a){q(a);let u=new TypeError("Reader was released");tt(a,u)}o(Me,"ReadableStreamDefaultReaderRelease");function tt(a,u){let y=a._readRequests;a._readRequests=new W,y.forEach(T=>{T._errorSteps(u)})}o(tt,"ReadableStreamDefaultReaderErrorReadRequests");function nt(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}o(nt,"defaultReaderBrandCheckException");let Ue=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class qe{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(u,y){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=u,this._preventCancel=y}next(){let u=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?v(this._ongoingPromise,u,u):u(),this._ongoingPromise}return(u){let y=o(()=>this._returnSteps(u),"returnSteps");return this._ongoingPromise?v(this._ongoingPromise,y,y):y()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let u=this._reader,y,T,A=p((F,ie)=>{y=F,T=ie});return ce(u,{_chunkSteps:o(F=>{this._ongoingPromise=void 0,E(()=>y({value:F,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,q(u),y({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(F=>{this._ongoingPromise=void 0,this._isFinished=!0,q(u),T(F)},"_errorSteps")}),A}_returnSteps(u){if(this._isFinished)return Promise.resolve({value:u,done:!0});this._isFinished=!0;let y=this._reader;if(!this._preventCancel){let T=B(y,u);return q(y),v(T,()=>({value:u,done:!0}))}return q(y),h({value:u,done:!0})}}let vt={next(){return Po(this)?this._asyncIteratorImpl.next():_(To("next"))},return(a){return Po(this)?this._asyncIteratorImpl.return(a):_(To("return"))}};Object.setPrototypeOf(vt,Ue);function So(a,u){let y=j(a),T=new qe(y,u),A=Object.create(vt);return A._asyncIteratorImpl=T,A}o(So,"AcquireReadableStreamAsyncIterator");function Po(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof qe}catch{return!1}}o(Po,"IsReadableStreamAsyncIterator");function To(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}o(To,"streamAsyncIteratorBrandCheckException");let Vt=Number.isNaN||function(a){return a!==a};var Xr,It,_t;function Ze(a){return a.slice()}o(Ze,"CreateArrayFromList");function Mm(a,u,y,T,A){new Uint8Array(a).set(new Uint8Array(y,T,A),u)}o(Mm,"CopyDataBlockBytes");let Qr=o(a=>(typeof a.transfer=="function"?Qr=o(u=>u.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?Qr=o(u=>structuredClone(u,{transfer:[u]}),"TransferArrayBuffer"):Qr=o(u=>u,"TransferArrayBuffer"),Qr(a)),"TransferArrayBuffer"),En=o(a=>(typeof a.detached=="boolean"?En=o(u=>u.detached,"IsDetachedBuffer"):En=o(u=>u.byteLength===0,"IsDetachedBuffer"),En(a)),"IsDetachedBuffer");function jm(a,u,y){if(a.slice)return a.slice(u,y);let T=y-u,A=new ArrayBuffer(T);return Mm(A,0,a,u,T),A}o(jm,"ArrayBufferSlice");function Xa(a,u){let y=a[u];if(y!=null){if(typeof y!="function")throw new TypeError(`${String(u)} is not a function`);return y}}o(Xa,"GetMethod");function Zw(a){let u={[Symbol.iterator]:()=>a.iterator},y=async function*(){return yield*u}(),T=y.next;return{iterator:y,nextMethod:T,done:!1}}o(Zw,"CreateAsyncFromSyncIterator");let Kc=(_t=(Xr=Symbol.asyncIterator)!==null&&Xr!==void 0?Xr:(It=Symbol.for)===null||It===void 0?void 0:It.call(Symbol,"Symbol.asyncIterator"))!==null&&_t!==void 0?_t:"@@asyncIterator";function Lm(a,u="sync",y){if(y===void 0)if(u==="async"){if(y=Xa(a,Kc),y===void 0){let M=Xa(a,Symbol.iterator),F=Lm(a,"sync",M);return Zw(F)}}else y=Xa(a,Symbol.iterator);if(y===void 0)throw new TypeError("The object is not iterable");let T=k(y,a,[]);if(!r(T))throw new TypeError("The iterator method must return an object");let A=T.next;return{iterator:T,nextMethod:A,done:!1}}o(Lm,"GetIterator");function Kw(a){let u=k(a.nextMethod,a.iterator,[]);if(!r(u))throw new TypeError("The iterator.next() method must return an object");return u}o(Kw,"IteratorNext");function Jw(a){return!!a.done}o(Jw,"IteratorComplete");function Yw(a){return a.value}o(Yw,"IteratorValue");function Xw(a){return!(typeof a!="number"||Vt(a)||a<0)}o(Xw,"IsNonNegativeNumber");function Fm(a){let u=jm(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(u)}o(Fm,"CloneAsUint8Array");function Jc(a){let u=a._queue.shift();return a._queueTotalSize-=u.size,a._queueTotalSize<0&&(a._queueTotalSize=0),u.value}o(Jc,"DequeueValue");function Yc(a,u,y){if(!Xw(y)||y===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:u,size:y}),a._queueTotalSize+=y}o(Yc,"EnqueueValueWithSize");function Qw(a){return a._queue.peek().value}o(Qw,"PeekQueueValue");function Sn(a){a._queue=new W,a._queueTotalSize=0}o(Sn,"ResetQueue");function qm(a){return a===DataView}o(qm,"isDataViewConstructor");function ex(a){return qm(a.constructor)}o(ex,"isDataView");function tx(a){return qm(a)?1:a.BYTES_PER_ELEMENT}o(tx,"arrayBufferViewElementSize");class Kn{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Xc(this))throw nl("view");return this._view}respond(u){if(!Xc(this))throw nl("respond");if(We(u,1,"respond"),u=R(u,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(En(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");rs(this._associatedReadableByteStreamController,u)}respondWithNewView(u){if(!Xc(this))throw nl("respondWithNewView");if(We(u,1,"respondWithNewView"),!ArrayBuffer.isView(u))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(En(u.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");ns(this._associatedReadableByteStreamController,u)}}Object.defineProperties(Kn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(Kn.prototype.respond,"respond"),i(Kn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Kn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class en{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Jn(this))throw Ai("byobRequest");return rl(this)}get desiredSize(){if(!Jn(this))throw Ai("desiredSize");return Xm(this)}close(){if(!Jn(this))throw Ai("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let u=this._controlledReadableByteStream._state;if(u!=="readable")throw new TypeError(`The stream (in ${u} state) is not in the readable state and cannot be closed`);xi(this)}enqueue(u){if(!Jn(this))throw Ai("enqueue");if(We(u,1,"enqueue"),!ArrayBuffer.isView(u))throw new TypeError("chunk must be an array buffer view");if(u.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(u.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let y=this._controlledReadableByteStream._state;if(y!=="readable")throw new TypeError(`The stream (in ${y} state) is not in the readable state and cannot be enqueued to`);ts(this,u)}error(u=void 0){if(!Jn(this))throw Ai("error");ar(this,u)}[te](u){Bm(this),Sn(this);let y=this._cancelAlgorithm(u);return es(this),y}[X](u){let y=this._controlledReadableByteStream;if(this._queueTotalSize>0){Ym(this,u);return}let T=this._autoAllocateChunkSize;if(T!==void 0){let A;try{A=new ArrayBuffer(T)}catch(F){u._errorSteps(F);return}let M={buffer:A,bufferByteLength:T,byteOffset:0,byteLength:T,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(M)}I(y,u),Yn(this)}[Te](){if(this._pendingPullIntos.length>0){let u=this._pendingPullIntos.peek();u.readerType="none",this._pendingPullIntos=new W,this._pendingPullIntos.push(u)}}}Object.defineProperties(en.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(en.prototype.close,"close"),i(en.prototype.enqueue,"enqueue"),i(en.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(en.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Jn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof en}o(Jn,"IsReadableByteStreamController");function Xc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof Kn}o(Xc,"IsReadableStreamBYOBRequest");function Yn(a){if(!ax(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let y=a._pullAlgorithm();f(y,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,Yn(a)),null),T=>(ar(a,T),null))}o(Yn,"ReadableByteStreamControllerCallPullIfNeeded");function Bm(a){el(a),a._pendingPullIntos=new W}o(Bm,"ReadableByteStreamControllerClearPendingPullIntos");function Qc(a,u){let y=!1;a._state==="closed"&&(y=!0);let T=Vm(u);u.readerType==="default"?C(a,T,y):px(a,T,y)}o(Qc,"ReadableByteStreamControllerCommitPullIntoDescriptor");function Vm(a){let u=a.bytesFilled,y=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,u/y)}o(Vm,"ReadableByteStreamControllerConvertPullIntoDescriptor");function Qa(a,u,y,T){a._queue.push({buffer:u,byteOffset:y,byteLength:T}),a._queueTotalSize+=T}o(Qa,"ReadableByteStreamControllerEnqueueChunkToQueue");function Gm(a,u,y,T){let A;try{A=jm(u,y,y+T)}catch(M){throw ar(a,M),M}Qa(a,A,0,T)}o(Gm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Hm(a,u){u.bytesFilled>0&&Gm(a,u.buffer,u.byteOffset,u.bytesFilled),wo(a)}o(Hm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function Wm(a,u){let y=Math.min(a._queueTotalSize,u.byteLength-u.bytesFilled),T=u.bytesFilled+y,A=y,M=!1,F=T%u.elementSize,ie=T-F;ie>=u.minimumFill&&(A=ie-u.bytesFilled,M=!0);let ye=a._queue;for(;A>0;){let pe=ye.peek(),we=Math.min(A,pe.byteLength),ke=u.byteOffset+u.bytesFilled;Mm(u.buffer,ke,pe.buffer,pe.byteOffset,we),pe.byteLength===we?ye.shift():(pe.byteOffset+=we,pe.byteLength-=we),a._queueTotalSize-=we,Zm(a,we,u),A-=we}return M}o(Wm,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function Zm(a,u,y){y.bytesFilled+=u}o(Zm,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function Km(a){a._queueTotalSize===0&&a._closeRequested?(es(a),ki(a._controlledReadableByteStream)):Yn(a)}o(Km,"ReadableByteStreamControllerHandleQueueDrain");function el(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}o(el,"ReadableByteStreamControllerInvalidateBYOBRequest");function tl(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let u=a._pendingPullIntos.peek();Wm(a,u)&&(wo(a),Qc(a._controlledReadableByteStream,u))}}o(tl,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function rx(a){let u=a._controlledReadableByteStream._reader;for(;u._readRequests.length>0;){if(a._queueTotalSize===0)return;let y=u._readRequests.shift();Ym(a,y)}}o(rx,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function nx(a,u,y,T){let A=a._controlledReadableByteStream,M=u.constructor,F=tx(M),{byteOffset:ie,byteLength:ye}=u,pe=y*F,we;try{we=Qr(u.buffer)}catch(Xe){T._errorSteps(Xe);return}let ke={buffer:we,bufferByteLength:we.byteLength,byteOffset:ie,byteLength:ye,bytesFilled:0,minimumFill:pe,elementSize:F,viewConstructor:M,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(ke),th(A,T);return}if(A._state==="closed"){let Xe=new M(ke.buffer,ke.byteOffset,0);T._closeSteps(Xe);return}if(a._queueTotalSize>0){if(Wm(a,ke)){let Xe=Vm(ke);Km(a),T._chunkSteps(Xe);return}if(a._closeRequested){let Xe=new TypeError("Insufficient bytes to fill elements in the given buffer");ar(a,Xe),T._errorSteps(Xe);return}}a._pendingPullIntos.push(ke),th(A,T),Yn(a)}o(nx,"ReadableByteStreamControllerPullInto");function ox(a,u){u.readerType==="none"&&wo(a);let y=a._controlledReadableByteStream;if(ol(y))for(;rh(y)>0;){let T=wo(a);Qc(y,T)}}o(ox,"ReadableByteStreamControllerRespondInClosedState");function ix(a,u,y){if(Zm(a,u,y),y.readerType==="none"){Hm(a,y),tl(a);return}if(y.bytesFilled<y.minimumFill)return;wo(a);let T=y.bytesFilled%y.elementSize;if(T>0){let A=y.byteOffset+y.bytesFilled;Gm(a,y.buffer,A-T,T)}y.bytesFilled-=T,Qc(a._controlledReadableByteStream,y),tl(a)}o(ix,"ReadableByteStreamControllerRespondInReadableState");function Jm(a,u){let y=a._pendingPullIntos.peek();el(a),a._controlledReadableByteStream._state==="closed"?ox(a,y):ix(a,u,y),Yn(a)}o(Jm,"ReadableByteStreamControllerRespondInternal");function wo(a){return a._pendingPullIntos.shift()}o(wo,"ReadableByteStreamControllerShiftPendingPullInto");function ax(a){let u=a._controlledReadableByteStream;return u._state!=="readable"||a._closeRequested||!a._started?!1:!!(N(u)&&U(u)>0||ol(u)&&rh(u)>0||Xm(a)>0)}o(ax,"ReadableByteStreamControllerShouldCallPull");function es(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}o(es,"ReadableByteStreamControllerClearAlgorithms");function xi(a){let u=a._controlledReadableByteStream;if(!(a._closeRequested||u._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let y=a._pendingPullIntos.peek();if(y.bytesFilled%y.elementSize!==0){let T=new TypeError("Insufficient bytes to fill elements in the given buffer");throw ar(a,T),T}}es(a),ki(u)}}o(xi,"ReadableByteStreamControllerClose");function ts(a,u){let y=a._controlledReadableByteStream;if(a._closeRequested||y._state!=="readable")return;let{buffer:T,byteOffset:A,byteLength:M}=u;if(En(T))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let F=Qr(T);if(a._pendingPullIntos.length>0){let ie=a._pendingPullIntos.peek();if(En(ie.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");el(a),ie.buffer=Qr(ie.buffer),ie.readerType==="none"&&Hm(a,ie)}if(N(y))if(rx(a),U(y)===0)Qa(a,F,A,M);else{a._pendingPullIntos.length>0&&wo(a);let ie=new Uint8Array(F,A,M);C(y,ie,!1)}else ol(y)?(Qa(a,F,A,M),tl(a)):Qa(a,F,A,M);Yn(a)}o(ts,"ReadableByteStreamControllerEnqueue");function ar(a,u){let y=a._controlledReadableByteStream;y._state==="readable"&&(Bm(a),Sn(a),es(a),xh(y,u))}o(ar,"ReadableByteStreamControllerError");function Ym(a,u){let y=a._queue.shift();a._queueTotalSize-=y.byteLength,Km(a);let T=new Uint8Array(y.buffer,y.byteOffset,y.byteLength);u._chunkSteps(T)}o(Ym,"ReadableByteStreamControllerFillReadRequestFromQueue");function rl(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let u=a._pendingPullIntos.peek(),y=new Uint8Array(u.buffer,u.byteOffset+u.bytesFilled,u.byteLength-u.bytesFilled),T=Object.create(Kn.prototype);ux(T,a,y),a._byobRequest=T}return a._byobRequest}o(rl,"ReadableByteStreamControllerGetBYOBRequest");function Xm(a){let u=a._controlledReadableByteStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(Xm,"ReadableByteStreamControllerGetDesiredSize");function rs(a,u){let y=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(u===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(y.bytesFilled+u>y.byteLength)throw new RangeError("bytesWritten out of range")}y.buffer=Qr(y.buffer),Jm(a,u)}o(rs,"ReadableByteStreamControllerRespond");function ns(a,u){let y=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(u.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(y.byteOffset+y.bytesFilled!==u.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(y.bufferByteLength!==u.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(y.bytesFilled+u.byteLength>y.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let A=u.byteLength;y.buffer=Qr(u.buffer),Jm(a,A)}o(ns,"ReadableByteStreamControllerRespondWithNewView");function Qm(a,u,y,T,A,M,F){u._controlledReadableByteStream=a,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,Sn(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=M,u._pullAlgorithm=T,u._cancelAlgorithm=A,u._autoAllocateChunkSize=F,u._pendingPullIntos=new W,a._readableStreamController=u;let ie=y();f(h(ie),()=>(u._started=!0,Yn(u),null),ye=>(ar(u,ye),null))}o(Qm,"SetUpReadableByteStreamController");function sx(a,u,y){let T=Object.create(en.prototype),A,M,F;u.start!==void 0?A=o(()=>u.start(T),"startAlgorithm"):A=o(()=>{},"startAlgorithm"),u.pull!==void 0?M=o(()=>u.pull(T),"pullAlgorithm"):M=o(()=>h(void 0),"pullAlgorithm"),u.cancel!==void 0?F=o(ye=>u.cancel(ye),"cancelAlgorithm"):F=o(()=>h(void 0),"cancelAlgorithm");let ie=u.autoAllocateChunkSize;if(ie===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Qm(a,T,A,M,F,y,ie)}o(sx,"SetUpReadableByteStreamControllerFromUnderlyingSource");function ux(a,u,y){a._associatedReadableByteStreamController=u,a._view=y}o(ux,"SetUpReadableStreamBYOBRequest");function nl(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}o(nl,"byobRequestBrandCheckException");function Ai(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}o(Ai,"byteStreamControllerBrandCheckException");function cx(a,u){st(a,u);let y=a?.mode;return{mode:y===void 0?void 0:lx(y,`${u} has member 'mode' that`)}}o(cx,"convertReaderOptions");function lx(a,u){if(a=`${a}`,a!=="byob")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}o(lx,"convertReadableStreamReaderMode");function dx(a,u){var y;st(a,u);let T=(y=a?.min)!==null&&y!==void 0?y:1;return{min:R(T,`${u} has member 'min' that`)}}o(dx,"convertByobReadOptions");function eh(a){return new Pn(a)}o(eh,"AcquireReadableStreamBYOBReader");function th(a,u){a._reader._readIntoRequests.push(u)}o(th,"ReadableStreamAddReadIntoRequest");function px(a,u,y){let A=a._reader._readIntoRequests.shift();y?A._closeSteps(u):A._chunkSteps(u)}o(px,"ReadableStreamFulfillReadIntoRequest");function rh(a){return a._reader._readIntoRequests.length}o(rh,"ReadableStreamGetNumReadIntoRequests");function ol(a){let u=a._reader;return!(u===void 0||!Xn(u))}o(ol,"ReadableStreamHasBYOBReader");class Pn{static{o(this,"ReadableStreamBYOBReader")}constructor(u){if(We(u,1,"ReadableStreamBYOBReader"),$(u,"First parameter"),xn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Jn(u._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");re(this,u),this._readIntoRequests=new W}get closed(){return Xn(this)?this._closedPromise:_(os("closed"))}cancel(u=void 0){return Xn(this)?this._ownerReadableStream===void 0?_(Y("cancel")):B(this,u):_(os("cancel"))}read(u,y={}){if(!Xn(this))return _(os("read"));if(!ArrayBuffer.isView(u))return _(new TypeError("view must be an array buffer view"));if(u.byteLength===0)return _(new TypeError("view must have non-zero byteLength"));if(u.buffer.byteLength===0)return _(new TypeError("view's buffer must have non-zero byteLength"));if(En(u.buffer))return _(new TypeError("view's buffer has been detached"));let T;try{T=dx(y,"options")}catch(pe){return _(pe)}let A=T.min;if(A===0)return _(new TypeError("options.min must be greater than 0"));if(ex(u)){if(A>u.byteLength)return _(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(A>u.length)return _(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return _(Y("read from"));let M,F,ie=p((pe,we)=>{M=pe,F=we});return nh(this,u,A,{_chunkSteps:o(pe=>M({value:pe,done:!1}),"_chunkSteps"),_closeSteps:o(pe=>M({value:pe,done:!0}),"_closeSteps"),_errorSteps:o(pe=>F(pe),"_errorSteps")}),ie}releaseLock(){if(!Xn(this))throw os("releaseLock");this._ownerReadableStream!==void 0&&fx(this)}}Object.defineProperties(Pn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(Pn.prototype.cancel,"cancel"),i(Pn.prototype.read,"read"),i(Pn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Pn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Xn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof Pn}o(Xn,"IsReadableStreamBYOBReader");function nh(a,u,y,T){let A=a._ownerReadableStream;A._disturbed=!0,A._state==="errored"?T._errorSteps(A._storedError):nx(A._readableStreamController,u,y,T)}o(nh,"ReadableStreamBYOBReaderRead");function fx(a){q(a);let u=new TypeError("Reader was released");oh(a,u)}o(fx,"ReadableStreamBYOBReaderRelease");function oh(a,u){let y=a._readIntoRequests;a._readIntoRequests=new W,y.forEach(T=>{T._errorSteps(u)})}o(oh,"ReadableStreamBYOBReaderErrorReadIntoRequests");function os(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}o(os,"byobReaderBrandCheckException");function Ii(a,u){let{highWaterMark:y}=a;if(y===void 0)return u;if(Vt(y)||y<0)throw new RangeError("Invalid highWaterMark");return y}o(Ii,"ExtractHighWaterMark");function is(a){let{size:u}=a;return u||(()=>1)}o(is,"ExtractSizeAlgorithm");function as(a,u){st(a,u);let y=a?.highWaterMark,T=a?.size;return{highWaterMark:y===void 0?void 0:w(y),size:T===void 0?void 0:mx(T,`${u} has member 'size' that`)}}o(as,"convertQueuingStrategy");function mx(a,u){return pt(a,u),y=>w(a(y))}o(mx,"convertQueuingStrategySize");function hx(a,u){st(a,u);let y=a?.abort,T=a?.close,A=a?.start,M=a?.type,F=a?.write;return{abort:y===void 0?void 0:gx(y,a,`${u} has member 'abort' that`),close:T===void 0?void 0:yx(T,a,`${u} has member 'close' that`),start:A===void 0?void 0:vx(A,a,`${u} has member 'start' that`),write:F===void 0?void 0:_x(F,a,`${u} has member 'write' that`),type:M}}o(hx,"convertUnderlyingSink");function gx(a,u,y){return pt(a,y),T=>L(a,u,[T])}o(gx,"convertUnderlyingSinkAbortCallback");function yx(a,u,y){return pt(a,y),()=>L(a,u,[])}o(yx,"convertUnderlyingSinkCloseCallback");function vx(a,u,y){return pt(a,y),T=>k(a,u,[T])}o(vx,"convertUnderlyingSinkStartCallback");function _x(a,u,y){return pt(a,y),(T,A)=>L(a,u,[T,A])}o(_x,"convertUnderlyingSinkWriteCallback");function ih(a,u){if(!xo(a))throw new TypeError(`${u} is not a WritableStream.`)}o(ih,"assertWritableStream");function bx(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}o(bx,"isAbortSignal");let Ex=typeof AbortController=="function";function Sx(){if(Ex)return new AbortController}o(Sx,"createAbortController");class Tn{static{o(this,"WritableStream")}constructor(u={},y={}){u===void 0?u=null:Be(u,"First parameter");let T=as(y,"Second parameter"),A=hx(u,"First parameter");if(sh(this),A.type!==void 0)throw new RangeError("Invalid type is specified");let F=is(T),ie=Ii(T,1);zx(this,A,ie,F)}get locked(){if(!xo(this))throw ds("locked");return Ao(this)}abort(u=void 0){return xo(this)?Ao(this)?_(new TypeError("Cannot abort a stream that already has a writer")):ss(this,u):_(ds("abort"))}close(){return xo(this)?Ao(this)?_(new TypeError("Cannot close a stream that already has a writer")):Dr(this)?_(new TypeError("Cannot close an already-closing stream")):uh(this):_(ds("close"))}getWriter(){if(!xo(this))throw ds("getWriter");return ah(this)}}Object.defineProperties(Tn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(Tn.prototype.abort,"abort"),i(Tn.prototype.close,"close"),i(Tn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Tn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function ah(a){return new tn(a)}o(ah,"AcquireWritableStreamDefaultWriter");function Px(a,u,y,T,A=1,M=()=>1){let F=Object.create(Tn.prototype);sh(F);let ie=Object.create(Io.prototype);return mh(F,ie,a,u,y,T,A,M),F}o(Px,"CreateWritableStream");function sh(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new W,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}o(sh,"InitializeWritableStream");function xo(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof Tn}o(xo,"IsWritableStream");function Ao(a){return a._writer!==void 0}o(Ao,"IsWritableStreamLocked");function ss(a,u){var y;if(a._state==="closed"||a._state==="errored")return h(void 0);a._writableStreamController._abortReason=u,(y=a._writableStreamController._abortController)===null||y===void 0||y.abort(u);let T=a._state;if(T==="closed"||T==="errored")return h(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let A=!1;T==="erroring"&&(A=!0,u=void 0);let M=p((F,ie)=>{a._pendingAbortRequest={_promise:void 0,_resolve:F,_reject:ie,_reason:u,_wasAlreadyErroring:A}});return a._pendingAbortRequest._promise=M,A||al(a,u),M}o(ss,"WritableStreamAbort");function uh(a){let u=a._state;if(u==="closed"||u==="errored")return _(new TypeError(`The stream (in ${u} state) is not in the writable state and cannot be closed`));let y=p((A,M)=>{let F={_resolve:A,_reject:M};a._closeRequest=F}),T=a._writer;return T!==void 0&&a._backpressure&&u==="writable"&&ml(T),Ux(a._writableStreamController),y}o(uh,"WritableStreamClose");function Tx(a){return p((y,T)=>{let A={_resolve:y,_reject:T};a._writeRequests.push(A)})}o(Tx,"WritableStreamAddWriteRequest");function il(a,u){if(a._state==="writable"){al(a,u);return}sl(a)}o(il,"WritableStreamDealWithRejection");function al(a,u){let y=a._writableStreamController;a._state="erroring",a._storedError=u;let T=a._writer;T!==void 0&&lh(T,u),!Rx(a)&&y._started&&sl(a)}o(al,"WritableStreamStartErroring");function sl(a){a._state="errored",a._writableStreamController[K]();let u=a._storedError;if(a._writeRequests.forEach(A=>{A._reject(u)}),a._writeRequests=new W,a._pendingAbortRequest===void 0){us(a);return}let y=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,y._wasAlreadyErroring){y._reject(u),us(a);return}let T=a._writableStreamController[G](y._reason);f(T,()=>(y._resolve(),us(a),null),A=>(y._reject(A),us(a),null))}o(sl,"WritableStreamFinishErroring");function wx(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}o(wx,"WritableStreamFinishInFlightWrite");function xx(a,u){a._inFlightWriteRequest._reject(u),a._inFlightWriteRequest=void 0,il(a,u)}o(xx,"WritableStreamFinishInFlightWriteWithError");function Ax(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 y=a._writer;y!==void 0&&vh(y)}o(Ax,"WritableStreamFinishInFlightClose");function Ix(a,u){a._inFlightCloseRequest._reject(u),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(u),a._pendingAbortRequest=void 0),il(a,u)}o(Ix,"WritableStreamFinishInFlightCloseWithError");function Dr(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Dr,"WritableStreamCloseQueuedOrInFlight");function Rx(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Rx,"WritableStreamHasOperationMarkedInFlight");function Cx(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}o(Cx,"WritableStreamMarkCloseRequestInFlight");function Ox(a){a._inFlightWriteRequest=a._writeRequests.shift()}o(Ox,"WritableStreamMarkFirstWriteRequestInFlight");function us(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let u=a._writer;u!==void 0&&pl(u,a._storedError)}o(us,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function ul(a,u){let y=a._writer;y!==void 0&&u!==a._backpressure&&(u?Vx(y):ml(y)),a._backpressure=u}o(ul,"WritableStreamUpdateBackpressure");class tn{static{o(this,"WritableStreamDefaultWriter")}constructor(u){if(We(u,1,"WritableStreamDefaultWriter"),ih(u,"First parameter"),Ao(u))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=u,u._writer=this;let y=u._state;if(y==="writable")!Dr(u)&&u._backpressure?fs(this):_h(this),ps(this);else if(y==="erroring")fl(this,u._storedError),ps(this);else if(y==="closed")_h(this),qx(this);else{let T=u._storedError;fl(this,T),yh(this,T)}}get closed(){return Qn(this)?this._closedPromise:_(eo("closed"))}get desiredSize(){if(!Qn(this))throw eo("desiredSize");if(this._ownerWritableStream===void 0)throw Ci("desiredSize");return Nx(this)}get ready(){return Qn(this)?this._readyPromise:_(eo("ready"))}abort(u=void 0){return Qn(this)?this._ownerWritableStream===void 0?_(Ci("abort")):$x(this,u):_(eo("abort"))}close(){if(!Qn(this))return _(eo("close"));let u=this._ownerWritableStream;return u===void 0?_(Ci("close")):Dr(u)?_(new TypeError("Cannot close an already-closing stream")):ch(this)}releaseLock(){if(!Qn(this))throw eo("releaseLock");this._ownerWritableStream!==void 0&&dh(this)}write(u=void 0){return Qn(this)?this._ownerWritableStream===void 0?_(Ci("write to")):ph(this,u):_(eo("write"))}}Object.defineProperties(tn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(tn.prototype.abort,"abort"),i(tn.prototype.close,"close"),i(tn.prototype.releaseLock,"releaseLock"),i(tn.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(tn.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Qn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof tn}o(Qn,"IsWritableStreamDefaultWriter");function $x(a,u){let y=a._ownerWritableStream;return ss(y,u)}o($x,"WritableStreamDefaultWriterAbort");function ch(a){let u=a._ownerWritableStream;return uh(u)}o(ch,"WritableStreamDefaultWriterClose");function kx(a){let u=a._ownerWritableStream,y=u._state;return Dr(u)||y==="closed"?h(void 0):y==="errored"?_(u._storedError):ch(a)}o(kx,"WritableStreamDefaultWriterCloseWithErrorPropagation");function Dx(a,u){a._closedPromiseState==="pending"?pl(a,u):Bx(a,u)}o(Dx,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function lh(a,u){a._readyPromiseState==="pending"?bh(a,u):Gx(a,u)}o(lh,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function Nx(a){let u=a._ownerWritableStream,y=u._state;return y==="errored"||y==="erroring"?null:y==="closed"?0:hh(u._writableStreamController)}o(Nx,"WritableStreamDefaultWriterGetDesiredSize");function dh(a){let u=a._ownerWritableStream,y=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");lh(a,y),Dx(a,y),u._writer=void 0,a._ownerWritableStream=void 0}o(dh,"WritableStreamDefaultWriterRelease");function ph(a,u){let y=a._ownerWritableStream,T=y._writableStreamController,A=Mx(T,u);if(y!==a._ownerWritableStream)return _(Ci("write to"));let M=y._state;if(M==="errored")return _(y._storedError);if(Dr(y)||M==="closed")return _(new TypeError("The stream is closing or closed and cannot be written to"));if(M==="erroring")return _(y._storedError);let F=Tx(y);return jx(T,u,A),F}o(ph,"WritableStreamDefaultWriterWrite");let fh={};class Io{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!cl(this))throw dl("abortReason");return this._abortReason}get signal(){if(!cl(this))throw dl("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(u=void 0){if(!cl(this))throw dl("error");this._controlledWritableStream._state==="writable"&&gh(this,u)}[G](u){let y=this._abortAlgorithm(u);return cs(this),y}[K](){Sn(this)}}Object.defineProperties(Io.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Io.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function cl(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Io}o(cl,"IsWritableStreamDefaultController");function mh(a,u,y,T,A,M,F,ie){u._controlledWritableStream=a,a._writableStreamController=u,u._queue=void 0,u._queueTotalSize=void 0,Sn(u),u._abortReason=void 0,u._abortController=Sx(),u._started=!1,u._strategySizeAlgorithm=ie,u._strategyHWM=F,u._writeAlgorithm=T,u._closeAlgorithm=A,u._abortAlgorithm=M;let ye=ll(u);ul(a,ye);let pe=y(),we=h(pe);f(we,()=>(u._started=!0,ls(u),null),ke=>(u._started=!0,il(a,ke),null))}o(mh,"SetUpWritableStreamDefaultController");function zx(a,u,y,T){let A=Object.create(Io.prototype),M,F,ie,ye;u.start!==void 0?M=o(()=>u.start(A),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.write!==void 0?F=o(pe=>u.write(pe,A),"writeAlgorithm"):F=o(()=>h(void 0),"writeAlgorithm"),u.close!==void 0?ie=o(()=>u.close(),"closeAlgorithm"):ie=o(()=>h(void 0),"closeAlgorithm"),u.abort!==void 0?ye=o(pe=>u.abort(pe),"abortAlgorithm"):ye=o(()=>h(void 0),"abortAlgorithm"),mh(a,A,M,F,ie,ye,y,T)}o(zx,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function cs(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(cs,"WritableStreamDefaultControllerClearAlgorithms");function Ux(a){Yc(a,fh,0),ls(a)}o(Ux,"WritableStreamDefaultControllerClose");function Mx(a,u){try{return a._strategySizeAlgorithm(u)}catch(y){return Ri(a,y),1}}o(Mx,"WritableStreamDefaultControllerGetChunkSize");function hh(a){return a._strategyHWM-a._queueTotalSize}o(hh,"WritableStreamDefaultControllerGetDesiredSize");function jx(a,u,y){try{Yc(a,u,y)}catch(A){Ri(a,A);return}let T=a._controlledWritableStream;if(!Dr(T)&&T._state==="writable"){let A=ll(a);ul(T,A)}ls(a)}o(jx,"WritableStreamDefaultControllerWrite");function ls(a){let u=a._controlledWritableStream;if(!a._started||u._inFlightWriteRequest!==void 0)return;if(u._state==="erroring"){sl(u);return}if(a._queue.length===0)return;let T=Qw(a);T===fh?Lx(a):Fx(a,T)}o(ls,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Ri(a,u){a._controlledWritableStream._state==="writable"&&gh(a,u)}o(Ri,"WritableStreamDefaultControllerErrorIfNeeded");function Lx(a){let u=a._controlledWritableStream;Cx(u),Jc(a);let y=a._closeAlgorithm();cs(a),f(y,()=>(Ax(u),null),T=>(Ix(u,T),null))}o(Lx,"WritableStreamDefaultControllerProcessClose");function Fx(a,u){let y=a._controlledWritableStream;Ox(y);let T=a._writeAlgorithm(u);f(T,()=>{wx(y);let A=y._state;if(Jc(a),!Dr(y)&&A==="writable"){let M=ll(a);ul(y,M)}return ls(a),null},A=>(y._state==="writable"&&cs(a),xx(y,A),null))}o(Fx,"WritableStreamDefaultControllerProcessWrite");function ll(a){return hh(a)<=0}o(ll,"WritableStreamDefaultControllerGetBackpressure");function gh(a,u){let y=a._controlledWritableStream;cs(a),al(y,u)}o(gh,"WritableStreamDefaultControllerError");function ds(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}o(ds,"streamBrandCheckException$2");function dl(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}o(dl,"defaultControllerBrandCheckException$2");function eo(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}o(eo,"defaultWriterBrandCheckException");function Ci(a){return new TypeError("Cannot "+a+" a stream using a released writer")}o(Ci,"defaultWriterLockException");function ps(a){a._closedPromise=p((u,y)=>{a._closedPromise_resolve=u,a._closedPromise_reject=y,a._closedPromiseState="pending"})}o(ps,"defaultWriterClosedPromiseInitialize");function yh(a,u){ps(a),pl(a,u)}o(yh,"defaultWriterClosedPromiseInitializeAsRejected");function qx(a){ps(a),vh(a)}o(qx,"defaultWriterClosedPromiseInitializeAsResolved");function pl(a,u){a._closedPromise_reject!==void 0&&(b(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}o(pl,"defaultWriterClosedPromiseReject");function Bx(a,u){yh(a,u)}o(Bx,"defaultWriterClosedPromiseResetToRejected");function vh(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="resolved")}o(vh,"defaultWriterClosedPromiseResolve");function fs(a){a._readyPromise=p((u,y)=>{a._readyPromise_resolve=u,a._readyPromise_reject=y}),a._readyPromiseState="pending"}o(fs,"defaultWriterReadyPromiseInitialize");function fl(a,u){fs(a),bh(a,u)}o(fl,"defaultWriterReadyPromiseInitializeAsRejected");function _h(a){fs(a),ml(a)}o(_h,"defaultWriterReadyPromiseInitializeAsResolved");function bh(a,u){a._readyPromise_reject!==void 0&&(b(a._readyPromise),a._readyPromise_reject(u),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}o(bh,"defaultWriterReadyPromiseReject");function Vx(a){fs(a)}o(Vx,"defaultWriterReadyPromiseReset");function Gx(a,u){fl(a,u)}o(Gx,"defaultWriterReadyPromiseResetToRejected");function ml(a){a._readyPromise_resolve!==void 0&&(a._readyPromise_resolve(void 0),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="fulfilled")}o(ml,"defaultWriterReadyPromiseResolve");function Hx(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(Hx,"getGlobals");let hl=Hx();function Wx(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}o(Wx,"isDOMExceptionConstructor");function Zx(){let a=hl?.DOMException;return Wx(a)?a:void 0}o(Zx,"getFromGlobal");function Kx(){let a=o(function(y,T){this.message=y||"",this.name=T||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return i(a,"DOMException"),a.prototype=Object.create(Error.prototype),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,configurable:!0}),a}o(Kx,"createPolyfill");let Jx=Zx()||Kx();function Eh(a,u,y,T,A,M){let F=j(a),ie=ah(u);a._disturbed=!0;let ye=!1,pe=h(void 0);return p((we,ke)=>{let Xe;if(M!==void 0){if(Xe=o(()=>{let me=M.reason!==void 0?M.reason:new Jx("Aborted","AbortError"),ze=[];T||ze.push(()=>u._state==="writable"?ss(u,me):h(void 0)),A||ze.push(()=>a._state==="readable"?Er(a,me):h(void 0)),Nt(()=>Promise.all(ze.map(Qe=>Qe())),!0,me)},"abortAlgorithm"),M.aborted){Xe();return}M.addEventListener("abort",Xe)}function Sr(){return p((me,ze)=>{function Qe(Gt){Gt?me():m($o(),Qe,ze)}o(Qe,"next"),Qe(!1)})}o(Sr,"pipeLoop");function $o(){return ye?h(!0):m(ie._readyPromise,()=>p((me,ze)=>{ce(F,{_chunkSteps:o(Qe=>{pe=m(ph(ie,Qe),void 0,e),me(!1)},"_chunkSteps"),_closeSteps:o(()=>me(!0),"_closeSteps"),_errorSteps:ze})}))}if(o($o,"pipeStep"),nn(a,F._closedPromise,me=>(T?sr(!0,me):Nt(()=>ss(u,me),!0,me),null)),nn(u,ie._closedPromise,me=>(A?sr(!0,me):Nt(()=>Er(a,me),!0,me),null)),Ot(a,F._closedPromise,()=>(y?sr():Nt(()=>kx(ie)),null)),Dr(u)||u._state==="closed"){let me=new TypeError("the destination writable stream closed before all data could be piped to it");A?sr(!0,me):Nt(()=>Er(a,me),!0,me)}b(Sr());function In(){let me=pe;return m(pe,()=>me!==pe?In():void 0)}o(In,"waitForWritesToFinish");function nn(me,ze,Qe){me._state==="errored"?Qe(me._storedError):g(ze,Qe)}o(nn,"isOrBecomesErrored");function Ot(me,ze,Qe){me._state==="closed"?Qe():l(ze,Qe)}o(Ot,"isOrBecomesClosed");function Nt(me,ze,Qe){if(ye)return;ye=!0,u._state==="writable"&&!Dr(u)?l(In(),Gt):Gt();function Gt(){return f(me(),()=>on(ze,Qe),ko=>on(!0,ko)),null}o(Gt,"doTheRest")}o(Nt,"shutdownWithAction");function sr(me,ze){ye||(ye=!0,u._state==="writable"&&!Dr(u)?l(In(),()=>on(me,ze)):on(me,ze))}o(sr,"shutdown");function on(me,ze){return dh(ie),q(F),M!==void 0&&M.removeEventListener("abort",Xe),me?ke(ze):we(void 0),null}o(on,"finalize")})}o(Eh,"ReadableStreamPipeTo");class rn{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ms(this))throw gs("desiredSize");return gl(this)}close(){if(!ms(this))throw gs("close");if(!Co(this))throw new TypeError("The stream is not in a state that permits close");to(this)}enqueue(u=void 0){if(!ms(this))throw gs("enqueue");if(!Co(this))throw new TypeError("The stream is not in a state that permits enqueue");return Ro(this,u)}error(u=void 0){if(!ms(this))throw gs("error");br(this,u)}[te](u){Sn(this);let y=this._cancelAlgorithm(u);return hs(this),y}[X](u){let y=this._controlledReadableStream;if(this._queue.length>0){let T=Jc(this);this._closeRequested&&this._queue.length===0?(hs(this),ki(y)):Oi(this),u._chunkSteps(T)}else I(y,u),Oi(this)}[Te](){}}Object.defineProperties(rn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(rn.prototype.close,"close"),i(rn.prototype.enqueue,"enqueue"),i(rn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(rn.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function ms(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof rn}o(ms,"IsReadableStreamDefaultController");function Oi(a){if(!Sh(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let y=a._pullAlgorithm();f(y,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,Oi(a)),null),T=>(br(a,T),null))}o(Oi,"ReadableStreamDefaultControllerCallPullIfNeeded");function Sh(a){let u=a._controlledReadableStream;return!Co(a)||!a._started?!1:!!(xn(u)&&U(u)>0||gl(a)>0)}o(Sh,"ReadableStreamDefaultControllerShouldCallPull");function hs(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(hs,"ReadableStreamDefaultControllerClearAlgorithms");function to(a){if(!Co(a))return;let u=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(hs(a),ki(u))}o(to,"ReadableStreamDefaultControllerClose");function Ro(a,u){if(!Co(a))return;let y=a._controlledReadableStream;if(xn(y)&&U(y)>0)C(y,u,!1);else{let T;try{T=a._strategySizeAlgorithm(u)}catch(A){throw br(a,A),A}try{Yc(a,u,T)}catch(A){throw br(a,A),A}}Oi(a)}o(Ro,"ReadableStreamDefaultControllerEnqueue");function br(a,u){let y=a._controlledReadableStream;y._state==="readable"&&(Sn(a),hs(a),xh(y,u))}o(br,"ReadableStreamDefaultControllerError");function gl(a){let u=a._controlledReadableStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(gl,"ReadableStreamDefaultControllerGetDesiredSize");function Yx(a){return!Sh(a)}o(Yx,"ReadableStreamDefaultControllerHasBackpressure");function Co(a){let u=a._controlledReadableStream._state;return!a._closeRequested&&u==="readable"}o(Co,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Ph(a,u,y,T,A,M,F){u._controlledReadableStream=a,u._queue=void 0,u._queueTotalSize=void 0,Sn(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=F,u._strategyHWM=M,u._pullAlgorithm=T,u._cancelAlgorithm=A,a._readableStreamController=u;let ie=y();f(h(ie),()=>(u._started=!0,Oi(u),null),ye=>(br(u,ye),null))}o(Ph,"SetUpReadableStreamDefaultController");function Xx(a,u,y,T){let A=Object.create(rn.prototype),M,F,ie;u.start!==void 0?M=o(()=>u.start(A),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.pull!==void 0?F=o(()=>u.pull(A),"pullAlgorithm"):F=o(()=>h(void 0),"pullAlgorithm"),u.cancel!==void 0?ie=o(ye=>u.cancel(ye),"cancelAlgorithm"):ie=o(()=>h(void 0),"cancelAlgorithm"),Ph(a,A,M,F,ie,y,T)}o(Xx,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function gs(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}o(gs,"defaultControllerBrandCheckException$1");function Qx(a,u){return Jn(a._readableStreamController)?tA(a):eA(a)}o(Qx,"ReadableStreamTee");function eA(a,u){let y=j(a),T=!1,A=!1,M=!1,F=!1,ie,ye,pe,we,ke,Xe=p(Ot=>{ke=Ot});function Sr(){return T?(A=!0,h(void 0)):(T=!0,ce(y,{_chunkSteps:o(Nt=>{E(()=>{A=!1;let sr=Nt,on=Nt;M||Ro(pe._readableStreamController,sr),F||Ro(we._readableStreamController,on),T=!1,A&&Sr()})},"_chunkSteps"),_closeSteps:o(()=>{T=!1,M||to(pe._readableStreamController),F||to(we._readableStreamController),(!M||!F)&&ke(void 0)},"_closeSteps"),_errorSteps:o(()=>{T=!1},"_errorSteps")}),h(void 0))}o(Sr,"pullAlgorithm");function $o(Ot){if(M=!0,ie=Ot,F){let Nt=Ze([ie,ye]),sr=Er(a,Nt);ke(sr)}return Xe}o($o,"cancel1Algorithm");function In(Ot){if(F=!0,ye=Ot,M){let Nt=Ze([ie,ye]),sr=Er(a,Nt);ke(sr)}return Xe}o(In,"cancel2Algorithm");function nn(){}return o(nn,"startAlgorithm"),pe=$i(nn,Sr,$o),we=$i(nn,Sr,In),g(y._closedPromise,Ot=>(br(pe._readableStreamController,Ot),br(we._readableStreamController,Ot),(!M||!F)&&ke(void 0),null)),[pe,we]}o(eA,"ReadableStreamDefaultTee");function tA(a){let u=j(a),y=!1,T=!1,A=!1,M=!1,F=!1,ie,ye,pe,we,ke,Xe=p(me=>{ke=me});function Sr(me){g(me._closedPromise,ze=>(me!==u||(ar(pe._readableStreamController,ze),ar(we._readableStreamController,ze),(!M||!F)&&ke(void 0)),null))}o(Sr,"forwardReaderError");function $o(){Xn(u)&&(q(u),u=j(a),Sr(u)),ce(u,{_chunkSteps:o(ze=>{E(()=>{T=!1,A=!1;let Qe=ze,Gt=ze;if(!M&&!F)try{Gt=Fm(ze)}catch(ko){ar(pe._readableStreamController,ko),ar(we._readableStreamController,ko),ke(Er(a,ko));return}M||ts(pe._readableStreamController,Qe),F||ts(we._readableStreamController,Gt),y=!1,T?nn():A&&Ot()})},"_chunkSteps"),_closeSteps:o(()=>{y=!1,M||xi(pe._readableStreamController),F||xi(we._readableStreamController),pe._readableStreamController._pendingPullIntos.length>0&&rs(pe._readableStreamController,0),we._readableStreamController._pendingPullIntos.length>0&&rs(we._readableStreamController,0),(!M||!F)&&ke(void 0)},"_closeSteps"),_errorSteps:o(()=>{y=!1},"_errorSteps")})}o($o,"pullWithDefaultReader");function In(me,ze){se(u)&&(q(u),u=eh(a),Sr(u));let Qe=ze?we:pe,Gt=ze?pe:we;nh(u,me,1,{_chunkSteps:o(Do=>{E(()=>{T=!1,A=!1;let No=ze?F:M;if(ze?M:F)No||ns(Qe._readableStreamController,Do);else{let jh;try{jh=Fm(Do)}catch(El){ar(Qe._readableStreamController,El),ar(Gt._readableStreamController,El),ke(Er(a,El));return}No||ns(Qe._readableStreamController,Do),ts(Gt._readableStreamController,jh)}y=!1,T?nn():A&&Ot()})},"_chunkSteps"),_closeSteps:o(Do=>{y=!1;let No=ze?F:M,Ts=ze?M:F;No||xi(Qe._readableStreamController),Ts||xi(Gt._readableStreamController),Do!==void 0&&(No||ns(Qe._readableStreamController,Do),!Ts&&Gt._readableStreamController._pendingPullIntos.length>0&&rs(Gt._readableStreamController,0)),(!No||!Ts)&&ke(void 0)},"_closeSteps"),_errorSteps:o(()=>{y=!1},"_errorSteps")})}o(In,"pullWithBYOBReader");function nn(){if(y)return T=!0,h(void 0);y=!0;let me=rl(pe._readableStreamController);return me===null?$o():In(me._view,!1),h(void 0)}o(nn,"pull1Algorithm");function Ot(){if(y)return A=!0,h(void 0);y=!0;let me=rl(we._readableStreamController);return me===null?$o():In(me._view,!0),h(void 0)}o(Ot,"pull2Algorithm");function Nt(me){if(M=!0,ie=me,F){let ze=Ze([ie,ye]),Qe=Er(a,ze);ke(Qe)}return Xe}o(Nt,"cancel1Algorithm");function sr(me){if(F=!0,ye=me,M){let ze=Ze([ie,ye]),Qe=Er(a,ze);ke(Qe)}return Xe}o(sr,"cancel2Algorithm");function on(){}return o(on,"startAlgorithm"),pe=wh(on,nn,Nt),we=wh(on,Ot,sr),Sr(u),[pe,we]}o(tA,"ReadableByteStreamTee");function rA(a){return r(a)&&typeof a.getReader<"u"}o(rA,"isReadableStreamLike");function nA(a){return rA(a)?iA(a.getReader()):oA(a)}o(nA,"ReadableStreamFrom");function oA(a){let u,y=Lm(a,"async"),T=e;function A(){let F;try{F=Kw(y)}catch(ye){return _(ye)}let ie=h(F);return v(ie,ye=>{if(!r(ye))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(Jw(ye))to(u._readableStreamController);else{let we=Yw(ye);Ro(u._readableStreamController,we)}})}o(A,"pullAlgorithm");function M(F){let ie=y.iterator,ye;try{ye=Xa(ie,"return")}catch(ke){return _(ke)}if(ye===void 0)return h(void 0);let pe;try{pe=k(ye,ie,[F])}catch(ke){return _(ke)}let we=h(pe);return v(we,ke=>{if(!r(ke))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(M,"cancelAlgorithm"),u=$i(T,A,M,0),u}o(oA,"ReadableStreamFromIterable");function iA(a){let u,y=e;function T(){let M;try{M=a.read()}catch(F){return _(F)}return v(M,F=>{if(!r(F))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(F.done)to(u._readableStreamController);else{let ie=F.value;Ro(u._readableStreamController,ie)}})}o(T,"pullAlgorithm");function A(M){try{return h(a.cancel(M))}catch(F){return _(F)}}return o(A,"cancelAlgorithm"),u=$i(y,T,A,0),u}o(iA,"ReadableStreamFromDefaultReader");function aA(a,u){st(a,u);let y=a,T=y?.autoAllocateChunkSize,A=y?.cancel,M=y?.pull,F=y?.start,ie=y?.type;return{autoAllocateChunkSize:T===void 0?void 0:R(T,`${u} has member 'autoAllocateChunkSize' that`),cancel:A===void 0?void 0:sA(A,y,`${u} has member 'cancel' that`),pull:M===void 0?void 0:uA(M,y,`${u} has member 'pull' that`),start:F===void 0?void 0:cA(F,y,`${u} has member 'start' that`),type:ie===void 0?void 0:lA(ie,`${u} has member 'type' that`)}}o(aA,"convertUnderlyingDefaultOrByteSource");function sA(a,u,y){return pt(a,y),T=>L(a,u,[T])}o(sA,"convertUnderlyingSourceCancelCallback");function uA(a,u,y){return pt(a,y),T=>L(a,u,[T])}o(uA,"convertUnderlyingSourcePullCallback");function cA(a,u,y){return pt(a,y),T=>k(a,u,[T])}o(cA,"convertUnderlyingSourceStartCallback");function lA(a,u){if(a=`${a}`,a!=="bytes")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}o(lA,"convertReadableStreamType");function dA(a,u){return st(a,u),{preventCancel:!!a?.preventCancel}}o(dA,"convertIteratorOptions");function Th(a,u){st(a,u);let y=a?.preventAbort,T=a?.preventCancel,A=a?.preventClose,M=a?.signal;return M!==void 0&&pA(M,`${u} has member 'signal' that`),{preventAbort:!!y,preventCancel:!!T,preventClose:!!A,signal:M}}o(Th,"convertPipeOptions");function pA(a,u){if(!bx(a))throw new TypeError(`${u} is not an AbortSignal.`)}o(pA,"assertAbortSignal");function fA(a,u){st(a,u);let y=a?.readable;S(y,"readable","ReadableWritablePair"),$(y,`${u} has member 'readable' that`);let T=a?.writable;return S(T,"writable","ReadableWritablePair"),ih(T,`${u} has member 'writable' that`),{readable:y,writable:T}}o(fA,"convertReadableWritablePair");class Rt{static{o(this,"ReadableStream")}constructor(u={},y={}){u===void 0?u=null:Be(u,"First parameter");let T=as(y,"Second parameter"),A=aA(u,"First parameter");if(yl(this),A.type==="bytes"){if(T.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let M=Ii(T,0);sx(this,A,M)}else{let M=is(T),F=Ii(T,1);Xx(this,A,F,M)}}get locked(){if(!wn(this))throw ro("locked");return xn(this)}cancel(u=void 0){return wn(this)?xn(this)?_(new TypeError("Cannot cancel a stream that already has a reader")):Er(this,u):_(ro("cancel"))}getReader(u=void 0){if(!wn(this))throw ro("getReader");return cx(u,"First parameter").mode===void 0?j(this):eh(this)}pipeThrough(u,y={}){if(!wn(this))throw ro("pipeThrough");We(u,1,"pipeThrough");let T=fA(u,"First parameter"),A=Th(y,"Second parameter");if(xn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Ao(T.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let M=Eh(this,T.writable,A.preventClose,A.preventAbort,A.preventCancel,A.signal);return b(M),T.readable}pipeTo(u,y={}){if(!wn(this))return _(ro("pipeTo"));if(u===void 0)return _("Parameter 1 is required in 'pipeTo'.");if(!xo(u))return _(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let T;try{T=Th(y,"Second parameter")}catch(A){return _(A)}return xn(this)?_(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Ao(u)?_(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Eh(this,u,T.preventClose,T.preventAbort,T.preventCancel,T.signal)}tee(){if(!wn(this))throw ro("tee");let u=Qx(this);return Ze(u)}values(u=void 0){if(!wn(this))throw ro("values");let y=dA(u,"First parameter");return So(this,y.preventCancel)}[Kc](u){return this.values(u)}static from(u){return nA(u)}}Object.defineProperties(Rt,{from:{enumerable:!0}}),Object.defineProperties(Rt.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(Rt.from,"from"),i(Rt.prototype.cancel,"cancel"),i(Rt.prototype.getReader,"getReader"),i(Rt.prototype.pipeThrough,"pipeThrough"),i(Rt.prototype.pipeTo,"pipeTo"),i(Rt.prototype.tee,"tee"),i(Rt.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rt.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Rt.prototype,Kc,{value:Rt.prototype.values,writable:!0,configurable:!0});function $i(a,u,y,T=1,A=()=>1){let M=Object.create(Rt.prototype);yl(M);let F=Object.create(rn.prototype);return Ph(M,F,a,u,y,T,A),M}o($i,"CreateReadableStream");function wh(a,u,y){let T=Object.create(Rt.prototype);yl(T);let A=Object.create(en.prototype);return Qm(T,A,a,u,y,0,void 0),T}o(wh,"CreateReadableByteStream");function yl(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}o(yl,"InitializeReadableStream");function wn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof Rt}o(wn,"IsReadableStream");function xn(a){return a._reader!==void 0}o(xn,"IsReadableStreamLocked");function Er(a,u){if(a._disturbed=!0,a._state==="closed")return h(void 0);if(a._state==="errored")return _(a._storedError);ki(a);let y=a._reader;if(y!==void 0&&Xn(y)){let A=y._readIntoRequests;y._readIntoRequests=new W,A.forEach(M=>{M._closeSteps(void 0)})}let T=a._readableStreamController[te](u);return v(T,e)}o(Er,"ReadableStreamCancel");function ki(a){a._state="closed";let u=a._reader;if(u!==void 0&&(Ve(u),se(u))){let y=u._readRequests;u._readRequests=new W,y.forEach(T=>{T._closeSteps()})}}o(ki,"ReadableStreamClose");function xh(a,u){a._state="errored",a._storedError=u;let y=a._reader;y!==void 0&&(Ie(y,u),se(y)?tt(y,u):oh(y,u))}o(xh,"ReadableStreamError");function ro(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}o(ro,"streamBrandCheckException$1");function Ah(a,u){st(a,u);let y=a?.highWaterMark;return S(y,"highWaterMark","QueuingStrategyInit"),{highWaterMark:w(y)}}o(Ah,"convertQueuingStrategyInit");let Ih=o(a=>a.byteLength,"byteLengthSizeFunction");i(Ih,"size");class ys{static{o(this,"ByteLengthQueuingStrategy")}constructor(u){We(u,1,"ByteLengthQueuingStrategy"),u=Ah(u,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!Ch(this))throw Rh("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Ch(this))throw Rh("size");return Ih}}Object.defineProperties(ys.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ys.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function Rh(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}o(Rh,"byteLengthBrandCheckException");function Ch(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof ys}o(Ch,"IsByteLengthQueuingStrategy");let Oh=o(()=>1,"countSizeFunction");i(Oh,"size");class vs{static{o(this,"CountQueuingStrategy")}constructor(u){We(u,1,"CountQueuingStrategy"),u=Ah(u,"First parameter"),this._countQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!kh(this))throw $h("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!kh(this))throw $h("size");return Oh}}Object.defineProperties(vs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(vs.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function $h(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}o($h,"countBrandCheckException");function kh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof vs}o(kh,"IsCountQueuingStrategy");function mA(a,u){st(a,u);let y=a?.cancel,T=a?.flush,A=a?.readableType,M=a?.start,F=a?.transform,ie=a?.writableType;return{cancel:y===void 0?void 0:vA(y,a,`${u} has member 'cancel' that`),flush:T===void 0?void 0:hA(T,a,`${u} has member 'flush' that`),readableType:A,start:M===void 0?void 0:gA(M,a,`${u} has member 'start' that`),transform:F===void 0?void 0:yA(F,a,`${u} has member 'transform' that`),writableType:ie}}o(mA,"convertTransformer");function hA(a,u,y){return pt(a,y),T=>L(a,u,[T])}o(hA,"convertTransformerFlushCallback");function gA(a,u,y){return pt(a,y),T=>k(a,u,[T])}o(gA,"convertTransformerStartCallback");function yA(a,u,y){return pt(a,y),(T,A)=>L(a,u,[T,A])}o(yA,"convertTransformerTransformCallback");function vA(a,u,y){return pt(a,y),T=>L(a,u,[T])}o(vA,"convertTransformerCancelCallback");class _s{static{o(this,"TransformStream")}constructor(u={},y={},T={}){u===void 0&&(u=null);let A=as(y,"Second parameter"),M=as(T,"Third parameter"),F=mA(u,"First parameter");if(F.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(F.writableType!==void 0)throw new RangeError("Invalid writableType specified");let ie=Ii(M,0),ye=is(M),pe=Ii(A,1),we=is(A),ke,Xe=p(Sr=>{ke=Sr});_A(this,Xe,pe,we,ie,ye),EA(this,F),F.start!==void 0?ke(F.start(this._transformStreamController)):ke(void 0)}get readable(){if(!Dh(this))throw Mh("readable");return this._readable}get writable(){if(!Dh(this))throw Mh("writable");return this._writable}}Object.defineProperties(_s.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(_s.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function _A(a,u,y,T,A,M){function F(){return u}o(F,"startAlgorithm");function ie(Xe){return TA(a,Xe)}o(ie,"writeAlgorithm");function ye(Xe){return wA(a,Xe)}o(ye,"abortAlgorithm");function pe(){return xA(a)}o(pe,"closeAlgorithm"),a._writable=Px(F,ie,pe,ye,y,T);function we(){return AA(a)}o(we,"pullAlgorithm");function ke(Xe){return IA(a,Xe)}o(ke,"cancelAlgorithm"),a._readable=$i(F,we,ke,A,M),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,bs(a,!0),a._transformStreamController=void 0}o(_A,"InitializeTransformStream");function Dh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof _s}o(Dh,"IsTransformStream");function Nh(a,u){br(a._readable._readableStreamController,u),vl(a,u)}o(Nh,"TransformStreamError");function vl(a,u){Ss(a._transformStreamController),Ri(a._writable._writableStreamController,u),_l(a)}o(vl,"TransformStreamErrorWritableAndUnblockWrite");function _l(a){a._backpressure&&bs(a,!1)}o(_l,"TransformStreamUnblockWrite");function bs(a,u){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=p(y=>{a._backpressureChangePromise_resolve=y}),a._backpressure=u}o(bs,"TransformStreamSetBackpressure");class An{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Es(this))throw Ps("desiredSize");let u=this._controlledTransformStream._readable._readableStreamController;return gl(u)}enqueue(u=void 0){if(!Es(this))throw Ps("enqueue");zh(this,u)}error(u=void 0){if(!Es(this))throw Ps("error");SA(this,u)}terminate(){if(!Es(this))throw Ps("terminate");PA(this)}}Object.defineProperties(An.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(An.prototype.enqueue,"enqueue"),i(An.prototype.error,"error"),i(An.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(An.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function Es(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof An}o(Es,"IsTransformStreamDefaultController");function bA(a,u,y,T,A){u._controlledTransformStream=a,a._transformStreamController=u,u._transformAlgorithm=y,u._flushAlgorithm=T,u._cancelAlgorithm=A,u._finishPromise=void 0,u._finishPromise_resolve=void 0,u._finishPromise_reject=void 0}o(bA,"SetUpTransformStreamDefaultController");function EA(a,u){let y=Object.create(An.prototype),T,A,M;u.transform!==void 0?T=o(F=>u.transform(F,y),"transformAlgorithm"):T=o(F=>{try{return zh(y,F),h(void 0)}catch(ie){return _(ie)}},"transformAlgorithm"),u.flush!==void 0?A=o(()=>u.flush(y),"flushAlgorithm"):A=o(()=>h(void 0),"flushAlgorithm"),u.cancel!==void 0?M=o(F=>u.cancel(F),"cancelAlgorithm"):M=o(()=>h(void 0),"cancelAlgorithm"),bA(a,y,T,A,M)}o(EA,"SetUpTransformStreamDefaultControllerFromTransformer");function Ss(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}o(Ss,"TransformStreamDefaultControllerClearAlgorithms");function zh(a,u){let y=a._controlledTransformStream,T=y._readable._readableStreamController;if(!Co(T))throw new TypeError("Readable side is not in a state that permits enqueue");try{Ro(T,u)}catch(M){throw vl(y,M),y._readable._storedError}Yx(T)!==y._backpressure&&bs(y,!0)}o(zh,"TransformStreamDefaultControllerEnqueue");function SA(a,u){Nh(a._controlledTransformStream,u)}o(SA,"TransformStreamDefaultControllerError");function Uh(a,u){let y=a._transformAlgorithm(u);return v(y,void 0,T=>{throw Nh(a._controlledTransformStream,T),T})}o(Uh,"TransformStreamDefaultControllerPerformTransform");function PA(a){let u=a._controlledTransformStream,y=u._readable._readableStreamController;to(y);let T=new TypeError("TransformStream terminated");vl(u,T)}o(PA,"TransformStreamDefaultControllerTerminate");function TA(a,u){let y=a._transformStreamController;if(a._backpressure){let T=a._backpressureChangePromise;return v(T,()=>{let A=a._writable;if(A._state==="erroring")throw A._storedError;return Uh(y,u)})}return Uh(y,u)}o(TA,"TransformStreamDefaultSinkWriteAlgorithm");function wA(a,u){let y=a._transformStreamController;if(y._finishPromise!==void 0)return y._finishPromise;let T=a._readable;y._finishPromise=p((M,F)=>{y._finishPromise_resolve=M,y._finishPromise_reject=F});let A=y._cancelAlgorithm(u);return Ss(y),f(A,()=>(T._state==="errored"?Oo(y,T._storedError):(br(T._readableStreamController,u),bl(y)),null),M=>(br(T._readableStreamController,M),Oo(y,M),null)),y._finishPromise}o(wA,"TransformStreamDefaultSinkAbortAlgorithm");function xA(a){let u=a._transformStreamController;if(u._finishPromise!==void 0)return u._finishPromise;let y=a._readable;u._finishPromise=p((A,M)=>{u._finishPromise_resolve=A,u._finishPromise_reject=M});let T=u._flushAlgorithm();return Ss(u),f(T,()=>(y._state==="errored"?Oo(u,y._storedError):(to(y._readableStreamController),bl(u)),null),A=>(br(y._readableStreamController,A),Oo(u,A),null)),u._finishPromise}o(xA,"TransformStreamDefaultSinkCloseAlgorithm");function AA(a){return bs(a,!1),a._backpressureChangePromise}o(AA,"TransformStreamDefaultSourcePullAlgorithm");function IA(a,u){let y=a._transformStreamController;if(y._finishPromise!==void 0)return y._finishPromise;let T=a._writable;y._finishPromise=p((M,F)=>{y._finishPromise_resolve=M,y._finishPromise_reject=F});let A=y._cancelAlgorithm(u);return Ss(y),f(A,()=>(T._state==="errored"?Oo(y,T._storedError):(Ri(T._writableStreamController,u),_l(a),bl(y)),null),M=>(Ri(T._writableStreamController,M),_l(a),Oo(y,M),null)),y._finishPromise}o(IA,"TransformStreamDefaultSourceCancelAlgorithm");function Ps(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}o(Ps,"defaultControllerBrandCheckException");function bl(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(bl,"defaultControllerFinishPromiseResolve");function Oo(a,u){a._finishPromise_reject!==void 0&&(b(a._finishPromise),a._finishPromise_reject(u),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Oo,"defaultControllerFinishPromiseReject");function Mh(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}o(Mh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=ys,t.CountQueuingStrategy=vs,t.ReadableByteStreamController=en,t.ReadableStream=Rt,t.ReadableStreamBYOBReader=Pn,t.ReadableStreamBYOBRequest=Kn,t.ReadableStreamDefaultController=rn,t.ReadableStreamDefaultReader=V,t.TransformStream=_s,t.TransformStreamDefaultController=An,t.WritableStream=Tn,t.WritableStreamDefaultController=Io,t.WritableStreamDefaultWriter=tn})});var Zb=D(()=>{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,Wb())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=o(function(r){let n=0,i=this;return new ReadableStream({type:"bytes",async pull(s){let d=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=d.byteLength,s.enqueue(new Uint8Array(d)),n===i.size&&s.close()}})},"name"))}catch{}});async function*Fd(t,e=!0){for(let r of t)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let n=r.byteOffset,i=r.byteOffset+r.byteLength;for(;n!==i;){let s=Math.min(i-n,Kb),c=r.buffer.slice(n,n+s);n+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let n=0,i=r;for(;n!==i.size;){let c=await i.slice(n,Math.min(i.size,n+Kb)).arrayBuffer();n+=c.byteLength,yield new Uint8Array(c)}}}var i9,Kb,Jb,YO,wr,ca=St(()=>{i9=rt(Zb(),1);Kb=65536;o(Fd,"toIterator");Jb=class qd{static{o(this,"Blob")}#e=[];#t="";#r=0;#n="transparent";constructor(e=[],r={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let n=new TextEncoder;for(let s of e){let c;ArrayBuffer.isView(s)?c=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?c=new Uint8Array(s.slice(0)):s instanceof qd?c=s:c=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of Fd(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 Fd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Fd(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let n=await e.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,n=""){let{size:i}=this,s=e<0?Math.max(i+e,0):Math.min(e,i),c=r<0?Math.max(i+r,0):Math.min(r,i),d=Math.max(c-s,0),p=this.#e,h=[],_=0;for(let f of p){if(_>=d)break;let l=ArrayBuffer.isView(f)?f.byteLength:f.size;if(s&&l<=s)s-=l,c-=l;else{let g;ArrayBuffer.isView(f)?(g=f.subarray(s,Math.min(l,c)),_+=g.byteLength):(g=f.slice(s,Math.min(l,c)),_+=g.size),c-=l,h.push(g),s=0}}let m=new qd([],{type:String(n).toLowerCase()});return m.#r=d,m.#e=h,m}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(Jb.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});YO=Jb,wr=YO});var XO,QO,Ln,Bd=St(()=>{ca();XO=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])}},QO=XO,Ln=QO});function Qb(t,e=wr){var r=`${Yb()}${Yb()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
|
|
13
|
+
`;let p=(0,e$.parseProxyResponse)(i);i.write(`${d}\r
|
|
14
|
+
`);let{connect:h,buffered:_}=await p;if(e.emit("proxyConnect",h),this.emit("proxyConnect",h,e),h.statusCode===200)return e.once("socket",t$),r.secureEndpoint?(ua("Upgrading socket connection to TLS"),Fb.connect({...Bb(qb(r),"host","path","port"),socket:i})):i;i.destroy();let m=new fu.Socket({writable:!1});return m.readable=!0,e.once("socket",f=>{ua("Replaying proxy buffer for failed request"),(0,JO.default)(f.listenerCount("data")>0),f.push(_),f.push(null)}),m}};mu.protocols=["http","https"];pr.HttpsProxyAgent=mu;function t$(t){t.resume()}o(t$,"resume");function Bb(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(Bb,"omit")});function r$(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,s=r[0]||"text/plain",c=s;for(let _=1;_<r.length;_++)r[_]==="base64"?i=!0:r[_]&&(c+=`;${r[_]}`,r[_].indexOf("charset=")===0&&(n=r[_].substring(8)));!r[0]&&!n.length&&(c+=";charset=US-ASCII",n="US-ASCII");let d=i?"base64":"ascii",p=unescape(t.substring(e+1)),h=Buffer.from(p,d);return h.type=s,h.typeFull=c,h.charset=n,h}var Wb,Zb=St(()=>{o(r$,"dataUriToBuffer");Wb=r$});var Jb=D((hu,Kb)=>{(function(t,e){typeof hu=="object"&&typeof Kb<"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(){}o(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(r,"typeIsObject");let n=e;function i(a,u){try{Object.defineProperty(a,"name",{value:u,configurable:!0})}catch{}}o(i,"setFunctionName");let s=Promise,c=Promise.prototype.then,d=Promise.reject.bind(s);function p(a){return new s(a)}o(p,"newPromise");function h(a){return p(u=>u(a))}o(h,"promiseResolvedWith");function _(a){return d(a)}o(_,"promiseRejectedWith");function m(a,u,y){return c.call(a,u,y)}o(m,"PerformPromiseThen");function f(a,u,y){m(m(a,u,y),void 0,n)}o(f,"uponPromise");function l(a,u){f(a,u)}o(l,"uponFulfillment");function g(a,u){f(a,void 0,u)}o(g,"uponRejection");function v(a,u,y){return m(a,u,y)}o(v,"transformPromiseWith");function b(a){m(a,void 0,n)}o(b,"setPromiseIsHandledToTrue");let E=o(a=>{if(typeof queueMicrotask=="function")E=queueMicrotask;else{let u=h(void 0);E=o(y=>m(u,y),"_queueMicrotask")}return E(a)},"_queueMicrotask");function k(a,u,y){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,u,y)}o(k,"reflectCall");function L(a,u,y){try{return h(k(a,u,y))}catch(T){return _(T)}}o(L,"promiseCall");let J=16384;class W{static{o(this,"SimpleQueue")}constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(u){let y=this._back,T=y;y._elements.length===J-1&&(T={_elements:[],_next:void 0}),y._elements.push(u),T!==y&&(this._back=T,y._next=T),++this._size}shift(){let u=this._front,y=u,T=this._cursor,A=T+1,M=u._elements,F=M[T];return A===J&&(y=u._next,A=0),--this._size,this._cursor=A,u!==y&&(this._front=y),M[T]=void 0,F}forEach(u){let y=this._cursor,T=this._front,A=T._elements;for(;(y!==A.length||T._next!==void 0)&&!(y===A.length&&(T=T._next,A=T._elements,y=0,A.length===0));)u(A[y]),++y}peek(){let u=this._front,y=this._cursor;return u._elements[y]}}let G=Symbol("[[AbortSteps]]"),K=Symbol("[[ErrorSteps]]"),te=Symbol("[[CancelSteps]]"),X=Symbol("[[PullSteps]]"),Te=Symbol("[[ReleaseSteps]]");function re(a,u){a._ownerReadableStream=u,u._reader=a,u._state==="readable"?Z(a):u._state==="closed"?ae(a):oe(a,u._storedError)}o(re,"ReadableStreamReaderGenericInitialize");function B(a,u){let y=a._ownerReadableStream;return Er(y,u)}o(B,"ReadableStreamReaderGenericCancel");function q(a){let u=a._ownerReadableStream;u._state==="readable"?Ie(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):$e(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._readableStreamController[Te](),u._reader=void 0,a._ownerReadableStream=void 0}o(q,"ReadableStreamReaderGenericRelease");function Y(a){return new TypeError("Cannot "+a+" a stream using a released reader")}o(Y,"readerLockException");function Z(a){a._closedPromise=p((u,y)=>{a._closedPromise_resolve=u,a._closedPromise_reject=y})}o(Z,"defaultReaderClosedPromiseInitialize");function oe(a,u){Z(a),Ie(a,u)}o(oe,"defaultReaderClosedPromiseInitializeAsRejected");function ae(a){Z(a),Ve(a)}o(ae,"defaultReaderClosedPromiseInitializeAsResolved");function Ie(a,u){a._closedPromise_reject!==void 0&&(b(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ie,"defaultReaderClosedPromiseReject");function $e(a,u){oe(a,u)}o($e,"defaultReaderClosedPromiseResetToRejected");function Ve(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ve,"defaultReaderClosedPromiseResolve");let Ye=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Et=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function ee(a){return typeof a=="object"||typeof a=="function"}o(ee,"isDictionary");function st(a,u){if(a!==void 0&&!ee(a))throw new TypeError(`${u} is not an object.`)}o(st,"assertDictionary");function pt(a,u){if(typeof a!="function")throw new TypeError(`${u} is not a function.`)}o(pt,"assertFunction");function Bt(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(Bt,"isObject");function Be(a,u){if(!Bt(a))throw new TypeError(`${u} is not an object.`)}o(Be,"assertObject");function We(a,u,y){if(a===void 0)throw new TypeError(`Parameter ${u} is required in '${y}'.`)}o(We,"assertRequiredArgument");function S(a,u,y){if(a===void 0)throw new TypeError(`${u} is required in '${y}'.`)}o(S,"assertRequiredField");function w(a){return Number(a)}o(w,"convertUnrestrictedDouble");function x(a){return a===0?0:a}o(x,"censorNegativeZero");function z(a){return x(Et(a))}o(z,"integerPart");function R(a,u){let T=Number.MAX_SAFE_INTEGER,A=Number(a);if(A=x(A),!Ye(A))throw new TypeError(`${u} is not a finite number`);if(A=z(A),A<0||A>T)throw new TypeError(`${u} is outside the accepted range of 0 to ${T}, inclusive`);return!Ye(A)||A===0?0:A}o(R,"convertUnsignedLongLongWithEnforceRange");function $(a,u){if(!wn(a))throw new TypeError(`${u} is not a ReadableStream.`)}o($,"assertReadableStream");function j(a){return new V(a)}o(j,"AcquireReadableStreamDefaultReader");function I(a,u){a._reader._readRequests.push(u)}o(I,"ReadableStreamAddReadRequest");function C(a,u,y){let A=a._reader._readRequests.shift();y?A._closeSteps():A._chunkSteps(u)}o(C,"ReadableStreamFulfillReadRequest");function U(a){return a._reader._readRequests.length}o(U,"ReadableStreamGetNumReadRequests");function N(a){let u=a._reader;return!(u===void 0||!se(u))}o(N,"ReadableStreamHasDefaultReader");class V{static{o(this,"ReadableStreamDefaultReader")}constructor(u){if(We(u,1,"ReadableStreamDefaultReader"),$(u,"First parameter"),xn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");re(this,u),this._readRequests=new W}get closed(){return se(this)?this._closedPromise:_(nt("closed"))}cancel(u=void 0){return se(this)?this._ownerReadableStream===void 0?_(Y("cancel")):B(this,u):_(nt("cancel"))}read(){if(!se(this))return _(nt("read"));if(this._ownerReadableStream===void 0)return _(Y("read from"));let u,y,T=p((M,F)=>{u=M,y=F});return ce(this,{_chunkSteps:o(M=>u({value:M,done:!1}),"_chunkSteps"),_closeSteps:o(()=>u({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(M=>y(M),"_errorSteps")}),T}releaseLock(){if(!se(this))throw nt("releaseLock");this._ownerReadableStream!==void 0&&Me(this)}}Object.defineProperties(V.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(V.prototype.cancel,"cancel"),i(V.prototype.read,"read"),i(V.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(V.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function se(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof V}o(se,"IsReadableStreamDefaultReader");function ce(a,u){let y=a._ownerReadableStream;y._disturbed=!0,y._state==="closed"?u._closeSteps():y._state==="errored"?u._errorSteps(y._storedError):y._readableStreamController[X](u)}o(ce,"ReadableStreamDefaultReaderRead");function Me(a){q(a);let u=new TypeError("Reader was released");tt(a,u)}o(Me,"ReadableStreamDefaultReaderRelease");function tt(a,u){let y=a._readRequests;a._readRequests=new W,y.forEach(T=>{T._errorSteps(u)})}o(tt,"ReadableStreamDefaultReaderErrorReadRequests");function nt(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}o(nt,"defaultReaderBrandCheckException");let Ue=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class qe{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(u,y){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=u,this._preventCancel=y}next(){let u=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?v(this._ongoingPromise,u,u):u(),this._ongoingPromise}return(u){let y=o(()=>this._returnSteps(u),"returnSteps");return this._ongoingPromise?v(this._ongoingPromise,y,y):y()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let u=this._reader,y,T,A=p((F,ie)=>{y=F,T=ie});return ce(u,{_chunkSteps:o(F=>{this._ongoingPromise=void 0,E(()=>y({value:F,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,q(u),y({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(F=>{this._ongoingPromise=void 0,this._isFinished=!0,q(u),T(F)},"_errorSteps")}),A}_returnSteps(u){if(this._isFinished)return Promise.resolve({value:u,done:!0});this._isFinished=!0;let y=this._reader;if(!this._preventCancel){let T=B(y,u);return q(y),v(T,()=>({value:u,done:!0}))}return q(y),h({value:u,done:!0})}}let vt={next(){return Po(this)?this._asyncIteratorImpl.next():_(To("next"))},return(a){return Po(this)?this._asyncIteratorImpl.return(a):_(To("return"))}};Object.setPrototypeOf(vt,Ue);function So(a,u){let y=j(a),T=new qe(y,u),A=Object.create(vt);return A._asyncIteratorImpl=T,A}o(So,"AcquireReadableStreamAsyncIterator");function Po(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof qe}catch{return!1}}o(Po,"IsReadableStreamAsyncIterator");function To(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}o(To,"streamAsyncIteratorBrandCheckException");let Vt=Number.isNaN||function(a){return a!==a};var Xr,It,_t;function Ze(a){return a.slice()}o(Ze,"CreateArrayFromList");function Mm(a,u,y,T,A){new Uint8Array(a).set(new Uint8Array(y,T,A),u)}o(Mm,"CopyDataBlockBytes");let Qr=o(a=>(typeof a.transfer=="function"?Qr=o(u=>u.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?Qr=o(u=>structuredClone(u,{transfer:[u]}),"TransferArrayBuffer"):Qr=o(u=>u,"TransferArrayBuffer"),Qr(a)),"TransferArrayBuffer"),En=o(a=>(typeof a.detached=="boolean"?En=o(u=>u.detached,"IsDetachedBuffer"):En=o(u=>u.byteLength===0,"IsDetachedBuffer"),En(a)),"IsDetachedBuffer");function jm(a,u,y){if(a.slice)return a.slice(u,y);let T=y-u,A=new ArrayBuffer(T);return Mm(A,0,a,u,T),A}o(jm,"ArrayBufferSlice");function Xa(a,u){let y=a[u];if(y!=null){if(typeof y!="function")throw new TypeError(`${String(u)} is not a function`);return y}}o(Xa,"GetMethod");function Yw(a){let u={[Symbol.iterator]:()=>a.iterator},y=async function*(){return yield*u}(),T=y.next;return{iterator:y,nextMethod:T,done:!1}}o(Yw,"CreateAsyncFromSyncIterator");let Zc=(_t=(Xr=Symbol.asyncIterator)!==null&&Xr!==void 0?Xr:(It=Symbol.for)===null||It===void 0?void 0:It.call(Symbol,"Symbol.asyncIterator"))!==null&&_t!==void 0?_t:"@@asyncIterator";function Lm(a,u="sync",y){if(y===void 0)if(u==="async"){if(y=Xa(a,Zc),y===void 0){let M=Xa(a,Symbol.iterator),F=Lm(a,"sync",M);return Yw(F)}}else y=Xa(a,Symbol.iterator);if(y===void 0)throw new TypeError("The object is not iterable");let T=k(y,a,[]);if(!r(T))throw new TypeError("The iterator method must return an object");let A=T.next;return{iterator:T,nextMethod:A,done:!1}}o(Lm,"GetIterator");function Xw(a){let u=k(a.nextMethod,a.iterator,[]);if(!r(u))throw new TypeError("The iterator.next() method must return an object");return u}o(Xw,"IteratorNext");function Qw(a){return!!a.done}o(Qw,"IteratorComplete");function ex(a){return a.value}o(ex,"IteratorValue");function tx(a){return!(typeof a!="number"||Vt(a)||a<0)}o(tx,"IsNonNegativeNumber");function Fm(a){let u=jm(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(u)}o(Fm,"CloneAsUint8Array");function Kc(a){let u=a._queue.shift();return a._queueTotalSize-=u.size,a._queueTotalSize<0&&(a._queueTotalSize=0),u.value}o(Kc,"DequeueValue");function Jc(a,u,y){if(!tx(y)||y===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:u,size:y}),a._queueTotalSize+=y}o(Jc,"EnqueueValueWithSize");function rx(a){return a._queue.peek().value}o(rx,"PeekQueueValue");function Sn(a){a._queue=new W,a._queueTotalSize=0}o(Sn,"ResetQueue");function qm(a){return a===DataView}o(qm,"isDataViewConstructor");function nx(a){return qm(a.constructor)}o(nx,"isDataView");function ox(a){return qm(a)?1:a.BYTES_PER_ELEMENT}o(ox,"arrayBufferViewElementSize");class Kn{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Yc(this))throw rl("view");return this._view}respond(u){if(!Yc(this))throw rl("respond");if(We(u,1,"respond"),u=R(u,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(En(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");rs(this._associatedReadableByteStreamController,u)}respondWithNewView(u){if(!Yc(this))throw rl("respondWithNewView");if(We(u,1,"respondWithNewView"),!ArrayBuffer.isView(u))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(En(u.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");ns(this._associatedReadableByteStreamController,u)}}Object.defineProperties(Kn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(Kn.prototype.respond,"respond"),i(Kn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Kn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class en{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Jn(this))throw Ii("byobRequest");return tl(this)}get desiredSize(){if(!Jn(this))throw Ii("desiredSize");return Xm(this)}close(){if(!Jn(this))throw Ii("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let u=this._controlledReadableByteStream._state;if(u!=="readable")throw new TypeError(`The stream (in ${u} state) is not in the readable state and cannot be closed`);Ai(this)}enqueue(u){if(!Jn(this))throw Ii("enqueue");if(We(u,1,"enqueue"),!ArrayBuffer.isView(u))throw new TypeError("chunk must be an array buffer view");if(u.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(u.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let y=this._controlledReadableByteStream._state;if(y!=="readable")throw new TypeError(`The stream (in ${y} state) is not in the readable state and cannot be enqueued to`);ts(this,u)}error(u=void 0){if(!Jn(this))throw Ii("error");ar(this,u)}[te](u){Bm(this),Sn(this);let y=this._cancelAlgorithm(u);return es(this),y}[X](u){let y=this._controlledReadableByteStream;if(this._queueTotalSize>0){Ym(this,u);return}let T=this._autoAllocateChunkSize;if(T!==void 0){let A;try{A=new ArrayBuffer(T)}catch(F){u._errorSteps(F);return}let M={buffer:A,bufferByteLength:T,byteOffset:0,byteLength:T,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(M)}I(y,u),Yn(this)}[Te](){if(this._pendingPullIntos.length>0){let u=this._pendingPullIntos.peek();u.readerType="none",this._pendingPullIntos=new W,this._pendingPullIntos.push(u)}}}Object.defineProperties(en.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(en.prototype.close,"close"),i(en.prototype.enqueue,"enqueue"),i(en.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(en.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Jn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof en}o(Jn,"IsReadableByteStreamController");function Yc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof Kn}o(Yc,"IsReadableStreamBYOBRequest");function Yn(a){if(!cx(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let y=a._pullAlgorithm();f(y,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,Yn(a)),null),T=>(ar(a,T),null))}o(Yn,"ReadableByteStreamControllerCallPullIfNeeded");function Bm(a){Qc(a),a._pendingPullIntos=new W}o(Bm,"ReadableByteStreamControllerClearPendingPullIntos");function Xc(a,u){let y=!1;a._state==="closed"&&(y=!0);let T=Vm(u);u.readerType==="default"?C(a,T,y):hx(a,T,y)}o(Xc,"ReadableByteStreamControllerCommitPullIntoDescriptor");function Vm(a){let u=a.bytesFilled,y=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,u/y)}o(Vm,"ReadableByteStreamControllerConvertPullIntoDescriptor");function Qa(a,u,y,T){a._queue.push({buffer:u,byteOffset:y,byteLength:T}),a._queueTotalSize+=T}o(Qa,"ReadableByteStreamControllerEnqueueChunkToQueue");function Gm(a,u,y,T){let A;try{A=jm(u,y,y+T)}catch(M){throw ar(a,M),M}Qa(a,A,0,T)}o(Gm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Hm(a,u){u.bytesFilled>0&&Gm(a,u.buffer,u.byteOffset,u.bytesFilled),wo(a)}o(Hm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function Wm(a,u){let y=Math.min(a._queueTotalSize,u.byteLength-u.bytesFilled),T=u.bytesFilled+y,A=y,M=!1,F=T%u.elementSize,ie=T-F;ie>=u.minimumFill&&(A=ie-u.bytesFilled,M=!0);let ye=a._queue;for(;A>0;){let pe=ye.peek(),we=Math.min(A,pe.byteLength),ke=u.byteOffset+u.bytesFilled;Mm(u.buffer,ke,pe.buffer,pe.byteOffset,we),pe.byteLength===we?ye.shift():(pe.byteOffset+=we,pe.byteLength-=we),a._queueTotalSize-=we,Zm(a,we,u),A-=we}return M}o(Wm,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function Zm(a,u,y){y.bytesFilled+=u}o(Zm,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function Km(a){a._queueTotalSize===0&&a._closeRequested?(es(a),Di(a._controlledReadableByteStream)):Yn(a)}o(Km,"ReadableByteStreamControllerHandleQueueDrain");function Qc(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}o(Qc,"ReadableByteStreamControllerInvalidateBYOBRequest");function el(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let u=a._pendingPullIntos.peek();Wm(a,u)&&(wo(a),Xc(a._controlledReadableByteStream,u))}}o(el,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function ix(a){let u=a._controlledReadableByteStream._reader;for(;u._readRequests.length>0;){if(a._queueTotalSize===0)return;let y=u._readRequests.shift();Ym(a,y)}}o(ix,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function ax(a,u,y,T){let A=a._controlledReadableByteStream,M=u.constructor,F=ox(M),{byteOffset:ie,byteLength:ye}=u,pe=y*F,we;try{we=Qr(u.buffer)}catch(Xe){T._errorSteps(Xe);return}let ke={buffer:we,bufferByteLength:we.byteLength,byteOffset:ie,byteLength:ye,bytesFilled:0,minimumFill:pe,elementSize:F,viewConstructor:M,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(ke),th(A,T);return}if(A._state==="closed"){let Xe=new M(ke.buffer,ke.byteOffset,0);T._closeSteps(Xe);return}if(a._queueTotalSize>0){if(Wm(a,ke)){let Xe=Vm(ke);Km(a),T._chunkSteps(Xe);return}if(a._closeRequested){let Xe=new TypeError("Insufficient bytes to fill elements in the given buffer");ar(a,Xe),T._errorSteps(Xe);return}}a._pendingPullIntos.push(ke),th(A,T),Yn(a)}o(ax,"ReadableByteStreamControllerPullInto");function sx(a,u){u.readerType==="none"&&wo(a);let y=a._controlledReadableByteStream;if(nl(y))for(;rh(y)>0;){let T=wo(a);Xc(y,T)}}o(sx,"ReadableByteStreamControllerRespondInClosedState");function ux(a,u,y){if(Zm(a,u,y),y.readerType==="none"){Hm(a,y),el(a);return}if(y.bytesFilled<y.minimumFill)return;wo(a);let T=y.bytesFilled%y.elementSize;if(T>0){let A=y.byteOffset+y.bytesFilled;Gm(a,y.buffer,A-T,T)}y.bytesFilled-=T,Xc(a._controlledReadableByteStream,y),el(a)}o(ux,"ReadableByteStreamControllerRespondInReadableState");function Jm(a,u){let y=a._pendingPullIntos.peek();Qc(a),a._controlledReadableByteStream._state==="closed"?sx(a,y):ux(a,u,y),Yn(a)}o(Jm,"ReadableByteStreamControllerRespondInternal");function wo(a){return a._pendingPullIntos.shift()}o(wo,"ReadableByteStreamControllerShiftPendingPullInto");function cx(a){let u=a._controlledReadableByteStream;return u._state!=="readable"||a._closeRequested||!a._started?!1:!!(N(u)&&U(u)>0||nl(u)&&rh(u)>0||Xm(a)>0)}o(cx,"ReadableByteStreamControllerShouldCallPull");function es(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}o(es,"ReadableByteStreamControllerClearAlgorithms");function Ai(a){let u=a._controlledReadableByteStream;if(!(a._closeRequested||u._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let y=a._pendingPullIntos.peek();if(y.bytesFilled%y.elementSize!==0){let T=new TypeError("Insufficient bytes to fill elements in the given buffer");throw ar(a,T),T}}es(a),Di(u)}}o(Ai,"ReadableByteStreamControllerClose");function ts(a,u){let y=a._controlledReadableByteStream;if(a._closeRequested||y._state!=="readable")return;let{buffer:T,byteOffset:A,byteLength:M}=u;if(En(T))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let F=Qr(T);if(a._pendingPullIntos.length>0){let ie=a._pendingPullIntos.peek();if(En(ie.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Qc(a),ie.buffer=Qr(ie.buffer),ie.readerType==="none"&&Hm(a,ie)}if(N(y))if(ix(a),U(y)===0)Qa(a,F,A,M);else{a._pendingPullIntos.length>0&&wo(a);let ie=new Uint8Array(F,A,M);C(y,ie,!1)}else nl(y)?(Qa(a,F,A,M),el(a)):Qa(a,F,A,M);Yn(a)}o(ts,"ReadableByteStreamControllerEnqueue");function ar(a,u){let y=a._controlledReadableByteStream;y._state==="readable"&&(Bm(a),Sn(a),es(a),xh(y,u))}o(ar,"ReadableByteStreamControllerError");function Ym(a,u){let y=a._queue.shift();a._queueTotalSize-=y.byteLength,Km(a);let T=new Uint8Array(y.buffer,y.byteOffset,y.byteLength);u._chunkSteps(T)}o(Ym,"ReadableByteStreamControllerFillReadRequestFromQueue");function tl(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let u=a._pendingPullIntos.peek(),y=new Uint8Array(u.buffer,u.byteOffset+u.bytesFilled,u.byteLength-u.bytesFilled),T=Object.create(Kn.prototype);dx(T,a,y),a._byobRequest=T}return a._byobRequest}o(tl,"ReadableByteStreamControllerGetBYOBRequest");function Xm(a){let u=a._controlledReadableByteStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(Xm,"ReadableByteStreamControllerGetDesiredSize");function rs(a,u){let y=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(u===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(y.bytesFilled+u>y.byteLength)throw new RangeError("bytesWritten out of range")}y.buffer=Qr(y.buffer),Jm(a,u)}o(rs,"ReadableByteStreamControllerRespond");function ns(a,u){let y=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(u.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(y.byteOffset+y.bytesFilled!==u.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(y.bufferByteLength!==u.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(y.bytesFilled+u.byteLength>y.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let A=u.byteLength;y.buffer=Qr(u.buffer),Jm(a,A)}o(ns,"ReadableByteStreamControllerRespondWithNewView");function Qm(a,u,y,T,A,M,F){u._controlledReadableByteStream=a,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,Sn(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=M,u._pullAlgorithm=T,u._cancelAlgorithm=A,u._autoAllocateChunkSize=F,u._pendingPullIntos=new W,a._readableStreamController=u;let ie=y();f(h(ie),()=>(u._started=!0,Yn(u),null),ye=>(ar(u,ye),null))}o(Qm,"SetUpReadableByteStreamController");function lx(a,u,y){let T=Object.create(en.prototype),A,M,F;u.start!==void 0?A=o(()=>u.start(T),"startAlgorithm"):A=o(()=>{},"startAlgorithm"),u.pull!==void 0?M=o(()=>u.pull(T),"pullAlgorithm"):M=o(()=>h(void 0),"pullAlgorithm"),u.cancel!==void 0?F=o(ye=>u.cancel(ye),"cancelAlgorithm"):F=o(()=>h(void 0),"cancelAlgorithm");let ie=u.autoAllocateChunkSize;if(ie===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Qm(a,T,A,M,F,y,ie)}o(lx,"SetUpReadableByteStreamControllerFromUnderlyingSource");function dx(a,u,y){a._associatedReadableByteStreamController=u,a._view=y}o(dx,"SetUpReadableStreamBYOBRequest");function rl(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}o(rl,"byobRequestBrandCheckException");function Ii(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}o(Ii,"byteStreamControllerBrandCheckException");function px(a,u){st(a,u);let y=a?.mode;return{mode:y===void 0?void 0:fx(y,`${u} has member 'mode' that`)}}o(px,"convertReaderOptions");function fx(a,u){if(a=`${a}`,a!=="byob")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}o(fx,"convertReadableStreamReaderMode");function mx(a,u){var y;st(a,u);let T=(y=a?.min)!==null&&y!==void 0?y:1;return{min:R(T,`${u} has member 'min' that`)}}o(mx,"convertByobReadOptions");function eh(a){return new Pn(a)}o(eh,"AcquireReadableStreamBYOBReader");function th(a,u){a._reader._readIntoRequests.push(u)}o(th,"ReadableStreamAddReadIntoRequest");function hx(a,u,y){let A=a._reader._readIntoRequests.shift();y?A._closeSteps(u):A._chunkSteps(u)}o(hx,"ReadableStreamFulfillReadIntoRequest");function rh(a){return a._reader._readIntoRequests.length}o(rh,"ReadableStreamGetNumReadIntoRequests");function nl(a){let u=a._reader;return!(u===void 0||!Xn(u))}o(nl,"ReadableStreamHasBYOBReader");class Pn{static{o(this,"ReadableStreamBYOBReader")}constructor(u){if(We(u,1,"ReadableStreamBYOBReader"),$(u,"First parameter"),xn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Jn(u._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");re(this,u),this._readIntoRequests=new W}get closed(){return Xn(this)?this._closedPromise:_(os("closed"))}cancel(u=void 0){return Xn(this)?this._ownerReadableStream===void 0?_(Y("cancel")):B(this,u):_(os("cancel"))}read(u,y={}){if(!Xn(this))return _(os("read"));if(!ArrayBuffer.isView(u))return _(new TypeError("view must be an array buffer view"));if(u.byteLength===0)return _(new TypeError("view must have non-zero byteLength"));if(u.buffer.byteLength===0)return _(new TypeError("view's buffer must have non-zero byteLength"));if(En(u.buffer))return _(new TypeError("view's buffer has been detached"));let T;try{T=mx(y,"options")}catch(pe){return _(pe)}let A=T.min;if(A===0)return _(new TypeError("options.min must be greater than 0"));if(nx(u)){if(A>u.byteLength)return _(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(A>u.length)return _(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return _(Y("read from"));let M,F,ie=p((pe,we)=>{M=pe,F=we});return nh(this,u,A,{_chunkSteps:o(pe=>M({value:pe,done:!1}),"_chunkSteps"),_closeSteps:o(pe=>M({value:pe,done:!0}),"_closeSteps"),_errorSteps:o(pe=>F(pe),"_errorSteps")}),ie}releaseLock(){if(!Xn(this))throw os("releaseLock");this._ownerReadableStream!==void 0&&gx(this)}}Object.defineProperties(Pn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(Pn.prototype.cancel,"cancel"),i(Pn.prototype.read,"read"),i(Pn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Pn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Xn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof Pn}o(Xn,"IsReadableStreamBYOBReader");function nh(a,u,y,T){let A=a._ownerReadableStream;A._disturbed=!0,A._state==="errored"?T._errorSteps(A._storedError):ax(A._readableStreamController,u,y,T)}o(nh,"ReadableStreamBYOBReaderRead");function gx(a){q(a);let u=new TypeError("Reader was released");oh(a,u)}o(gx,"ReadableStreamBYOBReaderRelease");function oh(a,u){let y=a._readIntoRequests;a._readIntoRequests=new W,y.forEach(T=>{T._errorSteps(u)})}o(oh,"ReadableStreamBYOBReaderErrorReadIntoRequests");function os(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}o(os,"byobReaderBrandCheckException");function Ri(a,u){let{highWaterMark:y}=a;if(y===void 0)return u;if(Vt(y)||y<0)throw new RangeError("Invalid highWaterMark");return y}o(Ri,"ExtractHighWaterMark");function is(a){let{size:u}=a;return u||(()=>1)}o(is,"ExtractSizeAlgorithm");function as(a,u){st(a,u);let y=a?.highWaterMark,T=a?.size;return{highWaterMark:y===void 0?void 0:w(y),size:T===void 0?void 0:yx(T,`${u} has member 'size' that`)}}o(as,"convertQueuingStrategy");function yx(a,u){return pt(a,u),y=>w(a(y))}o(yx,"convertQueuingStrategySize");function vx(a,u){st(a,u);let y=a?.abort,T=a?.close,A=a?.start,M=a?.type,F=a?.write;return{abort:y===void 0?void 0:_x(y,a,`${u} has member 'abort' that`),close:T===void 0?void 0:bx(T,a,`${u} has member 'close' that`),start:A===void 0?void 0:Ex(A,a,`${u} has member 'start' that`),write:F===void 0?void 0:Sx(F,a,`${u} has member 'write' that`),type:M}}o(vx,"convertUnderlyingSink");function _x(a,u,y){return pt(a,y),T=>L(a,u,[T])}o(_x,"convertUnderlyingSinkAbortCallback");function bx(a,u,y){return pt(a,y),()=>L(a,u,[])}o(bx,"convertUnderlyingSinkCloseCallback");function Ex(a,u,y){return pt(a,y),T=>k(a,u,[T])}o(Ex,"convertUnderlyingSinkStartCallback");function Sx(a,u,y){return pt(a,y),(T,A)=>L(a,u,[T,A])}o(Sx,"convertUnderlyingSinkWriteCallback");function ih(a,u){if(!xo(a))throw new TypeError(`${u} is not a WritableStream.`)}o(ih,"assertWritableStream");function Px(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}o(Px,"isAbortSignal");let Tx=typeof AbortController=="function";function wx(){if(Tx)return new AbortController}o(wx,"createAbortController");class Tn{static{o(this,"WritableStream")}constructor(u={},y={}){u===void 0?u=null:Be(u,"First parameter");let T=as(y,"Second parameter"),A=vx(u,"First parameter");if(sh(this),A.type!==void 0)throw new RangeError("Invalid type is specified");let F=is(T),ie=Ri(T,1);jx(this,A,ie,F)}get locked(){if(!xo(this))throw ds("locked");return Ao(this)}abort(u=void 0){return xo(this)?Ao(this)?_(new TypeError("Cannot abort a stream that already has a writer")):ss(this,u):_(ds("abort"))}close(){return xo(this)?Ao(this)?_(new TypeError("Cannot close a stream that already has a writer")):Dr(this)?_(new TypeError("Cannot close an already-closing stream")):uh(this):_(ds("close"))}getWriter(){if(!xo(this))throw ds("getWriter");return ah(this)}}Object.defineProperties(Tn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(Tn.prototype.abort,"abort"),i(Tn.prototype.close,"close"),i(Tn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Tn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function ah(a){return new tn(a)}o(ah,"AcquireWritableStreamDefaultWriter");function xx(a,u,y,T,A=1,M=()=>1){let F=Object.create(Tn.prototype);sh(F);let ie=Object.create(Io.prototype);return mh(F,ie,a,u,y,T,A,M),F}o(xx,"CreateWritableStream");function sh(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new W,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}o(sh,"InitializeWritableStream");function xo(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof Tn}o(xo,"IsWritableStream");function Ao(a){return a._writer!==void 0}o(Ao,"IsWritableStreamLocked");function ss(a,u){var y;if(a._state==="closed"||a._state==="errored")return h(void 0);a._writableStreamController._abortReason=u,(y=a._writableStreamController._abortController)===null||y===void 0||y.abort(u);let T=a._state;if(T==="closed"||T==="errored")return h(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let A=!1;T==="erroring"&&(A=!0,u=void 0);let M=p((F,ie)=>{a._pendingAbortRequest={_promise:void 0,_resolve:F,_reject:ie,_reason:u,_wasAlreadyErroring:A}});return a._pendingAbortRequest._promise=M,A||il(a,u),M}o(ss,"WritableStreamAbort");function uh(a){let u=a._state;if(u==="closed"||u==="errored")return _(new TypeError(`The stream (in ${u} state) is not in the writable state and cannot be closed`));let y=p((A,M)=>{let F={_resolve:A,_reject:M};a._closeRequest=F}),T=a._writer;return T!==void 0&&a._backpressure&&u==="writable"&&fl(T),Lx(a._writableStreamController),y}o(uh,"WritableStreamClose");function Ax(a){return p((y,T)=>{let A={_resolve:y,_reject:T};a._writeRequests.push(A)})}o(Ax,"WritableStreamAddWriteRequest");function ol(a,u){if(a._state==="writable"){il(a,u);return}al(a)}o(ol,"WritableStreamDealWithRejection");function il(a,u){let y=a._writableStreamController;a._state="erroring",a._storedError=u;let T=a._writer;T!==void 0&&lh(T,u),!$x(a)&&y._started&&al(a)}o(il,"WritableStreamStartErroring");function al(a){a._state="errored",a._writableStreamController[K]();let u=a._storedError;if(a._writeRequests.forEach(A=>{A._reject(u)}),a._writeRequests=new W,a._pendingAbortRequest===void 0){us(a);return}let y=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,y._wasAlreadyErroring){y._reject(u),us(a);return}let T=a._writableStreamController[G](y._reason);f(T,()=>(y._resolve(),us(a),null),A=>(y._reject(A),us(a),null))}o(al,"WritableStreamFinishErroring");function Ix(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}o(Ix,"WritableStreamFinishInFlightWrite");function Rx(a,u){a._inFlightWriteRequest._reject(u),a._inFlightWriteRequest=void 0,ol(a,u)}o(Rx,"WritableStreamFinishInFlightWriteWithError");function Cx(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 y=a._writer;y!==void 0&&vh(y)}o(Cx,"WritableStreamFinishInFlightClose");function Ox(a,u){a._inFlightCloseRequest._reject(u),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(u),a._pendingAbortRequest=void 0),ol(a,u)}o(Ox,"WritableStreamFinishInFlightCloseWithError");function Dr(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Dr,"WritableStreamCloseQueuedOrInFlight");function $x(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}o($x,"WritableStreamHasOperationMarkedInFlight");function kx(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}o(kx,"WritableStreamMarkCloseRequestInFlight");function Dx(a){a._inFlightWriteRequest=a._writeRequests.shift()}o(Dx,"WritableStreamMarkFirstWriteRequestInFlight");function us(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let u=a._writer;u!==void 0&&dl(u,a._storedError)}o(us,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function sl(a,u){let y=a._writer;y!==void 0&&u!==a._backpressure&&(u?Wx(y):fl(y)),a._backpressure=u}o(sl,"WritableStreamUpdateBackpressure");class tn{static{o(this,"WritableStreamDefaultWriter")}constructor(u){if(We(u,1,"WritableStreamDefaultWriter"),ih(u,"First parameter"),Ao(u))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=u,u._writer=this;let y=u._state;if(y==="writable")!Dr(u)&&u._backpressure?fs(this):_h(this),ps(this);else if(y==="erroring")pl(this,u._storedError),ps(this);else if(y==="closed")_h(this),Gx(this);else{let T=u._storedError;pl(this,T),yh(this,T)}}get closed(){return Qn(this)?this._closedPromise:_(eo("closed"))}get desiredSize(){if(!Qn(this))throw eo("desiredSize");if(this._ownerWritableStream===void 0)throw Oi("desiredSize");return Mx(this)}get ready(){return Qn(this)?this._readyPromise:_(eo("ready"))}abort(u=void 0){return Qn(this)?this._ownerWritableStream===void 0?_(Oi("abort")):Nx(this,u):_(eo("abort"))}close(){if(!Qn(this))return _(eo("close"));let u=this._ownerWritableStream;return u===void 0?_(Oi("close")):Dr(u)?_(new TypeError("Cannot close an already-closing stream")):ch(this)}releaseLock(){if(!Qn(this))throw eo("releaseLock");this._ownerWritableStream!==void 0&&dh(this)}write(u=void 0){return Qn(this)?this._ownerWritableStream===void 0?_(Oi("write to")):ph(this,u):_(eo("write"))}}Object.defineProperties(tn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(tn.prototype.abort,"abort"),i(tn.prototype.close,"close"),i(tn.prototype.releaseLock,"releaseLock"),i(tn.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(tn.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Qn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof tn}o(Qn,"IsWritableStreamDefaultWriter");function Nx(a,u){let y=a._ownerWritableStream;return ss(y,u)}o(Nx,"WritableStreamDefaultWriterAbort");function ch(a){let u=a._ownerWritableStream;return uh(u)}o(ch,"WritableStreamDefaultWriterClose");function zx(a){let u=a._ownerWritableStream,y=u._state;return Dr(u)||y==="closed"?h(void 0):y==="errored"?_(u._storedError):ch(a)}o(zx,"WritableStreamDefaultWriterCloseWithErrorPropagation");function Ux(a,u){a._closedPromiseState==="pending"?dl(a,u):Hx(a,u)}o(Ux,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function lh(a,u){a._readyPromiseState==="pending"?bh(a,u):Zx(a,u)}o(lh,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function Mx(a){let u=a._ownerWritableStream,y=u._state;return y==="errored"||y==="erroring"?null:y==="closed"?0:hh(u._writableStreamController)}o(Mx,"WritableStreamDefaultWriterGetDesiredSize");function dh(a){let u=a._ownerWritableStream,y=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");lh(a,y),Ux(a,y),u._writer=void 0,a._ownerWritableStream=void 0}o(dh,"WritableStreamDefaultWriterRelease");function ph(a,u){let y=a._ownerWritableStream,T=y._writableStreamController,A=Fx(T,u);if(y!==a._ownerWritableStream)return _(Oi("write to"));let M=y._state;if(M==="errored")return _(y._storedError);if(Dr(y)||M==="closed")return _(new TypeError("The stream is closing or closed and cannot be written to"));if(M==="erroring")return _(y._storedError);let F=Ax(y);return qx(T,u,A),F}o(ph,"WritableStreamDefaultWriterWrite");let fh={};class Io{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!ul(this))throw ll("abortReason");return this._abortReason}get signal(){if(!ul(this))throw ll("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(u=void 0){if(!ul(this))throw ll("error");this._controlledWritableStream._state==="writable"&&gh(this,u)}[G](u){let y=this._abortAlgorithm(u);return cs(this),y}[K](){Sn(this)}}Object.defineProperties(Io.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Io.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function ul(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Io}o(ul,"IsWritableStreamDefaultController");function mh(a,u,y,T,A,M,F,ie){u._controlledWritableStream=a,a._writableStreamController=u,u._queue=void 0,u._queueTotalSize=void 0,Sn(u),u._abortReason=void 0,u._abortController=wx(),u._started=!1,u._strategySizeAlgorithm=ie,u._strategyHWM=F,u._writeAlgorithm=T,u._closeAlgorithm=A,u._abortAlgorithm=M;let ye=cl(u);sl(a,ye);let pe=y(),we=h(pe);f(we,()=>(u._started=!0,ls(u),null),ke=>(u._started=!0,ol(a,ke),null))}o(mh,"SetUpWritableStreamDefaultController");function jx(a,u,y,T){let A=Object.create(Io.prototype),M,F,ie,ye;u.start!==void 0?M=o(()=>u.start(A),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.write!==void 0?F=o(pe=>u.write(pe,A),"writeAlgorithm"):F=o(()=>h(void 0),"writeAlgorithm"),u.close!==void 0?ie=o(()=>u.close(),"closeAlgorithm"):ie=o(()=>h(void 0),"closeAlgorithm"),u.abort!==void 0?ye=o(pe=>u.abort(pe),"abortAlgorithm"):ye=o(()=>h(void 0),"abortAlgorithm"),mh(a,A,M,F,ie,ye,y,T)}o(jx,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function cs(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(cs,"WritableStreamDefaultControllerClearAlgorithms");function Lx(a){Jc(a,fh,0),ls(a)}o(Lx,"WritableStreamDefaultControllerClose");function Fx(a,u){try{return a._strategySizeAlgorithm(u)}catch(y){return Ci(a,y),1}}o(Fx,"WritableStreamDefaultControllerGetChunkSize");function hh(a){return a._strategyHWM-a._queueTotalSize}o(hh,"WritableStreamDefaultControllerGetDesiredSize");function qx(a,u,y){try{Jc(a,u,y)}catch(A){Ci(a,A);return}let T=a._controlledWritableStream;if(!Dr(T)&&T._state==="writable"){let A=cl(a);sl(T,A)}ls(a)}o(qx,"WritableStreamDefaultControllerWrite");function ls(a){let u=a._controlledWritableStream;if(!a._started||u._inFlightWriteRequest!==void 0)return;if(u._state==="erroring"){al(u);return}if(a._queue.length===0)return;let T=rx(a);T===fh?Bx(a):Vx(a,T)}o(ls,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Ci(a,u){a._controlledWritableStream._state==="writable"&&gh(a,u)}o(Ci,"WritableStreamDefaultControllerErrorIfNeeded");function Bx(a){let u=a._controlledWritableStream;kx(u),Kc(a);let y=a._closeAlgorithm();cs(a),f(y,()=>(Cx(u),null),T=>(Ox(u,T),null))}o(Bx,"WritableStreamDefaultControllerProcessClose");function Vx(a,u){let y=a._controlledWritableStream;Dx(y);let T=a._writeAlgorithm(u);f(T,()=>{Ix(y);let A=y._state;if(Kc(a),!Dr(y)&&A==="writable"){let M=cl(a);sl(y,M)}return ls(a),null},A=>(y._state==="writable"&&cs(a),Rx(y,A),null))}o(Vx,"WritableStreamDefaultControllerProcessWrite");function cl(a){return hh(a)<=0}o(cl,"WritableStreamDefaultControllerGetBackpressure");function gh(a,u){let y=a._controlledWritableStream;cs(a),il(y,u)}o(gh,"WritableStreamDefaultControllerError");function ds(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}o(ds,"streamBrandCheckException$2");function ll(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}o(ll,"defaultControllerBrandCheckException$2");function eo(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}o(eo,"defaultWriterBrandCheckException");function Oi(a){return new TypeError("Cannot "+a+" a stream using a released writer")}o(Oi,"defaultWriterLockException");function ps(a){a._closedPromise=p((u,y)=>{a._closedPromise_resolve=u,a._closedPromise_reject=y,a._closedPromiseState="pending"})}o(ps,"defaultWriterClosedPromiseInitialize");function yh(a,u){ps(a),dl(a,u)}o(yh,"defaultWriterClosedPromiseInitializeAsRejected");function Gx(a){ps(a),vh(a)}o(Gx,"defaultWriterClosedPromiseInitializeAsResolved");function dl(a,u){a._closedPromise_reject!==void 0&&(b(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}o(dl,"defaultWriterClosedPromiseReject");function Hx(a,u){yh(a,u)}o(Hx,"defaultWriterClosedPromiseResetToRejected");function vh(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="resolved")}o(vh,"defaultWriterClosedPromiseResolve");function fs(a){a._readyPromise=p((u,y)=>{a._readyPromise_resolve=u,a._readyPromise_reject=y}),a._readyPromiseState="pending"}o(fs,"defaultWriterReadyPromiseInitialize");function pl(a,u){fs(a),bh(a,u)}o(pl,"defaultWriterReadyPromiseInitializeAsRejected");function _h(a){fs(a),fl(a)}o(_h,"defaultWriterReadyPromiseInitializeAsResolved");function bh(a,u){a._readyPromise_reject!==void 0&&(b(a._readyPromise),a._readyPromise_reject(u),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}o(bh,"defaultWriterReadyPromiseReject");function Wx(a){fs(a)}o(Wx,"defaultWriterReadyPromiseReset");function Zx(a,u){pl(a,u)}o(Zx,"defaultWriterReadyPromiseResetToRejected");function fl(a){a._readyPromise_resolve!==void 0&&(a._readyPromise_resolve(void 0),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="fulfilled")}o(fl,"defaultWriterReadyPromiseResolve");function Kx(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(Kx,"getGlobals");let ml=Kx();function Jx(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}o(Jx,"isDOMExceptionConstructor");function Yx(){let a=ml?.DOMException;return Jx(a)?a:void 0}o(Yx,"getFromGlobal");function Xx(){let a=o(function(y,T){this.message=y||"",this.name=T||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return i(a,"DOMException"),a.prototype=Object.create(Error.prototype),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,configurable:!0}),a}o(Xx,"createPolyfill");let Qx=Yx()||Xx();function Eh(a,u,y,T,A,M){let F=j(a),ie=ah(u);a._disturbed=!0;let ye=!1,pe=h(void 0);return p((we,ke)=>{let Xe;if(M!==void 0){if(Xe=o(()=>{let me=M.reason!==void 0?M.reason:new Qx("Aborted","AbortError"),ze=[];T||ze.push(()=>u._state==="writable"?ss(u,me):h(void 0)),A||ze.push(()=>a._state==="readable"?Er(a,me):h(void 0)),Nt(()=>Promise.all(ze.map(Qe=>Qe())),!0,me)},"abortAlgorithm"),M.aborted){Xe();return}M.addEventListener("abort",Xe)}function Sr(){return p((me,ze)=>{function Qe(Gt){Gt?me():m($o(),Qe,ze)}o(Qe,"next"),Qe(!1)})}o(Sr,"pipeLoop");function $o(){return ye?h(!0):m(ie._readyPromise,()=>p((me,ze)=>{ce(F,{_chunkSteps:o(Qe=>{pe=m(ph(ie,Qe),void 0,e),me(!1)},"_chunkSteps"),_closeSteps:o(()=>me(!0),"_closeSteps"),_errorSteps:ze})}))}if(o($o,"pipeStep"),nn(a,F._closedPromise,me=>(T?sr(!0,me):Nt(()=>ss(u,me),!0,me),null)),nn(u,ie._closedPromise,me=>(A?sr(!0,me):Nt(()=>Er(a,me),!0,me),null)),Ot(a,F._closedPromise,()=>(y?sr():Nt(()=>zx(ie)),null)),Dr(u)||u._state==="closed"){let me=new TypeError("the destination writable stream closed before all data could be piped to it");A?sr(!0,me):Nt(()=>Er(a,me),!0,me)}b(Sr());function In(){let me=pe;return m(pe,()=>me!==pe?In():void 0)}o(In,"waitForWritesToFinish");function nn(me,ze,Qe){me._state==="errored"?Qe(me._storedError):g(ze,Qe)}o(nn,"isOrBecomesErrored");function Ot(me,ze,Qe){me._state==="closed"?Qe():l(ze,Qe)}o(Ot,"isOrBecomesClosed");function Nt(me,ze,Qe){if(ye)return;ye=!0,u._state==="writable"&&!Dr(u)?l(In(),Gt):Gt();function Gt(){return f(me(),()=>on(ze,Qe),ko=>on(!0,ko)),null}o(Gt,"doTheRest")}o(Nt,"shutdownWithAction");function sr(me,ze){ye||(ye=!0,u._state==="writable"&&!Dr(u)?l(In(),()=>on(me,ze)):on(me,ze))}o(sr,"shutdown");function on(me,ze){return dh(ie),q(F),M!==void 0&&M.removeEventListener("abort",Xe),me?ke(ze):we(void 0),null}o(on,"finalize")})}o(Eh,"ReadableStreamPipeTo");class rn{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ms(this))throw gs("desiredSize");return hl(this)}close(){if(!ms(this))throw gs("close");if(!Co(this))throw new TypeError("The stream is not in a state that permits close");to(this)}enqueue(u=void 0){if(!ms(this))throw gs("enqueue");if(!Co(this))throw new TypeError("The stream is not in a state that permits enqueue");return Ro(this,u)}error(u=void 0){if(!ms(this))throw gs("error");br(this,u)}[te](u){Sn(this);let y=this._cancelAlgorithm(u);return hs(this),y}[X](u){let y=this._controlledReadableStream;if(this._queue.length>0){let T=Kc(this);this._closeRequested&&this._queue.length===0?(hs(this),Di(y)):$i(this),u._chunkSteps(T)}else I(y,u),$i(this)}[Te](){}}Object.defineProperties(rn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(rn.prototype.close,"close"),i(rn.prototype.enqueue,"enqueue"),i(rn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(rn.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function ms(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof rn}o(ms,"IsReadableStreamDefaultController");function $i(a){if(!Sh(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let y=a._pullAlgorithm();f(y,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,$i(a)),null),T=>(br(a,T),null))}o($i,"ReadableStreamDefaultControllerCallPullIfNeeded");function Sh(a){let u=a._controlledReadableStream;return!Co(a)||!a._started?!1:!!(xn(u)&&U(u)>0||hl(a)>0)}o(Sh,"ReadableStreamDefaultControllerShouldCallPull");function hs(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(hs,"ReadableStreamDefaultControllerClearAlgorithms");function to(a){if(!Co(a))return;let u=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(hs(a),Di(u))}o(to,"ReadableStreamDefaultControllerClose");function Ro(a,u){if(!Co(a))return;let y=a._controlledReadableStream;if(xn(y)&&U(y)>0)C(y,u,!1);else{let T;try{T=a._strategySizeAlgorithm(u)}catch(A){throw br(a,A),A}try{Jc(a,u,T)}catch(A){throw br(a,A),A}}$i(a)}o(Ro,"ReadableStreamDefaultControllerEnqueue");function br(a,u){let y=a._controlledReadableStream;y._state==="readable"&&(Sn(a),hs(a),xh(y,u))}o(br,"ReadableStreamDefaultControllerError");function hl(a){let u=a._controlledReadableStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(hl,"ReadableStreamDefaultControllerGetDesiredSize");function eA(a){return!Sh(a)}o(eA,"ReadableStreamDefaultControllerHasBackpressure");function Co(a){let u=a._controlledReadableStream._state;return!a._closeRequested&&u==="readable"}o(Co,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Ph(a,u,y,T,A,M,F){u._controlledReadableStream=a,u._queue=void 0,u._queueTotalSize=void 0,Sn(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=F,u._strategyHWM=M,u._pullAlgorithm=T,u._cancelAlgorithm=A,a._readableStreamController=u;let ie=y();f(h(ie),()=>(u._started=!0,$i(u),null),ye=>(br(u,ye),null))}o(Ph,"SetUpReadableStreamDefaultController");function tA(a,u,y,T){let A=Object.create(rn.prototype),M,F,ie;u.start!==void 0?M=o(()=>u.start(A),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.pull!==void 0?F=o(()=>u.pull(A),"pullAlgorithm"):F=o(()=>h(void 0),"pullAlgorithm"),u.cancel!==void 0?ie=o(ye=>u.cancel(ye),"cancelAlgorithm"):ie=o(()=>h(void 0),"cancelAlgorithm"),Ph(a,A,M,F,ie,y,T)}o(tA,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function gs(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}o(gs,"defaultControllerBrandCheckException$1");function rA(a,u){return Jn(a._readableStreamController)?oA(a):nA(a)}o(rA,"ReadableStreamTee");function nA(a,u){let y=j(a),T=!1,A=!1,M=!1,F=!1,ie,ye,pe,we,ke,Xe=p(Ot=>{ke=Ot});function Sr(){return T?(A=!0,h(void 0)):(T=!0,ce(y,{_chunkSteps:o(Nt=>{E(()=>{A=!1;let sr=Nt,on=Nt;M||Ro(pe._readableStreamController,sr),F||Ro(we._readableStreamController,on),T=!1,A&&Sr()})},"_chunkSteps"),_closeSteps:o(()=>{T=!1,M||to(pe._readableStreamController),F||to(we._readableStreamController),(!M||!F)&&ke(void 0)},"_closeSteps"),_errorSteps:o(()=>{T=!1},"_errorSteps")}),h(void 0))}o(Sr,"pullAlgorithm");function $o(Ot){if(M=!0,ie=Ot,F){let Nt=Ze([ie,ye]),sr=Er(a,Nt);ke(sr)}return Xe}o($o,"cancel1Algorithm");function In(Ot){if(F=!0,ye=Ot,M){let Nt=Ze([ie,ye]),sr=Er(a,Nt);ke(sr)}return Xe}o(In,"cancel2Algorithm");function nn(){}return o(nn,"startAlgorithm"),pe=ki(nn,Sr,$o),we=ki(nn,Sr,In),g(y._closedPromise,Ot=>(br(pe._readableStreamController,Ot),br(we._readableStreamController,Ot),(!M||!F)&&ke(void 0),null)),[pe,we]}o(nA,"ReadableStreamDefaultTee");function oA(a){let u=j(a),y=!1,T=!1,A=!1,M=!1,F=!1,ie,ye,pe,we,ke,Xe=p(me=>{ke=me});function Sr(me){g(me._closedPromise,ze=>(me!==u||(ar(pe._readableStreamController,ze),ar(we._readableStreamController,ze),(!M||!F)&&ke(void 0)),null))}o(Sr,"forwardReaderError");function $o(){Xn(u)&&(q(u),u=j(a),Sr(u)),ce(u,{_chunkSteps:o(ze=>{E(()=>{T=!1,A=!1;let Qe=ze,Gt=ze;if(!M&&!F)try{Gt=Fm(ze)}catch(ko){ar(pe._readableStreamController,ko),ar(we._readableStreamController,ko),ke(Er(a,ko));return}M||ts(pe._readableStreamController,Qe),F||ts(we._readableStreamController,Gt),y=!1,T?nn():A&&Ot()})},"_chunkSteps"),_closeSteps:o(()=>{y=!1,M||Ai(pe._readableStreamController),F||Ai(we._readableStreamController),pe._readableStreamController._pendingPullIntos.length>0&&rs(pe._readableStreamController,0),we._readableStreamController._pendingPullIntos.length>0&&rs(we._readableStreamController,0),(!M||!F)&&ke(void 0)},"_closeSteps"),_errorSteps:o(()=>{y=!1},"_errorSteps")})}o($o,"pullWithDefaultReader");function In(me,ze){se(u)&&(q(u),u=eh(a),Sr(u));let Qe=ze?we:pe,Gt=ze?pe:we;nh(u,me,1,{_chunkSteps:o(Do=>{E(()=>{T=!1,A=!1;let No=ze?F:M;if(ze?M:F)No||ns(Qe._readableStreamController,Do);else{let jh;try{jh=Fm(Do)}catch(bl){ar(Qe._readableStreamController,bl),ar(Gt._readableStreamController,bl),ke(Er(a,bl));return}No||ns(Qe._readableStreamController,Do),ts(Gt._readableStreamController,jh)}y=!1,T?nn():A&&Ot()})},"_chunkSteps"),_closeSteps:o(Do=>{y=!1;let No=ze?F:M,Ts=ze?M:F;No||Ai(Qe._readableStreamController),Ts||Ai(Gt._readableStreamController),Do!==void 0&&(No||ns(Qe._readableStreamController,Do),!Ts&&Gt._readableStreamController._pendingPullIntos.length>0&&rs(Gt._readableStreamController,0)),(!No||!Ts)&&ke(void 0)},"_closeSteps"),_errorSteps:o(()=>{y=!1},"_errorSteps")})}o(In,"pullWithBYOBReader");function nn(){if(y)return T=!0,h(void 0);y=!0;let me=tl(pe._readableStreamController);return me===null?$o():In(me._view,!1),h(void 0)}o(nn,"pull1Algorithm");function Ot(){if(y)return A=!0,h(void 0);y=!0;let me=tl(we._readableStreamController);return me===null?$o():In(me._view,!0),h(void 0)}o(Ot,"pull2Algorithm");function Nt(me){if(M=!0,ie=me,F){let ze=Ze([ie,ye]),Qe=Er(a,ze);ke(Qe)}return Xe}o(Nt,"cancel1Algorithm");function sr(me){if(F=!0,ye=me,M){let ze=Ze([ie,ye]),Qe=Er(a,ze);ke(Qe)}return Xe}o(sr,"cancel2Algorithm");function on(){}return o(on,"startAlgorithm"),pe=wh(on,nn,Nt),we=wh(on,Ot,sr),Sr(u),[pe,we]}o(oA,"ReadableByteStreamTee");function iA(a){return r(a)&&typeof a.getReader<"u"}o(iA,"isReadableStreamLike");function aA(a){return iA(a)?uA(a.getReader()):sA(a)}o(aA,"ReadableStreamFrom");function sA(a){let u,y=Lm(a,"async"),T=e;function A(){let F;try{F=Xw(y)}catch(ye){return _(ye)}let ie=h(F);return v(ie,ye=>{if(!r(ye))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(Qw(ye))to(u._readableStreamController);else{let we=ex(ye);Ro(u._readableStreamController,we)}})}o(A,"pullAlgorithm");function M(F){let ie=y.iterator,ye;try{ye=Xa(ie,"return")}catch(ke){return _(ke)}if(ye===void 0)return h(void 0);let pe;try{pe=k(ye,ie,[F])}catch(ke){return _(ke)}let we=h(pe);return v(we,ke=>{if(!r(ke))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(M,"cancelAlgorithm"),u=ki(T,A,M,0),u}o(sA,"ReadableStreamFromIterable");function uA(a){let u,y=e;function T(){let M;try{M=a.read()}catch(F){return _(F)}return v(M,F=>{if(!r(F))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(F.done)to(u._readableStreamController);else{let ie=F.value;Ro(u._readableStreamController,ie)}})}o(T,"pullAlgorithm");function A(M){try{return h(a.cancel(M))}catch(F){return _(F)}}return o(A,"cancelAlgorithm"),u=ki(y,T,A,0),u}o(uA,"ReadableStreamFromDefaultReader");function cA(a,u){st(a,u);let y=a,T=y?.autoAllocateChunkSize,A=y?.cancel,M=y?.pull,F=y?.start,ie=y?.type;return{autoAllocateChunkSize:T===void 0?void 0:R(T,`${u} has member 'autoAllocateChunkSize' that`),cancel:A===void 0?void 0:lA(A,y,`${u} has member 'cancel' that`),pull:M===void 0?void 0:dA(M,y,`${u} has member 'pull' that`),start:F===void 0?void 0:pA(F,y,`${u} has member 'start' that`),type:ie===void 0?void 0:fA(ie,`${u} has member 'type' that`)}}o(cA,"convertUnderlyingDefaultOrByteSource");function lA(a,u,y){return pt(a,y),T=>L(a,u,[T])}o(lA,"convertUnderlyingSourceCancelCallback");function dA(a,u,y){return pt(a,y),T=>L(a,u,[T])}o(dA,"convertUnderlyingSourcePullCallback");function pA(a,u,y){return pt(a,y),T=>k(a,u,[T])}o(pA,"convertUnderlyingSourceStartCallback");function fA(a,u){if(a=`${a}`,a!=="bytes")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}o(fA,"convertReadableStreamType");function mA(a,u){return st(a,u),{preventCancel:!!a?.preventCancel}}o(mA,"convertIteratorOptions");function Th(a,u){st(a,u);let y=a?.preventAbort,T=a?.preventCancel,A=a?.preventClose,M=a?.signal;return M!==void 0&&hA(M,`${u} has member 'signal' that`),{preventAbort:!!y,preventCancel:!!T,preventClose:!!A,signal:M}}o(Th,"convertPipeOptions");function hA(a,u){if(!Px(a))throw new TypeError(`${u} is not an AbortSignal.`)}o(hA,"assertAbortSignal");function gA(a,u){st(a,u);let y=a?.readable;S(y,"readable","ReadableWritablePair"),$(y,`${u} has member 'readable' that`);let T=a?.writable;return S(T,"writable","ReadableWritablePair"),ih(T,`${u} has member 'writable' that`),{readable:y,writable:T}}o(gA,"convertReadableWritablePair");class Rt{static{o(this,"ReadableStream")}constructor(u={},y={}){u===void 0?u=null:Be(u,"First parameter");let T=as(y,"Second parameter"),A=cA(u,"First parameter");if(gl(this),A.type==="bytes"){if(T.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let M=Ri(T,0);lx(this,A,M)}else{let M=is(T),F=Ri(T,1);tA(this,A,F,M)}}get locked(){if(!wn(this))throw ro("locked");return xn(this)}cancel(u=void 0){return wn(this)?xn(this)?_(new TypeError("Cannot cancel a stream that already has a reader")):Er(this,u):_(ro("cancel"))}getReader(u=void 0){if(!wn(this))throw ro("getReader");return px(u,"First parameter").mode===void 0?j(this):eh(this)}pipeThrough(u,y={}){if(!wn(this))throw ro("pipeThrough");We(u,1,"pipeThrough");let T=gA(u,"First parameter"),A=Th(y,"Second parameter");if(xn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Ao(T.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let M=Eh(this,T.writable,A.preventClose,A.preventAbort,A.preventCancel,A.signal);return b(M),T.readable}pipeTo(u,y={}){if(!wn(this))return _(ro("pipeTo"));if(u===void 0)return _("Parameter 1 is required in 'pipeTo'.");if(!xo(u))return _(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let T;try{T=Th(y,"Second parameter")}catch(A){return _(A)}return xn(this)?_(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Ao(u)?_(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Eh(this,u,T.preventClose,T.preventAbort,T.preventCancel,T.signal)}tee(){if(!wn(this))throw ro("tee");let u=rA(this);return Ze(u)}values(u=void 0){if(!wn(this))throw ro("values");let y=mA(u,"First parameter");return So(this,y.preventCancel)}[Zc](u){return this.values(u)}static from(u){return aA(u)}}Object.defineProperties(Rt,{from:{enumerable:!0}}),Object.defineProperties(Rt.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(Rt.from,"from"),i(Rt.prototype.cancel,"cancel"),i(Rt.prototype.getReader,"getReader"),i(Rt.prototype.pipeThrough,"pipeThrough"),i(Rt.prototype.pipeTo,"pipeTo"),i(Rt.prototype.tee,"tee"),i(Rt.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rt.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Rt.prototype,Zc,{value:Rt.prototype.values,writable:!0,configurable:!0});function ki(a,u,y,T=1,A=()=>1){let M=Object.create(Rt.prototype);gl(M);let F=Object.create(rn.prototype);return Ph(M,F,a,u,y,T,A),M}o(ki,"CreateReadableStream");function wh(a,u,y){let T=Object.create(Rt.prototype);gl(T);let A=Object.create(en.prototype);return Qm(T,A,a,u,y,0,void 0),T}o(wh,"CreateReadableByteStream");function gl(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}o(gl,"InitializeReadableStream");function wn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof Rt}o(wn,"IsReadableStream");function xn(a){return a._reader!==void 0}o(xn,"IsReadableStreamLocked");function Er(a,u){if(a._disturbed=!0,a._state==="closed")return h(void 0);if(a._state==="errored")return _(a._storedError);Di(a);let y=a._reader;if(y!==void 0&&Xn(y)){let A=y._readIntoRequests;y._readIntoRequests=new W,A.forEach(M=>{M._closeSteps(void 0)})}let T=a._readableStreamController[te](u);return v(T,e)}o(Er,"ReadableStreamCancel");function Di(a){a._state="closed";let u=a._reader;if(u!==void 0&&(Ve(u),se(u))){let y=u._readRequests;u._readRequests=new W,y.forEach(T=>{T._closeSteps()})}}o(Di,"ReadableStreamClose");function xh(a,u){a._state="errored",a._storedError=u;let y=a._reader;y!==void 0&&(Ie(y,u),se(y)?tt(y,u):oh(y,u))}o(xh,"ReadableStreamError");function ro(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}o(ro,"streamBrandCheckException$1");function Ah(a,u){st(a,u);let y=a?.highWaterMark;return S(y,"highWaterMark","QueuingStrategyInit"),{highWaterMark:w(y)}}o(Ah,"convertQueuingStrategyInit");let Ih=o(a=>a.byteLength,"byteLengthSizeFunction");i(Ih,"size");class ys{static{o(this,"ByteLengthQueuingStrategy")}constructor(u){We(u,1,"ByteLengthQueuingStrategy"),u=Ah(u,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!Ch(this))throw Rh("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Ch(this))throw Rh("size");return Ih}}Object.defineProperties(ys.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ys.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function Rh(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}o(Rh,"byteLengthBrandCheckException");function Ch(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof ys}o(Ch,"IsByteLengthQueuingStrategy");let Oh=o(()=>1,"countSizeFunction");i(Oh,"size");class vs{static{o(this,"CountQueuingStrategy")}constructor(u){We(u,1,"CountQueuingStrategy"),u=Ah(u,"First parameter"),this._countQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!kh(this))throw $h("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!kh(this))throw $h("size");return Oh}}Object.defineProperties(vs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(vs.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function $h(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}o($h,"countBrandCheckException");function kh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof vs}o(kh,"IsCountQueuingStrategy");function yA(a,u){st(a,u);let y=a?.cancel,T=a?.flush,A=a?.readableType,M=a?.start,F=a?.transform,ie=a?.writableType;return{cancel:y===void 0?void 0:EA(y,a,`${u} has member 'cancel' that`),flush:T===void 0?void 0:vA(T,a,`${u} has member 'flush' that`),readableType:A,start:M===void 0?void 0:_A(M,a,`${u} has member 'start' that`),transform:F===void 0?void 0:bA(F,a,`${u} has member 'transform' that`),writableType:ie}}o(yA,"convertTransformer");function vA(a,u,y){return pt(a,y),T=>L(a,u,[T])}o(vA,"convertTransformerFlushCallback");function _A(a,u,y){return pt(a,y),T=>k(a,u,[T])}o(_A,"convertTransformerStartCallback");function bA(a,u,y){return pt(a,y),(T,A)=>L(a,u,[T,A])}o(bA,"convertTransformerTransformCallback");function EA(a,u,y){return pt(a,y),T=>L(a,u,[T])}o(EA,"convertTransformerCancelCallback");class _s{static{o(this,"TransformStream")}constructor(u={},y={},T={}){u===void 0&&(u=null);let A=as(y,"Second parameter"),M=as(T,"Third parameter"),F=yA(u,"First parameter");if(F.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(F.writableType!==void 0)throw new RangeError("Invalid writableType specified");let ie=Ri(M,0),ye=is(M),pe=Ri(A,1),we=is(A),ke,Xe=p(Sr=>{ke=Sr});SA(this,Xe,pe,we,ie,ye),TA(this,F),F.start!==void 0?ke(F.start(this._transformStreamController)):ke(void 0)}get readable(){if(!Dh(this))throw Mh("readable");return this._readable}get writable(){if(!Dh(this))throw Mh("writable");return this._writable}}Object.defineProperties(_s.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(_s.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function SA(a,u,y,T,A,M){function F(){return u}o(F,"startAlgorithm");function ie(Xe){return AA(a,Xe)}o(ie,"writeAlgorithm");function ye(Xe){return IA(a,Xe)}o(ye,"abortAlgorithm");function pe(){return RA(a)}o(pe,"closeAlgorithm"),a._writable=xx(F,ie,pe,ye,y,T);function we(){return CA(a)}o(we,"pullAlgorithm");function ke(Xe){return OA(a,Xe)}o(ke,"cancelAlgorithm"),a._readable=ki(F,we,ke,A,M),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,bs(a,!0),a._transformStreamController=void 0}o(SA,"InitializeTransformStream");function Dh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof _s}o(Dh,"IsTransformStream");function Nh(a,u){br(a._readable._readableStreamController,u),yl(a,u)}o(Nh,"TransformStreamError");function yl(a,u){Ss(a._transformStreamController),Ci(a._writable._writableStreamController,u),vl(a)}o(yl,"TransformStreamErrorWritableAndUnblockWrite");function vl(a){a._backpressure&&bs(a,!1)}o(vl,"TransformStreamUnblockWrite");function bs(a,u){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=p(y=>{a._backpressureChangePromise_resolve=y}),a._backpressure=u}o(bs,"TransformStreamSetBackpressure");class An{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Es(this))throw Ps("desiredSize");let u=this._controlledTransformStream._readable._readableStreamController;return hl(u)}enqueue(u=void 0){if(!Es(this))throw Ps("enqueue");zh(this,u)}error(u=void 0){if(!Es(this))throw Ps("error");wA(this,u)}terminate(){if(!Es(this))throw Ps("terminate");xA(this)}}Object.defineProperties(An.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(An.prototype.enqueue,"enqueue"),i(An.prototype.error,"error"),i(An.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(An.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function Es(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof An}o(Es,"IsTransformStreamDefaultController");function PA(a,u,y,T,A){u._controlledTransformStream=a,a._transformStreamController=u,u._transformAlgorithm=y,u._flushAlgorithm=T,u._cancelAlgorithm=A,u._finishPromise=void 0,u._finishPromise_resolve=void 0,u._finishPromise_reject=void 0}o(PA,"SetUpTransformStreamDefaultController");function TA(a,u){let y=Object.create(An.prototype),T,A,M;u.transform!==void 0?T=o(F=>u.transform(F,y),"transformAlgorithm"):T=o(F=>{try{return zh(y,F),h(void 0)}catch(ie){return _(ie)}},"transformAlgorithm"),u.flush!==void 0?A=o(()=>u.flush(y),"flushAlgorithm"):A=o(()=>h(void 0),"flushAlgorithm"),u.cancel!==void 0?M=o(F=>u.cancel(F),"cancelAlgorithm"):M=o(()=>h(void 0),"cancelAlgorithm"),PA(a,y,T,A,M)}o(TA,"SetUpTransformStreamDefaultControllerFromTransformer");function Ss(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}o(Ss,"TransformStreamDefaultControllerClearAlgorithms");function zh(a,u){let y=a._controlledTransformStream,T=y._readable._readableStreamController;if(!Co(T))throw new TypeError("Readable side is not in a state that permits enqueue");try{Ro(T,u)}catch(M){throw yl(y,M),y._readable._storedError}eA(T)!==y._backpressure&&bs(y,!0)}o(zh,"TransformStreamDefaultControllerEnqueue");function wA(a,u){Nh(a._controlledTransformStream,u)}o(wA,"TransformStreamDefaultControllerError");function Uh(a,u){let y=a._transformAlgorithm(u);return v(y,void 0,T=>{throw Nh(a._controlledTransformStream,T),T})}o(Uh,"TransformStreamDefaultControllerPerformTransform");function xA(a){let u=a._controlledTransformStream,y=u._readable._readableStreamController;to(y);let T=new TypeError("TransformStream terminated");yl(u,T)}o(xA,"TransformStreamDefaultControllerTerminate");function AA(a,u){let y=a._transformStreamController;if(a._backpressure){let T=a._backpressureChangePromise;return v(T,()=>{let A=a._writable;if(A._state==="erroring")throw A._storedError;return Uh(y,u)})}return Uh(y,u)}o(AA,"TransformStreamDefaultSinkWriteAlgorithm");function IA(a,u){let y=a._transformStreamController;if(y._finishPromise!==void 0)return y._finishPromise;let T=a._readable;y._finishPromise=p((M,F)=>{y._finishPromise_resolve=M,y._finishPromise_reject=F});let A=y._cancelAlgorithm(u);return Ss(y),f(A,()=>(T._state==="errored"?Oo(y,T._storedError):(br(T._readableStreamController,u),_l(y)),null),M=>(br(T._readableStreamController,M),Oo(y,M),null)),y._finishPromise}o(IA,"TransformStreamDefaultSinkAbortAlgorithm");function RA(a){let u=a._transformStreamController;if(u._finishPromise!==void 0)return u._finishPromise;let y=a._readable;u._finishPromise=p((A,M)=>{u._finishPromise_resolve=A,u._finishPromise_reject=M});let T=u._flushAlgorithm();return Ss(u),f(T,()=>(y._state==="errored"?Oo(u,y._storedError):(to(y._readableStreamController),_l(u)),null),A=>(br(y._readableStreamController,A),Oo(u,A),null)),u._finishPromise}o(RA,"TransformStreamDefaultSinkCloseAlgorithm");function CA(a){return bs(a,!1),a._backpressureChangePromise}o(CA,"TransformStreamDefaultSourcePullAlgorithm");function OA(a,u){let y=a._transformStreamController;if(y._finishPromise!==void 0)return y._finishPromise;let T=a._writable;y._finishPromise=p((M,F)=>{y._finishPromise_resolve=M,y._finishPromise_reject=F});let A=y._cancelAlgorithm(u);return Ss(y),f(A,()=>(T._state==="errored"?Oo(y,T._storedError):(Ci(T._writableStreamController,u),vl(a),_l(y)),null),M=>(Ci(T._writableStreamController,M),vl(a),Oo(y,M),null)),y._finishPromise}o(OA,"TransformStreamDefaultSourceCancelAlgorithm");function Ps(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}o(Ps,"defaultControllerBrandCheckException");function _l(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(_l,"defaultControllerFinishPromiseResolve");function Oo(a,u){a._finishPromise_reject!==void 0&&(b(a._finishPromise),a._finishPromise_reject(u),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Oo,"defaultControllerFinishPromiseReject");function Mh(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}o(Mh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=ys,t.CountQueuingStrategy=vs,t.ReadableByteStreamController=en,t.ReadableStream=Rt,t.ReadableStreamBYOBReader=Pn,t.ReadableStreamBYOBRequest=Kn,t.ReadableStreamDefaultController=rn,t.ReadableStreamDefaultReader=V,t.TransformStream=_s,t.TransformStreamDefaultController=An,t.WritableStream=Tn,t.WritableStreamDefaultController=Io,t.WritableStreamDefaultWriter=tn})});var Yb=D(()=>{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,Jb())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=o(function(r){let n=0,i=this;return new ReadableStream({type:"bytes",async pull(s){let d=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=d.byteLength,s.enqueue(new Uint8Array(d)),n===i.size&&s.close()}})},"name"))}catch{}});async function*Fd(t,e=!0){for(let r of t)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let n=r.byteOffset,i=r.byteOffset+r.byteLength;for(;n!==i;){let s=Math.min(i-n,Xb),c=r.buffer.slice(n,n+s);n+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let n=0,i=r;for(;n!==i.size;){let c=await i.slice(n,Math.min(i.size,n+Xb)).arrayBuffer();n+=c.byteLength,yield new Uint8Array(c)}}}var p9,Xb,Qb,n$,wr,ca=St(()=>{p9=rt(Yb(),1);Xb=65536;o(Fd,"toIterator");Qb=class qd{static{o(this,"Blob")}#e=[];#t="";#r=0;#n="transparent";constructor(e=[],r={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let n=new TextEncoder;for(let s of e){let c;ArrayBuffer.isView(s)?c=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?c=new Uint8Array(s.slice(0)):s instanceof qd?c=s:c=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of Fd(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 Fd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Fd(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let n=await e.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,n=""){let{size:i}=this,s=e<0?Math.max(i+e,0):Math.min(e,i),c=r<0?Math.max(i+r,0):Math.min(r,i),d=Math.max(c-s,0),p=this.#e,h=[],_=0;for(let f of p){if(_>=d)break;let l=ArrayBuffer.isView(f)?f.byteLength:f.size;if(s&&l<=s)s-=l,c-=l;else{let g;ArrayBuffer.isView(f)?(g=f.subarray(s,Math.min(l,c)),_+=g.byteLength):(g=f.slice(s,Math.min(l,c)),_+=g.size),c-=l,h.push(g),s=0}}let m=new qd([],{type:String(n).toLowerCase()});return m.#r=d,m.#e=h,m}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(Qb.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});n$=Qb,wr=n$});var o$,i$,Ln,Bd=St(()=>{ca();o$=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])}},i$=o$,Ln=i$});function rE(t,e=wr){var r=`${eE()}${eE()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
|
|
15
15
|
Content-Disposition: form-data; name="`;return t.forEach((s,c)=>typeof s=="string"?n.push(i+Vd(c)+`"\r
|
|
16
16
|
\r
|
|
17
17
|
${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
@@ -20,53 +20,53 @@ ${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
|
20
20
|
Content-Type: ${s.type||"application/octet-stream"}\r
|
|
21
21
|
\r
|
|
22
22
|
`,s,`\r
|
|
23
|
-
`)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var la,
|
|
24
|
-
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),uo=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"),Fn=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[la](){return"FormData"}[
|
|
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=et.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:s,boundary:c,boundaryChars:d,index:p,state:h,flags:_}=this,m=this.boundary.length,f=m-1,l=e.length,g,v,b=o(J=>{this[J+"Mark"]=r},"mark"),E=o(J=>{delete this[J+"Mark"]},"clear"),k=o((J,W,G,K)=>{(W===void 0||W!==G)&&this[J](K&&K.subarray(W,G))},"callback"),L=o((J,W)=>{let G=J+"Mark";G in this&&(W?(k(J,this[G],r,e),delete this[G]):(k(J,this[G],e.length,e),this[G]=0))},"dataCallback");for(r=0;r<n;r++)switch(g=e[r],h){case et.START_BOUNDARY:if(p===c.length-2){if(g===pa)_|=qn.LAST_BOUNDARY;else if(g!==Pu)return;p++;break}else if(p-1===c.length-2){if(_&qn.LAST_BOUNDARY&&g===pa)h=et.END,_=0;else if(!(_&qn.LAST_BOUNDARY)&&g===Su)p=0,k("onPartBegin"),h=et.HEADER_FIELD_START;else return;break}g!==c[p+2]&&(p=-2),g===c[p+2]&&p++;break;case et.HEADER_FIELD_START:h=et.HEADER_FIELD,b("onHeaderField"),p=0;case et.HEADER_FIELD:if(g===Pu){E("onHeaderField"),h=et.HEADERS_ALMOST_DONE;break}if(p++,g===pa)break;if(g===o$){if(p===1)return;L("onHeaderField",!0),h=et.HEADER_VALUE_START;break}if(v=s$(g),v<i$||v>a$)return;break;case et.HEADER_VALUE_START:if(g===n$)break;b("onHeaderValue"),h=et.HEADER_VALUE;case et.HEADER_VALUE:g===Pu&&(L("onHeaderValue",!0),k("onHeaderEnd"),h=et.HEADER_VALUE_ALMOST_DONE);break;case et.HEADER_VALUE_ALMOST_DONE:if(g!==Su)return;h=et.HEADER_FIELD_START;break;case et.HEADERS_ALMOST_DONE:if(g!==Su)return;k("onHeadersEnd"),h=et.PART_DATA_START;break;case et.PART_DATA_START:h=et.PART_DATA,b("onPartData");case et.PART_DATA:if(i=p,p===0){for(r+=f;r<l&&!(e[r]in d);)r+=m;r-=f,g=e[r]}if(p<c.length)c[p]===g?(p===0&&L("onPartData",!0),p++):p=0;else if(p===c.length)p++,g===Pu?_|=qn.PART_BOUNDARY:g===pa?_|=qn.LAST_BOUNDARY:p=0;else if(p-1===c.length)if(_&qn.PART_BOUNDARY){if(p=0,g===Su){_&=~qn.PART_BOUNDARY,k("onPartEnd"),k("onPartBegin"),h=et.HEADER_FIELD_START;break}}else _&qn.LAST_BOUNDARY&&g===pa?(k("onPartEnd"),h=et.END,_=0):p=0;if(p>0)s[p-1]=g;else if(i>0){let J=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);k("onPartData",0,i,J),i=0,b("onPartData"),r--}break;case et.END:break;default:throw new Error(`Unexpected state entered: ${h}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=p,this.state=h,this.flags=_}end(){if(this.state===et.HEADER_FIELD_START&&this.index===0||this.state===et.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==et.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o(u$,"_fileName");o(c$,"toFormData")});async function Jd(t){if(t[Ft].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Ft].disturbed=!0,t[Ft].error)throw t[Ft].error;let{body:e}=t;if(e===null)return Kt.Buffer.alloc(0);if(!(e instanceof fr.default))return Kt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let s=new kt(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}n+=i.length,r.push(i)}}catch(i){throw i instanceof pn?i:new kt(`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")?Kt.Buffer.from(r.join("")):Kt.Buffer.concat(r,n)}catch(i){throw new kt(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new kt(`Premature close of server response while trying to fetch ${t.url}`)}var fr,fn,Kt,l$,Ft,jr,ei,d$,Tu,gE,yE,wu=St(()=>{fr=rt(require("node:stream"),1),fn=require("node:util"),Kt=require("node:buffer");ca();yu();Gd();vu();bu();l$=(0,fn.promisify)(fr.default.pipeline),Ft=Symbol("Body internals"),jr=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:Hd(e)?e=Kt.Buffer.from(e.toString()):da(e)||Kt.Buffer.isBuffer(e)||(fn.types.isAnyArrayBuffer(e)?e=Kt.Buffer.from(e):ArrayBuffer.isView(e)?e=Kt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof fr.default||(e instanceof Fn?(e=Qb(e),n=e.type.split("=")[1]):e=Kt.Buffer.from(String(e))));let i=e;Kt.Buffer.isBuffer(e)?i=fr.default.Readable.from(e):da(e)&&(i=fr.default.Readable.from(e.stream())),this[Ft]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof fr.default&&e.on("error",s=>{let c=s instanceof pn?s:new kt(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[Ft].error=c})}get body(){return this[Ft].stream}get bodyUsed(){return this[Ft].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await Jd(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 Fn,i=new URLSearchParams(await this.text());for(let[s,c]of i)n.append(s,c);return n}let{toFormData:r}=await Promise.resolve().then(()=>(hE(),mE));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Ft].body&&this[Ft].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 Jd(this);return new TextDecoder().decode(e)}buffer(){return Jd(this)}};jr.prototype.buffer=(0,fn.deprecate)(jr.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(jr.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,fn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(Jd,"consumeBody");ei=o((t,e)=>{let r,n,{body:i}=t[Ft];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof fr.default&&typeof i.getBoundary!="function"&&(r=new fr.PassThrough({highWaterMark:e}),n=new fr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[Ft].stream=r,i=n),i},"clone"),d$=(0,fn.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=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Hd(t)?"application/x-www-form-urlencoded;charset=UTF-8":da(t)?t.type||null:Kt.Buffer.isBuffer(t)||fn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Fn?`multipart/form-data; boundary=${e[Ft].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${d$(t)}`:t instanceof fr.default?null:"text/plain;charset=UTF-8","extractContentType"),gE=o(t=>{let{body:e}=t[Ft];return e===null?0:da(e)?e.size:Kt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),yE=o(async(t,{body:e})=>{e===null?t.end():await l$(e,t)},"writeToStream")});function vE(t=[]){return new qt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return xu(e),Xd(e,String(r)),!0}catch{return!1}}))}var Yd,fa,xu,Xd,qt,Au=St(()=>{Yd=require("node:util"),fa=rt(require("node:http"),1),xu=typeof fa.default.validateHeaderName=="function"?fa.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}},Xd=typeof fa.default.validateHeaderValue=="function"?fa.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}},qt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,s]of Object.entries(n))r.push(...s.map(c=>[i,c]))}else if(e!=null)if(typeof e=="object"&&!Yd.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"||Yd.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])=>(xu(n),Xd(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,s){switch(i){case"append":case"set":return(c,d)=>(xu(c),Xd(c,String(d)),URLSearchParams.prototype[i].call(n,String(c).toLowerCase(),String(d)));case"delete":case"has":case"getAll":return c=>(xu(c),URLSearchParams.prototype[i].call(n,String(c).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(qt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(vE,"fromRawHeaders")});var p$,ma,Qd=St(()=>{p$=new Set([301,302,303,307,308]),ma=o(t=>p$.has(t),"isRedirect")});var xr,Jt,_E=St(()=>{Au();wu();Qd();xr=Symbol("Response internals"),Jt=class t extends jr{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new qt(r.headers);if(e!==null&&!i.has("Content-Type")){let s=Tu(e,this);s&&i.append("Content-Type",s)}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(ei(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(!ma(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 qt(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(Jt.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 bE,EE=St(()=>{bE=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 SE(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 xE(t){if(!TE.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function f$(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,PE.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 ti(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:f$(t)}function AE(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let n=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,s=SE(i),c=SE(i,!0);s.toString().length>4096&&(s=c),e&&(s=e(s)),r&&(c=r(c));let d=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return s;case"strict-origin":return ti(s)&&!ti(d)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return s.origin===d.origin?s:ti(s)&&!ti(d)?"no-referrer":c;case"same-origin":return s.origin===d.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===d.origin?s:c;case"no-referrer-when-downgrade":return ti(s)&&!ti(d)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function IE(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&TE.has(n)&&(r=n);return r}var PE,TE,wE,ep=St(()=>{PE=require("node:net");o(SE,"stripURLForUseAsAReferrer");TE=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),wE="strict-origin-when-cross-origin";o(xE,"validateReferrerPolicy");o(f$,"isOriginPotentiallyTrustworthy");o(ti,"isUrlPotentiallyTrustworthy");o(AE,"determineRequestsReferrer");o(IE,"parseReferrerPolicyFromHeader")});var RE,CE,At,ha,m$,Bn,OE,$E=St(()=>{RE=require("node:url"),CE=require("node:util");Au();wu();bu();EE();ep();At=Symbol("Request internals"),ha=o(t=>typeof t=="object"&&typeof t[At]=="object","isRequest"),m$=(0,CE.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Bn=class t extends jr{static{o(this,"Request")}constructor(e,r={}){let n;if(ha(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()),!ha(r)&&"data"in r&&m$(),(r.body!=null||ha(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:ha(e)&&e.body!==null?ei(e):null;super(s,{size:r.size||e.size||0});let c=new qt(r.headers||e.headers||{});if(s!==null&&!c.has("Content-Type")){let h=Tu(s,this);h&&c.set("Content-Type",h)}let d=ha(e)?e.signal:null;if("signal"in r&&(d=r.signal),d!=null&&!eE(d))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let p=r.referrer==null?e.referrer:r.referrer;if(p==="")p="no-referrer";else if(p){let h=new URL(p);p=/^about:(\/\/)?client$/.test(h)?"client":h}else p=void 0;this[At]={method:i,redirect:r.redirect||e.redirect||"follow",headers:c,parsedURL:n,signal:d,referrer:p},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,RE.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=xE(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Bn.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}});OE=o(t=>{let{parsedURL:e}=t[At],r=new qt(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 d=gE(t);typeof d=="number"&&!Number.isNaN(d)&&(n=String(d))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=wE),t.referrer&&t.referrer!=="no-referrer"?t[At].referrer=AE(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:i}=t;typeof i=="function"&&(i=i(e));let s=bE(e),c={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:c}},"getNodeRequestOptions")});var ga,kE=St(()=>{vu();ga=class extends pn{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var zE={};ws(zE,{AbortError:()=>ga,Blob:()=>wr,FetchError:()=>kt,File:()=>Ln,FormData:()=>Fn,Headers:()=>qt,Request:()=>Bn,Response:()=>Jt,blobFrom:()=>uE,blobFromSync:()=>sE,default:()=>tp,fileFrom:()=>cE,fileFromSync:()=>lE,isRedirect:()=>ma});async function tp(t,e){return new Promise((r,n)=>{let i=new Bn(t,e),{parsedURL:s,options:c}=OE(i);if(!h$.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let g=Vb(i.url),v=new Jt(g,{headers:{"Content-Type":g.typeFull}});r(v);return}let d=(s.protocol==="https:"?NE.default:DE.default).request,{signal:p}=i,h=null,_=o(()=>{let g=new ga("The operation was aborted.");n(g),i.body&&i.body instanceof Yt.default.Readable&&i.body.destroy(g),!(!h||!h.body)&&h.body.emit("error",g)},"abort");if(p&&p.aborted){_();return}let m=o(()=>{_(),l()},"abortAndFinalize"),f=d(s.toString(),c);p&&p.addEventListener("abort",m);let l=o(()=>{f.abort(),p&&p.removeEventListener("abort",m)},"finalize");f.on("error",g=>{n(new kt(`request to ${i.url} failed, reason: ${g.message}`,"system",g)),l()}),g$(f,g=>{h&&h.body&&h.body.destroy(g)}),process.version<"v14"&&f.on("socket",g=>{let v;g.prependListener("end",()=>{v=g._eventsCount}),g.prependListener("close",b=>{if(h&&v<g._eventsCount&&!b){let E=new Error("Premature close");E.code="ERR_STREAM_PREMATURE_CLOSE",h.body.emit("error",E)}})}),f.on("response",g=>{f.setTimeout(0);let v=vE(g.rawHeaders);if(ma(g.statusCode)){let J=v.get("Location"),W=null;try{W=J===null?null:new URL(J,i.url)}catch{if(i.redirect!=="manual"){n(new kt(`uri requested responds with an invalid redirect URL: ${J}`,"invalid-redirect")),l();return}}switch(i.redirect){case"error":n(new kt(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),l();return;case"manual":break;case"follow":{if(W===null)break;if(i.counter>=i.follow){n(new kt(`maximum redirect reached at: ${i.url}`,"max-redirect")),l();return}let G={headers:new qt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:ei(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!tE(i.url,W)||!rE(i.url,W))for(let te of["authorization","www-authenticate","cookie","cookie2"])G.headers.delete(te);if(g.statusCode!==303&&i.body&&e.body instanceof Yt.default.Readable){n(new kt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),l();return}(g.statusCode===303||(g.statusCode===301||g.statusCode===302)&&i.method==="POST")&&(G.method="GET",G.body=void 0,G.headers.delete("content-length"));let K=IE(v);K&&(G.referrerPolicy=K),r(tp(new Bn(W,G))),l();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}p&&g.once("end",()=>{p.removeEventListener("abort",m)});let b=(0,Yt.pipeline)(g,new Yt.PassThrough,J=>{J&&n(J)});process.version<"v12.10"&&g.on("aborted",m);let E={url:i.url,status:g.statusCode,statusText:g.statusMessage,headers:v,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},k=v.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||k===null||g.statusCode===204||g.statusCode===304){h=new Jt(b,E),r(h);return}let L={flush:po.default.Z_SYNC_FLUSH,finishFlush:po.default.Z_SYNC_FLUSH};if(k==="gzip"||k==="x-gzip"){b=(0,Yt.pipeline)(b,po.default.createGunzip(L),J=>{J&&n(J)}),h=new Jt(b,E),r(h);return}if(k==="deflate"||k==="x-deflate"){let J=(0,Yt.pipeline)(g,new Yt.PassThrough,W=>{W&&n(W)});J.once("data",W=>{(W[0]&15)===8?b=(0,Yt.pipeline)(b,po.default.createInflate(),G=>{G&&n(G)}):b=(0,Yt.pipeline)(b,po.default.createInflateRaw(),G=>{G&&n(G)}),h=new Jt(b,E),r(h)}),J.once("end",()=>{h||(h=new Jt(b,E),r(h))});return}if(k==="br"){b=(0,Yt.pipeline)(b,po.default.createBrotliDecompress(),J=>{J&&n(J)}),h=new Jt(b,E),r(h);return}h=new Jt(b,E),r(h)}),yE(f,i).catch(n)})}function g$(t,e){let r=ya.Buffer.from(`0\r
|
|
23
|
+
`)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var la,a$,s$,eE,u$,tE,Vd,uo,Fn,gu=St(()=>{ca();Bd();({toStringTag:la,iterator:a$,hasInstance:s$}=Symbol),eE=Math.random,u$="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),tE=o((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[la])?[(r=r!==void 0?r+"":e[la]=="File"?e.name:"blob",t),e.name!==r||e[la]=="blob"?new Ln([e],r,e):e]:[t,e+""]),"f"),Vd=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"),uo=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"),Fn=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[la](){return"FormData"}[a$](){return this.entries()}static[s$](e){return e&&typeof e=="object"&&e[la]==="FormData"&&!u$.some(r=>typeof e[r]!="function")}append(...e){uo("append",arguments,2),this.#e.push(tE(...e))}delete(e){uo("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){uo("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 uo("getAll",arguments,1),r=[],e+="",this.#e.forEach(n=>n[0]===e&&r.push(n[1])),r}has(e){return uo("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){uo("forEach",arguments,1);for(var[n,i]of this)e.call(r,i,n,this)}set(...e){uo("set",arguments,2);var r=[],n=!0;e=tE(...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(rE,"formDataToBlob")});var pn,yu=St(()=>{pn=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 kt,Gd=St(()=>{yu();kt=class extends pn{static{o(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var vu,Hd,da,nE,oE,iE,_u=St(()=>{vu=Symbol.toStringTag,Hd=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[vu]==="URLSearchParams","isURLSearchParameters"),da=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[vu]),"isBlob"),nE=o(t=>typeof t=="object"&&(t[vu]==="AbortSignal"||t[vu]==="EventTarget"),"isAbortSignal"),oE=o((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),iE=o((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var sE=D((O9,aE)=>{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)}aE.exports=globalThis.DOMException});var co,uE,cE,Wd,lE,dE,pE,fE,mE,hE,bu,Zd=St(()=>{co=require("node:fs"),uE=require("node:path"),cE=rt(sE(),1);Bd();ca();({stat:Wd}=co.promises),lE=o((t,e)=>mE((0,co.statSync)(t),t,e),"blobFromSync"),dE=o((t,e)=>Wd(t).then(r=>mE(r,t,e)),"blobFrom"),pE=o((t,e)=>Wd(t).then(r=>hE(r,t,e)),"fileFrom"),fE=o((t,e)=>hE((0,co.statSync)(t),t,e),"fileFromSync"),mE=o((t,e,r="")=>new wr([new bu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),hE=o((t,e,r="")=>new Ln([new bu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,uE.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),bu=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 Wd(this.#e);if(e>this.lastModified)throw new cE.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,co.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var yE={};ws(yE,{toFormData:()=>h$});function m$(t){let e=t.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let r=e[2]||e[3]||"",n=r.slice(r.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,(i,s)=>String.fromCharCode(s)),n}async function h$(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 Kd(r[1]||r[2]),i,s,c,d,p,h,_=[],m=new Fn,f=o(E=>{c+=b.decode(E,{stream:!0})},"onPartData"),l=o(E=>{_.push(E)},"appendToFile"),g=o(()=>{let E=new Ln(_,h,{type:p});m.append(d,E)},"appendFileToFormData"),v=o(()=>{m.append(d,c)},"appendEntryToFormData"),b=new TextDecoder("utf-8");b.decode(),n.onPartBegin=function(){n.onPartData=f,n.onPartEnd=v,i="",s="",c="",d="",p="",h=null,_.length=0},n.onHeaderField=function(E){i+=b.decode(E,{stream:!0})},n.onHeaderValue=function(E){s+=b.decode(E,{stream:!0})},n.onHeaderEnd=function(){if(s+=b.decode(),i=i.toLowerCase(),i==="content-disposition"){let E=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);E&&(d=E[2]||E[3]||""),h=m$(s),h&&(n.onPartData=l,n.onPartEnd=g)}else i==="content-type"&&(p=s);s="",i=""};for await(let E of t)n.write(E);return n.end(),m}var Mr,et,gE,qn,Eu,Su,c$,pa,l$,d$,p$,f$,lo,Kd,vE=St(()=>{Zd();gu();Mr=0,et={START_BOUNDARY:Mr++,HEADER_FIELD_START:Mr++,HEADER_FIELD:Mr++,HEADER_VALUE_START:Mr++,HEADER_VALUE:Mr++,HEADER_VALUE_ALMOST_DONE:Mr++,HEADERS_ALMOST_DONE:Mr++,PART_DATA_START:Mr++,PART_DATA:Mr++,END:Mr++},gE=1,qn={PART_BOUNDARY:gE,LAST_BOUNDARY:gE*=2},Eu=10,Su=13,c$=32,pa=45,l$=58,d$=97,p$=122,f$=o(t=>t|32,"lower"),lo=o(()=>{},"noop"),Kd=class{static{o(this,"MultipartParser")}constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=lo,this.onHeaderField=lo,this.onHeadersEnd=lo,this.onHeaderValue=lo,this.onPartBegin=lo,this.onPartData=lo,this.onPartEnd=lo,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=et.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:s,boundary:c,boundaryChars:d,index:p,state:h,flags:_}=this,m=this.boundary.length,f=m-1,l=e.length,g,v,b=o(J=>{this[J+"Mark"]=r},"mark"),E=o(J=>{delete this[J+"Mark"]},"clear"),k=o((J,W,G,K)=>{(W===void 0||W!==G)&&this[J](K&&K.subarray(W,G))},"callback"),L=o((J,W)=>{let G=J+"Mark";G in this&&(W?(k(J,this[G],r,e),delete this[G]):(k(J,this[G],e.length,e),this[G]=0))},"dataCallback");for(r=0;r<n;r++)switch(g=e[r],h){case et.START_BOUNDARY:if(p===c.length-2){if(g===pa)_|=qn.LAST_BOUNDARY;else if(g!==Su)return;p++;break}else if(p-1===c.length-2){if(_&qn.LAST_BOUNDARY&&g===pa)h=et.END,_=0;else if(!(_&qn.LAST_BOUNDARY)&&g===Eu)p=0,k("onPartBegin"),h=et.HEADER_FIELD_START;else return;break}g!==c[p+2]&&(p=-2),g===c[p+2]&&p++;break;case et.HEADER_FIELD_START:h=et.HEADER_FIELD,b("onHeaderField"),p=0;case et.HEADER_FIELD:if(g===Su){E("onHeaderField"),h=et.HEADERS_ALMOST_DONE;break}if(p++,g===pa)break;if(g===l$){if(p===1)return;L("onHeaderField",!0),h=et.HEADER_VALUE_START;break}if(v=f$(g),v<d$||v>p$)return;break;case et.HEADER_VALUE_START:if(g===c$)break;b("onHeaderValue"),h=et.HEADER_VALUE;case et.HEADER_VALUE:g===Su&&(L("onHeaderValue",!0),k("onHeaderEnd"),h=et.HEADER_VALUE_ALMOST_DONE);break;case et.HEADER_VALUE_ALMOST_DONE:if(g!==Eu)return;h=et.HEADER_FIELD_START;break;case et.HEADERS_ALMOST_DONE:if(g!==Eu)return;k("onHeadersEnd"),h=et.PART_DATA_START;break;case et.PART_DATA_START:h=et.PART_DATA,b("onPartData");case et.PART_DATA:if(i=p,p===0){for(r+=f;r<l&&!(e[r]in d);)r+=m;r-=f,g=e[r]}if(p<c.length)c[p]===g?(p===0&&L("onPartData",!0),p++):p=0;else if(p===c.length)p++,g===Su?_|=qn.PART_BOUNDARY:g===pa?_|=qn.LAST_BOUNDARY:p=0;else if(p-1===c.length)if(_&qn.PART_BOUNDARY){if(p=0,g===Eu){_&=~qn.PART_BOUNDARY,k("onPartEnd"),k("onPartBegin"),h=et.HEADER_FIELD_START;break}}else _&qn.LAST_BOUNDARY&&g===pa?(k("onPartEnd"),h=et.END,_=0):p=0;if(p>0)s[p-1]=g;else if(i>0){let J=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);k("onPartData",0,i,J),i=0,b("onPartData"),r--}break;case et.END:break;default:throw new Error(`Unexpected state entered: ${h}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=p,this.state=h,this.flags=_}end(){if(this.state===et.HEADER_FIELD_START&&this.index===0||this.state===et.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==et.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o(m$,"_fileName");o(h$,"toFormData")});async function Jd(t){if(t[Ft].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Ft].disturbed=!0,t[Ft].error)throw t[Ft].error;let{body:e}=t;if(e===null)return Kt.Buffer.alloc(0);if(!(e instanceof fr.default))return Kt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let s=new kt(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}n+=i.length,r.push(i)}}catch(i){throw i instanceof pn?i:new kt(`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")?Kt.Buffer.from(r.join("")):Kt.Buffer.concat(r,n)}catch(i){throw new kt(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new kt(`Premature close of server response while trying to fetch ${t.url}`)}var fr,fn,Kt,g$,Ft,jr,ti,y$,Pu,_E,bE,Tu=St(()=>{fr=rt(require("node:stream"),1),fn=require("node:util"),Kt=require("node:buffer");ca();gu();Gd();yu();_u();g$=(0,fn.promisify)(fr.default.pipeline),Ft=Symbol("Body internals"),jr=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:Hd(e)?e=Kt.Buffer.from(e.toString()):da(e)||Kt.Buffer.isBuffer(e)||(fn.types.isAnyArrayBuffer(e)?e=Kt.Buffer.from(e):ArrayBuffer.isView(e)?e=Kt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof fr.default||(e instanceof Fn?(e=rE(e),n=e.type.split("=")[1]):e=Kt.Buffer.from(String(e))));let i=e;Kt.Buffer.isBuffer(e)?i=fr.default.Readable.from(e):da(e)&&(i=fr.default.Readable.from(e.stream())),this[Ft]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof fr.default&&e.on("error",s=>{let c=s instanceof pn?s:new kt(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[Ft].error=c})}get body(){return this[Ft].stream}get bodyUsed(){return this[Ft].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await Jd(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 Fn,i=new URLSearchParams(await this.text());for(let[s,c]of i)n.append(s,c);return n}let{toFormData:r}=await Promise.resolve().then(()=>(vE(),yE));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Ft].body&&this[Ft].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 Jd(this);return new TextDecoder().decode(e)}buffer(){return Jd(this)}};jr.prototype.buffer=(0,fn.deprecate)(jr.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(jr.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,fn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(Jd,"consumeBody");ti=o((t,e)=>{let r,n,{body:i}=t[Ft];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof fr.default&&typeof i.getBoundary!="function"&&(r=new fr.PassThrough({highWaterMark:e}),n=new fr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[Ft].stream=r,i=n),i},"clone"),y$=(0,fn.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"),Pu=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Hd(t)?"application/x-www-form-urlencoded;charset=UTF-8":da(t)?t.type||null:Kt.Buffer.isBuffer(t)||fn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Fn?`multipart/form-data; boundary=${e[Ft].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${y$(t)}`:t instanceof fr.default?null:"text/plain;charset=UTF-8","extractContentType"),_E=o(t=>{let{body:e}=t[Ft];return e===null?0:da(e)?e.size:Kt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),bE=o(async(t,{body:e})=>{e===null?t.end():await g$(e,t)},"writeToStream")});function EE(t=[]){return new qt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return wu(e),Xd(e,String(r)),!0}catch{return!1}}))}var Yd,fa,wu,Xd,qt,xu=St(()=>{Yd=require("node:util"),fa=rt(require("node:http"),1),wu=typeof fa.default.validateHeaderName=="function"?fa.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}},Xd=typeof fa.default.validateHeaderValue=="function"?fa.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}},qt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,s]of Object.entries(n))r.push(...s.map(c=>[i,c]))}else if(e!=null)if(typeof e=="object"&&!Yd.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"||Yd.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),Xd(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,s){switch(i){case"append":case"set":return(c,d)=>(wu(c),Xd(c,String(d)),URLSearchParams.prototype[i].call(n,String(c).toLowerCase(),String(d)));case"delete":case"has":case"getAll":return c=>(wu(c),URLSearchParams.prototype[i].call(n,String(c).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(qt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(EE,"fromRawHeaders")});var v$,ma,Qd=St(()=>{v$=new Set([301,302,303,307,308]),ma=o(t=>v$.has(t),"isRedirect")});var xr,Jt,SE=St(()=>{xu();Tu();Qd();xr=Symbol("Response internals"),Jt=class t extends jr{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new qt(r.headers);if(e!==null&&!i.has("Content-Type")){let s=Pu(e,this);s&&i.append("Content-Type",s)}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(ti(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(!ma(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 qt(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(Jt.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 PE,TE=St(()=>{PE=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 wE(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 RE(t){if(!AE.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function _$(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,xE.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 ri(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:_$(t)}function CE(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let n=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,s=wE(i),c=wE(i,!0);s.toString().length>4096&&(s=c),e&&(s=e(s)),r&&(c=r(c));let d=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return s;case"strict-origin":return ri(s)&&!ri(d)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return s.origin===d.origin?s:ri(s)&&!ri(d)?"no-referrer":c;case"same-origin":return s.origin===d.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===d.origin?s:c;case"no-referrer-when-downgrade":return ri(s)&&!ri(d)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function OE(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&AE.has(n)&&(r=n);return r}var xE,AE,IE,ep=St(()=>{xE=require("node:net");o(wE,"stripURLForUseAsAReferrer");AE=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),IE="strict-origin-when-cross-origin";o(RE,"validateReferrerPolicy");o(_$,"isOriginPotentiallyTrustworthy");o(ri,"isUrlPotentiallyTrustworthy");o(CE,"determineRequestsReferrer");o(OE,"parseReferrerPolicyFromHeader")});var $E,kE,At,ha,b$,Bn,DE,NE=St(()=>{$E=require("node:url"),kE=require("node:util");xu();Tu();_u();TE();ep();At=Symbol("Request internals"),ha=o(t=>typeof t=="object"&&typeof t[At]=="object","isRequest"),b$=(0,kE.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Bn=class t extends jr{static{o(this,"Request")}constructor(e,r={}){let n;if(ha(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()),!ha(r)&&"data"in r&&b$(),(r.body!=null||ha(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:ha(e)&&e.body!==null?ti(e):null;super(s,{size:r.size||e.size||0});let c=new qt(r.headers||e.headers||{});if(s!==null&&!c.has("Content-Type")){let h=Pu(s,this);h&&c.set("Content-Type",h)}let d=ha(e)?e.signal:null;if("signal"in r&&(d=r.signal),d!=null&&!nE(d))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let p=r.referrer==null?e.referrer:r.referrer;if(p==="")p="no-referrer";else if(p){let h=new URL(p);p=/^about:(\/\/)?client$/.test(h)?"client":h}else p=void 0;this[At]={method:i,redirect:r.redirect||e.redirect||"follow",headers:c,parsedURL:n,signal:d,referrer:p},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,$E.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=RE(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Bn.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}});DE=o(t=>{let{parsedURL:e}=t[At],r=new qt(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 d=_E(t);typeof d=="number"&&!Number.isNaN(d)&&(n=String(d))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=IE),t.referrer&&t.referrer!=="no-referrer"?t[At].referrer=CE(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:i}=t;typeof i=="function"&&(i=i(e));let s=PE(e),c={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:c}},"getNodeRequestOptions")});var ga,zE=St(()=>{yu();ga=class extends pn{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var jE={};ws(jE,{AbortError:()=>ga,Blob:()=>wr,FetchError:()=>kt,File:()=>Ln,FormData:()=>Fn,Headers:()=>qt,Request:()=>Bn,Response:()=>Jt,blobFrom:()=>dE,blobFromSync:()=>lE,default:()=>tp,fileFrom:()=>pE,fileFromSync:()=>fE,isRedirect:()=>ma});async function tp(t,e){return new Promise((r,n)=>{let i=new Bn(t,e),{parsedURL:s,options:c}=DE(i);if(!E$.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let g=Wb(i.url),v=new Jt(g,{headers:{"Content-Type":g.typeFull}});r(v);return}let d=(s.protocol==="https:"?ME.default:UE.default).request,{signal:p}=i,h=null,_=o(()=>{let g=new ga("The operation was aborted.");n(g),i.body&&i.body instanceof Yt.default.Readable&&i.body.destroy(g),!(!h||!h.body)&&h.body.emit("error",g)},"abort");if(p&&p.aborted){_();return}let m=o(()=>{_(),l()},"abortAndFinalize"),f=d(s.toString(),c);p&&p.addEventListener("abort",m);let l=o(()=>{f.abort(),p&&p.removeEventListener("abort",m)},"finalize");f.on("error",g=>{n(new kt(`request to ${i.url} failed, reason: ${g.message}`,"system",g)),l()}),S$(f,g=>{h&&h.body&&h.body.destroy(g)}),process.version<"v14"&&f.on("socket",g=>{let v;g.prependListener("end",()=>{v=g._eventsCount}),g.prependListener("close",b=>{if(h&&v<g._eventsCount&&!b){let E=new Error("Premature close");E.code="ERR_STREAM_PREMATURE_CLOSE",h.body.emit("error",E)}})}),f.on("response",g=>{f.setTimeout(0);let v=EE(g.rawHeaders);if(ma(g.statusCode)){let J=v.get("Location"),W=null;try{W=J===null?null:new URL(J,i.url)}catch{if(i.redirect!=="manual"){n(new kt(`uri requested responds with an invalid redirect URL: ${J}`,"invalid-redirect")),l();return}}switch(i.redirect){case"error":n(new kt(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),l();return;case"manual":break;case"follow":{if(W===null)break;if(i.counter>=i.follow){n(new kt(`maximum redirect reached at: ${i.url}`,"max-redirect")),l();return}let G={headers:new qt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:ti(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!oE(i.url,W)||!iE(i.url,W))for(let te of["authorization","www-authenticate","cookie","cookie2"])G.headers.delete(te);if(g.statusCode!==303&&i.body&&e.body instanceof Yt.default.Readable){n(new kt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),l();return}(g.statusCode===303||(g.statusCode===301||g.statusCode===302)&&i.method==="POST")&&(G.method="GET",G.body=void 0,G.headers.delete("content-length"));let K=OE(v);K&&(G.referrerPolicy=K),r(tp(new Bn(W,G))),l();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}p&&g.once("end",()=>{p.removeEventListener("abort",m)});let b=(0,Yt.pipeline)(g,new Yt.PassThrough,J=>{J&&n(J)});process.version<"v12.10"&&g.on("aborted",m);let E={url:i.url,status:g.statusCode,statusText:g.statusMessage,headers:v,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},k=v.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||k===null||g.statusCode===204||g.statusCode===304){h=new Jt(b,E),r(h);return}let L={flush:po.default.Z_SYNC_FLUSH,finishFlush:po.default.Z_SYNC_FLUSH};if(k==="gzip"||k==="x-gzip"){b=(0,Yt.pipeline)(b,po.default.createGunzip(L),J=>{J&&n(J)}),h=new Jt(b,E),r(h);return}if(k==="deflate"||k==="x-deflate"){let J=(0,Yt.pipeline)(g,new Yt.PassThrough,W=>{W&&n(W)});J.once("data",W=>{(W[0]&15)===8?b=(0,Yt.pipeline)(b,po.default.createInflate(),G=>{G&&n(G)}):b=(0,Yt.pipeline)(b,po.default.createInflateRaw(),G=>{G&&n(G)}),h=new Jt(b,E),r(h)}),J.once("end",()=>{h||(h=new Jt(b,E),r(h))});return}if(k==="br"){b=(0,Yt.pipeline)(b,po.default.createBrotliDecompress(),J=>{J&&n(J)}),h=new Jt(b,E),r(h);return}h=new Jt(b,E),r(h)}),bE(f,i).catch(n)})}function S$(t,e){let r=ya.Buffer.from(`0\r
|
|
26
26
|
\r
|
|
27
|
-
`),n=!1,i=!1,s;t.on("response",c=>{let{headers:d}=c;n=d["transfer-encoding"]==="chunked"&&!d["content-length"]}),t.on("socket",c=>{let d=o(()=>{if(n&&!i){let h=new Error("Premature close");h.code="ERR_STREAM_PREMATURE_CLOSE",e(h)}},"onSocketClose"),p=o(h=>{i=ya.Buffer.compare(h.slice(-5),r)===0,!i&&s&&(i=ya.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&ya.Buffer.compare(h.slice(-2),r.slice(3))===0),s=h},"onData");c.prependListener("close",d),c.on("data",p),t.on("close",()=>{c.removeListener("close",d),c.removeListener("data",p)})})}var
|
|
27
|
+
`),n=!1,i=!1,s;t.on("response",c=>{let{headers:d}=c;n=d["transfer-encoding"]==="chunked"&&!d["content-length"]}),t.on("socket",c=>{let d=o(()=>{if(n&&!i){let h=new Error("Premature close");h.code="ERR_STREAM_PREMATURE_CLOSE",e(h)}},"onSocketClose"),p=o(h=>{i=ya.Buffer.compare(h.slice(-5),r)===0,!i&&s&&(i=ya.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&ya.Buffer.compare(h.slice(-2),r.slice(3))===0),s=h},"onData");c.prependListener("close",d),c.on("data",p),t.on("close",()=>{c.removeListener("close",d),c.removeListener("data",p)})})}var UE,ME,po,Yt,ya,E$,LE=St(()=>{UE=rt(require("node:http"),1),ME=rt(require("node:https"),1),po=rt(require("node:zlib"),1),Yt=rt(require("node:stream"),1),ya=require("node:buffer");Zb();Tu();SE();xu();NE();Gd();zE();Qd();gu();_u();ep();Zd();E$=new Set(["data:","http:","https:"]);o(tp,"fetch");o(S$,"fixResponseChunkedTransferBadEnding")});var BE=D(oi=>{"use strict";var P$=oi&&oi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},ni;Object.defineProperty(oi,"__esModule",{value:!0});oi.Gaxios=void 0;var T$=P$(sa()),w$=require("https"),fo=Od(),x$=Eb(),FE=require("stream"),qE=Dd(),A$=o(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),I$=204,Au=class{static{o(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new qE.GaxiosInterceptorManager,response:new qE.GaxiosInterceptorManager}}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&ni.mergeHeaders(s,r.headers),n&&ni.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}async request(e={}){let r=await this.#n(e);return r=await this.#t(r),this.#r(this._request(r))}async _defaultAdapter(e){let r=e.fetchImplementation||this.defaults.fetchImplementation||await ni.#u(),n={...e};delete n.data;let i=await r(e.url,n),s=await this.getResponseData(e,i);return Object.getOwnPropertyDescriptor(i,"data")?.configurable||Object.defineProperties(i,{data:{configurable:!0,writable:!0,enumerable:!0,value:s}}),Object.assign(i,{config:e,data:s})}async _request(e){try{let r;if(e.adapter?r=await e.adapter(e,this._defaultAdapter.bind(this)):r=await this._defaultAdapter(e),!e.validateStatus(r.status)){if(e.responseType==="stream"){let i=[];for await(let s of r.data)i.push(s);r.data=i.toString()}let n=fo.GaxiosError.extractAPIErrorFromResponse(r,`Request failed with status code ${r.status}`);throw new fo.GaxiosError(n?.message,e,r,n)}return r}catch(r){let n;r instanceof fo.GaxiosError?n=r:r instanceof Error?n=new fo.GaxiosError(r.message,e,void 0,r):n=new fo.GaxiosError("Unexpected Gaxios Error",e,void 0,r);let{shouldRetry:i,config:s}=await(0,x$.getRetryConfig)(n);if(i&&s)return n.config.retryConfig.currentRetryAttempt=s.retryConfig.currentRetryAttempt,e.retryConfig=n.config?.retryConfig,this.#o(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(n),n}}async getResponseData(e,r){if(r.status===I$)return"";if(e.maxContentLength&&r.headers.has("content-length")&&e.maxContentLength<Number.parseInt(r.headers?.get("content-length")||""))throw new fo.GaxiosError("Response's `Content-Length` is over the limit.",e,Object.assign(r,{config:e}));switch(e.responseType){case"stream":return r.body;case"json":{let n=await r.text();try{return JSON.parse(n)}catch{return n}}case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"text":return r.text();default:return this.getResponseDataFromContentType(r)}}#e(e,r=[]){let n=new URL(e),i=[...r],s=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let c of s)i.push(c.trim());for(let c of i)if(c instanceof RegExp){if(c.test(n.toString()))return!1}else if(c instanceof URL){if(c.origin===n.origin)return!1}else if(c.startsWith("*.")||c.startsWith(".")){let d=c.replace(/^\*\./,".");if(n.hostname.endsWith(d))return!1}else if(c===n.origin||c===n.hostname||c===n.href)return!1;return!0}async#t(e){let r=Promise.resolve(e);for(let n of this.interceptors.request.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#r(e){let r=Promise.resolve(e);for(let n of this.interceptors.response.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#n(e){let r=new Headers(this.defaults.headers);ni.mergeHeaders(r,e.headers);let n=(0,T$.default)(!0,{},this.defaults,e);if(!n.url)throw new Error("URL is required.");if(n.baseURL&&(n.url=new URL(n.url,n.baseURL)),n.url=new URL(n.url),n.params)if(n.paramsSerializer){let c=n.paramsSerializer(n.params);c.startsWith("?")&&(c=c.slice(1));let d=n.url.toString().includes("?")?"&":"?";n.url=n.url+d+c}else{let c=n.url instanceof URL?n.url:new URL(n.url);for(let[d,p]of new URLSearchParams(n.params))c.searchParams.append(d,p);n.url=c}typeof e.maxContentLength=="number"&&(n.size=e.maxContentLength),typeof e.maxRedirects=="number"&&(n.follow=e.maxRedirects);let i=typeof n.data=="string"||n.data instanceof ArrayBuffer||n.data instanceof Blob||globalThis.File&&n.data instanceof File||n.data instanceof FormData||n.data instanceof FE.Readable||n.data instanceof ReadableStream||n.data instanceof String||n.data instanceof URLSearchParams||ArrayBuffer.isView(n.data)||["Blob","File","FormData"].includes(n.data?.constructor?.name||"");if(n.multipart?.length){let c=await A$();r.set("content-type",`multipart/related; boundary=${c}`),n.body=FE.Readable.from(this.getMultipartRequest(n.multipart,c))}else i?n.body=n.data:typeof n.data=="object"?r.get("Content-Type")==="application/x-www-form-urlencoded"?n.body=n.paramsSerializer?n.paramsSerializer(n.data):new URLSearchParams(n.data):(r.has("content-type")||r.set("content-type","application/json"),n.body=JSON.stringify(n.data)):n.data&&(n.body=n.data);n.validateStatus=n.validateStatus||this.validateStatus,n.responseType=n.responseType||"unknown",!r.has("accept")&&n.responseType==="json"&&r.set("accept","application/json");let s=n.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!n.agent)if(s&&this.#e(n.url,n.noProxy)){let c=await ni.#s();this.agentCache.has(s)?n.agent=this.agentCache.get(s):(n.agent=new c(s,{cert:n.cert,key:n.key}),this.agentCache.set(s,n.agent))}else n.cert&&n.key&&(this.agentCache.has(n.key)?n.agent=this.agentCache.get(n.key):(n.agent=new w$.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!="function"&&n.errorRedactor!==!1&&(n.errorRedactor=fo.defaultErrorRedactor),n.body&&!("duplex"in n)&&(n.duplex="half"),this.#o(n),Object.assign(n,{headers:r,url:n.url instanceof URL?n.url:new URL(n.url)})}#o(e){if(e.timeout){let r=AbortSignal.timeout(e.timeout);e.signal&&!e.signal.aborted?e.signal=AbortSignal.any([e.signal,r]):e.signal=r}}validateStatus(e){return e>=200&&e<300}async getResponseDataFromContentType(e){let r=e.headers.get("Content-Type");if(r===null)return e.text();if(r=r.toLowerCase(),r.includes("application/json")){let n=await e.text();try{n=JSON.parse(n)}catch{}return n}else return r.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,r){let n=`--${r}--`;for(let i of e){let s=i.headers.get("Content-Type")||"application/octet-stream";yield`--${r}\r
|
|
28
28
|
Content-Type: ${s}\r
|
|
29
29
|
\r
|
|
30
30
|
`,typeof i.content=="string"?yield i.content:yield*i.content,yield`\r
|
|
31
|
-
`}yield n}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>rt(Bb()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(UE(),zE))).default,this.#a}static mergeHeaders(e,...r){e=e instanceof Headers?e:new Headers(e);for(let n of r)(n instanceof Headers?n:new Headers(n)).forEach((s,c)=>{c==="set-cookie"?e.append(c,s):e.set(c,s)});return e}};ni.Gaxios=Iu;ri=Iu});var ft=D(Dt=>{"use strict";var P$=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]}),T$=Dt&&Dt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P$(e,t,r)};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.instance=Dt.Gaxios=Dt.GaxiosError=void 0;Dt.request=x$;var FE=LE();Object.defineProperty(Dt,"Gaxios",{enumerable:!0,get:o(function(){return FE.Gaxios},"get")});var w$=Od();Object.defineProperty(Dt,"GaxiosError",{enumerable:!0,get:o(function(){return w$.GaxiosError},"get")});T$(Dd(),Dt);Dt.instance=new FE.Gaxios;async function x$(t){return Dt.instance.request(t)}o(x$,"request")});var rp=D((qE,Ru)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,s="[BigNumber Error] ",c=s+"Number primitive has more than 15 significant digits: ",d=1e14,p=14,h=9007199254740991,_=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,f=1e9;function l(W){var G,K,te,X=ee.prototype={constructor:ee,toString:null,valueOf:null},Te=new ee(1),re=20,B=4,q=-7,Y=21,Z=-1e7,oe=1e7,ae=!1,Ie=1,$e=0,Ve={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Ye="0123456789abcdefghijklmnopqrstuvwxyz",Et=!0;function ee(S,w){var x,z,R,$,j,I,C,U,N=this;if(!(N instanceof ee))return new ee(S,w);if(w==null){if(S&&S._isBigNumber===!0){N.s=S.s,!S.c||S.e>oe?N.c=N.e=null:S.e<Z?N.c=[N.e=0]:(N.e=S.e,N.c=S.c.slice());return}if((I=typeof S=="number")&&S*0==0){if(N.s=1/S<0?(S=-S,-1):1,S===~~S){for($=0,j=S;j>=10;j/=10,$++);$>oe?N.c=N.e=null:(N.e=$,N.c=[S]);return}U=String(S)}else{if(!r.test(U=String(S)))return te(N,U,I);N.s=U.charCodeAt(0)==45?(U=U.slice(1),-1):1}($=U.indexOf("."))>-1&&(U=U.replace(".","")),(j=U.search(/e/i))>0?($<0&&($=j),$+=+U.slice(j+1),U=U.substring(0,j)):$<0&&($=U.length)}else{if(E(w,2,Ye.length,"Base"),w==10&&Et)return N=new ee(S),Be(N,re+N.e+1,B);if(U=String(S),I=typeof S=="number"){if(S*0!=0)return te(N,U,I,w);if(N.s=1/S<0?(U=U.slice(1),-1):1,ee.DEBUG&&U.replace(/^0\.0*|\./,"").length>15)throw Error(c+S)}else N.s=U.charCodeAt(0)===45?(U=U.slice(1),-1):1;for(x=Ye.slice(0,w),$=j=0,C=U.length;j<C;j++)if(x.indexOf(z=U.charAt(j))<0){if(z=="."){if(j>$){$=C;continue}}else if(!R&&(U==U.toUpperCase()&&(U=U.toLowerCase())||U==U.toLowerCase()&&(U=U.toUpperCase()))){R=!0,j=-1,$=0;continue}return te(N,String(S),I,w)}I=!1,U=K(U,w,10,N.s),($=U.indexOf("."))>-1?U=U.replace(".",""):$=U.length}for(j=0;U.charCodeAt(j)===48;j++);for(C=U.length;U.charCodeAt(--C)===48;);if(U=U.slice(j,++C)){if(C-=j,I&&ee.DEBUG&&C>15&&(S>h||S!==i(S)))throw Error(c+N.s*S);if(($=$-j-1)>oe)N.c=N.e=null;else if($<Z)N.c=[N.e=0];else{if(N.e=$,N.c=[],j=($+1)%p,$<0&&(j+=p),j<C){for(j&&N.c.push(+U.slice(0,j)),C-=p;j<C;)N.c.push(+U.slice(j,j+=p));j=p-(U=U.slice(j)).length}else j-=C;for(;j--;U+="0");N.c.push(+U)}}else N.c=[N.e=0]}o(ee,"BigNumber"),ee.clone=l,ee.ROUND_UP=0,ee.ROUND_DOWN=1,ee.ROUND_CEIL=2,ee.ROUND_FLOOR=3,ee.ROUND_HALF_UP=4,ee.ROUND_HALF_DOWN=5,ee.ROUND_HALF_EVEN=6,ee.ROUND_HALF_CEIL=7,ee.ROUND_HALF_FLOOR=8,ee.EUCLID=9,ee.config=ee.set=function(S){var w,x;if(S!=null)if(typeof S=="object"){if(S.hasOwnProperty(w="DECIMAL_PLACES")&&(x=S[w],E(x,0,f,w),re=x),S.hasOwnProperty(w="ROUNDING_MODE")&&(x=S[w],E(x,0,8,w),B=x),S.hasOwnProperty(w="EXPONENTIAL_AT")&&(x=S[w],x&&x.pop?(E(x[0],-f,0,w),E(x[1],0,f,w),q=x[0],Y=x[1]):(E(x,-f,f,w),q=-(Y=x<0?-x:x))),S.hasOwnProperty(w="RANGE"))if(x=S[w],x&&x.pop)E(x[0],-f,-1,w),E(x[1],1,f,w),Z=x[0],oe=x[1];else if(E(x,-f,f,w),x)Z=-(oe=x<0?-x:x);else throw Error(s+w+" cannot be zero: "+x);if(S.hasOwnProperty(w="CRYPTO"))if(x=S[w],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ae=x;else throw ae=!x,Error(s+"crypto unavailable");else ae=x;else throw Error(s+w+" not true or false: "+x);if(S.hasOwnProperty(w="MODULO_MODE")&&(x=S[w],E(x,0,9,w),Ie=x),S.hasOwnProperty(w="POW_PRECISION")&&(x=S[w],E(x,0,f,w),$e=x),S.hasOwnProperty(w="FORMAT"))if(x=S[w],typeof x=="object")Ve=x;else throw Error(s+w+" not an object: "+x);if(S.hasOwnProperty(w="ALPHABET"))if(x=S[w],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))Et=x.slice(0,10)=="0123456789",Ye=x;else throw Error(s+w+" invalid: "+x)}else throw Error(s+"Object expected: "+S);return{DECIMAL_PLACES:re,ROUNDING_MODE:B,EXPONENTIAL_AT:[q,Y],RANGE:[Z,oe],CRYPTO:ae,MODULO_MODE:Ie,POW_PRECISION:$e,FORMAT:Ve,ALPHABET:Ye}},ee.isBigNumber=function(S){if(!S||S._isBigNumber!==!0)return!1;if(!ee.DEBUG)return!0;var w,x,z=S.c,R=S.e,$=S.s;e:if({}.toString.call(z)=="[object Array]"){if(($===1||$===-1)&&R>=-f&&R<=f&&R===i(R)){if(z[0]===0){if(R===0&&z.length===1)return!0;break e}if(w=(R+1)%p,w<1&&(w+=p),String(z[0]).length==w){for(w=0;w<z.length;w++)if(x=z[w],x<0||x>=d||x!==i(x))break e;if(x!==0)return!0}}}else if(z===null&&R===null&&($===null||$===1||$===-1))return!0;throw Error(s+"Invalid BigNumber: "+S)},ee.maximum=ee.max=function(){return pt(arguments,-1)},ee.minimum=ee.min=function(){return pt(arguments,1)},ee.random=function(){var S=9007199254740992,w=Math.random()*S&2097151?function(){return i(Math.random()*S)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var z,R,$,j,I,C=0,U=[],N=new ee(Te);if(x==null?x=re:E(x,0,f),j=n(x/p),ae)if(crypto.getRandomValues){for(z=crypto.getRandomValues(new Uint32Array(j*=2));C<j;)I=z[C]*131072+(z[C+1]>>>11),I>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),z[C]=R[0],z[C+1]=R[1]):(U.push(I%1e14),C+=2);C=j/2}else if(crypto.randomBytes){for(z=crypto.randomBytes(j*=7);C<j;)I=(z[C]&31)*281474976710656+z[C+1]*1099511627776+z[C+2]*4294967296+z[C+3]*16777216+(z[C+4]<<16)+(z[C+5]<<8)+z[C+6],I>=9e15?crypto.randomBytes(7).copy(z,C):(U.push(I%1e14),C+=7);C=j/7}else throw ae=!1,Error(s+"crypto unavailable");if(!ae)for(;C<j;)I=w(),I<9e15&&(U[C++]=I%1e14);for(j=U[--C],x%=p,j&&x&&(I=_[p-x],U[C]=i(j/I)*I);U[C]===0;U.pop(),C--);if(C<0)U=[$=0];else{for($=-1;U[0]===0;U.splice(0,1),$-=p);for(C=1,I=U[0];I>=10;I/=10,C++);C<p&&($-=p-C)}return N.e=$,N.c=U,N}}(),ee.sum=function(){for(var S=1,w=arguments,x=new ee(w[0]);S<w.length;)x=x.plus(w[S++]);return x},K=function(){var S="0123456789";function w(x,z,R,$){for(var j,I=[0],C,U=0,N=x.length;U<N;){for(C=I.length;C--;I[C]*=z);for(I[0]+=$.indexOf(x.charAt(U++)),j=0;j<I.length;j++)I[j]>R-1&&(I[j+1]==null&&(I[j+1]=0),I[j+1]+=I[j]/R|0,I[j]%=R)}return I.reverse()}return o(w,"toBaseOut"),function(x,z,R,$,j){var I,C,U,N,V,se,ce,Me,tt=x.indexOf("."),nt=re,Ue=B;for(tt>=0&&(N=$e,$e=0,x=x.replace(".",""),Me=new ee(z),se=Me.pow(x.length-tt),$e=N,Me.c=w(J(v(se.c),se.e,"0"),10,R,S),Me.e=Me.c.length),ce=w(x,z,R,j?(I=Ye,S):(I=S,Ye)),U=N=ce.length;ce[--N]==0;ce.pop());if(!ce[0])return I.charAt(0);if(tt<0?--U:(se.c=ce,se.e=U,se.s=$,se=G(se,Me,nt,Ue,R),ce=se.c,V=se.r,U=se.e),C=U+nt+1,tt=ce[C],N=R/2,V=V||C<0||ce[C+1]!=null,V=Ue<4?(tt!=null||V)&&(Ue==0||Ue==(se.s<0?3:2)):tt>N||tt==N&&(Ue==4||V||Ue==6&&ce[C-1]&1||Ue==(se.s<0?8:7)),C<1||!ce[0])x=V?J(I.charAt(1),-nt,I.charAt(0)):I.charAt(0);else{if(ce.length=C,V)for(--R;++ce[--C]>R;)ce[C]=0,C||(++U,ce=[1].concat(ce));for(N=ce.length;!ce[--N];);for(tt=0,x="";tt<=N;x+=I.charAt(ce[tt++]));x=J(x,U,I.charAt(0))}return x}}(),G=function(){function S(z,R,$){var j,I,C,U,N=0,V=z.length,se=R%m,ce=R/m|0;for(z=z.slice();V--;)C=z[V]%m,U=z[V]/m|0,j=ce*C+U*se,I=se*C+j%m*m+N,N=(I/$|0)+(j/m|0)+ce*U,z[V]=I%$;return N&&(z=[N].concat(z)),z}o(S,"multiply");function w(z,R,$,j){var I,C;if($!=j)C=$>j?1:-1;else for(I=C=0;I<$;I++)if(z[I]!=R[I]){C=z[I]>R[I]?1:-1;break}return C}o(w,"compare");function x(z,R,$,j){for(var I=0;$--;)z[$]-=I,I=z[$]<R[$]?1:0,z[$]=I*j+z[$]-R[$];for(;!z[0]&&z.length>1;z.splice(0,1));}return o(x,"subtract"),function(z,R,$,j,I){var C,U,N,V,se,ce,Me,tt,nt,Ue,qe,vt,So,Po,To,Vt,Xr,It=z.s==R.s?1:-1,_t=z.c,Ze=R.c;if(!_t||!_t[0]||!Ze||!Ze[0])return new ee(!z.s||!R.s||(_t?Ze&&_t[0]==Ze[0]:!Ze)?NaN:_t&&_t[0]==0||!Ze?It*0:It/0);for(tt=new ee(It),nt=tt.c=[],U=z.e-R.e,It=$+U+1,I||(I=d,U=g(z.e/p)-g(R.e/p),It=It/p|0),N=0;Ze[N]==(_t[N]||0);N++);if(Ze[N]>(_t[N]||0)&&U--,It<0)nt.push(1),V=!0;else{for(Po=_t.length,Vt=Ze.length,N=0,It+=2,se=i(I/(Ze[0]+1)),se>1&&(Ze=S(Ze,se,I),_t=S(_t,se,I),Vt=Ze.length,Po=_t.length),So=Vt,Ue=_t.slice(0,Vt),qe=Ue.length;qe<Vt;Ue[qe++]=0);Xr=Ze.slice(),Xr=[0].concat(Xr),To=Ze[0],Ze[1]>=I/2&&To++;do{if(se=0,C=w(Ze,Ue,Vt,qe),C<0){if(vt=Ue[0],Vt!=qe&&(vt=vt*I+(Ue[1]||0)),se=i(vt/To),se>1)for(se>=I&&(se=I-1),ce=S(Ze,se,I),Me=ce.length,qe=Ue.length;w(ce,Ue,Me,qe)==1;)se--,x(ce,Vt<Me?Xr:Ze,Me,I),Me=ce.length,C=1;else se==0&&(C=se=1),ce=Ze.slice(),Me=ce.length;if(Me<qe&&(ce=[0].concat(ce)),x(Ue,ce,qe,I),qe=Ue.length,C==-1)for(;w(Ze,Ue,Vt,qe)<1;)se++,x(Ue,Vt<qe?Xr:Ze,qe,I),qe=Ue.length}else C===0&&(se++,Ue=[0]);nt[N++]=se,Ue[0]?Ue[qe++]=_t[So]||0:(Ue=[_t[So]],qe=1)}while((So++<Po||Ue[0]!=null)&&It--);V=Ue[0]!=null,nt[0]||nt.splice(0,1)}if(I==d){for(N=1,It=nt[0];It>=10;It/=10,N++);Be(tt,$+(tt.e=N+U*p-1)+1,j,V)}else tt.e=U,tt.r=+V;return tt}}();function st(S,w,x,z){var R,$,j,I,C;if(x==null?x=B:E(x,0,8),!S.c)return S.toString();if(R=S.c[0],j=S.e,w==null)C=v(S.c),C=z==1||z==2&&(j<=q||j>=Y)?L(C,j):J(C,j,"0");else if(S=Be(new ee(S),w,x),$=S.e,C=v(S.c),I=C.length,z==1||z==2&&(w<=$||$<=q)){for(;I<w;C+="0",I++);C=L(C,$)}else if(w-=j+(z===2&&$>j),C=J(C,$,"0"),$+1>I){if(--w>0)for(C+=".";w--;C+="0");}else if(w+=$-I,w>0)for($+1==I&&(C+=".");w--;C+="0");return S.s<0&&R?"-"+C:C}o(st,"format");function pt(S,w){for(var x,z,R=1,$=new ee(S[0]);R<S.length;R++)z=new ee(S[R]),(!z.s||(x=b($,z))===w||x===0&&$.s===w)&&($=z);return $}o(pt,"maxOrMin");function Bt(S,w,x){for(var z=1,R=w.length;!w[--R];w.pop());for(R=w[0];R>=10;R/=10,z++);return(x=z+x*p-1)>oe?S.c=S.e=null:x<Z?S.c=[S.e=0]:(S.e=x,S.c=w),S}o(Bt,"normalise"),te=function(){var S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,w=/^([^.]+)\.$/,x=/^\.([^.]+)$/,z=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,j,I,C){var U,N=I?j:j.replace(R,"");if(z.test(N))$.s=isNaN(N)?null:N<0?-1:1;else{if(!I&&(N=N.replace(S,function(V,se,ce){return U=(ce=ce.toLowerCase())=="x"?16:ce=="b"?2:8,!C||C==U?se:V}),C&&(U=C,N=N.replace(w,"$1").replace(x,"0.$1")),j!=N))return new ee(N,U);if(ee.DEBUG)throw Error(s+"Not a"+(C?" base "+C:"")+" number: "+j);$.s=null}$.c=$.e=null}}();function Be(S,w,x,z){var R,$,j,I,C,U,N,V=S.c,se=_;if(V){e:{for(R=1,I=V[0];I>=10;I/=10,R++);if($=w-R,$<0)$+=p,j=w,C=V[U=0],N=i(C/se[R-j-1]%10);else if(U=n(($+1)/p),U>=V.length)if(z){for(;V.length<=U;V.push(0));C=N=0,R=1,$%=p,j=$-p+1}else break e;else{for(C=I=V[U],R=1;I>=10;I/=10,R++);$%=p,j=$-p+R,N=j<0?0:i(C/se[R-j-1]%10)}if(z=z||w<0||V[U+1]!=null||(j<0?C:C%se[R-j-1]),z=x<4?(N||z)&&(x==0||x==(S.s<0?3:2)):N>5||N==5&&(x==4||z||x==6&&($>0?j>0?C/se[R-j]:0:V[U-1])%10&1||x==(S.s<0?8:7)),w<1||!V[0])return V.length=0,z?(w-=S.e+1,V[0]=se[(p-w%p)%p],S.e=-w||0):V[0]=S.e=0,S;if($==0?(V.length=U,I=1,U--):(V.length=U+1,I=se[p-$],V[U]=j>0?i(C/se[R-j]%se[j])*I:0),z)for(;;)if(U==0){for($=1,j=V[0];j>=10;j/=10,$++);for(j=V[0]+=I,I=1;j>=10;j/=10,I++);$!=I&&(S.e++,V[0]==d&&(V[0]=1));break}else{if(V[U]+=I,V[U]!=d)break;V[U--]=0,I=1}for($=V.length;V[--$]===0;V.pop());}S.e>oe?S.c=S.e=null:S.e<Z&&(S.c=[S.e=0])}return S}o(Be,"round");function We(S){var w,x=S.e;return x===null?S.toString():(w=v(S.c),w=x<=q||x>=Y?L(w,x):J(w,x,"0"),S.s<0?"-"+w:w)}return o(We,"valueOf"),X.absoluteValue=X.abs=function(){var S=new ee(this);return S.s<0&&(S.s=1),S},X.comparedTo=function(S,w){return b(this,new ee(S,w))},X.decimalPlaces=X.dp=function(S,w){var x,z,R,$=this;if(S!=null)return E(S,0,f),w==null?w=B:E(w,0,8),Be(new ee($),S+$.e+1,w);if(!(x=$.c))return null;if(z=((R=x.length-1)-g(this.e/p))*p,R=x[R])for(;R%10==0;R/=10,z--);return z<0&&(z=0),z},X.dividedBy=X.div=function(S,w){return G(this,new ee(S,w),re,B)},X.dividedToIntegerBy=X.idiv=function(S,w){return G(this,new ee(S,w),0,1)},X.exponentiatedBy=X.pow=function(S,w){var x,z,R,$,j,I,C,U,N,V=this;if(S=new ee(S),S.c&&!S.isInteger())throw Error(s+"Exponent not an integer: "+We(S));if(w!=null&&(w=new ee(w)),I=S.e>14,!V.c||!V.c[0]||V.c[0]==1&&!V.e&&V.c.length==1||!S.c||!S.c[0])return N=new ee(Math.pow(+We(V),I?S.s*(2-k(S)):+We(S))),w?N.mod(w):N;if(C=S.s<0,w){if(w.c?!w.c[0]:!w.s)return new ee(NaN);z=!C&&V.isInteger()&&w.isInteger(),z&&(V=V.mod(w))}else{if(S.e>9&&(V.e>0||V.e<-1||(V.e==0?V.c[0]>1||I&&V.c[1]>=24e7:V.c[0]<8e13||I&&V.c[0]<=9999975e7)))return $=V.s<0&&k(S)?-0:0,V.e>-1&&($=1/$),new ee(C?1/$:$);$e&&($=n($e/p+2))}for(I?(x=new ee(.5),C&&(S.s=1),U=k(S)):(R=Math.abs(+We(S)),U=R%2),N=new ee(Te);;){if(U){if(N=N.times(V),!N.c)break;$?N.c.length>$&&(N.c.length=$):z&&(N=N.mod(w))}if(R){if(R=i(R/2),R===0)break;U=R%2}else if(S=S.times(x),Be(S,S.e+1,1),S.e>14)U=k(S);else{if(R=+We(S),R===0)break;U=R%2}V=V.times(V),$?V.c&&V.c.length>$&&(V.c.length=$):z&&(V=V.mod(w))}return z?N:(C&&(N=Te.div(N)),w?N.mod(w):$?Be(N,$e,B,j):N)},X.integerValue=function(S){var w=new ee(this);return S==null?S=B:E(S,0,8),Be(w,w.e+1,S)},X.isEqualTo=X.eq=function(S,w){return b(this,new ee(S,w))===0},X.isFinite=function(){return!!this.c},X.isGreaterThan=X.gt=function(S,w){return b(this,new ee(S,w))>0},X.isGreaterThanOrEqualTo=X.gte=function(S,w){return(w=b(this,new ee(S,w)))===1||w===0},X.isInteger=function(){return!!this.c&&g(this.e/p)>this.c.length-2},X.isLessThan=X.lt=function(S,w){return b(this,new ee(S,w))<0},X.isLessThanOrEqualTo=X.lte=function(S,w){return(w=b(this,new ee(S,w)))===-1||w===0},X.isNaN=function(){return!this.s},X.isNegative=function(){return this.s<0},X.isPositive=function(){return this.s>0},X.isZero=function(){return!!this.c&&this.c[0]==0},X.minus=function(S,w){var x,z,R,$,j=this,I=j.s;if(S=new ee(S,w),w=S.s,!I||!w)return new ee(NaN);if(I!=w)return S.s=-w,j.plus(S);var C=j.e/p,U=S.e/p,N=j.c,V=S.c;if(!C||!U){if(!N||!V)return N?(S.s=-w,S):new ee(V?j:NaN);if(!N[0]||!V[0])return V[0]?(S.s=-w,S):new ee(N[0]?j:B==3?-0:0)}if(C=g(C),U=g(U),N=N.slice(),I=C-U){for(($=I<0)?(I=-I,R=N):(U=C,R=V),R.reverse(),w=I;w--;R.push(0));R.reverse()}else for(z=($=(I=N.length)<(w=V.length))?I:w,I=w=0;w<z;w++)if(N[w]!=V[w]){$=N[w]<V[w];break}if($&&(R=N,N=V,V=R,S.s=-S.s),w=(z=V.length)-(x=N.length),w>0)for(;w--;N[x++]=0);for(w=d-1;z>I;){if(N[--z]<V[z]){for(x=z;x&&!N[--x];N[x]=w);--N[x],N[z]+=d}N[z]-=V[z]}for(;N[0]==0;N.splice(0,1),--U);return N[0]?Bt(S,N,U):(S.s=B==3?-1:1,S.c=[S.e=0],S)},X.modulo=X.mod=function(S,w){var x,z,R=this;return S=new ee(S,w),!R.c||!S.s||S.c&&!S.c[0]?new ee(NaN):!S.c||R.c&&!R.c[0]?new ee(R):(Ie==9?(z=S.s,S.s=1,x=G(R,S,0,3),S.s=z,x.s*=z):x=G(R,S,0,Ie),S=R.minus(x.times(S)),!S.c[0]&&Ie==1&&(S.s=R.s),S)},X.multipliedBy=X.times=function(S,w){var x,z,R,$,j,I,C,U,N,V,se,ce,Me,tt,nt,Ue=this,qe=Ue.c,vt=(S=new ee(S,w)).c;if(!qe||!vt||!qe[0]||!vt[0])return!Ue.s||!S.s||qe&&!qe[0]&&!vt||vt&&!vt[0]&&!qe?S.c=S.e=S.s=null:(S.s*=Ue.s,!qe||!vt?S.c=S.e=null:(S.c=[0],S.e=0)),S;for(z=g(Ue.e/p)+g(S.e/p),S.s*=Ue.s,C=qe.length,V=vt.length,C<V&&(Me=qe,qe=vt,vt=Me,R=C,C=V,V=R),R=C+V,Me=[];R--;Me.push(0));for(tt=d,nt=m,R=V;--R>=0;){for(x=0,se=vt[R]%nt,ce=vt[R]/nt|0,j=C,$=R+j;$>R;)U=qe[--j]%nt,N=qe[j]/nt|0,I=ce*U+N*se,U=se*U+I%nt*nt+Me[$]+x,x=(U/tt|0)+(I/nt|0)+ce*N,Me[$--]=U%tt;Me[$]=x}return x?++z:Me.splice(0,1),Bt(S,Me,z)},X.negated=function(){var S=new ee(this);return S.s=-S.s||null,S},X.plus=function(S,w){var x,z=this,R=z.s;if(S=new ee(S,w),w=S.s,!R||!w)return new ee(NaN);if(R!=w)return S.s=-w,z.minus(S);var $=z.e/p,j=S.e/p,I=z.c,C=S.c;if(!$||!j){if(!I||!C)return new ee(R/0);if(!I[0]||!C[0])return C[0]?S:new ee(I[0]?z:R*0)}if($=g($),j=g(j),I=I.slice(),R=$-j){for(R>0?(j=$,x=C):(R=-R,x=I),x.reverse();R--;x.push(0));x.reverse()}for(R=I.length,w=C.length,R-w<0&&(x=C,C=I,I=x,w=R),R=0;w;)R=(I[--w]=I[w]+C[w]+R)/d|0,I[w]=d===I[w]?0:I[w]%d;return R&&(I=[R].concat(I),++j),Bt(S,I,j)},X.precision=X.sd=function(S,w){var x,z,R,$=this;if(S!=null&&S!==!!S)return E(S,1,f),w==null?w=B:E(w,0,8),Be(new ee($),S,w);if(!(x=$.c))return null;if(R=x.length-1,z=R*p+1,R=x[R]){for(;R%10==0;R/=10,z--);for(R=x[0];R>=10;R/=10,z++);}return S&&$.e+1>z&&(z=$.e+1),z},X.shiftedBy=function(S){return E(S,-h,h),this.times("1e"+S)},X.squareRoot=X.sqrt=function(){var S,w,x,z,R,$=this,j=$.c,I=$.s,C=$.e,U=re+4,N=new ee("0.5");if(I!==1||!j||!j[0])return new ee(!I||I<0&&(!j||j[0])?NaN:j?$:1/0);if(I=Math.sqrt(+We($)),I==0||I==1/0?(w=v(j),(w.length+C)%2==0&&(w+="0"),I=Math.sqrt(+w),C=g((C+1)/2)-(C<0||C%2),I==1/0?w="5e"+C:(w=I.toExponential(),w=w.slice(0,w.indexOf("e")+1)+C),x=new ee(w)):x=new ee(I+""),x.c[0]){for(C=x.e,I=C+U,I<3&&(I=0);;)if(R=x,x=N.times(R.plus(G($,R,U,1))),v(R.c).slice(0,I)===(w=v(x.c)).slice(0,I))if(x.e<C&&--I,w=w.slice(I-3,I+1),w=="9999"||!z&&w=="4999"){if(!z&&(Be(R,R.e+re+2,0),R.times(R).eq($))){x=R;break}U+=4,I+=4,z=1}else{(!+w||!+w.slice(1)&&w.charAt(0)=="5")&&(Be(x,x.e+re+2,1),S=!x.times(x).eq($));break}}return Be(x,x.e+re+1,B,S)},X.toExponential=function(S,w){return S!=null&&(E(S,0,f),S++),st(this,S,w,1)},X.toFixed=function(S,w){return S!=null&&(E(S,0,f),S=S+this.e+1),st(this,S,w)},X.toFormat=function(S,w,x){var z,R=this;if(x==null)S!=null&&w&&typeof w=="object"?(x=w,w=null):S&&typeof S=="object"?(x=S,S=w=null):x=Ve;else if(typeof x!="object")throw Error(s+"Argument not an object: "+x);if(z=R.toFixed(S,w),R.c){var $,j=z.split("."),I=+x.groupSize,C=+x.secondaryGroupSize,U=x.groupSeparator||"",N=j[0],V=j[1],se=R.s<0,ce=se?N.slice(1):N,Me=ce.length;if(C&&($=I,I=C,C=$,Me-=$),I>0&&Me>0){for($=Me%I||I,N=ce.substr(0,$);$<Me;$+=I)N+=U+ce.substr($,I);C>0&&(N+=U+ce.slice($)),se&&(N="-"+N)}z=V?N+(x.decimalSeparator||"")+((C=+x.fractionGroupSize)?V.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):V):N}return(x.prefix||"")+z+(x.suffix||"")},X.toFraction=function(S){var w,x,z,R,$,j,I,C,U,N,V,se,ce=this,Me=ce.c;if(S!=null&&(I=new ee(S),!I.isInteger()&&(I.c||I.s!==1)||I.lt(Te)))throw Error(s+"Argument "+(I.isInteger()?"out of range: ":"not an integer: ")+We(I));if(!Me)return new ee(ce);for(w=new ee(Te),U=x=new ee(Te),z=C=new ee(Te),se=v(Me),$=w.e=se.length-ce.e-1,w.c[0]=_[(j=$%p)<0?p+j:j],S=!S||I.comparedTo(w)>0?$>0?w:U:I,j=oe,oe=1/0,I=new ee(se),C.c[0]=0;N=G(I,w,0,1),R=x.plus(N.times(z)),R.comparedTo(S)!=1;)x=z,z=R,U=C.plus(N.times(R=U)),C=R,w=I.minus(N.times(R=w)),I=R;return R=G(S.minus(x),z,0,1),C=C.plus(R.times(U)),x=x.plus(R.times(z)),C.s=U.s=ce.s,$=$*2,V=G(U,z,$,B).minus(ce).abs().comparedTo(G(C,x,$,B).minus(ce).abs())<1?[U,z]:[C,x],oe=j,V},X.toNumber=function(){return+We(this)},X.toPrecision=function(S,w){return S!=null&&E(S,1,f),st(this,S,w,2)},X.toString=function(S){var w,x=this,z=x.s,R=x.e;return R===null?z?(w="Infinity",z<0&&(w="-"+w)):w="NaN":(S==null?w=R<=q||R>=Y?L(v(x.c),R):J(v(x.c),R,"0"):S===10&&Et?(x=Be(new ee(x),re+R+1,B),w=J(v(x.c),x.e,"0")):(E(S,2,Ye.length,"Base"),w=K(J(v(x.c),R,"0"),10,S,z,!0)),z<0&&x.c[0]&&(w="-"+w)),w},X.valueOf=X.toJSON=function(){return We(this)},X._isBigNumber=!0,W!=null&&ee.set(W),ee}o(l,"clone");function g(W){var G=W|0;return W>0||W===G?G:G-1}o(g,"bitFloor");function v(W){for(var G,K,te=1,X=W.length,Te=W[0]+"";te<X;){for(G=W[te++]+"",K=p-G.length;K--;G="0"+G);Te+=G}for(X=Te.length;Te.charCodeAt(--X)===48;);return Te.slice(0,X+1||1)}o(v,"coeffToString");function b(W,G){var K,te,X=W.c,Te=G.c,re=W.s,B=G.s,q=W.e,Y=G.e;if(!re||!B)return null;if(K=X&&!X[0],te=Te&&!Te[0],K||te)return K?te?0:-B:re;if(re!=B)return re;if(K=re<0,te=q==Y,!X||!Te)return te?0:!X^K?1:-1;if(!te)return q>Y^K?1:-1;for(B=(q=X.length)<(Y=Te.length)?q:Y,re=0;re<B;re++)if(X[re]!=Te[re])return X[re]>Te[re]^K?1:-1;return q==Y?0:q>Y^K?1:-1}o(b,"compare");function E(W,G,K,te){if(W<G||W>K||W!==i(W))throw Error(s+(te||"Argument")+(typeof W=="number"?W<G||W>K?" out of range: ":" not an integer: ":" not a primitive number: ")+String(W))}o(E,"intCheck");function k(W){var G=W.c.length-1;return g(W.e/p)==G&&W.c[G]%2!=0}o(k,"isOdd");function L(W,G){return(W.length>1?W.charAt(0)+"."+W.slice(1):W)+(G<0?"e":"e+")+G}o(L,"toExponential");function J(W,G,K){var te,X;if(G<0){for(X=K+".";++G;X+=K);W=X+W}else if(te=W.length,++G>te){for(X=K,G-=te;--G;X+=K);W+=X}else G<te&&(W=W.slice(0,G)+"."+W.slice(G));return W}o(J,"toFixedPoint"),e=l(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof Ru<"u"&&Ru.exports?Ru.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(qE)});var HE=D((x5,GE)=>{var BE=rp(),VE=GE.exports;(function(){"use strict";function t(h){return h<10?"0"+h:h}o(t,"f");var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,i,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c;function d(h){return r.lastIndex=0,r.test(h)?'"'+h.replace(r,function(_){var m=s[_];return typeof m=="string"?m:"\\u"+("0000"+_.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+h+'"'}o(d,"quote");function p(h,_){var m,f,l,g,v=n,b,E=_[h],k=E!=null&&(E instanceof BE||BE.isBigNumber(E));switch(E&&typeof E=="object"&&typeof E.toJSON=="function"&&(E=E.toJSON(h)),typeof c=="function"&&(E=c.call(_,h,E)),typeof E){case"string":return k?E:d(E);case"number":return isFinite(E)?String(E):"null";case"boolean":case"null":case"bigint":return String(E);case"object":if(!E)return"null";if(n+=i,b=[],Object.prototype.toString.apply(E)==="[object Array]"){for(g=E.length,m=0;m<g;m+=1)b[m]=p(m,E)||"null";return l=b.length===0?"[]":n?`[
|
|
31
|
+
`}yield n}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>rt(Hb()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(LE(),jE))).default,this.#a}static mergeHeaders(e,...r){e=e instanceof Headers?e:new Headers(e);for(let n of r)(n instanceof Headers?n:new Headers(n)).forEach((s,c)=>{c==="set-cookie"?e.append(c,s):e.set(c,s)});return e}};oi.Gaxios=Au;ni=Au});var ft=D(Dt=>{"use strict";var R$=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]}),C$=Dt&&Dt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&R$(e,t,r)};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.instance=Dt.Gaxios=Dt.GaxiosError=void 0;Dt.request=$$;var VE=BE();Object.defineProperty(Dt,"Gaxios",{enumerable:!0,get:o(function(){return VE.Gaxios},"get")});var O$=Od();Object.defineProperty(Dt,"GaxiosError",{enumerable:!0,get:o(function(){return O$.GaxiosError},"get")});C$(Dd(),Dt);Dt.instance=new VE.Gaxios;async function $$(t){return Dt.instance.request(t)}o($$,"request")});var rp=D((GE,Iu)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,s="[BigNumber Error] ",c=s+"Number primitive has more than 15 significant digits: ",d=1e14,p=14,h=9007199254740991,_=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,f=1e9;function l(W){var G,K,te,X=ee.prototype={constructor:ee,toString:null,valueOf:null},Te=new ee(1),re=20,B=4,q=-7,Y=21,Z=-1e7,oe=1e7,ae=!1,Ie=1,$e=0,Ve={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Ye="0123456789abcdefghijklmnopqrstuvwxyz",Et=!0;function ee(S,w){var x,z,R,$,j,I,C,U,N=this;if(!(N instanceof ee))return new ee(S,w);if(w==null){if(S&&S._isBigNumber===!0){N.s=S.s,!S.c||S.e>oe?N.c=N.e=null:S.e<Z?N.c=[N.e=0]:(N.e=S.e,N.c=S.c.slice());return}if((I=typeof S=="number")&&S*0==0){if(N.s=1/S<0?(S=-S,-1):1,S===~~S){for($=0,j=S;j>=10;j/=10,$++);$>oe?N.c=N.e=null:(N.e=$,N.c=[S]);return}U=String(S)}else{if(!r.test(U=String(S)))return te(N,U,I);N.s=U.charCodeAt(0)==45?(U=U.slice(1),-1):1}($=U.indexOf("."))>-1&&(U=U.replace(".","")),(j=U.search(/e/i))>0?($<0&&($=j),$+=+U.slice(j+1),U=U.substring(0,j)):$<0&&($=U.length)}else{if(E(w,2,Ye.length,"Base"),w==10&&Et)return N=new ee(S),Be(N,re+N.e+1,B);if(U=String(S),I=typeof S=="number"){if(S*0!=0)return te(N,U,I,w);if(N.s=1/S<0?(U=U.slice(1),-1):1,ee.DEBUG&&U.replace(/^0\.0*|\./,"").length>15)throw Error(c+S)}else N.s=U.charCodeAt(0)===45?(U=U.slice(1),-1):1;for(x=Ye.slice(0,w),$=j=0,C=U.length;j<C;j++)if(x.indexOf(z=U.charAt(j))<0){if(z=="."){if(j>$){$=C;continue}}else if(!R&&(U==U.toUpperCase()&&(U=U.toLowerCase())||U==U.toLowerCase()&&(U=U.toUpperCase()))){R=!0,j=-1,$=0;continue}return te(N,String(S),I,w)}I=!1,U=K(U,w,10,N.s),($=U.indexOf("."))>-1?U=U.replace(".",""):$=U.length}for(j=0;U.charCodeAt(j)===48;j++);for(C=U.length;U.charCodeAt(--C)===48;);if(U=U.slice(j,++C)){if(C-=j,I&&ee.DEBUG&&C>15&&(S>h||S!==i(S)))throw Error(c+N.s*S);if(($=$-j-1)>oe)N.c=N.e=null;else if($<Z)N.c=[N.e=0];else{if(N.e=$,N.c=[],j=($+1)%p,$<0&&(j+=p),j<C){for(j&&N.c.push(+U.slice(0,j)),C-=p;j<C;)N.c.push(+U.slice(j,j+=p));j=p-(U=U.slice(j)).length}else j-=C;for(;j--;U+="0");N.c.push(+U)}}else N.c=[N.e=0]}o(ee,"BigNumber"),ee.clone=l,ee.ROUND_UP=0,ee.ROUND_DOWN=1,ee.ROUND_CEIL=2,ee.ROUND_FLOOR=3,ee.ROUND_HALF_UP=4,ee.ROUND_HALF_DOWN=5,ee.ROUND_HALF_EVEN=6,ee.ROUND_HALF_CEIL=7,ee.ROUND_HALF_FLOOR=8,ee.EUCLID=9,ee.config=ee.set=function(S){var w,x;if(S!=null)if(typeof S=="object"){if(S.hasOwnProperty(w="DECIMAL_PLACES")&&(x=S[w],E(x,0,f,w),re=x),S.hasOwnProperty(w="ROUNDING_MODE")&&(x=S[w],E(x,0,8,w),B=x),S.hasOwnProperty(w="EXPONENTIAL_AT")&&(x=S[w],x&&x.pop?(E(x[0],-f,0,w),E(x[1],0,f,w),q=x[0],Y=x[1]):(E(x,-f,f,w),q=-(Y=x<0?-x:x))),S.hasOwnProperty(w="RANGE"))if(x=S[w],x&&x.pop)E(x[0],-f,-1,w),E(x[1],1,f,w),Z=x[0],oe=x[1];else if(E(x,-f,f,w),x)Z=-(oe=x<0?-x:x);else throw Error(s+w+" cannot be zero: "+x);if(S.hasOwnProperty(w="CRYPTO"))if(x=S[w],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ae=x;else throw ae=!x,Error(s+"crypto unavailable");else ae=x;else throw Error(s+w+" not true or false: "+x);if(S.hasOwnProperty(w="MODULO_MODE")&&(x=S[w],E(x,0,9,w),Ie=x),S.hasOwnProperty(w="POW_PRECISION")&&(x=S[w],E(x,0,f,w),$e=x),S.hasOwnProperty(w="FORMAT"))if(x=S[w],typeof x=="object")Ve=x;else throw Error(s+w+" not an object: "+x);if(S.hasOwnProperty(w="ALPHABET"))if(x=S[w],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))Et=x.slice(0,10)=="0123456789",Ye=x;else throw Error(s+w+" invalid: "+x)}else throw Error(s+"Object expected: "+S);return{DECIMAL_PLACES:re,ROUNDING_MODE:B,EXPONENTIAL_AT:[q,Y],RANGE:[Z,oe],CRYPTO:ae,MODULO_MODE:Ie,POW_PRECISION:$e,FORMAT:Ve,ALPHABET:Ye}},ee.isBigNumber=function(S){if(!S||S._isBigNumber!==!0)return!1;if(!ee.DEBUG)return!0;var w,x,z=S.c,R=S.e,$=S.s;e:if({}.toString.call(z)=="[object Array]"){if(($===1||$===-1)&&R>=-f&&R<=f&&R===i(R)){if(z[0]===0){if(R===0&&z.length===1)return!0;break e}if(w=(R+1)%p,w<1&&(w+=p),String(z[0]).length==w){for(w=0;w<z.length;w++)if(x=z[w],x<0||x>=d||x!==i(x))break e;if(x!==0)return!0}}}else if(z===null&&R===null&&($===null||$===1||$===-1))return!0;throw Error(s+"Invalid BigNumber: "+S)},ee.maximum=ee.max=function(){return pt(arguments,-1)},ee.minimum=ee.min=function(){return pt(arguments,1)},ee.random=function(){var S=9007199254740992,w=Math.random()*S&2097151?function(){return i(Math.random()*S)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var z,R,$,j,I,C=0,U=[],N=new ee(Te);if(x==null?x=re:E(x,0,f),j=n(x/p),ae)if(crypto.getRandomValues){for(z=crypto.getRandomValues(new Uint32Array(j*=2));C<j;)I=z[C]*131072+(z[C+1]>>>11),I>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),z[C]=R[0],z[C+1]=R[1]):(U.push(I%1e14),C+=2);C=j/2}else if(crypto.randomBytes){for(z=crypto.randomBytes(j*=7);C<j;)I=(z[C]&31)*281474976710656+z[C+1]*1099511627776+z[C+2]*4294967296+z[C+3]*16777216+(z[C+4]<<16)+(z[C+5]<<8)+z[C+6],I>=9e15?crypto.randomBytes(7).copy(z,C):(U.push(I%1e14),C+=7);C=j/7}else throw ae=!1,Error(s+"crypto unavailable");if(!ae)for(;C<j;)I=w(),I<9e15&&(U[C++]=I%1e14);for(j=U[--C],x%=p,j&&x&&(I=_[p-x],U[C]=i(j/I)*I);U[C]===0;U.pop(),C--);if(C<0)U=[$=0];else{for($=-1;U[0]===0;U.splice(0,1),$-=p);for(C=1,I=U[0];I>=10;I/=10,C++);C<p&&($-=p-C)}return N.e=$,N.c=U,N}}(),ee.sum=function(){for(var S=1,w=arguments,x=new ee(w[0]);S<w.length;)x=x.plus(w[S++]);return x},K=function(){var S="0123456789";function w(x,z,R,$){for(var j,I=[0],C,U=0,N=x.length;U<N;){for(C=I.length;C--;I[C]*=z);for(I[0]+=$.indexOf(x.charAt(U++)),j=0;j<I.length;j++)I[j]>R-1&&(I[j+1]==null&&(I[j+1]=0),I[j+1]+=I[j]/R|0,I[j]%=R)}return I.reverse()}return o(w,"toBaseOut"),function(x,z,R,$,j){var I,C,U,N,V,se,ce,Me,tt=x.indexOf("."),nt=re,Ue=B;for(tt>=0&&(N=$e,$e=0,x=x.replace(".",""),Me=new ee(z),se=Me.pow(x.length-tt),$e=N,Me.c=w(J(v(se.c),se.e,"0"),10,R,S),Me.e=Me.c.length),ce=w(x,z,R,j?(I=Ye,S):(I=S,Ye)),U=N=ce.length;ce[--N]==0;ce.pop());if(!ce[0])return I.charAt(0);if(tt<0?--U:(se.c=ce,se.e=U,se.s=$,se=G(se,Me,nt,Ue,R),ce=se.c,V=se.r,U=se.e),C=U+nt+1,tt=ce[C],N=R/2,V=V||C<0||ce[C+1]!=null,V=Ue<4?(tt!=null||V)&&(Ue==0||Ue==(se.s<0?3:2)):tt>N||tt==N&&(Ue==4||V||Ue==6&&ce[C-1]&1||Ue==(se.s<0?8:7)),C<1||!ce[0])x=V?J(I.charAt(1),-nt,I.charAt(0)):I.charAt(0);else{if(ce.length=C,V)for(--R;++ce[--C]>R;)ce[C]=0,C||(++U,ce=[1].concat(ce));for(N=ce.length;!ce[--N];);for(tt=0,x="";tt<=N;x+=I.charAt(ce[tt++]));x=J(x,U,I.charAt(0))}return x}}(),G=function(){function S(z,R,$){var j,I,C,U,N=0,V=z.length,se=R%m,ce=R/m|0;for(z=z.slice();V--;)C=z[V]%m,U=z[V]/m|0,j=ce*C+U*se,I=se*C+j%m*m+N,N=(I/$|0)+(j/m|0)+ce*U,z[V]=I%$;return N&&(z=[N].concat(z)),z}o(S,"multiply");function w(z,R,$,j){var I,C;if($!=j)C=$>j?1:-1;else for(I=C=0;I<$;I++)if(z[I]!=R[I]){C=z[I]>R[I]?1:-1;break}return C}o(w,"compare");function x(z,R,$,j){for(var I=0;$--;)z[$]-=I,I=z[$]<R[$]?1:0,z[$]=I*j+z[$]-R[$];for(;!z[0]&&z.length>1;z.splice(0,1));}return o(x,"subtract"),function(z,R,$,j,I){var C,U,N,V,se,ce,Me,tt,nt,Ue,qe,vt,So,Po,To,Vt,Xr,It=z.s==R.s?1:-1,_t=z.c,Ze=R.c;if(!_t||!_t[0]||!Ze||!Ze[0])return new ee(!z.s||!R.s||(_t?Ze&&_t[0]==Ze[0]:!Ze)?NaN:_t&&_t[0]==0||!Ze?It*0:It/0);for(tt=new ee(It),nt=tt.c=[],U=z.e-R.e,It=$+U+1,I||(I=d,U=g(z.e/p)-g(R.e/p),It=It/p|0),N=0;Ze[N]==(_t[N]||0);N++);if(Ze[N]>(_t[N]||0)&&U--,It<0)nt.push(1),V=!0;else{for(Po=_t.length,Vt=Ze.length,N=0,It+=2,se=i(I/(Ze[0]+1)),se>1&&(Ze=S(Ze,se,I),_t=S(_t,se,I),Vt=Ze.length,Po=_t.length),So=Vt,Ue=_t.slice(0,Vt),qe=Ue.length;qe<Vt;Ue[qe++]=0);Xr=Ze.slice(),Xr=[0].concat(Xr),To=Ze[0],Ze[1]>=I/2&&To++;do{if(se=0,C=w(Ze,Ue,Vt,qe),C<0){if(vt=Ue[0],Vt!=qe&&(vt=vt*I+(Ue[1]||0)),se=i(vt/To),se>1)for(se>=I&&(se=I-1),ce=S(Ze,se,I),Me=ce.length,qe=Ue.length;w(ce,Ue,Me,qe)==1;)se--,x(ce,Vt<Me?Xr:Ze,Me,I),Me=ce.length,C=1;else se==0&&(C=se=1),ce=Ze.slice(),Me=ce.length;if(Me<qe&&(ce=[0].concat(ce)),x(Ue,ce,qe,I),qe=Ue.length,C==-1)for(;w(Ze,Ue,Vt,qe)<1;)se++,x(Ue,Vt<qe?Xr:Ze,qe,I),qe=Ue.length}else C===0&&(se++,Ue=[0]);nt[N++]=se,Ue[0]?Ue[qe++]=_t[So]||0:(Ue=[_t[So]],qe=1)}while((So++<Po||Ue[0]!=null)&&It--);V=Ue[0]!=null,nt[0]||nt.splice(0,1)}if(I==d){for(N=1,It=nt[0];It>=10;It/=10,N++);Be(tt,$+(tt.e=N+U*p-1)+1,j,V)}else tt.e=U,tt.r=+V;return tt}}();function st(S,w,x,z){var R,$,j,I,C;if(x==null?x=B:E(x,0,8),!S.c)return S.toString();if(R=S.c[0],j=S.e,w==null)C=v(S.c),C=z==1||z==2&&(j<=q||j>=Y)?L(C,j):J(C,j,"0");else if(S=Be(new ee(S),w,x),$=S.e,C=v(S.c),I=C.length,z==1||z==2&&(w<=$||$<=q)){for(;I<w;C+="0",I++);C=L(C,$)}else if(w-=j+(z===2&&$>j),C=J(C,$,"0"),$+1>I){if(--w>0)for(C+=".";w--;C+="0");}else if(w+=$-I,w>0)for($+1==I&&(C+=".");w--;C+="0");return S.s<0&&R?"-"+C:C}o(st,"format");function pt(S,w){for(var x,z,R=1,$=new ee(S[0]);R<S.length;R++)z=new ee(S[R]),(!z.s||(x=b($,z))===w||x===0&&$.s===w)&&($=z);return $}o(pt,"maxOrMin");function Bt(S,w,x){for(var z=1,R=w.length;!w[--R];w.pop());for(R=w[0];R>=10;R/=10,z++);return(x=z+x*p-1)>oe?S.c=S.e=null:x<Z?S.c=[S.e=0]:(S.e=x,S.c=w),S}o(Bt,"normalise"),te=function(){var S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,w=/^([^.]+)\.$/,x=/^\.([^.]+)$/,z=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,j,I,C){var U,N=I?j:j.replace(R,"");if(z.test(N))$.s=isNaN(N)?null:N<0?-1:1;else{if(!I&&(N=N.replace(S,function(V,se,ce){return U=(ce=ce.toLowerCase())=="x"?16:ce=="b"?2:8,!C||C==U?se:V}),C&&(U=C,N=N.replace(w,"$1").replace(x,"0.$1")),j!=N))return new ee(N,U);if(ee.DEBUG)throw Error(s+"Not a"+(C?" base "+C:"")+" number: "+j);$.s=null}$.c=$.e=null}}();function Be(S,w,x,z){var R,$,j,I,C,U,N,V=S.c,se=_;if(V){e:{for(R=1,I=V[0];I>=10;I/=10,R++);if($=w-R,$<0)$+=p,j=w,C=V[U=0],N=i(C/se[R-j-1]%10);else if(U=n(($+1)/p),U>=V.length)if(z){for(;V.length<=U;V.push(0));C=N=0,R=1,$%=p,j=$-p+1}else break e;else{for(C=I=V[U],R=1;I>=10;I/=10,R++);$%=p,j=$-p+R,N=j<0?0:i(C/se[R-j-1]%10)}if(z=z||w<0||V[U+1]!=null||(j<0?C:C%se[R-j-1]),z=x<4?(N||z)&&(x==0||x==(S.s<0?3:2)):N>5||N==5&&(x==4||z||x==6&&($>0?j>0?C/se[R-j]:0:V[U-1])%10&1||x==(S.s<0?8:7)),w<1||!V[0])return V.length=0,z?(w-=S.e+1,V[0]=se[(p-w%p)%p],S.e=-w||0):V[0]=S.e=0,S;if($==0?(V.length=U,I=1,U--):(V.length=U+1,I=se[p-$],V[U]=j>0?i(C/se[R-j]%se[j])*I:0),z)for(;;)if(U==0){for($=1,j=V[0];j>=10;j/=10,$++);for(j=V[0]+=I,I=1;j>=10;j/=10,I++);$!=I&&(S.e++,V[0]==d&&(V[0]=1));break}else{if(V[U]+=I,V[U]!=d)break;V[U--]=0,I=1}for($=V.length;V[--$]===0;V.pop());}S.e>oe?S.c=S.e=null:S.e<Z&&(S.c=[S.e=0])}return S}o(Be,"round");function We(S){var w,x=S.e;return x===null?S.toString():(w=v(S.c),w=x<=q||x>=Y?L(w,x):J(w,x,"0"),S.s<0?"-"+w:w)}return o(We,"valueOf"),X.absoluteValue=X.abs=function(){var S=new ee(this);return S.s<0&&(S.s=1),S},X.comparedTo=function(S,w){return b(this,new ee(S,w))},X.decimalPlaces=X.dp=function(S,w){var x,z,R,$=this;if(S!=null)return E(S,0,f),w==null?w=B:E(w,0,8),Be(new ee($),S+$.e+1,w);if(!(x=$.c))return null;if(z=((R=x.length-1)-g(this.e/p))*p,R=x[R])for(;R%10==0;R/=10,z--);return z<0&&(z=0),z},X.dividedBy=X.div=function(S,w){return G(this,new ee(S,w),re,B)},X.dividedToIntegerBy=X.idiv=function(S,w){return G(this,new ee(S,w),0,1)},X.exponentiatedBy=X.pow=function(S,w){var x,z,R,$,j,I,C,U,N,V=this;if(S=new ee(S),S.c&&!S.isInteger())throw Error(s+"Exponent not an integer: "+We(S));if(w!=null&&(w=new ee(w)),I=S.e>14,!V.c||!V.c[0]||V.c[0]==1&&!V.e&&V.c.length==1||!S.c||!S.c[0])return N=new ee(Math.pow(+We(V),I?S.s*(2-k(S)):+We(S))),w?N.mod(w):N;if(C=S.s<0,w){if(w.c?!w.c[0]:!w.s)return new ee(NaN);z=!C&&V.isInteger()&&w.isInteger(),z&&(V=V.mod(w))}else{if(S.e>9&&(V.e>0||V.e<-1||(V.e==0?V.c[0]>1||I&&V.c[1]>=24e7:V.c[0]<8e13||I&&V.c[0]<=9999975e7)))return $=V.s<0&&k(S)?-0:0,V.e>-1&&($=1/$),new ee(C?1/$:$);$e&&($=n($e/p+2))}for(I?(x=new ee(.5),C&&(S.s=1),U=k(S)):(R=Math.abs(+We(S)),U=R%2),N=new ee(Te);;){if(U){if(N=N.times(V),!N.c)break;$?N.c.length>$&&(N.c.length=$):z&&(N=N.mod(w))}if(R){if(R=i(R/2),R===0)break;U=R%2}else if(S=S.times(x),Be(S,S.e+1,1),S.e>14)U=k(S);else{if(R=+We(S),R===0)break;U=R%2}V=V.times(V),$?V.c&&V.c.length>$&&(V.c.length=$):z&&(V=V.mod(w))}return z?N:(C&&(N=Te.div(N)),w?N.mod(w):$?Be(N,$e,B,j):N)},X.integerValue=function(S){var w=new ee(this);return S==null?S=B:E(S,0,8),Be(w,w.e+1,S)},X.isEqualTo=X.eq=function(S,w){return b(this,new ee(S,w))===0},X.isFinite=function(){return!!this.c},X.isGreaterThan=X.gt=function(S,w){return b(this,new ee(S,w))>0},X.isGreaterThanOrEqualTo=X.gte=function(S,w){return(w=b(this,new ee(S,w)))===1||w===0},X.isInteger=function(){return!!this.c&&g(this.e/p)>this.c.length-2},X.isLessThan=X.lt=function(S,w){return b(this,new ee(S,w))<0},X.isLessThanOrEqualTo=X.lte=function(S,w){return(w=b(this,new ee(S,w)))===-1||w===0},X.isNaN=function(){return!this.s},X.isNegative=function(){return this.s<0},X.isPositive=function(){return this.s>0},X.isZero=function(){return!!this.c&&this.c[0]==0},X.minus=function(S,w){var x,z,R,$,j=this,I=j.s;if(S=new ee(S,w),w=S.s,!I||!w)return new ee(NaN);if(I!=w)return S.s=-w,j.plus(S);var C=j.e/p,U=S.e/p,N=j.c,V=S.c;if(!C||!U){if(!N||!V)return N?(S.s=-w,S):new ee(V?j:NaN);if(!N[0]||!V[0])return V[0]?(S.s=-w,S):new ee(N[0]?j:B==3?-0:0)}if(C=g(C),U=g(U),N=N.slice(),I=C-U){for(($=I<0)?(I=-I,R=N):(U=C,R=V),R.reverse(),w=I;w--;R.push(0));R.reverse()}else for(z=($=(I=N.length)<(w=V.length))?I:w,I=w=0;w<z;w++)if(N[w]!=V[w]){$=N[w]<V[w];break}if($&&(R=N,N=V,V=R,S.s=-S.s),w=(z=V.length)-(x=N.length),w>0)for(;w--;N[x++]=0);for(w=d-1;z>I;){if(N[--z]<V[z]){for(x=z;x&&!N[--x];N[x]=w);--N[x],N[z]+=d}N[z]-=V[z]}for(;N[0]==0;N.splice(0,1),--U);return N[0]?Bt(S,N,U):(S.s=B==3?-1:1,S.c=[S.e=0],S)},X.modulo=X.mod=function(S,w){var x,z,R=this;return S=new ee(S,w),!R.c||!S.s||S.c&&!S.c[0]?new ee(NaN):!S.c||R.c&&!R.c[0]?new ee(R):(Ie==9?(z=S.s,S.s=1,x=G(R,S,0,3),S.s=z,x.s*=z):x=G(R,S,0,Ie),S=R.minus(x.times(S)),!S.c[0]&&Ie==1&&(S.s=R.s),S)},X.multipliedBy=X.times=function(S,w){var x,z,R,$,j,I,C,U,N,V,se,ce,Me,tt,nt,Ue=this,qe=Ue.c,vt=(S=new ee(S,w)).c;if(!qe||!vt||!qe[0]||!vt[0])return!Ue.s||!S.s||qe&&!qe[0]&&!vt||vt&&!vt[0]&&!qe?S.c=S.e=S.s=null:(S.s*=Ue.s,!qe||!vt?S.c=S.e=null:(S.c=[0],S.e=0)),S;for(z=g(Ue.e/p)+g(S.e/p),S.s*=Ue.s,C=qe.length,V=vt.length,C<V&&(Me=qe,qe=vt,vt=Me,R=C,C=V,V=R),R=C+V,Me=[];R--;Me.push(0));for(tt=d,nt=m,R=V;--R>=0;){for(x=0,se=vt[R]%nt,ce=vt[R]/nt|0,j=C,$=R+j;$>R;)U=qe[--j]%nt,N=qe[j]/nt|0,I=ce*U+N*se,U=se*U+I%nt*nt+Me[$]+x,x=(U/tt|0)+(I/nt|0)+ce*N,Me[$--]=U%tt;Me[$]=x}return x?++z:Me.splice(0,1),Bt(S,Me,z)},X.negated=function(){var S=new ee(this);return S.s=-S.s||null,S},X.plus=function(S,w){var x,z=this,R=z.s;if(S=new ee(S,w),w=S.s,!R||!w)return new ee(NaN);if(R!=w)return S.s=-w,z.minus(S);var $=z.e/p,j=S.e/p,I=z.c,C=S.c;if(!$||!j){if(!I||!C)return new ee(R/0);if(!I[0]||!C[0])return C[0]?S:new ee(I[0]?z:R*0)}if($=g($),j=g(j),I=I.slice(),R=$-j){for(R>0?(j=$,x=C):(R=-R,x=I),x.reverse();R--;x.push(0));x.reverse()}for(R=I.length,w=C.length,R-w<0&&(x=C,C=I,I=x,w=R),R=0;w;)R=(I[--w]=I[w]+C[w]+R)/d|0,I[w]=d===I[w]?0:I[w]%d;return R&&(I=[R].concat(I),++j),Bt(S,I,j)},X.precision=X.sd=function(S,w){var x,z,R,$=this;if(S!=null&&S!==!!S)return E(S,1,f),w==null?w=B:E(w,0,8),Be(new ee($),S,w);if(!(x=$.c))return null;if(R=x.length-1,z=R*p+1,R=x[R]){for(;R%10==0;R/=10,z--);for(R=x[0];R>=10;R/=10,z++);}return S&&$.e+1>z&&(z=$.e+1),z},X.shiftedBy=function(S){return E(S,-h,h),this.times("1e"+S)},X.squareRoot=X.sqrt=function(){var S,w,x,z,R,$=this,j=$.c,I=$.s,C=$.e,U=re+4,N=new ee("0.5");if(I!==1||!j||!j[0])return new ee(!I||I<0&&(!j||j[0])?NaN:j?$:1/0);if(I=Math.sqrt(+We($)),I==0||I==1/0?(w=v(j),(w.length+C)%2==0&&(w+="0"),I=Math.sqrt(+w),C=g((C+1)/2)-(C<0||C%2),I==1/0?w="5e"+C:(w=I.toExponential(),w=w.slice(0,w.indexOf("e")+1)+C),x=new ee(w)):x=new ee(I+""),x.c[0]){for(C=x.e,I=C+U,I<3&&(I=0);;)if(R=x,x=N.times(R.plus(G($,R,U,1))),v(R.c).slice(0,I)===(w=v(x.c)).slice(0,I))if(x.e<C&&--I,w=w.slice(I-3,I+1),w=="9999"||!z&&w=="4999"){if(!z&&(Be(R,R.e+re+2,0),R.times(R).eq($))){x=R;break}U+=4,I+=4,z=1}else{(!+w||!+w.slice(1)&&w.charAt(0)=="5")&&(Be(x,x.e+re+2,1),S=!x.times(x).eq($));break}}return Be(x,x.e+re+1,B,S)},X.toExponential=function(S,w){return S!=null&&(E(S,0,f),S++),st(this,S,w,1)},X.toFixed=function(S,w){return S!=null&&(E(S,0,f),S=S+this.e+1),st(this,S,w)},X.toFormat=function(S,w,x){var z,R=this;if(x==null)S!=null&&w&&typeof w=="object"?(x=w,w=null):S&&typeof S=="object"?(x=S,S=w=null):x=Ve;else if(typeof x!="object")throw Error(s+"Argument not an object: "+x);if(z=R.toFixed(S,w),R.c){var $,j=z.split("."),I=+x.groupSize,C=+x.secondaryGroupSize,U=x.groupSeparator||"",N=j[0],V=j[1],se=R.s<0,ce=se?N.slice(1):N,Me=ce.length;if(C&&($=I,I=C,C=$,Me-=$),I>0&&Me>0){for($=Me%I||I,N=ce.substr(0,$);$<Me;$+=I)N+=U+ce.substr($,I);C>0&&(N+=U+ce.slice($)),se&&(N="-"+N)}z=V?N+(x.decimalSeparator||"")+((C=+x.fractionGroupSize)?V.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):V):N}return(x.prefix||"")+z+(x.suffix||"")},X.toFraction=function(S){var w,x,z,R,$,j,I,C,U,N,V,se,ce=this,Me=ce.c;if(S!=null&&(I=new ee(S),!I.isInteger()&&(I.c||I.s!==1)||I.lt(Te)))throw Error(s+"Argument "+(I.isInteger()?"out of range: ":"not an integer: ")+We(I));if(!Me)return new ee(ce);for(w=new ee(Te),U=x=new ee(Te),z=C=new ee(Te),se=v(Me),$=w.e=se.length-ce.e-1,w.c[0]=_[(j=$%p)<0?p+j:j],S=!S||I.comparedTo(w)>0?$>0?w:U:I,j=oe,oe=1/0,I=new ee(se),C.c[0]=0;N=G(I,w,0,1),R=x.plus(N.times(z)),R.comparedTo(S)!=1;)x=z,z=R,U=C.plus(N.times(R=U)),C=R,w=I.minus(N.times(R=w)),I=R;return R=G(S.minus(x),z,0,1),C=C.plus(R.times(U)),x=x.plus(R.times(z)),C.s=U.s=ce.s,$=$*2,V=G(U,z,$,B).minus(ce).abs().comparedTo(G(C,x,$,B).minus(ce).abs())<1?[U,z]:[C,x],oe=j,V},X.toNumber=function(){return+We(this)},X.toPrecision=function(S,w){return S!=null&&E(S,1,f),st(this,S,w,2)},X.toString=function(S){var w,x=this,z=x.s,R=x.e;return R===null?z?(w="Infinity",z<0&&(w="-"+w)):w="NaN":(S==null?w=R<=q||R>=Y?L(v(x.c),R):J(v(x.c),R,"0"):S===10&&Et?(x=Be(new ee(x),re+R+1,B),w=J(v(x.c),x.e,"0")):(E(S,2,Ye.length,"Base"),w=K(J(v(x.c),R,"0"),10,S,z,!0)),z<0&&x.c[0]&&(w="-"+w)),w},X.valueOf=X.toJSON=function(){return We(this)},X._isBigNumber=!0,W!=null&&ee.set(W),ee}o(l,"clone");function g(W){var G=W|0;return W>0||W===G?G:G-1}o(g,"bitFloor");function v(W){for(var G,K,te=1,X=W.length,Te=W[0]+"";te<X;){for(G=W[te++]+"",K=p-G.length;K--;G="0"+G);Te+=G}for(X=Te.length;Te.charCodeAt(--X)===48;);return Te.slice(0,X+1||1)}o(v,"coeffToString");function b(W,G){var K,te,X=W.c,Te=G.c,re=W.s,B=G.s,q=W.e,Y=G.e;if(!re||!B)return null;if(K=X&&!X[0],te=Te&&!Te[0],K||te)return K?te?0:-B:re;if(re!=B)return re;if(K=re<0,te=q==Y,!X||!Te)return te?0:!X^K?1:-1;if(!te)return q>Y^K?1:-1;for(B=(q=X.length)<(Y=Te.length)?q:Y,re=0;re<B;re++)if(X[re]!=Te[re])return X[re]>Te[re]^K?1:-1;return q==Y?0:q>Y^K?1:-1}o(b,"compare");function E(W,G,K,te){if(W<G||W>K||W!==i(W))throw Error(s+(te||"Argument")+(typeof W=="number"?W<G||W>K?" out of range: ":" not an integer: ":" not a primitive number: ")+String(W))}o(E,"intCheck");function k(W){var G=W.c.length-1;return g(W.e/p)==G&&W.c[G]%2!=0}o(k,"isOdd");function L(W,G){return(W.length>1?W.charAt(0)+"."+W.slice(1):W)+(G<0?"e":"e+")+G}o(L,"toExponential");function J(W,G,K){var te,X;if(G<0){for(X=K+".";++G;X+=K);W=X+W}else if(te=W.length,++G>te){for(X=K,G-=te;--G;X+=K);W+=X}else G<te&&(W=W.slice(0,G)+"."+W.slice(G));return W}o(J,"toFixedPoint"),e=l(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof Iu<"u"&&Iu.exports?Iu.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(GE)});var KE=D((k5,ZE)=>{var HE=rp(),WE=ZE.exports;(function(){"use strict";function t(h){return h<10?"0"+h:h}o(t,"f");var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,i,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c;function d(h){return r.lastIndex=0,r.test(h)?'"'+h.replace(r,function(_){var m=s[_];return typeof m=="string"?m:"\\u"+("0000"+_.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+h+'"'}o(d,"quote");function p(h,_){var m,f,l,g,v=n,b,E=_[h],k=E!=null&&(E instanceof HE||HE.isBigNumber(E));switch(E&&typeof E=="object"&&typeof E.toJSON=="function"&&(E=E.toJSON(h)),typeof c=="function"&&(E=c.call(_,h,E)),typeof E){case"string":return k?E:d(E);case"number":return isFinite(E)?String(E):"null";case"boolean":case"null":case"bigint":return String(E);case"object":if(!E)return"null";if(n+=i,b=[],Object.prototype.toString.apply(E)==="[object Array]"){for(g=E.length,m=0;m<g;m+=1)b[m]=p(m,E)||"null";return l=b.length===0?"[]":n?`[
|
|
32
32
|
`+n+b.join(`,
|
|
33
33
|
`+n)+`
|
|
34
34
|
`+v+"]":"["+b.join(",")+"]",n=v,l}if(c&&typeof c=="object")for(g=c.length,m=0;m<g;m+=1)typeof c[m]=="string"&&(f=c[m],l=p(f,E),l&&b.push(d(f)+(n?": ":":")+l));else Object.keys(E).forEach(function(L){var J=p(L,E);J&&b.push(d(L)+(n?": ":":")+J)});return l=b.length===0?"{}":n?`{
|
|
35
35
|
`+n+b.join(`,
|
|
36
36
|
`+n)+`
|
|
37
|
-
`+v+"}":"{"+b.join(",")+"}",n=v,l}}o(p,"str"),typeof
|
|
38
|
-
`,r:"\r",t:" "},s,c=o(function(v){throw{name:"SyntaxError",message:v,at:r,text:s}},"error"),d=o(function(v){return v&&v!==n&&c("Expected '"+v+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),p=o(function(){var v,b="";for(n==="-"&&(b="-",d("-"));n>="0"&&n<="9";)b+=n,d();if(n===".")for(b+=".";d()&&n>="0"&&n<="9";)b+=n;if(n==="e"||n==="E")for(b+=n,d(),(n==="-"||n==="+")&&(b+=n,d());n>="0"&&n<="9";)b+=n,d();if(v=+b,!isFinite(v))c("Bad number");else return Cu==null&&(Cu=rp()),b.length>15?e.storeAsString?b:e.useNativeBigInt?BigInt(b):new Cu(b):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(v):new Cu(v):v},"number"),h=o(function(){var v,b,E="",k;if(n==='"')for(var L=r;d();){if(n==='"')return r-1>L&&(E+=s.substring(L,r-1)),d(),E;if(n==="\\"){if(r-1>L&&(E+=s.substring(L,r-1)),d(),n==="u"){for(k=0,b=0;b<4&&(v=parseInt(d(),16),!!isFinite(v));b+=1)k=k*16+v;E+=String.fromCharCode(k)}else if(typeof i[n]=="string")E+=i[n];else break;L=r}}c("Bad string")},"string"),_=o(function(){for(;n&&n<=" ";)d()},"white"),m=o(function(){switch(n){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}c("Unexpected '"+n+"'")},"word"),f,l=o(function(){var v=[];if(n==="["){if(d("["),_(),n==="]")return d("]"),v;for(;n;){if(v.push(f()),_(),n==="]")return d("]"),v;d(","),_()}}c("Bad array")},"array"),g=o(function(){var v,b=Object.create(null);if(n==="{"){if(d("{"),_(),n==="}")return d("}"),b;for(;n;){if(v=h(),_(),d(":"),e.strict===!0&&Object.hasOwnProperty.call(b,v)&&c('Duplicate key "'+v+'"'),A$.test(v)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?f():b[v]=f():I$.test(v)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?f():b[v]=f():b[v]=f(),_(),n==="}")return d("}"),b;d(","),_()}}c("Bad object")},"object");return f=o(function(){switch(_(),n){case"{":return g();case"[":return l();case'"':return h();case"-":return p();default:return n>="0"&&n<="9"?p():m()}},"value"),function(v,b){var E;return s=v+"",r=0,n=" ",E=f(),_(),n&&c("Syntax error"),typeof b=="function"?o(function k(L,J){var W,G,K=L[J];return K&&typeof K=="object"&&Object.keys(K).forEach(function(te){G=k(K,te),G!==void 0?K[te]=G:delete K[te]}),b.call(L,J,K)},"walk")({"":E},""):E}},"json_parse");WE.exports=R$});var YE=D((C5,Ou)=>{var KE=HE().stringify,JE=ZE();Ou.exports=function(t){return{parse:JE(t),stringify:KE}};Ou.exports.parse=JE();Ou.exports.stringify=KE});var np=D(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.GCE_LINUX_BIOS_PATHS=void 0;Ar.isGoogleCloudServerless=eS;Ar.isGoogleComputeEngineLinux=tS;Ar.isGoogleComputeEngineMACAddress=rS;Ar.isGoogleComputeEngine=nS;Ar.detectGCPResidency=O$;var XE=require("fs"),QE=require("os");Ar.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var C$=/^42:01/;function eS(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(eS,"isGoogleCloudServerless");function tS(){if((0,QE.platform)()!=="linux")return!1;try{(0,XE.statSync)(Ar.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,XE.readFileSync)(Ar.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(tS,"isGoogleComputeEngineLinux");function rS(){let t=(0,QE.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(C$.test(r))return!0}return!1}o(rS,"isGoogleComputeEngineMACAddress");function nS(){return tS()||rS()}o(nS,"isGoogleComputeEngine");function O$(){return eS()||nS()}o(O$,"detectGCPResidency")});var oS=D($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.Colours=void 0;var Ct=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="")}};$u.Colours=Ct;Ct.enabled=!1;Ct.reset="";Ct.bright="";Ct.dim="";Ct.red="";Ct.green="";Ct.yellow="";Ct.blue="";Ct.magenta="";Ct.cyan="";Ct.white="";Ct.grey="";Ct.refresh()});var uS=D(Je=>{"use strict";var $$=Je&&Je.__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]}),k$=Je&&Je.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),iS=Je&&Je.__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"&&$$(r,e,n[i]);return k$(r,e),r}}();Object.defineProperty(Je,"__esModule",{value:!0});Je.env=Je.DebugLogBackendBase=Je.placeholder=Je.AdhocDebugLogger=Je.LogSeverity=void 0;Je.getNodeBackend=ip;Je.getDebugBackend=N$;Je.getStructuredBackend=z$;Je.setBackend=U$;Je.log=sS;var D$=require("events"),va=iS(require("process")),aS=iS(require("util")),Xt=oS(),Ir;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(Ir||(Je.LogSeverity=Ir={}));var _a=class extends D$.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(Ir.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(Ir.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(Ir.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(Ir.ERROR,...n),this.func.sublog=n=>sS(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)}};Je.AdhocDebugLogger=_a;Je.placeholder=new _a("",()=>{}).func;var oi=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=va.env[Je.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)}}};Je.DebugLogBackendBase=oi;var op=class extends oi{static{o(this,"NodeBackend")}constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(r,...n)=>{var i;let s=`${Xt.Colours.green}${e}${Xt.Colours.reset}`,c=`${Xt.Colours.yellow}${va.pid}${Xt.Colours.reset}`,d;switch(r.severity){case Ir.ERROR:d=`${Xt.Colours.red}${r.severity}${Xt.Colours.reset}`;break;case Ir.INFO:d=`${Xt.Colours.magenta}${r.severity}${Xt.Colours.reset}`;break;case Ir.WARNING:d=`${Xt.Colours.yellow}${r.severity}${Xt.Colours.reset}`;break;default:d=(i=r.severity)!==null&&i!==void 0?i:Ir.DEFAULT;break}let p=aS.formatWithOptions({colors:Xt.Colours.enabled},...n),h=Object.assign({},r);delete h.severity;let _=Object.getOwnPropertyNames(h).length?JSON.stringify(h):"",m=_?`${Xt.Colours.grey}${_}${Xt.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",c,s,d,p,_?` ${m}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function ip(){return new op}o(ip,"getNodeBackend");var ap=class extends oi{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=va.env.NODE_DEBUG)!==null&&e!==void 0?e:"";va.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function N$(t){return new ap(t)}o(N$,"getDebugBackend");var sp=class extends oi{static{o(this,"StructuredBackend")}constructor(e){var r;super(),this.upstream=(r=e)!==null&&r!==void 0?r:void 0}makeLogger(e){var r;let n=(r=this.upstream)===null||r===void 0?void 0:r.makeLogger(e);return(i,...s)=>{var c;let d=(c=i.severity)!==null&&c!==void 0?c:Ir.INFO,p=Object.assign({severity:d,message:aS.format(...s)},i),h=JSON.stringify(p);n?n(i,h):console.log("%s",h)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function z$(t){return new sp(t)}o(z$,"getStructuredBackend");Je.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var up=new Map,Qt;function U$(t){Qt=t,up.clear()}o(U$,"setBackend");function sS(t,e){if(!Qt&&!va.env[Je.env.nodeEnables]||!t)return Je.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=up.get(t);if(r)return r.func;if(Qt===null)return Je.placeholder;Qt===void 0&&(Qt=ip());let n=(()=>{let i;return new _a(t,(c,...d)=>{if(i!==Qt){if(Qt===null)return;Qt===void 0&&(Qt=ip()),i=Qt}Qt?.log(t,c,...d)})})();return up.set(t,n),n.func}o(sS,"log")});var cp=D(mo=>{"use strict";var M$=mo&&mo.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),j$=mo&&mo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&M$(e,t,r)};Object.defineProperty(mo,"__esModule",{value:!0});j$(uS(),mo)});var Ea=D(he=>{"use strict";var lS=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]}),L$=he&&he.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),F$=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"&&lS(r,e,n[i]);return L$(r,e),r}}(),q$=he&&he.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lS(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=Z$;he.project=K$;he.universe=J$;he.bulk=Y$;he.isAvailable=Q$;he.resetIsAvailableCache=ek;he.getGCPResidency=pp;he.setGCPResidency=dS;he.requestTimeout=pS;var lp=ft(),B$=YE(),V$=np(),G$=F$(cp());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 cS=G$.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 dp(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(dp,"getBaseUrl");function H$(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(H$,"validate");async function ba(t,e={},r=3,n=!1){let i=new Headers(he.HEADERS),s="",c={};if(typeof t=="object"){let m=t;new Headers(m.headers).forEach((f,l)=>i.set(l,f)),s=m.metadataKey,c=m.params||c,r=m.noResponseRetries||r,n=m.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(H$(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((m,f)=>i.set(f,m)),c=e.params||c);let d=n?W$:lp.request,p={url:`${dp()}/${s}`,headers:i,retryConfig:{noResponseRetries:r},params:c,responseType:"text",timeout:pS()};cS.info("instance request %j",p);let h=await d(p);cS.info("instance metadata is %s",h.data);let _=h.headers.get(he.HEADER_NAME);if(_!==he.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${he.HEADER_NAME} header. Expected '${he.HEADER_VALUE}', got ${_?`'${_}'`:"no header"}`);if(typeof h.data=="string")try{return B$.parse(h.data)}catch{}return h.data}o(ba,"metadataAccessor");async function W$(t){let e={...t,url:t.url?.toString().replace(dp(),dp(he.SECONDARY_HOST_ADDRESS))},r=(0,lp.request)(t),n=(0,lp.request)(e);return Promise.any([r,n])}o(W$,"fastFailMetadataRequest");function Z$(t){return ba("instance",t)}o(Z$,"instance");function K$(t){return ba("project",t)}o(K$,"project");function J$(t){return ba("universe",t)}o(J$,"universe");async function Y$(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await ba(r),i=r.metadataKey;e[i]=n})())),e}o(Y$,"bulk");function X$(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(X$,"detectGCPAvailableRetries");var ku;async function Q$(){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 pp();case"ping-only":}}try{return ku===void 0&&(ku=ba("instance",void 0,X$(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await ku,!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(Q$,"isAvailable");function ek(){ku=void 0}o(ek,"resetIsAvailableCache");he.gcpResidencyCache=null;function pp(){return he.gcpResidencyCache===null&&dS(),he.gcpResidencyCache}o(pp,"getGCPResidency");function dS(t=null){he.gcpResidencyCache=t!==null?t:(0,V$.detectGCPResidency)()}o(dS,"setGCPResidency");function pS(){return pp()?0:3e3}o(pS,"requestTimeout");q$(np(),he)});var hS=D(Du=>{"use strict";Du.byteLength=rk;Du.toByteArray=ok;Du.fromByteArray=sk;var Lr=[],mr=[],tk=typeof Uint8Array<"u"?Uint8Array:Array,fp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ho=0,fS=fp.length;ho<fS;++ho)Lr[ho]=fp[ho],mr[fp.charCodeAt(ho)]=ho;var ho,fS;mr[45]=62;mr[95]=63;function mS(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(mS,"getLens");function rk(t){var e=mS(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(rk,"byteLength");function nk(t,e,r){return(e+r)*3/4-r}o(nk,"_byteLength");function ok(t){var e,r=mS(t),n=r[0],i=r[1],s=new tk(nk(t,n,i)),c=0,d=i>0?n-4:n,p;for(p=0;p<d;p+=4)e=mr[t.charCodeAt(p)]<<18|mr[t.charCodeAt(p+1)]<<12|mr[t.charCodeAt(p+2)]<<6|mr[t.charCodeAt(p+3)],s[c++]=e>>16&255,s[c++]=e>>8&255,s[c++]=e&255;return i===2&&(e=mr[t.charCodeAt(p)]<<2|mr[t.charCodeAt(p+1)]>>4,s[c++]=e&255),i===1&&(e=mr[t.charCodeAt(p)]<<10|mr[t.charCodeAt(p+1)]<<4|mr[t.charCodeAt(p+2)]>>2,s[c++]=e>>8&255,s[c++]=e&255),s}o(ok,"toByteArray");function ik(t){return Lr[t>>18&63]+Lr[t>>12&63]+Lr[t>>6&63]+Lr[t&63]}o(ik,"tripletToBase64");function ak(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(ik(n));return i.join("")}o(ak,"encodeChunk");function sk(t){for(var e,r=t.length,n=r%3,i=[],s=16383,c=0,d=r-n;c<d;c+=s)i.push(ak(t,c,c+s>d?d:c+s));return n===1?(e=t[r-1],i.push(Lr[e>>2]+Lr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Lr[e>>10]+Lr[e>>4&63]+Lr[e<<2&63]+"=")),i.join("")}o(sk,"fromByteArray")});var hp=D(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.fromArrayBufferToHex=uk;function uk(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o(uk,"fromArrayBufferToHex")});var gS=D(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.BrowserCrypto=void 0;var ii=hS(),ck=hp(),gp=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 ii.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),ii.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let i={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),c=ii.toByteArray(t.padBase64(n)),d=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,d,c,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),c=await window.crypto.subtle.sign(n,s,i);return ii.fromByteArray(new Uint8Array(c))}decodeBase64StringUtf8(e){let r=ii.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return ii.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,ck.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),i=new TextEncoder,s=await window.crypto.subtle.importKey("raw",i.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",s,i.encode(r))}};Nu.BrowserCrypto=gp});var yS=D(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.NodeCrypto=void 0;var ai=require("crypto"),yp=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return ai.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return ai.randomBytes(e).toString("base64")}async verify(e,r,n){let i=ai.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=ai.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 ai.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:dk(e);return lk(ai.createHmac("sha256",n).update(r).digest())}};zu.NodeCrypto=yp;function lk(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(lk,"toArrayBuffer");function dk(t){return Buffer.from(t)}o(dk,"toBuffer")});var Sa=D(mn=>{"use strict";var pk=mn&&mn.__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]}),fk=mn&&mn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pk(e,t,r)};Object.defineProperty(mn,"__esModule",{value:!0});mn.createCrypto=gk;mn.hasBrowserCrypto=vS;var mk=gS(),hk=yS();fk(hp(),mn);function gk(){return vS()?new mk.BrowserCrypto:new hk.NodeCrypto}o(gk,"createCrypto");function vS(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(vS,"hasBrowserCrypto")});var si=D((vp,bS)=>{var Uu=require("buffer"),Fr=Uu.Buffer;function _S(t,e){for(var r in t)e[r]=t[r]}o(_S,"copyProps");Fr.from&&Fr.alloc&&Fr.allocUnsafe&&Fr.allocUnsafeSlow?bS.exports=Uu:(_S(Uu,vp),vp.Buffer=go);function go(t,e,r){return Fr(t,e,r)}o(go,"SafeBuffer");go.prototype=Object.create(Fr.prototype);_S(Fr,go);go.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Fr(t,e,r)};go.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Fr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};go.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Fr(t)};go.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Uu.SlowBuffer(t)}});var SS=D((X5,ES)=>{"use strict";function _p(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(_p,"getParamSize");var yk={ES256:_p(256),ES384:_p(384),ES512:_p(521)};function vk(t){var e=yk[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(vk,"getParamBytesForAlg");ES.exports=vk});var bp=D((eY,IS)=>{"use strict";var Mu=si().Buffer,TS=SS(),ju=128,wS=0,_k=32,bk=16,Ek=2,xS=bk|_k|wS<<6,Lu=Ek|wS<<6;function Sk(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Sk,"base64Url");function AS(t){if(Mu.isBuffer(t))return t;if(typeof t=="string")return Mu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}o(AS,"signatureAsBuffer");function Pk(t,e){t=AS(t);var r=TS(e),n=r+1,i=t.length,s=0;if(t[s++]!==xS)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(ju|1)&&(c=t[s++]),i-s<c)throw new Error('"seq" specified length of "'+c+'", only "'+(i-s)+'" remaining');if(t[s++]!==Lu)throw new Error('Could not find expected "int" for "r"');var d=t[s++];if(i-s-2<d)throw new Error('"r" specified length of "'+d+'", only "'+(i-s-2)+'" available');if(n<d)throw new Error('"r" specified length of "'+d+'", max of "'+n+'" is acceptable');var p=s;if(s+=d,t[s++]!==Lu)throw new Error('Could not find expected "int" for "s"');var h=t[s++];if(i-s!==h)throw new Error('"s" specified length of "'+h+'", expected "'+(i-s)+'"');if(n<h)throw new Error('"s" specified length of "'+h+'", max of "'+n+'" is acceptable');var _=s;if(s+=h,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var m=r-d,f=r-h,l=Mu.allocUnsafe(m+d+f+h);for(s=0;s<m;++s)l[s]=0;t.copy(l,s,p+Math.max(-m,0),p+d),s=r;for(var g=s;s<g+f;++s)l[s]=0;return t.copy(l,s,_+Math.max(-f,0),_+h),l=l.toString("base64"),l=Sk(l),l}o(Pk,"derToJose");function PS(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=ju;return i&&--n,n}o(PS,"countPadding");function Tk(t,e){t=AS(t);var r=TS(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=PS(t,0,r),s=PS(t,r,t.length),c=r-i,d=r-s,p=2+c+1+1+d,h=p<ju,_=Mu.allocUnsafe((h?2:3)+p),m=0;return _[m++]=xS,h?_[m++]=p:(_[m++]=ju|1,_[m++]=p&255),_[m++]=Lu,_[m++]=c,i<0?(_[m++]=0,m+=t.copy(_,m,0,r)):m+=t.copy(_,m,i,r),_[m++]=Lu,_[m++]=d,s<0?(_[m++]=0,t.copy(_,m,r)):t.copy(_,m,r+s),_}o(Tk,"joseToDer");IS.exports={derToJose:Pk,joseToDer:Tk}});var Rr=D(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.LRUCache=void 0;hn.snakeToCamel=CS;hn.originalOrCamelOptions=Ik;hn.removeUndefinedValuesInObject=Rk;hn.isValidFile=Ck;hn.getWellKnownCertificateConfigFileLocation=Ok;var wk=require("fs"),xk=require("os"),Ep=require("path"),Ak="certificate_config.json",RS="gcloud";function CS(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(CS,"snakeToCamel");function Ik(t){function e(r){let n=t||{};return n[r]??n[CS(r)]}return o(e,"get"),{get:e}}o(Ik,"originalOrCamelOptions");var Sp=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()}};hn.LRUCache=Sp;function Rk(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(Rk,"removeUndefinedValuesInObject");async function Ck(t){try{return(await wk.promises.lstat(t)).isFile()}catch{return!1}}o(Ck,"isValidFile");function Ok(){let t=process.env.CLOUDSDK_CONFIG||($k()?Ep.join(process.env.APPDATA||"",RS):Ep.join(process.env.HOME||"",".config",RS));return Ep.join(t,Ak)}o(Ok,"getWellKnownCertificateConfigFileLocation");function $k(){return xk.platform().startsWith("win")}o($k,"_isWindows")});var OS=D((oY,kk)=>{kk.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 Pp=D(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.USER_AGENT=Vn.PRODUCT_NAME=Vn.pkg=void 0;var $S=OS();Vn.pkg=$S;var kS="google-api-nodejs-client";Vn.PRODUCT_NAME=kS;var Dk=`${kS}/${$S.version}`;Vn.USER_AGENT=Dk});var er=D(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.AuthClient=Cr.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=Cr.DEFAULT_UNIVERSE=void 0;var Nk=require("events"),Tp=ft(),zk=Rr(),Uk=cp(),wp=Pp();Cr.DEFAULT_UNIVERSE="googleapis.com";Cr.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=5*60*1e3;var xp=class t extends Nk.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=Cr.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=Cr.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,zk.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")??Cr.DEFAULT_UNIVERSE,this.transporter=e.transporter??new Tp.Gaxios(e.transporterOptions),r.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(t.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(t.DEFAULT_RESPONSE_INTERCEPTOR)),e.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=e.forceRefreshOnFailure??!1}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&Tp.Gaxios.mergeHeaders(s,r.headers),n&&Tp.Gaxios.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}setCredentials(e){this.credentials=e}addSharedMetadataHeaders(e){return!e.has("x-goog-user-project")&&this.quotaProjectId&&e.set("x-goog-user-project",this.quotaProjectId),e}addUserProjectAndAuthHeaders(e,r){let n=r.get("x-goog-user-project"),i=r.get("authorization");return n&&e.set("x-goog-user-project",n),i&&e.set("authorization",i),e}static log=(0,Uk.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(`${wp.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${wp.USER_AGENT}`):e.headers.set("User-Agent",wp.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let c={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,s,c):t.log.info("[%s] request %j",s,c)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,i,e.data):t.log.info("[%s] response %j",i,e.data)}catch{}return e},"resolved"),rejected:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,i,e.response?.data):t.log.error("[%s] error %j",i,e.response?.data)}catch{}throw e},"rejected")};static setMethodName(e,r){try{let n=e;n[t.RequestMethodNameSymbol]=r}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};Cr.AuthClient=xp});var Ip=D(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.LoginTicket=void 0;var Ap=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()}}};Fu.LoginTicket=Ap});var yo=D(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.OAuth2Client=qr.ClientAuthentication=qr.CertificateFormat=qr.CodeChallengeMethod=void 0;var DS=ft(),Mk=require("querystring"),jk=require("stream"),Lk=bp(),NS=Rr(),Rp=Sa(),ui=er(),Fk=Ip(),zS;(function(t){t.Plain="plain",t.S256="S256"})(zS||(qr.CodeChallengeMethod=zS={}));var gn;(function(t){t.PEM="PEM",t.JWK="JWK"})(gn||(qr.CertificateFormat=gn={}));var Pa;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(Pa||(qr.ClientAuthentication=Pa={}));var Cp=class t extends ui.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=gn.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||Pa.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()+"?"+Mk.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,Rp.createCrypto)(),n=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),s=(await e.sha256DigestBase64(n)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:n,codeChallenge:s}}getToken(e,r){let n=typeof e=="string"?{code:e}:e;if(r)this.getTokenAsync(n).then(i=>r(null,i.tokens,i.res),i=>r(i,null,i.response));else return this.getTokenAsync(n)}async getTokenAsync(e){let r=this.endpoints.oauth2TokenUrl.toString(),n=new Headers,i={client_id:e.client_id||this._clientId,code_verifier:e.codeVerifier,code:e.code,grant_type:"authorization_code",redirect_uri:e.redirect_uri||this.redirectUri};if(this.clientAuthentication===Pa.ClientSecretBasic){let p=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${p.toString("base64")}`)}this.clientAuthentication===Pa.ClientSecretPost&&(i.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,NS.removeUndefinedValuesInObject)(i)),headers:n};ui.AuthClient.setMethodName(s,"getTokenAsync");let c=await this.transporter.request(s),d=c.data;return c.data&&c.data.expires_in&&(d.expiry_date=new Date().getTime()+c.data.expires_in*1e3,delete d.expires_in),this.emit("tokens",d),{tokens:d,res:c}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let r=this.refreshTokenNoCache(e).then(n=>(this.refreshTokenPromises.delete(e),n),n=>{throw this.refreshTokenPromises.delete(e),n});return this.refreshTokenPromises.set(e,r),r}async refreshTokenNoCache(e){if(!e)throw new Error("No refresh token is set.");let r=this.endpoints.oauth2TokenUrl.toString(),n={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},i;try{let c={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,NS.removeUndefinedValuesInObject)(n))};ui.AuthClient.setMethodName(c,"refreshTokenNoCache"),i=await this.transporter.request(c)}catch(c){throw c instanceof DS.GaxiosError&&c.message==="invalid_grant"&&c.response?.data&&/ReAuth/i.test(c.response.data.error_description)&&(c.message=JSON.stringify(c.response.data)),c}let s=i.data;return i.data&&i.data.expires_in&&(s.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:i}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(r=>e(null,r.credentials,r.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),r=e.tokens;return r.refresh_token=this.credentials.refresh_token,this.credentials=r,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(r=>e(null,r.token,r.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let n=await this.processAndValidateRefreshHandler();if(n?.access_token)return this.setCredentials(n),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let r=await this.refreshAccessTokenAsync();if(!r.credentials||r.credentials&&!r.credentials.access_token)throw new Error("Could not refresh access token.");return{token:r.credentials.access_token,res:r.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let r=this.credentials;if(!r.access_token&&!r.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(r.access_token&&!this.isTokenExpiring()){r.token_type=r.token_type||"Bearer";let d=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(d)}}if(this.refreshHandler){let d=await this.processAndValidateRefreshHandler();if(d?.access_token){this.setCredentials(d);let p=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(p)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,i=null;try{n=await this.refreshToken(r.refresh_token),i=n.tokens}catch(d){let p=d;throw p.response&&(p.response.status===403||p.response.status===404)&&(p.message=`Could not refresh access token: ${p.message}`),p}let s=this.credentials;s.token_type=s.token_type||"Bearer",i.refresh_token=s.refresh_token,this.credentials=i;let c=new Headers({authorization:s.token_type+" "+i.access_token});return{headers:this.addSharedMetadataHeaders(c),res:n.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let r=new URL(this.endpoints.oauth2RevokeUrl);return r.searchParams.append("token",e),r}revokeToken(e,r){let n={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(ui.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=DS.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,n.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(n){let i=n.response;if(i){let s=i.status,c=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),d=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,p=i.config.data instanceof jk.Readable,h=s===401||s===403;if(!r&&h&&!p&&c)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&h&&!p&&d){let _=await this.processAndValidateRefreshHandler();return _?.access_token&&this.setCredentials(_),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,Rp.hasBrowserCrypto)()?gn.JWK:gn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case gn.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case gn.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let h={...t.RETRY_CONFIG,url:i};ui.AuthClient.setMethodName(h,"getFederatedSignonCertsAsync"),n=await this.transporter.request(h)}catch(h){throw h instanceof Error&&(h.message=`Failed to retrieve verification certificates: ${h.message}`),h}let s=n?.headers.get("cache-control"),c=-1;if(s){let h=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;h&&(c=Number(h)*1e3)}let d={};switch(r){case gn.PEM:d=n.data;break;case gn.JWK:for(let h of n.data.keys)d[h.kid]=h;break;default:throw new Error(`Unsupported certificate format ${r}`)}let p=new Date;return this.certificateExpiry=c===-1?null:new Date(p.getTime()+c),this.certificateCache=d,this.certificateCacheFormat=r,{certs:d,format:r,res:n}}getIapPublicKeys(e){if(e)this.getIapPublicKeysAsync().then(r=>e(null,r.pubkeys,r.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,r=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let n={...t.RETRY_CONFIG,url:r};ui.AuthClient.setMethodName(n,"getIapPublicKeysAsync"),e=await this.transporter.request(n)}catch(n){throw n instanceof Error&&(n.message=`Failed to retrieve verification certificates: ${n.message}`),n}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,r,n,i,s){let c=(0,Rp.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let d=e.split(".");if(d.length!==3)throw new Error("Wrong number of segments in token: "+e);let p=d[0]+"."+d[1],h=d[2],_,m;try{_=JSON.parse(c.decodeBase64StringUtf8(d[0]))}catch(L){throw L instanceof Error&&(L.message=`Can't parse token envelope: ${d[0]}': ${L.message}`),L}if(!_)throw new Error("Can't parse token envelope: "+d[0]);try{m=JSON.parse(c.decodeBase64StringUtf8(d[1]))}catch(L){throw L instanceof Error&&(L.message=`Can't parse token payload '${d[0]}`),L}if(!m)throw new Error("Can't parse token payload: "+d[1]);if(!Object.prototype.hasOwnProperty.call(r,_.kid))throw new Error("No pem found for envelope: "+JSON.stringify(_));let f=r[_.kid];if(_.alg==="ES256"&&(h=Lk.joseToDer(h,"ES256").toString("base64")),!await c.verify(f,p,h))throw new Error("Invalid token signature: "+e);if(!m.iat)throw new Error("No issue time in token: "+JSON.stringify(m));if(!m.exp)throw new Error("No expiration time in token: "+JSON.stringify(m));let g=Number(m.iat);if(isNaN(g))throw new Error("iat field using invalid format");let v=Number(m.exp);if(isNaN(v))throw new Error("exp field using invalid format");let b=new Date().getTime()/1e3;if(v>=b+s)throw new Error("Expiration time too far in future: "+JSON.stringify(m));let E=g-t.CLOCK_SKEW_SECS_,k=v+t.CLOCK_SKEW_SECS_;if(b<E)throw new Error("Token used too early, "+b+" < "+E+": "+JSON.stringify(m));if(b>k)throw new Error("Token used too late, "+b+" > "+k+": "+JSON.stringify(m));if(i&&i.indexOf(m.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+m.iss);if(typeof n<"u"&&n!==null){let L=m.aud,J=!1;if(n.constructor===Array?J=n.indexOf(L)>-1:J=L===n,!J)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new Fk.LoginTicket(_,m)}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}};qr.OAuth2Client=Cp});var $p=D(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.Compute=void 0;var qk=ft(),US=Ea(),Bk=yo(),Op=class extends Bk.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 US.instance(i)}catch(i){throw i instanceof qk.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 US.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))}};qu.Compute=Op});var Dp=D(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.IdTokenClient=void 0;var Vk=yo(),kp=class extends Vk.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}};Bu.IdTokenClient=kp});var Np=D(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.GCPEnv=void 0;ci.clear=Gk;ci.getEnv=Hk;var MS=Ea(),Br;(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"})(Br||(ci.GCPEnv=Br={}));var Ta;function Gk(){Ta=void 0}o(Gk,"clear");async function Hk(){return Ta||(Ta=Wk(),Ta)}o(Hk,"getEnv");async function Wk(){let t=Br.NONE;return Zk()?t=Br.APP_ENGINE:Kk()?t=Br.CLOUD_FUNCTIONS:await Qk()?await Xk()?t=Br.KUBERNETES_ENGINE:Jk()?t=Br.CLOUD_RUN:Yk()?t=Br.CLOUD_RUN_JOBS:t=Br.COMPUTE_ENGINE:t=Br.NONE,t}o(Wk,"getEnvMemoized");function Zk(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(Zk,"isAppEngine");function Kk(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o(Kk,"isCloudFunction");function Jk(){return!!process.env.K_CONFIGURATION}o(Jk,"isCloudRun");function Yk(){return!!process.env.CLOUD_RUN_JOB}o(Yk,"isCloudRunJob");async function Xk(){try{return await MS.instance("attributes/cluster-name"),!0}catch{return!1}}o(Xk,"isKubernetesEngine");async function Qk(){return MS.isAvailable()}o(Qk,"isComputeEngine")});var zp=D((vY,jS)=>{var Vu=si().Buffer,eD=require("stream"),tD=require("util");function Gu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Vu.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Vu.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(Gu,"DataStream");tD.inherits(Gu,eD);Gu.prototype.write=o(function(e){this.buffer=Vu.concat([this.buffer,Vu.from(e)]),this.emit("data",e)},"write");Gu.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");jS.exports=Gu});var FS=D((bY,LS)=>{"use strict";var wa=require("buffer").Buffer,Up=require("buffer").SlowBuffer;LS.exports=Hu;function Hu(t,e){if(!wa.isBuffer(t)||!wa.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(Hu,"bufferEq");Hu.install=function(){wa.prototype.equal=Up.prototype.equal=o(function(e){return Hu(this,e)},"equal")};var rD=wa.prototype.equal,nD=Up.prototype.equal;Hu.restore=function(){wa.prototype.equal=rD,Up.prototype.equal=nD}});var Fp=D((SY,JS)=>{var di=si().Buffer,hr=require("crypto"),BS=bp(),qS=require("util"),oD=`"%s" is not a valid algorithm.
|
|
37
|
+
`+v+"}":"{"+b.join(",")+"}",n=v,l}}o(p,"str"),typeof WE.stringify!="function"&&(WE.stringify=function(h,_,m){var f;if(n="",i="",typeof m=="number")for(f=0;f<m;f+=1)i+=" ";else typeof m=="string"&&(i=m);if(c=_,_&&typeof _!="function"&&(typeof _!="object"||typeof _.length!="number"))throw new Error("JSON.stringify");return p("",{"":h})})})()});var YE=D((N5,JE)=>{var Ru=null,k$=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,D$=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/,N$=o(function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(t!=null){if(t.strict===!0&&(e.strict=!0),t.storeAsString===!0&&(e.storeAsString=!0),e.alwaysParseAsBig=t.alwaysParseAsBig===!0?t.alwaysParseAsBig:!1,e.useNativeBigInt=t.useNativeBigInt===!0?t.useNativeBigInt:!1,typeof t.constructorAction<"u")if(t.constructorAction==="error"||t.constructorAction==="ignore"||t.constructorAction==="preserve")e.constructorAction=t.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);if(typeof t.protoAction<"u")if(t.protoAction==="error"||t.protoAction==="ignore"||t.protoAction==="preserve")e.protoAction=t.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`)}var r,n,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
38
|
+
`,r:"\r",t:" "},s,c=o(function(v){throw{name:"SyntaxError",message:v,at:r,text:s}},"error"),d=o(function(v){return v&&v!==n&&c("Expected '"+v+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),p=o(function(){var v,b="";for(n==="-"&&(b="-",d("-"));n>="0"&&n<="9";)b+=n,d();if(n===".")for(b+=".";d()&&n>="0"&&n<="9";)b+=n;if(n==="e"||n==="E")for(b+=n,d(),(n==="-"||n==="+")&&(b+=n,d());n>="0"&&n<="9";)b+=n,d();if(v=+b,!isFinite(v))c("Bad number");else return Ru==null&&(Ru=rp()),b.length>15?e.storeAsString?b:e.useNativeBigInt?BigInt(b):new Ru(b):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(v):new Ru(v):v},"number"),h=o(function(){var v,b,E="",k;if(n==='"')for(var L=r;d();){if(n==='"')return r-1>L&&(E+=s.substring(L,r-1)),d(),E;if(n==="\\"){if(r-1>L&&(E+=s.substring(L,r-1)),d(),n==="u"){for(k=0,b=0;b<4&&(v=parseInt(d(),16),!!isFinite(v));b+=1)k=k*16+v;E+=String.fromCharCode(k)}else if(typeof i[n]=="string")E+=i[n];else break;L=r}}c("Bad string")},"string"),_=o(function(){for(;n&&n<=" ";)d()},"white"),m=o(function(){switch(n){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}c("Unexpected '"+n+"'")},"word"),f,l=o(function(){var v=[];if(n==="["){if(d("["),_(),n==="]")return d("]"),v;for(;n;){if(v.push(f()),_(),n==="]")return d("]"),v;d(","),_()}}c("Bad array")},"array"),g=o(function(){var v,b=Object.create(null);if(n==="{"){if(d("{"),_(),n==="}")return d("}"),b;for(;n;){if(v=h(),_(),d(":"),e.strict===!0&&Object.hasOwnProperty.call(b,v)&&c('Duplicate key "'+v+'"'),k$.test(v)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?f():b[v]=f():D$.test(v)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?f():b[v]=f():b[v]=f(),_(),n==="}")return d("}"),b;d(","),_()}}c("Bad object")},"object");return f=o(function(){switch(_(),n){case"{":return g();case"[":return l();case'"':return h();case"-":return p();default:return n>="0"&&n<="9"?p():m()}},"value"),function(v,b){var E;return s=v+"",r=0,n=" ",E=f(),_(),n&&c("Syntax error"),typeof b=="function"?o(function k(L,J){var W,G,K=L[J];return K&&typeof K=="object"&&Object.keys(K).forEach(function(te){G=k(K,te),G!==void 0?K[te]=G:delete K[te]}),b.call(L,J,K)},"walk")({"":E},""):E}},"json_parse");JE.exports=N$});var eS=D((U5,Cu)=>{var XE=KE().stringify,QE=YE();Cu.exports=function(t){return{parse:QE(t),stringify:XE}};Cu.exports.parse=QE();Cu.exports.stringify=XE});var np=D(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.GCE_LINUX_BIOS_PATHS=void 0;Ar.isGoogleCloudServerless=nS;Ar.isGoogleComputeEngineLinux=oS;Ar.isGoogleComputeEngineMACAddress=iS;Ar.isGoogleComputeEngine=aS;Ar.detectGCPResidency=U$;var tS=require("fs"),rS=require("os");Ar.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var z$=/^42:01/;function nS(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(nS,"isGoogleCloudServerless");function oS(){if((0,rS.platform)()!=="linux")return!1;try{(0,tS.statSync)(Ar.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,tS.readFileSync)(Ar.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(oS,"isGoogleComputeEngineLinux");function iS(){let t=(0,rS.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(z$.test(r))return!0}return!1}o(iS,"isGoogleComputeEngineMACAddress");function aS(){return oS()||iS()}o(aS,"isGoogleComputeEngine");function U$(){return nS()||aS()}o(U$,"detectGCPResidency")});var sS=D(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.Colours=void 0;var Ct=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="")}};Ou.Colours=Ct;Ct.enabled=!1;Ct.reset="";Ct.bright="";Ct.dim="";Ct.red="";Ct.green="";Ct.yellow="";Ct.blue="";Ct.magenta="";Ct.cyan="";Ct.white="";Ct.grey="";Ct.refresh()});var dS=D(Je=>{"use strict";var M$=Je&&Je.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),j$=Je&&Je.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uS=Je&&Je.__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"&&M$(r,e,n[i]);return j$(r,e),r}}();Object.defineProperty(Je,"__esModule",{value:!0});Je.env=Je.DebugLogBackendBase=Je.placeholder=Je.AdhocDebugLogger=Je.LogSeverity=void 0;Je.getNodeBackend=ip;Je.getDebugBackend=F$;Je.getStructuredBackend=q$;Je.setBackend=B$;Je.log=lS;var L$=require("events"),va=uS(require("process")),cS=uS(require("util")),Xt=sS(),Ir;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(Ir||(Je.LogSeverity=Ir={}));var _a=class extends L$.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(Ir.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(Ir.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(Ir.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(Ir.ERROR,...n),this.func.sublog=n=>lS(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)}};Je.AdhocDebugLogger=_a;Je.placeholder=new _a("",()=>{}).func;var ii=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=va.env[Je.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)}}};Je.DebugLogBackendBase=ii;var op=class extends ii{static{o(this,"NodeBackend")}constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(r,...n)=>{var i;let s=`${Xt.Colours.green}${e}${Xt.Colours.reset}`,c=`${Xt.Colours.yellow}${va.pid}${Xt.Colours.reset}`,d;switch(r.severity){case Ir.ERROR:d=`${Xt.Colours.red}${r.severity}${Xt.Colours.reset}`;break;case Ir.INFO:d=`${Xt.Colours.magenta}${r.severity}${Xt.Colours.reset}`;break;case Ir.WARNING:d=`${Xt.Colours.yellow}${r.severity}${Xt.Colours.reset}`;break;default:d=(i=r.severity)!==null&&i!==void 0?i:Ir.DEFAULT;break}let p=cS.formatWithOptions({colors:Xt.Colours.enabled},...n),h=Object.assign({},r);delete h.severity;let _=Object.getOwnPropertyNames(h).length?JSON.stringify(h):"",m=_?`${Xt.Colours.grey}${_}${Xt.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",c,s,d,p,_?` ${m}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function ip(){return new op}o(ip,"getNodeBackend");var ap=class extends ii{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=va.env.NODE_DEBUG)!==null&&e!==void 0?e:"";va.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function F$(t){return new ap(t)}o(F$,"getDebugBackend");var sp=class extends ii{static{o(this,"StructuredBackend")}constructor(e){var r;super(),this.upstream=(r=e)!==null&&r!==void 0?r:void 0}makeLogger(e){var r;let n=(r=this.upstream)===null||r===void 0?void 0:r.makeLogger(e);return(i,...s)=>{var c;let d=(c=i.severity)!==null&&c!==void 0?c:Ir.INFO,p=Object.assign({severity:d,message:cS.format(...s)},i),h=JSON.stringify(p);n?n(i,h):console.log("%s",h)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function q$(t){return new sp(t)}o(q$,"getStructuredBackend");Je.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var up=new Map,Qt;function B$(t){Qt=t,up.clear()}o(B$,"setBackend");function lS(t,e){if(!Qt&&!va.env[Je.env.nodeEnables]||!t)return Je.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=up.get(t);if(r)return r.func;if(Qt===null)return Je.placeholder;Qt===void 0&&(Qt=ip());let n=(()=>{let i;return new _a(t,(c,...d)=>{if(i!==Qt){if(Qt===null)return;Qt===void 0&&(Qt=ip()),i=Qt}Qt?.log(t,c,...d)})})();return up.set(t,n),n.func}o(lS,"log")});var cp=D(mo=>{"use strict";var V$=mo&&mo.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),G$=mo&&mo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&V$(e,t,r)};Object.defineProperty(mo,"__esModule",{value:!0});G$(dS(),mo)});var Ea=D(he=>{"use strict";var fS=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]}),H$=he&&he.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),W$=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"&&fS(r,e,n[i]);return H$(r,e),r}}(),Z$=he&&he.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fS(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=ek;he.project=tk;he.universe=rk;he.bulk=nk;he.isAvailable=ik;he.resetIsAvailableCache=ak;he.getGCPResidency=pp;he.setGCPResidency=mS;he.requestTimeout=hS;var lp=ft(),K$=eS(),J$=np(),Y$=W$(cp());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 pS=Y$.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 dp(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(dp,"getBaseUrl");function X$(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(X$,"validate");async function ba(t,e={},r=3,n=!1){let i=new Headers(he.HEADERS),s="",c={};if(typeof t=="object"){let m=t;new Headers(m.headers).forEach((f,l)=>i.set(l,f)),s=m.metadataKey,c=m.params||c,r=m.noResponseRetries||r,n=m.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(X$(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((m,f)=>i.set(f,m)),c=e.params||c);let d=n?Q$:lp.request,p={url:`${dp()}/${s}`,headers:i,retryConfig:{noResponseRetries:r},params:c,responseType:"text",timeout:hS()};pS.info("instance request %j",p);let h=await d(p);pS.info("instance metadata is %s",h.data);let _=h.headers.get(he.HEADER_NAME);if(_!==he.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${he.HEADER_NAME} header. Expected '${he.HEADER_VALUE}', got ${_?`'${_}'`:"no header"}`);if(typeof h.data=="string")try{return K$.parse(h.data)}catch{}return h.data}o(ba,"metadataAccessor");async function Q$(t){let e={...t,url:t.url?.toString().replace(dp(),dp(he.SECONDARY_HOST_ADDRESS))},r=(0,lp.request)(t),n=(0,lp.request)(e);return Promise.any([r,n])}o(Q$,"fastFailMetadataRequest");function ek(t){return ba("instance",t)}o(ek,"instance");function tk(t){return ba("project",t)}o(tk,"project");function rk(t){return ba("universe",t)}o(rk,"universe");async function nk(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await ba(r),i=r.metadataKey;e[i]=n})())),e}o(nk,"bulk");function ok(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(ok,"detectGCPAvailableRetries");var $u;async function ik(){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 pp();case"ping-only":}}try{return $u===void 0&&($u=ba("instance",void 0,ok(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await $u,!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(ik,"isAvailable");function ak(){$u=void 0}o(ak,"resetIsAvailableCache");he.gcpResidencyCache=null;function pp(){return he.gcpResidencyCache===null&&mS(),he.gcpResidencyCache}o(pp,"getGCPResidency");function mS(t=null){he.gcpResidencyCache=t!==null?t:(0,J$.detectGCPResidency)()}o(mS,"setGCPResidency");function hS(){return pp()?0:3e3}o(hS,"requestTimeout");Z$(np(),he)});var vS=D(ku=>{"use strict";ku.byteLength=uk;ku.toByteArray=lk;ku.fromByteArray=fk;var Lr=[],mr=[],sk=typeof Uint8Array<"u"?Uint8Array:Array,fp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ho=0,gS=fp.length;ho<gS;++ho)Lr[ho]=fp[ho],mr[fp.charCodeAt(ho)]=ho;var ho,gS;mr[45]=62;mr[95]=63;function yS(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(yS,"getLens");function uk(t){var e=yS(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(uk,"byteLength");function ck(t,e,r){return(e+r)*3/4-r}o(ck,"_byteLength");function lk(t){var e,r=yS(t),n=r[0],i=r[1],s=new sk(ck(t,n,i)),c=0,d=i>0?n-4:n,p;for(p=0;p<d;p+=4)e=mr[t.charCodeAt(p)]<<18|mr[t.charCodeAt(p+1)]<<12|mr[t.charCodeAt(p+2)]<<6|mr[t.charCodeAt(p+3)],s[c++]=e>>16&255,s[c++]=e>>8&255,s[c++]=e&255;return i===2&&(e=mr[t.charCodeAt(p)]<<2|mr[t.charCodeAt(p+1)]>>4,s[c++]=e&255),i===1&&(e=mr[t.charCodeAt(p)]<<10|mr[t.charCodeAt(p+1)]<<4|mr[t.charCodeAt(p+2)]>>2,s[c++]=e>>8&255,s[c++]=e&255),s}o(lk,"toByteArray");function dk(t){return Lr[t>>18&63]+Lr[t>>12&63]+Lr[t>>6&63]+Lr[t&63]}o(dk,"tripletToBase64");function pk(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(dk(n));return i.join("")}o(pk,"encodeChunk");function fk(t){for(var e,r=t.length,n=r%3,i=[],s=16383,c=0,d=r-n;c<d;c+=s)i.push(pk(t,c,c+s>d?d:c+s));return n===1?(e=t[r-1],i.push(Lr[e>>2]+Lr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Lr[e>>10]+Lr[e>>4&63]+Lr[e<<2&63]+"=")),i.join("")}o(fk,"fromByteArray")});var hp=D(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.fromArrayBufferToHex=mk;function mk(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o(mk,"fromArrayBufferToHex")});var _S=D(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.BrowserCrypto=void 0;var ai=vS(),hk=hp(),gp=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 ai.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),ai.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let i={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),c=ai.toByteArray(t.padBase64(n)),d=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,d,c,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),c=await window.crypto.subtle.sign(n,s,i);return ai.fromByteArray(new Uint8Array(c))}decodeBase64StringUtf8(e){let r=ai.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return ai.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,hk.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),i=new TextEncoder,s=await window.crypto.subtle.importKey("raw",i.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",s,i.encode(r))}};Du.BrowserCrypto=gp});var bS=D(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.NodeCrypto=void 0;var si=require("crypto"),yp=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return si.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return si.randomBytes(e).toString("base64")}async verify(e,r,n){let i=si.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=si.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 si.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:yk(e);return gk(si.createHmac("sha256",n).update(r).digest())}};Nu.NodeCrypto=yp;function gk(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(gk,"toArrayBuffer");function yk(t){return Buffer.from(t)}o(yk,"toBuffer")});var Sa=D(mn=>{"use strict";var vk=mn&&mn.__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]}),_k=mn&&mn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vk(e,t,r)};Object.defineProperty(mn,"__esModule",{value:!0});mn.createCrypto=Sk;mn.hasBrowserCrypto=ES;var bk=_S(),Ek=bS();_k(hp(),mn);function Sk(){return ES()?new bk.BrowserCrypto:new Ek.NodeCrypto}o(Sk,"createCrypto");function ES(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(ES,"hasBrowserCrypto")});var ui=D((vp,PS)=>{var zu=require("buffer"),Fr=zu.Buffer;function SS(t,e){for(var r in t)e[r]=t[r]}o(SS,"copyProps");Fr.from&&Fr.alloc&&Fr.allocUnsafe&&Fr.allocUnsafeSlow?PS.exports=zu:(SS(zu,vp),vp.Buffer=go);function go(t,e,r){return Fr(t,e,r)}o(go,"SafeBuffer");go.prototype=Object.create(Fr.prototype);SS(Fr,go);go.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Fr(t,e,r)};go.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Fr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};go.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Fr(t)};go.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return zu.SlowBuffer(t)}});var wS=D((iY,TS)=>{"use strict";function _p(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(_p,"getParamSize");var Pk={ES256:_p(256),ES384:_p(384),ES512:_p(521)};function Tk(t){var e=Pk[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(Tk,"getParamBytesForAlg");TS.exports=Tk});var bp=D((sY,OS)=>{"use strict";var Uu=ui().Buffer,AS=wS(),Mu=128,IS=0,wk=32,xk=16,Ak=2,RS=xk|wk|IS<<6,ju=Ak|IS<<6;function Ik(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Ik,"base64Url");function CS(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")}o(CS,"signatureAsBuffer");function Rk(t,e){t=CS(t);var r=AS(e),n=r+1,i=t.length,s=0;if(t[s++]!==RS)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(Mu|1)&&(c=t[s++]),i-s<c)throw new Error('"seq" specified length of "'+c+'", only "'+(i-s)+'" remaining');if(t[s++]!==ju)throw new Error('Could not find expected "int" for "r"');var d=t[s++];if(i-s-2<d)throw new Error('"r" specified length of "'+d+'", only "'+(i-s-2)+'" available');if(n<d)throw new Error('"r" specified length of "'+d+'", max of "'+n+'" is acceptable');var p=s;if(s+=d,t[s++]!==ju)throw new Error('Could not find expected "int" for "s"');var h=t[s++];if(i-s!==h)throw new Error('"s" specified length of "'+h+'", expected "'+(i-s)+'"');if(n<h)throw new Error('"s" specified length of "'+h+'", max of "'+n+'" is acceptable');var _=s;if(s+=h,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var m=r-d,f=r-h,l=Uu.allocUnsafe(m+d+f+h);for(s=0;s<m;++s)l[s]=0;t.copy(l,s,p+Math.max(-m,0),p+d),s=r;for(var g=s;s<g+f;++s)l[s]=0;return t.copy(l,s,_+Math.max(-f,0),_+h),l=l.toString("base64"),l=Ik(l),l}o(Rk,"derToJose");function xS(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=Mu;return i&&--n,n}o(xS,"countPadding");function Ck(t,e){t=CS(t);var r=AS(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=xS(t,0,r),s=xS(t,r,t.length),c=r-i,d=r-s,p=2+c+1+1+d,h=p<Mu,_=Uu.allocUnsafe((h?2:3)+p),m=0;return _[m++]=RS,h?_[m++]=p:(_[m++]=Mu|1,_[m++]=p&255),_[m++]=ju,_[m++]=c,i<0?(_[m++]=0,m+=t.copy(_,m,0,r)):m+=t.copy(_,m,i,r),_[m++]=ju,_[m++]=d,s<0?(_[m++]=0,t.copy(_,m,r)):t.copy(_,m,r+s),_}o(Ck,"joseToDer");OS.exports={derToJose:Rk,joseToDer:Ck}});var Rr=D(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.LRUCache=void 0;hn.snakeToCamel=kS;hn.originalOrCamelOptions=Dk;hn.removeUndefinedValuesInObject=Nk;hn.isValidFile=zk;hn.getWellKnownCertificateConfigFileLocation=Uk;var Ok=require("fs"),$k=require("os"),Ep=require("path"),kk="certificate_config.json",$S="gcloud";function kS(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(kS,"snakeToCamel");function Dk(t){function e(r){let n=t||{};return n[r]??n[kS(r)]}return o(e,"get"),{get:e}}o(Dk,"originalOrCamelOptions");var Sp=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()}};hn.LRUCache=Sp;function Nk(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(Nk,"removeUndefinedValuesInObject");async function zk(t){try{return(await Ok.promises.lstat(t)).isFile()}catch{return!1}}o(zk,"isValidFile");function Uk(){let t=process.env.CLOUDSDK_CONFIG||(Mk()?Ep.join(process.env.APPDATA||"",$S):Ep.join(process.env.HOME||"",".config",$S));return Ep.join(t,kk)}o(Uk,"getWellKnownCertificateConfigFileLocation");function Mk(){return $k.platform().startsWith("win")}o(Mk,"_isWindows")});var DS=D((dY,jk)=>{jk.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 Pp=D(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.USER_AGENT=Vn.PRODUCT_NAME=Vn.pkg=void 0;var NS=DS();Vn.pkg=NS;var zS="google-api-nodejs-client";Vn.PRODUCT_NAME=zS;var Lk=`${zS}/${NS.version}`;Vn.USER_AGENT=Lk});var er=D(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.AuthClient=Cr.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=Cr.DEFAULT_UNIVERSE=void 0;var Fk=require("events"),Tp=ft(),qk=Rr(),Bk=cp(),wp=Pp();Cr.DEFAULT_UNIVERSE="googleapis.com";Cr.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=5*60*1e3;var xp=class t extends Fk.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=Cr.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=Cr.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,qk.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")??Cr.DEFAULT_UNIVERSE,this.transporter=e.transporter??new Tp.Gaxios(e.transporterOptions),r.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(t.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(t.DEFAULT_RESPONSE_INTERCEPTOR)),e.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=e.forceRefreshOnFailure??!1}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&Tp.Gaxios.mergeHeaders(s,r.headers),n&&Tp.Gaxios.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}setCredentials(e){this.credentials=e}addSharedMetadataHeaders(e){return!e.has("x-goog-user-project")&&this.quotaProjectId&&e.set("x-goog-user-project",this.quotaProjectId),e}addUserProjectAndAuthHeaders(e,r){let n=r.get("x-goog-user-project"),i=r.get("authorization");return n&&e.set("x-goog-user-project",n),i&&e.set("authorization",i),e}static log=(0,Bk.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:o(async e=>{if(!e.headers.has("x-goog-api-client")){let n=process.version.replace(/^v/,"");e.headers.set("x-goog-api-client",`gl-node/${n}`)}let r=e.headers.get("User-Agent");r?r.includes(`${wp.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${wp.USER_AGENT}`):e.headers.set("User-Agent",wp.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let c={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,s,c):t.log.info("[%s] request %j",s,c)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,i,e.data):t.log.info("[%s] response %j",i,e.data)}catch{}return e},"resolved"),rejected:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,i,e.response?.data):t.log.error("[%s] error %j",i,e.response?.data)}catch{}throw e},"rejected")};static setMethodName(e,r){try{let n=e;n[t.RequestMethodNameSymbol]=r}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};Cr.AuthClient=xp});var Ip=D(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.LoginTicket=void 0;var Ap=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()}}};Lu.LoginTicket=Ap});var yo=D(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.OAuth2Client=qr.ClientAuthentication=qr.CertificateFormat=qr.CodeChallengeMethod=void 0;var US=ft(),Vk=require("querystring"),Gk=require("stream"),Hk=bp(),MS=Rr(),Rp=Sa(),ci=er(),Wk=Ip(),jS;(function(t){t.Plain="plain",t.S256="S256"})(jS||(qr.CodeChallengeMethod=jS={}));var gn;(function(t){t.PEM="PEM",t.JWK="JWK"})(gn||(qr.CertificateFormat=gn={}));var Pa;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(Pa||(qr.ClientAuthentication=Pa={}));var Cp=class t extends ci.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=gn.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||Pa.ClientSecretPost,this.issuers=e.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}static GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";static CLOCK_SKEW_SECS_=300;static DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400;generateAuthUrl(e={}){if(e.code_challenge_method&&!e.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return e.response_type=e.response_type||"code",e.client_id=e.client_id||this._clientId,e.redirect_uri=e.redirect_uri||this.redirectUri,Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+Vk.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,Rp.createCrypto)(),n=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),s=(await e.sha256DigestBase64(n)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:n,codeChallenge:s}}getToken(e,r){let n=typeof e=="string"?{code:e}:e;if(r)this.getTokenAsync(n).then(i=>r(null,i.tokens,i.res),i=>r(i,null,i.response));else return this.getTokenAsync(n)}async getTokenAsync(e){let r=this.endpoints.oauth2TokenUrl.toString(),n=new Headers,i={client_id:e.client_id||this._clientId,code_verifier:e.codeVerifier,code:e.code,grant_type:"authorization_code",redirect_uri:e.redirect_uri||this.redirectUri};if(this.clientAuthentication===Pa.ClientSecretBasic){let p=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${p.toString("base64")}`)}this.clientAuthentication===Pa.ClientSecretPost&&(i.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,MS.removeUndefinedValuesInObject)(i)),headers:n};ci.AuthClient.setMethodName(s,"getTokenAsync");let c=await this.transporter.request(s),d=c.data;return c.data&&c.data.expires_in&&(d.expiry_date=new Date().getTime()+c.data.expires_in*1e3,delete d.expires_in),this.emit("tokens",d),{tokens:d,res:c}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let r=this.refreshTokenNoCache(e).then(n=>(this.refreshTokenPromises.delete(e),n),n=>{throw this.refreshTokenPromises.delete(e),n});return this.refreshTokenPromises.set(e,r),r}async refreshTokenNoCache(e){if(!e)throw new Error("No refresh token is set.");let r=this.endpoints.oauth2TokenUrl.toString(),n={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},i;try{let c={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,MS.removeUndefinedValuesInObject)(n))};ci.AuthClient.setMethodName(c,"refreshTokenNoCache"),i=await this.transporter.request(c)}catch(c){throw c instanceof US.GaxiosError&&c.message==="invalid_grant"&&c.response?.data&&/ReAuth/i.test(c.response.data.error_description)&&(c.message=JSON.stringify(c.response.data)),c}let s=i.data;return i.data&&i.data.expires_in&&(s.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:i}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(r=>e(null,r.credentials,r.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),r=e.tokens;return r.refresh_token=this.credentials.refresh_token,this.credentials=r,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(r=>e(null,r.token,r.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let n=await this.processAndValidateRefreshHandler();if(n?.access_token)return this.setCredentials(n),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let r=await this.refreshAccessTokenAsync();if(!r.credentials||r.credentials&&!r.credentials.access_token)throw new Error("Could not refresh access token.");return{token:r.credentials.access_token,res:r.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let r=this.credentials;if(!r.access_token&&!r.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(r.access_token&&!this.isTokenExpiring()){r.token_type=r.token_type||"Bearer";let d=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(d)}}if(this.refreshHandler){let d=await this.processAndValidateRefreshHandler();if(d?.access_token){this.setCredentials(d);let p=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(p)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,i=null;try{n=await this.refreshToken(r.refresh_token),i=n.tokens}catch(d){let p=d;throw p.response&&(p.response.status===403||p.response.status===404)&&(p.message=`Could not refresh access token: ${p.message}`),p}let s=this.credentials;s.token_type=s.token_type||"Bearer",i.refresh_token=s.refresh_token,this.credentials=i;let c=new Headers({authorization:s.token_type+" "+i.access_token});return{headers:this.addSharedMetadataHeaders(c),res:n.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let r=new URL(this.endpoints.oauth2RevokeUrl);return r.searchParams.append("token",e),r}revokeToken(e,r){let n={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(ci.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=US.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,n.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(n){let i=n.response;if(i){let s=i.status,c=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),d=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,p=i.config.data instanceof Gk.Readable,h=s===401||s===403;if(!r&&h&&!p&&c)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&h&&!p&&d){let _=await this.processAndValidateRefreshHandler();return _?.access_token&&this.setCredentials(_),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,Rp.hasBrowserCrypto)()?gn.JWK:gn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case gn.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case gn.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let h={...t.RETRY_CONFIG,url:i};ci.AuthClient.setMethodName(h,"getFederatedSignonCertsAsync"),n=await this.transporter.request(h)}catch(h){throw h instanceof Error&&(h.message=`Failed to retrieve verification certificates: ${h.message}`),h}let s=n?.headers.get("cache-control"),c=-1;if(s){let h=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;h&&(c=Number(h)*1e3)}let d={};switch(r){case gn.PEM:d=n.data;break;case gn.JWK:for(let h of n.data.keys)d[h.kid]=h;break;default:throw new Error(`Unsupported certificate format ${r}`)}let p=new Date;return this.certificateExpiry=c===-1?null:new Date(p.getTime()+c),this.certificateCache=d,this.certificateCacheFormat=r,{certs:d,format:r,res:n}}getIapPublicKeys(e){if(e)this.getIapPublicKeysAsync().then(r=>e(null,r.pubkeys,r.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,r=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let n={...t.RETRY_CONFIG,url:r};ci.AuthClient.setMethodName(n,"getIapPublicKeysAsync"),e=await this.transporter.request(n)}catch(n){throw n instanceof Error&&(n.message=`Failed to retrieve verification certificates: ${n.message}`),n}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,r,n,i,s){let c=(0,Rp.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let d=e.split(".");if(d.length!==3)throw new Error("Wrong number of segments in token: "+e);let p=d[0]+"."+d[1],h=d[2],_,m;try{_=JSON.parse(c.decodeBase64StringUtf8(d[0]))}catch(L){throw L instanceof Error&&(L.message=`Can't parse token envelope: ${d[0]}': ${L.message}`),L}if(!_)throw new Error("Can't parse token envelope: "+d[0]);try{m=JSON.parse(c.decodeBase64StringUtf8(d[1]))}catch(L){throw L instanceof Error&&(L.message=`Can't parse token payload '${d[0]}`),L}if(!m)throw new Error("Can't parse token payload: "+d[1]);if(!Object.prototype.hasOwnProperty.call(r,_.kid))throw new Error("No pem found for envelope: "+JSON.stringify(_));let f=r[_.kid];if(_.alg==="ES256"&&(h=Hk.joseToDer(h,"ES256").toString("base64")),!await c.verify(f,p,h))throw new Error("Invalid token signature: "+e);if(!m.iat)throw new Error("No issue time in token: "+JSON.stringify(m));if(!m.exp)throw new Error("No expiration time in token: "+JSON.stringify(m));let g=Number(m.iat);if(isNaN(g))throw new Error("iat field using invalid format");let v=Number(m.exp);if(isNaN(v))throw new Error("exp field using invalid format");let b=new Date().getTime()/1e3;if(v>=b+s)throw new Error("Expiration time too far in future: "+JSON.stringify(m));let E=g-t.CLOCK_SKEW_SECS_,k=v+t.CLOCK_SKEW_SECS_;if(b<E)throw new Error("Token used too early, "+b+" < "+E+": "+JSON.stringify(m));if(b>k)throw new Error("Token used too late, "+b+" > "+k+": "+JSON.stringify(m));if(i&&i.indexOf(m.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+m.iss);if(typeof n<"u"&&n!==null){let L=m.aud,J=!1;if(n.constructor===Array?J=n.indexOf(L)>-1:J=L===n,!J)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new Wk.LoginTicket(_,m)}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}};qr.OAuth2Client=Cp});var $p=D(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.Compute=void 0;var Zk=ft(),LS=Ea(),Kk=yo(),Op=class extends Kk.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 LS.instance(i)}catch(i){throw i instanceof Zk.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 LS.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))}};Fu.Compute=Op});var Dp=D(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.IdTokenClient=void 0;var Jk=yo(),kp=class extends Jk.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}};qu.IdTokenClient=kp});var Np=D(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.GCPEnv=void 0;li.clear=Yk;li.getEnv=Xk;var FS=Ea(),Br;(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"})(Br||(li.GCPEnv=Br={}));var Ta;function Yk(){Ta=void 0}o(Yk,"clear");async function Xk(){return Ta||(Ta=Qk(),Ta)}o(Xk,"getEnv");async function Qk(){let t=Br.NONE;return eD()?t=Br.APP_ENGINE:tD()?t=Br.CLOUD_FUNCTIONS:await iD()?await oD()?t=Br.KUBERNETES_ENGINE:rD()?t=Br.CLOUD_RUN:nD()?t=Br.CLOUD_RUN_JOBS:t=Br.COMPUTE_ENGINE:t=Br.NONE,t}o(Qk,"getEnvMemoized");function eD(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(eD,"isAppEngine");function tD(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o(tD,"isCloudFunction");function rD(){return!!process.env.K_CONFIGURATION}o(rD,"isCloudRun");function nD(){return!!process.env.CLOUD_RUN_JOB}o(nD,"isCloudRunJob");async function oD(){try{return await FS.instance("attributes/cluster-name"),!0}catch{return!1}}o(oD,"isKubernetesEngine");async function iD(){return FS.isAvailable()}o(iD,"isComputeEngine")});var zp=D((wY,qS)=>{var Bu=ui().Buffer,aD=require("stream"),sD=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+")")}o(Vu,"DataStream");sD.inherits(Vu,aD);Vu.prototype.write=o(function(e){this.buffer=Bu.concat([this.buffer,Bu.from(e)]),this.emit("data",e)},"write");Vu.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");qS.exports=Vu});var VS=D((AY,BS)=>{"use strict";var wa=require("buffer").Buffer,Up=require("buffer").SlowBuffer;BS.exports=Gu;function Gu(t,e){if(!wa.isBuffer(t)||!wa.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(Gu,"bufferEq");Gu.install=function(){wa.prototype.equal=Up.prototype.equal=o(function(e){return Gu(this,e)},"equal")};var uD=wa.prototype.equal,cD=Up.prototype.equal;Gu.restore=function(){wa.prototype.equal=uD,Up.prototype.equal=cD}});var Fp=D((RY,QS)=>{var pi=ui().Buffer,hr=require("crypto"),HS=bp(),GS=require("util"),lD=`"%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".`,xa="secret must be a string or buffer",li="key must be a string or a buffer",iD="key must be a string, a buffer or an object",jp=typeof hr.createPublicKey=="function";jp&&(li+=" or a KeyObject",xa+="or a KeyObject");function VS(t){if(!di.isBuffer(t)&&typeof t!="string"&&(!jp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Or(li)}o(VS,"checkIsPublicKey");function GS(t){if(!di.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Or(iD)}o(GS,"checkIsPrivateKey");function aD(t){if(!di.isBuffer(t)){if(typeof t=="string")return t;if(!jp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Or(xa)}}o(aD,"checkIsSecretKey");function Lp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Lp,"fromBase64");function HS(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(HS,"toBase64");function Or(t){var e=[].slice.call(arguments,1),r=qS.format.bind(qS,t).apply(null,e);return new TypeError(r)}o(Or,"typeError");function sD(t){return di.isBuffer(t)||typeof t=="string"}o(sD,"bufferOrString");function Aa(t){return sD(t)||(t=JSON.stringify(t)),t}o(Aa,"normalizeInput");function WS(t){return o(function(r,n){aD(n),r=Aa(r);var i=hr.createHmac("sha"+t,n),s=(i.update(r),i.digest("base64"));return Lp(s)},"sign")}o(WS,"createHmacSigner");var Mp,uD="timingSafeEqual"in hr?o(function(e,r){return e.byteLength!==r.byteLength?!1:hr.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return Mp||(Mp=FS()),Mp(e,r)},"timingSafeEqual");function cD(t){return o(function(r,n,i){var s=WS(t)(r,i);return uD(di.from(n),di.from(s))},"verify")}o(cD,"createHmacVerifier");function ZS(t){return o(function(r,n){GS(n),r=Aa(r);var i=hr.createSign("RSA-SHA"+t),s=(i.update(r),i.sign(n,"base64"));return Lp(s)},"sign")}o(ZS,"createKeySigner");function KS(t){return o(function(r,n,i){VS(i),r=Aa(r),n=HS(n);var s=hr.createVerify("RSA-SHA"+t);return s.update(r),s.verify(i,n,"base64")},"verify")}o(KS,"createKeyVerifier");function lD(t){return o(function(r,n){GS(n),r=Aa(r);var i=hr.createSign("RSA-SHA"+t),s=(i.update(r),i.sign({key:n,padding:hr.constants.RSA_PKCS1_PSS_PADDING,saltLength:hr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Lp(s)},"sign")}o(lD,"createPSSKeySigner");function dD(t){return o(function(r,n,i){VS(i),r=Aa(r),n=HS(n);var s=hr.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:i,padding:hr.constants.RSA_PKCS1_PSS_PADDING,saltLength:hr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(dD,"createPSSKeyVerifier");function pD(t){var e=ZS(t);return o(function(){var n=e.apply(null,arguments);return n=BS.derToJose(n,"ES"+t),n},"sign")}o(pD,"createECDSASigner");function fD(t){var e=KS(t);return o(function(n,i,s){i=BS.joseToDer(i,"ES"+t).toString("base64");var c=e(n,i,s);return c},"verify")}o(fD,"createECDSAVerifer");function mD(){return o(function(){return""},"sign")}o(mD,"createNoneSigner");function hD(){return o(function(e,r){return r===""},"verify")}o(hD,"createNoneVerifier");JS.exports=o(function(e){var r={hs:WS,rs:ZS,ps:lD,es:pD,none:mD},n={hs:cD,rs:KS,ps:dD,es:fD,none:hD},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Or(oD,e);var s=(i[1]||i[3]).toLowerCase(),c=i[2];return{sign:r[s](c),verify:n[s](c)}},"jwa")});var qp=D((TY,YS)=>{var gD=require("buffer").Buffer;YS.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||gD.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var nP=D((xY,rP)=>{var yD=si().Buffer,XS=zp(),vD=Fp(),_D=require("stream"),QS=qp(),Bp=require("util");function eP(t,e){return yD.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(eP,"base64url");function bD(t,e,r){r=r||"utf8";var n=eP(QS(t),"binary"),i=eP(QS(e),r);return Bp.format("%s.%s",n,i)}o(bD,"jwsSecuredInput");function tP(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,s=vD(e.alg),c=bD(e,r,i),d=s.sign(c,n);return Bp.format("%s.%s",c,d)}o(tP,"jwsSign");function Wu(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 XS(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new XS(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(Wu,"SignStream");Bp.inherits(Wu,_D);Wu.prototype.sign=o(function(){try{var e=tP({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");Wu.sign=tP;rP.exports=Wu});var fP=D((IY,pP)=>{var iP=si().Buffer,oP=zp(),ED=Fp(),SD=require("stream"),aP=qp(),PD=require("util"),TD=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function wD(t){return Object.prototype.toString.call(t)==="[object Object]"}o(wD,"isObject");function xD(t){if(wD(t))return t;try{return JSON.parse(t)}catch{return}}o(xD,"safeJsonParse");function sP(t){var e=t.split(".",1)[0];return xD(iP.from(e,"base64").toString("binary"))}o(sP,"headerFromJWS");function AD(t){return t.split(".",2).join(".")}o(AD,"securedInputFromJWS");function uP(t){return t.split(".")[2]}o(uP,"signatureFromJWS");function ID(t,e){e=e||"utf8";var r=t.split(".")[1];return iP.from(r,"base64").toString(e)}o(ID,"payloadFromJWS");function cP(t){return TD.test(t)&&!!sP(t)}o(cP,"isValidJws");function lP(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=aP(t);var i=uP(t),s=AD(t),c=ED(e);return c.verify(s,i,r)}o(lP,"jwsVerify");function dP(t,e){if(e=e||{},t=aP(t),!cP(t))return null;var r=sP(t);if(!r)return null;var n=ID(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:uP(t)}}o(dP,"jwsDecode");function pi(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 oP(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new oP(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(pi,"VerifyStream");PD.inherits(pi,SD);pi.prototype.verify=o(function(){try{var e=lP(this.signature.buffer,this.algorithm,this.key.buffer),r=dP(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");pi.decode=dP;pi.isValid=cP;pi.verify=lP;pP.exports=pi});var Vp=D(Gn=>{var mP=nP(),Zu=fP(),RD=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Gn.ALGORITHMS=RD;Gn.sign=mP.sign;Gn.verify=Zu.verify;Gn.decode=Zu.decode;Gn.isValid=Zu.isValid;Gn.createSign=o(function(e){return new mP(e)},"createSign");Gn.createVerify=o(function(e){return new Zu(e)},"createVerify")});var RP=D(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.GoogleToken=void 0;var hP=Ku(require("fs")),CD=ft(),OD=Ku(Vp()),$D=Ku(require("path")),kD=require("util");function Ku(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Ku=o(function(s,c){if(!c&&s&&s.__esModule)return s;var d,p,h={__proto__:null,default:s};if(s===null||yn(s)!="object"&&typeof s!="function")return h;if(d=c?n:r){if(d.has(s))return d.get(s);d.set(s,h)}for(var _ in s)_!=="default"&&{}.hasOwnProperty.call(s,_)&&((p=(d=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,_))&&(p.get||p.set)?d(h,_,p):h[_]=s[_]);return h},"_interopRequireWildcard"))(t,e)}o(Ku,"_interopRequireWildcard");function yn(t){"@babel/helpers - typeof";return yn=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},yn(t)}o(yn,"_typeof");function DD(t,e){TP(t,e),e.add(t)}o(DD,"_classPrivateMethodInitSpec");function ND(t,e,r){TP(t,e),e.set(t,r)}o(ND,"_classPrivateFieldInitSpec");function TP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(TP,"_checkPrivateRedeclaration");function gP(t,e,r){return t.set($r(t,e),r),r}o(gP,"_classPrivateFieldSet");function yP(t,e){return t.get($r(t,e))}o(yP,"_classPrivateFieldGet");function $r(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($r,"_assertClassBrand");function vP(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,AP(n.key),n)}}o(vP,"_defineProperties");function wP(t,e,r){return e&&vP(t.prototype,e),r&&vP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(wP,"_createClass");function xP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(xP,"_classCallCheck");function zD(t,e,r){return e=Oa(e),UD(t,Jp()?Reflect.construct(e,r||[],Oa(t).constructor):e.apply(t,r))}o(zD,"_callSuper");function UD(t,e){if(e&&(yn(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return MD(t)}o(UD,"_possibleConstructorReturn");function MD(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(MD,"_assertThisInitialized");function jD(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&&Ca(t,e)}o(jD,"_inherits");function Gp(t){var e=typeof Map=="function"?new Map:void 0;return Gp=o(function(n){if(n===null||!FD(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 LD(n,arguments,Oa(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ca(i,n)},"_wrapNativeSuper"),Gp(t)}o(Gp,"_wrapNativeSuper");function LD(t,e,r){if(Jp())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Ca(i,r.prototype),i}o(LD,"_construct");function Jp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Jp=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(Jp,"_isNativeReflectConstruct");function FD(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(FD,"_isNativeFunction");function Ca(t,e){return Ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ca(t,e)}o(Ca,"_setPrototypeOf");function Oa(t){return Oa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Oa(t)}o(Oa,"_getPrototypeOf");function tr(t,e,r){return(e=AP(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(tr,"_defineProperty");function AP(t){var e=qD(t,"string");return yn(e)=="symbol"?e:e+""}o(AP,"_toPropertyKey");function qD(t,e){if(yn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(yn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(qD,"_toPrimitive");function nr(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(l,g,v,b){var E=g&&g.prototype instanceof d?g:d,k=Object.create(E.prototype);return rr(k,"_invoke",function(L,J,W){var G,K,te,X=0,Te=W||[],re=!1,B={p:0,n:0,v:t,a:q,f:q.bind(t,4),d:o(function(Z,oe){return G=Z,K=0,te=t,B.n=oe,c},"d")};function q(Y,Z){for(K=Y,te=Z,e=0;!re&&X&&!oe&&e<Te.length;e++){var oe,ae=Te[e],Ie=B.p,$e=ae[2];Y>3?(oe=$e===Z)&&(te=ae[(K=ae[4])?5:(K=3,3)],ae[4]=ae[5]=t):ae[0]<=Ie&&((oe=Y<2&&Ie<ae[1])?(K=0,B.v=Z,B.n=ae[1]):Ie<$e&&(oe=Y<3||ae[0]>Z||Z>$e)&&(ae[4]=Y,ae[5]=Z,B.n=$e,K=0))}if(oe||Y>1)return c;throw re=!0,Z}return o(q,"d"),function(Y,Z,oe){if(X>1)throw TypeError("Generator is already running");for(re&&Z===1&&q(Z,oe),K=Z,te=oe;(e=K<2?t:te)||!re;){G||(K?K<3?(K>1&&(B.n=-1),q(K,te)):B.n=te:B.v=te);try{if(X=2,G){if(K||(Y="next"),e=G[Y]){if(!(e=e.call(G,te)))throw TypeError("iterator result is not an object");if(!e.done)return e;te=e.value,K<2&&(K=0)}else K===1&&(e=G.return)&&e.call(G),K<2&&(te=TypeError("The iterator does not provide a '"+Y+"' method"),K=1);G=t}else if((e=(re=B.n<0)?te:L.call(J,B))!==c)break}catch(ae){G=t,K=1,te=ae}finally{X=1}}return{value:e,done:re}}}(l,v,b),!0),k}o(s,"i");var c={};function d(){}o(d,"Generator");function p(){}o(p,"GeneratorFunction");function h(){}o(h,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var _=[][n]?e(e([][n]())):(rr(e={},n,function(){return this}),e),m=h.prototype=d.prototype=Object.create(_);function f(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,h):(l.__proto__=h,rr(l,i,"GeneratorFunction")),l.prototype=Object.create(m),l}return o(f,"f"),p.prototype=h,rr(m,"constructor",h),rr(h,"constructor",p),p.displayName="GeneratorFunction",rr(h,i,"GeneratorFunction"),rr(m),rr(m,i,"Generator"),rr(m,n,function(){return this}),rr(m,"toString",function(){return"[object Generator]"}),(nr=o(function(){return{w:s,m:f}},"_regenerator"))()}o(nr,"_regenerator");function rr(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}rr=o(function(c,d,p,h){if(d)i?i(c,d,{value:p,enumerable:!h,configurable:!h,writable:!h}):c[d]=p;else{var _=o(function(f,l){rr(c,f,function(g){return this._invoke(f,l,g)})},"o");_("next",0),_("throw",1),_("return",2)}},"_regeneratorDefine"),rr(t,e,r,n)}o(rr,"_regeneratorDefine2");function _P(t,e,r,n,i,s,c){try{var d=t[s](c),p=d.value}catch(h){return void r(h)}d.done?e(p):Promise.resolve(p).then(n,i)}o(_P,"asyncGeneratorStep");function fi(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function c(p){_P(s,n,i,c,d,"next",p)}o(c,"_next");function d(p){_P(s,n,i,c,d,"throw",p)}o(d,"_throw"),c(void 0)})}}o(fi,"_asyncToGenerator");var bP=hP.readFile?(0,kD.promisify)(hP.readFile):fi(nr().m(o(function t(){return nr().w(function(e){for(;;)switch(e.n){case 0:throw new Ra("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),EP="https://oauth2.googleapis.com/token",BD="https://oauth2.googleapis.com/revoke?token=",Ra=function(t){function e(r,n){var i;return xP(this,e),i=zD(this,e,[r]),tr(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),jD(e,t),wP(e)}(Gp(Error)),Ia=new WeakMap,Vr=new WeakSet,$Y=Ju.GoogleToken=function(){function t(e){xP(this,t),DD(this,Vr),tr(this,"expiresAt",void 0),tr(this,"key",void 0),tr(this,"keyFile",void 0),tr(this,"iss",void 0),tr(this,"sub",void 0),tr(this,"scope",void 0),tr(this,"rawToken",void 0),tr(this,"tokenExpires",void 0),tr(this,"email",void 0),tr(this,"additionalClaims",void 0),tr(this,"eagerRefreshThresholdMillis",void 0),tr(this,"transporter",{request:o(function(n){return(0,CD.request)(n)},"request")}),ND(this,Ia,void 0),$r(Vr,this,IP).call(this,e)}return o(t,"GoogleToken"),wP(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(yn(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;$r(Vr,this,SP).call(this,n).then(function(s){return i(null,s)},r);return}return $r(Vr,this,SP).call(this,n)},"getToken")},{key:"getCredentials",value:function(){var e=fi(nr().m(o(function n(i){var s,c,d,p,h,_,m;return nr().w(function(f){for(;;)switch(f.n){case 0:s=$D.extname(i),m=s,f.n=m===".json"?1:m===".der"||m===".crt"||m===".pem"?4:m===".p12"||m===".pfx"?6:7;break;case 1:return f.n=2,bP(i,"utf8");case 2:if(c=f.v,d=JSON.parse(c),p=d.private_key,h=d.client_email,!(!p||!h)){f.n=3;break}throw new Ra("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return f.a(2,{privateKey:p,clientEmail:h});case 4:return f.n=5,bP(i,"utf8");case 5:return _=f.v,f.a(2,{privateKey:_});case 6:throw new Ra("*.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 Ra("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return f.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){$r(Vr,this,PP).call(this).then(function(){return r()},r);return}return $r(Vr,this,PP).call(this)},"revokeToken")}])}();function SP(t){return Hp.apply(this,arguments)}o(SP,"_getTokenAsync");function Hp(){return Hp=fi(nr().m(o(function t(e){return nr().w(function(r){for(;;)switch(r.n){case 0:if(!(yP(Ia,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,yP(Ia,this));case 1:return r.p=1,r.n=2,gP(Ia,this,$r(Vr,this,VD).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,gP(Ia,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),Hp.apply(this,arguments)}o(Hp,"_getTokenAsync2");function VD(t){return Wp.apply(this,arguments)}o(VD,"_getTokenAsyncInner");function Wp(){return Wp=fi(nr().m(o(function t(e){var r;return nr().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||$r(Vr,this,GD).call(this);case 4:return n.a(2,$r(Vr,this,HD).call(this))}},t,this)},"_callee4"))),Wp.apply(this,arguments)}o(Wp,"_getTokenAsyncInner2");function GD(){if(!this.iss)throw new Ra("email is required.","MISSING_CREDENTIALS")}o(GD,"_ensureEmail");function PP(){return Zp.apply(this,arguments)}o(PP,"_revokeTokenAsync");function Zp(){return Zp=fi(nr().m(o(function t(){var e;return nr().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=BD+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:$r(Vr,this,IP).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"))),Zp.apply(this,arguments)}o(Zp,"_revokeTokenAsync2");function IP(){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,yn(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(IP,"_configure");function HD(){return Kp.apply(this,arguments)}o(HD,"_requestToken");function Kp(){return Kp=fi(nr().m(o(function t(){var e,r,n,i,s,c,d,p,h,_;return nr().w(function(m){for(;;)switch(m.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:EP,exp:e+3600,iat:e,sub:this.sub},r),i=OD.sign({header:{alg:"RS256"},payload:n,secret:this.key}),m.p=1,m.n=2,this.transporter.request({method:"POST",url:EP,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=m.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,m.a(2,this.rawToken);case 3:throw m.p=3,_=m.v,this.rawToken=void 0,this.tokenExpires=void 0,p=_.response&&(c=_.response)!==null&&c!==void 0&&c.data?(d=_.response)===null||d===void 0?void 0:d.data:{},p.error&&(h=p.error_description?": ".concat(p.error_description):"",_.message="".concat(p.error).concat(h)),_;case 4:return m.a(2)}},t,this,[[1,3]])},"_callee6"))),Kp.apply(this,arguments)}o(Kp,"_requestToken2")});var Xp=D(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.JWTAccess=void 0;var WD=Vp(),ZD=Rr(),CP={alg:"RS256",typ:"JWT"},Yp=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new ZD.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),s=this.cache.get(i),c=Date.now();if(s&&s.expiration-c>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let d=Math.floor(Date.now()/1e3),p=t.getExpirationTime(d),h;if(Array.isArray(n)&&(n=n.join(" ")),n?h={iss:this.email,sub:this.email,scope:n,exp:p,iat:d}:h={iss:this.email,sub:this.email,aud:e,exp:p,iat:d},r){for(let g in h)if(r[g])throw new Error(`The '${g}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let _=this.keyId?{...CP,kid:this.keyId}:CP,m=Object.assign(h,r),f=WD.sign({header:_,payload:m,secret:this.key}),l=new Headers({authorization:`Bearer ${f}`});return this.cache.set(i,{expiration:p*1e3,headers:l}),l}static getExpirationTime(e){return e+3600}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{e||n(new Error("Must pass in a stream containing the service account auth settings."));let i="";e.setEncoding("utf8").on("data",s=>i+=s).on("error",n).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}};Yu.JWTAccess=Yp});var ef=D(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.JWT=void 0;var OP=RP(),KD=Xp(),JD=yo(),Xu=er(),Qp=class t extends JD.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!==Xu.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==Xu.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${Xu.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 KD.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!==Xu.DEFAULT_UNIVERSE,s=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,i?n:void 0);return{headers:this.addSharedMetadataHeaders(s)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let r=new OP.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 OP.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}fromAPIKey(e){if(typeof e!="string")throw new Error("Must provide an API Key string.");this.apiKey=e}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let r=await this.createGToken().getCredentials(this.keyFile);return{private_key:r.privateKey,client_email:r.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};Qu.JWT=Qp});var rf=D(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.UserRefreshClient=mi.USER_REFRESH_ACCOUNT_TYPE=void 0;var YD=yo(),XD=er();mi.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var tf=class t extends YD.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,s){let c=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:s};super(c),this._refreshToken=c.refreshToken,this.credentials.refresh_token=c.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){let r={...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e})};return XD.AuthClient.setMethodName(r,"fetchIdToken"),(await this.transporter.request(r)).data.id_token}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the user refresh token");if(e.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!e.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!e.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!e.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=e.client_id,this._clientSecret=e.client_secret,this._refreshToken=e.refresh_token,this.credentials.refresh_token=e.refresh_token,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}async fromStreamAsync(e){return new Promise((r,n)=>{if(!e)return n(new Error("Must pass in a stream containing the user refresh token."));let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);return this.fromJSON(s),r()}catch(s){return n(s)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};mi.UserRefreshClient=tf});var of=D(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.Impersonated=hi.IMPERSONATED_ACCOUNT_TYPE=void 0;var $P=yo(),QD=ft(),eN=Rr();hi.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var nf=class t extends $P.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 $P.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,eN.originalOrCamelOptions)(e).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=e.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(e){await this.sourceClient.getAccessToken();let r=`projects/-/serviceAccounts/${this.targetPrincipal}`,n=`${this.endpoint}/v1/${r}:signBlob`,i={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:i,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let e="projects/-/serviceAccounts/"+this.targetPrincipal,r=`${this.endpoint}/v1/${e}:generateAccessToken`,n={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},i=await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:n,method:"POST"}),s=i.data;return this.credentials.access_token=s.accessToken,this.credentials.expiry_date=Date.parse(s.expireTime),{tokens:this.credentials,res:i}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof QD.GaxiosError&&(r=e?.response?.data?.error?.status,n=e?.response?.data?.error?.message),r&&n?(e.message=`${r}: unable to impersonate: ${n}`,e):(e.message=`unable to impersonate: ${e}`,e)}}async fetchIdToken(e,r){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,i=`${this.endpoint}/v1/${n}:generateIdToken`,s={delegates:this.delegates,audience:e,includeEmail:r?.includeEmail??!0,useEmailAzp:r?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:i,data:s,method:"POST"})).data.token}};hi.Impersonated=nf});var sf=D($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.OAuthClientAuthHandler=void 0;$a.getErrorFromOAuthErrorResponse=nN;var gi=ft(),tN=Sa(),rN=["PUT","POST","PATCH"],af=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,tN.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new gi.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new gi.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=gi.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=gi.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=gi.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${i}`);gi.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!rN.includes(r))throw new Error(`${r} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let i=new Headers(e.headers).get("content-type");if(i?.startsWith("application/x-www-form-urlencoded")||e.data instanceof URLSearchParams){let s=new URLSearchParams(e.data??"");s.append("client_id",this.#t.clientId),s.append("client_secret",this.#t.clientSecret||""),e.data=s}else if(i?.startsWith("application/json"))e.data=e.data||{},Object.assign(e.data,{client_id:this.#t.clientId,client_secret:this.#t.clientSecret||""});else throw new Error(`${i} content-types are not supported with ${this.#t.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};$a.OAuthClientAuthHandler=af;function nN(t,e){let r=t.error,n=t.error_description,i=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof i<"u"&&(s+=` - ${i}`);let c=new Error(s);if(e){let d=Object.keys(e);e.stack&&d.push("stack"),d.forEach(p=>{p!=="message"&&Object.defineProperty(c,p,{value:e[p],writable:!1,enumerable:!0})})}return c}o(nN,"getErrorFromOAuthErrorResponse")});var tc=D(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.StsCredentials=void 0;var oN=ft(),iN=er(),kP=sf(),aN=Rr(),uf=class t extends kP.OAuthClientAuthHandler{static{o(this,"StsCredentials")}#e;constructor(e={tokenExchangeEndpoint:""},r){(typeof e!="object"||e instanceof URL)&&(e={tokenExchangeEndpoint:e,clientAuthentication:r}),super(e),this.#e=e.tokenExchangeEndpoint}async exchangeToken(e,r,n){let i={grant_type:e.grantType,resource:e.resource,audience:e.audience,scope:e.scope?.join(" "),requested_token_type:e.requestedTokenType,subject_token:e.subjectToken,subject_token_type:e.subjectTokenType,actor_token:e.actingParty?.actorToken,actor_token_type:e.actingParty?.actorTokenType,options:n&&JSON.stringify(n)},s={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:r,data:new URLSearchParams((0,aN.removeUndefinedValuesInObject)(i))};iN.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let c=await this.transporter.request(s),d=c.data;return d.res=c,d}catch(c){throw c instanceof oN.GaxiosError&&c.response?(0,kP.getErrorFromOAuthErrorResponse)(c.response.data,c):c}}};ec.StsCredentials=uf});var Hn=D(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 sN=ft(),uN=require("stream"),cf=er(),cN=tc(),DP=Rr(),lN=Pp(),dN="urn:ietf:params:oauth:grant-type:token-exchange",pN="urn:ietf:params:oauth:token-type:access_token",lf="https://www.googleapis.com/auth/cloud-platform",fN=3600;gr.EXPIRATION_TIME_OFFSET=5*60*1e3;gr.EXTERNAL_ACCOUNT_TYPE="external_account";gr.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var mN="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",hN="https://sts.{universeDomain}/v1/token",df=class t extends cf.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,DP.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 i=r.get("client_id"),s=r.get("client_secret");this.tokenUrl=r.get("token_url")??hN.replace("{universeDomain}",this.universeDomain);let c=r.get("subject_token_type"),d=r.get("workforce_pool_user_project"),p=r.get("service_account_impersonation_url"),h=r.get("service_account_impersonation"),_=(0,DP.originalOrCamelOptions)(h).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(r.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),i&&(this.clientAuth={confidentialClientType:"basic",clientId:i,clientSecret:s}),this.stsCredential=new cN.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[lf],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=c,this.workforcePoolUserProject=d;let m=new RegExp(mN);if(this.workforcePoolUserProject&&!this.audience.match(m))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=p,this.serviceAccountImpersonationLifetime=_,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=fN),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}`};cf.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=sN.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof uN.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),r={grantType:dN,audience:this.audience,requestedTokenType:pN,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[lf]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,i=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),s=await this.stsCredential.exchangeToken(r,i,n);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(s.access_token):s.expires_in?this.cachedAccessToken={access_token:s.access_token,expiry_date:new Date().getTime()+s.expires_in*1e3,res:s.res}:this.cachedAccessToken={access_token:s.access_token,res:s.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}getProjectNumber(e){let r=e.match(/\/projects\/([^/]+)/);return r?r[1]:null}async getImpersonatedAccessToken(e){let r={...t.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"}};cf.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||[lf]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${lN.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};gr.BaseExternalAccountClient=df});var NP=D(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.FileSubjectTokenSupplier=void 0;var ff=require("util"),mf=require("fs"),gN=(0,ff.promisify)(mf.readFile??(()=>{})),yN=(0,ff.promisify)(mf.realpath??(()=>{})),vN=(0,ff.promisify)(mf.lstat??(()=>{})),pf=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 yN(e),!(await vN(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 gN(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}};rc.FileSubjectTokenSupplier=pf});var zP=D(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.UrlSubjectTokenSupplier=void 0;var _N=er(),hf=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};_N.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}};nc.UrlSubjectTokenSupplier=hf});var UP=D(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.CertificateSubjectTokenSupplier=or.InvalidConfigurationError=or.CertificateSourceUnavailableError=or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var oc=Rr(),ic=require("fs"),ac=require("crypto"),bN=require("https");or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Gr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};or.CertificateSourceUnavailableError=Gr;var yr=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};or.InvalidConfigurationError=yr;var gf=class{static{o(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 bN.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,oc.isValidFile)(e))return e;throw new Gr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,oc.isValidFile)(r))return r;throw new Gr(`Path from environment variable "${or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,oc.getWellKnownCertificateConfigFileLocation)();if(await(0,oc.isValidFile)(n))return n;throw new Gr(`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 Gr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),i=n?.cert_configs?.workload?.cert_path,s=n?.cert_configs?.workload?.key_path;if(!i||!s)throw new yr(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:i,keyPath:s}}catch(n){throw n instanceof yr?n:new yr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await ic.promises.readFile(e),new ac.X509Certificate(n)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Gr(`Failed to read certificate file at ${e}: ${c}`)}try{i=await ic.promises.readFile(r),(0,ac.createPrivateKey)(i)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Gr(`Failed to read private key file at ${r}: ${c}`)}return{cert:n,key:i}}async#n(e){let r=new ac.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((p,h)=>{try{return new ac.X509Certificate(p)}catch(_){let m=_ instanceof Error?_.message:String(_);throw new yr(`Failed to parse certificate at index ${h} in trust chain file ${this.trustChainPath}: ${m}`)}}),c=s.findIndex(p=>r.raw.equals(p.raw)),d;if(c===-1)d=[r,...s];else if(c===0)d=s;else throw new yr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${c}).`);return JSON.stringify(d.map(p=>p.raw.toString("base64")))}catch(n){if(n instanceof yr)throw n;let i=n instanceof Error?n.message:String(n);throw new Gr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};or.CertificateSubjectTokenSupplier=gf});var _f=D(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.IdentityPoolClient=void 0;var EN=Hn(),yf=Rr(),SN=NP(),PN=zP(),MP=UP(),TN=tc(),jP=ft(),vf=class t extends EN.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,yf.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("subject_token_supplier");if(!n&&!i)throw new Error("A credential source or subject token supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or subject token supplier can be specified.");if(i)this.subjectTokenSupplier=i,this.credentialSourceType="programmatic";else{let s=(0,yf.originalOrCamelOptions)(n),c=(0,yf.originalOrCamelOptions)(s.get("format")),d=c.get("type")||"text",p=c.get("subject_token_field_name");if(d!=="json"&&d!=="text")throw new Error(`Invalid credential_source format "${d}"`);if(d==="json"&&!p)throw new Error("Missing subject_token_field_name for JSON credential_source format");let h=s.get("file"),_=s.get("url"),m=s.get("certificate"),f=s.get("headers");if(h&&_||_&&m||h&&m)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(h)this.credentialSourceType="file",this.subjectTokenSupplier=new SN.FileSubjectTokenSupplier({filePath:h,formatType:d,subjectTokenFieldName:p});else if(_)this.credentialSourceType="url",this.subjectTokenSupplier=new PN.UrlSubjectTokenSupplier({url:_,formatType:d,subjectTokenFieldName:p,headers:f,additionalGaxiosOptions:t.RETRY_CONFIG});else if(m){this.credentialSourceType="certificate";let l=new MP.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:m.use_default_certificate_config,certificateConfigLocation:m.certificate_config_location,trustChainPath:m.trust_chain_path});this.subjectTokenSupplier=l}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 MP.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new TN.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new jP.Gaxios({agent:r})}),this.transporter=new jP.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};sc.IdentityPoolClient=vf});var Ef=D(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.AwsRequestSigner=void 0;var uc=ft(),FP=Sa(),LP="AWS4-HMAC-SHA256",wN="aws4_request",bf=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,FP.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let r=typeof e.data=="object"?JSON.stringify(e.data):e.data,n=e.url,i=e.method||"GET",s=e.body||r,c=e.headers,d=await this.getCredentials(),p=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 h=await AN({crypto:this.crypto,host:p.host,canonicalUri:p.pathname,canonicalQuerystring:p.search.slice(1),method:i,region:this.region,securityCredentials:d,requestPayload:s,additionalAmzHeaders:c}),_=uc.Gaxios.mergeHeaders(h.amzDate?{"x-amz-date":h.amzDate}:{},{authorization:h.authorizationHeader,host:p.host},c||{});d.token&&uc.Gaxios.mergeHeaders(_,{"x-amz-security-token":d.token});let m={url:n,method:i,headers:_};return s!==void 0&&(m.body=s),m}};cc.AwsRequestSigner=bf;async function ka(t,e,r){return await t.signWithHmacSha256(e,r)}o(ka,"sign");async function xN(t,e,r,n,i){let s=await ka(t,`AWS4${e}`,r),c=await ka(t,s,n),d=await ka(t,c,i);return await ka(t,d,"aws4_request")}o(xN,"getSigningKey");async function AN(t){let e=uc.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,s=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),c=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let d=uc.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),p="",h=[...d.keys()].sort();h.forEach(k=>{p+=`${k}:${d.get(k)}
|
|
40
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,xa="secret must be a string or buffer",di="key must be a string or a buffer",dD="key must be a string, a buffer or an object",jp=typeof hr.createPublicKey=="function";jp&&(di+=" or a KeyObject",xa+="or a KeyObject");function WS(t){if(!pi.isBuffer(t)&&typeof t!="string"&&(!jp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Or(di)}o(WS,"checkIsPublicKey");function ZS(t){if(!pi.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Or(dD)}o(ZS,"checkIsPrivateKey");function pD(t){if(!pi.isBuffer(t)){if(typeof t=="string")return t;if(!jp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Or(xa)}}o(pD,"checkIsSecretKey");function Lp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Lp,"fromBase64");function KS(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(KS,"toBase64");function Or(t){var e=[].slice.call(arguments,1),r=GS.format.bind(GS,t).apply(null,e);return new TypeError(r)}o(Or,"typeError");function fD(t){return pi.isBuffer(t)||typeof t=="string"}o(fD,"bufferOrString");function Aa(t){return fD(t)||(t=JSON.stringify(t)),t}o(Aa,"normalizeInput");function JS(t){return o(function(r,n){pD(n),r=Aa(r);var i=hr.createHmac("sha"+t,n),s=(i.update(r),i.digest("base64"));return Lp(s)},"sign")}o(JS,"createHmacSigner");var Mp,mD="timingSafeEqual"in hr?o(function(e,r){return e.byteLength!==r.byteLength?!1:hr.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return Mp||(Mp=VS()),Mp(e,r)},"timingSafeEqual");function hD(t){return o(function(r,n,i){var s=JS(t)(r,i);return mD(pi.from(n),pi.from(s))},"verify")}o(hD,"createHmacVerifier");function YS(t){return o(function(r,n){ZS(n),r=Aa(r);var i=hr.createSign("RSA-SHA"+t),s=(i.update(r),i.sign(n,"base64"));return Lp(s)},"sign")}o(YS,"createKeySigner");function XS(t){return o(function(r,n,i){WS(i),r=Aa(r),n=KS(n);var s=hr.createVerify("RSA-SHA"+t);return s.update(r),s.verify(i,n,"base64")},"verify")}o(XS,"createKeyVerifier");function gD(t){return o(function(r,n){ZS(n),r=Aa(r);var i=hr.createSign("RSA-SHA"+t),s=(i.update(r),i.sign({key:n,padding:hr.constants.RSA_PKCS1_PSS_PADDING,saltLength:hr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Lp(s)},"sign")}o(gD,"createPSSKeySigner");function yD(t){return o(function(r,n,i){WS(i),r=Aa(r),n=KS(n);var s=hr.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:i,padding:hr.constants.RSA_PKCS1_PSS_PADDING,saltLength:hr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(yD,"createPSSKeyVerifier");function vD(t){var e=YS(t);return o(function(){var n=e.apply(null,arguments);return n=HS.derToJose(n,"ES"+t),n},"sign")}o(vD,"createECDSASigner");function _D(t){var e=XS(t);return o(function(n,i,s){i=HS.joseToDer(i,"ES"+t).toString("base64");var c=e(n,i,s);return c},"verify")}o(_D,"createECDSAVerifer");function bD(){return o(function(){return""},"sign")}o(bD,"createNoneSigner");function ED(){return o(function(e,r){return r===""},"verify")}o(ED,"createNoneVerifier");QS.exports=o(function(e){var r={hs:JS,rs:YS,ps:gD,es:vD,none:bD},n={hs:hD,rs:XS,ps:yD,es:_D,none:ED},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Or(lD,e);var s=(i[1]||i[3]).toLowerCase(),c=i[2];return{sign:r[s](c),verify:n[s](c)}},"jwa")});var qp=D((OY,eP)=>{var SD=require("buffer").Buffer;eP.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||SD.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var aP=D((kY,iP)=>{var PD=ui().Buffer,tP=zp(),TD=Fp(),wD=require("stream"),rP=qp(),Bp=require("util");function nP(t,e){return PD.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(nP,"base64url");function xD(t,e,r){r=r||"utf8";var n=nP(rP(t),"binary"),i=nP(rP(e),r);return Bp.format("%s.%s",n,i)}o(xD,"jwsSecuredInput");function oP(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,s=TD(e.alg),c=xD(e,r,i),d=s.sign(c,n);return Bp.format("%s.%s",c,d)}o(oP,"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 tP(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new tP(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(Hu,"SignStream");Bp.inherits(Hu,wD);Hu.prototype.sign=o(function(){try{var e=oP({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=oP;iP.exports=Hu});var gP=D((NY,hP)=>{var uP=ui().Buffer,sP=zp(),AD=Fp(),ID=require("stream"),cP=qp(),RD=require("util"),CD=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function OD(t){return Object.prototype.toString.call(t)==="[object Object]"}o(OD,"isObject");function $D(t){if(OD(t))return t;try{return JSON.parse(t)}catch{return}}o($D,"safeJsonParse");function lP(t){var e=t.split(".",1)[0];return $D(uP.from(e,"base64").toString("binary"))}o(lP,"headerFromJWS");function kD(t){return t.split(".",2).join(".")}o(kD,"securedInputFromJWS");function dP(t){return t.split(".")[2]}o(dP,"signatureFromJWS");function DD(t,e){e=e||"utf8";var r=t.split(".")[1];return uP.from(r,"base64").toString(e)}o(DD,"payloadFromJWS");function pP(t){return CD.test(t)&&!!lP(t)}o(pP,"isValidJws");function fP(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=cP(t);var i=dP(t),s=kD(t),c=AD(e);return c.verify(s,i,r)}o(fP,"jwsVerify");function mP(t,e){if(e=e||{},t=cP(t),!pP(t))return null;var r=lP(t);if(!r)return null;var n=DD(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:dP(t)}}o(mP,"jwsDecode");function fi(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 sP(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new sP(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(fi,"VerifyStream");RD.inherits(fi,ID);fi.prototype.verify=o(function(){try{var e=fP(this.signature.buffer,this.algorithm,this.key.buffer),r=mP(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");fi.decode=mP;fi.isValid=pP;fi.verify=fP;hP.exports=fi});var Vp=D(Gn=>{var yP=aP(),Wu=gP(),ND=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Gn.ALGORITHMS=ND;Gn.sign=yP.sign;Gn.verify=Wu.verify;Gn.decode=Wu.decode;Gn.isValid=Wu.isValid;Gn.createSign=o(function(e){return new yP(e)},"createSign");Gn.createVerify=o(function(e){return new Wu(e)},"createVerify")});var $P=D(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.GoogleToken=void 0;var vP=Zu(require("fs")),zD=ft(),UD=Zu(Vp()),MD=Zu(require("path")),jD=require("util");function Zu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Zu=o(function(s,c){if(!c&&s&&s.__esModule)return s;var d,p,h={__proto__:null,default:s};if(s===null||yn(s)!="object"&&typeof s!="function")return h;if(d=c?n:r){if(d.has(s))return d.get(s);d.set(s,h)}for(var _ in s)_!=="default"&&{}.hasOwnProperty.call(s,_)&&((p=(d=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,_))&&(p.get||p.set)?d(h,_,p):h[_]=s[_]);return h},"_interopRequireWildcard"))(t,e)}o(Zu,"_interopRequireWildcard");function yn(t){"@babel/helpers - typeof";return yn=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},yn(t)}o(yn,"_typeof");function LD(t,e){AP(t,e),e.add(t)}o(LD,"_classPrivateMethodInitSpec");function FD(t,e,r){AP(t,e),e.set(t,r)}o(FD,"_classPrivateFieldInitSpec");function AP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(AP,"_checkPrivateRedeclaration");function _P(t,e,r){return t.set($r(t,e),r),r}o(_P,"_classPrivateFieldSet");function bP(t,e){return t.get($r(t,e))}o(bP,"_classPrivateFieldGet");function $r(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($r,"_assertClassBrand");function EP(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,CP(n.key),n)}}o(EP,"_defineProperties");function IP(t,e,r){return e&&EP(t.prototype,e),r&&EP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(IP,"_createClass");function RP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(RP,"_classCallCheck");function qD(t,e,r){return e=Oa(e),BD(t,Jp()?Reflect.construct(e,r||[],Oa(t).constructor):e.apply(t,r))}o(qD,"_callSuper");function BD(t,e){if(e&&(yn(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VD(t)}o(BD,"_possibleConstructorReturn");function VD(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(VD,"_assertThisInitialized");function GD(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&&Ca(t,e)}o(GD,"_inherits");function Gp(t){var e=typeof Map=="function"?new Map:void 0;return Gp=o(function(n){if(n===null||!WD(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 HD(n,arguments,Oa(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ca(i,n)},"_wrapNativeSuper"),Gp(t)}o(Gp,"_wrapNativeSuper");function HD(t,e,r){if(Jp())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Ca(i,r.prototype),i}o(HD,"_construct");function Jp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Jp=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(Jp,"_isNativeReflectConstruct");function WD(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(WD,"_isNativeFunction");function Ca(t,e){return Ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ca(t,e)}o(Ca,"_setPrototypeOf");function Oa(t){return Oa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Oa(t)}o(Oa,"_getPrototypeOf");function tr(t,e,r){return(e=CP(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(tr,"_defineProperty");function CP(t){var e=ZD(t,"string");return yn(e)=="symbol"?e:e+""}o(CP,"_toPropertyKey");function ZD(t,e){if(yn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(yn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(ZD,"_toPrimitive");function nr(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(l,g,v,b){var E=g&&g.prototype instanceof d?g:d,k=Object.create(E.prototype);return rr(k,"_invoke",function(L,J,W){var G,K,te,X=0,Te=W||[],re=!1,B={p:0,n:0,v:t,a:q,f:q.bind(t,4),d:o(function(Z,oe){return G=Z,K=0,te=t,B.n=oe,c},"d")};function q(Y,Z){for(K=Y,te=Z,e=0;!re&&X&&!oe&&e<Te.length;e++){var oe,ae=Te[e],Ie=B.p,$e=ae[2];Y>3?(oe=$e===Z)&&(te=ae[(K=ae[4])?5:(K=3,3)],ae[4]=ae[5]=t):ae[0]<=Ie&&((oe=Y<2&&Ie<ae[1])?(K=0,B.v=Z,B.n=ae[1]):Ie<$e&&(oe=Y<3||ae[0]>Z||Z>$e)&&(ae[4]=Y,ae[5]=Z,B.n=$e,K=0))}if(oe||Y>1)return c;throw re=!0,Z}return o(q,"d"),function(Y,Z,oe){if(X>1)throw TypeError("Generator is already running");for(re&&Z===1&&q(Z,oe),K=Z,te=oe;(e=K<2?t:te)||!re;){G||(K?K<3?(K>1&&(B.n=-1),q(K,te)):B.n=te:B.v=te);try{if(X=2,G){if(K||(Y="next"),e=G[Y]){if(!(e=e.call(G,te)))throw TypeError("iterator result is not an object");if(!e.done)return e;te=e.value,K<2&&(K=0)}else K===1&&(e=G.return)&&e.call(G),K<2&&(te=TypeError("The iterator does not provide a '"+Y+"' method"),K=1);G=t}else if((e=(re=B.n<0)?te:L.call(J,B))!==c)break}catch(ae){G=t,K=1,te=ae}finally{X=1}}return{value:e,done:re}}}(l,v,b),!0),k}o(s,"i");var c={};function d(){}o(d,"Generator");function p(){}o(p,"GeneratorFunction");function h(){}o(h,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var _=[][n]?e(e([][n]())):(rr(e={},n,function(){return this}),e),m=h.prototype=d.prototype=Object.create(_);function f(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,h):(l.__proto__=h,rr(l,i,"GeneratorFunction")),l.prototype=Object.create(m),l}return o(f,"f"),p.prototype=h,rr(m,"constructor",h),rr(h,"constructor",p),p.displayName="GeneratorFunction",rr(h,i,"GeneratorFunction"),rr(m),rr(m,i,"Generator"),rr(m,n,function(){return this}),rr(m,"toString",function(){return"[object Generator]"}),(nr=o(function(){return{w:s,m:f}},"_regenerator"))()}o(nr,"_regenerator");function rr(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}rr=o(function(c,d,p,h){if(d)i?i(c,d,{value:p,enumerable:!h,configurable:!h,writable:!h}):c[d]=p;else{var _=o(function(f,l){rr(c,f,function(g){return this._invoke(f,l,g)})},"o");_("next",0),_("throw",1),_("return",2)}},"_regeneratorDefine"),rr(t,e,r,n)}o(rr,"_regeneratorDefine2");function SP(t,e,r,n,i,s,c){try{var d=t[s](c),p=d.value}catch(h){return void r(h)}d.done?e(p):Promise.resolve(p).then(n,i)}o(SP,"asyncGeneratorStep");function mi(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function c(p){SP(s,n,i,c,d,"next",p)}o(c,"_next");function d(p){SP(s,n,i,c,d,"throw",p)}o(d,"_throw"),c(void 0)})}}o(mi,"_asyncToGenerator");var PP=vP.readFile?(0,jD.promisify)(vP.readFile):mi(nr().m(o(function t(){return nr().w(function(e){for(;;)switch(e.n){case 0:throw new Ra("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),TP="https://oauth2.googleapis.com/token",KD="https://oauth2.googleapis.com/revoke?token=",Ra=function(t){function e(r,n){var i;return RP(this,e),i=qD(this,e,[r]),tr(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),GD(e,t),IP(e)}(Gp(Error)),Ia=new WeakMap,Vr=new WeakSet,jY=Ku.GoogleToken=function(){function t(e){RP(this,t),LD(this,Vr),tr(this,"expiresAt",void 0),tr(this,"key",void 0),tr(this,"keyFile",void 0),tr(this,"iss",void 0),tr(this,"sub",void 0),tr(this,"scope",void 0),tr(this,"rawToken",void 0),tr(this,"tokenExpires",void 0),tr(this,"email",void 0),tr(this,"additionalClaims",void 0),tr(this,"eagerRefreshThresholdMillis",void 0),tr(this,"transporter",{request:o(function(n){return(0,zD.request)(n)},"request")}),FD(this,Ia,void 0),$r(Vr,this,OP).call(this,e)}return o(t,"GoogleToken"),IP(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(yn(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;$r(Vr,this,wP).call(this,n).then(function(s){return i(null,s)},r);return}return $r(Vr,this,wP).call(this,n)},"getToken")},{key:"getCredentials",value:function(){var e=mi(nr().m(o(function n(i){var s,c,d,p,h,_,m;return nr().w(function(f){for(;;)switch(f.n){case 0:s=MD.extname(i),m=s,f.n=m===".json"?1:m===".der"||m===".crt"||m===".pem"?4:m===".p12"||m===".pfx"?6:7;break;case 1:return f.n=2,PP(i,"utf8");case 2:if(c=f.v,d=JSON.parse(c),p=d.private_key,h=d.client_email,!(!p||!h)){f.n=3;break}throw new Ra("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return f.a(2,{privateKey:p,clientEmail:h});case 4:return f.n=5,PP(i,"utf8");case 5:return _=f.v,f.a(2,{privateKey:_});case 6:throw new Ra("*.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 Ra("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return f.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){$r(Vr,this,xP).call(this).then(function(){return r()},r);return}return $r(Vr,this,xP).call(this)},"revokeToken")}])}();function wP(t){return Hp.apply(this,arguments)}o(wP,"_getTokenAsync");function Hp(){return Hp=mi(nr().m(o(function t(e){return nr().w(function(r){for(;;)switch(r.n){case 0:if(!(bP(Ia,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,bP(Ia,this));case 1:return r.p=1,r.n=2,_P(Ia,this,$r(Vr,this,JD).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,_P(Ia,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),Hp.apply(this,arguments)}o(Hp,"_getTokenAsync2");function JD(t){return Wp.apply(this,arguments)}o(JD,"_getTokenAsyncInner");function Wp(){return Wp=mi(nr().m(o(function t(e){var r;return nr().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||$r(Vr,this,YD).call(this);case 4:return n.a(2,$r(Vr,this,XD).call(this))}},t,this)},"_callee4"))),Wp.apply(this,arguments)}o(Wp,"_getTokenAsyncInner2");function YD(){if(!this.iss)throw new Ra("email is required.","MISSING_CREDENTIALS")}o(YD,"_ensureEmail");function xP(){return Zp.apply(this,arguments)}o(xP,"_revokeTokenAsync");function Zp(){return Zp=mi(nr().m(o(function t(){var e;return nr().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=KD+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:$r(Vr,this,OP).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"))),Zp.apply(this,arguments)}o(Zp,"_revokeTokenAsync2");function OP(){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,yn(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(OP,"_configure");function XD(){return Kp.apply(this,arguments)}o(XD,"_requestToken");function Kp(){return Kp=mi(nr().m(o(function t(){var e,r,n,i,s,c,d,p,h,_;return nr().w(function(m){for(;;)switch(m.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:TP,exp:e+3600,iat:e,sub:this.sub},r),i=UD.sign({header:{alg:"RS256"},payload:n,secret:this.key}),m.p=1,m.n=2,this.transporter.request({method:"POST",url:TP,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=m.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,m.a(2,this.rawToken);case 3:throw m.p=3,_=m.v,this.rawToken=void 0,this.tokenExpires=void 0,p=_.response&&(c=_.response)!==null&&c!==void 0&&c.data?(d=_.response)===null||d===void 0?void 0:d.data:{},p.error&&(h=p.error_description?": ".concat(p.error_description):"",_.message="".concat(p.error).concat(h)),_;case 4:return m.a(2)}},t,this,[[1,3]])},"_callee6"))),Kp.apply(this,arguments)}o(Kp,"_requestToken2")});var Xp=D(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.JWTAccess=void 0;var QD=Vp(),eN=Rr(),kP={alg:"RS256",typ:"JWT"},Yp=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new eN.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),s=this.cache.get(i),c=Date.now();if(s&&s.expiration-c>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let d=Math.floor(Date.now()/1e3),p=t.getExpirationTime(d),h;if(Array.isArray(n)&&(n=n.join(" ")),n?h={iss:this.email,sub:this.email,scope:n,exp:p,iat:d}:h={iss:this.email,sub:this.email,aud:e,exp:p,iat:d},r){for(let g in h)if(r[g])throw new Error(`The '${g}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let _=this.keyId?{...kP,kid:this.keyId}:kP,m=Object.assign(h,r),f=QD.sign({header:_,payload:m,secret:this.key}),l=new Headers({authorization:`Bearer ${f}`});return this.cache.set(i,{expiration:p*1e3,headers:l}),l}static getExpirationTime(e){return e+3600}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{e||n(new Error("Must pass in a stream containing the service account auth settings."));let i="";e.setEncoding("utf8").on("data",s=>i+=s).on("error",n).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}};Ju.JWTAccess=Yp});var ef=D(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.JWT=void 0;var DP=$P(),tN=Xp(),rN=yo(),Yu=er(),Qp=class t extends rN.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!==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 tN.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!==Yu.DEFAULT_UNIVERSE,s=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,i?n:void 0);return{headers:this.addSharedMetadataHeaders(s)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let r=new DP.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 DP.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}fromAPIKey(e){if(typeof e!="string")throw new Error("Must provide an API Key string.");this.apiKey=e}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let r=await this.createGToken().getCredentials(this.keyFile);return{private_key:r.privateKey,client_email:r.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};Xu.JWT=Qp});var rf=D(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.UserRefreshClient=hi.USER_REFRESH_ACCOUNT_TYPE=void 0;var nN=yo(),oN=er();hi.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var tf=class t extends nN.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,s){let c=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:s};super(c),this._refreshToken=c.refreshToken,this.credentials.refresh_token=c.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){let r={...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e})};return oN.AuthClient.setMethodName(r,"fetchIdToken"),(await this.transporter.request(r)).data.id_token}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the user refresh token");if(e.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!e.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!e.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!e.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=e.client_id,this._clientSecret=e.client_secret,this._refreshToken=e.refresh_token,this.credentials.refresh_token=e.refresh_token,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}async fromStreamAsync(e){return new Promise((r,n)=>{if(!e)return n(new Error("Must pass in a stream containing the user refresh token."));let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);return this.fromJSON(s),r()}catch(s){return n(s)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};hi.UserRefreshClient=tf});var of=D(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.Impersonated=gi.IMPERSONATED_ACCOUNT_TYPE=void 0;var NP=yo(),iN=ft(),aN=Rr();gi.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var nf=class t extends NP.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 NP.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,aN.originalOrCamelOptions)(e).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=e.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(e){await this.sourceClient.getAccessToken();let r=`projects/-/serviceAccounts/${this.targetPrincipal}`,n=`${this.endpoint}/v1/${r}:signBlob`,i={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:i,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let e="projects/-/serviceAccounts/"+this.targetPrincipal,r=`${this.endpoint}/v1/${e}:generateAccessToken`,n={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},i=await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:n,method:"POST"}),s=i.data;return this.credentials.access_token=s.accessToken,this.credentials.expiry_date=Date.parse(s.expireTime),{tokens:this.credentials,res:i}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof iN.GaxiosError&&(r=e?.response?.data?.error?.status,n=e?.response?.data?.error?.message),r&&n?(e.message=`${r}: unable to impersonate: ${n}`,e):(e.message=`unable to impersonate: ${e}`,e)}}async fetchIdToken(e,r){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,i=`${this.endpoint}/v1/${n}:generateIdToken`,s={delegates:this.delegates,audience:e,includeEmail:r?.includeEmail??!0,useEmailAzp:r?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:i,data:s,method:"POST"})).data.token}};gi.Impersonated=nf});var sf=D($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.OAuthClientAuthHandler=void 0;$a.getErrorFromOAuthErrorResponse=cN;var yi=ft(),sN=Sa(),uN=["PUT","POST","PATCH"],af=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,sN.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new yi.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new yi.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=yi.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=yi.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=yi.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${i}`);yi.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!uN.includes(r))throw new Error(`${r} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let i=new Headers(e.headers).get("content-type");if(i?.startsWith("application/x-www-form-urlencoded")||e.data instanceof URLSearchParams){let s=new URLSearchParams(e.data??"");s.append("client_id",this.#t.clientId),s.append("client_secret",this.#t.clientSecret||""),e.data=s}else if(i?.startsWith("application/json"))e.data=e.data||{},Object.assign(e.data,{client_id:this.#t.clientId,client_secret:this.#t.clientSecret||""});else throw new Error(`${i} content-types are not supported with ${this.#t.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};$a.OAuthClientAuthHandler=af;function cN(t,e){let r=t.error,n=t.error_description,i=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof i<"u"&&(s+=` - ${i}`);let c=new Error(s);if(e){let d=Object.keys(e);e.stack&&d.push("stack"),d.forEach(p=>{p!=="message"&&Object.defineProperty(c,p,{value:e[p],writable:!1,enumerable:!0})})}return c}o(cN,"getErrorFromOAuthErrorResponse")});var ec=D(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.StsCredentials=void 0;var lN=ft(),dN=er(),zP=sf(),pN=Rr(),uf=class t extends zP.OAuthClientAuthHandler{static{o(this,"StsCredentials")}#e;constructor(e={tokenExchangeEndpoint:""},r){(typeof e!="object"||e instanceof URL)&&(e={tokenExchangeEndpoint:e,clientAuthentication:r}),super(e),this.#e=e.tokenExchangeEndpoint}async exchangeToken(e,r,n){let i={grant_type:e.grantType,resource:e.resource,audience:e.audience,scope:e.scope?.join(" "),requested_token_type:e.requestedTokenType,subject_token:e.subjectToken,subject_token_type:e.subjectTokenType,actor_token:e.actingParty?.actorToken,actor_token_type:e.actingParty?.actorTokenType,options:n&&JSON.stringify(n)},s={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:r,data:new URLSearchParams((0,pN.removeUndefinedValuesInObject)(i))};dN.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let c=await this.transporter.request(s),d=c.data;return d.res=c,d}catch(c){throw c instanceof lN.GaxiosError&&c.response?(0,zP.getErrorFromOAuthErrorResponse)(c.response.data,c):c}}};Qu.StsCredentials=uf});var Hn=D(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 fN=ft(),mN=require("stream"),cf=er(),hN=ec(),UP=Rr(),gN=Pp(),yN="urn:ietf:params:oauth:grant-type:token-exchange",vN="urn:ietf:params:oauth:token-type:access_token",lf="https://www.googleapis.com/auth/cloud-platform",_N=3600;gr.EXPIRATION_TIME_OFFSET=5*60*1e3;gr.EXTERNAL_ACCOUNT_TYPE="external_account";gr.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var bN="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",EN="https://sts.{universeDomain}/v1/token",df=class t extends cf.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,UP.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 i=r.get("client_id"),s=r.get("client_secret");this.tokenUrl=r.get("token_url")??EN.replace("{universeDomain}",this.universeDomain);let c=r.get("subject_token_type"),d=r.get("workforce_pool_user_project"),p=r.get("service_account_impersonation_url"),h=r.get("service_account_impersonation"),_=(0,UP.originalOrCamelOptions)(h).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(r.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),i&&(this.clientAuth={confidentialClientType:"basic",clientId:i,clientSecret:s}),this.stsCredential=new hN.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[lf],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=c,this.workforcePoolUserProject=d;let m=new RegExp(bN);if(this.workforcePoolUserProject&&!this.audience.match(m))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=p,this.serviceAccountImpersonationLifetime=_,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=_N),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}`};cf.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=fN.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof mN.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),r={grantType:yN,audience:this.audience,requestedTokenType:vN,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[lf]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,i=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),s=await this.stsCredential.exchangeToken(r,i,n);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(s.access_token):s.expires_in?this.cachedAccessToken={access_token:s.access_token,expiry_date:new Date().getTime()+s.expires_in*1e3,res:s.res}:this.cachedAccessToken={access_token:s.access_token,res:s.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}getProjectNumber(e){let r=e.match(/\/projects\/([^/]+)/);return r?r[1]:null}async getImpersonatedAccessToken(e){let r={...t.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"}};cf.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||[lf]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${gN.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};gr.BaseExternalAccountClient=df});var MP=D(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.FileSubjectTokenSupplier=void 0;var ff=require("util"),mf=require("fs"),SN=(0,ff.promisify)(mf.readFile??(()=>{})),PN=(0,ff.promisify)(mf.realpath??(()=>{})),TN=(0,ff.promisify)(mf.lstat??(()=>{})),pf=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 PN(e),!(await TN(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 SN(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=pf});var jP=D(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.UrlSubjectTokenSupplier=void 0;var wN=er(),hf=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};wN.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=hf});var LP=D(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.CertificateSubjectTokenSupplier=or.InvalidConfigurationError=or.CertificateSourceUnavailableError=or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var nc=Rr(),oc=require("fs"),ic=require("crypto"),xN=require("https");or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Gr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};or.CertificateSourceUnavailableError=Gr;var yr=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};or.InvalidConfigurationError=yr;var gf=class{static{o(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 xN.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 Gr(`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 Gr(`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 Gr(`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 oc.promises.readFile(e,"utf8")}catch{throw new Gr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),i=n?.cert_configs?.workload?.cert_path,s=n?.cert_configs?.workload?.key_path;if(!i||!s)throw new yr(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:i,keyPath:s}}catch(n){throw n instanceof yr?n:new yr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await oc.promises.readFile(e),new ic.X509Certificate(n)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Gr(`Failed to read certificate file at ${e}: ${c}`)}try{i=await oc.promises.readFile(r),(0,ic.createPrivateKey)(i)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Gr(`Failed to read private key file at ${r}: ${c}`)}return{cert:n,key:i}}async#n(e){let r=new ic.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await oc.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((p,h)=>{try{return new ic.X509Certificate(p)}catch(_){let m=_ instanceof Error?_.message:String(_);throw new yr(`Failed to parse certificate at index ${h} in trust chain file ${this.trustChainPath}: ${m}`)}}),c=s.findIndex(p=>r.raw.equals(p.raw)),d;if(c===-1)d=[r,...s];else if(c===0)d=s;else throw new yr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${c}).`);return JSON.stringify(d.map(p=>p.raw.toString("base64")))}catch(n){if(n instanceof yr)throw n;let i=n instanceof Error?n.message:String(n);throw new Gr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};or.CertificateSubjectTokenSupplier=gf});var _f=D(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.IdentityPoolClient=void 0;var AN=Hn(),yf=Rr(),IN=MP(),RN=jP(),FP=LP(),CN=ec(),qP=ft(),vf=class t extends AN.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,yf.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("subject_token_supplier");if(!n&&!i)throw new Error("A credential source or subject token supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or subject token supplier can be specified.");if(i)this.subjectTokenSupplier=i,this.credentialSourceType="programmatic";else{let s=(0,yf.originalOrCamelOptions)(n),c=(0,yf.originalOrCamelOptions)(s.get("format")),d=c.get("type")||"text",p=c.get("subject_token_field_name");if(d!=="json"&&d!=="text")throw new Error(`Invalid credential_source format "${d}"`);if(d==="json"&&!p)throw new Error("Missing subject_token_field_name for JSON credential_source format");let h=s.get("file"),_=s.get("url"),m=s.get("certificate"),f=s.get("headers");if(h&&_||_&&m||h&&m)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(h)this.credentialSourceType="file",this.subjectTokenSupplier=new IN.FileSubjectTokenSupplier({filePath:h,formatType:d,subjectTokenFieldName:p});else if(_)this.credentialSourceType="url",this.subjectTokenSupplier=new RN.UrlSubjectTokenSupplier({url:_,formatType:d,subjectTokenFieldName:p,headers:f,additionalGaxiosOptions:t.RETRY_CONFIG});else if(m){this.credentialSourceType="certificate";let l=new FP.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:m.use_default_certificate_config,certificateConfigLocation:m.certificate_config_location,trustChainPath:m.trust_chain_path});this.subjectTokenSupplier=l}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 FP.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new CN.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new qP.Gaxios({agent:r})}),this.transporter=new qP.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};ac.IdentityPoolClient=vf});var Ef=D(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.AwsRequestSigner=void 0;var sc=ft(),VP=Sa(),BP="AWS4-HMAC-SHA256",ON="aws4_request",bf=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,VP.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let r=typeof e.data=="object"?JSON.stringify(e.data):e.data,n=e.url,i=e.method||"GET",s=e.body||r,c=e.headers,d=await this.getCredentials(),p=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 h=await kN({crypto:this.crypto,host:p.host,canonicalUri:p.pathname,canonicalQuerystring:p.search.slice(1),method:i,region:this.region,securityCredentials:d,requestPayload:s,additionalAmzHeaders:c}),_=sc.Gaxios.mergeHeaders(h.amzDate?{"x-amz-date":h.amzDate}:{},{authorization:h.authorizationHeader,host:p.host},c||{});d.token&&sc.Gaxios.mergeHeaders(_,{"x-amz-security-token":d.token});let m={url:n,method:i,headers:_};return s!==void 0&&(m.body=s),m}};uc.AwsRequestSigner=bf;async function ka(t,e,r){return await t.signWithHmacSha256(e,r)}o(ka,"sign");async function $N(t,e,r,n,i){let s=await ka(t,`AWS4${e}`,r),c=await ka(t,s,n),d=await ka(t,c,i);return await ka(t,d,"aws4_request")}o($N,"getSigningKey");async function kN(t){let e=sc.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,s=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),c=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let d=sc.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),p="",h=[...d.keys()].sort();h.forEach(k=>{p+=`${k}:${d.get(k)}
|
|
41
41
|
`});let _=h.join(";"),m=await t.crypto.sha256DigestHex(r),f=`${t.method.toUpperCase()}
|
|
42
42
|
${t.canonicalUri}
|
|
43
43
|
${t.canonicalQuerystring}
|
|
44
44
|
${p}
|
|
45
45
|
${_}
|
|
46
|
-
${m}`,l=`${c}/${t.region}/${n}/${
|
|
46
|
+
${m}`,l=`${c}/${t.region}/${n}/${ON}`,g=`${BP}
|
|
47
47
|
${s}
|
|
48
48
|
${l}
|
|
49
|
-
`+await t.crypto.sha256DigestHex(f),v=await xN(t.crypto,t.securityCredentials.secretAccessKey,c,t.region,n),b=await ka(t.crypto,v,g),E=`${LP} Credential=${t.securityCredentials.accessKeyId}/${l}, SignedHeaders=${_}, Signature=${(0,FP.fromArrayBufferToHex)(b)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:E,canonicalQuerystring:t.canonicalQuerystring}}o(AN,"generateAuthenticationHeaderMap")});var qP=D(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.DefaultAwsSecurityCredentialsSupplier=void 0;var lc=er(),Sf=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};lc.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 lc.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 lc.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 lc.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}};dc.DefaultAwsSecurityCredentialsSupplier=Sf});var Tf=D(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.AwsClient=void 0;var IN=Ef(),RN=Hn(),CN=qP(),BP=Rr(),ON=ft(),Pf=class t extends RN.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,BP.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("aws_security_credentials_supplier");if(!n&&!i)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(i)this.awsSecurityCredentialsSupplier=i,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let s=(0,BP.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let c=s.get("region_url"),d=s.get("url"),p=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new CN.DefaultAwsSecurityCredentialsSupplier({regionUrl:c,securityCredentialsUrl:d,imdsV2SessionTokenUrl:p}),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 IN.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 ON.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((i,s)=>r.push({key:s,value:i})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};pc.AwsClient=Pf});var Rf=D(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.InvalidSubjectTokenError=gt.InvalidMessageFieldError=gt.InvalidCodeFieldError=gt.InvalidTokenTypeFieldError=gt.InvalidExpirationTimeFieldError=gt.InvalidSuccessFieldError=gt.InvalidVersionFieldError=gt.ExecutableResponseError=gt.ExecutableResponse=void 0;var fc="urn:ietf:params:oauth:token-type:saml2",wf="urn:ietf:params:oauth:token-type:id_token",xf="urn:ietf:params:oauth:token-type:jwt",Af=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new mc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new hc("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!==fc&&this.tokenType!==wf&&this.tokenType!==xf)throw new gc(`Executable response must contain a 'token_type' field when successful and it must be one of ${wf}, ${xf}, or ${fc}.`);if(this.tokenType===fc){if(!e.saml_response)throw new Da(`Executable response must contain a 'saml_response' field when token_type=${fc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new Da(`Executable response must contain a 'id_token' field when token_type=${wf} or ${xf}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new yc("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new vc("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)}};gt.ExecutableResponse=Af;var Hr=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};gt.ExecutableResponseError=Hr;var mc=class extends Hr{static{o(this,"InvalidVersionFieldError")}};gt.InvalidVersionFieldError=mc;var hc=class extends Hr{static{o(this,"InvalidSuccessFieldError")}};gt.InvalidSuccessFieldError=hc;var If=class extends Hr{static{o(this,"InvalidExpirationTimeFieldError")}};gt.InvalidExpirationTimeFieldError=If;var gc=class extends Hr{static{o(this,"InvalidTokenTypeFieldError")}};gt.InvalidTokenTypeFieldError=gc;var yc=class extends Hr{static{o(this,"InvalidCodeFieldError")}};gt.InvalidCodeFieldError=yc;var vc=class extends Hr{static{o(this,"InvalidMessageFieldError")}};gt.InvalidMessageFieldError=vc;var Da=class extends Hr{static{o(this,"InvalidSubjectTokenError")}};gt.InvalidSubjectTokenError=Da});var $f=D(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.PluggableAuthHandler=yi.ExecutableError=void 0;var vo=Rf(),$N=require("child_process"),Cf=require("fs"),_c=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)}};yi.ExecutableError=_c;var Of=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=$N.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";i.stdout.on("data",d=>{s+=d}),i.stderr.on("data",d=>{s+=d});let c=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",d=>{if(clearTimeout(c),d===0)try{let p=JSON.parse(s),h=new vo.ExecutableResponse(p);return r(h)}catch(p){return p instanceof vo.ExecutableResponseError?n(p):n(new vo.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new _c(s,d.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await Cf.promises.realpath(this.outputFile)}catch{return}if(!(await Cf.promises.lstat(e)).isFile())return;let r=await Cf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new vo.ExecutableResponse(n).isValid()?new vo.ExecutableResponse(n):void 0}catch(n){throw n instanceof vo.ExecutableResponseError?n:new vo.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}};yi.PluggableAuthHandler=Of});var Df=D(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.PluggableAuthClient=vi.ExecutableError=void 0;var kN=Hn(),DN=Rf(),VP=$f(),NN=$f();Object.defineProperty(vi,"ExecutableError",{enumerable:!0,get:o(function(){return NN.ExecutableError},"get")});var zN=30*1e3,GP=5*1e3,HP=120*1e3,UN="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",WP=1,kf=class extends kN.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=zN;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<GP||this.timeoutMillis>HP)throw new Error(`Timeout must be between ${GP} and ${HP} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new VP.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[UN]!=="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>WP)throw new Error(`Version of executable is not currently supported, maximum supported version is ${WP}.`);if(!e.success)throw new VP.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new DN.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}};vi.PluggableAuthClient=kf});var zf=D(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.ExternalAccountClient=void 0;var MN=Hn(),jN=_f(),LN=Tf(),FN=Df(),Nf=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===MN.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new LN.AwsClient(e):e.credential_source?.executable?new FN.PluggableAuthClient(e):new jN.IdentityPoolClient(e):null}};bc.ExternalAccountClient=Nf});var jf=D(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.ExternalAccountAuthorizedUserClient=_i.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var KP=er(),ZP=sf(),JP=ft(),qN=require("stream"),BN=Hn();_i.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var VN="https://sts.{universeDomain}/v1/oauthtoken",Uf=class t extends ZP.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})};KP.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let i=await this.transporter.request(n),s=i.data;return s.res=i,s}catch(i){throw i instanceof JP.GaxiosError&&i.response?(0,ZP.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},Mf=class extends KP.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 Uf({tokenRefreshEndpoint:e.token_url??VN.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=BN.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=JP.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof qN.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){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}};_i.ExternalAccountAuthorizedUserClient=Mf});var eT=D(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.GoogleAuth=kr.GoogleAuthExceptionMessages=void 0;var GN=require("child_process"),Na=require("fs"),HN=ft(),za=Ea(),WN=require("os"),Lf=require("path"),ZN=Sa(),KN=$p(),JN=Dp(),YN=Np(),bi=ef(),YP=rf(),Ei=of(),XN=zf(),Ua=Hn(),Ff=er(),XP=jf(),QP=Rr();kr.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(f),v=await $N(t.crypto,t.securityCredentials.secretAccessKey,c,t.region,n),b=await ka(t.crypto,v,g),E=`${BP} Credential=${t.securityCredentials.accessKeyId}/${l}, SignedHeaders=${_}, Signature=${(0,VP.fromArrayBufferToHex)(b)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:E,canonicalQuerystring:t.canonicalQuerystring}}o(kN,"generateAuthenticationHeaderMap")});var GP=D(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.DefaultAwsSecurityCredentialsSupplier=void 0;var cc=er(),Sf=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};cc.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 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 i={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,headers:r};return cc.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}};lc.DefaultAwsSecurityCredentialsSupplier=Sf});var Tf=D(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.AwsClient=void 0;var DN=Ef(),NN=Hn(),zN=GP(),HP=Rr(),UN=ft(),Pf=class t extends NN.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,HP.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("aws_security_credentials_supplier");if(!n&&!i)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(i)this.awsSecurityCredentialsSupplier=i,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let s=(0,HP.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let c=s.get("region_url"),d=s.get("url"),p=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new zN.DefaultAwsSecurityCredentialsSupplier({regionUrl:c,securityCredentialsUrl:d,imdsV2SessionTokenUrl:p}),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 DN.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 UN.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((i,s)=>r.push({key:s,value:i})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};dc.AwsClient=Pf});var Rf=D(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.InvalidSubjectTokenError=gt.InvalidMessageFieldError=gt.InvalidCodeFieldError=gt.InvalidTokenTypeFieldError=gt.InvalidExpirationTimeFieldError=gt.InvalidSuccessFieldError=gt.InvalidVersionFieldError=gt.ExecutableResponseError=gt.ExecutableResponse=void 0;var pc="urn:ietf:params:oauth:token-type:saml2",wf="urn:ietf:params:oauth:token-type:id_token",xf="urn:ietf:params:oauth:token-type:jwt",Af=class{static{o(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!==wf&&this.tokenType!==xf)throw new hc(`Executable response must contain a 'token_type' field when successful and it must be one of ${wf}, ${xf}, or ${pc}.`);if(this.tokenType===pc){if(!e.saml_response)throw new Da(`Executable response must contain a 'saml_response' field when token_type=${pc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new Da(`Executable response must contain a 'id_token' field when token_type=${wf} or ${xf}.`);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)}};gt.ExecutableResponse=Af;var Hr=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};gt.ExecutableResponseError=Hr;var fc=class extends Hr{static{o(this,"InvalidVersionFieldError")}};gt.InvalidVersionFieldError=fc;var mc=class extends Hr{static{o(this,"InvalidSuccessFieldError")}};gt.InvalidSuccessFieldError=mc;var If=class extends Hr{static{o(this,"InvalidExpirationTimeFieldError")}};gt.InvalidExpirationTimeFieldError=If;var hc=class extends Hr{static{o(this,"InvalidTokenTypeFieldError")}};gt.InvalidTokenTypeFieldError=hc;var gc=class extends Hr{static{o(this,"InvalidCodeFieldError")}};gt.InvalidCodeFieldError=gc;var yc=class extends Hr{static{o(this,"InvalidMessageFieldError")}};gt.InvalidMessageFieldError=yc;var Da=class extends Hr{static{o(this,"InvalidSubjectTokenError")}};gt.InvalidSubjectTokenError=Da});var $f=D(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.PluggableAuthHandler=vi.ExecutableError=void 0;var vo=Rf(),MN=require("child_process"),Cf=require("fs"),vc=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)}};vi.ExecutableError=vc;var Of=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=MN.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";i.stdout.on("data",d=>{s+=d}),i.stderr.on("data",d=>{s+=d});let c=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",d=>{if(clearTimeout(c),d===0)try{let p=JSON.parse(s),h=new vo.ExecutableResponse(p);return r(h)}catch(p){return p instanceof vo.ExecutableResponseError?n(p):n(new vo.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new vc(s,d.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await Cf.promises.realpath(this.outputFile)}catch{return}if(!(await Cf.promises.lstat(e)).isFile())return;let r=await Cf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new vo.ExecutableResponse(n).isValid()?new vo.ExecutableResponse(n):void 0}catch(n){throw n instanceof vo.ExecutableResponseError?n:new vo.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}};vi.PluggableAuthHandler=Of});var Df=D(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.PluggableAuthClient=_i.ExecutableError=void 0;var jN=Hn(),LN=Rf(),WP=$f(),FN=$f();Object.defineProperty(_i,"ExecutableError",{enumerable:!0,get:o(function(){return FN.ExecutableError},"get")});var qN=30*1e3,ZP=5*1e3,KP=120*1e3,BN="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",JP=1,kf=class extends jN.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=qN;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<ZP||this.timeoutMillis>KP)throw new Error(`Timeout must be between ${ZP} and ${KP} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new WP.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[BN]!=="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>JP)throw new Error(`Version of executable is not currently supported, maximum supported version is ${JP}.`);if(!e.success)throw new WP.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new LN.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}};_i.PluggableAuthClient=kf});var zf=D(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.ExternalAccountClient=void 0;var VN=Hn(),GN=_f(),HN=Tf(),WN=Df(),Nf=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===VN.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new HN.AwsClient(e):e.credential_source?.executable?new WN.PluggableAuthClient(e):new GN.IdentityPoolClient(e):null}};_c.ExternalAccountClient=Nf});var jf=D(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.ExternalAccountAuthorizedUserClient=bi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var XP=er(),YP=sf(),QP=ft(),ZN=require("stream"),KN=Hn();bi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var JN="https://sts.{universeDomain}/v1/oauthtoken",Uf=class t extends YP.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})};XP.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let i=await this.transporter.request(n),s=i.data;return s.res=i,s}catch(i){throw i instanceof QP.GaxiosError&&i.response?(0,YP.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},Mf=class extends XP.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 Uf({tokenRefreshEndpoint:e.token_url??JN.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=KN.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=QP.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof ZN.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};bi.ExternalAccountAuthorizedUserClient=Mf});var nT=D(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.GoogleAuth=kr.GoogleAuthExceptionMessages=void 0;var YN=require("child_process"),Na=require("fs"),XN=ft(),za=Ea(),QN=require("os"),Lf=require("path"),ez=Sa(),tz=$p(),rz=Dp(),nz=Np(),Ei=ef(),eT=rf(),Si=of(),oz=zf(),Ua=Hn(),Ff=er(),tT=jf(),rT=Rr();kr.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 qf=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(kr.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===kr.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(kr.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 za.universe("universe-domain"),e||=Ff.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Ff.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,QP.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Ff.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 bi.JWT?r.scopes=this.scopes:r instanceof Ua.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof bi.JWT?r.scopes=this.scopes:r instanceof Ua.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new KN.Compute(e));throw new Error(kr.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=za.getGCPResidency()||await za.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=Lf.join(i,".config"))}return r&&(r=Lf.join(r,"gcloud","application_default_credentials.json"),Na.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=Na.realpathSync(e),!Na.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=Na.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!==Ei.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${Ei.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 Ei.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,r={}){let n,i=(0,QP.originalOrCamelOptions)(r).get("universe_domain");return e.type===YP.USER_REFRESH_ACCOUNT_TYPE?(n=new YP.UserRefreshClient(r),n.fromJSON(e)):e.type===Ei.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===Ua.EXTERNAL_ACCOUNT_TYPE?(n=XN.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===XP.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new XP.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new bi.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),i&&(n.universeDomain=i),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let i={};if(typeof r=="function"?n=r:i=r,n)this.fromStreamAsync(e,i).then(s=>n(null,s),n);else return this.fromStreamAsync(e,i)}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",i).on("data",c=>s.push(c)).on("end",()=>{try{try{let c=JSON.parse(s.join("")),d=this._cacheClientFromJSON(c,r);return n(d)}catch(c){if(!this.keyFilename)throw c;let d=new bi.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=d,this.setGapicJWTValues(d),n(d)}}catch(c){return i(c)}})})}fromAPIKey(e,r={}){return new bi.JWT({...r,apiKey:e})}_isWindows(){let e=WN.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,GN.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!==Ua.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await za.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 Ei.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof Ua.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([za.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(kr.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=Lf.resolve(this.keyFilename),r=Na.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 JN.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=HN.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,YN.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 Ei.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,ZN.createCrypto)();if(n instanceof bi.JWT&&n.key)return await s.sign(n.key,e);let c=await this.getCredentials();if(!c.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,c.client_email,e,r)}async signBlob(e,r,n,i){let s=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};kr.GoogleAuth=qf});var tT=D(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.IAMAuth=void 0;var Bf=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}}};Ec.IAMAuth=Bf});var rT=D(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.DownscopedClient=Wr.EXPIRATION_TIME_OFFSET=Wr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var QN=ft(),ez=require("stream"),Vf=er(),tz=tc(),rz="urn:ietf:params:oauth:grant-type:token-exchange",nz="urn:ietf:params:oauth:token-type:access_token",oz="urn:ietf:params:oauth:token-type:access_token";Wr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Wr.EXPIRATION_TIME_OFFSET=5*60*1e3;var Gf=class extends Vf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Vf.AuthClient?{}:e),e instanceof Vf.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>Wr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Wr.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 tz.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=QN.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof ez.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:rz,requestedTokenType:nz,subjectToken:e,subjectTokenType:oz},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),i=this.authClient.credentials?.expiry_date||null,s=n.expires_in?new Date().getTime()+n.expires_in*1e3:i;return this.cachedDownscopedAccessToken={access_token:n.access_token,expiry_date:s,res:n.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};Wr.DownscopedClient=Gf});var nT=D(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.PassThroughClient=void 0;var iz=er(),Hf=class extends iz.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};Sc.PassThroughClient=Hf});var Ma=D(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.GoogleAuth=ue.auth=ue.PassThroughClient=ue.ExternalAccountAuthorizedUserClient=ue.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=ue.ExecutableError=ue.PluggableAuthClient=ue.DownscopedClient=ue.BaseExternalAccountClient=ue.ExternalAccountClient=ue.IdentityPoolClient=ue.AwsRequestSigner=ue.AwsClient=ue.UserRefreshClient=ue.LoginTicket=ue.ClientAuthentication=ue.OAuth2Client=ue.CodeChallengeMethod=ue.Impersonated=ue.JWT=ue.JWTAccess=ue.IdTokenClient=ue.IAMAuth=ue.GCPEnv=ue.Compute=ue.DEFAULT_UNIVERSE=ue.AuthClient=ue.gaxios=ue.gcpMetadata=void 0;var oT=eT();Object.defineProperty(ue,"GoogleAuth",{enumerable:!0,get:o(function(){return oT.GoogleAuth},"get")});ue.gcpMetadata=Ea();ue.gaxios=ft();var iT=er();Object.defineProperty(ue,"AuthClient",{enumerable:!0,get:o(function(){return iT.AuthClient},"get")});Object.defineProperty(ue,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return iT.DEFAULT_UNIVERSE},"get")});var az=$p();Object.defineProperty(ue,"Compute",{enumerable:!0,get:o(function(){return az.Compute},"get")});var sz=Np();Object.defineProperty(ue,"GCPEnv",{enumerable:!0,get:o(function(){return sz.GCPEnv},"get")});var uz=tT();Object.defineProperty(ue,"IAMAuth",{enumerable:!0,get:o(function(){return uz.IAMAuth},"get")});var cz=Dp();Object.defineProperty(ue,"IdTokenClient",{enumerable:!0,get:o(function(){return cz.IdTokenClient},"get")});var lz=Xp();Object.defineProperty(ue,"JWTAccess",{enumerable:!0,get:o(function(){return lz.JWTAccess},"get")});var dz=ef();Object.defineProperty(ue,"JWT",{enumerable:!0,get:o(function(){return dz.JWT},"get")});var pz=of();Object.defineProperty(ue,"Impersonated",{enumerable:!0,get:o(function(){return pz.Impersonated},"get")});var Wf=yo();Object.defineProperty(ue,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return Wf.CodeChallengeMethod},"get")});Object.defineProperty(ue,"OAuth2Client",{enumerable:!0,get:o(function(){return Wf.OAuth2Client},"get")});Object.defineProperty(ue,"ClientAuthentication",{enumerable:!0,get:o(function(){return Wf.ClientAuthentication},"get")});var fz=Ip();Object.defineProperty(ue,"LoginTicket",{enumerable:!0,get:o(function(){return fz.LoginTicket},"get")});var mz=rf();Object.defineProperty(ue,"UserRefreshClient",{enumerable:!0,get:o(function(){return mz.UserRefreshClient},"get")});var hz=Tf();Object.defineProperty(ue,"AwsClient",{enumerable:!0,get:o(function(){return hz.AwsClient},"get")});var gz=Ef();Object.defineProperty(ue,"AwsRequestSigner",{enumerable:!0,get:o(function(){return gz.AwsRequestSigner},"get")});var yz=_f();Object.defineProperty(ue,"IdentityPoolClient",{enumerable:!0,get:o(function(){return yz.IdentityPoolClient},"get")});var vz=zf();Object.defineProperty(ue,"ExternalAccountClient",{enumerable:!0,get:o(function(){return vz.ExternalAccountClient},"get")});var _z=Hn();Object.defineProperty(ue,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return _z.BaseExternalAccountClient},"get")});var bz=rT();Object.defineProperty(ue,"DownscopedClient",{enumerable:!0,get:o(function(){return bz.DownscopedClient},"get")});var aT=Df();Object.defineProperty(ue,"PluggableAuthClient",{enumerable:!0,get:o(function(){return aT.PluggableAuthClient},"get")});Object.defineProperty(ue,"ExecutableError",{enumerable:!0,get:o(function(){return aT.ExecutableError},"get")});var sT=jf();Object.defineProperty(ue,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return sT.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(ue,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return sT.ExternalAccountAuthorizedUserClient},"get")});var Ez=nT();Object.defineProperty(ue,"PassThroughClient",{enumerable:!0,get:o(function(){return Ez.PassThroughClient},"get")});var Sz=new oT.GoogleAuth;ue.auth=Sz});var ja=D((Kf,Jf)=>{(function(t,e){typeof Kf=="object"&&typeof Jf<"u"?Jf.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Kf,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",s="minute",c="hour",d="day",p="week",h="month",_="quarter",m="year",f="date",l="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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(re){var B=["th","st","nd","rd"],q=re%100;return"["+re+(B[(q-20)%10]||B[q]||B[0])+"]"},"ordinal")},E=o(function(re,B,q){var Y=String(re);return!Y||Y.length>=B?re:""+Array(B+1-Y.length).join(q)+re},"m"),k={s:E,z:o(function(re){var B=-re.utcOffset(),q=Math.abs(B),Y=Math.floor(q/60),Z=q%60;return(B<=0?"+":"-")+E(Y,2,"0")+":"+E(Z,2,"0")},"z"),m:o(function re(B,q){if(B.date()<q.date())return-re(q,B);var Y=12*(q.year()-B.year())+(q.month()-B.month()),Z=B.clone().add(Y,h),oe=q-Z<0,ae=B.clone().add(Y+(oe?-1:1),h);return+(-(Y+(q-Z)/(oe?Z-ae:ae-Z))||0)},"t"),a:o(function(re){return re<0?Math.ceil(re)||0:Math.floor(re)},"a"),p:o(function(re){return{M:h,y:m,w:p,d,D:f,h:c,m:s,s:i,ms:n,Q:_}[re]||String(re||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(re){return re===void 0},"u")},L="en",J={};J[L]=b;var W=o(function(re){return re instanceof X},"p"),G=o(function re(B,q,Y){var Z;if(!B)return L;if(typeof B=="string"){var oe=B.toLowerCase();J[oe]&&(Z=oe),q&&(J[oe]=q,Z=oe);var ae=B.split("-");if(!Z&&ae.length>1)return re(ae[0])}else{var Ie=B.name;J[Ie]=B,Z=Ie}return!Y&&Z&&(L=Z),Z||!Y&&L},"t"),K=o(function(re,B){if(W(re))return re.clone();var q=typeof B=="object"?B:{};return q.date=re,q.args=arguments,new X(q)},"w"),te=k;te.l=G,te.i=W,te.w=function(re,B){return K(re,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var X=function(){function re(q){this.$L=G(q.locale,null,!0),this.parse(q)}o(re,"M");var B=re.prototype;return B.parse=function(q){this.$d=function(Y){var Z=Y.date,oe=Y.utc;if(Z===null)return new Date(NaN);if(te.u(Z))return new Date;if(Z instanceof Date)return new Date(Z);if(typeof Z=="string"&&!/Z$/i.test(Z)){var ae=Z.match(g);if(ae){var Ie=ae[2]-1||0,$e=(ae[7]||"0").substring(0,3);return oe?new Date(Date.UTC(ae[1],Ie,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,$e)):new Date(ae[1],Ie,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,$e)}}return new Date(Z)}(q),this.$x=q.x||{},this.init()},B.init=function(){var q=this.$d;this.$y=q.getFullYear(),this.$M=q.getMonth(),this.$D=q.getDate(),this.$W=q.getDay(),this.$H=q.getHours(),this.$m=q.getMinutes(),this.$s=q.getSeconds(),this.$ms=q.getMilliseconds()},B.$utils=function(){return te},B.isValid=function(){return this.$d.toString()!==l},B.isSame=function(q,Y){var Z=K(q);return this.startOf(Y)<=Z&&Z<=this.endOf(Y)},B.isAfter=function(q,Y){return K(q)<this.startOf(Y)},B.isBefore=function(q,Y){return this.endOf(Y)<K(q)},B.$g=function(q,Y,Z){return te.u(q)?this[Y]:this.set(Z,q)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(q,Y){var Z=this,oe=!!te.u(Y)||Y,ae=te.p(q),Ie=o(function(Bt,Be){var We=te.w(Z.$u?Date.UTC(Z.$y,Be,Bt):new Date(Z.$y,Be,Bt),Z);return oe?We:We.endOf(d)},"l"),$e=o(function(Bt,Be){return te.w(Z.toDate()[Bt].apply(Z.toDate("s"),(oe?[0,0,0,0]:[23,59,59,999]).slice(Be)),Z)},"$"),Ve=this.$W,Ye=this.$M,Et=this.$D,ee="set"+(this.$u?"UTC":"");switch(ae){case m:return oe?Ie(1,0):Ie(31,11);case h:return oe?Ie(1,Ye):Ie(0,Ye+1);case p:var st=this.$locale().weekStart||0,pt=(Ve<st?Ve+7:Ve)-st;return Ie(oe?Et-pt:Et+(6-pt),Ye);case d:case f:return $e(ee+"Hours",0);case c:return $e(ee+"Minutes",1);case s:return $e(ee+"Seconds",2);case i:return $e(ee+"Milliseconds",3);default:return this.clone()}},B.endOf=function(q){return this.startOf(q,!1)},B.$set=function(q,Y){var Z,oe=te.p(q),ae="set"+(this.$u?"UTC":""),Ie=(Z={},Z[d]=ae+"Date",Z[f]=ae+"Date",Z[h]=ae+"Month",Z[m]=ae+"FullYear",Z[c]=ae+"Hours",Z[s]=ae+"Minutes",Z[i]=ae+"Seconds",Z[n]=ae+"Milliseconds",Z)[oe],$e=oe===d?this.$D+(Y-this.$W):Y;if(oe===h||oe===m){var Ve=this.clone().set(f,1);Ve.$d[Ie]($e),Ve.init(),this.$d=Ve.set(f,Math.min(this.$D,Ve.daysInMonth())).$d}else Ie&&this.$d[Ie]($e);return this.init(),this},B.set=function(q,Y){return this.clone().$set(q,Y)},B.get=function(q){return this[te.p(q)]()},B.add=function(q,Y){var Z,oe=this;q=Number(q);var ae=te.p(Y),Ie=o(function(Ye){var Et=K(oe);return te.w(Et.date(Et.date()+Math.round(Ye*q)),oe)},"y");if(ae===h)return this.set(h,this.$M+q);if(ae===m)return this.set(m,this.$y+q);if(ae===d)return Ie(1);if(ae===p)return Ie(7);var $e=(Z={},Z[s]=e,Z[c]=r,Z[i]=t,Z)[ae]||1,Ve=this.$d.getTime()+q*$e;return te.w(Ve,this)},B.subtract=function(q,Y){return this.add(-1*q,Y)},B.format=function(q){var Y=this,Z=this.$locale();if(!this.isValid())return Z.invalidDate||l;var oe=q||"YYYY-MM-DDTHH:mm:ssZ",ae=te.z(this),Ie=this.$H,$e=this.$m,Ve=this.$M,Ye=Z.weekdays,Et=Z.months,ee=Z.meridiem,st=o(function(Be,We,S,w){return Be&&(Be[We]||Be(Y,oe))||S[We].slice(0,w)},"h"),pt=o(function(Be){return te.s(Ie%12||12,Be,"0")},"d"),Bt=ee||function(Be,We,S){var w=Be<12?"AM":"PM";return S?w.toLowerCase():w};return oe.replace(v,function(Be,We){return We||function(S){switch(S){case"YY":return String(Y.$y).slice(-2);case"YYYY":return te.s(Y.$y,4,"0");case"M":return Ve+1;case"MM":return te.s(Ve+1,2,"0");case"MMM":return st(Z.monthsShort,Ve,Et,3);case"MMMM":return st(Et,Ve);case"D":return Y.$D;case"DD":return te.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return st(Z.weekdaysMin,Y.$W,Ye,2);case"ddd":return st(Z.weekdaysShort,Y.$W,Ye,3);case"dddd":return Ye[Y.$W];case"H":return String(Ie);case"HH":return te.s(Ie,2,"0");case"h":return pt(1);case"hh":return pt(2);case"a":return Bt(Ie,$e,!0);case"A":return Bt(Ie,$e,!1);case"m":return String($e);case"mm":return te.s($e,2,"0");case"s":return String(Y.$s);case"ss":return te.s(Y.$s,2,"0");case"SSS":return te.s(Y.$ms,3,"0");case"Z":return ae}return null}(Be)||ae.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(q,Y,Z){var oe,ae=this,Ie=te.p(Y),$e=K(q),Ve=($e.utcOffset()-this.utcOffset())*e,Ye=this-$e,Et=o(function(){return te.m(ae,$e)},"D");switch(Ie){case m:oe=Et()/12;break;case h:oe=Et();break;case _:oe=Et()/3;break;case p:oe=(Ye-Ve)/6048e5;break;case d:oe=(Ye-Ve)/864e5;break;case c:oe=Ye/r;break;case s:oe=Ye/e;break;case i:oe=Ye/t;break;default:oe=Ye}return Z?oe:te.a(oe)},B.daysInMonth=function(){return this.endOf(h).$D},B.$locale=function(){return J[this.$L]},B.locale=function(q,Y){if(!q)return this.$L;var Z=this.clone(),oe=G(q,Y,!0);return oe&&(Z.$L=oe),Z},B.clone=function(){return te.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},re}(),Te=X.prototype;return K.prototype=Te,[["$ms",n],["$s",i],["$m",s],["$H",c],["$W",d],["$M",h],["$y",m],["$D",f]].forEach(function(re){Te[re[1]]=function(B){return this.$g(B,re[0],re[1])}}),K.extend=function(re,B){return re.$i||(re(B,X,K),re.$i=!0),K},K.locale=G,K.isDayjs=W,K.unix=function(re){return K(1e3*re)},K.en=J[L],K.Ls=J,K.p={},K})});var uT=D(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.getAPI=Pz;function Pz(t,e,r,n){let i;if(typeof e=="string")i=e,e={};else if(typeof e=="object")i=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[i],c=new s(e,n);return Object.freeze(c)}catch(s){throw new Error(`Unable to load endpoint ${t}("${i}"): ${s.message}`)}}o(Pz,"getAPI")});var lT=D((HX,cT)=>{cT.exports=require("util").inspect});var Va=D((WX,CT)=>{var sm=typeof Map=="function"&&Map.prototype,Xf=Object.getOwnPropertyDescriptor&&sm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,wc=sm&&Xf&&typeof Xf.get=="function"?Xf.get:null,dT=sm&&Map.prototype.forEach,um=typeof Set=="function"&&Set.prototype,Qf=Object.getOwnPropertyDescriptor&&um?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,xc=um&&Qf&&typeof Qf.get=="function"?Qf.get:null,pT=um&&Set.prototype.forEach,Tz=typeof WeakMap=="function"&&WeakMap.prototype,Fa=Tz?WeakMap.prototype.has:null,wz=typeof WeakSet=="function"&&WeakSet.prototype,qa=wz?WeakSet.prototype.has:null,xz=typeof WeakRef=="function"&&WeakRef.prototype,fT=xz?WeakRef.prototype.deref:null,Az=Boolean.prototype.valueOf,Iz=Object.prototype.toString,Rz=Function.prototype.toString,Cz=String.prototype.match,cm=String.prototype.slice,Wn=String.prototype.replace,Oz=String.prototype.toUpperCase,mT=String.prototype.toLowerCase,PT=RegExp.prototype.test,hT=Array.prototype.concat,Zr=Array.prototype.join,$z=Array.prototype.slice,gT=Math.floor,rm=typeof BigInt=="function"?BigInt.prototype.valueOf:null,em=Object.getOwnPropertySymbols,nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Si=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ba=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Si||!0)?Symbol.toStringTag:null,TT=Object.prototype.propertyIsEnumerable,yT=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function vT(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||PT.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-gT(-t):gT(t);if(n!==t){var i=String(n),s=cm.call(e,i.length+1);return Wn.call(i,r,"$&_")+"."+Wn.call(Wn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Wn.call(e,r,"$&_")}o(vT,"addNumericSeparator");var om=lT(),_T=om.custom,bT=AT(_T)?_T:null,wT={__proto__:null,double:'"',single:"'"},kz={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};CT.exports=o(function t(e,r,n,i){var s=r||{};if(vn(s,"quoteStyle")&&!vn(wT,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(vn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=vn(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(vn(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(vn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return RT(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var p=String(e);return d?vT(e,p):p}if(typeof e=="bigint"){var h=String(e)+"n";return d?vT(e,h):h}var _=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=_&&_>0&&typeof e=="object")return im(e)?"[Array]":"[Object]";var m=Yz(s,n);if(typeof i>"u")i=[];else if(IT(i,e)>=0)return"[Circular]";function f(q,Y,Z){if(Y&&(i=$z.call(i),i.push(Y)),Z){var oe={depth:s.depth};return vn(s,"quoteStyle")&&(oe.quoteStyle=s.quoteStyle),t(q,oe,n+1,i)}return t(q,s,n+1,i)}if(o(f,"inspect"),typeof e=="function"&&!ET(e)){var l=qz(e),g=Tc(e,f);return"[Function"+(l?": "+l:" (anonymous)")+"]"+(g.length>0?" { "+Zr.call(g,", ")+" }":"")}if(AT(e)){var v=Si?Wn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):nm.call(e);return typeof e=="object"&&!Si?La(v):v}if(Zz(e)){for(var b="<"+mT.call(String(e.nodeName)),E=e.attributes||[],k=0;k<E.length;k++)b+=" "+E[k].name+"="+xT(Dz(E[k].value),"double",s);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+mT.call(String(e.nodeName))+">",b}if(im(e)){if(e.length===0)return"[]";var L=Tc(e,f);return m&&!Jz(L)?"["+am(L,m)+"]":"[ "+Zr.call(L,", ")+" ]"}if(zz(e)){var J=Tc(e,f);return!("cause"in Error.prototype)&&"cause"in e&&!TT.call(e,"cause")?"{ ["+String(e)+"] "+Zr.call(hT.call("[cause]: "+f(e.cause),J),", ")+" }":J.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Zr.call(J,", ")+" }"}if(typeof e=="object"&&c){if(bT&&typeof e[bT]=="function"&&om)return om(e,{depth:_-n});if(c!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Bz(e)){var W=[];return dT&&dT.call(e,function(q,Y){W.push(f(Y,e,!0)+" => "+f(q,e))}),ST("Map",wc.call(e),W,m)}if(Hz(e)){var G=[];return pT&&pT.call(e,function(q){G.push(f(q,e))}),ST("Set",xc.call(e),G,m)}if(Vz(e))return tm("WeakMap");if(Wz(e))return tm("WeakSet");if(Gz(e))return tm("WeakRef");if(Mz(e))return La(f(Number(e)));if(Lz(e))return La(f(rm.call(e)));if(jz(e))return La(Az.call(e));if(Uz(e))return La(f(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(!Nz(e)&&!ET(e)){var K=Tc(e,f),te=yT?yT(e)===Object.prototype:e instanceof Object||e.constructor===Object,X=e instanceof Object?"":"null prototype",Te=!te&&Ba&&Object(e)===e&&Ba in e?cm.call(Zn(e),8,-1):X?"Object":"",re=te||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",B=re+(Te||X?"["+Zr.call(hT.call([],Te||[],X||[]),": ")+"] ":"");return K.length===0?B+"{}":m?B+"{"+am(K,m)+"}":B+"{ "+Zr.call(K,", ")+" }"}return String(e)},"inspect_");function xT(t,e,r){var n=r.quoteStyle||e,i=wT[n];return i+t+i}o(xT,"wrapQuotes");function Dz(t){return Wn.call(String(t),/"/g,""")}o(Dz,"quote");function _o(t){return!Ba||!(typeof t=="object"&&(Ba in t||typeof t[Ba]<"u"))}o(_o,"canTrustToString");function im(t){return Zn(t)==="[object Array]"&&_o(t)}o(im,"isArray");function Nz(t){return Zn(t)==="[object Date]"&&_o(t)}o(Nz,"isDate");function ET(t){return Zn(t)==="[object RegExp]"&&_o(t)}o(ET,"isRegExp");function zz(t){return Zn(t)==="[object Error]"&&_o(t)}o(zz,"isError");function Uz(t){return Zn(t)==="[object String]"&&_o(t)}o(Uz,"isString");function Mz(t){return Zn(t)==="[object Number]"&&_o(t)}o(Mz,"isNumber");function jz(t){return Zn(t)==="[object Boolean]"&&_o(t)}o(jz,"isBoolean");function AT(t){if(Si)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!nm)return!1;try{return nm.call(t),!0}catch{}return!1}o(AT,"isSymbol");function Lz(t){if(!t||typeof t!="object"||!rm)return!1;try{return rm.call(t),!0}catch{}return!1}o(Lz,"isBigInt");var Fz=Object.prototype.hasOwnProperty||function(t){return t in this};function vn(t,e){return Fz.call(t,e)}o(vn,"has");function Zn(t){return Iz.call(t)}o(Zn,"toStr");function qz(t){if(t.name)return t.name;var e=Cz.call(Rz.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(qz,"nameOf");function IT(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(IT,"indexOf");function Bz(t){if(!wc||!t||typeof t!="object")return!1;try{wc.call(t);try{xc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(Bz,"isMap");function Vz(t){if(!Fa||!t||typeof t!="object")return!1;try{Fa.call(t,Fa);try{qa.call(t,qa)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(Vz,"isWeakMap");function Gz(t){if(!fT||!t||typeof t!="object")return!1;try{return fT.call(t),!0}catch{}return!1}o(Gz,"isWeakRef");function Hz(t){if(!xc||!t||typeof t!="object")return!1;try{xc.call(t);try{wc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(Hz,"isSet");function Wz(t){if(!qa||!t||typeof t!="object")return!1;try{qa.call(t,qa);try{Fa.call(t,Fa)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(Wz,"isWeakSet");function Zz(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(Zz,"isElement");function RT(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return RT(cm.call(t,0,e.maxStringLength),e)+n}var i=kz[e.quoteStyle||"single"];i.lastIndex=0;var s=Wn.call(Wn.call(t,i,"\\$1"),/[\x00-\x1f]/g,Kz);return xT(s,"single",e)}o(RT,"inspectString");function Kz(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":"")+Oz.call(e.toString(16))}o(Kz,"lowbyte");function La(t){return"Object("+t+")"}o(La,"markBoxed");function tm(t){return t+" { ? }"}o(tm,"weakCollectionOf");function ST(t,e,r,n){var i=n?am(r,n):Zr.call(r,", ");return t+" ("+e+") {"+i+"}"}o(ST,"collectionOf");function Jz(t){for(var e=0;e<t.length;e++)if(IT(t[e],`
|
|
56
|
-
`)>=0)return!1;return!0}o(
|
|
55
|
+
https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var qf=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(kr.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===kr.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(kr.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 za.universe("universe-domain"),e||=Ff.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Ff.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,rT.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Ff.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 Ei.JWT?r.scopes=this.scopes:r instanceof Ua.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof Ei.JWT?r.scopes=this.scopes:r instanceof Ua.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new tz.Compute(e));throw new Error(kr.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=za.getGCPResidency()||await za.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=Lf.join(i,".config"))}return r&&(r=Lf.join(r,"gcloud","application_default_credentials.json"),Na.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=Na.realpathSync(e),!Na.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=Na.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!==Si.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${Si.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 Si.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,r={}){let n,i=(0,rT.originalOrCamelOptions)(r).get("universe_domain");return e.type===eT.USER_REFRESH_ACCOUNT_TYPE?(n=new eT.UserRefreshClient(r),n.fromJSON(e)):e.type===Si.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===Ua.EXTERNAL_ACCOUNT_TYPE?(n=oz.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===tT.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new tT.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new Ei.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),i&&(n.universeDomain=i),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let i={};if(typeof r=="function"?n=r:i=r,n)this.fromStreamAsync(e,i).then(s=>n(null,s),n);else return this.fromStreamAsync(e,i)}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",i).on("data",c=>s.push(c)).on("end",()=>{try{try{let c=JSON.parse(s.join("")),d=this._cacheClientFromJSON(c,r);return n(d)}catch(c){if(!this.keyFilename)throw c;let d=new Ei.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=d,this.setGapicJWTValues(d),n(d)}}catch(c){return i(c)}})})}fromAPIKey(e,r={}){return new Ei.JWT({...r,apiKey:e})}_isWindows(){let e=QN.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,YN.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!==Ua.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await za.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 Si.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof Ua.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([za.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(kr.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=Lf.resolve(this.keyFilename),r=Na.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 rz.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=XN.Gaxios.mergeHeaders(e.headers,i),e}async fetch(...e){return(await this.getClient()).fetch(...e)}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,nz.getEnv)()}async sign(e,r){let n=await this.getClient(),i=await this.getUniverseDomain();if(r=r||`https://iamcredentials.${i}/v1/projects/-/serviceAccounts/`,n instanceof Si.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,ez.createCrypto)();if(n instanceof Ei.JWT&&n.key)return await s.sign(n.key,e);let c=await this.getCredentials();if(!c.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,c.client_email,e,r)}async signBlob(e,r,n,i){let s=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};kr.GoogleAuth=qf});var oT=D(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.IAMAuth=void 0;var Bf=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}}};bc.IAMAuth=Bf});var iT=D(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.DownscopedClient=Wr.EXPIRATION_TIME_OFFSET=Wr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var iz=ft(),az=require("stream"),Vf=er(),sz=ec(),uz="urn:ietf:params:oauth:grant-type:token-exchange",cz="urn:ietf:params:oauth:token-type:access_token",lz="urn:ietf:params:oauth:token-type:access_token";Wr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Wr.EXPIRATION_TIME_OFFSET=5*60*1e3;var Gf=class extends Vf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Vf.AuthClient?{}:e),e instanceof Vf.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>Wr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Wr.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 sz.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=iz.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof az.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:uz,requestedTokenType:cz,subjectToken:e,subjectTokenType:lz},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),i=this.authClient.credentials?.expiry_date||null,s=n.expires_in?new Date().getTime()+n.expires_in*1e3:i;return this.cachedDownscopedAccessToken={access_token:n.access_token,expiry_date:s,res:n.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};Wr.DownscopedClient=Gf});var aT=D(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.PassThroughClient=void 0;var dz=er(),Hf=class extends dz.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};Ec.PassThroughClient=Hf});var Ma=D(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.GoogleAuth=ue.auth=ue.PassThroughClient=ue.ExternalAccountAuthorizedUserClient=ue.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=ue.ExecutableError=ue.PluggableAuthClient=ue.DownscopedClient=ue.BaseExternalAccountClient=ue.ExternalAccountClient=ue.IdentityPoolClient=ue.AwsRequestSigner=ue.AwsClient=ue.UserRefreshClient=ue.LoginTicket=ue.ClientAuthentication=ue.OAuth2Client=ue.CodeChallengeMethod=ue.Impersonated=ue.JWT=ue.JWTAccess=ue.IdTokenClient=ue.IAMAuth=ue.GCPEnv=ue.Compute=ue.DEFAULT_UNIVERSE=ue.AuthClient=ue.gaxios=ue.gcpMetadata=void 0;var sT=nT();Object.defineProperty(ue,"GoogleAuth",{enumerable:!0,get:o(function(){return sT.GoogleAuth},"get")});ue.gcpMetadata=Ea();ue.gaxios=ft();var uT=er();Object.defineProperty(ue,"AuthClient",{enumerable:!0,get:o(function(){return uT.AuthClient},"get")});Object.defineProperty(ue,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return uT.DEFAULT_UNIVERSE},"get")});var pz=$p();Object.defineProperty(ue,"Compute",{enumerable:!0,get:o(function(){return pz.Compute},"get")});var fz=Np();Object.defineProperty(ue,"GCPEnv",{enumerable:!0,get:o(function(){return fz.GCPEnv},"get")});var mz=oT();Object.defineProperty(ue,"IAMAuth",{enumerable:!0,get:o(function(){return mz.IAMAuth},"get")});var hz=Dp();Object.defineProperty(ue,"IdTokenClient",{enumerable:!0,get:o(function(){return hz.IdTokenClient},"get")});var gz=Xp();Object.defineProperty(ue,"JWTAccess",{enumerable:!0,get:o(function(){return gz.JWTAccess},"get")});var yz=ef();Object.defineProperty(ue,"JWT",{enumerable:!0,get:o(function(){return yz.JWT},"get")});var vz=of();Object.defineProperty(ue,"Impersonated",{enumerable:!0,get:o(function(){return vz.Impersonated},"get")});var Wf=yo();Object.defineProperty(ue,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return Wf.CodeChallengeMethod},"get")});Object.defineProperty(ue,"OAuth2Client",{enumerable:!0,get:o(function(){return Wf.OAuth2Client},"get")});Object.defineProperty(ue,"ClientAuthentication",{enumerable:!0,get:o(function(){return Wf.ClientAuthentication},"get")});var _z=Ip();Object.defineProperty(ue,"LoginTicket",{enumerable:!0,get:o(function(){return _z.LoginTicket},"get")});var bz=rf();Object.defineProperty(ue,"UserRefreshClient",{enumerable:!0,get:o(function(){return bz.UserRefreshClient},"get")});var Ez=Tf();Object.defineProperty(ue,"AwsClient",{enumerable:!0,get:o(function(){return Ez.AwsClient},"get")});var Sz=Ef();Object.defineProperty(ue,"AwsRequestSigner",{enumerable:!0,get:o(function(){return Sz.AwsRequestSigner},"get")});var Pz=_f();Object.defineProperty(ue,"IdentityPoolClient",{enumerable:!0,get:o(function(){return Pz.IdentityPoolClient},"get")});var Tz=zf();Object.defineProperty(ue,"ExternalAccountClient",{enumerable:!0,get:o(function(){return Tz.ExternalAccountClient},"get")});var wz=Hn();Object.defineProperty(ue,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return wz.BaseExternalAccountClient},"get")});var xz=iT();Object.defineProperty(ue,"DownscopedClient",{enumerable:!0,get:o(function(){return xz.DownscopedClient},"get")});var cT=Df();Object.defineProperty(ue,"PluggableAuthClient",{enumerable:!0,get:o(function(){return cT.PluggableAuthClient},"get")});Object.defineProperty(ue,"ExecutableError",{enumerable:!0,get:o(function(){return cT.ExecutableError},"get")});var lT=jf();Object.defineProperty(ue,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return lT.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(ue,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return lT.ExternalAccountAuthorizedUserClient},"get")});var Az=aT();Object.defineProperty(ue,"PassThroughClient",{enumerable:!0,get:o(function(){return Az.PassThroughClient},"get")});var Iz=new sT.GoogleAuth;ue.auth=Iz});var ja=D((Kf,Jf)=>{(function(t,e){typeof Kf=="object"&&typeof Jf<"u"?Jf.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Kf,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",s="minute",c="hour",d="day",p="week",h="month",_="quarter",m="year",f="date",l="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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(re){var B=["th","st","nd","rd"],q=re%100;return"["+re+(B[(q-20)%10]||B[q]||B[0])+"]"},"ordinal")},E=o(function(re,B,q){var Y=String(re);return!Y||Y.length>=B?re:""+Array(B+1-Y.length).join(q)+re},"m"),k={s:E,z:o(function(re){var B=-re.utcOffset(),q=Math.abs(B),Y=Math.floor(q/60),Z=q%60;return(B<=0?"+":"-")+E(Y,2,"0")+":"+E(Z,2,"0")},"z"),m:o(function re(B,q){if(B.date()<q.date())return-re(q,B);var Y=12*(q.year()-B.year())+(q.month()-B.month()),Z=B.clone().add(Y,h),oe=q-Z<0,ae=B.clone().add(Y+(oe?-1:1),h);return+(-(Y+(q-Z)/(oe?Z-ae:ae-Z))||0)},"t"),a:o(function(re){return re<0?Math.ceil(re)||0:Math.floor(re)},"a"),p:o(function(re){return{M:h,y:m,w:p,d,D:f,h:c,m:s,s:i,ms:n,Q:_}[re]||String(re||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(re){return re===void 0},"u")},L="en",J={};J[L]=b;var W=o(function(re){return re instanceof X},"p"),G=o(function re(B,q,Y){var Z;if(!B)return L;if(typeof B=="string"){var oe=B.toLowerCase();J[oe]&&(Z=oe),q&&(J[oe]=q,Z=oe);var ae=B.split("-");if(!Z&&ae.length>1)return re(ae[0])}else{var Ie=B.name;J[Ie]=B,Z=Ie}return!Y&&Z&&(L=Z),Z||!Y&&L},"t"),K=o(function(re,B){if(W(re))return re.clone();var q=typeof B=="object"?B:{};return q.date=re,q.args=arguments,new X(q)},"w"),te=k;te.l=G,te.i=W,te.w=function(re,B){return K(re,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var X=function(){function re(q){this.$L=G(q.locale,null,!0),this.parse(q)}o(re,"M");var B=re.prototype;return B.parse=function(q){this.$d=function(Y){var Z=Y.date,oe=Y.utc;if(Z===null)return new Date(NaN);if(te.u(Z))return new Date;if(Z instanceof Date)return new Date(Z);if(typeof Z=="string"&&!/Z$/i.test(Z)){var ae=Z.match(g);if(ae){var Ie=ae[2]-1||0,$e=(ae[7]||"0").substring(0,3);return oe?new Date(Date.UTC(ae[1],Ie,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,$e)):new Date(ae[1],Ie,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,$e)}}return new Date(Z)}(q),this.$x=q.x||{},this.init()},B.init=function(){var q=this.$d;this.$y=q.getFullYear(),this.$M=q.getMonth(),this.$D=q.getDate(),this.$W=q.getDay(),this.$H=q.getHours(),this.$m=q.getMinutes(),this.$s=q.getSeconds(),this.$ms=q.getMilliseconds()},B.$utils=function(){return te},B.isValid=function(){return this.$d.toString()!==l},B.isSame=function(q,Y){var Z=K(q);return this.startOf(Y)<=Z&&Z<=this.endOf(Y)},B.isAfter=function(q,Y){return K(q)<this.startOf(Y)},B.isBefore=function(q,Y){return this.endOf(Y)<K(q)},B.$g=function(q,Y,Z){return te.u(q)?this[Y]:this.set(Z,q)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(q,Y){var Z=this,oe=!!te.u(Y)||Y,ae=te.p(q),Ie=o(function(Bt,Be){var We=te.w(Z.$u?Date.UTC(Z.$y,Be,Bt):new Date(Z.$y,Be,Bt),Z);return oe?We:We.endOf(d)},"l"),$e=o(function(Bt,Be){return te.w(Z.toDate()[Bt].apply(Z.toDate("s"),(oe?[0,0,0,0]:[23,59,59,999]).slice(Be)),Z)},"$"),Ve=this.$W,Ye=this.$M,Et=this.$D,ee="set"+(this.$u?"UTC":"");switch(ae){case m:return oe?Ie(1,0):Ie(31,11);case h:return oe?Ie(1,Ye):Ie(0,Ye+1);case p:var st=this.$locale().weekStart||0,pt=(Ve<st?Ve+7:Ve)-st;return Ie(oe?Et-pt:Et+(6-pt),Ye);case d:case f:return $e(ee+"Hours",0);case c:return $e(ee+"Minutes",1);case s:return $e(ee+"Seconds",2);case i:return $e(ee+"Milliseconds",3);default:return this.clone()}},B.endOf=function(q){return this.startOf(q,!1)},B.$set=function(q,Y){var Z,oe=te.p(q),ae="set"+(this.$u?"UTC":""),Ie=(Z={},Z[d]=ae+"Date",Z[f]=ae+"Date",Z[h]=ae+"Month",Z[m]=ae+"FullYear",Z[c]=ae+"Hours",Z[s]=ae+"Minutes",Z[i]=ae+"Seconds",Z[n]=ae+"Milliseconds",Z)[oe],$e=oe===d?this.$D+(Y-this.$W):Y;if(oe===h||oe===m){var Ve=this.clone().set(f,1);Ve.$d[Ie]($e),Ve.init(),this.$d=Ve.set(f,Math.min(this.$D,Ve.daysInMonth())).$d}else Ie&&this.$d[Ie]($e);return this.init(),this},B.set=function(q,Y){return this.clone().$set(q,Y)},B.get=function(q){return this[te.p(q)]()},B.add=function(q,Y){var Z,oe=this;q=Number(q);var ae=te.p(Y),Ie=o(function(Ye){var Et=K(oe);return te.w(Et.date(Et.date()+Math.round(Ye*q)),oe)},"y");if(ae===h)return this.set(h,this.$M+q);if(ae===m)return this.set(m,this.$y+q);if(ae===d)return Ie(1);if(ae===p)return Ie(7);var $e=(Z={},Z[s]=e,Z[c]=r,Z[i]=t,Z)[ae]||1,Ve=this.$d.getTime()+q*$e;return te.w(Ve,this)},B.subtract=function(q,Y){return this.add(-1*q,Y)},B.format=function(q){var Y=this,Z=this.$locale();if(!this.isValid())return Z.invalidDate||l;var oe=q||"YYYY-MM-DDTHH:mm:ssZ",ae=te.z(this),Ie=this.$H,$e=this.$m,Ve=this.$M,Ye=Z.weekdays,Et=Z.months,ee=Z.meridiem,st=o(function(Be,We,S,w){return Be&&(Be[We]||Be(Y,oe))||S[We].slice(0,w)},"h"),pt=o(function(Be){return te.s(Ie%12||12,Be,"0")},"d"),Bt=ee||function(Be,We,S){var w=Be<12?"AM":"PM";return S?w.toLowerCase():w};return oe.replace(v,function(Be,We){return We||function(S){switch(S){case"YY":return String(Y.$y).slice(-2);case"YYYY":return te.s(Y.$y,4,"0");case"M":return Ve+1;case"MM":return te.s(Ve+1,2,"0");case"MMM":return st(Z.monthsShort,Ve,Et,3);case"MMMM":return st(Et,Ve);case"D":return Y.$D;case"DD":return te.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return st(Z.weekdaysMin,Y.$W,Ye,2);case"ddd":return st(Z.weekdaysShort,Y.$W,Ye,3);case"dddd":return Ye[Y.$W];case"H":return String(Ie);case"HH":return te.s(Ie,2,"0");case"h":return pt(1);case"hh":return pt(2);case"a":return Bt(Ie,$e,!0);case"A":return Bt(Ie,$e,!1);case"m":return String($e);case"mm":return te.s($e,2,"0");case"s":return String(Y.$s);case"ss":return te.s(Y.$s,2,"0");case"SSS":return te.s(Y.$ms,3,"0");case"Z":return ae}return null}(Be)||ae.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(q,Y,Z){var oe,ae=this,Ie=te.p(Y),$e=K(q),Ve=($e.utcOffset()-this.utcOffset())*e,Ye=this-$e,Et=o(function(){return te.m(ae,$e)},"D");switch(Ie){case m:oe=Et()/12;break;case h:oe=Et();break;case _:oe=Et()/3;break;case p:oe=(Ye-Ve)/6048e5;break;case d:oe=(Ye-Ve)/864e5;break;case c:oe=Ye/r;break;case s:oe=Ye/e;break;case i:oe=Ye/t;break;default:oe=Ye}return Z?oe:te.a(oe)},B.daysInMonth=function(){return this.endOf(h).$D},B.$locale=function(){return J[this.$L]},B.locale=function(q,Y){if(!q)return this.$L;var Z=this.clone(),oe=G(q,Y,!0);return oe&&(Z.$L=oe),Z},B.clone=function(){return te.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},re}(),Te=X.prototype;return K.prototype=Te,[["$ms",n],["$s",i],["$m",s],["$H",c],["$W",d],["$M",h],["$y",m],["$D",f]].forEach(function(re){Te[re[1]]=function(B){return this.$g(B,re[0],re[1])}}),K.extend=function(re,B){return re.$i||(re(B,X,K),re.$i=!0),K},K.locale=G,K.isDayjs=W,K.unix=function(re){return K(1e3*re)},K.en=J[L],K.Ls=J,K.p={},K})});var dT=D(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.getAPI=Rz;function Rz(t,e,r,n){let i;if(typeof e=="string")i=e,e={};else if(typeof e=="object")i=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[i],c=new s(e,n);return Object.freeze(c)}catch(s){throw new Error(`Unable to load endpoint ${t}("${i}"): ${s.message}`)}}o(Rz,"getAPI")});var fT=D((QX,pT)=>{pT.exports=require("util").inspect});var Va=D((e7,kT)=>{var sm=typeof Map=="function"&&Map.prototype,Xf=Object.getOwnPropertyDescriptor&&sm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Tc=sm&&Xf&&typeof Xf.get=="function"?Xf.get:null,mT=sm&&Map.prototype.forEach,um=typeof Set=="function"&&Set.prototype,Qf=Object.getOwnPropertyDescriptor&&um?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,wc=um&&Qf&&typeof Qf.get=="function"?Qf.get:null,hT=um&&Set.prototype.forEach,Cz=typeof WeakMap=="function"&&WeakMap.prototype,Fa=Cz?WeakMap.prototype.has:null,Oz=typeof WeakSet=="function"&&WeakSet.prototype,qa=Oz?WeakSet.prototype.has:null,$z=typeof WeakRef=="function"&&WeakRef.prototype,gT=$z?WeakRef.prototype.deref:null,kz=Boolean.prototype.valueOf,Dz=Object.prototype.toString,Nz=Function.prototype.toString,zz=String.prototype.match,cm=String.prototype.slice,Wn=String.prototype.replace,Uz=String.prototype.toUpperCase,yT=String.prototype.toLowerCase,xT=RegExp.prototype.test,vT=Array.prototype.concat,Zr=Array.prototype.join,Mz=Array.prototype.slice,_T=Math.floor,rm=typeof BigInt=="function"?BigInt.prototype.valueOf:null,em=Object.getOwnPropertySymbols,nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Pi=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ba=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Pi||!0)?Symbol.toStringTag:null,AT=Object.prototype.propertyIsEnumerable,bT=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function ET(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||xT.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-_T(-t):_T(t);if(n!==t){var i=String(n),s=cm.call(e,i.length+1);return Wn.call(i,r,"$&_")+"."+Wn.call(Wn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Wn.call(e,r,"$&_")}o(ET,"addNumericSeparator");var om=fT(),ST=om.custom,PT=CT(ST)?ST:null,IT={__proto__:null,double:'"',single:"'"},jz={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};kT.exports=o(function t(e,r,n,i){var s=r||{};if(vn(s,"quoteStyle")&&!vn(IT,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(vn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=vn(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(vn(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(vn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return $T(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var p=String(e);return d?ET(e,p):p}if(typeof e=="bigint"){var h=String(e)+"n";return d?ET(e,h):h}var _=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=_&&_>0&&typeof e=="object")return im(e)?"[Array]":"[Object]";var m=nU(s,n);if(typeof i>"u")i=[];else if(OT(i,e)>=0)return"[Circular]";function f(q,Y,Z){if(Y&&(i=Mz.call(i),i.push(Y)),Z){var oe={depth:s.depth};return vn(s,"quoteStyle")&&(oe.quoteStyle=s.quoteStyle),t(q,oe,n+1,i)}return t(q,s,n+1,i)}if(o(f,"inspect"),typeof e=="function"&&!TT(e)){var l=Zz(e),g=Pc(e,f);return"[Function"+(l?": "+l:" (anonymous)")+"]"+(g.length>0?" { "+Zr.call(g,", ")+" }":"")}if(CT(e)){var v=Pi?Wn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):nm.call(e);return typeof e=="object"&&!Pi?La(v):v}if(eU(e)){for(var b="<"+yT.call(String(e.nodeName)),E=e.attributes||[],k=0;k<E.length;k++)b+=" "+E[k].name+"="+RT(Lz(E[k].value),"double",s);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+yT.call(String(e.nodeName))+">",b}if(im(e)){if(e.length===0)return"[]";var L=Pc(e,f);return m&&!rU(L)?"["+am(L,m)+"]":"[ "+Zr.call(L,", ")+" ]"}if(qz(e)){var J=Pc(e,f);return!("cause"in Error.prototype)&&"cause"in e&&!AT.call(e,"cause")?"{ ["+String(e)+"] "+Zr.call(vT.call("[cause]: "+f(e.cause),J),", ")+" }":J.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Zr.call(J,", ")+" }"}if(typeof e=="object"&&c){if(PT&&typeof e[PT]=="function"&&om)return om(e,{depth:_-n});if(c!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Kz(e)){var W=[];return mT&&mT.call(e,function(q,Y){W.push(f(Y,e,!0)+" => "+f(q,e))}),wT("Map",Tc.call(e),W,m)}if(Xz(e)){var G=[];return hT&&hT.call(e,function(q){G.push(f(q,e))}),wT("Set",wc.call(e),G,m)}if(Jz(e))return tm("WeakMap");if(Qz(e))return tm("WeakSet");if(Yz(e))return tm("WeakRef");if(Vz(e))return La(f(Number(e)));if(Hz(e))return La(f(rm.call(e)));if(Gz(e))return La(kz.call(e));if(Bz(e))return La(f(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(!Fz(e)&&!TT(e)){var K=Pc(e,f),te=bT?bT(e)===Object.prototype:e instanceof Object||e.constructor===Object,X=e instanceof Object?"":"null prototype",Te=!te&&Ba&&Object(e)===e&&Ba in e?cm.call(Zn(e),8,-1):X?"Object":"",re=te||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",B=re+(Te||X?"["+Zr.call(vT.call([],Te||[],X||[]),": ")+"] ":"");return K.length===0?B+"{}":m?B+"{"+am(K,m)+"}":B+"{ "+Zr.call(K,", ")+" }"}return String(e)},"inspect_");function RT(t,e,r){var n=r.quoteStyle||e,i=IT[n];return i+t+i}o(RT,"wrapQuotes");function Lz(t){return Wn.call(String(t),/"/g,""")}o(Lz,"quote");function _o(t){return!Ba||!(typeof t=="object"&&(Ba in t||typeof t[Ba]<"u"))}o(_o,"canTrustToString");function im(t){return Zn(t)==="[object Array]"&&_o(t)}o(im,"isArray");function Fz(t){return Zn(t)==="[object Date]"&&_o(t)}o(Fz,"isDate");function TT(t){return Zn(t)==="[object RegExp]"&&_o(t)}o(TT,"isRegExp");function qz(t){return Zn(t)==="[object Error]"&&_o(t)}o(qz,"isError");function Bz(t){return Zn(t)==="[object String]"&&_o(t)}o(Bz,"isString");function Vz(t){return Zn(t)==="[object Number]"&&_o(t)}o(Vz,"isNumber");function Gz(t){return Zn(t)==="[object Boolean]"&&_o(t)}o(Gz,"isBoolean");function CT(t){if(Pi)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!nm)return!1;try{return nm.call(t),!0}catch{}return!1}o(CT,"isSymbol");function Hz(t){if(!t||typeof t!="object"||!rm)return!1;try{return rm.call(t),!0}catch{}return!1}o(Hz,"isBigInt");var Wz=Object.prototype.hasOwnProperty||function(t){return t in this};function vn(t,e){return Wz.call(t,e)}o(vn,"has");function Zn(t){return Dz.call(t)}o(Zn,"toStr");function Zz(t){if(t.name)return t.name;var e=zz.call(Nz.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(Zz,"nameOf");function OT(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(OT,"indexOf");function Kz(t){if(!Tc||!t||typeof t!="object")return!1;try{Tc.call(t);try{wc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(Kz,"isMap");function Jz(t){if(!Fa||!t||typeof t!="object")return!1;try{Fa.call(t,Fa);try{qa.call(t,qa)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(Jz,"isWeakMap");function Yz(t){if(!gT||!t||typeof t!="object")return!1;try{return gT.call(t),!0}catch{}return!1}o(Yz,"isWeakRef");function Xz(t){if(!wc||!t||typeof t!="object")return!1;try{wc.call(t);try{Tc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(Xz,"isSet");function Qz(t){if(!qa||!t||typeof t!="object")return!1;try{qa.call(t,qa);try{Fa.call(t,Fa)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(Qz,"isWeakSet");function eU(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(eU,"isElement");function $T(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return $T(cm.call(t,0,e.maxStringLength),e)+n}var i=jz[e.quoteStyle||"single"];i.lastIndex=0;var s=Wn.call(Wn.call(t,i,"\\$1"),/[\x00-\x1f]/g,tU);return RT(s,"single",e)}o($T,"inspectString");function tU(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":"")+Uz.call(e.toString(16))}o(tU,"lowbyte");function La(t){return"Object("+t+")"}o(La,"markBoxed");function tm(t){return t+" { ? }"}o(tm,"weakCollectionOf");function wT(t,e,r,n){var i=n?am(r,n):Zr.call(r,", ");return t+" ("+e+") {"+i+"}"}o(wT,"collectionOf");function rU(t){for(var e=0;e<t.length;e++)if(OT(t[e],`
|
|
56
|
+
`)>=0)return!1;return!0}o(rU,"singleLineValues");function nU(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Zr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Zr.call(Array(e+1),r)}}o(nU,"getIndent");function am(t,e){if(t.length===0)return"";var r=`
|
|
57
57
|
`+e.prev+e.base;return r+Zr.call(t,","+r)+`
|
|
58
|
-
`+e.prev}o(am,"indentedJoin");function Tc(t,e){var r=im(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=vn(t,i)?e(t[i],t):""}var s=typeof em=="function"?em(t):[],c;if(Si){c={};for(var d=0;d<s.length;d++)c["$"+s[d]]=s[d]}for(var p in t)vn(t,p)&&(r&&String(Number(p))===p&&p<t.length||Si&&c["$"+p]instanceof Symbol||(PT.call(/[^\w$]/,p)?n.push(e(p,t)+": "+e(t[p],t)):n.push(p+": "+e(t[p],t))));if(typeof em=="function")for(var h=0;h<s.length;h++)TT.call(t,s[h])&&n.push("["+e(s[h])+"]: "+e(t[s[h]],t));return n}o(Tc,"arrObjKeys")});var $T=D((KX,OT)=>{"use strict";var Xz=Va(),Qz=Nn(),Ac=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"),eU=o(function(t,e){if(t){var r=Ac(t,e);return r&&r.value}},"listGet"),tU=o(function(t,e,r){var n=Ac(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),rU=o(function(t,e){return t?!!Ac(t,e):!1},"listHas"),nU=o(function(t,e){if(t)return Ac(t,e,!0)},"listDelete");OT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new Qz("Side channel does not contain "+Xz(n))},"assert"),delete:o(function(n){var i=nU(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return eU(e,n)},"get"),has:o(function(n){return rU(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),tU(e,n,i)},"set")};return r},"getSideChannelList")});var lm=D((YX,NT)=>{"use strict";var kT=ia(),DT=_d(),oU=DT([kT("%String.prototype.indexOf%")]);NT.exports=o(function(e,r){var n=kT(e,!!r);return typeof n=="function"&&oU(e,".prototype.")>-1?DT([n]):n},"callBoundIntrinsic")});var dm=D((QX,UT)=>{"use strict";var iU=ia(),Ga=lm(),aU=Va(),sU=Nn(),zT=iU("%Map%",!0),uU=Ga("Map.prototype.get",!0),cU=Ga("Map.prototype.set",!0),lU=Ga("Map.prototype.has",!0),dU=Ga("Map.prototype.delete",!0),pU=Ga("Map.prototype.size",!0);UT.exports=!!zT&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new sU("Side channel does not contain "+aU(n))},"assert"),delete:o(function(n){if(e){var i=dU(e,n);return pU(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return uU(e,n)},"get"),has:o(function(n){return e?lU(e,n):!1},"has"),set:o(function(n,i){e||(e=new zT),cU(e,n,i)},"set")};return r},"getSideChannelMap")});var jT=D((t7,MT)=>{"use strict";var fU=ia(),Rc=lm(),mU=Va(),Ic=dm(),hU=Nn(),Pi=fU("%WeakMap%",!0),gU=Rc("WeakMap.prototype.get",!0),yU=Rc("WeakMap.prototype.set",!0),vU=Rc("WeakMap.prototype.has",!0),_U=Rc("WeakMap.prototype.delete",!0);MT.exports=Pi?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new hU("Side channel does not contain "+mU(i))},"assert"),delete:o(function(i){if(Pi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return _U(e,i)}else if(Ic&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return Pi&&i&&(typeof i=="object"||typeof i=="function")&&e?gU(e,i):r&&r.get(i)},"get"),has:o(function(i){return Pi&&i&&(typeof i=="object"||typeof i=="function")&&e?vU(e,i):!!r&&r.has(i)},"has"),set:o(function(i,s){Pi&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Pi),yU(e,i,s)):Ic&&(r||(r=Ic()),r.set(i,s))},"set")};return n},"getSideChannelWeakMap"):Ic});var pm=D((n7,LT)=>{"use strict";var bU=Nn(),EU=Va(),SU=$T(),PU=dm(),TU=jT(),wU=TU||PU||SU;LT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new bU("Side channel does not contain "+EU(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=wU()),e.set(n,i)},"set")};return r},"getSideChannel")});var Cc=D((i7,FT)=>{"use strict";var xU=String.prototype.replace,AU=/%20/g,fm={RFC1738:"RFC1738",RFC3986:"RFC3986"};FT.exports={default:fm.RFC3986,formatters:{RFC1738:o(function(t){return xU.call(t,AU,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:fm.RFC1738,RFC3986:fm.RFC3986}});var ym=D((s7,qT)=>{"use strict";var IU=Cc(),RU=pm(),mm=Object.prototype.hasOwnProperty,bo=Array.isArray,Oc=RU(),Ti=o(function(e,r){return Oc.set(e,r),e},"markOverflow"),Eo=o(function(e){return Oc.has(e)},"isOverflow"),Ha=o(function(e){return Oc.get(e)},"getMaxIndex"),gm=o(function(e,r){Oc.set(e,r)},"setMaxIndex"),Kr=function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t}(),CU=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(bo(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&(i[i.length]=n[s]);r.obj[r.prop]=i}}},"compactQueue"),Wa=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"),OU=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(bo(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return Ti(Wa(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(Eo(e)){var s=Ha(e)+1;e[s]=r,gm(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!mm.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(Eo(r)){for(var c=Object.keys(r),d=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},p=0;p<c.length;p++){var h=parseInt(c[p],10);d[h+1]=r[c[p]]}return Ti(d,Ha(r)+1)}var _=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&_.length>n.arrayLimit?Ti(Wa(_,n),_.length-1):_}var m=e;return bo(e)&&!bo(r)&&(m=Wa(e,n)),bo(e)&&bo(r)?(r.forEach(function(f,l){if(mm.call(e,l)){var g=e[l];g&&typeof g=="object"&&f&&typeof f=="object"?e[l]=t(g,f,n):e[e.length]=f}else e[l]=f}),e):Object.keys(r).reduce(function(f,l){var g=r[l];if(mm.call(f,l)?f[l]=t(f[l],g,n):f[l]=g,Eo(r)&&!Eo(f)&&Ti(f,Ha(r)),Eo(f)){var v=parseInt(l,10);String(v)===l&&v>=0&&v>Ha(f)&&gm(f,v)}return f},m)},"merge"),$U=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),kU=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"),hm=1024,DU=o(function(e,r,n,i,s){if(e.length===0)return e;var c=e;if(typeof e=="symbol"?c=Symbol.prototype.toString.call(e):typeof e!="string"&&(c=String(e)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var d="",p=0;p<c.length;p+=hm){for(var h=c.length>=hm?c.slice(p,p+hm):c,_=[],m=0;m<h.length;++m){var f=h.charCodeAt(m);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||s===IU.RFC1738&&(f===40||f===41)){_[_.length]=h.charAt(m);continue}if(f<128){_[_.length]=Kr[f];continue}if(f<2048){_[_.length]=Kr[192|f>>6]+Kr[128|f&63];continue}if(f<55296||f>=57344){_[_.length]=Kr[224|f>>12]+Kr[128|f>>6&63]+Kr[128|f&63];continue}m+=1,f=65536+((f&1023)<<10|h.charCodeAt(m)&1023),_[_.length]=Kr[240|f>>18]+Kr[128|f>>12&63]+Kr[128|f>>6&63]+Kr[128|f&63]}d+=_.join("")}return d},"encode"),NU=o(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],c=s.obj[s.prop],d=Object.keys(c),p=0;p<d.length;++p){var h=d[p],_=c[h];typeof _=="object"&&_!==null&&n.indexOf(_)===-1&&(r[r.length]={obj:c,prop:h},n[n.length]=_)}return CU(r),e},"compact"),zU=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),UU=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),MU=o(function(e,r,n,i){if(Eo(e)){var s=Ha(e)+1;return e[s]=r,gm(e,s),e}var c=[].concat(e,r);return c.length>n?Ti(Wa(c,{plainObjects:i}),c.length-1):c},"combine"),jU=o(function(e,r){if(bo(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");qT.exports={arrayToObject:Wa,assign:$U,combine:MU,compact:NU,decode:kU,encode:DU,isBuffer:UU,isOverflow:Eo,isRegExp:zU,markOverflow:Ti,maybeMap:jU,merge:OU}});var ZT=D((c7,WT)=>{"use strict";var VT=pm(),$c=ym(),Za=Cc(),LU=Object.prototype.hasOwnProperty,GT={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")},Jr=Array.isArray,FU=Array.prototype.push,HT=o(function(t,e){FU.apply(t,Jr(e)?e:[e])},"pushToArray"),qU=Date.prototype.toISOString,BT=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:BT,formatter:Za.formatters[BT],indices:!1,serializeDate:o(function(e){return qU.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},BU=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),vm={},VU=o(function t(e,r,n,i,s,c,d,p,h,_,m,f,l,g,v,b,E,k){for(var L=e,J=k,W=0,G=!1;(J=J.get(vm))!==void 0&&!G;){var K=J.get(e);if(W+=1,typeof K<"u"){if(K===W)throw new RangeError("Cyclic object value");G=!0}typeof J.get(vm)>"u"&&(W=0)}if(typeof _=="function"?L=_(r,L):L instanceof Date?L=l(L):n==="comma"&&Jr(L)&&(L=$c.maybeMap(L,function(Ve){return Ve instanceof Date?l(Ve):Ve})),L===null){if(c)return h&&!b?h(r,bt.encoder,E,"key",g):r;L=""}if(BU(L)||$c.isBuffer(L)){if(h){var te=b?r:h(r,bt.encoder,E,"key",g);return[v(te)+"="+v(h(L,bt.encoder,E,"value",g))]}return[v(r)+"="+v(String(L))]}var X=[];if(typeof L>"u")return X;var Te;if(n==="comma"&&Jr(L))b&&h&&(L=$c.maybeMap(L,h)),Te=[{value:L.length>0?L.join(",")||null:void 0}];else if(Jr(_))Te=_;else{var re=Object.keys(L);Te=m?re.sort(m):re}var B=p?String(r).replace(/\./g,"%2E"):String(r),q=i&&Jr(L)&&L.length===1?B+"[]":B;if(s&&Jr(L)&&L.length===0)return q+"[]";for(var Y=0;Y<Te.length;++Y){var Z=Te[Y],oe=typeof Z=="object"&&Z&&typeof Z.value<"u"?Z.value:L[Z];if(!(d&&oe===null)){var ae=f&&p?String(Z).replace(/\./g,"%2E"):String(Z),Ie=Jr(L)?typeof n=="function"?n(q,ae):q:q+(f?"."+ae:"["+ae+"]");k.set(e,W);var $e=VT();$e.set(vm,k),HT(X,t(oe,Ie,n,i,s,c,d,p,n==="comma"&&b&&Jr(L)?null:h,_,m,f,l,g,v,b,E,$e))}}return X},"stringify"),GU=o(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(!LU.call(Za.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Za.formatters[n],s=bt.filter;(typeof e.filter=="function"||Jr(e.filter))&&(s=e.filter);var c;if(e.arrayFormat in GT?c=e.arrayFormat:"indices"in e?c=e.indices?"indices":"repeat":c=bt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var d=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:bt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:bt.addQueryPrefix,allowDots:d,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:bt.allowEmptyArrays,arrayFormat:c,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:i,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");WT.exports=function(t,e){var r=t,n=GU(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Jr(n.filter)&&(s=n.filter,i=s);var c=[];if(typeof r!="object"||r===null)return"";var d=GT[n.arrayFormat],p=d==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var h=VT(),_=0;_<i.length;++_){var m=i[_],f=r[m];n.skipNulls&&f===null||HT(c,VU(f,m,d,p,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,h))}var l=c.join(n.delimiter),g=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),l.length>0?g+l:""}});var YT=D((d7,JT)=>{"use strict";var Yr=ym(),kc=Object.prototype.hasOwnProperty,_m=Array.isArray,at={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Yr.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},HU=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),KT=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"),WU="utf8=%26%2310003%3B",ZU="utf8=%E2%9C%93",KU=o(function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,c=i.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&c.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var d=-1,p,h=r.charset;if(r.charsetSentinel)for(p=0;p<c.length;++p)c[p].indexOf("utf8=")===0&&(c[p]===ZU?h="utf-8":c[p]===WU&&(h="iso-8859-1"),d=p,p=c.length);for(p=0;p<c.length;++p)if(p!==d){var _=c[p],m=_.indexOf("]="),f=m===-1?_.indexOf("="):m+1,l,g;if(f===-1?(l=r.decoder(_,at.decoder,h,"key"),g=r.strictNullHandling?null:""):(l=r.decoder(_.slice(0,f),at.decoder,h,"key"),l!==null&&(g=Yr.maybeMap(KT(_.slice(f+1),r,_m(n[l])?n[l].length:0),function(b){return r.decoder(b,at.decoder,h,"value")}))),g&&r.interpretNumericEntities&&h==="iso-8859-1"&&(g=HU(String(g))),_.indexOf("[]=")>-1&&(g=_m(g)?[g]:g),r.comma&&_m(g)&&g.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");g=Yr.combine([],g,r.arrayLimit,r.plainObjects)}if(l!==null){var v=kc.call(n,l);v&&(r.duplicates==="combine"||_.indexOf("[]=")>-1)?n[l]=Yr.combine(n[l],g,r.arrayLimit,r.plainObjects):(!v||r.duplicates==="last")&&(n[l]=g)}}return n},"parseQueryStringValues"),JU=o(function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");i=Array.isArray(e)&&e[s]?e[s].length:0}for(var c=n?e:KT(e,r,i),d=t.length-1;d>=0;--d){var p,h=t[d];if(h==="[]"&&r.parseArrays)Yr.isOverflow(c)?p=c:p=r.allowEmptyArrays&&(c===""||r.strictNullHandling&&c===null)?[]:Yr.combine([],c,r.arrayLimit,r.plainObjects);else{p=r.plainObjects?{__proto__:null}:{};var _=h.charAt(0)==="["&&h.charAt(h.length-1)==="]"?h.slice(1,-1):h,m=r.decodeDotInKeys?_.replace(/%2E/g,"."):_,f=parseInt(m,10),l=!isNaN(f)&&h!==m&&String(f)===m&&f>=0&&r.parseArrays;if(!r.parseArrays&&m==="")p={0:c};else if(l&&f<r.arrayLimit)p=[],p[f]=c;else{if(l&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");l?(p[f]=c,Yr.markOverflow(p,f)):m!=="__proto__"&&(p[m]=c)}}c=p}return c},"parseObject"),YU=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&kc.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=i.exec(n),d=c?n.slice(0,c.index):n,p=[];if(d){if(!r.plainObjects&&kc.call(Object.prototype,d)&&!r.allowPrototypes)return;p[p.length]=d}for(var h=0;(c=s.exec(n))!==null&&h<r.depth;){h+=1;var _=c[1].slice(1,-1);if(!r.plainObjects&&kc.call(Object.prototype,_)&&!r.allowPrototypes)return;p[p.length]=c[1]}if(c){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");p[p.length]="["+n.slice(c.index)+"]"}return p},"splitKeyIntoSegments"),XU=o(function(e,r,n,i){if(e){var s=YU(e,n);if(s)return JU(s,r,n,i)}},"parseQueryStringKeys"),QU=o(function(e){if(!e)return at;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"?at.charset:e.charset,n=typeof e.duplicates>"u"?at.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:at.allowDots:!!e.allowDots;return{allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:at.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:at.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:at.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:at.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:at.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:at.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:at.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:at.decoder,delimiter:typeof e.delimiter=="string"||Yr.isRegExp(e.delimiter)?e.delimiter:at.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:at.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:at.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:at.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:at.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:at.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:at.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:at.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");JT.exports=function(t,e){var r=QU(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?KU(t,r):t,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),c=0;c<s.length;++c){var d=s[c],p=XU(d,n[d],r,typeof t=="string");i=Yr.merge(i,p,r)}return r.allowSparse===!0?i:Yr.compact(i)}});var bm=D((f7,XT)=>{"use strict";var e1=ZT(),t1=YT(),r1=Cc();XT.exports={formats:r1,parse:t1,stringify:e1}});var ew=D((Em,QT)=>{(function(t,e){typeof Em=="object"?QT.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(Em,function(){function t(){}return o(t,"UrlTemplate"),t.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(r){return/%[0-9A-Fa-f]/.test(r)||(r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")),r}).join("")},t.prototype.encodeUnreserved=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})},t.prototype.encodeValue=function(e,r,n){return r=e==="+"||e==="#"?this.encodeReserved(r):this.encodeUnreserved(r),n?this.encodeUnreserved(n)+"="+r:r},t.prototype.isDefined=function(e){return e!=null},t.prototype.isKeyOperator=function(e){return e===";"||e==="&"||e==="?"},t.prototype.getValues=function(e,r,n,i){var s=e[n],c=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),i&&i!=="*"&&(s=s.substring(0,parseInt(i,10))),c.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(i==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(p){c.push(this.encodeValue(r,p,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(p){this.isDefined(s[p])&&c.push(this.encodeValue(r,s[p],p))},this);else{var d=[];Array.isArray(s)?s.filter(this.isDefined).forEach(function(p){d.push(this.encodeValue(r,p))},this):Object.keys(s).forEach(function(p){this.isDefined(s[p])&&(d.push(this.encodeUnreserved(p)),d.push(this.encodeValue(r,s[p].toString())))},this),this.isKeyOperator(r)?c.push(this.encodeUnreserved(n)+"="+d.join(",")):d.length!==0&&c.push(d.join(","))}else r===";"?this.isDefined(s)&&c.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?c.push(this.encodeUnreserved(n)+"="):s===""&&c.push("");return c},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:o(function(i){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,c,d){if(c){var p=null,h=[];if(n.indexOf(c.charAt(0))!==-1&&(p=c.charAt(0),c=c.substr(1)),c.split(/,/g).forEach(function(m){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(m);h.push.apply(h,r.getValues(i,p,f[1],f[2]||f[3]))}),p&&p!=="+"){var _=",";return p==="?"?_="&":p!=="#"&&(_=p),(h.length!==0?p:"")+h.join(_)}else return h.join(",")}else return r.encodeReserved(d)})},"expand")}},new t})});var tw=D(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.isBrowser=n1;function n1(){return typeof window<"u"}o(n1,"isBrowser")});var Nc=D(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.headersToClassicHeaders=rw;Dc.marshallGaxiosResponse=o1;function rw(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(rw,"headersToClassicHeaders");function o1(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:rw(t?.headers)}})}o(o1,"marshallGaxiosResponse")});var iw=D(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.sessions=void 0;ir.request=y1;ir.closeSession=Pm;var ow=require("http2"),i1=require("zlib"),a1=require("url"),s1=bm(),u1=sa(),c1=require("stream"),l1=require("util"),d1=require("process"),p1=Nc(),{HTTP2_HEADER_CONTENT_ENCODING:f1,HTTP2_HEADER_CONTENT_TYPE:nw,HTTP2_HEADER_METHOD:m1,HTTP2_HEADER_PATH:h1,HTTP2_HEADER_STATUS:g1}=ow.constants,Ka=!!d1.env.HTTP2_DEBUG;ir.sessions={};async function y1(t){let e=u1(!0,{},t);e.validateStatus=e.validateStatus||v1,e.responseType=e.responseType||"json";let r=new a1.URL(e.url),n=_1(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let m=(t.paramsSerializer||s1.stringify)(e.params);i+=`?${m}`}let s=(0,p1.headersToClassicHeaders)(e.headers);s[h1]=i,s[m1]=t.method||"GET",e.headers=s,s[nw]||e.responseType!=="text"&&(s[nw]="application/json");let c={config:t,headers:{},status:0,data:{},statusText:""},d=[],p=n.session,h;return new Promise((_,m)=>{try{h=p.request(s).on("response",f=>{Object.assign(c,{headers:f,status:f[g1]});let l=h;if(f[f1]==="gzip"&&(l=h.pipe(i1.createGunzip())),e.responseType==="stream"){c.data=l,_(c);return}l.on("data",g=>{d.push(g)}).on("error",g=>{m(g)}).on("end",()=>{let g=Buffer.concat(d),v=g;if(g){if(e.responseType==="json")try{v=JSON.parse(g.toString("utf8"))}catch{v=g.toString("utf8")}else e.responseType==="text"?v=g.toString("utf8"):e.responseType==="arraybuffer"&&(v=g.buffer);c.data=v}if(!e.validateStatus(c.status)){let b=`Request failed with status code ${c.status}. `;if(c.data&&typeof c.data=="object"){let E=l1.inspect(c.data,{depth:5});b=`${b}
|
|
59
|
-
'${E}`}m(new Error(b,{cause:c}))}_(c)})}).on("error",f=>{m(f)})}catch(f){Pm(r).then(()=>m(f)).catch(m);return}if(c.request=h,t.data){if(t.data instanceof
|
|
60
|
-
`),this.push(v),L()}}),E=new Am,k=
|
|
58
|
+
`+e.prev}o(am,"indentedJoin");function Pc(t,e){var r=im(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=vn(t,i)?e(t[i],t):""}var s=typeof em=="function"?em(t):[],c;if(Pi){c={};for(var d=0;d<s.length;d++)c["$"+s[d]]=s[d]}for(var p in t)vn(t,p)&&(r&&String(Number(p))===p&&p<t.length||Pi&&c["$"+p]instanceof Symbol||(xT.call(/[^\w$]/,p)?n.push(e(p,t)+": "+e(t[p],t)):n.push(p+": "+e(t[p],t))));if(typeof em=="function")for(var h=0;h<s.length;h++)AT.call(t,s[h])&&n.push("["+e(s[h])+"]: "+e(t[s[h]],t));return n}o(Pc,"arrObjKeys")});var NT=D((r7,DT)=>{"use strict";var oU=Va(),iU=Nn(),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"),aU=o(function(t,e){if(t){var r=xc(t,e);return r&&r.value}},"listGet"),sU=o(function(t,e,r){var n=xc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),uU=o(function(t,e){return t?!!xc(t,e):!1},"listHas"),cU=o(function(t,e){if(t)return xc(t,e,!0)},"listDelete");DT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new iU("Side channel does not contain "+oU(n))},"assert"),delete:o(function(n){var i=cU(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return aU(e,n)},"get"),has:o(function(n){return uU(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),sU(e,n,i)},"set")};return r},"getSideChannelList")});var lm=D((o7,MT)=>{"use strict";var zT=ia(),UT=vd(),lU=UT([zT("%String.prototype.indexOf%")]);MT.exports=o(function(e,r){var n=zT(e,!!r);return typeof n=="function"&&lU(e,".prototype.")>-1?UT([n]):n},"callBoundIntrinsic")});var dm=D((a7,LT)=>{"use strict";var dU=ia(),Ga=lm(),pU=Va(),fU=Nn(),jT=dU("%Map%",!0),mU=Ga("Map.prototype.get",!0),hU=Ga("Map.prototype.set",!0),gU=Ga("Map.prototype.has",!0),yU=Ga("Map.prototype.delete",!0),vU=Ga("Map.prototype.size",!0);LT.exports=!!jT&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new fU("Side channel does not contain "+pU(n))},"assert"),delete:o(function(n){if(e){var i=yU(e,n);return vU(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return mU(e,n)},"get"),has:o(function(n){return e?gU(e,n):!1},"has"),set:o(function(n,i){e||(e=new jT),hU(e,n,i)},"set")};return r},"getSideChannelMap")});var qT=D((u7,FT)=>{"use strict";var _U=ia(),Ic=lm(),bU=Va(),Ac=dm(),EU=Nn(),Ti=_U("%WeakMap%",!0),SU=Ic("WeakMap.prototype.get",!0),PU=Ic("WeakMap.prototype.set",!0),TU=Ic("WeakMap.prototype.has",!0),wU=Ic("WeakMap.prototype.delete",!0);FT.exports=Ti?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new EU("Side channel does not contain "+bU(i))},"assert"),delete:o(function(i){if(Ti&&i&&(typeof i=="object"||typeof i=="function")){if(e)return wU(e,i)}else if(Ac&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return Ti&&i&&(typeof i=="object"||typeof i=="function")&&e?SU(e,i):r&&r.get(i)},"get"),has:o(function(i){return Ti&&i&&(typeof i=="object"||typeof i=="function")&&e?TU(e,i):!!r&&r.has(i)},"has"),set:o(function(i,s){Ti&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Ti),PU(e,i,s)):Ac&&(r||(r=Ac()),r.set(i,s))},"set")};return n},"getSideChannelWeakMap"):Ac});var pm=D((l7,BT)=>{"use strict";var xU=Nn(),AU=Va(),IU=NT(),RU=dm(),CU=qT(),OU=CU||RU||IU;BT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new xU("Side channel does not contain "+AU(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=OU()),e.set(n,i)},"set")};return r},"getSideChannel")});var Rc=D((p7,VT)=>{"use strict";var $U=String.prototype.replace,kU=/%20/g,fm={RFC1738:"RFC1738",RFC3986:"RFC3986"};VT.exports={default:fm.RFC3986,formatters:{RFC1738:o(function(t){return $U.call(t,kU,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:fm.RFC1738,RFC3986:fm.RFC3986}});var ym=D((m7,GT)=>{"use strict";var DU=Rc(),NU=pm(),mm=Object.prototype.hasOwnProperty,bo=Array.isArray,Cc=NU(),wi=o(function(e,r){return Cc.set(e,r),e},"markOverflow"),Eo=o(function(e){return Cc.has(e)},"isOverflow"),Ha=o(function(e){return Cc.get(e)},"getMaxIndex"),gm=o(function(e,r){Cc.set(e,r)},"setMaxIndex"),Kr=function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t}(),zU=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(bo(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&(i[i.length]=n[s]);r.obj[r.prop]=i}}},"compactQueue"),Wa=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"),UU=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(bo(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return wi(Wa(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(Eo(e)){var s=Ha(e)+1;e[s]=r,gm(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!mm.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(Eo(r)){for(var c=Object.keys(r),d=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},p=0;p<c.length;p++){var h=parseInt(c[p],10);d[h+1]=r[c[p]]}return wi(d,Ha(r)+1)}var _=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&_.length>n.arrayLimit?wi(Wa(_,n),_.length-1):_}var m=e;return bo(e)&&!bo(r)&&(m=Wa(e,n)),bo(e)&&bo(r)?(r.forEach(function(f,l){if(mm.call(e,l)){var g=e[l];g&&typeof g=="object"&&f&&typeof f=="object"?e[l]=t(g,f,n):e[e.length]=f}else e[l]=f}),e):Object.keys(r).reduce(function(f,l){var g=r[l];if(mm.call(f,l)?f[l]=t(f[l],g,n):f[l]=g,Eo(r)&&!Eo(f)&&wi(f,Ha(r)),Eo(f)){var v=parseInt(l,10);String(v)===l&&v>=0&&v>Ha(f)&&gm(f,v)}return f},m)},"merge"),MU=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),jU=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"),hm=1024,LU=o(function(e,r,n,i,s){if(e.length===0)return e;var c=e;if(typeof e=="symbol"?c=Symbol.prototype.toString.call(e):typeof e!="string"&&(c=String(e)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var d="",p=0;p<c.length;p+=hm){for(var h=c.length>=hm?c.slice(p,p+hm):c,_=[],m=0;m<h.length;++m){var f=h.charCodeAt(m);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||s===DU.RFC1738&&(f===40||f===41)){_[_.length]=h.charAt(m);continue}if(f<128){_[_.length]=Kr[f];continue}if(f<2048){_[_.length]=Kr[192|f>>6]+Kr[128|f&63];continue}if(f<55296||f>=57344){_[_.length]=Kr[224|f>>12]+Kr[128|f>>6&63]+Kr[128|f&63];continue}m+=1,f=65536+((f&1023)<<10|h.charCodeAt(m)&1023),_[_.length]=Kr[240|f>>18]+Kr[128|f>>12&63]+Kr[128|f>>6&63]+Kr[128|f&63]}d+=_.join("")}return d},"encode"),FU=o(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],c=s.obj[s.prop],d=Object.keys(c),p=0;p<d.length;++p){var h=d[p],_=c[h];typeof _=="object"&&_!==null&&n.indexOf(_)===-1&&(r[r.length]={obj:c,prop:h},n[n.length]=_)}return zU(r),e},"compact"),qU=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),BU=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),VU=o(function(e,r,n,i){if(Eo(e)){var s=Ha(e)+1;return e[s]=r,gm(e,s),e}var c=[].concat(e,r);return c.length>n?wi(Wa(c,{plainObjects:i}),c.length-1):c},"combine"),GU=o(function(e,r){if(bo(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");GT.exports={arrayToObject:Wa,assign:MU,combine:VU,compact:FU,decode:jU,encode:LU,isBuffer:BU,isOverflow:Eo,isRegExp:qU,markOverflow:wi,maybeMap:GU,merge:UU}});var YT=D((g7,JT)=>{"use strict";var WT=pm(),Oc=ym(),Za=Rc(),HU=Object.prototype.hasOwnProperty,ZT={brackets:o(function(e){return e+"[]"},"brackets"),comma:"comma",indices:o(function(e,r){return e+"["+r+"]"},"indices"),repeat:o(function(e){return e},"repeat")},Jr=Array.isArray,WU=Array.prototype.push,KT=o(function(t,e){WU.apply(t,Jr(e)?e:[e])},"pushToArray"),ZU=Date.prototype.toISOString,HT=Za.default,bt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Oc.encode,encodeValuesOnly:!1,filter:void 0,format:HT,formatter:Za.formatters[HT],indices:!1,serializeDate:o(function(e){return ZU.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},KU=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),vm={},JU=o(function t(e,r,n,i,s,c,d,p,h,_,m,f,l,g,v,b,E,k){for(var L=e,J=k,W=0,G=!1;(J=J.get(vm))!==void 0&&!G;){var K=J.get(e);if(W+=1,typeof K<"u"){if(K===W)throw new RangeError("Cyclic object value");G=!0}typeof J.get(vm)>"u"&&(W=0)}if(typeof _=="function"?L=_(r,L):L instanceof Date?L=l(L):n==="comma"&&Jr(L)&&(L=Oc.maybeMap(L,function(Ve){return Ve instanceof Date?l(Ve):Ve})),L===null){if(c)return h&&!b?h(r,bt.encoder,E,"key",g):r;L=""}if(KU(L)||Oc.isBuffer(L)){if(h){var te=b?r:h(r,bt.encoder,E,"key",g);return[v(te)+"="+v(h(L,bt.encoder,E,"value",g))]}return[v(r)+"="+v(String(L))]}var X=[];if(typeof L>"u")return X;var Te;if(n==="comma"&&Jr(L))b&&h&&(L=Oc.maybeMap(L,h)),Te=[{value:L.length>0?L.join(",")||null:void 0}];else if(Jr(_))Te=_;else{var re=Object.keys(L);Te=m?re.sort(m):re}var B=p?String(r).replace(/\./g,"%2E"):String(r),q=i&&Jr(L)&&L.length===1?B+"[]":B;if(s&&Jr(L)&&L.length===0)return q+"[]";for(var Y=0;Y<Te.length;++Y){var Z=Te[Y],oe=typeof Z=="object"&&Z&&typeof Z.value<"u"?Z.value:L[Z];if(!(d&&oe===null)){var ae=f&&p?String(Z).replace(/\./g,"%2E"):String(Z),Ie=Jr(L)?typeof n=="function"?n(q,ae):q:q+(f?"."+ae:"["+ae+"]");k.set(e,W);var $e=WT();$e.set(vm,k),KT(X,t(oe,Ie,n,i,s,c,d,p,n==="comma"&&b&&Jr(L)?null:h,_,m,f,l,g,v,b,E,$e))}}return X},"stringify"),YU=o(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(!HU.call(Za.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Za.formatters[n],s=bt.filter;(typeof e.filter=="function"||Jr(e.filter))&&(s=e.filter);var c;if(e.arrayFormat in ZT?c=e.arrayFormat:"indices"in e?c=e.indices?"indices":"repeat":c=bt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var d=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:bt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:bt.addQueryPrefix,allowDots:d,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:bt.allowEmptyArrays,arrayFormat:c,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:i,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");JT.exports=function(t,e){var r=t,n=YU(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Jr(n.filter)&&(s=n.filter,i=s);var c=[];if(typeof r!="object"||r===null)return"";var d=ZT[n.arrayFormat],p=d==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var h=WT(),_=0;_<i.length;++_){var m=i[_],f=r[m];n.skipNulls&&f===null||KT(c,JU(f,m,d,p,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,h))}var l=c.join(n.delimiter),g=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),l.length>0?g+l:""}});var ew=D((v7,QT)=>{"use strict";var Yr=ym(),$c=Object.prototype.hasOwnProperty,_m=Array.isArray,at={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Yr.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},XU=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),XT=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"),QU="utf8=%26%2310003%3B",e1="utf8=%E2%9C%93",t1=o(function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,c=i.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&c.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var d=-1,p,h=r.charset;if(r.charsetSentinel)for(p=0;p<c.length;++p)c[p].indexOf("utf8=")===0&&(c[p]===e1?h="utf-8":c[p]===QU&&(h="iso-8859-1"),d=p,p=c.length);for(p=0;p<c.length;++p)if(p!==d){var _=c[p],m=_.indexOf("]="),f=m===-1?_.indexOf("="):m+1,l,g;if(f===-1?(l=r.decoder(_,at.decoder,h,"key"),g=r.strictNullHandling?null:""):(l=r.decoder(_.slice(0,f),at.decoder,h,"key"),l!==null&&(g=Yr.maybeMap(XT(_.slice(f+1),r,_m(n[l])?n[l].length:0),function(b){return r.decoder(b,at.decoder,h,"value")}))),g&&r.interpretNumericEntities&&h==="iso-8859-1"&&(g=XU(String(g))),_.indexOf("[]=")>-1&&(g=_m(g)?[g]:g),r.comma&&_m(g)&&g.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");g=Yr.combine([],g,r.arrayLimit,r.plainObjects)}if(l!==null){var v=$c.call(n,l);v&&(r.duplicates==="combine"||_.indexOf("[]=")>-1)?n[l]=Yr.combine(n[l],g,r.arrayLimit,r.plainObjects):(!v||r.duplicates==="last")&&(n[l]=g)}}return n},"parseQueryStringValues"),r1=o(function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");i=Array.isArray(e)&&e[s]?e[s].length:0}for(var c=n?e:XT(e,r,i),d=t.length-1;d>=0;--d){var p,h=t[d];if(h==="[]"&&r.parseArrays)Yr.isOverflow(c)?p=c:p=r.allowEmptyArrays&&(c===""||r.strictNullHandling&&c===null)?[]:Yr.combine([],c,r.arrayLimit,r.plainObjects);else{p=r.plainObjects?{__proto__:null}:{};var _=h.charAt(0)==="["&&h.charAt(h.length-1)==="]"?h.slice(1,-1):h,m=r.decodeDotInKeys?_.replace(/%2E/g,"."):_,f=parseInt(m,10),l=!isNaN(f)&&h!==m&&String(f)===m&&f>=0&&r.parseArrays;if(!r.parseArrays&&m==="")p={0:c};else if(l&&f<r.arrayLimit)p=[],p[f]=c;else{if(l&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");l?(p[f]=c,Yr.markOverflow(p,f)):m!=="__proto__"&&(p[m]=c)}}c=p}return c},"parseObject"),n1=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&$c.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=i.exec(n),d=c?n.slice(0,c.index):n,p=[];if(d){if(!r.plainObjects&&$c.call(Object.prototype,d)&&!r.allowPrototypes)return;p[p.length]=d}for(var h=0;(c=s.exec(n))!==null&&h<r.depth;){h+=1;var _=c[1].slice(1,-1);if(!r.plainObjects&&$c.call(Object.prototype,_)&&!r.allowPrototypes)return;p[p.length]=c[1]}if(c){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");p[p.length]="["+n.slice(c.index)+"]"}return p},"splitKeyIntoSegments"),o1=o(function(e,r,n,i){if(e){var s=n1(e,n);if(s)return r1(s,r,n,i)}},"parseQueryStringKeys"),i1=o(function(e){if(!e)return at;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"?at.charset:e.charset,n=typeof e.duplicates>"u"?at.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:at.allowDots:!!e.allowDots;return{allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:at.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:at.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:at.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:at.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:at.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:at.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:at.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:at.decoder,delimiter:typeof e.delimiter=="string"||Yr.isRegExp(e.delimiter)?e.delimiter:at.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:at.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:at.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:at.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:at.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:at.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:at.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:at.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");QT.exports=function(t,e){var r=i1(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?t1(t,r):t,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),c=0;c<s.length;++c){var d=s[c],p=o1(d,n[d],r,typeof t=="string");i=Yr.merge(i,p,r)}return r.allowSparse===!0?i:Yr.compact(i)}});var bm=D((b7,tw)=>{"use strict";var a1=YT(),s1=ew(),u1=Rc();tw.exports={formats:u1,parse:s1,stringify:a1}});var nw=D((Em,rw)=>{(function(t,e){typeof Em=="object"?rw.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(Em,function(){function t(){}return o(t,"UrlTemplate"),t.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(r){return/%[0-9A-Fa-f]/.test(r)||(r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")),r}).join("")},t.prototype.encodeUnreserved=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})},t.prototype.encodeValue=function(e,r,n){return r=e==="+"||e==="#"?this.encodeReserved(r):this.encodeUnreserved(r),n?this.encodeUnreserved(n)+"="+r:r},t.prototype.isDefined=function(e){return e!=null},t.prototype.isKeyOperator=function(e){return e===";"||e==="&"||e==="?"},t.prototype.getValues=function(e,r,n,i){var s=e[n],c=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),i&&i!=="*"&&(s=s.substring(0,parseInt(i,10))),c.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(i==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(p){c.push(this.encodeValue(r,p,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(p){this.isDefined(s[p])&&c.push(this.encodeValue(r,s[p],p))},this);else{var d=[];Array.isArray(s)?s.filter(this.isDefined).forEach(function(p){d.push(this.encodeValue(r,p))},this):Object.keys(s).forEach(function(p){this.isDefined(s[p])&&(d.push(this.encodeUnreserved(p)),d.push(this.encodeValue(r,s[p].toString())))},this),this.isKeyOperator(r)?c.push(this.encodeUnreserved(n)+"="+d.join(",")):d.length!==0&&c.push(d.join(","))}else r===";"?this.isDefined(s)&&c.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?c.push(this.encodeUnreserved(n)+"="):s===""&&c.push("");return c},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:o(function(i){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,c,d){if(c){var p=null,h=[];if(n.indexOf(c.charAt(0))!==-1&&(p=c.charAt(0),c=c.substr(1)),c.split(/,/g).forEach(function(m){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(m);h.push.apply(h,r.getValues(i,p,f[1],f[2]||f[3]))}),p&&p!=="+"){var _=",";return p==="?"?_="&":p!=="#"&&(_=p),(h.length!==0?p:"")+h.join(_)}else return h.join(",")}else return r.encodeReserved(d)})},"expand")}},new t})});var ow=D(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.isBrowser=c1;function c1(){return typeof window<"u"}o(c1,"isBrowser")});var Dc=D(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.headersToClassicHeaders=iw;kc.marshallGaxiosResponse=l1;function iw(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(iw,"headersToClassicHeaders");function l1(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:iw(t?.headers)}})}o(l1,"marshallGaxiosResponse")});var uw=D(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.sessions=void 0;ir.request=P1;ir.closeSession=Pm;var sw=require("http2"),d1=require("zlib"),p1=require("url"),f1=bm(),m1=sa(),h1=require("stream"),g1=require("util"),y1=require("process"),v1=Dc(),{HTTP2_HEADER_CONTENT_ENCODING:_1,HTTP2_HEADER_CONTENT_TYPE:aw,HTTP2_HEADER_METHOD:b1,HTTP2_HEADER_PATH:E1,HTTP2_HEADER_STATUS:S1}=sw.constants,Ka=!!y1.env.HTTP2_DEBUG;ir.sessions={};async function P1(t){let e=m1(!0,{},t);e.validateStatus=e.validateStatus||T1,e.responseType=e.responseType||"json";let r=new p1.URL(e.url),n=w1(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let m=(t.paramsSerializer||f1.stringify)(e.params);i+=`?${m}`}let s=(0,v1.headersToClassicHeaders)(e.headers);s[E1]=i,s[b1]=t.method||"GET",e.headers=s,s[aw]||e.responseType!=="text"&&(s[aw]="application/json");let c={config:t,headers:{},status:0,data:{},statusText:""},d=[],p=n.session,h;return new Promise((_,m)=>{try{h=p.request(s).on("response",f=>{Object.assign(c,{headers:f,status:f[S1]});let l=h;if(f[_1]==="gzip"&&(l=h.pipe(d1.createGunzip())),e.responseType==="stream"){c.data=l,_(c);return}l.on("data",g=>{d.push(g)}).on("error",g=>{m(g)}).on("end",()=>{let g=Buffer.concat(d),v=g;if(g){if(e.responseType==="json")try{v=JSON.parse(g.toString("utf8"))}catch{v=g.toString("utf8")}else e.responseType==="text"?v=g.toString("utf8"):e.responseType==="arraybuffer"&&(v=g.buffer);c.data=v}if(!e.validateStatus(c.status)){let b=`Request failed with status code ${c.status}. `;if(c.data&&typeof c.data=="object"){let E=g1.inspect(c.data,{depth:5});b=`${b}
|
|
59
|
+
'${E}`}m(new Error(b,{cause:c}))}_(c)})}).on("error",f=>{m(f)})}catch(f){Pm(r).then(()=>m(f)).catch(m);return}if(c.request=h,t.data){if(t.data instanceof h1.Stream)t.data.pipe(h);else if(typeof t.data=="string"){let f=Buffer.from(t.data);h.end(f)}else if(typeof t.data=="object"){let f=JSON.stringify(t.data);h.end(f)}}n.timeoutHandle=setTimeout(()=>Pm(r),500)})}o(P1,"request");function T1(t){return t>=200&&t<300}o(T1,"validateStatus");function w1(t){if(ir.sessions[t])Ka&&console.log(`Used cached client for ${t}`);else{Ka&&console.log(`Creating client for ${t}`);let e=sw.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete ir.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete ir.sessions[t]}),ir.sessions[t]={session:e}}return ir.sessions[t]}o(w1,"_getClient");async function Pm(t){let e=ir.sessions[t.host];if(!e)return;let{session:r}=e;delete ir.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)}o(Pm,"closeSession")});var cw=D((I7,x1)=>{x1.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 Nc=D(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.createAPIRequest=O1;var Tm=ft(),A1=bm(),mw=require("stream"),lw=nw(),dw=sa(),xm=ow(),I1=uw(),wm=Dc(),hw=cw(),pw=o(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function R1(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}o(R1,"isReadableStream");function C1(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}o(C1,"getMissingParams");function O1(t,e){if(e)fw(t).then(r=>e(null,r),e);else return fw(t)}o(O1,"createAPIRequest");async function fw(t){let e=dw(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=dw(!0,{},e.params,t.params);e.userAgentDirectives=e.userAgentDirectives||[];let n=r.media||{},i=r.requestBody;!r.requestBody&&r.resource&&(!t.requiredParams.includes("resource")||typeof r.resource!="string")&&(i=r.resource,delete r.resource),delete r.requestBody;let s=r.auth||e.auth,c=typeof n.body=="string"?"text/plain":"application/octet-stream";delete r.media,delete r.auth;let d=(0,wm.headersToClassicHeaders)(r.headers||{});$1(d,e.apiVersion),delete r.headers,Object.keys(r).forEach(l=>{if(l.slice(-1)==="_"){let g=l.slice(0,-1);r[g]=r[l],delete r[l]}});let p=C1(r,t.requiredParams);if(p)throw new Error("Missing required parameters: "+p.join(", "));if(e.url){let l=e.url;typeof l=="object"&&(l=l.toString()),e.url=lw.parse(l).expand(r)}if(t.mediaUrl&&(t.mediaUrl=lw.parse(t.mediaUrl).expand(r)),t.context._options.rootUrl!==void 0&&e.url!==void 0){let l=new URL(e.url),g=l.href.substr(l.origin.length);e.url=new URL(g,t.context._options.rootUrl).href}e.paramsSerializer=l=>A1.stringify(l,{arrayFormat:"repeat"}),t.pathParams.forEach(l=>delete r[l]),typeof s=="string"&&(r.key=r.key||s,s=void 0);function h(l){let g=pw(),v=`--${g}--`,b=new mw.PassThrough({flush(L){this.push(`\r
|
|
60
|
+
`),this.push(v),L()}}),E=new Am,k=R1(l[1].body);d["content-type"]=`multipart/related; boundary=${g}`;for(let L of l){let J=`--${g}\r
|
|
61
61
|
content-type: ${L["content-type"]}\r
|
|
62
62
|
\r
|
|
63
63
|
`;b.push(J),typeof L.body=="string"?(b.push(L.body),b.push(`\r
|
|
64
|
-
`)):(E.on("progress",W=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:W})}),L.body.pipe(E).pipe(b))}k||(b.push(v),b.push(null)),e.data=b}o(h,"multipartUpload");function _(l){let g=
|
|
64
|
+
`)):(E.on("progress",W=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:W})}),L.body.pipe(E).pipe(b))}k||(b.push(v),b.push(null)),e.data=b}o(h,"multipartUpload");function _(l){let g=pw(),v=`--${g}--`;d["content-type"]=`multipart/related; boundary=${g}`;let b="";for(let E of l){let k=`--${g}\r
|
|
65
65
|
content-type: ${E["content-type"]}\r
|
|
66
66
|
\r
|
|
67
67
|
`;b+=k,typeof E.body=="string"&&(b+=E.body,b+=`\r
|
|
68
|
-
`)}b+=v,e.data=b}if(o(_,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,i){r.uploadType="multipart";let l=[{"content-type":"application/json",body:JSON.stringify(i)},{"content-type":n.mimeType||i&&i.mimeType||c,body:n.body}];(0,xm.isBrowser)()?_(l):h(l)}else r.uploadType="media",Object.assign(d,{"content-type":n.mimeType||c}),e.data=n.body;else e.data=i||void 0;if(e.headers=Tm.Gaxios.mergeHeaders(e.headers||{},d),e.params=r,!(0,xm.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:pw.version,comment:"gzip"});let l=e.userAgentDirectives.map(g=>{let v=`${g.product}/${g.version}`;return g.comment&&(v+=` (${g.comment})`),v}).join(" ");e.headers.set("User-Agent",l)}if(e.validateStatus||(e.validateStatus=l=>l>=200&&l<300||l===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 m=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,f=e.universeDomain??e.universe_domain??m??"googleapis.com";if(f!=="googleapis.com"&&e.url){let l=new URL(e.url);l.hostname.endsWith(".googleapis.com")&&(l.hostname=l.hostname.replace(/googleapis\.com$/,f),e.url=l.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let l=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(l&&f!==l)throw new Error(`The configured universe domain (${f}) does not match the universe domain found in the credentials (${l}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let g=await s.getRequestHeaders(e.url),v=Object.assign({},e);return v.headers=Tm.Gaxios.mergeHeaders(v.headers,g),S1.request(v)}else{let g=await s.request(e);return(0,wm.marshallGaxiosResponse)(g)}}else return new Tm.Gaxios().request(e).then(l=>(0,wm.marshallGaxiosResponse)(l))}o(lw,"createAPIRequestAsync");var Am=class extends dw.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 x1(t,e){(0,xm.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${pw.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o(x1,"populateAPIHeader")});var fw=D(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.AuthPlus=void 0;var _n=Ma(),Rm=class extends _n.GoogleAuth{static{o(this,"AuthPlus")}JWT=_n.JWT;Compute=_n.Compute;OAuth2=_n.OAuth2Client;GoogleAuth=_n.GoogleAuth;AwsClient=_n.AwsClient;IdentityPoolClient=_n.IdentityPoolClient;ExternalAccountClient=_n.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new _n.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()}};Uc.AuthPlus=Rm});var Om=D(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.Endpoint=void 0;var mw=zc(),Cm=class{static{o(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,i){if(this.applyMethodsFromSchema(e,r,n,i),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let c=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,c,i)}}}applyMethodsFromSchema(e,r,n,i){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let c=n.methods[s];e[s]=this.makeMethod(r,c,i)}}}makeMethod(e,r,n){return(i,s)=>{let c=typeof i=="function"?{}:i;s=typeof i=="function"?i:s;let d=hw(e.rootUrl+e.servicePath+r.path),p={options:{url:d.substring(1,d.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:c,requiredParams:r.parameterOrder||[],pathParams:this.getPathParams(r.parameters),context:n};if(r.mediaUpload&&r.mediaUpload.protocols&&r.mediaUpload.protocols.simple&&r.mediaUpload.protocols.simple.path){let h=hw(e.rootUrl+r.mediaUpload.protocols.simple.path);p.mediaUrl=h.substring(1,h.length-1)}if(!s)return(0,mw.createAPIRequest)(p);(0,mw.createAPIRequest)(p,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}};Mc.Endpoint=Cm;function hw(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(hw,"buildurl")});var yw=D(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.Discovery=void 0;var A1=require("fs"),I1=ft(),R1=require("url"),gw=require("util"),C1=zc(),O1=Om(),$1=gw.promisify(A1.readFile),$m=class{static{o(this,"Discovery")}transporter=new I1.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new O1.Endpoint(r);return n.applySchema(n,e,e,n),n}}log(...e){this.options&&this.options.debug&&console.log(...e)}async discoverAllAPIs(e){let r=new Headers(this.options.includePrivate?{}:{"X-User-Ip":"0.0.0.0"}),i=(await this.transporter.request({url:e,headers:r})).data.items,s=await Promise.all(i.map(async p=>{let h=await this.discoverAPI(p.discoveryRestUrl);return{api:p,endpointCreator:h}})),c={},d={};for(let p of s)d[p.api.name]||(c[p.api.name]={},d[p.api.name]=h=>{let _=typeof h,m;if(_==="string")m=h,h={};else if(_==="object")m=h.version,delete h.version;else throw new Error("Argument error: Accepts only string or object");try{let f=p.endpointCreator(h,this);return Object.freeze(f)}catch(f){throw new Error(gw.format('Unable to load endpoint %s("%s"): %s',p.api.name,m,f.message))}}),c[p.api.name][p.api.version]=p.endpointCreator;return d}async discoverAPI(e){if(typeof e=="string"){let r=R1.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await $1(e,{encoding:"utf8"});return this.makeEndpoint(JSON.parse(n))}else{this.log("Requesting "+e);let n=await this.transporter.request({url:e});return this.makeEndpoint(n.data)}}else{let r=e;this.log("Requesting "+r.url);let n=r.url;delete r.url;let i={options:{url:n,method:"GET"},requiredParams:[],pathParams:[],params:r,context:{google:{_options:{}},_options:{}}},s=await(0,C1.createAPIRequest)(i);return this.makeEndpoint(s.data)}}};jc.Discovery=$m});var Lc=D(Ae=>{"use strict";var k1=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]}),D1=Ae&&Ae.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&k1(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=Ma();Ae.gaxios=ft();var bn=Ma();Object.defineProperty(Ae,"OAuth2Client",{enumerable:!0,get:o(function(){return bn.OAuth2Client},"get")});Object.defineProperty(Ae,"JWT",{enumerable:!0,get:o(function(){return bn.JWT},"get")});Object.defineProperty(Ae,"Compute",{enumerable:!0,get:o(function(){return bn.Compute},"get")});Object.defineProperty(Ae,"UserRefreshClient",{enumerable:!0,get:o(function(){return bn.UserRefreshClient},"get")});Object.defineProperty(Ae,"GoogleAuth",{enumerable:!0,get:o(function(){return bn.GoogleAuth},"get")});Object.defineProperty(Ae,"ExternalAccountClient",{enumerable:!0,get:o(function(){return bn.ExternalAccountClient},"get")});Object.defineProperty(Ae,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return bn.BaseExternalAccountClient},"get")});Object.defineProperty(Ae,"IdentityPoolClient",{enumerable:!0,get:o(function(){return bn.IdentityPoolClient},"get")});Object.defineProperty(Ae,"AwsClient",{enumerable:!0,get:o(function(){return bn.AwsClient},"get")});var vw=ft();Object.defineProperty(Ae,"Gaxios",{enumerable:!0,get:o(function(){return vw.Gaxios},"get")});Object.defineProperty(Ae,"GaxiosError",{enumerable:!0,get:o(function(){return vw.GaxiosError},"get")});var N1=uT();Object.defineProperty(Ae,"getAPI",{enumerable:!0,get:o(function(){return N1.getAPI},"get")});var z1=zc();Object.defineProperty(Ae,"createAPIRequest",{enumerable:!0,get:o(function(){return z1.createAPIRequest},"get")});var U1=fw();Object.defineProperty(Ae,"AuthPlus",{enumerable:!0,get:o(function(){return U1.AuthPlus},"get")});var M1=yw();Object.defineProperty(Ae,"Discovery",{enumerable:!0,get:o(function(){return M1.Discovery},"get")});var j1=Om();Object.defineProperty(Ae,"Endpoint",{enumerable:!0,get:o(function(){return j1.Endpoint},"get")});D1(Nc(),Ae)});var bw=D(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.calendar_v3=void 0;var ne=Lc(),_w;(function(t){class e{static{o(this,"Calendar")}context;acl;calendarList;calendars;channels;colors;events;freebusy;settings;constructor(m,f){this.context={_options:m||{},google:f},this.acl=new r(this.context),this.calendarList=new n(this.context),this.calendars=new i(this.context),this.channels=new s(this.context),this.colors=new c(this.context),this.events=new d(this.context),this.freebusy=new p(this.context),this.settings=new h(this.context)}}t.Calendar=e;class r{static{o(this,"Resource$Acl")}context;constructor(m){this.context=m}delete(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}get(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}insert(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}list(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}patch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}update(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}watch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Acl=r;class n{static{o(this,"Resource$Calendarlist")}context;constructor(m){this.context=m}delete(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}get(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}insert(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}list(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}patch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}update(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}watch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Calendarlist=n;class i{static{o(this,"Resource$Calendars")}context;constructor(m){this.context=m}clear(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/clear").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}delete(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}get(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}insert(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}patch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}update(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Calendars=i;class s{static{o(this,"Resource$Channels")}context;constructor(m){this.context=m}stop(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Channels=s;class c{static{o(this,"Resource$Colors")}context;constructor(m){this.context=m}get(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/colors").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Colors=c;class d{static{o(this,"Resource$Events")}context;constructor(m){this.context=m}delete(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}get(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}import(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/import").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}insert(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}instances(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/{eventId}/instances").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}list(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}move(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/{eventId}/move").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId","destination"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}patch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}quickAdd(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/quickAdd").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId","text"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}update(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}watch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Events=d;class p{static{o(this,"Resource$Freebusy")}context;constructor(m){this.context=m}query(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/freeBusy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Freebusy=p;class h{static{o(this,"Resource$Settings")}context;constructor(m){this.context=m}get(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/settings/{setting}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["setting"],pathParams:["setting"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}list(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/settings").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}watch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/settings/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Settings=h})(_w||(Fc.calendar_v3=_w={}))});var Ja=D(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.AuthPlus=_r.calendar_v3=_r.auth=_r.VERSIONS=void 0;_r.calendar=L1;var Ew=Lc(),Sw=bw();Object.defineProperty(_r,"calendar_v3",{enumerable:!0,get:o(function(){return Sw.calendar_v3},"get")});_r.VERSIONS={v3:Sw.calendar_v3.Calendar};function L1(t){return(0,Ew.getAPI)("calendar",t,_r.VERSIONS,this)}o(L1,"calendar");var F1=new Ew.AuthPlus;_r.auth=F1;var q1=Lc();Object.defineProperty(_r,"AuthPlus",{enumerable:!0,get:o(function(){return q1.AuthPlus},"get")})});var G1={};ws(G1,{createGoogleClient:()=>vr,getAccessToken:()=>Le,googleCalendar:()=>V1,googleCalendarAuth:()=>Oe});module.exports=DA(G1);var NA=Object.freeze({status:"aborted"});function le(t,e,r){function n(d,p){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:p,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(t))return;d._zod.traits.add(t),e(d,p);let h=c.prototype,_=Object.keys(h);for(let m=0;m<_.length;m++){let f=_[m];f in d||(d[f]=h[f].bind(d))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(d){var p;let h=r?.Parent?new s:this;n(h,d),(p=h._zod).deferred??(p.deferred=[]);for(let _ of h._zod.deferred)_();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}o(le,"$constructor");var zA=Symbol("zod_brand"),Nr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},xs=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Sl={};function an(t){return t&&Object.assign(Sl,t),Sl}o(an,"config");function Tl(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(Tl,"getEnumValues");function qh(t,e){return typeof e=="bigint"?e.toString():e}o(qh,"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")}}}o(Is,"cached");function Bh(t){return t==null}o(Bh,"nullish");function Rs(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(Rs,"cleanRegex");var Fh=Symbol("evaluating");function mt(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Fh)return n===void 0&&(n=Fh,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(mt,"defineLazy");var wl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Ni(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(Ni,"isObject");var UA=Is(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Vh(t){if(Ni(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Ni(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Vh,"isPlainObject");var Gh=new Set(["string","number","symbol"]);function zo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(zo,"escapeRegex");function Cs(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}o(Cs,"clone");function ut(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(ut,"normalizeParams");function Hh(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(Hh,"optionalKeys");var MA={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 Uo(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(Uo,"aborted");function Rn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(Rn,"prefixIssues");function As(t){return typeof t=="string"?t:t?.message}o(As,"unwrapMessage");function Cn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=As(t.inst?._zod.def?.error?.(t))??As(e?.error?.(t))??As(r.customError?.(t))??As(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(Cn,"finalizeIssue");function Wh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(Wh,"getLengthableOrigin");function xl(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o(xl,"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,qh,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),Kh=le("$ZodError",Zh),zi=le("$ZodError",Zh,{Parent:Error});var LA=o(t=>(e,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new Nr;if(c.issues.length){let d=new(i?.Err??t)(c.issues.map(p=>Cn(p,s,an())));throw wl(d,i?.callee),d}return c.value},"_parse"),Os=LA(zi),FA=o(t=>async(e,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??t)(c.issues.map(p=>Cn(p,s,an())));throw wl(d,i?.callee),d}return c.value},"_parseAsync"),$s=FA(zi),qA=o(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Nr;return s.issues.length?{success:!1,error:new(t??Kh)(s.issues.map(c=>Cn(c,i,an())))}:{success:!0,data:s.value}},"_safeParse"),Ui=qA(zi),BA=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>Cn(c,i,an())))}:{success:!0,data:s.value}},"_safeParseAsync"),Mi=BA(zi);var VA="(?:(?:\\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])))",GA=new RegExp(`^${VA}$`);var Jh=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),Yh=/^-?\d+n?$/;var Al=/^-?\d+(?:\.\d+)?$/,Xh=/^(?:true|false)$/i;var Mo=le("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])});var Qh=le("$ZodCheckMinLength",(t,e)=>{var r;Mo.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Bh(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let c=Wh(i);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var Il=le("$ZodCheckStringFormat",(t,e)=>{var r,n;Mo.init(t,e),t._zod.onattach.push(i=>{let s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),eg=le("$ZodCheckRegex",(t,e)=>{Il.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 rg={major:4,minor:3,patch:6};var ct=le("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=rg;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let s of i._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=o((c,d,p)=>{let h=Uo(c),_;for(let m of d){if(m._zod.def.when){if(!m._zod.def.when(c))continue}else if(h)continue;let f=c.issues.length,l=m._zod.check(c);if(l instanceof Promise&&p?.async===!1)throw new Nr;if(_||l instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await l,c.issues.length!==f&&(h||(h=Uo(c,f)))});else{if(c.issues.length===f)continue;h||(h=Uo(c,f))}}return _?_.then(()=>c):c},"runChecks"),s=o((c,d,p)=>{if(Uo(c))return c.aborted=!0,c;let h=i(d,n,p);if(h instanceof Promise){if(p.async===!1)throw new Nr;return h.then(_=>t._zod.parse(_,p))}return t._zod.parse(h,p)},"handleCanaryResult");t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){let h=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(_=>s(_,c,d)):s(h,c,d)}let p=t._zod.parse(c,d);if(p instanceof Promise){if(d.async===!1)throw new Nr;return p.then(h=>i(h,n,d))}return i(p,n,d)}}mt(t,"~standard",()=>({validate:o(i=>{try{let s=Ui(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Mi(t,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ns=le("$ZodString",(t,e)=>{ct.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Jh(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}}),Rl=le("$ZodStringFormat",(t,e)=>{Il.init(t,e),Ns.init(t,e)});var sg=le("$ZodURL",(t,e)=>{Rl.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 ug=le("$ZodNumber",(t,e)=>{ct.init(t,e),t._zod.pattern=t._zod.bag.pattern??Al,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}});var Cl=le("$ZodBoolean",(t,e)=>{ct.init(t,e),t._zod.pattern=Xh,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}}),cg=le("$ZodBigInt",(t,e)=>{ct.init(t,e),t._zod.pattern=Yh,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 lg=le("$ZodAny",(t,e)=>{ct.init(t,e),t._zod.parse=r=>r}),dg=le("$ZodUnknown",(t,e)=>{ct.init(t,e),t._zod.parse=r=>r});var pg=le("$ZodVoid",(t,e)=>{ct.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}}),fg=le("$ZodDate",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:t}),r}});function ng(t,e,r){t.issues.length&&e.issues.push(...Rn(r,t.issues)),e.value[r]=t.value}o(ng,"handleArrayResult");var mg=le("$ZodArray",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let s=[];for(let c=0;c<i.length;c++){let d=i[c],p=e.element._zod.run({value:d,issues:[]},n);p instanceof Promise?s.push(p.then(h=>ng(h,r,c))):ng(p,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Ds(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...Rn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(Ds,"handlePropertyResult");function HA(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=Hh(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(HA,"normalizeDef");function WA(t,e,r,n,i,s){let c=[],d=i.keySet,p=i.catchall._zod,h=p.def.type,_=p.optout==="optional";for(let m in e){if(d.has(m))continue;if(h==="never"){c.push(m);continue}let f=p.run({value:e[m],issues:[]},n);f instanceof Promise?t.push(f.then(l=>Ds(l,r,m,e,_))):Ds(f,r,m,e,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}o(WA,"handleCatchall");var hg=le("$ZodObject",(t,e)=>{if(ct.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let d=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let p={...d};return Object.defineProperty(e,"shape",{value:p}),p},"get")})}let n=Is(()=>HA(e));mt(t._zod,"propValues",()=>{let d=e.shape,p={};for(let h in d){let _=d[h]._zod;if(_.values){p[h]??(p[h]=new Set);for(let m of _.values)p[h].add(m)}}return p});let i=Ni,s=e.catchall,c;t._zod.parse=(d,p)=>{c??(c=n.value);let h=d.value;if(!i(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),d;d.value={};let _=[],m=c.shape;for(let f of c.keys){let l=m[f],g=l._zod.optout==="optional",v=l._zod.run({value:h[f],issues:[]},p);v instanceof Promise?_.push(v.then(b=>Ds(b,d,f,h,g))):Ds(v,d,f,h,g)}return s?WA(_,h,d,p,n.value,t):_.length?Promise.all(_).then(()=>d):d}});function og(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let i=t.filter(s=>!Uo(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>Cn(c,n,an())))}),e)}o(og,"handleUnionResults");var Ol=le("$ZodUnion",(t,e)=>{ct.init(t,e),mt(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),mt(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),mt(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),mt(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Rs(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,d=[];for(let p of e.options){let h=p._zod.run({value:i.value,issues:[]},s);if(h instanceof Promise)d.push(h),c=!0;else{if(h.issues.length===0)return h;d.push(h)}}return c?Promise.all(d).then(p=>og(p,i,t,s)):og(d,i,t,s)}});var gg=le("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Ol.init(t,e);let r=t._zod.parse;mt(t._zod,"propValues",()=>{let i={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[d,p]of Object.entries(c)){i[d]||(i[d]=new Set);for(let h of p)i[d].add(h)}}return i});let n=Is(()=>{let i=e.options,s=new Map;for(let c of i){let d=c._zod.propValues?.[e.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let p of d){if(s.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);s.set(p,c)}}return s});t._zod.parse=(i,s)=>{let c=i.value;if(!Ni(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),i;let d=n.value.get(c?.[e.discriminator]);return d?d._zod.run(i,s):e.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:c,path:[e.discriminator],inst:t}),i)}});var yg=le("$ZodRecord",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Vh(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let s=[],c=e.keyType._zod.values;if(c){r.value={};let d=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){d.add(typeof h=="number"?h.toString():h);let _=e.valueType._zod.run({value:i[h],issues:[]},n);_ instanceof Promise?s.push(_.then(m=>{m.issues.length&&r.issues.push(...Rn(h,m.issues)),r.value[h]=m.value})):(_.issues.length&&r.issues.push(...Rn(h,_.issues)),r.value[h]=_.value)}let p;for(let h in i)d.has(h)||(p=p??[],p.push(h));p&&p.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:p})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let p=e.keyType._zod.run({value:d,issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&Al.test(d)&&p.issues.length){let m=e.keyType._zod.run({value:Number(d),issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(p=m)}if(p.issues.length){e.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(m=>Cn(m,n,an())),input:d,path:[d],inst:t});continue}let _=e.valueType._zod.run({value:i[d],issues:[]},n);_ instanceof Promise?s.push(_.then(m=>{m.issues.length&&r.issues.push(...Rn(d,m.issues)),r.value[p.value]=m.value})):(_.issues.length&&r.issues.push(...Rn(d,_.issues)),r.value[p.value]=_.value)}}return s.length?Promise.all(s).then(()=>r):r}});var vg=le("$ZodEnum",(t,e)=>{ct.init(t,e);let r=Tl(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>Gh.has(typeof i)).map(i=>typeof i=="string"?zo(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:t}),i}}),_g=le("$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"?zo(n):n?zo(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var bg=le("$ZodTransform",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new xs(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new Nr;return r.value=i,r}});function ig(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(ig,"handleOptionalResult");var Eg=le("$ZodOptional",(t,e)=>{ct.init(t,e),t._zod.optin="optional",t._zod.optout="optional",mt(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),mt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Rs(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>ig(s,r.value)):ig(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var Sg=le("$ZodNullable",(t,e)=>{ct.init(t,e),mt(t._zod,"optin",()=>e.innerType._zod.optin),mt(t._zod,"optout",()=>e.innerType._zod.optout),mt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Rs(r.source)}|null)$`):void 0}),mt(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=le("$ZodPipe",(t,e)=>{ct.init(t,e),mt(t._zod,"values",()=>e.in._zod.values),mt(t._zod,"optin",()=>e.in._zod.optin),mt(t._zod,"optout",()=>e.out._zod.optout),mt(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(c=>ks(c,e.in,n)):ks(s,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>ks(s,e.out,n)):ks(i,e.out,n)}});function ks(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(ks,"handlePipeResult");var Tg=le("$ZodCustom",(t,e)=>{Mo.init(t,e),ct.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(s=>ag(s,r,n,t));ag(i,r,n,t)}});function ag(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(xl(i))}}o(ag,"handleRefineResult");var xg,YA=Symbol("ZodOutput"),XA=Symbol("ZodInput"),$l=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ag(){return new $l}o(Ag,"registry");(xg=globalThis).__zod_globalRegistry??(xg.__zod_globalRegistry=Ag());var kl=globalThis.__zod_globalRegistry;function Ig(t,e){return new t({type:"string",...ut(e)})}o(Ig,"_string");function Rg(t,e){return new t({type:"string",coerce:!0,...ut(e)})}o(Rg,"_coercedString");function Cg(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...ut(e)})}o(Cg,"_url");function Og(t,e){return new t({type:"number",checks:[],...ut(e)})}o(Og,"_number");function $g(t,e){return new t({type:"number",coerce:!0,checks:[],...ut(e)})}o($g,"_coercedNumber");function kg(t,e){return new t({type:"boolean",...ut(e)})}o(kg,"_boolean");function Dg(t,e){return new t({type:"boolean",coerce:!0,...ut(e)})}o(Dg,"_coercedBoolean");function Ng(t,e){return new t({type:"bigint",coerce:!0,...ut(e)})}o(Ng,"_coercedBigint");function zg(t){return new t({type:"any"})}o(zg,"_any");function Ug(t){return new t({type:"unknown"})}o(Ug,"_unknown");function Mg(t,e){return new t({type:"void",...ut(e)})}o(Mg,"_void");function jg(t,e){return new t({type:"date",coerce:!0,...ut(e)})}o(jg,"_coercedDate");function Pr(t,e){return new Qh({check:"min_length",...ut(e),minimum:t})}o(Pr,"_minLength");function On(t,e){return new eg({check:"string_format",format:"regex",...ut(e),pattern:t})}o(On,"_regex");function Lg(t,e,r){let n=ut(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(Lg,"_custom");var ht=le("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)=>Os(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Ui(t,r,n),t.parseAsync=async(r,n)=>$s(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Mi(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)=>Cs(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.apply=r=>r(t)}),Us=le("ZodMiniString",(t,e)=>{Ns.init(t,e),ht.init(t,e)});function P(t){return Ig(Us,t)}o(P,"string");var Fg=le("ZodMiniStringFormat",(t,e)=>{Rl.init(t,e),Us.init(t,e)});var uI=le("ZodMiniURL",(t,e)=>{sg.init(t,e),Fg.init(t,e)});function qg(t){return Cg(uI,t)}o(qg,"url");var Dl=le("ZodMiniNumber",(t,e)=>{ug.init(t,e),ht.init(t,e)});function $t(t){return Og(Dl,t)}o($t,"number");var Nl=le("ZodMiniBoolean",(t,e)=>{Cl.init(t,e),ht.init(t,e)});function Ke(t){return kg(Nl,t)}o(Ke,"boolean");var Bg=le("ZodMiniBigInt",(t,e)=>{cg.init(t,e),ht.init(t,e)});var cI=le("ZodMiniAny",(t,e)=>{lg.init(t,e),ht.init(t,e)});function Li(){return zg(cI)}o(Li,"any");var lI=le("ZodMiniUnknown",(t,e)=>{dg.init(t,e),ht.init(t,e)});function Ee(){return Ug(lI)}o(Ee,"unknown");var dI=le("ZodMiniVoid",(t,e)=>{pg.init(t,e),ht.init(t,e)});function Vg(t){return Mg(dI,t)}o(Vg,"_void");var Gg=le("ZodMiniDate",(t,e)=>{fg.init(t,e),ht.init(t,e)});var pI=le("ZodMiniArray",(t,e)=>{mg.init(t,e),ht.init(t,e)});function xe(t,e){return new pI({type:"array",element:t,...ut(e)})}o(xe,"array");var fI=le("ZodMiniObject",(t,e)=>{hg.init(t,e),ht.init(t,e),mt(t,"shape",()=>e.shape)});function O(t,e){let r={type:"object",shape:t??{},...ut(e)};return new fI(r)}o(O,"object");var mI=le("ZodMiniUnion",(t,e)=>{Ol.init(t,e),ht.init(t,e)});function Re(t,e){return new mI({type:"union",options:t,...ut(e)})}o(Re,"union");var hI=le("ZodMiniDiscriminatedUnion",(t,e)=>{gg.init(t,e),ht.init(t,e)});function jo(t,e,r){return new hI({type:"union",options:e,discriminator:t,...ut(r)})}o(jo,"discriminatedUnion");var gI=le("ZodMiniRecord",(t,e)=>{yg.init(t,e),ht.init(t,e)});function Se(t,e,r){return new gI({type:"record",keyType:t,valueType:e,...ut(r)})}o(Se,"record");var yI=le("ZodMiniEnum",(t,e)=>{vg.init(t,e),ht.init(t,e),t.options=Object.values(e.entries)});function De(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new yI({type:"enum",entries:r,...ut(e)})}o(De,"_enum");var vI=le("ZodMiniLiteral",(t,e)=>{_g.init(t,e),ht.init(t,e)});function ge(t,e){return new vI({type:"literal",values:Array.isArray(t)?t:[t],...ut(e)})}o(ge,"literal");var _I=le("ZodMiniTransform",(t,e)=>{bg.init(t,e),ht.init(t,e)});function $n(t){return new _I({type:"transform",transform:t})}o($n,"transform");var bI=le("ZodMiniOptional",(t,e)=>{Eg.init(t,e),ht.init(t,e)});function H(t){return new bI({type:"optional",innerType:t})}o(H,"optional");var EI=le("ZodMiniNullable",(t,e)=>{Sg.init(t,e),ht.init(t,e)});function Fi(t){return new EI({type:"nullable",innerType:t})}o(Fi,"nullable");var SI=le("ZodMiniPipe",(t,e)=>{Pg.init(t,e),ht.init(t,e)});function kn(t,e){return new SI({type:"pipe",in:t,out:e})}o(kn,"pipe");var PI=le("ZodMiniCustom",(t,e)=>{Tg.init(t,e),ht.init(t,e)});function Ms(t,e){return Lg(PI,t??(()=>!0),e)}o(Ms,"custom");var qi={};ws(qi,{bigint:()=>CI,boolean:()=>RI,date:()=>OI,number:()=>II,string:()=>AI});function AI(t){return Rg(Us,t)}o(AI,"string");function II(t){return $g(Dl,t)}o(II,"number");function RI(t){return Dg(Nl,t)}o(RI,"boolean");function CI(t){return Ng(Bg,t)}o(CI,"bigint");function OI(t){return jg(Gg,t)}o(OI,"date");var Ul=O({retryOnFailure:O({defaultValue:H(Ke()),hide:H(Ke())}),continueOnFailure:O({defaultValue:H(Ke()),hide:H(Ke())})}),zl=class{constructor(e,r,n,i,s,c,d,p,h,_,m){this.name=e;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=d;this.errorHandlingOptions=p;this.outputSchema=h;this.audience=_;this.aiMetadata=m}static{o(this,"IAction")}},Pt=o(t=>new zl(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 Fe=O({displayName:P(),description:H(P())}),Ce=o((t,e)=>O({type:ge(e),required:Ke(),defaultValue:H(Li())}),"TPropertyValue");var Ht=O({...Fe.shape,...Ce(P(),"SHORT_TEXT").shape}),sn=O({...Fe.shape,...Ce(P(),"LONG_TEXT").shape});var Wg=O({label:P(),value:Ee()}),js=O({disabled:H(Ke()),placeholder:H(P()),options:xe(Wg)});var Wt=O({...Fe.shape,options:js,...Ce(Ee(),"STATIC_DROPDOWN").shape}),un=O({...Fe.shape,options:js,...Ce(xe(Ee()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Ml=O({...Fe.shape,...Ce(Ee(),"DROPDOWN").shape,refreshers:xe(P())}),Bi=O({...Fe.shape,...Ce(xe(Ee()),"MULTI_SELECT_DROPDOWN").shape,refreshers:xe(P())});var cn=O({...Fe.shape,...Ce(Ke(),"CHECKBOX").shape});var ln=O({...Fe.shape,...Ce($t(),"NUMBER").shape});var Vi=O({...Fe.shape,...Ce(Ee(),"FILE").shape});var Gi=O({...Fe.shape,...Ce(P(),"DATE_TIME").shape});var Zg=Se(P(),Re([Ht,sn,Wt,Bi,un,cn,ln,Vi,Gi])),Hi=O({...Fe.shape,properties:Zg,...Ce(xe(Ee()),"ARRAY").shape});var Wi=O({...Fe.shape,...Ce(Re([Se(P(),Ee())]),"JSON").shape});var Kg=Re([Ht,Wt,Wi,Hi,un]),kI=Se(P(),Kg),jl=O({refreshers:xe(P()),...Fe.shape,...Ce(Ee(),"DYNAMIC").shape});var Ls=O({...Fe.shape,...Ce(Vg(),"MARKDOWN").shape});var Zi=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Zi||{}),Lo=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Lo||{}),Fo=(E=>(E.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",E.COMMUNICATION="COMMUNICATION",E.COMMERCE="COMMERCE",E.CORE="CORE",E.UNIVERSAL_AI="UNIVERSAL_AI",E.FLOW_CONTROL="FLOW_CONTROL",E.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",E.ACCOUNTING="ACCOUNTING",E.PRODUCTIVITY="PRODUCTIVITY",E.CONTENT_AND_FILES="CONTENT_AND_FILES",E.DEVELOPER_TOOLS="DEVELOPER_TOOLS",E.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",E.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",E.HUMAN_RESOURCES="HUMAN_RESOURCES",E.PAYMENT_PROCESSING="PAYMENT_PROCESSING",E.MARKETING="MARKETING",E.SALES_AND_CRM="SALES_AND_CRM",E))(Fo||{});var Ki=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Ki||{}),Ll="both_client_credentials_and_authorization_code";var zt=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(zt||{}),Ji=(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))(Ji||{}),DI=O({strategy:De(Ji),paramName:H(P())}),Yi=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Yi||{});var Fs=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Fs||{}),Jg=O({status:H($t()),body:H(Ee()),headers:H(Se(P(),P()))}),Yg=O({type:ge("DELAY"),resumeDateTime:P(),requestIdToReply:H(P()),handlerId:H(P()),streamStepProgress:H(De(Fs))}),Xg=O({type:ge("WEBHOOK"),requestId:P(),requestIdToReply:H(P()),response:Jg,handlerId:H(P()),streamStepProgress:H(De(Fs))}),NI=Re([Yg,Xg]);var zI=O({body:Ee(),rawBody:H(Ee()),headers:Se(P(),P()),queryParams:Se(P(),P())});function ot(t){return t==null}o(ot,"isNil");function Xi(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(Xi,"isEmpty");function qs(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(qs,"assertNotNullOrUndefined");var Fl=rt(require("crypto"),1);var UI=128,no,qo,MI=o(t=>{!no||no.length<t?(no=Buffer.allocUnsafe(t*UI),Fl.default.randomFillSync(no),qo=0):qo+t>no.length&&(Fl.default.randomFillSync(no),qo=0),qo+=t},"fillPool"),jI=o(t=>(MI(t|=0),no.subarray(qo-t,qo)),"random"),LI=o((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(s=e)=>{let c="";for(;;){let d=r(i),p=i;for(;p--;)if(c+=t[d[p]&n]||"",c.length===s)return c}}},"customRandom"),ey=o((t,e=21)=>LI(t,e,jI),"customAlphabet");var FI="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ty=21,AV=P().check(On(new RegExp(`^[0-9a-zA-Z]{${ty}}$`))),qI=ey(FI,ty);var Dn=kn($n(t=>t instanceof Date?t.toISOString():t),P()),ur={id:P(),created:Dn,updated:Dn},it=o(t=>H(Fi(t)),"Nullable");function ql(t){return H(Fi(De(t)))}o(ql,"NullableEnum");var CV=kn($n(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),H(Ke())),Bs=o(t=>kn($n(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),H(xe(t))),"OptionalArrayFromQuery");var kV=Se(P(),Ee());var Qi=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(Qi||{});var GV=P().check(On(/^#[0-9A-Fa-f]{6}$/));var WV=O({filename:P(),data:Ee(),type:ge("file"),mimetype:H(P())});var BI=rt(ny());var eG=O({...ur,name:P(),permissions:xe(P()),platformId:it(P()),type:P(),userCount:H($t())});var oy=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(oy||{}),Bl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Bl||{}),Vl=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Vl||{});var Gl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Gl||{});var Hl=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Hl||{});var VI=O({mode:De(oy),value:Ee()}),GI=O({auth:H(P()),fields:Se(P(),VI)}),HI=O({pieceName:P(),pieceVersion:P(),actionName:P(),predefinedInput:H(GI)}),WI=O({type:ge("PIECE"),toolName:P().check(Pr(1)),pieceMetadata:HI}),ZI=O({type:ge("none")}),KI=O({type:ge("access_token"),accessToken:P()}),JI=O({type:ge("api_key"),apiKey:P(),apiKeyHeader:P()}),YI=O({type:ge("headers"),headers:Se(P(),P())}),XI=jo("type",[ZI,KI,JI,YI]),iy=O({type:ge("FLOW"),toolName:P().check(Pr(1)),externalFlowId:P(),flowDisplayName:H(P())}),ay=O({type:ge("MCP"),toolName:P().check(Pr(1)),serverUrl:qg(),protocol:De(Vl),auth:XI}),sy=O({type:ge("KNOWLEDGE_BASE"),toolName:P().check(Pr(1)),sourceType:De(Bl),sourceId:P(),sourceName:P()}),QI=jo("type",[WI,iy,ay,sy]),eR=O({displayName:P(),description:H(P()),type:De(Gl)}),uy=O({type:ge("MARKDOWN"),markdown:P()}),Bo={type:ge("TOOL_CALL"),input:it(Se(P(),Ee())),output:H(Ee()),toolName:P(),status:De(Hl),toolCallId:P(),startTime:P(),endTime:H(P())},AG=O(Bo),cy=jo("toolCallType",[O({...Bo,toolCallType:ge("PIECE"),pieceName:P(),pieceVersion:P(),actionName:P()}),O({...Bo,toolCallType:ge("FLOW"),displayName:P(),externalFlowId:P()}),O({...Bo,toolCallType:ge("MCP"),displayName:P(),serverUrl:P()}),O({...Bo,toolCallType:ge("KNOWLEDGE_BASE"),displayName:P(),sourceType:P()}),O({...Bo,toolCallType:ge("UNKNOWN"),displayName:P()})]),tR=Re([uy,cy]);var Wl=(r=>(r.IMAGE="image",r.TEXT="text",r))(Wl||{}),dn=O({apiKey:P()}),rR=dn,nR=O({apiKey:P(),apiKeyHash:P()}),oR=dn,iR=dn,aR=dn,sR=dn,uR=dn,cR=dn,lR=dn,ly=O({accessKeyId:P().check(Pr(1)),secretAccessKey:P().check(Pr(1))}),dR=O({}),pR=O({}),fR=O({}),mR=O({}),hR=O({}),gR=O({}),dy=O({modelId:P(),modelName:P(),modelType:De(Wl)}),py=O({apiKeyHeader:P(),baseUrl:P(),models:xe(dy),defaultHeaders:H(Se(P(),P()))}),fy=O({accountId:P(),gatewayId:P(),models:xe(dy),vertexProject:H(P()),vertexRegion:H(P())}),my=O({resourceName:P(),apiVersion:kn($n(t=>typeof t=="string"&&t.trim().length===0?void 0:t),H(P()))}),hy=O({region:P().check(Pr(1))}),yR=Re([rR,aR,sR,uR,cR,iR,oR,nR,ly,lR]),gy=Re([py,fy,my,hy,dR,fR,mR,hR,pR,gR]),vR=O({id:P(),name:P(),type:De(Wl)}),_R=O({id:P(),name:P(),provider:De(Qi),config:gy,enabledForChat:Ke()}),bR=O({provider:De(Qi),config:gy,auth:yR,platformId:P()});var OG={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var ER=O({base64Url:P(),fileName:P(),extension:H(P())}),SR=O({mimeType:P(),url:P(),fileName:H(P())}),Zl=Re([ER,SR]);var PR=Re([O({type:ge("file"),value:Zl}),O({type:ge("markdown"),value:P(),files:H(xe(Zl))})]),TR=O({sessionId:P(),message:P(),files:H(xe(P()))});var vy=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(vy||{}),_y=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(_y||{}),Kl=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Kl||{});var wR=Re([O({...ur,name:P(),externalId:P(),type:ge("STATIC_DROPDOWN"),tableId:P(),projectId:P(),data:O({options:xe(O({value:P()}))})}),O({...ur,name:P(),externalId:P(),type:Re([ge("TEXT"),ge("NUMBER"),ge("DATE")]),tableId:P(),projectId:P()})]),xR=O({...ur,name:P(),folderId:it(P()),projectId:P(),externalId:P(),status:ql(_y),trigger:ql(vy)}),AR=O({...ur,tableId:P(),projectId:P(),cells:Se(P(),O({updated:P(),created:P(),value:Ee(),fieldName:P()}))}),IR=O({events:xe(De(Kl)),webhookUrl:P(),flowId:P()}),RR=O({fields:xe(O({id:P(),name:P()})),rows:xe(Se(P(),P())),name:P()}),CR=O({projectId:P(),limit:H(qi.number()),cursor:H(P()),name:H(P()),externalIds:Bs(P()),folderId:H(P()),folderIds:Bs(P())}),OR=O({records:xe(xe(O({fieldId:P(),value:Ey()}))),tableId:P()}),$R=O({cells:H(xe(O({fieldId:P(),value:Ey()}))),tableId:P(),agentUpdate:H(Ke())}),by=jo("operator",[oo("eq"),oo("neq"),oo("gt"),oo("gte"),oo("lt"),oo("lte"),oo("co"),yy("exists"),yy("not_exists")]),kR=O({tableId:P(),limit:H(qi.number()),cursor:H(P()),filters:Bs(by)});function Ey(){return kn($n(t=>t==null?t:String(t)),Fi(P()))}o(Ey,"coerceToString");function oo(t){return O({fieldId:P(),operator:ge(t),value:P()})}o(oo,"valueFilter");function yy(t){return O({fieldId:P(),operator:ge(t)})}o(yy,"existenceFilter");var DR=O({status:H($t()),body:H(Ee()),headers:H(Se(P(),P()))}),NR=O({...ur,deleted:it(Dn),ownerId:P(),displayName:P(),platformId:P(),externalId:it(P())});var Sy=O({name:P(),description:H(P()),type:P(),required:Ke()}),zR=O({pieceName:P(),triggerName:P(),input:O({toolName:P(),toolDescription:P(),inputSchema:xe(Sy),returnsResponse:Ke()})});var Py="^[0-9]+\\.[0-9]+\\.[0-9]+$",JG=new RegExp(Py),MR="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",YG=P().check(On(new RegExp(Py))),XG=P().check(On(new RegExp(MR))),jR=O({packageType:ge("ARCHIVE"),pieceType:De(Lo),pieceName:P(),pieceVersion:P(),archiveId:P(),platformId:P()}),Ty=O({packageType:ge("REGISTRY"),pieceType:ge("OFFICIAL"),pieceName:P(),pieceVersion:P()}),wy=O({packageType:ge("REGISTRY"),pieceType:ge("CUSTOM"),pieceName:P(),pieceVersion:P(),platformId:P()}),QG=Re([Ty,wy]),eH=Re([jR,Ty,wy]),xy=(e=>(e.CRON_EXPRESSION="CRON_EXPRESSION",e))(xy||{}),LR=O({type:De(xy),cronExpression:P(),timezone:P()}),tH=O({...ur,type:De(zt),projectId:P(),flowId:P(),triggerName:P(),schedule:it(LR),flowVersionId:P(),pieceName:P(),pieceVersion:P(),deleted:it(P()),simulate:Ke()}),Ay=(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))(Ay||{}),Iy=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Iy||{}),Ry=(r=>(r.S3="S3",r.DB="DB",r))(Ry||{}),rH=O({...ur,projectId:it(P()),platformId:it(P()),type:De(Ay),compression:De(Iy),data:H(Ee()),location:De(Ry),size:it($t()),fileName:it(P()),s3Key:it(P()),metadata:it(Se(P(),P()))}),Cy=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Cy||{}),Oy=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Oy||{}),nH=O({id:P(),email:P(),firstName:P(),status:De(Oy),externalId:it(P()),platformId:it(P()),platformRole:De(Cy),lastName:P(),created:Dn,updated:Dn,lastActiveDate:it(Dn),imageUrl:it(P())});var Yl=O({...Fe.shape,...Ce(Se(P(),Ee()),"OBJECT").shape});var Dy=O({...Fe.shape,...Ce(P(),"COLOR").shape});var Xl=Re([Ht,sn,Ls,cn,Wt,un,Ml,Bi,jl,ln,Hi,Yl,Wi,Gi,Vi,Dy]),Q={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 zr=O({displayName:P(),description:H(P())});var Ny=O({username:P(),password:P()}),Ql=O({...zr.shape,username:O({displayName:P(),description:H(P())}),password:O({displayName:P(),description:H(P())}),...Ce(Ny,"BASIC_AUTH").shape});var VR=Se(P(),Re([Ht,sn,ln,cn,Wt])),ed=O({...zr.shape,props:VR,...Ce(Ee(),"CUSTOM_AUTH").shape});var io=O({...zr.shape,...Ce(O({auth:P()}),"SECRET_TEXT").shape});var GR=Se(P(),Re([Ht,sn,io,ln,cn,Wt,un,Ls])),zy=O({...zr.shape,props:GR,...Ce(Ee(),"OIDC").shape});var td=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(td||{}),Uy=Re([Ht,io,Wt]),My=Se(P(),Uy),HR=O({props:H(Se(P(),Uy)),authUrl:P(),tokenUrl:P(),scope:xe(P()),prompt:H(Re([ge("none"),ge("consent"),ge("login"),ge("omit")])),pkce:H(Ke()),pkceMethod:H(Re([ge("plain"),ge("S256")])),authorizationMethod:H(De(td)),grantType:H(Re([De(Ki),ge(Ll)])),extra:H(Se(P(),P()))}),jy=O({access_token:P(),props:H(My),data:Se(P(),Li())}),rd=O({...zr.shape,...HR.shape,...Ce(jy,"OAUTH2").shape});var Vo=Re([Ql,ed,zy,rd,io]),ea="Connection",Gs={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||ea}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||ea,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||ea}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||ea}},None(){}};var NW={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 WR=O({...Fe.shape,...Ce(Ee(),"CUSTOM").shape,code:P()});var ZR=Re([Xl,Vo]),nd=Se(P(),ZR),tZ=Se(P(),Xl);var Ly=Re([O({strategy:ge("CRON"),cronExpression:P()}),O({strategy:ge("NONE")})]),Go=class{constructor(e,r,n,i,s,c,d,p,h,_,m,f,l,g,v,b,E,k,L){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=d;this.onHandshake=p;this.renewConfiguration=h;this.onRenew=_;this.onEnable=m;this.onDisable=f;this.onStart=l;this.run=g;this.test=v;this.sampleData=b;this.testStrategy=E;this.outputSchema=k;this.aiMetadata=L}static{o(this,"ITrigger")}},Ut=o(t=>{switch(t.type){case"WEBHOOK":return new Go(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 Go(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 Go(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 Go(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,ot(t.sampleData)&&ot(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var Fy="2",Hs="0.82.0";var od=class{constructor(e,r,n,i,s,c,d,p,h=Hs,_,m=""){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=p;this.minimumSupportedRelease=h;this.maximumSupportedRelease=_;this.description=m;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Fy}),"getContextInfo");(!KR(h)||JR(h,Hs))&&(this.minimumSupportedRelease=Hs),s.forEach(f=>this._actions[f.name]=f),c.forEach(f=>this._triggers[f.name]=f)}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}},qy=o(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new od(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description)},"createPiece");function KR(t){return/^\d+\.\d+\.\d+$/.test(t)}o(KR,"isValidSimpleSemver");function JR(t,e){let[r,n,i]=t.split(".").map(Number),[s,c,d]=e.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<d}o(JR,"isSemverLessThan");var YR=H(Se(P(),Se(P(),P()))),By=O({id:H(P()),name:P(),displayName:P(),logoUrl:P(),description:P(),authors:xe(P()),platformId:H(P()),directoryPath:H(P()),auth:H(Re([Vo,xe(Vo)])),version:P(),categories:H(xe(De(Fo))),minimumSupportedRelease:H(P()),maximumSupportedRelease:H(P()),i18n:YR}),XR=De(["human","ai","both"]),Vy=O({description:H(P()),idempotent:H(Ke())}),Gy=O({name:P(),displayName:P(),description:P(),props:nd,requireAuth:Ke(),errorHandlingOptions:H(Ul),outputSchema:H(Ms()),audience:H(XR),aiMetadata:H(Vy)}),Hy=O({name:P(),displayName:P(),description:P(),props:nd,errorHandlingOptions:H(Ul),type:De(zt),sampleData:Ee(),handshakeConfiguration:H(Ms()),renewConfiguration:H(Ly),testStrategy:De(Yi),outputSchema:H(Ms()),aiMetadata:H(Vy)}),QR=O({...By.shape,actions:Se(P(),Gy),triggers:Se(P(),Hy)}),e0=O({...By.shape,actions:$t(),triggers:$t(),suggestedActions:H(xe(Hy)),suggestedTriggers:H(xe(Gy))}),Wy=O({projectUsage:$t(),tags:H(xe(P())),pieceType:De(Lo),packageType:De(Zi),platformId:H(P()),archiveId:H(P())}),t3=O({...QR.shape,...Wy.shape}),r3=O({...e0.shape,...Wy.shape}),n3=O({name:P(),version:P()});var t0=rt(require("path")),r0=rt(require("fs/promises"));var Ws=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};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 Zs=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new id,r=new ad){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},id=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},ad=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 Ks=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Js=class extends Ws{static{o(this,"FetchHttpClient")}constructor(e="",r=new Zs){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),s=this.getHeaders(e),c=e.queryParams??{};for(let[L,J]of Object.entries(c))i.append(L,J);let d=i.toString(),p=d?`${n}?${d}`:n,h=e.responseType??"json",_=e.followRedirects??!0,m=e.retries??0,{body:f,extraHeaders:l,isStream:g}=n0(e.body,s),v=i0({...s,...l}),b=await o0(async()=>{let L=new AbortController,J=e.timeout&&e.timeout>0?setTimeout(()=>L.abort(),e.timeout):void 0;try{let W={method:e.method.toString(),headers:v,body:f,redirect:_?"follow":"manual",signal:L.signal};return g&&(W.duplex="half"),r?.dispatcher!==void 0&&(W.dispatcher=r.dispatcher),await fetch(p,W)}finally{J!==void 0&&clearTimeout(J)}},m),E=_?300:400;if(b.status<200||b.status>=E){let L=await Zy(b,h),J=new Ks(e.body,{status:b.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",J),J}let k=await Zy(b,h);return{status:b.status,headers:a0(b.headers),body:k}}};function n0(t,e){return u0(t)?{body:void 0,extraHeaders:{},isStream:!1}:s0(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(n0,"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 o0(t,e){let r;for(let n=0;n<=e;n++)try{let i=await t();if(i.status>=500&&n<e){await Ky(n);continue}return i}catch(i){if(r=i,n<e){await Ky(n);continue}throw i}throw r}o(o0,"sendWithRetries");function Ky(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(Ky,"backoff");function i0(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(i0,"normalizeHeaders");function a0(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(a0,"toHttpHeaders");function s0(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"}o(s0,"isNodeFormData");function u0(t){return t==null}o(u0,"isNil");var Ge=new Js;var cr=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(cr||{});var HC=rt(require("fs")),J_=rt(K_());var WC={"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 ZC(t){let e=t.split(";")[0].trim().toLowerCase();return WC[e]??""}o(ZC,"contentTypeToExtension");var KC=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),JC=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 Y_({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:d,authLocation:p="headers"}){return Pt({audience:"human",name:s||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:Q.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:Q.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
69
|
-
i.e ${JC(e,h)}/resource or /resource`,required:!0,defaultValue:h?e(h):"",...c?.url??{}})}),"props")}),method:Q.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(cr).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:Q.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:Q.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:Q.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:Q.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let _=h,m={};switch(_){case"none":break;case"json":m.data=Q.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":m.data=Q.LongText({displayName:"Raw Body",required:!0});break;case"form_data":m.data=Q.Array({displayName:"Form Data",required:!0,properties:{fieldName:Q.ShortText({displayName:"Field Name",required:!0}),fieldType:Q.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:Q.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:Q.File({displayName:"File Field Value",required:!1})}});break}return m},"props")}),response_is_binary:Q.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:Q.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:Q.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:Q.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async h=>{let{method:_,url:m,headers:f,queryParams:l,body:g,body_type:v,failsafe:b,timeout:E,response_is_binary:k,followRedirects:L}=h.propsValue;qs(_,"Method"),qs(m,"URL");let J=ot(r)?{}:await r(h.auth,h.propsValue),W=m.url,G=W.startsWith("http://")||W.startsWith("https://")?W:KC({baseUrl:e(h.auth),relativePath:W}),K={method:_,url:G,headers:{...f??{},...p==="headers"||!ot(p)?J:{}},queryParams:{...p==="queryParams"?J:{},...l??{}},timeout:E?E*1e3:0,followRedirects:L};if(k&&(K.responseType="arraybuffer"),g)if(v&&v!=="none"){let te=g.data;if(v==="form_data"){let X=te,Te=new J_.default;for(let{fieldName:re,fieldType:B,textFieldValue:q,fileFieldValue:Y}of X)B==="text"&&!Xi(q)?Te.append(re,q):B==="file"&&!Xi(Y)&&Te.append(re,Y.data,{filename:Y?.filename});K.body=Te,K.headers={...K.headers,...Te.getHeaders()}}else K.body=te}else v||(K.body=g);try{let te=await Ge.sendRequest(K);return await YC(h.files,te.body,te.status,te.headers,k)}catch(te){if(b)return te.errorMessage();throw te}},"run")})}o(Y_,"createCustomApiCallAction");var YC=o(async(t,e,r,n,i)=>{let s;if(i&&XC(e)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=ZC(c??"")||"txt",p;e instanceof ArrayBuffer?p=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?p=e:p=Buffer.from(e),s=await t.write({fileName:`output.${d}`,data:p})}else s=e;return{status:r,headers:n,body:s}},"handleBinaryResponse"),XC=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var He={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:c}){switch(t.strategy){case 0:{let d=await e.get("lastPoll");if(ot(d))throw new Error("lastPoll doesn't exist in the store.");let p=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:d,server:c}),h=p.reduce((_,m)=>Math.max(_,m.epochMilliSeconds),d);return await e.put("lastPoll",h),p.filter(_=>_.epochMilliSeconds>d).map(_=>_.data)}case 1:{let d=await e.get("lastItem"),p=await t.items({store:e,auth:r,propsValue:n,lastItemId:d,files:s,server:c}),h=p.findIndex(f=>f.id===d),_=[];ot(d)||h==-1?_=p??[]:_=p?.slice(0,h)??[],ot(i)||(_=_.slice(-i));let m=_?.[0]?.id;return ot(m)||await e.put("lastItem",m),_.map(f=>f.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i}){switch(t.strategy){case 0:{await e.put("lastPoll",Date.now());break}case 1:{let c=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;ot(c)?await e.delete("lastItem"):await e.put("lastItem",c);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:i,server:s}){let c=[];switch(t.strategy){case 0:{c=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:s});break}}return QC(c.map(d=>d.data))}};function QC(t){return t.length<=5?t:t.slice(0,5)}o(QC,"getFirstFiveOrAll");var X_=require("crypto");async function Ad(t,e){let r={method:"POST",url:`${fe.baseUrl}/channels/stop`,body:{id:t?.id,resourceId:t?.resourceId},authentication:{type:"BEARER_TOKEN",token:await Le(e)}};await Ge.sendRequest(r)}o(Ad,"stopWatchEvent");async function Id(t,e,r){let n=Date.now()+5184e5,i={method:"POST",url:`${fe.baseUrl}/calendars/${t}/events/watch`,body:{id:(0,X_.randomUUID)(),type:"web_hook",address:e,expiration:n.toString()},authentication:{type:"BEARER_TOKEN",token:await Le(r)}},{body:s}=await Ge.sendRequest(i);return s}o(Id,"watchEvent");async function au({calendarId:t,authProp:e}){let r=await Le(e),n={singleEvents:"true",showDeleted:"true",maxResults:"2500"},i="",s;do{i&&(n.pageToken=i);let c={method:"GET",url:`${fe.baseUrl}/calendars/${t}/events`,queryParams:n,authentication:{type:"BEARER_TOKEN",token:r}},{body:d}=await Ge.sendRequest(c);i=d.nextPageToken,s=d.nextSyncToken}while(i);return s}o(au,"getInitialSyncToken");async function Q_({calendarId:t,syncToken:e,authProp:r}){let n=await Le(r),i={syncToken:e,maxResults:"2500"},s="",c,d=[];do{s&&(i.pageToken=s);let p={method:"GET",url:`${fe.baseUrl}/calendars/${t}/events`,queryParams:i,authentication:{type:"BEARER_TOKEN",token:n}};try{let{body:h}=await Ge.sendRequest(p);h.items?.length>0&&(d=[...d,...h.items]),s=h.nextPageToken,c=h.nextSyncToken}catch(h){if(h?.response?.status===410)return{items:[],nextSyncToken:void 0,syncTokenInvalid:!0};throw h}}while(s);return{items:d,nextSyncToken:c,syncTokenInvalid:!1}}o(Q_,"listEventsWithSyncToken");async function Mn(t,e){let r={showDeleted:"false"};e&&(r.minAccessRole=e);let n={method:"GET",url:`${fe.baseUrl}/users/me/calendarList`,queryParams:r,authentication:{type:"BEARER_TOKEN",token:await Le(t)}};return(await Ge.sendRequest(n)).body.items}o(Mn,"getCalendars");async function eb(t){let e={method:"GET",url:`${fe.baseUrl}/colors`,authentication:{type:"BEARER_TOKEN",token:await Le(t)}};return(await Ge.sendRequest(e)).body}o(eb,"getColors");async function aa(t,e,r,n){let i=new Date,s=new Date;s.setDate(i.getDate()-1);let c={updatedMin:n?.toISOString()??s.toISOString(),maxResults:"2500",orderBy:"updated",singleEvents:e?"true":"false",showDeleted:"true"},d=await Le(r),p={method:"GET",url:`${fe.baseUrl}/calendars/${t}/events`,queryParams:c,authentication:{type:"BEARER_TOKEN",token:d}},h=[],_="";do{c.pageToken=_;let{body:m}=await Ge.sendRequest(p);m.items.length>0&&(h=[...h,...m.items]),_=m.nextPageToken}while(_);return h}o(aa,"getEvents");async function tb(t,e){return(await aa(t,!1,e)).pop()}o(tb,"getLatestEvent");async function rb(t,e,r=50){if(!e)return[];try{let n=new Date,i=new Date;i.setDate(n.getDate()+30);let s={singleEvents:"true",orderBy:"startTime",timeMin:n.toISOString(),timeMax:i.toISOString(),maxResults:r.toString(),showDeleted:"false"},c={method:"GET",url:`${fe.baseUrl}/calendars/${encodeURIComponent(e)}/events`,queryParams:s,authentication:{type:"BEARER_TOKEN",token:await Le(t)}},d=await Ge.sendRequest(c);return!d.body.items||d.body.items.length===0?[]:d.body.items.map(p=>{let h=p.start?.dateTime||p.start?.date||"",_=h?new Date(h).toLocaleDateString():"",m=h?new Date(h).toLocaleTimeString():"",f=p.summary||"Untitled Event";return _&&(f+=` (${_}`,p.start?.dateTime&&(f+=` at ${m}`),f+=")"),{label:f,value:p.id||""}}).filter(p=>p.value!=="")}catch(n){return console.error("Error fetching events for dropdown:",n),[]}}o(rb,"getEventsForDropdown");var Pc=rt(Ma());var Zf=["https://www.googleapis.com/auth/calendar.events","https://www.googleapis.com/auth/calendar.readonly"],Oe=[Gs.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,pkce:!0,scope:Zf}),Gs.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 calendars without adding the service account to each one. <br> <br> **Note:** Without a user email, the service account only has access to calendars you explicitly share with it.",required:!0,props:{serviceAccount:Q.ShortText({displayName:"Service Account JSON Key",required:!0}),userEmail:Q.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 Le({type:"CUSTOM_AUTH",props:{...t}})}catch(e){return{valid:!1,error:e.message}}return{valid:!0}},"validate")})];async function vr(t){if(t.type==="CUSTOM_AUTH"){let r=JSON.parse(t.props.serviceAccount);return new Pc.JWT({email:r.client_email,key:r.private_key,scopes:Zf,subject:t.props.userEmail})}let e=new Pc.OAuth2Client;return e.setCredentials(t),e}o(vr,"createGoogleClient");var Le=o(async t=>{if(t.type==="CUSTOM_AUTH"){let r=await(await vr(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 fe={baseUrl:"https://www.googleapis.com/calendar/v3",calendarDropdown:o(t=>Q.Dropdown({auth:Oe,displayName:"Calendar",refreshers:[],required:!0,options:o(async({auth:e})=>e?{disabled:!1,options:(await Mn(e,t)).map(i=>({label:i.summary,value:i.id}))}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),"calendarDropdown"),eventDropdown:o((t=!1)=>Q.Dropdown({displayName:"Event",refreshers:["calendar_id"],required:t,auth:Oe,options:o(async({auth:e,calendar_id:r})=>e?r?{disabled:!1,options:await rb(e,r)}:{disabled:!0,placeholder:"Please select a calendar first",options:[]}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),"eventDropdown"),colorId:Q.Dropdown({auth:Oe,displayName:"Color",refreshers:[],required:!1,options:o(async({auth:t})=>{if(!t)return{disabled:!0,placeholder:"Please connect your account first",options:[]};let e=await eb(t);return{disabled:!1,options:Object.entries(e.event).map(([r,n])=>({label:n.background,value:r}))}},"options")})};var qc=rt(ja()),Aw=rt(Ja()),Iw=require("crypto");var yt={fields:[{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"htmlLink",label:"Event Link",format:"url"},{key:"id",label:"Event ID"},{key:"eventType",label:"Event Type"},{key:"start",label:"Start",children:[{key:"dateTime",label:"Start Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"end",label:"End",children:[{key:"dateTime",label:"End Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"creator",label:"Creator",children:[{key:"email",label:"Email",format:"email"}]},{key:"organizer",label:"Organizer",children:[{key:"email",label:"Email",format:"email"}]},{key:"created",label:"Created",format:"datetime"},{key:"updated",label:"Updated",format:"datetime"},{key:"iCalUID",label:"iCal UID"}]},Pw={fields:[{key:"summary",label:"Name"},{key:"description",label:"Description"},{key:"id",label:"Calendar ID"},{key:"timeZone",label:"Time Zone"},{key:"accessRole",label:"Access Role"},{key:"selected",label:"Selected",format:"boolean"},{key:"isShared",label:"Is Shared",format:"boolean"},{key:"calendarType",label:"Calendar Type"},{key:"backgroundColor",label:"Background Color"},{key:"foregroundColor",label:"Foreground Color"},{key:"colorId",label:"Color ID"}]},Tw={fields:[{key:"status",label:"Status Code"},{key:"summary",label:"Calendar Summary",value:"body.summary"},{key:"timeZone",label:"Time Zone",value:"body.timeZone"},{key:"accessRole",label:"Access Role",value:"body.accessRole"},{key:"updated",label:"Updated",value:"body.updated",format:"datetime"},{key:"items",label:"Events",value:"body.items",labelKey:"summary",listItems:[{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"id",label:"Event ID"},{key:"eventType",label:"Event Type"},{key:"htmlLink",label:"Event Link",format:"url"},{key:"startDateTime",label:"Start",value:"start.dateTime",format:"datetime"},{key:"endDateTime",label:"End",value:"end.dateTime",format:"datetime"},{key:"creatorEmail",label:"Creator Email",value:"creator.email",format:"email"},{key:"organizerEmail",label:"Organizer Email",value:"organizer.email",format:"email"},{key:"created",label:"Created",format:"datetime"},{key:"updated",label:"Updated",format:"datetime"},{key:"iCalUID",label:"iCal UID"}]}]},ww={fields:[{key:"summary",label:"Summary",value:"body.summary"},{key:"status",label:"Status",value:"body.status"},{key:"id",label:"Event ID",value:"body.id"},{key:"htmlLink",label:"Event Link",value:"body.htmlLink",format:"url"},{key:"created",label:"Created",value:"body.created",format:"datetime"},{key:"updated",label:"Updated",value:"body.updated",format:"datetime"},{key:"start",label:"Start",value:"body.start",children:[{key:"dateTime",label:"Start Date/Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"end",label:"End",value:"body.end",children:[{key:"dateTime",label:"End Date/Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"creator",label:"Creator",value:"body.creator",children:[{key:"email",label:"Email",format:"email"}]},{key:"organizer",label:"Organizer",value:"body.organizer",children:[{key:"email",label:"Email",format:"email"}]},{key:"eventType",label:"Event Type",value:"body.eventType"},{key:"iCalUID",label:"iCal UID",value:"body.iCalUID"}]},xw={fields:[{key:"timeMin",label:"Time Min",format:"datetime"},{key:"timeMax",label:"Time Max",format:"datetime"},{key:"calendars",label:"Calendars",dynamicKey:!0,children:[{key:"busy",label:"Busy Periods",labelKey:"start",listItems:[{key:"start",label:"Start",format:"datetime"},{key:"end",label:"End",format:"datetime"}]}]}]};var Rw=Pt({auth:Oe,name:"create_google_calendar_event",description:"Add Event",audience:"both",aiMetadata:{description:"Creates a Google Calendar event with structured fields (title, start/end times, location, description, attendees, color, guest permissions) and can optionally attach a Google Meet link. Use this when you have explicit event details; choose Create Quick Event instead when working from a single natural-language phrase. Requires a title and start time (end defaults to 30 minutes after start). Not idempotent: each call creates a new event.",idempotent:!1},displayName:"Create Event",props:{calendar_id:fe.calendarDropdown("writer"),title:Q.ShortText({displayName:"Title of the event",required:!0}),start_date_time:Q.DateTime({displayName:"Start date time of the event",required:!0}),end_date_time:Q.DateTime({displayName:"End date time of the event",description:"By default it'll be 30 min post start time",required:!1}),location:Q.ShortText({displayName:"Location",required:!1}),description:Q.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1}),colorId:fe.colorId,attendees:Q.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!1}),guests_can_modify:Q.Checkbox({displayName:"Guests can modify",defaultValue:!1,required:!1}),guests_can_invite_others:Q.Checkbox({displayName:"Guests can invite others",defaultValue:!1,required:!1}),guests_can_see_other_guests:Q.Checkbox({displayName:"Guests can see other guests",defaultValue:!1,required:!1}),send_notifications:Q.StaticDropdown({displayName:"Send Notifications",defaultValue:"all",options:{options:[{label:"Yes, to everyone",value:"all"},{label:"To non-Google Calendar guests only",value:"externalOnly"},{label:"To no one",value:"none"}]},required:!0}),create_meet_link:Q.Checkbox({displayName:"Create Google Meet Link",description:"Automatically create a Google Meet video conference link for this event",defaultValue:!1,required:!1})},outputSchema:yt,async run(t){let{calendar_id:e,title:r,start_date_time:n,end_date_time:i,location:s,description:c,colorId:d,guests_can_modify:p,guests_can_invite_others:h,guests_can_see_other_guests:_,create_meet_link:m}=t.propsValue,f={dateTime:(0,qc.default)(n).format("YYYY-MM-DDTHH:mm:ss.sssZ")},l=i||(0,qc.default)(n).add(30,"m"),g={dateTime:(0,qc.default)(l).format("YYYY-MM-DDTHH:mm:ss.sssZ")},v=t.propsValue.attendees,b=t.propsValue.send_notifications,E=[];if(v)for(let G of v)E.push({email:G});let k=await vr(t.auth),L=(0,Aw.calendar)({version:"v3",auth:k}),J={summary:r,start:f,end:g,colorId:d,location:s??"",description:c??"",attendees:E,guestsCanInviteOthers:h,guestsCanModify:p,guestsCanSeeOtherGuests:_};return m&&(J.conferenceData={createRequest:{conferenceSolutionKey:{type:"hangoutsMeet"},requestId:(0,Iw.randomUUID)()}}),(await L.events.insert({calendarId:e,sendUpdates:b,conferenceDataVersion:m?1:0,requestBody:J})).data}});var Cw=Pt({auth:Oe,name:"create_quick_event",description:"Add Quick Calendar Event",audience:"both",aiMetadata:{description:`Creates a calendar event from a single natural-language phrase (e.g. "Lunch with Sam tomorrow at 1pm") via Google's quickAdd parsing, letting Google infer the time, title, and date. Use when you have free-form text rather than structured fields; prefer Create Event when you have explicit start/end times or attendees. Not idempotent: each call creates a new event.`,idempotent:!1},displayName:"Create Quick Event",props:{calendar_id:fe.calendarDropdown("writer"),text:Q.LongText({displayName:"Summary",description:"The text describing the event to be created",required:!0}),send_updates:Q.StaticDropdown({displayName:"Send Updates",description:"Guests who should receive notifications about the creation of the new event.",required:!1,options:{disabled:!1,options:[{label:"All",value:"all"},{label:"External Only",value:"externalOnly"},{label:"none",value:"none"}]}})},outputSchema:ww,async run(t){let e=t.propsValue.calendar_id,r=`${fe.baseUrl}/calendars/${e}/events/quickAdd`,n={text:t.propsValue.text,sendUpdates:t.propsValue.send_updates||"none"},i={method:"POST",url:r,body:{},authentication:{type:"BEARER_TOKEN",token:await Le(t.auth)},queryParams:n};return await Ge.sendRequest(i)}});var Ow=rt(Ja());var $w=Pt({displayName:"Delete Event",auth:Oe,name:"delete_event",description:"Deletes an event from Google Calendar.",audience:"both",aiMetadata:{description:"Permanently removes an event from a Google Calendar, identified by calendar and event ID. Use to cancel or delete an existing event. Requires the event ID and cannot be undone. Idempotent: once the event is deleted, repeating the call leaves it absent (a second call may report it as already gone).",idempotent:!0},props:{calendar_id:fe.calendarDropdown("writer"),eventId:Q.ShortText({displayName:"Event ID",required:!0})},async run(t){let e=await vr(t.auth),r=t.propsValue.calendar_id,n=t.propsValue.eventId;return(await(0,Ow.calendar)({version:"v3",auth:e}).events.delete({calendarId:r,eventId:n})).data}});var km=rt(ja());var kw=Pt({auth:Oe,name:"google_calendar_get_events",description:"Get Events",audience:"both",aiMetadata:{description:"Lists events from a Google Calendar, optionally filtered by a date range, search term, and event types, and can expand recurring events into individual instances. Use to look up or browse multiple events when you do not already have a specific event ID; use Get Event by ID for a single known event. Read-only and idempotent.",idempotent:!0},displayName:"Get all Events",props:{calendar_id:fe.calendarDropdown("writer"),event_types:Q.StaticMultiSelectDropdown({displayName:"Event types",description:"Select event types",required:!0,defaultValue:["default","focusTime","outOfOffice"],options:{options:[{label:"Default",value:"default"},{label:"Out Of Office",value:"outOfOffice"},{label:"Focus Time",value:"focusTime"},{label:"Working Location",value:"workingLocation"}]}}),search:Q.ShortText({displayName:"Search Term",required:!1}),start_date:Q.DateTime({displayName:"Date from",required:!1}),end_date:Q.DateTime({displayName:"Date to",required:!1}),singleEvents:Q.Checkbox({displayName:"Expand Recurring Event?",description:"Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves.",required:!0,defaultValue:!1})},outputSchema:Tw,async run(t){let{calendar_id:e,start_date:r,end_date:n,search:i,event_types:s,singleEvents:c}=t.propsValue,d=await Le(t.auth),p={showDeleted:"false"},h=`${fe.baseUrl}/calendars/${e}/events`;c!==null&&(p.singleEvents=c?"true":"false"),i&&(p.q=`"${i}"`),r&&(p.timeMin=(0,km.default)(r).format("YYYY-MM-DDTHH:mm:ss.sssZ")),r&&n&&(p.timeMax=(0,km.default)(n).format("YYYY-MM-DDTHH:mm:ss.sssZ")),s.length>0&&(h+=`?${s.map(m=>`eventTypes=${m}`).join("&")}`);let _={method:"GET",url:h,queryParams:p,authentication:{type:"BEARER_TOKEN",token:d}};return await Ge.sendRequest(_)}});var Dw=rt(Ja());var Dm=rt(ja());var Nw=Pt({displayName:"Update Event",auth:Oe,name:"update_event",description:"Updates an event in Google Calendar.",audience:"both",aiMetadata:{description:"Updates the fields of an existing Google Calendar event identified by calendar and event ID (title, times, location, description, color, attendees, guest permissions); unset fields retain their current values. Use to modify or reschedule an event that already exists rather than creating a new one. Requires the event ID. Idempotent: applying the same field values repeatedly leaves the event in the same state.",idempotent:!0},props:{calendar_id:fe.calendarDropdown("writer"),eventId:Q.ShortText({displayName:"Event ID",required:!0}),title:Q.ShortText({displayName:"Title of the event",required:!1}),start_date_time:Q.DateTime({displayName:"Start date time of the event",required:!1}),end_date_time:Q.DateTime({displayName:"End date time of the event",required:!1}),location:Q.ShortText({displayName:"Location",required:!1}),description:Q.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1}),colorId:fe.colorId,attendees:Q.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!1}),guests_can_modify:Q.Checkbox({displayName:"Guests can modify",defaultValue:!1,required:!1}),guests_can_invite_others:Q.Checkbox({displayName:"Guests can invite others",defaultValue:!1,required:!1}),guests_can_see_other_guests:Q.Checkbox({displayName:"Guests can see other guests",defaultValue:!1,required:!1})},outputSchema:yt,async run(t){let{calendar_id:e,eventId:r,title:n,start_date_time:i,end_date_time:s,location:c,description:d,colorId:p,guests_can_invite_others:h,guests_can_modify:_,guests_can_see_other_guests:m}=t.propsValue,f=t.propsValue.attendees,l=await vr(t.auth),g=(0,Dw.calendar)({version:"v3",auth:l}),v=await g.events.get({calendarId:e,eventId:r}),b=[];return Array.isArray(f)&&f.length>0?b=f.map(k=>({email:k})):v.data.attendees&&Array.isArray(v.data.attendees)&&(b=v.data.attendees),(await g.events.update({calendarId:e,eventId:r,requestBody:{summary:n??v.data.summary,attendees:b,description:d??v.data.description,colorId:p,location:c??v.data.location,start:i?{dateTime:(0,Dm.default)(i).format("YYYY-MM-DDTHH:mm:ss.sssZ")}:v.data.start,end:s?{dateTime:(0,Dm.default)(s).format("YYYY-MM-DDTHH:mm:ss.sssZ")}:v.data.end,guestsCanInviteOthers:h,guestsCanModify:_,guestsCanSeeOtherGuests:m}})).data}});var Bc={strategy:0,items:o(async({auth:t,propsValue:{calendarId:e,expandRecurringEvent:r},lastFetchEpochMS:n})=>{let i=new Date(n);if(n===0){let d=new Date,p=new Date;p.setDate(d.getDate()-7),i=p}return(await aa(e,r,t,i)??[]).map(d=>({epochMilliSeconds:new Date(d.updated).getTime(),data:d}))},"items")},zw=Ut({auth:Oe,name:"new_or_updated_event",displayName:"New or Updated Event",description:"Triggers when an event is added or updated",aiMetadata:{description:"Fires when any event in the selected calendar is created or modified, polling by last-updated time. Each fired item is the affected event; can optionally expand recurring events so every occurrence fires separately."},props:{calendar_id:fe.calendarDropdown(),expandRecurringEvent:Q.Checkbox({displayName:"Expand Recurring Event?",description:"If true, the trigger will activate for every occurrence of a recurring event.",required:!0,defaultValue:!1})},sampleData:{kind:"calendar#event",etag:"3350849506974000",id:"0nsfi5ttd2b17ac76ma2f37oi9",htmlLink:"https://www.google.com/calendar/event?eid=kgjb90uioj4klrgfmdsnjsjvlgkm",summary:"ap-event-test",created:"2023-02-03T11:36:36.000Z",updated:"2023-02-03T11:45:53.487Z",description:"Sample description",status:"canceled",creator:{email:"test@test.com",self:!0},organizer:{email:"test@test.com",self:!0},start:{dateTime:"2023-02-02T22:30:00+03:00",timeZone:"Asia/Amman"},end:{dateTime:"2023-02-02T23:30:00+03:00",timeZone:"Asia/Amman"},transparency:"transparent",iCalUID:"0nsfi5ttd2b17ac76ma2f37oi9@google.com",sequence:1,attendees:[{email:"attende@test.com",responseStatus:"needsAction"},{email:"test@test.com",organizer:!0,self:!0,responseStatus:"accepted"}],reminders:{useDefault:!0},eventType:"default"},outputSchema:yt,type:"POLLING",async test({store:t,auth:e,propsValue:r,files:n}){return await He.test(Bc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent},files:n})},async onEnable({store:t,auth:e,propsValue:r}){await He.onEnable(Bc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent}})},async onDisable({store:t,auth:e,propsValue:r}){await He.onDisable(Bc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent}})},async run({store:t,auth:e,propsValue:r,files:n}){return await He.poll(Bc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent},files:n})}});var Uw=rt(Ja());var Mw=Pt({auth:Oe,name:"google-calendar-add-attendees",displayName:"Add Attendees to Event",description:"Add one or more person to existing event.",audience:"both",aiMetadata:{description:"Adds one or more guests (by email) to an existing Google Calendar event, identified by calendar and event ID, preserving the current attendee list. Use to invite people to an event that already exists rather than recreating it. Not idempotent: re-running appends the same emails again, producing duplicate attendee entries.",idempotent:!1},props:{calendar_id:fe.calendarDropdown("writer"),eventId:Q.ShortText({displayName:"Event ID",required:!0}),attendees:Q.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!0})},outputSchema:yt,async run(t){let{calendar_id:e,eventId:r}=t.propsValue,n=t.propsValue.attendees,i=await vr(t.auth),s=(0,Uw.calendar)({version:"v3",auth:i}),c=await s.events.get({calendarId:e,eventId:r}),d=c.data.attendees??[],p=[];return p.push(...d),p.push(...n.map(_=>({email:_}))),(await s.events.update({calendarId:e,eventId:r,requestBody:{...c.data,attendees:p}})).data}});var Nm=rt(ja());var jw=Pt({auth:Oe,name:"google_calendar_find_busy_free_periods",displayName:"Find Busy/Free Periods in Calendar",description:"Finds free/busy calendar details from Google Calendar.",audience:"both",aiMetadata:{description:"Queries one or more calendars for their busy time blocks within a given start/end window, without exposing event details. Use to check availability or find open slots before scheduling a meeting. Requires the calendars to check and a time range. Read-only and idempotent.",idempotent:!0},props:{calendar_ids:Q.MultiSelectDropdown({auth:Oe,displayName:"Calendars",description:"Select the calendars to check for busy periods.",required:!0,refreshers:[],options:o(async({auth:t})=>t?{disabled:!1,options:(await Mn(t)).map(n=>({label:n.summary,value:n.id}))}:{disabled:!0,placeholder:"Connect your account first",options:[]},"options")}),start_date:Q.DateTime({displayName:"Start Time",description:"The start of the time range to check.",required:!0}),end_date:Q.DateTime({displayName:"End Time",description:"The end of the time range to check.",required:!0})},outputSchema:xw,async run(t){let{calendar_ids:e,start_date:r,end_date:n}=t.propsValue,i=await Le(t.auth),s={timeMin:(0,Nm.default)(r).toISOString(),timeMax:(0,Nm.default)(n).toISOString(),items:e.map(p=>({id:p}))},c={method:"POST",url:`${fe.baseUrl}/freeBusy`,body:s,authentication:{type:"BEARER_TOKEN",token:i}};return(await Ge.sendRequest(c)).body}});var Lw=Pt({auth:Oe,name:"google_calendar_get_event_by_id",displayName:"Get Event by ID",description:"Fetch event details by its unique ID from Google Calendar.",audience:"both",aiMetadata:{description:"Fetches the full details of a single Google Calendar event by its unique event ID within a given calendar. Use when you already have an event ID (e.g. from a trigger or a list action) and need its details; use Get all Events to search when you do not. Requires a valid event ID. Read-only and idempotent.",idempotent:!0},props:{calendar_id:fe.calendarDropdown(),event_id:Q.ShortText({displayName:"Event ID",description:'The unique ID of the event (e.g., "abc123def456"). You can find this in the event URL or from other calendar actions.',required:!0}),max_attendees:Q.Number({displayName:"Max Attendees",description:"Maximum number of attendees to include in the response. If there are more attendees, only the participant is returned.",required:!1}),time_zone:Q.ShortText({displayName:"Time Zone",description:`Time zone for the response (e.g., "America/New_York", "Europe/London"). Defaults to the calendar's time zone if not specified.`,required:!1})},outputSchema:yt,async run(t){let{calendar_id:e,event_id:r,max_attendees:n,time_zone:i}=t.propsValue,s=await Le(t.auth);if(!e||typeof e!="string"||e.trim().length===0)throw new Error("Calendar ID is required");if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Event ID cannot be empty");if(r.length<5||r.length>1024)throw new Error("Event ID must be between 5 and 1024 characters");let c={};n!==void 0&&n>0&&(c.maxAttendees=n.toString()),i&&typeof i=="string"&&i.trim().length>0&&(c.timeZone=i.trim());let d=`${fe.baseUrl}/calendars/${encodeURIComponent(e.trim())}/events/${encodeURIComponent(r.trim())}`,p={method:"GET",url:d,queryParams:c,authentication:{type:"BEARER_TOKEN",token:s}};try{return(await Ge.sendRequest(p)).body}catch(h){throw h.response?.status===404?new Error(`Event with ID "${r}" not found in calendar "${e}". Please verify the event ID and calendar selection.`):h.response?.status===403?new Error(`Access denied to event "${r}" in calendar "${e}". Please check your permissions.`):h.response?.status===400?new Error("Invalid request parameters. Please check the event ID format and other parameters."):h.response?.status===401?new Error("Authentication failed. Please reconnect your Google Calendar account."):new Error(`Failed to fetch event: ${h.message||"Unknown error occurred"}`)}}});var Vc="google_calendar_watch",wi="google_calendar_sync_token",zm="google_calendar_seen_event_ids",B1=500;function Fw(t,{event_types:e,search_filter:r,exclude_all_day:n}){if(e&&e.length>0){let i=t.eventType||"default";if(!e.includes(i))return!1}if(r&&r.trim()){let i=r.toLowerCase().trim(),s=(t.summary||"").toLowerCase(),c=(t.description||"").toLowerCase(),d=(t.location||"").toLowerCase();if(!(s.includes(i)||c.includes(i)||d.includes(i)))return!1}return!(n&&t.start?.date&&!t.start?.dateTime)}o(Fw,"matchesFilters");var qw=Ut({auth:Oe,name:"new_event",displayName:"New Event",description:"Fires when a new event is created in a calendar.",aiMetadata:{description:"Fires when a brand-new event is created in the selected calendar (not on edits or cancellations), via Google push notifications. Each fired item is the new event; can be narrowed by event type, a text search across title/description/location, and an option to skip all-day events."},props:{calendar_id:fe.calendarDropdown("writer"),event_types:Q.StaticMultiSelectDropdown({displayName:"Event Types to Monitor",description:"Filter by specific event types (leave empty to monitor all event types)",required:!1,options:{options:[{label:"Default Events",value:"default"},{label:"Birthday Events",value:"birthday"},{label:"Focus Time",value:"focusTime"},{label:"Out of Office",value:"outOfOffice"},{label:"Working Location",value:"workingLocation"},{label:"From Gmail",value:"fromGmail"}]}}),search_filter:Q.ShortText({displayName:"Search Filter",description:"Only trigger for events containing this text in title, description, or location (optional)",required:!1}),exclude_all_day:Q.Checkbox({displayName:"Exclude All-Day Events",description:"Skip triggering for all-day events",required:!1,defaultValue:!1})},outputSchema:yt,type:"WEBHOOK",renewConfiguration:{strategy:"CRON",cronExpression:"0 */12 * * *"},sampleData:{kind:"calendar#event",etag:'"3419997894982000"',id:"sample_event_id_12345",status:"confirmed",htmlLink:"https://www.google.com/calendar/event?eid=c2FtcGxlX2V2ZW50X2lkXzEyMzQ1",created:"2025-08-15T11:02:27.000Z",updated:"2025-08-15T11:02:27.491Z",summary:"Team Sync",creator:{email:"creator@example.com"},organizer:{email:"creator@example.com",self:!0},start:{dateTime:"2025-08-18T10:00:00-07:00",timeZone:"America/Los_Angeles"},end:{dateTime:"2025-08-18T11:00:00-07:00",timeZone:"America/Los_Angeles"},iCalUID:"sample_event_id_12345@google.com",sequence:0,reminders:{useDefault:!0},eventType:"default"},async onEnable(t){let e=t.propsValue.calendar_id,r=t.auth,n=await Id(e,t.webhookUrl,r);await t.store.put(Vc,n);let i=await au({calendarId:e,authProp:r});ot(i)||await t.store.put(wi,i)},async onDisable(t){let e=t.auth,r=await t.store.get(Vc);r&&await Ad(r,e),await t.store.delete(wi),await t.store.delete(zm)},async onRenew(t){let e=t.propsValue.calendar_id,r=t.auth,n=await t.store.get(Vc);n&&await Ad(n,r);let i=await Id(e,t.webhookUrl,r);await t.store.put(Vc,i)},async run(t){let n=t.payload.headers["x-goog-resource-state"],i={event_types:t.propsValue.event_types,search_filter:t.propsValue.search_filter,exclude_all_day:t.propsValue.exclude_all_day};if(n==="sync")return[];if(n!=="exists")return[];let s=t.propsValue.calendar_id,c=t.auth,d=await t.store.get(wi);if(ot(d)){let g=await au({calendarId:s,authProp:c});return ot(g)||await t.store.put(wi,g),[]}let{items:p,nextSyncToken:h,syncTokenInvalid:_}=await Q_({calendarId:s,syncToken:d,authProp:c});if(_){let g=await au({calendarId:s,authProp:c});return ot(g)||await t.store.put(wi,g),[]}ot(h)||await t.store.put(wi,h);let m=await t.store.get(zm),f=new Set(m??[]),l=[];for(let g of p)!g.id||g.status==="cancelled"||f.has(g.id)||(f.add(g.id),Fw(g,i)&&l.push(g));if(f.size!==(m?.length??0)){let g=Array.from(f).slice(-B1);await t.store.put(zm,g)}return l},async test(t){let e=t.auth,r={event_types:t.propsValue.event_types,search_filter:t.propsValue.search_filter,exclude_all_day:t.propsValue.exclude_all_day},n=await tb(t.propsValue.calendar_id,e);return Fw(n,r)?[n]:[]}});var Gc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{if(r===0)return[];let{calendar_id:n,specific_event:i,event_id:s}=e;if(!n)return[];if(i&&!s)return[];let c=[];if(i&&s){let h={method:"GET",url:`${fe.baseUrl}/calendars/${n}/events/${s}`,authentication:{type:"BEARER_TOKEN",token:await Le(t)}};try{let m=(await Ge.sendRequest(h)).body,f=m.end?.dateTime??m.end?.date;f&&new Date(f).getTime()>r&&(c=[m])}catch(_){return console.error("Error fetching specific event:",_),[]}}else{let h={method:"GET",url:`${fe.baseUrl}/calendars/${n}/events`,authentication:{type:"BEARER_TOKEN",token:await Le(t)},queryParams:{singleEvents:"true",orderBy:"startTime",timeMin:new Date(r).toISOString()}};c=(await Ge.sendRequest(h)).body.items}let d=[],p=Date.now();for(let h of c){let _=h.end?.dateTime??h.end?.date;if(!_)continue;let m=new Date(_).getTime();m>r&&m<=p&&d.push({epochMilliSeconds:m,data:h})}return d},"items")},Bw=Ut({auth:Oe,name:"event_ends",displayName:"Event Ends",description:"Fires when an event ends.",aiMetadata:{description:"Fires once an event in the selected calendar reaches its end time, detected by polling. Each fired item is the event that just ended. Can watch all events in the calendar or be scoped to a single specific event."},props:{calendar_id:fe.calendarDropdown("writer"),specific_event:Q.Checkbox({displayName:"Target Specific Event",description:"Enable to monitor a specific event instead of all events in the calendar.",required:!1,defaultValue:!1}),event_id:fe.eventDropdown(!1)},outputSchema:yt,type:"POLLING",sampleData:{kind:"calendar#event",etag:'"3419997894982000"',id:"sample_event_id_67890",status:"confirmed",htmlLink:"https://www.google.com/calendar/event?eid=c2FtcGxlX2V2ZW50X2lkXzY3ODkw",created:"2025-08-14T09:00:00.000Z",updated:"2025-08-14T09:00:00.000Z",summary:"Project Deadline",creator:{email:"manager@example.com"},organizer:{email:"manager@example.com",self:!0},start:{dateTime:"2025-08-14T14:30:00+05:30",timeZone:"Asia/Kolkata"},end:{dateTime:"2025-08-14T15:30:00+05:30",timeZone:"Asia/Kolkata"},iCalUID:"sample_event_id_67890@google.com",sequence:0,reminders:{useDefault:!0},eventType:"default"},async onEnable(t){await He.onEnable(Gc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await He.onDisable(Gc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await He.poll(Gc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await He.test(Gc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var Hc={strategy:0,items:o(async({auth:t,propsValue:e})=>{let{calendar_id:r,specific_event:n,event_id:i,time_value:s,time_unit:c}=e;if(!r||!s||!c)return[];if(n&&!i)return[];let d=s*60*1e3;c==="hours"?d=s*60*60*1e3:c==="days"&&(d=s*24*60*60*1e3);let p=Date.now(),h=5*60*1e3,_=new Date(p+d).toISOString(),m=new Date(p+d+h).toISOString(),f=[];if(n&&i){let l={method:"GET",url:`${fe.baseUrl}/calendars/${r}/events/${i}`,authentication:{type:"BEARER_TOKEN",token:await Le(t)}};try{let v=(await Ge.sendRequest(l)).body,E=new Date(v.start?.dateTime??v.start?.date??0).getTime()-d;E>=p&&E<=p+h&&(f=[v])}catch(g){return console.error("Error fetching specific event:",g),[]}}else{let l={method:"GET",url:`${fe.baseUrl}/calendars/${r}/events`,authentication:{type:"BEARER_TOKEN",token:await Le(t)},queryParams:{singleEvents:"true",orderBy:"startTime",timeMin:_,timeMax:m}};f=(await Ge.sendRequest(l)).body.items}return f.map(l=>({epochMilliSeconds:new Date(l.start?.dateTime??l.start?.date??0).getTime()-d,data:l}))},"items")},Vw=Ut({auth:Oe,name:"event_starts_in",displayName:"Event Start (Time Before)",description:"Fires at a specified amount of time before an event starts (e.g., a reminder).",aiMetadata:{description:"Fires a configurable lead time (in minutes, hours, or days) before an event in the selected calendar begins, acting as a pre-event reminder. Each fired item is the upcoming event. Can watch all events or a single specific event."},props:{calendar_id:fe.calendarDropdown("writer"),specific_event:Q.Checkbox({displayName:"Target Specific Event",description:"Enable to monitor a specific event instead of all events in the calendar.",required:!1,defaultValue:!1}),event_id:fe.eventDropdown(!1),time_value:Q.Number({displayName:"Time Before",description:"The amount of time before the event starts.",required:!0,defaultValue:15}),time_unit:Q.StaticDropdown({displayName:"Time Unit",required:!0,options:{options:[{label:"Minutes",value:"minutes"},{label:"Hours",value:"hours"},{label:"Days",value:"days"}]},defaultValue:"minutes"})},outputSchema:yt,type:"POLLING",sampleData:{},async onEnable(t){await He.onEnable(Hc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await He.onDisable(Hc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await He.poll(Hc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await He.test(Hc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var Wc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let{calendar_id:n,search_term:i,event_types:s,search_fields:c}=e;if(!n||!i)return[];let d;r===0?(d=new Date,d.setDate(d.getDate()-1)):d=new Date(r);let p={singleEvents:"true",orderBy:"updated",updatedMin:d.toISOString(),q:i};s&&s.length>0&&s.forEach(l=>{p.eventTypes?p.eventTypes+="&eventTypes="+l:p.eventTypes=l});let h={method:"GET",url:`${fe.baseUrl}/calendars/${n}/events`,authentication:{type:"BEARER_TOKEN",token:await Le(t)},queryParams:p};return(await Ge.sendRequest(h)).body.items.filter(l=>{let g=new Date(l.created??0).getTime();if(!(new Date(l.updated??0).getTime()-g<5e3))return!1;if(c&&c.length>0){let E=i.toLowerCase();return c.some(k=>{switch(k){case"summary":return l.summary?.toLowerCase().includes(E)||!1;case"description":return l.description?.toLowerCase().includes(E)||!1;case"location":return l.location?.toLowerCase().includes(E)||!1;case"attendees":return l.attendees?.some(L=>L.email?.toLowerCase().includes(E)||L.displayName?.toLowerCase().includes(E))||!1;default:return!1}})}return!0}).map(l=>({epochMilliSeconds:new Date(l.updated).getTime(),data:l}))},"items")},Gw=Ut({auth:Oe,name:"new_event_matching_search",displayName:"New Event Matching Search",description:"Fires when a new event is created that matches a specified search term.",aiMetadata:{description:"Fires when a newly created event in the selected calendar matches a required search term (matched across title, description, location, and attendees by default, or restricted to chosen fields). Each fired item is the matching new event; can also be filtered by event type."},props:{calendar_id:fe.calendarDropdown("writer"),search_term:Q.ShortText({displayName:"Search Term",description:"The keyword(s) to search for in new events (searches across title, description, location, and attendees by default).",required:!0}),event_types:Q.StaticMultiSelectDropdown({displayName:"Event Types",description:"Filter by specific event types (optional)",required:!1,options:{options:[{label:"Default Events",value:"default"},{label:"Birthday Events",value:"birthday"},{label:"Focus Time",value:"focusTime"},{label:"Out of Office",value:"outOfOffice"},{label:"Working Location",value:"workingLocation"},{label:"From Gmail",value:"fromGmail"}]}}),search_fields:Q.StaticMultiSelectDropdown({displayName:"Search In Fields",description:"Specify which fields to search in (leave empty to use Google's default search across all fields)",required:!1,options:{options:[{label:"Event Title/Summary",value:"summary"},{label:"Event Description",value:"description"},{label:"Event Location",value:"location"},{label:"Attendee Names/Emails",value:"attendees"}]}})},outputSchema:yt,type:"POLLING",sampleData:{id:"abc123def456",summary:"Final Project Review",description:"Review of the Q3 final project deliverables.",status:"confirmed",created:"2025-08-14T09:05:00.000Z",updated:"2025-08-14T09:05:01.000Z",start:{dateTime:"2025-09-01T10:00:00-07:00"},end:{dateTime:"2025-09-01T11:30:00-07:00"},organizer:{email:"project.manager@example.com"}},async onEnable(t){await He.onEnable(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await He.onDisable(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await He.poll(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await He.test(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var Zc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let{calendar_id:n,specific_event:i,event_id:s,cancellation_reason:c}=e;if(!n)return[];if(i&&!s)return[];let d;r===0?(d=new Date,d.setDate(d.getDate()-1)):d=new Date(r);let p=[];if(i&&s){let h={method:"GET",url:`${fe.baseUrl}/calendars/${n}/events/${s}`,authentication:{type:"BEARER_TOKEN",token:await Le(t)}};try{let m=(await Ge.sendRequest(h)).body;new Date(m.updated??0).getTime()>r&&m.status==="cancelled"&&(p=[m])}catch(_){return console.error("Error fetching specific event:",_),[]}}else p=(await aa(n,!0,t,d)).filter(_=>_.status==="cancelled");return c&&c.length>0&&(p=p.filter(h=>c.some(_=>{switch(_){case"deleted":return!h.summary||h.summary.includes("Deleted");case"declined":return h.attendees?.some(m=>m.responseStatus==="declined")||!1;case"rescheduled":return h.summary?.toLowerCase().includes("rescheduled")||h.description?.toLowerCase().includes("rescheduled")||!1;case"other":return!0;default:return!0}}))),p.map(h=>({epochMilliSeconds:new Date(h.updated).getTime(),data:h}))},"items")},Hw=Ut({auth:Oe,name:"event_cancelled",displayName:"Event Cancelled",description:"Fires when an event is canceled or deleted.",aiMetadata:{description:"Fires when an event in the selected calendar transitions to a cancelled (or deleted) state, detected by polling. Each fired item is the cancelled event; can optionally be filtered by cancellation reason (deleted, attendee declined, rescheduled, other) and scoped to a single specific event."},props:{calendar_id:fe.calendarDropdown("writer"),specific_event:Q.Checkbox({displayName:"Target Specific Event",description:"Enable to monitor a specific event instead of all events in the calendar.",required:!1,defaultValue:!1}),event_id:fe.eventDropdown(!1),cancellation_reason:Q.StaticMultiSelectDropdown({displayName:"Cancellation Reasons",description:"Filter by specific types of cancellations (optional)",required:!1,options:{options:[{label:"Event Deleted",value:"deleted"},{label:"Attendee Declined",value:"declined"},{label:"Event Rescheduled",value:"rescheduled"},{label:"Other Cancellations",value:"other"}]}})},outputSchema:yt,type:"POLLING",sampleData:{id:"abc123def456_cancelled",summary:"Cancelled: Q3 Planning Session",status:"cancelled",created:"2025-07-20T10:00:00.000Z",updated:"2025-08-14T09:30:00.000Z",organizer:{email:"project.manager@example.com"},start:{dateTime:"2025-08-25T10:00:00-07:00"},end:{dateTime:"2025-08-25T11:30:00-07:00"}},async onEnable(t){await He.onEnable(Zc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await He.onDisable(Zc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await He.poll(Zc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await He.test(Zc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var Um={strategy:1,items:o(async({auth:t,store:e,propsValue:r})=>{let{access_role_filter:n,calendar_name_filter:i,exclude_shared:s}=r,d=await Mn(t);if(n&&n.length>0&&(d=d.filter(f=>n.includes(f.accessRole))),i&&i.trim()){let f=i.toLowerCase().trim();d=d.filter(l=>l.summary?.toLowerCase().includes(f)||l.description?.toLowerCase().includes(f))}s&&(d=d.filter(f=>f.accessRole==="owner"||f.primary));let p=d.map(f=>f.id),h=await e.get("calendars")||[],_=new Set(h),m=d.filter(f=>!_.has(f.id));return await e.put("calendars",p),m.map(f=>({id:f.id,data:{...f,isOwned:f.accessRole==="owner"||f.primary,isShared:f.accessRole!=="owner"&&!f.primary,calendarType:f.primary?"primary":f.accessRole==="owner"?"owned":"shared"}}))},"items")},Ww=Ut({auth:Oe,name:"new_calendar",displayName:"New Calendar",description:"Fires when a new calendar is created or becomes accessible.",aiMetadata:{description:"Fires when a calendar newly appears in the connected account's calendar list, whether created or shared in, detected by polling. Each fired item is the new calendar. Can be filtered by access role, a name/description text match, and an option to exclude shared calendars."},props:{access_role_filter:Q.StaticMultiSelectDropdown({displayName:"Access Role Filter",description:"Only trigger for calendars with specific access roles (optional)",required:!1,options:{options:[{label:"Owner",value:"owner"},{label:"Writer",value:"writer"},{label:"Reader",value:"reader"},{label:"Free/Busy Reader",value:"freeBusyReader"}]}}),calendar_name_filter:Q.ShortText({displayName:"Calendar Name Filter",description:"Only trigger for calendars containing this text in name or description (optional)",required:!1}),exclude_shared:Q.Checkbox({displayName:"Exclude Shared Calendars",description:"Only trigger for calendars you own, not shared calendars",required:!1,defaultValue:!1})},outputSchema:Pw,type:"POLLING",sampleData:{id:"sample_calendar_id@group.calendar.google.com",summary:"New Project Team Calendar",description:"A shared calendar for the new project team.",timeZone:"Asia/Kolkata",backgroundColor:"#9fe1e7",foregroundColor:"#000000",accessRole:"owner",isOwned:!0,isShared:!1,calendarType:"owned",primary:!1},async onEnable(t){let e=await Mn(t.auth),{access_role_filter:r,calendar_name_filter:n,exclude_shared:i}=t.propsValue,s=e;if(r&&r.length>0&&(s=s.filter(c=>r.includes(c.accessRole))),n&&n.trim()){let c=n.toLowerCase().trim();s=s.filter(d=>d.summary?.toLowerCase().includes(c)||d.description?.toLowerCase().includes(c))}i&&(s=s.filter(c=>c.accessRole==="owner"||c.primary)),await t.store.put("calendars",s.map(c=>c.id)),await He.onEnable(Um,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await He.onDisable(Um,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await He.poll(Um,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return(await Mn(t.auth)).slice(-1).map(n=>({id:n.id,data:{...n,isOwned:n.accessRole==="owner"||n.primary,isShared:n.accessRole!=="owner"&&!n.primary,calendarType:n.primary?"primary":n.accessRole==="owner"?"owned":"shared"}}))}});var V1=qy({minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/google-calendar.png",categories:["PRODUCTIVITY"],displayName:"Google Calendar",description:"Get organized and stay on schedule",authors:["OsamaHaikal","bibhuty-did-this","Vitalini","pfernandez98","kishanprmr","MoShizzle","khaledmashaly","abuaboud","ikus060","Cloudieunnie","sanket-a11y","geekyme"],auth:Oe,actions:[Mw,Cw,Rw,kw,Nw,$w,jw,Lw,Y_({auth:Oe,baseUrl(){return fe.baseUrl},authMapping:o(async t=>({Authorization:`Bearer ${await Le(t)}`}),"authMapping")})],triggers:[zw,qw,Bw,Vw,Gw,Hw,Ww]});0&&(module.exports={createGoogleClient,getAccessToken,googleCalendar,googleCalendarAuth});
|
|
68
|
+
`)}b+=v,e.data=b}if(o(_,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,i){r.uploadType="multipart";let l=[{"content-type":"application/json",body:JSON.stringify(i)},{"content-type":n.mimeType||i&&i.mimeType||c,body:n.body}];(0,xm.isBrowser)()?_(l):h(l)}else r.uploadType="media",Object.assign(d,{"content-type":n.mimeType||c}),e.data=n.body;else e.data=i||void 0;if(e.headers=Tm.Gaxios.mergeHeaders(e.headers||{},d),e.params=r,!(0,xm.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:hw.version,comment:"gzip"});let l=e.userAgentDirectives.map(g=>{let v=`${g.product}/${g.version}`;return g.comment&&(v+=` (${g.comment})`),v}).join(" ");e.headers.set("User-Agent",l)}if(e.validateStatus||(e.validateStatus=l=>l>=200&&l<300||l===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 m=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,f=e.universeDomain??e.universe_domain??m??"googleapis.com";if(f!=="googleapis.com"&&e.url){let l=new URL(e.url);l.hostname.endsWith(".googleapis.com")&&(l.hostname=l.hostname.replace(/googleapis\.com$/,f),e.url=l.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let l=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(l&&f!==l)throw new Error(`The configured universe domain (${f}) does not match the universe domain found in the credentials (${l}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let g=await s.getRequestHeaders(e.url),v=Object.assign({},e);return v.headers=Tm.Gaxios.mergeHeaders(v.headers,g),I1.request(v)}else{let g=await s.request(e);return(0,wm.marshallGaxiosResponse)(g)}}else return new Tm.Gaxios().request(e).then(l=>(0,wm.marshallGaxiosResponse)(l))}o(fw,"createAPIRequestAsync");var Am=class extends mw.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 $1(t,e){(0,xm.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${hw.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o($1,"populateAPIHeader")});var gw=D(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.AuthPlus=void 0;var _n=Ma(),Rm=class extends _n.GoogleAuth{static{o(this,"AuthPlus")}JWT=_n.JWT;Compute=_n.Compute;OAuth2=_n.OAuth2Client;GoogleAuth=_n.GoogleAuth;AwsClient=_n.AwsClient;IdentityPoolClient=_n.IdentityPoolClient;ExternalAccountClient=_n.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new _n.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=Rm});var Om=D(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.Endpoint=void 0;var yw=Nc(),Cm=class{static{o(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,i){if(this.applyMethodsFromSchema(e,r,n,i),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let c=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,c,i)}}}applyMethodsFromSchema(e,r,n,i){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let c=n.methods[s];e[s]=this.makeMethod(r,c,i)}}}makeMethod(e,r,n){return(i,s)=>{let c=typeof i=="function"?{}:i;s=typeof i=="function"?i:s;let d=vw(e.rootUrl+e.servicePath+r.path),p={options:{url:d.substring(1,d.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:c,requiredParams:r.parameterOrder||[],pathParams:this.getPathParams(r.parameters),context:n};if(r.mediaUpload&&r.mediaUpload.protocols&&r.mediaUpload.protocols.simple&&r.mediaUpload.protocols.simple.path){let h=vw(e.rootUrl+r.mediaUpload.protocols.simple.path);p.mediaUrl=h.substring(1,h.length-1)}if(!s)return(0,yw.createAPIRequest)(p);(0,yw.createAPIRequest)(p,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=Cm;function vw(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(vw,"buildurl")});var bw=D(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.Discovery=void 0;var k1=require("fs"),D1=ft(),N1=require("url"),_w=require("util"),z1=Nc(),U1=Om(),M1=_w.promisify(k1.readFile),$m=class{static{o(this,"Discovery")}transporter=new D1.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new U1.Endpoint(r);return n.applySchema(n,e,e,n),n}}log(...e){this.options&&this.options.debug&&console.log(...e)}async discoverAllAPIs(e){let r=new Headers(this.options.includePrivate?{}:{"X-User-Ip":"0.0.0.0"}),i=(await this.transporter.request({url:e,headers:r})).data.items,s=await Promise.all(i.map(async p=>{let h=await this.discoverAPI(p.discoveryRestUrl);return{api:p,endpointCreator:h}})),c={},d={};for(let p of s)d[p.api.name]||(c[p.api.name]={},d[p.api.name]=h=>{let _=typeof h,m;if(_==="string")m=h,h={};else if(_==="object")m=h.version,delete h.version;else throw new Error("Argument error: Accepts only string or object");try{let f=p.endpointCreator(h,this);return Object.freeze(f)}catch(f){throw new Error(_w.format('Unable to load endpoint %s("%s"): %s',p.api.name,m,f.message))}}),c[p.api.name][p.api.version]=p.endpointCreator;return d}async discoverAPI(e){if(typeof e=="string"){let r=N1.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await M1(e,{encoding:"utf8"});return this.makeEndpoint(JSON.parse(n))}else{this.log("Requesting "+e);let n=await this.transporter.request({url:e});return this.makeEndpoint(n.data)}}else{let r=e;this.log("Requesting "+r.url);let n=r.url;delete r.url;let i={options:{url:n,method:"GET"},requiredParams:[],pathParams:[],params:r,context:{google:{_options:{}},_options:{}}},s=await(0,z1.createAPIRequest)(i);return this.makeEndpoint(s.data)}}};Mc.Discovery=$m});var jc=D(Ae=>{"use strict";var j1=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]}),L1=Ae&&Ae.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j1(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=Ma();Ae.gaxios=ft();var bn=Ma();Object.defineProperty(Ae,"OAuth2Client",{enumerable:!0,get:o(function(){return bn.OAuth2Client},"get")});Object.defineProperty(Ae,"JWT",{enumerable:!0,get:o(function(){return bn.JWT},"get")});Object.defineProperty(Ae,"Compute",{enumerable:!0,get:o(function(){return bn.Compute},"get")});Object.defineProperty(Ae,"UserRefreshClient",{enumerable:!0,get:o(function(){return bn.UserRefreshClient},"get")});Object.defineProperty(Ae,"GoogleAuth",{enumerable:!0,get:o(function(){return bn.GoogleAuth},"get")});Object.defineProperty(Ae,"ExternalAccountClient",{enumerable:!0,get:o(function(){return bn.ExternalAccountClient},"get")});Object.defineProperty(Ae,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return bn.BaseExternalAccountClient},"get")});Object.defineProperty(Ae,"IdentityPoolClient",{enumerable:!0,get:o(function(){return bn.IdentityPoolClient},"get")});Object.defineProperty(Ae,"AwsClient",{enumerable:!0,get:o(function(){return bn.AwsClient},"get")});var Ew=ft();Object.defineProperty(Ae,"Gaxios",{enumerable:!0,get:o(function(){return Ew.Gaxios},"get")});Object.defineProperty(Ae,"GaxiosError",{enumerable:!0,get:o(function(){return Ew.GaxiosError},"get")});var F1=dT();Object.defineProperty(Ae,"getAPI",{enumerable:!0,get:o(function(){return F1.getAPI},"get")});var q1=Nc();Object.defineProperty(Ae,"createAPIRequest",{enumerable:!0,get:o(function(){return q1.createAPIRequest},"get")});var B1=gw();Object.defineProperty(Ae,"AuthPlus",{enumerable:!0,get:o(function(){return B1.AuthPlus},"get")});var V1=bw();Object.defineProperty(Ae,"Discovery",{enumerable:!0,get:o(function(){return V1.Discovery},"get")});var G1=Om();Object.defineProperty(Ae,"Endpoint",{enumerable:!0,get:o(function(){return G1.Endpoint},"get")});L1(Dc(),Ae)});var Pw=D(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.calendar_v3=void 0;var ne=jc(),Sw;(function(t){class e{static{o(this,"Calendar")}context;acl;calendarList;calendars;channels;colors;events;freebusy;settings;constructor(m,f){this.context={_options:m||{},google:f},this.acl=new r(this.context),this.calendarList=new n(this.context),this.calendars=new i(this.context),this.channels=new s(this.context),this.colors=new c(this.context),this.events=new d(this.context),this.freebusy=new p(this.context),this.settings=new h(this.context)}}t.Calendar=e;class r{static{o(this,"Resource$Acl")}context;constructor(m){this.context=m}delete(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}get(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}insert(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}list(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}patch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}update(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}watch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/acl/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Acl=r;class n{static{o(this,"Resource$Calendarlist")}context;constructor(m){this.context=m}delete(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}get(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}insert(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}list(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}patch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}update(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}watch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/calendarList/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Calendarlist=n;class i{static{o(this,"Resource$Calendars")}context;constructor(m){this.context=m}clear(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/clear").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}delete(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}get(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}insert(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}patch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}update(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Calendars=i;class s{static{o(this,"Resource$Channels")}context;constructor(m){this.context=m}stop(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Channels=s;class c{static{o(this,"Resource$Colors")}context;constructor(m){this.context=m}get(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/colors").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Colors=c;class d{static{o(this,"Resource$Events")}context;constructor(m){this.context=m}delete(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}get(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}import(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/import").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}insert(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}instances(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/{eventId}/instances").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}list(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}move(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/{eventId}/move").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId","destination"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}patch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}quickAdd(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/quickAdd").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId","text"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}update(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}watch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/calendars/{calendarId}/events/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Events=d;class p{static{o(this,"Resource$Freebusy")}context;constructor(m){this.context=m}query(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/freeBusy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Freebusy=p;class h{static{o(this,"Resource$Settings")}context;constructor(m){this.context=m}get(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/settings/{setting}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["setting"],pathParams:["setting"],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}list(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/settings").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}watch(m,f,l){let g=m||{},v=f||{};typeof m=="function"&&(l=m,g={},v={}),typeof f=="function"&&(l=f,v={});let b=v.rootUrl||"https://www.googleapis.com/",E={options:Object.assign({url:(b+"/calendar/v3/users/me/settings/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,ne.createAPIRequest)(E,l);else return(0,ne.createAPIRequest)(E)}}t.Resource$Settings=h})(Sw||(Lc.calendar_v3=Sw={}))});var Ja=D(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.AuthPlus=_r.calendar_v3=_r.auth=_r.VERSIONS=void 0;_r.calendar=H1;var Tw=jc(),ww=Pw();Object.defineProperty(_r,"calendar_v3",{enumerable:!0,get:o(function(){return ww.calendar_v3},"get")});_r.VERSIONS={v3:ww.calendar_v3.Calendar};function H1(t){return(0,Tw.getAPI)("calendar",t,_r.VERSIONS,this)}o(H1,"calendar");var W1=new Tw.AuthPlus;_r.auth=W1;var Z1=jc();Object.defineProperty(_r,"AuthPlus",{enumerable:!0,get:o(function(){return Z1.AuthPlus},"get")})});var Y1={};ws(Y1,{createGoogleClient:()=>vr,getAccessToken:()=>Le,googleCalendar:()=>J1,googleCalendarAuth:()=>Oe});module.exports=UA(Y1);var MA=Object.freeze({status:"aborted"});function le(t,e,r){function n(d,p){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:p,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(t))return;d._zod.traits.add(t),e(d,p);let h=c.prototype,_=Object.keys(h);for(let m=0;m<_.length;m++){let f=_[m];f in d||(d[f]=h[f].bind(d))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(d){var p;let h=r?.Parent?new s:this;n(h,d),(p=h._zod).deferred??(p.deferred=[]);for(let _ of h._zod.deferred)_();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}o(le,"$constructor");var jA=Symbol("zod_brand"),Nr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},xs=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},El={};function an(t){return t&&Object.assign(El,t),El}o(an,"config");function Pl(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(Pl,"getEnumValues");function qh(t,e){return typeof e=="bigint"?e.toString():e}o(qh,"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")}}}o(Is,"cached");function Bh(t){return t==null}o(Bh,"nullish");function Rs(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(Rs,"cleanRegex");var Fh=Symbol("evaluating");function mt(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Fh)return n===void 0&&(n=Fh,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(mt,"defineLazy");var Tl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function zi(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(zi,"isObject");var LA=Is(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Vh(t){if(zi(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(zi(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Vh,"isPlainObject");var Gh=new Set(["string","number","symbol"]);function zo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(zo,"escapeRegex");function Cs(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}o(Cs,"clone");function ut(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(ut,"normalizeParams");function Hh(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(Hh,"optionalKeys");var FA={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 Uo(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(Uo,"aborted");function Rn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(Rn,"prefixIssues");function As(t){return typeof t=="string"?t:t?.message}o(As,"unwrapMessage");function Cn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=As(t.inst?._zod.def?.error?.(t))??As(e?.error?.(t))??As(r.customError?.(t))??As(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(Cn,"finalizeIssue");function Wh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(Wh,"getLengthableOrigin");function wl(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o(wl,"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,qh,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),Kh=le("$ZodError",Zh),Ui=le("$ZodError",Zh,{Parent:Error});var BA=o(t=>(e,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new Nr;if(c.issues.length){let d=new(i?.Err??t)(c.issues.map(p=>Cn(p,s,an())));throw Tl(d,i?.callee),d}return c.value},"_parse"),Os=BA(Ui),VA=o(t=>async(e,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??t)(c.issues.map(p=>Cn(p,s,an())));throw Tl(d,i?.callee),d}return c.value},"_parseAsync"),$s=VA(Ui),GA=o(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Nr;return s.issues.length?{success:!1,error:new(t??Kh)(s.issues.map(c=>Cn(c,i,an())))}:{success:!0,data:s.value}},"_safeParse"),Mi=GA(Ui),HA=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>Cn(c,i,an())))}:{success:!0,data:s.value}},"_safeParseAsync"),ji=HA(Ui);var WA="(?:(?:\\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])))",ZA=new RegExp(`^${WA}$`);var Jh=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),Yh=/^-?\d+n?$/;var xl=/^-?\d+(?:\.\d+)?$/,Xh=/^(?:true|false)$/i;var Mo=le("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])});var Qh=le("$ZodCheckMinLength",(t,e)=>{var r;Mo.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Bh(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let c=Wh(i);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var Al=le("$ZodCheckStringFormat",(t,e)=>{var r,n;Mo.init(t,e),t._zod.onattach.push(i=>{let s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),eg=le("$ZodCheckRegex",(t,e)=>{Al.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 rg={major:4,minor:3,patch:6};var ct=le("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=rg;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let s of i._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=o((c,d,p)=>{let h=Uo(c),_;for(let m of d){if(m._zod.def.when){if(!m._zod.def.when(c))continue}else if(h)continue;let f=c.issues.length,l=m._zod.check(c);if(l instanceof Promise&&p?.async===!1)throw new Nr;if(_||l instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await l,c.issues.length!==f&&(h||(h=Uo(c,f)))});else{if(c.issues.length===f)continue;h||(h=Uo(c,f))}}return _?_.then(()=>c):c},"runChecks"),s=o((c,d,p)=>{if(Uo(c))return c.aborted=!0,c;let h=i(d,n,p);if(h instanceof Promise){if(p.async===!1)throw new Nr;return h.then(_=>t._zod.parse(_,p))}return t._zod.parse(h,p)},"handleCanaryResult");t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){let h=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(_=>s(_,c,d)):s(h,c,d)}let p=t._zod.parse(c,d);if(p instanceof Promise){if(d.async===!1)throw new Nr;return p.then(h=>i(h,n,d))}return i(p,n,d)}}mt(t,"~standard",()=>({validate:o(i=>{try{let s=Mi(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return ji(t,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ns=le("$ZodString",(t,e)=>{ct.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Jh(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}}),Il=le("$ZodStringFormat",(t,e)=>{Al.init(t,e),Ns.init(t,e)});var sg=le("$ZodURL",(t,e)=>{Il.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 ug=le("$ZodNumber",(t,e)=>{ct.init(t,e),t._zod.pattern=t._zod.bag.pattern??xl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}});var Rl=le("$ZodBoolean",(t,e)=>{ct.init(t,e),t._zod.pattern=Xh,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}}),cg=le("$ZodBigInt",(t,e)=>{ct.init(t,e),t._zod.pattern=Yh,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 lg=le("$ZodAny",(t,e)=>{ct.init(t,e),t._zod.parse=r=>r}),dg=le("$ZodUnknown",(t,e)=>{ct.init(t,e),t._zod.parse=r=>r});var pg=le("$ZodVoid",(t,e)=>{ct.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}}),fg=le("$ZodDate",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:t}),r}});function ng(t,e,r){t.issues.length&&e.issues.push(...Rn(r,t.issues)),e.value[r]=t.value}o(ng,"handleArrayResult");var mg=le("$ZodArray",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let s=[];for(let c=0;c<i.length;c++){let d=i[c],p=e.element._zod.run({value:d,issues:[]},n);p instanceof Promise?s.push(p.then(h=>ng(h,r,c))):ng(p,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Ds(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...Rn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(Ds,"handlePropertyResult");function KA(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=Hh(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(KA,"normalizeDef");function JA(t,e,r,n,i,s){let c=[],d=i.keySet,p=i.catchall._zod,h=p.def.type,_=p.optout==="optional";for(let m in e){if(d.has(m))continue;if(h==="never"){c.push(m);continue}let f=p.run({value:e[m],issues:[]},n);f instanceof Promise?t.push(f.then(l=>Ds(l,r,m,e,_))):Ds(f,r,m,e,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}o(JA,"handleCatchall");var hg=le("$ZodObject",(t,e)=>{if(ct.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let d=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let p={...d};return Object.defineProperty(e,"shape",{value:p}),p},"get")})}let n=Is(()=>KA(e));mt(t._zod,"propValues",()=>{let d=e.shape,p={};for(let h in d){let _=d[h]._zod;if(_.values){p[h]??(p[h]=new Set);for(let m of _.values)p[h].add(m)}}return p});let i=zi,s=e.catchall,c;t._zod.parse=(d,p)=>{c??(c=n.value);let h=d.value;if(!i(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),d;d.value={};let _=[],m=c.shape;for(let f of c.keys){let l=m[f],g=l._zod.optout==="optional",v=l._zod.run({value:h[f],issues:[]},p);v instanceof Promise?_.push(v.then(b=>Ds(b,d,f,h,g))):Ds(v,d,f,h,g)}return s?JA(_,h,d,p,n.value,t):_.length?Promise.all(_).then(()=>d):d}});function og(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let i=t.filter(s=>!Uo(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>Cn(c,n,an())))}),e)}o(og,"handleUnionResults");var Cl=le("$ZodUnion",(t,e)=>{ct.init(t,e),mt(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),mt(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),mt(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),mt(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Rs(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,d=[];for(let p of e.options){let h=p._zod.run({value:i.value,issues:[]},s);if(h instanceof Promise)d.push(h),c=!0;else{if(h.issues.length===0)return h;d.push(h)}}return c?Promise.all(d).then(p=>og(p,i,t,s)):og(d,i,t,s)}});var gg=le("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Cl.init(t,e);let r=t._zod.parse;mt(t._zod,"propValues",()=>{let i={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[d,p]of Object.entries(c)){i[d]||(i[d]=new Set);for(let h of p)i[d].add(h)}}return i});let n=Is(()=>{let i=e.options,s=new Map;for(let c of i){let d=c._zod.propValues?.[e.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let p of d){if(s.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);s.set(p,c)}}return s});t._zod.parse=(i,s)=>{let c=i.value;if(!zi(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),i;let d=n.value.get(c?.[e.discriminator]);return d?d._zod.run(i,s):e.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:c,path:[e.discriminator],inst:t}),i)}});var yg=le("$ZodRecord",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Vh(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let s=[],c=e.keyType._zod.values;if(c){r.value={};let d=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){d.add(typeof h=="number"?h.toString():h);let _=e.valueType._zod.run({value:i[h],issues:[]},n);_ instanceof Promise?s.push(_.then(m=>{m.issues.length&&r.issues.push(...Rn(h,m.issues)),r.value[h]=m.value})):(_.issues.length&&r.issues.push(...Rn(h,_.issues)),r.value[h]=_.value)}let p;for(let h in i)d.has(h)||(p=p??[],p.push(h));p&&p.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:p})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let p=e.keyType._zod.run({value:d,issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&xl.test(d)&&p.issues.length){let m=e.keyType._zod.run({value:Number(d),issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(p=m)}if(p.issues.length){e.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(m=>Cn(m,n,an())),input:d,path:[d],inst:t});continue}let _=e.valueType._zod.run({value:i[d],issues:[]},n);_ instanceof Promise?s.push(_.then(m=>{m.issues.length&&r.issues.push(...Rn(d,m.issues)),r.value[p.value]=m.value})):(_.issues.length&&r.issues.push(...Rn(d,_.issues)),r.value[p.value]=_.value)}}return s.length?Promise.all(s).then(()=>r):r}});var vg=le("$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(i=>Gh.has(typeof i)).map(i=>typeof i=="string"?zo(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:t}),i}}),_g=le("$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"?zo(n):n?zo(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var bg=le("$ZodTransform",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new xs(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new Nr;return r.value=i,r}});function ig(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(ig,"handleOptionalResult");var Eg=le("$ZodOptional",(t,e)=>{ct.init(t,e),t._zod.optin="optional",t._zod.optout="optional",mt(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),mt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Rs(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>ig(s,r.value)):ig(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var Sg=le("$ZodNullable",(t,e)=>{ct.init(t,e),mt(t._zod,"optin",()=>e.innerType._zod.optin),mt(t._zod,"optout",()=>e.innerType._zod.optout),mt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Rs(r.source)}|null)$`):void 0}),mt(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=le("$ZodPipe",(t,e)=>{ct.init(t,e),mt(t._zod,"values",()=>e.in._zod.values),mt(t._zod,"optin",()=>e.in._zod.optin),mt(t._zod,"optout",()=>e.out._zod.optout),mt(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(c=>ks(c,e.in,n)):ks(s,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>ks(s,e.out,n)):ks(i,e.out,n)}});function ks(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(ks,"handlePipeResult");var Tg=le("$ZodCustom",(t,e)=>{Mo.init(t,e),ct.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(s=>ag(s,r,n,t));ag(i,r,n,t)}});function ag(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(wl(i))}}o(ag,"handleRefineResult");var xg,eI=Symbol("ZodOutput"),tI=Symbol("ZodInput"),Ol=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ag(){return new Ol}o(Ag,"registry");(xg=globalThis).__zod_globalRegistry??(xg.__zod_globalRegistry=Ag());var $l=globalThis.__zod_globalRegistry;function Ig(t,e){return new t({type:"string",...ut(e)})}o(Ig,"_string");function Rg(t,e){return new t({type:"string",coerce:!0,...ut(e)})}o(Rg,"_coercedString");function Cg(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...ut(e)})}o(Cg,"_url");function Og(t,e){return new t({type:"number",checks:[],...ut(e)})}o(Og,"_number");function $g(t,e){return new t({type:"number",coerce:!0,checks:[],...ut(e)})}o($g,"_coercedNumber");function kg(t,e){return new t({type:"boolean",...ut(e)})}o(kg,"_boolean");function Dg(t,e){return new t({type:"boolean",coerce:!0,...ut(e)})}o(Dg,"_coercedBoolean");function Ng(t,e){return new t({type:"bigint",coerce:!0,...ut(e)})}o(Ng,"_coercedBigint");function zg(t){return new t({type:"any"})}o(zg,"_any");function Ug(t){return new t({type:"unknown"})}o(Ug,"_unknown");function Mg(t,e){return new t({type:"void",...ut(e)})}o(Mg,"_void");function jg(t,e){return new t({type:"date",coerce:!0,...ut(e)})}o(jg,"_coercedDate");function Pr(t,e){return new Qh({check:"min_length",...ut(e),minimum:t})}o(Pr,"_minLength");function On(t,e){return new eg({check:"string_format",format:"regex",...ut(e),pattern:t})}o(On,"_regex");function Lg(t,e,r){let n=ut(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(Lg,"_custom");var ht=le("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)=>Os(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Mi(t,r,n),t.parseAsync=async(r,n)=>$s(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>ji(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)=>Cs(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.apply=r=>r(t)}),Us=le("ZodMiniString",(t,e)=>{Ns.init(t,e),ht.init(t,e)});function P(t){return Ig(Us,t)}o(P,"string");var Fg=le("ZodMiniStringFormat",(t,e)=>{Il.init(t,e),Us.init(t,e)});var dI=le("ZodMiniURL",(t,e)=>{sg.init(t,e),Fg.init(t,e)});function qg(t){return Cg(dI,t)}o(qg,"url");var kl=le("ZodMiniNumber",(t,e)=>{ug.init(t,e),ht.init(t,e)});function $t(t){return Og(kl,t)}o($t,"number");var Dl=le("ZodMiniBoolean",(t,e)=>{Rl.init(t,e),ht.init(t,e)});function Ke(t){return kg(Dl,t)}o(Ke,"boolean");var Bg=le("ZodMiniBigInt",(t,e)=>{cg.init(t,e),ht.init(t,e)});var pI=le("ZodMiniAny",(t,e)=>{lg.init(t,e),ht.init(t,e)});function Fi(){return zg(pI)}o(Fi,"any");var fI=le("ZodMiniUnknown",(t,e)=>{dg.init(t,e),ht.init(t,e)});function Ee(){return Ug(fI)}o(Ee,"unknown");var mI=le("ZodMiniVoid",(t,e)=>{pg.init(t,e),ht.init(t,e)});function Vg(t){return Mg(mI,t)}o(Vg,"_void");var Gg=le("ZodMiniDate",(t,e)=>{fg.init(t,e),ht.init(t,e)});var hI=le("ZodMiniArray",(t,e)=>{mg.init(t,e),ht.init(t,e)});function xe(t,e){return new hI({type:"array",element:t,...ut(e)})}o(xe,"array");var gI=le("ZodMiniObject",(t,e)=>{hg.init(t,e),ht.init(t,e),mt(t,"shape",()=>e.shape)});function O(t,e){let r={type:"object",shape:t??{},...ut(e)};return new gI(r)}o(O,"object");var yI=le("ZodMiniUnion",(t,e)=>{Cl.init(t,e),ht.init(t,e)});function Re(t,e){return new yI({type:"union",options:t,...ut(e)})}o(Re,"union");var vI=le("ZodMiniDiscriminatedUnion",(t,e)=>{gg.init(t,e),ht.init(t,e)});function jo(t,e,r){return new vI({type:"union",options:e,discriminator:t,...ut(r)})}o(jo,"discriminatedUnion");var _I=le("ZodMiniRecord",(t,e)=>{yg.init(t,e),ht.init(t,e)});function Se(t,e,r){return new _I({type:"record",keyType:t,valueType:e,...ut(r)})}o(Se,"record");var bI=le("ZodMiniEnum",(t,e)=>{vg.init(t,e),ht.init(t,e),t.options=Object.values(e.entries)});function De(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new bI({type:"enum",entries:r,...ut(e)})}o(De,"_enum");var EI=le("ZodMiniLiteral",(t,e)=>{_g.init(t,e),ht.init(t,e)});function ge(t,e){return new EI({type:"literal",values:Array.isArray(t)?t:[t],...ut(e)})}o(ge,"literal");var SI=le("ZodMiniTransform",(t,e)=>{bg.init(t,e),ht.init(t,e)});function $n(t){return new SI({type:"transform",transform:t})}o($n,"transform");var PI=le("ZodMiniOptional",(t,e)=>{Eg.init(t,e),ht.init(t,e)});function H(t){return new PI({type:"optional",innerType:t})}o(H,"optional");var TI=le("ZodMiniNullable",(t,e)=>{Sg.init(t,e),ht.init(t,e)});function qi(t){return new TI({type:"nullable",innerType:t})}o(qi,"nullable");var wI=le("ZodMiniPipe",(t,e)=>{Pg.init(t,e),ht.init(t,e)});function kn(t,e){return new wI({type:"pipe",in:t,out:e})}o(kn,"pipe");var xI=le("ZodMiniCustom",(t,e)=>{Tg.init(t,e),ht.init(t,e)});function Ms(t,e){return Lg(xI,t??(()=>!0),e)}o(Ms,"custom");var Bi={};ws(Bi,{bigint:()=>kI,boolean:()=>$I,date:()=>DI,number:()=>OI,string:()=>CI});function CI(t){return Rg(Us,t)}o(CI,"string");function OI(t){return $g(kl,t)}o(OI,"number");function $I(t){return Dg(Dl,t)}o($I,"boolean");function kI(t){return Ng(Bg,t)}o(kI,"bigint");function DI(t){return jg(Gg,t)}o(DI,"date");var zl=O({retryOnFailure:O({defaultValue:H(Ke()),hide:H(Ke())}),continueOnFailure:O({defaultValue:H(Ke()),hide:H(Ke())})}),Nl=class{constructor(e,r,n,i,s,c,d,p,h,_,m){this.name=e;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=d;this.errorHandlingOptions=p;this.outputSchema=h;this.audience=_;this.aiMetadata=m}static{o(this,"IAction")}},Pt=o(t=>new Nl(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 Fe=O({displayName:P(),description:H(P())}),Ce=o((t,e)=>O({type:ge(e),required:Ke(),defaultValue:H(Fi())}),"TPropertyValue");var Ht=O({...Fe.shape,...Ce(P(),"SHORT_TEXT").shape}),sn=O({...Fe.shape,...Ce(P(),"LONG_TEXT").shape});var Wg=O({label:P(),value:Ee()}),js=O({disabled:H(Ke()),placeholder:H(P()),options:xe(Wg)});var Wt=O({...Fe.shape,options:js,...Ce(Ee(),"STATIC_DROPDOWN").shape}),un=O({...Fe.shape,options:js,...Ce(xe(Ee()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Ul=O({...Fe.shape,...Ce(Ee(),"DROPDOWN").shape,refreshers:xe(P())}),Vi=O({...Fe.shape,...Ce(xe(Ee()),"MULTI_SELECT_DROPDOWN").shape,refreshers:xe(P())});var cn=O({...Fe.shape,...Ce(Ke(),"CHECKBOX").shape});var ln=O({...Fe.shape,...Ce($t(),"NUMBER").shape});var Gi=O({...Fe.shape,...Ce(Ee(),"FILE").shape});var Hi=O({...Fe.shape,...Ce(P(),"DATE_TIME").shape});var Zg=Se(P(),Re([Ht,sn,Wt,Vi,un,cn,ln,Gi,Hi])),Wi=O({...Fe.shape,properties:Zg,...Ce(xe(Ee()),"ARRAY").shape});var Zi=O({...Fe.shape,...Ce(Re([Se(P(),Ee())]),"JSON").shape});var Kg=Re([Ht,Wt,Zi,Wi,un]),zI=Se(P(),Kg),Ml=O({refreshers:xe(P()),...Fe.shape,...Ce(Ee(),"DYNAMIC").shape});var Ls=O({...Fe.shape,...Ce(Vg(),"MARKDOWN").shape});var Ki=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Ki||{}),Lo=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Lo||{}),Fo=(E=>(E.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",E.COMMUNICATION="COMMUNICATION",E.COMMERCE="COMMERCE",E.CORE="CORE",E.UNIVERSAL_AI="UNIVERSAL_AI",E.FLOW_CONTROL="FLOW_CONTROL",E.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",E.ACCOUNTING="ACCOUNTING",E.PRODUCTIVITY="PRODUCTIVITY",E.CONTENT_AND_FILES="CONTENT_AND_FILES",E.DEVELOPER_TOOLS="DEVELOPER_TOOLS",E.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",E.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",E.HUMAN_RESOURCES="HUMAN_RESOURCES",E.PAYMENT_PROCESSING="PAYMENT_PROCESSING",E.MARKETING="MARKETING",E.SALES_AND_CRM="SALES_AND_CRM",E))(Fo||{});var Ji=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Ji||{}),jl="both_client_credentials_and_authorization_code";var zt=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(zt||{}),Yi=(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))(Yi||{}),UI=O({strategy:De(Yi),paramName:H(P())}),Xi=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Xi||{});var Fs=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Fs||{}),Jg=O({status:H($t()),body:H(Ee()),headers:H(Se(P(),P()))}),Yg=O({type:ge("DELAY"),resumeDateTime:P(),requestIdToReply:H(P()),handlerId:H(P()),streamStepProgress:H(De(Fs))}),Xg=O({type:ge("WEBHOOK"),requestId:P(),requestIdToReply:H(P()),response:Jg,handlerId:H(P()),streamStepProgress:H(De(Fs))}),MI=Re([Yg,Xg]);var jI=O({body:Ee(),rawBody:H(Ee()),headers:Se(P(),P()),queryParams:Se(P(),P())});function ot(t){return t==null}o(ot,"isNil");function Qi(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(Qi,"isEmpty");function qs(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(qs,"assertNotNullOrUndefined");var Ll=rt(require("crypto"),1);var LI=128,no,qo,FI=o(t=>{!no||no.length<t?(no=Buffer.allocUnsafe(t*LI),Ll.default.randomFillSync(no),qo=0):qo+t>no.length&&(Ll.default.randomFillSync(no),qo=0),qo+=t},"fillPool"),qI=o(t=>(FI(t|=0),no.subarray(qo-t,qo)),"random"),BI=o((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(s=e)=>{let c="";for(;;){let d=r(i),p=i;for(;p--;)if(c+=t[d[p]&n]||"",c.length===s)return c}}},"customRandom"),ey=o((t,e=21)=>BI(t,e,qI),"customAlphabet");var VI="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ty=21,kV=P().check(On(new RegExp(`^[0-9a-zA-Z]{${ty}}$`))),GI=ey(VI,ty);var Dn=kn($n(t=>t instanceof Date?t.toISOString():t),P()),ur={id:P(),created:Dn,updated:Dn},it=o(t=>H(qi(t)),"Nullable");function Fl(t){return H(qi(De(t)))}o(Fl,"NullableEnum");var zV=kn($n(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),H(Ke())),Bs=o(t=>kn($n(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),H(xe(t))),"OptionalArrayFromQuery");var jV=Se(P(),Ee());var ea=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(ea||{});var YV=P().check(On(/^#[0-9A-Fa-f]{6}$/));var QV=O({filename:P(),data:Ee(),type:ge("file"),mimetype:H(P())});var HI=rt(ny());var aG=O({...ur,name:P(),permissions:xe(P()),platformId:it(P()),type:P(),userCount:H($t())});var oy=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(oy||{}),ql=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(ql||{}),Bl=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Bl||{});var Vl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Vl||{});var Gl=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Gl||{});var WI=O({mode:De(oy),value:Ee()}),ZI=O({auth:H(P()),fields:Se(P(),WI)}),KI=O({pieceName:P(),pieceVersion:P(),actionName:P(),predefinedInput:H(ZI)}),JI=O({type:ge("PIECE"),toolName:P().check(Pr(1)),pieceMetadata:KI}),YI=O({type:ge("none")}),XI=O({type:ge("access_token"),accessToken:P()}),QI=O({type:ge("api_key"),apiKey:P(),apiKeyHeader:P()}),eR=O({type:ge("headers"),headers:Se(P(),P())}),tR=jo("type",[YI,XI,QI,eR]),iy=O({type:ge("FLOW"),toolName:P().check(Pr(1)),externalFlowId:P(),flowDisplayName:H(P())}),ay=O({type:ge("MCP"),toolName:P().check(Pr(1)),serverUrl:qg(),protocol:De(Bl),auth:tR}),sy=O({type:ge("KNOWLEDGE_BASE"),toolName:P().check(Pr(1)),sourceType:De(ql),sourceId:P(),sourceName:P()}),rR=jo("type",[JI,iy,ay,sy]),nR=O({displayName:P(),description:H(P()),type:De(Vl)}),uy=O({type:ge("MARKDOWN"),markdown:P()}),Bo={type:ge("TOOL_CALL"),input:it(Se(P(),Ee())),output:H(Ee()),toolName:P(),status:De(Gl),toolCallId:P(),startTime:P(),endTime:H(P())},kG=O(Bo),cy=jo("toolCallType",[O({...Bo,toolCallType:ge("PIECE"),pieceName:P(),pieceVersion:P(),actionName:P()}),O({...Bo,toolCallType:ge("FLOW"),displayName:P(),externalFlowId:P()}),O({...Bo,toolCallType:ge("MCP"),displayName:P(),serverUrl:P()}),O({...Bo,toolCallType:ge("KNOWLEDGE_BASE"),displayName:P(),sourceType:P()}),O({...Bo,toolCallType:ge("UNKNOWN"),displayName:P()})]),oR=Re([uy,cy]);var Hl=(r=>(r.IMAGE="image",r.TEXT="text",r))(Hl||{}),dn=O({apiKey:P()}),iR=dn,aR=O({apiKey:P(),apiKeyHash:P()}),sR=dn,uR=dn,cR=dn,lR=dn,dR=dn,pR=dn,fR=dn,ly=O({accessKeyId:P().check(Pr(1)),secretAccessKey:P().check(Pr(1))}),mR=O({}),hR=O({}),gR=O({}),yR=O({}),vR=O({}),_R=O({}),dy=O({modelId:P(),modelName:P(),modelType:De(Hl)}),py=O({apiKeyHeader:P(),baseUrl:P(),models:xe(dy),defaultHeaders:H(Se(P(),P()))}),fy=O({accountId:P(),gatewayId:P(),models:xe(dy),vertexProject:H(P()),vertexRegion:H(P())}),my=O({resourceName:P(),apiVersion:kn($n(t=>typeof t=="string"&&t.trim().length===0?void 0:t),H(P()))}),hy=O({region:P().check(Pr(1))}),bR=Re([iR,cR,lR,dR,pR,uR,sR,aR,ly,fR]),gy=Re([py,fy,my,hy,mR,gR,yR,vR,hR,_R]),ER=O({id:P(),name:P(),type:De(Hl)}),SR=O({id:P(),name:P(),provider:De(ea),config:gy,enabledForChat:Ke()}),PR=O({provider:De(ea),config:gy,auth:bR,platformId:P()});var UG={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var TR=O({base64Url:P(),fileName:P(),extension:H(P())}),wR=O({mimeType:P(),url:P(),fileName:H(P())}),Wl=Re([TR,wR]);var xR=Re([O({type:ge("file"),value:Wl}),O({type:ge("markdown"),value:P(),files:H(xe(Wl))})]),AR=O({sessionId:P(),message:P(),files:H(xe(P()))});var vy=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(vy||{}),_y=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(_y||{}),Zl=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Zl||{});var IR=Re([O({...ur,name:P(),externalId:P(),type:ge("STATIC_DROPDOWN"),tableId:P(),projectId:P(),data:O({options:xe(O({value:P()}))})}),O({...ur,name:P(),externalId:P(),type:Re([ge("TEXT"),ge("NUMBER"),ge("DATE")]),tableId:P(),projectId:P()})]),RR=O({...ur,name:P(),folderId:it(P()),projectId:P(),externalId:P(),status:Fl(_y),trigger:Fl(vy)}),CR=O({...ur,tableId:P(),projectId:P(),cells:Se(P(),O({updated:P(),created:P(),value:Ee(),fieldName:P()}))}),OR=O({events:xe(De(Zl)),webhookUrl:P(),flowId:P()}),$R=O({fields:xe(O({id:P(),name:P()})),rows:xe(Se(P(),P())),name:P()}),kR=O({projectId:P(),limit:H(Bi.number()),cursor:H(P()),name:H(P()),externalIds:Bs(P()),folderId:H(P()),folderIds:Bs(P())}),DR=O({records:xe(xe(O({fieldId:P(),value:Ey()}))),tableId:P()}),NR=O({cells:H(xe(O({fieldId:P(),value:Ey()}))),tableId:P(),agentUpdate:H(Ke())}),by=jo("operator",[oo("eq"),oo("neq"),oo("gt"),oo("gte"),oo("lt"),oo("lte"),oo("co"),yy("exists"),yy("not_exists")]),zR=O({tableId:P(),limit:H(Bi.number()),cursor:H(P()),filters:Bs(by)});function Ey(){return kn($n(t=>t==null?t:String(t)),qi(P()))}o(Ey,"coerceToString");function oo(t){return O({fieldId:P(),operator:ge(t),value:P()})}o(oo,"valueFilter");function yy(t){return O({fieldId:P(),operator:ge(t)})}o(yy,"existenceFilter");var UR=O({status:H($t()),body:H(Ee()),headers:H(Se(P(),P()))}),MR=O({...ur,deleted:it(Dn),ownerId:P(),displayName:P(),platformId:P(),externalId:it(P())});var Sy=O({name:P(),description:H(P()),type:P(),required:Ke()}),jR=O({pieceName:P(),triggerName:P(),input:O({toolName:P(),toolDescription:P(),inputSchema:xe(Sy),returnsResponse:Ke()})});var Py="^[0-9]+\\.[0-9]+\\.[0-9]+$",rH=new RegExp(Py),FR="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",nH=P().check(On(new RegExp(Py))),oH=P().check(On(new RegExp(FR))),qR=O({packageType:ge("ARCHIVE"),pieceType:De(Lo),pieceName:P(),pieceVersion:P(),archiveId:P(),platformId:P()}),Ty=O({packageType:ge("REGISTRY"),pieceType:ge("OFFICIAL"),pieceName:P(),pieceVersion:P()}),wy=O({packageType:ge("REGISTRY"),pieceType:ge("CUSTOM"),pieceName:P(),pieceVersion:P(),platformId:P()}),iH=Re([Ty,wy]),aH=Re([qR,Ty,wy]),xy=(e=>(e.CRON_EXPRESSION="CRON_EXPRESSION",e))(xy||{}),BR=O({type:De(xy),cronExpression:P(),timezone:P()}),sH=O({...ur,type:De(zt),projectId:P(),flowId:P(),triggerName:P(),schedule:it(BR),flowVersionId:P(),pieceName:P(),pieceVersion:P(),deleted:it(P()),simulate:Ke()}),Ay=(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))(Ay||{}),Iy=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Iy||{}),Ry=(r=>(r.S3="S3",r.DB="DB",r))(Ry||{}),uH=O({...ur,projectId:it(P()),platformId:it(P()),type:De(Ay),compression:De(Iy),data:H(Ee()),location:De(Ry),size:it($t()),fileName:it(P()),s3Key:it(P()),metadata:it(Se(P(),P()))}),Cy=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Cy||{}),Oy=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Oy||{}),cH=O({id:P(),email:P(),firstName:P(),status:De(Oy),externalId:it(P()),platformId:it(P()),platformRole:De(Cy),lastName:P(),created:Dn,updated:Dn,lastActiveDate:it(Dn),imageUrl:it(P())});var Jl=O({...Fe.shape,...Ce(Se(P(),Ee()),"OBJECT").shape});var Dy=O({...Fe.shape,...Ce(P(),"COLOR").shape});var Yl=Re([Ht,sn,Ls,cn,Wt,un,Ul,Vi,Ml,ln,Wi,Jl,Zi,Hi,Gi,Dy]),Q={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 zr=O({displayName:P(),description:H(P())});var Ny=O({username:P(),password:P()}),Xl=O({...zr.shape,username:O({displayName:P(),description:H(P())}),password:O({displayName:P(),description:H(P())}),...Ce(Ny,"BASIC_AUTH").shape});var WR=Se(P(),Re([Ht,sn,ln,cn,Wt])),Ql=O({...zr.shape,props:WR,...Ce(Ee(),"CUSTOM_AUTH").shape});var io=O({...zr.shape,...Ce(O({auth:P()}),"SECRET_TEXT").shape});var ZR=Se(P(),Re([Ht,sn,io,ln,cn,Wt,un,Ls])),zy=O({...zr.shape,props:ZR,...Ce(Ee(),"OIDC").shape});var ed=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(ed||{}),Uy=Re([Ht,io,Wt]),My=Se(P(),Uy),KR=O({props:H(Se(P(),Uy)),authUrl:P(),tokenUrl:P(),scope:xe(P()),prompt:H(Re([ge("none"),ge("consent"),ge("login"),ge("omit")])),pkce:H(Ke()),pkceMethod:H(Re([ge("plain"),ge("S256")])),authorizationMethod:H(De(ed)),grantType:H(Re([De(Ji),ge(jl)])),extra:H(Se(P(),P()))}),jy=O({access_token:P(),props:H(My),data:Se(P(),Fi())}),td=O({...zr.shape,...KR.shape,...Ce(jy,"OAUTH2").shape});var Vo=Re([Xl,Ql,zy,td,io]),ta="Connection",Gs={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 FW={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 JR=O({...Fe.shape,...Ce(Ee(),"CUSTOM").shape,code:P()});var YR=Re([Yl,Vo]),rd=Se(P(),YR),sZ=Se(P(),Yl);var Ly=Re([O({strategy:ge("CRON"),cronExpression:P()}),O({strategy:ge("NONE")})]),Go=class{constructor(e,r,n,i,s,c,d,p,h,_,m,f,l,g,v,b,E,k,L){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=d;this.onHandshake=p;this.renewConfiguration=h;this.onRenew=_;this.onEnable=m;this.onDisable=f;this.onStart=l;this.run=g;this.test=v;this.sampleData=b;this.testStrategy=E;this.outputSchema=k;this.aiMetadata=L}static{o(this,"ITrigger")}},Ut=o(t=>{switch(t.type){case"WEBHOOK":return new Go(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 Go(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 Go(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 Go(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,ot(t.sampleData)&&ot(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var Fy="2",Hs="0.82.0";var nd=class{constructor(e,r,n,i,s,c,d,p,h=Hs,_,m=""){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=p;this.minimumSupportedRelease=h;this.maximumSupportedRelease=_;this.description=m;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Fy}),"getContextInfo");(!XR(h)||QR(h,Hs))&&(this.minimumSupportedRelease=Hs),s.forEach(f=>this._actions[f.name]=f),c.forEach(f=>this._triggers[f.name]=f)}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}},qy=o(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new nd(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description)},"createPiece");function XR(t){return/^\d+\.\d+\.\d+$/.test(t)}o(XR,"isValidSimpleSemver");function QR(t,e){let[r,n,i]=t.split(".").map(Number),[s,c,d]=e.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<d}o(QR,"isSemverLessThan");var e0=H(Se(P(),Se(P(),P()))),By=O({id:H(P()),name:P(),displayName:P(),logoUrl:P(),description:P(),authors:xe(P()),platformId:H(P()),directoryPath:H(P()),auth:H(Re([Vo,xe(Vo)])),version:P(),categories:H(xe(De(Fo))),minimumSupportedRelease:H(P()),maximumSupportedRelease:H(P()),i18n:e0}),t0=De(["human","ai","both"]),Vy=O({description:H(P()),idempotent:H(Ke())}),Gy=O({name:P(),displayName:P(),description:P(),props:rd,requireAuth:Ke(),errorHandlingOptions:H(zl),outputSchema:H(Ms()),audience:H(t0),aiMetadata:H(Vy)}),Hy=O({name:P(),displayName:P(),description:P(),props:rd,errorHandlingOptions:H(zl),type:De(zt),sampleData:Ee(),handshakeConfiguration:H(Ms()),renewConfiguration:H(Ly),testStrategy:De(Xi),outputSchema:H(Ms()),aiMetadata:H(Vy)}),r0=O({...By.shape,actions:Se(P(),Gy),triggers:Se(P(),Hy)}),n0=O({...By.shape,actions:$t(),triggers:$t(),suggestedActions:H(xe(Hy)),suggestedTriggers:H(xe(Gy))}),Wy=O({projectUsage:$t(),tags:H(xe(P())),pieceType:De(Lo),packageType:De(Ki),platformId:H(P()),archiveId:H(P())}),s3=O({...r0.shape,...Wy.shape}),u3=O({...n0.shape,...Wy.shape}),c3=O({name:P(),version:P()});var o0=rt(require("path")),i0=rt(require("fs/promises"));var Ws=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};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 Zs=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new od,r=new id){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},od=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},id=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 Ks=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Js=class extends Ws{static{o(this,"FetchHttpClient")}constructor(e="",r=new Zs){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),s=this.getHeaders(e),c=e.queryParams??{};for(let[L,J]of Object.entries(c))i.append(L,J);let d=i.toString(),p=d?`${n}?${d}`:n,h=e.responseType??"json",_=e.followRedirects??!0,m=e.retries??0,{body:f,extraHeaders:l,isStream:g}=a0(e.body,s),v=u0({...s,...l}),b=await s0(async()=>{let L=new AbortController,J=e.timeout&&e.timeout>0?setTimeout(()=>L.abort(),e.timeout):void 0;try{let W={method:e.method.toString(),headers:v,body:f,redirect:_?"follow":"manual",signal:L.signal};return g&&(W.duplex="half"),r?.dispatcher!==void 0&&(W.dispatcher=r.dispatcher),await fetch(p,W)}finally{J!==void 0&&clearTimeout(J)}},m),E=_?300:400;if(b.status<200||b.status>=E){let L=await Zy(b,h),J=new Ks(e.body,{status:b.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",J),J}let k=await Zy(b,h);return{status:b.status,headers:c0(b.headers),body:k}}};function a0(t,e){return d0(t)?{body:void 0,extraHeaders:{},isStream:!1}:l0(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(a0,"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 Ky(n);continue}return i}catch(i){if(r=i,n<e){await Ky(n);continue}throw i}throw r}o(s0,"sendWithRetries");function Ky(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(Ky,"backoff");function u0(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(u0,"normalizeHeaders");function c0(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(c0,"toHttpHeaders");function l0(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"}o(l0,"isNodeFormData");function d0(t){return t==null}o(d0,"isNil");var Ge=new Js;var cr=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(cr||{});var XC=rt(require("fs")),Q_=rt(X_());var QC={"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 eO(t){let e=t.split(";")[0].trim().toLowerCase();return QC[e]??""}o(eO,"contentTypeToExtension");var tO=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),rO=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 eb({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:d,authLocation:p="headers"}){return Pt({audience:"human",name:s||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:Q.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:Q.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
69
|
+
i.e ${rO(e,h)}/resource or /resource`,required:!0,defaultValue:h?e(h):"",...c?.url??{}})}),"props")}),method:Q.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(cr).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:Q.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:Q.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:Q.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:Q.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let _=h,m={};switch(_){case"none":break;case"json":m.data=Q.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":m.data=Q.LongText({displayName:"Raw Body",required:!0});break;case"form_data":m.data=Q.Array({displayName:"Form Data",required:!0,properties:{fieldName:Q.ShortText({displayName:"Field Name",required:!0}),fieldType:Q.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:Q.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:Q.File({displayName:"File Field Value",required:!1})}});break}return m},"props")}),response_is_binary:Q.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:Q.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:Q.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:Q.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async h=>{let{method:_,url:m,headers:f,queryParams:l,body:g,body_type:v,failsafe:b,timeout:E,response_is_binary:k,followRedirects:L}=h.propsValue;qs(_,"Method"),qs(m,"URL");let J=ot(r)?{}:await r(h.auth,h.propsValue),W=m.url,G=W.startsWith("http://")||W.startsWith("https://")?W:tO({baseUrl:e(h.auth),relativePath:W}),K={method:_,url:G,headers:{...f??{},...p==="headers"||!ot(p)?J:{}},queryParams:{...p==="queryParams"?J:{},...l??{}},timeout:E?E*1e3:0,followRedirects:L};if(k&&(K.responseType="arraybuffer"),g)if(v&&v!=="none"){let te=g.data;if(v==="form_data"){let X=te,Te=new Q_.default;for(let{fieldName:re,fieldType:B,textFieldValue:q,fileFieldValue:Y}of X)B==="text"&&!Qi(q)?Te.append(re,q):B==="file"&&!Qi(Y)&&Te.append(re,Y.data,{filename:Y?.filename});K.body=Te,K.headers={...K.headers,...Te.getHeaders()}}else K.body=te}else v||(K.body=g);try{let te=await Ge.sendRequest(K);return await nO(h.files,te.body,te.status,te.headers,k)}catch(te){if(b)return te.errorMessage();throw te}},"run")})}o(eb,"createCustomApiCallAction");var nO=o(async(t,e,r,n,i)=>{let s;if(i&&oO(e)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=eO(c??"")||"txt",p;e instanceof ArrayBuffer?p=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?p=e:p=Buffer.from(e),s=await t.write({fileName:`output.${d}`,data:p})}else s=e;return{status:r,headers:n,body:s}},"handleBinaryResponse"),oO=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var He={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:c}){switch(t.strategy){case 0:{let d=await e.get("lastPoll");if(ot(d))throw new Error("lastPoll doesn't exist in the store.");let p=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:d,server:c}),h=p.reduce((_,m)=>Math.max(_,m.epochMilliSeconds),d);return await e.put("lastPoll",h),p.filter(_=>_.epochMilliSeconds>d).map(_=>_.data)}case 1:{let d=await e.get("lastItem"),p=await t.items({store:e,auth:r,propsValue:n,lastItemId:d,files:s,server:c}),h=p.findIndex(f=>f.id===d),_=[];ot(d)||h==-1?_=p??[]:_=p?.slice(0,h)??[],ot(i)||(_=_.slice(-i));let m=_?.[0]?.id;return ot(m)||await e.put("lastItem",m),_.map(f=>f.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i}){switch(t.strategy){case 0:{await e.put("lastPoll",Date.now());break}case 1:{let c=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;ot(c)?await e.delete("lastItem"):await e.put("lastItem",c);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:i,server:s}){let c=[];switch(t.strategy){case 0:{c=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:s});break}}return iO(c.map(d=>d.data))}};function iO(t){return t.length<=5?t:t.slice(0,5)}o(iO,"getFirstFiveOrAll");var tb=require("crypto");async function Ad(t,e){let r={method:"POST",url:`${fe.baseUrl}/channels/stop`,body:{id:t?.id,resourceId:t?.resourceId},authentication:{type:"BEARER_TOKEN",token:await Le(e)}};await Ge.sendRequest(r)}o(Ad,"stopWatchEvent");async function Id(t,e,r){let n=Date.now()+5184e5,i={method:"POST",url:`${fe.baseUrl}/calendars/${t}/events/watch`,body:{id:(0,tb.randomUUID)(),type:"web_hook",address:e,expiration:n.toString()},authentication:{type:"BEARER_TOKEN",token:await Le(r)}},{body:s}=await Ge.sendRequest(i);return s}o(Id,"watchEvent");async function iu({calendarId:t,authProp:e}){let r=await Le(e),n={singleEvents:"true",showDeleted:"true",maxResults:"2500"},i="",s;do{i&&(n.pageToken=i);let c={method:"GET",url:`${fe.baseUrl}/calendars/${t}/events`,queryParams:n,authentication:{type:"BEARER_TOKEN",token:r}},{body:d}=await Ge.sendRequest(c);i=d.nextPageToken,s=d.nextSyncToken}while(i);return s}o(iu,"getInitialSyncToken");async function rb({calendarId:t,syncToken:e,authProp:r}){let n=await Le(r),i={syncToken:e,maxResults:"2500"},s="",c,d=[];do{s&&(i.pageToken=s);let p={method:"GET",url:`${fe.baseUrl}/calendars/${t}/events`,queryParams:i,authentication:{type:"BEARER_TOKEN",token:n}};try{let{body:h}=await Ge.sendRequest(p);h.items?.length>0&&(d=[...d,...h.items]),s=h.nextPageToken,c=h.nextSyncToken}catch(h){if(h?.response?.status===410)return{items:[],nextSyncToken:void 0,syncTokenInvalid:!0};throw h}}while(s);return{items:d,nextSyncToken:c,syncTokenInvalid:!1}}o(rb,"listEventsWithSyncToken");async function Mn(t,e){let r={showDeleted:"false"};e&&(r.minAccessRole=e);let n={method:"GET",url:`${fe.baseUrl}/users/me/calendarList`,queryParams:r,authentication:{type:"BEARER_TOKEN",token:await Le(t)}};return(await Ge.sendRequest(n)).body.items}o(Mn,"getCalendars");async function nb(t){let e={method:"GET",url:`${fe.baseUrl}/colors`,authentication:{type:"BEARER_TOKEN",token:await Le(t)}};return(await Ge.sendRequest(e)).body}o(nb,"getColors");async function aa(t,e,r,n){let i=new Date,s=new Date;s.setDate(i.getDate()-1);let c={updatedMin:n?.toISOString()??s.toISOString(),maxResults:"2500",orderBy:"updated",singleEvents:e?"true":"false",showDeleted:"true"},d=await Le(r),p={method:"GET",url:`${fe.baseUrl}/calendars/${t}/events`,queryParams:c,authentication:{type:"BEARER_TOKEN",token:d}},h=[],_="";do{c.pageToken=_;let{body:m}=await Ge.sendRequest(p);m.items.length>0&&(h=[...h,...m.items]),_=m.nextPageToken}while(_);return h}o(aa,"getEvents");async function ob(t,e){return(await aa(t,!1,e)).pop()}o(ob,"getLatestEvent");async function ib(t,e,r=50){if(!e)return[];try{let n=new Date,i=new Date;i.setDate(n.getDate()+30);let s={singleEvents:"true",orderBy:"startTime",timeMin:n.toISOString(),timeMax:i.toISOString(),maxResults:r.toString(),showDeleted:"false"},c={method:"GET",url:`${fe.baseUrl}/calendars/${encodeURIComponent(e)}/events`,queryParams:s,authentication:{type:"BEARER_TOKEN",token:await Le(t)}},d=await Ge.sendRequest(c);return!d.body.items||d.body.items.length===0?[]:d.body.items.map(p=>{let h=p.start?.dateTime||p.start?.date||"",_=h?new Date(h).toLocaleDateString():"",m=h?new Date(h).toLocaleTimeString():"",f=p.summary||"Untitled Event";return _&&(f+=` (${_}`,p.start?.dateTime&&(f+=` at ${m}`),f+=")"),{label:f,value:p.id||""}}).filter(p=>p.value!=="")}catch(n){return console.error("Error fetching events for dropdown:",n),[]}}o(ib,"getEventsForDropdown");var Sc=rt(Ma());var Zf=["https://www.googleapis.com/auth/calendar.events","https://www.googleapis.com/auth/calendar.readonly"],Oe=[Gs.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,pkce:!0,scope:Zf}),Gs.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 calendars without adding the service account to each one. <br> <br> **Note:** Without a user email, the service account only has access to calendars you explicitly share with it.",required:!0,props:{serviceAccount:Q.ShortText({displayName:"Service Account JSON Key",required:!0}),userEmail:Q.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 Le({type:"CUSTOM_AUTH",props:{...t}})}catch(e){return{valid:!1,error:e.message}}return{valid:!0}},"validate")})];async function vr(t){if(t.type==="CUSTOM_AUTH"){let r=JSON.parse(t.props.serviceAccount);return new Sc.JWT({email:r.client_email,key:r.private_key,scopes:Zf,subject:t.props.userEmail})}let e=new Sc.OAuth2Client;return e.setCredentials(t),e}o(vr,"createGoogleClient");var Le=o(async t=>{if(t.type==="CUSTOM_AUTH"){let r=await(await vr(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 fe={baseUrl:"https://www.googleapis.com/calendar/v3",calendarDropdown:o(t=>Q.Dropdown({auth:Oe,displayName:"Calendar",refreshers:[],required:!0,options:o(async({auth:e})=>e?{disabled:!1,options:(await Mn(e,t)).map(i=>({label:i.summary,value:i.id}))}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),"calendarDropdown"),eventDropdown:o((t=!1)=>Q.Dropdown({displayName:"Event",refreshers:["calendar_id"],required:t,auth:Oe,options:o(async({auth:e,calendar_id:r})=>e?r?{disabled:!1,options:await ib(e,r)}:{disabled:!0,placeholder:"Please select a calendar first",options:[]}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),"eventDropdown"),colorId:Q.Dropdown({auth:Oe,displayName:"Color",refreshers:[],required:!1,options:o(async({auth:t})=>{if(!t)return{disabled:!0,placeholder:"Please connect your account first",options:[]};let e=await nb(t);return{disabled:!1,options:Object.entries(e.event).map(([r,n])=>({label:n.background,value:r}))}},"options")})};var Fc=rt(ja()),Cw=rt(Ja()),Ow=require("crypto");var yt={fields:[{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"htmlLink",label:"Event Link",format:"url"},{key:"id",label:"Event ID"},{key:"eventType",label:"Event Type"},{key:"start",label:"Start",children:[{key:"dateTime",label:"Start Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"end",label:"End",children:[{key:"dateTime",label:"End Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"creator",label:"Creator",children:[{key:"email",label:"Email",format:"email"}]},{key:"organizer",label:"Organizer",children:[{key:"email",label:"Email",format:"email"}]},{key:"created",label:"Created",format:"datetime"},{key:"updated",label:"Updated",format:"datetime"},{key:"iCalUID",label:"iCal UID"}]},xw={fields:[{key:"summary",label:"Name"},{key:"description",label:"Description"},{key:"id",label:"Calendar ID"},{key:"timeZone",label:"Time Zone"},{key:"accessRole",label:"Access Role"},{key:"selected",label:"Selected",format:"boolean"},{key:"isShared",label:"Is Shared",format:"boolean"},{key:"calendarType",label:"Calendar Type"},{key:"backgroundColor",label:"Background Color"},{key:"foregroundColor",label:"Foreground Color"},{key:"colorId",label:"Color ID"}]},Aw={fields:[{key:"status",label:"Status Code"},{key:"summary",label:"Calendar Summary",value:"body.summary"},{key:"timeZone",label:"Time Zone",value:"body.timeZone"},{key:"accessRole",label:"Access Role",value:"body.accessRole"},{key:"updated",label:"Updated",value:"body.updated",format:"datetime"},{key:"items",label:"Events",value:"body.items",labelKey:"summary",listItems:[{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"id",label:"Event ID"},{key:"eventType",label:"Event Type"},{key:"htmlLink",label:"Event Link",format:"url"},{key:"startDateTime",label:"Start",value:"start.dateTime",format:"datetime"},{key:"endDateTime",label:"End",value:"end.dateTime",format:"datetime"},{key:"creatorEmail",label:"Creator Email",value:"creator.email",format:"email"},{key:"organizerEmail",label:"Organizer Email",value:"organizer.email",format:"email"},{key:"created",label:"Created",format:"datetime"},{key:"updated",label:"Updated",format:"datetime"},{key:"iCalUID",label:"iCal UID"}]}]},Iw={fields:[{key:"summary",label:"Summary",value:"body.summary"},{key:"status",label:"Status",value:"body.status"},{key:"id",label:"Event ID",value:"body.id"},{key:"htmlLink",label:"Event Link",value:"body.htmlLink",format:"url"},{key:"created",label:"Created",value:"body.created",format:"datetime"},{key:"updated",label:"Updated",value:"body.updated",format:"datetime"},{key:"start",label:"Start",value:"body.start",children:[{key:"dateTime",label:"Start Date/Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"end",label:"End",value:"body.end",children:[{key:"dateTime",label:"End Date/Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"creator",label:"Creator",value:"body.creator",children:[{key:"email",label:"Email",format:"email"}]},{key:"organizer",label:"Organizer",value:"body.organizer",children:[{key:"email",label:"Email",format:"email"}]},{key:"eventType",label:"Event Type",value:"body.eventType"},{key:"iCalUID",label:"iCal UID",value:"body.iCalUID"}]},Rw={fields:[{key:"timeMin",label:"Time Min",format:"datetime"},{key:"timeMax",label:"Time Max",format:"datetime"},{key:"calendars",label:"Calendars",dynamicKey:!0,children:[{key:"busy",label:"Busy Periods",labelKey:"start",listItems:[{key:"start",label:"Start",format:"datetime"},{key:"end",label:"End",format:"datetime"}]}]}]};var $w=Pt({auth:Oe,name:"create_google_calendar_event",description:"Add Event",audience:"both",aiMetadata:{description:"Creates a Google Calendar event with structured fields (title, start/end times, location, description, attendees, color, guest permissions) and can optionally attach a Google Meet link. Use this when you have explicit event details; choose Create Quick Event instead when working from a single natural-language phrase. Requires a title and start time (end defaults to 30 minutes after start). Not idempotent: each call creates a new event.",idempotent:!1},displayName:"Create Event",props:{calendar_id:fe.calendarDropdown("writer"),title:Q.ShortText({displayName:"Title of the event",required:!0}),start_date_time:Q.DateTime({displayName:"Start date time of the event",required:!0}),end_date_time:Q.DateTime({displayName:"End date time of the event",description:"By default it'll be 30 min post start time",required:!1}),location:Q.ShortText({displayName:"Location",required:!1}),description:Q.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1}),colorId:fe.colorId,attendees:Q.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!1}),guests_can_modify:Q.Checkbox({displayName:"Guests can modify",defaultValue:!1,required:!1}),guests_can_invite_others:Q.Checkbox({displayName:"Guests can invite others",defaultValue:!1,required:!1}),guests_can_see_other_guests:Q.Checkbox({displayName:"Guests can see other guests",defaultValue:!1,required:!1}),send_notifications:Q.StaticDropdown({displayName:"Send Notifications",defaultValue:"all",options:{options:[{label:"Yes, to everyone",value:"all"},{label:"To non-Google Calendar guests only",value:"externalOnly"},{label:"To no one",value:"none"}]},required:!0}),create_meet_link:Q.Checkbox({displayName:"Create Google Meet Link",description:"Automatically create a Google Meet video conference link for this event",defaultValue:!1,required:!1})},outputSchema:yt,async run(t){let{calendar_id:e,title:r,start_date_time:n,end_date_time:i,location:s,description:c,colorId:d,guests_can_modify:p,guests_can_invite_others:h,guests_can_see_other_guests:_,create_meet_link:m}=t.propsValue,f={dateTime:(0,Fc.default)(n).format("YYYY-MM-DDTHH:mm:ss.sssZ")},l=i||(0,Fc.default)(n).add(30,"m"),g={dateTime:(0,Fc.default)(l).format("YYYY-MM-DDTHH:mm:ss.sssZ")},v=t.propsValue.attendees,b=t.propsValue.send_notifications,E=[];if(v)for(let G of v)E.push({email:G});let k=await vr(t.auth),L=(0,Cw.calendar)({version:"v3",auth:k}),J={summary:r,start:f,end:g,colorId:d,location:s??"",description:c??"",attendees:E,guestsCanInviteOthers:h,guestsCanModify:p,guestsCanSeeOtherGuests:_};return m&&(J.conferenceData={createRequest:{conferenceSolutionKey:{type:"hangoutsMeet"},requestId:(0,Ow.randomUUID)()}}),(await L.events.insert({calendarId:e,sendUpdates:b,conferenceDataVersion:m?1:0,requestBody:J})).data}});var kw=Pt({auth:Oe,name:"create_quick_event",description:"Add Quick Calendar Event",audience:"both",aiMetadata:{description:`Creates a calendar event from a single natural-language phrase (e.g. "Lunch with Sam tomorrow at 1pm") via Google's quickAdd parsing, letting Google infer the time, title, and date. Use when you have free-form text rather than structured fields; prefer Create Event when you have explicit start/end times or attendees. Not idempotent: each call creates a new event.`,idempotent:!1},displayName:"Create Quick Event",props:{calendar_id:fe.calendarDropdown("writer"),text:Q.LongText({displayName:"Summary",description:"The text describing the event to be created",required:!0}),send_updates:Q.StaticDropdown({displayName:"Send Updates",description:"Guests who should receive notifications about the creation of the new event.",required:!1,options:{disabled:!1,options:[{label:"All",value:"all"},{label:"External Only",value:"externalOnly"},{label:"none",value:"none"}]}})},outputSchema:Iw,async run(t){let e=t.propsValue.calendar_id,r=`${fe.baseUrl}/calendars/${e}/events/quickAdd`,n={text:t.propsValue.text,sendUpdates:t.propsValue.send_updates||"none"},i={method:"POST",url:r,body:{},authentication:{type:"BEARER_TOKEN",token:await Le(t.auth)},queryParams:n};return await Ge.sendRequest(i)}});var Dw=rt(Ja());var Nw=Pt({displayName:"Delete Event",auth:Oe,name:"delete_event",description:"Deletes an event from Google Calendar.",audience:"both",aiMetadata:{description:"Permanently removes an event from a Google Calendar, identified by calendar and event ID. Use to cancel or delete an existing event. Requires the event ID and cannot be undone. Idempotent: once the event is deleted, repeating the call leaves it absent (a second call may report it as already gone).",idempotent:!0},props:{calendar_id:fe.calendarDropdown("writer"),eventId:Q.ShortText({displayName:"Event ID",required:!0})},async run(t){let e=await vr(t.auth),r=t.propsValue.calendar_id,n=t.propsValue.eventId;return(await(0,Dw.calendar)({version:"v3",auth:e}).events.delete({calendarId:r,eventId:n})).data}});var km=rt(ja());var zw=Pt({auth:Oe,name:"google_calendar_get_events",description:"Get Events",audience:"both",aiMetadata:{description:"Lists events from a Google Calendar, optionally filtered by a date range, search term, and event types, and can expand recurring events into individual instances. Use to look up or browse multiple events when you do not already have a specific event ID; use Get Event by ID for a single known event. Read-only and idempotent.",idempotent:!0},displayName:"Get all Events",props:{calendar_id:fe.calendarDropdown("writer"),event_types:Q.StaticMultiSelectDropdown({displayName:"Event types",description:"Select event types",required:!0,defaultValue:["default","focusTime","outOfOffice"],options:{options:[{label:"Default",value:"default"},{label:"Out Of Office",value:"outOfOffice"},{label:"Focus Time",value:"focusTime"},{label:"Working Location",value:"workingLocation"}]}}),search:Q.ShortText({displayName:"Search Term",required:!1}),start_date:Q.DateTime({displayName:"Date from",required:!1}),end_date:Q.DateTime({displayName:"Date to",required:!1}),singleEvents:Q.Checkbox({displayName:"Expand Recurring Event?",description:"Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves.",required:!0,defaultValue:!1})},outputSchema:Aw,async run(t){let{calendar_id:e,start_date:r,end_date:n,search:i,event_types:s,singleEvents:c}=t.propsValue,d=await Le(t.auth),p={showDeleted:"false"},h=`${fe.baseUrl}/calendars/${e}/events`;c!==null&&(p.singleEvents=c?"true":"false"),i&&(p.q=`"${i}"`),r&&(p.timeMin=(0,km.default)(r).format("YYYY-MM-DDTHH:mm:ss.sssZ")),r&&n&&(p.timeMax=(0,km.default)(n).format("YYYY-MM-DDTHH:mm:ss.sssZ")),s.length>0&&(h+=`?${s.map(m=>`eventTypes=${m}`).join("&")}`);let _={method:"GET",url:h,queryParams:p,authentication:{type:"BEARER_TOKEN",token:d}};return await Ge.sendRequest(_)}});var Uw=rt(Ja());var Dm=rt(ja());var Mw=Pt({displayName:"Update Event",auth:Oe,name:"update_event",description:"Updates an event in Google Calendar.",audience:"both",aiMetadata:{description:"Updates the fields of an existing Google Calendar event identified by calendar and event ID (title, times, location, description, color, attendees, guest permissions); unset fields retain their current values. Use to modify or reschedule an event that already exists rather than creating a new one. Requires the event ID. Idempotent: applying the same field values repeatedly leaves the event in the same state.",idempotent:!0},props:{calendar_id:fe.calendarDropdown("writer"),eventId:Q.ShortText({displayName:"Event ID",required:!0}),title:Q.ShortText({displayName:"Title of the event",required:!1}),start_date_time:Q.DateTime({displayName:"Start date time of the event",required:!1}),end_date_time:Q.DateTime({displayName:"End date time of the event",required:!1}),location:Q.ShortText({displayName:"Location",required:!1}),description:Q.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1}),colorId:fe.colorId,attendees:Q.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!1}),guests_can_modify:Q.Checkbox({displayName:"Guests can modify",defaultValue:!1,required:!1}),guests_can_invite_others:Q.Checkbox({displayName:"Guests can invite others",defaultValue:!1,required:!1}),guests_can_see_other_guests:Q.Checkbox({displayName:"Guests can see other guests",defaultValue:!1,required:!1})},outputSchema:yt,async run(t){let{calendar_id:e,eventId:r,title:n,start_date_time:i,end_date_time:s,location:c,description:d,colorId:p,guests_can_invite_others:h,guests_can_modify:_,guests_can_see_other_guests:m}=t.propsValue,f=t.propsValue.attendees,l=await vr(t.auth),g=(0,Uw.calendar)({version:"v3",auth:l}),v=await g.events.get({calendarId:e,eventId:r}),b=[];return Array.isArray(f)&&f.length>0?b=f.map(k=>({email:k})):v.data.attendees&&Array.isArray(v.data.attendees)&&(b=v.data.attendees),(await g.events.update({calendarId:e,eventId:r,requestBody:{summary:n??v.data.summary,attendees:b,description:d??v.data.description,colorId:p,location:c??v.data.location,start:i?{dateTime:(0,Dm.default)(i).format("YYYY-MM-DDTHH:mm:ss.sssZ")}:v.data.start,end:s?{dateTime:(0,Dm.default)(s).format("YYYY-MM-DDTHH:mm:ss.sssZ")}:v.data.end,guestsCanInviteOthers:h,guestsCanModify:_,guestsCanSeeOtherGuests:m}})).data}});var qc={strategy:0,items:o(async({auth:t,propsValue:{calendarId:e,expandRecurringEvent:r},lastFetchEpochMS:n})=>{let i=new Date(n);if(n===0){let d=new Date,p=new Date;p.setDate(d.getDate()-7),i=p}return(await aa(e,r,t,i)??[]).map(d=>({epochMilliSeconds:new Date(d.updated).getTime(),data:d}))},"items")},jw=Ut({auth:Oe,name:"new_or_updated_event",displayName:"New or Updated Event",description:"Triggers when an event is added or updated",aiMetadata:{description:"Fires when any event in the selected calendar is created or modified, polling by last-updated time. Each fired item is the affected event; can optionally expand recurring events so every occurrence fires separately."},props:{calendar_id:fe.calendarDropdown(),expandRecurringEvent:Q.Checkbox({displayName:"Expand Recurring Event?",description:"If true, the trigger will activate for every occurrence of a recurring event.",required:!0,defaultValue:!1})},sampleData:{kind:"calendar#event",etag:"3350849506974000",id:"0nsfi5ttd2b17ac76ma2f37oi9",htmlLink:"https://www.google.com/calendar/event?eid=kgjb90uioj4klrgfmdsnjsjvlgkm",summary:"ap-event-test",created:"2023-02-03T11:36:36.000Z",updated:"2023-02-03T11:45:53.487Z",description:"Sample description",status:"canceled",creator:{email:"test@test.com",self:!0},organizer:{email:"test@test.com",self:!0},start:{dateTime:"2023-02-02T22:30:00+03:00",timeZone:"Asia/Amman"},end:{dateTime:"2023-02-02T23:30:00+03:00",timeZone:"Asia/Amman"},transparency:"transparent",iCalUID:"0nsfi5ttd2b17ac76ma2f37oi9@google.com",sequence:1,attendees:[{email:"attende@test.com",responseStatus:"needsAction"},{email:"test@test.com",organizer:!0,self:!0,responseStatus:"accepted"}],reminders:{useDefault:!0},eventType:"default"},outputSchema:yt,type:"POLLING",async test({store:t,auth:e,propsValue:r,files:n}){return await He.test(qc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent},files:n})},async onEnable({store:t,auth:e,propsValue:r}){await He.onEnable(qc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent}})},async onDisable({store:t,auth:e,propsValue:r}){await He.onDisable(qc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent}})},async run({store:t,auth:e,propsValue:r,files:n}){return await He.poll(qc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent},files:n})}});var Lw=rt(Ja());var Fw=Pt({auth:Oe,name:"google-calendar-add-attendees",displayName:"Add Attendees to Event",description:"Add one or more person to existing event.",audience:"both",aiMetadata:{description:"Adds one or more guests (by email) to an existing Google Calendar event, identified by calendar and event ID, preserving the current attendee list. Use to invite people to an event that already exists rather than recreating it. Not idempotent: re-running appends the same emails again, producing duplicate attendee entries.",idempotent:!1},props:{calendar_id:fe.calendarDropdown("writer"),eventId:Q.ShortText({displayName:"Event ID",required:!0}),attendees:Q.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!0})},outputSchema:yt,async run(t){let{calendar_id:e,eventId:r}=t.propsValue,n=t.propsValue.attendees,i=await vr(t.auth),s=(0,Lw.calendar)({version:"v3",auth:i}),c=await s.events.get({calendarId:e,eventId:r}),d=c.data.attendees??[],p=[];return p.push(...d),p.push(...n.map(_=>({email:_}))),(await s.events.update({calendarId:e,eventId:r,requestBody:{...c.data,attendees:p}})).data}});var Nm=rt(ja());var qw=Pt({auth:Oe,name:"google_calendar_find_busy_free_periods",displayName:"Find Busy/Free Periods in Calendar",description:"Finds free/busy calendar details from Google Calendar.",audience:"both",aiMetadata:{description:"Queries one or more calendars for their busy time blocks within a given start/end window, without exposing event details. Use to check availability or find open slots before scheduling a meeting. Requires the calendars to check and a time range. Read-only and idempotent.",idempotent:!0},props:{calendar_ids:Q.MultiSelectDropdown({auth:Oe,displayName:"Calendars",description:"Select the calendars to check for busy periods.",required:!0,refreshers:[],options:o(async({auth:t})=>t?{disabled:!1,options:(await Mn(t)).map(n=>({label:n.summary,value:n.id}))}:{disabled:!0,placeholder:"Connect your account first",options:[]},"options")}),start_date:Q.DateTime({displayName:"Start Time",description:"The start of the time range to check.",required:!0}),end_date:Q.DateTime({displayName:"End Time",description:"The end of the time range to check.",required:!0})},outputSchema:Rw,async run(t){let{calendar_ids:e,start_date:r,end_date:n}=t.propsValue,i=await Le(t.auth),s={timeMin:(0,Nm.default)(r).toISOString(),timeMax:(0,Nm.default)(n).toISOString(),items:e.map(p=>({id:p}))},c={method:"POST",url:`${fe.baseUrl}/freeBusy`,body:s,authentication:{type:"BEARER_TOKEN",token:i}};return(await Ge.sendRequest(c)).body}});var Bw=Pt({auth:Oe,name:"google_calendar_get_event_by_id",displayName:"Get Event by ID",description:"Fetch event details by its unique ID from Google Calendar.",audience:"both",aiMetadata:{description:"Fetches the full details of a single Google Calendar event by its unique event ID within a given calendar. Use when you already have an event ID (e.g. from a trigger or a list action) and need its details; use Get all Events to search when you do not. Requires a valid event ID. Read-only and idempotent.",idempotent:!0},props:{calendar_id:fe.calendarDropdown(),event_id:Q.ShortText({displayName:"Event ID",description:'The unique ID of the event (e.g., "abc123def456"). You can find this in the event URL or from other calendar actions.',required:!0}),max_attendees:Q.Number({displayName:"Max Attendees",description:"Maximum number of attendees to include in the response. If there are more attendees, only the participant is returned.",required:!1}),time_zone:Q.ShortText({displayName:"Time Zone",description:`Time zone for the response (e.g., "America/New_York", "Europe/London"). Defaults to the calendar's time zone if not specified.`,required:!1})},outputSchema:yt,async run(t){let{calendar_id:e,event_id:r,max_attendees:n,time_zone:i}=t.propsValue,s=await Le(t.auth);if(!e||typeof e!="string"||e.trim().length===0)throw new Error("Calendar ID is required");if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Event ID cannot be empty");if(r.length<5||r.length>1024)throw new Error("Event ID must be between 5 and 1024 characters");let c={};n!==void 0&&n>0&&(c.maxAttendees=n.toString()),i&&typeof i=="string"&&i.trim().length>0&&(c.timeZone=i.trim());let d=`${fe.baseUrl}/calendars/${encodeURIComponent(e.trim())}/events/${encodeURIComponent(r.trim())}`,p={method:"GET",url:d,queryParams:c,authentication:{type:"BEARER_TOKEN",token:s}};try{return(await Ge.sendRequest(p)).body}catch(h){throw h.response?.status===404?new Error(`Event with ID "${r}" not found in calendar "${e}". Please verify the event ID and calendar selection.`):h.response?.status===403?new Error(`Access denied to event "${r}" in calendar "${e}". Please check your permissions.`):h.response?.status===400?new Error("Invalid request parameters. Please check the event ID format and other parameters."):h.response?.status===401?new Error("Authentication failed. Please reconnect your Google Calendar account."):new Error(`Failed to fetch event: ${h.message||"Unknown error occurred"}`)}}});var Bc="google_calendar_watch",xi="google_calendar_sync_token",zm="google_calendar_seen_event_ids",K1=500;function Vw(t,{event_types:e,search_filter:r,exclude_all_day:n}){if(e&&e.length>0){let i=t.eventType||"default";if(!e.includes(i))return!1}if(r&&r.trim()){let i=r.toLowerCase().trim(),s=(t.summary||"").toLowerCase(),c=(t.description||"").toLowerCase(),d=(t.location||"").toLowerCase();if(!(s.includes(i)||c.includes(i)||d.includes(i)))return!1}return!(n&&t.start?.date&&!t.start?.dateTime)}o(Vw,"matchesFilters");var Gw=Ut({auth:Oe,name:"new_event",displayName:"New Event",description:"Fires when a new event is created in a calendar.",aiMetadata:{description:"Fires when a brand-new event is created in the selected calendar (not on edits or cancellations), via Google push notifications. Each fired item is the new event; can be narrowed by event type, a text search across title/description/location, and an option to skip all-day events."},props:{calendar_id:fe.calendarDropdown("writer"),event_types:Q.StaticMultiSelectDropdown({displayName:"Event Types to Monitor",description:"Filter by specific event types (leave empty to monitor all event types)",required:!1,options:{options:[{label:"Default Events",value:"default"},{label:"Birthday Events",value:"birthday"},{label:"Focus Time",value:"focusTime"},{label:"Out of Office",value:"outOfOffice"},{label:"Working Location",value:"workingLocation"},{label:"From Gmail",value:"fromGmail"}]}}),search_filter:Q.ShortText({displayName:"Search Filter",description:"Only trigger for events containing this text in title, description, or location (optional)",required:!1}),exclude_all_day:Q.Checkbox({displayName:"Exclude All-Day Events",description:"Skip triggering for all-day events",required:!1,defaultValue:!1})},outputSchema:yt,type:"WEBHOOK",renewConfiguration:{strategy:"CRON",cronExpression:"0 */12 * * *"},sampleData:{kind:"calendar#event",etag:'"3419997894982000"',id:"sample_event_id_12345",status:"confirmed",htmlLink:"https://www.google.com/calendar/event?eid=c2FtcGxlX2V2ZW50X2lkXzEyMzQ1",created:"2025-08-15T11:02:27.000Z",updated:"2025-08-15T11:02:27.491Z",summary:"Team Sync",creator:{email:"creator@example.com"},organizer:{email:"creator@example.com",self:!0},start:{dateTime:"2025-08-18T10:00:00-07:00",timeZone:"America/Los_Angeles"},end:{dateTime:"2025-08-18T11:00:00-07:00",timeZone:"America/Los_Angeles"},iCalUID:"sample_event_id_12345@google.com",sequence:0,reminders:{useDefault:!0},eventType:"default"},async onEnable(t){let e=t.propsValue.calendar_id,r=t.auth,n=await Id(e,t.webhookUrl,r);await t.store.put(Bc,n);let i=await iu({calendarId:e,authProp:r});ot(i)||await t.store.put(xi,i)},async onDisable(t){let e=t.auth,r=await t.store.get(Bc);r&&await Ad(r,e),await t.store.delete(xi),await t.store.delete(zm)},async onRenew(t){let e=t.propsValue.calendar_id,r=t.auth,n=await t.store.get(Bc);n&&await Ad(n,r);let i=await Id(e,t.webhookUrl,r);await t.store.put(Bc,i)},async run(t){let n=t.payload.headers["x-goog-resource-state"],i={event_types:t.propsValue.event_types,search_filter:t.propsValue.search_filter,exclude_all_day:t.propsValue.exclude_all_day};if(n==="sync")return[];if(n!=="exists")return[];let s=t.propsValue.calendar_id,c=t.auth,d=await t.store.get(xi);if(ot(d)){let g=await iu({calendarId:s,authProp:c});return ot(g)||await t.store.put(xi,g),[]}let{items:p,nextSyncToken:h,syncTokenInvalid:_}=await rb({calendarId:s,syncToken:d,authProp:c});if(_){let g=await iu({calendarId:s,authProp:c});return ot(g)||await t.store.put(xi,g),[]}ot(h)||await t.store.put(xi,h);let m=await t.store.get(zm),f=new Set(m??[]),l=[];for(let g of p)!g.id||g.status==="cancelled"||f.has(g.id)||(f.add(g.id),Vw(g,i)&&l.push(g));if(f.size!==(m?.length??0)){let g=Array.from(f).slice(-K1);await t.store.put(zm,g)}return l},async test(t){let e=t.auth,r={event_types:t.propsValue.event_types,search_filter:t.propsValue.search_filter,exclude_all_day:t.propsValue.exclude_all_day},n=await ob(t.propsValue.calendar_id,e);return Vw(n,r)?[n]:[]}});var Vc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{if(r===0)return[];let{calendar_id:n,specific_event:i,event_id:s}=e;if(!n)return[];if(i&&!s)return[];let c=[];if(i&&s){let h={method:"GET",url:`${fe.baseUrl}/calendars/${n}/events/${s}`,authentication:{type:"BEARER_TOKEN",token:await Le(t)}};try{let m=(await Ge.sendRequest(h)).body,f=m.end?.dateTime??m.end?.date;f&&new Date(f).getTime()>r&&(c=[m])}catch(_){return console.error("Error fetching specific event:",_),[]}}else{let h={method:"GET",url:`${fe.baseUrl}/calendars/${n}/events`,authentication:{type:"BEARER_TOKEN",token:await Le(t)},queryParams:{singleEvents:"true",orderBy:"startTime",timeMin:new Date(r).toISOString()}};c=(await Ge.sendRequest(h)).body.items}let d=[],p=Date.now();for(let h of c){let _=h.end?.dateTime??h.end?.date;if(!_)continue;let m=new Date(_).getTime();m>r&&m<=p&&d.push({epochMilliSeconds:m,data:h})}return d},"items")},Hw=Ut({auth:Oe,name:"event_ends",displayName:"Event Ends",description:"Fires when an event ends.",aiMetadata:{description:"Fires once an event in the selected calendar reaches its end time, detected by polling. Each fired item is the event that just ended. Can watch all events in the calendar or be scoped to a single specific event."},props:{calendar_id:fe.calendarDropdown("writer"),specific_event:Q.Checkbox({displayName:"Target Specific Event",description:"Enable to monitor a specific event instead of all events in the calendar.",required:!1,defaultValue:!1}),event_id:fe.eventDropdown(!1)},outputSchema:yt,type:"POLLING",sampleData:{kind:"calendar#event",etag:'"3419997894982000"',id:"sample_event_id_67890",status:"confirmed",htmlLink:"https://www.google.com/calendar/event?eid=c2FtcGxlX2V2ZW50X2lkXzY3ODkw",created:"2025-08-14T09:00:00.000Z",updated:"2025-08-14T09:00:00.000Z",summary:"Project Deadline",creator:{email:"manager@example.com"},organizer:{email:"manager@example.com",self:!0},start:{dateTime:"2025-08-14T14:30:00+05:30",timeZone:"Asia/Kolkata"},end:{dateTime:"2025-08-14T15:30:00+05:30",timeZone:"Asia/Kolkata"},iCalUID:"sample_event_id_67890@google.com",sequence:0,reminders:{useDefault:!0},eventType:"default"},async onEnable(t){await He.onEnable(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await He.onDisable(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await He.poll(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await He.test(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var Gc={strategy:0,items:o(async({auth:t,propsValue:e})=>{let{calendar_id:r,specific_event:n,event_id:i,time_value:s,time_unit:c}=e;if(!r||!s||!c)return[];if(n&&!i)return[];let d=s*60*1e3;c==="hours"?d=s*60*60*1e3:c==="days"&&(d=s*24*60*60*1e3);let p=Date.now(),h=5*60*1e3,_=new Date(p+d).toISOString(),m=new Date(p+d+h).toISOString(),f=[];if(n&&i){let l={method:"GET",url:`${fe.baseUrl}/calendars/${r}/events/${i}`,authentication:{type:"BEARER_TOKEN",token:await Le(t)}};try{let v=(await Ge.sendRequest(l)).body,E=new Date(v.start?.dateTime??v.start?.date??0).getTime()-d;E>=p&&E<=p+h&&(f=[v])}catch(g){return console.error("Error fetching specific event:",g),[]}}else{let l={method:"GET",url:`${fe.baseUrl}/calendars/${r}/events`,authentication:{type:"BEARER_TOKEN",token:await Le(t)},queryParams:{singleEvents:"true",orderBy:"startTime",timeMin:_,timeMax:m}};f=(await Ge.sendRequest(l)).body.items}return f.map(l=>({epochMilliSeconds:new Date(l.start?.dateTime??l.start?.date??0).getTime()-d,data:l}))},"items")},Ww=Ut({auth:Oe,name:"event_starts_in",displayName:"Event Start (Time Before)",description:"Fires at a specified amount of time before an event starts (e.g., a reminder).",aiMetadata:{description:"Fires a configurable lead time (in minutes, hours, or days) before an event in the selected calendar begins, acting as a pre-event reminder. Each fired item is the upcoming event. Can watch all events or a single specific event."},props:{calendar_id:fe.calendarDropdown("writer"),specific_event:Q.Checkbox({displayName:"Target Specific Event",description:"Enable to monitor a specific event instead of all events in the calendar.",required:!1,defaultValue:!1}),event_id:fe.eventDropdown(!1),time_value:Q.Number({displayName:"Time Before",description:"The amount of time before the event starts.",required:!0,defaultValue:15}),time_unit:Q.StaticDropdown({displayName:"Time Unit",required:!0,options:{options:[{label:"Minutes",value:"minutes"},{label:"Hours",value:"hours"},{label:"Days",value:"days"}]},defaultValue:"minutes"})},outputSchema:yt,type:"POLLING",sampleData:{},async onEnable(t){await He.onEnable(Gc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await He.onDisable(Gc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await He.poll(Gc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await He.test(Gc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var Hc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let{calendar_id:n,search_term:i,event_types:s,search_fields:c}=e;if(!n||!i)return[];let d;r===0?(d=new Date,d.setDate(d.getDate()-1)):d=new Date(r);let p={singleEvents:"true",orderBy:"updated",updatedMin:d.toISOString(),q:i};s&&s.length>0&&s.forEach(l=>{p.eventTypes?p.eventTypes+="&eventTypes="+l:p.eventTypes=l});let h={method:"GET",url:`${fe.baseUrl}/calendars/${n}/events`,authentication:{type:"BEARER_TOKEN",token:await Le(t)},queryParams:p};return(await Ge.sendRequest(h)).body.items.filter(l=>{let g=new Date(l.created??0).getTime();if(!(new Date(l.updated??0).getTime()-g<5e3))return!1;if(c&&c.length>0){let E=i.toLowerCase();return c.some(k=>{switch(k){case"summary":return l.summary?.toLowerCase().includes(E)||!1;case"description":return l.description?.toLowerCase().includes(E)||!1;case"location":return l.location?.toLowerCase().includes(E)||!1;case"attendees":return l.attendees?.some(L=>L.email?.toLowerCase().includes(E)||L.displayName?.toLowerCase().includes(E))||!1;default:return!1}})}return!0}).map(l=>({epochMilliSeconds:new Date(l.updated).getTime(),data:l}))},"items")},Zw=Ut({auth:Oe,name:"new_event_matching_search",displayName:"New Event Matching Search",description:"Fires when a new event is created that matches a specified search term.",aiMetadata:{description:"Fires when a newly created event in the selected calendar matches a required search term (matched across title, description, location, and attendees by default, or restricted to chosen fields). Each fired item is the matching new event; can also be filtered by event type."},props:{calendar_id:fe.calendarDropdown("writer"),search_term:Q.ShortText({displayName:"Search Term",description:"The keyword(s) to search for in new events (searches across title, description, location, and attendees by default).",required:!0}),event_types:Q.StaticMultiSelectDropdown({displayName:"Event Types",description:"Filter by specific event types (optional)",required:!1,options:{options:[{label:"Default Events",value:"default"},{label:"Birthday Events",value:"birthday"},{label:"Focus Time",value:"focusTime"},{label:"Out of Office",value:"outOfOffice"},{label:"Working Location",value:"workingLocation"},{label:"From Gmail",value:"fromGmail"}]}}),search_fields:Q.StaticMultiSelectDropdown({displayName:"Search In Fields",description:"Specify which fields to search in (leave empty to use Google's default search across all fields)",required:!1,options:{options:[{label:"Event Title/Summary",value:"summary"},{label:"Event Description",value:"description"},{label:"Event Location",value:"location"},{label:"Attendee Names/Emails",value:"attendees"}]}})},outputSchema:yt,type:"POLLING",sampleData:{id:"abc123def456",summary:"Final Project Review",description:"Review of the Q3 final project deliverables.",status:"confirmed",created:"2025-08-14T09:05:00.000Z",updated:"2025-08-14T09:05:01.000Z",start:{dateTime:"2025-09-01T10:00:00-07:00"},end:{dateTime:"2025-09-01T11:30:00-07:00"},organizer:{email:"project.manager@example.com"}},async onEnable(t){await He.onEnable(Hc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await He.onDisable(Hc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await He.poll(Hc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await He.test(Hc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var Wc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let{calendar_id:n,specific_event:i,event_id:s,cancellation_reason:c}=e;if(!n)return[];if(i&&!s)return[];let d;r===0?(d=new Date,d.setDate(d.getDate()-1)):d=new Date(r);let p=[];if(i&&s){let h={method:"GET",url:`${fe.baseUrl}/calendars/${n}/events/${s}`,authentication:{type:"BEARER_TOKEN",token:await Le(t)}};try{let m=(await Ge.sendRequest(h)).body;new Date(m.updated??0).getTime()>r&&m.status==="cancelled"&&(p=[m])}catch(_){return console.error("Error fetching specific event:",_),[]}}else p=(await aa(n,!0,t,d)).filter(_=>_.status==="cancelled");return c&&c.length>0&&(p=p.filter(h=>c.some(_=>{switch(_){case"deleted":return!h.summary||h.summary.includes("Deleted");case"declined":return h.attendees?.some(m=>m.responseStatus==="declined")||!1;case"rescheduled":return h.summary?.toLowerCase().includes("rescheduled")||h.description?.toLowerCase().includes("rescheduled")||!1;case"other":return!0;default:return!0}}))),p.map(h=>({epochMilliSeconds:new Date(h.updated).getTime(),data:h}))},"items")},Kw=Ut({auth:Oe,name:"event_cancelled",displayName:"Event Cancelled",description:"Fires when an event is canceled or deleted.",aiMetadata:{description:"Fires when an event in the selected calendar transitions to a cancelled (or deleted) state, detected by polling. Each fired item is the cancelled event; can optionally be filtered by cancellation reason (deleted, attendee declined, rescheduled, other) and scoped to a single specific event."},props:{calendar_id:fe.calendarDropdown("writer"),specific_event:Q.Checkbox({displayName:"Target Specific Event",description:"Enable to monitor a specific event instead of all events in the calendar.",required:!1,defaultValue:!1}),event_id:fe.eventDropdown(!1),cancellation_reason:Q.StaticMultiSelectDropdown({displayName:"Cancellation Reasons",description:"Filter by specific types of cancellations (optional)",required:!1,options:{options:[{label:"Event Deleted",value:"deleted"},{label:"Attendee Declined",value:"declined"},{label:"Event Rescheduled",value:"rescheduled"},{label:"Other Cancellations",value:"other"}]}})},outputSchema:yt,type:"POLLING",sampleData:{id:"abc123def456_cancelled",summary:"Cancelled: Q3 Planning Session",status:"cancelled",created:"2025-07-20T10:00:00.000Z",updated:"2025-08-14T09:30:00.000Z",organizer:{email:"project.manager@example.com"},start:{dateTime:"2025-08-25T10:00:00-07:00"},end:{dateTime:"2025-08-25T11:30:00-07:00"}},async onEnable(t){await He.onEnable(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await He.onDisable(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await He.poll(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await He.test(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var Um={strategy:1,items:o(async({auth:t,store:e,propsValue:r})=>{let{access_role_filter:n,calendar_name_filter:i,exclude_shared:s}=r,d=await Mn(t);if(n&&n.length>0&&(d=d.filter(f=>n.includes(f.accessRole))),i&&i.trim()){let f=i.toLowerCase().trim();d=d.filter(l=>l.summary?.toLowerCase().includes(f)||l.description?.toLowerCase().includes(f))}s&&(d=d.filter(f=>f.accessRole==="owner"||f.primary));let p=d.map(f=>f.id),h=await e.get("calendars")||[],_=new Set(h),m=d.filter(f=>!_.has(f.id));return await e.put("calendars",p),m.map(f=>({id:f.id,data:{...f,isOwned:f.accessRole==="owner"||f.primary,isShared:f.accessRole!=="owner"&&!f.primary,calendarType:f.primary?"primary":f.accessRole==="owner"?"owned":"shared"}}))},"items")},Jw=Ut({auth:Oe,name:"new_calendar",displayName:"New Calendar",description:"Fires when a new calendar is created or becomes accessible.",aiMetadata:{description:"Fires when a calendar newly appears in the connected account's calendar list, whether created or shared in, detected by polling. Each fired item is the new calendar. Can be filtered by access role, a name/description text match, and an option to exclude shared calendars."},props:{access_role_filter:Q.StaticMultiSelectDropdown({displayName:"Access Role Filter",description:"Only trigger for calendars with specific access roles (optional)",required:!1,options:{options:[{label:"Owner",value:"owner"},{label:"Writer",value:"writer"},{label:"Reader",value:"reader"},{label:"Free/Busy Reader",value:"freeBusyReader"}]}}),calendar_name_filter:Q.ShortText({displayName:"Calendar Name Filter",description:"Only trigger for calendars containing this text in name or description (optional)",required:!1}),exclude_shared:Q.Checkbox({displayName:"Exclude Shared Calendars",description:"Only trigger for calendars you own, not shared calendars",required:!1,defaultValue:!1})},outputSchema:xw,type:"POLLING",sampleData:{id:"sample_calendar_id@group.calendar.google.com",summary:"New Project Team Calendar",description:"A shared calendar for the new project team.",timeZone:"Asia/Kolkata",backgroundColor:"#9fe1e7",foregroundColor:"#000000",accessRole:"owner",isOwned:!0,isShared:!1,calendarType:"owned",primary:!1},async onEnable(t){let e=await Mn(t.auth),{access_role_filter:r,calendar_name_filter:n,exclude_shared:i}=t.propsValue,s=e;if(r&&r.length>0&&(s=s.filter(c=>r.includes(c.accessRole))),n&&n.trim()){let c=n.toLowerCase().trim();s=s.filter(d=>d.summary?.toLowerCase().includes(c)||d.description?.toLowerCase().includes(c))}i&&(s=s.filter(c=>c.accessRole==="owner"||c.primary)),await t.store.put("calendars",s.map(c=>c.id)),await He.onEnable(Um,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await He.onDisable(Um,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await He.poll(Um,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return(await Mn(t.auth)).slice(-1).map(n=>({id:n.id,data:{...n,isOwned:n.accessRole==="owner"||n.primary,isShared:n.accessRole!=="owner"&&!n.primary,calendarType:n.primary?"primary":n.accessRole==="owner"?"owned":"shared"}}))}});var J1=qy({minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/google-calendar.png",categories:["PRODUCTIVITY"],displayName:"Google Calendar",description:"Get organized and stay on schedule",authors:["OsamaHaikal","bibhuty-did-this","Vitalini","pfernandez98","kishanprmr","MoShizzle","khaledmashaly","abuaboud","ikus060","Cloudieunnie","sanket-a11y","geekyme"],auth:Oe,actions:[Fw,kw,$w,zw,Mw,Nw,qw,Bw,eb({auth:Oe,baseUrl(){return fe.baseUrl},authMapping:o(async t=>({Authorization:`Bearer ${await Le(t)}`}),"authMapping")})],triggers:[jw,Gw,Hw,Ww,Zw,Kw,Jw]});0&&(module.exports={createGoogleClient,getAccessToken,googleCalendar,googleCalendarAuth});
|
|
70
70
|
/*! Bundled license information:
|
|
71
71
|
|
|
72
72
|
mime-types/index.js:
|