@activepieces/piece-google-calendar 0.9.4 → 0.10.0
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 +41 -41
package/src/index.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
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 FI=Object.create;var Li=Object.defineProperty;var qI=Object.getOwnPropertyDescriptor;var BI=Object.getOwnPropertyNames;var VI=Object.getPrototypeOf,GI=Object.prototype.hasOwnProperty;var o=(t,e)=>Li(t,"name",{value:e,configurable:!0});var Tt=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var D=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},As=(t,e)=>{for(var r in e)Li(t,r,{get:e[r],enumerable:!0})},dg=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of BI(e))!GI.call(t,i)&&i!==r&&Li(t,i,{get:()=>e[i],enumerable:!(n=qI(e,i))||n.enumerable});return t};var qe=(t,e,r)=>(r=t!=null?FI(VI(t)):{},dg(e||!t||!t.__esModule?Li(r,"default",{value:t,enumerable:!0}):r,t)),HI=t=>dg(Li({},"__esModule",{value:!0}),t);var Dy=D(($y,Zs)=>{(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,E=-1,b=(l.match(d.zoneIndex)||[])[0],C,U;for(b&&(b=b.substring(1),l=l.replace(/%.+$/,""));(E=l.indexOf(":",E+1))>=0;)v++;if(l.substr(0,2)==="::"&&v--,l.substr(-2,2)==="::"&&v--,v>g)return null;for(U=g-v,C=":";U--;)C+="0:";return l=l.replace("::",C),l[0]===":"&&(l=l.slice(1)),l[l.length-1]===":"&&(l=l.slice(0,-1)),g=(function(){let J=l.split(":"),W=[];for(let H=0;H<J.length;H++)W.push(parseInt(J[H],16));return W})(),{parts:g,zoneId:b}}o(p,"expandIPv6");function m(l,g,v,E){if(l.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let b=0,C;for(;E>0;){if(C=v-E,C<0&&(C=0),l[b]>>C!==g[b]>>C)return!1;E-=v,b+=1}return!0}o(m,"matchCIDR");function y(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(y,"parseIntAuto");function h(l,g){for(;l.length<g;)l=`0${l}`;return l}o(h,"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,E;for(v=0;v<g.length;v++)if(E=g[v],!(0<=E&&E<=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 E;if(v===void 0&&(E=g,g=E[0],v=E[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return m(this.octets,g.octets,8,v)},l.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!1,E={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},b,C,U;for(b=3;b>=0;b-=1)if(C=this.octets[b],C in E){if(U=E[C],v&&U!==0)return null;U!==8&&(v=!0),g+=U}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(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],C=0;for(;C<4;)b.push(parseInt(v[C],10)|parseInt(E[C],10)^255),C++;return new this(b)}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,E,b,C;try{for(g=this.parseCIDR(l),E=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],v=0;v<4;)b.push(parseInt(E[v],10)&parseInt(C[v],10)),v++;return new this(b)}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 E=[this.parse(g[1]),v];return Object.defineProperty(E,"toString",{value:o(function(){return this.join("/")},"value")}),E}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},f.IPv4.parser=function(l){let g,v,E;if(g=l.match(r.fourOctet))return(function(){let b=g.slice(1,6),C=[];for(let U=0;U<b.length;U++)v=b[U],C.push(y(v));return C})();if(g=l.match(r.longValue)){if(E=y(g[1]),E>4294967295||E<0)throw new Error("ipaddr: address outside defined range");return(function(){let b=[],C;for(C=0;C<=24;C+=8)b.push(E>>C&255);return b})().reverse()}else return(g=l.match(r.twoOctet))?(function(){let b=g.slice(1,4),C=[];if(E=y(b[1]),E>16777215||E<0)throw new Error("ipaddr: address outside defined range");return C.push(y(b[0])),C.push(E>>16&255),C.push(E>>8&255),C.push(E&255),C})():(g=l.match(r.threeOctet))?(function(){let b=g.slice(1,5),C=[];if(E=y(b[2]),E>65535||E<0)throw new Error("ipaddr: address outside defined range");return C.push(y(b[0])),C.push(y(b[1])),C.push(E>>8&255),C.push(E&255),C})():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,E=Math.floor(l/8);for(;v<E;)g[v]=255,v++;return E<4&&(g[E]=Math.pow(2,l%8)-1<<8-l%8),new this(g)},f.IPv6=(function(){function l(g,v){let E,b;if(g.length===16)for(this.parts=[],E=0;E<=14;E+=2)this.parts.push(g[E]<<8|g[E+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(E=0;E<this.parts.length;E++)if(b=this.parts[E],!(0<=b&&b<=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 E;if(v===void 0&&(E=g,g=E[0],v=E[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return m(this.parts,g.parts,16,v)},l.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!1,E={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},b,C;for(let U=7;U>=0;U-=1)if(b=this.parts[U],b in E){if(C=E[b],v&&C!==0)return null;C!==16&&(v=!0),g+=C}else return null;return 128-g},l.prototype.range=function(){return f.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){let g,v=[],E=this.parts;for(let b=0;b<E.length;b++)g=E[b],v.push(g>>8),v.push(g&255);return v},l.prototype.toFixedLengthString=function(){let g=(function(){let E=[];for(let b=0;b<this.parts.length;b++)E.push(h(this.parts[b].toString(16),4));return E}).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],E=g[1];return new f.IPv4([v>>8,v&255,E>>8,E&255])},l.prototype.toNormalizedString=function(){let g=(function(){let E=[];for(let b=0;b<this.parts.length;b++)E.push(this.parts[b].toString(16));return E}).call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},l.prototype.toRFC5952String=function(){let g=/((^|:)(0(:|$)){2,})/g,v=this.toNormalizedString(),E=0,b=-1,C;for(;C=g.exec(v);)C[0].length>b&&(E=C.index,b=C[0].length);return b<0?v:`${v.substring(0,E)}::${v.substring(E+b)}`},l.prototype.toString=function(){return this.toRFC5952String()},l})(),f.IPv6.broadcastAddressFromCIDR=function(l){try{let g=this.parseCIDR(l),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],C=0;for(;C<16;)b.push(parseInt(v[C],10)|parseInt(E[C],10)^255),C++;return new this(b)}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,E,b,C;try{for(g=this.parseCIDR(l),E=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],v=0;v<16;)b.push(parseInt(E[v],10)&parseInt(C[v],10)),v++;return new this(b)}catch(U){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${U})`)}},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,E;if((v=l.match(/^(.+)\/(\d+)$/))&&(g=parseInt(v[2]),g>=0&&g<=128))return E=[this.parse(v[1]),g],Object.defineProperty(E,"toString",{value:o(function(){return this.join("/")},"value")}),E;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},f.IPv6.parser=function(l){let g,v,E,b,C,U;if(E=l.match(d.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(d.native.test(l))return p(l,8);if((E=l.match(d.transitional))&&(U=E[6]||"",g=E[1],E[1].endsWith("::")||(g=g.slice(0,-1)),g=p(g+U,6),g.parts)){for(C=[parseInt(E[2]),parseInt(E[3]),parseInt(E[4]),parseInt(E[5])],v=0;v<C.length;v++)if(b=C[v],!(0<=b&&b<=255))return null;return g.parts.push(C[0]<<8|C[1]),g.parts.push(C[2]<<8|C[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,E=Math.floor(l/8);for(;v<E;)g[v]=255,v++;return E<16&&(g[E]=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 E,b,C,U;v==null&&(v="unicast");for(b in g)if(Object.prototype.hasOwnProperty.call(g,b)){for(C=g[b],C[0]&&!(C[0]instanceof Array)&&(C=[C]),E=0;E<C.length;E++)if(U=C[E],l.kind()===U[0].kind()&&l.match.apply(l,U))return b}return v},typeof Zs<"u"&&Zs.exports?Zs.exports=f:t.ipaddr=f})($y)});var $v=D((eJ,kv)=>{var Ov=require("stream").Stream,A0=require("util");kv.exports=Ar;function Ar(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(Ar,"DelayedStream");A0.inherits(Ar,Ov);Ar.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(Ar.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});Ar.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Ar.prototype.resume=function(){this._released||this.release(),this.source.resume()};Ar.prototype.pause=function(){this.source.pause()};Ar.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};Ar.prototype.pipe=function(){var t=Ov.prototype.pipe.apply(this,arguments);return this.resume(),t};Ar.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)};Ar.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 Uv=D((rJ,zv)=>{var I0=require("util"),Nv=require("stream").Stream,Dv=$v();zv.exports=ft;function ft(){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(ft,"CombinedStream");I0.inherits(ft,Nv);ft.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};ft.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};ft.prototype.append=function(t){var e=ft.isStreamLike(t);if(e){if(!(t instanceof Dv)){var r=Dv.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};ft.prototype.pipe=function(t,e){return Nv.prototype.pipe.call(this,t,e),this.resume(),t};ft.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}};ft.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=ft.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ft.prototype._pipeNext=function(t){this._currentStream=t;var e=ft.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()};ft.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};ft.prototype.write=function(t){this.emit("data",t)};ft.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ft.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")};ft.prototype.end=function(){this._reset(),this.emit("end")};ft.prototype.destroy=function(){this._reset(),this.emit("close")};ft.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ft.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};ft.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)};ft.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var Lv=D((oJ,Mv)=>{"use strict";Mv.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 qv=D(Ft=>{"use strict";var tu=Lv(),R0=require("path").extname,jv=/^\s*([^;\s]*)(?:;|\s|$)/,C0=/^text\//i;Ft.charset=Fv;Ft.charsets={lookup:Fv};Ft.contentType=O0;Ft.extension=k0;Ft.extensions=Object.create(null);Ft.lookup=$0;Ft.types=Object.create(null);D0(Ft.extensions,Ft.types);function Fv(t){if(!t||typeof t!="string")return!1;var e=jv.exec(t),r=e&&tu[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&C0.test(e[1])?"UTF-8":!1}o(Fv,"charset");function O0(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Ft.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Ft.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(O0,"contentType");function k0(t){if(!t||typeof t!="string")return!1;var e=jv.exec(t),r=e&&Ft.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(k0,"extension");function $0(t){if(!t||typeof t!="string")return!1;var e=R0("x."+t).toLowerCase().substr(1);return e&&Ft.types[e]||!1}o($0,"lookup");function D0(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(tu).forEach(o(function(i){var s=tu[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 m=r.indexOf(tu[e[p]].source),y=r.indexOf(s.source);if(e[p]!=="application/octet-stream"&&(m>y||m===y&&e[p].substr(0,12)==="application/"))continue}e[p]=i}}},"forEachMimeType"))}o(D0,"populateMaps")});var Vv=D((sJ,Bv)=>{Bv.exports=N0;function N0(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(N0,"defer")});var md=D((cJ,Hv)=>{var Gv=Vv();Hv.exports=z0;function z0(t){var e=!1;return Gv(function(){e=!0}),o(function(n,i){e?t(n,i):Gv(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(z0,"async")});var hd=D((dJ,Wv)=>{Wv.exports=U0;function U0(t){Object.keys(t.jobs).forEach(M0.bind(t)),t.jobs={}}o(U0,"abort");function M0(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(M0,"clean")});var gd=D((fJ,Kv)=>{var Zv=md(),L0=hd();Kv.exports=j0;function j0(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=F0(e,i,t[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?L0(r):r.results[i]=c,n(s,r.results))})}o(j0,"iterate");function F0(t,e,r,n){var i;return t.length==2?i=t(r,Zv(n)):i=t(r,e,Zv(n)),i}o(F0,"runJob")});var yd=D((hJ,Jv)=>{Jv.exports=q0;function q0(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(q0,"state")});var vd=D((yJ,Yv)=>{var B0=hd(),V0=md();Yv.exports=G0;function G0(t){Object.keys(this.jobs).length&&(this.index=this.size,B0(this),V0(t)(null,this.results))}o(G0,"terminator")});var Qv=D((_J,Xv)=>{var H0=gd(),W0=yd(),Z0=vd();Xv.exports=K0;function K0(t,e,r){for(var n=W0(t);n.index<(n.keyedList||t).length;)H0(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 Z0.bind(n,r)}o(K0,"parallel")});var _d=D((EJ,ru)=>{var e_=gd(),J0=yd(),Y0=vd();ru.exports=X0;ru.exports.ascending=t_;ru.exports.descending=Q0;function X0(t,e,r,n){var i=J0(t,r);return e_(t,e,i,o(function s(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||t).length){e_(t,e,i,s);return}n(null,i.results)},"iteratorHandler")),Y0.bind(i,n)}o(X0,"serialOrdered");function t_(t,e){return t<e?-1:t>e?1:0}o(t_,"ascending");function Q0(t,e){return-1*t_(t,e)}o(Q0,"descending")});var n_=D((wJ,r_)=>{var eO=_d();r_.exports=tO;function tO(t,e,r){return eO(t,e,null,r)}o(tO,"serial")});var i_=D((PJ,o_)=>{o_.exports={parallel:Qv(),serial:n_(),serialOrdered:_d()}});var bd=D((xJ,a_)=>{"use strict";a_.exports=Object});var u_=D((AJ,s_)=>{"use strict";s_.exports=Error});var l_=D((IJ,c_)=>{"use strict";c_.exports=EvalError});var p_=D((RJ,d_)=>{"use strict";d_.exports=RangeError});var m_=D((CJ,f_)=>{"use strict";f_.exports=ReferenceError});var g_=D((OJ,h_)=>{"use strict";h_.exports=SyntaxError});var Bn=D((kJ,y_)=>{"use strict";y_.exports=TypeError});var __=D(($J,v_)=>{"use strict";v_.exports=URIError});var E_=D((DJ,b_)=>{"use strict";b_.exports=Math.abs});var w_=D((NJ,S_)=>{"use strict";S_.exports=Math.floor});var P_=D((zJ,T_)=>{"use strict";T_.exports=Math.max});var A_=D((UJ,x_)=>{"use strict";x_.exports=Math.min});var R_=D((MJ,I_)=>{"use strict";I_.exports=Math.pow});var O_=D((LJ,C_)=>{"use strict";C_.exports=Math.round});var $_=D((jJ,k_)=>{"use strict";k_.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var N_=D((qJ,D_)=>{"use strict";var rO=$_();D_.exports=o(function(e){return rO(e)||e===0?e:e<0?-1:1},"sign")});var U_=D((VJ,z_)=>{"use strict";z_.exports=Object.getOwnPropertyDescriptor});var Ed=D((GJ,M_)=>{"use strict";var nu=U_();if(nu)try{nu([],"length")}catch{nu=null}M_.exports=nu});var j_=D((HJ,L_)=>{"use strict";var ou=Object.defineProperty||!1;if(ou)try{ou({},"a",{value:1})}catch{ou=!1}L_.exports=ou});var Sd=D((WJ,F_)=>{"use strict";F_.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 V_=D((KJ,B_)=>{"use strict";var q_=typeof Symbol<"u"&&Symbol,nO=Sd();B_.exports=o(function(){return typeof q_!="function"||typeof Symbol!="function"||typeof q_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:nO()},"hasNativeSymbols")});var wd=D((YJ,G_)=>{"use strict";G_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Td=D((XJ,H_)=>{"use strict";var oO=bd();H_.exports=oO.getPrototypeOf||null});var K_=D((QJ,Z_)=>{"use strict";var iO="Function.prototype.bind called on incompatible ",aO=Object.prototype.toString,sO=Math.max,uO="[object Function]",W_=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"),cO=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"),lO=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");Z_.exports=o(function(e){var r=this;if(typeof r!="function"||aO.apply(r)!==uO)throw new TypeError(iO+r);for(var n=cO(arguments,1),i,s=o(function(){if(this instanceof i){var y=r.apply(this,W_(n,arguments));return Object(y)===y?y:this}return r.apply(e,W_(n,arguments))},"binder"),c=sO(0,r.length-n.length),d=[],p=0;p<c;p++)d[p]="$"+p;if(i=Function("binder","return function ("+lO(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var m=o(function(){},"Empty");m.prototype=r.prototype,i.prototype=new m,m.prototype=null}return i},"bind")});var Jo=D((t5,J_)=>{"use strict";var dO=K_();J_.exports=Function.prototype.bind||dO});var iu=D((r5,Y_)=>{"use strict";Y_.exports=Function.prototype.call});var Pd=D((n5,X_)=>{"use strict";X_.exports=Function.prototype.apply});var eb=D((o5,Q_)=>{"use strict";Q_.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var rb=D((i5,tb)=>{"use strict";var pO=Jo(),fO=Pd(),mO=iu(),hO=eb();tb.exports=hO||pO.call(mO,fO)});var xd=D((a5,nb)=>{"use strict";var gO=Jo(),yO=Bn(),vO=iu(),_O=rb();nb.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new yO("a function is required");return _O(gO,vO,e)},"callBindBasic")});var cb=D((u5,ub)=>{"use strict";var bO=xd(),ob=Ed(),ab;try{ab=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ad=!!ab&&ob&&ob(Object.prototype,"__proto__"),sb=Object,ib=sb.getPrototypeOf;ub.exports=Ad&&typeof Ad.get=="function"?bO([Ad.get]):typeof ib=="function"?o(function(e){return ib(e==null?e:sb(e))},"getDunder"):!1});var mb=D((l5,fb)=>{"use strict";var lb=wd(),db=Td(),pb=cb();fb.exports=lb?o(function(e){return lb(e)},"getProto"):db?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return db(e)},"getProto"):pb?o(function(e){return pb(e)},"getProto"):null});var Id=D((p5,hb)=>{"use strict";var EO=Function.prototype.call,SO=Object.prototype.hasOwnProperty,wO=Jo();hb.exports=wO.call(EO,SO)});var ca=D((f5,Eb)=>{"use strict";var Me,TO=bd(),PO=u_(),xO=l_(),AO=p_(),IO=m_(),ei=g_(),Qo=Bn(),RO=__(),CO=E_(),OO=w_(),kO=P_(),$O=A_(),DO=R_(),NO=O_(),zO=N_(),_b=Function,Rd=o(function(t){try{return _b('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),aa=Ed(),UO=j_(),Cd=o(function(){throw new Qo},"throwTypeError"),MO=aa?(function(){try{return arguments.callee,Cd}catch{try{return aa(arguments,"callee").get}catch{return Cd}}})():Cd,Yo=V_()(),Pt=mb(),LO=Td(),jO=wd(),bb=Pd(),sa=iu(),Xo={},FO=typeof Uint8Array>"u"||!Pt?Me:Pt(Uint8Array),fo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Me:ArrayBuffer,"%ArrayIteratorPrototype%":Yo&&Pt?Pt([][Symbol.iterator]()):Me,"%AsyncFromSyncIteratorPrototype%":Me,"%AsyncFunction%":Xo,"%AsyncGenerator%":Xo,"%AsyncGeneratorFunction%":Xo,"%AsyncIteratorPrototype%":Xo,"%Atomics%":typeof Atomics>"u"?Me:Atomics,"%BigInt%":typeof BigInt>"u"?Me:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Me:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Me:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Me:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":PO,"%eval%":eval,"%EvalError%":xO,"%Float16Array%":typeof Float16Array>"u"?Me:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Me:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Me:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Me:FinalizationRegistry,"%Function%":_b,"%GeneratorFunction%":Xo,"%Int8Array%":typeof Int8Array>"u"?Me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Yo&&Pt?Pt(Pt([][Symbol.iterator]())):Me,"%JSON%":typeof JSON=="object"?JSON:Me,"%Map%":typeof Map>"u"?Me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Yo||!Pt?Me:Pt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":TO,"%Object.getOwnPropertyDescriptor%":aa,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Me:Promise,"%Proxy%":typeof Proxy>"u"?Me:Proxy,"%RangeError%":AO,"%ReferenceError%":IO,"%Reflect%":typeof Reflect>"u"?Me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Yo||!Pt?Me:Pt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Yo&&Pt?Pt(""[Symbol.iterator]()):Me,"%Symbol%":Yo?Symbol:Me,"%SyntaxError%":ei,"%ThrowTypeError%":MO,"%TypedArray%":FO,"%TypeError%":Qo,"%Uint8Array%":typeof Uint8Array>"u"?Me:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Me:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Me:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Me:Uint32Array,"%URIError%":RO,"%WeakMap%":typeof WeakMap>"u"?Me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Me:WeakSet,"%Function.prototype.call%":sa,"%Function.prototype.apply%":bb,"%Object.defineProperty%":UO,"%Object.getPrototypeOf%":LO,"%Math.abs%":CO,"%Math.floor%":OO,"%Math.max%":kO,"%Math.min%":$O,"%Math.pow%":DO,"%Math.round%":NO,"%Math.sign%":zO,"%Reflect.getPrototypeOf%":jO};if(Pt)try{null.error}catch(t){gb=Pt(Pt(t)),fo["%Error.prototype%"]=gb}var gb,qO=o(function t(e){var r;if(e==="%AsyncFunction%")r=Rd("async function () {}");else if(e==="%GeneratorFunction%")r=Rd("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Rd("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Pt&&(r=Pt(i.prototype))}return fo[e]=r,r},"doEval"),yb={__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"]},ua=Jo(),au=Id(),BO=ua.call(sa,Array.prototype.concat),VO=ua.call(bb,Array.prototype.splice),vb=ua.call(sa,String.prototype.replace),su=ua.call(sa,String.prototype.slice),GO=ua.call(sa,RegExp.prototype.exec),HO=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,WO=/\\(\\)?/g,ZO=o(function(e){var r=su(e,0,1),n=su(e,-1);if(r==="%"&&n!=="%")throw new ei("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new ei("invalid intrinsic syntax, expected opening `%`");var i=[];return vb(e,HO,function(s,c,d,p){i[i.length]=d?vb(p,WO,"$1"):c||s}),i},"stringToPath"),KO=o(function(e,r){var n=e,i;if(au(yb,n)&&(i=yb[n],n="%"+i[0]+"%"),au(fo,n)){var s=fo[n];if(s===Xo&&(s=qO(n)),typeof s>"u"&&!r)throw new Qo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new ei("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");Eb.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new Qo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Qo('"allowMissing" argument must be a boolean');if(GO(/^%?[^%]*%?$/,e)===null)throw new ei("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ZO(e),i=n.length>0?n[0]:"",s=KO("%"+i+"%",r),c=s.name,d=s.value,p=!1,m=s.alias;m&&(i=m[0],VO(n,BO([0,1],m)));for(var y=1,h=!0;y<n.length;y+=1){var f=n[y],l=su(f,0,1),g=su(f,-1);if((l==='"'||l==="'"||l==="`"||g==='"'||g==="'"||g==="`")&&l!==g)throw new ei("property names with quotes must have matching quotes");if((f==="constructor"||!h)&&(p=!0),i+="."+f,c="%"+i+"%",au(fo,c))d=fo[c];else if(d!=null){if(!(f in d)){if(!r)throw new Qo("base intrinsic for "+e+" exists, but the property is not available.");return}if(aa&&y+1>=n.length){var v=aa(d,f);h=!!v,h&&"get"in v&&!("originalValue"in v.get)?d=v.get:d=d[f]}else h=au(d,f),d=d[f];h&&!p&&(fo[c]=d)}}return d},"GetIntrinsic")});var wb=D((h5,Sb)=>{"use strict";var JO=Sd();Sb.exports=o(function(){return JO()&&!!Symbol.toStringTag},"hasToStringTagShams")});var xb=D((y5,Pb)=>{"use strict";var YO=ca(),Tb=YO("%Object.defineProperty%",!0),XO=wb()(),QO=Id(),ek=Bn(),uu=XO?Symbol.toStringTag:null;Pb.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 ek("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");uu&&(n||!QO(e,uu))&&(Tb?Tb(e,uu,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[uu]=r)},"setToStringTag")});var Ib=D((_5,Ab)=>{"use strict";var tk=Function.prototype.call,rk=Object.prototype.hasOwnProperty,nk=Jo();Ab.exports=nk.call(tk,rk)});var Cb=D((b5,Rb)=>{"use strict";Rb.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var $b=D((E5,kb)=>{"use strict";var Dd=Uv(),ok=require("util"),Od=require("path"),ik=require("http"),ak=require("https"),sk=require("url").parse,uk=require("fs"),ck=require("stream").Stream,lk=require("crypto"),kd=qv(),dk=i_(),pk=xb(),Vn=Ib(),$d=Cb();function Ob(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Ob,"escapeHeaderParam");function Be(t){if(!(this instanceof Be))return new Be(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Dd.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(Be,"FormData");ok.inherits(Be,Dd);Be.LINE_BREAK=`\r
|
|
2
|
+
`;Be.DEFAULT_CONTENT_TYPE="application/octet-stream";Be.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Dd.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)};Be.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)+Be.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&Vn(e,"httpVersion"))&&!(e instanceof ck))&&(r.knownLength||this._valuesToMeasure.push(e))};Be.prototype._lengthRetriever=function(t,e){Vn(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):uk.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):Vn(t,"httpVersion")?e(null,Number(t.headers["content-length"])):Vn(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};Be.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="'+Ob(t)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&$d(c,r.header);var d;for(var p in c)if(Vn(c,p)){if(d=c[p],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=p+": "+d.join("; ")+Be.LINE_BREAK)}return"--"+this.getBoundary()+Be.LINE_BREAK+s+Be.LINE_BREAK};Be.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=Od.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=Od.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&Vn(t,"httpVersion")&&(r=Od.basename(t.client._httpMessage.path||"")),r)return'filename="'+Ob(r)+'"'};Be.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=kd.lookup(t.name)),!r&&t&&t.path&&(r=kd.lookup(t.path)),!r&&t&&t.readable&&Vn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=kd.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=Be.DEFAULT_CONTENT_TYPE),r};Be.prototype._multiPartFooter=function(){return function(t){var e=Be.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};Be.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Be.LINE_BREAK};Be.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)Vn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};Be.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Be.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Be.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(Be.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Be.prototype._generateBoundary=function(){this._boundary="--------------------------"+lk.randomBytes(12).toString("hex")};Be.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};Be.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Be.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}dk.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};Be.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=sk(t),n=$d({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=$d(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=ak.request(n):r=ik.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(m,y){return r.removeListener("error",p),r.removeListener("response",d),e.call(this,m,y)},"callback");d=p.bind(this,null),r.on("error",p),r.on("response",d)}}.bind(this)),r};Be.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Be.prototype.toString=function(){return"[object FormData]"};pk(Be.prototype,"FormData");kb.exports=Be});var da=D((i9,Wb)=>{"use strict";var du=Object.prototype.hasOwnProperty,Hb=Object.prototype.toString,jb=Object.defineProperty,Fb=Object.getOwnPropertyDescriptor,qb=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):Hb.call(e)==="[object Array]"},"isArray"),Bb=o(function(e){if(!e||Hb.call(e)!=="[object Object]")return!1;var r=du.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&du.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||du.call(e,i)},"isPlainObject"),Vb=o(function(e,r){jb&&r.name==="__proto__"?jb(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),Gb=o(function(e,r){if(r==="__proto__")if(du.call(e,r)){if(Fb)return Fb(e,r).value}else return;return e[r]},"getProperty");Wb.exports=o(function t(){var e,r,n,i,s,c,d=arguments[0],p=1,m=arguments.length,y=!1;for(typeof d=="boolean"&&(y=d,d=arguments[1]||{},p=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});p<m;++p)if(e=arguments[p],e!=null)for(r in e)n=Gb(d,r),i=Gb(e,r),d!==i&&(y&&i&&(Bb(i)||(s=qb(i)))?(s?(s=!1,c=n&&qb(n)?n:[]):c=n&&Bb(n)?n:{},Vb(d,{name:r,newValue:t(y,c,i)})):typeof i<"u"&&Vb(d,{name:r,newValue:i}));return d},"extend")});var Zb=D((s9,Ek)=>{Ek.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 Jb=D((u9,Kb)=>{"use strict";var Sk=Zb();Kb.exports={pkg:Sk}});var Ld=D(fr=>{"use strict";var Xb=fr&&fr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fr,"__esModule",{value:!0});fr.GaxiosError=fr.GAXIOS_ERROR_SYMBOL=void 0;fr.defaultErrorRedactor=Qb;var Yb=Xb(da()),wk=Xb(Jb()),Ud=wk.default.pkg;fr.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Ud.name}-gaxios-error`);var Md=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[fr.GAXIOS_ERROR_SYMBOL]=Ud.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&fr.GAXIOS_ERROR_SYMBOL in e&&e[fr.GAXIOS_ERROR_SYMBOL]===Ud.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=Tk(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}}};fr.GaxiosError=Md;function Tk(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(Tk,"translateData");function Qb(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&&(Qb({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(Qb,"defaultErrorRedactor")});var tE=D(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.getRetryConfig=Pk;async function Pk(t){let e=eE(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||xk)(t))return{shouldRetry:!1,config:t.config};let i=Ak(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(Pk,"getRetryConfig");function xk(t){let e=eE(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(xk,"shouldRetryRequest");function eE(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(eE,"getConfig");function Ak(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(Ak,"getNextRetryDelay")});var qd=D(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.GaxiosInterceptorManager=void 0;var Fd=class extends Set{static{o(this,"GaxiosInterceptorManager")}};pu.GaxiosInterceptorManager=Fd});var nE=D((h9,rE)=>{var ti=1e3,ri=ti*60,ni=ri*60,mo=ni*24,Ik=mo*7,Rk=mo*365.25;rE.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Ck(t);if(r==="number"&&isFinite(t))return e.long?kk(t):Ok(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Ck(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*Rk;case"weeks":case"week":case"w":return r*Ik;case"days":case"day":case"d":return r*mo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ni;case"minutes":case"minute":case"mins":case"min":case"m":return r*ri;case"seconds":case"second":case"secs":case"sec":case"s":return r*ti;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(Ck,"parse");function Ok(t){var e=Math.abs(t);return e>=mo?Math.round(t/mo)+"d":e>=ni?Math.round(t/ni)+"h":e>=ri?Math.round(t/ri)+"m":e>=ti?Math.round(t/ti)+"s":t+"ms"}o(Ok,"fmtShort");function kk(t){var e=Math.abs(t);return e>=mo?fu(t,e,mo,"day"):e>=ni?fu(t,e,ni,"hour"):e>=ri?fu(t,e,ri,"minute"):e>=ti?fu(t,e,ti,"second"):t+" ms"}o(kk,"fmtLong");function fu(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(fu,"plural")});var Bd=D((y9,oE)=>{function $k(t){r.debug=r,r.default=r,r.coerce=p,r.disable=c,r.enable=i,r.enabled=d,r.humanize=nE(),r.destroy=m,Object.keys(t).forEach(y=>{r[y]=t[y]}),r.names=[],r.skips=[],r.formatters={};function e(y){let h=0;for(let f=0;f<y.length;f++)h=(h<<5)-h+y.charCodeAt(f),h|=0;return r.colors[Math.abs(h)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(y){let h,f=null,l,g;function v(...E){if(!v.enabled)return;let b=v,C=Number(new Date),U=C-(h||C);b.diff=U,b.prev=h,b.curr=C,h=C,E[0]=r.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let J=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(H,K)=>{if(H==="%%")return"%";J++;let te=r.formatters[K];if(typeof te=="function"){let Q=E[J];H=te.call(b,Q),E.splice(J,1),J--}return H}),r.formatArgs.call(b,E),(b.log||r.log).apply(b,E)}return o(v,"debug"),v.namespace=y,v.useColors=r.useColors(),v.color=r.selectColor(y),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(y)),g),"get"),set:o(E=>{f=E},"set")}),typeof r.init=="function"&&r.init(v),v}o(r,"createDebug");function n(y,h){let f=r(this.namespace+(typeof h>"u"?":":h)+y);return f.log=this.log,f}o(n,"extend");function i(y){r.save(y),r.namespaces=y,r.names=[],r.skips=[];let h=(typeof y=="string"?y:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of h)f[0]==="-"?r.skips.push(f.slice(1)):r.names.push(f)}o(i,"enable");function s(y,h){let f=0,l=0,g=-1,v=0;for(;f<y.length;)if(l<h.length&&(h[l]===y[f]||h[l]==="*"))h[l]==="*"?(g=l,v=f,l++):(f++,l++);else if(g!==-1)l=g+1,v++,f=v;else return!1;for(;l<h.length&&h[l]==="*";)l++;return l===h.length}o(s,"matchesTemplate");function c(){let y=[...r.names,...r.skips.map(h=>"-"+h)].join(",");return r.enable(""),y}o(c,"disable");function d(y){for(let h of r.skips)if(s(y,h))return!1;for(let h of r.names)if(s(y,h))return!0;return!1}o(d,"enabled");function p(y){return y instanceof Error?y.stack||y.message:y}o(p,"coerce");function m(){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(m,"destroy"),r.enable(r.load()),r}o($k,"setup");oE.exports=$k});var iE=D((qt,mu)=>{qt.formatArgs=Nk;qt.save=zk;qt.load=Uk;qt.useColors=Dk;qt.storage=Mk();qt.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`."))}})();qt.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 Dk(){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(Dk,"useColors");function Nk(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+mu.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(Nk,"formatArgs");qt.log=console.debug||console.log||(()=>{});function zk(t){try{t?qt.storage.setItem("debug",t):qt.storage.removeItem("debug")}catch{}}o(zk,"save");function Uk(){let t;try{t=qt.storage.getItem("debug")||qt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(Uk,"load");function Mk(){try{return localStorage}catch{}}o(Mk,"localstorage");mu.exports=Bd()(qt);var{formatters:Lk}=mu.exports;Lk.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var sE=D((b9,aE)=>{"use strict";aE.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 lE=D((E9,cE)=>{"use strict";var jk=require("os"),uE=require("tty"),mr=sE(),{env:xt}=process,Gn;mr("no-color")||mr("no-colors")||mr("color=false")||mr("color=never")?Gn=0:(mr("color")||mr("colors")||mr("color=true")||mr("color=always"))&&(Gn=1);"FORCE_COLOR"in xt&&(xt.FORCE_COLOR==="true"?Gn=1:xt.FORCE_COLOR==="false"?Gn=0:Gn=xt.FORCE_COLOR.length===0?1:Math.min(parseInt(xt.FORCE_COLOR,10),3));function Vd(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(Vd,"translateLevel");function Gd(t,e){if(Gn===0)return 0;if(mr("color=16m")||mr("color=full")||mr("color=truecolor"))return 3;if(mr("color=256"))return 2;if(t&&!e&&Gn===void 0)return 0;let r=Gn||0;if(xt.TERM==="dumb")return r;if(process.platform==="win32"){let n=jk.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in xt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in xt)||xt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in xt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(xt.TEAMCITY_VERSION)?1:0;if(xt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in xt){let n=parseInt((xt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(xt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(xt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(xt.TERM)||"COLORTERM"in xt?1:r}o(Gd,"supportsColor");function Fk(t){let e=Gd(t,t&&t.isTTY);return Vd(e)}o(Fk,"getSupportLevel");cE.exports={supportsColor:Fk,stdout:Vd(Gd(!0,uE.isatty(1))),stderr:Vd(Gd(!0,uE.isatty(2)))}});var pE=D((At,gu)=>{var qk=require("tty"),hu=require("util");At.init=Kk;At.log=Hk;At.formatArgs=Vk;At.save=Wk;At.load=Zk;At.useColors=Bk;At.destroy=hu.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");At.colors=[6,2,3,4,5,1];try{let t=lE();t&&(t.stderr||t).level>=2&&(At.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{}At.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 Bk(){return"colors"in At.inspectOpts?!!At.inspectOpts.colors:qk.isatty(process.stderr.fd)}o(Bk,"useColors");function Vk(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+"+gu.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Gk()+e+" "+t[0]}o(Vk,"formatArgs");function Gk(){return At.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(Gk,"getDate");function Hk(...t){return process.stderr.write(hu.formatWithOptions(At.inspectOpts,...t)+`
|
|
6
|
+
`)}o(Hk,"log");function Wk(t){t?process.env.DEBUG=t:delete process.env.DEBUG}o(Wk,"save");function Zk(){return process.env.DEBUG}o(Zk,"load");function Kk(t){t.inspectOpts={};let e=Object.keys(At.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=At.inspectOpts[e[r]]}o(Kk,"init");gu.exports=Bd()(At);var{formatters:dE}=gu.exports;dE.o=function(t){return this.inspectOpts.colors=this.useColors,hu.inspect(t,this.inspectOpts).split(`
|
|
7
|
+
`).map(e=>e.trim()).join(" ")};dE.O=function(t){return this.inspectOpts.colors=this.useColors,hu.inspect(t,this.inspectOpts)}});var Wd=D((T9,Hd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Hd.exports=iE():Hd.exports=pE()});var hE=D(Bt=>{"use strict";var Jk=Bt&&Bt.__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]})),Yk=Bt&&Bt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fE=Bt&&Bt.__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)&&Jk(e,t,r);return Yk(e,t),e};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.req=Bt.json=Bt.toBuffer=void 0;var Xk=fE(require("http")),Qk=fE(require("https"));async function mE(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}o(mE,"toBuffer");Bt.toBuffer=mE;async function e$(t){let r=(await mE(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let i=n;throw i.message+=` (input: ${r})`,i}}o(e$,"json");Bt.json=e$;function t$(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?Qk:Xk).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(t$,"req");Bt.req=t$});var _E=D(Yt=>{"use strict";var yE=Yt&&Yt.__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]})),r$=Yt&&Yt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vE=Yt&&Yt.__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)&&yE(e,t,r);return r$(e,t),e},n$=Yt&&Yt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yE(e,t,r)};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.Agent=void 0;var o$=vE(require("net")),gE=vE(require("http")),i$=require("https");n$(hE(),Yt);var Fr=Symbol("AgentBaseInternalState"),Zd=class extends gE.Agent{static{o(this,"Agent")}constructor(e){super(e),this[Fr]={}}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 o$.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)?i$.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 gE.Agent)try{return d.addRequest(e,i)}catch(p){return n(p)}this[Fr].currentSocket=d,super.createSocket(e,r,n)},d=>{this.decrementSockets(s,c),n(d)})}createConnection(){let e=this[Fr].currentSocket;if(this[Fr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Fr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Fr]&&(this[Fr].defaultPort=e)}get protocol(){return this[Fr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Fr]&&(this[Fr].protocol=e)}};Yt.Agent=Zd});var bE=D(oi=>{"use strict";var a$=oi&&oi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oi,"__esModule",{value:!0});oi.parseProxyResponse=void 0;var s$=a$(Wd()),yu=(0,s$.default)("https-proxy-agent:parse-proxy-response");function u$(t){return new Promise((e,r)=>{let n=0,i=[];function s(){let y=t.read();y?m(y):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(),yu("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}o(d,"onend");function p(y){c(),yu("onerror %o",y),r(y)}o(p,"onerror");function m(y){i.push(y),n+=y.length;let h=Buffer.concat(i,n),f=h.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(" "),
|
|
10
|
+
`);if(f===-1){yu("have not received end of HTTP headers yet..."),s();return}let l=h.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(" "),E=+v[1],b=v.slice(2).join(" "),C={};for(let U of l){if(!U)continue;let J=U.indexOf(":");if(J===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${U}"`));let W=U.slice(0,J).toLowerCase(),H=U.slice(J+1).trimStart(),K=C[W];typeof K=="string"?C[W]=[K,H]:Array.isArray(K)?K.push(H):C[W]=H}yu("got proxy server response: %o %o",g,C),c(),e({connect:{statusCode:E,statusText:b,headers:C},buffered:h})}o(m,"ondata"),t.on("error",p),t.on("end",d),s()})}o(u$,"parseProxyResponse");oi.parseProxyResponse=u$});var xE=D(hr=>{"use strict";var c$=hr&&hr.__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$=hr&&hr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),TE=hr&&hr.__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)&&c$(e,t,r);return l$(e,t),e},PE=hr&&hr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hr,"__esModule",{value:!0});hr.HttpsProxyAgent=void 0;var vu=TE(require("net")),EE=TE(require("tls")),d$=PE(require("assert")),p$=PE(Wd()),f$=_E(),m$=require("url"),h$=bE(),pa=(0,p$.default)("https-proxy-agent"),SE=o(t=>t.servername===void 0&&t.host&&!vu.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),_u=class extends f$.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new m$.URL(e):e,this.proxyHeaders=r?.headers??{},pa("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?wE(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:"?(pa("Creating `tls.Socket`: %o",this.connectOpts),i=EE.connect(SE(this.connectOpts))):(pa("Creating `net.Socket`: %o",this.connectOpts),i=vu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=vu.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
|
|
15
|
-
Content-Disposition: form-data; name="`;return t.forEach((s,c)=>typeof s=="string"?n.push(i+
|
|
13
|
+
`;let p=(0,h$.parseProxyResponse)(i);i.write(`${d}\r
|
|
14
|
+
`);let{connect:m,buffered:y}=await p;if(e.emit("proxyConnect",m),this.emit("proxyConnect",m,e),m.statusCode===200)return e.once("socket",g$),r.secureEndpoint?(pa("Upgrading socket connection to TLS"),EE.connect({...wE(SE(r),"host","path","port"),socket:i})):i;i.destroy();let h=new vu.Socket({writable:!1});return h.readable=!0,e.once("socket",f=>{pa("Replaying proxy buffer for failed request"),(0,d$.default)(f.listenerCount("data")>0),f.push(y),f.push(null)}),h}};_u.protocols=["http","https"];hr.HttpsProxyAgent=_u;function g$(t){t.resume()}o(g$,"resume");function wE(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(wE,"omit")});function y$(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 y=1;y<r.length;y++)r[y]==="base64"?i=!0:r[y]&&(c+=`;${r[y]}`,r[y].indexOf("charset=")===0&&(n=r[y].substring(8)));!r[0]&&!n.length&&(c+=";charset=US-ASCII",n="US-ASCII");let d=i?"base64":"ascii",p=unescape(t.substring(e+1)),m=Buffer.from(p,d);return m.type=s,m.typeFull=c,m.charset=n,m}var AE,IE=Tt(()=>{o(y$,"dataUriToBuffer");AE=y$});var CE=D((bu,RE)=>{(function(t,e){typeof bu=="object"&&typeof RE<"u"?e(bu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(bu,(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 m(a){return p(u=>u(a))}o(m,"promiseResolvedWith");function y(a){return d(a)}o(y,"promiseRejectedWith");function h(a,u,_){return c.call(a,u,_)}o(h,"PerformPromiseThen");function f(a,u,_){h(h(a,u,_),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,_){return h(a,u,_)}o(v,"transformPromiseWith");function E(a){h(a,void 0,n)}o(E,"setPromiseIsHandledToTrue");let b=o(a=>{if(typeof queueMicrotask=="function")b=queueMicrotask;else{let u=m(void 0);b=o(_=>h(u,_),"_queueMicrotask")}return b(a)},"_queueMicrotask");function C(a,u,_){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,u,_)}o(C,"reflectCall");function U(a,u,_){try{return m(C(a,u,_))}catch(T){return y(T)}}o(U,"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 _=this._back,T=_;_._elements.length===J-1&&(T={_elements:[],_next:void 0}),_._elements.push(u),T!==_&&(this._back=T,_._next=T),++this._size}shift(){let u=this._front,_=u,T=this._cursor,A=T+1,L=u._elements,q=L[T];return A===J&&(_=u._next,A=0),--this._size,this._cursor=A,u!==_&&(this._front=_),L[T]=void 0,q}forEach(u){let _=this._cursor,T=this._front,A=T._elements;for(;(_!==A.length||T._next!==void 0)&&!(_===A.length&&(T=T._next,A=T._elements,_=0,A.length===0));)u(A[_]),++_}peek(){let u=this._front,_=this._cursor;return u._elements[_]}}let H=Symbol("[[AbortSteps]]"),K=Symbol("[[ErrorSteps]]"),te=Symbol("[[CancelSteps]]"),Q=Symbol("[[PullSteps]]"),xe=Symbol("[[ReleaseSteps]]");function re(a,u){a._ownerReadableStream=u,u._reader=a,u._state==="readable"?Y(a):u._state==="closed"?ue(a):ie(a,u._storedError)}o(re,"ReadableStreamReaderGenericInitialize");function V(a,u){let _=a._ownerReadableStream;return Tr(_,u)}o(V,"ReadableStreamReaderGenericCancel");function B(a){let u=a._ownerReadableStream;u._state==="readable"?Ce(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):De(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._readableStreamController[xe](),u._reader=void 0,a._ownerReadableStream=void 0}o(B,"ReadableStreamReaderGenericRelease");function X(a){return new TypeError("Cannot "+a+" a stream using a released reader")}o(X,"readerLockException");function Y(a){a._closedPromise=p((u,_)=>{a._closedPromise_resolve=u,a._closedPromise_reject=_})}o(Y,"defaultReaderClosedPromiseInitialize");function ie(a,u){Y(a),Ce(a,u)}o(ie,"defaultReaderClosedPromiseInitializeAsRejected");function ue(a){Y(a),Ke(a)}o(ue,"defaultReaderClosedPromiseInitializeAsResolved");function Ce(a,u){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ce,"defaultReaderClosedPromiseReject");function De(a,u){ie(a,u)}o(De,"defaultReaderClosedPromiseResetToRejected");function Ke(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ke,"defaultReaderClosedPromiseResolve");let et=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},wt=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 lt(a,u){if(a!==void 0&&!ee(a))throw new TypeError(`${u} is not an object.`)}o(lt,"assertDictionary");function mt(a,u){if(typeof a!="function")throw new TypeError(`${u} is not a function.`)}o(mt,"assertFunction");function Ht(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(Ht,"isObject");function We(a,u){if(!Ht(a))throw new TypeError(`${u} is not an object.`)}o(We,"assertObject");function Ye(a,u,_){if(a===void 0)throw new TypeError(`Parameter ${u} is required in '${_}'.`)}o(Ye,"assertRequiredArgument");function S(a,u,_){if(a===void 0)throw new TypeError(`${u} is required in '${_}'.`)}o(S,"assertRequiredField");function P(a){return Number(a)}o(P,"convertUnrestrictedDouble");function x(a){return a===0?0:a}o(x,"censorNegativeZero");function z(a){return x(wt(a))}o(z,"integerPart");function R(a,u){let T=Number.MAX_SAFE_INTEGER,A=Number(a);if(A=x(A),!et(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!et(A)||A===0?0:A}o(R,"convertUnsignedLongLongWithEnforceRange");function $(a,u){if(!On(a))throw new TypeError(`${u} is not a ReadableStream.`)}o($,"assertReadableStream");function j(a){return new G(a)}o(j,"AcquireReadableStreamDefaultReader");function I(a,u){a._reader._readRequests.push(u)}o(I,"ReadableStreamAddReadRequest");function O(a,u,_){let A=a._reader._readRequests.shift();_?A._closeSteps():A._chunkSteps(u)}o(O,"ReadableStreamFulfillReadRequest");function M(a){return a._reader._readRequests.length}o(M,"ReadableStreamGetNumReadRequests");function N(a){let u=a._reader;return!(u===void 0||!ce(u))}o(N,"ReadableStreamHasDefaultReader");class G{static{o(this,"ReadableStreamDefaultReader")}constructor(u){if(Ye(u,1,"ReadableStreamDefaultReader"),$(u,"First parameter"),kn(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 ce(this)?this._closedPromise:y(at("closed"))}cancel(u=void 0){return ce(this)?this._ownerReadableStream===void 0?y(X("cancel")):V(this,u):y(at("cancel"))}read(){if(!ce(this))return y(at("read"));if(this._ownerReadableStream===void 0)return y(X("read from"));let u,_,T=p((L,q)=>{u=L,_=q});return pe(this,{_chunkSteps:o(L=>u({value:L,done:!1}),"_chunkSteps"),_closeSteps:o(()=>u({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(L=>_(L),"_errorSteps")}),T}releaseLock(){if(!ce(this))throw at("releaseLock");this._ownerReadableStream!==void 0&&Fe(this)}}Object.defineProperties(G.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(G.prototype.cancel,"cancel"),i(G.prototype.read,"read"),i(G.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(G.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function ce(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof G}o(ce,"IsReadableStreamDefaultReader");function pe(a,u){let _=a._ownerReadableStream;_._disturbed=!0,_._state==="closed"?u._closeSteps():_._state==="errored"?u._errorSteps(_._storedError):_._readableStreamController[Q](u)}o(pe,"ReadableStreamDefaultReaderRead");function Fe(a){B(a);let u=new TypeError("Reader was released");ot(a,u)}o(Fe,"ReadableStreamDefaultReaderRelease");function ot(a,u){let _=a._readRequests;a._readRequests=new W,_.forEach(T=>{T._errorSteps(u)})}o(ot,"ReadableStreamDefaultReaderErrorReadRequests");function at(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}o(at,"defaultReaderBrandCheckException");let je=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Ge{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(u,_){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=u,this._preventCancel=_}next(){let u=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?v(this._ongoingPromise,u,u):u(),this._ongoingPromise}return(u){let _=o(()=>this._returnSteps(u),"returnSteps");return this._ongoingPromise?v(this._ongoingPromise,_,_):_()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let u=this._reader,_,T,A=p((q,se)=>{_=q,T=se});return pe(u,{_chunkSteps:o(q=>{this._ongoingPromise=void 0,b(()=>_({value:q,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),_({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(q=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),T(q)},"_errorSteps")}),A}_returnSteps(u){if(this._isFinished)return Promise.resolve({value:u,done:!0});this._isFinished=!0;let _=this._reader;if(!this._preventCancel){let T=V(_,u);return B(_),v(T,()=>({value:u,done:!0}))}return B(_),m({value:u,done:!0})}}let bt={next(){return Ro(this)?this._asyncIteratorImpl.next():y(Co("next"))},return(a){return Ro(this)?this._asyncIteratorImpl.return(a):y(Co("return"))}};Object.setPrototypeOf(bt,je);function Io(a,u){let _=j(a),T=new Ge(_,u),A=Object.create(bt);return A._asyncIteratorImpl=T,A}o(Io,"AcquireReadableStreamAsyncIterator");function Ro(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof Ge}catch{return!1}}o(Ro,"IsReadableStreamAsyncIterator");function Co(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}o(Co,"streamAsyncIteratorBrandCheckException");let Wt=Number.isNaN||function(a){return a!==a};var rn,Rt,Et;function Xe(a){return a.slice()}o(Xe,"CreateArrayFromList");function ch(a,u,_,T,A){new Uint8Array(a).set(new Uint8Array(_,T,A),u)}o(ch,"CopyDataBlockBytes");let nn=o(a=>(typeof a.transfer=="function"?nn=o(u=>u.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?nn=o(u=>structuredClone(u,{transfer:[u]}),"TransferArrayBuffer"):nn=o(u=>u,"TransferArrayBuffer"),nn(a)),"TransferArrayBuffer"),An=o(a=>(typeof a.detached=="boolean"?An=o(u=>u.detached,"IsDetachedBuffer"):An=o(u=>u.byteLength===0,"IsDetachedBuffer"),An(a)),"IsDetachedBuffer");function lh(a,u,_){if(a.slice)return a.slice(u,_);let T=_-u,A=new ArrayBuffer(T);return ch(A,0,a,u,T),A}o(lh,"ArrayBufferSlice");function es(a,u){let _=a[u];if(_!=null){if(typeof _!="function")throw new TypeError(`${String(u)} is not a function`);return _}}o(es,"GetMethod");function aA(a){let u={[Symbol.iterator]:()=>a.iterator},_=(async function*(){return yield*u})(),T=_.next;return{iterator:_,nextMethod:T,done:!1}}o(aA,"CreateAsyncFromSyncIterator");let rl=(Et=(rn=Symbol.asyncIterator)!==null&&rn!==void 0?rn:(Rt=Symbol.for)===null||Rt===void 0?void 0:Rt.call(Symbol,"Symbol.asyncIterator"))!==null&&Et!==void 0?Et:"@@asyncIterator";function dh(a,u="sync",_){if(_===void 0)if(u==="async"){if(_=es(a,rl),_===void 0){let L=es(a,Symbol.iterator),q=dh(a,"sync",L);return aA(q)}}else _=es(a,Symbol.iterator);if(_===void 0)throw new TypeError("The object is not iterable");let T=C(_,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(dh,"GetIterator");function sA(a){let u=C(a.nextMethod,a.iterator,[]);if(!r(u))throw new TypeError("The iterator.next() method must return an object");return u}o(sA,"IteratorNext");function uA(a){return!!a.done}o(uA,"IteratorComplete");function cA(a){return a.value}o(cA,"IteratorValue");function lA(a){return!(typeof a!="number"||Wt(a)||a<0)}o(lA,"IsNonNegativeNumber");function ph(a){let u=lh(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(u)}o(ph,"CloneAsUint8Array");function nl(a){let u=a._queue.shift();return a._queueTotalSize-=u.size,a._queueTotalSize<0&&(a._queueTotalSize=0),u.value}o(nl,"DequeueValue");function ol(a,u,_){if(!lA(_)||_===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:u,size:_}),a._queueTotalSize+=_}o(ol,"EnqueueValueWithSize");function dA(a){return a._queue.peek().value}o(dA,"PeekQueueValue");function In(a){a._queue=new W,a._queueTotalSize=0}o(In,"ResetQueue");function fh(a){return a===DataView}o(fh,"isDataViewConstructor");function pA(a){return fh(a.constructor)}o(pA,"isDataView");function fA(a){return fh(a)?1:a.BYTES_PER_ELEMENT}o(fA,"arrayBufferViewElementSize");class to{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!il(this))throw ll("view");return this._view}respond(u){if(!il(this))throw ll("respond");if(Ye(u,1,"respond"),u=R(u,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(An(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");os(this._associatedReadableByteStreamController,u)}respondWithNewView(u){if(!il(this))throw ll("respondWithNewView");if(Ye(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(An(u.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");is(this._associatedReadableByteStreamController,u)}}Object.defineProperties(to.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(to.prototype.respond,"respond"),i(to.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(to.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class on{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!ro(this))throw ki("byobRequest");return cl(this)}get desiredSize(){if(!ro(this))throw ki("desiredSize");return wh(this)}close(){if(!ro(this))throw ki("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`);Oi(this)}enqueue(u){if(!ro(this))throw ki("enqueue");if(Ye(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 _=this._controlledReadableByteStream._state;if(_!=="readable")throw new TypeError(`The stream (in ${_} state) is not in the readable state and cannot be enqueued to`);ns(this,u)}error(u=void 0){if(!ro(this))throw ki("error");cr(this,u)}[te](u){mh(this),In(this);let _=this._cancelAlgorithm(u);return rs(this),_}[Q](u){let _=this._controlledReadableByteStream;if(this._queueTotalSize>0){Sh(this,u);return}let T=this._autoAllocateChunkSize;if(T!==void 0){let A;try{A=new ArrayBuffer(T)}catch(q){u._errorSteps(q);return}let L={buffer:A,bufferByteLength:T,byteOffset:0,byteLength:T,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(L)}I(_,u),no(this)}[xe](){if(this._pendingPullIntos.length>0){let u=this._pendingPullIntos.peek();u.readerType="none",this._pendingPullIntos=new W,this._pendingPullIntos.push(u)}}}Object.defineProperties(on.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(on.prototype.close,"close"),i(on.prototype.enqueue,"enqueue"),i(on.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(on.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function ro(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof on}o(ro,"IsReadableByteStreamController");function il(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof to}o(il,"IsReadableStreamBYOBRequest");function no(a){if(!vA(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let _=a._pullAlgorithm();f(_,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,no(a)),null),T=>(cr(a,T),null))}o(no,"ReadableByteStreamControllerCallPullIfNeeded");function mh(a){sl(a),a._pendingPullIntos=new W}o(mh,"ReadableByteStreamControllerClearPendingPullIntos");function al(a,u){let _=!1;a._state==="closed"&&(_=!0);let T=hh(u);u.readerType==="default"?O(a,T,_):TA(a,T,_)}o(al,"ReadableByteStreamControllerCommitPullIntoDescriptor");function hh(a){let u=a.bytesFilled,_=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,u/_)}o(hh,"ReadableByteStreamControllerConvertPullIntoDescriptor");function ts(a,u,_,T){a._queue.push({buffer:u,byteOffset:_,byteLength:T}),a._queueTotalSize+=T}o(ts,"ReadableByteStreamControllerEnqueueChunkToQueue");function gh(a,u,_,T){let A;try{A=lh(u,_,_+T)}catch(L){throw cr(a,L),L}ts(a,A,0,T)}o(gh,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function yh(a,u){u.bytesFilled>0&&gh(a,u.buffer,u.byteOffset,u.bytesFilled),Oo(a)}o(yh,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function vh(a,u){let _=Math.min(a._queueTotalSize,u.byteLength-u.bytesFilled),T=u.bytesFilled+_,A=_,L=!1,q=T%u.elementSize,se=T-q;se>=u.minimumFill&&(A=se-u.bytesFilled,L=!0);let _e=a._queue;for(;A>0;){let me=_e.peek(),Ae=Math.min(A,me.byteLength),Ne=u.byteOffset+u.bytesFilled;ch(u.buffer,Ne,me.buffer,me.byteOffset,Ae),me.byteLength===Ae?_e.shift():(me.byteOffset+=Ae,me.byteLength-=Ae),a._queueTotalSize-=Ae,_h(a,Ae,u),A-=Ae}return L}o(vh,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function _h(a,u,_){_.bytesFilled+=u}o(_h,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function bh(a){a._queueTotalSize===0&&a._closeRequested?(rs(a),Mi(a._controlledReadableByteStream)):no(a)}o(bh,"ReadableByteStreamControllerHandleQueueDrain");function sl(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}o(sl,"ReadableByteStreamControllerInvalidateBYOBRequest");function ul(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let u=a._pendingPullIntos.peek();vh(a,u)&&(Oo(a),al(a._controlledReadableByteStream,u))}}o(ul,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function mA(a){let u=a._controlledReadableByteStream._reader;for(;u._readRequests.length>0;){if(a._queueTotalSize===0)return;let _=u._readRequests.shift();Sh(a,_)}}o(mA,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function hA(a,u,_,T){let A=a._controlledReadableByteStream,L=u.constructor,q=fA(L),{byteOffset:se,byteLength:_e}=u,me=_*q,Ae;try{Ae=nn(u.buffer)}catch(tt){T._errorSteps(tt);return}let Ne={buffer:Ae,bufferByteLength:Ae.byteLength,byteOffset:se,byteLength:_e,bytesFilled:0,minimumFill:me,elementSize:q,viewConstructor:L,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(Ne),xh(A,T);return}if(A._state==="closed"){let tt=new L(Ne.buffer,Ne.byteOffset,0);T._closeSteps(tt);return}if(a._queueTotalSize>0){if(vh(a,Ne)){let tt=hh(Ne);bh(a),T._chunkSteps(tt);return}if(a._closeRequested){let tt=new TypeError("Insufficient bytes to fill elements in the given buffer");cr(a,tt),T._errorSteps(tt);return}}a._pendingPullIntos.push(Ne),xh(A,T),no(a)}o(hA,"ReadableByteStreamControllerPullInto");function gA(a,u){u.readerType==="none"&&Oo(a);let _=a._controlledReadableByteStream;if(dl(_))for(;Ah(_)>0;){let T=Oo(a);al(_,T)}}o(gA,"ReadableByteStreamControllerRespondInClosedState");function yA(a,u,_){if(_h(a,u,_),_.readerType==="none"){yh(a,_),ul(a);return}if(_.bytesFilled<_.minimumFill)return;Oo(a);let T=_.bytesFilled%_.elementSize;if(T>0){let A=_.byteOffset+_.bytesFilled;gh(a,_.buffer,A-T,T)}_.bytesFilled-=T,al(a._controlledReadableByteStream,_),ul(a)}o(yA,"ReadableByteStreamControllerRespondInReadableState");function Eh(a,u){let _=a._pendingPullIntos.peek();sl(a),a._controlledReadableByteStream._state==="closed"?gA(a,_):yA(a,u,_),no(a)}o(Eh,"ReadableByteStreamControllerRespondInternal");function Oo(a){return a._pendingPullIntos.shift()}o(Oo,"ReadableByteStreamControllerShiftPendingPullInto");function vA(a){let u=a._controlledReadableByteStream;return u._state!=="readable"||a._closeRequested||!a._started?!1:!!(N(u)&&M(u)>0||dl(u)&&Ah(u)>0||wh(a)>0)}o(vA,"ReadableByteStreamControllerShouldCallPull");function rs(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}o(rs,"ReadableByteStreamControllerClearAlgorithms");function Oi(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 _=a._pendingPullIntos.peek();if(_.bytesFilled%_.elementSize!==0){let T=new TypeError("Insufficient bytes to fill elements in the given buffer");throw cr(a,T),T}}rs(a),Mi(u)}}o(Oi,"ReadableByteStreamControllerClose");function ns(a,u){let _=a._controlledReadableByteStream;if(a._closeRequested||_._state!=="readable")return;let{buffer:T,byteOffset:A,byteLength:L}=u;if(An(T))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let q=nn(T);if(a._pendingPullIntos.length>0){let se=a._pendingPullIntos.peek();if(An(se.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");sl(a),se.buffer=nn(se.buffer),se.readerType==="none"&&yh(a,se)}if(N(_))if(mA(a),M(_)===0)ts(a,q,A,L);else{a._pendingPullIntos.length>0&&Oo(a);let se=new Uint8Array(q,A,L);O(_,se,!1)}else dl(_)?(ts(a,q,A,L),ul(a)):ts(a,q,A,L);no(a)}o(ns,"ReadableByteStreamControllerEnqueue");function cr(a,u){let _=a._controlledReadableByteStream;_._state==="readable"&&(mh(a),In(a),rs(a),Yh(_,u))}o(cr,"ReadableByteStreamControllerError");function Sh(a,u){let _=a._queue.shift();a._queueTotalSize-=_.byteLength,bh(a);let T=new Uint8Array(_.buffer,_.byteOffset,_.byteLength);u._chunkSteps(T)}o(Sh,"ReadableByteStreamControllerFillReadRequestFromQueue");function cl(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let u=a._pendingPullIntos.peek(),_=new Uint8Array(u.buffer,u.byteOffset+u.bytesFilled,u.byteLength-u.bytesFilled),T=Object.create(to.prototype);bA(T,a,_),a._byobRequest=T}return a._byobRequest}o(cl,"ReadableByteStreamControllerGetBYOBRequest");function wh(a){let u=a._controlledReadableByteStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(wh,"ReadableByteStreamControllerGetDesiredSize");function os(a,u){let _=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(_.bytesFilled+u>_.byteLength)throw new RangeError("bytesWritten out of range")}_.buffer=nn(_.buffer),Eh(a,u)}o(os,"ReadableByteStreamControllerRespond");function is(a,u){let _=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(_.byteOffset+_.bytesFilled!==u.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(_.bufferByteLength!==u.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(_.bytesFilled+u.byteLength>_.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let A=u.byteLength;_.buffer=nn(u.buffer),Eh(a,A)}o(is,"ReadableByteStreamControllerRespondWithNewView");function Th(a,u,_,T,A,L,q){u._controlledReadableByteStream=a,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,In(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=L,u._pullAlgorithm=T,u._cancelAlgorithm=A,u._autoAllocateChunkSize=q,u._pendingPullIntos=new W,a._readableStreamController=u;let se=_();f(m(se),()=>(u._started=!0,no(u),null),_e=>(cr(u,_e),null))}o(Th,"SetUpReadableByteStreamController");function _A(a,u,_){let T=Object.create(on.prototype),A,L,q;u.start!==void 0?A=o(()=>u.start(T),"startAlgorithm"):A=o(()=>{},"startAlgorithm"),u.pull!==void 0?L=o(()=>u.pull(T),"pullAlgorithm"):L=o(()=>m(void 0),"pullAlgorithm"),u.cancel!==void 0?q=o(_e=>u.cancel(_e),"cancelAlgorithm"):q=o(()=>m(void 0),"cancelAlgorithm");let se=u.autoAllocateChunkSize;if(se===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Th(a,T,A,L,q,_,se)}o(_A,"SetUpReadableByteStreamControllerFromUnderlyingSource");function bA(a,u,_){a._associatedReadableByteStreamController=u,a._view=_}o(bA,"SetUpReadableStreamBYOBRequest");function ll(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}o(ll,"byobRequestBrandCheckException");function ki(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}o(ki,"byteStreamControllerBrandCheckException");function EA(a,u){lt(a,u);let _=a?.mode;return{mode:_===void 0?void 0:SA(_,`${u} has member 'mode' that`)}}o(EA,"convertReaderOptions");function SA(a,u){if(a=`${a}`,a!=="byob")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}o(SA,"convertReadableStreamReaderMode");function wA(a,u){var _;lt(a,u);let T=(_=a?.min)!==null&&_!==void 0?_:1;return{min:R(T,`${u} has member 'min' that`)}}o(wA,"convertByobReadOptions");function Ph(a){return new Rn(a)}o(Ph,"AcquireReadableStreamBYOBReader");function xh(a,u){a._reader._readIntoRequests.push(u)}o(xh,"ReadableStreamAddReadIntoRequest");function TA(a,u,_){let A=a._reader._readIntoRequests.shift();_?A._closeSteps(u):A._chunkSteps(u)}o(TA,"ReadableStreamFulfillReadIntoRequest");function Ah(a){return a._reader._readIntoRequests.length}o(Ah,"ReadableStreamGetNumReadIntoRequests");function dl(a){let u=a._reader;return!(u===void 0||!oo(u))}o(dl,"ReadableStreamHasBYOBReader");class Rn{static{o(this,"ReadableStreamBYOBReader")}constructor(u){if(Ye(u,1,"ReadableStreamBYOBReader"),$(u,"First parameter"),kn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!ro(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 oo(this)?this._closedPromise:y(as("closed"))}cancel(u=void 0){return oo(this)?this._ownerReadableStream===void 0?y(X("cancel")):V(this,u):y(as("cancel"))}read(u,_={}){if(!oo(this))return y(as("read"));if(!ArrayBuffer.isView(u))return y(new TypeError("view must be an array buffer view"));if(u.byteLength===0)return y(new TypeError("view must have non-zero byteLength"));if(u.buffer.byteLength===0)return y(new TypeError("view's buffer must have non-zero byteLength"));if(An(u.buffer))return y(new TypeError("view's buffer has been detached"));let T;try{T=wA(_,"options")}catch(me){return y(me)}let A=T.min;if(A===0)return y(new TypeError("options.min must be greater than 0"));if(pA(u)){if(A>u.byteLength)return y(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(A>u.length)return y(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return y(X("read from"));let L,q,se=p((me,Ae)=>{L=me,q=Ae});return Ih(this,u,A,{_chunkSteps:o(me=>L({value:me,done:!1}),"_chunkSteps"),_closeSteps:o(me=>L({value:me,done:!0}),"_closeSteps"),_errorSteps:o(me=>q(me),"_errorSteps")}),se}releaseLock(){if(!oo(this))throw as("releaseLock");this._ownerReadableStream!==void 0&&PA(this)}}Object.defineProperties(Rn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(Rn.prototype.cancel,"cancel"),i(Rn.prototype.read,"read"),i(Rn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function oo(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof Rn}o(oo,"IsReadableStreamBYOBReader");function Ih(a,u,_,T){let A=a._ownerReadableStream;A._disturbed=!0,A._state==="errored"?T._errorSteps(A._storedError):hA(A._readableStreamController,u,_,T)}o(Ih,"ReadableStreamBYOBReaderRead");function PA(a){B(a);let u=new TypeError("Reader was released");Rh(a,u)}o(PA,"ReadableStreamBYOBReaderRelease");function Rh(a,u){let _=a._readIntoRequests;a._readIntoRequests=new W,_.forEach(T=>{T._errorSteps(u)})}o(Rh,"ReadableStreamBYOBReaderErrorReadIntoRequests");function as(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}o(as,"byobReaderBrandCheckException");function $i(a,u){let{highWaterMark:_}=a;if(_===void 0)return u;if(Wt(_)||_<0)throw new RangeError("Invalid highWaterMark");return _}o($i,"ExtractHighWaterMark");function ss(a){let{size:u}=a;return u||(()=>1)}o(ss,"ExtractSizeAlgorithm");function us(a,u){lt(a,u);let _=a?.highWaterMark,T=a?.size;return{highWaterMark:_===void 0?void 0:P(_),size:T===void 0?void 0:xA(T,`${u} has member 'size' that`)}}o(us,"convertQueuingStrategy");function xA(a,u){return mt(a,u),_=>P(a(_))}o(xA,"convertQueuingStrategySize");function AA(a,u){lt(a,u);let _=a?.abort,T=a?.close,A=a?.start,L=a?.type,q=a?.write;return{abort:_===void 0?void 0:IA(_,a,`${u} has member 'abort' that`),close:T===void 0?void 0:RA(T,a,`${u} has member 'close' that`),start:A===void 0?void 0:CA(A,a,`${u} has member 'start' that`),write:q===void 0?void 0:OA(q,a,`${u} has member 'write' that`),type:L}}o(AA,"convertUnderlyingSink");function IA(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(IA,"convertUnderlyingSinkAbortCallback");function RA(a,u,_){return mt(a,_),()=>U(a,u,[])}o(RA,"convertUnderlyingSinkCloseCallback");function CA(a,u,_){return mt(a,_),T=>C(a,u,[T])}o(CA,"convertUnderlyingSinkStartCallback");function OA(a,u,_){return mt(a,_),(T,A)=>U(a,u,[T,A])}o(OA,"convertUnderlyingSinkWriteCallback");function Ch(a,u){if(!ko(a))throw new TypeError(`${u} is not a WritableStream.`)}o(Ch,"assertWritableStream");function kA(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}o(kA,"isAbortSignal");let $A=typeof AbortController=="function";function DA(){if($A)return new AbortController}o(DA,"createAbortController");class Cn{static{o(this,"WritableStream")}constructor(u={},_={}){u===void 0?u=null:We(u,"First parameter");let T=us(_,"Second parameter"),A=AA(u,"First parameter");if(kh(this),A.type!==void 0)throw new RangeError("Invalid type is specified");let q=ss(T),se=$i(T,1);ZA(this,A,se,q)}get locked(){if(!ko(this))throw fs("locked");return $o(this)}abort(u=void 0){return ko(this)?$o(this)?y(new TypeError("Cannot abort a stream that already has a writer")):cs(this,u):y(fs("abort"))}close(){return ko(this)?$o(this)?y(new TypeError("Cannot close a stream that already has a writer")):Ur(this)?y(new TypeError("Cannot close an already-closing stream")):$h(this):y(fs("close"))}getWriter(){if(!ko(this))throw fs("getWriter");return Oh(this)}}Object.defineProperties(Cn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(Cn.prototype.abort,"abort"),i(Cn.prototype.close,"close"),i(Cn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Cn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function Oh(a){return new an(a)}o(Oh,"AcquireWritableStreamDefaultWriter");function NA(a,u,_,T,A=1,L=()=>1){let q=Object.create(Cn.prototype);kh(q);let se=Object.create(Do.prototype);return Lh(q,se,a,u,_,T,A,L),q}o(NA,"CreateWritableStream");function kh(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(kh,"InitializeWritableStream");function ko(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof Cn}o(ko,"IsWritableStream");function $o(a){return a._writer!==void 0}o($o,"IsWritableStreamLocked");function cs(a,u){var _;if(a._state==="closed"||a._state==="errored")return m(void 0);a._writableStreamController._abortReason=u,(_=a._writableStreamController._abortController)===null||_===void 0||_.abort(u);let T=a._state;if(T==="closed"||T==="errored")return m(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let A=!1;T==="erroring"&&(A=!0,u=void 0);let L=p((q,se)=>{a._pendingAbortRequest={_promise:void 0,_resolve:q,_reject:se,_reason:u,_wasAlreadyErroring:A}});return a._pendingAbortRequest._promise=L,A||fl(a,u),L}o(cs,"WritableStreamAbort");function $h(a){let u=a._state;if(u==="closed"||u==="errored")return y(new TypeError(`The stream (in ${u} state) is not in the writable state and cannot be closed`));let _=p((A,L)=>{let q={_resolve:A,_reject:L};a._closeRequest=q}),T=a._writer;return T!==void 0&&a._backpressure&&u==="writable"&&El(T),KA(a._writableStreamController),_}o($h,"WritableStreamClose");function zA(a){return p((_,T)=>{let A={_resolve:_,_reject:T};a._writeRequests.push(A)})}o(zA,"WritableStreamAddWriteRequest");function pl(a,u){if(a._state==="writable"){fl(a,u);return}ml(a)}o(pl,"WritableStreamDealWithRejection");function fl(a,u){let _=a._writableStreamController;a._state="erroring",a._storedError=u;let T=a._writer;T!==void 0&&Nh(T,u),!FA(a)&&_._started&&ml(a)}o(fl,"WritableStreamStartErroring");function ml(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){ls(a);return}let _=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,_._wasAlreadyErroring){_._reject(u),ls(a);return}let T=a._writableStreamController[H](_._reason);f(T,()=>(_._resolve(),ls(a),null),A=>(_._reject(A),ls(a),null))}o(ml,"WritableStreamFinishErroring");function UA(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}o(UA,"WritableStreamFinishInFlightWrite");function MA(a,u){a._inFlightWriteRequest._reject(u),a._inFlightWriteRequest=void 0,pl(a,u)}o(MA,"WritableStreamFinishInFlightWriteWithError");function LA(a){a._inFlightCloseRequest._resolve(void 0),a._inFlightCloseRequest=void 0,a._state==="erroring"&&(a._storedError=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._resolve(),a._pendingAbortRequest=void 0)),a._state="closed";let _=a._writer;_!==void 0&&Bh(_)}o(LA,"WritableStreamFinishInFlightClose");function jA(a,u){a._inFlightCloseRequest._reject(u),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(u),a._pendingAbortRequest=void 0),pl(a,u)}o(jA,"WritableStreamFinishInFlightCloseWithError");function Ur(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Ur,"WritableStreamCloseQueuedOrInFlight");function FA(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}o(FA,"WritableStreamHasOperationMarkedInFlight");function qA(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}o(qA,"WritableStreamMarkCloseRequestInFlight");function BA(a){a._inFlightWriteRequest=a._writeRequests.shift()}o(BA,"WritableStreamMarkFirstWriteRequestInFlight");function ls(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let u=a._writer;u!==void 0&&_l(u,a._storedError)}o(ls,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function hl(a,u){let _=a._writer;_!==void 0&&u!==a._backpressure&&(u?rI(_):El(_)),a._backpressure=u}o(hl,"WritableStreamUpdateBackpressure");class an{static{o(this,"WritableStreamDefaultWriter")}constructor(u){if(Ye(u,1,"WritableStreamDefaultWriter"),Ch(u,"First parameter"),$o(u))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=u,u._writer=this;let _=u._state;if(_==="writable")!Ur(u)&&u._backpressure?hs(this):Vh(this),ms(this);else if(_==="erroring")bl(this,u._storedError),ms(this);else if(_==="closed")Vh(this),eI(this);else{let T=u._storedError;bl(this,T),qh(this,T)}}get closed(){return io(this)?this._closedPromise:y(ao("closed"))}get desiredSize(){if(!io(this))throw ao("desiredSize");if(this._ownerWritableStream===void 0)throw Ni("desiredSize");return WA(this)}get ready(){return io(this)?this._readyPromise:y(ao("ready"))}abort(u=void 0){return io(this)?this._ownerWritableStream===void 0?y(Ni("abort")):VA(this,u):y(ao("abort"))}close(){if(!io(this))return y(ao("close"));let u=this._ownerWritableStream;return u===void 0?y(Ni("close")):Ur(u)?y(new TypeError("Cannot close an already-closing stream")):Dh(this)}releaseLock(){if(!io(this))throw ao("releaseLock");this._ownerWritableStream!==void 0&&zh(this)}write(u=void 0){return io(this)?this._ownerWritableStream===void 0?y(Ni("write to")):Uh(this,u):y(ao("write"))}}Object.defineProperties(an.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(an.prototype.abort,"abort"),i(an.prototype.close,"close"),i(an.prototype.releaseLock,"releaseLock"),i(an.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(an.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function io(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof an}o(io,"IsWritableStreamDefaultWriter");function VA(a,u){let _=a._ownerWritableStream;return cs(_,u)}o(VA,"WritableStreamDefaultWriterAbort");function Dh(a){let u=a._ownerWritableStream;return $h(u)}o(Dh,"WritableStreamDefaultWriterClose");function GA(a){let u=a._ownerWritableStream,_=u._state;return Ur(u)||_==="closed"?m(void 0):_==="errored"?y(u._storedError):Dh(a)}o(GA,"WritableStreamDefaultWriterCloseWithErrorPropagation");function HA(a,u){a._closedPromiseState==="pending"?_l(a,u):tI(a,u)}o(HA,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function Nh(a,u){a._readyPromiseState==="pending"?Gh(a,u):nI(a,u)}o(Nh,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function WA(a){let u=a._ownerWritableStream,_=u._state;return _==="errored"||_==="erroring"?null:_==="closed"?0:jh(u._writableStreamController)}o(WA,"WritableStreamDefaultWriterGetDesiredSize");function zh(a){let u=a._ownerWritableStream,_=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Nh(a,_),HA(a,_),u._writer=void 0,a._ownerWritableStream=void 0}o(zh,"WritableStreamDefaultWriterRelease");function Uh(a,u){let _=a._ownerWritableStream,T=_._writableStreamController,A=JA(T,u);if(_!==a._ownerWritableStream)return y(Ni("write to"));let L=_._state;if(L==="errored")return y(_._storedError);if(Ur(_)||L==="closed")return y(new TypeError("The stream is closing or closed and cannot be written to"));if(L==="erroring")return y(_._storedError);let q=zA(_);return YA(T,u,A),q}o(Uh,"WritableStreamDefaultWriterWrite");let Mh={};class Do{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!gl(this))throw vl("abortReason");return this._abortReason}get signal(){if(!gl(this))throw vl("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(u=void 0){if(!gl(this))throw vl("error");this._controlledWritableStream._state==="writable"&&Fh(this,u)}[H](u){let _=this._abortAlgorithm(u);return ds(this),_}[K](){In(this)}}Object.defineProperties(Do.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Do.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function gl(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Do}o(gl,"IsWritableStreamDefaultController");function Lh(a,u,_,T,A,L,q,se){u._controlledWritableStream=a,a._writableStreamController=u,u._queue=void 0,u._queueTotalSize=void 0,In(u),u._abortReason=void 0,u._abortController=DA(),u._started=!1,u._strategySizeAlgorithm=se,u._strategyHWM=q,u._writeAlgorithm=T,u._closeAlgorithm=A,u._abortAlgorithm=L;let _e=yl(u);hl(a,_e);let me=_(),Ae=m(me);f(Ae,()=>(u._started=!0,ps(u),null),Ne=>(u._started=!0,pl(a,Ne),null))}o(Lh,"SetUpWritableStreamDefaultController");function ZA(a,u,_,T){let A=Object.create(Do.prototype),L,q,se,_e;u.start!==void 0?L=o(()=>u.start(A),"startAlgorithm"):L=o(()=>{},"startAlgorithm"),u.write!==void 0?q=o(me=>u.write(me,A),"writeAlgorithm"):q=o(()=>m(void 0),"writeAlgorithm"),u.close!==void 0?se=o(()=>u.close(),"closeAlgorithm"):se=o(()=>m(void 0),"closeAlgorithm"),u.abort!==void 0?_e=o(me=>u.abort(me),"abortAlgorithm"):_e=o(()=>m(void 0),"abortAlgorithm"),Lh(a,A,L,q,se,_e,_,T)}o(ZA,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function ds(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(ds,"WritableStreamDefaultControllerClearAlgorithms");function KA(a){ol(a,Mh,0),ps(a)}o(KA,"WritableStreamDefaultControllerClose");function JA(a,u){try{return a._strategySizeAlgorithm(u)}catch(_){return Di(a,_),1}}o(JA,"WritableStreamDefaultControllerGetChunkSize");function jh(a){return a._strategyHWM-a._queueTotalSize}o(jh,"WritableStreamDefaultControllerGetDesiredSize");function YA(a,u,_){try{ol(a,u,_)}catch(A){Di(a,A);return}let T=a._controlledWritableStream;if(!Ur(T)&&T._state==="writable"){let A=yl(a);hl(T,A)}ps(a)}o(YA,"WritableStreamDefaultControllerWrite");function ps(a){let u=a._controlledWritableStream;if(!a._started||u._inFlightWriteRequest!==void 0)return;if(u._state==="erroring"){ml(u);return}if(a._queue.length===0)return;let T=dA(a);T===Mh?XA(a):QA(a,T)}o(ps,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Di(a,u){a._controlledWritableStream._state==="writable"&&Fh(a,u)}o(Di,"WritableStreamDefaultControllerErrorIfNeeded");function XA(a){let u=a._controlledWritableStream;qA(u),nl(a);let _=a._closeAlgorithm();ds(a),f(_,()=>(LA(u),null),T=>(jA(u,T),null))}o(XA,"WritableStreamDefaultControllerProcessClose");function QA(a,u){let _=a._controlledWritableStream;BA(_);let T=a._writeAlgorithm(u);f(T,()=>{UA(_);let A=_._state;if(nl(a),!Ur(_)&&A==="writable"){let L=yl(a);hl(_,L)}return ps(a),null},A=>(_._state==="writable"&&ds(a),MA(_,A),null))}o(QA,"WritableStreamDefaultControllerProcessWrite");function yl(a){return jh(a)<=0}o(yl,"WritableStreamDefaultControllerGetBackpressure");function Fh(a,u){let _=a._controlledWritableStream;ds(a),fl(_,u)}o(Fh,"WritableStreamDefaultControllerError");function fs(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}o(fs,"streamBrandCheckException$2");function vl(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}o(vl,"defaultControllerBrandCheckException$2");function ao(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}o(ao,"defaultWriterBrandCheckException");function Ni(a){return new TypeError("Cannot "+a+" a stream using a released writer")}o(Ni,"defaultWriterLockException");function ms(a){a._closedPromise=p((u,_)=>{a._closedPromise_resolve=u,a._closedPromise_reject=_,a._closedPromiseState="pending"})}o(ms,"defaultWriterClosedPromiseInitialize");function qh(a,u){ms(a),_l(a,u)}o(qh,"defaultWriterClosedPromiseInitializeAsRejected");function eI(a){ms(a),Bh(a)}o(eI,"defaultWriterClosedPromiseInitializeAsResolved");function _l(a,u){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}o(_l,"defaultWriterClosedPromiseReject");function tI(a,u){qh(a,u)}o(tI,"defaultWriterClosedPromiseResetToRejected");function Bh(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(Bh,"defaultWriterClosedPromiseResolve");function hs(a){a._readyPromise=p((u,_)=>{a._readyPromise_resolve=u,a._readyPromise_reject=_}),a._readyPromiseState="pending"}o(hs,"defaultWriterReadyPromiseInitialize");function bl(a,u){hs(a),Gh(a,u)}o(bl,"defaultWriterReadyPromiseInitializeAsRejected");function Vh(a){hs(a),El(a)}o(Vh,"defaultWriterReadyPromiseInitializeAsResolved");function Gh(a,u){a._readyPromise_reject!==void 0&&(E(a._readyPromise),a._readyPromise_reject(u),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}o(Gh,"defaultWriterReadyPromiseReject");function rI(a){hs(a)}o(rI,"defaultWriterReadyPromiseReset");function nI(a,u){bl(a,u)}o(nI,"defaultWriterReadyPromiseResetToRejected");function El(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(El,"defaultWriterReadyPromiseResolve");function oI(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(oI,"getGlobals");let Sl=oI();function iI(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}o(iI,"isDOMExceptionConstructor");function aI(){let a=Sl?.DOMException;return iI(a)?a:void 0}o(aI,"getFromGlobal");function sI(){let a=o(function(_,T){this.message=_||"",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(sI,"createPolyfill");let uI=aI()||sI();function Hh(a,u,_,T,A,L){let q=j(a),se=Oh(u);a._disturbed=!0;let _e=!1,me=m(void 0);return p((Ae,Ne)=>{let tt;if(L!==void 0){if(tt=o(()=>{let he=L.reason!==void 0?L.reason:new uI("Aborted","AbortError"),Le=[];T||Le.push(()=>u._state==="writable"?cs(u,he):m(void 0)),A||Le.push(()=>a._state==="readable"?Tr(a,he):m(void 0)),Mt(()=>Promise.all(Le.map(rt=>rt())),!0,he)},"abortAlgorithm"),L.aborted){tt();return}L.addEventListener("abort",tt)}function Pr(){return p((he,Le)=>{function rt(Zt){Zt?he():h(Mo(),rt,Le)}o(rt,"next"),rt(!1)})}o(Pr,"pipeLoop");function Mo(){return _e?m(!0):h(se._readyPromise,()=>p((he,Le)=>{pe(q,{_chunkSteps:o(rt=>{me=h(Uh(se,rt),void 0,e),he(!1)},"_chunkSteps"),_closeSteps:o(()=>he(!0),"_closeSteps"),_errorSteps:Le})}))}if(o(Mo,"pipeStep"),un(a,q._closedPromise,he=>(T?lr(!0,he):Mt(()=>cs(u,he),!0,he),null)),un(u,se._closedPromise,he=>(A?lr(!0,he):Mt(()=>Tr(a,he),!0,he),null)),Dt(a,q._closedPromise,()=>(_?lr():Mt(()=>GA(se)),null)),Ur(u)||u._state==="closed"){let he=new TypeError("the destination writable stream closed before all data could be piped to it");A?lr(!0,he):Mt(()=>Tr(a,he),!0,he)}E(Pr());function Dn(){let he=me;return h(me,()=>he!==me?Dn():void 0)}o(Dn,"waitForWritesToFinish");function un(he,Le,rt){he._state==="errored"?rt(he._storedError):g(Le,rt)}o(un,"isOrBecomesErrored");function Dt(he,Le,rt){he._state==="closed"?rt():l(Le,rt)}o(Dt,"isOrBecomesClosed");function Mt(he,Le,rt){if(_e)return;_e=!0,u._state==="writable"&&!Ur(u)?l(Dn(),Zt):Zt();function Zt(){return f(he(),()=>cn(Le,rt),Lo=>cn(!0,Lo)),null}o(Zt,"doTheRest")}o(Mt,"shutdownWithAction");function lr(he,Le){_e||(_e=!0,u._state==="writable"&&!Ur(u)?l(Dn(),()=>cn(he,Le)):cn(he,Le))}o(lr,"shutdown");function cn(he,Le){return zh(se),B(q),L!==void 0&&L.removeEventListener("abort",tt),he?Ne(Le):Ae(void 0),null}o(cn,"finalize")})}o(Hh,"ReadableStreamPipeTo");class sn{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!gs(this))throw vs("desiredSize");return wl(this)}close(){if(!gs(this))throw vs("close");if(!zo(this))throw new TypeError("The stream is not in a state that permits close");so(this)}enqueue(u=void 0){if(!gs(this))throw vs("enqueue");if(!zo(this))throw new TypeError("The stream is not in a state that permits enqueue");return No(this,u)}error(u=void 0){if(!gs(this))throw vs("error");wr(this,u)}[te](u){In(this);let _=this._cancelAlgorithm(u);return ys(this),_}[Q](u){let _=this._controlledReadableStream;if(this._queue.length>0){let T=nl(this);this._closeRequested&&this._queue.length===0?(ys(this),Mi(_)):zi(this),u._chunkSteps(T)}else I(_,u),zi(this)}[xe](){}}Object.defineProperties(sn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(sn.prototype.close,"close"),i(sn.prototype.enqueue,"enqueue"),i(sn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(sn.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function gs(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof sn}o(gs,"IsReadableStreamDefaultController");function zi(a){if(!Wh(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let _=a._pullAlgorithm();f(_,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,zi(a)),null),T=>(wr(a,T),null))}o(zi,"ReadableStreamDefaultControllerCallPullIfNeeded");function Wh(a){let u=a._controlledReadableStream;return!zo(a)||!a._started?!1:!!(kn(u)&&M(u)>0||wl(a)>0)}o(Wh,"ReadableStreamDefaultControllerShouldCallPull");function ys(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(ys,"ReadableStreamDefaultControllerClearAlgorithms");function so(a){if(!zo(a))return;let u=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(ys(a),Mi(u))}o(so,"ReadableStreamDefaultControllerClose");function No(a,u){if(!zo(a))return;let _=a._controlledReadableStream;if(kn(_)&&M(_)>0)O(_,u,!1);else{let T;try{T=a._strategySizeAlgorithm(u)}catch(A){throw wr(a,A),A}try{ol(a,u,T)}catch(A){throw wr(a,A),A}}zi(a)}o(No,"ReadableStreamDefaultControllerEnqueue");function wr(a,u){let _=a._controlledReadableStream;_._state==="readable"&&(In(a),ys(a),Yh(_,u))}o(wr,"ReadableStreamDefaultControllerError");function wl(a){let u=a._controlledReadableStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(wl,"ReadableStreamDefaultControllerGetDesiredSize");function cI(a){return!Wh(a)}o(cI,"ReadableStreamDefaultControllerHasBackpressure");function zo(a){let u=a._controlledReadableStream._state;return!a._closeRequested&&u==="readable"}o(zo,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Zh(a,u,_,T,A,L,q){u._controlledReadableStream=a,u._queue=void 0,u._queueTotalSize=void 0,In(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=q,u._strategyHWM=L,u._pullAlgorithm=T,u._cancelAlgorithm=A,a._readableStreamController=u;let se=_();f(m(se),()=>(u._started=!0,zi(u),null),_e=>(wr(u,_e),null))}o(Zh,"SetUpReadableStreamDefaultController");function lI(a,u,_,T){let A=Object.create(sn.prototype),L,q,se;u.start!==void 0?L=o(()=>u.start(A),"startAlgorithm"):L=o(()=>{},"startAlgorithm"),u.pull!==void 0?q=o(()=>u.pull(A),"pullAlgorithm"):q=o(()=>m(void 0),"pullAlgorithm"),u.cancel!==void 0?se=o(_e=>u.cancel(_e),"cancelAlgorithm"):se=o(()=>m(void 0),"cancelAlgorithm"),Zh(a,A,L,q,se,_,T)}o(lI,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function vs(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}o(vs,"defaultControllerBrandCheckException$1");function dI(a,u){return ro(a._readableStreamController)?fI(a):pI(a)}o(dI,"ReadableStreamTee");function pI(a,u){let _=j(a),T=!1,A=!1,L=!1,q=!1,se,_e,me,Ae,Ne,tt=p(Dt=>{Ne=Dt});function Pr(){return T?(A=!0,m(void 0)):(T=!0,pe(_,{_chunkSteps:o(Mt=>{b(()=>{A=!1;let lr=Mt,cn=Mt;L||No(me._readableStreamController,lr),q||No(Ae._readableStreamController,cn),T=!1,A&&Pr()})},"_chunkSteps"),_closeSteps:o(()=>{T=!1,L||so(me._readableStreamController),q||so(Ae._readableStreamController),(!L||!q)&&Ne(void 0)},"_closeSteps"),_errorSteps:o(()=>{T=!1},"_errorSteps")}),m(void 0))}o(Pr,"pullAlgorithm");function Mo(Dt){if(L=!0,se=Dt,q){let Mt=Xe([se,_e]),lr=Tr(a,Mt);Ne(lr)}return tt}o(Mo,"cancel1Algorithm");function Dn(Dt){if(q=!0,_e=Dt,L){let Mt=Xe([se,_e]),lr=Tr(a,Mt);Ne(lr)}return tt}o(Dn,"cancel2Algorithm");function un(){}return o(un,"startAlgorithm"),me=Ui(un,Pr,Mo),Ae=Ui(un,Pr,Dn),g(_._closedPromise,Dt=>(wr(me._readableStreamController,Dt),wr(Ae._readableStreamController,Dt),(!L||!q)&&Ne(void 0),null)),[me,Ae]}o(pI,"ReadableStreamDefaultTee");function fI(a){let u=j(a),_=!1,T=!1,A=!1,L=!1,q=!1,se,_e,me,Ae,Ne,tt=p(he=>{Ne=he});function Pr(he){g(he._closedPromise,Le=>(he!==u||(cr(me._readableStreamController,Le),cr(Ae._readableStreamController,Le),(!L||!q)&&Ne(void 0)),null))}o(Pr,"forwardReaderError");function Mo(){oo(u)&&(B(u),u=j(a),Pr(u)),pe(u,{_chunkSteps:o(Le=>{b(()=>{T=!1,A=!1;let rt=Le,Zt=Le;if(!L&&!q)try{Zt=ph(Le)}catch(Lo){cr(me._readableStreamController,Lo),cr(Ae._readableStreamController,Lo),Ne(Tr(a,Lo));return}L||ns(me._readableStreamController,rt),q||ns(Ae._readableStreamController,Zt),_=!1,T?un():A&&Dt()})},"_chunkSteps"),_closeSteps:o(()=>{_=!1,L||Oi(me._readableStreamController),q||Oi(Ae._readableStreamController),me._readableStreamController._pendingPullIntos.length>0&&os(me._readableStreamController,0),Ae._readableStreamController._pendingPullIntos.length>0&&os(Ae._readableStreamController,0),(!L||!q)&&Ne(void 0)},"_closeSteps"),_errorSteps:o(()=>{_=!1},"_errorSteps")})}o(Mo,"pullWithDefaultReader");function Dn(he,Le){ce(u)&&(B(u),u=Ph(a),Pr(u));let rt=Le?Ae:me,Zt=Le?me:Ae;Ih(u,he,1,{_chunkSteps:o(jo=>{b(()=>{T=!1,A=!1;let Fo=Le?q:L;if(Le?L:q)Fo||is(rt._readableStreamController,jo);else{let lg;try{lg=ph(jo)}catch(Il){cr(rt._readableStreamController,Il),cr(Zt._readableStreamController,Il),Ne(Tr(a,Il));return}Fo||is(rt._readableStreamController,jo),ns(Zt._readableStreamController,lg)}_=!1,T?un():A&&Dt()})},"_chunkSteps"),_closeSteps:o(jo=>{_=!1;let Fo=Le?q:L,xs=Le?L:q;Fo||Oi(rt._readableStreamController),xs||Oi(Zt._readableStreamController),jo!==void 0&&(Fo||is(rt._readableStreamController,jo),!xs&&Zt._readableStreamController._pendingPullIntos.length>0&&os(Zt._readableStreamController,0)),(!Fo||!xs)&&Ne(void 0)},"_closeSteps"),_errorSteps:o(()=>{_=!1},"_errorSteps")})}o(Dn,"pullWithBYOBReader");function un(){if(_)return T=!0,m(void 0);_=!0;let he=cl(me._readableStreamController);return he===null?Mo():Dn(he._view,!1),m(void 0)}o(un,"pull1Algorithm");function Dt(){if(_)return A=!0,m(void 0);_=!0;let he=cl(Ae._readableStreamController);return he===null?Mo():Dn(he._view,!0),m(void 0)}o(Dt,"pull2Algorithm");function Mt(he){if(L=!0,se=he,q){let Le=Xe([se,_e]),rt=Tr(a,Le);Ne(rt)}return tt}o(Mt,"cancel1Algorithm");function lr(he){if(q=!0,_e=he,L){let Le=Xe([se,_e]),rt=Tr(a,Le);Ne(rt)}return tt}o(lr,"cancel2Algorithm");function cn(){}return o(cn,"startAlgorithm"),me=Jh(cn,un,Mt),Ae=Jh(cn,Dt,lr),Pr(u),[me,Ae]}o(fI,"ReadableByteStreamTee");function mI(a){return r(a)&&typeof a.getReader<"u"}o(mI,"isReadableStreamLike");function hI(a){return mI(a)?yI(a.getReader()):gI(a)}o(hI,"ReadableStreamFrom");function gI(a){let u,_=dh(a,"async"),T=e;function A(){let q;try{q=sA(_)}catch(_e){return y(_e)}let se=m(q);return v(se,_e=>{if(!r(_e))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(uA(_e))so(u._readableStreamController);else{let Ae=cA(_e);No(u._readableStreamController,Ae)}})}o(A,"pullAlgorithm");function L(q){let se=_.iterator,_e;try{_e=es(se,"return")}catch(Ne){return y(Ne)}if(_e===void 0)return m(void 0);let me;try{me=C(_e,se,[q])}catch(Ne){return y(Ne)}let Ae=m(me);return v(Ae,Ne=>{if(!r(Ne))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(L,"cancelAlgorithm"),u=Ui(T,A,L,0),u}o(gI,"ReadableStreamFromIterable");function yI(a){let u,_=e;function T(){let L;try{L=a.read()}catch(q){return y(q)}return v(L,q=>{if(!r(q))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(q.done)so(u._readableStreamController);else{let se=q.value;No(u._readableStreamController,se)}})}o(T,"pullAlgorithm");function A(L){try{return m(a.cancel(L))}catch(q){return y(q)}}return o(A,"cancelAlgorithm"),u=Ui(_,T,A,0),u}o(yI,"ReadableStreamFromDefaultReader");function vI(a,u){lt(a,u);let _=a,T=_?.autoAllocateChunkSize,A=_?.cancel,L=_?.pull,q=_?.start,se=_?.type;return{autoAllocateChunkSize:T===void 0?void 0:R(T,`${u} has member 'autoAllocateChunkSize' that`),cancel:A===void 0?void 0:_I(A,_,`${u} has member 'cancel' that`),pull:L===void 0?void 0:bI(L,_,`${u} has member 'pull' that`),start:q===void 0?void 0:EI(q,_,`${u} has member 'start' that`),type:se===void 0?void 0:SI(se,`${u} has member 'type' that`)}}o(vI,"convertUnderlyingDefaultOrByteSource");function _I(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(_I,"convertUnderlyingSourceCancelCallback");function bI(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(bI,"convertUnderlyingSourcePullCallback");function EI(a,u,_){return mt(a,_),T=>C(a,u,[T])}o(EI,"convertUnderlyingSourceStartCallback");function SI(a,u){if(a=`${a}`,a!=="bytes")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}o(SI,"convertReadableStreamType");function wI(a,u){return lt(a,u),{preventCancel:!!a?.preventCancel}}o(wI,"convertIteratorOptions");function Kh(a,u){lt(a,u);let _=a?.preventAbort,T=a?.preventCancel,A=a?.preventClose,L=a?.signal;return L!==void 0&&TI(L,`${u} has member 'signal' that`),{preventAbort:!!_,preventCancel:!!T,preventClose:!!A,signal:L}}o(Kh,"convertPipeOptions");function TI(a,u){if(!kA(a))throw new TypeError(`${u} is not an AbortSignal.`)}o(TI,"assertAbortSignal");function PI(a,u){lt(a,u);let _=a?.readable;S(_,"readable","ReadableWritablePair"),$(_,`${u} has member 'readable' that`);let T=a?.writable;return S(T,"writable","ReadableWritablePair"),Ch(T,`${u} has member 'writable' that`),{readable:_,writable:T}}o(PI,"convertReadableWritablePair");class Ct{static{o(this,"ReadableStream")}constructor(u={},_={}){u===void 0?u=null:We(u,"First parameter");let T=us(_,"Second parameter"),A=vI(u,"First parameter");if(Tl(this),A.type==="bytes"){if(T.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let L=$i(T,0);_A(this,A,L)}else{let L=ss(T),q=$i(T,1);lI(this,A,q,L)}}get locked(){if(!On(this))throw uo("locked");return kn(this)}cancel(u=void 0){return On(this)?kn(this)?y(new TypeError("Cannot cancel a stream that already has a reader")):Tr(this,u):y(uo("cancel"))}getReader(u=void 0){if(!On(this))throw uo("getReader");return EA(u,"First parameter").mode===void 0?j(this):Ph(this)}pipeThrough(u,_={}){if(!On(this))throw uo("pipeThrough");Ye(u,1,"pipeThrough");let T=PI(u,"First parameter"),A=Kh(_,"Second parameter");if(kn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if($o(T.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let L=Hh(this,T.writable,A.preventClose,A.preventAbort,A.preventCancel,A.signal);return E(L),T.readable}pipeTo(u,_={}){if(!On(this))return y(uo("pipeTo"));if(u===void 0)return y("Parameter 1 is required in 'pipeTo'.");if(!ko(u))return y(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let T;try{T=Kh(_,"Second parameter")}catch(A){return y(A)}return kn(this)?y(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):$o(u)?y(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Hh(this,u,T.preventClose,T.preventAbort,T.preventCancel,T.signal)}tee(){if(!On(this))throw uo("tee");let u=dI(this);return Xe(u)}values(u=void 0){if(!On(this))throw uo("values");let _=wI(u,"First parameter");return Io(this,_.preventCancel)}[rl](u){return this.values(u)}static from(u){return hI(u)}}Object.defineProperties(Ct,{from:{enumerable:!0}}),Object.defineProperties(Ct.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(Ct.from,"from"),i(Ct.prototype.cancel,"cancel"),i(Ct.prototype.getReader,"getReader"),i(Ct.prototype.pipeThrough,"pipeThrough"),i(Ct.prototype.pipeTo,"pipeTo"),i(Ct.prototype.tee,"tee"),i(Ct.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ct.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Ct.prototype,rl,{value:Ct.prototype.values,writable:!0,configurable:!0});function Ui(a,u,_,T=1,A=()=>1){let L=Object.create(Ct.prototype);Tl(L);let q=Object.create(sn.prototype);return Zh(L,q,a,u,_,T,A),L}o(Ui,"CreateReadableStream");function Jh(a,u,_){let T=Object.create(Ct.prototype);Tl(T);let A=Object.create(on.prototype);return Th(T,A,a,u,_,0,void 0),T}o(Jh,"CreateReadableByteStream");function Tl(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}o(Tl,"InitializeReadableStream");function On(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof Ct}o(On,"IsReadableStream");function kn(a){return a._reader!==void 0}o(kn,"IsReadableStreamLocked");function Tr(a,u){if(a._disturbed=!0,a._state==="closed")return m(void 0);if(a._state==="errored")return y(a._storedError);Mi(a);let _=a._reader;if(_!==void 0&&oo(_)){let A=_._readIntoRequests;_._readIntoRequests=new W,A.forEach(L=>{L._closeSteps(void 0)})}let T=a._readableStreamController[te](u);return v(T,e)}o(Tr,"ReadableStreamCancel");function Mi(a){a._state="closed";let u=a._reader;if(u!==void 0&&(Ke(u),ce(u))){let _=u._readRequests;u._readRequests=new W,_.forEach(T=>{T._closeSteps()})}}o(Mi,"ReadableStreamClose");function Yh(a,u){a._state="errored",a._storedError=u;let _=a._reader;_!==void 0&&(Ce(_,u),ce(_)?ot(_,u):Rh(_,u))}o(Yh,"ReadableStreamError");function uo(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}o(uo,"streamBrandCheckException$1");function Xh(a,u){lt(a,u);let _=a?.highWaterMark;return S(_,"highWaterMark","QueuingStrategyInit"),{highWaterMark:P(_)}}o(Xh,"convertQueuingStrategyInit");let Qh=o(a=>a.byteLength,"byteLengthSizeFunction");i(Qh,"size");class _s{static{o(this,"ByteLengthQueuingStrategy")}constructor(u){Ye(u,1,"ByteLengthQueuingStrategy"),u=Xh(u,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!tg(this))throw eg("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!tg(this))throw eg("size");return Qh}}Object.defineProperties(_s.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(_s.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function eg(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}o(eg,"byteLengthBrandCheckException");function tg(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof _s}o(tg,"IsByteLengthQueuingStrategy");let rg=o(()=>1,"countSizeFunction");i(rg,"size");class bs{static{o(this,"CountQueuingStrategy")}constructor(u){Ye(u,1,"CountQueuingStrategy"),u=Xh(u,"First parameter"),this._countQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!og(this))throw ng("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!og(this))throw ng("size");return rg}}Object.defineProperties(bs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bs.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function ng(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}o(ng,"countBrandCheckException");function og(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof bs}o(og,"IsCountQueuingStrategy");function xI(a,u){lt(a,u);let _=a?.cancel,T=a?.flush,A=a?.readableType,L=a?.start,q=a?.transform,se=a?.writableType;return{cancel:_===void 0?void 0:CI(_,a,`${u} has member 'cancel' that`),flush:T===void 0?void 0:AI(T,a,`${u} has member 'flush' that`),readableType:A,start:L===void 0?void 0:II(L,a,`${u} has member 'start' that`),transform:q===void 0?void 0:RI(q,a,`${u} has member 'transform' that`),writableType:se}}o(xI,"convertTransformer");function AI(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(AI,"convertTransformerFlushCallback");function II(a,u,_){return mt(a,_),T=>C(a,u,[T])}o(II,"convertTransformerStartCallback");function RI(a,u,_){return mt(a,_),(T,A)=>U(a,u,[T,A])}o(RI,"convertTransformerTransformCallback");function CI(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(CI,"convertTransformerCancelCallback");class Es{static{o(this,"TransformStream")}constructor(u={},_={},T={}){u===void 0&&(u=null);let A=us(_,"Second parameter"),L=us(T,"Third parameter"),q=xI(u,"First parameter");if(q.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(q.writableType!==void 0)throw new RangeError("Invalid writableType specified");let se=$i(L,0),_e=ss(L),me=$i(A,1),Ae=ss(A),Ne,tt=p(Pr=>{Ne=Pr});OI(this,tt,me,Ae,se,_e),$I(this,q),q.start!==void 0?Ne(q.start(this._transformStreamController)):Ne(void 0)}get readable(){if(!ig(this))throw cg("readable");return this._readable}get writable(){if(!ig(this))throw cg("writable");return this._writable}}Object.defineProperties(Es.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Es.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function OI(a,u,_,T,A,L){function q(){return u}o(q,"startAlgorithm");function se(tt){return zI(a,tt)}o(se,"writeAlgorithm");function _e(tt){return UI(a,tt)}o(_e,"abortAlgorithm");function me(){return MI(a)}o(me,"closeAlgorithm"),a._writable=NA(q,se,me,_e,_,T);function Ae(){return LI(a)}o(Ae,"pullAlgorithm");function Ne(tt){return jI(a,tt)}o(Ne,"cancelAlgorithm"),a._readable=Ui(q,Ae,Ne,A,L),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,Ss(a,!0),a._transformStreamController=void 0}o(OI,"InitializeTransformStream");function ig(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof Es}o(ig,"IsTransformStream");function ag(a,u){wr(a._readable._readableStreamController,u),Pl(a,u)}o(ag,"TransformStreamError");function Pl(a,u){Ts(a._transformStreamController),Di(a._writable._writableStreamController,u),xl(a)}o(Pl,"TransformStreamErrorWritableAndUnblockWrite");function xl(a){a._backpressure&&Ss(a,!1)}o(xl,"TransformStreamUnblockWrite");function Ss(a,u){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=p(_=>{a._backpressureChangePromise_resolve=_}),a._backpressure=u}o(Ss,"TransformStreamSetBackpressure");class $n{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ws(this))throw Ps("desiredSize");let u=this._controlledTransformStream._readable._readableStreamController;return wl(u)}enqueue(u=void 0){if(!ws(this))throw Ps("enqueue");sg(this,u)}error(u=void 0){if(!ws(this))throw Ps("error");DI(this,u)}terminate(){if(!ws(this))throw Ps("terminate");NI(this)}}Object.defineProperties($n.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i($n.prototype.enqueue,"enqueue"),i($n.prototype.error,"error"),i($n.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($n.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function ws(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof $n}o(ws,"IsTransformStreamDefaultController");function kI(a,u,_,T,A){u._controlledTransformStream=a,a._transformStreamController=u,u._transformAlgorithm=_,u._flushAlgorithm=T,u._cancelAlgorithm=A,u._finishPromise=void 0,u._finishPromise_resolve=void 0,u._finishPromise_reject=void 0}o(kI,"SetUpTransformStreamDefaultController");function $I(a,u){let _=Object.create($n.prototype),T,A,L;u.transform!==void 0?T=o(q=>u.transform(q,_),"transformAlgorithm"):T=o(q=>{try{return sg(_,q),m(void 0)}catch(se){return y(se)}},"transformAlgorithm"),u.flush!==void 0?A=o(()=>u.flush(_),"flushAlgorithm"):A=o(()=>m(void 0),"flushAlgorithm"),u.cancel!==void 0?L=o(q=>u.cancel(q),"cancelAlgorithm"):L=o(()=>m(void 0),"cancelAlgorithm"),kI(a,_,T,A,L)}o($I,"SetUpTransformStreamDefaultControllerFromTransformer");function Ts(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}o(Ts,"TransformStreamDefaultControllerClearAlgorithms");function sg(a,u){let _=a._controlledTransformStream,T=_._readable._readableStreamController;if(!zo(T))throw new TypeError("Readable side is not in a state that permits enqueue");try{No(T,u)}catch(L){throw Pl(_,L),_._readable._storedError}cI(T)!==_._backpressure&&Ss(_,!0)}o(sg,"TransformStreamDefaultControllerEnqueue");function DI(a,u){ag(a._controlledTransformStream,u)}o(DI,"TransformStreamDefaultControllerError");function ug(a,u){let _=a._transformAlgorithm(u);return v(_,void 0,T=>{throw ag(a._controlledTransformStream,T),T})}o(ug,"TransformStreamDefaultControllerPerformTransform");function NI(a){let u=a._controlledTransformStream,_=u._readable._readableStreamController;so(_);let T=new TypeError("TransformStream terminated");Pl(u,T)}o(NI,"TransformStreamDefaultControllerTerminate");function zI(a,u){let _=a._transformStreamController;if(a._backpressure){let T=a._backpressureChangePromise;return v(T,()=>{let A=a._writable;if(A._state==="erroring")throw A._storedError;return ug(_,u)})}return ug(_,u)}o(zI,"TransformStreamDefaultSinkWriteAlgorithm");function UI(a,u){let _=a._transformStreamController;if(_._finishPromise!==void 0)return _._finishPromise;let T=a._readable;_._finishPromise=p((L,q)=>{_._finishPromise_resolve=L,_._finishPromise_reject=q});let A=_._cancelAlgorithm(u);return Ts(_),f(A,()=>(T._state==="errored"?Uo(_,T._storedError):(wr(T._readableStreamController,u),Al(_)),null),L=>(wr(T._readableStreamController,L),Uo(_,L),null)),_._finishPromise}o(UI,"TransformStreamDefaultSinkAbortAlgorithm");function MI(a){let u=a._transformStreamController;if(u._finishPromise!==void 0)return u._finishPromise;let _=a._readable;u._finishPromise=p((A,L)=>{u._finishPromise_resolve=A,u._finishPromise_reject=L});let T=u._flushAlgorithm();return Ts(u),f(T,()=>(_._state==="errored"?Uo(u,_._storedError):(so(_._readableStreamController),Al(u)),null),A=>(wr(_._readableStreamController,A),Uo(u,A),null)),u._finishPromise}o(MI,"TransformStreamDefaultSinkCloseAlgorithm");function LI(a){return Ss(a,!1),a._backpressureChangePromise}o(LI,"TransformStreamDefaultSourcePullAlgorithm");function jI(a,u){let _=a._transformStreamController;if(_._finishPromise!==void 0)return _._finishPromise;let T=a._writable;_._finishPromise=p((L,q)=>{_._finishPromise_resolve=L,_._finishPromise_reject=q});let A=_._cancelAlgorithm(u);return Ts(_),f(A,()=>(T._state==="errored"?Uo(_,T._storedError):(Di(T._writableStreamController,u),xl(a),Al(_)),null),L=>(Di(T._writableStreamController,L),xl(a),Uo(_,L),null)),_._finishPromise}o(jI,"TransformStreamDefaultSourceCancelAlgorithm");function Ps(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}o(Ps,"defaultControllerBrandCheckException");function Al(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Al,"defaultControllerFinishPromiseResolve");function Uo(a,u){a._finishPromise_reject!==void 0&&(E(a._finishPromise),a._finishPromise_reject(u),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Uo,"defaultControllerFinishPromiseReject");function cg(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}o(cg,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=_s,t.CountQueuingStrategy=bs,t.ReadableByteStreamController=on,t.ReadableStream=Ct,t.ReadableStreamBYOBReader=Rn,t.ReadableStreamBYOBRequest=to,t.ReadableStreamDefaultController=sn,t.ReadableStreamDefaultReader=G,t.TransformStream=Es,t.TransformStreamDefaultController=$n,t.WritableStream=Cn,t.WritableStreamDefaultController=Do,t.WritableStreamDefaultWriter=an}))});var OE=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,CE())}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*Kd(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,kE),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+kE)).arrayBuffer();n+=c.byteLength,yield new Uint8Array(c)}}}var L9,kE,$E,v$,Ir,fa=Tt(()=>{L9=qe(OE(),1);kE=65536;o(Kd,"toIterator");$E=class Jd{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 Jd?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 Kd(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 Kd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Kd(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,m=[],y=0;for(let f of p){if(y>=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)),y+=g.byteLength):(g=f.slice(s,Math.min(l,c)),y+=g.size),c-=l,m.push(g),s=0}}let h=new Jd([],{type:String(n).toLowerCase()});return h.#r=d,h.#e=m,h}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($E.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});v$=$E,Ir=v$});var _$,b$,Hn,Yd=Tt(()=>{fa();_$=class extends Ir{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 Ir&&/^(File)$/.test(e[Symbol.toStringTag])}},b$=_$,Hn=b$});function zE(t,e=Ir){var r=`${DE()}${DE()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
|
|
15
|
+
Content-Disposition: form-data; name="`;return t.forEach((s,c)=>typeof s=="string"?n.push(i+Xd(c)+`"\r
|
|
16
16
|
\r
|
|
17
17
|
${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
18
18
|
`)}\r
|
|
19
|
-
`):n.push(i+
|
|
19
|
+
`):n.push(i+Xd(c)+`"; filename="${Xd(s.name,1)}"\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
|
|
24
|
-
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),
|
|
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 ma,E$,S$,DE,w$,NE,Xd,ho,Wn,Eu=Tt(()=>{fa();Yd();({toStringTag:ma,iterator:E$,hasInstance:S$}=Symbol),DE=Math.random,w$="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),NE=o((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[ma])?[(r=r!==void 0?r+"":e[ma]=="File"?e.name:"blob",t),e.name!==r||e[ma]=="blob"?new Hn([e],r,e):e]:[t,e+""]),"f"),Xd=o((t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r
|
|
24
|
+
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),ho=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"),Wn=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[ma](){return"FormData"}[E$](){return this.entries()}static[S$](e){return e&&typeof e=="object"&&e[ma]==="FormData"&&!w$.some(r=>typeof e[r]!="function")}append(...e){ho("append",arguments,2),this.#e.push(NE(...e))}delete(e){ho("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){ho("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 ho("getAll",arguments,1),r=[],e+="",this.#e.forEach(n=>n[0]===e&&r.push(n[1])),r}has(e){return ho("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){ho("forEach",arguments,1);for(var[n,i]of this)e.call(r,i,n,this)}set(...e){ho("set",arguments,2);var r=[],n=!0;e=NE(...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(zE,"formDataToBlob")});var gn,Su=Tt(()=>{gn=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 zt,Qd=Tt(()=>{Su();zt=class extends gn{static{o(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var wu,ep,ha,UE,ME,LE,Tu=Tt(()=>{wu=Symbol.toStringTag,ep=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[wu]==="URLSearchParams","isURLSearchParameters"),ha=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[wu]),"isBlob"),UE=o(t=>typeof t=="object"&&(t[wu]==="AbortSignal"||t[wu]==="EventTarget"),"isAbortSignal"),ME=o((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),LE=o((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var FE=D((oY,jE)=>{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)}jE.exports=globalThis.DOMException});var go,qE,BE,tp,VE,GE,HE,WE,ZE,KE,Pu,rp=Tt(()=>{go=require("node:fs"),qE=require("node:path"),BE=qe(FE(),1);Yd();fa();({stat:tp}=go.promises),VE=o((t,e)=>ZE((0,go.statSync)(t),t,e),"blobFromSync"),GE=o((t,e)=>tp(t).then(r=>ZE(r,t,e)),"blobFrom"),HE=o((t,e)=>tp(t).then(r=>KE(r,t,e)),"fileFrom"),WE=o((t,e)=>KE((0,go.statSync)(t),t,e),"fileFromSync"),ZE=o((t,e,r="")=>new Ir([new Pu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),KE=o((t,e,r="")=>new Hn([new Pu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,qE.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),Pu=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 tp(this.#e);if(e>this.lastModified)throw new BE.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,go.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var YE={};As(YE,{toFormData:()=>C$});function R$(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 C$(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 np(r[1]||r[2]),i,s,c,d,p,m,y=[],h=new Wn,f=o(b=>{c+=E.decode(b,{stream:!0})},"onPartData"),l=o(b=>{y.push(b)},"appendToFile"),g=o(()=>{let b=new Hn(y,m,{type:p});h.append(d,b)},"appendFileToFormData"),v=o(()=>{h.append(d,c)},"appendEntryToFormData"),E=new TextDecoder("utf-8");E.decode(),n.onPartBegin=function(){n.onPartData=f,n.onPartEnd=v,i="",s="",c="",d="",p="",m=null,y.length=0},n.onHeaderField=function(b){i+=E.decode(b,{stream:!0})},n.onHeaderValue=function(b){s+=E.decode(b,{stream:!0})},n.onHeaderEnd=function(){if(s+=E.decode(),i=i.toLowerCase(),i==="content-disposition"){let b=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);b&&(d=b[2]||b[3]||""),m=R$(s),m&&(n.onPartData=l,n.onPartEnd=g)}else i==="content-type"&&(p=s);s="",i=""};for await(let b of t)n.write(b);return n.end(),h}var qr,nt,JE,Zn,xu,Au,T$,ga,P$,x$,A$,I$,yo,np,XE=Tt(()=>{rp();Eu();qr=0,nt={START_BOUNDARY:qr++,HEADER_FIELD_START:qr++,HEADER_FIELD:qr++,HEADER_VALUE_START:qr++,HEADER_VALUE:qr++,HEADER_VALUE_ALMOST_DONE:qr++,HEADERS_ALMOST_DONE:qr++,PART_DATA_START:qr++,PART_DATA:qr++,END:qr++},JE=1,Zn={PART_BOUNDARY:JE,LAST_BOUNDARY:JE*=2},xu=10,Au=13,T$=32,ga=45,P$=58,x$=97,A$=122,I$=o(t=>t|32,"lower"),yo=o(()=>{},"noop"),np=class{static{o(this,"MultipartParser")}constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=yo,this.onHeaderField=yo,this.onHeadersEnd=yo,this.onHeaderValue=yo,this.onPartBegin=yo,this.onPartData=yo,this.onPartEnd=yo,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=nt.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:s,boundary:c,boundaryChars:d,index:p,state:m,flags:y}=this,h=this.boundary.length,f=h-1,l=e.length,g,v,E=o(J=>{this[J+"Mark"]=r},"mark"),b=o(J=>{delete this[J+"Mark"]},"clear"),C=o((J,W,H,K)=>{(W===void 0||W!==H)&&this[J](K&&K.subarray(W,H))},"callback"),U=o((J,W)=>{let H=J+"Mark";H in this&&(W?(C(J,this[H],r,e),delete this[H]):(C(J,this[H],e.length,e),this[H]=0))},"dataCallback");for(r=0;r<n;r++)switch(g=e[r],m){case nt.START_BOUNDARY:if(p===c.length-2){if(g===ga)y|=Zn.LAST_BOUNDARY;else if(g!==Au)return;p++;break}else if(p-1===c.length-2){if(y&Zn.LAST_BOUNDARY&&g===ga)m=nt.END,y=0;else if(!(y&Zn.LAST_BOUNDARY)&&g===xu)p=0,C("onPartBegin"),m=nt.HEADER_FIELD_START;else return;break}g!==c[p+2]&&(p=-2),g===c[p+2]&&p++;break;case nt.HEADER_FIELD_START:m=nt.HEADER_FIELD,E("onHeaderField"),p=0;case nt.HEADER_FIELD:if(g===Au){b("onHeaderField"),m=nt.HEADERS_ALMOST_DONE;break}if(p++,g===ga)break;if(g===P$){if(p===1)return;U("onHeaderField",!0),m=nt.HEADER_VALUE_START;break}if(v=I$(g),v<x$||v>A$)return;break;case nt.HEADER_VALUE_START:if(g===T$)break;E("onHeaderValue"),m=nt.HEADER_VALUE;case nt.HEADER_VALUE:g===Au&&(U("onHeaderValue",!0),C("onHeaderEnd"),m=nt.HEADER_VALUE_ALMOST_DONE);break;case nt.HEADER_VALUE_ALMOST_DONE:if(g!==xu)return;m=nt.HEADER_FIELD_START;break;case nt.HEADERS_ALMOST_DONE:if(g!==xu)return;C("onHeadersEnd"),m=nt.PART_DATA_START;break;case nt.PART_DATA_START:m=nt.PART_DATA,E("onPartData");case nt.PART_DATA:if(i=p,p===0){for(r+=f;r<l&&!(e[r]in d);)r+=h;r-=f,g=e[r]}if(p<c.length)c[p]===g?(p===0&&U("onPartData",!0),p++):p=0;else if(p===c.length)p++,g===Au?y|=Zn.PART_BOUNDARY:g===ga?y|=Zn.LAST_BOUNDARY:p=0;else if(p-1===c.length)if(y&Zn.PART_BOUNDARY){if(p=0,g===xu){y&=~Zn.PART_BOUNDARY,C("onPartEnd"),C("onPartBegin"),m=nt.HEADER_FIELD_START;break}}else y&Zn.LAST_BOUNDARY&&g===ga?(C("onPartEnd"),m=nt.END,y=0):p=0;if(p>0)s[p-1]=g;else if(i>0){let J=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);C("onPartData",0,i,J),i=0,E("onPartData"),r--}break;case nt.END:break;default:throw new Error(`Unexpected state entered: ${m}`)}U("onHeaderField"),U("onHeaderValue"),U("onPartData"),this.index=p,this.state=m,this.flags=y}end(){if(this.state===nt.HEADER_FIELD_START&&this.index===0||this.state===nt.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==nt.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o(R$,"_fileName");o(C$,"toFormData")});async function op(t){if(t[Vt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Vt].disturbed=!0,t[Vt].error)throw t[Vt].error;let{body:e}=t;if(e===null)return Xt.Buffer.alloc(0);if(!(e instanceof gr.default))return Xt.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 zt(`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 gn?i:new zt(`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")?Xt.Buffer.from(r.join("")):Xt.Buffer.concat(r,n)}catch(i){throw new zt(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new zt(`Premature close of server response while trying to fetch ${t.url}`)}var gr,yn,Xt,O$,Vt,Br,ii,k$,Iu,QE,eS,Ru=Tt(()=>{gr=qe(require("node:stream"),1),yn=require("node:util"),Xt=require("node:buffer");fa();Eu();Qd();Su();Tu();O$=(0,yn.promisify)(gr.default.pipeline),Vt=Symbol("Body internals"),Br=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:ep(e)?e=Xt.Buffer.from(e.toString()):ha(e)||Xt.Buffer.isBuffer(e)||(yn.types.isAnyArrayBuffer(e)?e=Xt.Buffer.from(e):ArrayBuffer.isView(e)?e=Xt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof gr.default||(e instanceof Wn?(e=zE(e),n=e.type.split("=")[1]):e=Xt.Buffer.from(String(e))));let i=e;Xt.Buffer.isBuffer(e)?i=gr.default.Readable.from(e):ha(e)&&(i=gr.default.Readable.from(e.stream())),this[Vt]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof gr.default&&e.on("error",s=>{let c=s instanceof gn?s:new zt(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[Vt].error=c})}get body(){return this[Vt].stream}get bodyUsed(){return this[Vt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await op(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 Wn,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(()=>(XE(),YE));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Vt].body&&this[Vt].body.type||"",r=await this.arrayBuffer();return new Ir([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await op(this);return new TextDecoder().decode(e)}buffer(){return op(this)}};Br.prototype.buffer=(0,yn.deprecate)(Br.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Br.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,yn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(op,"consumeBody");ii=o((t,e)=>{let r,n,{body:i}=t[Vt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof gr.default&&typeof i.getBoundary!="function"&&(r=new gr.PassThrough({highWaterMark:e}),n=new gr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[Vt].stream=r,i=n),i},"clone"),k$=(0,yn.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"),Iu=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":ep(t)?"application/x-www-form-urlencoded;charset=UTF-8":ha(t)?t.type||null:Xt.Buffer.isBuffer(t)||yn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Wn?`multipart/form-data; boundary=${e[Vt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${k$(t)}`:t instanceof gr.default?null:"text/plain;charset=UTF-8","extractContentType"),QE=o(t=>{let{body:e}=t[Vt];return e===null?0:ha(e)?e.size:Xt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),eS=o(async(t,{body:e})=>{e===null?t.end():await O$(e,t)},"writeToStream")});function tS(t=[]){return new Gt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return Cu(e),ap(e,String(r)),!0}catch{return!1}}))}var ip,ya,Cu,ap,Gt,Ou=Tt(()=>{ip=require("node:util"),ya=qe(require("node:http"),1),Cu=typeof ya.default.validateHeaderName=="function"?ya.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}},ap=typeof ya.default.validateHeaderValue=="function"?ya.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}},Gt=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"&&!ip.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"||ip.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])=>(Cu(n),ap(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)=>(Cu(c),ap(c,String(d)),URLSearchParams.prototype[i].call(n,String(c).toLowerCase(),String(d)));case"delete":case"has":case"getAll":return c=>(Cu(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(Gt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(tS,"fromRawHeaders")});var $$,va,sp=Tt(()=>{$$=new Set([301,302,303,307,308]),va=o(t=>$$.has(t),"isRedirect")});var Rr,Qt,rS=Tt(()=>{Ou();Ru();sp();Rr=Symbol("Response internals"),Qt=class t extends Br{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new Gt(r.headers);if(e!==null&&!i.has("Content-Type")){let s=Iu(e,this);s&&i.append("Content-Type",s)}this[Rr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Rr].type}get url(){return this[Rr].url||""}get status(){return this[Rr].status}get ok(){return this[Rr].status>=200&&this[Rr].status<300}get redirected(){return this[Rr].counter>0}get statusText(){return this[Rr].statusText}get headers(){return this[Rr].headers}get highWaterMark(){return this[Rr].highWaterMark}clone(){return new t(ii(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(!va(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[Rr].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 Gt(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(Qt.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 nS,oS=Tt(()=>{nS=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 iS(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 cS(t){if(!sS.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function D$(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,aS.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 ai(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:D$(t)}function lS(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=iS(i),c=iS(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 ai(s)&&!ai(d)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return s.origin===d.origin?s:ai(s)&&!ai(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 ai(s)&&!ai(d)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function dS(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&sS.has(n)&&(r=n);return r}var aS,sS,uS,up=Tt(()=>{aS=require("node:net");o(iS,"stripURLForUseAsAReferrer");sS=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),uS="strict-origin-when-cross-origin";o(cS,"validateReferrerPolicy");o(D$,"isOriginPotentiallyTrustworthy");o(ai,"isUrlPotentiallyTrustworthy");o(lS,"determineRequestsReferrer");o(dS,"parseReferrerPolicyFromHeader")});var pS,fS,It,_a,N$,Kn,mS,hS=Tt(()=>{pS=require("node:url"),fS=require("node:util");Ou();Ru();Tu();oS();up();It=Symbol("Request internals"),_a=o(t=>typeof t=="object"&&typeof t[It]=="object","isRequest"),N$=(0,fS.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Kn=class t extends Br{static{o(this,"Request")}constructor(e,r={}){let n;if(_a(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()),!_a(r)&&"data"in r&&N$(),(r.body!=null||_a(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:_a(e)&&e.body!==null?ii(e):null;super(s,{size:r.size||e.size||0});let c=new Gt(r.headers||e.headers||{});if(s!==null&&!c.has("Content-Type")){let m=Iu(s,this);m&&c.set("Content-Type",m)}let d=_a(e)?e.signal:null;if("signal"in r&&(d=r.signal),d!=null&&!UE(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 m=new URL(p);p=/^about:(\/\/)?client$/.test(m)?"client":m}else p=void 0;this[It]={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[It].method}get url(){return(0,pS.format)(this[It].parsedURL)}get headers(){return this[It].headers}get redirect(){return this[It].redirect}get signal(){return this[It].signal}get referrer(){if(this[It].referrer==="no-referrer")return"";if(this[It].referrer==="client")return"about:client";if(this[It].referrer)return this[It].referrer.toString()}get referrerPolicy(){return this[It].referrerPolicy}set referrerPolicy(e){this[It].referrerPolicy=cS(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Kn.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}});mS=o(t=>{let{parsedURL:e}=t[It],r=new Gt(t[It].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=QE(t);typeof d=="number"&&!Number.isNaN(d)&&(n=String(d))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=uS),t.referrer&&t.referrer!=="no-referrer"?t[It].referrer=lS(t):t[It].referrer="no-referrer",t[It].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=nS(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 ba,gS=Tt(()=>{Su();ba=class extends gn{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var _S={};As(_S,{AbortError:()=>ba,Blob:()=>Ir,FetchError:()=>zt,File:()=>Hn,FormData:()=>Wn,Headers:()=>Gt,Request:()=>Kn,Response:()=>Qt,blobFrom:()=>GE,blobFromSync:()=>VE,default:()=>cp,fileFrom:()=>HE,fileFromSync:()=>WE,isRedirect:()=>va});async function cp(t,e){return new Promise((r,n)=>{let i=new Kn(t,e),{parsedURL:s,options:c}=mS(i);if(!z$.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=AE(i.url),v=new Qt(g,{headers:{"Content-Type":g.typeFull}});r(v);return}let d=(s.protocol==="https:"?vS.default:yS.default).request,{signal:p}=i,m=null,y=o(()=>{let g=new ba("The operation was aborted.");n(g),i.body&&i.body instanceof er.default.Readable&&i.body.destroy(g),!(!m||!m.body)&&m.body.emit("error",g)},"abort");if(p&&p.aborted){y();return}let h=o(()=>{y(),l()},"abortAndFinalize"),f=d(s.toString(),c);p&&p.addEventListener("abort",h);let l=o(()=>{f.abort(),p&&p.removeEventListener("abort",h)},"finalize");f.on("error",g=>{n(new zt(`request to ${i.url} failed, reason: ${g.message}`,"system",g)),l()}),U$(f,g=>{m&&m.body&&m.body.destroy(g)}),process.version<"v14"&&f.on("socket",g=>{let v;g.prependListener("end",()=>{v=g._eventsCount}),g.prependListener("close",E=>{if(m&&v<g._eventsCount&&!E){let b=new Error("Premature close");b.code="ERR_STREAM_PREMATURE_CLOSE",m.body.emit("error",b)}})}),f.on("response",g=>{f.setTimeout(0);let v=tS(g.rawHeaders);if(va(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 zt(`uri requested responds with an invalid redirect URL: ${J}`,"invalid-redirect")),l();return}}switch(i.redirect){case"error":n(new zt(`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 zt(`maximum redirect reached at: ${i.url}`,"max-redirect")),l();return}let H={headers:new Gt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:ii(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!ME(i.url,W)||!LE(i.url,W))for(let te of["authorization","www-authenticate","cookie","cookie2"])H.headers.delete(te);if(g.statusCode!==303&&i.body&&e.body instanceof er.default.Readable){n(new zt("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")&&(H.method="GET",H.body=void 0,H.headers.delete("content-length"));let K=dS(v);K&&(H.referrerPolicy=K),r(cp(new Kn(W,H))),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",h)});let E=(0,er.pipeline)(g,new er.PassThrough,J=>{J&&n(J)});process.version<"v12.10"&&g.on("aborted",h);let b={url:i.url,status:g.statusCode,statusText:g.statusMessage,headers:v,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},C=v.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||C===null||g.statusCode===204||g.statusCode===304){m=new Qt(E,b),r(m);return}let U={flush:vo.default.Z_SYNC_FLUSH,finishFlush:vo.default.Z_SYNC_FLUSH};if(C==="gzip"||C==="x-gzip"){E=(0,er.pipeline)(E,vo.default.createGunzip(U),J=>{J&&n(J)}),m=new Qt(E,b),r(m);return}if(C==="deflate"||C==="x-deflate"){let J=(0,er.pipeline)(g,new er.PassThrough,W=>{W&&n(W)});J.once("data",W=>{(W[0]&15)===8?E=(0,er.pipeline)(E,vo.default.createInflate(),H=>{H&&n(H)}):E=(0,er.pipeline)(E,vo.default.createInflateRaw(),H=>{H&&n(H)}),m=new Qt(E,b),r(m)}),J.once("end",()=>{m||(m=new Qt(E,b),r(m))});return}if(C==="br"){E=(0,er.pipeline)(E,vo.default.createBrotliDecompress(),J=>{J&&n(J)}),m=new Qt(E,b),r(m);return}m=new Qt(E,b),r(m)}),eS(f,i).catch(n)})}function U$(t,e){let r=Ea.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
|
|
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 m=new Error("Premature close");m.code="ERR_STREAM_PREMATURE_CLOSE",e(m)}},"onSocketClose"),p=o(m=>{i=Ea.Buffer.compare(m.slice(-5),r)===0,!i&&s&&(i=Ea.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&Ea.Buffer.compare(m.slice(-2),r.slice(3))===0),s=m},"onData");c.prependListener("close",d),c.on("data",p),t.on("close",()=>{c.removeListener("close",d),c.removeListener("data",p)})})}var yS,vS,vo,er,Ea,z$,bS=Tt(()=>{yS=qe(require("node:http"),1),vS=qe(require("node:https"),1),vo=qe(require("node:zlib"),1),er=qe(require("node:stream"),1),Ea=require("node:buffer");IE();Ru();rS();Ou();hS();Qd();gS();sp();Eu();Tu();up();rp();z$=new Set(["data:","http:","https:"]);o(cp,"fetch");o(U$,"fixResponseChunkedTransferBadEnding")});var wS=D(ui=>{"use strict";var M$=ui&&ui.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},si;Object.defineProperty(ui,"__esModule",{value:!0});ui.Gaxios=void 0;var L$=M$(da()),j$=require("https"),_o=Ld(),F$=tE(),ES=require("stream"),SS=qd(),q$=o(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),B$=204,ku=class{static{o(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new SS.GaxiosInterceptorManager,response:new SS.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&&si.mergeHeaders(s,r.headers),n&&si.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 si.#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=_o.GaxiosError.extractAPIErrorFromResponse(r,`Request failed with status code ${r.status}`);throw new _o.GaxiosError(n?.message,e,r,n)}return r}catch(r){let n;r instanceof _o.GaxiosError?n=r:r instanceof Error?n=new _o.GaxiosError(r.message,e,void 0,r):n=new _o.GaxiosError("Unexpected Gaxios Error",e,void 0,r);let{shouldRetry:i,config:s}=await(0,F$.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===B$)return"";if(e.maxContentLength&&r.headers.has("content-length")&&e.maxContentLength<Number.parseInt(r.headers?.get("content-length")||""))throw new _o.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);si.mergeHeaders(r,e.headers);let n=(0,L$.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 ES.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 q$();r.set("content-type",`multipart/related; boundary=${c}`),n.body=ES.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 si.#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 j$.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!="function"&&n.errorRedactor!==!1&&(n.errorRedactor=_o.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?`[
|
|
32
|
-
`+n+
|
|
31
|
+
`}yield n}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>qe(xE()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(bS(),_S))).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}};ui.Gaxios=ku;si=ku});var ht=D(Ut=>{"use strict";var V$=Ut&&Ut.__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$=Ut&&Ut.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&V$(e,t,r)};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.instance=Ut.Gaxios=Ut.GaxiosError=void 0;Ut.request=W$;var TS=wS();Object.defineProperty(Ut,"Gaxios",{enumerable:!0,get:o(function(){return TS.Gaxios},"get")});var H$=Ld();Object.defineProperty(Ut,"GaxiosError",{enumerable:!0,get:o(function(){return H$.GaxiosError},"get")});G$(qd(),Ut);Ut.instance=new TS.Gaxios;async function W$(t){return Ut.instance.request(t)}o(W$,"request")});var lp=D((PS,$u)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,s="[BigNumber Error] ",c=s+"Number primitive has more than 15 significant digits: ",d=1e14,p=14,m=9007199254740991,y=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],h=1e7,f=1e9;function l(W){var H,K,te,Q=ee.prototype={constructor:ee,toString:null,valueOf:null},xe=new ee(1),re=20,V=4,B=-7,X=21,Y=-1e7,ie=1e7,ue=!1,Ce=1,De=0,Ke={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},et="0123456789abcdefghijklmnopqrstuvwxyz",wt=!0;function ee(S,P){var x,z,R,$,j,I,O,M,N=this;if(!(N instanceof ee))return new ee(S,P);if(P==null){if(S&&S._isBigNumber===!0){N.s=S.s,!S.c||S.e>ie?N.c=N.e=null:S.e<Y?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,$++);$>ie?N.c=N.e=null:(N.e=$,N.c=[S]);return}M=String(S)}else{if(!r.test(M=String(S)))return te(N,M,I);N.s=M.charCodeAt(0)==45?(M=M.slice(1),-1):1}($=M.indexOf("."))>-1&&(M=M.replace(".","")),(j=M.search(/e/i))>0?($<0&&($=j),$+=+M.slice(j+1),M=M.substring(0,j)):$<0&&($=M.length)}else{if(b(P,2,et.length,"Base"),P==10&&wt)return N=new ee(S),We(N,re+N.e+1,V);if(M=String(S),I=typeof S=="number"){if(S*0!=0)return te(N,M,I,P);if(N.s=1/S<0?(M=M.slice(1),-1):1,ee.DEBUG&&M.replace(/^0\.0*|\./,"").length>15)throw Error(c+S)}else N.s=M.charCodeAt(0)===45?(M=M.slice(1),-1):1;for(x=et.slice(0,P),$=j=0,O=M.length;j<O;j++)if(x.indexOf(z=M.charAt(j))<0){if(z=="."){if(j>$){$=O;continue}}else if(!R&&(M==M.toUpperCase()&&(M=M.toLowerCase())||M==M.toLowerCase()&&(M=M.toUpperCase()))){R=!0,j=-1,$=0;continue}return te(N,String(S),I,P)}I=!1,M=K(M,P,10,N.s),($=M.indexOf("."))>-1?M=M.replace(".",""):$=M.length}for(j=0;M.charCodeAt(j)===48;j++);for(O=M.length;M.charCodeAt(--O)===48;);if(M=M.slice(j,++O)){if(O-=j,I&&ee.DEBUG&&O>15&&(S>m||S!==i(S)))throw Error(c+N.s*S);if(($=$-j-1)>ie)N.c=N.e=null;else if($<Y)N.c=[N.e=0];else{if(N.e=$,N.c=[],j=($+1)%p,$<0&&(j+=p),j<O){for(j&&N.c.push(+M.slice(0,j)),O-=p;j<O;)N.c.push(+M.slice(j,j+=p));j=p-(M=M.slice(j)).length}else j-=O;for(;j--;M+="0");N.c.push(+M)}}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 P,x;if(S!=null)if(typeof S=="object"){if(S.hasOwnProperty(P="DECIMAL_PLACES")&&(x=S[P],b(x,0,f,P),re=x),S.hasOwnProperty(P="ROUNDING_MODE")&&(x=S[P],b(x,0,8,P),V=x),S.hasOwnProperty(P="EXPONENTIAL_AT")&&(x=S[P],x&&x.pop?(b(x[0],-f,0,P),b(x[1],0,f,P),B=x[0],X=x[1]):(b(x,-f,f,P),B=-(X=x<0?-x:x))),S.hasOwnProperty(P="RANGE"))if(x=S[P],x&&x.pop)b(x[0],-f,-1,P),b(x[1],1,f,P),Y=x[0],ie=x[1];else if(b(x,-f,f,P),x)Y=-(ie=x<0?-x:x);else throw Error(s+P+" cannot be zero: "+x);if(S.hasOwnProperty(P="CRYPTO"))if(x=S[P],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ue=x;else throw ue=!x,Error(s+"crypto unavailable");else ue=x;else throw Error(s+P+" not true or false: "+x);if(S.hasOwnProperty(P="MODULO_MODE")&&(x=S[P],b(x,0,9,P),Ce=x),S.hasOwnProperty(P="POW_PRECISION")&&(x=S[P],b(x,0,f,P),De=x),S.hasOwnProperty(P="FORMAT"))if(x=S[P],typeof x=="object")Ke=x;else throw Error(s+P+" not an object: "+x);if(S.hasOwnProperty(P="ALPHABET"))if(x=S[P],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))wt=x.slice(0,10)=="0123456789",et=x;else throw Error(s+P+" invalid: "+x)}else throw Error(s+"Object expected: "+S);return{DECIMAL_PLACES:re,ROUNDING_MODE:V,EXPONENTIAL_AT:[B,X],RANGE:[Y,ie],CRYPTO:ue,MODULO_MODE:Ce,POW_PRECISION:De,FORMAT:Ke,ALPHABET:et}},ee.isBigNumber=function(S){if(!S||S._isBigNumber!==!0)return!1;if(!ee.DEBUG)return!0;var P,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(P=(R+1)%p,P<1&&(P+=p),String(z[0]).length==P){for(P=0;P<z.length;P++)if(x=z[P],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 mt(arguments,-1)},ee.minimum=ee.min=function(){return mt(arguments,1)},ee.random=(function(){var S=9007199254740992,P=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,O=0,M=[],N=new ee(xe);if(x==null?x=re:b(x,0,f),j=n(x/p),ue)if(crypto.getRandomValues){for(z=crypto.getRandomValues(new Uint32Array(j*=2));O<j;)I=z[O]*131072+(z[O+1]>>>11),I>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),z[O]=R[0],z[O+1]=R[1]):(M.push(I%1e14),O+=2);O=j/2}else if(crypto.randomBytes){for(z=crypto.randomBytes(j*=7);O<j;)I=(z[O]&31)*281474976710656+z[O+1]*1099511627776+z[O+2]*4294967296+z[O+3]*16777216+(z[O+4]<<16)+(z[O+5]<<8)+z[O+6],I>=9e15?crypto.randomBytes(7).copy(z,O):(M.push(I%1e14),O+=7);O=j/7}else throw ue=!1,Error(s+"crypto unavailable");if(!ue)for(;O<j;)I=P(),I<9e15&&(M[O++]=I%1e14);for(j=M[--O],x%=p,j&&x&&(I=y[p-x],M[O]=i(j/I)*I);M[O]===0;M.pop(),O--);if(O<0)M=[$=0];else{for($=-1;M[0]===0;M.splice(0,1),$-=p);for(O=1,I=M[0];I>=10;I/=10,O++);O<p&&($-=p-O)}return N.e=$,N.c=M,N}})(),ee.sum=function(){for(var S=1,P=arguments,x=new ee(P[0]);S<P.length;)x=x.plus(P[S++]);return x},K=(function(){var S="0123456789";function P(x,z,R,$){for(var j,I=[0],O,M=0,N=x.length;M<N;){for(O=I.length;O--;I[O]*=z);for(I[0]+=$.indexOf(x.charAt(M++)),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(P,"toBaseOut"),function(x,z,R,$,j){var I,O,M,N,G,ce,pe,Fe,ot=x.indexOf("."),at=re,je=V;for(ot>=0&&(N=De,De=0,x=x.replace(".",""),Fe=new ee(z),ce=Fe.pow(x.length-ot),De=N,Fe.c=P(J(v(ce.c),ce.e,"0"),10,R,S),Fe.e=Fe.c.length),pe=P(x,z,R,j?(I=et,S):(I=S,et)),M=N=pe.length;pe[--N]==0;pe.pop());if(!pe[0])return I.charAt(0);if(ot<0?--M:(ce.c=pe,ce.e=M,ce.s=$,ce=H(ce,Fe,at,je,R),pe=ce.c,G=ce.r,M=ce.e),O=M+at+1,ot=pe[O],N=R/2,G=G||O<0||pe[O+1]!=null,G=je<4?(ot!=null||G)&&(je==0||je==(ce.s<0?3:2)):ot>N||ot==N&&(je==4||G||je==6&&pe[O-1]&1||je==(ce.s<0?8:7)),O<1||!pe[0])x=G?J(I.charAt(1),-at,I.charAt(0)):I.charAt(0);else{if(pe.length=O,G)for(--R;++pe[--O]>R;)pe[O]=0,O||(++M,pe=[1].concat(pe));for(N=pe.length;!pe[--N];);for(ot=0,x="";ot<=N;x+=I.charAt(pe[ot++]));x=J(x,M,I.charAt(0))}return x}})(),H=(function(){function S(z,R,$){var j,I,O,M,N=0,G=z.length,ce=R%h,pe=R/h|0;for(z=z.slice();G--;)O=z[G]%h,M=z[G]/h|0,j=pe*O+M*ce,I=ce*O+j%h*h+N,N=(I/$|0)+(j/h|0)+pe*M,z[G]=I%$;return N&&(z=[N].concat(z)),z}o(S,"multiply");function P(z,R,$,j){var I,O;if($!=j)O=$>j?1:-1;else for(I=O=0;I<$;I++)if(z[I]!=R[I]){O=z[I]>R[I]?1:-1;break}return O}o(P,"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 O,M,N,G,ce,pe,Fe,ot,at,je,Ge,bt,Io,Ro,Co,Wt,rn,Rt=z.s==R.s?1:-1,Et=z.c,Xe=R.c;if(!Et||!Et[0]||!Xe||!Xe[0])return new ee(!z.s||!R.s||(Et?Xe&&Et[0]==Xe[0]:!Xe)?NaN:Et&&Et[0]==0||!Xe?Rt*0:Rt/0);for(ot=new ee(Rt),at=ot.c=[],M=z.e-R.e,Rt=$+M+1,I||(I=d,M=g(z.e/p)-g(R.e/p),Rt=Rt/p|0),N=0;Xe[N]==(Et[N]||0);N++);if(Xe[N]>(Et[N]||0)&&M--,Rt<0)at.push(1),G=!0;else{for(Ro=Et.length,Wt=Xe.length,N=0,Rt+=2,ce=i(I/(Xe[0]+1)),ce>1&&(Xe=S(Xe,ce,I),Et=S(Et,ce,I),Wt=Xe.length,Ro=Et.length),Io=Wt,je=Et.slice(0,Wt),Ge=je.length;Ge<Wt;je[Ge++]=0);rn=Xe.slice(),rn=[0].concat(rn),Co=Xe[0],Xe[1]>=I/2&&Co++;do{if(ce=0,O=P(Xe,je,Wt,Ge),O<0){if(bt=je[0],Wt!=Ge&&(bt=bt*I+(je[1]||0)),ce=i(bt/Co),ce>1)for(ce>=I&&(ce=I-1),pe=S(Xe,ce,I),Fe=pe.length,Ge=je.length;P(pe,je,Fe,Ge)==1;)ce--,x(pe,Wt<Fe?rn:Xe,Fe,I),Fe=pe.length,O=1;else ce==0&&(O=ce=1),pe=Xe.slice(),Fe=pe.length;if(Fe<Ge&&(pe=[0].concat(pe)),x(je,pe,Ge,I),Ge=je.length,O==-1)for(;P(Xe,je,Wt,Ge)<1;)ce++,x(je,Wt<Ge?rn:Xe,Ge,I),Ge=je.length}else O===0&&(ce++,je=[0]);at[N++]=ce,je[0]?je[Ge++]=Et[Io]||0:(je=[Et[Io]],Ge=1)}while((Io++<Ro||je[0]!=null)&&Rt--);G=je[0]!=null,at[0]||at.splice(0,1)}if(I==d){for(N=1,Rt=at[0];Rt>=10;Rt/=10,N++);We(ot,$+(ot.e=N+M*p-1)+1,j,G)}else ot.e=M,ot.r=+G;return ot}})();function lt(S,P,x,z){var R,$,j,I,O;if(x==null?x=V:b(x,0,8),!S.c)return S.toString();if(R=S.c[0],j=S.e,P==null)O=v(S.c),O=z==1||z==2&&(j<=B||j>=X)?U(O,j):J(O,j,"0");else if(S=We(new ee(S),P,x),$=S.e,O=v(S.c),I=O.length,z==1||z==2&&(P<=$||$<=B)){for(;I<P;O+="0",I++);O=U(O,$)}else if(P-=j+(z===2&&$>j),O=J(O,$,"0"),$+1>I){if(--P>0)for(O+=".";P--;O+="0");}else if(P+=$-I,P>0)for($+1==I&&(O+=".");P--;O+="0");return S.s<0&&R?"-"+O:O}o(lt,"format");function mt(S,P){for(var x,z,R=1,$=new ee(S[0]);R<S.length;R++)z=new ee(S[R]),(!z.s||(x=E($,z))===P||x===0&&$.s===P)&&($=z);return $}o(mt,"maxOrMin");function Ht(S,P,x){for(var z=1,R=P.length;!P[--R];P.pop());for(R=P[0];R>=10;R/=10,z++);return(x=z+x*p-1)>ie?S.c=S.e=null:x<Y?S.c=[S.e=0]:(S.e=x,S.c=P),S}o(Ht,"normalise"),te=(function(){var S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,P=/^([^.]+)\.$/,x=/^\.([^.]+)$/,z=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,j,I,O){var M,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(G,ce,pe){return M=(pe=pe.toLowerCase())=="x"?16:pe=="b"?2:8,!O||O==M?ce:G}),O&&(M=O,N=N.replace(P,"$1").replace(x,"0.$1")),j!=N))return new ee(N,M);if(ee.DEBUG)throw Error(s+"Not a"+(O?" base "+O:"")+" number: "+j);$.s=null}$.c=$.e=null}})();function We(S,P,x,z){var R,$,j,I,O,M,N,G=S.c,ce=y;if(G){e:{for(R=1,I=G[0];I>=10;I/=10,R++);if($=P-R,$<0)$+=p,j=P,O=G[M=0],N=i(O/ce[R-j-1]%10);else if(M=n(($+1)/p),M>=G.length)if(z){for(;G.length<=M;G.push(0));O=N=0,R=1,$%=p,j=$-p+1}else break e;else{for(O=I=G[M],R=1;I>=10;I/=10,R++);$%=p,j=$-p+R,N=j<0?0:i(O/ce[R-j-1]%10)}if(z=z||P<0||G[M+1]!=null||(j<0?O:O%ce[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?O/ce[R-j]:0:G[M-1])%10&1||x==(S.s<0?8:7)),P<1||!G[0])return G.length=0,z?(P-=S.e+1,G[0]=ce[(p-P%p)%p],S.e=-P||0):G[0]=S.e=0,S;if($==0?(G.length=M,I=1,M--):(G.length=M+1,I=ce[p-$],G[M]=j>0?i(O/ce[R-j]%ce[j])*I:0),z)for(;;)if(M==0){for($=1,j=G[0];j>=10;j/=10,$++);for(j=G[0]+=I,I=1;j>=10;j/=10,I++);$!=I&&(S.e++,G[0]==d&&(G[0]=1));break}else{if(G[M]+=I,G[M]!=d)break;G[M--]=0,I=1}for($=G.length;G[--$]===0;G.pop());}S.e>ie?S.c=S.e=null:S.e<Y&&(S.c=[S.e=0])}return S}o(We,"round");function Ye(S){var P,x=S.e;return x===null?S.toString():(P=v(S.c),P=x<=B||x>=X?U(P,x):J(P,x,"0"),S.s<0?"-"+P:P)}return o(Ye,"valueOf"),Q.absoluteValue=Q.abs=function(){var S=new ee(this);return S.s<0&&(S.s=1),S},Q.comparedTo=function(S,P){return E(this,new ee(S,P))},Q.decimalPlaces=Q.dp=function(S,P){var x,z,R,$=this;if(S!=null)return b(S,0,f),P==null?P=V:b(P,0,8),We(new ee($),S+$.e+1,P);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},Q.dividedBy=Q.div=function(S,P){return H(this,new ee(S,P),re,V)},Q.dividedToIntegerBy=Q.idiv=function(S,P){return H(this,new ee(S,P),0,1)},Q.exponentiatedBy=Q.pow=function(S,P){var x,z,R,$,j,I,O,M,N,G=this;if(S=new ee(S),S.c&&!S.isInteger())throw Error(s+"Exponent not an integer: "+Ye(S));if(P!=null&&(P=new ee(P)),I=S.e>14,!G.c||!G.c[0]||G.c[0]==1&&!G.e&&G.c.length==1||!S.c||!S.c[0])return N=new ee(Math.pow(+Ye(G),I?S.s*(2-C(S)):+Ye(S))),P?N.mod(P):N;if(O=S.s<0,P){if(P.c?!P.c[0]:!P.s)return new ee(NaN);z=!O&&G.isInteger()&&P.isInteger(),z&&(G=G.mod(P))}else{if(S.e>9&&(G.e>0||G.e<-1||(G.e==0?G.c[0]>1||I&&G.c[1]>=24e7:G.c[0]<8e13||I&&G.c[0]<=9999975e7)))return $=G.s<0&&C(S)?-0:0,G.e>-1&&($=1/$),new ee(O?1/$:$);De&&($=n(De/p+2))}for(I?(x=new ee(.5),O&&(S.s=1),M=C(S)):(R=Math.abs(+Ye(S)),M=R%2),N=new ee(xe);;){if(M){if(N=N.times(G),!N.c)break;$?N.c.length>$&&(N.c.length=$):z&&(N=N.mod(P))}if(R){if(R=i(R/2),R===0)break;M=R%2}else if(S=S.times(x),We(S,S.e+1,1),S.e>14)M=C(S);else{if(R=+Ye(S),R===0)break;M=R%2}G=G.times(G),$?G.c&&G.c.length>$&&(G.c.length=$):z&&(G=G.mod(P))}return z?N:(O&&(N=xe.div(N)),P?N.mod(P):$?We(N,De,V,j):N)},Q.integerValue=function(S){var P=new ee(this);return S==null?S=V:b(S,0,8),We(P,P.e+1,S)},Q.isEqualTo=Q.eq=function(S,P){return E(this,new ee(S,P))===0},Q.isFinite=function(){return!!this.c},Q.isGreaterThan=Q.gt=function(S,P){return E(this,new ee(S,P))>0},Q.isGreaterThanOrEqualTo=Q.gte=function(S,P){return(P=E(this,new ee(S,P)))===1||P===0},Q.isInteger=function(){return!!this.c&&g(this.e/p)>this.c.length-2},Q.isLessThan=Q.lt=function(S,P){return E(this,new ee(S,P))<0},Q.isLessThanOrEqualTo=Q.lte=function(S,P){return(P=E(this,new ee(S,P)))===-1||P===0},Q.isNaN=function(){return!this.s},Q.isNegative=function(){return this.s<0},Q.isPositive=function(){return this.s>0},Q.isZero=function(){return!!this.c&&this.c[0]==0},Q.minus=function(S,P){var x,z,R,$,j=this,I=j.s;if(S=new ee(S,P),P=S.s,!I||!P)return new ee(NaN);if(I!=P)return S.s=-P,j.plus(S);var O=j.e/p,M=S.e/p,N=j.c,G=S.c;if(!O||!M){if(!N||!G)return N?(S.s=-P,S):new ee(G?j:NaN);if(!N[0]||!G[0])return G[0]?(S.s=-P,S):new ee(N[0]?j:V==3?-0:0)}if(O=g(O),M=g(M),N=N.slice(),I=O-M){for(($=I<0)?(I=-I,R=N):(M=O,R=G),R.reverse(),P=I;P--;R.push(0));R.reverse()}else for(z=($=(I=N.length)<(P=G.length))?I:P,I=P=0;P<z;P++)if(N[P]!=G[P]){$=N[P]<G[P];break}if($&&(R=N,N=G,G=R,S.s=-S.s),P=(z=G.length)-(x=N.length),P>0)for(;P--;N[x++]=0);for(P=d-1;z>I;){if(N[--z]<G[z]){for(x=z;x&&!N[--x];N[x]=P);--N[x],N[z]+=d}N[z]-=G[z]}for(;N[0]==0;N.splice(0,1),--M);return N[0]?Ht(S,N,M):(S.s=V==3?-1:1,S.c=[S.e=0],S)},Q.modulo=Q.mod=function(S,P){var x,z,R=this;return S=new ee(S,P),!R.c||!S.s||S.c&&!S.c[0]?new ee(NaN):!S.c||R.c&&!R.c[0]?new ee(R):(Ce==9?(z=S.s,S.s=1,x=H(R,S,0,3),S.s=z,x.s*=z):x=H(R,S,0,Ce),S=R.minus(x.times(S)),!S.c[0]&&Ce==1&&(S.s=R.s),S)},Q.multipliedBy=Q.times=function(S,P){var x,z,R,$,j,I,O,M,N,G,ce,pe,Fe,ot,at,je=this,Ge=je.c,bt=(S=new ee(S,P)).c;if(!Ge||!bt||!Ge[0]||!bt[0])return!je.s||!S.s||Ge&&!Ge[0]&&!bt||bt&&!bt[0]&&!Ge?S.c=S.e=S.s=null:(S.s*=je.s,!Ge||!bt?S.c=S.e=null:(S.c=[0],S.e=0)),S;for(z=g(je.e/p)+g(S.e/p),S.s*=je.s,O=Ge.length,G=bt.length,O<G&&(Fe=Ge,Ge=bt,bt=Fe,R=O,O=G,G=R),R=O+G,Fe=[];R--;Fe.push(0));for(ot=d,at=h,R=G;--R>=0;){for(x=0,ce=bt[R]%at,pe=bt[R]/at|0,j=O,$=R+j;$>R;)M=Ge[--j]%at,N=Ge[j]/at|0,I=pe*M+N*ce,M=ce*M+I%at*at+Fe[$]+x,x=(M/ot|0)+(I/at|0)+pe*N,Fe[$--]=M%ot;Fe[$]=x}return x?++z:Fe.splice(0,1),Ht(S,Fe,z)},Q.negated=function(){var S=new ee(this);return S.s=-S.s||null,S},Q.plus=function(S,P){var x,z=this,R=z.s;if(S=new ee(S,P),P=S.s,!R||!P)return new ee(NaN);if(R!=P)return S.s=-P,z.minus(S);var $=z.e/p,j=S.e/p,I=z.c,O=S.c;if(!$||!j){if(!I||!O)return new ee(R/0);if(!I[0]||!O[0])return O[0]?S:new ee(I[0]?z:R*0)}if($=g($),j=g(j),I=I.slice(),R=$-j){for(R>0?(j=$,x=O):(R=-R,x=I),x.reverse();R--;x.push(0));x.reverse()}for(R=I.length,P=O.length,R-P<0&&(x=O,O=I,I=x,P=R),R=0;P;)R=(I[--P]=I[P]+O[P]+R)/d|0,I[P]=d===I[P]?0:I[P]%d;return R&&(I=[R].concat(I),++j),Ht(S,I,j)},Q.precision=Q.sd=function(S,P){var x,z,R,$=this;if(S!=null&&S!==!!S)return b(S,1,f),P==null?P=V:b(P,0,8),We(new ee($),S,P);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},Q.shiftedBy=function(S){return b(S,-m,m),this.times("1e"+S)},Q.squareRoot=Q.sqrt=function(){var S,P,x,z,R,$=this,j=$.c,I=$.s,O=$.e,M=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(+Ye($)),I==0||I==1/0?(P=v(j),(P.length+O)%2==0&&(P+="0"),I=Math.sqrt(+P),O=g((O+1)/2)-(O<0||O%2),I==1/0?P="5e"+O:(P=I.toExponential(),P=P.slice(0,P.indexOf("e")+1)+O),x=new ee(P)):x=new ee(I+""),x.c[0]){for(O=x.e,I=O+M,I<3&&(I=0);;)if(R=x,x=N.times(R.plus(H($,R,M,1))),v(R.c).slice(0,I)===(P=v(x.c)).slice(0,I))if(x.e<O&&--I,P=P.slice(I-3,I+1),P=="9999"||!z&&P=="4999"){if(!z&&(We(R,R.e+re+2,0),R.times(R).eq($))){x=R;break}M+=4,I+=4,z=1}else{(!+P||!+P.slice(1)&&P.charAt(0)=="5")&&(We(x,x.e+re+2,1),S=!x.times(x).eq($));break}}return We(x,x.e+re+1,V,S)},Q.toExponential=function(S,P){return S!=null&&(b(S,0,f),S++),lt(this,S,P,1)},Q.toFixed=function(S,P){return S!=null&&(b(S,0,f),S=S+this.e+1),lt(this,S,P)},Q.toFormat=function(S,P,x){var z,R=this;if(x==null)S!=null&&P&&typeof P=="object"?(x=P,P=null):S&&typeof S=="object"?(x=S,S=P=null):x=Ke;else if(typeof x!="object")throw Error(s+"Argument not an object: "+x);if(z=R.toFixed(S,P),R.c){var $,j=z.split("."),I=+x.groupSize,O=+x.secondaryGroupSize,M=x.groupSeparator||"",N=j[0],G=j[1],ce=R.s<0,pe=ce?N.slice(1):N,Fe=pe.length;if(O&&($=I,I=O,O=$,Fe-=$),I>0&&Fe>0){for($=Fe%I||I,N=pe.substr(0,$);$<Fe;$+=I)N+=M+pe.substr($,I);O>0&&(N+=M+pe.slice($)),ce&&(N="-"+N)}z=G?N+(x.decimalSeparator||"")+((O=+x.fractionGroupSize)?G.replace(new RegExp("\\d{"+O+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):G):N}return(x.prefix||"")+z+(x.suffix||"")},Q.toFraction=function(S){var P,x,z,R,$,j,I,O,M,N,G,ce,pe=this,Fe=pe.c;if(S!=null&&(I=new ee(S),!I.isInteger()&&(I.c||I.s!==1)||I.lt(xe)))throw Error(s+"Argument "+(I.isInteger()?"out of range: ":"not an integer: ")+Ye(I));if(!Fe)return new ee(pe);for(P=new ee(xe),M=x=new ee(xe),z=O=new ee(xe),ce=v(Fe),$=P.e=ce.length-pe.e-1,P.c[0]=y[(j=$%p)<0?p+j:j],S=!S||I.comparedTo(P)>0?$>0?P:M:I,j=ie,ie=1/0,I=new ee(ce),O.c[0]=0;N=H(I,P,0,1),R=x.plus(N.times(z)),R.comparedTo(S)!=1;)x=z,z=R,M=O.plus(N.times(R=M)),O=R,P=I.minus(N.times(R=P)),I=R;return R=H(S.minus(x),z,0,1),O=O.plus(R.times(M)),x=x.plus(R.times(z)),O.s=M.s=pe.s,$=$*2,G=H(M,z,$,V).minus(pe).abs().comparedTo(H(O,x,$,V).minus(pe).abs())<1?[M,z]:[O,x],ie=j,G},Q.toNumber=function(){return+Ye(this)},Q.toPrecision=function(S,P){return S!=null&&b(S,1,f),lt(this,S,P,2)},Q.toString=function(S){var P,x=this,z=x.s,R=x.e;return R===null?z?(P="Infinity",z<0&&(P="-"+P)):P="NaN":(S==null?P=R<=B||R>=X?U(v(x.c),R):J(v(x.c),R,"0"):S===10&&wt?(x=We(new ee(x),re+R+1,V),P=J(v(x.c),x.e,"0")):(b(S,2,et.length,"Base"),P=K(J(v(x.c),R,"0"),10,S,z,!0)),z<0&&x.c[0]&&(P="-"+P)),P},Q.valueOf=Q.toJSON=function(){return Ye(this)},Q._isBigNumber=!0,W!=null&&ee.set(W),ee}o(l,"clone");function g(W){var H=W|0;return W>0||W===H?H:H-1}o(g,"bitFloor");function v(W){for(var H,K,te=1,Q=W.length,xe=W[0]+"";te<Q;){for(H=W[te++]+"",K=p-H.length;K--;H="0"+H);xe+=H}for(Q=xe.length;xe.charCodeAt(--Q)===48;);return xe.slice(0,Q+1||1)}o(v,"coeffToString");function E(W,H){var K,te,Q=W.c,xe=H.c,re=W.s,V=H.s,B=W.e,X=H.e;if(!re||!V)return null;if(K=Q&&!Q[0],te=xe&&!xe[0],K||te)return K?te?0:-V:re;if(re!=V)return re;if(K=re<0,te=B==X,!Q||!xe)return te?0:!Q^K?1:-1;if(!te)return B>X^K?1:-1;for(V=(B=Q.length)<(X=xe.length)?B:X,re=0;re<V;re++)if(Q[re]!=xe[re])return Q[re]>xe[re]^K?1:-1;return B==X?0:B>X^K?1:-1}o(E,"compare");function b(W,H,K,te){if(W<H||W>K||W!==i(W))throw Error(s+(te||"Argument")+(typeof W=="number"?W<H||W>K?" out of range: ":" not an integer: ":" not a primitive number: ")+String(W))}o(b,"intCheck");function C(W){var H=W.c.length-1;return g(W.e/p)==H&&W.c[H]%2!=0}o(C,"isOdd");function U(W,H){return(W.length>1?W.charAt(0)+"."+W.slice(1):W)+(H<0?"e":"e+")+H}o(U,"toExponential");function J(W,H,K){var te,Q;if(H<0){for(Q=K+".";++H;Q+=K);W=Q+W}else if(te=W.length,++H>te){for(Q=K,H-=te;--H;Q+=K);W+=Q}else H<te&&(W=W.slice(0,H)+"."+W.slice(H));return W}o(J,"toFixedPoint"),e=l(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof $u<"u"&&$u.exports?$u.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(PS)});var RS=D((aX,IS)=>{var xS=lp(),AS=IS.exports;(function(){"use strict";function t(m){return m<10?"0"+m:m}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(m){return r.lastIndex=0,r.test(m)?'"'+m.replace(r,function(y){var h=s[y];return typeof h=="string"?h:"\\u"+("0000"+y.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+m+'"'}o(d,"quote");function p(m,y){var h,f,l,g,v=n,E,b=y[m],C=b!=null&&(b instanceof xS||xS.isBigNumber(b));switch(b&&typeof b=="object"&&typeof b.toJSON=="function"&&(b=b.toJSON(m)),typeof c=="function"&&(b=c.call(y,m,b)),typeof b){case"string":return C?b:d(b);case"number":return isFinite(b)?String(b):"null";case"boolean":case"null":case"bigint":return String(b);case"object":if(!b)return"null";if(n+=i,E=[],Object.prototype.toString.apply(b)==="[object Array]"){for(g=b.length,h=0;h<g;h+=1)E[h]=p(h,b)||"null";return l=E.length===0?"[]":n?`[
|
|
32
|
+
`+n+E.join(`,
|
|
33
33
|
`+n)+`
|
|
34
|
-
`+v+"]":"["+
|
|
35
|
-
`+n+
|
|
34
|
+
`+v+"]":"["+E.join(",")+"]",n=v,l}if(c&&typeof c=="object")for(g=c.length,h=0;h<g;h+=1)typeof c[h]=="string"&&(f=c[h],l=p(f,b),l&&E.push(d(f)+(n?": ":":")+l));else Object.keys(b).forEach(function(U){var J=p(U,b);J&&E.push(d(U)+(n?": ":":")+J)});return l=E.length===0?"{}":n?`{
|
|
35
|
+
`+n+E.join(`,
|
|
36
36
|
`+n)+`
|
|
37
|
-
`+v+"}":"{"+
|
|
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+"}":"{"+E.join(",")+"}",n=v,l}}o(p,"str"),typeof AS.stringify!="function"&&(AS.stringify=function(m,y,h){var f;if(n="",i="",typeof h=="number")for(f=0;f<h;f+=1)i+=" ";else typeof h=="string"&&(i=h);if(c=y,y&&typeof y!="function"&&(typeof y!="object"||typeof y.length!="number"))throw new Error("JSON.stringify");return p("",{"":m})})})()});var OS=D((uX,CS)=>{var Du=null,Z$=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,K$=/(?: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)/,J$=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,E="";for(n==="-"&&(E="-",d("-"));n>="0"&&n<="9";)E+=n,d();if(n===".")for(E+=".";d()&&n>="0"&&n<="9";)E+=n;if(n==="e"||n==="E")for(E+=n,d(),(n==="-"||n==="+")&&(E+=n,d());n>="0"&&n<="9";)E+=n,d();if(v=+E,!isFinite(v))c("Bad number");else return Du==null&&(Du=lp()),E.length>15?e.storeAsString?E:e.useNativeBigInt?BigInt(E):new Du(E):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(v):new Du(v):v},"number"),m=o(function(){var v,E,b="",C;if(n==='"')for(var U=r;d();){if(n==='"')return r-1>U&&(b+=s.substring(U,r-1)),d(),b;if(n==="\\"){if(r-1>U&&(b+=s.substring(U,r-1)),d(),n==="u"){for(C=0,E=0;E<4&&(v=parseInt(d(),16),!!isFinite(v));E+=1)C=C*16+v;b+=String.fromCharCode(C)}else if(typeof i[n]=="string")b+=i[n];else break;U=r}}c("Bad string")},"string"),y=o(function(){for(;n&&n<=" ";)d()},"white"),h=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("["),y(),n==="]")return d("]"),v;for(;n;){if(v.push(f()),y(),n==="]")return d("]"),v;d(","),y()}}c("Bad array")},"array"),g=o(function(){var v,E=Object.create(null);if(n==="{"){if(d("{"),y(),n==="}")return d("}"),E;for(;n;){if(v=m(),y(),d(":"),e.strict===!0&&Object.hasOwnProperty.call(E,v)&&c('Duplicate key "'+v+'"'),Z$.test(v)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?f():E[v]=f():K$.test(v)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?f():E[v]=f():E[v]=f(),y(),n==="}")return d("}"),E;d(","),y()}}c("Bad object")},"object");return f=o(function(){switch(y(),n){case"{":return g();case"[":return l();case'"':return m();case"-":return p();default:return n>="0"&&n<="9"?p():h()}},"value"),function(v,E){var b;return s=v+"",r=0,n=" ",b=f(),y(),n&&c("Syntax error"),typeof E=="function"?o((function C(U,J){var W,H,K=U[J];return K&&typeof K=="object"&&Object.keys(K).forEach(function(te){H=C(K,te),H!==void 0?K[te]=H:delete K[te]}),E.call(U,J,K)}),"walk")({"":b},""):b}},"json_parse");CS.exports=J$});var DS=D((lX,Nu)=>{var kS=RS().stringify,$S=OS();Nu.exports=function(t){return{parse:$S(t),stringify:kS}};Nu.exports.parse=$S();Nu.exports.stringify=kS});var dp=D(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.GCE_LINUX_BIOS_PATHS=void 0;Cr.isGoogleCloudServerless=US;Cr.isGoogleComputeEngineLinux=MS;Cr.isGoogleComputeEngineMACAddress=LS;Cr.isGoogleComputeEngine=jS;Cr.detectGCPResidency=X$;var NS=require("fs"),zS=require("os");Cr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var Y$=/^42:01/;function US(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(US,"isGoogleCloudServerless");function MS(){if((0,zS.platform)()!=="linux")return!1;try{(0,NS.statSync)(Cr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,NS.readFileSync)(Cr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(MS,"isGoogleComputeEngineLinux");function LS(){let t=(0,zS.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(Y$.test(r))return!0}return!1}o(LS,"isGoogleComputeEngineMACAddress");function jS(){return MS()||LS()}o(jS,"isGoogleComputeEngine");function X$(){return US()||jS()}o(X$,"detectGCPResidency")});var FS=D(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.Colours=void 0;var $t=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="")}};zu.Colours=$t;$t.enabled=!1;$t.reset="";$t.bright="";$t.dim="";$t.red="";$t.green="";$t.yellow="";$t.blue="";$t.magenta="";$t.cyan="";$t.white="";$t.grey="";$t.refresh()});var GS=D(Qe=>{"use strict";var Q$=Qe&&Qe.__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]})),eD=Qe&&Qe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qS=Qe&&Qe.__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"&&Q$(r,e,n[i]);return eD(r,e),r}})();Object.defineProperty(Qe,"__esModule",{value:!0});Qe.env=Qe.DebugLogBackendBase=Qe.placeholder=Qe.AdhocDebugLogger=Qe.LogSeverity=void 0;Qe.getNodeBackend=fp;Qe.getDebugBackend=rD;Qe.getStructuredBackend=nD;Qe.setBackend=oD;Qe.log=VS;var tD=require("events"),Sa=qS(require("process")),BS=qS(require("util")),tr=FS(),Or;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(Or||(Qe.LogSeverity=Or={}));var wa=class extends tD.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(Or.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(Or.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(Or.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(Or.ERROR,...n),this.func.sublog=n=>VS(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)}};Qe.AdhocDebugLogger=wa;Qe.placeholder=new wa("",()=>{}).func;var ci=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=Sa.env[Qe.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)}}};Qe.DebugLogBackendBase=ci;var pp=class extends ci{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=`${tr.Colours.green}${e}${tr.Colours.reset}`,c=`${tr.Colours.yellow}${Sa.pid}${tr.Colours.reset}`,d;switch(r.severity){case Or.ERROR:d=`${tr.Colours.red}${r.severity}${tr.Colours.reset}`;break;case Or.INFO:d=`${tr.Colours.magenta}${r.severity}${tr.Colours.reset}`;break;case Or.WARNING:d=`${tr.Colours.yellow}${r.severity}${tr.Colours.reset}`;break;default:d=(i=r.severity)!==null&&i!==void 0?i:Or.DEFAULT;break}let p=BS.formatWithOptions({colors:tr.Colours.enabled},...n),m=Object.assign({},r);delete m.severity;let y=Object.getOwnPropertyNames(m).length?JSON.stringify(m):"",h=y?`${tr.Colours.grey}${y}${tr.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",c,s,d,p,y?` ${h}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function fp(){return new pp}o(fp,"getNodeBackend");var mp=class extends ci{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=Sa.env.NODE_DEBUG)!==null&&e!==void 0?e:"";Sa.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function rD(t){return new mp(t)}o(rD,"getDebugBackend");var hp=class extends ci{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:Or.INFO,p=Object.assign({severity:d,message:BS.format(...s)},i),m=JSON.stringify(p);n?n(i,m):console.log("%s",m)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function nD(t){return new hp(t)}o(nD,"getStructuredBackend");Qe.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var gp=new Map,rr;function oD(t){rr=t,gp.clear()}o(oD,"setBackend");function VS(t,e){if(!rr&&!Sa.env[Qe.env.nodeEnables]||!t)return Qe.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=gp.get(t);if(r)return r.func;if(rr===null)return Qe.placeholder;rr===void 0&&(rr=fp());let n=(()=>{let i;return new wa(t,(c,...d)=>{if(i!==rr){if(rr===null)return;rr===void 0&&(rr=fp()),i=rr}rr?.log(t,c,...d)})})();return gp.set(t,n),n.func}o(VS,"log")});var yp=D(bo=>{"use strict";var iD=bo&&bo.__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]})),aD=bo&&bo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iD(e,t,r)};Object.defineProperty(bo,"__esModule",{value:!0});aD(GS(),bo)});var Pa=D(ye=>{"use strict";var WS=ye&&ye.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sD=ye&&ye.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),uD=ye&&ye.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&WS(r,e,n[i]);return sD(r,e),r}})(),cD=ye&&ye.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WS(e,t,r)};Object.defineProperty(ye,"__esModule",{value:!0});ye.gcpResidencyCache=ye.METADATA_SERVER_DETECTION=ye.HEADERS=ye.HEADER_VALUE=ye.HEADER_NAME=ye.SECONDARY_HOST_ADDRESS=ye.HOST_ADDRESS=ye.BASE_PATH=void 0;ye.instance=hD;ye.project=gD;ye.universe=yD;ye.bulk=vD;ye.isAvailable=bD;ye.resetIsAvailableCache=ED;ye.getGCPResidency=bp;ye.setGCPResidency=ZS;ye.requestTimeout=KS;var vp=ht(),lD=DS(),dD=dp(),pD=uD(yp());ye.BASE_PATH="/computeMetadata/v1";ye.HOST_ADDRESS="http://169.254.169.254";ye.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";ye.HEADER_NAME="Metadata-Flavor";ye.HEADER_VALUE="Google";ye.HEADERS=Object.freeze({[ye.HEADER_NAME]:ye.HEADER_VALUE});var HS=pD.log("gcp-metadata");ye.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 _p(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||ye.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(ye.BASE_PATH,t).href}o(_p,"getBaseUrl");function fD(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(fD,"validate");async function Ta(t,e={},r=3,n=!1){let i=new Headers(ye.HEADERS),s="",c={};if(typeof t=="object"){let h=t;new Headers(h.headers).forEach((f,l)=>i.set(l,f)),s=h.metadataKey,c=h.params||c,r=h.noResponseRetries||r,n=h.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(fD(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((h,f)=>i.set(f,h)),c=e.params||c);let d=n?mD:vp.request,p={url:`${_p()}/${s}`,headers:i,retryConfig:{noResponseRetries:r},params:c,responseType:"text",timeout:KS()};HS.info("instance request %j",p);let m=await d(p);HS.info("instance metadata is %s",m.data);let y=m.headers.get(ye.HEADER_NAME);if(y!==ye.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${ye.HEADER_NAME} header. Expected '${ye.HEADER_VALUE}', got ${y?`'${y}'`:"no header"}`);if(typeof m.data=="string")try{return lD.parse(m.data)}catch{}return m.data}o(Ta,"metadataAccessor");async function mD(t){let e={...t,url:t.url?.toString().replace(_p(),_p(ye.SECONDARY_HOST_ADDRESS))},r=(0,vp.request)(t),n=(0,vp.request)(e);return Promise.any([r,n])}o(mD,"fastFailMetadataRequest");function hD(t){return Ta("instance",t)}o(hD,"instance");function gD(t){return Ta("project",t)}o(gD,"project");function yD(t){return Ta("universe",t)}o(yD,"universe");async function vD(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await Ta(r),i=r.metadataKey;e[i]=n})())),e}o(vD,"bulk");function _D(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(_D,"detectGCPAvailableRetries");var Uu;async function bD(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in ye.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(ye.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return bp();case"ping-only":}}try{return Uu===void 0&&(Uu=Ta("instance",void 0,_D(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Uu,!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(bD,"isAvailable");function ED(){Uu=void 0}o(ED,"resetIsAvailableCache");ye.gcpResidencyCache=null;function bp(){return ye.gcpResidencyCache===null&&ZS(),ye.gcpResidencyCache}o(bp,"getGCPResidency");function ZS(t=null){ye.gcpResidencyCache=t!==null?t:(0,dD.detectGCPResidency)()}o(ZS,"setGCPResidency");function KS(){return bp()?0:3e3}o(KS,"requestTimeout");cD(dp(),ye)});var XS=D(Mu=>{"use strict";Mu.byteLength=wD;Mu.toByteArray=PD;Mu.fromByteArray=ID;var Vr=[],yr=[],SD=typeof Uint8Array<"u"?Uint8Array:Array,Ep="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Eo=0,JS=Ep.length;Eo<JS;++Eo)Vr[Eo]=Ep[Eo],yr[Ep.charCodeAt(Eo)]=Eo;var Eo,JS;yr[45]=62;yr[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 wD(t){var e=YS(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(wD,"byteLength");function TD(t,e,r){return(e+r)*3/4-r}o(TD,"_byteLength");function PD(t){var e,r=YS(t),n=r[0],i=r[1],s=new SD(TD(t,n,i)),c=0,d=i>0?n-4:n,p;for(p=0;p<d;p+=4)e=yr[t.charCodeAt(p)]<<18|yr[t.charCodeAt(p+1)]<<12|yr[t.charCodeAt(p+2)]<<6|yr[t.charCodeAt(p+3)],s[c++]=e>>16&255,s[c++]=e>>8&255,s[c++]=e&255;return i===2&&(e=yr[t.charCodeAt(p)]<<2|yr[t.charCodeAt(p+1)]>>4,s[c++]=e&255),i===1&&(e=yr[t.charCodeAt(p)]<<10|yr[t.charCodeAt(p+1)]<<4|yr[t.charCodeAt(p+2)]>>2,s[c++]=e>>8&255,s[c++]=e&255),s}o(PD,"toByteArray");function xD(t){return Vr[t>>18&63]+Vr[t>>12&63]+Vr[t>>6&63]+Vr[t&63]}o(xD,"tripletToBase64");function AD(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(xD(n));return i.join("")}o(AD,"encodeChunk");function ID(t){for(var e,r=t.length,n=r%3,i=[],s=16383,c=0,d=r-n;c<d;c+=s)i.push(AD(t,c,c+s>d?d:c+s));return n===1?(e=t[r-1],i.push(Vr[e>>2]+Vr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Vr[e>>10]+Vr[e>>4&63]+Vr[e<<2&63]+"=")),i.join("")}o(ID,"fromByteArray")});var wp=D(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.fromArrayBufferToHex=RD;function RD(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o(RD,"fromArrayBufferToHex")});var QS=D(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.BrowserCrypto=void 0;var li=XS(),CD=wp(),Tp=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 li.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),li.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=li.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 li.fromByteArray(new Uint8Array(c))}decodeBase64StringUtf8(e){let r=li.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return li.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,CD.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))}};Lu.BrowserCrypto=Tp});var ew=D(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.NodeCrypto=void 0;var di=require("crypto"),Pp=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return di.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return di.randomBytes(e).toString("base64")}async verify(e,r,n){let i=di.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=di.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 di.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:kD(e);return OD(di.createHmac("sha256",n).update(r).digest())}};ju.NodeCrypto=Pp;function OD(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(OD,"toArrayBuffer");function kD(t){return Buffer.from(t)}o(kD,"toBuffer")});var xa=D(vn=>{"use strict";var $D=vn&&vn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DD=vn&&vn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$D(e,t,r)};Object.defineProperty(vn,"__esModule",{value:!0});vn.createCrypto=UD;vn.hasBrowserCrypto=tw;var ND=QS(),zD=ew();DD(wp(),vn);function UD(){return tw()?new ND.BrowserCrypto:new zD.NodeCrypto}o(UD,"createCrypto");function tw(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(tw,"hasBrowserCrypto")});var pi=D((xp,nw)=>{var Fu=require("buffer"),Gr=Fu.Buffer;function rw(t,e){for(var r in t)e[r]=t[r]}o(rw,"copyProps");Gr.from&&Gr.alloc&&Gr.allocUnsafe&&Gr.allocUnsafeSlow?nw.exports=Fu:(rw(Fu,xp),xp.Buffer=So);function So(t,e,r){return Gr(t,e,r)}o(So,"SafeBuffer");So.prototype=Object.create(Gr.prototype);rw(Gr,So);So.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Gr(t,e,r)};So.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Gr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};So.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Gr(t)};So.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Fu.SlowBuffer(t)}});var iw=D((kX,ow)=>{"use strict";function Ap(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(Ap,"getParamSize");var MD={ES256:Ap(256),ES384:Ap(384),ES512:Ap(521)};function LD(t){var e=MD[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(LD,"getParamBytesForAlg");ow.exports=LD});var Ip=D((DX,dw)=>{"use strict";var qu=pi().Buffer,sw=iw(),Bu=128,uw=0,jD=32,FD=16,qD=2,cw=FD|jD|uw<<6,Vu=qD|uw<<6;function BD(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(BD,"base64Url");function lw(t){if(qu.isBuffer(t))return t;if(typeof t=="string")return qu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}o(lw,"signatureAsBuffer");function VD(t,e){t=lw(t);var r=sw(e),n=r+1,i=t.length,s=0;if(t[s++]!==cw)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(Bu|1)&&(c=t[s++]),i-s<c)throw new Error('"seq" specified length of "'+c+'", only "'+(i-s)+'" remaining');if(t[s++]!==Vu)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++]!==Vu)throw new Error('Could not find expected "int" for "s"');var m=t[s++];if(i-s!==m)throw new Error('"s" specified length of "'+m+'", expected "'+(i-s)+'"');if(n<m)throw new Error('"s" specified length of "'+m+'", max of "'+n+'" is acceptable');var y=s;if(s+=m,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var h=r-d,f=r-m,l=qu.allocUnsafe(h+d+f+m);for(s=0;s<h;++s)l[s]=0;t.copy(l,s,p+Math.max(-h,0),p+d),s=r;for(var g=s;s<g+f;++s)l[s]=0;return t.copy(l,s,y+Math.max(-f,0),y+m),l=l.toString("base64"),l=BD(l),l}o(VD,"derToJose");function aw(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=Bu;return i&&--n,n}o(aw,"countPadding");function GD(t,e){t=lw(t);var r=sw(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=aw(t,0,r),s=aw(t,r,t.length),c=r-i,d=r-s,p=2+c+1+1+d,m=p<Bu,y=qu.allocUnsafe((m?2:3)+p),h=0;return y[h++]=cw,m?y[h++]=p:(y[h++]=Bu|1,y[h++]=p&255),y[h++]=Vu,y[h++]=c,i<0?(y[h++]=0,h+=t.copy(y,h,0,r)):h+=t.copy(y,h,i,r),y[h++]=Vu,y[h++]=d,s<0?(y[h++]=0,t.copy(y,h,r)):t.copy(y,h,r+s),y}o(GD,"joseToDer");dw.exports={derToJose:VD,joseToDer:GD}});var kr=D(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.LRUCache=void 0;_n.snakeToCamel=fw;_n.originalOrCamelOptions=KD;_n.removeUndefinedValuesInObject=JD;_n.isValidFile=YD;_n.getWellKnownCertificateConfigFileLocation=XD;var HD=require("fs"),WD=require("os"),Rp=require("path"),ZD="certificate_config.json",pw="gcloud";function fw(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(fw,"snakeToCamel");function KD(t){function e(r){let n=t||{};return n[r]??n[fw(r)]}return o(e,"get"),{get:e}}o(KD,"originalOrCamelOptions");var Cp=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()}};_n.LRUCache=Cp;function JD(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(JD,"removeUndefinedValuesInObject");async function YD(t){try{return(await HD.promises.lstat(t)).isFile()}catch{return!1}}o(YD,"isValidFile");function XD(){let t=process.env.CLOUDSDK_CONFIG||(QD()?Rp.join(process.env.APPDATA||"",pw):Rp.join(process.env.HOME||"",".config",pw));return Rp.join(t,ZD)}o(XD,"getWellKnownCertificateConfigFileLocation");function QD(){return WD.platform().startsWith("win")}o(QD,"_isWindows")});var mw=D((MX,eN)=>{eN.exports={name:"google-auth-library",version:"10.5.0",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=18"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:"googleapis/google-auth-library-nodejs.git",keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^7.0.0","gcp-metadata":"^8.0.0","google-logging-utils":"^1.0.0",gtoken:"^8.0.0",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/jws":"^3.1.0","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","assert-rejects":"^1.0.0",c8:"^10.0.0",codecov:"^3.0.2",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",keypair:"^1.0.4",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","ts-loader":"^8.0.0",typescript:"5.8.2",webpack:"^5.21.2","webpack-cli":"^4.0.0"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check --no-inline-config",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.js","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start","docs-test":"echo 'disabled until linkinator is fixed'","predocs-test":"npm run docs",prelint:"cd samples; npm link ../; npm install"},license:"Apache-2.0"}});var Op=D(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.USER_AGENT=Jn.PRODUCT_NAME=Jn.pkg=void 0;var hw=mw();Jn.pkg=hw;var gw="google-api-nodejs-client";Jn.PRODUCT_NAME=gw;var tN=`${gw}/${hw.version}`;Jn.USER_AGENT=tN});var nr=D($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.AuthClient=$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=$r.DEFAULT_UNIVERSE=void 0;var rN=require("events"),kp=ht(),nN=kr(),oN=yp(),$p=Op();$r.DEFAULT_UNIVERSE="googleapis.com";$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var Dp=class t extends rN.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=$r.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,nN.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")??$r.DEFAULT_UNIVERSE,this.transporter=e.transporter??new kp.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&&kp.Gaxios.mergeHeaders(s,r.headers),n&&kp.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,oN.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(`${$p.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${$p.USER_AGENT}`):e.headers.set("User-Agent",$p.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"]}}}};$r.AuthClient=Dp});var zp=D(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.LoginTicket=void 0;var Np=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()}}};Gu.LoginTicket=Np});var wo=D(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.OAuth2Client=Hr.ClientAuthentication=Hr.CertificateFormat=Hr.CodeChallengeMethod=void 0;var yw=ht(),iN=require("querystring"),aN=require("stream"),sN=Ip(),vw=kr(),Up=xa(),fi=nr(),uN=zp(),_w;(function(t){t.Plain="plain",t.S256="S256"})(_w||(Hr.CodeChallengeMethod=_w={}));var bn;(function(t){t.PEM="PEM",t.JWK="JWK"})(bn||(Hr.CertificateFormat=bn={}));var Aa;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(Aa||(Hr.ClientAuthentication=Aa={}));var Mp=class t extends fi.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=bn.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||Aa.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()+"?"+iN.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,Up.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===Aa.ClientSecretBasic){let p=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${p.toString("base64")}`)}this.clientAuthentication===Aa.ClientSecretPost&&(i.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,vw.removeUndefinedValuesInObject)(i)),headers:n};fi.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,vw.removeUndefinedValuesInObject)(n))};fi.AuthClient.setMethodName(c,"refreshTokenNoCache"),i=await this.transporter.request(c)}catch(c){throw c instanceof yw.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(fi.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=yw.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 aN.Readable,m=s===401||s===403;if(!r&&m&&!p&&c)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&m&&!p&&d){let y=await this.processAndValidateRefreshHandler();return y?.access_token&&this.setCredentials(y),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,Up.hasBrowserCrypto)()?bn.JWK:bn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case bn.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case bn.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let m={...t.RETRY_CONFIG,url:i};fi.AuthClient.setMethodName(m,"getFederatedSignonCertsAsync"),n=await this.transporter.request(m)}catch(m){throw m instanceof Error&&(m.message=`Failed to retrieve verification certificates: ${m.message}`),m}let s=n?.headers.get("cache-control"),c=-1;if(s){let m=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;m&&(c=Number(m)*1e3)}let d={};switch(r){case bn.PEM:d=n.data;break;case bn.JWK:for(let m of n.data.keys)d[m.kid]=m;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};fi.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,Up.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],m=d[2],y,h;try{y=JSON.parse(c.decodeBase64StringUtf8(d[0]))}catch(U){throw U instanceof Error&&(U.message=`Can't parse token envelope: ${d[0]}': ${U.message}`),U}if(!y)throw new Error("Can't parse token envelope: "+d[0]);try{h=JSON.parse(c.decodeBase64StringUtf8(d[1]))}catch(U){throw U instanceof Error&&(U.message=`Can't parse token payload '${d[0]}`),U}if(!h)throw new Error("Can't parse token payload: "+d[1]);if(!Object.prototype.hasOwnProperty.call(r,y.kid))throw new Error("No pem found for envelope: "+JSON.stringify(y));let f=r[y.kid];if(y.alg==="ES256"&&(m=sN.joseToDer(m,"ES256").toString("base64")),!await c.verify(f,p,m))throw new Error("Invalid token signature: "+e);if(!h.iat)throw new Error("No issue time in token: "+JSON.stringify(h));if(!h.exp)throw new Error("No expiration time in token: "+JSON.stringify(h));let g=Number(h.iat);if(isNaN(g))throw new Error("iat field using invalid format");let v=Number(h.exp);if(isNaN(v))throw new Error("exp field using invalid format");let E=new Date().getTime()/1e3;if(v>=E+s)throw new Error("Expiration time too far in future: "+JSON.stringify(h));let b=g-t.CLOCK_SKEW_SECS_,C=v+t.CLOCK_SKEW_SECS_;if(E<b)throw new Error("Token used too early, "+E+" < "+b+": "+JSON.stringify(h));if(E>C)throw new Error("Token used too late, "+E+" > "+C+": "+JSON.stringify(h));if(i&&i.indexOf(h.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+h.iss);if(typeof n<"u"&&n!==null){let U=h.aud,J=!1;if(n.constructor===Array?J=n.indexOf(U)>-1:J=U===n,!J)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new uN.LoginTicket(y,h)}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}};Hr.OAuth2Client=Mp});var jp=D(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.Compute=void 0;var cN=ht(),bw=Pa(),lN=wo(),Lp=class extends lN.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 bw.instance(i)}catch(i){throw i instanceof cN.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 bw.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))}};Hu.Compute=Lp});var qp=D(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.IdTokenClient=void 0;var dN=wo(),Fp=class extends dN.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}};Wu.IdTokenClient=Fp});var Bp=D(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.GCPEnv=void 0;mi.clear=pN;mi.getEnv=fN;var Ew=Pa(),Wr;(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"})(Wr||(mi.GCPEnv=Wr={}));var Ia;function pN(){Ia=void 0}o(pN,"clear");async function fN(){return Ia||(Ia=mN(),Ia)}o(fN,"getEnv");async function mN(){let t=Wr.NONE;return hN()?t=Wr.APP_ENGINE:gN()?t=Wr.CLOUD_FUNCTIONS:await bN()?await _N()?t=Wr.KUBERNETES_ENGINE:yN()?t=Wr.CLOUD_RUN:vN()?t=Wr.CLOUD_RUN_JOBS:t=Wr.COMPUTE_ENGINE:t=Wr.NONE,t}o(mN,"getEnvMemoized");function hN(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(hN,"isAppEngine");function gN(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o(gN,"isCloudFunction");function yN(){return!!process.env.K_CONFIGURATION}o(yN,"isCloudRun");function vN(){return!!process.env.CLOUD_RUN_JOB}o(vN,"isCloudRunJob");async function _N(){try{return await Ew.instance("attributes/cluster-name"),!0}catch{return!1}}o(_N,"isKubernetesEngine");async function bN(){return Ew.isAvailable()}o(bN,"isComputeEngine")});var Vp=D((XX,Sw)=>{var Zu=pi().Buffer,EN=require("stream"),SN=require("util");function Ku(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Zu.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Zu.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(Ku,"DataStream");SN.inherits(Ku,EN);Ku.prototype.write=o(function(e){this.buffer=Zu.concat([this.buffer,Zu.from(e)]),this.emit("data",e)},"write");Ku.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");Sw.exports=Ku});var Tw=D((e7,ww)=>{"use strict";var Ra=require("buffer").Buffer,Gp=require("buffer").SlowBuffer;ww.exports=Ju;function Ju(t,e){if(!Ra.isBuffer(t)||!Ra.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(Ju,"bufferEq");Ju.install=function(){Ra.prototype.equal=Gp.prototype.equal=o(function(e){return Ju(this,e)},"equal")};var wN=Ra.prototype.equal,TN=Gp.prototype.equal;Ju.restore=function(){Ra.prototype.equal=wN,Gp.prototype.equal=TN}});var Kp=D((r7,$w)=>{var gi=pi().Buffer,vr=require("crypto"),xw=Ip(),Pw=require("util"),PN=`"%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)}
|
|
41
|
-
`});let
|
|
40
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Ca="secret must be a string or buffer",hi="key must be a string or a buffer",xN="key must be a string, a buffer or an object",Wp=typeof vr.createPublicKey=="function";Wp&&(hi+=" or a KeyObject",Ca+="or a KeyObject");function Aw(t){if(!gi.isBuffer(t)&&typeof t!="string"&&(!Wp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Dr(hi)}o(Aw,"checkIsPublicKey");function Iw(t){if(!gi.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Dr(xN)}o(Iw,"checkIsPrivateKey");function AN(t){if(!gi.isBuffer(t)){if(typeof t=="string")return t;if(!Wp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Dr(Ca)}}o(AN,"checkIsSecretKey");function Zp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Zp,"fromBase64");function Rw(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(Rw,"toBase64");function Dr(t){var e=[].slice.call(arguments,1),r=Pw.format.bind(Pw,t).apply(null,e);return new TypeError(r)}o(Dr,"typeError");function IN(t){return gi.isBuffer(t)||typeof t=="string"}o(IN,"bufferOrString");function Oa(t){return IN(t)||(t=JSON.stringify(t)),t}o(Oa,"normalizeInput");function Cw(t){return o(function(r,n){AN(n),r=Oa(r);var i=vr.createHmac("sha"+t,n),s=(i.update(r),i.digest("base64"));return Zp(s)},"sign")}o(Cw,"createHmacSigner");var Hp,RN="timingSafeEqual"in vr?o(function(e,r){return e.byteLength!==r.byteLength?!1:vr.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return Hp||(Hp=Tw()),Hp(e,r)},"timingSafeEqual");function CN(t){return o(function(r,n,i){var s=Cw(t)(r,i);return RN(gi.from(n),gi.from(s))},"verify")}o(CN,"createHmacVerifier");function Ow(t){return o(function(r,n){Iw(n),r=Oa(r);var i=vr.createSign("RSA-SHA"+t),s=(i.update(r),i.sign(n,"base64"));return Zp(s)},"sign")}o(Ow,"createKeySigner");function kw(t){return o(function(r,n,i){Aw(i),r=Oa(r),n=Rw(n);var s=vr.createVerify("RSA-SHA"+t);return s.update(r),s.verify(i,n,"base64")},"verify")}o(kw,"createKeyVerifier");function ON(t){return o(function(r,n){Iw(n),r=Oa(r);var i=vr.createSign("RSA-SHA"+t),s=(i.update(r),i.sign({key:n,padding:vr.constants.RSA_PKCS1_PSS_PADDING,saltLength:vr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Zp(s)},"sign")}o(ON,"createPSSKeySigner");function kN(t){return o(function(r,n,i){Aw(i),r=Oa(r),n=Rw(n);var s=vr.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:i,padding:vr.constants.RSA_PKCS1_PSS_PADDING,saltLength:vr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(kN,"createPSSKeyVerifier");function $N(t){var e=Ow(t);return o(function(){var n=e.apply(null,arguments);return n=xw.derToJose(n,"ES"+t),n},"sign")}o($N,"createECDSASigner");function DN(t){var e=kw(t);return o(function(n,i,s){i=xw.joseToDer(i,"ES"+t).toString("base64");var c=e(n,i,s);return c},"verify")}o(DN,"createECDSAVerifer");function NN(){return o(function(){return""},"sign")}o(NN,"createNoneSigner");function zN(){return o(function(e,r){return r===""},"verify")}o(zN,"createNoneVerifier");$w.exports=o(function(e){var r={hs:Cw,rs:Ow,ps:ON,es:$N,none:NN},n={hs:CN,rs:kw,ps:kN,es:DN,none:zN},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Dr(PN,e);var s=(i[1]||i[3]).toLowerCase(),c=i[2];return{sign:r[s](c),verify:n[s](c)}},"jwa")});var Jp=D((o7,Dw)=>{var UN=require("buffer").Buffer;Dw.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||UN.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var jw=D((a7,Lw)=>{var MN=pi().Buffer,Nw=Vp(),LN=Kp(),jN=require("stream"),zw=Jp(),Yp=require("util");function Uw(t,e){return MN.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Uw,"base64url");function FN(t,e,r){r=r||"utf8";var n=Uw(zw(t),"binary"),i=Uw(zw(e),r);return Yp.format("%s.%s",n,i)}o(FN,"jwsSecuredInput");function Mw(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,s=LN(e.alg),c=FN(e,r,i),d=s.sign(c,n);return Yp.format("%s.%s",c,d)}o(Mw,"jwsSign");function Yu(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 Nw(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Nw(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(Yu,"SignStream");Yp.inherits(Yu,jN);Yu.prototype.sign=o(function(){try{var e=Mw({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");Yu.sign=Mw;Lw.exports=Yu});var Jw=D((u7,Kw)=>{var qw=pi().Buffer,Fw=Vp(),qN=Kp(),BN=require("stream"),Bw=Jp(),VN=require("util"),GN=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function HN(t){return Object.prototype.toString.call(t)==="[object Object]"}o(HN,"isObject");function WN(t){if(HN(t))return t;try{return JSON.parse(t)}catch{return}}o(WN,"safeJsonParse");function Vw(t){var e=t.split(".",1)[0];return WN(qw.from(e,"base64").toString("binary"))}o(Vw,"headerFromJWS");function ZN(t){return t.split(".",2).join(".")}o(ZN,"securedInputFromJWS");function Gw(t){return t.split(".")[2]}o(Gw,"signatureFromJWS");function KN(t,e){e=e||"utf8";var r=t.split(".")[1];return qw.from(r,"base64").toString(e)}o(KN,"payloadFromJWS");function Hw(t){return GN.test(t)&&!!Vw(t)}o(Hw,"isValidJws");function Ww(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=Bw(t);var i=Gw(t),s=ZN(t),c=qN(e);return c.verify(s,i,r)}o(Ww,"jwsVerify");function Zw(t,e){if(e=e||{},t=Bw(t),!Hw(t))return null;var r=Vw(t);if(!r)return null;var n=KN(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:Gw(t)}}o(Zw,"jwsDecode");function yi(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 Fw(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new Fw(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(yi,"VerifyStream");VN.inherits(yi,BN);yi.prototype.verify=o(function(){try{var e=Ww(this.signature.buffer,this.algorithm,this.key.buffer),r=Zw(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");yi.decode=Zw;yi.isValid=Hw;yi.verify=Ww;Kw.exports=yi});var Xp=D(Yn=>{var Yw=jw(),Xu=Jw(),JN=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Yn.ALGORITHMS=JN;Yn.sign=Yw.sign;Yn.verify=Xu.verify;Yn.decode=Xu.decode;Yn.isValid=Xu.isValid;Yn.createSign=o(function(e){return new Yw(e)},"createSign");Yn.createVerify=o(function(e){return new Xu(e)},"createVerify")});var pT=D(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.GoogleToken=void 0;var Xw=Qu(require("fs")),YN=ht(),XN=Qu(Xp()),QN=Qu(require("path")),ez=require("util");function Qu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Qu=o(function(s,c){if(!c&&s&&s.__esModule)return s;var d,p,m={__proto__:null,default:s};if(s===null||En(s)!="object"&&typeof s!="function")return m;if(d=c?n:r){if(d.has(s))return d.get(s);d.set(s,m)}for(var y in s)y!=="default"&&{}.hasOwnProperty.call(s,y)&&((p=(d=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,y))&&(p.get||p.set)?d(m,y,p):m[y]=s[y]);return m},"_interopRequireWildcard"))(t,e)}o(Qu,"_interopRequireWildcard");function En(t){"@babel/helpers - typeof";return En=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},En(t)}o(En,"_typeof");function tz(t,e){sT(t,e),e.add(t)}o(tz,"_classPrivateMethodInitSpec");function rz(t,e,r){sT(t,e),e.set(t,r)}o(rz,"_classPrivateFieldInitSpec");function sT(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(sT,"_checkPrivateRedeclaration");function Qw(t,e,r){return t.set(Nr(t,e),r),r}o(Qw,"_classPrivateFieldSet");function eT(t,e){return t.get(Nr(t,e))}o(eT,"_classPrivateFieldGet");function Nr(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(Nr,"_assertClassBrand");function tT(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,lT(n.key),n)}}o(tT,"_defineProperties");function uT(t,e,r){return e&&tT(t.prototype,e),r&&tT(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(uT,"_createClass");function cT(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(cT,"_classCallCheck");function nz(t,e,r){return e=Na(e),oz(t,of()?Reflect.construct(e,r||[],Na(t).constructor):e.apply(t,r))}o(nz,"_callSuper");function oz(t,e){if(e&&(En(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iz(t)}o(oz,"_possibleConstructorReturn");function iz(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(iz,"_assertThisInitialized");function az(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Da(t,e)}o(az,"_inherits");function Qp(t){var e=typeof Map=="function"?new Map:void 0;return Qp=o(function(n){if(n===null||!uz(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 sz(n,arguments,Na(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Da(i,n)},"_wrapNativeSuper"),Qp(t)}o(Qp,"_wrapNativeSuper");function sz(t,e,r){if(of())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Da(i,r.prototype),i}o(sz,"_construct");function of(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(of=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(of,"_isNativeReflectConstruct");function uz(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(uz,"_isNativeFunction");function Da(t,e){return Da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Da(t,e)}o(Da,"_setPrototypeOf");function Na(t){return Na=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Na(t)}o(Na,"_getPrototypeOf");function or(t,e,r){return(e=lT(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(or,"_defineProperty");function lT(t){var e=cz(t,"string");return En(e)=="symbol"?e:e+""}o(lT,"_toPropertyKey");function cz(t,e){if(En(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(En(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(cz,"_toPrimitive");function ar(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(l,g,v,E){var b=g&&g.prototype instanceof d?g:d,C=Object.create(b.prototype);return ir(C,"_invoke",(function(U,J,W){var H,K,te,Q=0,xe=W||[],re=!1,V={p:0,n:0,v:t,a:B,f:B.bind(t,4),d:o(function(Y,ie){return H=Y,K=0,te=t,V.n=ie,c},"d")};function B(X,Y){for(K=X,te=Y,e=0;!re&&Q&&!ie&&e<xe.length;e++){var ie,ue=xe[e],Ce=V.p,De=ue[2];X>3?(ie=De===Y)&&(te=ue[(K=ue[4])?5:(K=3,3)],ue[4]=ue[5]=t):ue[0]<=Ce&&((ie=X<2&&Ce<ue[1])?(K=0,V.v=Y,V.n=ue[1]):Ce<De&&(ie=X<3||ue[0]>Y||Y>De)&&(ue[4]=X,ue[5]=Y,V.n=De,K=0))}if(ie||X>1)return c;throw re=!0,Y}return o(B,"d"),function(X,Y,ie){if(Q>1)throw TypeError("Generator is already running");for(re&&Y===1&&B(Y,ie),K=Y,te=ie;(e=K<2?t:te)||!re;){H||(K?K<3?(K>1&&(V.n=-1),B(K,te)):V.n=te:V.v=te);try{if(Q=2,H){if(K||(X="next"),e=H[X]){if(!(e=e.call(H,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=H.return)&&e.call(H),K<2&&(te=TypeError("The iterator does not provide a '"+X+"' method"),K=1);H=t}else if((e=(re=V.n<0)?te:U.call(J,V))!==c)break}catch(ue){H=t,K=1,te=ue}finally{Q=1}}return{value:e,done:re}}})(l,v,E),!0),C}o(s,"i");var c={};function d(){}o(d,"Generator");function p(){}o(p,"GeneratorFunction");function m(){}o(m,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var y=[][n]?e(e([][n]())):(ir(e={},n,function(){return this}),e),h=m.prototype=d.prototype=Object.create(y);function f(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,m):(l.__proto__=m,ir(l,i,"GeneratorFunction")),l.prototype=Object.create(h),l}return o(f,"f"),p.prototype=m,ir(h,"constructor",m),ir(m,"constructor",p),p.displayName="GeneratorFunction",ir(m,i,"GeneratorFunction"),ir(h),ir(h,i,"Generator"),ir(h,n,function(){return this}),ir(h,"toString",function(){return"[object Generator]"}),(ar=o(function(){return{w:s,m:f}},"_regenerator"))()}o(ar,"_regenerator");function ir(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}ir=o(function(c,d,p,m){if(d)i?i(c,d,{value:p,enumerable:!m,configurable:!m,writable:!m}):c[d]=p;else{var y=o(function(f,l){ir(c,f,function(g){return this._invoke(f,l,g)})},"o");y("next",0),y("throw",1),y("return",2)}},"_regeneratorDefine"),ir(t,e,r,n)}o(ir,"_regeneratorDefine2");function rT(t,e,r,n,i,s,c){try{var d=t[s](c),p=d.value}catch(m){return void r(m)}d.done?e(p):Promise.resolve(p).then(n,i)}o(rT,"asyncGeneratorStep");function vi(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function c(p){rT(s,n,i,c,d,"next",p)}o(c,"_next");function d(p){rT(s,n,i,c,d,"throw",p)}o(d,"_throw"),c(void 0)})}}o(vi,"_asyncToGenerator");var nT=Xw.readFile?(0,ez.promisify)(Xw.readFile):vi(ar().m(o(function t(){return ar().w(function(e){for(;;)switch(e.n){case 0:throw new $a("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),oT="https://oauth2.googleapis.com/token",lz="https://oauth2.googleapis.com/revoke?token=",$a=(function(t){function e(r,n){var i;return cT(this,e),i=nz(this,e,[r]),or(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),az(e,t),uT(e)})(Qp(Error)),ka=new WeakMap,Zr=new WeakSet,p7=ec.GoogleToken=(function(){function t(e){cT(this,t),tz(this,Zr),or(this,"expiresAt",void 0),or(this,"key",void 0),or(this,"keyFile",void 0),or(this,"iss",void 0),or(this,"sub",void 0),or(this,"scope",void 0),or(this,"rawToken",void 0),or(this,"tokenExpires",void 0),or(this,"email",void 0),or(this,"additionalClaims",void 0),or(this,"eagerRefreshThresholdMillis",void 0),or(this,"transporter",{request:o(function(n){return(0,YN.request)(n)},"request")}),rz(this,ka,void 0),Nr(Zr,this,dT).call(this,e)}return o(t,"GoogleToken"),uT(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(En(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;Nr(Zr,this,iT).call(this,n).then(function(s){return i(null,s)},r);return}return Nr(Zr,this,iT).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=vi(ar().m(o(function n(i){var s,c,d,p,m,y,h;return ar().w(function(f){for(;;)switch(f.n){case 0:s=QN.extname(i),h=s,f.n=h===".json"?1:h===".der"||h===".crt"||h===".pem"?4:h===".p12"||h===".pfx"?6:7;break;case 1:return f.n=2,nT(i,"utf8");case 2:if(c=f.v,d=JSON.parse(c),p=d.private_key,m=d.client_email,!(!p||!m)){f.n=3;break}throw new $a("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return f.a(2,{privateKey:p,clientEmail:m});case 4:return f.n=5,nT(i,"utf8");case 5:return y=f.v,f.a(2,{privateKey:y});case 6:throw new $a("*.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 $a("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){Nr(Zr,this,aT).call(this).then(function(){return r()},r);return}return Nr(Zr,this,aT).call(this)},"revokeToken")}])})();function iT(t){return ef.apply(this,arguments)}o(iT,"_getTokenAsync");function ef(){return ef=vi(ar().m(o(function t(e){return ar().w(function(r){for(;;)switch(r.n){case 0:if(!(eT(ka,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,eT(ka,this));case 1:return r.p=1,r.n=2,Qw(ka,this,Nr(Zr,this,dz).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,Qw(ka,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),ef.apply(this,arguments)}o(ef,"_getTokenAsync2");function dz(t){return tf.apply(this,arguments)}o(dz,"_getTokenAsyncInner");function tf(){return tf=vi(ar().m(o(function t(e){var r;return ar().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||Nr(Zr,this,pz).call(this);case 4:return n.a(2,Nr(Zr,this,fz).call(this))}},t,this)},"_callee4"))),tf.apply(this,arguments)}o(tf,"_getTokenAsyncInner2");function pz(){if(!this.iss)throw new $a("email is required.","MISSING_CREDENTIALS")}o(pz,"_ensureEmail");function aT(){return rf.apply(this,arguments)}o(aT,"_revokeTokenAsync");function rf(){return rf=vi(ar().m(o(function t(){var e;return ar().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=lz+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Nr(Zr,this,dT).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"))),rf.apply(this,arguments)}o(rf,"_revokeTokenAsync2");function dT(){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,En(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(dT,"_configure");function fz(){return nf.apply(this,arguments)}o(fz,"_requestToken");function nf(){return nf=vi(ar().m(o(function t(){var e,r,n,i,s,c,d,p,m,y;return ar().w(function(h){for(;;)switch(h.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:oT,exp:e+3600,iat:e,sub:this.sub},r),i=XN.sign({header:{alg:"RS256"},payload:n,secret:this.key}),h.p=1,h.n=2,this.transporter.request({method:"POST",url:oT,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=h.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,h.a(2,this.rawToken);case 3:throw h.p=3,y=h.v,this.rawToken=void 0,this.tokenExpires=void 0,p=y.response&&(c=y.response)!==null&&c!==void 0&&c.data?(d=y.response)===null||d===void 0?void 0:d.data:{},p.error&&(m=p.error_description?": ".concat(p.error_description):"",y.message="".concat(p.error).concat(m)),y;case 4:return h.a(2)}},t,this,[[1,3]])},"_callee6"))),nf.apply(this,arguments)}o(nf,"_requestToken2")});var sf=D(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.JWTAccess=void 0;var mz=Xp(),hz=kr(),fT={alg:"RS256",typ:"JWT"},af=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new hz.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,r,n,i){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=i??300*1e3}getCachedKey(e,r){let n=e;if(r&&Array.isArray(r)&&r.length?n=e?`${e}_${r.join("_")}`:`${r.join("_")}`:typeof r=="string"&&(n=e?`${e}_${r}`:r),!n)throw Error("Scopes or url must be provided");return n}getRequestHeaders(e,r,n){let i=this.getCachedKey(e,n),s=this.cache.get(i),c=Date.now();if(s&&s.expiration-c>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let d=Math.floor(Date.now()/1e3),p=t.getExpirationTime(d),m;if(Array.isArray(n)&&(n=n.join(" ")),n?m={iss:this.email,sub:this.email,scope:n,exp:p,iat:d}:m={iss:this.email,sub:this.email,aud:e,exp:p,iat:d},r){for(let g in m)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 y=this.keyId?{...fT,kid:this.keyId}:fT,h=Object.assign(m,r),f=mz.sign({header:y,payload:h,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)}})})}};tc.JWTAccess=af});var cf=D(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.JWT=void 0;var mT=pT(),gz=sf(),yz=wo(),rc=nr(),uf=class t extends yz.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!==rc.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==rc.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${rc.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 gz.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!==rc.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 mT.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 mT.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.")}};nc.JWT=uf});var df=D(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.UserRefreshClient=_i.USER_REFRESH_ACCOUNT_TYPE=void 0;var vz=wo(),_z=nr();_i.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var lf=class t extends vz.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 _z.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}};_i.UserRefreshClient=lf});var ff=D(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.Impersonated=bi.IMPERSONATED_ACCOUNT_TYPE=void 0;var hT=wo(),bz=ht(),Ez=kr();bi.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var pf=class t extends hT.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 hT.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,Ez.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 bz.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}};bi.Impersonated=pf});var hf=D(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.OAuthClientAuthHandler=void 0;za.getErrorFromOAuthErrorResponse=Tz;var Ei=ht(),Sz=xa(),wz=["PUT","POST","PATCH"],mf=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,Sz.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new Ei.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new Ei.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=Ei.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=Ei.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=Ei.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${i}`);Ei.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!wz.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"]}}}};za.OAuthClientAuthHandler=mf;function Tz(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(Tz,"getErrorFromOAuthErrorResponse")});var ic=D(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.StsCredentials=void 0;var Pz=ht(),xz=nr(),gT=hf(),Az=kr(),gf=class t extends gT.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,Az.removeUndefinedValuesInObject)(i))};xz.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 Pz.GaxiosError&&c.response?(0,gT.getErrorFromOAuthErrorResponse)(c.response.data,c):c}}};oc.StsCredentials=gf});var Xn=D(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.BaseExternalAccountClient=_r.CLOUD_RESOURCE_MANAGER=_r.EXTERNAL_ACCOUNT_TYPE=_r.EXPIRATION_TIME_OFFSET=void 0;var Iz=ht(),Rz=require("stream"),yf=nr(),Cz=ic(),yT=kr(),Oz=Op(),kz="urn:ietf:params:oauth:grant-type:token-exchange",$z="urn:ietf:params:oauth:token-type:access_token",vf="https://www.googleapis.com/auth/cloud-platform",Dz=3600;_r.EXPIRATION_TIME_OFFSET=300*1e3;_r.EXTERNAL_ACCOUNT_TYPE="external_account";_r.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var Nz="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",zz="https://sts.{universeDomain}/v1/token",_f=class t extends yf.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,yT.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==_r.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${_r.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")??zz.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"),m=r.get("service_account_impersonation"),y=(0,yT.originalOrCamelOptions)(m).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 Cz.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[vf],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=c,this.workforcePoolUserProject=d;let h=new RegExp(Nz);if(this.workforcePoolUserProject&&!this.audience.match(h))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=p,this.serviceAccountImpersonationLifetime=y,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=Dz),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}`};yf.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=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 Rz.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:kz,audience:this.audience,requestedTokenType:$z,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[vf]: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"}};yf.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||[vf]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${Oz.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};_r.BaseExternalAccountClient=_f});var vT=D(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.FileSubjectTokenSupplier=void 0;var Ef=require("util"),Sf=require("fs"),Uz=(0,Ef.promisify)(Sf.readFile??(()=>{})),Mz=(0,Ef.promisify)(Sf.realpath??(()=>{})),Lz=(0,Ef.promisify)(Sf.lstat??(()=>{})),bf=class{static{o(this,"FileSubjectTokenSupplier")}filePath;formatType;subjectTokenFieldName;constructor(e){this.filePath=e.filePath,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName}async getSubjectToken(){let e=this.filePath;try{if(e=await Mz(e),!(await Lz(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 Uz(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}};ac.FileSubjectTokenSupplier=bf});var _T=D(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.UrlSubjectTokenSupplier=void 0;var jz=nr(),wf=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};jz.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}};sc.UrlSubjectTokenSupplier=wf});var bT=D(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.CertificateSubjectTokenSupplier=sr.InvalidConfigurationError=sr.CertificateSourceUnavailableError=sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var uc=kr(),cc=require("fs"),lc=require("crypto"),Fz=require("https");sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Kr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};sr.CertificateSourceUnavailableError=Kr;var br=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};sr.InvalidConfigurationError=br;var Tf=class{static{o(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new br("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new br("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new br("Cannot create mTLS Agent with missing certificate or key");return new Fz.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,uc.isValidFile)(e))return e;throw new Kr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,uc.isValidFile)(r))return r;throw new Kr(`Path from environment variable "${sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,uc.getWellKnownCertificateConfigFileLocation)();if(await(0,uc.isValidFile)(n))return n;throw new Kr(`Could not find certificate configuration file. Searched override path, the "${sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await cc.promises.readFile(e,"utf8")}catch{throw new Kr(`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 br(`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 br?n:new br(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await cc.promises.readFile(e),new lc.X509Certificate(n)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Kr(`Failed to read certificate file at ${e}: ${c}`)}try{i=await cc.promises.readFile(r),(0,lc.createPrivateKey)(i)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Kr(`Failed to read private key file at ${r}: ${c}`)}return{cert:n,key:i}}async#n(e){let r=new lc.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await cc.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((p,m)=>{try{return new lc.X509Certificate(p)}catch(y){let h=y instanceof Error?y.message:String(y);throw new br(`Failed to parse certificate at index ${m} in trust chain file ${this.trustChainPath}: ${h}`)}}),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 br(`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 br)throw n;let i=n instanceof Error?n.message:String(n);throw new Kr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};sr.CertificateSubjectTokenSupplier=Tf});var Af=D(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.IdentityPoolClient=void 0;var qz=Xn(),Pf=kr(),Bz=vT(),Vz=_T(),ET=bT(),Gz=ic(),ST=ht(),xf=class t extends qz.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,Pf.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,Pf.originalOrCamelOptions)(n),c=(0,Pf.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 m=s.get("file"),y=s.get("url"),h=s.get("certificate"),f=s.get("headers");if(m&&y||y&&h||m&&h)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(m)this.credentialSourceType="file",this.subjectTokenSupplier=new Bz.FileSubjectTokenSupplier({filePath:m,formatType:d,subjectTokenFieldName:p});else if(y)this.credentialSourceType="url",this.subjectTokenSupplier=new Vz.UrlSubjectTokenSupplier({url:y,formatType:d,subjectTokenFieldName:p,headers:f,additionalGaxiosOptions:t.RETRY_CONFIG});else if(h){this.credentialSourceType="certificate";let l=new ET.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:h.use_default_certificate_config,certificateConfigLocation:h.certificate_config_location,trustChainPath:h.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 ET.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new Gz.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new ST.Gaxios({agent:r})}),this.transporter=new ST.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};dc.IdentityPoolClient=xf});var Rf=D(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.AwsRequestSigner=void 0;var pc=ht(),TT=xa(),wT="AWS4-HMAC-SHA256",Hz="aws4_request",If=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,TT.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 m=await Zz({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}),y=pc.Gaxios.mergeHeaders(m.amzDate?{"x-amz-date":m.amzDate}:{},{authorization:m.authorizationHeader,host:p.host},c||{});d.token&&pc.Gaxios.mergeHeaders(y,{"x-amz-security-token":d.token});let h={url:n,method:i,headers:y};return s!==void 0&&(h.body=s),h}};fc.AwsRequestSigner=If;async function Ua(t,e,r){return await t.signWithHmacSha256(e,r)}o(Ua,"sign");async function Wz(t,e,r,n,i){let s=await Ua(t,`AWS4${e}`,r),c=await Ua(t,s,n),d=await Ua(t,c,i);return await Ua(t,d,"aws4_request")}o(Wz,"getSigningKey");async function Zz(t){let e=pc.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=pc.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),p="",m=[...d.keys()].sort();m.forEach(C=>{p+=`${C}:${d.get(C)}
|
|
41
|
+
`});let y=m.join(";"),h=await t.crypto.sha256DigestHex(r),f=`${t.method.toUpperCase()}
|
|
42
42
|
${t.canonicalUri}
|
|
43
43
|
${t.canonicalQuerystring}
|
|
44
44
|
${p}
|
|
45
|
-
${
|
|
46
|
-
${
|
|
45
|
+
${y}
|
|
46
|
+
${h}`,l=`${c}/${t.region}/${n}/${Hz}`,g=`${wT}
|
|
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 Wz(t.crypto,t.securityCredentials.secretAccessKey,c,t.region,n),E=await Ua(t.crypto,v,g),b=`${wT} Credential=${t.securityCredentials.accessKeyId}/${l}, SignedHeaders=${y}, Signature=${(0,TT.fromArrayBufferToHex)(E)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:b,canonicalQuerystring:t.canonicalQuerystring}}o(Zz,"generateAuthenticationHeaderMap")});var PT=D(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.DefaultAwsSecurityCredentialsSupplier=void 0;var mc=nr(),Cf=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};mc.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 mc.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 mc.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 mc.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}};hc.DefaultAwsSecurityCredentialsSupplier=Cf});var kf=D(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.AwsClient=void 0;var Kz=Rf(),Jz=Xn(),Yz=PT(),xT=kr(),Xz=ht(),Of=class t extends Jz.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,xT.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,xT.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 Yz.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 Kz.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 Xz.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}))}};gc.AwsClient=Of});var Uf=D(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.InvalidSubjectTokenError=vt.InvalidMessageFieldError=vt.InvalidCodeFieldError=vt.InvalidTokenTypeFieldError=vt.InvalidExpirationTimeFieldError=vt.InvalidSuccessFieldError=vt.InvalidVersionFieldError=vt.ExecutableResponseError=vt.ExecutableResponse=void 0;var yc="urn:ietf:params:oauth:token-type:saml2",$f="urn:ietf:params:oauth:token-type:id_token",Df="urn:ietf:params:oauth:token-type:jwt",Nf=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new vc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new _c("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!==yc&&this.tokenType!==$f&&this.tokenType!==Df)throw new bc(`Executable response must contain a 'token_type' field when successful and it must be one of ${$f}, ${Df}, or ${yc}.`);if(this.tokenType===yc){if(!e.saml_response)throw new Ma(`Executable response must contain a 'saml_response' field when token_type=${yc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new Ma(`Executable response must contain a 'id_token' field when token_type=${$f} or ${Df}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new Ec("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new Sc("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=e.code,this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};vt.ExecutableResponse=Nf;var Jr=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};vt.ExecutableResponseError=Jr;var vc=class extends Jr{static{o(this,"InvalidVersionFieldError")}};vt.InvalidVersionFieldError=vc;var _c=class extends Jr{static{o(this,"InvalidSuccessFieldError")}};vt.InvalidSuccessFieldError=_c;var zf=class extends Jr{static{o(this,"InvalidExpirationTimeFieldError")}};vt.InvalidExpirationTimeFieldError=zf;var bc=class extends Jr{static{o(this,"InvalidTokenTypeFieldError")}};vt.InvalidTokenTypeFieldError=bc;var Ec=class extends Jr{static{o(this,"InvalidCodeFieldError")}};vt.InvalidCodeFieldError=Ec;var Sc=class extends Jr{static{o(this,"InvalidMessageFieldError")}};vt.InvalidMessageFieldError=Sc;var Ma=class extends Jr{static{o(this,"InvalidSubjectTokenError")}};vt.InvalidSubjectTokenError=Ma});var jf=D(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.PluggableAuthHandler=Si.ExecutableError=void 0;var To=Uf(),Qz=require("child_process"),Mf=require("fs"),wc=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)}};Si.ExecutableError=wc;var Lf=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=Qz.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),m=new To.ExecutableResponse(p);return r(m)}catch(p){return p instanceof To.ExecutableResponseError?n(p):n(new To.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new wc(s,d.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await Mf.promises.realpath(this.outputFile)}catch{return}if(!(await Mf.promises.lstat(e)).isFile())return;let r=await Mf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new To.ExecutableResponse(n).isValid()?new To.ExecutableResponse(n):void 0}catch(n){throw n instanceof To.ExecutableResponseError?n:new To.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}};Si.PluggableAuthHandler=Lf});var qf=D(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.PluggableAuthClient=wi.ExecutableError=void 0;var eU=Xn(),tU=Uf(),AT=jf(),rU=jf();Object.defineProperty(wi,"ExecutableError",{enumerable:!0,get:o(function(){return rU.ExecutableError},"get")});var nU=30*1e3,IT=5*1e3,RT=120*1e3,oU="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",CT=1,Ff=class extends eU.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=nU;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<IT||this.timeoutMillis>RT)throw new Error(`Timeout must be between ${IT} and ${RT} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new AT.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[oU]!=="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>CT)throw new Error(`Version of executable is not currently supported, maximum supported version is ${CT}.`);if(!e.success)throw new AT.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new tU.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}};wi.PluggableAuthClient=Ff});var Vf=D(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.ExternalAccountClient=void 0;var iU=Xn(),aU=Af(),sU=kf(),uU=qf(),Bf=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===iU.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new sU.AwsClient(e):e.credential_source?.executable?new uU.PluggableAuthClient(e):new aU.IdentityPoolClient(e):null}};Tc.ExternalAccountClient=Bf});var Wf=D(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.ExternalAccountAuthorizedUserClient=Ti.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var kT=nr(),OT=hf(),$T=ht(),cU=require("stream"),lU=Xn();Ti.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var dU="https://sts.{universeDomain}/v1/oauthtoken",Gf=class t extends OT.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})};kT.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 $T.GaxiosError&&i.response?(0,OT.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},Hf=class extends kT.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 Gf({tokenRefreshEndpoint:e.token_url??dU.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=lU.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=$T.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 cU.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}};Ti.ExternalAccountAuthorizedUserClient=Hf});var UT=D(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.GoogleAuth=zr.GoogleAuthExceptionMessages=void 0;var pU=require("child_process"),La=require("fs"),fU=ht(),ja=Pa(),mU=require("os"),Zf=require("path"),hU=xa(),gU=jp(),yU=qp(),vU=Bp(),Pi=cf(),DT=df(),xi=ff(),_U=Vf(),Fa=Xn(),Kf=nr(),NT=Wf(),zT=kr();zr.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(
|
|
57
|
-
`+e.prev+e.base;return 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
|
-
'${
|
|
60
|
-
`),this.push(v),
|
|
61
|
-
content-type: ${
|
|
55
|
+
https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var Jf=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(zr.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===zr.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(zr.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 ja.universe("universe-domain"),e||=Kf.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Kf.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,zT.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Kf.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 Pi.JWT?r.scopes=this.scopes:r instanceof Fa.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof Pi.JWT?r.scopes=this.scopes:r instanceof Fa.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new gU.Compute(e));throw new Error(zr.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=ja.getGCPResidency()||await ja.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=Zf.join(i,".config"))}return r&&(r=Zf.join(r,"gcloud","application_default_credentials.json"),La.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=La.realpathSync(e),!La.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=La.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!==xi.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${xi.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 xi.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,r={}){let n,i=(0,zT.originalOrCamelOptions)(r).get("universe_domain");return e.type===DT.USER_REFRESH_ACCOUNT_TYPE?(n=new DT.UserRefreshClient(r),n.fromJSON(e)):e.type===xi.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===Fa.EXTERNAL_ACCOUNT_TYPE?(n=_U.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===NT.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new NT.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new Pi.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 Pi.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 Pi.JWT({...r,apiKey:e})}_isWindows(){let e=mU.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,pU.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!==Fa.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await ja.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 xi.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof Fa.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([ja.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(zr.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=Zf.resolve(this.keyFilename),r=La.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 yU.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=fU.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,vU.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 xi.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,hU.createCrypto)();if(n instanceof Pi.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}};zr.GoogleAuth=Jf});var MT=D(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.IAMAuth=void 0;var Yf=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}}};Pc.IAMAuth=Yf});var LT=D(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.DownscopedClient=Yr.EXPIRATION_TIME_OFFSET=Yr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var bU=ht(),EU=require("stream"),Xf=nr(),SU=ic(),wU="urn:ietf:params:oauth:grant-type:token-exchange",TU="urn:ietf:params:oauth:token-type:access_token",PU="urn:ietf:params:oauth:token-type:access_token";Yr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Yr.EXPIRATION_TIME_OFFSET=300*1e3;var Qf=class extends Xf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Xf.AuthClient?{}:e),e instanceof Xf.AuthClient?(this.authClient=e,this.credentialAccessBoundary=r):(this.authClient=e.authClient,this.credentialAccessBoundary=e.credentialAccessBoundary),this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length===0)throw new Error("At least one access boundary rule needs to be defined.");if(this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length>Yr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Yr.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);for(let n of this.credentialAccessBoundary.accessBoundary.accessBoundaryRules)if(n.availablePermissions.length===0)throw new Error("At least one permission should be defined in access boundary rules.");this.stsCredential=new SU.StsCredentials({tokenExchangeEndpoint:`https://sts.${this.universeDomain}/v1/token`}),this.cachedDownscopedAccessToken=null}setCredentials(e){if(!e.expiry_date)throw new Error("The access token expiry_date field is missing in the provided credentials.");super.setCredentials(e),this.cachedDownscopedAccessToken=e}async getAccessToken(){return(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=bU.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 EU.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:wU,requestedTokenType:TU,subjectToken:e,subjectTokenType:PU},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}};Yr.DownscopedClient=Qf});var jT=D(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.PassThroughClient=void 0;var xU=nr(),em=class extends xU.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};xc.PassThroughClient=em});var qa=D(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.GoogleAuth=de.auth=de.PassThroughClient=de.ExternalAccountAuthorizedUserClient=de.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=de.ExecutableError=de.PluggableAuthClient=de.DownscopedClient=de.BaseExternalAccountClient=de.ExternalAccountClient=de.IdentityPoolClient=de.AwsRequestSigner=de.AwsClient=de.UserRefreshClient=de.LoginTicket=de.ClientAuthentication=de.OAuth2Client=de.CodeChallengeMethod=de.Impersonated=de.JWT=de.JWTAccess=de.IdTokenClient=de.IAMAuth=de.GCPEnv=de.Compute=de.DEFAULT_UNIVERSE=de.AuthClient=de.gaxios=de.gcpMetadata=void 0;var FT=UT();Object.defineProperty(de,"GoogleAuth",{enumerable:!0,get:o(function(){return FT.GoogleAuth},"get")});de.gcpMetadata=Pa();de.gaxios=ht();var qT=nr();Object.defineProperty(de,"AuthClient",{enumerable:!0,get:o(function(){return qT.AuthClient},"get")});Object.defineProperty(de,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return qT.DEFAULT_UNIVERSE},"get")});var AU=jp();Object.defineProperty(de,"Compute",{enumerable:!0,get:o(function(){return AU.Compute},"get")});var IU=Bp();Object.defineProperty(de,"GCPEnv",{enumerable:!0,get:o(function(){return IU.GCPEnv},"get")});var RU=MT();Object.defineProperty(de,"IAMAuth",{enumerable:!0,get:o(function(){return RU.IAMAuth},"get")});var CU=qp();Object.defineProperty(de,"IdTokenClient",{enumerable:!0,get:o(function(){return CU.IdTokenClient},"get")});var OU=sf();Object.defineProperty(de,"JWTAccess",{enumerable:!0,get:o(function(){return OU.JWTAccess},"get")});var kU=cf();Object.defineProperty(de,"JWT",{enumerable:!0,get:o(function(){return kU.JWT},"get")});var $U=ff();Object.defineProperty(de,"Impersonated",{enumerable:!0,get:o(function(){return $U.Impersonated},"get")});var tm=wo();Object.defineProperty(de,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return tm.CodeChallengeMethod},"get")});Object.defineProperty(de,"OAuth2Client",{enumerable:!0,get:o(function(){return tm.OAuth2Client},"get")});Object.defineProperty(de,"ClientAuthentication",{enumerable:!0,get:o(function(){return tm.ClientAuthentication},"get")});var DU=zp();Object.defineProperty(de,"LoginTicket",{enumerable:!0,get:o(function(){return DU.LoginTicket},"get")});var NU=df();Object.defineProperty(de,"UserRefreshClient",{enumerable:!0,get:o(function(){return NU.UserRefreshClient},"get")});var zU=kf();Object.defineProperty(de,"AwsClient",{enumerable:!0,get:o(function(){return zU.AwsClient},"get")});var UU=Rf();Object.defineProperty(de,"AwsRequestSigner",{enumerable:!0,get:o(function(){return UU.AwsRequestSigner},"get")});var MU=Af();Object.defineProperty(de,"IdentityPoolClient",{enumerable:!0,get:o(function(){return MU.IdentityPoolClient},"get")});var LU=Vf();Object.defineProperty(de,"ExternalAccountClient",{enumerable:!0,get:o(function(){return LU.ExternalAccountClient},"get")});var jU=Xn();Object.defineProperty(de,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return jU.BaseExternalAccountClient},"get")});var FU=LT();Object.defineProperty(de,"DownscopedClient",{enumerable:!0,get:o(function(){return FU.DownscopedClient},"get")});var BT=qf();Object.defineProperty(de,"PluggableAuthClient",{enumerable:!0,get:o(function(){return BT.PluggableAuthClient},"get")});Object.defineProperty(de,"ExecutableError",{enumerable:!0,get:o(function(){return BT.ExecutableError},"get")});var VT=Wf();Object.defineProperty(de,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return VT.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(de,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return VT.ExternalAccountAuthorizedUserClient},"get")});var qU=jT();Object.defineProperty(de,"PassThroughClient",{enumerable:!0,get:o(function(){return qU.PassThroughClient},"get")});var BU=new FT.GoogleAuth;de.auth=BU});var Sn=D((nm,om)=>{(function(t,e){typeof nm=="object"&&typeof om<"u"?om.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(nm,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",s="minute",c="hour",d="day",p="week",m="month",y="quarter",h="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,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o(function(re){var V=["th","st","nd","rd"],B=re%100;return"["+re+(V[(B-20)%10]||V[B]||V[0])+"]"},"ordinal")},b=o(function(re,V,B){var X=String(re);return!X||X.length>=V?re:""+Array(V+1-X.length).join(B)+re},"m"),C={s:b,z:o(function(re){var V=-re.utcOffset(),B=Math.abs(V),X=Math.floor(B/60),Y=B%60;return(V<=0?"+":"-")+b(X,2,"0")+":"+b(Y,2,"0")},"z"),m:o(function re(V,B){if(V.date()<B.date())return-re(B,V);var X=12*(B.year()-V.year())+(B.month()-V.month()),Y=V.clone().add(X,m),ie=B-Y<0,ue=V.clone().add(X+(ie?-1:1),m);return+(-(X+(B-Y)/(ie?Y-ue:ue-Y))||0)},"t"),a:o(function(re){return re<0?Math.ceil(re)||0:Math.floor(re)},"a"),p:o(function(re){return{M:m,y:h,w:p,d,D:f,h:c,m:s,s:i,ms:n,Q:y}[re]||String(re||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(re){return re===void 0},"u")},U="en",J={};J[U]=E;var W=o(function(re){return re instanceof Q},"p"),H=o(function re(V,B,X){var Y;if(!V)return U;if(typeof V=="string"){var ie=V.toLowerCase();J[ie]&&(Y=ie),B&&(J[ie]=B,Y=ie);var ue=V.split("-");if(!Y&&ue.length>1)return re(ue[0])}else{var Ce=V.name;J[Ce]=V,Y=Ce}return!X&&Y&&(U=Y),Y||!X&&U},"t"),K=o(function(re,V){if(W(re))return re.clone();var B=typeof V=="object"?V:{};return B.date=re,B.args=arguments,new Q(B)},"w"),te=C;te.l=H,te.i=W,te.w=function(re,V){return K(re,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var Q=(function(){function re(B){this.$L=H(B.locale,null,!0),this.parse(B)}o(re,"M");var V=re.prototype;return V.parse=function(B){this.$d=(function(X){var Y=X.date,ie=X.utc;if(Y===null)return new Date(NaN);if(te.u(Y))return new Date;if(Y instanceof Date)return new Date(Y);if(typeof Y=="string"&&!/Z$/i.test(Y)){var ue=Y.match(g);if(ue){var Ce=ue[2]-1||0,De=(ue[7]||"0").substring(0,3);return ie?new Date(Date.UTC(ue[1],Ce,ue[3]||1,ue[4]||0,ue[5]||0,ue[6]||0,De)):new Date(ue[1],Ce,ue[3]||1,ue[4]||0,ue[5]||0,ue[6]||0,De)}}return new Date(Y)})(B),this.$x=B.x||{},this.init()},V.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},V.$utils=function(){return te},V.isValid=function(){return this.$d.toString()!==l},V.isSame=function(B,X){var Y=K(B);return this.startOf(X)<=Y&&Y<=this.endOf(X)},V.isAfter=function(B,X){return K(B)<this.startOf(X)},V.isBefore=function(B,X){return this.endOf(X)<K(B)},V.$g=function(B,X,Y){return te.u(B)?this[X]:this.set(Y,B)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(B,X){var Y=this,ie=!!te.u(X)||X,ue=te.p(B),Ce=o(function(Ht,We){var Ye=te.w(Y.$u?Date.UTC(Y.$y,We,Ht):new Date(Y.$y,We,Ht),Y);return ie?Ye:Ye.endOf(d)},"l"),De=o(function(Ht,We){return te.w(Y.toDate()[Ht].apply(Y.toDate("s"),(ie?[0,0,0,0]:[23,59,59,999]).slice(We)),Y)},"$"),Ke=this.$W,et=this.$M,wt=this.$D,ee="set"+(this.$u?"UTC":"");switch(ue){case h:return ie?Ce(1,0):Ce(31,11);case m:return ie?Ce(1,et):Ce(0,et+1);case p:var lt=this.$locale().weekStart||0,mt=(Ke<lt?Ke+7:Ke)-lt;return Ce(ie?wt-mt:wt+(6-mt),et);case d:case f:return De(ee+"Hours",0);case c:return De(ee+"Minutes",1);case s:return De(ee+"Seconds",2);case i:return De(ee+"Milliseconds",3);default:return this.clone()}},V.endOf=function(B){return this.startOf(B,!1)},V.$set=function(B,X){var Y,ie=te.p(B),ue="set"+(this.$u?"UTC":""),Ce=(Y={},Y[d]=ue+"Date",Y[f]=ue+"Date",Y[m]=ue+"Month",Y[h]=ue+"FullYear",Y[c]=ue+"Hours",Y[s]=ue+"Minutes",Y[i]=ue+"Seconds",Y[n]=ue+"Milliseconds",Y)[ie],De=ie===d?this.$D+(X-this.$W):X;if(ie===m||ie===h){var Ke=this.clone().set(f,1);Ke.$d[Ce](De),Ke.init(),this.$d=Ke.set(f,Math.min(this.$D,Ke.daysInMonth())).$d}else Ce&&this.$d[Ce](De);return this.init(),this},V.set=function(B,X){return this.clone().$set(B,X)},V.get=function(B){return this[te.p(B)]()},V.add=function(B,X){var Y,ie=this;B=Number(B);var ue=te.p(X),Ce=o(function(et){var wt=K(ie);return te.w(wt.date(wt.date()+Math.round(et*B)),ie)},"y");if(ue===m)return this.set(m,this.$M+B);if(ue===h)return this.set(h,this.$y+B);if(ue===d)return Ce(1);if(ue===p)return Ce(7);var De=(Y={},Y[s]=e,Y[c]=r,Y[i]=t,Y)[ue]||1,Ke=this.$d.getTime()+B*De;return te.w(Ke,this)},V.subtract=function(B,X){return this.add(-1*B,X)},V.format=function(B){var X=this,Y=this.$locale();if(!this.isValid())return Y.invalidDate||l;var ie=B||"YYYY-MM-DDTHH:mm:ssZ",ue=te.z(this),Ce=this.$H,De=this.$m,Ke=this.$M,et=Y.weekdays,wt=Y.months,ee=Y.meridiem,lt=o(function(We,Ye,S,P){return We&&(We[Ye]||We(X,ie))||S[Ye].slice(0,P)},"h"),mt=o(function(We){return te.s(Ce%12||12,We,"0")},"d"),Ht=ee||function(We,Ye,S){var P=We<12?"AM":"PM";return S?P.toLowerCase():P};return ie.replace(v,(function(We,Ye){return Ye||(function(S){switch(S){case"YY":return String(X.$y).slice(-2);case"YYYY":return te.s(X.$y,4,"0");case"M":return Ke+1;case"MM":return te.s(Ke+1,2,"0");case"MMM":return lt(Y.monthsShort,Ke,wt,3);case"MMMM":return lt(wt,Ke);case"D":return X.$D;case"DD":return te.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return lt(Y.weekdaysMin,X.$W,et,2);case"ddd":return lt(Y.weekdaysShort,X.$W,et,3);case"dddd":return et[X.$W];case"H":return String(Ce);case"HH":return te.s(Ce,2,"0");case"h":return mt(1);case"hh":return mt(2);case"a":return Ht(Ce,De,!0);case"A":return Ht(Ce,De,!1);case"m":return String(De);case"mm":return te.s(De,2,"0");case"s":return String(X.$s);case"ss":return te.s(X.$s,2,"0");case"SSS":return te.s(X.$ms,3,"0");case"Z":return ue}return null})(We)||ue.replace(":","")}))},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(B,X,Y){var ie,ue=this,Ce=te.p(X),De=K(B),Ke=(De.utcOffset()-this.utcOffset())*e,et=this-De,wt=o(function(){return te.m(ue,De)},"D");switch(Ce){case h:ie=wt()/12;break;case m:ie=wt();break;case y:ie=wt()/3;break;case p:ie=(et-Ke)/6048e5;break;case d:ie=(et-Ke)/864e5;break;case c:ie=et/r;break;case s:ie=et/e;break;case i:ie=et/t;break;default:ie=et}return Y?ie:te.a(ie)},V.daysInMonth=function(){return this.endOf(m).$D},V.$locale=function(){return J[this.$L]},V.locale=function(B,X){if(!B)return this.$L;var Y=this.clone(),ie=H(B,X,!0);return ie&&(Y.$L=ie),Y},V.clone=function(){return te.w(this.$d,this)},V.toDate=function(){return new Date(this.valueOf())},V.toJSON=function(){return this.isValid()?this.toISOString():null},V.toISOString=function(){return this.$d.toISOString()},V.toString=function(){return this.$d.toUTCString()},re})(),xe=Q.prototype;return K.prototype=xe,[["$ms",n],["$s",i],["$m",s],["$H",c],["$W",d],["$M",m],["$y",h],["$D",f]].forEach((function(re){xe[re[1]]=function(V){return this.$g(V,re[0],re[1])}})),K.extend=function(re,V){return re.$i||(re(V,Q,K),re.$i=!0),K},K.locale=H,K.isDayjs=W,K.unix=function(re){return K(1e3*re)},K.en=J[U],K.Ls=J,K.p={},K}))});var GT=D(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.getAPI=VU;function VU(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(VU,"getAPI")});var WT=D((xQ,HT)=>{HT.exports=require("util").inspect});var Wa=D((AQ,fP)=>{var hm=typeof Map=="function"&&Map.prototype,am=Object.getOwnPropertyDescriptor&&hm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Rc=hm&&am&&typeof am.get=="function"?am.get:null,ZT=hm&&Map.prototype.forEach,gm=typeof Set=="function"&&Set.prototype,sm=Object.getOwnPropertyDescriptor&&gm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Cc=gm&&sm&&typeof sm.get=="function"?sm.get:null,KT=gm&&Set.prototype.forEach,GU=typeof WeakMap=="function"&&WeakMap.prototype,Va=GU?WeakMap.prototype.has:null,HU=typeof WeakSet=="function"&&WeakSet.prototype,Ga=HU?WeakSet.prototype.has:null,WU=typeof WeakRef=="function"&&WeakRef.prototype,JT=WU?WeakRef.prototype.deref:null,ZU=Boolean.prototype.valueOf,KU=Object.prototype.toString,JU=Function.prototype.toString,YU=String.prototype.match,ym=String.prototype.slice,Qn=String.prototype.replace,XU=String.prototype.toUpperCase,YT=String.prototype.toLowerCase,aP=RegExp.prototype.test,XT=Array.prototype.concat,Xr=Array.prototype.join,QU=Array.prototype.slice,QT=Math.floor,lm=typeof BigInt=="function"?BigInt.prototype.valueOf:null,um=Object.getOwnPropertySymbols,dm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ai=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ha=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ai||!0)?Symbol.toStringTag:null,sP=Object.prototype.propertyIsEnumerable,eP=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function tP(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||aP.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-QT(-t):QT(t);if(n!==t){var i=String(n),s=ym.call(e,i.length+1);return Qn.call(i,r,"$&_")+"."+Qn.call(Qn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Qn.call(e,r,"$&_")}o(tP,"addNumericSeparator");var pm=WT(),rP=pm.custom,nP=lP(rP)?rP:null,uP={__proto__:null,double:'"',single:"'"},eM={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};fP.exports=o(function t(e,r,n,i){var s=r||{};if(wn(s,"quoteStyle")&&!wn(uP,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(wn(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=wn(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(wn(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(wn(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 pP(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var p=String(e);return d?tP(e,p):p}if(typeof e=="bigint"){var m=String(e)+"n";return d?tP(e,m):m}var y=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=y&&y>0&&typeof e=="object")return fm(e)?"[Array]":"[Object]";var h=vM(s,n);if(typeof i>"u")i=[];else if(dP(i,e)>=0)return"[Circular]";function f(B,X,Y){if(X&&(i=QU.call(i),i.push(X)),Y){var ie={depth:s.depth};return wn(s,"quoteStyle")&&(ie.quoteStyle=s.quoteStyle),t(B,ie,n+1,i)}return t(B,s,n+1,i)}if(o(f,"inspect"),typeof e=="function"&&!oP(e)){var l=cM(e),g=Ic(e,f);return"[Function"+(l?": "+l:" (anonymous)")+"]"+(g.length>0?" { "+Xr.call(g,", ")+" }":"")}if(lP(e)){var v=Ai?Qn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):dm.call(e);return typeof e=="object"&&!Ai?Ba(v):v}if(hM(e)){for(var E="<"+YT.call(String(e.nodeName)),b=e.attributes||[],C=0;C<b.length;C++)E+=" "+b[C].name+"="+cP(tM(b[C].value),"double",s);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+YT.call(String(e.nodeName))+">",E}if(fm(e)){if(e.length===0)return"[]";var U=Ic(e,f);return h&&!yM(U)?"["+mm(U,h)+"]":"[ "+Xr.call(U,", ")+" ]"}if(nM(e)){var J=Ic(e,f);return!("cause"in Error.prototype)&&"cause"in e&&!sP.call(e,"cause")?"{ ["+String(e)+"] "+Xr.call(XT.call("[cause]: "+f(e.cause),J),", ")+" }":J.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Xr.call(J,", ")+" }"}if(typeof e=="object"&&c){if(nP&&typeof e[nP]=="function"&&pm)return pm(e,{depth:y-n});if(c!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(lM(e)){var W=[];return ZT&&ZT.call(e,function(B,X){W.push(f(X,e,!0)+" => "+f(B,e))}),iP("Map",Rc.call(e),W,h)}if(fM(e)){var H=[];return KT&&KT.call(e,function(B){H.push(f(B,e))}),iP("Set",Cc.call(e),H,h)}if(dM(e))return cm("WeakMap");if(mM(e))return cm("WeakSet");if(pM(e))return cm("WeakRef");if(iM(e))return Ba(f(Number(e)));if(sM(e))return Ba(f(lm.call(e)));if(aM(e))return Ba(ZU.call(e));if(oM(e))return Ba(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(!rM(e)&&!oP(e)){var K=Ic(e,f),te=eP?eP(e)===Object.prototype:e instanceof Object||e.constructor===Object,Q=e instanceof Object?"":"null prototype",xe=!te&&Ha&&Object(e)===e&&Ha in e?ym.call(eo(e),8,-1):Q?"Object":"",re=te||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",V=re+(xe||Q?"["+Xr.call(XT.call([],xe||[],Q||[]),": ")+"] ":"");return K.length===0?V+"{}":h?V+"{"+mm(K,h)+"}":V+"{ "+Xr.call(K,", ")+" }"}return String(e)},"inspect_");function cP(t,e,r){var n=r.quoteStyle||e,i=uP[n];return i+t+i}o(cP,"wrapQuotes");function tM(t){return Qn.call(String(t),/"/g,""")}o(tM,"quote");function Po(t){return!Ha||!(typeof t=="object"&&(Ha in t||typeof t[Ha]<"u"))}o(Po,"canTrustToString");function fm(t){return eo(t)==="[object Array]"&&Po(t)}o(fm,"isArray");function rM(t){return eo(t)==="[object Date]"&&Po(t)}o(rM,"isDate");function oP(t){return eo(t)==="[object RegExp]"&&Po(t)}o(oP,"isRegExp");function nM(t){return eo(t)==="[object Error]"&&Po(t)}o(nM,"isError");function oM(t){return eo(t)==="[object String]"&&Po(t)}o(oM,"isString");function iM(t){return eo(t)==="[object Number]"&&Po(t)}o(iM,"isNumber");function aM(t){return eo(t)==="[object Boolean]"&&Po(t)}o(aM,"isBoolean");function lP(t){if(Ai)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!dm)return!1;try{return dm.call(t),!0}catch{}return!1}o(lP,"isSymbol");function sM(t){if(!t||typeof t!="object"||!lm)return!1;try{return lm.call(t),!0}catch{}return!1}o(sM,"isBigInt");var uM=Object.prototype.hasOwnProperty||function(t){return t in this};function wn(t,e){return uM.call(t,e)}o(wn,"has");function eo(t){return KU.call(t)}o(eo,"toStr");function cM(t){if(t.name)return t.name;var e=YU.call(JU.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(cM,"nameOf");function dP(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(dP,"indexOf");function lM(t){if(!Rc||!t||typeof t!="object")return!1;try{Rc.call(t);try{Cc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(lM,"isMap");function dM(t){if(!Va||!t||typeof t!="object")return!1;try{Va.call(t,Va);try{Ga.call(t,Ga)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(dM,"isWeakMap");function pM(t){if(!JT||!t||typeof t!="object")return!1;try{return JT.call(t),!0}catch{}return!1}o(pM,"isWeakRef");function fM(t){if(!Cc||!t||typeof t!="object")return!1;try{Cc.call(t);try{Rc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(fM,"isSet");function mM(t){if(!Ga||!t||typeof t!="object")return!1;try{Ga.call(t,Ga);try{Va.call(t,Va)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(mM,"isWeakSet");function hM(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(hM,"isElement");function pP(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return pP(ym.call(t,0,e.maxStringLength),e)+n}var i=eM[e.quoteStyle||"single"];i.lastIndex=0;var s=Qn.call(Qn.call(t,i,"\\$1"),/[\x00-\x1f]/g,gM);return cP(s,"single",e)}o(pP,"inspectString");function gM(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":"")+XU.call(e.toString(16))}o(gM,"lowbyte");function Ba(t){return"Object("+t+")"}o(Ba,"markBoxed");function cm(t){return t+" { ? }"}o(cm,"weakCollectionOf");function iP(t,e,r,n){var i=n?mm(r,n):Xr.call(r,", ");return t+" ("+e+") {"+i+"}"}o(iP,"collectionOf");function yM(t){for(var e=0;e<t.length;e++)if(dP(t[e],`
|
|
56
|
+
`)>=0)return!1;return!0}o(yM,"singleLineValues");function vM(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Xr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Xr.call(Array(e+1),r)}}o(vM,"getIndent");function mm(t,e){if(t.length===0)return"";var r=`
|
|
57
|
+
`+e.prev+e.base;return r+Xr.call(t,","+r)+`
|
|
58
|
+
`+e.prev}o(mm,"indentedJoin");function Ic(t,e){var r=fm(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=wn(t,i)?e(t[i],t):""}var s=typeof um=="function"?um(t):[],c;if(Ai){c={};for(var d=0;d<s.length;d++)c["$"+s[d]]=s[d]}for(var p in t)wn(t,p)&&(r&&String(Number(p))===p&&p<t.length||Ai&&c["$"+p]instanceof Symbol||(aP.call(/[^\w$]/,p)?n.push(e(p,t)+": "+e(t[p],t)):n.push(p+": "+e(t[p],t))));if(typeof um=="function")for(var m=0;m<s.length;m++)sP.call(t,s[m])&&n.push("["+e(s[m])+"]: "+e(t[s[m]],t));return n}o(Ic,"arrObjKeys")});var hP=D((RQ,mP)=>{"use strict";var _M=Wa(),bM=Bn(),Oc=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"),EM=o(function(t,e){if(t){var r=Oc(t,e);return r&&r.value}},"listGet"),SM=o(function(t,e,r){var n=Oc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),wM=o(function(t,e){return t?!!Oc(t,e):!1},"listHas"),TM=o(function(t,e){if(t)return Oc(t,e,!0)},"listDelete");mP.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new bM("Side channel does not contain "+_M(n))},"assert"),delete:o(function(n){var i=TM(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return EM(e,n)},"get"),has:o(function(n){return wM(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),SM(e,n,i)},"set")};return r},"getSideChannelList")});var vm=D((OQ,vP)=>{"use strict";var gP=ca(),yP=xd(),PM=yP([gP("%String.prototype.indexOf%")]);vP.exports=o(function(e,r){var n=gP(e,!!r);return typeof n=="function"&&PM(e,".prototype.")>-1?yP([n]):n},"callBoundIntrinsic")});var _m=D(($Q,bP)=>{"use strict";var xM=ca(),Za=vm(),AM=Wa(),IM=Bn(),_P=xM("%Map%",!0),RM=Za("Map.prototype.get",!0),CM=Za("Map.prototype.set",!0),OM=Za("Map.prototype.has",!0),kM=Za("Map.prototype.delete",!0),$M=Za("Map.prototype.size",!0);bP.exports=!!_P&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new IM("Side channel does not contain "+AM(n))},"assert"),delete:o(function(n){if(e){var i=kM(e,n);return $M(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return RM(e,n)},"get"),has:o(function(n){return e?OM(e,n):!1},"has"),set:o(function(n,i){e||(e=new _P),CM(e,n,i)},"set")};return r},"getSideChannelMap")});var SP=D((NQ,EP)=>{"use strict";var DM=ca(),$c=vm(),NM=Wa(),kc=_m(),zM=Bn(),Ii=DM("%WeakMap%",!0),UM=$c("WeakMap.prototype.get",!0),MM=$c("WeakMap.prototype.set",!0),LM=$c("WeakMap.prototype.has",!0),jM=$c("WeakMap.prototype.delete",!0);EP.exports=Ii?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new zM("Side channel does not contain "+NM(i))},"assert"),delete:o(function(i){if(Ii&&i&&(typeof i=="object"||typeof i=="function")){if(e)return jM(e,i)}else if(kc&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return Ii&&i&&(typeof i=="object"||typeof i=="function")&&e?UM(e,i):r&&r.get(i)},"get"),has:o(function(i){return Ii&&i&&(typeof i=="object"||typeof i=="function")&&e?LM(e,i):!!r&&r.has(i)},"has"),set:o(function(i,s){Ii&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Ii),MM(e,i,s)):kc&&(r||(r=kc()),r.set(i,s))},"set")};return n},"getSideChannelWeakMap"):kc});var bm=D((UQ,wP)=>{"use strict";var FM=Bn(),qM=Wa(),BM=hP(),VM=_m(),GM=SP(),HM=GM||VM||BM;wP.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new FM("Side channel does not contain "+qM(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=HM()),e.set(n,i)},"set")};return r},"getSideChannel")});var Dc=D((LQ,TP)=>{"use strict";var WM=String.prototype.replace,ZM=/%20/g,Em={RFC1738:"RFC1738",RFC3986:"RFC3986"};TP.exports={default:Em.RFC3986,formatters:{RFC1738:o(function(t){return WM.call(t,ZM,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:Em.RFC1738,RFC3986:Em.RFC3986}});var Pm=D((FQ,PP)=>{"use strict";var KM=Dc(),JM=bm(),Sm=Object.prototype.hasOwnProperty,xo=Array.isArray,Nc=JM(),Ri=o(function(e,r){return Nc.set(e,r),e},"markOverflow"),Ao=o(function(e){return Nc.has(e)},"isOverflow"),Ka=o(function(e){return Nc.get(e)},"getMaxIndex"),Tm=o(function(e,r){Nc.set(e,r)},"setMaxIndex"),Qr=(function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t})(),YM=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(xo(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"),Ja=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"),XM=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(xo(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return Ri(Ja(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(Ao(e)){var s=Ka(e)+1;e[s]=r,Tm(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!Sm.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(Ao(r)){for(var c=Object.keys(r),d=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},p=0;p<c.length;p++){var m=parseInt(c[p],10);d[m+1]=r[c[p]]}return Ri(d,Ka(r)+1)}var y=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&y.length>n.arrayLimit?Ri(Ja(y,n),y.length-1):y}var h=e;return xo(e)&&!xo(r)&&(h=Ja(e,n)),xo(e)&&xo(r)?(r.forEach(function(f,l){if(Sm.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(Sm.call(f,l)?f[l]=t(f[l],g,n):f[l]=g,Ao(r)&&!Ao(f)&&Ri(f,Ka(r)),Ao(f)){var v=parseInt(l,10);String(v)===l&&v>=0&&v>Ka(f)&&Tm(f,v)}return f},h)},"merge"),QM=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),e1=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"),wm=1024,t1=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+=wm){for(var m=c.length>=wm?c.slice(p,p+wm):c,y=[],h=0;h<m.length;++h){var f=m.charCodeAt(h);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||s===KM.RFC1738&&(f===40||f===41)){y[y.length]=m.charAt(h);continue}if(f<128){y[y.length]=Qr[f];continue}if(f<2048){y[y.length]=Qr[192|f>>6]+Qr[128|f&63];continue}if(f<55296||f>=57344){y[y.length]=Qr[224|f>>12]+Qr[128|f>>6&63]+Qr[128|f&63];continue}h+=1,f=65536+((f&1023)<<10|m.charCodeAt(h)&1023),y[y.length]=Qr[240|f>>18]+Qr[128|f>>12&63]+Qr[128|f>>6&63]+Qr[128|f&63]}d+=y.join("")}return d},"encode"),r1=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 m=d[p],y=c[m];typeof y=="object"&&y!==null&&n.indexOf(y)===-1&&(r[r.length]={obj:c,prop:m},n[n.length]=y)}return YM(r),e},"compact"),n1=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),o1=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),i1=o(function(e,r,n,i){if(Ao(e)){var s=Ka(e)+1;return e[s]=r,Tm(e,s),e}var c=[].concat(e,r);return c.length>n?Ri(Ja(c,{plainObjects:i}),c.length-1):c},"combine"),a1=o(function(e,r){if(xo(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");PP.exports={arrayToObject:Ja,assign:QM,combine:i1,compact:r1,decode:e1,encode:t1,isBuffer:o1,isOverflow:Ao,isRegExp:n1,markOverflow:Ri,maybeMap:a1,merge:XM}});var OP=D((BQ,CP)=>{"use strict";var AP=bm(),zc=Pm(),Ya=Dc(),s1=Object.prototype.hasOwnProperty,IP={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")},en=Array.isArray,u1=Array.prototype.push,RP=o(function(t,e){u1.apply(t,en(e)?e:[e])},"pushToArray"),c1=Date.prototype.toISOString,xP=Ya.default,St={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:zc.encode,encodeValuesOnly:!1,filter:void 0,format:xP,formatter:Ya.formatters[xP],indices:!1,serializeDate:o(function(e){return c1.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},l1=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),xm={},d1=o(function t(e,r,n,i,s,c,d,p,m,y,h,f,l,g,v,E,b,C){for(var U=e,J=C,W=0,H=!1;(J=J.get(xm))!==void 0&&!H;){var K=J.get(e);if(W+=1,typeof K<"u"){if(K===W)throw new RangeError("Cyclic object value");H=!0}typeof J.get(xm)>"u"&&(W=0)}if(typeof y=="function"?U=y(r,U):U instanceof Date?U=l(U):n==="comma"&&en(U)&&(U=zc.maybeMap(U,function(Ke){return Ke instanceof Date?l(Ke):Ke})),U===null){if(c)return m&&!E?m(r,St.encoder,b,"key",g):r;U=""}if(l1(U)||zc.isBuffer(U)){if(m){var te=E?r:m(r,St.encoder,b,"key",g);return[v(te)+"="+v(m(U,St.encoder,b,"value",g))]}return[v(r)+"="+v(String(U))]}var Q=[];if(typeof U>"u")return Q;var xe;if(n==="comma"&&en(U))E&&m&&(U=zc.maybeMap(U,m)),xe=[{value:U.length>0?U.join(",")||null:void 0}];else if(en(y))xe=y;else{var re=Object.keys(U);xe=h?re.sort(h):re}var V=p?String(r).replace(/\./g,"%2E"):String(r),B=i&&en(U)&&U.length===1?V+"[]":V;if(s&&en(U)&&U.length===0)return B+"[]";for(var X=0;X<xe.length;++X){var Y=xe[X],ie=typeof Y=="object"&&Y&&typeof Y.value<"u"?Y.value:U[Y];if(!(d&&ie===null)){var ue=f&&p?String(Y).replace(/\./g,"%2E"):String(Y),Ce=en(U)?typeof n=="function"?n(B,ue):B:B+(f?"."+ue:"["+ue+"]");C.set(e,W);var De=AP();De.set(xm,C),RP(Q,t(ie,Ce,n,i,s,c,d,p,n==="comma"&&E&&en(U)?null:m,y,h,f,l,g,v,E,b,De))}}return Q},"stringify"),p1=o(function(e){if(!e)return St;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.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||St.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=Ya.default;if(typeof e.format<"u"){if(!s1.call(Ya.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Ya.formatters[n],s=St.filter;(typeof e.filter=="function"||en(e.filter))&&(s=e.filter);var c;if(e.arrayFormat in IP?c=e.arrayFormat:"indices"in e?c=e.indices?"indices":"repeat":c=St.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:St.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:St.addQueryPrefix,allowDots:d,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:St.allowEmptyArrays,arrayFormat:c,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:St.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?St.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:St.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:St.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:St.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:St.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:St.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:St.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:St.strictNullHandling}},"normalizeStringifyOptions");CP.exports=function(t,e){var r=t,n=p1(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):en(n.filter)&&(s=n.filter,i=s);var c=[];if(typeof r!="object"||r===null)return"";var d=IP[n.arrayFormat],p=d==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var m=AP(),y=0;y<i.length;++y){var h=i[y],f=r[h];n.skipNulls&&f===null||RP(c,d1(f,h,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,m))}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 DP=D((GQ,$P)=>{"use strict";var tn=Pm(),Uc=Object.prototype.hasOwnProperty,Am=Array.isArray,ct={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:tn.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},f1=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),kP=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"),m1="utf8=%26%2310003%3B",h1="utf8=%E2%9C%93",g1=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,m=r.charset;if(r.charsetSentinel)for(p=0;p<c.length;++p)c[p].indexOf("utf8=")===0&&(c[p]===h1?m="utf-8":c[p]===m1&&(m="iso-8859-1"),d=p,p=c.length);for(p=0;p<c.length;++p)if(p!==d){var y=c[p],h=y.indexOf("]="),f=h===-1?y.indexOf("="):h+1,l,g;if(f===-1?(l=r.decoder(y,ct.decoder,m,"key"),g=r.strictNullHandling?null:""):(l=r.decoder(y.slice(0,f),ct.decoder,m,"key"),l!==null&&(g=tn.maybeMap(kP(y.slice(f+1),r,Am(n[l])?n[l].length:0),function(E){return r.decoder(E,ct.decoder,m,"value")}))),g&&r.interpretNumericEntities&&m==="iso-8859-1"&&(g=f1(String(g))),y.indexOf("[]=")>-1&&(g=Am(g)?[g]:g),r.comma&&Am(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=tn.combine([],g,r.arrayLimit,r.plainObjects)}if(l!==null){var v=Uc.call(n,l);v&&(r.duplicates==="combine"||y.indexOf("[]=")>-1)?n[l]=tn.combine(n[l],g,r.arrayLimit,r.plainObjects):(!v||r.duplicates==="last")&&(n[l]=g)}}return n},"parseQueryStringValues"),y1=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:kP(e,r,i),d=t.length-1;d>=0;--d){var p,m=t[d];if(m==="[]"&&r.parseArrays)tn.isOverflow(c)?p=c:p=r.allowEmptyArrays&&(c===""||r.strictNullHandling&&c===null)?[]:tn.combine([],c,r.arrayLimit,r.plainObjects);else{p=r.plainObjects?{__proto__:null}:{};var y=m.charAt(0)==="["&&m.charAt(m.length-1)==="]"?m.slice(1,-1):m,h=r.decodeDotInKeys?y.replace(/%2E/g,"."):y,f=parseInt(h,10),l=!isNaN(f)&&m!==h&&String(f)===h&&f>=0&&r.parseArrays;if(!r.parseArrays&&h==="")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,tn.markOverflow(p,f)):h!=="__proto__"&&(p[h]=c)}}c=p}return c},"parseObject"),v1=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&Uc.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&&Uc.call(Object.prototype,d)&&!r.allowPrototypes)return;p[p.length]=d}for(var m=0;(c=s.exec(n))!==null&&m<r.depth;){m+=1;var y=c[1].slice(1,-1);if(!r.plainObjects&&Uc.call(Object.prototype,y)&&!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"),_1=o(function(e,r,n,i){if(e){var s=v1(e,n);if(s)return y1(s,r,n,i)}},"parseQueryStringKeys"),b1=o(function(e){if(!e)return ct;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"?ct.charset:e.charset,n=typeof e.duplicates>"u"?ct.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:ct.allowDots:!!e.allowDots;return{allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ct.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:ct.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:ct.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:ct.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ct.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:ct.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:ct.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:ct.decoder,delimiter:typeof e.delimiter=="string"||tn.isRegExp(e.delimiter)?e.delimiter:ct.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:ct.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:ct.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:ct.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:ct.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:ct.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:ct.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ct.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");$P.exports=function(t,e){var r=b1(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?g1(t,r):t,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),c=0;c<s.length;++c){var d=s[c],p=_1(d,n[d],r,typeof t=="string");i=tn.merge(i,p,r)}return r.allowSparse===!0?i:tn.compact(i)}});var Im=D((WQ,NP)=>{"use strict";var E1=OP(),S1=DP(),w1=Dc();NP.exports={formats:w1,parse:S1,stringify:E1}});var UP=D((Rm,zP)=>{(function(t,e){typeof Rm=="object"?zP.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(Rm,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,m=[];if(n.indexOf(c.charAt(0))!==-1&&(p=c.charAt(0),c=c.substr(1)),c.split(/,/g).forEach(function(h){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(h);m.push.apply(m,r.getValues(i,p,f[1],f[2]||f[3]))}),p&&p!=="+"){var y=",";return p==="?"?y="&":p!=="#"&&(y=p),(m.length!==0?p:"")+m.join(y)}else return m.join(",")}else return r.encodeReserved(d)})},"expand")}},new t})});var MP=D(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.isBrowser=T1;function T1(){return typeof window<"u"}o(T1,"isBrowser")});var Lc=D(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.headersToClassicHeaders=LP;Mc.marshallGaxiosResponse=P1;function LP(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(LP,"headersToClassicHeaders");function P1(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:LP(t?.headers)}})}o(P1,"marshallGaxiosResponse")});var qP=D(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.sessions=void 0;ur.request=M1;ur.closeSession=Om;var FP=require("http2"),x1=require("zlib"),A1=require("url"),I1=Im(),R1=da(),C1=require("stream"),O1=require("util"),k1=require("process"),$1=Lc(),{HTTP2_HEADER_CONTENT_ENCODING:D1,HTTP2_HEADER_CONTENT_TYPE:jP,HTTP2_HEADER_METHOD:N1,HTTP2_HEADER_PATH:z1,HTTP2_HEADER_STATUS:U1}=FP.constants,Xa=!!k1.env.HTTP2_DEBUG;ur.sessions={};async function M1(t){let e=R1(!0,{},t);e.validateStatus=e.validateStatus||L1,e.responseType=e.responseType||"json";let r=new A1.URL(e.url),n=j1(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let h=(t.paramsSerializer||I1.stringify)(e.params);i+=`?${h}`}let s=(0,$1.headersToClassicHeaders)(e.headers);s[z1]=i,s[N1]=t.method||"GET",e.headers=s,s[jP]||e.responseType!=="text"&&(s[jP]="application/json");let c={config:t,headers:{},status:0,data:{},statusText:""},d=[],p=n.session,m;return new Promise((y,h)=>{try{m=p.request(s).on("response",f=>{Object.assign(c,{headers:f,status:f[U1]});let l=m;if(f[D1]==="gzip"&&(l=m.pipe(x1.createGunzip())),e.responseType==="stream"){c.data=l,y(c);return}l.on("data",g=>{d.push(g)}).on("error",g=>{h(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 E=`Request failed with status code ${c.status}. `;if(c.data&&typeof c.data=="object"){let b=O1.inspect(c.data,{depth:5});E=`${E}
|
|
59
|
+
'${b}`}h(new Error(E,{cause:c}))}y(c)})}).on("error",f=>{h(f)})}catch(f){Om(r).then(()=>h(f)).catch(h);return}if(c.request=m,t.data){if(t.data instanceof C1.Stream)t.data.pipe(m);else if(typeof t.data=="string"){let f=Buffer.from(t.data);m.end(f)}else if(typeof t.data=="object"){let f=JSON.stringify(t.data);m.end(f)}}n.timeoutHandle=setTimeout(()=>Om(r),500)})}o(M1,"request");function L1(t){return t>=200&&t<300}o(L1,"validateStatus");function j1(t){if(ur.sessions[t])Xa&&console.log(`Used cached client for ${t}`);else{Xa&&console.log(`Creating client for ${t}`);let e=FP.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete ur.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete ur.sessions[t]}),ur.sessions[t]={session:e}}return ur.sessions[t]}o(j1,"_getClient");async function Om(t){let e=ur.sessions[t.host];if(!e)return;let{session:r}=e;delete ur.sessions[t.host],Xa&&console.error(`Closing ${t.host}`),r.close(()=>{Xa&&console.error(`Closed ${t.host}`)}),setTimeout(()=>{r&&!r.destroyed&&(Xa&&console.log(`Forcing close ${t.host}`),r&&r.destroy())},1e3)}o(Om,"closeSession")});var BP=D((tee,F1)=>{F1.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 jc=D(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});zm.createAPIRequest=H1;var km=ht(),q1=Im(),ZP=require("stream"),VP=UP(),GP=da(),Dm=MP(),B1=qP(),$m=Lc(),KP=BP(),HP=o(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function V1(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}o(V1,"isReadableStream");function G1(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}o(G1,"getMissingParams");function H1(t,e){if(e)WP(t).then(r=>e(null,r),e);else return WP(t)}o(H1,"createAPIRequest");async function WP(t){let e=GP(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=GP(!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,$m.headersToClassicHeaders)(r.headers||{});W1(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=G1(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=VP.parse(l).expand(r)}if(t.mediaUrl&&(t.mediaUrl=VP.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=>q1.stringify(l,{arrayFormat:"repeat"}),t.pathParams.forEach(l=>delete r[l]),typeof s=="string"&&(r.key=r.key||s,s=void 0);function m(l){let g=HP(),v=`--${g}--`,E=new ZP.PassThrough({flush(U){this.push(`\r
|
|
60
|
+
`),this.push(v),U()}}),b=new Nm,C=V1(l[1].body);d["content-type"]=`multipart/related; boundary=${g}`;for(let U of l){let J=`--${g}\r
|
|
61
|
+
content-type: ${U["content-type"]}\r
|
|
62
62
|
\r
|
|
63
|
-
`;
|
|
64
|
-
`)):(
|
|
65
|
-
content-type: ${
|
|
63
|
+
`;E.push(J),typeof U.body=="string"?(E.push(U.body),E.push(`\r
|
|
64
|
+
`)):(b.on("progress",W=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:W})}),U.body.pipe(b).pipe(E))}C||(E.push(v),E.push(null)),e.data=E}o(m,"multipartUpload");function y(l){let g=HP(),v=`--${g}--`;d["content-type"]=`multipart/related; boundary=${g}`;let E="";for(let b of l){let C=`--${g}\r
|
|
65
|
+
content-type: ${b["content-type"]}\r
|
|
66
66
|
\r
|
|
67
|
-
`;
|
|
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});
|
|
67
|
+
`;E+=C,typeof b.body=="string"&&(E+=b.body,E+=`\r
|
|
68
|
+
`)}E+=v,e.data=E}if(o(y,"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,Dm.isBrowser)()?y(l):m(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=km.Gaxios.mergeHeaders(e.headers||{},d),e.params=r,!(0,Dm.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:KP.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 h=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,f=e.universeDomain??e.universe_domain??h??"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=km.Gaxios.mergeHeaders(v.headers,g),B1.request(v)}else{let g=await s.request(e);return(0,$m.marshallGaxiosResponse)(g)}}else return new km.Gaxios().request(e).then(l=>(0,$m.marshallGaxiosResponse)(l))}o(WP,"createAPIRequestAsync");var Nm=class extends ZP.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 W1(t,e){(0,Dm.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${KP.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o(W1,"populateAPIHeader")});var JP=D(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.AuthPlus=void 0;var Tn=qa(),Um=class extends Tn.GoogleAuth{static{o(this,"AuthPlus")}JWT=Tn.JWT;Compute=Tn.Compute;OAuth2=Tn.OAuth2Client;GoogleAuth=Tn.GoogleAuth;AwsClient=Tn.AwsClient;IdentityPoolClient=Tn.IdentityPoolClient;ExternalAccountClient=Tn.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new Tn.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()}};Fc.AuthPlus=Um});var Lm=D(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.Endpoint=void 0;var YP=jc(),Mm=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=XP(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 m=XP(e.rootUrl+r.mediaUpload.protocols.simple.path);p.mediaUrl=m.substring(1,m.length-1)}if(!s)return(0,YP.createAPIRequest)(p);(0,YP.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}};qc.Endpoint=Mm;function XP(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(XP,"buildurl")});var ex=D(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.Discovery=void 0;var Z1=require("fs"),K1=ht(),J1=require("url"),QP=require("util"),Y1=jc(),X1=Lm(),Q1=QP.promisify(Z1.readFile),jm=class{static{o(this,"Discovery")}transporter=new K1.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new X1.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 m=await this.discoverAPI(p.discoveryRestUrl);return{api:p,endpointCreator:m}})),c={},d={};for(let p of s)d[p.api.name]||(c[p.api.name]={},d[p.api.name]=m=>{let y=typeof m,h;if(y==="string")h=m,m={};else if(y==="object")h=m.version,delete m.version;else throw new Error("Argument error: Accepts only string or object");try{let f=p.endpointCreator(m,this);return Object.freeze(f)}catch(f){throw new Error(QP.format('Unable to load endpoint %s("%s"): %s',p.api.name,h,f.message))}}),c[p.api.name][p.api.version]=p.endpointCreator;return d}async discoverAPI(e){if(typeof e=="string"){let r=J1.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await Q1(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,Y1.createAPIRequest)(i);return this.makeEndpoint(s.data)}}};Bc.Discovery=jm});var Vc=D(Re=>{"use strict";var eL=Re&&Re.__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]})),tL=Re&&Re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eL(e,t,r)};Object.defineProperty(Re,"__esModule",{value:!0});Re.Endpoint=Re.Discovery=Re.AuthPlus=Re.createAPIRequest=Re.getAPI=Re.GaxiosError=Re.Gaxios=Re.AwsClient=Re.IdentityPoolClient=Re.BaseExternalAccountClient=Re.ExternalAccountClient=Re.GoogleAuth=Re.UserRefreshClient=Re.Compute=Re.JWT=Re.OAuth2Client=Re.gaxios=Re.googleAuthLibrary=void 0;Re.googleAuthLibrary=qa();Re.gaxios=ht();var Pn=qa();Object.defineProperty(Re,"OAuth2Client",{enumerable:!0,get:o(function(){return Pn.OAuth2Client},"get")});Object.defineProperty(Re,"JWT",{enumerable:!0,get:o(function(){return Pn.JWT},"get")});Object.defineProperty(Re,"Compute",{enumerable:!0,get:o(function(){return Pn.Compute},"get")});Object.defineProperty(Re,"UserRefreshClient",{enumerable:!0,get:o(function(){return Pn.UserRefreshClient},"get")});Object.defineProperty(Re,"GoogleAuth",{enumerable:!0,get:o(function(){return Pn.GoogleAuth},"get")});Object.defineProperty(Re,"ExternalAccountClient",{enumerable:!0,get:o(function(){return Pn.ExternalAccountClient},"get")});Object.defineProperty(Re,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return Pn.BaseExternalAccountClient},"get")});Object.defineProperty(Re,"IdentityPoolClient",{enumerable:!0,get:o(function(){return Pn.IdentityPoolClient},"get")});Object.defineProperty(Re,"AwsClient",{enumerable:!0,get:o(function(){return Pn.AwsClient},"get")});var tx=ht();Object.defineProperty(Re,"Gaxios",{enumerable:!0,get:o(function(){return tx.Gaxios},"get")});Object.defineProperty(Re,"GaxiosError",{enumerable:!0,get:o(function(){return tx.GaxiosError},"get")});var rL=GT();Object.defineProperty(Re,"getAPI",{enumerable:!0,get:o(function(){return rL.getAPI},"get")});var nL=jc();Object.defineProperty(Re,"createAPIRequest",{enumerable:!0,get:o(function(){return nL.createAPIRequest},"get")});var oL=JP();Object.defineProperty(Re,"AuthPlus",{enumerable:!0,get:o(function(){return oL.AuthPlus},"get")});var iL=ex();Object.defineProperty(Re,"Discovery",{enumerable:!0,get:o(function(){return iL.Discovery},"get")});var aL=Lm();Object.defineProperty(Re,"Endpoint",{enumerable:!0,get:o(function(){return aL.Endpoint},"get")});tL(Lc(),Re)});var nx=D(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.calendar_v3=void 0;var oe=Vc(),rx;(function(t){class e{static{o(this,"Calendar")}context;acl;calendarList;calendars;channels;colors;events;freebusy;settings;constructor(h,f){this.context={_options:h||{},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 m(this.context)}}t.Calendar=e;class r{static{o(this,"Resource$Acl")}context;constructor(h){this.context=h}delete(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}insert(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}list(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}patch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}update(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}watch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Acl=r;class n{static{o(this,"Resource$Calendarlist")}context;constructor(h){this.context=h}delete(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}insert(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}list(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}patch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}update(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}watch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Calendarlist=n;class i{static{o(this,"Resource$Calendars")}context;constructor(h){this.context=h}clear(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/clear").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}delete(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}insert(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}patch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}update(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Calendars=i;class s{static{o(this,"Resource$Channels")}context;constructor(h){this.context=h}stop(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Channels=s;class c{static{o(this,"Resource$Colors")}context;constructor(h){this.context=h}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/colors").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Colors=c;class d{static{o(this,"Resource$Events")}context;constructor(h){this.context=h}delete(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}import(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}insert(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}instances(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}list(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}move(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}patch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}quickAdd(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}update(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}watch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Events=d;class p{static{o(this,"Resource$Freebusy")}context;constructor(h){this.context=h}query(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/freeBusy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Freebusy=p;class m{static{o(this,"Resource$Settings")}context;constructor(h){this.context=h}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/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,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}list(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/settings").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}watch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/settings/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Settings=m})(rx||(Gc.calendar_v3=rx={}))});var xn=D(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.AuthPlus=Er.calendar_v3=Er.auth=Er.VERSIONS=void 0;Er.calendar=sL;var ox=Vc(),ix=nx();Object.defineProperty(Er,"calendar_v3",{enumerable:!0,get:o(function(){return ix.calendar_v3},"get")});Er.VERSIONS={v3:ix.calendar_v3.Calendar};function sL(t){return(0,ox.getAPI)("calendar",t,Er.VERSIONS,this)}o(sL,"calendar");var uL=new ox.AuthPlus;Er.auth=uL;var cL=Vc();Object.defineProperty(Er,"AuthPlus",{enumerable:!0,get:o(function(){return cL.AuthPlus},"get")})});var kx=D((th,rh)=>{(function(t,e){typeof th=="object"&&typeof rh<"u"?rh.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_utc=e()})(th,(function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,s){var c=i.prototype;s.utc=function(l){var g={date:l,utc:!0,args:arguments};return new i(g)},c.utc=function(l){var g=s(this.toDate(),{locale:this.$L,utc:!0});return l?g.add(this.utcOffset(),t):g},c.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var d=c.parse;c.parse=function(l){l.utc&&(this.$u=!0),this.$utils().u(l.$offset)||(this.$offset=l.$offset),d.call(this,l)};var p=c.init;c.init=function(){if(this.$u){var l=this.$d;this.$y=l.getUTCFullYear(),this.$M=l.getUTCMonth(),this.$D=l.getUTCDate(),this.$W=l.getUTCDay(),this.$H=l.getUTCHours(),this.$m=l.getUTCMinutes(),this.$s=l.getUTCSeconds(),this.$ms=l.getUTCMilliseconds()}else p.call(this)};var m=c.utcOffset;c.utcOffset=function(l,g){var v=this.$utils().u;if(v(l))return this.$u?0:v(this.$offset)?m.call(this):this.$offset;if(typeof l=="string"&&(l=(function(U){U===void 0&&(U="");var J=U.match(e);if(!J)return null;var W=(""+J[0]).match(r)||["-",0,0],H=W[0],K=60*+W[1]+ +W[2];return K===0?0:H==="+"?K:-K})(l),l===null))return this;var E=Math.abs(l)<=16?60*l:l,b=this;if(g)return b.$offset=E,b.$u=l===0,b;if(l!==0){var C=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(b=this.local().add(E+C,t)).$offset=E,b.$x.$localOffset=C}else b=this.utc();return b};var y=c.format;c.format=function(l){var g=l||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,g)},c.valueOf=function(){var l=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*l},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var h=c.toDate;c.toDate=function(l){return l==="s"&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var f=c.diff;c.diff=function(l,g,v){if(l&&this.$u===l.$u)return f.call(this,l,g,v);var E=this.local(),b=s(l).local();return f.call(E,b,g,v)}}}))});var bL={};As(bL,{createGoogleClient:()=>_t,getAccessToken:()=>Ie,googleCalendar:()=>_L,googleCalendarAuth:()=>ne});module.exports=HI(bL);var WI=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 m=c.prototype,y=Object.keys(m);for(let h=0;h<y.length;h++){let f=y[h];f in d||(d[f]=m[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 m=r?.Parent?new s:this;n(m,d),(p=m._zod).deferred??(p.deferred=[]);for(let y of m._zod.deferred)y();return m}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 Mr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Is=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Rl={};function ln(t){return t&&Object.assign(Rl,t),Rl}o(ln,"config");function Ol(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(Ol,"getEnumValues");function fg(t,e){return typeof e=="bigint"?e.toString():e}o(fg,"jsonStringifyReplacer");function Cs(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Cs,"cached");function mg(t){return t==null}o(mg,"nullish");function Os(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(Os,"cleanRegex");var pg=Symbol("evaluating");function gt(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==pg)return n===void 0&&(n=pg,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(gt,"defineLazy");var kl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ji(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(ji,"isObject");var ZI=Cs(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function hg(t){if(ji(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(ji(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(hg,"isPlainObject");var gg=new Set(["string","number","symbol"]);function qo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(qo,"escapeRegex");function ks(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}o(ks,"clone");function st(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(st,"normalizeParams");function yg(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(yg,"optionalKeys");var vg={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 Bo(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(Bo,"aborted");function Nn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(Nn,"prefixIssues");function Rs(t){return typeof t=="string"?t:t?.message}o(Rs,"unwrapMessage");function zn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=Rs(t.inst?._zod.def?.error?.(t))??Rs(e?.error?.(t))??Rs(r.customError?.(t))??Rs(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(zn,"finalizeIssue");function _g(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(_g,"getLengthableOrigin");function $l(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o($l,"issue");var bg=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,fg,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),Eg=le("$ZodError",bg),Fi=le("$ZodError",bg,{Parent:Error});var JI=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 Mr;if(c.issues.length){let d=new(i?.Err??t)(c.issues.map(p=>zn(p,s,ln())));throw kl(d,i?.callee),d}return c.value},"_parse"),$s=JI(Fi),YI=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=>zn(p,s,ln())));throw kl(d,i?.callee),d}return c.value},"_parseAsync"),Ds=YI(Fi),XI=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 Mr;return s.issues.length?{success:!1,error:new(t??Eg)(s.issues.map(c=>zn(c,i,ln())))}:{success:!0,data:s.value}},"_safeParse"),qi=XI(Fi),QI=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=>zn(c,i,ln())))}:{success:!0,data:s.value}},"_safeParseAsync"),Bi=QI(Fi);var eR="(?:(?:\\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])))",tR=new RegExp(`^${eR}$`);var Sg=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),wg=/^-?\d+n?$/,Tg=/^-?\d+$/,Dl=/^-?\d+(?:\.\d+)?$/,Pg=/^(?:true|false)$/i;var Un=le("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),rR={number:"number",bigint:"bigint",object:"date"};var xg=le("$ZodCheckGreaterThan",(t,e)=>{Un.init(t,e);let r=rR[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}});var Ag=le("$ZodCheckNumberFormat",(t,e)=>{Un.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,s]=vg[e.format];t._zod.onattach.push(c=>{let d=c._zod.bag;d.format=e.format,d.minimum=i,d.maximum=s,r&&(d.pattern=Tg)}),t._zod.check=c=>{let d=c.value;if(r){if(!Number.isInteger(d)){c.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:d,inst:t});return}if(!Number.isSafeInteger(d)){d>0?c.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):c.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}d<i&&c.issues.push({origin:"number",input:d,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),d>s&&c.issues.push({origin:"number",input:d,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var Ig=le("$ZodCheckMinLength",(t,e)=>{var r;Un.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!mg(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=_g(i);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var Nl=le("$ZodCheckStringFormat",(t,e)=>{var r,n;Un.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=()=>{})}),Rg=le("$ZodCheckRegex",(t,e)=>{Nl.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 Og={major:4,minor:3,patch:6};var dt=le("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Og;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 m=Bo(c),y;for(let h of d){if(h._zod.def.when){if(!h._zod.def.when(c))continue}else if(m)continue;let f=c.issues.length,l=h._zod.check(c);if(l instanceof Promise&&p?.async===!1)throw new Mr;if(y||l instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await l,c.issues.length!==f&&(m||(m=Bo(c,f)))});else{if(c.issues.length===f)continue;m||(m=Bo(c,f))}}return y?y.then(()=>c):c},"runChecks"),s=o((c,d,p)=>{if(Bo(c))return c.aborted=!0,c;let m=i(d,n,p);if(m instanceof Promise){if(p.async===!1)throw new Mr;return m.then(y=>t._zod.parse(y,p))}return t._zod.parse(m,p)},"handleCanaryResult");t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){let m=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(y=>s(y,c,d)):s(m,c,d)}let p=t._zod.parse(c,d);if(p instanceof Promise){if(d.async===!1)throw new Mr;return p.then(m=>i(m,n,d))}return i(p,n,d)}}gt(t,"~standard",()=>({validate:o(i=>{try{let s=qi(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Bi(t,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Us=le("$ZodString",(t,e)=>{dt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Sg(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}}),zl=le("$ZodStringFormat",(t,e)=>{Nl.init(t,e),Us.init(t,e)});var zg=le("$ZodURL",(t,e)=>{zl.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 Ul=le("$ZodNumber",(t,e)=>{dt.init(t,e),t._zod.pattern=t._zod.bag.pattern??Dl,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}}),Ug=le("$ZodNumberFormat",(t,e)=>{Ag.init(t,e),Ul.init(t,e)}),Ml=le("$ZodBoolean",(t,e)=>{dt.init(t,e),t._zod.pattern=Pg,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}}),Mg=le("$ZodBigInt",(t,e)=>{dt.init(t,e),t._zod.pattern=wg,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)=>{dt.init(t,e),t._zod.parse=r=>r}),jg=le("$ZodUnknown",(t,e)=>{dt.init(t,e),t._zod.parse=r=>r});var Fg=le("$ZodVoid",(t,e)=>{dt.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}}),qg=le("$ZodDate",(t,e)=>{dt.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 kg(t,e,r){t.issues.length&&e.issues.push(...Nn(r,t.issues)),e.value[r]=t.value}o(kg,"handleArrayResult");var Bg=le("$ZodArray",(t,e)=>{dt.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(m=>kg(m,r,c))):kg(p,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function zs(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...Nn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(zs,"handlePropertyResult");function nR(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=yg(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(nR,"normalizeDef");function oR(t,e,r,n,i,s){let c=[],d=i.keySet,p=i.catchall._zod,m=p.def.type,y=p.optout==="optional";for(let h in e){if(d.has(h))continue;if(m==="never"){c.push(h);continue}let f=p.run({value:e[h],issues:[]},n);f instanceof Promise?t.push(f.then(l=>zs(l,r,h,e,y))):zs(f,r,h,e,y)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}o(oR,"handleCatchall");var Vg=le("$ZodObject",(t,e)=>{if(dt.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=Cs(()=>nR(e));gt(t._zod,"propValues",()=>{let d=e.shape,p={};for(let m in d){let y=d[m]._zod;if(y.values){p[m]??(p[m]=new Set);for(let h of y.values)p[m].add(h)}}return p});let i=ji,s=e.catchall,c;t._zod.parse=(d,p)=>{c??(c=n.value);let m=d.value;if(!i(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),d;d.value={};let y=[],h=c.shape;for(let f of c.keys){let l=h[f],g=l._zod.optout==="optional",v=l._zod.run({value:m[f],issues:[]},p);v instanceof Promise?y.push(v.then(E=>zs(E,d,f,m,g))):zs(v,d,f,m,g)}return s?oR(y,m,d,p,n.value,t):y.length?Promise.all(y).then(()=>d):d}});function $g(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=>!Bo(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=>zn(c,n,ln())))}),e)}o($g,"handleUnionResults");var Ll=le("$ZodUnion",(t,e)=>{dt.init(t,e),gt(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),gt(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),gt(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),gt(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=>Os(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 m=p._zod.run({value:i.value,issues:[]},s);if(m instanceof Promise)d.push(m),c=!0;else{if(m.issues.length===0)return m;d.push(m)}}return c?Promise.all(d).then(p=>$g(p,i,t,s)):$g(d,i,t,s)}});var Gg=le("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Ll.init(t,e);let r=t._zod.parse;gt(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 m of p)i[d].add(m)}}return i});let n=Cs(()=>{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(!ji(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 Hg=le("$ZodRecord",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!hg(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 m of c)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){d.add(typeof m=="number"?m.toString():m);let y=e.valueType._zod.run({value:i[m],issues:[]},n);y instanceof Promise?s.push(y.then(h=>{h.issues.length&&r.issues.push(...Nn(m,h.issues)),r.value[m]=h.value})):(y.issues.length&&r.issues.push(...Nn(m,y.issues)),r.value[m]=y.value)}let p;for(let m in i)d.has(m)||(p=p??[],p.push(m));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"&&Dl.test(d)&&p.issues.length){let h=e.keyType._zod.run({value:Number(d),issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(p=h)}if(p.issues.length){e.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(h=>zn(h,n,ln())),input:d,path:[d],inst:t});continue}let y=e.valueType._zod.run({value:i[d],issues:[]},n);y instanceof Promise?s.push(y.then(h=>{h.issues.length&&r.issues.push(...Nn(d,h.issues)),r.value[p.value]=h.value})):(y.issues.length&&r.issues.push(...Nn(d,y.issues)),r.value[p.value]=y.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Wg=le("$ZodEnum",(t,e)=>{dt.init(t,e);let r=Ol(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>gg.has(typeof i)).map(i=>typeof i=="string"?qo(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}}),Zg=le("$ZodLiteral",(t,e)=>{if(dt.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"?qo(n):n?qo(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 Kg=le("$ZodTransform",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Is(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 Mr;return r.value=i,r}});function Dg(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(Dg,"handleOptionalResult");var Jg=le("$ZodOptional",(t,e)=>{dt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",gt(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),gt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Os(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=>Dg(s,r.value)):Dg(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var Yg=le("$ZodNullable",(t,e)=>{dt.init(t,e),gt(t._zod,"optin",()=>e.innerType._zod.optin),gt(t._zod,"optout",()=>e.innerType._zod.optout),gt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Os(r.source)}|null)$`):void 0}),gt(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 Xg=le("$ZodPipe",(t,e)=>{dt.init(t,e),gt(t._zod,"values",()=>e.in._zod.values),gt(t._zod,"optin",()=>e.in._zod.optin),gt(t._zod,"optout",()=>e.out._zod.optout),gt(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=>Ns(c,e.in,n)):Ns(s,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Ns(s,e.out,n)):Ns(i,e.out,n)}});function Ns(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(Ns,"handlePipeResult");var Qg=le("$ZodCustom",(t,e)=>{Un.init(t,e),dt.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=>Ng(s,r,n,t));Ng(i,r,n,t)}});function Ng(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($l(i))}}o(Ng,"handleRefineResult");var ty;var jl=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 ry(){return new jl}o(ry,"registry");(ty=globalThis).__zod_globalRegistry??(ty.__zod_globalRegistry=ry());var Fl=globalThis.__zod_globalRegistry;function ny(t,e){return new t({type:"string",...st(e)})}o(ny,"_string");function oy(t,e){return new t({type:"string",coerce:!0,...st(e)})}o(oy,"_coercedString");function iy(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...st(e)})}o(iy,"_url");function ay(t,e){return new t({type:"number",checks:[],...st(e)})}o(ay,"_number");function sy(t,e){return new t({type:"number",coerce:!0,checks:[],...st(e)})}o(sy,"_coercedNumber");function uy(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...st(e)})}o(uy,"_int");function cy(t,e){return new t({type:"boolean",...st(e)})}o(cy,"_boolean");function ly(t,e){return new t({type:"boolean",coerce:!0,...st(e)})}o(ly,"_coercedBoolean");function dy(t,e){return new t({type:"bigint",coerce:!0,...st(e)})}o(dy,"_coercedBigint");function py(t){return new t({type:"any"})}o(py,"_any");function fy(t){return new t({type:"unknown"})}o(fy,"_unknown");function my(t,e){return new t({type:"void",...st(e)})}o(my,"_void");function hy(t,e){return new t({type:"date",coerce:!0,...st(e)})}o(hy,"_coercedDate");function Ms(t,e){return new xg({check:"greater_than",...st(e),value:t,inclusive:!0})}o(Ms,"_gte");function xr(t,e){return new Ig({check:"min_length",...st(e),minimum:t})}o(xr,"_minLength");function Mn(t,e){return new Rg({check:"string_format",format:"regex",...st(e),pattern:t})}o(Mn,"_regex");function gy(t,e,r){let n=st(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(gy,"_custom");var yt=le("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");dt.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>$s(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>qi(t,r,n),t.parseAsync=async(r,n)=>Ds(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Bi(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)=>ks(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),js=le("ZodMiniString",(t,e)=>{Us.init(t,e),yt.init(t,e)});function w(t){return ny(js,t)}o(w,"string");var yy=le("ZodMiniStringFormat",(t,e)=>{zl.init(t,e),js.init(t,e)});var yR=le("ZodMiniURL",(t,e)=>{zg.init(t,e),yy.init(t,e)});function vy(t){return iy(yR,t)}o(vy,"url");var Fs=le("ZodMiniNumber",(t,e)=>{Ul.init(t,e),yt.init(t,e)});function Nt(t){return ay(Fs,t)}o(Nt,"number");var vR=le("ZodMiniNumberFormat",(t,e)=>{Ug.init(t,e),Fs.init(t,e)});function _y(t){return uy(vR,t)}o(_y,"int");var ql=le("ZodMiniBoolean",(t,e)=>{Ml.init(t,e),yt.init(t,e)});function He(t){return cy(ql,t)}o(He,"boolean");var by=le("ZodMiniBigInt",(t,e)=>{Mg.init(t,e),yt.init(t,e)});var _R=le("ZodMiniAny",(t,e)=>{Lg.init(t,e),yt.init(t,e)});function Gi(){return py(_R)}o(Gi,"any");var bR=le("ZodMiniUnknown",(t,e)=>{jg.init(t,e),yt.init(t,e)});function we(){return fy(bR)}o(we,"unknown");var ER=le("ZodMiniVoid",(t,e)=>{Fg.init(t,e),yt.init(t,e)});function Ey(t){return my(ER,t)}o(Ey,"_void");var Sy=le("ZodMiniDate",(t,e)=>{qg.init(t,e),yt.init(t,e)});var SR=le("ZodMiniArray",(t,e)=>{Bg.init(t,e),yt.init(t,e)});function Oe(t,e){return new SR({type:"array",element:t,...st(e)})}o(Oe,"array");var wR=le("ZodMiniObject",(t,e)=>{Vg.init(t,e),yt.init(t,e),gt(t,"shape",()=>e.shape)});function k(t,e){let r={type:"object",shape:t??{},...st(e)};return new wR(r)}o(k,"object");var TR=le("ZodMiniUnion",(t,e)=>{Ll.init(t,e),yt.init(t,e)});function ke(t,e){return new TR({type:"union",options:t,...st(e)})}o(ke,"union");var PR=le("ZodMiniDiscriminatedUnion",(t,e)=>{Gg.init(t,e),yt.init(t,e)});function Ln(t,e,r){return new PR({type:"union",options:e,discriminator:t,...st(r)})}o(Ln,"discriminatedUnion");var xR=le("ZodMiniRecord",(t,e)=>{Hg.init(t,e),yt.init(t,e)});function Te(t,e,r){return new xR({type:"record",keyType:t,valueType:e,...st(r)})}o(Te,"record");var AR=le("ZodMiniEnum",(t,e)=>{Wg.init(t,e),yt.init(t,e),t.options=Object.values(e.entries)});function ze(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new AR({type:"enum",entries:r,...st(e)})}o(ze,"_enum");var IR=le("ZodMiniLiteral",(t,e)=>{Zg.init(t,e),yt.init(t,e)});function ge(t,e){return new IR({type:"literal",values:Array.isArray(t)?t:[t],...st(e)})}o(ge,"literal");var RR=le("ZodMiniTransform",(t,e)=>{Kg.init(t,e),yt.init(t,e)});function jn(t){return new RR({type:"transform",transform:t})}o(jn,"transform");var CR=le("ZodMiniOptional",(t,e)=>{Jg.init(t,e),yt.init(t,e)});function Z(t){return new CR({type:"optional",innerType:t})}o(Z,"optional");var OR=le("ZodMiniNullable",(t,e)=>{Yg.init(t,e),yt.init(t,e)});function Hi(t){return new OR({type:"nullable",innerType:t})}o(Hi,"nullable");var kR=le("ZodMiniPipe",(t,e)=>{Xg.init(t,e),yt.init(t,e)});function Fn(t,e){return new kR({type:"pipe",in:t,out:e})}o(Fn,"pipe");var $R=le("ZodMiniCustom",(t,e)=>{Qg.init(t,e),yt.init(t,e)});function qs(t,e){return gy($R,t??(()=>!0),e)}o(qs,"custom");var Wi={};As(Wi,{bigint:()=>LR,boolean:()=>MR,date:()=>jR,number:()=>UR,string:()=>zR});function zR(t){return oy(js,t)}o(zR,"string");function UR(t){return sy(Fs,t)}o(UR,"number");function MR(t){return ly(ql,t)}o(MR,"boolean");function LR(t){return dy(by,t)}o(LR,"bigint");function jR(t){return hy(Sy,t)}o(jR,"date");var Vl=k({retryOnFailure:k({defaultValue:Z(He()),hide:Z(He())}),continueOnFailure:k({defaultValue:Z(He()),hide:Z(He())})}),Bl=class{constructor(e,r,n,i,s,c,d,p,m,y,h){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=m;this.audience=y;this.aiMetadata=h}static{o(this,"IAction")}},ve=o(t=>new Bl(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 Ve=k({displayName:w(),description:Z(w())}),$e=o((t,e)=>k({type:ge(e),required:He(),defaultValue:Z(Gi())}),"TPropertyValue");var Kt=k({...Ve.shape,...$e(w(),"SHORT_TEXT").shape}),dn=k({...Ve.shape,...$e(w(),"LONG_TEXT").shape});var Ty=k({label:w(),value:we()}),Bs=k({disabled:Z(He()),placeholder:Z(w()),options:Oe(Ty)});var Jt=k({...Ve.shape,options:Bs,...$e(we(),"STATIC_DROPDOWN").shape}),pn=k({...Ve.shape,options:Bs,...$e(Oe(we()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Gl=k({...Ve.shape,...$e(we(),"DROPDOWN").shape,refreshers:Oe(w())}),Zi=k({...Ve.shape,...$e(Oe(we()),"MULTI_SELECT_DROPDOWN").shape,refreshers:Oe(w())});var fn=k({...Ve.shape,...$e(He(),"CHECKBOX").shape});var mn=k({...Ve.shape,...$e(Nt(),"NUMBER").shape});var Ki=k({...Ve.shape,streaming:Z(He()),...$e(we(),"FILE").shape});var Ji=k({...Ve.shape,...$e(w(),"DATE_TIME").shape});var Py=Te(w(),ke([Kt,dn,Jt,Zi,pn,fn,mn,Ki,Ji])),Yi=k({...Ve.shape,properties:Py,...$e(Oe(we()),"ARRAY").shape});var Xi=k({...Ve.shape,...$e(ke([Te(w(),we())]),"JSON").shape});var xy=ke([Kt,Jt,Xi,Yi,pn]),qR=Te(w(),xy),Hl=k({refreshers:Oe(w()),...Ve.shape,...$e(we(),"DYNAMIC").shape});var Vs=k({...Ve.shape,...$e(Ey(),"MARKDOWN").shape});var Qi=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Qi||{}),Vo=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Vo||{}),Go=(b=>(b.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",b.COMMUNICATION="COMMUNICATION",b.COMMERCE="COMMERCE",b.CORE="CORE",b.UNIVERSAL_AI="UNIVERSAL_AI",b.FLOW_CONTROL="FLOW_CONTROL",b.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",b.ACCOUNTING="ACCOUNTING",b.PRODUCTIVITY="PRODUCTIVITY",b.CONTENT_AND_FILES="CONTENT_AND_FILES",b.DEVELOPER_TOOLS="DEVELOPER_TOOLS",b.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",b.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",b.HUMAN_RESOURCES="HUMAN_RESOURCES",b.PAYMENT_PROCESSING="PAYMENT_PROCESSING",b.MARKETING="MARKETING",b.SALES_AND_CRM="SALES_AND_CRM",b))(Go||{});var ea=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ea||{}),Wl="both_client_credentials_and_authorization_code";var Lt=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Lt||{}),ta=(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))(ta||{}),BR=k({strategy:ze(ta),paramName:Z(w())}),ra=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ra||{});var Gs=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Gs||{}),Ay=k({status:Z(Nt()),body:Z(we()),headers:Z(Te(w(),w()))}),Iy=k({type:ge("DELAY"),resumeDateTime:w(),requestIdToReply:Z(w()),handlerId:Z(w()),streamStepProgress:Z(ze(Gs))}),Ry=k({type:ge("WEBHOOK"),requestId:w(),requestIdToReply:Z(w()),response:Ay,handlerId:Z(w()),streamStepProgress:Z(ze(Gs))}),VR=ke([Iy,Ry]);var GR=k({body:we(),rawBody:Z(we()),headers:Te(w(),w()),queryParams:Te(w(),w())});function it(t){return t==null}o(it,"isNil");function na(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(na,"isEmpty");function Hs(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(Hs,"assertNotNullOrUndefined");var Zl=qe(require("crypto"),1);var HR=128,co,Ho,WR=o(t=>{!co||co.length<t?(co=Buffer.allocUnsafe(t*HR),Zl.default.randomFillSync(co),Ho=0):Ho+t>co.length&&(Zl.default.randomFillSync(co),Ho=0),Ho+=t},"fillPool"),ZR=o(t=>(WR(t|=0),co.subarray(Ho-t,Ho)),"random"),KR=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"),Oy=o((t,e=21)=>KR(t,e,ZR),"customAlphabet");var JR="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ky=21,eH=w().check(Mn(new RegExp(`^[0-9a-zA-Z]{${ky}}$`))),YR=Oy(JR,ky);var qn=Fn(jn(t=>t instanceof Date?t.toISOString():t),w()),dr={id:w(),created:qn,updated:qn},ut=o(t=>Z(Hi(t)),"Nullable");function Kl(t){return Z(Hi(ze(t)))}o(Kl,"NullableEnum");var nH=Fn(jn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),Z(He())),Ws=o(t=>Fn(jn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),Z(Oe(t))),"OptionalArrayFromQuery");var aH=Te(w(),we());var oa=(y=>(y.OPENAI="openai",y.OPENROUTER="openrouter",y.ANTHROPIC="anthropic",y.AZURE="azure",y.GOOGLE="google",y.ACTIVEPIECES="activepieces",y.CLOUDFLARE_GATEWAY="cloudflare-gateway",y.CUSTOM="custom",y.BEDROCK="bedrock",y.MISTRAL="mistral",y))(oa||{});var vH=w().check(Mn(/^#[0-9A-Fa-f]{6}$/));var bH=k({filename:w(),data:we(),type:ge("file"),mimetype:Z(w())});var XR=qe(Dy());var AH=k({...dr,name:w(),permissions:Oe(w()),platformId:ut(w()),type:w(),userCount:Z(Nt())});var Ny=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ny||{}),Jl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Jl||{}),Yl=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Yl||{});var Xl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Xl||{});var Ql=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ql||{});var QR=k({mode:ze(Ny),value:we()}),eC=k({auth:Z(w()),fields:Te(w(),QR)}),tC=k({pieceName:w(),pieceVersion:w(),actionName:w(),predefinedInput:Z(eC)}),rC=k({type:ge("PIECE"),toolName:w().check(xr(1)),pieceMetadata:tC}),nC=k({type:ge("none")}),oC=k({type:ge("access_token"),accessToken:w()}),iC=k({type:ge("api_key"),apiKey:w(),apiKeyHeader:w()}),aC=k({type:ge("headers"),headers:Te(w(),w())}),sC=Ln("type",[nC,oC,iC,aC]),zy=k({type:ge("FLOW"),toolName:w().check(xr(1)),externalFlowId:w(),flowDisplayName:Z(w())}),Uy=k({type:ge("MCP"),toolName:w().check(xr(1)),serverUrl:vy(),protocol:ze(Yl),auth:sC}),My=k({type:ge("KNOWLEDGE_BASE"),toolName:w().check(xr(1)),sourceType:ze(Jl),sourceId:w(),sourceName:w()}),uC=Ln("type",[rC,zy,Uy,My]),cC=k({displayName:w(),description:Z(w()),type:ze(Xl)}),Ly=k({type:ge("MARKDOWN"),markdown:w()}),Wo={type:ge("TOOL_CALL"),input:ut(Te(w(),we())),output:Z(we()),toolName:w(),status:ze(Ql),toolCallId:w(),startTime:w(),endTime:Z(w())},oW=k(Wo),jy=Ln("toolCallType",[k({...Wo,toolCallType:ge("PIECE"),pieceName:w(),pieceVersion:w(),actionName:w()}),k({...Wo,toolCallType:ge("FLOW"),displayName:w(),externalFlowId:w()}),k({...Wo,toolCallType:ge("MCP"),displayName:w(),serverUrl:w()}),k({...Wo,toolCallType:ge("KNOWLEDGE_BASE"),displayName:w(),sourceType:w()}),k({...Wo,toolCallType:ge("UNKNOWN"),displayName:w()})]),lC=ke([Ly,jy]);var ed=(r=>(r.IMAGE="image",r.TEXT="text",r))(ed||{}),hn=k({apiKey:w()}),dC=hn,pC=k({apiKey:w(),apiKeyHash:w()}),fC=hn,mC=hn,hC=hn,gC=hn,yC=hn,vC=hn,_C=hn,Gy=k({accessKeyId:w().check(xr(1)),secretAccessKey:w().check(xr(1))}),bC=k({}),EC=k({}),SC=k({}),wC=k({}),TC=k({}),PC=k({}),Hy=k({modelId:w(),modelName:w(),modelType:ze(ed)}),Wy=k({apiKeyHeader:w(),baseUrl:w(),models:Oe(Hy),defaultHeaders:Z(Te(w(),w()))}),Zy=k({accountId:w(),gatewayId:w(),models:Oe(Hy),vertexProject:Z(w()),vertexRegion:Z(w())}),Ky=k({resourceName:w(),apiVersion:Fn(jn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),Z(w()))}),Jy=k({region:w().check(xr(1))}),xC=ke([dC,hC,gC,yC,vC,mC,fC,pC,Gy,_C]),Yy=ke([Wy,Zy,Ky,Jy,bC,SC,wC,TC,EC,PC]),AC=k({id:w(),name:w(),type:ze(ed)}),IC=k({id:w(),name:w(),provider:ze(oa),config:Yy,enabledForChat:He()}),RC=k({provider:ze(oa),config:Yy,auth:xC,platformId:w()});var uW={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Fy=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],CC=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],OC=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],qy=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],kC=["grok-4.20","grok-4.1-fast"],$C={openai:Fy,anthropic:CC,google:qy,activepieces:[...OC.map(t=>`anthropic/${t}`),...Fy.map(t=>`openai/${t}`),...qy.map(t=>`google/${t}`),...kC.map(t=>`x-ai/${t}`)]};var By=128e3,DC={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function NC({provider:t}){return t?DC[t]??By:By}o(NC,"getMaxContextTokens");var Vy={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},zC={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},UC=new Set(["anthropic","mistral"]);function Lr(t){return{chatModels:$C[t],maxContextTokens:NC({provider:t}),defaultEmbeddingModel:Vy[t],supportsEmbedding:Vy[t]!==void 0,supportsImageGeneration:!UC.has(t),webSearch:zC[t]}}o(Lr,"buildProviderCapabilities");var MC={openai:Lr("openai"),anthropic:Lr("anthropic"),openrouter:Lr("openrouter"),azure:Lr("azure"),google:Lr("google"),"cloudflare-gateway":Lr("cloudflare-gateway"),custom:Lr("custom"),bedrock:Lr("bedrock"),mistral:Lr("mistral"),activepieces:Lr("activepieces")};var LC=k({base64Url:w(),fileName:w(),extension:Z(w())}),jC=k({mimeType:w(),url:w(),fileName:Z(w())}),td=ke([LC,jC]);var FC=ke([k({type:ge("file"),value:td}),k({type:ge("markdown"),value:w(),files:Z(Oe(td))})]),qC=k({sessionId:w(),message:w(),files:Z(Oe(w()))});var Qy=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Qy||{}),ev=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ev||{}),rd=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(rd||{});var BC=ke([k({...dr,name:w(),externalId:w(),type:ge("STATIC_DROPDOWN"),tableId:w(),projectId:w(),data:k({options:Oe(k({value:w()}))})}),k({...dr,name:w(),externalId:w(),type:ke([ge("TEXT"),ge("NUMBER"),ge("DATE")]),tableId:w(),projectId:w()})]),VC=k({...dr,name:w(),folderId:ut(w()),projectId:w(),externalId:w(),status:Kl(ev),trigger:Kl(Qy)}),GC=k({...dr,tableId:w(),projectId:w(),cells:Te(w(),k({updated:w(),created:w(),value:we(),fieldName:w()}))}),HC=k({events:Oe(ze(rd)),webhookUrl:w(),flowId:w()}),WC=k({fields:Oe(k({id:w(),name:w()})),rows:Oe(Te(w(),w())),name:w()}),ZC=k({projectId:w(),limit:Z(Wi.number()),cursor:Z(w()),name:Z(w()),externalIds:Ws(w()),folderId:Z(w()),folderIds:Ws(w())}),KC=k({records:Oe(Oe(k({fieldId:w(),value:rv()}))),tableId:w()}),JC=k({cells:Z(Oe(k({fieldId:w(),value:rv()}))),tableId:w(),agentUpdate:Z(He())}),tv=Ln("operator",[lo("eq"),lo("neq"),lo("gt"),lo("gte"),lo("lt"),lo("lte"),lo("co"),Xy("exists"),Xy("not_exists")]),YC=k({tableId:w(),limit:Z(Wi.number()),cursor:Z(w()),filters:Ws(tv)});function rv(){return Fn(jn(t=>t==null?t:String(t)),Hi(w()))}o(rv,"coerceToString");function lo(t){return k({fieldId:w(),operator:ge(t),value:w()})}o(lo,"valueFilter");function Xy(t){return k({fieldId:w(),operator:ge(t)})}o(Xy,"existenceFilter");var XC=k({status:Z(Nt()),body:Z(we()),headers:Z(Te(w(),w()))}),QC=k({...dr,deleted:ut(qn),ownerId:w(),displayName:w(),platformId:w(),externalId:ut(w())});var nv=k({name:w(),description:Z(w()),type:w(),required:He()}),e0=k({pieceName:w(),triggerName:w(),input:k({toolName:w(),toolDescription:w(),inputSchema:Oe(nv),returnsResponse:He()})});var ov="^[0-9]+\\.[0-9]+\\.[0-9]+$",AW=new RegExp(ov),r0="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",IW=w().check(Mn(new RegExp(ov))),RW=w().check(Mn(new RegExp(r0))),n0=k({packageType:ge("ARCHIVE"),pieceType:ze(Vo),pieceName:w(),pieceVersion:w(),archiveId:w(),platformId:w()}),iv=k({packageType:ge("REGISTRY"),pieceType:ge("OFFICIAL"),pieceName:w(),pieceVersion:w()}),av=k({packageType:ge("REGISTRY"),pieceType:ge("CUSTOM"),pieceName:w(),pieceVersion:w(),platformId:w()}),CW=ke([iv,av]),OW=ke([n0,iv,av]);var o0=Ln("type",[k({type:ge("CRON_EXPRESSION"),cronExpression:w(),timezone:w()}),k({type:ge("INTERVAL"),intervalMs:_y().check(Ms(6e4))})]),kW=k({...dr,type:ze(Lt),projectId:w(),flowId:w(),triggerName:w(),schedule:ut(o0),flowVersionId:w(),pieceName:w(),pieceVersion:w(),deleted:ut(w()),simulate:He()}),sv=(E=>(E.UNKNOWN="UNKNOWN",E.FLOW_RUN_LOG="FLOW_RUN_LOG",E.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",E.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",E.FLOW_STEP_FILE="FLOW_STEP_FILE",E.SAMPLE_DATA="SAMPLE_DATA",E.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",E.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",E.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",E.PROJECT_RELEASE="PROJECT_RELEASE",E.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",E.PLATFORM_ASSET="PLATFORM_ASSET",E.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",E.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",E.KNOWLEDGE_BASE="KNOWLEDGE_BASE",E.FLOW_BUNDLE="FLOW_BUNDLE",E))(sv||{}),uv=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(uv||{}),cv=(r=>(r.S3="S3",r.DB="DB",r))(cv||{}),$W=k({...dr,projectId:ut(w()),platformId:ut(w()),type:ze(sv),compression:ze(uv),data:Z(we()),location:ze(cv),size:ut(Nt()),fileName:ut(w()),s3Key:ut(w()),metadata:ut(Te(w(),w()))}),lv=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(lv||{}),dv=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(dv||{}),DW=k({id:w(),email:w(),firstName:w(),status:ze(dv),externalId:ut(w()),platformId:ut(w()),platformRole:ze(lv),lastName:w(),created:qn,updated:qn,lastActiveDate:ut(qn),imageUrl:ut(w())});var od=k({...Ve.shape,...$e(Te(w(),we()),"OBJECT").shape});var mv=k({...Ve.shape,...$e(w(),"COLOR").shape});var id=ke([Kt,dn,Vs,fn,Jt,pn,Gl,Zi,Hl,mn,Yi,od,Xi,Ji,Ki,mv]),F={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 jr=k({displayName:w(),description:Z(w())});var hv=k({username:w(),password:w()}),ad=k({...jr.shape,username:k({displayName:w(),description:Z(w())}),password:k({displayName:w(),description:Z(w())}),...$e(hv,"BASIC_AUTH").shape});var u0=Te(w(),ke([Kt,dn,mn,fn,Jt])),sd=k({...jr.shape,props:u0,...$e(we(),"CUSTOM_AUTH").shape});var po=k({...jr.shape,...$e(k({auth:w()}),"SECRET_TEXT").shape});var c0=Te(w(),ke([Kt,dn,po,mn,fn,Jt,pn,Vs])),gv=k({...jr.shape,props:c0,...$e(we(),"OIDC").shape});var ud=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(ud||{}),yv=ke([Kt,po,Jt]),vv=Te(w(),yv),l0=k({props:Z(Te(w(),yv)),authUrl:w(),tokenUrl:w(),scope:Oe(w()),prompt:Z(ke([ge("none"),ge("consent"),ge("login"),ge("omit")])),pkce:Z(He()),pkceMethod:Z(ke([ge("plain"),ge("S256")])),authorizationMethod:Z(ze(ud)),grantType:Z(ke([ze(ea),ge(Wl)])),extra:Z(Te(w(),w()))}),_v=k({access_token:w(),props:Z(vv),data:Te(w(),Gi())}),cd=k({...jr.shape,...l0.shape,...$e(_v,"OAUTH2").shape});var Zo=ke([ad,sd,gv,cd,po]),ia="Connection",Ks={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||ia}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||ia,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||ia}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||ia}},None(){}};var p3={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 d0=k({...Ve.shape,...$e(we(),"CUSTOM").shape,code:w()});var p0=ke([id,Zo]),ld=Te(w(),p0),k3=Te(w(),id);var bv=ke([k({strategy:ge("CRON"),cronExpression:w()}),k({strategy:ge("NONE")})]),Ko=class{constructor(e,r,n,i,s,c,d,p,m,y,h,f,l,g,v,E,b,C,U){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=m;this.onRenew=y;this.onEnable=h;this.onDisable=f;this.onStart=l;this.run=g;this.test=v;this.sampleData=E;this.testStrategy=b;this.outputSchema=C;this.aiMetadata=U}static{o(this,"ITrigger")}},jt=o(t=>{switch(t.type){case"WEBHOOK":return new Ko(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 Ko(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 Ko(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 Ko(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,it(t.sampleData)&&it(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var Ev="2",Js="0.82.0";var dd=class{constructor(e,r,n,i,s,c,d,p,m=Js,y,h="",f){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=p;this.minimumSupportedRelease=m;this.maximumSupportedRelease=y;this.description=h;this.deprecated=f;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ev}),"getContextInfo");(!f0(m)||m0(m,Js))&&(this.minimumSupportedRelease=Js),s.forEach(l=>this._actions[l.name]=l),c.forEach(l=>this._triggers[l.name]=l)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(e){return this._actions[e]}getTrigger(e){return this._triggers[e]}actions(){return this._actions}triggers(){return this._triggers}},Sv=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 dd(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description,t.deprecated)},"createPiece");function f0(t){return/^\d+\.\d+\.\d+$/.test(t)}o(f0,"isValidSimpleSemver");function m0(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(m0,"isSemverLessThan");var h0=Z(Te(w(),Te(w(),w()))),wv=k({id:Z(w()),name:w(),displayName:w(),logoUrl:w(),description:w(),authors:Oe(w()),platformId:Z(w()),directoryPath:Z(w()),auth:Z(ke([Zo,Oe(Zo)])),version:w(),categories:Z(Oe(ze(Go))),minimumSupportedRelease:Z(w()),maximumSupportedRelease:Z(w()),deprecated:Z(He()),i18n:h0}),g0=ze(["human","ai","both"]),Tv=k({description:Z(w()),idempotent:Z(He())}),Pv=k({name:w(),displayName:w(),description:w(),props:ld,requireAuth:He(),errorHandlingOptions:Z(Vl),outputSchema:Z(qs()),audience:Z(g0),aiMetadata:Z(Tv)}),xv=k({name:w(),displayName:w(),description:w(),props:ld,errorHandlingOptions:Z(Vl),type:ze(Lt),sampleData:we(),handshakeConfiguration:Z(qs()),renewConfiguration:Z(bv),testStrategy:ze(ra),outputSchema:Z(qs()),aiMetadata:Z(Tv)}),y0=k({...wv.shape,actions:Te(w(),Pv),triggers:Te(w(),xv)}),v0=k({...wv.shape,actions:Nt(),triggers:Nt(),suggestedActions:Z(Oe(Pv)),suggestedTriggers:Z(Oe(xv))}),Av=k({projectUsage:Nt(),pieceType:ze(Vo),packageType:ze(Qi),platformId:Z(w()),archiveId:Z(w())}),kK=k({...y0.shape,...Av.shape}),$K=k({...v0.shape,...Av.shape}),DK=k({name:w(),version:w()});var _0=qe(require("path")),b0=qe(require("fs/promises"));var Cv=require("node:stream");var Ys=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};return e.authentication&&this.populateAuthentication(e.authentication,r),e.body&&(e.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),e.headers&&(r={...r,...e.headers}),r}populateAuthentication(e,r){this.authenticationConverter.convert(e,r)}};var Xs=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new pd,r=new fd){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},pd=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},fd=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 Qs=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 eu=class extends Ys{static{o(this,"FetchHttpClient")}constructor(e="",r=new Xs){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[U,J]of Object.entries(c))i.append(U,J);let d=i.toString(),p=d?`${n}?${d}`:n,m=e.responseType??"json",y=e.followRedirects??!0,h=e.retries??0,{body:f,extraHeaders:l,isStream:g}=E0(e.body,s),v=w0({...s,...l}),E=await S0(async()=>{let U=new AbortController,J=e.timeout&&e.timeout>0?setTimeout(()=>U.abort(),e.timeout):void 0;try{let W={method:e.method.toString(),headers:v,body:f,redirect:y?"follow":"manual",signal:U.signal};return g&&(W.duplex="half"),r?.dispatcher!==void 0&&(W.dispatcher=r.dispatcher),await fetch(p,W)}finally{J!==void 0&&clearTimeout(J)}},h),b=y?300:400;if(E.status<200||E.status>=b){let U=await Iv(E,m),J=new Qs(e.body,{status:E.status,responseBody:U});throw console.error("[HttpClient#(sanitized error message)] Request failed:",J),J}let C=await Iv(E,m);return{status:E.status,headers:T0(E.headers),body:C}}};function E0(t,e){if(x0(t))return{body:void 0,extraHeaders:{},isStream:!1};if(P0(t)){let n=new Cv.PassThrough;return t.on("error",i=>n.destroy(i)),t.pipe(n),{body:n,extraHeaders:t.getHeaders(),isStream:!0}}return typeof t=="string"||Buffer.isBuffer(t)||t instanceof URLSearchParams||t instanceof ArrayBuffer||typeof FormData<"u"&&t instanceof FormData||typeof Blob<"u"&&t instanceof Blob?{body:t,extraHeaders:{},isStream:!1}:(e["Content-Type"]??e["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(t).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(t),extraHeaders:{},isStream:!1}}o(E0,"serializeBody");async function Iv(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"blob":return await t.blob();case"text":return await t.text();default:{let r=await t.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Iv,"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 Rv(n);continue}return i}catch(i){if(r=i,n<e){await Rv(n);continue}throw i}throw r}o(S0,"sendWithRetries");function Rv(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(Rv,"backoff");function w0(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&(e[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return e}o(w0,"normalizeHeaders");function T0(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(T0,"toHttpHeaders");function P0(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}o(P0,"isNodeFormData");function x0(t){return t==null}o(x0,"isNil");var Ue=new eu;var Ot=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Ot||{});var fk=qe(require("fs")),Db=qe($b());var mk={"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 hk(t){let e=t.split(";")[0].trim().toLowerCase();return mk[e]??""}o(hk,"contentTypeToExtension");var gk=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),yk=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 Nb({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:d,authLocation:p="headers"}){return ve({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:F.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:m})=>({url:F.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
69
|
+
i.e ${yk(e,m)}/resource or /resource`,required:!0,defaultValue:m?e(m):"",...c?.url??{}})}),"props")}),method:F.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Ot).map(m=>({label:m,value:m}))},...c?.method??{}}),headers:F.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:F.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:F.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:F.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:m})=>{if(!m)return{};let y=m,h={};switch(y){case"none":break;case"json":h.data=F.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":h.data=F.LongText({displayName:"Raw Body",required:!0});break;case"form_data":h.data=F.Array({displayName:"Form Data",required:!0,properties:{fieldName:F.ShortText({displayName:"Field Name",required:!0}),fieldType:F.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:F.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:F.File({displayName:"File Field Value",required:!1})}});break}return h},"props")}),response_is_binary:F.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:F.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:F.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:F.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async m=>{let{method:y,url:h,headers:f,queryParams:l,body:g,body_type:v,failsafe:E,timeout:b,response_is_binary:C,followRedirects:U}=m.propsValue;Hs(y,"Method"),Hs(h,"URL");let J=it(r)?{}:await r(m.auth,m.propsValue),W=h.url,H=W.startsWith("http://")||W.startsWith("https://")?W:gk({baseUrl:e(m.auth),relativePath:W}),K={method:y,url:H,headers:{...f??{},...p==="headers"||!it(p)?J:{}},queryParams:{...p==="queryParams"?J:{},...l??{}},timeout:b?b*1e3:0,followRedirects:U};if(C&&(K.responseType="arraybuffer"),g)if(v&&v!=="none"){let te=g.data;if(v==="form_data"){let Q=te,xe=new Db.default;for(let{fieldName:re,fieldType:V,textFieldValue:B,fileFieldValue:X}of Q)V==="text"&&!na(B)?xe.append(re,B):V==="file"&&!na(X)&&xe.append(re,X.data,{filename:X?.filename});K.body=xe,K.headers={...K.headers,...xe.getHeaders()}}else K.body=te}else v||(K.body=g);try{let te=await Ue.sendRequest(K);return await vk(m.files,te.body,te.status,te.headers,C)}catch(te){if(E)return te.errorMessage();throw te}},"run")})}o(Nb,"createCustomApiCallAction");var vk=o(async(t,e,r,n,i)=>{let s;if(i&&_k(e)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=hk(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"),_k=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var Je={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(it(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}),m=p.reduce((y,h)=>Math.max(y,h.epochMilliSeconds),d);return await e.put("lastPoll",m),p.filter(y=>y.epochMilliSeconds>d).map(y=>y.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}),m=p.findIndex(f=>f.id===d),y=[];it(d)||m==-1?y=p??[]:y=p?.slice(0,m)??[],it(i)||(y=y.slice(-i));let h=y?.[0]?.id;return it(h)||await e.put("lastItem",h),y.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;it(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 bk(c.map(d=>d.data))}};function bk(t){return t.length<=5?t:t.slice(0,5)}o(bk,"getFirstFiveOrAll");var zb=require("crypto");async function Nd(t,e){let r={method:"POST",url:`${ae.baseUrl}/channels/stop`,body:{id:t?.id,resourceId:t?.resourceId},authentication:{type:"BEARER_TOKEN",token:await Ie(e)}};await Ue.sendRequest(r)}o(Nd,"stopWatchEvent");async function zd(t,e,r){let n=Date.now()+5184e5,i={method:"POST",url:`${ae.baseUrl}/calendars/${t}/events/watch`,body:{id:(0,zb.randomUUID)(),type:"web_hook",address:e,expiration:n.toString()},authentication:{type:"BEARER_TOKEN",token:await Ie(r)}},{body:s}=await Ue.sendRequest(i);return s}o(zd,"watchEvent");async function cu({calendarId:t,authProp:e}){let r=await Ie(e),n={singleEvents:"true",showDeleted:"true",maxResults:"2500"},i="",s;do{i&&(n.pageToken=i);let c={method:"GET",url:`${ae.baseUrl}/calendars/${t}/events`,queryParams:n,authentication:{type:"BEARER_TOKEN",token:r}},{body:d}=await Ue.sendRequest(c);i=d.nextPageToken,s=d.nextSyncToken}while(i);return s}o(cu,"getInitialSyncToken");async function Ub({calendarId:t,syncToken:e,authProp:r}){let n=await Ie(r),i={syncToken:e,maxResults:"2500"},s="",c,d=[];do{s&&(i.pageToken=s);let p={method:"GET",url:`${ae.baseUrl}/calendars/${t}/events`,queryParams:i,authentication:{type:"BEARER_TOKEN",token:n}};try{let{body:m}=await Ue.sendRequest(p);m.items?.length>0&&(d=[...d,...m.items]),s=m.nextPageToken,c=m.nextSyncToken}catch(m){if(m?.response?.status===410)return{items:[],nextSyncToken:void 0,syncTokenInvalid:!0};throw m}}while(s);return{items:d,nextSyncToken:c,syncTokenInvalid:!1}}o(Ub,"listEventsWithSyncToken");async function kt(t,e){let r={showDeleted:"false"};e&&(r.minAccessRole=e);let n={method:"GET",url:`${ae.baseUrl}/users/me/calendarList`,queryParams:r,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};return(await Ue.sendRequest(n)).body.items}o(kt,"getCalendars");async function lu(t){let e={method:"GET",url:`${ae.baseUrl}/colors`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};return(await Ue.sendRequest(e)).body}o(lu,"getColors");async function la(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 Ie(r),p={method:"GET",url:`${ae.baseUrl}/calendars/${t}/events`,queryParams:c,authentication:{type:"BEARER_TOKEN",token:d}},m=[],y="";do{c.pageToken=y;let{body:h}=await Ue.sendRequest(p);h.items.length>0&&(m=[...m,...h.items]),y=h.nextPageToken}while(y);return m}o(la,"getEvents");async function Mb(t,e){return(await la(t,!1,e)).pop()}o(Mb,"getLatestEvent");async function Lb(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:`${ae.baseUrl}/calendars/${encodeURIComponent(e)}/events`,queryParams:s,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}},d=await Ue.sendRequest(c);return!d.body.items||d.body.items.length===0?[]:d.body.items.map(p=>{let m=p.start?.dateTime||p.start?.date||"",y=m?new Date(m).toLocaleDateString():"",h=m?new Date(m).toLocaleTimeString():"",f=p.summary||"Untitled Event";return y&&(f+=` (${y}`,p.start?.dateTime&&(f+=` at ${h}`),f+=")"),{label:f,value:p.id||""}}).filter(p=>p.value!=="")}catch(n){return console.error("Error fetching events for dropdown:",n),[]}}o(Lb,"getEventsForDropdown");var Ac=qe(qa());var rm=["https://www.googleapis.com/auth/calendar.events","https://www.googleapis.com/auth/calendar.readonly"],ne=[Ks.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,pkce:!0,scope:rm}),Ks.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:F.ShortText({displayName:"Service Account JSON Key",required:!0}),userEmail:F.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 Ie({type:"CUSTOM_AUTH",props:{...t}})}catch(e){return{valid:!1,error:e.message}}return{valid:!0}},"validate")})];async function _t(t){if(t.type==="CUSTOM_AUTH"){let r=JSON.parse(t.props.serviceAccount);return new Ac.JWT({email:r.client_email,key:r.private_key,scopes:rm,subject:t.props.userEmail})}let e=new Ac.OAuth2Client;return e.setCredentials(t),e}o(_t,"createGoogleClient");var Ie=o(async t=>{if(t.type==="CUSTOM_AUTH"){let r=await(await _t(t)).getAccessToken();if(r.token)return r.token;throw new Error("Could not retrieve access token from service account json")}return t.access_token},"getAccessToken");var ae={baseUrl:"https://www.googleapis.com/calendar/v3",calendarDropdown:o(t=>F.Dropdown({auth:ne,displayName:"Calendar",refreshers:[],required:!0,options:o(async({auth:e})=>e?{disabled:!1,options:(await kt(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)=>F.Dropdown({displayName:"Event",refreshers:["calendar_id"],required:t,auth:ne,options:o(async({auth:e,calendar_id:r})=>e?r?{disabled:!1,options:await Lb(e,r)}:{disabled:!0,placeholder:"Please select a calendar first",options:[]}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),"eventDropdown"),colorId:F.Dropdown({auth:ne,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 lu(t);return{disabled:!1,options:Object.entries(e.event).map(([r,n])=>({label:n.background,value:r}))}},"options")})};var Zc=qe(Sn()),yx=qe(xn()),vx=require("crypto");var Ze={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"}]},ax={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:"primary",label:"Primary",format:"boolean"},{key:"isOwned",label:"Is Owned",format:"boolean"},{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"}]},Hc={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"}]}]},sx={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"}]},ux={fields:[{key:"summary",label:"Name"},{key:"id",label:"Calendar ID"},{key:"description",label:"Description"},{key:"location",label:"Location"},{key:"timeZone",label:"Time Zone"}]};var cx={fields:[{key:"calendar",label:"Calendar Colors",dynamicKey:!0,children:[{key:"background",label:"Background Color"},{key:"foreground",label:"Foreground Color"}]},{key:"event",label:"Event Colors",dynamicKey:!0,children:[{key:"background",label:"Background Color"},{key:"foreground",label:"Foreground Color"}]}]},lx={fields:[{key:"calendars",label:"Calendars",labelKey:"summary",listItems:[{key:"id",label:"Calendar ID"},{key:"summary",label:"Name"},{key:"description",label:"Description"},{key:"location",label:"Location"},{key:"timeZone",label:"Time Zone"},{key:"accessRole",label:"Access Role"},{key:"primary",label:"Primary",format:"boolean"},{key:"selected",label:"Selected",format:"boolean"},{key:"backgroundColor",label:"Background Color"},{key:"foregroundColor",label:"Foreground Color"}]},{key:"count",label:"Count",format:"number"}]},dx={fields:[{key:"items",label:"Settings",labelKey:"id",listItems:[{key:"id",label:"Setting ID"},{key:"value",label:"Value"}]},{key:"count",label:"Count",format:"number"}]},px={fields:[{key:"removed",label:"Removed",format:"boolean"},{key:"attendee_email",label:"Attendee Email",format:"email"},{key:"message",label:"Message"},{key:"event",label:"Event",children:Ze.fields}]},fx={fields:[{key:"free_slots",label:"Free Slots",labelKey:"start",listItems:[{key:"start",label:"Start",format:"datetime"},{key:"end",label:"End",format:"datetime"},{key:"duration_minutes",label:"Duration (Minutes)",format:"number"}]},{key:"count",label:"Count",format:"number"}]},lL=[{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"id",label:"Instance Event ID"},{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:"originalStartDateTime",label:"Original Start",value:"originalStartTime.dateTime",format:"datetime"}],mx={fields:[{key:"instances",label:"Instances",labelKey:"summary",listItems:lL},{key:"count",label:"Count",format:"number"},{key:"nextPageToken",label:"Next Page Token"}]},hx={fields:[{key:"moved",label:"Moved",format:"boolean"},{key:"already_in_destination",label:"Already in Destination",format:"boolean"},{key:"event",label:"Event",children:Ze.fields}]},gx={fields:[{key:"events",label:"Events",labelKey:"summary",listItems:[{key:"calendarId",label:"Calendar ID"},{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"id",label:"Event ID"},{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:"count",label:"Count",format:"number"},{key:"calendars_searched",label:"Calendars Searched",format:"number"},{key:"warning",label:"Warning"}]},Wc={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 Fm={calendar_id:ae.calendarDropdown("writer"),title:F.ShortText({displayName:"Title of the event",required:!0}),start_date_time:F.DateTime({displayName:"Start date time of the event",required:!0}),end_date_time:F.DateTime({displayName:"End date time of the event",description:"By default it'll be 30 min post start time",required:!1}),location:F.ShortText({displayName:"Location",required:!1}),description:F.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1}),colorId:ae.colorId,attendees:F.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!1}),guests_can_modify:F.Checkbox({displayName:"Guests can modify",defaultValue:!1,required:!1}),guests_can_invite_others:F.Checkbox({displayName:"Guests can invite others",defaultValue:!1,required:!1}),guests_can_see_other_guests:F.Checkbox({displayName:"Guests can see other guests",defaultValue:!1,required:!1}),send_notifications:F.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:F.Checkbox({displayName:"Create Google Meet Link",description:"Automatically create a Google Meet video conference link for this event",defaultValue:!1,required:!1})};async function qm(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:m,guests_can_see_other_guests:y,create_meet_link:h}=t.propsValue,f={dateTime:(0,Zc.default)(n).format("YYYY-MM-DDTHH:mm:ss.sssZ")},l=i||(0,Zc.default)(n).add(30,"m"),g={dateTime:(0,Zc.default)(l).format("YYYY-MM-DDTHH:mm:ss.sssZ")},v=t.propsValue.attendees,E=t.propsValue.send_notifications,b=[];if(v)for(let H of v)b.push({email:H});let C=await _t(t.auth),U=(0,yx.calendar)({version:"v3",auth:C}),J={summary:r,start:f,end:g,colorId:d,location:s??"",description:c??"",attendees:b,guestsCanInviteOthers:m,guestsCanModify:p,guestsCanSeeOtherGuests:y};return h&&(J.conferenceData={createRequest:{conferenceSolutionKey:{type:"hangoutsMeet"},requestId:(0,vx.randomUUID)()}}),(await U.events.insert({calendarId:e,sendUpdates:E,conferenceDataVersion:h?1:0,requestBody:J})).data}o(qm,"runCreateEvent");var _x=ve({auth:ne,name:"create_google_calendar_event",description:"Add Event",audience:"human",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:Fm,outputSchema:Ze,run:qm});var bx=ve({auth:ne,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:ae.calendarDropdown("writer"),text:F.LongText({displayName:"Summary",description:"The text describing the event to be created",required:!0}),send_updates:F.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:sx,async run(t){let e=t.propsValue.calendar_id,r=`${ae.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 Ie(t.auth)},queryParams:n};return await Ue.sendRequest(i)}});var Ex=qe(xn());var dL={calendar_id:ae.calendarDropdown("writer"),eventId:F.ShortText({displayName:"Event ID",required:!0})};async function Bm(t){let e=await _t(t.auth),r=t.propsValue.calendar_id,n=t.propsValue.eventId;return(await(0,Ex.calendar)({version:"v3",auth:e}).events.delete({calendarId:r,eventId:n})).data}o(Bm,"runDeleteEvent");var Sx=ve({displayName:"Delete Event",auth:ne,name:"delete_event",description:"Deletes an event from Google Calendar.",audience:"human",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:dL,run:Bm});var Vm=qe(Sn());var Gm={calendar_id:ae.calendarDropdown("writer"),event_types:F.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:F.ShortText({displayName:"Search Term",required:!1}),start_date:F.DateTime({displayName:"Date from",required:!1}),end_date:F.DateTime({displayName:"Date to",required:!1}),singleEvents:F.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})};async function Hm(t){let{calendar_id:e,start_date:r,end_date:n,search:i,event_types:s,singleEvents:c}=t.propsValue,d=await Ie(t.auth),p={showDeleted:"false"},m=`${ae.baseUrl}/calendars/${e}/events`;c!==null&&(p.singleEvents=c?"true":"false"),i&&(p.q=`"${i}"`),r&&(p.timeMin=(0,Vm.default)(r).format("YYYY-MM-DDTHH:mm:ss.sssZ")),r&&n&&(p.timeMax=(0,Vm.default)(n).format("YYYY-MM-DDTHH:mm:ss.sssZ")),s.length>0&&(m+=`?${s.map(h=>`eventTypes=${h}`).join("&")}`);let y={method:"GET",url:m,queryParams:p,authentication:{type:"BEARER_TOKEN",token:d}};return await Ue.sendRequest(y)}o(Hm,"runGetEvents");var wx=ve({auth:ne,name:"google_calendar_get_events",description:"Get Events",audience:"human",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:Gm,outputSchema:Hc,run:Hm});var Tx=qe(xn());var Wm=qe(Sn());var Kc={calendar_id:ae.calendarDropdown("writer"),eventId:F.ShortText({displayName:"Event ID",required:!0}),title:F.ShortText({displayName:"Title of the event",required:!1}),start_date_time:F.DateTime({displayName:"Start date time of the event",required:!1}),end_date_time:F.DateTime({displayName:"End date time of the event",required:!1}),location:F.ShortText({displayName:"Location",required:!1}),description:F.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1}),colorId:ae.colorId,attendees:F.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!1}),guests_can_modify:F.Checkbox({displayName:"Guests can modify",defaultValue:!1,required:!1}),guests_can_invite_others:F.Checkbox({displayName:"Guests can invite others",defaultValue:!1,required:!1}),guests_can_see_other_guests:F.Checkbox({displayName:"Guests can see other guests",defaultValue:!1,required:!1})};async function Zm(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:m,guests_can_modify:y,guests_can_see_other_guests:h}=t.propsValue,f=t.propsValue.attendees,l=await _t(t.auth),g=(0,Tx.calendar)({version:"v3",auth:l}),v=await g.events.get({calendarId:e,eventId:r}),E=[];return Array.isArray(f)&&f.length>0?E=f.map(C=>({email:C})):v.data.attendees&&Array.isArray(v.data.attendees)&&(E=v.data.attendees),(await g.events.update({calendarId:e,eventId:r,requestBody:{summary:n??v.data.summary,attendees:E,description:d??v.data.description,colorId:p,location:c??v.data.location,start:i?{dateTime:(0,Wm.default)(i).format("YYYY-MM-DDTHH:mm:ss.sssZ")}:v.data.start,end:s?{dateTime:(0,Wm.default)(s).format("YYYY-MM-DDTHH:mm:ss.sssZ")}:v.data.end,guestsCanInviteOthers:m??v.data.guestsCanInviteOthers,guestsCanModify:y??v.data.guestsCanModify,guestsCanSeeOtherGuests:h??v.data.guestsCanSeeOtherGuests}})).data}o(Zm,"runUpdateEvent");var Px=ve({displayName:"Update Event",auth:ne,name:"update_event",description:"Updates an event in Google Calendar.",audience:"human",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:Kc,outputSchema:Ze,run:Zm});var Jc={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 la(e,r,t,i)??[]).map(d=>({epochMilliSeconds:new Date(d.updated).getTime(),data:d}))},"items")},xx=jt({auth:ne,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:ae.calendarDropdown(),expandRecurringEvent:F.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:Ze,type:"POLLING",async test({store:t,auth:e,propsValue:r,files:n}){return await Je.test(Jc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent},files:n})},async onEnable({store:t,auth:e,propsValue:r}){await Je.onEnable(Jc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent}})},async onDisable({store:t,auth:e,propsValue:r}){await Je.onDisable(Jc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent}})},async run({store:t,auth:e,propsValue:r,files:n}){return await Je.poll(Jc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent},files:n})}});var Ax=qe(xn());var Ix=ve({auth:ne,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:ae.calendarDropdown("writer"),eventId:F.ShortText({displayName:"Event ID",required:!0}),attendees:F.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!0})},outputSchema:Ze,async run(t){let{calendar_id:e,eventId:r}=t.propsValue,n=t.propsValue.attendees,i=await _t(t.auth),s=(0,Ax.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(y=>({email:y}))),(await s.events.update({calendarId:e,eventId:r,requestBody:{...c.data,attendees:p}})).data}});var Km=qe(Sn());var Jm={calendar_ids:F.MultiSelectDropdown({auth:ne,displayName:"Calendars",description:"Select the calendars to check for busy periods.",required:!0,refreshers:[],options:o(async({auth:t})=>t?{disabled:!1,options:(await kt(t)).map(n=>({label:n.summary,value:n.id}))}:{disabled:!0,placeholder:"Connect your account first",options:[]},"options")}),start_date:F.DateTime({displayName:"Start Time",description:"The start of the time range to check.",required:!0}),end_date:F.DateTime({displayName:"End Time",description:"The end of the time range to check.",required:!0})};async function Ym(t){let{calendar_ids:e,start_date:r,end_date:n}=t.propsValue,i=await Ie(t.auth),s={timeMin:(0,Km.default)(r).toISOString(),timeMax:(0,Km.default)(n).toISOString(),items:e.map(p=>({id:p}))},c={method:"POST",url:`${ae.baseUrl}/freeBusy`,body:s,authentication:{type:"BEARER_TOKEN",token:i}};return(await Ue.sendRequest(c)).body}o(Ym,"runFindFreeBusy");var Rx=ve({auth:ne,name:"google_calendar_find_busy_free_periods",displayName:"Find Busy/Free Periods in Calendar",description:"Finds free/busy calendar details from Google Calendar.",audience:"human",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:Jm,outputSchema:Wc,run:Ym});var Xm={calendar_id:ae.calendarDropdown(),event_id:F.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:F.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:F.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})};async function Qm(t){let{calendar_id:e,event_id:r,max_attendees:n,time_zone:i}=t.propsValue,s=await Ie(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=`${ae.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 Ue.sendRequest(p)).body}catch(m){throw m.response?.status===404?new Error(`Event with ID "${r}" not found in calendar "${e}". Please verify the event ID and calendar selection.`):m.response?.status===403?new Error(`Access denied to event "${r}" in calendar "${e}". Please check your permissions.`):m.response?.status===400?new Error("Invalid request parameters. Please check the event ID format and other parameters."):m.response?.status===401?new Error("Authentication failed. Please reconnect your Google Calendar account."):new Error(`Failed to fetch event: ${m.message||"Unknown error occurred"}`)}}o(Qm,"runGetEventById");var Cx=ve({auth:ne,name:"google_calendar_get_event_by_id",displayName:"Get Event by ID",description:"Fetch event details by its unique ID from Google Calendar.",audience:"human",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:Xm,outputSchema:Ze,run:Qm});var eh=qe(Sn()),Ox=ve({auth:ne,name:"google_calendar_search_events_all_calendars",displayName:"Search Events Across Calendars",description:"Searches every calendar the account can access for events matching a keyword within a required time window.",audience:"ai",aiMetadata:{description:"Search all of the user's calendars at once for events matching a text query within a required time window, returning each match tagged with its owning calendarId so you can then get/update/delete it. Use this instead of Get all Events when you know a keyword and time range but do NOT know which calendar the event lives in (Get all Events searches a single calendar). A start and end time are mandatory to bound the cross-calendar scan; matching uses Google's native q= filter, not semantic search. Read-only and idempotent.",idempotent:!0},props:{query:F.ShortText({displayName:"Search Term",description:`Free-text query matched against event fields (summary, description, location, attendee names/emails) using Google's native search. Example: "budget review".`,required:!0}),start_date:F.DateTime({displayName:"Start Time",description:`Lower bound (inclusive) for an event's end time, as an ISO 8601 timestamp (e.g. "2026-06-01T00:00:00Z"). Required to bound the cross-calendar scan.`,required:!0}),end_date:F.DateTime({displayName:"End Time",description:`Upper bound (exclusive) for an event's start time, as an ISO 8601 timestamp (e.g. "2026-06-30T23:59:59Z"). Required to bound the cross-calendar scan.`,required:!0}),single_events:F.Checkbox({displayName:"Expand Recurring Events?",description:"When enabled, recurring events are expanded into their individual instances instead of returning the underlying recurring event.",required:!1,defaultValue:!0})},outputSchema:gx,async run(t){let{query:e,start_date:r,end_date:n,single_events:i}=t.propsValue,s=await Ie(t.auth),c=(0,eh.default)(r).toISOString(),d=(0,eh.default)(n).toISOString(),p=await kt(t.auth),m=[],y=[];for(let h of p){let f="";do{let l={q:e,timeMin:c,timeMax:d,singleEvents:i?"true":"false",showDeleted:"false",maxResults:"250"};f&&(l.pageToken=f);let g={method:"GET",url:`${ae.baseUrl}/calendars/${encodeURIComponent(h.id)}/events`,queryParams:l,authentication:{type:"BEARER_TOKEN",token:s}};try{let v=await Ue.sendRequest(g),E=v.body.items??[];for(let b of E)m.push({...b,calendarId:h.id});f=v.body.nextPageToken}catch(v){let E=v.response?.status;if(E===403||E===404){y.push({calendarId:h.id,status:E}),f="";continue}throw E===429?new Error("Google Calendar rate limit reached while searching calendars. Please retry shortly."):v}}while(f)}return{events:m,count:m.length,calendars_searched:p.length-y.length,...y.length>0?{skipped_calendars:y,warning:"Some calendars could not be searched (access denied or not found); a missing match may live in a skipped calendar. See skipped_calendars."}:{}}}});var Sr=qe(Sn()),$x=qe(kx());Sr.default.extend($x.default);function pL(t){if(t.length===0)return[];let e=[...t].sort((n,i)=>n.start-i.start),r=[{...e[0]}];for(let n=1;n<e.length;n++){let i=r[r.length-1],s=e[n];s.start<=i.end?i.end=Math.max(i.end,s.end):r.push({...s})}return r}o(pL,"mergeIntervals");function fL(t,e,r){let n=[],i=e;for(let s of t)if(s.start>i&&n.push({start:i,end:Math.min(s.start,r)}),i=Math.max(i,s.end),i>=r)break;return i<r&&n.push({start:i,end:r}),n.filter(s=>s.end>s.start)}o(fL,"complement");function mL(t,e,r){let n=[];for(let i of t){let s=Sr.default.utc(i.start).startOf("day"),c=Sr.default.utc(i.end);for(;s.valueOf()<i.end;){let d=s.add(e,"hour"),p=s.add(r,"hour"),m=Math.max(i.start,d.valueOf()),y=Math.min(i.end,p.valueOf());if(y>m&&n.push({start:m,end:y}),s=s.add(1,"day"),s.valueOf()>c.valueOf())break}}return n}o(mL,"clipToWorkingHours");var Dx=ve({auth:ne,name:"google_calendar_find_free_slots",displayName:"Find Free Time Slots",description:"Computes open time slots shared across one or more calendars within a window, by inverting their busy blocks.",audience:"ai",aiMetadata:{description:'Return the OPEN time slots common to the selected calendars within a window \u2014 the inverse of their combined busy blocks, optionally filtered to a minimum duration and to working hours. Use this instead of Find Busy/Free Periods (which returns only busy blocks and forces you to invert and reconcile them yourself) when you need the actual free intervals to answer "when can everyone meet". Idempotent because it performs no writes, but the result depends entirely on the window: pass absolute start/end times, since a window relative to "now" yields a shifting set of slots.',idempotent:!0},props:{calendar_ids:F.MultiSelectDropdown({auth:ne,displayName:"Calendars",description:"The calendars whose schedules must all be free. A slot is returned only when it is open on every selected calendar.",required:!0,refreshers:[],options:o(async({auth:t})=>t?{disabled:!1,options:(await kt(t)).map(n=>({label:n.summary,value:n.id}))}:{disabled:!0,placeholder:"Connect your account first",options:[]},"options")}),start_date:F.DateTime({displayName:"Window Start",description:'Start of the search window, as an absolute ISO 8601 timestamp (e.g. "2026-06-01T09:00:00Z"). Prefer absolute times over relative ones.',required:!0}),end_date:F.DateTime({displayName:"Window End",description:'End of the search window, as an absolute ISO 8601 timestamp (e.g. "2026-06-05T18:00:00Z").',required:!0}),min_duration_minutes:F.Number({displayName:"Minimum Slot Duration (minutes)",description:"Discard any open slot shorter than this many minutes. Leave empty to return every open slot regardless of length.",required:!1}),working_hours_start:F.Number({displayName:"Working Hours Start (hour 0-23)",description:"If set together with Working Hours End, each day's open slots are clipped to this hour range, interpreted in UTC (not the calendar's local time zone). Example: 9 for 09:00 UTC. Leave both unset to return slots across the full window.",required:!1}),working_hours_end:F.Number({displayName:"Working Hours End (hour 0-23)",description:"Upper bound of the daily working-hours window. Example: 17 for 5 PM. Ignored unless Working Hours Start is also set.",required:!1})},outputSchema:fx,async run(t){let{calendar_ids:e,start_date:r,end_date:n,min_duration_minutes:i,working_hours_start:s,working_hours_end:c}=t.propsValue,d=await Ie(t.auth),p=(0,Sr.default)(r).valueOf(),m=(0,Sr.default)(n).valueOf();if(m<=p)throw new Error("Window End must be after Window Start.");let y={method:"POST",url:`${ae.baseUrl}/freeBusy`,body:{timeMin:(0,Sr.default)(r).toISOString(),timeMax:(0,Sr.default)(n).toISOString(),items:e.map(b=>({id:b}))},authentication:{type:"BEARER_TOKEN",token:d}},h=await Ue.sendRequest(y),f=[],l=[];for(let b of Object.keys(h.body.calendars)){let C=h.body.calendars[b];if(C.errors?.length){l.push({calendarId:b,errors:C.errors});continue}let U=C.busy??[];for(let J of U)f.push({start:(0,Sr.default)(J.start).valueOf(),end:(0,Sr.default)(J.end).valueOf()})}if(l.length>0)throw new Error(`Could not read availability for calendar(s): ${l.map(b=>`${b.calendarId} (${b.errors.map(C=>C.reason).join(", ")})`).join("; ")}. A slot can only be marked free if every selected calendar is free, so free slots cannot be computed while any of them are unreadable. Verify the calendar IDs with List Calendars.`);let g=pL(f),v=fL(g,p,m);if(s!==void 0&&c!==void 0&&c>s&&(v=mL(v,s,c)),i!==void 0&&i>0){let b=i*60*1e3;v=v.filter(C=>C.end-C.start>=b)}let E=v.map(b=>({start:(0,Sr.default)(b.start).toISOString(),end:(0,Sr.default)(b.end).toISOString(),duration_minutes:Math.round((b.end-b.start)/6e4)}));return{free_slots:E,count:E.length}}});var Nx=qe(xn());var nh=qe(Sn()),zx=ve({auth:ne,name:"google_calendar_list_recurring_event_instances",displayName:"List Recurring Event Instances",description:"Lists the individual occurrences of one recurring event series, each with its own instance event ID.",audience:"ai",aiMetadata:{description:"List the individual occurrences of a single recurring event series, identified by its recurring-event ID, each returned with its own distinct instance event ID. Use this when you need to inspect, reschedule, or cancel ONE occurrence of a series rather than the whole series; Get all Events expands recurring events only across a whole-calendar window and cannot target one series by ID. Requires the recurring series' event ID; optionally bound by a time range. Read-only and idempotent.",idempotent:!0},props:{calendar_id:ae.calendarDropdown(),event_id:F.ShortText({displayName:"Recurring Event ID",description:'The event ID of the recurring SERIES (the parent), e.g. "abc123def456". Obtain it from Search Events Across Calendars or Get all Events. Individual instance IDs will not work here.',required:!0}),time_min:F.DateTime({displayName:"Start Time",description:`Optional lower bound (inclusive) for an instance's end time, as an ISO 8601 timestamp with offset (e.g. "2026-06-01T00:00:00Z").`,required:!1}),time_max:F.DateTime({displayName:"End Time",description:`Optional upper bound (exclusive) for an instance's start time, as an ISO 8601 timestamp with offset (e.g. "2026-06-30T23:59:59Z").`,required:!1}),show_deleted:F.Checkbox({displayName:"Include Cancelled Instances",description:"Whether to include cancelled (deleted) instances of the series in the result. Defaults to false.",required:!1,defaultValue:!1}),max_results:F.Number({displayName:"Max Results",description:"Maximum number of instances to return per page (1-2500). Defaults to the API default of 250.",required:!1})},outputSchema:mx,async run(t){let{calendar_id:e,event_id:r,time_min:n,time_max:i,show_deleted:s,max_results:c}=t.propsValue,d=await _t(t.auth),p=(0,Nx.calendar)({version:"v3",auth:d});try{let m=await p.events.instances({calendarId:e,eventId:r,timeMin:n?(0,nh.default)(n).toISOString():void 0,timeMax:i?(0,nh.default)(i).toISOString():void 0,showDeleted:s??!1,maxResults:c}),y=m.data.items??[];return{instances:y,count:y.length,nextPageToken:m.data.nextPageToken??null}}catch(m){let y=m.response?.status??m.code;throw y===404?new Error(`Recurring event "${r}" not found in calendar "${e}". Verify the ID belongs to a recurring series.`):y===400?new Error(`Invalid request: "${r}" may not be a recurring event. The instances endpoint only works on recurring series.`):y===403?new Error(`Access denied to event "${r}" in calendar "${e}". Check your permissions.`):m}}});var Ux=qe(xn());var Mx=ve({auth:ne,name:"google_calendar_move_event",displayName:"Move Event to Another Calendar",description:"Moves an existing event from one calendar to another, preserving its event ID and metadata.",audience:"ai",aiMetadata:{description:"Move an existing event from a source calendar to a destination calendar in place, preserving the event ID, conferencing, and attendee state. Use this instead of deleting and recreating the event (which loses the ID and metadata) when you need to transfer an event between calendars. Idempotent: moving an event to the calendar it already lives on is treated as a no-op. The source and destination must be writable calendars.",idempotent:!0},props:{calendar_id:ae.calendarDropdown("writer"),event_id:F.ShortText({displayName:"Event ID",description:'The ID of the event to move, e.g. "abc123def456". Obtain it from Search Events Across Calendars or Get all Events.',required:!0}),destination_calendar_id:F.Dropdown({auth:ne,displayName:"Destination Calendar",description:"The calendar to move the event to.",refreshers:[],required:!0,options:o(async({auth:t})=>t?{disabled:!1,options:(await kt(t,"writer")).map(r=>({label:r.summary,value:r.id}))}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),send_updates:F.StaticDropdown({displayName:"Send Notifications",description:"Who should receive notifications about the change of the event's organizer.",required:!1,defaultValue:"none",options:{options:[{label:"To everyone",value:"all"},{label:"To external guests only",value:"externalOnly"},{label:"To no one",value:"none"}]}})},outputSchema:hx,async run(t){let{calendar_id:e,event_id:r,destination_calendar_id:n,send_updates:i}=t.propsValue,s=await _t(t.auth),c=(0,Ux.calendar)({version:"v3",auth:s});if(e===n)return{moved:!1,already_in_destination:!0,event:(await c.events.get({calendarId:n,eventId:r})).data};try{return await c.events.move({calendarId:e,eventId:r,destination:n,sendUpdates:i??"none"}),{moved:!0,already_in_destination:!1,event:(await c.events.get({calendarId:n,eventId:r})).data}}catch(d){let p=d.response?.status??d.code;throw p===404?new Error(`Event "${r}" not found in source calendar "${e}". Verify the event ID and source calendar.`):p===403?new Error(`Access denied while moving event "${r}". Both the source and destination calendars must be writable.`):p===400?new Error(`Invalid move request for event "${r}". The destination must differ from the source and both must be valid calendars.`):d}}});var Lx=ve({auth:ne,name:"google_calendar_create_event",displayName:"Create Event",description:"Create a new event on a Google Calendar with structured fields (title, start/end, location, description, attendees, color) and an optional Google Meet link.",audience:"ai",aiMetadata:{description:'Create a new event on a calendar from explicit structured fields (title, start/end times, location, description, attendees, color, guest permissions) with an optional Google Meet link. Use this when you already have the event details; for a single natural-language phrase use the quick-add path instead. Resolve calendarId via google_calendar_list_calendars (default "primary"). Requires a title and start time; end defaults to 30 minutes after start. Not idempotent: each call creates a new event.',idempotent:!1},props:Fm,outputSchema:Ze,run:qm});var{eventId:pre,calendar_id:fre,guests_can_modify:mre,guests_can_invite_others:hre,guests_can_see_other_guests:gre,...hL}=Kc;function oh(t){return F.StaticDropdown({displayName:t,description:"Leave unset to keep the event's current value.",required:!1,options:{options:[{label:"True",value:"true"},{label:"False",value:"false"}]}})}o(oh,"guestPermissionProp");function ih(t){return t===void 0?void 0:t==="true"}o(ih,"toOptionalBoolean");var gL={calendar_id:Kc.calendar_id,event_id:F.ShortText({displayName:"Event ID",description:"The ID of the event to update. Resolve it via List Events or Search Events Across Calendars.",required:!0}),...hL,guests_can_modify:oh("Guests can modify"),guests_can_invite_others:oh("Guests can invite others"),guests_can_see_other_guests:oh("Guests can see other guests")},jx=ve({auth:ne,name:"google_calendar_update_event",displayName:"Update Event",description:"Update fields of an existing Google Calendar event by ID using a safe get-then-merge; fields you leave unset keep their current values.",audience:"ai",aiMetadata:{description:"Update fields of an existing event (title, times, location, description, color, attendees, guest permissions) identified by calendar and event ID. It fetches the event first and merges, so unset fields keep their current values (it never blanks out attendees/recurrence/conferencing). Use this to edit or reschedule an existing event rather than recreating it. Resolve calendarId via google_calendar_list_calendars and eventId via google_calendar_list_events / google_calendar_search_events_all_calendars. Idempotent: applying the same field values repeatedly leaves the event in the same state.",idempotent:!0},props:gL,outputSchema:Ze,run:o(t=>Zm({...t,propsValue:{...t.propsValue,eventId:t.propsValue.event_id,guests_can_modify:ih(t.propsValue.guests_can_modify),guests_can_invite_others:ih(t.propsValue.guests_can_invite_others),guests_can_see_other_guests:ih(t.propsValue.guests_can_see_other_guests)}}),"run")});var yL={calendar_id:ae.calendarDropdown("writer"),event_id:F.ShortText({displayName:"Event ID",description:"The ID of the event to delete. Resolve it via List Events or Search Events Across Calendars.",required:!0})},Fx=ve({auth:ne,name:"google_calendar_delete_event",displayName:"Delete Event",description:"Permanently delete an event from a Google Calendar by its event ID.",audience:"ai",aiMetadata:{description:"Permanently delete an event from a calendar, identified by calendar and event ID. Use to cancel or remove an existing event; this cannot be undone, so confirm the event ID first. Resolve calendarId via google_calendar_list_calendars and eventId via google_calendar_list_events / google_calendar_search_events_all_calendars. Idempotent: once deleted, re-running leaves the event absent (a repeat call may report it as already gone).",idempotent:!0},props:yL,run:o(t=>Bm({...t,propsValue:{calendar_id:t.propsValue.calendar_id,eventId:t.propsValue.event_id}}),"run")});var qx=ve({auth:ne,name:"google_calendar_get_event",displayName:"Get Event",description:"Fetch the full details of a single Google Calendar event by its event ID.",audience:"ai",aiMetadata:{description:"Fetch the full details of one event by its unique event ID within a calendar. Use this when you already have an event ID (from a trigger or a list action) and need its current details; to find an event when you do not have its ID, use google_calendar_list_events or google_calendar_search_events_all_calendars instead. Resolve calendarId via google_calendar_list_calendars and eventId via google_calendar_list_events / google_calendar_search_events_all_calendars. Read-only and idempotent.",idempotent:!0},props:Xm,outputSchema:Ze,run:Qm});var Bx=ve({auth:ne,name:"google_calendar_list_events",displayName:"List Events",description:"List events from one Google Calendar, optionally filtered by date range, free-text search, and event types.",audience:"ai",aiMetadata:{description:`List events from one calendar, optionally narrowed by a date range, a free-text search term (matched with Google's native q= filter), and event types, optionally expanding recurring events into individual instances. Use this to browse or find events in a known calendar, including text search within that calendar; to search across every calendar when you do not know which one holds the event, use google_calendar_search_events_all_calendars instead. Resolve calendarId via google_calendar_list_calendars (default "primary"). Read-only and idempotent.`,idempotent:!0},props:Gm,outputSchema:Hc,run:Hm});var Vx=ve({auth:ne,name:"google_calendar_find_busy_periods",displayName:"Find Busy Periods",description:"Return the raw busy time blocks of one or more calendars within a window, via the freebusy query.",audience:"ai",aiMetadata:{description:"Query one or more calendars for their raw busy time blocks within a start/end window, without exposing event details (the low-level freebusy primitive). Use this when you need the busy intervals themselves (e.g. across several shared calendars); to get the inverse open slots directly, use google_calendar_find_free_slots instead. Resolve calendarId values via google_calendar_list_calendars. Requires the calendars to check and a time range. Read-only and idempotent.",idempotent:!0},props:Jm,outputSchema:Wc,run:Ym});var Gx=qe(xn());var Hx=ve({auth:ne,name:"google_calendar_remove_attendee",displayName:"Remove Attendee",description:"Remove one attendee (by email) from an existing Google Calendar event, preserving the rest of the guest list.",audience:"ai",aiMetadata:{description:"Remove a single attendee, matched by email, from an existing event by fetching the current attendee list, dropping that one guest, and patching the event. Use this to uninvite one person without disturbing the other guests; to add guests use the add-attendees action instead. Resolve calendarId via google_calendar_list_calendars and eventId via google_calendar_list_events / google_calendar_search_events_all_calendars. Not idempotent (notifications may fire), though re-removing an already-absent attendee is a no-op on state. It uses optimistic concurrency (If-Match on the event revision), so a simultaneous edit by someone else fails with a retry-able conflict instead of silently clobbering their change.",idempotent:!1},props:{calendar_id:ae.calendarDropdown("writer"),event_id:F.ShortText({displayName:"Event ID",description:"The ID of the event to remove the attendee from. Resolve it via List Events or Search Events Across Calendars.",required:!0}),attendee_email:F.ShortText({displayName:"Attendee Email",description:"Email address of the attendee to remove from the event.",required:!0}),send_updates:F.StaticDropdown({displayName:"Send Notifications",description:"Who should be notified about the attendee change.",required:!1,defaultValue:"none",options:{options:[{label:"To everyone",value:"all"},{label:"To external guests only",value:"externalOnly"},{label:"To no one",value:"none"}]}})},outputSchema:px,async run(t){let{calendar_id:e,event_id:r,attendee_email:n,send_updates:i}=t.propsValue,s=await _t(t.auth),c=(0,Gx.calendar)({version:"v3",auth:s}),d=n.trim().toLowerCase();try{let p=await c.events.get({calendarId:e,eventId:r}),m=p.data.attendees??[],y=m.filter(l=>(l.email??"").trim().toLowerCase()!==d);if(y.length===m.length)return{removed:!1,attendee_email:n,message:`Attendee "${n}" was not on event "${r}"; nothing to remove.`,event:p.data};let h=p.data.etag??void 0,f=await c.events.patch({calendarId:e,eventId:r,sendUpdates:i??"none",requestBody:{attendees:y}},h?{headers:{"If-Match":h}}:{});return{removed:!0,attendee_email:n,event:f.data}}catch(p){let m=p.response?.status??p.code;throw m===412?new Error(`Event "${r}" changed since it was read (a concurrent edit). Re-run Remove Attendee to retry against the latest version.`):m===404?new Error(`Event "${r}" not found in calendar "${e}". Verify the event ID and calendar.`):m===403?new Error(`Access denied while editing event "${r}". The calendar must be writable.`):p}}});var Wx=qe(xn());var ah=qe(Sn()),Zx=ve({auth:ne,name:"google_calendar_import_event",displayName:"Import Event",description:"Import an existing event (by iCalUID) into a Google Calendar as a private copy, using events.import.",audience:"ai",aiMetadata:{description:'Import an existing event into a calendar as a private copy, keyed by its iCalUID with a start and end time (the events.import primitive, distinct from creating a brand-new event or moving one). Use this to copy or de-duplicate an event across calendars; re-importing the same iCalUID updates the existing copy rather than duplicating it. Resolve calendarId via google_calendar_list_calendars (default "primary"). Only default (non-special) events can be imported. Not idempotent: each import can create or mutate the destination copy.',idempotent:!1},props:{calendar_id:ae.calendarDropdown("writer"),ical_uid:F.ShortText({displayName:"iCal UID",description:`The event's iCalUID (its globally unique identifier, e.g. "abc123@google.com"). This is the dedup key: re-importing the same UID updates the existing copy.`,required:!0}),summary:F.ShortText({displayName:"Title",description:"Title (summary) of the imported event.",required:!0}),start_date_time:F.DateTime({displayName:"Start Time",description:'Event start as an ISO 8601 timestamp (e.g. "2026-06-01T09:00:00Z").',required:!0}),end_date_time:F.DateTime({displayName:"End Time",description:'Event end as an ISO 8601 timestamp (e.g. "2026-06-01T10:00:00Z").',required:!0}),location:F.ShortText({displayName:"Location",required:!1}),description:F.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1})},outputSchema:Ze,async run(t){let{calendar_id:e,ical_uid:r,summary:n,start_date_time:i,end_date_time:s,location:c,description:d}=t.propsValue,p=await _t(t.auth),m=(0,Wx.calendar)({version:"v3",auth:p});try{return(await m.events.import({calendarId:e,requestBody:{iCalUID:r,summary:n,location:c??void 0,description:d??void 0,start:{dateTime:(0,ah.default)(i).toISOString()},end:{dateTime:(0,ah.default)(s).toISOString()}}})).data}catch(y){let h=y.response?.status??y.code;throw h===403?new Error(`Access denied while importing into calendar "${e}". The calendar must be writable.`):h===400?new Error(`Invalid import request. Ensure iCalUID, start, and end are provided and that the event is a default (non-special) event. (${y.message})`):y}}});var Kx=ve({auth:ne,name:"google_calendar_list_calendars",displayName:"List Calendars",description:"List every calendar in the user's calendar list, returning each calendar's id, summary, access role, time zone, and whether it is primary.",audience:"ai",aiMetadata:{description:`List all calendars on the user's calendar list, returning each one's calendarId, summary, accessRole, timeZone, and whether it is the primary calendar. This is the calendarId resolver: call it first to discover which calendars exist and obtain the calendarId that every event/freebusy atomic needs (default "primary"). Read-only and idempotent.`,idempotent:!0},props:{},outputSchema:lx,async run(t){await Ie(t.auth);let e=await kt(t.auth);return{calendars:e.map(r=>({id:r.id,summary:r.summary,description:r.description,location:r.location,timeZone:r.timeZone,accessRole:r.accessRole,primary:r.primary??!1,selected:r.selected??!1,backgroundColor:r.backgroundColor,foregroundColor:r.foregroundColor})),count:e.length}}});var Jx=ve({auth:ne,name:"google_calendar_get_calendar",displayName:"Get Calendar",description:"Fetch one calendar's metadata (summary, time zone, description, location) by its calendar ID.",audience:"ai",aiMetadata:{description:`Fetch one calendar's metadata \u2014 summary, timeZone, description, and location \u2014 by its calendar ID. Use this to read a calendar's time zone, which is load-bearing when constructing correct event start/end windows. Resolve calendarId via google_calendar_list_calendars (default "primary"). Read-only and idempotent.`,idempotent:!0},props:{calendar_id:ae.calendarDropdown()},outputSchema:ux,async run(t){let{calendar_id:e}=t.propsValue,r=await Ie(t.auth),n={method:"GET",url:`${ae.baseUrl}/calendars/${encodeURIComponent(e)}`,authentication:{type:"BEARER_TOKEN",token:r}};try{return(await Ue.sendRequest(n)).body}catch(i){let s=i.response?.status;throw s===404?new Error(`Calendar "${e}" not found. Verify the calendar ID via List Calendars.`):s===403?new Error(`Access denied to calendar "${e}". Check your permissions.`):i}}});var Yx=ve({auth:ne,name:"google_calendar_get_colors",displayName:"Get Colors",description:"Fetch the Google Calendar color palette mapping colorId values to their hex background/foreground colors.",audience:"ai",aiMetadata:{description:"Fetch the global color palette: the mapping from each colorId to its background/foreground hex color, for both events and calendars. Use this to resolve a colorId before setting the color on google_calendar_create_event or google_calendar_update_event. Read-only and idempotent.",idempotent:!0},props:{},outputSchema:cx,async run(t){return await lu(t.auth)}});var Xx=ve({auth:ne,name:"google_calendar_list_settings",displayName:"List Settings",description:"List the user's Google Calendar account settings (time zone, week start, date/time format, and more).",audience:"ai",aiMetadata:{description:`List all of the user's Google Calendar account settings as id/value pairs \u2014 including the account "timezone", "weekStart", and "format24HourTime". Use this to read the account time zone to anchor relative-date reasoning before building event windows, or to read a single setting (just pick its id from the returned list). Read-only and idempotent.`,idempotent:!0},props:{},outputSchema:dx,async run(t){let e=await Ie(t.auth),r={method:"GET",url:`${ae.baseUrl}/users/me/settings`,authentication:{type:"BEARER_TOKEN",token:e}},i=(await Ue.sendRequest(r)).body.items??[],s={};for(let c of i)s[c.id]=c.value;return{settings:s,items:i,count:i.length}}});var Yc="google_calendar_watch",Ci="google_calendar_sync_token",sh="google_calendar_seen_event_ids",vL=500;function Qx(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(Qx,"matchesFilters");var eA=jt({auth:ne,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:ae.calendarDropdown("writer"),event_types:F.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:F.ShortText({displayName:"Search Filter",description:"Only trigger for events containing this text in title, description, or location (optional)",required:!1}),exclude_all_day:F.Checkbox({displayName:"Exclude All-Day Events",description:"Skip triggering for all-day events",required:!1,defaultValue:!1})},outputSchema:Ze,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 zd(e,t.webhookUrl,r);await t.store.put(Yc,n);let i=await cu({calendarId:e,authProp:r});it(i)||await t.store.put(Ci,i)},async onDisable(t){let e=t.auth,r=await t.store.get(Yc);r&&await Nd(r,e),await t.store.delete(Ci),await t.store.delete(sh)},async onRenew(t){let e=t.propsValue.calendar_id,r=t.auth,n=await t.store.get(Yc);n&&await Nd(n,r);let i=await zd(e,t.webhookUrl,r);await t.store.put(Yc,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(Ci);if(it(d)){let g=await cu({calendarId:s,authProp:c});return it(g)||await t.store.put(Ci,g),[]}let{items:p,nextSyncToken:m,syncTokenInvalid:y}=await Ub({calendarId:s,syncToken:d,authProp:c});if(y){let g=await cu({calendarId:s,authProp:c});return it(g)||await t.store.put(Ci,g),[]}it(m)||await t.store.put(Ci,m);let h=await t.store.get(sh),f=new Set(h??[]),l=[];for(let g of p)!g.id||g.status==="cancelled"||f.has(g.id)||(f.add(g.id),Qx(g,i)&&l.push(g));if(f.size!==(h?.length??0)){let g=Array.from(f).slice(-vL);await t.store.put(sh,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 Mb(t.propsValue.calendar_id,e);return Qx(n,r)?[n]:[]}});var Xc={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 m={method:"GET",url:`${ae.baseUrl}/calendars/${n}/events/${s}`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};try{let h=(await Ue.sendRequest(m)).body,f=h.end?.dateTime??h.end?.date;f&&new Date(f).getTime()>r&&(c=[h])}catch(y){return console.error("Error fetching specific event:",y),[]}}else{let m={method:"GET",url:`${ae.baseUrl}/calendars/${n}/events`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)},queryParams:{singleEvents:"true",orderBy:"startTime",timeMin:new Date(r).toISOString()}};c=(await Ue.sendRequest(m)).body.items}let d=[],p=Date.now();for(let m of c){let y=m.end?.dateTime??m.end?.date;if(!y)continue;let h=new Date(y).getTime();h>r&&h<=p&&d.push({epochMilliSeconds:h,data:m})}return d},"items")},tA=jt({auth:ne,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:ae.calendarDropdown("writer"),specific_event:F.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:ae.eventDropdown(!1)},outputSchema:Ze,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 Je.onEnable(Xc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(Xc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(Xc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await Je.test(Xc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var Qc={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(),m=300*1e3,y=new Date(p+d).toISOString(),h=new Date(p+d+m).toISOString(),f=[];if(n&&i){let l={method:"GET",url:`${ae.baseUrl}/calendars/${r}/events/${i}`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};try{let v=(await Ue.sendRequest(l)).body,b=new Date(v.start?.dateTime??v.start?.date??0).getTime()-d;b>=p&&b<=p+m&&(f=[v])}catch(g){return console.error("Error fetching specific event:",g),[]}}else{let l={method:"GET",url:`${ae.baseUrl}/calendars/${r}/events`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)},queryParams:{singleEvents:"true",orderBy:"startTime",timeMin:y,timeMax:h}};f=(await Ue.sendRequest(l)).body.items}return f.map(l=>({epochMilliSeconds:new Date(l.start?.dateTime??l.start?.date??0).getTime()-d,data:l}))},"items")},rA=jt({auth:ne,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:ae.calendarDropdown("writer"),specific_event:F.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:ae.eventDropdown(!1),time_value:F.Number({displayName:"Time Before",description:"The amount of time before the event starts.",required:!0,defaultValue:15}),time_unit:F.StaticDropdown({displayName:"Time Unit",required:!0,options:{options:[{label:"Minutes",value:"minutes"},{label:"Hours",value:"hours"},{label:"Days",value:"days"}]},defaultValue:"minutes"})},outputSchema:Ze,type:"POLLING",sampleData:{},async onEnable(t){await Je.onEnable(Qc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(Qc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(Qc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await Je.test(Qc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var el={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 m={method:"GET",url:`${ae.baseUrl}/calendars/${n}/events`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)},queryParams:p};return(await Ue.sendRequest(m)).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 b=i.toLowerCase();return c.some(C=>{switch(C){case"summary":return l.summary?.toLowerCase().includes(b)||!1;case"description":return l.description?.toLowerCase().includes(b)||!1;case"location":return l.location?.toLowerCase().includes(b)||!1;case"attendees":return l.attendees?.some(U=>U.email?.toLowerCase().includes(b)||U.displayName?.toLowerCase().includes(b))||!1;default:return!1}})}return!0}).map(l=>({epochMilliSeconds:new Date(l.updated).getTime(),data:l}))},"items")},nA=jt({auth:ne,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:ae.calendarDropdown("writer"),search_term:F.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:F.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:F.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:Ze,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 Je.onEnable(el,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(el,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(el,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await Je.test(el,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var tl={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 m={method:"GET",url:`${ae.baseUrl}/calendars/${n}/events/${s}`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};try{let h=(await Ue.sendRequest(m)).body;new Date(h.updated??0).getTime()>r&&h.status==="cancelled"&&(p=[h])}catch(y){return console.error("Error fetching specific event:",y),[]}}else p=(await la(n,!0,t,d)).filter(y=>y.status==="cancelled");return c&&c.length>0&&(p=p.filter(m=>c.some(y=>{switch(y){case"deleted":return!m.summary||m.summary.includes("Deleted");case"declined":return m.attendees?.some(h=>h.responseStatus==="declined")||!1;case"rescheduled":return m.summary?.toLowerCase().includes("rescheduled")||m.description?.toLowerCase().includes("rescheduled")||!1;case"other":return!0;default:return!0}}))),p.map(m=>({epochMilliSeconds:new Date(m.updated).getTime(),data:m}))},"items")},oA=jt({auth:ne,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:ae.calendarDropdown("writer"),specific_event:F.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:ae.eventDropdown(!1),cancellation_reason:F.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:Ze,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 Je.onEnable(tl,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(tl,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(tl,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await Je.test(tl,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var uh={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 kt(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),m=await e.get("calendars")||[],y=new Set(m),h=d.filter(f=>!y.has(f.id));return await e.put("calendars",p),h.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")},iA=jt({auth:ne,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:F.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:F.ShortText({displayName:"Calendar Name Filter",description:"Only trigger for calendars containing this text in name or description (optional)",required:!1}),exclude_shared:F.Checkbox({displayName:"Exclude Shared Calendars",description:"Only trigger for calendars you own, not shared calendars",required:!1,defaultValue:!1})},outputSchema:ax,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 kt(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 Je.onEnable(uh,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(uh,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(uh,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return(await kt(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 _L=Sv({minimumSupportedRelease:"0.86.4",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:ne,actions:[Ix,bx,_x,wx,Px,Sx,Rx,Cx,Ox,Dx,zx,Mx,Lx,jx,Fx,qx,Bx,Vx,Hx,Zx,Kx,Jx,Yx,Xx,Nb({auth:ne,baseUrl(){return ae.baseUrl},authMapping:o(async t=>({Authorization:`Bearer ${await Ie(t)}`}),"authMapping")})],triggers:[xx,eA,tA,rA,nA,oA,iA]});0&&(module.exports={createGoogleClient,getAccessToken,googleCalendar,googleCalendarAuth});
|
|
70
70
|
/*! Bundled license information:
|
|
71
71
|
|
|
72
72
|
mime-types/index.js:
|