@activepieces/piece-google-drive 0.7.8 → 0.7.9
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 +7 -20
- package/src/index.js +108 -79
- package/src/index.d.ts +0 -6
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/action/add-permission.action.d.ts +0 -11
- package/src/lib/action/add-permission.action.d.ts.map +0 -1
- package/src/lib/action/add-permission.action.js +0 -79
- package/src/lib/action/add-permission.action.js.map +0 -1
- package/src/lib/action/create-new-folder.d.ts +0 -12
- package/src/lib/action/create-new-folder.d.ts.map +0 -1
- package/src/lib/action/create-new-folder.js +0 -39
- package/src/lib/action/create-new-folder.js.map +0 -1
- package/src/lib/action/create-new-text-file.d.ts +0 -14
- package/src/lib/action/create-new-text-file.d.ts.map +0 -1
- package/src/lib/action/create-new-text-file.js +0 -83
- package/src/lib/action/create-new-text-file.js.map +0 -1
- package/src/lib/action/delete-file.d.ts +0 -8
- package/src/lib/action/delete-file.d.ts.map +0 -1
- package/src/lib/action/delete-file.js +0 -36
- package/src/lib/action/delete-file.js.map +0 -1
- package/src/lib/action/delete-permission.action.d.ts +0 -9
- package/src/lib/action/delete-permission.action.d.ts.map +0 -1
- package/src/lib/action/delete-permission.action.js +0 -80
- package/src/lib/action/delete-permission.action.js.map +0 -1
- package/src/lib/action/duplicate-file.action.d.ts +0 -11
- package/src/lib/action/duplicate-file.action.d.ts.map +0 -1
- package/src/lib/action/duplicate-file.action.js +0 -79
- package/src/lib/action/duplicate-file.action.js.map +0 -1
- package/src/lib/action/get-file-by-id.d.ts +0 -8
- package/src/lib/action/get-file-by-id.d.ts.map +0 -1
- package/src/lib/action/get-file-by-id.js +0 -42
- package/src/lib/action/get-file-by-id.js.map +0 -1
- package/src/lib/action/list-files.action.d.ts +0 -11
- package/src/lib/action/list-files.action.d.ts.map +0 -1
- package/src/lib/action/list-files.action.js +0 -161
- package/src/lib/action/list-files.action.js.map +0 -1
- package/src/lib/action/move-file.d.ts +0 -12
- package/src/lib/action/move-file.d.ts.map +0 -1
- package/src/lib/action/move-file.js +0 -48
- package/src/lib/action/move-file.js.map +0 -1
- package/src/lib/action/read-file.d.ts +0 -8
- package/src/lib/action/read-file.d.ts.map +0 -1
- package/src/lib/action/read-file.js +0 -30
- package/src/lib/action/read-file.js.map +0 -1
- package/src/lib/action/save-file-as-pdf.action.d.ts +0 -10
- package/src/lib/action/save-file-as-pdf.action.d.ts.map +0 -1
- package/src/lib/action/save-file-as-pdf.action.js +0 -68
- package/src/lib/action/save-file-as-pdf.action.js.map +0 -1
- package/src/lib/action/search-folder-or-file.action.d.ts +0 -15
- package/src/lib/action/search-folder-or-file.action.d.ts.map +0 -1
- package/src/lib/action/search-folder-or-file.action.js +0 -116
- package/src/lib/action/search-folder-or-file.action.js.map +0 -1
- package/src/lib/action/send-to-trash.d.ts +0 -8
- package/src/lib/action/send-to-trash.d.ts.map +0 -1
- package/src/lib/action/send-to-trash.js +0 -40
- package/src/lib/action/send-to-trash.js.map +0 -1
- package/src/lib/action/set-public-access.d.ts +0 -8
- package/src/lib/action/set-public-access.d.ts.map +0 -1
- package/src/lib/action/set-public-access.js +0 -62
- package/src/lib/action/set-public-access.js.map +0 -1
- package/src/lib/action/upload-file.d.ts +0 -13
- package/src/lib/action/upload-file.d.ts.map +0 -1
- package/src/lib/action/upload-file.js +0 -63
- package/src/lib/action/upload-file.js.map +0 -1
- package/src/lib/auth.d.ts +0 -11
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -86
- package/src/lib/auth.js.map +0 -1
- package/src/lib/common/get-file-content.d.ts +0 -4
- package/src/lib/common/get-file-content.d.ts.map +0 -1
- package/src/lib/common/get-file-content.js +0 -69
- package/src/lib/common/get-file-content.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -23
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -150
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/triggers/new-file.d.ts +0 -43
- package/src/lib/triggers/new-file.d.ts.map +0 -1
- package/src/lib/triggers/new-file.js +0 -103
- package/src/lib/triggers/new-file.js.map +0 -1
- package/src/lib/triggers/new-folder.d.ts +0 -39
- package/src/lib/triggers/new-folder.d.ts.map +0 -1
- package/src/lib/triggers/new-folder.js +0 -67
- package/src/lib/triggers/new-folder.js.map +0 -1
package/src/index.js
CHANGED
|
@@ -1,79 +1,108 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.googleDrive = exports.createGoogleClient = exports.getAccessToken = exports.googleDriveAuth = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const list_files_action_1 = require("./lib/action/list-files.action");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const auth_1 = require("./lib/auth");
|
|
26
|
-
|
|
27
|
-
Object.defineProperty(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
minimumSupportedRelease: '0.5.6',
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
'ArmanGiau3',
|
|
39
|
-
|
|
40
|
-
'pfernandez98',
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
],
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
read_file_1.readFile,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
search_folder_or_file_action_1.googleDriveSearchFolder,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
baseUrl: () => 'https://www.googleapis.com/drive/v3',
|
|
69
|
-
|
|
70
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
-
return ({
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
1
|
+
"use strict";var GA=Object.create;var Di=Object.defineProperty;var HA=Object.getOwnPropertyDescriptor;var WA=Object.getOwnPropertyNames;var ZA=Object.getPrototypeOf,KA=Object.prototype.hasOwnProperty;var o=(t,e)=>Di(t,"name",{value:e,configurable:!0});var Pt=(t,e)=>()=>(t&&(e=t(t=0)),e);var M=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pa=(t,e)=>{for(var r in e)Di(t,r,{get:e[r],enumerable:!0})},Ih=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of WA(e))!KA.call(t,i)&&i!==r&&Di(t,i,{get:()=>e[i],enumerable:!(n=HA(e,i))||n.enumerable});return t};var ze=(t,e,r)=>(r=t!=null?GA(ZA(t)):{},Ih(e||!t||!t.__esModule?Di(r,"default",{value:t,enumerable:!0}):r,t)),JA=t=>Ih(Di({},"__esModule",{value:!0}),t);var Gg=M((Vg,Ma)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",f="(?:[0-9a-f]+::?)+",m={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${f})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${f})|(?:::)(?:${f})?)${e}\\.${e}\\.${e}\\.${e}(${a})?$`,"i")};function h(w,T){if(w.indexOf("::")!==w.lastIndexOf("::"))return null;let $=0,b=-1,u=(w.match(m.zoneIndex)||[])[0],p,c;for(u&&(u=u.substring(1),w=w.replace(/%.+$/,""));(b=w.indexOf(":",b+1))>=0;)$++;if(w.substr(0,2)==="::"&&$--,w.substr(-2,2)==="::"&&$--,$>T)return null;for(c=T-$,p=":";c--;)p+="0:";return w=w.replace("::",p),w[0]===":"&&(w=w.slice(1)),w[w.length-1]===":"&&(w=w.slice(0,-1)),T=function(){let y=w.split(":"),l=[];for(let x=0;x<y.length;x++)l.push(parseInt(y[x],16));return l}(),{parts:T,zoneId:u}}o(h,"expandIPv6");function _(w,T,$,b){if(w.length!==T.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let u=0,p;for(;b>0;){if(p=$-b,p<0&&(p=0),w[u]>>p!==T[u]>>p)return!1;b-=$,u+=1}return!0}o(_,"matchCIDR");function P(w){if(i.test(w))return parseInt(w,16);if(w[0]==="0"&&!isNaN(parseInt(w[1],10))){if(n.test(w))return parseInt(w,8);throw new Error(`ipaddr: cannot parse ${w} as octal`)}return parseInt(w,10)}o(P,"parseIntAuto");function E(w,T){for(;w.length<T;)w=`0${w}`;return w}o(E,"padPart");let S={};S.IPv4=function(){function w(T){if(T.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let $,b;for($=0;$<T.length;$++)if(b=T[$],!(0<=b&&b<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=T}return o(w,"IPv4"),w.prototype.SpecialRanges={unspecified:[[new w([0,0,0,0]),8]],broadcast:[[new w([255,255,255,255]),32]],multicast:[[new w([224,0,0,0]),4]],linkLocal:[[new w([169,254,0,0]),16]],loopback:[[new w([127,0,0,0]),8]],carrierGradeNat:[[new w([100,64,0,0]),10]],private:[[new w([10,0,0,0]),8],[new w([172,16,0,0]),12],[new w([192,168,0,0]),16]],reserved:[[new w([192,0,0,0]),24],[new w([192,0,2,0]),24],[new w([192,88,99,0]),24],[new w([198,18,0,0]),15],[new w([198,51,100,0]),24],[new w([203,0,113,0]),24],[new w([240,0,0,0]),4]],as112:[[new w([192,175,48,0]),24],[new w([192,31,196,0]),24]],amt:[[new w([192,52,193,0]),24]]},w.prototype.kind=function(){return"ipv4"},w.prototype.match=function(T,$){let b;if($===void 0&&(b=T,T=b[0],$=b[1]),T.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return _(this.octets,T.octets,8,$)},w.prototype.prefixLengthFromSubnetMask=function(){let T=0,$=!1,b={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},u,p,c;for(u=3;u>=0;u-=1)if(p=this.octets[u],p in b){if(c=b[p],$&&c!==0)return null;c!==8&&($=!0),T+=c}else return null;return 32-T},w.prototype.range=function(){return S.subnetMatch(this,this.SpecialRanges)},w.prototype.toByteArray=function(){return this.octets.slice(0)},w.prototype.toIPv4MappedAddress=function(){return S.IPv6.parse(`::ffff:${this.toString()}`)},w.prototype.toNormalizedString=function(){return this.toString()},w.prototype.toString=function(){return this.octets.join(".")},w}(),S.IPv4.broadcastAddressFromCIDR=function(w){try{let T=this.parseCIDR(w),$=T[0].toByteArray(),b=this.subnetMaskFromPrefixLength(T[1]).toByteArray(),u=[],p=0;for(;p<4;)u.push(parseInt($[p],10)|parseInt(b[p],10)^255),p++;return new this(u)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},S.IPv4.isIPv4=function(w){return this.parser(w)!==null},S.IPv4.isValid=function(w){try{return new this(this.parser(w)),!0}catch{return!1}},S.IPv4.isValidCIDR=function(w){try{return this.parseCIDR(w),!0}catch{return!1}},S.IPv4.isValidFourPartDecimal=function(w){return!!(S.IPv4.isValid(w)&&w.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},S.IPv4.isValidCIDRFourPartDecimal=function(w){let T=w.match(/^(.+)\/(\d+)$/);return!S.IPv4.isValidCIDR(w)||!T?!1:S.IPv4.isValidFourPartDecimal(T[1])},S.IPv4.networkAddressFromCIDR=function(w){let T,$,b,u,p;try{for(T=this.parseCIDR(w),b=T[0].toByteArray(),p=this.subnetMaskFromPrefixLength(T[1]).toByteArray(),u=[],$=0;$<4;)u.push(parseInt(b[$],10)&parseInt(p[$],10)),$++;return new this(u)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},S.IPv4.parse=function(w){let T=this.parser(w);if(T===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(T)},S.IPv4.parseCIDR=function(w){let T;if(T=w.match(/^(.+)\/(\d+)$/)){let $=parseInt(T[2]);if($>=0&&$<=32){let b=[this.parse(T[1]),$];return Object.defineProperty(b,"toString",{value:o(function(){return this.join("/")},"value")}),b}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},S.IPv4.parser=function(w){let T,$,b;if(T=w.match(r.fourOctet))return function(){let u=T.slice(1,6),p=[];for(let c=0;c<u.length;c++)$=u[c],p.push(P($));return p}();if(T=w.match(r.longValue)){if(b=P(T[1]),b>4294967295||b<0)throw new Error("ipaddr: address outside defined range");return function(){let u=[],p;for(p=0;p<=24;p+=8)u.push(b>>p&255);return u}().reverse()}else return(T=w.match(r.twoOctet))?function(){let u=T.slice(1,4),p=[];if(b=P(u[1]),b>16777215||b<0)throw new Error("ipaddr: address outside defined range");return p.push(P(u[0])),p.push(b>>16&255),p.push(b>>8&255),p.push(b&255),p}():(T=w.match(r.threeOctet))?function(){let u=T.slice(1,5),p=[];if(b=P(u[2]),b>65535||b<0)throw new Error("ipaddr: address outside defined range");return p.push(P(u[0])),p.push(P(u[1])),p.push(b>>8&255),p.push(b&255),p}():null},S.IPv4.subnetMaskFromPrefixLength=function(w){if(w=parseInt(w),w<0||w>32)throw new Error("ipaddr: invalid IPv4 prefix length");let T=[0,0,0,0],$=0,b=Math.floor(w/8);for(;$<b;)T[$]=255,$++;return b<4&&(T[b]=Math.pow(2,w%8)-1<<8-w%8),new this(T)},S.IPv6=function(){function w(T,$){let b,u;if(T.length===16)for(this.parts=[],b=0;b<=14;b+=2)this.parts.push(T[b]<<8|T[b+1]);else if(T.length===8)this.parts=T;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(b=0;b<this.parts.length;b++)if(u=this.parts[b],!(0<=u&&u<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");$&&(this.zoneId=$)}return o(w,"IPv6"),w.prototype.SpecialRanges={unspecified:[new w([0,0,0,0,0,0,0,0]),128],linkLocal:[new w([65152,0,0,0,0,0,0,0]),10],multicast:[new w([65280,0,0,0,0,0,0,0]),8],loopback:[new w([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new w([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new w([0,0,0,0,0,65535,0,0]),96],discard:[new w([256,0,0,0,0,0,0,0]),64],rfc6145:[new w([0,0,0,0,65535,0,0,0]),96],rfc6052:[new w([100,65435,0,0,0,0,0,0]),96],"6to4":[new w([8194,0,0,0,0,0,0,0]),16],teredo:[new w([8193,0,0,0,0,0,0,0]),32],benchmarking:[new w([8193,2,0,0,0,0,0,0]),48],amt:[new w([8193,3,0,0,0,0,0,0]),32],as112v6:[[new w([8193,4,274,0,0,0,0,0]),48],[new w([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new w([8193,16,0,0,0,0,0,0]),28],orchid2:[new w([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new w([8193,48,0,0,0,0,0,0]),28],reserved:[[new w([8193,0,0,0,0,0,0,0]),23],[new w([8193,3512,0,0,0,0,0,0]),32]]},w.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},w.prototype.kind=function(){return"ipv6"},w.prototype.match=function(T,$){let b;if($===void 0&&(b=T,T=b[0],$=b[1]),T.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return _(this.parts,T.parts,16,$)},w.prototype.prefixLengthFromSubnetMask=function(){let T=0,$=!1,b={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},u,p;for(let c=7;c>=0;c-=1)if(u=this.parts[c],u in b){if(p=b[u],$&&p!==0)return null;p!==16&&($=!0),T+=p}else return null;return 128-T},w.prototype.range=function(){return S.subnetMatch(this,this.SpecialRanges)},w.prototype.toByteArray=function(){let T,$=[],b=this.parts;for(let u=0;u<b.length;u++)T=b[u],$.push(T>>8),$.push(T&255);return $},w.prototype.toFixedLengthString=function(){let T=function(){let b=[];for(let u=0;u<this.parts.length;u++)b.push(E(this.parts[u].toString(16),4));return b}.call(this).join(":"),$="";return this.zoneId&&($=`%${this.zoneId}`),T+$},w.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let T=this.parts.slice(-2),$=T[0],b=T[1];return new S.IPv4([$>>8,$&255,b>>8,b&255])},w.prototype.toNormalizedString=function(){let T=function(){let b=[];for(let u=0;u<this.parts.length;u++)b.push(this.parts[u].toString(16));return b}.call(this).join(":"),$="";return this.zoneId&&($=`%${this.zoneId}`),T+$},w.prototype.toRFC5952String=function(){let T=/((^|:)(0(:|$)){2,})/g,$=this.toNormalizedString(),b=0,u=-1,p;for(;p=T.exec($);)p[0].length>u&&(b=p.index,u=p[0].length);return u<0?$:`${$.substring(0,b)}::${$.substring(b+u)}`},w.prototype.toString=function(){return this.toRFC5952String()},w}(),S.IPv6.broadcastAddressFromCIDR=function(w){try{let T=this.parseCIDR(w),$=T[0].toByteArray(),b=this.subnetMaskFromPrefixLength(T[1]).toByteArray(),u=[],p=0;for(;p<16;)u.push(parseInt($[p],10)|parseInt(b[p],10)^255),p++;return new this(u)}catch(T){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${T})`)}},S.IPv6.isIPv6=function(w){return this.parser(w)!==null},S.IPv6.isValid=function(w){if(typeof w=="string"&&w.indexOf(":")===-1)return!1;try{let T=this.parser(w);return new this(T.parts,T.zoneId),!0}catch{return!1}},S.IPv6.isValidCIDR=function(w){if(typeof w=="string"&&w.indexOf(":")===-1)return!1;try{return this.parseCIDR(w),!0}catch{return!1}},S.IPv6.networkAddressFromCIDR=function(w){let T,$,b,u,p;try{for(T=this.parseCIDR(w),b=T[0].toByteArray(),p=this.subnetMaskFromPrefixLength(T[1]).toByteArray(),u=[],$=0;$<16;)u.push(parseInt(b[$],10)&parseInt(p[$],10)),$++;return new this(u)}catch(c){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${c})`)}},S.IPv6.parse=function(w){let T=this.parser(w);if(T.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(T.parts,T.zoneId)},S.IPv6.parseCIDR=function(w){let T,$,b;if(($=w.match(/^(.+)\/(\d+)$/))&&(T=parseInt($[2]),T>=0&&T<=128))return b=[this.parse($[1]),T],Object.defineProperty(b,"toString",{value:o(function(){return this.join("/")},"value")}),b;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},S.IPv6.parser=function(w){let T,$,b,u,p,c;if(b=w.match(m.deprecatedTransitional))return this.parser(`::ffff:${b[1]}`);if(m.native.test(w))return h(w,8);if((b=w.match(m.transitional))&&(c=b[6]||"",T=b[1],b[1].endsWith("::")||(T=T.slice(0,-1)),T=h(T+c,6),T.parts)){for(p=[parseInt(b[2]),parseInt(b[3]),parseInt(b[4]),parseInt(b[5])],$=0;$<p.length;$++)if(u=p[$],!(0<=u&&u<=255))return null;return T.parts.push(p[0]<<8|p[1]),T.parts.push(p[2]<<8|p[3]),{parts:T.parts,zoneId:T.zoneId}}return null},S.IPv6.subnetMaskFromPrefixLength=function(w){if(w=parseInt(w),w<0||w>128)throw new Error("ipaddr: invalid IPv6 prefix length");let T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],$=0,b=Math.floor(w/8);for(;$<b;)T[$]=255,$++;return b<16&&(T[b]=Math.pow(2,w%8)-1<<8-w%8),new this(T)},S.fromByteArray=function(w){let T=w.length;if(T===4)return new S.IPv4(w);if(T===16)return new S.IPv6(w);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},S.isValid=function(w){return S.IPv6.isValid(w)||S.IPv4.isValid(w)},S.isValidCIDR=function(w){return S.IPv6.isValidCIDR(w)||S.IPv4.isValidCIDR(w)},S.parse=function(w){if(S.IPv6.isValid(w))return S.IPv6.parse(w);if(S.IPv4.isValid(w))return S.IPv4.parse(w);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},S.parseCIDR=function(w){try{return S.IPv6.parseCIDR(w)}catch{try{return S.IPv4.parseCIDR(w)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},S.process=function(w){let T=this.parse(w);return T.kind()==="ipv6"&&T.isIPv4MappedAddress()?T.toIPv4Address():T},S.subnetMatch=function(w,T,$){let b,u,p,c;$==null&&($="unicast");for(u in T)if(Object.prototype.hasOwnProperty.call(T,u)){for(p=T[u],p[0]&&!(p[0]instanceof Array)&&(p=[p]),b=0;b<p.length;b++)if(c=p[b],w.kind()===c[0].kind()&&w.match.apply(w,c))return u}return $},typeof Ma<"u"&&Ma.exports?Ma.exports=S:t.ipaddr=S})(Vg)});var Fy=M((MK,My)=>{var jy=require("stream").Stream,E0=require("util");My.exports=wr;function wr(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(wr,"DelayedStream");E0.inherits(wr,jy);wr.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(wr.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});wr.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};wr.prototype.resume=function(){this._released||this.release(),this.source.resume()};wr.prototype.pause=function(){this.source.pause()};wr.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};wr.prototype.pipe=function(){var t=jy.prototype.pipe.apply(this,arguments);return this.resume(),t};wr.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)};wr.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(t))}}});var Vy=M((LK,By)=>{var b0=require("util"),qy=require("stream").Stream,Ly=Fy();By.exports=lt;function lt(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(lt,"CombinedStream");b0.inherits(lt,qy);lt.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};lt.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};lt.prototype.append=function(t){var e=lt.isStreamLike(t);if(e){if(!(t instanceof Ly)){var r=Ly.create(t,{maxDataSize:1/0,pauseStream:this.pauseStreams});t.on("data",this._checkDataSize.bind(this)),t=r}this._handleErrors(t),this.pauseStreams&&t.pause()}return this._streams.push(t),this};lt.prototype.pipe=function(t,e){return qy.prototype.pipe.call(this,t,e),this.resume(),t};lt.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};lt.prototype._realGetNext=function(){var t=this._streams.shift();if(typeof t>"u"){this.end();return}if(typeof t!="function"){this._pipeNext(t);return}var e=t;e(function(r){var n=lt.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};lt.prototype._pipeNext=function(t){this._currentStream=t;var e=lt.isStreamLike(t);if(e){t.on("end",this._getNext.bind(this)),t.pipe(this,{end:!1});return}var r=t;this.write(r),this._getNext()};lt.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};lt.prototype.write=function(t){this.emit("data",t)};lt.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};lt.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};lt.prototype.end=function(){this._reset(),this.emit("end")};lt.prototype.destroy=function(){this._reset(),this.emit("close")};lt.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};lt.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};lt.prototype._updateDataSize=function(){this.dataSize=0;var t=this;this._streams.forEach(function(e){e.dataSize&&(t.dataSize+=e.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};lt.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var Hy=M((BK,Gy)=>{"use strict";Gy.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var Za=M(zt=>{"use strict";var Wa=Hy(),A0=require("path").extname,Wy=/^\s*([^;\s]*)(?:;|\s|$)/,I0=/^text\//i;zt.charset=Zy;zt.charsets={lookup:Zy};zt.contentType=R0;zt.extension=$0;zt.extensions=Object.create(null);zt.lookup=O0;zt.types=Object.create(null);D0(zt.extensions,zt.types);function Zy(t){if(!t||typeof t!="string")return!1;var e=Wy.exec(t),r=e&&Wa[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&I0.test(e[1])?"UTF-8":!1}o(Zy,"charset");function R0(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?zt.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=zt.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(R0,"contentType");function $0(t){if(!t||typeof t!="string")return!1;var e=Wy.exec(t),r=e&&zt.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o($0,"extension");function O0(t){if(!t||typeof t!="string")return!1;var e=A0("x."+t).toLowerCase().substr(1);return e&&zt.types[e]||!1}o(O0,"lookup");function D0(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(Wa).forEach(o(function(i){var a=Wa[i],f=a.extensions;if(!(!f||!f.length)){t[i]=f;for(var m=0;m<f.length;m++){var h=f[m];if(e[h]){var _=r.indexOf(Wa[e[h]].source),P=r.indexOf(a.source);if(e[h]!=="application/octet-stream"&&(_>P||_===P&&e[h].substr(0,12)==="application/"))continue}e[h]=i}}},"forEachMimeType"))}o(D0,"populateMaps")});var Jy=M((HK,Ky)=>{Ky.exports=C0;function C0(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(C0,"defer")});var ed=M((ZK,Xy)=>{var Yy=Jy();Xy.exports=N0;function N0(t){var e=!1;return Yy(function(){e=!0}),o(function(n,i){e?t(n,i):Yy(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(N0,"async")});var td=M((JK,Qy)=>{Qy.exports=z0;function z0(t){Object.keys(t.jobs).forEach(U0.bind(t)),t.jobs={}}o(z0,"abort");function U0(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(U0,"clean")});var rd=M((XK,tv)=>{var ev=ed(),k0=td();tv.exports=j0;function j0(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=M0(e,i,t[i],function(a,f){i in r.jobs&&(delete r.jobs[i],a?k0(r):r.results[i]=f,n(a,r.results))})}o(j0,"iterate");function M0(t,e,r,n){var i;return t.length==2?i=t(r,ev(n)):i=t(r,e,ev(n)),i}o(M0,"runJob")});var nd=M((eJ,rv)=>{rv.exports=F0;function F0(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};return e&&n.keyedList.sort(r?e:function(i,a){return e(t[i],t[a])}),n}o(F0,"state")});var od=M((rJ,nv)=>{var L0=td(),q0=ed();nv.exports=B0;function B0(t){Object.keys(this.jobs).length&&(this.index=this.size,L0(this),q0(t)(null,this.results))}o(B0,"terminator")});var iv=M((oJ,ov)=>{var V0=rd(),G0=nd(),H0=od();ov.exports=W0;function W0(t,e,r){for(var n=G0(t);n.index<(n.keyedList||t).length;)V0(t,e,n,function(i,a){if(i){r(i,a);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return H0.bind(n,r)}o(W0,"parallel")});var id=M((sJ,Ka)=>{var sv=rd(),Z0=nd(),K0=od();Ka.exports=J0;Ka.exports.ascending=av;Ka.exports.descending=Y0;function J0(t,e,r,n){var i=Z0(t,r);return sv(t,e,i,o(function a(f,m){if(f){n(f,m);return}if(i.index++,i.index<(i.keyedList||t).length){sv(t,e,i,a);return}n(null,i.results)},"iteratorHandler")),K0.bind(i,n)}o(J0,"serialOrdered");function av(t,e){return t<e?-1:t>e?1:0}o(av,"ascending");function Y0(t,e){return-1*av(t,e)}o(Y0,"descending")});var cv=M((uJ,uv)=>{var X0=id();uv.exports=Q0;function Q0(t,e,r){return X0(t,e,null,r)}o(Q0,"serial")});var dv=M((lJ,lv)=>{lv.exports={parallel:iv(),serial:cv(),serialOrdered:id()}});var sd=M((dJ,pv)=>{"use strict";pv.exports=Object});var mv=M((pJ,fv)=>{"use strict";fv.exports=Error});var gv=M((fJ,hv)=>{"use strict";hv.exports=EvalError});var vv=M((mJ,yv)=>{"use strict";yv.exports=RangeError});var Pv=M((hJ,_v)=>{"use strict";_v.exports=ReferenceError});var xv=M((gJ,wv)=>{"use strict";wv.exports=SyntaxError});var Nn=M((yJ,Sv)=>{"use strict";Sv.exports=TypeError});var Ev=M((vJ,Tv)=>{"use strict";Tv.exports=URIError});var Av=M((_J,bv)=>{"use strict";bv.exports=Math.abs});var Rv=M((PJ,Iv)=>{"use strict";Iv.exports=Math.floor});var Ov=M((wJ,$v)=>{"use strict";$v.exports=Math.max});var Cv=M((xJ,Dv)=>{"use strict";Dv.exports=Math.min});var zv=M((SJ,Nv)=>{"use strict";Nv.exports=Math.pow});var kv=M((TJ,Uv)=>{"use strict";Uv.exports=Math.round});var Mv=M((EJ,jv)=>{"use strict";jv.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var Lv=M((AJ,Fv)=>{"use strict";var e$=Mv();Fv.exports=o(function(e){return e$(e)||e===0?e:e<0?-1:1},"sign")});var Bv=M((RJ,qv)=>{"use strict";qv.exports=Object.getOwnPropertyDescriptor});var ad=M(($J,Vv)=>{"use strict";var Ja=Bv();if(Ja)try{Ja([],"length")}catch{Ja=null}Vv.exports=Ja});var Hv=M((OJ,Gv)=>{"use strict";var Ya=Object.defineProperty||!1;if(Ya)try{Ya({},"a",{value:1})}catch{Ya=!1}Gv.exports=Ya});var ud=M((DJ,Wv)=>{"use strict";Wv.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var f=Object.getOwnPropertySymbols(e);if(f.length!==1||f[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var m=Object.getOwnPropertyDescriptor(e,r);if(m.value!==i||m.enumerable!==!0)return!1}return!0},"hasSymbols")});var Jv=M((NJ,Kv)=>{"use strict";var Zv=typeof Symbol<"u"&&Symbol,t$=ud();Kv.exports=o(function(){return typeof Zv!="function"||typeof Symbol!="function"||typeof Zv("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t$()},"hasNativeSymbols")});var cd=M((UJ,Yv)=>{"use strict";Yv.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var ld=M((kJ,Xv)=>{"use strict";var r$=sd();Xv.exports=r$.getPrototypeOf||null});var t_=M((jJ,e_)=>{"use strict";var n$="Function.prototype.bind called on incompatible ",o$=Object.prototype.toString,i$=Math.max,s$="[object Function]",Qv=o(function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var a=0;a<r.length;a+=1)n[a+e.length]=r[a];return n},"concatty"),a$=o(function(e,r){for(var n=[],i=r||0,a=0;i<e.length;i+=1,a+=1)n[a]=e[i];return n},"slicy"),u$=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");e_.exports=o(function(e){var r=this;if(typeof r!="function"||o$.apply(r)!==s$)throw new TypeError(n$+r);for(var n=a$(arguments,1),i,a=o(function(){if(this instanceof i){var P=r.apply(this,Qv(n,arguments));return Object(P)===P?P:this}return r.apply(e,Qv(n,arguments))},"binder"),f=i$(0,r.length-n.length),m=[],h=0;h<f;h++)m[h]="$"+h;if(i=Function("binder","return function ("+u$(m,",")+"){ return binder.apply(this,arguments); }")(a),r.prototype){var _=o(function(){},"Empty");_.prototype=r.prototype,i.prototype=new _,_.prototype=null}return i},"bind")});var Qi=M((FJ,r_)=>{"use strict";var c$=t_();r_.exports=Function.prototype.bind||c$});var Xa=M((LJ,n_)=>{"use strict";n_.exports=Function.prototype.call});var dd=M((qJ,o_)=>{"use strict";o_.exports=Function.prototype.apply});var s_=M((BJ,i_)=>{"use strict";i_.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var u_=M((VJ,a_)=>{"use strict";var l$=Qi(),d$=dd(),p$=Xa(),f$=s_();a_.exports=f$||l$.call(p$,d$)});var pd=M((GJ,c_)=>{"use strict";var m$=Qi(),h$=Nn(),g$=Xa(),y$=u_();c_.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new h$("a function is required");return y$(m$,g$,e)},"callBindBasic")});var h_=M((WJ,m_)=>{"use strict";var v$=pd(),l_=ad(),p_;try{p_=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var fd=!!p_&&l_&&l_(Object.prototype,"__proto__"),f_=Object,d_=f_.getPrototypeOf;m_.exports=fd&&typeof fd.get=="function"?v$([fd.get]):typeof d_=="function"?o(function(e){return d_(e==null?e:f_(e))},"getDunder"):!1});var P_=M((KJ,__)=>{"use strict";var g_=cd(),y_=ld(),v_=h_();__.exports=g_?o(function(e){return g_(e)},"getProto"):y_?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return y_(e)},"getProto"):v_?o(function(e){return v_(e)},"getProto"):null});var Qa=M((YJ,w_)=>{"use strict";var _$=Function.prototype.call,P$=Object.prototype.hasOwnProperty,w$=Qi();w_.exports=w$.call(_$,P$)});var ns=M((XJ,A_)=>{"use strict";var Ue,x$=sd(),S$=mv(),T$=gv(),E$=vv(),b$=Pv(),Zo=xv(),Wo=Nn(),A$=Ev(),I$=Av(),R$=Rv(),$$=Ov(),O$=Cv(),D$=zv(),C$=kv(),N$=Lv(),E_=Function,md=o(function(t){try{return E_('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),es=ad(),z$=Hv(),hd=o(function(){throw new Wo},"throwTypeError"),U$=es?function(){try{return arguments.callee,hd}catch{try{return es(arguments,"callee").get}catch{return hd}}}():hd,Go=Jv()(),wt=P_(),k$=ld(),j$=cd(),b_=dd(),ts=Xa(),Ho={},M$=typeof Uint8Array>"u"||!wt?Ue:wt(Uint8Array),io={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Ue:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ue:ArrayBuffer,"%ArrayIteratorPrototype%":Go&&wt?wt([][Symbol.iterator]()):Ue,"%AsyncFromSyncIteratorPrototype%":Ue,"%AsyncFunction%":Ho,"%AsyncGenerator%":Ho,"%AsyncGeneratorFunction%":Ho,"%AsyncIteratorPrototype%":Ho,"%Atomics%":typeof Atomics>"u"?Ue:Atomics,"%BigInt%":typeof BigInt>"u"?Ue:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ue:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ue:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ue:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":S$,"%eval%":eval,"%EvalError%":T$,"%Float16Array%":typeof Float16Array>"u"?Ue:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Ue:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ue:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ue:FinalizationRegistry,"%Function%":E_,"%GeneratorFunction%":Ho,"%Int8Array%":typeof Int8Array>"u"?Ue:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ue:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ue:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Go&&wt?wt(wt([][Symbol.iterator]())):Ue,"%JSON%":typeof JSON=="object"?JSON:Ue,"%Map%":typeof Map>"u"?Ue:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Go||!wt?Ue:wt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":x$,"%Object.getOwnPropertyDescriptor%":es,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ue:Promise,"%Proxy%":typeof Proxy>"u"?Ue:Proxy,"%RangeError%":E$,"%ReferenceError%":b$,"%Reflect%":typeof Reflect>"u"?Ue:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ue:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Go||!wt?Ue:wt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ue:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Go&&wt?wt(""[Symbol.iterator]()):Ue,"%Symbol%":Go?Symbol:Ue,"%SyntaxError%":Zo,"%ThrowTypeError%":U$,"%TypedArray%":M$,"%TypeError%":Wo,"%Uint8Array%":typeof Uint8Array>"u"?Ue:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ue:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ue:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ue:Uint32Array,"%URIError%":A$,"%WeakMap%":typeof WeakMap>"u"?Ue:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ue:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ue:WeakSet,"%Function.prototype.call%":ts,"%Function.prototype.apply%":b_,"%Object.defineProperty%":z$,"%Object.getPrototypeOf%":k$,"%Math.abs%":I$,"%Math.floor%":R$,"%Math.max%":$$,"%Math.min%":O$,"%Math.pow%":D$,"%Math.round%":C$,"%Math.sign%":N$,"%Reflect.getPrototypeOf%":j$};if(wt)try{null.error}catch(t){x_=wt(wt(t)),io["%Error.prototype%"]=x_}var x_,F$=o(function t(e){var r;if(e==="%AsyncFunction%")r=md("async function () {}");else if(e==="%GeneratorFunction%")r=md("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=md("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&wt&&(r=wt(i.prototype))}return io[e]=r,r},"doEval"),S_={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},rs=Qi(),eu=Qa(),L$=rs.call(ts,Array.prototype.concat),q$=rs.call(b_,Array.prototype.splice),T_=rs.call(ts,String.prototype.replace),tu=rs.call(ts,String.prototype.slice),B$=rs.call(ts,RegExp.prototype.exec),V$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G$=/\\(\\)?/g,H$=o(function(e){var r=tu(e,0,1),n=tu(e,-1);if(r==="%"&&n!=="%")throw new Zo("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Zo("invalid intrinsic syntax, expected opening `%`");var i=[];return T_(e,V$,function(a,f,m,h){i[i.length]=m?T_(h,G$,"$1"):f||a}),i},"stringToPath"),W$=o(function(e,r){var n=e,i;if(eu(S_,n)&&(i=S_[n],n="%"+i[0]+"%"),eu(io,n)){var a=io[n];if(a===Ho&&(a=F$(n)),typeof a>"u"&&!r)throw new Wo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Zo("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");A_.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new Wo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Wo('"allowMissing" argument must be a boolean');if(B$(/^%?[^%]*%?$/,e)===null)throw new Zo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=H$(e),i=n.length>0?n[0]:"",a=W$("%"+i+"%",r),f=a.name,m=a.value,h=!1,_=a.alias;_&&(i=_[0],q$(n,L$([0,1],_)));for(var P=1,E=!0;P<n.length;P+=1){var S=n[P],w=tu(S,0,1),T=tu(S,-1);if((w==='"'||w==="'"||w==="`"||T==='"'||T==="'"||T==="`")&&w!==T)throw new Zo("property names with quotes must have matching quotes");if((S==="constructor"||!E)&&(h=!0),i+="."+S,f="%"+i+"%",eu(io,f))m=io[f];else if(m!=null){if(!(S in m)){if(!r)throw new Wo("base intrinsic for "+e+" exists, but the property is not available.");return}if(es&&P+1>=n.length){var $=es(m,S);E=!!$,E&&"get"in $&&!("originalValue"in $.get)?m=$.get:m=m[S]}else E=eu(m,S),m=m[S];E&&!h&&(io[f]=m)}}return m},"GetIntrinsic")});var R_=M((e8,I_)=>{"use strict";var Z$=ud();I_.exports=o(function(){return Z$()&&!!Symbol.toStringTag},"hasToStringTagShams")});var D_=M((r8,O_)=>{"use strict";var K$=ns(),$_=K$("%Object.defineProperty%",!0),J$=R_()(),Y$=Qa(),X$=Nn(),ru=J$?Symbol.toStringTag:null;O_.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 X$("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ru&&(n||!Y$(e,ru))&&($_?$_(e,ru,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[ru]=r)},"setToStringTag")});var N_=M((o8,C_)=>{"use strict";C_.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var nu=M((i8,z_)=>{"use strict";var _d=Vy(),Q$=require("util"),gd=require("path"),eO=require("http"),tO=require("https"),rO=require("url").parse,nO=require("fs"),oO=require("stream").Stream,iO=require("crypto"),yd=Za(),sO=dv(),aO=D_(),zn=Qa(),vd=N_();function Le(t){if(!(this instanceof Le))return new Le(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],_d.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(Le,"FormData");Q$.inherits(Le,_d);Le.LINE_BREAK=`\r
|
|
2
|
+
`;Le.DEFAULT_CONTENT_TYPE="application/octet-stream";Le.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=_d.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r),a=this._multiPartFooter();n(i),n(e),n(a),this._trackLength(i,e,r)};Le.prototype._trackLength=function(t,e,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(e)?n=e.length:typeof e=="string"&&(n=Buffer.byteLength(e)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(t)+Le.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&zn(e,"httpVersion"))&&!(e instanceof oO))&&(r.knownLength||this._valuesToMeasure.push(e))};Le.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)):nO.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")};Le.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),i=this._getContentType(e,r),a="",f={"Content-Disposition":["form-data",'name="'+t+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&vd(f,r.header);var m;for(var h in f)if(zn(f,h)){if(m=f[h],m==null)continue;Array.isArray(m)||(m=[m]),m.length&&(a+=h+": "+m.join("; ")+Le.LINE_BREAK)}return"--"+this.getBoundary()+Le.LINE_BREAK+a+Le.LINE_BREAK};Le.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=gd.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=gd.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&zn(t,"httpVersion")&&(r=gd.basename(t.client._httpMessage.path||"")),r)return'filename="'+r+'"'};Le.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=yd.lookup(t.name)),!r&&t&&t.path&&(r=yd.lookup(t.path)),!r&&t&&t.readable&&zn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=yd.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=Le.DEFAULT_CONTENT_TYPE),r};Le.prototype._multiPartFooter=function(){return function(t){var e=Le.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};Le.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Le.LINE_BREAK};Le.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)zn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};Le.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Le.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Le.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?t=Buffer.concat([t,this._streams[r]]):t=Buffer.concat([t,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(Le.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Le.prototype._generateBoundary=function(){this._boundary="--------------------------"+iO.randomBytes(12).toString("hex")};Le.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};Le.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Le.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}sO.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};Le.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=rO(t),n=vd({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=vd(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=tO.request(n):r=eO.request(n),this.getLength(function(a,f){if(a&&a!=="Unknown stream"){this._error(a);return}if(f&&r.setHeader("Content-Length",f),this.pipe(r),e){var m,h=o(function(_,P){return r.removeListener("error",h),r.removeListener("response",m),e.call(this,_,P)},"callback");m=h.bind(this,null),r.on("error",h),r.on("response",m)}}.bind(this)),r};Le.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Le.prototype.toString=function(){return"[object FormData]"};aO(Le,"FormData");z_.exports=Le});var os=M((I8,G_)=>{"use strict";var ou=Object.prototype.hasOwnProperty,V_=Object.prototype.toString,j_=Object.defineProperty,M_=Object.getOwnPropertyDescriptor,F_=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):V_.call(e)==="[object Array]"},"isArray"),L_=o(function(e){if(!e||V_.call(e)!=="[object Object]")return!1;var r=ou.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&ou.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||ou.call(e,i)},"isPlainObject"),q_=o(function(e,r){j_&&r.name==="__proto__"?j_(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),B_=o(function(e,r){if(r==="__proto__")if(ou.call(e,r)){if(M_)return M_(e,r).value}else return;return e[r]},"getProperty");G_.exports=o(function t(){var e,r,n,i,a,f,m=arguments[0],h=1,_=arguments.length,P=!1;for(typeof m=="boolean"&&(P=m,m=arguments[1]||{},h=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});h<_;++h)if(e=arguments[h],e!=null)for(r in e)n=B_(m,r),i=B_(e,r),m!==i&&(P&&i&&(L_(i)||(a=F_(i)))?(a?(a=!1,f=n&&F_(n)?n:[]):f=n&&L_(n)?n:{},q_(m,{name:r,newValue:t(P,f,i)})):typeof i<"u"&&q_(m,{name:r,newValue:i}));return m},"extend")});var H_=M(($8,gO)=>{gO.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 Z_=M((O8,W_)=>{"use strict";var yO=H_();W_.exports={pkg:yO}});var xd=M(ur=>{"use strict";var J_=ur&&ur.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ur,"__esModule",{value:!0});ur.GaxiosError=ur.GAXIOS_ERROR_SYMBOL=void 0;ur.defaultErrorRedactor=Y_;var K_=J_(os()),vO=J_(Z_()),Pd=vO.default.pkg;ur.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Pd.name}-gaxios-error`);var wd=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[ur.GAXIOS_ERROR_SYMBOL]=Pd.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&ur.GAXIOS_ERROR_SYMBOL in e&&e[ur.GAXIOS_ERROR_SYMBOL]===Pd.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,K_.default)(!0,{},r),this.response&&(this.response.config=(0,K_.default)(!0,{},this.response.config)),this.response){try{this.response.data=_O(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}i instanceof DOMException?this.code=i.name:i&&typeof i=="object"&&"code"in i&&(typeof i.code=="string"||typeof i.code=="number")&&(this.code=i.code)}static extractAPIErrorFromResponse(e,r="The request failed"){let n=r;if(typeof e.data=="string"&&(n=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){n="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:n;let i="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,a="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let f=[];for(let m of e.data.error.errors)typeof m=="object"&&"message"in m&&typeof m.message=="string"&&f.push(m.message);return Object.assign({message:f.join(`
|
|
3
|
+
`)||n,code:a,status:i},e.data.error)}return Object.assign({message:n,code:a,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};ur.GaxiosError=wd;function _O(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(_O,"translateData");function Y_(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(a){a&&a.forEach((f,m)=>{(/^authentication$/i.test(m)||/^authorization$/i.test(m)||/secret/i.test(m))&&a.set(m,e)})}o(r,"redactHeaders");function n(a,f){if(typeof a=="object"&&a!==null&&typeof a[f]=="string"){let m=a[f];(/grant_type=/i.test(m)||/assertion=/i.test(m)||/secret/i.test(m))&&(a[f]=e)}}o(n,"redactString");function i(a){!a||typeof a!="object"||(a instanceof FormData||a instanceof URLSearchParams||"forEach"in a&&"set"in a?a.forEach((f,m)=>{(["grant_type","assertion"].includes(m)||/secret/.test(m))&&a.set(m,e)}):("grant_type"in a&&(a.grant_type=e),"assertion"in a&&(a.assertion=e),"client_secret"in a&&(a.client_secret=e)))}return o(i,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),i(t.config.data),n(t.config,"body"),i(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(Y_({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(Y_,"defaultErrorRedactor")});var Q_=M(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.getRetryConfig=PO;async function PO(t){let e=X_(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||wO)(t))return{shouldRetry:!1,config:t.config};let i=xO(e);t.config.retryConfig.currentRetryAttempt+=1;let a=e.retryBackoff?e.retryBackoff(t,i):new Promise(f=>{setTimeout(f,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await a,{shouldRetry:!0,config:t.config}}o(PO,"getRetryConfig");function wO(t){let e=X_(t);if(t.config.signal?.aborted&&t.code!=="TimeoutError"||t.code==="AbortError"||!e||e.retry===0||!t.response&&(e.currentRetryAttempt||0)>=e.noResponseRetries||!e.httpMethodsToRetry||!e.httpMethodsToRetry.includes(t.config.method?.toUpperCase()||"GET"))return!1;if(t.response&&t.response.status){let r=!1;for(let[n,i]of e.statusCodesToRetry){let a=t.response.status;if(a>=n&&a<=i){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}o(wO,"shouldRetryRequest");function X_(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(X_,"getConfig");function xO(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(xO,"getNextRetryDelay")});var Ed=M(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.GaxiosInterceptorManager=void 0;var Td=class extends Set{static{o(this,"GaxiosInterceptorManager")}};iu.GaxiosInterceptorManager=Td});var tP=M((j8,eP)=>{var Ko=1e3,Jo=Ko*60,Yo=Jo*60,so=Yo*24,SO=so*7,TO=so*365.25;eP.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return EO(t);if(r==="number"&&isFinite(t))return e.long?AO(t):bO(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function EO(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*TO;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*Yo;case"minutes":case"minute":case"mins":case"min":case"m":return r*Jo;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ko;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(EO,"parse");function bO(t){var e=Math.abs(t);return e>=so?Math.round(t/so)+"d":e>=Yo?Math.round(t/Yo)+"h":e>=Jo?Math.round(t/Jo)+"m":e>=Ko?Math.round(t/Ko)+"s":t+"ms"}o(bO,"fmtShort");function AO(t){var e=Math.abs(t);return e>=so?su(t,e,so,"day"):e>=Yo?su(t,e,Yo,"hour"):e>=Jo?su(t,e,Jo,"minute"):e>=Ko?su(t,e,Ko,"second"):t+" ms"}o(AO,"fmtLong");function su(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(su,"plural")});var bd=M((F8,rP)=>{function IO(t){r.debug=r,r.default=r,r.coerce=h,r.disable=f,r.enable=i,r.enabled=m,r.humanize=tP(),r.destroy=_,Object.keys(t).forEach(P=>{r[P]=t[P]}),r.names=[],r.skips=[],r.formatters={};function e(P){let E=0;for(let S=0;S<P.length;S++)E=(E<<5)-E+P.charCodeAt(S),E|=0;return r.colors[Math.abs(E)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(P){let E,S=null,w,T;function $(...b){if(!$.enabled)return;let u=$,p=Number(new Date),c=p-(E||p);u.diff=c,u.prev=E,u.curr=p,E=p,b[0]=r.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let y=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(x,g)=>{if(x==="%%")return"%";y++;let re=r.formatters[g];if(typeof re=="function"){let ee=b[y];x=re.call(u,ee),b.splice(y,1),y--}return x}),r.formatArgs.call(u,b),(u.log||r.log).apply(u,b)}return o($,"debug"),$.namespace=P,$.useColors=r.useColors(),$.color=r.selectColor(P),$.extend=n,$.destroy=r.destroy,Object.defineProperty($,"enabled",{enumerable:!0,configurable:!1,get:o(()=>S!==null?S:(w!==r.namespaces&&(w=r.namespaces,T=r.enabled(P)),T),"get"),set:o(b=>{S=b},"set")}),typeof r.init=="function"&&r.init($),$}o(r,"createDebug");function n(P,E){let S=r(this.namespace+(typeof E>"u"?":":E)+P);return S.log=this.log,S}o(n,"extend");function i(P){r.save(P),r.namespaces=P,r.names=[],r.skips=[];let E=(typeof P=="string"?P:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let S of E)S[0]==="-"?r.skips.push(S.slice(1)):r.names.push(S)}o(i,"enable");function a(P,E){let S=0,w=0,T=-1,$=0;for(;S<P.length;)if(w<E.length&&(E[w]===P[S]||E[w]==="*"))E[w]==="*"?(T=w,$=S,w++):(S++,w++);else if(T!==-1)w=T+1,$++,S=$;else return!1;for(;w<E.length&&E[w]==="*";)w++;return w===E.length}o(a,"matchesTemplate");function f(){let P=[...r.names,...r.skips.map(E=>"-"+E)].join(",");return r.enable(""),P}o(f,"disable");function m(P){for(let E of r.skips)if(a(P,E))return!1;for(let E of r.names)if(a(P,E))return!0;return!1}o(m,"enabled");function h(P){return P instanceof Error?P.stack||P.message:P}o(h,"coerce");function _(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o(_,"destroy"),r.enable(r.load()),r}o(IO,"setup");rP.exports=IO});var nP=M((Ut,au)=>{Ut.formatArgs=$O;Ut.save=OO;Ut.load=DO;Ut.useColors=RO;Ut.storage=CO();Ut.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ut.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function RO(){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(RO,"useColors");function $O(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+au.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($O,"formatArgs");Ut.log=console.debug||console.log||(()=>{});function OO(t){try{t?Ut.storage.setItem("debug",t):Ut.storage.removeItem("debug")}catch{}}o(OO,"save");function DO(){let t;try{t=Ut.storage.getItem("debug")||Ut.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(DO,"load");function CO(){try{return localStorage}catch{}}o(CO,"localstorage");au.exports=bd()(Ut);var{formatters:NO}=au.exports;NO.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var iP=M((B8,oP)=>{"use strict";oP.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 uP=M((V8,aP)=>{"use strict";var zO=require("os"),sP=require("tty"),cr=iP(),{env:xt}=process,Un;cr("no-color")||cr("no-colors")||cr("color=false")||cr("color=never")?Un=0:(cr("color")||cr("colors")||cr("color=true")||cr("color=always"))&&(Un=1);"FORCE_COLOR"in xt&&(xt.FORCE_COLOR==="true"?Un=1:xt.FORCE_COLOR==="false"?Un=0:Un=xt.FORCE_COLOR.length===0?1:Math.min(parseInt(xt.FORCE_COLOR,10),3));function Ad(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(Ad,"translateLevel");function Id(t,e){if(Un===0)return 0;if(cr("color=16m")||cr("color=full")||cr("color=truecolor"))return 3;if(cr("color=256"))return 2;if(t&&!e&&Un===void 0)return 0;let r=Un||0;if(xt.TERM==="dumb")return r;if(process.platform==="win32"){let n=zO.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(Id,"supportsColor");function UO(t){let e=Id(t,t&&t.isTTY);return Ad(e)}o(UO,"getSupportLevel");aP.exports={supportsColor:UO,stdout:Ad(Id(!0,sP.isatty(1))),stderr:Ad(Id(!0,sP.isatty(2)))}});var lP=M((St,cu)=>{var kO=require("tty"),uu=require("util");St.init=VO;St.log=LO;St.formatArgs=MO;St.save=qO;St.load=BO;St.useColors=jO;St.destroy=uu.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");St.colors=[6,2,3,4,5,1];try{let t=uP();t&&(t.stderr||t).level>=2&&(St.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}St.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,a)=>a.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function jO(){return"colors"in St.inspectOpts?!!St.inspectOpts.colors:kO.isatty(process.stderr.fd)}o(jO,"useColors");function MO(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),a=` ${i};1m${e} \x1B[0m`;t[0]=a+t[0].split(`
|
|
4
|
+
`).join(`
|
|
5
|
+
`+a),t.push(i+"m+"+cu.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=FO()+e+" "+t[0]}o(MO,"formatArgs");function FO(){return St.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(FO,"getDate");function LO(...t){return process.stderr.write(uu.formatWithOptions(St.inspectOpts,...t)+`
|
|
6
|
+
`)}o(LO,"log");function qO(t){t?process.env.DEBUG=t:delete process.env.DEBUG}o(qO,"save");function BO(){return process.env.DEBUG}o(BO,"load");function VO(t){t.inspectOpts={};let e=Object.keys(St.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=St.inspectOpts[e[r]]}o(VO,"init");cu.exports=bd()(St);var{formatters:cP}=cu.exports;cP.o=function(t){return this.inspectOpts.colors=this.useColors,uu.inspect(t,this.inspectOpts).split(`
|
|
7
|
+
`).map(e=>e.trim()).join(" ")};cP.O=function(t){return this.inspectOpts.colors=this.useColors,uu.inspect(t,this.inspectOpts)}});var $d=M((W8,Rd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Rd.exports=nP():Rd.exports=lP()});var fP=M(kt=>{"use strict";var GO=kt&&kt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),HO=kt&&kt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dP=kt&&kt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&GO(e,t,r);return HO(e,t),e};Object.defineProperty(kt,"__esModule",{value:!0});kt.req=kt.json=kt.toBuffer=void 0;var WO=dP(require("http")),ZO=dP(require("https"));async function pP(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}o(pP,"toBuffer");kt.toBuffer=pP;async function KO(t){let r=(await pP(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let i=n;throw i.message+=` (input: ${r})`,i}}o(KO,"json");kt.json=KO;function JO(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?ZO:WO).request(t,e),i=new Promise((a,f)=>{n.once("response",a).once("error",f).end()});return n.then=i.then.bind(i),n}o(JO,"req");kt.req=JO});var yP=M(Ht=>{"use strict";var hP=Ht&&Ht.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),YO=Ht&&Ht.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),gP=Ht&&Ht.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&hP(e,t,r);return YO(e,t),e},XO=Ht&&Ht.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hP(e,t,r)};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.Agent=void 0;var QO=gP(require("net")),mP=gP(require("http")),eD=require("https");XO(fP(),Ht);var zr=Symbol("AgentBaseInternalState"),Od=class extends mP.Agent{static{o(this,"Agent")}constructor(e){super(e),this[zr]={}}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 QO.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)?eD.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let i={...r,secureEndpoint:this.isSecureEndpoint(r)},a=this.getName(i),f=this.incrementSockets(a);Promise.resolve().then(()=>this.connect(e,i)).then(m=>{if(this.decrementSockets(a,f),m instanceof mP.Agent)try{return m.addRequest(e,i)}catch(h){return n(h)}this[zr].currentSocket=m,super.createSocket(e,r,n)},m=>{this.decrementSockets(a,f),n(m)})}createConnection(){let e=this[zr].currentSocket;if(this[zr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[zr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[zr]&&(this[zr].defaultPort=e)}get protocol(){return this[zr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[zr]&&(this[zr].protocol=e)}};Ht.Agent=Od});var vP=M(Xo=>{"use strict";var tD=Xo&&Xo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xo,"__esModule",{value:!0});Xo.parseProxyResponse=void 0;var rD=tD($d()),lu=(0,rD.default)("https-proxy-agent:parse-proxy-response");function nD(t){return new Promise((e,r)=>{let n=0,i=[];function a(){let P=t.read();P?_(P):t.once("readable",a)}o(a,"read");function f(){t.removeListener("end",m),t.removeListener("error",h),t.removeListener("readable",a)}o(f,"cleanup");function m(){f(),lu("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}o(m,"onend");function h(P){f(),lu("onerror %o",P),r(P)}o(h,"onerror");function _(P){i.push(P),n+=P.length;let E=Buffer.concat(i,n),S=E.indexOf(`\r
|
|
9
|
+
\r
|
|
10
|
+
`);if(S===-1){lu("have not received end of HTTP headers yet..."),a();return}let w=E.slice(0,S).toString("ascii").split(`\r
|
|
11
|
+
`),T=w.shift();if(!T)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let $=T.split(" "),b=+$[1],u=$.slice(2).join(" "),p={};for(let c of w){if(!c)continue;let y=c.indexOf(":");if(y===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${c}"`));let l=c.slice(0,y).toLowerCase(),x=c.slice(y+1).trimStart(),g=p[l];typeof g=="string"?p[l]=[g,x]:Array.isArray(g)?g.push(x):p[l]=x}lu("got proxy server response: %o %o",T,p),f(),e({connect:{statusCode:b,statusText:u,headers:p},buffered:E})}o(_,"ondata"),t.on("error",h),t.on("end",m),a()})}o(nD,"parseProxyResponse");Xo.parseProxyResponse=nD});var TP=M(lr=>{"use strict";var oD=lr&&lr.__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]}),iD=lr&&lr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),xP=lr&&lr.__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)&&oD(e,t,r);return iD(e,t),e},SP=lr&&lr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(lr,"__esModule",{value:!0});lr.HttpsProxyAgent=void 0;var du=xP(require("net")),_P=xP(require("tls")),sD=SP(require("assert")),aD=SP($d()),uD=yP(),cD=require("url"),lD=vP(),is=(0,aD.default)("https-proxy-agent"),PP=o(t=>t.servername===void 0&&t.host&&!du.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),pu=class extends uD.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new cD.URL(e):e,this.proxyHeaders=r?.headers??{},is("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?wP(r,"headers"):null,host:n,port:i}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let i;n.protocol==="https:"?(is("Creating `tls.Socket`: %o",this.connectOpts),i=_P.connect(PP(this.connectOpts))):(is("Creating `net.Socket`: %o",this.connectOpts),i=du.connect(this.connectOpts));let a=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},f=du.isIPv6(r.host)?`[${r.host}]`:r.host,m=`CONNECT ${f}:${r.port} HTTP/1.1\r
|
|
12
|
+
`;if(n.username||n.password){let S=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;a["Proxy-Authorization"]=`Basic ${Buffer.from(S).toString("base64")}`}a.Host=`${f}:${r.port}`,a["Proxy-Connection"]||(a["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let S of Object.keys(a))m+=`${S}: ${a[S]}\r
|
|
13
|
+
`;let h=(0,lD.parseProxyResponse)(i);i.write(`${m}\r
|
|
14
|
+
`);let{connect:_,buffered:P}=await h;if(e.emit("proxyConnect",_),this.emit("proxyConnect",_,e),_.statusCode===200)return e.once("socket",dD),r.secureEndpoint?(is("Upgrading socket connection to TLS"),_P.connect({...wP(PP(r),"host","path","port"),socket:i})):i;i.destroy();let E=new du.Socket({writable:!1});return E.readable=!0,e.once("socket",S=>{is("Replaying proxy buffer for failed request"),(0,sD.default)(S.listenerCount("data")>0),S.push(P),S.push(null)}),E}};pu.protocols=["http","https"];lr.HttpsProxyAgent=pu;function dD(t){t.resume()}o(dD,"resume");function wP(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(wP,"omit")});function pD(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,a=r[0]||"text/plain",f=a;for(let P=1;P<r.length;P++)r[P]==="base64"?i=!0:r[P]&&(f+=`;${r[P]}`,r[P].indexOf("charset=")===0&&(n=r[P].substring(8)));!r[0]&&!n.length&&(f+=";charset=US-ASCII",n="US-ASCII");let m=i?"base64":"ascii",h=unescape(t.substring(e+1)),_=Buffer.from(h,m);return _.type=a,_.typeFull=f,_.charset=n,_}var EP,bP=Pt(()=>{o(pD,"dataUriToBuffer");EP=pD});var IP=M((fu,AP)=>{(function(t,e){typeof fu=="object"&&typeof AP<"u"?e(fu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(fu,function(t){"use strict";function e(){}o(e,"noop");function r(s){return typeof s=="object"&&s!==null||typeof s=="function"}o(r,"typeIsObject");let n=e;function i(s,d){try{Object.defineProperty(s,"name",{value:d,configurable:!0})}catch{}}o(i,"setFunctionName");let a=Promise,f=Promise.prototype.then,m=Promise.reject.bind(a);function h(s){return new a(s)}o(h,"newPromise");function _(s){return h(d=>d(s))}o(_,"promiseResolvedWith");function P(s){return m(s)}o(P,"promiseRejectedWith");function E(s,d,v){return f.call(s,d,v)}o(E,"PerformPromiseThen");function S(s,d,v){E(E(s,d,v),void 0,n)}o(S,"uponPromise");function w(s,d){S(s,d)}o(w,"uponFulfillment");function T(s,d){S(s,void 0,d)}o(T,"uponRejection");function $(s,d,v){return E(s,d,v)}o($,"transformPromiseWith");function b(s){E(s,void 0,n)}o(b,"setPromiseIsHandledToTrue");let u=o(s=>{if(typeof queueMicrotask=="function")u=queueMicrotask;else{let d=_(void 0);u=o(v=>E(d,v),"_queueMicrotask")}return u(s)},"_queueMicrotask");function p(s,d,v){if(typeof s!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(s,d,v)}o(p,"reflectCall");function c(s,d,v){try{return _(p(s,d,v))}catch(R){return P(R)}}o(c,"promiseCall");let y=16384;class l{static{o(this,"SimpleQueue")}constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(d){let v=this._back,R=v;v._elements.length===y-1&&(R={_elements:[],_next:void 0}),v._elements.push(d),R!==v&&(this._back=R,v._next=R),++this._size}shift(){let d=this._front,v=d,R=this._cursor,C=R+1,V=d._elements,W=V[R];return C===y&&(v=d._next,C=0),--this._size,this._cursor=C,d!==v&&(this._front=v),V[R]=void 0,W}forEach(d){let v=this._cursor,R=this._front,C=R._elements;for(;(v!==C.length||R._next!==void 0)&&!(v===C.length&&(R=R._next,C=R._elements,v=0,C.length===0));)d(C[v]),++v}peek(){let d=this._front,v=this._cursor;return d._elements[v]}}let x=Symbol("[[AbortSteps]]"),g=Symbol("[[ErrorSteps]]"),re=Symbol("[[CancelSteps]]"),ee=Symbol("[[PullSteps]]"),Te=Symbol("[[ReleaseSteps]]");function ne(s,d){s._ownerReadableStream=d,d._reader=s,d._state==="readable"?X(s):d._state==="closed"?ae(s):ie(s,d._storedError)}o(ne,"ReadableStreamReaderGenericInitialize");function K(s,d){let v=s._ownerReadableStream;return yr(v,d)}o(K,"ReadableStreamReaderGenericCancel");function Z(s){let d=s._ownerReadableStream;d._state==="readable"?Ie(s,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):De(s,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),d._readableStreamController[Te](),d._reader=void 0,s._ownerReadableStream=void 0}o(Z,"ReadableStreamReaderGenericRelease");function Q(s){return new TypeError("Cannot "+s+" a stream using a released reader")}o(Q,"readerLockException");function X(s){s._closedPromise=h((d,v)=>{s._closedPromise_resolve=d,s._closedPromise_reject=v})}o(X,"defaultReaderClosedPromiseInitialize");function ie(s,d){X(s),Ie(s,d)}o(ie,"defaultReaderClosedPromiseInitializeAsRejected");function ae(s){X(s),He(s)}o(ae,"defaultReaderClosedPromiseInitializeAsResolved");function Ie(s,d){s._closedPromise_reject!==void 0&&(b(s._closedPromise),s._closedPromise_reject(d),s._closedPromise_resolve=void 0,s._closedPromise_reject=void 0)}o(Ie,"defaultReaderClosedPromiseReject");function De(s,d){ie(s,d)}o(De,"defaultReaderClosedPromiseResetToRejected");function He(s){s._closedPromise_resolve!==void 0&&(s._closedPromise_resolve(void 0),s._closedPromise_resolve=void 0,s._closedPromise_reject=void 0)}o(He,"defaultReaderClosedPromiseResolve");let Xe=Number.isFinite||function(s){return typeof s=="number"&&isFinite(s)},_t=Math.trunc||function(s){return s<0?Math.ceil(s):Math.floor(s)};function te(s){return typeof s=="object"||typeof s=="function"}o(te,"isDictionary");function st(s,d){if(s!==void 0&&!te(s))throw new TypeError(`${d} is not an object.`)}o(st,"assertDictionary");function dt(s,d){if(typeof s!="function")throw new TypeError(`${d} is not a function.`)}o(dt,"assertFunction");function Lt(s){return typeof s=="object"&&s!==null||typeof s=="function"}o(Lt,"isObject");function Ge(s,d){if(!Lt(s))throw new TypeError(`${d} is not an object.`)}o(Ge,"assertObject");function We(s,d,v){if(s===void 0)throw new TypeError(`Parameter ${d} is required in '${v}'.`)}o(We,"assertRequiredArgument");function A(s,d,v){if(s===void 0)throw new TypeError(`${d} is required in '${v}'.`)}o(A,"assertRequiredField");function O(s){return Number(s)}o(O,"convertUnrestrictedDouble");function D(s){return s===0?0:s}o(D,"censorNegativeZero");function L(s){return D(_t(s))}o(L,"integerPart");function z(s,d){let R=Number.MAX_SAFE_INTEGER,C=Number(s);if(C=D(C),!Xe(C))throw new TypeError(`${d} is not a finite number`);if(C=L(C),C<0||C>R)throw new TypeError(`${d} is outside the accepted range of 0 to ${R}, inclusive`);return!Xe(C)||C===0?0:C}o(z,"convertUnsignedLongLongWithEnforceRange");function j(s,d){if(!Tn(s))throw new TypeError(`${d} is not a ReadableStream.`)}o(j,"assertReadableStream");function G(s){return new J(s)}o(G,"AcquireReadableStreamDefaultReader");function N(s,d){s._reader._readRequests.push(d)}o(N,"ReadableStreamAddReadRequest");function U(s,d,v){let C=s._reader._readRequests.shift();v?C._closeSteps():C._chunkSteps(d)}o(U,"ReadableStreamFulfillReadRequest");function B(s){return s._reader._readRequests.length}o(B,"ReadableStreamGetNumReadRequests");function F(s){let d=s._reader;return!(d===void 0||!ue(d))}o(F,"ReadableStreamHasDefaultReader");class J{static{o(this,"ReadableStreamDefaultReader")}constructor(d){if(We(d,1,"ReadableStreamDefaultReader"),j(d,"First parameter"),En(d))throw new TypeError("This stream has already been locked for exclusive reading by another reader");ne(this,d),this._readRequests=new l}get closed(){return ue(this)?this._closedPromise:P(nt("closed"))}cancel(d=void 0){return ue(this)?this._ownerReadableStream===void 0?P(Q("cancel")):K(this,d):P(nt("cancel"))}read(){if(!ue(this))return P(nt("read"));if(this._ownerReadableStream===void 0)return P(Q("read from"));let d,v,R=h((V,W)=>{d=V,v=W});return le(this,{_chunkSteps:o(V=>d({value:V,done:!1}),"_chunkSteps"),_closeSteps:o(()=>d({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(V=>v(V),"_errorSteps")}),R}releaseLock(){if(!ue(this))throw nt("releaseLock");this._ownerReadableStream!==void 0&&Fe(this)}}Object.defineProperties(J.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(J.prototype.cancel,"cancel"),i(J.prototype.read,"read"),i(J.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(J.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function ue(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_readRequests")?!1:s instanceof J}o(ue,"IsReadableStreamDefaultReader");function le(s,d){let v=s._ownerReadableStream;v._disturbed=!0,v._state==="closed"?d._closeSteps():v._state==="errored"?d._errorSteps(v._storedError):v._readableStreamController[ee](d)}o(le,"ReadableStreamDefaultReaderRead");function Fe(s){Z(s);let d=new TypeError("Reader was released");rt(s,d)}o(Fe,"ReadableStreamDefaultReaderRelease");function rt(s,d){let v=s._readRequests;s._readRequests=new l,v.forEach(R=>{R._errorSteps(d)})}o(rt,"ReadableStreamDefaultReaderErrorReadRequests");function nt(s){return new TypeError(`ReadableStreamDefaultReader.prototype.${s} can only be used on a ReadableStreamDefaultReader`)}o(nt,"defaultReaderBrandCheckException");let Me=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Ve{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(d,v){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=d,this._preventCancel=v}next(){let d=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?$(this._ongoingPromise,d,d):d(),this._ongoingPromise}return(d){let v=o(()=>this._returnSteps(d),"returnSteps");return this._ongoingPromise?$(this._ongoingPromise,v,v):v()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let d=this._reader,v,R,C=h((W,se)=>{v=W,R=se});return le(d,{_chunkSteps:o(W=>{this._ongoingPromise=void 0,u(()=>v({value:W,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,Z(d),v({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(W=>{this._ongoingPromise=void 0,this._isFinished=!0,Z(d),R(W)},"_errorSteps")}),C}_returnSteps(d){if(this._isFinished)return Promise.resolve({value:d,done:!0});this._isFinished=!0;let v=this._reader;if(!this._preventCancel){let R=K(v,d);return Z(v),$(R,()=>({value:d,done:!0}))}return Z(v),_({value:d,done:!0})}}let gt={next(){return xo(this)?this._asyncIteratorImpl.next():P(So("next"))},return(s){return xo(this)?this._asyncIteratorImpl.return(s):P(So("return"))}};Object.setPrototypeOf(gt,Me);function wo(s,d){let v=G(s),R=new Ve(v,d),C=Object.create(gt);return C._asyncIteratorImpl=R,C}o(wo,"AcquireReadableStreamAsyncIterator");function xo(s){if(!r(s)||!Object.prototype.hasOwnProperty.call(s,"_asyncIteratorImpl"))return!1;try{return s._asyncIteratorImpl instanceof Ve}catch{return!1}}o(xo,"IsReadableStreamAsyncIterator");function So(s){return new TypeError(`ReadableStreamAsyncIterator.${s} can only be used on a ReadableSteamAsyncIterator`)}o(So,"streamAsyncIteratorBrandCheckException");let qt=Number.isNaN||function(s){return s!==s};var Jr,bt,yt;function Ze(s){return s.slice()}o(Ze,"CreateArrayFromList");function bm(s,d,v,R,C){new Uint8Array(s).set(new Uint8Array(v,R,C),d)}o(bm,"CopyDataBlockBytes");let Yr=o(s=>(typeof s.transfer=="function"?Yr=o(d=>d.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?Yr=o(d=>structuredClone(d,{transfer:[d]}),"TransferArrayBuffer"):Yr=o(d=>d,"TransferArrayBuffer"),Yr(s)),"TransferArrayBuffer"),Pn=o(s=>(typeof s.detached=="boolean"?Pn=o(d=>d.detached,"IsDetachedBuffer"):Pn=o(d=>d.byteLength===0,"IsDetachedBuffer"),Pn(s)),"IsDetachedBuffer");function Am(s,d,v){if(s.slice)return s.slice(d,v);let R=v-d,C=new ArrayBuffer(R);return bm(C,0,s,d,R),C}o(Am,"ArrayBufferSlice");function Ws(s,d){let v=s[d];if(v!=null){if(typeof v!="function")throw new TypeError(`${String(d)} is not a function`);return v}}o(Ws,"GetMethod");function lb(s){let d={[Symbol.iterator]:()=>s.iterator},v=async function*(){return yield*d}(),R=v.next;return{iterator:v,nextMethod:R,done:!1}}o(lb,"CreateAsyncFromSyncIterator");let qc=(yt=(Jr=Symbol.asyncIterator)!==null&&Jr!==void 0?Jr:(bt=Symbol.for)===null||bt===void 0?void 0:bt.call(Symbol,"Symbol.asyncIterator"))!==null&&yt!==void 0?yt:"@@asyncIterator";function Im(s,d="sync",v){if(v===void 0)if(d==="async"){if(v=Ws(s,qc),v===void 0){let V=Ws(s,Symbol.iterator),W=Im(s,"sync",V);return lb(W)}}else v=Ws(s,Symbol.iterator);if(v===void 0)throw new TypeError("The object is not iterable");let R=p(v,s,[]);if(!r(R))throw new TypeError("The iterator method must return an object");let C=R.next;return{iterator:R,nextMethod:C,done:!1}}o(Im,"GetIterator");function db(s){let d=p(s.nextMethod,s.iterator,[]);if(!r(d))throw new TypeError("The iterator.next() method must return an object");return d}o(db,"IteratorNext");function pb(s){return!!s.done}o(pb,"IteratorComplete");function fb(s){return s.value}o(fb,"IteratorValue");function mb(s){return!(typeof s!="number"||qt(s)||s<0)}o(mb,"IsNonNegativeNumber");function Rm(s){let d=Am(s.buffer,s.byteOffset,s.byteOffset+s.byteLength);return new Uint8Array(d)}o(Rm,"CloneAsUint8Array");function Bc(s){let d=s._queue.shift();return s._queueTotalSize-=d.size,s._queueTotalSize<0&&(s._queueTotalSize=0),d.value}o(Bc,"DequeueValue");function Vc(s,d,v){if(!mb(v)||v===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");s._queue.push({value:d,size:v}),s._queueTotalSize+=v}o(Vc,"EnqueueValueWithSize");function hb(s){return s._queue.peek().value}o(hb,"PeekQueueValue");function wn(s){s._queue=new l,s._queueTotalSize=0}o(wn,"ResetQueue");function $m(s){return s===DataView}o($m,"isDataViewConstructor");function gb(s){return $m(s.constructor)}o(gb,"isDataView");function yb(s){return $m(s)?1:s.BYTES_PER_ELEMENT}o(yb,"arrayBufferViewElementSize");class Wn{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Gc(this))throw Jc("view");return this._view}respond(d){if(!Gc(this))throw Jc("respond");if(We(d,1,"respond"),d=z(d,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Pn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Ys(this._associatedReadableByteStreamController,d)}respondWithNewView(d){if(!Gc(this))throw Jc("respondWithNewView");if(We(d,1,"respondWithNewView"),!ArrayBuffer.isView(d))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Pn(d.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Xs(this._associatedReadableByteStreamController,d)}}Object.defineProperties(Wn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(Wn.prototype.respond,"respond"),i(Wn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Wn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Xr{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Zn(this))throw Ei("byobRequest");return Kc(this)}get desiredSize(){if(!Zn(this))throw Ei("desiredSize");return Fm(this)}close(){if(!Zn(this))throw Ei("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let d=this._controlledReadableByteStream._state;if(d!=="readable")throw new TypeError(`The stream (in ${d} state) is not in the readable state and cannot be closed`);Ti(this)}enqueue(d){if(!Zn(this))throw Ei("enqueue");if(We(d,1,"enqueue"),!ArrayBuffer.isView(d))throw new TypeError("chunk must be an array buffer view");if(d.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(d.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let v=this._controlledReadableByteStream._state;if(v!=="readable")throw new TypeError(`The stream (in ${v} state) is not in the readable state and cannot be enqueued to`);Js(this,d)}error(d=void 0){if(!Zn(this))throw Ei("error");ir(this,d)}[re](d){Om(this),wn(this);let v=this._cancelAlgorithm(d);return Ks(this),v}[ee](d){let v=this._controlledReadableByteStream;if(this._queueTotalSize>0){Mm(this,d);return}let R=this._autoAllocateChunkSize;if(R!==void 0){let C;try{C=new ArrayBuffer(R)}catch(W){d._errorSteps(W);return}let V={buffer:C,bufferByteLength:R,byteOffset:0,byteLength:R,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(V)}N(v,d),Kn(this)}[Te](){if(this._pendingPullIntos.length>0){let d=this._pendingPullIntos.peek();d.readerType="none",this._pendingPullIntos=new l,this._pendingPullIntos.push(d)}}}Object.defineProperties(Xr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Xr.prototype.close,"close"),i(Xr.prototype.enqueue,"enqueue"),i(Xr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Xr.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Zn(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_controlledReadableByteStream")?!1:s instanceof Xr}o(Zn,"IsReadableByteStreamController");function Gc(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_associatedReadableByteStreamController")?!1:s instanceof Wn}o(Gc,"IsReadableStreamBYOBRequest");function Kn(s){if(!xb(s))return;if(s._pulling){s._pullAgain=!0;return}s._pulling=!0;let v=s._pullAlgorithm();S(v,()=>(s._pulling=!1,s._pullAgain&&(s._pullAgain=!1,Kn(s)),null),R=>(ir(s,R),null))}o(Kn,"ReadableByteStreamControllerCallPullIfNeeded");function Om(s){Wc(s),s._pendingPullIntos=new l}o(Om,"ReadableByteStreamControllerClearPendingPullIntos");function Hc(s,d){let v=!1;s._state==="closed"&&(v=!0);let R=Dm(d);d.readerType==="default"?U(s,R,v):Ib(s,R,v)}o(Hc,"ReadableByteStreamControllerCommitPullIntoDescriptor");function Dm(s){let d=s.bytesFilled,v=s.elementSize;return new s.viewConstructor(s.buffer,s.byteOffset,d/v)}o(Dm,"ReadableByteStreamControllerConvertPullIntoDescriptor");function Zs(s,d,v,R){s._queue.push({buffer:d,byteOffset:v,byteLength:R}),s._queueTotalSize+=R}o(Zs,"ReadableByteStreamControllerEnqueueChunkToQueue");function Cm(s,d,v,R){let C;try{C=Am(d,v,v+R)}catch(V){throw ir(s,V),V}Zs(s,C,0,R)}o(Cm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Nm(s,d){d.bytesFilled>0&&Cm(s,d.buffer,d.byteOffset,d.bytesFilled),To(s)}o(Nm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function zm(s,d){let v=Math.min(s._queueTotalSize,d.byteLength-d.bytesFilled),R=d.bytesFilled+v,C=v,V=!1,W=R%d.elementSize,se=R-W;se>=d.minimumFill&&(C=se-d.bytesFilled,V=!0);let ye=s._queue;for(;C>0;){let fe=ye.peek(),Ee=Math.min(C,fe.byteLength),Ce=d.byteOffset+d.bytesFilled;bm(d.buffer,Ce,fe.buffer,fe.byteOffset,Ee),fe.byteLength===Ee?ye.shift():(fe.byteOffset+=Ee,fe.byteLength-=Ee),s._queueTotalSize-=Ee,Um(s,Ee,d),C-=Ee}return V}o(zm,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function Um(s,d,v){v.bytesFilled+=d}o(Um,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function km(s){s._queueTotalSize===0&&s._closeRequested?(Ks(s),Oi(s._controlledReadableByteStream)):Kn(s)}o(km,"ReadableByteStreamControllerHandleQueueDrain");function Wc(s){s._byobRequest!==null&&(s._byobRequest._associatedReadableByteStreamController=void 0,s._byobRequest._view=null,s._byobRequest=null)}o(Wc,"ReadableByteStreamControllerInvalidateBYOBRequest");function Zc(s){for(;s._pendingPullIntos.length>0;){if(s._queueTotalSize===0)return;let d=s._pendingPullIntos.peek();zm(s,d)&&(To(s),Hc(s._controlledReadableByteStream,d))}}o(Zc,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function vb(s){let d=s._controlledReadableByteStream._reader;for(;d._readRequests.length>0;){if(s._queueTotalSize===0)return;let v=d._readRequests.shift();Mm(s,v)}}o(vb,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function _b(s,d,v,R){let C=s._controlledReadableByteStream,V=d.constructor,W=yb(V),{byteOffset:se,byteLength:ye}=d,fe=v*W,Ee;try{Ee=Yr(d.buffer)}catch(Qe){R._errorSteps(Qe);return}let Ce={buffer:Ee,bufferByteLength:Ee.byteLength,byteOffset:se,byteLength:ye,bytesFilled:0,minimumFill:fe,elementSize:W,viewConstructor:V,readerType:"byob"};if(s._pendingPullIntos.length>0){s._pendingPullIntos.push(Ce),Bm(C,R);return}if(C._state==="closed"){let Qe=new V(Ce.buffer,Ce.byteOffset,0);R._closeSteps(Qe);return}if(s._queueTotalSize>0){if(zm(s,Ce)){let Qe=Dm(Ce);km(s),R._chunkSteps(Qe);return}if(s._closeRequested){let Qe=new TypeError("Insufficient bytes to fill elements in the given buffer");ir(s,Qe),R._errorSteps(Qe);return}}s._pendingPullIntos.push(Ce),Bm(C,R),Kn(s)}o(_b,"ReadableByteStreamControllerPullInto");function Pb(s,d){d.readerType==="none"&&To(s);let v=s._controlledReadableByteStream;if(Yc(v))for(;Vm(v)>0;){let R=To(s);Hc(v,R)}}o(Pb,"ReadableByteStreamControllerRespondInClosedState");function wb(s,d,v){if(Um(s,d,v),v.readerType==="none"){Nm(s,v),Zc(s);return}if(v.bytesFilled<v.minimumFill)return;To(s);let R=v.bytesFilled%v.elementSize;if(R>0){let C=v.byteOffset+v.bytesFilled;Cm(s,v.buffer,C-R,R)}v.bytesFilled-=R,Hc(s._controlledReadableByteStream,v),Zc(s)}o(wb,"ReadableByteStreamControllerRespondInReadableState");function jm(s,d){let v=s._pendingPullIntos.peek();Wc(s),s._controlledReadableByteStream._state==="closed"?Pb(s,v):wb(s,d,v),Kn(s)}o(jm,"ReadableByteStreamControllerRespondInternal");function To(s){return s._pendingPullIntos.shift()}o(To,"ReadableByteStreamControllerShiftPendingPullInto");function xb(s){let d=s._controlledReadableByteStream;return d._state!=="readable"||s._closeRequested||!s._started?!1:!!(F(d)&&B(d)>0||Yc(d)&&Vm(d)>0||Fm(s)>0)}o(xb,"ReadableByteStreamControllerShouldCallPull");function Ks(s){s._pullAlgorithm=void 0,s._cancelAlgorithm=void 0}o(Ks,"ReadableByteStreamControllerClearAlgorithms");function Ti(s){let d=s._controlledReadableByteStream;if(!(s._closeRequested||d._state!=="readable")){if(s._queueTotalSize>0){s._closeRequested=!0;return}if(s._pendingPullIntos.length>0){let v=s._pendingPullIntos.peek();if(v.bytesFilled%v.elementSize!==0){let R=new TypeError("Insufficient bytes to fill elements in the given buffer");throw ir(s,R),R}}Ks(s),Oi(d)}}o(Ti,"ReadableByteStreamControllerClose");function Js(s,d){let v=s._controlledReadableByteStream;if(s._closeRequested||v._state!=="readable")return;let{buffer:R,byteOffset:C,byteLength:V}=d;if(Pn(R))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let W=Yr(R);if(s._pendingPullIntos.length>0){let se=s._pendingPullIntos.peek();if(Pn(se.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Wc(s),se.buffer=Yr(se.buffer),se.readerType==="none"&&Nm(s,se)}if(F(v))if(vb(s),B(v)===0)Zs(s,W,C,V);else{s._pendingPullIntos.length>0&&To(s);let se=new Uint8Array(W,C,V);U(v,se,!1)}else Yc(v)?(Zs(s,W,C,V),Zc(s)):Zs(s,W,C,V);Kn(s)}o(Js,"ReadableByteStreamControllerEnqueue");function ir(s,d){let v=s._controlledReadableByteStream;v._state==="readable"&&(Om(s),wn(s),Ks(s),mh(v,d))}o(ir,"ReadableByteStreamControllerError");function Mm(s,d){let v=s._queue.shift();s._queueTotalSize-=v.byteLength,km(s);let R=new Uint8Array(v.buffer,v.byteOffset,v.byteLength);d._chunkSteps(R)}o(Mm,"ReadableByteStreamControllerFillReadRequestFromQueue");function Kc(s){if(s._byobRequest===null&&s._pendingPullIntos.length>0){let d=s._pendingPullIntos.peek(),v=new Uint8Array(d.buffer,d.byteOffset+d.bytesFilled,d.byteLength-d.bytesFilled),R=Object.create(Wn.prototype);Tb(R,s,v),s._byobRequest=R}return s._byobRequest}o(Kc,"ReadableByteStreamControllerGetBYOBRequest");function Fm(s){let d=s._controlledReadableByteStream._state;return d==="errored"?null:d==="closed"?0:s._strategyHWM-s._queueTotalSize}o(Fm,"ReadableByteStreamControllerGetDesiredSize");function Ys(s,d){let v=s._pendingPullIntos.peek();if(s._controlledReadableByteStream._state==="closed"){if(d!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(d===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(v.bytesFilled+d>v.byteLength)throw new RangeError("bytesWritten out of range")}v.buffer=Yr(v.buffer),jm(s,d)}o(Ys,"ReadableByteStreamControllerRespond");function Xs(s,d){let v=s._pendingPullIntos.peek();if(s._controlledReadableByteStream._state==="closed"){if(d.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(d.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(v.byteOffset+v.bytesFilled!==d.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(v.bufferByteLength!==d.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(v.bytesFilled+d.byteLength>v.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let C=d.byteLength;v.buffer=Yr(d.buffer),jm(s,C)}o(Xs,"ReadableByteStreamControllerRespondWithNewView");function Lm(s,d,v,R,C,V,W){d._controlledReadableByteStream=s,d._pullAgain=!1,d._pulling=!1,d._byobRequest=null,d._queue=d._queueTotalSize=void 0,wn(d),d._closeRequested=!1,d._started=!1,d._strategyHWM=V,d._pullAlgorithm=R,d._cancelAlgorithm=C,d._autoAllocateChunkSize=W,d._pendingPullIntos=new l,s._readableStreamController=d;let se=v();S(_(se),()=>(d._started=!0,Kn(d),null),ye=>(ir(d,ye),null))}o(Lm,"SetUpReadableByteStreamController");function Sb(s,d,v){let R=Object.create(Xr.prototype),C,V,W;d.start!==void 0?C=o(()=>d.start(R),"startAlgorithm"):C=o(()=>{},"startAlgorithm"),d.pull!==void 0?V=o(()=>d.pull(R),"pullAlgorithm"):V=o(()=>_(void 0),"pullAlgorithm"),d.cancel!==void 0?W=o(ye=>d.cancel(ye),"cancelAlgorithm"):W=o(()=>_(void 0),"cancelAlgorithm");let se=d.autoAllocateChunkSize;if(se===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Lm(s,R,C,V,W,v,se)}o(Sb,"SetUpReadableByteStreamControllerFromUnderlyingSource");function Tb(s,d,v){s._associatedReadableByteStreamController=d,s._view=v}o(Tb,"SetUpReadableStreamBYOBRequest");function Jc(s){return new TypeError(`ReadableStreamBYOBRequest.prototype.${s} can only be used on a ReadableStreamBYOBRequest`)}o(Jc,"byobRequestBrandCheckException");function Ei(s){return new TypeError(`ReadableByteStreamController.prototype.${s} can only be used on a ReadableByteStreamController`)}o(Ei,"byteStreamControllerBrandCheckException");function Eb(s,d){st(s,d);let v=s?.mode;return{mode:v===void 0?void 0:bb(v,`${d} has member 'mode' that`)}}o(Eb,"convertReaderOptions");function bb(s,d){if(s=`${s}`,s!=="byob")throw new TypeError(`${d} '${s}' is not a valid enumeration value for ReadableStreamReaderMode`);return s}o(bb,"convertReadableStreamReaderMode");function Ab(s,d){var v;st(s,d);let R=(v=s?.min)!==null&&v!==void 0?v:1;return{min:z(R,`${d} has member 'min' that`)}}o(Ab,"convertByobReadOptions");function qm(s){return new xn(s)}o(qm,"AcquireReadableStreamBYOBReader");function Bm(s,d){s._reader._readIntoRequests.push(d)}o(Bm,"ReadableStreamAddReadIntoRequest");function Ib(s,d,v){let C=s._reader._readIntoRequests.shift();v?C._closeSteps(d):C._chunkSteps(d)}o(Ib,"ReadableStreamFulfillReadIntoRequest");function Vm(s){return s._reader._readIntoRequests.length}o(Vm,"ReadableStreamGetNumReadIntoRequests");function Yc(s){let d=s._reader;return!(d===void 0||!Jn(d))}o(Yc,"ReadableStreamHasBYOBReader");class xn{static{o(this,"ReadableStreamBYOBReader")}constructor(d){if(We(d,1,"ReadableStreamBYOBReader"),j(d,"First parameter"),En(d))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Zn(d._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");ne(this,d),this._readIntoRequests=new l}get closed(){return Jn(this)?this._closedPromise:P(Qs("closed"))}cancel(d=void 0){return Jn(this)?this._ownerReadableStream===void 0?P(Q("cancel")):K(this,d):P(Qs("cancel"))}read(d,v={}){if(!Jn(this))return P(Qs("read"));if(!ArrayBuffer.isView(d))return P(new TypeError("view must be an array buffer view"));if(d.byteLength===0)return P(new TypeError("view must have non-zero byteLength"));if(d.buffer.byteLength===0)return P(new TypeError("view's buffer must have non-zero byteLength"));if(Pn(d.buffer))return P(new TypeError("view's buffer has been detached"));let R;try{R=Ab(v,"options")}catch(fe){return P(fe)}let C=R.min;if(C===0)return P(new TypeError("options.min must be greater than 0"));if(gb(d)){if(C>d.byteLength)return P(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(C>d.length)return P(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return P(Q("read from"));let V,W,se=h((fe,Ee)=>{V=fe,W=Ee});return Gm(this,d,C,{_chunkSteps:o(fe=>V({value:fe,done:!1}),"_chunkSteps"),_closeSteps:o(fe=>V({value:fe,done:!0}),"_closeSteps"),_errorSteps:o(fe=>W(fe),"_errorSteps")}),se}releaseLock(){if(!Jn(this))throw Qs("releaseLock");this._ownerReadableStream!==void 0&&Rb(this)}}Object.defineProperties(xn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(xn.prototype.cancel,"cancel"),i(xn.prototype.read,"read"),i(xn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(xn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Jn(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_readIntoRequests")?!1:s instanceof xn}o(Jn,"IsReadableStreamBYOBReader");function Gm(s,d,v,R){let C=s._ownerReadableStream;C._disturbed=!0,C._state==="errored"?R._errorSteps(C._storedError):_b(C._readableStreamController,d,v,R)}o(Gm,"ReadableStreamBYOBReaderRead");function Rb(s){Z(s);let d=new TypeError("Reader was released");Hm(s,d)}o(Rb,"ReadableStreamBYOBReaderRelease");function Hm(s,d){let v=s._readIntoRequests;s._readIntoRequests=new l,v.forEach(R=>{R._errorSteps(d)})}o(Hm,"ReadableStreamBYOBReaderErrorReadIntoRequests");function Qs(s){return new TypeError(`ReadableStreamBYOBReader.prototype.${s} can only be used on a ReadableStreamBYOBReader`)}o(Qs,"byobReaderBrandCheckException");function bi(s,d){let{highWaterMark:v}=s;if(v===void 0)return d;if(qt(v)||v<0)throw new RangeError("Invalid highWaterMark");return v}o(bi,"ExtractHighWaterMark");function ea(s){let{size:d}=s;return d||(()=>1)}o(ea,"ExtractSizeAlgorithm");function ta(s,d){st(s,d);let v=s?.highWaterMark,R=s?.size;return{highWaterMark:v===void 0?void 0:O(v),size:R===void 0?void 0:$b(R,`${d} has member 'size' that`)}}o(ta,"convertQueuingStrategy");function $b(s,d){return dt(s,d),v=>O(s(v))}o($b,"convertQueuingStrategySize");function Ob(s,d){st(s,d);let v=s?.abort,R=s?.close,C=s?.start,V=s?.type,W=s?.write;return{abort:v===void 0?void 0:Db(v,s,`${d} has member 'abort' that`),close:R===void 0?void 0:Cb(R,s,`${d} has member 'close' that`),start:C===void 0?void 0:Nb(C,s,`${d} has member 'start' that`),write:W===void 0?void 0:zb(W,s,`${d} has member 'write' that`),type:V}}o(Ob,"convertUnderlyingSink");function Db(s,d,v){return dt(s,v),R=>c(s,d,[R])}o(Db,"convertUnderlyingSinkAbortCallback");function Cb(s,d,v){return dt(s,v),()=>c(s,d,[])}o(Cb,"convertUnderlyingSinkCloseCallback");function Nb(s,d,v){return dt(s,v),R=>p(s,d,[R])}o(Nb,"convertUnderlyingSinkStartCallback");function zb(s,d,v){return dt(s,v),(R,C)=>c(s,d,[R,C])}o(zb,"convertUnderlyingSinkWriteCallback");function Wm(s,d){if(!Eo(s))throw new TypeError(`${d} is not a WritableStream.`)}o(Wm,"assertWritableStream");function Ub(s){if(typeof s!="object"||s===null)return!1;try{return typeof s.aborted=="boolean"}catch{return!1}}o(Ub,"isAbortSignal");let kb=typeof AbortController=="function";function jb(){if(kb)return new AbortController}o(jb,"createAbortController");class Sn{static{o(this,"WritableStream")}constructor(d={},v={}){d===void 0?d=null:Ge(d,"First parameter");let R=ta(v,"Second parameter"),C=Ob(d,"First parameter");if(Km(this),C.type!==void 0)throw new RangeError("Invalid type is specified");let W=ea(R),se=bi(R,1);Xb(this,C,se,W)}get locked(){if(!Eo(this))throw sa("locked");return bo(this)}abort(d=void 0){return Eo(this)?bo(this)?P(new TypeError("Cannot abort a stream that already has a writer")):ra(this,d):P(sa("abort"))}close(){return Eo(this)?bo(this)?P(new TypeError("Cannot close a stream that already has a writer")):Or(this)?P(new TypeError("Cannot close an already-closing stream")):Jm(this):P(sa("close"))}getWriter(){if(!Eo(this))throw sa("getWriter");return Zm(this)}}Object.defineProperties(Sn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(Sn.prototype.abort,"abort"),i(Sn.prototype.close,"close"),i(Sn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Sn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function Zm(s){return new Qr(s)}o(Zm,"AcquireWritableStreamDefaultWriter");function Mb(s,d,v,R,C=1,V=()=>1){let W=Object.create(Sn.prototype);Km(W);let se=Object.create(Ao.prototype);return rh(W,se,s,d,v,R,C,V),W}o(Mb,"CreateWritableStream");function Km(s){s._state="writable",s._storedError=void 0,s._writer=void 0,s._writableStreamController=void 0,s._writeRequests=new l,s._inFlightWriteRequest=void 0,s._closeRequest=void 0,s._inFlightCloseRequest=void 0,s._pendingAbortRequest=void 0,s._backpressure=!1}o(Km,"InitializeWritableStream");function Eo(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_writableStreamController")?!1:s instanceof Sn}o(Eo,"IsWritableStream");function bo(s){return s._writer!==void 0}o(bo,"IsWritableStreamLocked");function ra(s,d){var v;if(s._state==="closed"||s._state==="errored")return _(void 0);s._writableStreamController._abortReason=d,(v=s._writableStreamController._abortController)===null||v===void 0||v.abort(d);let R=s._state;if(R==="closed"||R==="errored")return _(void 0);if(s._pendingAbortRequest!==void 0)return s._pendingAbortRequest._promise;let C=!1;R==="erroring"&&(C=!0,d=void 0);let V=h((W,se)=>{s._pendingAbortRequest={_promise:void 0,_resolve:W,_reject:se,_reason:d,_wasAlreadyErroring:C}});return s._pendingAbortRequest._promise=V,C||Qc(s,d),V}o(ra,"WritableStreamAbort");function Jm(s){let d=s._state;if(d==="closed"||d==="errored")return P(new TypeError(`The stream (in ${d} state) is not in the writable state and cannot be closed`));let v=h((C,V)=>{let W={_resolve:C,_reject:V};s._closeRequest=W}),R=s._writer;return R!==void 0&&s._backpressure&&d==="writable"&&al(R),Qb(s._writableStreamController),v}o(Jm,"WritableStreamClose");function Fb(s){return h((v,R)=>{let C={_resolve:v,_reject:R};s._writeRequests.push(C)})}o(Fb,"WritableStreamAddWriteRequest");function Xc(s,d){if(s._state==="writable"){Qc(s,d);return}el(s)}o(Xc,"WritableStreamDealWithRejection");function Qc(s,d){let v=s._writableStreamController;s._state="erroring",s._storedError=d;let R=s._writer;R!==void 0&&Xm(R,d),!Gb(s)&&v._started&&el(s)}o(Qc,"WritableStreamStartErroring");function el(s){s._state="errored",s._writableStreamController[g]();let d=s._storedError;if(s._writeRequests.forEach(C=>{C._reject(d)}),s._writeRequests=new l,s._pendingAbortRequest===void 0){na(s);return}let v=s._pendingAbortRequest;if(s._pendingAbortRequest=void 0,v._wasAlreadyErroring){v._reject(d),na(s);return}let R=s._writableStreamController[x](v._reason);S(R,()=>(v._resolve(),na(s),null),C=>(v._reject(C),na(s),null))}o(el,"WritableStreamFinishErroring");function Lb(s){s._inFlightWriteRequest._resolve(void 0),s._inFlightWriteRequest=void 0}o(Lb,"WritableStreamFinishInFlightWrite");function qb(s,d){s._inFlightWriteRequest._reject(d),s._inFlightWriteRequest=void 0,Xc(s,d)}o(qb,"WritableStreamFinishInFlightWriteWithError");function Bb(s){s._inFlightCloseRequest._resolve(void 0),s._inFlightCloseRequest=void 0,s._state==="erroring"&&(s._storedError=void 0,s._pendingAbortRequest!==void 0&&(s._pendingAbortRequest._resolve(),s._pendingAbortRequest=void 0)),s._state="closed";let v=s._writer;v!==void 0&&sh(v)}o(Bb,"WritableStreamFinishInFlightClose");function Vb(s,d){s._inFlightCloseRequest._reject(d),s._inFlightCloseRequest=void 0,s._pendingAbortRequest!==void 0&&(s._pendingAbortRequest._reject(d),s._pendingAbortRequest=void 0),Xc(s,d)}o(Vb,"WritableStreamFinishInFlightCloseWithError");function Or(s){return!(s._closeRequest===void 0&&s._inFlightCloseRequest===void 0)}o(Or,"WritableStreamCloseQueuedOrInFlight");function Gb(s){return!(s._inFlightWriteRequest===void 0&&s._inFlightCloseRequest===void 0)}o(Gb,"WritableStreamHasOperationMarkedInFlight");function Hb(s){s._inFlightCloseRequest=s._closeRequest,s._closeRequest=void 0}o(Hb,"WritableStreamMarkCloseRequestInFlight");function Wb(s){s._inFlightWriteRequest=s._writeRequests.shift()}o(Wb,"WritableStreamMarkFirstWriteRequestInFlight");function na(s){s._closeRequest!==void 0&&(s._closeRequest._reject(s._storedError),s._closeRequest=void 0);let d=s._writer;d!==void 0&&il(d,s._storedError)}o(na,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function tl(s,d){let v=s._writer;v!==void 0&&d!==s._backpressure&&(d?sA(v):al(v)),s._backpressure=d}o(tl,"WritableStreamUpdateBackpressure");class Qr{static{o(this,"WritableStreamDefaultWriter")}constructor(d){if(We(d,1,"WritableStreamDefaultWriter"),Wm(d,"First parameter"),bo(d))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=d,d._writer=this;let v=d._state;if(v==="writable")!Or(d)&&d._backpressure?ua(this):ah(this),aa(this);else if(v==="erroring")sl(this,d._storedError),aa(this);else if(v==="closed")ah(this),oA(this);else{let R=d._storedError;sl(this,R),ih(this,R)}}get closed(){return Yn(this)?this._closedPromise:P(Xn("closed"))}get desiredSize(){if(!Yn(this))throw Xn("desiredSize");if(this._ownerWritableStream===void 0)throw Ii("desiredSize");return Yb(this)}get ready(){return Yn(this)?this._readyPromise:P(Xn("ready"))}abort(d=void 0){return Yn(this)?this._ownerWritableStream===void 0?P(Ii("abort")):Zb(this,d):P(Xn("abort"))}close(){if(!Yn(this))return P(Xn("close"));let d=this._ownerWritableStream;return d===void 0?P(Ii("close")):Or(d)?P(new TypeError("Cannot close an already-closing stream")):Ym(this)}releaseLock(){if(!Yn(this))throw Xn("releaseLock");this._ownerWritableStream!==void 0&&Qm(this)}write(d=void 0){return Yn(this)?this._ownerWritableStream===void 0?P(Ii("write to")):eh(this,d):P(Xn("write"))}}Object.defineProperties(Qr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(Qr.prototype.abort,"abort"),i(Qr.prototype.close,"close"),i(Qr.prototype.releaseLock,"releaseLock"),i(Qr.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Qr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Yn(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_ownerWritableStream")?!1:s instanceof Qr}o(Yn,"IsWritableStreamDefaultWriter");function Zb(s,d){let v=s._ownerWritableStream;return ra(v,d)}o(Zb,"WritableStreamDefaultWriterAbort");function Ym(s){let d=s._ownerWritableStream;return Jm(d)}o(Ym,"WritableStreamDefaultWriterClose");function Kb(s){let d=s._ownerWritableStream,v=d._state;return Or(d)||v==="closed"?_(void 0):v==="errored"?P(d._storedError):Ym(s)}o(Kb,"WritableStreamDefaultWriterCloseWithErrorPropagation");function Jb(s,d){s._closedPromiseState==="pending"?il(s,d):iA(s,d)}o(Jb,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function Xm(s,d){s._readyPromiseState==="pending"?uh(s,d):aA(s,d)}o(Xm,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function Yb(s){let d=s._ownerWritableStream,v=d._state;return v==="errored"||v==="erroring"?null:v==="closed"?0:nh(d._writableStreamController)}o(Yb,"WritableStreamDefaultWriterGetDesiredSize");function Qm(s){let d=s._ownerWritableStream,v=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Xm(s,v),Jb(s,v),d._writer=void 0,s._ownerWritableStream=void 0}o(Qm,"WritableStreamDefaultWriterRelease");function eh(s,d){let v=s._ownerWritableStream,R=v._writableStreamController,C=eA(R,d);if(v!==s._ownerWritableStream)return P(Ii("write to"));let V=v._state;if(V==="errored")return P(v._storedError);if(Or(v)||V==="closed")return P(new TypeError("The stream is closing or closed and cannot be written to"));if(V==="erroring")return P(v._storedError);let W=Fb(v);return tA(R,d,C),W}o(eh,"WritableStreamDefaultWriterWrite");let th={};class Ao{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!rl(this))throw ol("abortReason");return this._abortReason}get signal(){if(!rl(this))throw ol("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(d=void 0){if(!rl(this))throw ol("error");this._controlledWritableStream._state==="writable"&&oh(this,d)}[x](d){let v=this._abortAlgorithm(d);return oa(this),v}[g](){wn(this)}}Object.defineProperties(Ao.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ao.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function rl(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_controlledWritableStream")?!1:s instanceof Ao}o(rl,"IsWritableStreamDefaultController");function rh(s,d,v,R,C,V,W,se){d._controlledWritableStream=s,s._writableStreamController=d,d._queue=void 0,d._queueTotalSize=void 0,wn(d),d._abortReason=void 0,d._abortController=jb(),d._started=!1,d._strategySizeAlgorithm=se,d._strategyHWM=W,d._writeAlgorithm=R,d._closeAlgorithm=C,d._abortAlgorithm=V;let ye=nl(d);tl(s,ye);let fe=v(),Ee=_(fe);S(Ee,()=>(d._started=!0,ia(d),null),Ce=>(d._started=!0,Xc(s,Ce),null))}o(rh,"SetUpWritableStreamDefaultController");function Xb(s,d,v,R){let C=Object.create(Ao.prototype),V,W,se,ye;d.start!==void 0?V=o(()=>d.start(C),"startAlgorithm"):V=o(()=>{},"startAlgorithm"),d.write!==void 0?W=o(fe=>d.write(fe,C),"writeAlgorithm"):W=o(()=>_(void 0),"writeAlgorithm"),d.close!==void 0?se=o(()=>d.close(),"closeAlgorithm"):se=o(()=>_(void 0),"closeAlgorithm"),d.abort!==void 0?ye=o(fe=>d.abort(fe),"abortAlgorithm"):ye=o(()=>_(void 0),"abortAlgorithm"),rh(s,C,V,W,se,ye,v,R)}o(Xb,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function oa(s){s._writeAlgorithm=void 0,s._closeAlgorithm=void 0,s._abortAlgorithm=void 0,s._strategySizeAlgorithm=void 0}o(oa,"WritableStreamDefaultControllerClearAlgorithms");function Qb(s){Vc(s,th,0),ia(s)}o(Qb,"WritableStreamDefaultControllerClose");function eA(s,d){try{return s._strategySizeAlgorithm(d)}catch(v){return Ai(s,v),1}}o(eA,"WritableStreamDefaultControllerGetChunkSize");function nh(s){return s._strategyHWM-s._queueTotalSize}o(nh,"WritableStreamDefaultControllerGetDesiredSize");function tA(s,d,v){try{Vc(s,d,v)}catch(C){Ai(s,C);return}let R=s._controlledWritableStream;if(!Or(R)&&R._state==="writable"){let C=nl(s);tl(R,C)}ia(s)}o(tA,"WritableStreamDefaultControllerWrite");function ia(s){let d=s._controlledWritableStream;if(!s._started||d._inFlightWriteRequest!==void 0)return;if(d._state==="erroring"){el(d);return}if(s._queue.length===0)return;let R=hb(s);R===th?rA(s):nA(s,R)}o(ia,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Ai(s,d){s._controlledWritableStream._state==="writable"&&oh(s,d)}o(Ai,"WritableStreamDefaultControllerErrorIfNeeded");function rA(s){let d=s._controlledWritableStream;Hb(d),Bc(s);let v=s._closeAlgorithm();oa(s),S(v,()=>(Bb(d),null),R=>(Vb(d,R),null))}o(rA,"WritableStreamDefaultControllerProcessClose");function nA(s,d){let v=s._controlledWritableStream;Wb(v);let R=s._writeAlgorithm(d);S(R,()=>{Lb(v);let C=v._state;if(Bc(s),!Or(v)&&C==="writable"){let V=nl(s);tl(v,V)}return ia(s),null},C=>(v._state==="writable"&&oa(s),qb(v,C),null))}o(nA,"WritableStreamDefaultControllerProcessWrite");function nl(s){return nh(s)<=0}o(nl,"WritableStreamDefaultControllerGetBackpressure");function oh(s,d){let v=s._controlledWritableStream;oa(s),Qc(v,d)}o(oh,"WritableStreamDefaultControllerError");function sa(s){return new TypeError(`WritableStream.prototype.${s} can only be used on a WritableStream`)}o(sa,"streamBrandCheckException$2");function ol(s){return new TypeError(`WritableStreamDefaultController.prototype.${s} can only be used on a WritableStreamDefaultController`)}o(ol,"defaultControllerBrandCheckException$2");function Xn(s){return new TypeError(`WritableStreamDefaultWriter.prototype.${s} can only be used on a WritableStreamDefaultWriter`)}o(Xn,"defaultWriterBrandCheckException");function Ii(s){return new TypeError("Cannot "+s+" a stream using a released writer")}o(Ii,"defaultWriterLockException");function aa(s){s._closedPromise=h((d,v)=>{s._closedPromise_resolve=d,s._closedPromise_reject=v,s._closedPromiseState="pending"})}o(aa,"defaultWriterClosedPromiseInitialize");function ih(s,d){aa(s),il(s,d)}o(ih,"defaultWriterClosedPromiseInitializeAsRejected");function oA(s){aa(s),sh(s)}o(oA,"defaultWriterClosedPromiseInitializeAsResolved");function il(s,d){s._closedPromise_reject!==void 0&&(b(s._closedPromise),s._closedPromise_reject(d),s._closedPromise_resolve=void 0,s._closedPromise_reject=void 0,s._closedPromiseState="rejected")}o(il,"defaultWriterClosedPromiseReject");function iA(s,d){ih(s,d)}o(iA,"defaultWriterClosedPromiseResetToRejected");function sh(s){s._closedPromise_resolve!==void 0&&(s._closedPromise_resolve(void 0),s._closedPromise_resolve=void 0,s._closedPromise_reject=void 0,s._closedPromiseState="resolved")}o(sh,"defaultWriterClosedPromiseResolve");function ua(s){s._readyPromise=h((d,v)=>{s._readyPromise_resolve=d,s._readyPromise_reject=v}),s._readyPromiseState="pending"}o(ua,"defaultWriterReadyPromiseInitialize");function sl(s,d){ua(s),uh(s,d)}o(sl,"defaultWriterReadyPromiseInitializeAsRejected");function ah(s){ua(s),al(s)}o(ah,"defaultWriterReadyPromiseInitializeAsResolved");function uh(s,d){s._readyPromise_reject!==void 0&&(b(s._readyPromise),s._readyPromise_reject(d),s._readyPromise_resolve=void 0,s._readyPromise_reject=void 0,s._readyPromiseState="rejected")}o(uh,"defaultWriterReadyPromiseReject");function sA(s){ua(s)}o(sA,"defaultWriterReadyPromiseReset");function aA(s,d){sl(s,d)}o(aA,"defaultWriterReadyPromiseResetToRejected");function al(s){s._readyPromise_resolve!==void 0&&(s._readyPromise_resolve(void 0),s._readyPromise_resolve=void 0,s._readyPromise_reject=void 0,s._readyPromiseState="fulfilled")}o(al,"defaultWriterReadyPromiseResolve");function uA(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(uA,"getGlobals");let ul=uA();function cA(s){if(!(typeof s=="function"||typeof s=="object")||s.name!=="DOMException")return!1;try{return new s,!0}catch{return!1}}o(cA,"isDOMExceptionConstructor");function lA(){let s=ul?.DOMException;return cA(s)?s:void 0}o(lA,"getFromGlobal");function dA(){let s=o(function(v,R){this.message=v||"",this.name=R||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return i(s,"DOMException"),s.prototype=Object.create(Error.prototype),Object.defineProperty(s.prototype,"constructor",{value:s,writable:!0,configurable:!0}),s}o(dA,"createPolyfill");let pA=lA()||dA();function ch(s,d,v,R,C,V){let W=G(s),se=Zm(d);s._disturbed=!0;let ye=!1,fe=_(void 0);return h((Ee,Ce)=>{let Qe;if(V!==void 0){if(Qe=o(()=>{let me=V.reason!==void 0?V.reason:new pA("Aborted","AbortError"),je=[];R||je.push(()=>d._state==="writable"?ra(d,me):_(void 0)),C||je.push(()=>s._state==="readable"?yr(s,me):_(void 0)),Nt(()=>Promise.all(je.map(et=>et())),!0,me)},"abortAlgorithm"),V.aborted){Qe();return}V.addEventListener("abort",Qe)}function vr(){return h((me,je)=>{function et(Bt){Bt?me():E(Oo(),et,je)}o(et,"next"),et(!1)})}o(vr,"pipeLoop");function Oo(){return ye?_(!0):E(se._readyPromise,()=>h((me,je)=>{le(W,{_chunkSteps:o(et=>{fe=E(eh(se,et),void 0,e),me(!1)},"_chunkSteps"),_closeSteps:o(()=>me(!0),"_closeSteps"),_errorSteps:je})}))}if(o(Oo,"pipeStep"),tn(s,W._closedPromise,me=>(R?sr(!0,me):Nt(()=>ra(d,me),!0,me),null)),tn(d,se._closedPromise,me=>(C?sr(!0,me):Nt(()=>yr(s,me),!0,me),null)),$t(s,W._closedPromise,()=>(v?sr():Nt(()=>Kb(se)),null)),Or(d)||d._state==="closed"){let me=new TypeError("the destination writable stream closed before all data could be piped to it");C?sr(!0,me):Nt(()=>yr(s,me),!0,me)}b(vr());function An(){let me=fe;return E(fe,()=>me!==fe?An():void 0)}o(An,"waitForWritesToFinish");function tn(me,je,et){me._state==="errored"?et(me._storedError):T(je,et)}o(tn,"isOrBecomesErrored");function $t(me,je,et){me._state==="closed"?et():w(je,et)}o($t,"isOrBecomesClosed");function Nt(me,je,et){if(ye)return;ye=!0,d._state==="writable"&&!Or(d)?w(An(),Bt):Bt();function Bt(){return S(me(),()=>rn(je,et),Do=>rn(!0,Do)),null}o(Bt,"doTheRest")}o(Nt,"shutdownWithAction");function sr(me,je){ye||(ye=!0,d._state==="writable"&&!Or(d)?w(An(),()=>rn(me,je)):rn(me,je))}o(sr,"shutdown");function rn(me,je){return Qm(se),Z(W),V!==void 0&&V.removeEventListener("abort",Qe),me?Ce(je):Ee(void 0),null}o(rn,"finalize")})}o(ch,"ReadableStreamPipeTo");class en{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ca(this))throw da("desiredSize");return cl(this)}close(){if(!ca(this))throw da("close");if(!Ro(this))throw new TypeError("The stream is not in a state that permits close");Qn(this)}enqueue(d=void 0){if(!ca(this))throw da("enqueue");if(!Ro(this))throw new TypeError("The stream is not in a state that permits enqueue");return Io(this,d)}error(d=void 0){if(!ca(this))throw da("error");gr(this,d)}[re](d){wn(this);let v=this._cancelAlgorithm(d);return la(this),v}[ee](d){let v=this._controlledReadableStream;if(this._queue.length>0){let R=Bc(this);this._closeRequested&&this._queue.length===0?(la(this),Oi(v)):Ri(this),d._chunkSteps(R)}else N(v,d),Ri(this)}[Te](){}}Object.defineProperties(en.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{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:"ReadableStreamDefaultController",configurable:!0});function ca(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_controlledReadableStream")?!1:s instanceof en}o(ca,"IsReadableStreamDefaultController");function Ri(s){if(!lh(s))return;if(s._pulling){s._pullAgain=!0;return}s._pulling=!0;let v=s._pullAlgorithm();S(v,()=>(s._pulling=!1,s._pullAgain&&(s._pullAgain=!1,Ri(s)),null),R=>(gr(s,R),null))}o(Ri,"ReadableStreamDefaultControllerCallPullIfNeeded");function lh(s){let d=s._controlledReadableStream;return!Ro(s)||!s._started?!1:!!(En(d)&&B(d)>0||cl(s)>0)}o(lh,"ReadableStreamDefaultControllerShouldCallPull");function la(s){s._pullAlgorithm=void 0,s._cancelAlgorithm=void 0,s._strategySizeAlgorithm=void 0}o(la,"ReadableStreamDefaultControllerClearAlgorithms");function Qn(s){if(!Ro(s))return;let d=s._controlledReadableStream;s._closeRequested=!0,s._queue.length===0&&(la(s),Oi(d))}o(Qn,"ReadableStreamDefaultControllerClose");function Io(s,d){if(!Ro(s))return;let v=s._controlledReadableStream;if(En(v)&&B(v)>0)U(v,d,!1);else{let R;try{R=s._strategySizeAlgorithm(d)}catch(C){throw gr(s,C),C}try{Vc(s,d,R)}catch(C){throw gr(s,C),C}}Ri(s)}o(Io,"ReadableStreamDefaultControllerEnqueue");function gr(s,d){let v=s._controlledReadableStream;v._state==="readable"&&(wn(s),la(s),mh(v,d))}o(gr,"ReadableStreamDefaultControllerError");function cl(s){let d=s._controlledReadableStream._state;return d==="errored"?null:d==="closed"?0:s._strategyHWM-s._queueTotalSize}o(cl,"ReadableStreamDefaultControllerGetDesiredSize");function fA(s){return!lh(s)}o(fA,"ReadableStreamDefaultControllerHasBackpressure");function Ro(s){let d=s._controlledReadableStream._state;return!s._closeRequested&&d==="readable"}o(Ro,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function dh(s,d,v,R,C,V,W){d._controlledReadableStream=s,d._queue=void 0,d._queueTotalSize=void 0,wn(d),d._started=!1,d._closeRequested=!1,d._pullAgain=!1,d._pulling=!1,d._strategySizeAlgorithm=W,d._strategyHWM=V,d._pullAlgorithm=R,d._cancelAlgorithm=C,s._readableStreamController=d;let se=v();S(_(se),()=>(d._started=!0,Ri(d),null),ye=>(gr(d,ye),null))}o(dh,"SetUpReadableStreamDefaultController");function mA(s,d,v,R){let C=Object.create(en.prototype),V,W,se;d.start!==void 0?V=o(()=>d.start(C),"startAlgorithm"):V=o(()=>{},"startAlgorithm"),d.pull!==void 0?W=o(()=>d.pull(C),"pullAlgorithm"):W=o(()=>_(void 0),"pullAlgorithm"),d.cancel!==void 0?se=o(ye=>d.cancel(ye),"cancelAlgorithm"):se=o(()=>_(void 0),"cancelAlgorithm"),dh(s,C,V,W,se,v,R)}o(mA,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function da(s){return new TypeError(`ReadableStreamDefaultController.prototype.${s} can only be used on a ReadableStreamDefaultController`)}o(da,"defaultControllerBrandCheckException$1");function hA(s,d){return Zn(s._readableStreamController)?yA(s):gA(s)}o(hA,"ReadableStreamTee");function gA(s,d){let v=G(s),R=!1,C=!1,V=!1,W=!1,se,ye,fe,Ee,Ce,Qe=h($t=>{Ce=$t});function vr(){return R?(C=!0,_(void 0)):(R=!0,le(v,{_chunkSteps:o(Nt=>{u(()=>{C=!1;let sr=Nt,rn=Nt;V||Io(fe._readableStreamController,sr),W||Io(Ee._readableStreamController,rn),R=!1,C&&vr()})},"_chunkSteps"),_closeSteps:o(()=>{R=!1,V||Qn(fe._readableStreamController),W||Qn(Ee._readableStreamController),(!V||!W)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{R=!1},"_errorSteps")}),_(void 0))}o(vr,"pullAlgorithm");function Oo($t){if(V=!0,se=$t,W){let Nt=Ze([se,ye]),sr=yr(s,Nt);Ce(sr)}return Qe}o(Oo,"cancel1Algorithm");function An($t){if(W=!0,ye=$t,V){let Nt=Ze([se,ye]),sr=yr(s,Nt);Ce(sr)}return Qe}o(An,"cancel2Algorithm");function tn(){}return o(tn,"startAlgorithm"),fe=$i(tn,vr,Oo),Ee=$i(tn,vr,An),T(v._closedPromise,$t=>(gr(fe._readableStreamController,$t),gr(Ee._readableStreamController,$t),(!V||!W)&&Ce(void 0),null)),[fe,Ee]}o(gA,"ReadableStreamDefaultTee");function yA(s){let d=G(s),v=!1,R=!1,C=!1,V=!1,W=!1,se,ye,fe,Ee,Ce,Qe=h(me=>{Ce=me});function vr(me){T(me._closedPromise,je=>(me!==d||(ir(fe._readableStreamController,je),ir(Ee._readableStreamController,je),(!V||!W)&&Ce(void 0)),null))}o(vr,"forwardReaderError");function Oo(){Jn(d)&&(Z(d),d=G(s),vr(d)),le(d,{_chunkSteps:o(je=>{u(()=>{R=!1,C=!1;let et=je,Bt=je;if(!V&&!W)try{Bt=Rm(je)}catch(Do){ir(fe._readableStreamController,Do),ir(Ee._readableStreamController,Do),Ce(yr(s,Do));return}V||Js(fe._readableStreamController,et),W||Js(Ee._readableStreamController,Bt),v=!1,R?tn():C&&$t()})},"_chunkSteps"),_closeSteps:o(()=>{v=!1,V||Ti(fe._readableStreamController),W||Ti(Ee._readableStreamController),fe._readableStreamController._pendingPullIntos.length>0&&Ys(fe._readableStreamController,0),Ee._readableStreamController._pendingPullIntos.length>0&&Ys(Ee._readableStreamController,0),(!V||!W)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{v=!1},"_errorSteps")})}o(Oo,"pullWithDefaultReader");function An(me,je){ue(d)&&(Z(d),d=qm(s),vr(d));let et=je?Ee:fe,Bt=je?fe:Ee;Gm(d,me,1,{_chunkSteps:o(Co=>{u(()=>{R=!1,C=!1;let No=je?W:V;if(je?V:W)No||Xs(et._readableStreamController,Co);else{let Ah;try{Ah=Rm(Co)}catch(ml){ir(et._readableStreamController,ml),ir(Bt._readableStreamController,ml),Ce(yr(s,ml));return}No||Xs(et._readableStreamController,Co),Js(Bt._readableStreamController,Ah)}v=!1,R?tn():C&&$t()})},"_chunkSteps"),_closeSteps:o(Co=>{v=!1;let No=je?W:V,_a=je?V:W;No||Ti(et._readableStreamController),_a||Ti(Bt._readableStreamController),Co!==void 0&&(No||Xs(et._readableStreamController,Co),!_a&&Bt._readableStreamController._pendingPullIntos.length>0&&Ys(Bt._readableStreamController,0)),(!No||!_a)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{v=!1},"_errorSteps")})}o(An,"pullWithBYOBReader");function tn(){if(v)return R=!0,_(void 0);v=!0;let me=Kc(fe._readableStreamController);return me===null?Oo():An(me._view,!1),_(void 0)}o(tn,"pull1Algorithm");function $t(){if(v)return C=!0,_(void 0);v=!0;let me=Kc(Ee._readableStreamController);return me===null?Oo():An(me._view,!0),_(void 0)}o($t,"pull2Algorithm");function Nt(me){if(V=!0,se=me,W){let je=Ze([se,ye]),et=yr(s,je);Ce(et)}return Qe}o(Nt,"cancel1Algorithm");function sr(me){if(W=!0,ye=me,V){let je=Ze([se,ye]),et=yr(s,je);Ce(et)}return Qe}o(sr,"cancel2Algorithm");function rn(){}return o(rn,"startAlgorithm"),fe=fh(rn,tn,Nt),Ee=fh(rn,$t,sr),vr(d),[fe,Ee]}o(yA,"ReadableByteStreamTee");function vA(s){return r(s)&&typeof s.getReader<"u"}o(vA,"isReadableStreamLike");function _A(s){return vA(s)?wA(s.getReader()):PA(s)}o(_A,"ReadableStreamFrom");function PA(s){let d,v=Im(s,"async"),R=e;function C(){let W;try{W=db(v)}catch(ye){return P(ye)}let se=_(W);return $(se,ye=>{if(!r(ye))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(pb(ye))Qn(d._readableStreamController);else{let Ee=fb(ye);Io(d._readableStreamController,Ee)}})}o(C,"pullAlgorithm");function V(W){let se=v.iterator,ye;try{ye=Ws(se,"return")}catch(Ce){return P(Ce)}if(ye===void 0)return _(void 0);let fe;try{fe=p(ye,se,[W])}catch(Ce){return P(Ce)}let Ee=_(fe);return $(Ee,Ce=>{if(!r(Ce))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(V,"cancelAlgorithm"),d=$i(R,C,V,0),d}o(PA,"ReadableStreamFromIterable");function wA(s){let d,v=e;function R(){let V;try{V=s.read()}catch(W){return P(W)}return $(V,W=>{if(!r(W))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(W.done)Qn(d._readableStreamController);else{let se=W.value;Io(d._readableStreamController,se)}})}o(R,"pullAlgorithm");function C(V){try{return _(s.cancel(V))}catch(W){return P(W)}}return o(C,"cancelAlgorithm"),d=$i(v,R,C,0),d}o(wA,"ReadableStreamFromDefaultReader");function xA(s,d){st(s,d);let v=s,R=v?.autoAllocateChunkSize,C=v?.cancel,V=v?.pull,W=v?.start,se=v?.type;return{autoAllocateChunkSize:R===void 0?void 0:z(R,`${d} has member 'autoAllocateChunkSize' that`),cancel:C===void 0?void 0:SA(C,v,`${d} has member 'cancel' that`),pull:V===void 0?void 0:TA(V,v,`${d} has member 'pull' that`),start:W===void 0?void 0:EA(W,v,`${d} has member 'start' that`),type:se===void 0?void 0:bA(se,`${d} has member 'type' that`)}}o(xA,"convertUnderlyingDefaultOrByteSource");function SA(s,d,v){return dt(s,v),R=>c(s,d,[R])}o(SA,"convertUnderlyingSourceCancelCallback");function TA(s,d,v){return dt(s,v),R=>c(s,d,[R])}o(TA,"convertUnderlyingSourcePullCallback");function EA(s,d,v){return dt(s,v),R=>p(s,d,[R])}o(EA,"convertUnderlyingSourceStartCallback");function bA(s,d){if(s=`${s}`,s!=="bytes")throw new TypeError(`${d} '${s}' is not a valid enumeration value for ReadableStreamType`);return s}o(bA,"convertReadableStreamType");function AA(s,d){return st(s,d),{preventCancel:!!s?.preventCancel}}o(AA,"convertIteratorOptions");function ph(s,d){st(s,d);let v=s?.preventAbort,R=s?.preventCancel,C=s?.preventClose,V=s?.signal;return V!==void 0&&IA(V,`${d} has member 'signal' that`),{preventAbort:!!v,preventCancel:!!R,preventClose:!!C,signal:V}}o(ph,"convertPipeOptions");function IA(s,d){if(!Ub(s))throw new TypeError(`${d} is not an AbortSignal.`)}o(IA,"assertAbortSignal");function RA(s,d){st(s,d);let v=s?.readable;A(v,"readable","ReadableWritablePair"),j(v,`${d} has member 'readable' that`);let R=s?.writable;return A(R,"writable","ReadableWritablePair"),Wm(R,`${d} has member 'writable' that`),{readable:v,writable:R}}o(RA,"convertReadableWritablePair");class At{static{o(this,"ReadableStream")}constructor(d={},v={}){d===void 0?d=null:Ge(d,"First parameter");let R=ta(v,"Second parameter"),C=xA(d,"First parameter");if(ll(this),C.type==="bytes"){if(R.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let V=bi(R,0);Sb(this,C,V)}else{let V=ea(R),W=bi(R,1);mA(this,C,W,V)}}get locked(){if(!Tn(this))throw eo("locked");return En(this)}cancel(d=void 0){return Tn(this)?En(this)?P(new TypeError("Cannot cancel a stream that already has a reader")):yr(this,d):P(eo("cancel"))}getReader(d=void 0){if(!Tn(this))throw eo("getReader");return Eb(d,"First parameter").mode===void 0?G(this):qm(this)}pipeThrough(d,v={}){if(!Tn(this))throw eo("pipeThrough");We(d,1,"pipeThrough");let R=RA(d,"First parameter"),C=ph(v,"Second parameter");if(En(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(bo(R.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let V=ch(this,R.writable,C.preventClose,C.preventAbort,C.preventCancel,C.signal);return b(V),R.readable}pipeTo(d,v={}){if(!Tn(this))return P(eo("pipeTo"));if(d===void 0)return P("Parameter 1 is required in 'pipeTo'.");if(!Eo(d))return P(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let R;try{R=ph(v,"Second parameter")}catch(C){return P(C)}return En(this)?P(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):bo(d)?P(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):ch(this,d,R.preventClose,R.preventAbort,R.preventCancel,R.signal)}tee(){if(!Tn(this))throw eo("tee");let d=hA(this);return Ze(d)}values(d=void 0){if(!Tn(this))throw eo("values");let v=AA(d,"First parameter");return wo(this,v.preventCancel)}[qc](d){return this.values(d)}static from(d){return _A(d)}}Object.defineProperties(At,{from:{enumerable:!0}}),Object.defineProperties(At.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(At.from,"from"),i(At.prototype.cancel,"cancel"),i(At.prototype.getReader,"getReader"),i(At.prototype.pipeThrough,"pipeThrough"),i(At.prototype.pipeTo,"pipeTo"),i(At.prototype.tee,"tee"),i(At.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(At.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(At.prototype,qc,{value:At.prototype.values,writable:!0,configurable:!0});function $i(s,d,v,R=1,C=()=>1){let V=Object.create(At.prototype);ll(V);let W=Object.create(en.prototype);return dh(V,W,s,d,v,R,C),V}o($i,"CreateReadableStream");function fh(s,d,v){let R=Object.create(At.prototype);ll(R);let C=Object.create(Xr.prototype);return Lm(R,C,s,d,v,0,void 0),R}o(fh,"CreateReadableByteStream");function ll(s){s._state="readable",s._reader=void 0,s._storedError=void 0,s._disturbed=!1}o(ll,"InitializeReadableStream");function Tn(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_readableStreamController")?!1:s instanceof At}o(Tn,"IsReadableStream");function En(s){return s._reader!==void 0}o(En,"IsReadableStreamLocked");function yr(s,d){if(s._disturbed=!0,s._state==="closed")return _(void 0);if(s._state==="errored")return P(s._storedError);Oi(s);let v=s._reader;if(v!==void 0&&Jn(v)){let C=v._readIntoRequests;v._readIntoRequests=new l,C.forEach(V=>{V._closeSteps(void 0)})}let R=s._readableStreamController[re](d);return $(R,e)}o(yr,"ReadableStreamCancel");function Oi(s){s._state="closed";let d=s._reader;if(d!==void 0&&(He(d),ue(d))){let v=d._readRequests;d._readRequests=new l,v.forEach(R=>{R._closeSteps()})}}o(Oi,"ReadableStreamClose");function mh(s,d){s._state="errored",s._storedError=d;let v=s._reader;v!==void 0&&(Ie(v,d),ue(v)?rt(v,d):Hm(v,d))}o(mh,"ReadableStreamError");function eo(s){return new TypeError(`ReadableStream.prototype.${s} can only be used on a ReadableStream`)}o(eo,"streamBrandCheckException$1");function hh(s,d){st(s,d);let v=s?.highWaterMark;return A(v,"highWaterMark","QueuingStrategyInit"),{highWaterMark:O(v)}}o(hh,"convertQueuingStrategyInit");let gh=o(s=>s.byteLength,"byteLengthSizeFunction");i(gh,"size");class pa{static{o(this,"ByteLengthQueuingStrategy")}constructor(d){We(d,1,"ByteLengthQueuingStrategy"),d=hh(d,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=d.highWaterMark}get highWaterMark(){if(!vh(this))throw yh("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!vh(this))throw yh("size");return gh}}Object.defineProperties(pa.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(pa.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function yh(s){return new TypeError(`ByteLengthQueuingStrategy.prototype.${s} can only be used on a ByteLengthQueuingStrategy`)}o(yh,"byteLengthBrandCheckException");function vh(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_byteLengthQueuingStrategyHighWaterMark")?!1:s instanceof pa}o(vh,"IsByteLengthQueuingStrategy");let _h=o(()=>1,"countSizeFunction");i(_h,"size");class fa{static{o(this,"CountQueuingStrategy")}constructor(d){We(d,1,"CountQueuingStrategy"),d=hh(d,"First parameter"),this._countQueuingStrategyHighWaterMark=d.highWaterMark}get highWaterMark(){if(!wh(this))throw Ph("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!wh(this))throw Ph("size");return _h}}Object.defineProperties(fa.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(fa.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function Ph(s){return new TypeError(`CountQueuingStrategy.prototype.${s} can only be used on a CountQueuingStrategy`)}o(Ph,"countBrandCheckException");function wh(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_countQueuingStrategyHighWaterMark")?!1:s instanceof fa}o(wh,"IsCountQueuingStrategy");function $A(s,d){st(s,d);let v=s?.cancel,R=s?.flush,C=s?.readableType,V=s?.start,W=s?.transform,se=s?.writableType;return{cancel:v===void 0?void 0:NA(v,s,`${d} has member 'cancel' that`),flush:R===void 0?void 0:OA(R,s,`${d} has member 'flush' that`),readableType:C,start:V===void 0?void 0:DA(V,s,`${d} has member 'start' that`),transform:W===void 0?void 0:CA(W,s,`${d} has member 'transform' that`),writableType:se}}o($A,"convertTransformer");function OA(s,d,v){return dt(s,v),R=>c(s,d,[R])}o(OA,"convertTransformerFlushCallback");function DA(s,d,v){return dt(s,v),R=>p(s,d,[R])}o(DA,"convertTransformerStartCallback");function CA(s,d,v){return dt(s,v),(R,C)=>c(s,d,[R,C])}o(CA,"convertTransformerTransformCallback");function NA(s,d,v){return dt(s,v),R=>c(s,d,[R])}o(NA,"convertTransformerCancelCallback");class ma{static{o(this,"TransformStream")}constructor(d={},v={},R={}){d===void 0&&(d=null);let C=ta(v,"Second parameter"),V=ta(R,"Third parameter"),W=$A(d,"First parameter");if(W.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(W.writableType!==void 0)throw new RangeError("Invalid writableType specified");let se=bi(V,0),ye=ea(V),fe=bi(C,1),Ee=ea(C),Ce,Qe=h(vr=>{Ce=vr});zA(this,Qe,fe,Ee,se,ye),kA(this,W),W.start!==void 0?Ce(W.start(this._transformStreamController)):Ce(void 0)}get readable(){if(!xh(this))throw bh("readable");return this._readable}get writable(){if(!xh(this))throw bh("writable");return this._writable}}Object.defineProperties(ma.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ma.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function zA(s,d,v,R,C,V){function W(){return d}o(W,"startAlgorithm");function se(Qe){return FA(s,Qe)}o(se,"writeAlgorithm");function ye(Qe){return LA(s,Qe)}o(ye,"abortAlgorithm");function fe(){return qA(s)}o(fe,"closeAlgorithm"),s._writable=Mb(W,se,fe,ye,v,R);function Ee(){return BA(s)}o(Ee,"pullAlgorithm");function Ce(Qe){return VA(s,Qe)}o(Ce,"cancelAlgorithm"),s._readable=$i(W,Ee,Ce,C,V),s._backpressure=void 0,s._backpressureChangePromise=void 0,s._backpressureChangePromise_resolve=void 0,ha(s,!0),s._transformStreamController=void 0}o(zA,"InitializeTransformStream");function xh(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_transformStreamController")?!1:s instanceof ma}o(xh,"IsTransformStream");function Sh(s,d){gr(s._readable._readableStreamController,d),dl(s,d)}o(Sh,"TransformStreamError");function dl(s,d){ya(s._transformStreamController),Ai(s._writable._writableStreamController,d),pl(s)}o(dl,"TransformStreamErrorWritableAndUnblockWrite");function pl(s){s._backpressure&&ha(s,!1)}o(pl,"TransformStreamUnblockWrite");function ha(s,d){s._backpressureChangePromise!==void 0&&s._backpressureChangePromise_resolve(),s._backpressureChangePromise=h(v=>{s._backpressureChangePromise_resolve=v}),s._backpressure=d}o(ha,"TransformStreamSetBackpressure");class bn{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ga(this))throw va("desiredSize");let d=this._controlledTransformStream._readable._readableStreamController;return cl(d)}enqueue(d=void 0){if(!ga(this))throw va("enqueue");Th(this,d)}error(d=void 0){if(!ga(this))throw va("error");jA(this,d)}terminate(){if(!ga(this))throw va("terminate");MA(this)}}Object.defineProperties(bn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(bn.prototype.enqueue,"enqueue"),i(bn.prototype.error,"error"),i(bn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function ga(s){return!r(s)||!Object.prototype.hasOwnProperty.call(s,"_controlledTransformStream")?!1:s instanceof bn}o(ga,"IsTransformStreamDefaultController");function UA(s,d,v,R,C){d._controlledTransformStream=s,s._transformStreamController=d,d._transformAlgorithm=v,d._flushAlgorithm=R,d._cancelAlgorithm=C,d._finishPromise=void 0,d._finishPromise_resolve=void 0,d._finishPromise_reject=void 0}o(UA,"SetUpTransformStreamDefaultController");function kA(s,d){let v=Object.create(bn.prototype),R,C,V;d.transform!==void 0?R=o(W=>d.transform(W,v),"transformAlgorithm"):R=o(W=>{try{return Th(v,W),_(void 0)}catch(se){return P(se)}},"transformAlgorithm"),d.flush!==void 0?C=o(()=>d.flush(v),"flushAlgorithm"):C=o(()=>_(void 0),"flushAlgorithm"),d.cancel!==void 0?V=o(W=>d.cancel(W),"cancelAlgorithm"):V=o(()=>_(void 0),"cancelAlgorithm"),UA(s,v,R,C,V)}o(kA,"SetUpTransformStreamDefaultControllerFromTransformer");function ya(s){s._transformAlgorithm=void 0,s._flushAlgorithm=void 0,s._cancelAlgorithm=void 0}o(ya,"TransformStreamDefaultControllerClearAlgorithms");function Th(s,d){let v=s._controlledTransformStream,R=v._readable._readableStreamController;if(!Ro(R))throw new TypeError("Readable side is not in a state that permits enqueue");try{Io(R,d)}catch(V){throw dl(v,V),v._readable._storedError}fA(R)!==v._backpressure&&ha(v,!0)}o(Th,"TransformStreamDefaultControllerEnqueue");function jA(s,d){Sh(s._controlledTransformStream,d)}o(jA,"TransformStreamDefaultControllerError");function Eh(s,d){let v=s._transformAlgorithm(d);return $(v,void 0,R=>{throw Sh(s._controlledTransformStream,R),R})}o(Eh,"TransformStreamDefaultControllerPerformTransform");function MA(s){let d=s._controlledTransformStream,v=d._readable._readableStreamController;Qn(v);let R=new TypeError("TransformStream terminated");dl(d,R)}o(MA,"TransformStreamDefaultControllerTerminate");function FA(s,d){let v=s._transformStreamController;if(s._backpressure){let R=s._backpressureChangePromise;return $(R,()=>{let C=s._writable;if(C._state==="erroring")throw C._storedError;return Eh(v,d)})}return Eh(v,d)}o(FA,"TransformStreamDefaultSinkWriteAlgorithm");function LA(s,d){let v=s._transformStreamController;if(v._finishPromise!==void 0)return v._finishPromise;let R=s._readable;v._finishPromise=h((V,W)=>{v._finishPromise_resolve=V,v._finishPromise_reject=W});let C=v._cancelAlgorithm(d);return ya(v),S(C,()=>(R._state==="errored"?$o(v,R._storedError):(gr(R._readableStreamController,d),fl(v)),null),V=>(gr(R._readableStreamController,V),$o(v,V),null)),v._finishPromise}o(LA,"TransformStreamDefaultSinkAbortAlgorithm");function qA(s){let d=s._transformStreamController;if(d._finishPromise!==void 0)return d._finishPromise;let v=s._readable;d._finishPromise=h((C,V)=>{d._finishPromise_resolve=C,d._finishPromise_reject=V});let R=d._flushAlgorithm();return ya(d),S(R,()=>(v._state==="errored"?$o(d,v._storedError):(Qn(v._readableStreamController),fl(d)),null),C=>(gr(v._readableStreamController,C),$o(d,C),null)),d._finishPromise}o(qA,"TransformStreamDefaultSinkCloseAlgorithm");function BA(s){return ha(s,!1),s._backpressureChangePromise}o(BA,"TransformStreamDefaultSourcePullAlgorithm");function VA(s,d){let v=s._transformStreamController;if(v._finishPromise!==void 0)return v._finishPromise;let R=s._writable;v._finishPromise=h((V,W)=>{v._finishPromise_resolve=V,v._finishPromise_reject=W});let C=v._cancelAlgorithm(d);return ya(v),S(C,()=>(R._state==="errored"?$o(v,R._storedError):(Ai(R._writableStreamController,d),pl(s),fl(v)),null),V=>(Ai(R._writableStreamController,V),pl(s),$o(v,V),null)),v._finishPromise}o(VA,"TransformStreamDefaultSourceCancelAlgorithm");function va(s){return new TypeError(`TransformStreamDefaultController.prototype.${s} can only be used on a TransformStreamDefaultController`)}o(va,"defaultControllerBrandCheckException");function fl(s){s._finishPromise_resolve!==void 0&&(s._finishPromise_resolve(),s._finishPromise_resolve=void 0,s._finishPromise_reject=void 0)}o(fl,"defaultControllerFinishPromiseResolve");function $o(s,d){s._finishPromise_reject!==void 0&&(b(s._finishPromise),s._finishPromise_reject(d),s._finishPromise_resolve=void 0,s._finishPromise_reject=void 0)}o($o,"defaultControllerFinishPromiseReject");function bh(s){return new TypeError(`TransformStream.prototype.${s} can only be used on a TransformStream`)}o(bh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=pa,t.CountQueuingStrategy=fa,t.ReadableByteStreamController=Xr,t.ReadableStream=At,t.ReadableStreamBYOBReader=xn,t.ReadableStreamBYOBRequest=Wn,t.ReadableStreamDefaultController=en,t.ReadableStreamDefaultReader=J,t.TransformStream=ma,t.TransformStreamDefaultController=bn,t.WritableStream=Sn,t.WritableStreamDefaultController=Ao,t.WritableStreamDefaultWriter=Qr})});var RP=M(()=>{if(!globalThis.ReadableStream)try{let t=require("node:process"),{emitWarning:e}=t;try{t.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),t.emitWarning=e}catch(r){throw t.emitWarning=e,r}}catch{Object.assign(globalThis,IP())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=o(function(r){let n=0,i=this;return new ReadableStream({type:"bytes",async pull(a){let m=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=m.byteLength,a.enqueue(new Uint8Array(m)),n===i.size&&a.close()}})},"name"))}catch{}});async function*Dd(t,e=!0){for(let r of t)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let n=r.byteOffset,i=r.byteOffset+r.byteLength;for(;n!==i;){let a=Math.min(i-n,$P),f=r.buffer.slice(n,n+a);n+=f.byteLength,yield new Uint8Array(f)}}else yield r;else{let n=0,i=r;for(;n!==i.size;){let f=await i.slice(n,Math.min(i.size,n+$P)).arrayBuffer();n+=f.byteLength,yield new Uint8Array(f)}}}var u9,$P,OP,fD,xr,ss=Pt(()=>{u9=ze(RP(),1);$P=65536;o(Dd,"toIterator");OP=class Cd{static{o(this,"Blob")}#e=[];#t="";#r=0;#n="transparent";constructor(e=[],r={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let n=new TextEncoder;for(let a of e){let f;ArrayBuffer.isView(a)?f=new Uint8Array(a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength)):a instanceof ArrayBuffer?f=new Uint8Array(a.slice(0)):a instanceof Cd?f=a:f=n.encode(`${a}`),this.#r+=ArrayBuffer.isView(f)?f.byteLength:f.size,this.#e.push(f)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of Dd(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 Dd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Dd(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let n=await e.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,n=""){let{size:i}=this,a=e<0?Math.max(i+e,0):Math.min(e,i),f=r<0?Math.max(i+r,0):Math.min(r,i),m=Math.max(f-a,0),h=this.#e,_=[],P=0;for(let S of h){if(P>=m)break;let w=ArrayBuffer.isView(S)?S.byteLength:S.size;if(a&&w<=a)a-=w,f-=w;else{let T;ArrayBuffer.isView(S)?(T=S.subarray(a,Math.min(w,f)),P+=T.byteLength):(T=S.slice(a,Math.min(w,f)),P+=T.size),f-=w,_.push(T),a=0}}let E=new Cd([],{type:String(n).toLowerCase()});return E.#r=m,E.#e=_,E}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}};Object.defineProperties(OP.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});fD=OP,xr=fD});var mD,hD,kn,Nd=Pt(()=>{ss();mD=class extends xr{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 xr&&/^(File)$/.test(e[Symbol.toStringTag])}},hD=mD,kn=hD});function NP(t,e=xr){var r=`${DP()}${DP()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
|
|
15
|
+
Content-Disposition: form-data; name="`;return t.forEach((a,f)=>typeof a=="string"?n.push(i+zd(f)+`"\r
|
|
16
|
+
\r
|
|
17
|
+
${a.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
18
|
+
`)}\r
|
|
19
|
+
`):n.push(i+zd(f)+`"; filename="${zd(a.name,1)}"\r
|
|
20
|
+
Content-Type: ${a.type||"application/octet-stream"}\r
|
|
21
|
+
\r
|
|
22
|
+
`,a,`\r
|
|
23
|
+
`)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var as,gD,yD,DP,vD,CP,zd,ao,jn,mu=Pt(()=>{ss();Nd();({toStringTag:as,iterator:gD,hasInstance:yD}=Symbol),DP=Math.random,vD="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),CP=o((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[as])?[(r=r!==void 0?r+"":e[as]=="File"?e.name:"blob",t),e.name!==r||e[as]=="blob"?new kn([e],r,e):e]:[t,e+""]),"f"),zd=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"),ao=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"),jn=class{static{o(this,"FormData")}#e=[];constructor(...e){if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[as](){return"FormData"}[gD](){return this.entries()}static[yD](e){return e&&typeof e=="object"&&e[as]==="FormData"&&!vD.some(r=>typeof e[r]!="function")}append(...e){ao("append",arguments,2),this.#e.push(CP(...e))}delete(e){ao("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){ao("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 ao("getAll",arguments,1),r=[],e+="",this.#e.forEach(n=>n[0]===e&&r.push(n[1])),r}has(e){return ao("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){ao("forEach",arguments,1);for(var[n,i]of this)e.call(r,i,n,this)}set(...e){ao("set",arguments,2);var r=[],n=!0;e=CP(...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(NP,"formDataToBlob")});var dn,hu=Pt(()=>{dn=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 Dt,Ud=Pt(()=>{hu();Dt=class extends dn{static{o(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var gu,kd,us,zP,UP,kP,yu=Pt(()=>{gu=Symbol.toStringTag,kd=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[gu]==="URLSearchParams","isURLSearchParameters"),us=o(t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[gu]),"isBlob"),zP=o(t=>typeof t=="object"&&(t[gu]==="AbortSignal"||t[gu]==="EventTarget"),"isAbortSignal"),UP=o((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),kP=o((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var MP=M((A9,jP)=>{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)}jP.exports=globalThis.DOMException});var uo,FP,LP,jd,qP,BP,VP,GP,HP,WP,vu,Md=Pt(()=>{uo=require("node:fs"),FP=require("node:path"),LP=ze(MP(),1);Nd();ss();({stat:jd}=uo.promises),qP=o((t,e)=>HP((0,uo.statSync)(t),t,e),"blobFromSync"),BP=o((t,e)=>jd(t).then(r=>HP(r,t,e)),"blobFrom"),VP=o((t,e)=>jd(t).then(r=>WP(r,t,e)),"fileFrom"),GP=o((t,e)=>WP((0,uo.statSync)(t),t,e),"fileFromSync"),HP=o((t,e,r="")=>new xr([new vu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),WP=o((t,e,r="")=>new kn([new vu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,FP.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),vu=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 jd(this.#e);if(e>this.lastModified)throw new LP.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,uo.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var KP={};Pa(KP,{toFormData:()=>ED});function TD(t){let e=t.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let r=e[2]||e[3]||"",n=r.slice(r.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,(i,a)=>String.fromCharCode(a)),n}async function ED(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 Fd(r[1]||r[2]),i,a,f,m,h,_,P=[],E=new jn,S=o(u=>{f+=b.decode(u,{stream:!0})},"onPartData"),w=o(u=>{P.push(u)},"appendToFile"),T=o(()=>{let u=new kn(P,_,{type:h});E.append(m,u)},"appendFileToFormData"),$=o(()=>{E.append(m,f)},"appendEntryToFormData"),b=new TextDecoder("utf-8");b.decode(),n.onPartBegin=function(){n.onPartData=S,n.onPartEnd=$,i="",a="",f="",m="",h="",_=null,P.length=0},n.onHeaderField=function(u){i+=b.decode(u,{stream:!0})},n.onHeaderValue=function(u){a+=b.decode(u,{stream:!0})},n.onHeaderEnd=function(){if(a+=b.decode(),i=i.toLowerCase(),i==="content-disposition"){let u=a.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);u&&(m=u[2]||u[3]||""),_=TD(a),_&&(n.onPartData=w,n.onPartEnd=T)}else i==="content-type"&&(h=a);a="",i=""};for await(let u of t)n.write(u);return n.end(),E}var Ur,tt,ZP,Mn,_u,Pu,_D,cs,PD,wD,xD,SD,co,Fd,JP=Pt(()=>{Md();mu();Ur=0,tt={START_BOUNDARY:Ur++,HEADER_FIELD_START:Ur++,HEADER_FIELD:Ur++,HEADER_VALUE_START:Ur++,HEADER_VALUE:Ur++,HEADER_VALUE_ALMOST_DONE:Ur++,HEADERS_ALMOST_DONE:Ur++,PART_DATA_START:Ur++,PART_DATA:Ur++,END:Ur++},ZP=1,Mn={PART_BOUNDARY:ZP,LAST_BOUNDARY:ZP*=2},_u=10,Pu=13,_D=32,cs=45,PD=58,wD=97,xD=122,SD=o(t=>t|32,"lower"),co=o(()=>{},"noop"),Fd=class{static{o(this,"MultipartParser")}constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=co,this.onHeaderField=co,this.onHeadersEnd=co,this.onHeaderValue=co,this.onPartBegin=co,this.onPartData=co,this.onPartEnd=co,this.boundaryChars={},e=`\r
|
|
25
|
+
--`+e;let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n),this.boundaryChars[r[n]]=!0;this.boundary=r,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=tt.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:a,boundary:f,boundaryChars:m,index:h,state:_,flags:P}=this,E=this.boundary.length,S=E-1,w=e.length,T,$,b=o(y=>{this[y+"Mark"]=r},"mark"),u=o(y=>{delete this[y+"Mark"]},"clear"),p=o((y,l,x,g)=>{(l===void 0||l!==x)&&this[y](g&&g.subarray(l,x))},"callback"),c=o((y,l)=>{let x=y+"Mark";x in this&&(l?(p(y,this[x],r,e),delete this[x]):(p(y,this[x],e.length,e),this[x]=0))},"dataCallback");for(r=0;r<n;r++)switch(T=e[r],_){case tt.START_BOUNDARY:if(h===f.length-2){if(T===cs)P|=Mn.LAST_BOUNDARY;else if(T!==Pu)return;h++;break}else if(h-1===f.length-2){if(P&Mn.LAST_BOUNDARY&&T===cs)_=tt.END,P=0;else if(!(P&Mn.LAST_BOUNDARY)&&T===_u)h=0,p("onPartBegin"),_=tt.HEADER_FIELD_START;else return;break}T!==f[h+2]&&(h=-2),T===f[h+2]&&h++;break;case tt.HEADER_FIELD_START:_=tt.HEADER_FIELD,b("onHeaderField"),h=0;case tt.HEADER_FIELD:if(T===Pu){u("onHeaderField"),_=tt.HEADERS_ALMOST_DONE;break}if(h++,T===cs)break;if(T===PD){if(h===1)return;c("onHeaderField",!0),_=tt.HEADER_VALUE_START;break}if($=SD(T),$<wD||$>xD)return;break;case tt.HEADER_VALUE_START:if(T===_D)break;b("onHeaderValue"),_=tt.HEADER_VALUE;case tt.HEADER_VALUE:T===Pu&&(c("onHeaderValue",!0),p("onHeaderEnd"),_=tt.HEADER_VALUE_ALMOST_DONE);break;case tt.HEADER_VALUE_ALMOST_DONE:if(T!==_u)return;_=tt.HEADER_FIELD_START;break;case tt.HEADERS_ALMOST_DONE:if(T!==_u)return;p("onHeadersEnd"),_=tt.PART_DATA_START;break;case tt.PART_DATA_START:_=tt.PART_DATA,b("onPartData");case tt.PART_DATA:if(i=h,h===0){for(r+=S;r<w&&!(e[r]in m);)r+=E;r-=S,T=e[r]}if(h<f.length)f[h]===T?(h===0&&c("onPartData",!0),h++):h=0;else if(h===f.length)h++,T===Pu?P|=Mn.PART_BOUNDARY:T===cs?P|=Mn.LAST_BOUNDARY:h=0;else if(h-1===f.length)if(P&Mn.PART_BOUNDARY){if(h=0,T===_u){P&=~Mn.PART_BOUNDARY,p("onPartEnd"),p("onPartBegin"),_=tt.HEADER_FIELD_START;break}}else P&Mn.LAST_BOUNDARY&&T===cs?(p("onPartEnd"),_=tt.END,P=0):h=0;if(h>0)a[h-1]=T;else if(i>0){let y=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);p("onPartData",0,i,y),i=0,b("onPartData"),r--}break;case tt.END:break;default:throw new Error(`Unexpected state entered: ${_}`)}c("onHeaderField"),c("onHeaderValue"),c("onPartData"),this.index=h,this.state=_,this.flags=P}end(){if(this.state===tt.HEADER_FIELD_START&&this.index===0||this.state===tt.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==tt.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o(TD,"_fileName");o(ED,"toFormData")});async function Ld(t){if(t[jt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[jt].disturbed=!0,t[jt].error)throw t[jt].error;let{body:e}=t;if(e===null)return Wt.Buffer.alloc(0);if(!(e instanceof dr.default))return Wt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let a=new Dt(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(a),a}n+=i.length,r.push(i)}}catch(i){throw i instanceof dn?i:new Dt(`Invalid response body while trying to fetch ${t.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(i=>typeof i=="string")?Wt.Buffer.from(r.join("")):Wt.Buffer.concat(r,n)}catch(i){throw new Dt(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new Dt(`Premature close of server response while trying to fetch ${t.url}`)}var dr,pn,Wt,bD,jt,kr,Qo,AD,wu,YP,XP,xu=Pt(()=>{dr=ze(require("node:stream"),1),pn=require("node:util"),Wt=require("node:buffer");ss();mu();Ud();hu();yu();bD=(0,pn.promisify)(dr.default.pipeline),jt=Symbol("Body internals"),kr=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:kd(e)?e=Wt.Buffer.from(e.toString()):us(e)||Wt.Buffer.isBuffer(e)||(pn.types.isAnyArrayBuffer(e)?e=Wt.Buffer.from(e):ArrayBuffer.isView(e)?e=Wt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof dr.default||(e instanceof jn?(e=NP(e),n=e.type.split("=")[1]):e=Wt.Buffer.from(String(e))));let i=e;Wt.Buffer.isBuffer(e)?i=dr.default.Readable.from(e):us(e)&&(i=dr.default.Readable.from(e.stream())),this[jt]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof dr.default&&e.on("error",a=>{let f=a instanceof dn?a:new Dt(`Invalid response body while trying to fetch ${this.url}: ${a.message}`,"system",a);this[jt].error=f})}get body(){return this[jt].stream}get bodyUsed(){return this[jt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await Ld(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 jn,i=new URLSearchParams(await this.text());for(let[a,f]of i)n.append(a,f);return n}let{toFormData:r}=await Promise.resolve().then(()=>(JP(),KP));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[jt].body&&this[jt].body.type||"",r=await this.arrayBuffer();return new xr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await Ld(this);return new TextDecoder().decode(e)}buffer(){return Ld(this)}};kr.prototype.buffer=(0,pn.deprecate)(kr.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(kr.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,pn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(Ld,"consumeBody");Qo=o((t,e)=>{let r,n,{body:i}=t[jt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof dr.default&&typeof i.getBoundary!="function"&&(r=new dr.PassThrough({highWaterMark:e}),n=new dr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[jt].stream=r,i=n),i},"clone"),AD=(0,pn.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"),wu=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":kd(t)?"application/x-www-form-urlencoded;charset=UTF-8":us(t)?t.type||null:Wt.Buffer.isBuffer(t)||pn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof jn?`multipart/form-data; boundary=${e[jt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${AD(t)}`:t instanceof dr.default?null:"text/plain;charset=UTF-8","extractContentType"),YP=o(t=>{let{body:e}=t[jt];return e===null?0:us(e)?e.size:Wt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),XP=o(async(t,{body:e})=>{e===null?t.end():await bD(e,t)},"writeToStream")});function QP(t=[]){return new Mt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return Su(e),Bd(e,String(r)),!0}catch{return!1}}))}var qd,ls,Su,Bd,Mt,Tu=Pt(()=>{qd=require("node:util"),ls=ze(require("node:http"),1),Su=typeof ls.default.validateHeaderName=="function"?ls.default.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},Bd=typeof ls.default.validateHeaderValue=="function"?ls.default.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},Mt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,a]of Object.entries(n))r.push(...a.map(f=>[i,f]))}else if(e!=null)if(typeof e=="object"&&!qd.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"||qd.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])=>(Su(n),Bd(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,a){switch(i){case"append":case"set":return(f,m)=>(Su(f),Bd(f,String(m)),URLSearchParams.prototype[i].call(n,String(f).toLowerCase(),String(m)));case"delete":case"has":case"getAll":return f=>(Su(f),URLSearchParams.prototype[i].call(n,String(f).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,a)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(Mt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(QP,"fromRawHeaders")});var ID,ds,Vd=Pt(()=>{ID=new Set([301,302,303,307,308]),ds=o(t=>ID.has(t),"isRedirect")});var Sr,Zt,ew=Pt(()=>{Tu();xu();Vd();Sr=Symbol("Response internals"),Zt=class t extends kr{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new Mt(r.headers);if(e!==null&&!i.has("Content-Type")){let a=wu(e,this);a&&i.append("Content-Type",a)}this[Sr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Sr].type}get url(){return this[Sr].url||""}get status(){return this[Sr].status}get ok(){return this[Sr].status>=200&&this[Sr].status<300}get redirected(){return this[Sr].counter>0}get statusText(){return this[Sr].statusText}get headers(){return this[Sr].headers}get highWaterMark(){return this[Sr].highWaterMark}clone(){return new t(Qo(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!ds(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new t(null,{status:0,statusText:""});return e[Sr].type="error",e}static json(e=void 0,r={}){let n=JSON.stringify(e);if(n===void 0)throw new TypeError("data is not JSON serializable");let i=new Mt(r&&r.headers);return i.has("content-type")||i.set("content-type","application/json"),new t(n,{...r,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Zt.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var tw,rw=Pt(()=>{tw=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 nw(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 aw(t){if(!iw.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function RD(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,ow.isIP)(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function ei(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:RD(t)}function uw(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let n=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,a=nw(i),f=nw(i,!0);a.toString().length>4096&&(a=f),e&&(a=e(a)),r&&(f=r(f));let m=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return f;case"unsafe-url":return a;case"strict-origin":return ei(a)&&!ei(m)?"no-referrer":f.toString();case"strict-origin-when-cross-origin":return a.origin===m.origin?a:ei(a)&&!ei(m)?"no-referrer":f;case"same-origin":return a.origin===m.origin?a:"no-referrer";case"origin-when-cross-origin":return a.origin===m.origin?a:f;case"no-referrer-when-downgrade":return ei(a)&&!ei(m)?"no-referrer":a;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function cw(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&iw.has(n)&&(r=n);return r}var ow,iw,sw,Gd=Pt(()=>{ow=require("node:net");o(nw,"stripURLForUseAsAReferrer");iw=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),sw="strict-origin-when-cross-origin";o(aw,"validateReferrerPolicy");o(RD,"isOriginPotentiallyTrustworthy");o(ei,"isUrlPotentiallyTrustworthy");o(uw,"determineRequestsReferrer");o(cw,"parseReferrerPolicyFromHeader")});var lw,dw,Tt,ps,$D,Fn,pw,fw=Pt(()=>{lw=require("node:url"),dw=require("node:util");Tu();xu();yu();rw();Gd();Tt=Symbol("Request internals"),ps=o(t=>typeof t=="object"&&typeof t[Tt]=="object","isRequest"),$D=(0,dw.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Fn=class t extends kr{static{o(this,"Request")}constructor(e,r={}){let n;if(ps(e)?n=new URL(e.url):(n=new URL(e),e={}),n.username!==""||n.password!=="")throw new TypeError(`${n} is an url with embedded credentials.`);let i=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!ps(r)&&"data"in r&&$D(),(r.body!=null||ps(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let a=r.body?r.body:ps(e)&&e.body!==null?Qo(e):null;super(a,{size:r.size||e.size||0});let f=new Mt(r.headers||e.headers||{});if(a!==null&&!f.has("Content-Type")){let _=wu(a,this);_&&f.set("Content-Type",_)}let m=ps(e)?e.signal:null;if("signal"in r&&(m=r.signal),m!=null&&!zP(m))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let h=r.referrer==null?e.referrer:r.referrer;if(h==="")h="no-referrer";else if(h){let _=new URL(h);h=/^about:(\/\/)?client$/.test(_)?"client":_}else h=void 0;this[Tt]={method:i,redirect:r.redirect||e.redirect||"follow",headers:f,parsedURL:n,signal:m,referrer:h},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[Tt].method}get url(){return(0,lw.format)(this[Tt].parsedURL)}get headers(){return this[Tt].headers}get redirect(){return this[Tt].redirect}get signal(){return this[Tt].signal}get referrer(){if(this[Tt].referrer==="no-referrer")return"";if(this[Tt].referrer==="client")return"about:client";if(this[Tt].referrer)return this[Tt].referrer.toString()}get referrerPolicy(){return this[Tt].referrerPolicy}set referrerPolicy(e){this[Tt].referrerPolicy=aw(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Fn.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}});pw=o(t=>{let{parsedURL:e}=t[Tt],r=new Mt(t[Tt].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(n="0"),t.body!==null){let m=YP(t);typeof m=="number"&&!Number.isNaN(m)&&(n=String(m))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=sw),t.referrer&&t.referrer!=="no-referrer"?t[Tt].referrer=uw(t):t[Tt].referrer="no-referrer",t[Tt].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=t;typeof i=="function"&&(i=i(e));let a=tw(e),f={path:e.pathname+a,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:f}},"getNodeRequestOptions")});var fs,mw=Pt(()=>{hu();fs=class extends dn{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var yw={};Pa(yw,{AbortError:()=>fs,Blob:()=>xr,FetchError:()=>Dt,File:()=>kn,FormData:()=>jn,Headers:()=>Mt,Request:()=>Fn,Response:()=>Zt,blobFrom:()=>BP,blobFromSync:()=>qP,default:()=>Hd,fileFrom:()=>VP,fileFromSync:()=>GP,isRedirect:()=>ds});async function Hd(t,e){return new Promise((r,n)=>{let i=new Fn(t,e),{parsedURL:a,options:f}=pw(i);if(!OD.has(a.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${a.protocol.replace(/:$/,"")}" is not supported.`);if(a.protocol==="data:"){let T=EP(i.url),$=new Zt(T,{headers:{"Content-Type":T.typeFull}});r($);return}let m=(a.protocol==="https:"?gw.default:hw.default).request,{signal:h}=i,_=null,P=o(()=>{let T=new fs("The operation was aborted.");n(T),i.body&&i.body instanceof Kt.default.Readable&&i.body.destroy(T),!(!_||!_.body)&&_.body.emit("error",T)},"abort");if(h&&h.aborted){P();return}let E=o(()=>{P(),w()},"abortAndFinalize"),S=m(a.toString(),f);h&&h.addEventListener("abort",E);let w=o(()=>{S.abort(),h&&h.removeEventListener("abort",E)},"finalize");S.on("error",T=>{n(new Dt(`request to ${i.url} failed, reason: ${T.message}`,"system",T)),w()}),DD(S,T=>{_&&_.body&&_.body.destroy(T)}),process.version<"v14"&&S.on("socket",T=>{let $;T.prependListener("end",()=>{$=T._eventsCount}),T.prependListener("close",b=>{if(_&&$<T._eventsCount&&!b){let u=new Error("Premature close");u.code="ERR_STREAM_PREMATURE_CLOSE",_.body.emit("error",u)}})}),S.on("response",T=>{S.setTimeout(0);let $=QP(T.rawHeaders);if(ds(T.statusCode)){let y=$.get("Location"),l=null;try{l=y===null?null:new URL(y,i.url)}catch{if(i.redirect!=="manual"){n(new Dt(`uri requested responds with an invalid redirect URL: ${y}`,"invalid-redirect")),w();return}}switch(i.redirect){case"error":n(new Dt(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),w();return;case"manual":break;case"follow":{if(l===null)break;if(i.counter>=i.follow){n(new Dt(`maximum redirect reached at: ${i.url}`,"max-redirect")),w();return}let x={headers:new Mt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:Qo(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!UP(i.url,l)||!kP(i.url,l))for(let re of["authorization","www-authenticate","cookie","cookie2"])x.headers.delete(re);if(T.statusCode!==303&&i.body&&e.body instanceof Kt.default.Readable){n(new Dt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),w();return}(T.statusCode===303||(T.statusCode===301||T.statusCode===302)&&i.method==="POST")&&(x.method="GET",x.body=void 0,x.headers.delete("content-length"));let g=cw($);g&&(x.referrerPolicy=g),r(Hd(new Fn(l,x))),w();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}h&&T.once("end",()=>{h.removeEventListener("abort",E)});let b=(0,Kt.pipeline)(T,new Kt.PassThrough,y=>{y&&n(y)});process.version<"v12.10"&&T.on("aborted",E);let u={url:i.url,status:T.statusCode,statusText:T.statusMessage,headers:$,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},p=$.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||p===null||T.statusCode===204||T.statusCode===304){_=new Zt(b,u),r(_);return}let c={flush:lo.default.Z_SYNC_FLUSH,finishFlush:lo.default.Z_SYNC_FLUSH};if(p==="gzip"||p==="x-gzip"){b=(0,Kt.pipeline)(b,lo.default.createGunzip(c),y=>{y&&n(y)}),_=new Zt(b,u),r(_);return}if(p==="deflate"||p==="x-deflate"){let y=(0,Kt.pipeline)(T,new Kt.PassThrough,l=>{l&&n(l)});y.once("data",l=>{(l[0]&15)===8?b=(0,Kt.pipeline)(b,lo.default.createInflate(),x=>{x&&n(x)}):b=(0,Kt.pipeline)(b,lo.default.createInflateRaw(),x=>{x&&n(x)}),_=new Zt(b,u),r(_)}),y.once("end",()=>{_||(_=new Zt(b,u),r(_))});return}if(p==="br"){b=(0,Kt.pipeline)(b,lo.default.createBrotliDecompress(),y=>{y&&n(y)}),_=new Zt(b,u),r(_);return}_=new Zt(b,u),r(_)}),XP(S,i).catch(n)})}function DD(t,e){let r=ms.Buffer.from(`0\r
|
|
26
|
+
\r
|
|
27
|
+
`),n=!1,i=!1,a;t.on("response",f=>{let{headers:m}=f;n=m["transfer-encoding"]==="chunked"&&!m["content-length"]}),t.on("socket",f=>{let m=o(()=>{if(n&&!i){let _=new Error("Premature close");_.code="ERR_STREAM_PREMATURE_CLOSE",e(_)}},"onSocketClose"),h=o(_=>{i=ms.Buffer.compare(_.slice(-5),r)===0,!i&&a&&(i=ms.Buffer.compare(a.slice(-3),r.slice(0,3))===0&&ms.Buffer.compare(_.slice(-2),r.slice(3))===0),a=_},"onData");f.prependListener("close",m),f.on("data",h),t.on("close",()=>{f.removeListener("close",m),f.removeListener("data",h)})})}var hw,gw,lo,Kt,ms,OD,vw=Pt(()=>{hw=ze(require("node:http"),1),gw=ze(require("node:https"),1),lo=ze(require("node:zlib"),1),Kt=ze(require("node:stream"),1),ms=require("node:buffer");bP();xu();ew();Tu();fw();Ud();mw();Vd();mu();yu();Gd();Md();OD=new Set(["data:","http:","https:"]);o(Hd,"fetch");o(DD,"fixResponseChunkedTransferBadEnding")});var ww=M(ri=>{"use strict";var CD=ri&&ri.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},ti;Object.defineProperty(ri,"__esModule",{value:!0});ri.Gaxios=void 0;var ND=CD(os()),zD=require("https"),po=xd(),UD=Q_(),_w=require("stream"),Pw=Ed(),kD=o(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),jD=204,Eu=class{static{o(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new Pw.GaxiosInterceptorManager,response:new Pw.GaxiosInterceptorManager}}fetch(...e){let r=e[0],n=e[1],i,a=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&ti.mergeHeaders(a,r.headers),n&&ti.mergeHeaders(a,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:a,url:i}):this.request({...n,headers:a,url:i})}async request(e={}){let r=await this.#n(e);return r=await this.#t(r),this.#r(this._request(r))}async _defaultAdapter(e){let r=e.fetchImplementation||this.defaults.fetchImplementation||await ti.#u(),n={...e};delete n.data;let i=await r(e.url,n),a=await this.getResponseData(e,i);return Object.getOwnPropertyDescriptor(i,"data")?.configurable||Object.defineProperties(i,{data:{configurable:!0,writable:!0,enumerable:!0,value:a}}),Object.assign(i,{config:e,data:a})}async _request(e){try{let r;if(e.adapter?r=await e.adapter(e,this._defaultAdapter.bind(this)):r=await this._defaultAdapter(e),!e.validateStatus(r.status)){if(e.responseType==="stream"){let i=[];for await(let a of r.data)i.push(a);r.data=i.toString()}let n=po.GaxiosError.extractAPIErrorFromResponse(r,`Request failed with status code ${r.status}`);throw new po.GaxiosError(n?.message,e,r,n)}return r}catch(r){let n;r instanceof po.GaxiosError?n=r:r instanceof Error?n=new po.GaxiosError(r.message,e,void 0,r):n=new po.GaxiosError("Unexpected Gaxios Error",e,void 0,r);let{shouldRetry:i,config:a}=await(0,UD.getRetryConfig)(n);if(i&&a)return n.config.retryConfig.currentRetryAttempt=a.retryConfig.currentRetryAttempt,e.retryConfig=n.config?.retryConfig,this.#o(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(n),n}}async getResponseData(e,r){if(r.status===jD)return"";if(e.maxContentLength&&r.headers.has("content-length")&&e.maxContentLength<Number.parseInt(r.headers?.get("content-length")||""))throw new po.GaxiosError("Response's `Content-Length` is over the limit.",e,Object.assign(r,{config:e}));switch(e.responseType){case"stream":return r.body;case"json":{let n=await r.text();try{return JSON.parse(n)}catch{return n}}case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"text":return r.text();default:return this.getResponseDataFromContentType(r)}}#e(e,r=[]){let n=new URL(e),i=[...r],a=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let f of a)i.push(f.trim());for(let f of i)if(f instanceof RegExp){if(f.test(n.toString()))return!1}else if(f instanceof URL){if(f.origin===n.origin)return!1}else if(f.startsWith("*.")||f.startsWith(".")){let m=f.replace(/^\*\./,".");if(n.hostname.endsWith(m))return!1}else if(f===n.origin||f===n.hostname||f===n.href)return!1;return!0}async#t(e){let r=Promise.resolve(e);for(let n of this.interceptors.request.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#r(e){let r=Promise.resolve(e);for(let n of this.interceptors.response.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#n(e){let r=new Headers(this.defaults.headers);ti.mergeHeaders(r,e.headers);let n=(0,ND.default)(!0,{},this.defaults,e);if(!n.url)throw new Error("URL is required.");if(n.baseURL&&(n.url=new URL(n.url,n.baseURL)),n.url=new URL(n.url),n.params)if(n.paramsSerializer){let f=n.paramsSerializer(n.params);f.startsWith("?")&&(f=f.slice(1));let m=n.url.toString().includes("?")?"&":"?";n.url=n.url+m+f}else{let f=n.url instanceof URL?n.url:new URL(n.url);for(let[m,h]of new URLSearchParams(n.params))f.searchParams.append(m,h);n.url=f}typeof e.maxContentLength=="number"&&(n.size=e.maxContentLength),typeof e.maxRedirects=="number"&&(n.follow=e.maxRedirects);let i=typeof n.data=="string"||n.data instanceof ArrayBuffer||n.data instanceof Blob||globalThis.File&&n.data instanceof File||n.data instanceof FormData||n.data instanceof _w.Readable||n.data instanceof ReadableStream||n.data instanceof String||n.data instanceof URLSearchParams||ArrayBuffer.isView(n.data)||["Blob","File","FormData"].includes(n.data?.constructor?.name||"");if(n.multipart?.length){let f=await kD();r.set("content-type",`multipart/related; boundary=${f}`),n.body=_w.Readable.from(this.getMultipartRequest(n.multipart,f))}else i?n.body=n.data:typeof n.data=="object"?r.get("Content-Type")==="application/x-www-form-urlencoded"?n.body=n.paramsSerializer?n.paramsSerializer(n.data):new URLSearchParams(n.data):(r.has("content-type")||r.set("content-type","application/json"),n.body=JSON.stringify(n.data)):n.data&&(n.body=n.data);n.validateStatus=n.validateStatus||this.validateStatus,n.responseType=n.responseType||"unknown",!r.has("accept")&&n.responseType==="json"&&r.set("accept","application/json");let a=n.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!n.agent)if(a&&this.#e(n.url,n.noProxy)){let f=await ti.#a();this.agentCache.has(a)?n.agent=this.agentCache.get(a):(n.agent=new f(a,{cert:n.cert,key:n.key}),this.agentCache.set(a,n.agent))}else n.cert&&n.key&&(this.agentCache.has(n.key)?n.agent=this.agentCache.get(n.key):(n.agent=new zD.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!="function"&&n.errorRedactor!==!1&&(n.errorRedactor=po.defaultErrorRedactor),n.body&&!("duplex"in n)&&(n.duplex="half"),this.#o(n),Object.assign(n,{headers:r,url:n.url instanceof URL?n.url:new URL(n.url)})}#o(e){if(e.timeout){let r=AbortSignal.timeout(e.timeout);e.signal&&!e.signal.aborted?e.signal=AbortSignal.any([e.signal,r]):e.signal=r}}validateStatus(e){return e>=200&&e<300}async getResponseDataFromContentType(e){let r=e.headers.get("Content-Type");if(r===null)return e.text();if(r=r.toLowerCase(),r.includes("application/json")){let n=await e.text();try{n=JSON.parse(n)}catch{}return n}else return r.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,r){let n=`--${r}--`;for(let i of e){let a=i.headers.get("Content-Type")||"application/octet-stream";yield`--${r}\r
|
|
28
|
+
Content-Type: ${a}\r
|
|
29
|
+
\r
|
|
30
|
+
`,typeof i.content=="string"?yield i.content:yield*i.content,yield`\r
|
|
31
|
+
`}yield n}static#i;static#s;static async#a(){return this.#i||=(await Promise.resolve().then(()=>ze(TP()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#s||=e?window.fetch:(await Promise.resolve().then(()=>(vw(),yw))).default,this.#s}static mergeHeaders(e,...r){e=e instanceof Headers?e:new Headers(e);for(let n of r)(n instanceof Headers?n:new Headers(n)).forEach((a,f)=>{f==="set-cookie"?e.append(f,a):e.set(f,a)});return e}};ri.Gaxios=Eu;ti=Eu});var pt=M(Ct=>{"use strict";var MD=Ct&&Ct.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),FD=Ct&&Ct.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MD(e,t,r)};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.instance=Ct.Gaxios=Ct.GaxiosError=void 0;Ct.request=qD;var xw=ww();Object.defineProperty(Ct,"Gaxios",{enumerable:!0,get:o(function(){return xw.Gaxios},"get")});var LD=xd();Object.defineProperty(Ct,"GaxiosError",{enumerable:!0,get:o(function(){return LD.GaxiosError},"get")});FD(Ed(),Ct);Ct.instance=new xw.Gaxios;async function qD(t){return Ct.instance.request(t)}o(qD,"request")});var Wd=M((Sw,bu)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,a="[BigNumber Error] ",f=a+"Number primitive has more than 15 significant digits: ",m=1e14,h=14,_=9007199254740991,P=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],E=1e7,S=1e9;function w(l){var x,g,re,ee=te.prototype={constructor:te,toString:null,valueOf:null},Te=new te(1),ne=20,K=4,Z=-7,Q=21,X=-1e7,ie=1e7,ae=!1,Ie=1,De=0,He={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Xe="0123456789abcdefghijklmnopqrstuvwxyz",_t=!0;function te(A,O){var D,L,z,j,G,N,U,B,F=this;if(!(F instanceof te))return new te(A,O);if(O==null){if(A&&A._isBigNumber===!0){F.s=A.s,!A.c||A.e>ie?F.c=F.e=null:A.e<X?F.c=[F.e=0]:(F.e=A.e,F.c=A.c.slice());return}if((N=typeof A=="number")&&A*0==0){if(F.s=1/A<0?(A=-A,-1):1,A===~~A){for(j=0,G=A;G>=10;G/=10,j++);j>ie?F.c=F.e=null:(F.e=j,F.c=[A]);return}B=String(A)}else{if(!r.test(B=String(A)))return re(F,B,N);F.s=B.charCodeAt(0)==45?(B=B.slice(1),-1):1}(j=B.indexOf("."))>-1&&(B=B.replace(".","")),(G=B.search(/e/i))>0?(j<0&&(j=G),j+=+B.slice(G+1),B=B.substring(0,G)):j<0&&(j=B.length)}else{if(u(O,2,Xe.length,"Base"),O==10&&_t)return F=new te(A),Ge(F,ne+F.e+1,K);if(B=String(A),N=typeof A=="number"){if(A*0!=0)return re(F,B,N,O);if(F.s=1/A<0?(B=B.slice(1),-1):1,te.DEBUG&&B.replace(/^0\.0*|\./,"").length>15)throw Error(f+A)}else F.s=B.charCodeAt(0)===45?(B=B.slice(1),-1):1;for(D=Xe.slice(0,O),j=G=0,U=B.length;G<U;G++)if(D.indexOf(L=B.charAt(G))<0){if(L=="."){if(G>j){j=U;continue}}else if(!z&&(B==B.toUpperCase()&&(B=B.toLowerCase())||B==B.toLowerCase()&&(B=B.toUpperCase()))){z=!0,G=-1,j=0;continue}return re(F,String(A),N,O)}N=!1,B=g(B,O,10,F.s),(j=B.indexOf("."))>-1?B=B.replace(".",""):j=B.length}for(G=0;B.charCodeAt(G)===48;G++);for(U=B.length;B.charCodeAt(--U)===48;);if(B=B.slice(G,++U)){if(U-=G,N&&te.DEBUG&&U>15&&(A>_||A!==i(A)))throw Error(f+F.s*A);if((j=j-G-1)>ie)F.c=F.e=null;else if(j<X)F.c=[F.e=0];else{if(F.e=j,F.c=[],G=(j+1)%h,j<0&&(G+=h),G<U){for(G&&F.c.push(+B.slice(0,G)),U-=h;G<U;)F.c.push(+B.slice(G,G+=h));G=h-(B=B.slice(G)).length}else G-=U;for(;G--;B+="0");F.c.push(+B)}}else F.c=[F.e=0]}o(te,"BigNumber"),te.clone=w,te.ROUND_UP=0,te.ROUND_DOWN=1,te.ROUND_CEIL=2,te.ROUND_FLOOR=3,te.ROUND_HALF_UP=4,te.ROUND_HALF_DOWN=5,te.ROUND_HALF_EVEN=6,te.ROUND_HALF_CEIL=7,te.ROUND_HALF_FLOOR=8,te.EUCLID=9,te.config=te.set=function(A){var O,D;if(A!=null)if(typeof A=="object"){if(A.hasOwnProperty(O="DECIMAL_PLACES")&&(D=A[O],u(D,0,S,O),ne=D),A.hasOwnProperty(O="ROUNDING_MODE")&&(D=A[O],u(D,0,8,O),K=D),A.hasOwnProperty(O="EXPONENTIAL_AT")&&(D=A[O],D&&D.pop?(u(D[0],-S,0,O),u(D[1],0,S,O),Z=D[0],Q=D[1]):(u(D,-S,S,O),Z=-(Q=D<0?-D:D))),A.hasOwnProperty(O="RANGE"))if(D=A[O],D&&D.pop)u(D[0],-S,-1,O),u(D[1],1,S,O),X=D[0],ie=D[1];else if(u(D,-S,S,O),D)X=-(ie=D<0?-D:D);else throw Error(a+O+" cannot be zero: "+D);if(A.hasOwnProperty(O="CRYPTO"))if(D=A[O],D===!!D)if(D)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ae=D;else throw ae=!D,Error(a+"crypto unavailable");else ae=D;else throw Error(a+O+" not true or false: "+D);if(A.hasOwnProperty(O="MODULO_MODE")&&(D=A[O],u(D,0,9,O),Ie=D),A.hasOwnProperty(O="POW_PRECISION")&&(D=A[O],u(D,0,S,O),De=D),A.hasOwnProperty(O="FORMAT"))if(D=A[O],typeof D=="object")He=D;else throw Error(a+O+" not an object: "+D);if(A.hasOwnProperty(O="ALPHABET"))if(D=A[O],typeof D=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(D))_t=D.slice(0,10)=="0123456789",Xe=D;else throw Error(a+O+" invalid: "+D)}else throw Error(a+"Object expected: "+A);return{DECIMAL_PLACES:ne,ROUNDING_MODE:K,EXPONENTIAL_AT:[Z,Q],RANGE:[X,ie],CRYPTO:ae,MODULO_MODE:Ie,POW_PRECISION:De,FORMAT:He,ALPHABET:Xe}},te.isBigNumber=function(A){if(!A||A._isBigNumber!==!0)return!1;if(!te.DEBUG)return!0;var O,D,L=A.c,z=A.e,j=A.s;e:if({}.toString.call(L)=="[object Array]"){if((j===1||j===-1)&&z>=-S&&z<=S&&z===i(z)){if(L[0]===0){if(z===0&&L.length===1)return!0;break e}if(O=(z+1)%h,O<1&&(O+=h),String(L[0]).length==O){for(O=0;O<L.length;O++)if(D=L[O],D<0||D>=m||D!==i(D))break e;if(D!==0)return!0}}}else if(L===null&&z===null&&(j===null||j===1||j===-1))return!0;throw Error(a+"Invalid BigNumber: "+A)},te.maximum=te.max=function(){return dt(arguments,-1)},te.minimum=te.min=function(){return dt(arguments,1)},te.random=function(){var A=9007199254740992,O=Math.random()*A&2097151?function(){return i(Math.random()*A)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(D){var L,z,j,G,N,U=0,B=[],F=new te(Te);if(D==null?D=ne:u(D,0,S),G=n(D/h),ae)if(crypto.getRandomValues){for(L=crypto.getRandomValues(new Uint32Array(G*=2));U<G;)N=L[U]*131072+(L[U+1]>>>11),N>=9e15?(z=crypto.getRandomValues(new Uint32Array(2)),L[U]=z[0],L[U+1]=z[1]):(B.push(N%1e14),U+=2);U=G/2}else if(crypto.randomBytes){for(L=crypto.randomBytes(G*=7);U<G;)N=(L[U]&31)*281474976710656+L[U+1]*1099511627776+L[U+2]*4294967296+L[U+3]*16777216+(L[U+4]<<16)+(L[U+5]<<8)+L[U+6],N>=9e15?crypto.randomBytes(7).copy(L,U):(B.push(N%1e14),U+=7);U=G/7}else throw ae=!1,Error(a+"crypto unavailable");if(!ae)for(;U<G;)N=O(),N<9e15&&(B[U++]=N%1e14);for(G=B[--U],D%=h,G&&D&&(N=P[h-D],B[U]=i(G/N)*N);B[U]===0;B.pop(),U--);if(U<0)B=[j=0];else{for(j=-1;B[0]===0;B.splice(0,1),j-=h);for(U=1,N=B[0];N>=10;N/=10,U++);U<h&&(j-=h-U)}return F.e=j,F.c=B,F}}(),te.sum=function(){for(var A=1,O=arguments,D=new te(O[0]);A<O.length;)D=D.plus(O[A++]);return D},g=function(){var A="0123456789";function O(D,L,z,j){for(var G,N=[0],U,B=0,F=D.length;B<F;){for(U=N.length;U--;N[U]*=L);for(N[0]+=j.indexOf(D.charAt(B++)),G=0;G<N.length;G++)N[G]>z-1&&(N[G+1]==null&&(N[G+1]=0),N[G+1]+=N[G]/z|0,N[G]%=z)}return N.reverse()}return o(O,"toBaseOut"),function(D,L,z,j,G){var N,U,B,F,J,ue,le,Fe,rt=D.indexOf("."),nt=ne,Me=K;for(rt>=0&&(F=De,De=0,D=D.replace(".",""),Fe=new te(L),ue=Fe.pow(D.length-rt),De=F,Fe.c=O(y($(ue.c),ue.e,"0"),10,z,A),Fe.e=Fe.c.length),le=O(D,L,z,G?(N=Xe,A):(N=A,Xe)),B=F=le.length;le[--F]==0;le.pop());if(!le[0])return N.charAt(0);if(rt<0?--B:(ue.c=le,ue.e=B,ue.s=j,ue=x(ue,Fe,nt,Me,z),le=ue.c,J=ue.r,B=ue.e),U=B+nt+1,rt=le[U],F=z/2,J=J||U<0||le[U+1]!=null,J=Me<4?(rt!=null||J)&&(Me==0||Me==(ue.s<0?3:2)):rt>F||rt==F&&(Me==4||J||Me==6&&le[U-1]&1||Me==(ue.s<0?8:7)),U<1||!le[0])D=J?y(N.charAt(1),-nt,N.charAt(0)):N.charAt(0);else{if(le.length=U,J)for(--z;++le[--U]>z;)le[U]=0,U||(++B,le=[1].concat(le));for(F=le.length;!le[--F];);for(rt=0,D="";rt<=F;D+=N.charAt(le[rt++]));D=y(D,B,N.charAt(0))}return D}}(),x=function(){function A(L,z,j){var G,N,U,B,F=0,J=L.length,ue=z%E,le=z/E|0;for(L=L.slice();J--;)U=L[J]%E,B=L[J]/E|0,G=le*U+B*ue,N=ue*U+G%E*E+F,F=(N/j|0)+(G/E|0)+le*B,L[J]=N%j;return F&&(L=[F].concat(L)),L}o(A,"multiply");function O(L,z,j,G){var N,U;if(j!=G)U=j>G?1:-1;else for(N=U=0;N<j;N++)if(L[N]!=z[N]){U=L[N]>z[N]?1:-1;break}return U}o(O,"compare");function D(L,z,j,G){for(var N=0;j--;)L[j]-=N,N=L[j]<z[j]?1:0,L[j]=N*G+L[j]-z[j];for(;!L[0]&&L.length>1;L.splice(0,1));}return o(D,"subtract"),function(L,z,j,G,N){var U,B,F,J,ue,le,Fe,rt,nt,Me,Ve,gt,wo,xo,So,qt,Jr,bt=L.s==z.s?1:-1,yt=L.c,Ze=z.c;if(!yt||!yt[0]||!Ze||!Ze[0])return new te(!L.s||!z.s||(yt?Ze&&yt[0]==Ze[0]:!Ze)?NaN:yt&&yt[0]==0||!Ze?bt*0:bt/0);for(rt=new te(bt),nt=rt.c=[],B=L.e-z.e,bt=j+B+1,N||(N=m,B=T(L.e/h)-T(z.e/h),bt=bt/h|0),F=0;Ze[F]==(yt[F]||0);F++);if(Ze[F]>(yt[F]||0)&&B--,bt<0)nt.push(1),J=!0;else{for(xo=yt.length,qt=Ze.length,F=0,bt+=2,ue=i(N/(Ze[0]+1)),ue>1&&(Ze=A(Ze,ue,N),yt=A(yt,ue,N),qt=Ze.length,xo=yt.length),wo=qt,Me=yt.slice(0,qt),Ve=Me.length;Ve<qt;Me[Ve++]=0);Jr=Ze.slice(),Jr=[0].concat(Jr),So=Ze[0],Ze[1]>=N/2&&So++;do{if(ue=0,U=O(Ze,Me,qt,Ve),U<0){if(gt=Me[0],qt!=Ve&&(gt=gt*N+(Me[1]||0)),ue=i(gt/So),ue>1)for(ue>=N&&(ue=N-1),le=A(Ze,ue,N),Fe=le.length,Ve=Me.length;O(le,Me,Fe,Ve)==1;)ue--,D(le,qt<Fe?Jr:Ze,Fe,N),Fe=le.length,U=1;else ue==0&&(U=ue=1),le=Ze.slice(),Fe=le.length;if(Fe<Ve&&(le=[0].concat(le)),D(Me,le,Ve,N),Ve=Me.length,U==-1)for(;O(Ze,Me,qt,Ve)<1;)ue++,D(Me,qt<Ve?Jr:Ze,Ve,N),Ve=Me.length}else U===0&&(ue++,Me=[0]);nt[F++]=ue,Me[0]?Me[Ve++]=yt[wo]||0:(Me=[yt[wo]],Ve=1)}while((wo++<xo||Me[0]!=null)&&bt--);J=Me[0]!=null,nt[0]||nt.splice(0,1)}if(N==m){for(F=1,bt=nt[0];bt>=10;bt/=10,F++);Ge(rt,j+(rt.e=F+B*h-1)+1,G,J)}else rt.e=B,rt.r=+J;return rt}}();function st(A,O,D,L){var z,j,G,N,U;if(D==null?D=K:u(D,0,8),!A.c)return A.toString();if(z=A.c[0],G=A.e,O==null)U=$(A.c),U=L==1||L==2&&(G<=Z||G>=Q)?c(U,G):y(U,G,"0");else if(A=Ge(new te(A),O,D),j=A.e,U=$(A.c),N=U.length,L==1||L==2&&(O<=j||j<=Z)){for(;N<O;U+="0",N++);U=c(U,j)}else if(O-=G+(L===2&&j>G),U=y(U,j,"0"),j+1>N){if(--O>0)for(U+=".";O--;U+="0");}else if(O+=j-N,O>0)for(j+1==N&&(U+=".");O--;U+="0");return A.s<0&&z?"-"+U:U}o(st,"format");function dt(A,O){for(var D,L,z=1,j=new te(A[0]);z<A.length;z++)L=new te(A[z]),(!L.s||(D=b(j,L))===O||D===0&&j.s===O)&&(j=L);return j}o(dt,"maxOrMin");function Lt(A,O,D){for(var L=1,z=O.length;!O[--z];O.pop());for(z=O[0];z>=10;z/=10,L++);return(D=L+D*h-1)>ie?A.c=A.e=null:D<X?A.c=[A.e=0]:(A.e=D,A.c=O),A}o(Lt,"normalise"),re=function(){var A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,O=/^([^.]+)\.$/,D=/^\.([^.]+)$/,L=/^-?(Infinity|NaN)$/,z=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(j,G,N,U){var B,F=N?G:G.replace(z,"");if(L.test(F))j.s=isNaN(F)?null:F<0?-1:1;else{if(!N&&(F=F.replace(A,function(J,ue,le){return B=(le=le.toLowerCase())=="x"?16:le=="b"?2:8,!U||U==B?ue:J}),U&&(B=U,F=F.replace(O,"$1").replace(D,"0.$1")),G!=F))return new te(F,B);if(te.DEBUG)throw Error(a+"Not a"+(U?" base "+U:"")+" number: "+G);j.s=null}j.c=j.e=null}}();function Ge(A,O,D,L){var z,j,G,N,U,B,F,J=A.c,ue=P;if(J){e:{for(z=1,N=J[0];N>=10;N/=10,z++);if(j=O-z,j<0)j+=h,G=O,U=J[B=0],F=i(U/ue[z-G-1]%10);else if(B=n((j+1)/h),B>=J.length)if(L){for(;J.length<=B;J.push(0));U=F=0,z=1,j%=h,G=j-h+1}else break e;else{for(U=N=J[B],z=1;N>=10;N/=10,z++);j%=h,G=j-h+z,F=G<0?0:i(U/ue[z-G-1]%10)}if(L=L||O<0||J[B+1]!=null||(G<0?U:U%ue[z-G-1]),L=D<4?(F||L)&&(D==0||D==(A.s<0?3:2)):F>5||F==5&&(D==4||L||D==6&&(j>0?G>0?U/ue[z-G]:0:J[B-1])%10&1||D==(A.s<0?8:7)),O<1||!J[0])return J.length=0,L?(O-=A.e+1,J[0]=ue[(h-O%h)%h],A.e=-O||0):J[0]=A.e=0,A;if(j==0?(J.length=B,N=1,B--):(J.length=B+1,N=ue[h-j],J[B]=G>0?i(U/ue[z-G]%ue[G])*N:0),L)for(;;)if(B==0){for(j=1,G=J[0];G>=10;G/=10,j++);for(G=J[0]+=N,N=1;G>=10;G/=10,N++);j!=N&&(A.e++,J[0]==m&&(J[0]=1));break}else{if(J[B]+=N,J[B]!=m)break;J[B--]=0,N=1}for(j=J.length;J[--j]===0;J.pop());}A.e>ie?A.c=A.e=null:A.e<X&&(A.c=[A.e=0])}return A}o(Ge,"round");function We(A){var O,D=A.e;return D===null?A.toString():(O=$(A.c),O=D<=Z||D>=Q?c(O,D):y(O,D,"0"),A.s<0?"-"+O:O)}return o(We,"valueOf"),ee.absoluteValue=ee.abs=function(){var A=new te(this);return A.s<0&&(A.s=1),A},ee.comparedTo=function(A,O){return b(this,new te(A,O))},ee.decimalPlaces=ee.dp=function(A,O){var D,L,z,j=this;if(A!=null)return u(A,0,S),O==null?O=K:u(O,0,8),Ge(new te(j),A+j.e+1,O);if(!(D=j.c))return null;if(L=((z=D.length-1)-T(this.e/h))*h,z=D[z])for(;z%10==0;z/=10,L--);return L<0&&(L=0),L},ee.dividedBy=ee.div=function(A,O){return x(this,new te(A,O),ne,K)},ee.dividedToIntegerBy=ee.idiv=function(A,O){return x(this,new te(A,O),0,1)},ee.exponentiatedBy=ee.pow=function(A,O){var D,L,z,j,G,N,U,B,F,J=this;if(A=new te(A),A.c&&!A.isInteger())throw Error(a+"Exponent not an integer: "+We(A));if(O!=null&&(O=new te(O)),N=A.e>14,!J.c||!J.c[0]||J.c[0]==1&&!J.e&&J.c.length==1||!A.c||!A.c[0])return F=new te(Math.pow(+We(J),N?A.s*(2-p(A)):+We(A))),O?F.mod(O):F;if(U=A.s<0,O){if(O.c?!O.c[0]:!O.s)return new te(NaN);L=!U&&J.isInteger()&&O.isInteger(),L&&(J=J.mod(O))}else{if(A.e>9&&(J.e>0||J.e<-1||(J.e==0?J.c[0]>1||N&&J.c[1]>=24e7:J.c[0]<8e13||N&&J.c[0]<=9999975e7)))return j=J.s<0&&p(A)?-0:0,J.e>-1&&(j=1/j),new te(U?1/j:j);De&&(j=n(De/h+2))}for(N?(D=new te(.5),U&&(A.s=1),B=p(A)):(z=Math.abs(+We(A)),B=z%2),F=new te(Te);;){if(B){if(F=F.times(J),!F.c)break;j?F.c.length>j&&(F.c.length=j):L&&(F=F.mod(O))}if(z){if(z=i(z/2),z===0)break;B=z%2}else if(A=A.times(D),Ge(A,A.e+1,1),A.e>14)B=p(A);else{if(z=+We(A),z===0)break;B=z%2}J=J.times(J),j?J.c&&J.c.length>j&&(J.c.length=j):L&&(J=J.mod(O))}return L?F:(U&&(F=Te.div(F)),O?F.mod(O):j?Ge(F,De,K,G):F)},ee.integerValue=function(A){var O=new te(this);return A==null?A=K:u(A,0,8),Ge(O,O.e+1,A)},ee.isEqualTo=ee.eq=function(A,O){return b(this,new te(A,O))===0},ee.isFinite=function(){return!!this.c},ee.isGreaterThan=ee.gt=function(A,O){return b(this,new te(A,O))>0},ee.isGreaterThanOrEqualTo=ee.gte=function(A,O){return(O=b(this,new te(A,O)))===1||O===0},ee.isInteger=function(){return!!this.c&&T(this.e/h)>this.c.length-2},ee.isLessThan=ee.lt=function(A,O){return b(this,new te(A,O))<0},ee.isLessThanOrEqualTo=ee.lte=function(A,O){return(O=b(this,new te(A,O)))===-1||O===0},ee.isNaN=function(){return!this.s},ee.isNegative=function(){return this.s<0},ee.isPositive=function(){return this.s>0},ee.isZero=function(){return!!this.c&&this.c[0]==0},ee.minus=function(A,O){var D,L,z,j,G=this,N=G.s;if(A=new te(A,O),O=A.s,!N||!O)return new te(NaN);if(N!=O)return A.s=-O,G.plus(A);var U=G.e/h,B=A.e/h,F=G.c,J=A.c;if(!U||!B){if(!F||!J)return F?(A.s=-O,A):new te(J?G:NaN);if(!F[0]||!J[0])return J[0]?(A.s=-O,A):new te(F[0]?G:K==3?-0:0)}if(U=T(U),B=T(B),F=F.slice(),N=U-B){for((j=N<0)?(N=-N,z=F):(B=U,z=J),z.reverse(),O=N;O--;z.push(0));z.reverse()}else for(L=(j=(N=F.length)<(O=J.length))?N:O,N=O=0;O<L;O++)if(F[O]!=J[O]){j=F[O]<J[O];break}if(j&&(z=F,F=J,J=z,A.s=-A.s),O=(L=J.length)-(D=F.length),O>0)for(;O--;F[D++]=0);for(O=m-1;L>N;){if(F[--L]<J[L]){for(D=L;D&&!F[--D];F[D]=O);--F[D],F[L]+=m}F[L]-=J[L]}for(;F[0]==0;F.splice(0,1),--B);return F[0]?Lt(A,F,B):(A.s=K==3?-1:1,A.c=[A.e=0],A)},ee.modulo=ee.mod=function(A,O){var D,L,z=this;return A=new te(A,O),!z.c||!A.s||A.c&&!A.c[0]?new te(NaN):!A.c||z.c&&!z.c[0]?new te(z):(Ie==9?(L=A.s,A.s=1,D=x(z,A,0,3),A.s=L,D.s*=L):D=x(z,A,0,Ie),A=z.minus(D.times(A)),!A.c[0]&&Ie==1&&(A.s=z.s),A)},ee.multipliedBy=ee.times=function(A,O){var D,L,z,j,G,N,U,B,F,J,ue,le,Fe,rt,nt,Me=this,Ve=Me.c,gt=(A=new te(A,O)).c;if(!Ve||!gt||!Ve[0]||!gt[0])return!Me.s||!A.s||Ve&&!Ve[0]&&!gt||gt&&!gt[0]&&!Ve?A.c=A.e=A.s=null:(A.s*=Me.s,!Ve||!gt?A.c=A.e=null:(A.c=[0],A.e=0)),A;for(L=T(Me.e/h)+T(A.e/h),A.s*=Me.s,U=Ve.length,J=gt.length,U<J&&(Fe=Ve,Ve=gt,gt=Fe,z=U,U=J,J=z),z=U+J,Fe=[];z--;Fe.push(0));for(rt=m,nt=E,z=J;--z>=0;){for(D=0,ue=gt[z]%nt,le=gt[z]/nt|0,G=U,j=z+G;j>z;)B=Ve[--G]%nt,F=Ve[G]/nt|0,N=le*B+F*ue,B=ue*B+N%nt*nt+Fe[j]+D,D=(B/rt|0)+(N/nt|0)+le*F,Fe[j--]=B%rt;Fe[j]=D}return D?++L:Fe.splice(0,1),Lt(A,Fe,L)},ee.negated=function(){var A=new te(this);return A.s=-A.s||null,A},ee.plus=function(A,O){var D,L=this,z=L.s;if(A=new te(A,O),O=A.s,!z||!O)return new te(NaN);if(z!=O)return A.s=-O,L.minus(A);var j=L.e/h,G=A.e/h,N=L.c,U=A.c;if(!j||!G){if(!N||!U)return new te(z/0);if(!N[0]||!U[0])return U[0]?A:new te(N[0]?L:z*0)}if(j=T(j),G=T(G),N=N.slice(),z=j-G){for(z>0?(G=j,D=U):(z=-z,D=N),D.reverse();z--;D.push(0));D.reverse()}for(z=N.length,O=U.length,z-O<0&&(D=U,U=N,N=D,O=z),z=0;O;)z=(N[--O]=N[O]+U[O]+z)/m|0,N[O]=m===N[O]?0:N[O]%m;return z&&(N=[z].concat(N),++G),Lt(A,N,G)},ee.precision=ee.sd=function(A,O){var D,L,z,j=this;if(A!=null&&A!==!!A)return u(A,1,S),O==null?O=K:u(O,0,8),Ge(new te(j),A,O);if(!(D=j.c))return null;if(z=D.length-1,L=z*h+1,z=D[z]){for(;z%10==0;z/=10,L--);for(z=D[0];z>=10;z/=10,L++);}return A&&j.e+1>L&&(L=j.e+1),L},ee.shiftedBy=function(A){return u(A,-_,_),this.times("1e"+A)},ee.squareRoot=ee.sqrt=function(){var A,O,D,L,z,j=this,G=j.c,N=j.s,U=j.e,B=ne+4,F=new te("0.5");if(N!==1||!G||!G[0])return new te(!N||N<0&&(!G||G[0])?NaN:G?j:1/0);if(N=Math.sqrt(+We(j)),N==0||N==1/0?(O=$(G),(O.length+U)%2==0&&(O+="0"),N=Math.sqrt(+O),U=T((U+1)/2)-(U<0||U%2),N==1/0?O="5e"+U:(O=N.toExponential(),O=O.slice(0,O.indexOf("e")+1)+U),D=new te(O)):D=new te(N+""),D.c[0]){for(U=D.e,N=U+B,N<3&&(N=0);;)if(z=D,D=F.times(z.plus(x(j,z,B,1))),$(z.c).slice(0,N)===(O=$(D.c)).slice(0,N))if(D.e<U&&--N,O=O.slice(N-3,N+1),O=="9999"||!L&&O=="4999"){if(!L&&(Ge(z,z.e+ne+2,0),z.times(z).eq(j))){D=z;break}B+=4,N+=4,L=1}else{(!+O||!+O.slice(1)&&O.charAt(0)=="5")&&(Ge(D,D.e+ne+2,1),A=!D.times(D).eq(j));break}}return Ge(D,D.e+ne+1,K,A)},ee.toExponential=function(A,O){return A!=null&&(u(A,0,S),A++),st(this,A,O,1)},ee.toFixed=function(A,O){return A!=null&&(u(A,0,S),A=A+this.e+1),st(this,A,O)},ee.toFormat=function(A,O,D){var L,z=this;if(D==null)A!=null&&O&&typeof O=="object"?(D=O,O=null):A&&typeof A=="object"?(D=A,A=O=null):D=He;else if(typeof D!="object")throw Error(a+"Argument not an object: "+D);if(L=z.toFixed(A,O),z.c){var j,G=L.split("."),N=+D.groupSize,U=+D.secondaryGroupSize,B=D.groupSeparator||"",F=G[0],J=G[1],ue=z.s<0,le=ue?F.slice(1):F,Fe=le.length;if(U&&(j=N,N=U,U=j,Fe-=j),N>0&&Fe>0){for(j=Fe%N||N,F=le.substr(0,j);j<Fe;j+=N)F+=B+le.substr(j,N);U>0&&(F+=B+le.slice(j)),ue&&(F="-"+F)}L=J?F+(D.decimalSeparator||"")+((U=+D.fractionGroupSize)?J.replace(new RegExp("\\d{"+U+"}\\B","g"),"$&"+(D.fractionGroupSeparator||"")):J):F}return(D.prefix||"")+L+(D.suffix||"")},ee.toFraction=function(A){var O,D,L,z,j,G,N,U,B,F,J,ue,le=this,Fe=le.c;if(A!=null&&(N=new te(A),!N.isInteger()&&(N.c||N.s!==1)||N.lt(Te)))throw Error(a+"Argument "+(N.isInteger()?"out of range: ":"not an integer: ")+We(N));if(!Fe)return new te(le);for(O=new te(Te),B=D=new te(Te),L=U=new te(Te),ue=$(Fe),j=O.e=ue.length-le.e-1,O.c[0]=P[(G=j%h)<0?h+G:G],A=!A||N.comparedTo(O)>0?j>0?O:B:N,G=ie,ie=1/0,N=new te(ue),U.c[0]=0;F=x(N,O,0,1),z=D.plus(F.times(L)),z.comparedTo(A)!=1;)D=L,L=z,B=U.plus(F.times(z=B)),U=z,O=N.minus(F.times(z=O)),N=z;return z=x(A.minus(D),L,0,1),U=U.plus(z.times(B)),D=D.plus(z.times(L)),U.s=B.s=le.s,j=j*2,J=x(B,L,j,K).minus(le).abs().comparedTo(x(U,D,j,K).minus(le).abs())<1?[B,L]:[U,D],ie=G,J},ee.toNumber=function(){return+We(this)},ee.toPrecision=function(A,O){return A!=null&&u(A,1,S),st(this,A,O,2)},ee.toString=function(A){var O,D=this,L=D.s,z=D.e;return z===null?L?(O="Infinity",L<0&&(O="-"+O)):O="NaN":(A==null?O=z<=Z||z>=Q?c($(D.c),z):y($(D.c),z,"0"):A===10&&_t?(D=Ge(new te(D),ne+z+1,K),O=y($(D.c),D.e,"0")):(u(A,2,Xe.length,"Base"),O=g(y($(D.c),z,"0"),10,A,L,!0)),L<0&&D.c[0]&&(O="-"+O)),O},ee.valueOf=ee.toJSON=function(){return We(this)},ee._isBigNumber=!0,l!=null&&te.set(l),te}o(w,"clone");function T(l){var x=l|0;return l>0||l===x?x:x-1}o(T,"bitFloor");function $(l){for(var x,g,re=1,ee=l.length,Te=l[0]+"";re<ee;){for(x=l[re++]+"",g=h-x.length;g--;x="0"+x);Te+=x}for(ee=Te.length;Te.charCodeAt(--ee)===48;);return Te.slice(0,ee+1||1)}o($,"coeffToString");function b(l,x){var g,re,ee=l.c,Te=x.c,ne=l.s,K=x.s,Z=l.e,Q=x.e;if(!ne||!K)return null;if(g=ee&&!ee[0],re=Te&&!Te[0],g||re)return g?re?0:-K:ne;if(ne!=K)return ne;if(g=ne<0,re=Z==Q,!ee||!Te)return re?0:!ee^g?1:-1;if(!re)return Z>Q^g?1:-1;for(K=(Z=ee.length)<(Q=Te.length)?Z:Q,ne=0;ne<K;ne++)if(ee[ne]!=Te[ne])return ee[ne]>Te[ne]^g?1:-1;return Z==Q?0:Z>Q^g?1:-1}o(b,"compare");function u(l,x,g,re){if(l<x||l>g||l!==i(l))throw Error(a+(re||"Argument")+(typeof l=="number"?l<x||l>g?" out of range: ":" not an integer: ":" not a primitive number: ")+String(l))}o(u,"intCheck");function p(l){var x=l.c.length-1;return T(l.e/h)==x&&l.c[x]%2!=0}o(p,"isOdd");function c(l,x){return(l.length>1?l.charAt(0)+"."+l.slice(1):l)+(x<0?"e":"e+")+x}o(c,"toExponential");function y(l,x,g){var re,ee;if(x<0){for(ee=g+".";++x;ee+=g);l=ee+l}else if(re=l.length,++x>re){for(ee=g,x-=re;--x;ee+=g);l+=ee}else x<re&&(l=l.slice(0,x)+"."+l.slice(x));return l}o(y,"toFixedPoint"),e=w(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof bu<"u"&&bu.exports?bu.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(Sw)});var Aw=M((R5,bw)=>{var Tw=Wd(),Ew=bw.exports;(function(){"use strict";function t(_){return _<10?"0"+_:_}o(t,"f");var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,i,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},f;function m(_){return r.lastIndex=0,r.test(_)?'"'+_.replace(r,function(P){var E=a[P];return typeof E=="string"?E:"\\u"+("0000"+P.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+_+'"'}o(m,"quote");function h(_,P){var E,S,w,T,$=n,b,u=P[_],p=u!=null&&(u instanceof Tw||Tw.isBigNumber(u));switch(u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON(_)),typeof f=="function"&&(u=f.call(P,_,u)),typeof u){case"string":return p?u:m(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":case"bigint":return String(u);case"object":if(!u)return"null";if(n+=i,b=[],Object.prototype.toString.apply(u)==="[object Array]"){for(T=u.length,E=0;E<T;E+=1)b[E]=h(E,u)||"null";return w=b.length===0?"[]":n?`[
|
|
32
|
+
`+n+b.join(`,
|
|
33
|
+
`+n)+`
|
|
34
|
+
`+$+"]":"["+b.join(",")+"]",n=$,w}if(f&&typeof f=="object")for(T=f.length,E=0;E<T;E+=1)typeof f[E]=="string"&&(S=f[E],w=h(S,u),w&&b.push(m(S)+(n?": ":":")+w));else Object.keys(u).forEach(function(c){var y=h(c,u);y&&b.push(m(c)+(n?": ":":")+y)});return w=b.length===0?"{}":n?`{
|
|
35
|
+
`+n+b.join(`,
|
|
36
|
+
`+n)+`
|
|
37
|
+
`+$+"}":"{"+b.join(",")+"}",n=$,w}}o(h,"str"),typeof Ew.stringify!="function"&&(Ew.stringify=function(_,P,E){var S;if(n="",i="",typeof E=="number")for(S=0;S<E;S+=1)i+=" ";else typeof E=="string"&&(i=E);if(f=P,P&&typeof P!="function"&&(typeof P!="object"||typeof P.length!="number"))throw new Error("JSON.stringify");return h("",{"":_})})})()});var Rw=M((O5,Iw)=>{var Au=null,BD=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,VD=/(?: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)/,GD=o(function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(t!=null){if(t.strict===!0&&(e.strict=!0),t.storeAsString===!0&&(e.storeAsString=!0),e.alwaysParseAsBig=t.alwaysParseAsBig===!0?t.alwaysParseAsBig:!1,e.useNativeBigInt=t.useNativeBigInt===!0?t.useNativeBigInt:!1,typeof t.constructorAction<"u")if(t.constructorAction==="error"||t.constructorAction==="ignore"||t.constructorAction==="preserve")e.constructorAction=t.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);if(typeof t.protoAction<"u")if(t.protoAction==="error"||t.protoAction==="ignore"||t.protoAction==="preserve")e.protoAction=t.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`)}var r,n,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
38
|
+
`,r:"\r",t:" "},a,f=o(function($){throw{name:"SyntaxError",message:$,at:r,text:a}},"error"),m=o(function($){return $&&$!==n&&f("Expected '"+$+"' instead of '"+n+"'"),n=a.charAt(r),r+=1,n},"next"),h=o(function(){var $,b="";for(n==="-"&&(b="-",m("-"));n>="0"&&n<="9";)b+=n,m();if(n===".")for(b+=".";m()&&n>="0"&&n<="9";)b+=n;if(n==="e"||n==="E")for(b+=n,m(),(n==="-"||n==="+")&&(b+=n,m());n>="0"&&n<="9";)b+=n,m();if($=+b,!isFinite($))f("Bad number");else return Au==null&&(Au=Wd()),b.length>15?e.storeAsString?b:e.useNativeBigInt?BigInt(b):new Au(b):e.alwaysParseAsBig?e.useNativeBigInt?BigInt($):new Au($):$},"number"),_=o(function(){var $,b,u="",p;if(n==='"')for(var c=r;m();){if(n==='"')return r-1>c&&(u+=a.substring(c,r-1)),m(),u;if(n==="\\"){if(r-1>c&&(u+=a.substring(c,r-1)),m(),n==="u"){for(p=0,b=0;b<4&&($=parseInt(m(),16),!!isFinite($));b+=1)p=p*16+$;u+=String.fromCharCode(p)}else if(typeof i[n]=="string")u+=i[n];else break;c=r}}f("Bad string")},"string"),P=o(function(){for(;n&&n<=" ";)m()},"white"),E=o(function(){switch(n){case"t":return m("t"),m("r"),m("u"),m("e"),!0;case"f":return m("f"),m("a"),m("l"),m("s"),m("e"),!1;case"n":return m("n"),m("u"),m("l"),m("l"),null}f("Unexpected '"+n+"'")},"word"),S,w=o(function(){var $=[];if(n==="["){if(m("["),P(),n==="]")return m("]"),$;for(;n;){if($.push(S()),P(),n==="]")return m("]"),$;m(","),P()}}f("Bad array")},"array"),T=o(function(){var $,b=Object.create(null);if(n==="{"){if(m("{"),P(),n==="}")return m("}"),b;for(;n;){if($=_(),P(),m(":"),e.strict===!0&&Object.hasOwnProperty.call(b,$)&&f('Duplicate key "'+$+'"'),BD.test($)===!0?e.protoAction==="error"?f("Object contains forbidden prototype property"):e.protoAction==="ignore"?S():b[$]=S():VD.test($)===!0?e.constructorAction==="error"?f("Object contains forbidden constructor property"):e.constructorAction==="ignore"?S():b[$]=S():b[$]=S(),P(),n==="}")return m("}"),b;m(","),P()}}f("Bad object")},"object");return S=o(function(){switch(P(),n){case"{":return T();case"[":return w();case'"':return _();case"-":return h();default:return n>="0"&&n<="9"?h():E()}},"value"),function($,b){var u;return a=$+"",r=0,n=" ",u=S(),P(),n&&f("Syntax error"),typeof b=="function"?o(function p(c,y){var l,x,g=c[y];return g&&typeof g=="object"&&Object.keys(g).forEach(function(re){x=p(g,re),x!==void 0?g[re]=x:delete g[re]}),b.call(c,y,g)},"walk")({"":u},""):u}},"json_parse");Iw.exports=GD});var Dw=M((C5,Iu)=>{var $w=Aw().stringify,Ow=Rw();Iu.exports=function(t){return{parse:Ow(t),stringify:$w}};Iu.exports.parse=Ow();Iu.exports.stringify=$w});var Zd=M(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.GCE_LINUX_BIOS_PATHS=void 0;Tr.isGoogleCloudServerless=zw;Tr.isGoogleComputeEngineLinux=Uw;Tr.isGoogleComputeEngineMACAddress=kw;Tr.isGoogleComputeEngine=jw;Tr.detectGCPResidency=WD;var Cw=require("fs"),Nw=require("os");Tr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var HD=/^42:01/;function zw(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(zw,"isGoogleCloudServerless");function Uw(){if((0,Nw.platform)()!=="linux")return!1;try{(0,Cw.statSync)(Tr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,Cw.readFileSync)(Tr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(Uw,"isGoogleComputeEngineLinux");function kw(){let t=(0,Nw.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(HD.test(r))return!0}return!1}o(kw,"isGoogleComputeEngineMACAddress");function jw(){return Uw()||kw()}o(jw,"isGoogleComputeEngine");function WD(){return zw()||jw()}o(WD,"detectGCPResidency")});var Mw=M(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.Colours=void 0;var It=class t{static{o(this,"Colours")}static isEnabled(e){return e&&e.isTTY&&(typeof e.getColorDepth=="function"?e.getColorDepth()>2:!0)}static refresh(){t.enabled=t.isEnabled(process==null?void 0:process.stderr),this.enabled?(t.reset="\x1B[0m",t.bright="\x1B[1m",t.dim="\x1B[2m",t.red="\x1B[31m",t.green="\x1B[32m",t.yellow="\x1B[33m",t.blue="\x1B[34m",t.magenta="\x1B[35m",t.cyan="\x1B[36m",t.white="\x1B[37m",t.grey="\x1B[90m"):(t.reset="",t.bright="",t.dim="",t.red="",t.green="",t.yellow="",t.blue="",t.magenta="",t.cyan="",t.white="",t.grey="")}};Ru.Colours=It;It.enabled=!1;It.reset="";It.bright="";It.dim="";It.red="";It.green="";It.yellow="";It.blue="";It.magenta="";It.cyan="";It.white="";It.grey="";It.refresh()});var Bw=M(Je=>{"use strict";var ZD=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]}),KD=Je&&Je.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Fw=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"&&ZD(r,e,n[i]);return KD(r,e),r}}();Object.defineProperty(Je,"__esModule",{value:!0});Je.env=Je.DebugLogBackendBase=Je.placeholder=Je.AdhocDebugLogger=Je.LogSeverity=void 0;Je.getNodeBackend=Jd;Je.getDebugBackend=YD;Je.getStructuredBackend=XD;Je.setBackend=QD;Je.log=qw;var JD=require("events"),hs=Fw(require("process")),Lw=Fw(require("util")),Jt=Mw(),Er;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(Er||(Je.LogSeverity=Er={}));var gs=class extends JD.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(Er.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(Er.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(Er.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(Er.ERROR,...n),this.func.sublog=n=>qw(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=gs;Je.placeholder=new gs("",()=>{}).func;var ni=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=hs.env[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=ni;var Kd=class extends ni{static{o(this,"NodeBackend")}constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(r,...n)=>{var i;let a=`${Jt.Colours.green}${e}${Jt.Colours.reset}`,f=`${Jt.Colours.yellow}${hs.pid}${Jt.Colours.reset}`,m;switch(r.severity){case Er.ERROR:m=`${Jt.Colours.red}${r.severity}${Jt.Colours.reset}`;break;case Er.INFO:m=`${Jt.Colours.magenta}${r.severity}${Jt.Colours.reset}`;break;case Er.WARNING:m=`${Jt.Colours.yellow}${r.severity}${Jt.Colours.reset}`;break;default:m=(i=r.severity)!==null&&i!==void 0?i:Er.DEFAULT;break}let h=Lw.formatWithOptions({colors:Jt.Colours.enabled},...n),_=Object.assign({},r);delete _.severity;let P=Object.getOwnPropertyNames(_).length?JSON.stringify(_):"",E=P?`${Jt.Colours.grey}${P}${Jt.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",f,a,m,h,P?` ${E}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function Jd(){return new Kd}o(Jd,"getNodeBackend");var Yd=class extends ni{static{o(this,"DebugBackend")}constructor(e){super(),this.debugPkg=e}makeLogger(e){let r=this.debugPkg(e);return(n,...i)=>{r(i[0],...i.slice(1))}}setFilters(){var e;let r=(e=hs.env.NODE_DEBUG)!==null&&e!==void 0?e:"";hs.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function YD(t){return new Yd(t)}o(YD,"getDebugBackend");var Xd=class extends ni{static{o(this,"StructuredBackend")}constructor(e){var r;super(),this.upstream=(r=e)!==null&&r!==void 0?r:void 0}makeLogger(e){var r;let n=(r=this.upstream)===null||r===void 0?void 0:r.makeLogger(e);return(i,...a)=>{var f;let m=(f=i.severity)!==null&&f!==void 0?f:Er.INFO,h=Object.assign({severity:m,message:Lw.format(...a)},i),_=JSON.stringify(h);n?n(i,_):console.log("%s",_)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function XD(t){return new Xd(t)}o(XD,"getStructuredBackend");Je.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var Qd=new Map,Yt;function QD(t){Yt=t,Qd.clear()}o(QD,"setBackend");function qw(t,e){if(!Yt&&!hs.env[Je.env.nodeEnables]||!t)return Je.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=Qd.get(t);if(r)return r.func;if(Yt===null)return Je.placeholder;Yt===void 0&&(Yt=Jd());let n=(()=>{let i;return new gs(t,(f,...m)=>{if(i!==Yt){if(Yt===null)return;Yt===void 0&&(Yt=Jd()),i=Yt}Yt?.log(t,f,...m)})})();return Qd.set(t,n),n.func}o(qw,"log")});var ep=M(fo=>{"use strict";var eC=fo&&fo.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tC=fo&&fo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eC(e,t,r)};Object.defineProperty(fo,"__esModule",{value:!0});tC(Bw(),fo)});var vs=M(he=>{"use strict";var Gw=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]}),rC=he&&he.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nC=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"&&Gw(r,e,n[i]);return rC(r,e),r}}(),oC=he&&he.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gw(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=lC;he.project=dC;he.universe=pC;he.bulk=fC;he.isAvailable=hC;he.resetIsAvailableCache=gC;he.getGCPResidency=np;he.setGCPResidency=Hw;he.requestTimeout=Ww;var tp=pt(),iC=Dw(),sC=Zd(),aC=nC(ep());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 Vw=aC.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 rp(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(rp,"getBaseUrl");function uC(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(uC,"validate");async function ys(t,e={},r=3,n=!1){let i=new Headers(he.HEADERS),a="",f={};if(typeof t=="object"){let E=t;new Headers(E.headers).forEach((S,w)=>i.set(w,S)),a=E.metadataKey,f=E.params||f,r=E.noResponseRetries||r,n=E.fastFail||n}else a=t;typeof e=="string"?a+=`/${e}`:(uC(e),e.property&&(a+=`/${e.property}`),new Headers(e.headers).forEach((E,S)=>i.set(S,E)),f=e.params||f);let m=n?cC:tp.request,h={url:`${rp()}/${a}`,headers:i,retryConfig:{noResponseRetries:r},params:f,responseType:"text",timeout:Ww()};Vw.info("instance request %j",h);let _=await m(h);Vw.info("instance metadata is %s",_.data);let P=_.headers.get(he.HEADER_NAME);if(P!==he.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${he.HEADER_NAME} header. Expected '${he.HEADER_VALUE}', got ${P?`'${P}'`:"no header"}`);if(typeof _.data=="string")try{return iC.parse(_.data)}catch{}return _.data}o(ys,"metadataAccessor");async function cC(t){let e={...t,url:t.url?.toString().replace(rp(),rp(he.SECONDARY_HOST_ADDRESS))},r=(0,tp.request)(t),n=(0,tp.request)(e);return Promise.any([r,n])}o(cC,"fastFailMetadataRequest");function lC(t){return ys("instance",t)}o(lC,"instance");function dC(t){return ys("project",t)}o(dC,"project");function pC(t){return ys("universe",t)}o(pC,"universe");async function fC(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await ys(r),i=r.metadataKey;e[i]=n})())),e}o(fC,"bulk");function mC(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(mC,"detectGCPAvailableRetries");var $u;async function hC(){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 np();case"ping-only":}}try{return $u===void 0&&($u=ys("instance",void 0,mC(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await $u,!0}catch(t){let e=t;if(process.env.DEBUG_AUTH&&console.info(e),e.type==="request-timeout"||e.response&&e.response.status===404)return!1;if(!(e.response&&e.response.status===404)&&(!e.code||!["EHOSTDOWN","EHOSTUNREACH","ENETUNREACH","ENOENT","ENOTFOUND","ECONNREFUSED"].includes(e.code.toString()))){let r="UNKNOWN";e.code&&(r=e.code.toString()),process.emitWarning(`received unexpected error = ${e.message} code = ${r}`,"MetadataLookupWarning")}return!1}}o(hC,"isAvailable");function gC(){$u=void 0}o(gC,"resetIsAvailableCache");he.gcpResidencyCache=null;function np(){return he.gcpResidencyCache===null&&Hw(),he.gcpResidencyCache}o(np,"getGCPResidency");function Hw(t=null){he.gcpResidencyCache=t!==null?t:(0,sC.detectGCPResidency)()}o(Hw,"setGCPResidency");function Ww(){return np()?0:3e3}o(Ww,"requestTimeout");oC(Zd(),he)});var Jw=M(Ou=>{"use strict";Ou.byteLength=vC;Ou.toByteArray=PC;Ou.fromByteArray=SC;var jr=[],pr=[],yC=typeof Uint8Array<"u"?Uint8Array:Array,op="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(mo=0,Zw=op.length;mo<Zw;++mo)jr[mo]=op[mo],pr[op.charCodeAt(mo)]=mo;var mo,Zw;pr[45]=62;pr[95]=63;function Kw(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(Kw,"getLens");function vC(t){var e=Kw(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(vC,"byteLength");function _C(t,e,r){return(e+r)*3/4-r}o(_C,"_byteLength");function PC(t){var e,r=Kw(t),n=r[0],i=r[1],a=new yC(_C(t,n,i)),f=0,m=i>0?n-4:n,h;for(h=0;h<m;h+=4)e=pr[t.charCodeAt(h)]<<18|pr[t.charCodeAt(h+1)]<<12|pr[t.charCodeAt(h+2)]<<6|pr[t.charCodeAt(h+3)],a[f++]=e>>16&255,a[f++]=e>>8&255,a[f++]=e&255;return i===2&&(e=pr[t.charCodeAt(h)]<<2|pr[t.charCodeAt(h+1)]>>4,a[f++]=e&255),i===1&&(e=pr[t.charCodeAt(h)]<<10|pr[t.charCodeAt(h+1)]<<4|pr[t.charCodeAt(h+2)]>>2,a[f++]=e>>8&255,a[f++]=e&255),a}o(PC,"toByteArray");function wC(t){return jr[t>>18&63]+jr[t>>12&63]+jr[t>>6&63]+jr[t&63]}o(wC,"tripletToBase64");function xC(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(wC(n));return i.join("")}o(xC,"encodeChunk");function SC(t){for(var e,r=t.length,n=r%3,i=[],a=16383,f=0,m=r-n;f<m;f+=a)i.push(xC(t,f,f+a>m?m:f+a));return n===1?(e=t[r-1],i.push(jr[e>>2]+jr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(jr[e>>10]+jr[e>>4&63]+jr[e<<2&63]+"=")),i.join("")}o(SC,"fromByteArray")});var sp=M(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.fromArrayBufferToHex=TC;function TC(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o(TC,"fromArrayBufferToHex")});var Yw=M(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.BrowserCrypto=void 0;var oi=Jw(),EC=sp(),ap=class t{static{o(this,"BrowserCrypto")}constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return oi.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),oi.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let i={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},a=new TextEncoder().encode(r),f=oi.toByteArray(t.padBase64(n)),m=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,m,f,a)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),a=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),f=await window.crypto.subtle.sign(n,a,i);return oi.fromByteArray(new Uint8Array(f))}decodeBase64StringUtf8(e){let r=oi.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return oi.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,EC.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),i=new TextEncoder,a=await window.crypto.subtle.importKey("raw",i.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",a,i.encode(r))}};Du.BrowserCrypto=ap});var Xw=M(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.NodeCrypto=void 0;var ii=require("crypto"),up=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return ii.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return ii.randomBytes(e).toString("base64")}async verify(e,r,n){let i=ii.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=ii.createSign("RSA-SHA256");return n.update(r),n.end(),n.sign(e,"base64")}decodeBase64StringUtf8(e){return Buffer.from(e,"base64").toString("utf-8")}encodeBase64StringUtf8(e){return Buffer.from(e,"utf-8").toString("base64")}async sha256DigestHex(e){return ii.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:AC(e);return bC(ii.createHmac("sha256",n).update(r).digest())}};Cu.NodeCrypto=up;function bC(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(bC,"toArrayBuffer");function AC(t){return Buffer.from(t)}o(AC,"toBuffer")});var _s=M(fn=>{"use strict";var IC=fn&&fn.__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]}),RC=fn&&fn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IC(e,t,r)};Object.defineProperty(fn,"__esModule",{value:!0});fn.createCrypto=DC;fn.hasBrowserCrypto=Qw;var $C=Yw(),OC=Xw();RC(sp(),fn);function DC(){return Qw()?new $C.BrowserCrypto:new OC.NodeCrypto}o(DC,"createCrypto");function Qw(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(Qw,"hasBrowserCrypto")});var si=M((cp,tx)=>{var Nu=require("buffer"),Mr=Nu.Buffer;function ex(t,e){for(var r in t)e[r]=t[r]}o(ex,"copyProps");Mr.from&&Mr.alloc&&Mr.allocUnsafe&&Mr.allocUnsafeSlow?tx.exports=Nu:(ex(Nu,cp),cp.Buffer=ho);function ho(t,e,r){return Mr(t,e,r)}o(ho,"SafeBuffer");ho.prototype=Object.create(Mr.prototype);ex(Mr,ho);ho.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Mr(t,e,r)};ho.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Mr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};ho.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Mr(t)};ho.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Nu.SlowBuffer(t)}});var nx=M((tY,rx)=>{"use strict";function lp(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(lp,"getParamSize");var CC={ES256:lp(256),ES384:lp(384),ES512:lp(521)};function NC(t){var e=CC[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(NC,"getParamBytesForAlg");rx.exports=NC});var dp=M((nY,cx)=>{"use strict";var zu=si().Buffer,ix=nx(),Uu=128,sx=0,zC=32,UC=16,kC=2,ax=UC|zC|sx<<6,ku=kC|sx<<6;function jC(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(jC,"base64Url");function ux(t){if(zu.isBuffer(t))return t;if(typeof t=="string")return zu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}o(ux,"signatureAsBuffer");function MC(t,e){t=ux(t);var r=ix(e),n=r+1,i=t.length,a=0;if(t[a++]!==ax)throw new Error('Could not find expected "seq"');var f=t[a++];if(f===(Uu|1)&&(f=t[a++]),i-a<f)throw new Error('"seq" specified length of "'+f+'", only "'+(i-a)+'" remaining');if(t[a++]!==ku)throw new Error('Could not find expected "int" for "r"');var m=t[a++];if(i-a-2<m)throw new Error('"r" specified length of "'+m+'", only "'+(i-a-2)+'" available');if(n<m)throw new Error('"r" specified length of "'+m+'", max of "'+n+'" is acceptable');var h=a;if(a+=m,t[a++]!==ku)throw new Error('Could not find expected "int" for "s"');var _=t[a++];if(i-a!==_)throw new Error('"s" specified length of "'+_+'", expected "'+(i-a)+'"');if(n<_)throw new Error('"s" specified length of "'+_+'", max of "'+n+'" is acceptable');var P=a;if(a+=_,a!==i)throw new Error('Expected to consume entire buffer, but "'+(i-a)+'" bytes remain');var E=r-m,S=r-_,w=zu.allocUnsafe(E+m+S+_);for(a=0;a<E;++a)w[a]=0;t.copy(w,a,h+Math.max(-E,0),h+m),a=r;for(var T=a;a<T+S;++a)w[a]=0;return t.copy(w,a,P+Math.max(-S,0),P+_),w=w.toString("base64"),w=jC(w),w}o(MC,"derToJose");function ox(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=Uu;return i&&--n,n}o(ox,"countPadding");function FC(t,e){t=ux(t);var r=ix(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=ox(t,0,r),a=ox(t,r,t.length),f=r-i,m=r-a,h=2+f+1+1+m,_=h<Uu,P=zu.allocUnsafe((_?2:3)+h),E=0;return P[E++]=ax,_?P[E++]=h:(P[E++]=Uu|1,P[E++]=h&255),P[E++]=ku,P[E++]=f,i<0?(P[E++]=0,E+=t.copy(P,E,0,r)):E+=t.copy(P,E,i,r),P[E++]=ku,P[E++]=m,a<0?(P[E++]=0,t.copy(P,E,r)):t.copy(P,E,r+a),P}o(FC,"joseToDer");cx.exports={derToJose:MC,joseToDer:FC}});var br=M(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.LRUCache=void 0;mn.snakeToCamel=dx;mn.originalOrCamelOptions=VC;mn.removeUndefinedValuesInObject=GC;mn.isValidFile=HC;mn.getWellKnownCertificateConfigFileLocation=WC;var LC=require("fs"),qC=require("os"),pp=require("path"),BC="certificate_config.json",lx="gcloud";function dx(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(dx,"snakeToCamel");function VC(t){function e(r){let n=t||{};return n[r]??n[dx(r)]}return o(e,"get"),{get:e}}o(VC,"originalOrCamelOptions");var fp=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()}};mn.LRUCache=fp;function GC(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(GC,"removeUndefinedValuesInObject");async function HC(t){try{return(await LC.promises.lstat(t)).isFile()}catch{return!1}}o(HC,"isValidFile");function WC(){let t=process.env.CLOUDSDK_CONFIG||(ZC()?pp.join(process.env.APPDATA||"",lx):pp.join(process.env.HOME||"",".config",lx));return pp.join(t,BC)}o(WC,"getWellKnownCertificateConfigFileLocation");function ZC(){return qC.platform().startsWith("win")}o(ZC,"_isWindows")});var px=M((aY,KC)=>{KC.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 mp=M(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.USER_AGENT=Ln.PRODUCT_NAME=Ln.pkg=void 0;var fx=px();Ln.pkg=fx;var mx="google-api-nodejs-client";Ln.PRODUCT_NAME=mx;var JC=`${mx}/${fx.version}`;Ln.USER_AGENT=JC});var Xt=M(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.AuthClient=Ar.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=Ar.DEFAULT_UNIVERSE=void 0;var YC=require("events"),hp=pt(),XC=br(),QC=ep(),gp=mp();Ar.DEFAULT_UNIVERSE="googleapis.com";Ar.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=5*60*1e3;var yp=class t extends YC.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=Ar.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=Ar.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,XC.originalOrCamelOptions)(e);this.apiKey=e.apiKey,this.projectId=r.get("project_id")??null,this.quotaProjectId=r.get("quota_project_id"),this.credentials=r.get("credentials")??{},this.universeDomain=r.get("universe_domain")??Ar.DEFAULT_UNIVERSE,this.transporter=e.transporter??new hp.Gaxios(e.transporterOptions),r.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(t.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(t.DEFAULT_RESPONSE_INTERCEPTOR)),e.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=e.forceRefreshOnFailure??!1}fetch(...e){let r=e[0],n=e[1],i,a=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&hp.Gaxios.mergeHeaders(a,r.headers),n&&hp.Gaxios.mergeHeaders(a,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:a,url:i}):this.request({...n,headers:a,url:i})}setCredentials(e){this.credentials=e}addSharedMetadataHeaders(e){return!e.has("x-goog-user-project")&&this.quotaProjectId&&e.set("x-goog-user-project",this.quotaProjectId),e}addUserProjectAndAuthHeaders(e,r){let n=r.get("x-goog-user-project"),i=r.get("authorization");return n&&e.set("x-goog-user-project",n),i&&e.set("authorization",i),e}static log=(0,QC.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(`${gp.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${gp.USER_AGENT}`):e.headers.set("User-Agent",gp.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],a=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=a;let f={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,a,f):t.log.info("[%s] request %j",a,f)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,i,e.data):t.log.info("[%s] response %j",i,e.data)}catch{}return e},"resolved"),rejected:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,i,e.response?.data):t.log.error("[%s] error %j",i,e.response?.data)}catch{}throw e},"rejected")};static setMethodName(e,r){try{let n=e;n[t.RequestMethodNameSymbol]=r}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};Ar.AuthClient=yp});var _p=M(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.LoginTicket=void 0;var vp=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()}}};ju.LoginTicket=vp});var go=M(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.OAuth2Client=Fr.ClientAuthentication=Fr.CertificateFormat=Fr.CodeChallengeMethod=void 0;var hx=pt(),eN=require("querystring"),tN=require("stream"),rN=dp(),gx=br(),Pp=_s(),ai=Xt(),nN=_p(),yx;(function(t){t.Plain="plain",t.S256="S256"})(yx||(Fr.CodeChallengeMethod=yx={}));var hn;(function(t){t.PEM="PEM",t.JWK="JWK"})(hn||(Fr.CertificateFormat=hn={}));var Ps;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(Ps||(Fr.ClientAuthentication=Ps={}));var wp=class t extends ai.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=hn.PEM;refreshTokenPromises=new Map;endpoints;issuers;clientAuthentication;_clientId;_clientSecret;refreshHandler;constructor(e={},r,n){super(typeof e=="object"?e:{}),typeof e!="object"&&(e={clientId:e,clientSecret:r,redirectUri:n}),this._clientId=e.clientId||e.client_id,this._clientSecret=e.clientSecret||e.client_secret,this.redirectUri=e.redirectUri||e.redirect_uris?.[0],this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...e.endpoints},this.clientAuthentication=e.clientAuthentication||Ps.ClientSecretPost,this.issuers=e.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}static GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";static CLOCK_SKEW_SECS_=300;static DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400;generateAuthUrl(e={}){if(e.code_challenge_method&&!e.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return e.response_type=e.response_type||"code",e.client_id=e.client_id||this._clientId,e.redirect_uri=e.redirect_uri||this.redirectUri,Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+eN.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,Pp.createCrypto)(),n=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),a=(await e.sha256DigestBase64(n)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:n,codeChallenge:a}}getToken(e,r){let n=typeof e=="string"?{code:e}:e;if(r)this.getTokenAsync(n).then(i=>r(null,i.tokens,i.res),i=>r(i,null,i.response));else return this.getTokenAsync(n)}async getTokenAsync(e){let r=this.endpoints.oauth2TokenUrl.toString(),n=new Headers,i={client_id:e.client_id||this._clientId,code_verifier:e.codeVerifier,code:e.code,grant_type:"authorization_code",redirect_uri:e.redirect_uri||this.redirectUri};if(this.clientAuthentication===Ps.ClientSecretBasic){let h=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${h.toString("base64")}`)}this.clientAuthentication===Ps.ClientSecretPost&&(i.client_secret=this._clientSecret);let a={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,gx.removeUndefinedValuesInObject)(i)),headers:n};ai.AuthClient.setMethodName(a,"getTokenAsync");let f=await this.transporter.request(a),m=f.data;return f.data&&f.data.expires_in&&(m.expiry_date=new Date().getTime()+f.data.expires_in*1e3,delete m.expires_in),this.emit("tokens",m),{tokens:m,res:f}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let r=this.refreshTokenNoCache(e).then(n=>(this.refreshTokenPromises.delete(e),n),n=>{throw this.refreshTokenPromises.delete(e),n});return this.refreshTokenPromises.set(e,r),r}async refreshTokenNoCache(e){if(!e)throw new Error("No refresh token is set.");let r=this.endpoints.oauth2TokenUrl.toString(),n={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},i;try{let f={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,gx.removeUndefinedValuesInObject)(n))};ai.AuthClient.setMethodName(f,"refreshTokenNoCache"),i=await this.transporter.request(f)}catch(f){throw f instanceof hx.GaxiosError&&f.message==="invalid_grant"&&f.response?.data&&/ReAuth/i.test(f.response.data.error_description)&&(f.message=JSON.stringify(f.response.data)),f}let a=i.data;return i.data&&i.data.expires_in&&(a.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete a.expires_in),this.emit("tokens",a),{tokens:a,res:i}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(r=>e(null,r.credentials,r.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),r=e.tokens;return r.refresh_token=this.credentials.refresh_token,this.credentials=r,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(r=>e(null,r.token,r.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let n=await this.processAndValidateRefreshHandler();if(n?.access_token)return this.setCredentials(n),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let r=await this.refreshAccessTokenAsync();if(!r.credentials||r.credentials&&!r.credentials.access_token)throw new Error("Could not refresh access token.");return{token:r.credentials.access_token,res:r.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let r=this.credentials;if(!r.access_token&&!r.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(r.access_token&&!this.isTokenExpiring()){r.token_type=r.token_type||"Bearer";let m=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(m)}}if(this.refreshHandler){let m=await this.processAndValidateRefreshHandler();if(m?.access_token){this.setCredentials(m);let h=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(h)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,i=null;try{n=await this.refreshToken(r.refresh_token),i=n.tokens}catch(m){let h=m;throw h.response&&(h.response.status===403||h.response.status===404)&&(h.message=`Could not refresh access token: ${h.message}`),h}let a=this.credentials;a.token_type=a.token_type||"Bearer",i.refresh_token=a.refresh_token,this.credentials=i;let f=new Headers({authorization:a.token_type+" "+i.access_token});return{headers:this.addSharedMetadataHeaders(f),res:n.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let r=new URL(this.endpoints.oauth2RevokeUrl);return r.searchParams.append("token",e),r}revokeToken(e,r){let n={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(ai.AuthClient.setMethodName(n,"revokeToken"),r)this.transporter.request(n).then(i=>r(null,i),r);else return this.transporter.request(n)}revokeCredentials(e){if(e)this.revokeCredentialsAsync().then(r=>e(null,r),e);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let e=this.credentials.access_token;if(this.credentials={},e)return this.revokeToken(e);throw new Error("No access token to revoke.")}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){try{let n=await this.getRequestMetadataAsync();return e.headers=hx.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,n.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(n){let i=n.response;if(i){let a=i.status,f=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),m=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,h=i.config.data instanceof tN.Readable,_=a===401||a===403;if(!r&&_&&!h&&f)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&_&&!h&&m){let P=await this.processAndValidateRefreshHandler();return P?.access_token&&this.setCredentials(P),this.requestAsync(e,!0)}}throw n}}verifyIdToken(e,r){if(r&&typeof r!="function")throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(r)this.verifyIdTokenAsync(e).then(n=>r(null,n),r);else return this.verifyIdTokenAsync(e)}async verifyIdTokenAsync(e){if(!e.idToken)throw new Error("The verifyIdToken method requires an ID Token");let r=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(e.idToken,r.certs,e.audience,this.issuers,e.maxExpiry)}async getTokenInfo(e){let{data:r}=await this.transporter.request({...t.RETRY_CONFIG,method:"POST",headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8",authorization:`Bearer ${e}`},url:this.endpoints.tokenInfoUrl.toString()}),n=Object.assign({expiry_date:new Date().getTime()+r.expires_in*1e3,scopes:r.scope.split(" ")},r);return delete n.expires_in,delete n.scope,n}getFederatedSignonCerts(e){if(e)this.getFederatedSignonCertsAsync().then(r=>e(null,r.certs,r.res),e);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let e=new Date().getTime(),r=(0,Pp.hasBrowserCrypto)()?hn.JWK:hn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case hn.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case hn.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let _={...t.RETRY_CONFIG,url:i};ai.AuthClient.setMethodName(_,"getFederatedSignonCertsAsync"),n=await this.transporter.request(_)}catch(_){throw _ instanceof Error&&(_.message=`Failed to retrieve verification certificates: ${_.message}`),_}let a=n?.headers.get("cache-control"),f=-1;if(a){let _=/max-age=(?<maxAge>[0-9]+)/.exec(a)?.groups?.maxAge;_&&(f=Number(_)*1e3)}let m={};switch(r){case hn.PEM:m=n.data;break;case hn.JWK:for(let _ of n.data.keys)m[_.kid]=_;break;default:throw new Error(`Unsupported certificate format ${r}`)}let h=new Date;return this.certificateExpiry=f===-1?null:new Date(h.getTime()+f),this.certificateCache=m,this.certificateCacheFormat=r,{certs:m,format:r,res:n}}getIapPublicKeys(e){if(e)this.getIapPublicKeysAsync().then(r=>e(null,r.pubkeys,r.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,r=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let n={...t.RETRY_CONFIG,url:r};ai.AuthClient.setMethodName(n,"getIapPublicKeysAsync"),e=await this.transporter.request(n)}catch(n){throw n instanceof Error&&(n.message=`Failed to retrieve verification certificates: ${n.message}`),n}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,r,n,i,a){let f=(0,Pp.createCrypto)();a||(a=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let m=e.split(".");if(m.length!==3)throw new Error("Wrong number of segments in token: "+e);let h=m[0]+"."+m[1],_=m[2],P,E;try{P=JSON.parse(f.decodeBase64StringUtf8(m[0]))}catch(c){throw c instanceof Error&&(c.message=`Can't parse token envelope: ${m[0]}': ${c.message}`),c}if(!P)throw new Error("Can't parse token envelope: "+m[0]);try{E=JSON.parse(f.decodeBase64StringUtf8(m[1]))}catch(c){throw c instanceof Error&&(c.message=`Can't parse token payload '${m[0]}`),c}if(!E)throw new Error("Can't parse token payload: "+m[1]);if(!Object.prototype.hasOwnProperty.call(r,P.kid))throw new Error("No pem found for envelope: "+JSON.stringify(P));let S=r[P.kid];if(P.alg==="ES256"&&(_=rN.joseToDer(_,"ES256").toString("base64")),!await f.verify(S,h,_))throw new Error("Invalid token signature: "+e);if(!E.iat)throw new Error("No issue time in token: "+JSON.stringify(E));if(!E.exp)throw new Error("No expiration time in token: "+JSON.stringify(E));let T=Number(E.iat);if(isNaN(T))throw new Error("iat field using invalid format");let $=Number(E.exp);if(isNaN($))throw new Error("exp field using invalid format");let b=new Date().getTime()/1e3;if($>=b+a)throw new Error("Expiration time too far in future: "+JSON.stringify(E));let u=T-t.CLOCK_SKEW_SECS_,p=$+t.CLOCK_SKEW_SECS_;if(b<u)throw new Error("Token used too early, "+b+" < "+u+": "+JSON.stringify(E));if(b>p)throw new Error("Token used too late, "+b+" > "+p+": "+JSON.stringify(E));if(i&&i.indexOf(E.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+E.iss);if(typeof n<"u"&&n!==null){let c=E.aud,y=!1;if(n.constructor===Array?y=n.indexOf(c)>-1:y=c===n,!y)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new nN.LoginTicket(P,E)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let e=await this.refreshHandler();if(!e.access_token)throw new Error("No access token is returned by the refreshHandler callback.");return e}}isTokenExpiring(){let e=this.credentials.expiry_date;return e?e<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}};Fr.OAuth2Client=wp});var Sp=M(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.Compute=void 0;var oN=pt(),vx=vs(),iN=go(),xp=class extends iN.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 vx.instance(i)}catch(i){throw i instanceof oN.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 vx.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))}};Mu.Compute=xp});var Ep=M(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.IdTokenClient=void 0;var sN=go(),Tp=class extends sN.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}};Fu.IdTokenClient=Tp});var bp=M(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.GCPEnv=void 0;ui.clear=aN;ui.getEnv=uN;var _x=vs(),Lr;(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"})(Lr||(ui.GCPEnv=Lr={}));var ws;function aN(){ws=void 0}o(aN,"clear");async function uN(){return ws||(ws=cN(),ws)}o(uN,"getEnv");async function cN(){let t=Lr.NONE;return lN()?t=Lr.APP_ENGINE:dN()?t=Lr.CLOUD_FUNCTIONS:await hN()?await mN()?t=Lr.KUBERNETES_ENGINE:pN()?t=Lr.CLOUD_RUN:fN()?t=Lr.CLOUD_RUN_JOBS:t=Lr.COMPUTE_ENGINE:t=Lr.NONE,t}o(cN,"getEnvMemoized");function lN(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(lN,"isAppEngine");function dN(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o(dN,"isCloudFunction");function pN(){return!!process.env.K_CONFIGURATION}o(pN,"isCloudRun");function fN(){return!!process.env.CLOUD_RUN_JOB}o(fN,"isCloudRunJob");async function mN(){try{return await _x.instance("attributes/cluster-name"),!0}catch{return!1}}o(mN,"isKubernetesEngine");async function hN(){return _x.isAvailable()}o(hN,"isComputeEngine")});var Ap=M((wY,Px)=>{var Lu=si().Buffer,gN=require("stream"),yN=require("util");function qu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Lu.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Lu.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(qu,"DataStream");yN.inherits(qu,gN);qu.prototype.write=o(function(e){this.buffer=Lu.concat([this.buffer,Lu.from(e)]),this.emit("data",e)},"write");qu.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");Px.exports=qu});var xx=M((SY,wx)=>{"use strict";var xs=require("buffer").Buffer,Ip=require("buffer").SlowBuffer;wx.exports=Bu;function Bu(t,e){if(!xs.isBuffer(t)||!xs.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}o(Bu,"bufferEq");Bu.install=function(){xs.prototype.equal=Ip.prototype.equal=o(function(e){return Bu(this,e)},"equal")};var vN=xs.prototype.equal,_N=Ip.prototype.equal;Bu.restore=function(){xs.prototype.equal=vN,Ip.prototype.equal=_N}});var Dp=M((EY,Ox)=>{var li=si().Buffer,fr=require("crypto"),Tx=dp(),Sx=require("util"),PN=`"%s" is not a valid algorithm.
|
|
39
|
+
Supported algorithms are:
|
|
40
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Ss="secret must be a string or buffer",ci="key must be a string or a buffer",wN="key must be a string, a buffer or an object",$p=typeof fr.createPublicKey=="function";$p&&(ci+=" or a KeyObject",Ss+="or a KeyObject");function Ex(t){if(!li.isBuffer(t)&&typeof t!="string"&&(!$p||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Ir(ci)}o(Ex,"checkIsPublicKey");function bx(t){if(!li.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Ir(wN)}o(bx,"checkIsPrivateKey");function xN(t){if(!li.isBuffer(t)){if(typeof t=="string")return t;if(!$p||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Ir(Ss)}}o(xN,"checkIsSecretKey");function Op(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Op,"fromBase64");function Ax(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(Ax,"toBase64");function Ir(t){var e=[].slice.call(arguments,1),r=Sx.format.bind(Sx,t).apply(null,e);return new TypeError(r)}o(Ir,"typeError");function SN(t){return li.isBuffer(t)||typeof t=="string"}o(SN,"bufferOrString");function Ts(t){return SN(t)||(t=JSON.stringify(t)),t}o(Ts,"normalizeInput");function Ix(t){return o(function(r,n){xN(n),r=Ts(r);var i=fr.createHmac("sha"+t,n),a=(i.update(r),i.digest("base64"));return Op(a)},"sign")}o(Ix,"createHmacSigner");var Rp,TN="timingSafeEqual"in fr?o(function(e,r){return e.byteLength!==r.byteLength?!1:fr.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return Rp||(Rp=xx()),Rp(e,r)},"timingSafeEqual");function EN(t){return o(function(r,n,i){var a=Ix(t)(r,i);return TN(li.from(n),li.from(a))},"verify")}o(EN,"createHmacVerifier");function Rx(t){return o(function(r,n){bx(n),r=Ts(r);var i=fr.createSign("RSA-SHA"+t),a=(i.update(r),i.sign(n,"base64"));return Op(a)},"sign")}o(Rx,"createKeySigner");function $x(t){return o(function(r,n,i){Ex(i),r=Ts(r),n=Ax(n);var a=fr.createVerify("RSA-SHA"+t);return a.update(r),a.verify(i,n,"base64")},"verify")}o($x,"createKeyVerifier");function bN(t){return o(function(r,n){bx(n),r=Ts(r);var i=fr.createSign("RSA-SHA"+t),a=(i.update(r),i.sign({key:n,padding:fr.constants.RSA_PKCS1_PSS_PADDING,saltLength:fr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Op(a)},"sign")}o(bN,"createPSSKeySigner");function AN(t){return o(function(r,n,i){Ex(i),r=Ts(r),n=Ax(n);var a=fr.createVerify("RSA-SHA"+t);return a.update(r),a.verify({key:i,padding:fr.constants.RSA_PKCS1_PSS_PADDING,saltLength:fr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(AN,"createPSSKeyVerifier");function IN(t){var e=Rx(t);return o(function(){var n=e.apply(null,arguments);return n=Tx.derToJose(n,"ES"+t),n},"sign")}o(IN,"createECDSASigner");function RN(t){var e=$x(t);return o(function(n,i,a){i=Tx.joseToDer(i,"ES"+t).toString("base64");var f=e(n,i,a);return f},"verify")}o(RN,"createECDSAVerifer");function $N(){return o(function(){return""},"sign")}o($N,"createNoneSigner");function ON(){return o(function(e,r){return r===""},"verify")}o(ON,"createNoneVerifier");Ox.exports=o(function(e){var r={hs:Ix,rs:Rx,ps:bN,es:IN,none:$N},n={hs:EN,rs:$x,ps:AN,es:RN,none:ON},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Ir(PN,e);var a=(i[1]||i[3]).toLowerCase(),f=i[2];return{sign:r[a](f),verify:n[a](f)}},"jwa")});var Cp=M((AY,Dx)=>{var DN=require("buffer").Buffer;Dx.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||DN.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var jx=M((RY,kx)=>{var CN=si().Buffer,Cx=Ap(),NN=Dp(),zN=require("stream"),Nx=Cp(),Np=require("util");function zx(t,e){return CN.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(zx,"base64url");function UN(t,e,r){r=r||"utf8";var n=zx(Nx(t),"binary"),i=zx(Nx(e),r);return Np.format("%s.%s",n,i)}o(UN,"jwsSecuredInput");function Ux(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,a=NN(e.alg),f=UN(e,r,i),m=a.sign(f,n);return Np.format("%s.%s",f,m)}o(Ux,"jwsSign");function Vu(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 Cx(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Cx(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(Vu,"SignStream");Np.inherits(Vu,zN);Vu.prototype.sign=o(function(){try{var e=Ux({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");Vu.sign=Ux;kx.exports=Vu});var Zx=M((OY,Wx)=>{var Fx=si().Buffer,Mx=Ap(),kN=Dp(),jN=require("stream"),Lx=Cp(),MN=require("util"),FN=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function LN(t){return Object.prototype.toString.call(t)==="[object Object]"}o(LN,"isObject");function qN(t){if(LN(t))return t;try{return JSON.parse(t)}catch{return}}o(qN,"safeJsonParse");function qx(t){var e=t.split(".",1)[0];return qN(Fx.from(e,"base64").toString("binary"))}o(qx,"headerFromJWS");function BN(t){return t.split(".",2).join(".")}o(BN,"securedInputFromJWS");function Bx(t){return t.split(".")[2]}o(Bx,"signatureFromJWS");function VN(t,e){e=e||"utf8";var r=t.split(".")[1];return Fx.from(r,"base64").toString(e)}o(VN,"payloadFromJWS");function Vx(t){return FN.test(t)&&!!qx(t)}o(Vx,"isValidJws");function Gx(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=Lx(t);var i=Bx(t),a=BN(t),f=kN(e);return f.verify(a,i,r)}o(Gx,"jwsVerify");function Hx(t,e){if(e=e||{},t=Lx(t),!Vx(t))return null;var r=qx(t);if(!r)return null;var n=VN(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:Bx(t)}}o(Hx,"jwsDecode");function di(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new Mx(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new Mx(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}o(di,"VerifyStream");MN.inherits(di,jN);di.prototype.verify=o(function(){try{var e=Gx(this.signature.buffer,this.algorithm,this.key.buffer),r=Hx(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"verify");di.decode=Hx;di.isValid=Vx;di.verify=Gx;Wx.exports=di});var zp=M(qn=>{var Kx=jx(),Gu=Zx(),GN=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];qn.ALGORITHMS=GN;qn.sign=Kx.sign;qn.verify=Gu.verify;qn.decode=Gu.decode;qn.isValid=Gu.isValid;qn.createSign=o(function(e){return new Kx(e)},"createSign");qn.createVerify=o(function(e){return new Gu(e)},"createVerify")});var lS=M(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.GoogleToken=void 0;var Jx=Hu(require("fs")),HN=pt(),WN=Hu(zp()),ZN=Hu(require("path")),KN=require("util");function Hu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Hu=o(function(a,f){if(!f&&a&&a.__esModule)return a;var m,h,_={__proto__:null,default:a};if(a===null||gn(a)!="object"&&typeof a!="function")return _;if(m=f?n:r){if(m.has(a))return m.get(a);m.set(a,_)}for(var P in a)P!=="default"&&{}.hasOwnProperty.call(a,P)&&((h=(m=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,P))&&(h.get||h.set)?m(_,P,h):_[P]=a[P]);return _},"_interopRequireWildcard"))(t,e)}o(Hu,"_interopRequireWildcard");function gn(t){"@babel/helpers - typeof";return gn=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},gn(t)}o(gn,"_typeof");function JN(t,e){iS(t,e),e.add(t)}o(JN,"_classPrivateMethodInitSpec");function YN(t,e,r){iS(t,e),e.set(t,r)}o(YN,"_classPrivateFieldInitSpec");function iS(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(iS,"_checkPrivateRedeclaration");function Yx(t,e,r){return t.set(Rr(t,e),r),r}o(Yx,"_classPrivateFieldSet");function Xx(t,e){return t.get(Rr(t,e))}o(Xx,"_classPrivateFieldGet");function Rr(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(Rr,"_assertClassBrand");function Qx(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,uS(n.key),n)}}o(Qx,"_defineProperties");function sS(t,e,r){return e&&Qx(t.prototype,e),r&&Qx(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(sS,"_createClass");function aS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(aS,"_classCallCheck");function XN(t,e,r){return e=Is(e),QN(t,Lp()?Reflect.construct(e,r||[],Is(t).constructor):e.apply(t,r))}o(XN,"_callSuper");function QN(t,e){if(e&&(gn(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ez(t)}o(QN,"_possibleConstructorReturn");function ez(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(ez,"_assertThisInitialized");function tz(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&As(t,e)}o(tz,"_inherits");function Up(t){var e=typeof Map=="function"?new Map:void 0;return Up=o(function(n){if(n===null||!nz(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 rz(n,arguments,Is(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),As(i,n)},"_wrapNativeSuper"),Up(t)}o(Up,"_wrapNativeSuper");function rz(t,e,r){if(Lp())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&As(i,r.prototype),i}o(rz,"_construct");function Lp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Lp=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(Lp,"_isNativeReflectConstruct");function nz(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(nz,"_isNativeFunction");function As(t,e){return As=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},As(t,e)}o(As,"_setPrototypeOf");function Is(t){return Is=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Is(t)}o(Is,"_getPrototypeOf");function Qt(t,e,r){return(e=uS(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(Qt,"_defineProperty");function uS(t){var e=oz(t,"string");return gn(e)=="symbol"?e:e+""}o(uS,"_toPropertyKey");function oz(t,e){if(gn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(gn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(oz,"_toPrimitive");function tr(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(w,T,$,b){var u=T&&T.prototype instanceof m?T:m,p=Object.create(u.prototype);return er(p,"_invoke",function(c,y,l){var x,g,re,ee=0,Te=l||[],ne=!1,K={p:0,n:0,v:t,a:Z,f:Z.bind(t,4),d:o(function(X,ie){return x=X,g=0,re=t,K.n=ie,f},"d")};function Z(Q,X){for(g=Q,re=X,e=0;!ne&&ee&&!ie&&e<Te.length;e++){var ie,ae=Te[e],Ie=K.p,De=ae[2];Q>3?(ie=De===X)&&(re=ae[(g=ae[4])?5:(g=3,3)],ae[4]=ae[5]=t):ae[0]<=Ie&&((ie=Q<2&&Ie<ae[1])?(g=0,K.v=X,K.n=ae[1]):Ie<De&&(ie=Q<3||ae[0]>X||X>De)&&(ae[4]=Q,ae[5]=X,K.n=De,g=0))}if(ie||Q>1)return f;throw ne=!0,X}return o(Z,"d"),function(Q,X,ie){if(ee>1)throw TypeError("Generator is already running");for(ne&&X===1&&Z(X,ie),g=X,re=ie;(e=g<2?t:re)||!ne;){x||(g?g<3?(g>1&&(K.n=-1),Z(g,re)):K.n=re:K.v=re);try{if(ee=2,x){if(g||(Q="next"),e=x[Q]){if(!(e=e.call(x,re)))throw TypeError("iterator result is not an object");if(!e.done)return e;re=e.value,g<2&&(g=0)}else g===1&&(e=x.return)&&e.call(x),g<2&&(re=TypeError("The iterator does not provide a '"+Q+"' method"),g=1);x=t}else if((e=(ne=K.n<0)?re:c.call(y,K))!==f)break}catch(ae){x=t,g=1,re=ae}finally{ee=1}}return{value:e,done:ne}}}(w,$,b),!0),p}o(a,"i");var f={};function m(){}o(m,"Generator");function h(){}o(h,"GeneratorFunction");function _(){}o(_,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var P=[][n]?e(e([][n]())):(er(e={},n,function(){return this}),e),E=_.prototype=m.prototype=Object.create(P);function S(w){return Object.setPrototypeOf?Object.setPrototypeOf(w,_):(w.__proto__=_,er(w,i,"GeneratorFunction")),w.prototype=Object.create(E),w}return o(S,"f"),h.prototype=_,er(E,"constructor",_),er(_,"constructor",h),h.displayName="GeneratorFunction",er(_,i,"GeneratorFunction"),er(E),er(E,i,"Generator"),er(E,n,function(){return this}),er(E,"toString",function(){return"[object Generator]"}),(tr=o(function(){return{w:a,m:S}},"_regenerator"))()}o(tr,"_regenerator");function er(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}er=o(function(f,m,h,_){if(m)i?i(f,m,{value:h,enumerable:!_,configurable:!_,writable:!_}):f[m]=h;else{var P=o(function(S,w){er(f,S,function(T){return this._invoke(S,w,T)})},"o");P("next",0),P("throw",1),P("return",2)}},"_regeneratorDefine"),er(t,e,r,n)}o(er,"_regeneratorDefine2");function eS(t,e,r,n,i,a,f){try{var m=t[a](f),h=m.value}catch(_){return void r(_)}m.done?e(h):Promise.resolve(h).then(n,i)}o(eS,"asyncGeneratorStep");function pi(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var a=t.apply(e,r);function f(h){eS(a,n,i,f,m,"next",h)}o(f,"_next");function m(h){eS(a,n,i,f,m,"throw",h)}o(m,"_throw"),f(void 0)})}}o(pi,"_asyncToGenerator");var tS=Jx.readFile?(0,KN.promisify)(Jx.readFile):pi(tr().m(o(function t(){return tr().w(function(e){for(;;)switch(e.n){case 0:throw new bs("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),rS="https://oauth2.googleapis.com/token",iz="https://oauth2.googleapis.com/revoke?token=",bs=function(t){function e(r,n){var i;return aS(this,e),i=XN(this,e,[r]),Qt(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),tz(e,t),sS(e)}(Up(Error)),Es=new WeakMap,qr=new WeakSet,zY=Wu.GoogleToken=function(){function t(e){aS(this,t),JN(this,qr),Qt(this,"expiresAt",void 0),Qt(this,"key",void 0),Qt(this,"keyFile",void 0),Qt(this,"iss",void 0),Qt(this,"sub",void 0),Qt(this,"scope",void 0),Qt(this,"rawToken",void 0),Qt(this,"tokenExpires",void 0),Qt(this,"email",void 0),Qt(this,"additionalClaims",void 0),Qt(this,"eagerRefreshThresholdMillis",void 0),Qt(this,"transporter",{request:o(function(n){return(0,HN.request)(n)},"request")}),YN(this,Es,void 0),Rr(qr,this,cS).call(this,e)}return o(t,"GoogleToken"),sS(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(gn(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;Rr(qr,this,nS).call(this,n).then(function(a){return i(null,a)},r);return}return Rr(qr,this,nS).call(this,n)},"getToken")},{key:"getCredentials",value:function(){var e=pi(tr().m(o(function n(i){var a,f,m,h,_,P,E;return tr().w(function(S){for(;;)switch(S.n){case 0:a=ZN.extname(i),E=a,S.n=E===".json"?1:E===".der"||E===".crt"||E===".pem"?4:E===".p12"||E===".pfx"?6:7;break;case 1:return S.n=2,tS(i,"utf8");case 2:if(f=S.v,m=JSON.parse(f),h=m.private_key,_=m.client_email,!(!h||!_)){S.n=3;break}throw new bs("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return S.a(2,{privateKey:h,clientEmail:_});case 4:return S.n=5,tS(i,"utf8");case 5:return P=S.v,S.a(2,{privateKey:P});case 6:throw new bs("*.p12 certificates are not supported after v6.1.2. Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.","UNKNOWN_CERTIFICATE_TYPE");case 7:throw new bs("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return S.a(2)}},n)},"_callee2")));function r(n){return e.apply(this,arguments)}return o(r,"getCredentials"),r}()},{key:"revokeToken",value:o(function(r){if(r){Rr(qr,this,oS).call(this).then(function(){return r()},r);return}return Rr(qr,this,oS).call(this)},"revokeToken")}])}();function nS(t){return kp.apply(this,arguments)}o(nS,"_getTokenAsync");function kp(){return kp=pi(tr().m(o(function t(e){return tr().w(function(r){for(;;)switch(r.n){case 0:if(!(Xx(Es,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,Xx(Es,this));case 1:return r.p=1,r.n=2,Yx(Es,this,Rr(qr,this,sz).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,Yx(Es,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),kp.apply(this,arguments)}o(kp,"_getTokenAsync2");function sz(t){return jp.apply(this,arguments)}o(sz,"_getTokenAsyncInner");function jp(){return jp=pi(tr().m(o(function t(e){var r;return tr().w(function(n){for(;;)switch(n.n){case 0:if(!(this.isTokenExpiring()===!1&&e.forceRefresh===!1)){n.n=1;break}return n.a(2,Promise.resolve(this.rawToken));case 1:if(!(!this.key&&!this.keyFile)){n.n=2;break}throw new Error("No key or keyFile set.");case 2:if(!(!this.key&&this.keyFile)){n.n=4;break}return n.n=3,this.getCredentials(this.keyFile);case 3:r=n.v,this.key=r.privateKey,this.iss=r.clientEmail||this.iss,r.clientEmail||Rr(qr,this,az).call(this);case 4:return n.a(2,Rr(qr,this,uz).call(this))}},t,this)},"_callee4"))),jp.apply(this,arguments)}o(jp,"_getTokenAsyncInner2");function az(){if(!this.iss)throw new bs("email is required.","MISSING_CREDENTIALS")}o(az,"_ensureEmail");function oS(){return Mp.apply(this,arguments)}o(oS,"_revokeTokenAsync");function Mp(){return Mp=pi(tr().m(o(function t(){var e;return tr().w(function(r){for(;;)switch(r.n){case 0:if(this.accessToken){r.n=1;break}throw new Error("No token to revoke.");case 1:return e=iz+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Rr(qr,this,cS).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"))),Mp.apply(this,arguments)}o(Mp,"_revokeTokenAsync2");function cS(){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,gn(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(cS,"_configure");function uz(){return Fp.apply(this,arguments)}o(uz,"_requestToken");function Fp(){return Fp=pi(tr().m(o(function t(){var e,r,n,i,a,f,m,h,_,P;return tr().w(function(E){for(;;)switch(E.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:rS,exp:e+3600,iat:e,sub:this.sub},r),i=WN.sign({header:{alg:"RS256"},payload:n,secret:this.key}),E.p=1,E.n=2,this.transporter.request({method:"POST",url:rS,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return a=E.v,this.rawToken=a.data,this.expiresAt=a.data.expires_in===null||a.data.expires_in===void 0?void 0:(e+a.data.expires_in)*1e3,E.a(2,this.rawToken);case 3:throw E.p=3,P=E.v,this.rawToken=void 0,this.tokenExpires=void 0,h=P.response&&(f=P.response)!==null&&f!==void 0&&f.data?(m=P.response)===null||m===void 0?void 0:m.data:{},h.error&&(_=h.error_description?": ".concat(h.error_description):"",P.message="".concat(h.error).concat(_)),P;case 4:return E.a(2)}},t,this,[[1,3]])},"_callee6"))),Fp.apply(this,arguments)}o(Fp,"_requestToken2")});var Bp=M(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.JWTAccess=void 0;var cz=zp(),lz=br(),dS={alg:"RS256",typ:"JWT"},qp=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new lz.LRUCache({capacity:500,maxAge:60*60*1e3});constructor(e,r,n,i){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=i??5*60*1e3}getCachedKey(e,r){let n=e;if(r&&Array.isArray(r)&&r.length?n=e?`${e}_${r.join("_")}`:`${r.join("_")}`:typeof r=="string"&&(n=e?`${e}_${r}`:r),!n)throw Error("Scopes or url must be provided");return n}getRequestHeaders(e,r,n){let i=this.getCachedKey(e,n),a=this.cache.get(i),f=Date.now();if(a&&a.expiration-f>this.eagerRefreshThresholdMillis)return new Headers(a.headers);let m=Math.floor(Date.now()/1e3),h=t.getExpirationTime(m),_;if(Array.isArray(n)&&(n=n.join(" ")),n?_={iss:this.email,sub:this.email,scope:n,exp:h,iat:m}:_={iss:this.email,sub:this.email,aud:e,exp:h,iat:m},r){for(let T in _)if(r[T])throw new Error(`The '${T}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let P=this.keyId?{...dS,kid:this.keyId}:dS,E=Object.assign(_,r),S=cz.sign({header:P,payload:E,secret:this.key}),w=new Headers({authorization:`Bearer ${S}`});return this.cache.set(i,{expiration:h*1e3,headers:w}),w}static getExpirationTime(e){return e+3600}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{e||n(new Error("Must pass in a stream containing the service account auth settings."));let i="";e.setEncoding("utf8").on("data",a=>i+=a).on("error",n).on("end",()=>{try{let a=JSON.parse(i);this.fromJSON(a),r()}catch(a){n(a)}})})}};Zu.JWTAccess=qp});var Gp=M(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.JWT=void 0;var pS=lS(),dz=Bp(),pz=go(),Ku=Xt(),Vp=class t extends pz.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!==Ku.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==Ku.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${Ku.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 dz.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!==Ku.DEFAULT_UNIVERSE,a=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,i?n:void 0);return{headers:this.addSharedMetadataHeaders(a)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let r=new pS.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 pS.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let i="";e.setEncoding("utf8").on("error",n).on("data",a=>i+=a).on("end",()=>{try{let a=JSON.parse(i);this.fromJSON(a),r()}catch(a){n(a)}})})}fromAPIKey(e){if(typeof e!="string")throw new Error("Must provide an API Key string.");this.apiKey=e}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let r=await this.createGToken().getCredentials(this.keyFile);return{private_key:r.privateKey,client_email:r.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};Ju.JWT=Vp});var Wp=M(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.UserRefreshClient=fi.USER_REFRESH_ACCOUNT_TYPE=void 0;var fz=go(),mz=Xt();fi.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var Hp=class t extends fz.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,a){let f=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:a};super(f),this._refreshToken=f.refreshToken,this.credentials.refresh_token=f.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){let r={...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e})};return mz.AuthClient.setMethodName(r,"fetchIdToken"),(await this.transporter.request(r)).data.id_token}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the user refresh token");if(e.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!e.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!e.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!e.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=e.client_id,this._clientSecret=e.client_secret,this._refreshToken=e.refresh_token,this.credentials.refresh_token=e.refresh_token,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}async fromStreamAsync(e){return new Promise((r,n)=>{if(!e)return n(new Error("Must pass in a stream containing the user refresh token."));let i="";e.setEncoding("utf8").on("error",n).on("data",a=>i+=a).on("end",()=>{try{let a=JSON.parse(i);return this.fromJSON(a),r()}catch(a){return n(a)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};fi.UserRefreshClient=Hp});var Kp=M(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.Impersonated=mi.IMPERSONATED_ACCOUNT_TYPE=void 0;var fS=go(),hz=pt(),gz=br();mi.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var Zp=class t extends fS.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 fS.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,gz.originalOrCamelOptions)(e).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=e.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(e){await this.sourceClient.getAccessToken();let r=`projects/-/serviceAccounts/${this.targetPrincipal}`,n=`${this.endpoint}/v1/${r}:signBlob`,i={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:i,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let e="projects/-/serviceAccounts/"+this.targetPrincipal,r=`${this.endpoint}/v1/${e}:generateAccessToken`,n={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},i=await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:n,method:"POST"}),a=i.data;return this.credentials.access_token=a.accessToken,this.credentials.expiry_date=Date.parse(a.expireTime),{tokens:this.credentials,res:i}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof hz.GaxiosError&&(r=e?.response?.data?.error?.status,n=e?.response?.data?.error?.message),r&&n?(e.message=`${r}: unable to impersonate: ${n}`,e):(e.message=`unable to impersonate: ${e}`,e)}}async fetchIdToken(e,r){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,i=`${this.endpoint}/v1/${n}:generateIdToken`,a={delegates:this.delegates,audience:e,includeEmail:r?.includeEmail??!0,useEmailAzp:r?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:i,data:a,method:"POST"})).data.token}};mi.Impersonated=Zp});var Yp=M(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.OAuthClientAuthHandler=void 0;Rs.getErrorFromOAuthErrorResponse=_z;var hi=pt(),yz=_s(),vz=["PUT","POST","PATCH"],Jp=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,yz.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new hi.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new hi.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=hi.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=hi.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=hi.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",a=this.#e.encodeBase64StringUtf8(`${n}:${i}`);hi.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${a}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!vz.includes(r))throw new Error(`${r} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let i=new Headers(e.headers).get("content-type");if(i?.startsWith("application/x-www-form-urlencoded")||e.data instanceof URLSearchParams){let a=new URLSearchParams(e.data??"");a.append("client_id",this.#t.clientId),a.append("client_secret",this.#t.clientSecret||""),e.data=a}else if(i?.startsWith("application/json"))e.data=e.data||{},Object.assign(e.data,{client_id:this.#t.clientId,client_secret:this.#t.clientSecret||""});else throw new Error(`${i} content-types are not supported with ${this.#t.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};Rs.OAuthClientAuthHandler=Jp;function _z(t,e){let r=t.error,n=t.error_description,i=t.error_uri,a=`Error code ${r}`;typeof n<"u"&&(a+=`: ${n}`),typeof i<"u"&&(a+=` - ${i}`);let f=new Error(a);if(e){let m=Object.keys(e);e.stack&&m.push("stack"),m.forEach(h=>{h!=="message"&&Object.defineProperty(f,h,{value:e[h],writable:!1,enumerable:!0})})}return f}o(_z,"getErrorFromOAuthErrorResponse")});var Xu=M(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.StsCredentials=void 0;var Pz=pt(),wz=Xt(),mS=Yp(),xz=br(),Xp=class t extends mS.OAuthClientAuthHandler{static{o(this,"StsCredentials")}#e;constructor(e={tokenExchangeEndpoint:""},r){(typeof e!="object"||e instanceof URL)&&(e={tokenExchangeEndpoint:e,clientAuthentication:r}),super(e),this.#e=e.tokenExchangeEndpoint}async exchangeToken(e,r,n){let i={grant_type:e.grantType,resource:e.resource,audience:e.audience,scope:e.scope?.join(" "),requested_token_type:e.requestedTokenType,subject_token:e.subjectToken,subject_token_type:e.subjectTokenType,actor_token:e.actingParty?.actorToken,actor_token_type:e.actingParty?.actorTokenType,options:n&&JSON.stringify(n)},a={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:r,data:new URLSearchParams((0,xz.removeUndefinedValuesInObject)(i))};wz.AuthClient.setMethodName(a,"exchangeToken"),this.applyClientAuthenticationOptions(a);try{let f=await this.transporter.request(a),m=f.data;return m.res=f,m}catch(f){throw f instanceof Pz.GaxiosError&&f.response?(0,mS.getErrorFromOAuthErrorResponse)(f.response.data,f):f}}};Yu.StsCredentials=Xp});var Bn=M(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.BaseExternalAccountClient=mr.CLOUD_RESOURCE_MANAGER=mr.EXTERNAL_ACCOUNT_TYPE=mr.EXPIRATION_TIME_OFFSET=void 0;var Sz=pt(),Tz=require("stream"),Qp=Xt(),Ez=Xu(),hS=br(),bz=mp(),Az="urn:ietf:params:oauth:grant-type:token-exchange",Iz="urn:ietf:params:oauth:token-type:access_token",ef="https://www.googleapis.com/auth/cloud-platform",Rz=3600;mr.EXPIRATION_TIME_OFFSET=5*60*1e3;mr.EXTERNAL_ACCOUNT_TYPE="external_account";mr.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var $z="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",Oz="https://sts.{universeDomain}/v1/token",tf=class t extends Qp.AuthClient{static{o(this,"BaseExternalAccountClient")}scopes;projectNumber;audience;subjectTokenType;stsCredential;clientAuth;credentialSourceType;cachedAccessToken;serviceAccountImpersonationUrl;serviceAccountImpersonationLifetime;workforcePoolUserProject;configLifetimeRequested;tokenUrl;cloudResourceManagerURL;supplierContext;#e=null;constructor(e){super(e);let r=(0,hS.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==mr.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${mr.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let i=r.get("client_id"),a=r.get("client_secret");this.tokenUrl=r.get("token_url")??Oz.replace("{universeDomain}",this.universeDomain);let f=r.get("subject_token_type"),m=r.get("workforce_pool_user_project"),h=r.get("service_account_impersonation_url"),_=r.get("service_account_impersonation"),P=(0,hS.originalOrCamelOptions)(_).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(r.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),i&&(this.clientAuth={confidentialClientType:"basic",clientId:i,clientSecret:a}),this.stsCredential=new Ez.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[ef],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=f,this.workforcePoolUserProject=m;let E=new RegExp($z);if(this.workforcePoolUserProject&&!this.audience.match(E))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=h,this.serviceAccountImpersonationLifetime=P,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=Rz),this.projectNumber=this.getProjectNumber(this.audience),this.supplierContext={audience:this.audience,subjectTokenType:this.subjectTokenType,transporter:this.transporter}}getServiceAccountEmail(){if(this.serviceAccountImpersonationUrl){if(this.serviceAccountImpersonationUrl.length>256)throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);return/serviceAccounts\/(?<email>[^:]+):generateAccessToken$/.exec(this.serviceAccountImpersonationUrl)?.groups?.email||null}return null}setCredentials(e){super.setCredentials(e),this.cachedAccessToken=e}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async getProjectId(){let e=this.projectNumber||this.workforcePoolUserProject;if(this.projectId)return this.projectId;if(e){let r=await this.getRequestHeaders(),n={...t.RETRY_CONFIG,headers:r,url:`${this.cloudResourceManagerURL.toString()}${e}`};Qp.AuthClient.setMethodName(n,"getProjectId");let i=await this.transporter.request(n);return this.projectId=i.data.projectId,this.projectId}return null}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=Sz.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let a=i.response;if(a){let f=a.status,m=a.config.data instanceof Tz.Readable;if(!r&&(f===401||f===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),r={grantType:Az,audience:this.audience,requestedTokenType:Iz,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[ef]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,i=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),a=await this.stsCredential.exchangeToken(r,i,n);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(a.access_token):a.expires_in?this.cachedAccessToken={access_token:a.access_token,expiry_date:new Date().getTime()+a.expires_in*1e3,res:a.res}:this.cachedAccessToken={access_token:a.access_token,res:a.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}getProjectNumber(e){let r=e.match(/\/projects\/([^/]+)/);return r?r[1]:null}async getImpersonatedAccessToken(e){let r={...t.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"}};Qp.AuthClient.setMethodName(r,"getImpersonatedAccessToken");let n=await this.transporter.request(r),i=n.data;return{access_token:i.accessToken,expiry_date:new Date(i.expireTime).getTime(),res:n}}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}getScopesArray(){return typeof this.scopes=="string"?[this.scopes]:this.scopes||[ef]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${bz.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};mr.BaseExternalAccountClient=tf});var gS=M(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.FileSubjectTokenSupplier=void 0;var nf=require("util"),of=require("fs"),Dz=(0,nf.promisify)(of.readFile??(()=>{})),Cz=(0,nf.promisify)(of.realpath??(()=>{})),Nz=(0,nf.promisify)(of.lstat??(()=>{})),rf=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 Cz(e),!(await Nz(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 Dz(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}};Qu.FileSubjectTokenSupplier=rf});var yS=M(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.UrlSubjectTokenSupplier=void 0;var zz=Xt(),sf=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};zz.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}};ec.UrlSubjectTokenSupplier=sf});var vS=M(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.CertificateSubjectTokenSupplier=rr.InvalidConfigurationError=rr.CertificateSourceUnavailableError=rr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var tc=br(),rc=require("fs"),nc=require("crypto"),Uz=require("https");rr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Br=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};rr.CertificateSourceUnavailableError=Br;var hr=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};rr.InvalidConfigurationError=hr;var af=class{static{o(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new hr("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new hr("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new hr("Cannot create mTLS Agent with missing certificate or key");return new Uz.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,tc.isValidFile)(e))return e;throw new Br(`Provided certificate config path is invalid: ${e}`)}let r=process.env[rr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,tc.isValidFile)(r))return r;throw new Br(`Path from environment variable "${rr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,tc.getWellKnownCertificateConfigFileLocation)();if(await(0,tc.isValidFile)(n))return n;throw new Br(`Could not find certificate configuration file. Searched override path, the "${rr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await rc.promises.readFile(e,"utf8")}catch{throw new Br(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),i=n?.cert_configs?.workload?.cert_path,a=n?.cert_configs?.workload?.key_path;if(!i||!a)throw new hr(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:i,keyPath:a}}catch(n){throw n instanceof hr?n:new hr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await rc.promises.readFile(e),new nc.X509Certificate(n)}catch(a){let f=a instanceof Error?a.message:String(a);throw new Br(`Failed to read certificate file at ${e}: ${f}`)}try{i=await rc.promises.readFile(r),(0,nc.createPrivateKey)(i)}catch(a){let f=a instanceof Error?a.message:String(a);throw new Br(`Failed to read private key file at ${r}: ${f}`)}return{cert:n,key:i}}async#n(e){let r=new nc.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let a=((await rc.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((h,_)=>{try{return new nc.X509Certificate(h)}catch(P){let E=P instanceof Error?P.message:String(P);throw new hr(`Failed to parse certificate at index ${_} in trust chain file ${this.trustChainPath}: ${E}`)}}),f=a.findIndex(h=>r.raw.equals(h.raw)),m;if(f===-1)m=[r,...a];else if(f===0)m=a;else throw new hr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${f}).`);return JSON.stringify(m.map(h=>h.raw.toString("base64")))}catch(n){if(n instanceof hr)throw n;let i=n instanceof Error?n.message:String(n);throw new Br(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};rr.CertificateSubjectTokenSupplier=af});var lf=M(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.IdentityPoolClient=void 0;var kz=Bn(),uf=br(),jz=gS(),Mz=yS(),_S=vS(),Fz=Xu(),PS=pt(),cf=class t extends kz.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,uf.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("subject_token_supplier");if(!n&&!i)throw new Error("A credential source or subject token supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or subject token supplier can be specified.");if(i)this.subjectTokenSupplier=i,this.credentialSourceType="programmatic";else{let a=(0,uf.originalOrCamelOptions)(n),f=(0,uf.originalOrCamelOptions)(a.get("format")),m=f.get("type")||"text",h=f.get("subject_token_field_name");if(m!=="json"&&m!=="text")throw new Error(`Invalid credential_source format "${m}"`);if(m==="json"&&!h)throw new Error("Missing subject_token_field_name for JSON credential_source format");let _=a.get("file"),P=a.get("url"),E=a.get("certificate"),S=a.get("headers");if(_&&P||P&&E||_&&E)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(_)this.credentialSourceType="file",this.subjectTokenSupplier=new jz.FileSubjectTokenSupplier({filePath:_,formatType:m,subjectTokenFieldName:h});else if(P)this.credentialSourceType="url",this.subjectTokenSupplier=new Mz.UrlSubjectTokenSupplier({url:P,formatType:m,subjectTokenFieldName:h,headers:S,additionalGaxiosOptions:t.RETRY_CONFIG});else if(E){this.credentialSourceType="certificate";let w=new _S.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:E.use_default_certificate_config,certificateConfigLocation:E.certificate_config_location,trustChainPath:E.trust_chain_path});this.subjectTokenSupplier=w}else throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.')}}async retrieveSubjectToken(){let e=await this.subjectTokenSupplier.getSubjectToken(this.supplierContext);if(this.subjectTokenSupplier instanceof _S.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new Fz.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new PS.Gaxios({agent:r})}),this.transporter=new PS.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};oc.IdentityPoolClient=cf});var pf=M(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.AwsRequestSigner=void 0;var ic=pt(),xS=_s(),wS="AWS4-HMAC-SHA256",Lz="aws4_request",df=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,xS.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let r=typeof e.data=="object"?JSON.stringify(e.data):e.data,n=e.url,i=e.method||"GET",a=e.body||r,f=e.headers,m=await this.getCredentials(),h=new URL(n);if(typeof a!="string"&&a!==void 0)throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${a}`);let _=await Bz({crypto:this.crypto,host:h.host,canonicalUri:h.pathname,canonicalQuerystring:h.search.slice(1),method:i,region:this.region,securityCredentials:m,requestPayload:a,additionalAmzHeaders:f}),P=ic.Gaxios.mergeHeaders(_.amzDate?{"x-amz-date":_.amzDate}:{},{authorization:_.authorizationHeader,host:h.host},f||{});m.token&&ic.Gaxios.mergeHeaders(P,{"x-amz-security-token":m.token});let E={url:n,method:i,headers:P};return a!==void 0&&(E.body=a),E}};sc.AwsRequestSigner=df;async function $s(t,e,r){return await t.signWithHmacSha256(e,r)}o($s,"sign");async function qz(t,e,r,n,i){let a=await $s(t,`AWS4${e}`,r),f=await $s(t,a,n),m=await $s(t,f,i);return await $s(t,m,"aws4_request")}o(qz,"getSigningKey");async function Bz(t){let e=ic.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,a=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),f=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let m=ic.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":a},e),h="",_=[...m.keys()].sort();_.forEach(p=>{h+=`${p}:${m.get(p)}
|
|
41
|
+
`});let P=_.join(";"),E=await t.crypto.sha256DigestHex(r),S=`${t.method.toUpperCase()}
|
|
42
|
+
${t.canonicalUri}
|
|
43
|
+
${t.canonicalQuerystring}
|
|
44
|
+
${h}
|
|
45
|
+
${P}
|
|
46
|
+
${E}`,w=`${f}/${t.region}/${n}/${Lz}`,T=`${wS}
|
|
47
|
+
${a}
|
|
48
|
+
${w}
|
|
49
|
+
`+await t.crypto.sha256DigestHex(S),$=await qz(t.crypto,t.securityCredentials.secretAccessKey,f,t.region,n),b=await $s(t.crypto,$,T),u=`${wS} Credential=${t.securityCredentials.accessKeyId}/${w}, SignedHeaders=${P}, Signature=${(0,xS.fromArrayBufferToHex)(b)}`;return{amzDate:e.has("date")?void 0:a,authorizationHeader:u,canonicalQuerystring:t.canonicalQuerystring}}o(Bz,"generateAuthenticationHeaderMap")});var SS=M(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.DefaultAwsSecurityCredentialsSupplier=void 0;var ac=Xt(),ff=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};ac.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 ac.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 ac.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 ac.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}};uc.DefaultAwsSecurityCredentialsSupplier=ff});var hf=M(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.AwsClient=void 0;var Vz=pf(),Gz=Bn(),Hz=SS(),TS=br(),Wz=pt(),mf=class t extends Gz.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,TS.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("aws_security_credentials_supplier");if(!n&&!i)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(i)this.awsSecurityCredentialsSupplier=i,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let a=(0,TS.originalOrCamelOptions)(n);this.environmentId=a.get("environment_id");let f=a.get("region_url"),m=a.get("url"),h=a.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new Hz.DefaultAwsSecurityCredentialsSupplier({regionUrl:f,securityCredentialsUrl:m,imdsV2SessionTokenUrl:h}),this.regionalCredVerificationUrl=a.get("regional_cred_verification_url"),this.credentialSourceType="aws",this.validateEnvironmentId()}this.awsRequestSigner=null,this.region=""}validateEnvironmentId(){let e=this.environmentId?.match(/^(aws)(\d+)$/);if(!e||!this.regionalCredVerificationUrl)throw new Error('No valid AWS "credential_source" provided');if(parseInt(e[2],10)!==1)throw new Error(`aws version "${e[2]}" is not supported in the current build.`)}async retrieveSubjectToken(){this.awsRequestSigner||(this.region=await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext),this.awsRequestSigner=new Vz.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 Wz.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((i,a)=>r.push({key:a,value:i})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};cc.AwsClient=mf});var Pf=M(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.InvalidSubjectTokenError=ht.InvalidMessageFieldError=ht.InvalidCodeFieldError=ht.InvalidTokenTypeFieldError=ht.InvalidExpirationTimeFieldError=ht.InvalidSuccessFieldError=ht.InvalidVersionFieldError=ht.ExecutableResponseError=ht.ExecutableResponse=void 0;var lc="urn:ietf:params:oauth:token-type:saml2",gf="urn:ietf:params:oauth:token-type:id_token",yf="urn:ietf:params:oauth:token-type:jwt",vf=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new dc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new pc("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!==lc&&this.tokenType!==gf&&this.tokenType!==yf)throw new fc(`Executable response must contain a 'token_type' field when successful and it must be one of ${gf}, ${yf}, or ${lc}.`);if(this.tokenType===lc){if(!e.saml_response)throw new Os(`Executable response must contain a 'saml_response' field when token_type=${lc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new Os(`Executable response must contain a 'id_token' field when token_type=${gf} or ${yf}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new mc("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new hc("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=e.code,this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};ht.ExecutableResponse=vf;var Vr=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};ht.ExecutableResponseError=Vr;var dc=class extends Vr{static{o(this,"InvalidVersionFieldError")}};ht.InvalidVersionFieldError=dc;var pc=class extends Vr{static{o(this,"InvalidSuccessFieldError")}};ht.InvalidSuccessFieldError=pc;var _f=class extends Vr{static{o(this,"InvalidExpirationTimeFieldError")}};ht.InvalidExpirationTimeFieldError=_f;var fc=class extends Vr{static{o(this,"InvalidTokenTypeFieldError")}};ht.InvalidTokenTypeFieldError=fc;var mc=class extends Vr{static{o(this,"InvalidCodeFieldError")}};ht.InvalidCodeFieldError=mc;var hc=class extends Vr{static{o(this,"InvalidMessageFieldError")}};ht.InvalidMessageFieldError=hc;var Os=class extends Vr{static{o(this,"InvalidSubjectTokenError")}};ht.InvalidSubjectTokenError=Os});var Sf=M(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.PluggableAuthHandler=gi.ExecutableError=void 0;var yo=Pf(),Zz=require("child_process"),wf=require("fs"),gc=class extends Error{static{o(this,"ExecutableError")}code;constructor(e,r){super(`The executable failed with exit code: ${r} and error message: ${e}.`),this.code=r,Object.setPrototypeOf(this,new.target.prototype)}};gi.ExecutableError=gc;var xf=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=Zz.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),a="";i.stdout.on("data",m=>{a+=m}),i.stderr.on("data",m=>{a+=m});let f=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",m=>{if(clearTimeout(f),m===0)try{let h=JSON.parse(a),_=new yo.ExecutableResponse(h);return r(_)}catch(h){return h instanceof yo.ExecutableResponseError?n(h):n(new yo.ExecutableResponseError(`The executable returned an invalid response: ${a}`))}else return n(new gc(a,m.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await wf.promises.realpath(this.outputFile)}catch{return}if(!(await wf.promises.lstat(e)).isFile())return;let r=await wf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new yo.ExecutableResponse(n).isValid()?new yo.ExecutableResponse(n):void 0}catch(n){throw n instanceof yo.ExecutableResponseError?n:new yo.ExecutableResponseError(`The output file contained an invalid response: ${r}`)}}static parseCommand(e){let r=e.match(/(?:[^\s"]+|"[^"]*")+/g);if(!r)throw new Error(`Provided command: "${e}" could not be parsed.`);for(let n=0;n<r.length;n++)r[n][0]==='"'&&r[n].slice(-1)==='"'&&(r[n]=r[n].slice(1,-1));return r}};gi.PluggableAuthHandler=xf});var Ef=M(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.PluggableAuthClient=yi.ExecutableError=void 0;var Kz=Bn(),Jz=Pf(),ES=Sf(),Yz=Sf();Object.defineProperty(yi,"ExecutableError",{enumerable:!0,get:o(function(){return Yz.ExecutableError},"get")});var Xz=30*1e3,bS=5*1e3,AS=120*1e3,Qz="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",IS=1,Tf=class extends Kz.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=Xz;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<bS||this.timeoutMillis>AS)throw new Error(`Timeout must be between ${bS} and ${AS} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new ES.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[Qz]!=="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>IS)throw new Error(`Version of executable is not currently supported, maximum supported version is ${IS}.`);if(!e.success)throw new ES.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new Jz.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.");if(e.isExpired())throw new Error("Executable response is expired.");return e.subjectToken}};yi.PluggableAuthClient=Tf});var Af=M(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.ExternalAccountClient=void 0;var eU=Bn(),tU=lf(),rU=hf(),nU=Ef(),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===eU.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new rU.AwsClient(e):e.credential_source?.executable?new nU.PluggableAuthClient(e):new tU.IdentityPoolClient(e):null}};yc.ExternalAccountClient=bf});var $f=M(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.ExternalAccountAuthorizedUserClient=vi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var $S=Xt(),RS=Yp(),OS=pt(),oU=require("stream"),iU=Bn();vi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var sU="https://sts.{universeDomain}/v1/oauthtoken",If=class t extends RS.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})};$S.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let i=await this.transporter.request(n),a=i.data;return a.res=i,a}catch(i){throw i instanceof OS.GaxiosError&&i.response?(0,RS.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},Rf=class extends $S.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 If({tokenRefreshEndpoint:e.token_url??sU.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=iU.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=OS.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let a=i.response;if(a){let f=a.status,m=a.config.data instanceof oU.Readable;if(!r&&(f===401||f===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};vi.ExternalAccountAuthorizedUserClient=Rf});var zS=M($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.GoogleAuth=$r.GoogleAuthExceptionMessages=void 0;var aU=require("child_process"),Ds=require("fs"),uU=pt(),Cs=vs(),cU=require("os"),Of=require("path"),lU=_s(),dU=Sp(),pU=Ep(),fU=bp(),_i=Gp(),DS=Wp(),Pi=Kp(),mU=Af(),Ns=Bn(),Df=Xt(),CS=$f(),NS=br();$r.GoogleAuthExceptionMessages={API_KEY_WITH_CREDENTIALS:"API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.",NO_PROJECT_ID_FOUND:`Unable to detect a Project Id in the current environment.
|
|
50
|
+
To learn more about authentication and Google APIs, visit:
|
|
51
|
+
https://cloud.google.com/docs/authentication/getting-started`,NO_CREDENTIALS_FOUND:`Unable to find credentials in current environment.
|
|
52
|
+
To learn more about authentication and Google APIs, visit:
|
|
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
|
+
To learn more about Universe Domain retrieval, visit:
|
|
55
|
+
https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var Cf=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($r.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);e.universeDomain&&(this.clientOptions.universeDomain=e.universeDomain)}setGapicJWTValues(e){e.defaultServicePath=this.defaultServicePath,e.useJWTAccessWithScope=this.useJWTAccessWithScope,e.defaultScopes=this.defaultScopes}getProjectId(e){if(e)this.getProjectIdAsync().then(r=>e(null,r),e);else return this.getProjectIdAsync()}async getProjectIdOptional(){try{return await this.getProjectId()}catch(e){if(e instanceof Error&&e.message===$r.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)return null;throw e}}async findAndCacheProjectId(){let e=null;if(e||=await this.getProductionProjectId(),e||=await this.getFileProjectId(),e||=await this.getDefaultServiceProjectId(),e||=await this.getGCEProjectId(),e||=await this.getExternalAccountClientProjectId(),e)return this._cachedProjectId=e,e;throw new Error($r.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)}async getProjectIdAsync(){return this._cachedProjectId?this._cachedProjectId:(this._findProjectIdPromise||(this._findProjectIdPromise=this.findAndCacheProjectId()),this._findProjectIdPromise)}async getUniverseDomainFromMetadataServer(){let e;try{e=await Cs.universe("universe-domain"),e||=Df.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Df.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,NS.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Df.DEFAULT_UNIVERSE}return e}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(e={},r){let n;if(typeof e=="function"?r=e:n=e,r)this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r);else return this.getApplicationDefaultAsync(n)}async getApplicationDefaultAsync(e={}){if(this.cachedCredential)return await this.#t(this.cachedCredential,null);let r;if(r=await this._tryGetApplicationCredentialsFromEnvironmentVariable(e),r)return r instanceof _i.JWT?r.scopes=this.scopes:r instanceof Ns.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof _i.JWT?r.scopes=this.scopes:r instanceof Ns.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new dU.Compute(e));throw new Error($r.GoogleAuthExceptionMessages.NO_ADC_FOUND)}async#t(e,r=process.env.GOOGLE_CLOUD_QUOTA_PROJECT||null){let n=await this.getProjectIdOptional();return r&&(e.quotaProjectId=r),this.cachedCredential=e,{credential:e,projectId:n}}async _checkIsGCE(){return this.checkIsGCE===void 0&&(this.checkIsGCE=Cs.getGCPResidency()||await Cs.isAvailable()),this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(e){let r=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials;if(!r||r.length===0)return null;try{return this._getApplicationCredentialsFromFilePath(r,e)}catch(n){throw n instanceof Error&&(n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`),n}}async _tryGetApplicationCredentialsFromWellKnownFile(e){let r=null;if(this._isWindows())r=process.env.APPDATA;else{let i=process.env.HOME;i&&(r=Of.join(i,".config"))}return r&&(r=Of.join(r,"gcloud","application_default_credentials.json"),Ds.existsSync(r)||(r=null)),r?await this._getApplicationCredentialsFromFilePath(r,e):null}async _getApplicationCredentialsFromFilePath(e,r={}){if(!e||e.length===0)throw new Error("The file path is invalid.");try{if(e=Ds.realpathSync(e),!Ds.lstatSync(e).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let n=Ds.createReadStream(e);return this.fromStream(n,r)}fromImpersonatedJSON(e){if(!e)throw new Error("Must pass in a JSON object containing an impersonated refresh token");if(e.type!==Pi.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${Pi.IMPERSONATED_ACCOUNT_TYPE}" type`);if(!e.source_credentials)throw new Error("The incoming JSON object does not contain a source_credentials field");if(!e.service_account_impersonation_url)throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field");let r=this.fromJSON(e.source_credentials);if(e.service_account_impersonation_url?.length>256)throw new RangeError(`Target principal is too long: ${e.service_account_impersonation_url}`);let n=/(?<target>[^/]+):(generateAccessToken|generateIdToken)$/.exec(e.service_account_impersonation_url)?.groups?.target;if(!n)throw new RangeError(`Cannot extract target principal from ${e.service_account_impersonation_url}`);let i=(this.scopes||e.scopes||this.defaultScopes)??[];return new Pi.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,r={}){let n,i=(0,NS.originalOrCamelOptions)(r).get("universe_domain");return e.type===DS.USER_REFRESH_ACCOUNT_TYPE?(n=new DS.UserRefreshClient(r),n.fromJSON(e)):e.type===Pi.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===Ns.EXTERNAL_ACCOUNT_TYPE?(n=mU.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===CS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new CS.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new _i.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),i&&(n.universeDomain=i),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let i={};if(typeof r=="function"?n=r:i=r,n)this.fromStreamAsync(e,i).then(a=>n(null,a),n);else return this.fromStreamAsync(e,i)}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let a=[];e.setEncoding("utf8").on("error",i).on("data",f=>a.push(f)).on("end",()=>{try{try{let f=JSON.parse(a.join("")),m=this._cacheClientFromJSON(f,r);return n(m)}catch(f){if(!this.keyFilename)throw f;let m=new _i.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=m,this.setGapicJWTValues(m),n(m)}}catch(f){return i(f)}})})}fromAPIKey(e,r={}){return new _i.JWT({...r,apiKey:e})}_isWindows(){let e=cU.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,aU.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n)try{let i=JSON.parse(n).configuration.properties.core.project;e(i);return}catch{}e(null)})})}getProductionProjectId(){return process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project}async getFileProjectId(){if(this.cachedCredential)return this.cachedCredential.projectId;if(this.keyFilename){let r=await this.getClient();if(r&&r.projectId)return r.projectId}let e=await this._tryGetApplicationCredentialsFromEnvironmentVariable();return e?e.projectId:null}async getExternalAccountClientProjectId(){return!this.jsonContent||this.jsonContent.type!==Ns.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await Cs.project("project-id")}catch{return null}}getCredentials(e){if(e)this.getCredentialsAsync().then(r=>e(null,r),e);else return this.getCredentialsAsync()}async getCredentialsAsync(){let e=await this.getClient();if(e instanceof Pi.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof Ns.BaseExternalAccountClient){let r=e.getServiceAccountEmail();if(r)return{client_email:r,universe_domain:e.universeDomain}}if(this.jsonContent)return{client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key,universe_domain:this.jsonContent.universe_domain};if(await this._checkIsGCE()){let[r,n]=await Promise.all([Cs.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error($r.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND)}async getClient(){if(this.cachedCredential)return this.cachedCredential;this.#e=this.#e||this.#r();try{return await this.#e}finally{this.#e=null}}async#r(){if(this.jsonContent)return this._cacheClientFromJSON(this.jsonContent,this.clientOptions);if(this.keyFilename){let e=Of.resolve(this.keyFilename),r=Ds.createReadStream(e);return await this.fromStreamAsync(r,this.clientOptions)}else if(this.apiKey){let e=await this.fromAPIKey(this.apiKey,this.clientOptions);e.scopes=this.scopes;let{credential:r}=await this.#t(e);return r}else{let{credential:e}=await this.getApplicationDefaultAsync(this.clientOptions);return e}}async getIdTokenClient(e){let r=await this.getClient();if(!("fetchIdToken"in r))throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.");return new pU.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=uU.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,fU.getEnv)()}async sign(e,r){let n=await this.getClient(),i=await this.getUniverseDomain();if(r=r||`https://iamcredentials.${i}/v1/projects/-/serviceAccounts/`,n instanceof Pi.Impersonated)return(await n.sign(e)).signedBlob;let a=(0,lU.createCrypto)();if(n instanceof _i.JWT&&n.key)return await a.sign(n.key,e);let f=await this.getCredentials();if(!f.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(a,f.client_email,e,r)}async signBlob(e,r,n,i){let a=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:a.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};$r.GoogleAuth=Cf});var US=M(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.IAMAuth=void 0;var Nf=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}}};vc.IAMAuth=Nf});var kS=M(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.DownscopedClient=Gr.EXPIRATION_TIME_OFFSET=Gr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var hU=pt(),gU=require("stream"),zf=Xt(),yU=Xu(),vU="urn:ietf:params:oauth:grant-type:token-exchange",_U="urn:ietf:params:oauth:token-type:access_token",PU="urn:ietf:params:oauth:token-type:access_token";Gr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Gr.EXPIRATION_TIME_OFFSET=5*60*1e3;var Uf=class extends zf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof zf.AuthClient?{}:e),e instanceof zf.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>Gr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Gr.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 yU.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=hU.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let a=i.response;if(a){let f=a.status,m=a.config.data instanceof gU.Readable;if(!r&&(f===401||f===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:vU,requestedTokenType:_U,subjectToken:e,subjectTokenType:PU},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),i=this.authClient.credentials?.expiry_date||null,a=n.expires_in?new Date().getTime()+n.expires_in*1e3:i;return this.cachedDownscopedAccessToken={access_token:n.access_token,expiry_date:a,res:n.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};Gr.DownscopedClient=Uf});var jS=M(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.PassThroughClient=void 0;var wU=Xt(),kf=class extends wU.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};_c.PassThroughClient=kf});var zs=M(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.GoogleAuth=ce.auth=ce.PassThroughClient=ce.ExternalAccountAuthorizedUserClient=ce.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=ce.ExecutableError=ce.PluggableAuthClient=ce.DownscopedClient=ce.BaseExternalAccountClient=ce.ExternalAccountClient=ce.IdentityPoolClient=ce.AwsRequestSigner=ce.AwsClient=ce.UserRefreshClient=ce.LoginTicket=ce.ClientAuthentication=ce.OAuth2Client=ce.CodeChallengeMethod=ce.Impersonated=ce.JWT=ce.JWTAccess=ce.IdTokenClient=ce.IAMAuth=ce.GCPEnv=ce.Compute=ce.DEFAULT_UNIVERSE=ce.AuthClient=ce.gaxios=ce.gcpMetadata=void 0;var MS=zS();Object.defineProperty(ce,"GoogleAuth",{enumerable:!0,get:o(function(){return MS.GoogleAuth},"get")});ce.gcpMetadata=vs();ce.gaxios=pt();var FS=Xt();Object.defineProperty(ce,"AuthClient",{enumerable:!0,get:o(function(){return FS.AuthClient},"get")});Object.defineProperty(ce,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return FS.DEFAULT_UNIVERSE},"get")});var xU=Sp();Object.defineProperty(ce,"Compute",{enumerable:!0,get:o(function(){return xU.Compute},"get")});var SU=bp();Object.defineProperty(ce,"GCPEnv",{enumerable:!0,get:o(function(){return SU.GCPEnv},"get")});var TU=US();Object.defineProperty(ce,"IAMAuth",{enumerable:!0,get:o(function(){return TU.IAMAuth},"get")});var EU=Ep();Object.defineProperty(ce,"IdTokenClient",{enumerable:!0,get:o(function(){return EU.IdTokenClient},"get")});var bU=Bp();Object.defineProperty(ce,"JWTAccess",{enumerable:!0,get:o(function(){return bU.JWTAccess},"get")});var AU=Gp();Object.defineProperty(ce,"JWT",{enumerable:!0,get:o(function(){return AU.JWT},"get")});var IU=Kp();Object.defineProperty(ce,"Impersonated",{enumerable:!0,get:o(function(){return IU.Impersonated},"get")});var jf=go();Object.defineProperty(ce,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return jf.CodeChallengeMethod},"get")});Object.defineProperty(ce,"OAuth2Client",{enumerable:!0,get:o(function(){return jf.OAuth2Client},"get")});Object.defineProperty(ce,"ClientAuthentication",{enumerable:!0,get:o(function(){return jf.ClientAuthentication},"get")});var RU=_p();Object.defineProperty(ce,"LoginTicket",{enumerable:!0,get:o(function(){return RU.LoginTicket},"get")});var $U=Wp();Object.defineProperty(ce,"UserRefreshClient",{enumerable:!0,get:o(function(){return $U.UserRefreshClient},"get")});var OU=hf();Object.defineProperty(ce,"AwsClient",{enumerable:!0,get:o(function(){return OU.AwsClient},"get")});var DU=pf();Object.defineProperty(ce,"AwsRequestSigner",{enumerable:!0,get:o(function(){return DU.AwsRequestSigner},"get")});var CU=lf();Object.defineProperty(ce,"IdentityPoolClient",{enumerable:!0,get:o(function(){return CU.IdentityPoolClient},"get")});var NU=Af();Object.defineProperty(ce,"ExternalAccountClient",{enumerable:!0,get:o(function(){return NU.ExternalAccountClient},"get")});var zU=Bn();Object.defineProperty(ce,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return zU.BaseExternalAccountClient},"get")});var UU=kS();Object.defineProperty(ce,"DownscopedClient",{enumerable:!0,get:o(function(){return UU.DownscopedClient},"get")});var LS=Ef();Object.defineProperty(ce,"PluggableAuthClient",{enumerable:!0,get:o(function(){return LS.PluggableAuthClient},"get")});Object.defineProperty(ce,"ExecutableError",{enumerable:!0,get:o(function(){return LS.ExecutableError},"get")});var qS=$f();Object.defineProperty(ce,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return qS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(ce,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return qS.ExternalAccountAuthorizedUserClient},"get")});var kU=jS();Object.defineProperty(ce,"PassThroughClient",{enumerable:!0,get:o(function(){return kU.PassThroughClient},"get")});var jU=new MS.GoogleAuth;ce.auth=jU});var VS=M(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.getAPI=MU;function MU(t,e,r,n){let i;if(typeof e=="string")i=e,e={};else if(typeof e=="object")i=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let a=r[i],f=new a(e,n);return Object.freeze(f)}catch(a){throw new Error(`Unable to load endpoint ${t}("${i}"): ${a.message}`)}}o(MU,"getAPI")});var HS=M((MX,GS)=>{GS.exports=require("util").inspect});var Fs=M((FX,pT)=>{var Kf=typeof Map=="function"&&Map.prototype,Ff=Object.getOwnPropertyDescriptor&&Kf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,xc=Kf&&Ff&&typeof Ff.get=="function"?Ff.get:null,WS=Kf&&Map.prototype.forEach,Jf=typeof Set=="function"&&Set.prototype,Lf=Object.getOwnPropertyDescriptor&&Jf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Sc=Jf&&Lf&&typeof Lf.get=="function"?Lf.get:null,ZS=Jf&&Set.prototype.forEach,FU=typeof WeakMap=="function"&&WeakMap.prototype,ks=FU?WeakMap.prototype.has:null,LU=typeof WeakSet=="function"&&WeakSet.prototype,js=LU?WeakSet.prototype.has:null,qU=typeof WeakRef=="function"&&WeakRef.prototype,KS=qU?WeakRef.prototype.deref:null,BU=Boolean.prototype.valueOf,VU=Object.prototype.toString,GU=Function.prototype.toString,HU=String.prototype.match,Yf=String.prototype.slice,Vn=String.prototype.replace,WU=String.prototype.toUpperCase,JS=String.prototype.toLowerCase,iT=RegExp.prototype.test,YS=Array.prototype.concat,Hr=Array.prototype.join,ZU=Array.prototype.slice,XS=Math.floor,Vf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,qf=Object.getOwnPropertySymbols,Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,wi=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ms=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===wi||!0)?Symbol.toStringTag:null,sT=Object.prototype.propertyIsEnumerable,QS=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function eT(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||iT.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-XS(-t):XS(t);if(n!==t){var i=String(n),a=Yf.call(e,i.length+1);return Vn.call(i,r,"$&_")+"."+Vn.call(Vn.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Vn.call(e,r,"$&_")}o(eT,"addNumericSeparator");var Hf=HS(),tT=Hf.custom,rT=cT(tT)?tT:null,aT={__proto__:null,double:'"',single:"'"},KU={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};pT.exports=o(function t(e,r,n,i){var a=r||{};if(yn(a,"quoteStyle")&&!yn(aT,a.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(yn(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=yn(a,"customInspect")?a.customInspect:!0;if(typeof f!="boolean"&&f!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(yn(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(yn(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var m=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return dT(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var h=String(e);return m?eT(e,h):h}if(typeof e=="bigint"){var _=String(e)+"n";return m?eT(e,_):_}var P=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=P&&P>0&&typeof e=="object")return Wf(e)?"[Array]":"[Object]";var E=fk(a,n);if(typeof i>"u")i=[];else if(lT(i,e)>=0)return"[Circular]";function S(Z,Q,X){if(Q&&(i=ZU.call(i),i.push(Q)),X){var ie={depth:a.depth};return yn(a,"quoteStyle")&&(ie.quoteStyle=a.quoteStyle),t(Z,ie,n+1,i)}return t(Z,a,n+1,i)}if(o(S,"inspect"),typeof e=="function"&&!nT(e)){var w=ok(e),T=wc(e,S);return"[Function"+(w?": "+w:" (anonymous)")+"]"+(T.length>0?" { "+Hr.call(T,", ")+" }":"")}if(cT(e)){var $=wi?Vn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Gf.call(e);return typeof e=="object"&&!wi?Us($):$}if(lk(e)){for(var b="<"+JS.call(String(e.nodeName)),u=e.attributes||[],p=0;p<u.length;p++)b+=" "+u[p].name+"="+uT(JU(u[p].value),"double",a);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+JS.call(String(e.nodeName))+">",b}if(Wf(e)){if(e.length===0)return"[]";var c=wc(e,S);return E&&!pk(c)?"["+Zf(c,E)+"]":"[ "+Hr.call(c,", ")+" ]"}if(XU(e)){var y=wc(e,S);return!("cause"in Error.prototype)&&"cause"in e&&!sT.call(e,"cause")?"{ ["+String(e)+"] "+Hr.call(YS.call("[cause]: "+S(e.cause),y),", ")+" }":y.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Hr.call(y,", ")+" }"}if(typeof e=="object"&&f){if(rT&&typeof e[rT]=="function"&&Hf)return Hf(e,{depth:P-n});if(f!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ik(e)){var l=[];return WS&&WS.call(e,function(Z,Q){l.push(S(Q,e,!0)+" => "+S(Z,e))}),oT("Map",xc.call(e),l,E)}if(uk(e)){var x=[];return ZS&&ZS.call(e,function(Z){x.push(S(Z,e))}),oT("Set",Sc.call(e),x,E)}if(sk(e))return Bf("WeakMap");if(ck(e))return Bf("WeakSet");if(ak(e))return Bf("WeakRef");if(ek(e))return Us(S(Number(e)));if(rk(e))return Us(S(Vf.call(e)));if(tk(e))return Us(BU.call(e));if(QU(e))return Us(S(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof global<"u"&&e===global)return"{ [object globalThis] }";if(!YU(e)&&!nT(e)){var g=wc(e,S),re=QS?QS(e)===Object.prototype:e instanceof Object||e.constructor===Object,ee=e instanceof Object?"":"null prototype",Te=!re&&Ms&&Object(e)===e&&Ms in e?Yf.call(Gn(e),8,-1):ee?"Object":"",ne=re||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",K=ne+(Te||ee?"["+Hr.call(YS.call([],Te||[],ee||[]),": ")+"] ":"");return g.length===0?K+"{}":E?K+"{"+Zf(g,E)+"}":K+"{ "+Hr.call(g,", ")+" }"}return String(e)},"inspect_");function uT(t,e,r){var n=r.quoteStyle||e,i=aT[n];return i+t+i}o(uT,"wrapQuotes");function JU(t){return Vn.call(String(t),/"/g,""")}o(JU,"quote");function vo(t){return!Ms||!(typeof t=="object"&&(Ms in t||typeof t[Ms]<"u"))}o(vo,"canTrustToString");function Wf(t){return Gn(t)==="[object Array]"&&vo(t)}o(Wf,"isArray");function YU(t){return Gn(t)==="[object Date]"&&vo(t)}o(YU,"isDate");function nT(t){return Gn(t)==="[object RegExp]"&&vo(t)}o(nT,"isRegExp");function XU(t){return Gn(t)==="[object Error]"&&vo(t)}o(XU,"isError");function QU(t){return Gn(t)==="[object String]"&&vo(t)}o(QU,"isString");function ek(t){return Gn(t)==="[object Number]"&&vo(t)}o(ek,"isNumber");function tk(t){return Gn(t)==="[object Boolean]"&&vo(t)}o(tk,"isBoolean");function cT(t){if(wi)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Gf)return!1;try{return Gf.call(t),!0}catch{}return!1}o(cT,"isSymbol");function rk(t){if(!t||typeof t!="object"||!Vf)return!1;try{return Vf.call(t),!0}catch{}return!1}o(rk,"isBigInt");var nk=Object.prototype.hasOwnProperty||function(t){return t in this};function yn(t,e){return nk.call(t,e)}o(yn,"has");function Gn(t){return VU.call(t)}o(Gn,"toStr");function ok(t){if(t.name)return t.name;var e=HU.call(GU.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(ok,"nameOf");function lT(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(lT,"indexOf");function ik(t){if(!xc||!t||typeof t!="object")return!1;try{xc.call(t);try{Sc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(ik,"isMap");function sk(t){if(!ks||!t||typeof t!="object")return!1;try{ks.call(t,ks);try{js.call(t,js)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(sk,"isWeakMap");function ak(t){if(!KS||!t||typeof t!="object")return!1;try{return KS.call(t),!0}catch{}return!1}o(ak,"isWeakRef");function uk(t){if(!Sc||!t||typeof t!="object")return!1;try{Sc.call(t);try{xc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(uk,"isSet");function ck(t){if(!js||!t||typeof t!="object")return!1;try{js.call(t,js);try{ks.call(t,ks)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(ck,"isWeakSet");function lk(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(lk,"isElement");function dT(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return dT(Yf.call(t,0,e.maxStringLength),e)+n}var i=KU[e.quoteStyle||"single"];i.lastIndex=0;var a=Vn.call(Vn.call(t,i,"\\$1"),/[\x00-\x1f]/g,dk);return uT(a,"single",e)}o(dT,"inspectString");function dk(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":"")+WU.call(e.toString(16))}o(dk,"lowbyte");function Us(t){return"Object("+t+")"}o(Us,"markBoxed");function Bf(t){return t+" { ? }"}o(Bf,"weakCollectionOf");function oT(t,e,r,n){var i=n?Zf(r,n):Hr.call(r,", ");return t+" ("+e+") {"+i+"}"}o(oT,"collectionOf");function pk(t){for(var e=0;e<t.length;e++)if(lT(t[e],`
|
|
56
|
+
`)>=0)return!1;return!0}o(pk,"singleLineValues");function fk(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Hr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Hr.call(Array(e+1),r)}}o(fk,"getIndent");function Zf(t,e){if(t.length===0)return"";var r=`
|
|
57
|
+
`+e.prev+e.base;return r+Hr.call(t,","+r)+`
|
|
58
|
+
`+e.prev}o(Zf,"indentedJoin");function wc(t,e){var r=Wf(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=yn(t,i)?e(t[i],t):""}var a=typeof qf=="function"?qf(t):[],f;if(wi){f={};for(var m=0;m<a.length;m++)f["$"+a[m]]=a[m]}for(var h in t)yn(t,h)&&(r&&String(Number(h))===h&&h<t.length||wi&&f["$"+h]instanceof Symbol||(iT.call(/[^\w$]/,h)?n.push(e(h,t)+": "+e(t[h],t)):n.push(h+": "+e(t[h],t))));if(typeof qf=="function")for(var _=0;_<a.length;_++)sT.call(t,a[_])&&n.push("["+e(a[_])+"]: "+e(t[a[_]],t));return n}o(wc,"arrObjKeys")});var mT=M((qX,fT)=>{"use strict";var mk=Fs(),hk=Nn(),Tc=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"),gk=o(function(t,e){if(t){var r=Tc(t,e);return r&&r.value}},"listGet"),yk=o(function(t,e,r){var n=Tc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),vk=o(function(t,e){return t?!!Tc(t,e):!1},"listHas"),_k=o(function(t,e){if(t)return Tc(t,e,!0)},"listDelete");fT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new hk("Side channel does not contain "+mk(n))},"assert"),delete:o(function(n){var i=_k(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return gk(e,n)},"get"),has:o(function(n){return vk(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),yk(e,n,i)},"set")};return r},"getSideChannelList")});var Xf=M((VX,yT)=>{"use strict";var hT=ns(),gT=pd(),Pk=gT([hT("%String.prototype.indexOf%")]);yT.exports=o(function(e,r){var n=hT(e,!!r);return typeof n=="function"&&Pk(e,".prototype.")>-1?gT([n]):n},"callBoundIntrinsic")});var Qf=M((HX,_T)=>{"use strict";var wk=ns(),Ls=Xf(),xk=Fs(),Sk=Nn(),vT=wk("%Map%",!0),Tk=Ls("Map.prototype.get",!0),Ek=Ls("Map.prototype.set",!0),bk=Ls("Map.prototype.has",!0),Ak=Ls("Map.prototype.delete",!0),Ik=Ls("Map.prototype.size",!0);_T.exports=!!vT&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new Sk("Side channel does not contain "+xk(n))},"assert"),delete:o(function(n){if(e){var i=Ak(e,n);return Ik(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return Tk(e,n)},"get"),has:o(function(n){return e?bk(e,n):!1},"has"),set:o(function(n,i){e||(e=new vT),Ek(e,n,i)},"set")};return r},"getSideChannelMap")});var wT=M((ZX,PT)=>{"use strict";var Rk=ns(),bc=Xf(),$k=Fs(),Ec=Qf(),Ok=Nn(),xi=Rk("%WeakMap%",!0),Dk=bc("WeakMap.prototype.get",!0),Ck=bc("WeakMap.prototype.set",!0),Nk=bc("WeakMap.prototype.has",!0),zk=bc("WeakMap.prototype.delete",!0);PT.exports=xi?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new Ok("Side channel does not contain "+$k(i))},"assert"),delete:o(function(i){if(xi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return zk(e,i)}else if(Ec&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return xi&&i&&(typeof i=="object"||typeof i=="function")&&e?Dk(e,i):r&&r.get(i)},"get"),has:o(function(i){return xi&&i&&(typeof i=="object"||typeof i=="function")&&e?Nk(e,i):!!r&&r.has(i)},"has"),set:o(function(i,a){xi&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new xi),Ck(e,i,a)):Ec&&(r||(r=Ec()),r.set(i,a))},"set")};return n},"getSideChannelWeakMap"):Ec});var em=M((JX,xT)=>{"use strict";var Uk=Nn(),kk=Fs(),jk=mT(),Mk=Qf(),Fk=wT(),Lk=Fk||Mk||jk;xT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new Uk("Side channel does not contain "+kk(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=Lk()),e.set(n,i)},"set")};return r},"getSideChannel")});var Ac=M((XX,ST)=>{"use strict";var qk=String.prototype.replace,Bk=/%20/g,tm={RFC1738:"RFC1738",RFC3986:"RFC3986"};ST.exports={default:tm.RFC3986,formatters:{RFC1738:o(function(t){return qk.call(t,Bk,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:tm.RFC1738,RFC3986:tm.RFC3986}});var im=M((e7,TT)=>{"use strict";var Vk=Ac(),Gk=em(),rm=Object.prototype.hasOwnProperty,_o=Array.isArray,Ic=Gk(),Si=o(function(e,r){return Ic.set(e,r),e},"markOverflow"),Po=o(function(e){return Ic.has(e)},"isOverflow"),qs=o(function(e){return Ic.get(e)},"getMaxIndex"),om=o(function(e,r){Ic.set(e,r)},"setMaxIndex"),Wr=function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t}(),Hk=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(_o(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&(i[i.length]=n[a]);r.obj[r.prop]=i}}},"compactQueue"),Bs=o(function(e,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},"arrayToObject"),Wk=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(_o(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return Si(Bs(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(Po(e)){var a=qs(e)+1;e[a]=r,om(e,a)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!rm.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(Po(r)){for(var f=Object.keys(r),m=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},h=0;h<f.length;h++){var _=parseInt(f[h],10);m[_+1]=r[f[h]]}return Si(m,qs(r)+1)}var P=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&P.length>n.arrayLimit?Si(Bs(P,n),P.length-1):P}var E=e;return _o(e)&&!_o(r)&&(E=Bs(e,n)),_o(e)&&_o(r)?(r.forEach(function(S,w){if(rm.call(e,w)){var T=e[w];T&&typeof T=="object"&&S&&typeof S=="object"?e[w]=t(T,S,n):e[e.length]=S}else e[w]=S}),e):Object.keys(r).reduce(function(S,w){var T=r[w];if(rm.call(S,w)?S[w]=t(S[w],T,n):S[w]=T,Po(r)&&!Po(S)&&Si(S,qs(r)),Po(S)){var $=parseInt(w,10);String($)===w&&$>=0&&$>qs(S)&&om(S,$)}return S},E)},"merge"),Zk=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),Kk=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"),nm=1024,Jk=o(function(e,r,n,i,a){if(e.length===0)return e;var f=e;if(typeof e=="symbol"?f=Symbol.prototype.toString.call(e):typeof e!="string"&&(f=String(e)),n==="iso-8859-1")return escape(f).replace(/%u[0-9a-f]{4}/gi,function(w){return"%26%23"+parseInt(w.slice(2),16)+"%3B"});for(var m="",h=0;h<f.length;h+=nm){for(var _=f.length>=nm?f.slice(h,h+nm):f,P=[],E=0;E<_.length;++E){var S=_.charCodeAt(E);if(S===45||S===46||S===95||S===126||S>=48&&S<=57||S>=65&&S<=90||S>=97&&S<=122||a===Vk.RFC1738&&(S===40||S===41)){P[P.length]=_.charAt(E);continue}if(S<128){P[P.length]=Wr[S];continue}if(S<2048){P[P.length]=Wr[192|S>>6]+Wr[128|S&63];continue}if(S<55296||S>=57344){P[P.length]=Wr[224|S>>12]+Wr[128|S>>6&63]+Wr[128|S&63];continue}E+=1,S=65536+((S&1023)<<10|_.charCodeAt(E)&1023),P[P.length]=Wr[240|S>>18]+Wr[128|S>>12&63]+Wr[128|S>>6&63]+Wr[128|S&63]}m+=P.join("")}return m},"encode"),Yk=o(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var a=r[i],f=a.obj[a.prop],m=Object.keys(f),h=0;h<m.length;++h){var _=m[h],P=f[_];typeof P=="object"&&P!==null&&n.indexOf(P)===-1&&(r[r.length]={obj:f,prop:_},n[n.length]=P)}return Hk(r),e},"compact"),Xk=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),Qk=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),e1=o(function(e,r,n,i){if(Po(e)){var a=qs(e)+1;return e[a]=r,om(e,a),e}var f=[].concat(e,r);return f.length>n?Si(Bs(f,{plainObjects:i}),f.length-1):f},"combine"),t1=o(function(e,r){if(_o(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");TT.exports={arrayToObject:Bs,assign:Zk,combine:e1,compact:Yk,decode:Kk,encode:Jk,isBuffer:Qk,isOverflow:Po,isRegExp:Xk,markOverflow:Si,maybeMap:t1,merge:Wk}});var $T=M((r7,RT)=>{"use strict";var bT=em(),Rc=im(),Vs=Ac(),r1=Object.prototype.hasOwnProperty,AT={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")},Zr=Array.isArray,n1=Array.prototype.push,IT=o(function(t,e){n1.apply(t,Zr(e)?e:[e])},"pushToArray"),o1=Date.prototype.toISOString,ET=Vs.default,vt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Rc.encode,encodeValuesOnly:!1,filter:void 0,format:ET,formatter:Vs.formatters[ET],indices:!1,serializeDate:o(function(e){return o1.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},i1=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),sm={},s1=o(function t(e,r,n,i,a,f,m,h,_,P,E,S,w,T,$,b,u,p){for(var c=e,y=p,l=0,x=!1;(y=y.get(sm))!==void 0&&!x;){var g=y.get(e);if(l+=1,typeof g<"u"){if(g===l)throw new RangeError("Cyclic object value");x=!0}typeof y.get(sm)>"u"&&(l=0)}if(typeof P=="function"?c=P(r,c):c instanceof Date?c=w(c):n==="comma"&&Zr(c)&&(c=Rc.maybeMap(c,function(He){return He instanceof Date?w(He):He})),c===null){if(f)return _&&!b?_(r,vt.encoder,u,"key",T):r;c=""}if(i1(c)||Rc.isBuffer(c)){if(_){var re=b?r:_(r,vt.encoder,u,"key",T);return[$(re)+"="+$(_(c,vt.encoder,u,"value",T))]}return[$(r)+"="+$(String(c))]}var ee=[];if(typeof c>"u")return ee;var Te;if(n==="comma"&&Zr(c))b&&_&&(c=Rc.maybeMap(c,_)),Te=[{value:c.length>0?c.join(",")||null:void 0}];else if(Zr(P))Te=P;else{var ne=Object.keys(c);Te=E?ne.sort(E):ne}var K=h?String(r).replace(/\./g,"%2E"):String(r),Z=i&&Zr(c)&&c.length===1?K+"[]":K;if(a&&Zr(c)&&c.length===0)return Z+"[]";for(var Q=0;Q<Te.length;++Q){var X=Te[Q],ie=typeof X=="object"&&X&&typeof X.value<"u"?X.value:c[X];if(!(m&&ie===null)){var ae=S&&h?String(X).replace(/\./g,"%2E"):String(X),Ie=Zr(c)?typeof n=="function"?n(Z,ae):Z:Z+(S?"."+ae:"["+ae+"]");p.set(e,l);var De=bT();De.set(sm,p),IT(ee,t(ie,Ie,n,i,a,f,m,h,n==="comma"&&b&&Zr(c)?null:_,P,E,S,w,T,$,b,u,De))}}return ee},"stringify"),a1=o(function(e){if(!e)return vt;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||vt.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Vs.default;if(typeof e.format<"u"){if(!r1.call(Vs.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Vs.formatters[n],a=vt.filter;(typeof e.filter=="function"||Zr(e.filter))&&(a=e.filter);var f;if(e.arrayFormat in AT?f=e.arrayFormat:"indices"in e?f=e.indices?"indices":"repeat":f=vt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var m=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:vt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:vt.addQueryPrefix,allowDots:m,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:vt.allowEmptyArrays,arrayFormat:f,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:vt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?vt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:vt.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:vt.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:vt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:vt.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:vt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:vt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:vt.strictNullHandling}},"normalizeStringifyOptions");RT.exports=function(t,e){var r=t,n=a1(e),i,a;typeof n.filter=="function"?(a=n.filter,r=a("",r)):Zr(n.filter)&&(a=n.filter,i=a);var f=[];if(typeof r!="object"||r===null)return"";var m=AT[n.arrayFormat],h=m==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var _=bT(),P=0;P<i.length;++P){var E=i[P],S=r[E];n.skipNulls&&S===null||IT(f,s1(S,E,m,h,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,_))}var w=f.join(n.delimiter),T=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?T+="utf8=%26%2310003%3B&":T+="utf8=%E2%9C%93&"),w.length>0?T+w:""}});var CT=M((o7,DT)=>{"use strict";var Kr=im(),$c=Object.prototype.hasOwnProperty,am=Array.isArray,it={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Kr.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},u1=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),OT=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"),c1="utf8=%26%2310003%3B",l1="utf8=%E2%9C%93",d1=o(function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=r.parameterLimit===1/0?void 0:r.parameterLimit,f=i.split(r.delimiter,r.throwOnLimitExceeded&&typeof a<"u"?a+1:a);if(r.throwOnLimitExceeded&&typeof a<"u"&&f.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(a===1?"":"s")+" allowed.");var m=-1,h,_=r.charset;if(r.charsetSentinel)for(h=0;h<f.length;++h)f[h].indexOf("utf8=")===0&&(f[h]===l1?_="utf-8":f[h]===c1&&(_="iso-8859-1"),m=h,h=f.length);for(h=0;h<f.length;++h)if(h!==m){var P=f[h],E=P.indexOf("]="),S=E===-1?P.indexOf("="):E+1,w,T;if(S===-1?(w=r.decoder(P,it.decoder,_,"key"),T=r.strictNullHandling?null:""):(w=r.decoder(P.slice(0,S),it.decoder,_,"key"),w!==null&&(T=Kr.maybeMap(OT(P.slice(S+1),r,am(n[w])?n[w].length:0),function(b){return r.decoder(b,it.decoder,_,"value")}))),T&&r.interpretNumericEntities&&_==="iso-8859-1"&&(T=u1(String(T))),P.indexOf("[]=")>-1&&(T=am(T)?[T]:T),r.comma&&am(T)&&T.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");T=Kr.combine([],T,r.arrayLimit,r.plainObjects)}if(w!==null){var $=$c.call(n,w);$&&(r.duplicates==="combine"||P.indexOf("[]=")>-1)?n[w]=Kr.combine(n[w],T,r.arrayLimit,r.plainObjects):(!$||r.duplicates==="last")&&(n[w]=T)}}return n},"parseQueryStringValues"),p1=o(function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var a=t.slice(0,-1).join("");i=Array.isArray(e)&&e[a]?e[a].length:0}for(var f=n?e:OT(e,r,i),m=t.length-1;m>=0;--m){var h,_=t[m];if(_==="[]"&&r.parseArrays)Kr.isOverflow(f)?h=f:h=r.allowEmptyArrays&&(f===""||r.strictNullHandling&&f===null)?[]:Kr.combine([],f,r.arrayLimit,r.plainObjects);else{h=r.plainObjects?{__proto__:null}:{};var P=_.charAt(0)==="["&&_.charAt(_.length-1)==="]"?_.slice(1,-1):_,E=r.decodeDotInKeys?P.replace(/%2E/g,"."):P,S=parseInt(E,10),w=!isNaN(S)&&_!==E&&String(S)===E&&S>=0&&r.parseArrays;if(!r.parseArrays&&E==="")h={0:f};else if(w&&S<r.arrayLimit)h=[],h[S]=f;else{if(w&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");w?(h[S]=f,Kr.markOverflow(h,S)):E!=="__proto__"&&(h[E]=f)}}f=h}return f},"parseObject"),f1=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&$c.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,f=i.exec(n),m=f?n.slice(0,f.index):n,h=[];if(m){if(!r.plainObjects&&$c.call(Object.prototype,m)&&!r.allowPrototypes)return;h[h.length]=m}for(var _=0;(f=a.exec(n))!==null&&_<r.depth;){_+=1;var P=f[1].slice(1,-1);if(!r.plainObjects&&$c.call(Object.prototype,P)&&!r.allowPrototypes)return;h[h.length]=f[1]}if(f){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");h[h.length]="["+n.slice(f.index)+"]"}return h},"splitKeyIntoSegments"),m1=o(function(e,r,n,i){if(e){var a=f1(e,n);if(a)return p1(a,r,n,i)}},"parseQueryStringKeys"),h1=o(function(e){if(!e)return it;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof e.charset>"u"?it.charset:e.charset,n=typeof e.duplicates>"u"?it.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var i=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:it.allowDots:!!e.allowDots;return{allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:it.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:it.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:it.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:it.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:it.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:it.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:it.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:it.decoder,delimiter:typeof e.delimiter=="string"||Kr.isRegExp(e.delimiter)?e.delimiter:it.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:it.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:it.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:it.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:it.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:it.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:it.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:it.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");DT.exports=function(t,e){var r=h1(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?d1(t,r):t,i=r.plainObjects?{__proto__:null}:{},a=Object.keys(n),f=0;f<a.length;++f){var m=a[f],h=m1(m,n[m],r,typeof t=="string");i=Kr.merge(i,h,r)}return r.allowSparse===!0?i:Kr.compact(i)}});var um=M((s7,NT)=>{"use strict";var g1=$T(),y1=CT(),v1=Ac();NT.exports={formats:v1,parse:y1,stringify:g1}});var UT=M((cm,zT)=>{(function(t,e){typeof cm=="object"?zT.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(cm,function(){function t(){}return o(t,"UrlTemplate"),t.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(r){return/%[0-9A-Fa-f]/.test(r)||(r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")),r}).join("")},t.prototype.encodeUnreserved=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})},t.prototype.encodeValue=function(e,r,n){return r=e==="+"||e==="#"?this.encodeReserved(r):this.encodeUnreserved(r),n?this.encodeUnreserved(n)+"="+r:r},t.prototype.isDefined=function(e){return e!=null},t.prototype.isKeyOperator=function(e){return e===";"||e==="&"||e==="?"},t.prototype.getValues=function(e,r,n,i){var a=e[n],f=[];if(this.isDefined(a)&&a!=="")if(typeof a=="string"||typeof a=="number"||typeof a=="boolean")a=a.toString(),i&&i!=="*"&&(a=a.substring(0,parseInt(i,10))),f.push(this.encodeValue(r,a,this.isKeyOperator(r)?n:null));else if(i==="*")Array.isArray(a)?a.filter(this.isDefined).forEach(function(h){f.push(this.encodeValue(r,h,this.isKeyOperator(r)?n:null))},this):Object.keys(a).forEach(function(h){this.isDefined(a[h])&&f.push(this.encodeValue(r,a[h],h))},this);else{var m=[];Array.isArray(a)?a.filter(this.isDefined).forEach(function(h){m.push(this.encodeValue(r,h))},this):Object.keys(a).forEach(function(h){this.isDefined(a[h])&&(m.push(this.encodeUnreserved(h)),m.push(this.encodeValue(r,a[h].toString())))},this),this.isKeyOperator(r)?f.push(this.encodeUnreserved(n)+"="+m.join(",")):m.length!==0&&f.push(m.join(","))}else r===";"?this.isDefined(a)&&f.push(this.encodeUnreserved(n)):a===""&&(r==="&"||r==="?")?f.push(this.encodeUnreserved(n)+"="):a===""&&f.push("");return f},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:o(function(i){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(a,f,m){if(f){var h=null,_=[];if(n.indexOf(f.charAt(0))!==-1&&(h=f.charAt(0),f=f.substr(1)),f.split(/,/g).forEach(function(E){var S=/([^:\*]*)(?::(\d+)|(\*))?/.exec(E);_.push.apply(_,r.getValues(i,h,S[1],S[2]||S[3]))}),h&&h!=="+"){var P=",";return h==="?"?P="&":h!=="#"&&(P=h),(_.length!==0?h:"")+_.join(P)}else return _.join(",")}else return r.encodeReserved(m)})},"expand")}},new t})});var kT=M(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.isBrowser=_1;function _1(){return typeof window<"u"}o(_1,"isBrowser")});var Dc=M(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.headersToClassicHeaders=jT;Oc.marshallGaxiosResponse=P1;function jT(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(jT,"headersToClassicHeaders");function P1(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:jT(t?.headers)}})}o(P1,"marshallGaxiosResponse")});var LT=M(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.sessions=void 0;nr.request=C1;nr.closeSession=dm;var FT=require("http2"),w1=require("zlib"),x1=require("url"),S1=um(),T1=os(),E1=require("stream"),b1=require("util"),A1=require("process"),I1=Dc(),{HTTP2_HEADER_CONTENT_ENCODING:R1,HTTP2_HEADER_CONTENT_TYPE:MT,HTTP2_HEADER_METHOD:$1,HTTP2_HEADER_PATH:O1,HTTP2_HEADER_STATUS:D1}=FT.constants,Gs=!!A1.env.HTTP2_DEBUG;nr.sessions={};async function C1(t){let e=T1(!0,{},t);e.validateStatus=e.validateStatus||N1,e.responseType=e.responseType||"json";let r=new x1.URL(e.url),n=z1(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let E=(t.paramsSerializer||S1.stringify)(e.params);i+=`?${E}`}let a=(0,I1.headersToClassicHeaders)(e.headers);a[O1]=i,a[$1]=t.method||"GET",e.headers=a,a[MT]||e.responseType!=="text"&&(a[MT]="application/json");let f={config:t,headers:{},status:0,data:{},statusText:""},m=[],h=n.session,_;return new Promise((P,E)=>{try{_=h.request(a).on("response",S=>{Object.assign(f,{headers:S,status:S[D1]});let w=_;if(S[R1]==="gzip"&&(w=_.pipe(w1.createGunzip())),e.responseType==="stream"){f.data=w,P(f);return}w.on("data",T=>{m.push(T)}).on("error",T=>{E(T)}).on("end",()=>{let T=Buffer.concat(m),$=T;if(T){if(e.responseType==="json")try{$=JSON.parse(T.toString("utf8"))}catch{$=T.toString("utf8")}else e.responseType==="text"?$=T.toString("utf8"):e.responseType==="arraybuffer"&&($=T.buffer);f.data=$}if(!e.validateStatus(f.status)){let b=`Request failed with status code ${f.status}. `;if(f.data&&typeof f.data=="object"){let u=b1.inspect(f.data,{depth:5});b=`${b}
|
|
59
|
+
'${u}`}E(new Error(b,{cause:f}))}P(f)})}).on("error",S=>{E(S)})}catch(S){dm(r).then(()=>E(S)).catch(E);return}if(f.request=_,t.data){if(t.data instanceof E1.Stream)t.data.pipe(_);else if(typeof t.data=="string"){let S=Buffer.from(t.data);_.end(S)}else if(typeof t.data=="object"){let S=JSON.stringify(t.data);_.end(S)}}n.timeoutHandle=setTimeout(()=>dm(r),500)})}o(C1,"request");function N1(t){return t>=200&&t<300}o(N1,"validateStatus");function z1(t){if(nr.sessions[t])Gs&&console.log(`Used cached client for ${t}`);else{Gs&&console.log(`Creating client for ${t}`);let e=FT.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete nr.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete nr.sessions[t]}),nr.sessions[t]={session:e}}return nr.sessions[t]}o(z1,"_getClient");async function dm(t){let e=nr.sessions[t.host];if(!e)return;let{session:r}=e;delete nr.sessions[t.host],Gs&&console.error(`Closing ${t.host}`),r.close(()=>{Gs&&console.error(`Closed ${t.host}`)}),setTimeout(()=>{r&&!r.destroyed&&(Gs&&console.log(`Forcing close ${t.host}`),r&&r.destroy())},1e3)}o(dm,"closeSession")});var qT=M((m7,U1)=>{U1.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 Cc=M(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.createAPIRequest=L1;var pm=pt(),k1=um(),WT=require("stream"),BT=UT(),VT=os(),mm=kT(),j1=LT(),fm=Dc(),ZT=qT(),GT=o(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function M1(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}o(M1,"isReadableStream");function F1(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}o(F1,"getMissingParams");function L1(t,e){if(e)HT(t).then(r=>e(null,r),e);else return HT(t)}o(L1,"createAPIRequest");async function HT(t){let e=VT(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=VT(!0,{},e.params,t.params);e.userAgentDirectives=e.userAgentDirectives||[];let n=r.media||{},i=r.requestBody;!r.requestBody&&r.resource&&(!t.requiredParams.includes("resource")||typeof r.resource!="string")&&(i=r.resource,delete r.resource),delete r.requestBody;let a=r.auth||e.auth,f=typeof n.body=="string"?"text/plain":"application/octet-stream";delete r.media,delete r.auth;let m=(0,fm.headersToClassicHeaders)(r.headers||{});q1(m,e.apiVersion),delete r.headers,Object.keys(r).forEach(w=>{if(w.slice(-1)==="_"){let T=w.slice(0,-1);r[T]=r[w],delete r[w]}});let h=F1(r,t.requiredParams);if(h)throw new Error("Missing required parameters: "+h.join(", "));if(e.url){let w=e.url;typeof w=="object"&&(w=w.toString()),e.url=BT.parse(w).expand(r)}if(t.mediaUrl&&(t.mediaUrl=BT.parse(t.mediaUrl).expand(r)),t.context._options.rootUrl!==void 0&&e.url!==void 0){let w=new URL(e.url),T=w.href.substr(w.origin.length);e.url=new URL(T,t.context._options.rootUrl).href}e.paramsSerializer=w=>k1.stringify(w,{arrayFormat:"repeat"}),t.pathParams.forEach(w=>delete r[w]),typeof a=="string"&&(r.key=r.key||a,a=void 0);function _(w){let T=GT(),$=`--${T}--`,b=new WT.PassThrough({flush(c){this.push(`\r
|
|
60
|
+
`),this.push($),c()}}),u=new hm,p=M1(w[1].body);m["content-type"]=`multipart/related; boundary=${T}`;for(let c of w){let y=`--${T}\r
|
|
61
|
+
content-type: ${c["content-type"]}\r
|
|
62
|
+
\r
|
|
63
|
+
`;b.push(y),typeof c.body=="string"?(b.push(c.body),b.push(`\r
|
|
64
|
+
`)):(u.on("progress",l=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:l})}),c.body.pipe(u).pipe(b))}p||(b.push($),b.push(null)),e.data=b}o(_,"multipartUpload");function P(w){let T=GT(),$=`--${T}--`;m["content-type"]=`multipart/related; boundary=${T}`;let b="";for(let u of w){let p=`--${T}\r
|
|
65
|
+
content-type: ${u["content-type"]}\r
|
|
66
|
+
\r
|
|
67
|
+
`;b+=p,typeof u.body=="string"&&(b+=u.body,b+=`\r
|
|
68
|
+
`)}b+=$,e.data=b}if(o(P,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,i){r.uploadType="multipart";let w=[{"content-type":"application/json",body:JSON.stringify(i)},{"content-type":n.mimeType||i&&i.mimeType||f,body:n.body}];(0,mm.isBrowser)()?P(w):_(w)}else r.uploadType="media",Object.assign(m,{"content-type":n.mimeType||f}),e.data=n.body;else e.data=i||void 0;if(e.headers=pm.Gaxios.mergeHeaders(e.headers||{},m),e.params=r,!(0,mm.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:ZT.version,comment:"gzip"});let w=e.userAgentDirectives.map(T=>{let $=`${T.product}/${T.version}`;return T.comment&&($+=` (${T.comment})`),$}).join(" ");e.headers.set("User-Agent",w)}if(e.validateStatus||(e.validateStatus=w=>w>=200&&w<300||w===304),e.retry=e.retry===void 0?!0:e.retry,delete e.auth,e.universeDomain&&e.universe_domain&&e.universeDomain!==e.universe_domain)throw new Error("Please set either universe_domain or universeDomain, but not both.");let E=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,S=e.universeDomain??e.universe_domain??E??"googleapis.com";if(S!=="googleapis.com"&&e.url){let w=new URL(e.url);w.hostname.endsWith(".googleapis.com")&&(w.hostname=w.hostname.replace(/googleapis\.com$/,S),e.url=w.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),a&&typeof a=="object"){let w=typeof a.getUniverseDomain=="function"?await a.getUniverseDomain():void 0;if(w&&S!==w)throw new Error(`The configured universe domain (${S}) does not match the universe domain found in the credentials (${w}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let T=await a.getRequestHeaders(e.url),$=Object.assign({},e);return $.headers=pm.Gaxios.mergeHeaders($.headers,T),j1.request($)}else{let T=await a.request(e);return(0,fm.marshallGaxiosResponse)(T)}}else return new pm.Gaxios().request(e).then(w=>(0,fm.marshallGaxiosResponse)(w))}o(HT,"createAPIRequestAsync");var hm=class extends WT.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 q1(t,e){(0,mm.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${ZT.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o(q1,"populateAPIHeader")});var KT=M(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.AuthPlus=void 0;var vn=zs(),ym=class extends vn.GoogleAuth{static{o(this,"AuthPlus")}JWT=vn.JWT;Compute=vn.Compute;OAuth2=vn.OAuth2Client;GoogleAuth=vn.GoogleAuth;AwsClient=vn.AwsClient;IdentityPoolClient=vn.IdentityPoolClient;ExternalAccountClient=vn.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new vn.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()}};Nc.AuthPlus=ym});var _m=M(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.Endpoint=void 0;var JT=Cc(),vm=class{static{o(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,i){if(this.applyMethodsFromSchema(e,r,n,i),n.resources){for(let a in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,a)){let f=n.resources[a];e[a]||(e[a]={}),this.applySchema(e[a],r,f,i)}}}applyMethodsFromSchema(e,r,n,i){if(n.methods){for(let a in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,a)){let f=n.methods[a];e[a]=this.makeMethod(r,f,i)}}}makeMethod(e,r,n){return(i,a)=>{let f=typeof i=="function"?{}:i;a=typeof i=="function"?i:a;let m=YT(e.rootUrl+e.servicePath+r.path),h={options:{url:m.substring(1,m.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:f,requiredParams:r.parameterOrder||[],pathParams:this.getPathParams(r.parameters),context:n};if(r.mediaUpload&&r.mediaUpload.protocols&&r.mediaUpload.protocols.simple&&r.mediaUpload.protocols.simple.path){let _=YT(e.rootUrl+r.mediaUpload.protocols.simple.path);h.mediaUrl=_.substring(1,_.length-1)}if(!a)return(0,JT.createAPIRequest)(h);(0,JT.createAPIRequest)(h,a)}}getPathParams(e){let r=new Array;return typeof e!="object"&&(e={}),Object.keys(e).forEach(n=>{e[n].location==="path"&&r.push(n)}),r}};zc.Endpoint=vm;function YT(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(YT,"buildurl")});var QT=M(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.Discovery=void 0;var B1=require("fs"),V1=pt(),G1=require("url"),XT=require("util"),H1=Cc(),W1=_m(),Z1=XT.promisify(B1.readFile),Pm=class{static{o(this,"Discovery")}transporter=new V1.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new W1.Endpoint(r);return n.applySchema(n,e,e,n),n}}log(...e){this.options&&this.options.debug&&console.log(...e)}async discoverAllAPIs(e){let r=new Headers(this.options.includePrivate?{}:{"X-User-Ip":"0.0.0.0"}),i=(await this.transporter.request({url:e,headers:r})).data.items,a=await Promise.all(i.map(async h=>{let _=await this.discoverAPI(h.discoveryRestUrl);return{api:h,endpointCreator:_}})),f={},m={};for(let h of a)m[h.api.name]||(f[h.api.name]={},m[h.api.name]=_=>{let P=typeof _,E;if(P==="string")E=_,_={};else if(P==="object")E=_.version,delete _.version;else throw new Error("Argument error: Accepts only string or object");try{let S=h.endpointCreator(_,this);return Object.freeze(S)}catch(S){throw new Error(XT.format('Unable to load endpoint %s("%s"): %s',h.api.name,E,S.message))}}),f[h.api.name][h.api.version]=h.endpointCreator;return m}async discoverAPI(e){if(typeof e=="string"){let r=G1.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await Z1(e,{encoding:"utf8"});return this.makeEndpoint(JSON.parse(n))}else{this.log("Requesting "+e);let n=await this.transporter.request({url:e});return this.makeEndpoint(n.data)}}else{let r=e;this.log("Requesting "+r.url);let n=r.url;delete r.url;let i={options:{url:n,method:"GET"},requiredParams:[],pathParams:[],params:r,context:{google:{_options:{}},_options:{}}},a=await(0,H1.createAPIRequest)(i);return this.makeEndpoint(a.data)}}};Uc.Discovery=Pm});var Hs=M(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]}),J1=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=zs();Ae.gaxios=pt();var _n=zs();Object.defineProperty(Ae,"OAuth2Client",{enumerable:!0,get:o(function(){return _n.OAuth2Client},"get")});Object.defineProperty(Ae,"JWT",{enumerable:!0,get:o(function(){return _n.JWT},"get")});Object.defineProperty(Ae,"Compute",{enumerable:!0,get:o(function(){return _n.Compute},"get")});Object.defineProperty(Ae,"UserRefreshClient",{enumerable:!0,get:o(function(){return _n.UserRefreshClient},"get")});Object.defineProperty(Ae,"GoogleAuth",{enumerable:!0,get:o(function(){return _n.GoogleAuth},"get")});Object.defineProperty(Ae,"ExternalAccountClient",{enumerable:!0,get:o(function(){return _n.ExternalAccountClient},"get")});Object.defineProperty(Ae,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return _n.BaseExternalAccountClient},"get")});Object.defineProperty(Ae,"IdentityPoolClient",{enumerable:!0,get:o(function(){return _n.IdentityPoolClient},"get")});Object.defineProperty(Ae,"AwsClient",{enumerable:!0,get:o(function(){return _n.AwsClient},"get")});var eE=pt();Object.defineProperty(Ae,"Gaxios",{enumerable:!0,get:o(function(){return eE.Gaxios},"get")});Object.defineProperty(Ae,"GaxiosError",{enumerable:!0,get:o(function(){return eE.GaxiosError},"get")});var Y1=VS();Object.defineProperty(Ae,"getAPI",{enumerable:!0,get:o(function(){return Y1.getAPI},"get")});var X1=Cc();Object.defineProperty(Ae,"createAPIRequest",{enumerable:!0,get:o(function(){return X1.createAPIRequest},"get")});var Q1=KT();Object.defineProperty(Ae,"AuthPlus",{enumerable:!0,get:o(function(){return Q1.AuthPlus},"get")});var ej=QT();Object.defineProperty(Ae,"Discovery",{enumerable:!0,get:o(function(){return ej.Discovery},"get")});var tj=_m();Object.defineProperty(Ae,"Endpoint",{enumerable:!0,get:o(function(){return tj.Endpoint},"get")});J1(Dc(),Ae)});var rE=M(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.drive_v2=void 0;var q=Hs(),tE;(function(t){class e{static{o(this,"Drive")}context;about;apps;changes;channels;children;comments;drives;files;parents;permissions;properties;replies;revisions;teamdrives;constructor(u,p){this.context={_options:u||{},google:p},this.about=new r(this.context),this.apps=new n(this.context),this.changes=new i(this.context),this.channels=new a(this.context),this.children=new f(this.context),this.comments=new m(this.context),this.drives=new h(this.context),this.files=new _(this.context),this.parents=new P(this.context),this.permissions=new E(this.context),this.properties=new S(this.context),this.replies=new w(this.context),this.revisions=new T(this.context),this.teamdrives=new $(this.context)}}t.Drive=e;class r{static{o(this,"Resource$About")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/about").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$About=r;class n{static{o(this,"Resource$Apps")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/apps/{appId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["appId"],pathParams:["appId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/apps").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Apps=n;class i{static{o(this,"Resource$Changes")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/changes/{changeId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["changeId"],pathParams:["changeId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}getStartPageToken(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/changes/startPageToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/changes").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}watch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/changes/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Changes=i;class a{static{o(this,"Resource$Channels")}context;constructor(u){this.context=u}stop(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Channels=a;class f{static{o(this,"Resource$Children")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{folderId}/children/{childId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["folderId","childId"],pathParams:["childId","folderId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{folderId}/children/{childId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["folderId","childId"],pathParams:["childId","folderId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{folderId}/children").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["folderId"],pathParams:["folderId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{folderId}/children").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["folderId"],pathParams:["folderId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Children=f;class m{static{o(this,"Resource$Comments")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}patch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Comments=m;class h{static{o(this,"Resource$Drives")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}hide(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives/{driveId}/hide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}unhide(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives/{driveId}/unhide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Drives=h;class _{static{o(this,"Resource$Files")}context;constructor(u){this.context=u}copy(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/copy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}emptyTrash(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/trash").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}export(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/export").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","mimeType"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}generateCseToken(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/generateCseToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}generateIds(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/generateIds").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,mediaUrl:(x+"/upload/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}listLabels(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/listLabels").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}modifyLabels(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/modifyLabels").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}patch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}touch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/touch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}trash(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/trash").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}untrash(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/untrash").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,mediaUrl:(x+"/upload/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}watch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Files=_;class P{static{o(this,"Resource$Parents")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/parents/{parentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","parentId"],pathParams:["fileId","parentId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/parents/{parentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","parentId"],pathParams:["fileId","parentId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/parents").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/parents").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Parents=P;class E{static{o(this,"Resource$Permissions")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}getIdForEmail(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/permissionIds/{email}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["email"],pathParams:["email"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}patch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Permissions=E;class S{static{o(this,"Resource$Properties")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/properties").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/properties").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}patch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Properties=S;class w{static{o(this,"Resource$Replies")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}patch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Replies=w;class T{static{o(this,"Resource$Revisions")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/revisions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}patch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Revisions=T;class ${static{o(this,"Resource$Teamdrives")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}insert(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,q.createAPIRequest)(g,c);else return(0,q.createAPIRequest)(g)}}t.Resource$Teamdrives=$})(tE||(kc.drive_v2=tE={}))});var oE=M(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.drive_v3=void 0;var H=Hs(),nE;(function(t){class e{static{o(this,"Drive")}context;about;accessproposals;approvals;apps;changes;channels;comments;drives;files;operations;permissions;replies;revisions;teamdrives;constructor(u,p){this.context={_options:u||{},google:p},this.about=new r(this.context),this.accessproposals=new n(this.context),this.approvals=new i(this.context),this.apps=new a(this.context),this.changes=new f(this.context),this.channels=new m(this.context),this.comments=new h(this.context),this.drives=new _(this.context),this.files=new P(this.context),this.operations=new E(this.context),this.permissions=new S(this.context),this.replies=new w(this.context),this.revisions=new T(this.context),this.teamdrives=new $(this.context)}}t.Drive=e;class r{static{o(this,"Resource$About")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/about").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$About=r;class n{static{o(this,"Resource$Accessproposals")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/accessproposals/{proposalId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","proposalId"],pathParams:["fileId","proposalId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/accessproposals").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}resolve(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/accessproposals/{proposalId}:resolve").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","proposalId"],pathParams:["fileId","proposalId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Accessproposals=n;class i{static{o(this,"Resource$Approvals")}context;constructor(u){this.context=u}approve(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals/{approvalId}:approve").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}cancel(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals/{approvalId}:cancel").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}comment(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals/{approvalId}:comment").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}decline(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals/{approvalId}:decline").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals/{approvalId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}reassign(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals/{approvalId}:reassign").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}start(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/approvals:start").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Approvals=i;class a{static{o(this,"Resource$Apps")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/apps/{appId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["appId"],pathParams:["appId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/apps").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Apps=a;class f{static{o(this,"Resource$Changes")}context;constructor(u){this.context=u}getStartPageToken(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/changes/startPageToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/changes").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["pageToken"],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}watch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/changes/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["pageToken"],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Changes=f;class m{static{o(this,"Resource$Channels")}context;constructor(u){this.context=u}stop(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Channels=m;class h{static{o(this,"Resource$Comments")}context;constructor(u){this.context=u}create(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Comments=h;class _{static{o(this,"Resource$Drives")}context;constructor(u){this.context=u}create(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}hide(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives/{driveId}/hide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}unhide(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives/{driveId}/unhide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Drives=_;class P{static{o(this,"Resource$Files")}context;constructor(u){this.context=u}copy(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/copy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}create(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,mediaUrl:(x+"/upload/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}download(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/download").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}emptyTrash(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/trash").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}export(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/export").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","mimeType"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}generateCseToken(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/generateCseToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}generateIds(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/generateIds").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}listLabels(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/listLabels").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}modifyLabels(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/modifyLabels").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,mediaUrl:(x+"/upload/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}watch(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Files=P;class E{static{o(this,"Resource$Operations")}context;constructor(u){this.context=u}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/operations/{name}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["name"],pathParams:["name"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Operations=E;class S{static{o(this,"Resource$Permissions")}context;constructor(u){this.context=u}create(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Permissions=S;class w{static{o(this,"Resource$Replies")}context;constructor(u){this.context=u}create(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Replies=w;class T{static{o(this,"Resource$Revisions")}context;constructor(u){this.context=u}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/revisions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Revisions=T;class ${static{o(this,"Resource$Teamdrives")}context;constructor(u){this.context=u}create(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}delete(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}get(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}list(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}update(u,p,c){let y=u||{},l=p||{};typeof u=="function"&&(c=u,y={},l={}),typeof p=="function"&&(c=p,l={});let x=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(x+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,H.createAPIRequest)(g,c);else return(0,H.createAPIRequest)(g)}}t.Resource$Teamdrives=$})(nE||(jc.drive_v3=nE={}))});var or=M(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.AuthPlus=Ft.drive_v3=Ft.drive_v2=Ft.auth=Ft.VERSIONS=void 0;Ft.drive=rj;var iE=Hs(),sE=rE();Object.defineProperty(Ft,"drive_v2",{enumerable:!0,get:o(function(){return sE.drive_v2},"get")});var aE=oE();Object.defineProperty(Ft,"drive_v3",{enumerable:!0,get:o(function(){return aE.drive_v3},"get")});Ft.VERSIONS={v2:sE.drive_v2.Drive,v3:aE.drive_v3.Drive};function rj(t){return(0,iE.getAPI)("drive",t,Ft.VERSIONS,this)}o(rj,"drive");var nj=new iE.AuthPlus;Ft.auth=nj;var oj=Hs();Object.defineProperty(Ft,"AuthPlus",{enumerable:!0,get:o(function(){return oj.AuthPlus},"get")})});var Mc=M((wm,xm)=>{(function(t,e){typeof wm=="object"&&typeof xm<"u"?xm.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(wm,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",a="minute",f="hour",m="day",h="week",_="month",P="quarter",E="year",S="date",w="Invalid Date",T=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,$=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o(function(ne){var K=["th","st","nd","rd"],Z=ne%100;return"["+ne+(K[(Z-20)%10]||K[Z]||K[0])+"]"},"ordinal")},u=o(function(ne,K,Z){var Q=String(ne);return!Q||Q.length>=K?ne:""+Array(K+1-Q.length).join(Z)+ne},"m"),p={s:u,z:o(function(ne){var K=-ne.utcOffset(),Z=Math.abs(K),Q=Math.floor(Z/60),X=Z%60;return(K<=0?"+":"-")+u(Q,2,"0")+":"+u(X,2,"0")},"z"),m:o(function ne(K,Z){if(K.date()<Z.date())return-ne(Z,K);var Q=12*(Z.year()-K.year())+(Z.month()-K.month()),X=K.clone().add(Q,_),ie=Z-X<0,ae=K.clone().add(Q+(ie?-1:1),_);return+(-(Q+(Z-X)/(ie?X-ae:ae-X))||0)},"t"),a:o(function(ne){return ne<0?Math.ceil(ne)||0:Math.floor(ne)},"a"),p:o(function(ne){return{M:_,y:E,w:h,d:m,D:S,h:f,m:a,s:i,ms:n,Q:P}[ne]||String(ne||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(ne){return ne===void 0},"u")},c="en",y={};y[c]=b;var l=o(function(ne){return ne instanceof ee},"p"),x=o(function ne(K,Z,Q){var X;if(!K)return c;if(typeof K=="string"){var ie=K.toLowerCase();y[ie]&&(X=ie),Z&&(y[ie]=Z,X=ie);var ae=K.split("-");if(!X&&ae.length>1)return ne(ae[0])}else{var Ie=K.name;y[Ie]=K,X=Ie}return!Q&&X&&(c=X),X||!Q&&c},"t"),g=o(function(ne,K){if(l(ne))return ne.clone();var Z=typeof K=="object"?K:{};return Z.date=ne,Z.args=arguments,new ee(Z)},"w"),re=p;re.l=x,re.i=l,re.w=function(ne,K){return g(ne,{locale:K.$L,utc:K.$u,x:K.$x,$offset:K.$offset})};var ee=function(){function ne(Z){this.$L=x(Z.locale,null,!0),this.parse(Z)}o(ne,"M");var K=ne.prototype;return K.parse=function(Z){this.$d=function(Q){var X=Q.date,ie=Q.utc;if(X===null)return new Date(NaN);if(re.u(X))return new Date;if(X instanceof Date)return new Date(X);if(typeof X=="string"&&!/Z$/i.test(X)){var ae=X.match(T);if(ae){var Ie=ae[2]-1||0,De=(ae[7]||"0").substring(0,3);return ie?new Date(Date.UTC(ae[1],Ie,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,De)):new Date(ae[1],Ie,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,De)}}return new Date(X)}(Z),this.$x=Z.x||{},this.init()},K.init=function(){var Z=this.$d;this.$y=Z.getFullYear(),this.$M=Z.getMonth(),this.$D=Z.getDate(),this.$W=Z.getDay(),this.$H=Z.getHours(),this.$m=Z.getMinutes(),this.$s=Z.getSeconds(),this.$ms=Z.getMilliseconds()},K.$utils=function(){return re},K.isValid=function(){return this.$d.toString()!==w},K.isSame=function(Z,Q){var X=g(Z);return this.startOf(Q)<=X&&X<=this.endOf(Q)},K.isAfter=function(Z,Q){return g(Z)<this.startOf(Q)},K.isBefore=function(Z,Q){return this.endOf(Q)<g(Z)},K.$g=function(Z,Q,X){return re.u(Z)?this[Q]:this.set(X,Z)},K.unix=function(){return Math.floor(this.valueOf()/1e3)},K.valueOf=function(){return this.$d.getTime()},K.startOf=function(Z,Q){var X=this,ie=!!re.u(Q)||Q,ae=re.p(Z),Ie=o(function(Lt,Ge){var We=re.w(X.$u?Date.UTC(X.$y,Ge,Lt):new Date(X.$y,Ge,Lt),X);return ie?We:We.endOf(m)},"l"),De=o(function(Lt,Ge){return re.w(X.toDate()[Lt].apply(X.toDate("s"),(ie?[0,0,0,0]:[23,59,59,999]).slice(Ge)),X)},"$"),He=this.$W,Xe=this.$M,_t=this.$D,te="set"+(this.$u?"UTC":"");switch(ae){case E:return ie?Ie(1,0):Ie(31,11);case _:return ie?Ie(1,Xe):Ie(0,Xe+1);case h:var st=this.$locale().weekStart||0,dt=(He<st?He+7:He)-st;return Ie(ie?_t-dt:_t+(6-dt),Xe);case m:case S:return De(te+"Hours",0);case f:return De(te+"Minutes",1);case a:return De(te+"Seconds",2);case i:return De(te+"Milliseconds",3);default:return this.clone()}},K.endOf=function(Z){return this.startOf(Z,!1)},K.$set=function(Z,Q){var X,ie=re.p(Z),ae="set"+(this.$u?"UTC":""),Ie=(X={},X[m]=ae+"Date",X[S]=ae+"Date",X[_]=ae+"Month",X[E]=ae+"FullYear",X[f]=ae+"Hours",X[a]=ae+"Minutes",X[i]=ae+"Seconds",X[n]=ae+"Milliseconds",X)[ie],De=ie===m?this.$D+(Q-this.$W):Q;if(ie===_||ie===E){var He=this.clone().set(S,1);He.$d[Ie](De),He.init(),this.$d=He.set(S,Math.min(this.$D,He.daysInMonth())).$d}else Ie&&this.$d[Ie](De);return this.init(),this},K.set=function(Z,Q){return this.clone().$set(Z,Q)},K.get=function(Z){return this[re.p(Z)]()},K.add=function(Z,Q){var X,ie=this;Z=Number(Z);var ae=re.p(Q),Ie=o(function(Xe){var _t=g(ie);return re.w(_t.date(_t.date()+Math.round(Xe*Z)),ie)},"y");if(ae===_)return this.set(_,this.$M+Z);if(ae===E)return this.set(E,this.$y+Z);if(ae===m)return Ie(1);if(ae===h)return Ie(7);var De=(X={},X[a]=e,X[f]=r,X[i]=t,X)[ae]||1,He=this.$d.getTime()+Z*De;return re.w(He,this)},K.subtract=function(Z,Q){return this.add(-1*Z,Q)},K.format=function(Z){var Q=this,X=this.$locale();if(!this.isValid())return X.invalidDate||w;var ie=Z||"YYYY-MM-DDTHH:mm:ssZ",ae=re.z(this),Ie=this.$H,De=this.$m,He=this.$M,Xe=X.weekdays,_t=X.months,te=X.meridiem,st=o(function(Ge,We,A,O){return Ge&&(Ge[We]||Ge(Q,ie))||A[We].slice(0,O)},"h"),dt=o(function(Ge){return re.s(Ie%12||12,Ge,"0")},"d"),Lt=te||function(Ge,We,A){var O=Ge<12?"AM":"PM";return A?O.toLowerCase():O};return ie.replace($,function(Ge,We){return We||function(A){switch(A){case"YY":return String(Q.$y).slice(-2);case"YYYY":return re.s(Q.$y,4,"0");case"M":return He+1;case"MM":return re.s(He+1,2,"0");case"MMM":return st(X.monthsShort,He,_t,3);case"MMMM":return st(_t,He);case"D":return Q.$D;case"DD":return re.s(Q.$D,2,"0");case"d":return String(Q.$W);case"dd":return st(X.weekdaysMin,Q.$W,Xe,2);case"ddd":return st(X.weekdaysShort,Q.$W,Xe,3);case"dddd":return Xe[Q.$W];case"H":return String(Ie);case"HH":return re.s(Ie,2,"0");case"h":return dt(1);case"hh":return dt(2);case"a":return Lt(Ie,De,!0);case"A":return Lt(Ie,De,!1);case"m":return String(De);case"mm":return re.s(De,2,"0");case"s":return String(Q.$s);case"ss":return re.s(Q.$s,2,"0");case"SSS":return re.s(Q.$ms,3,"0");case"Z":return ae}return null}(Ge)||ae.replace(":","")})},K.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},K.diff=function(Z,Q,X){var ie,ae=this,Ie=re.p(Q),De=g(Z),He=(De.utcOffset()-this.utcOffset())*e,Xe=this-De,_t=o(function(){return re.m(ae,De)},"D");switch(Ie){case E:ie=_t()/12;break;case _:ie=_t();break;case P:ie=_t()/3;break;case h:ie=(Xe-He)/6048e5;break;case m:ie=(Xe-He)/864e5;break;case f:ie=Xe/r;break;case a:ie=Xe/e;break;case i:ie=Xe/t;break;default:ie=Xe}return X?ie:re.a(ie)},K.daysInMonth=function(){return this.endOf(_).$D},K.$locale=function(){return y[this.$L]},K.locale=function(Z,Q){if(!Z)return this.$L;var X=this.clone(),ie=x(Z,Q,!0);return ie&&(X.$L=ie),X},K.clone=function(){return re.w(this.$d,this)},K.toDate=function(){return new Date(this.valueOf())},K.toJSON=function(){return this.isValid()?this.toISOString():null},K.toISOString=function(){return this.$d.toISOString()},K.toString=function(){return this.$d.toUTCString()},ne}(),Te=ee.prototype;return g.prototype=Te,[["$ms",n],["$s",i],["$m",a],["$H",f],["$W",m],["$M",_],["$y",E],["$D",S]].forEach(function(ne){Te[ne[1]]=function(K){return this.$g(K,ne[0],ne[1])}}),g.extend=function(ne,K){return ne.$i||(ne(K,ee,g),ne.$i=!0),g},g.locale=x,g.isDayjs=l,g.unix=function(ne){return g(1e3*ne)},g.en=y[c],g.Ls=y,g.p={},g})});var cj={};Pa(cj,{createGoogleClient:()=>Ye,getAccessToken:()=>Rt,googleDrive:()=>uj,googleDriveAuth:()=>Oe});module.exports=JA(cj);var YA=Object.freeze({status:"aborted"});function de(t,e,r){function n(m,h){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:h,constr:f,traits:new Set},enumerable:!1}),m._zod.traits.has(t))return;m._zod.traits.add(t),e(m,h);let _=f.prototype,P=Object.keys(_);for(let E=0;E<P.length;E++){let S=P[E];S in m||(m[S]=_[S].bind(m))}}o(n,"init");let i=r?.Parent??Object;class a extends i{static{o(this,"Definition")}}Object.defineProperty(a,"name",{value:t});function f(m){var h;let _=r?.Parent?new a:this;n(_,m),(h=_._zod).deferred??(h.deferred=[]);for(let P of _._zod.deferred)P();return _}return o(f,"_"),Object.defineProperty(f,"init",{value:n}),Object.defineProperty(f,Symbol.hasInstance,{value:o(m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(t),"value")}),Object.defineProperty(f,"name",{value:t}),f}o(de,"$constructor");var XA=Symbol("zod_brand"),Dr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},wa=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},hl={};function nn(t){return t&&Object.assign(hl,t),hl}o(nn,"config");function yl(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(yl,"getEnumValues");function $h(t,e){return typeof e=="bigint"?e.toString():e}o($h,"jsonStringifyReplacer");function Sa(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Sa,"cached");function Oh(t){return t==null}o(Oh,"nullish");function Ta(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(Ta,"cleanRegex");var Rh=Symbol("evaluating");function ft(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Rh)return n===void 0&&(n=Rh,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(ft,"defineLazy");var vl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Ci(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(Ci,"isObject");var QA=Sa(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Dh(t){if(Ci(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Ci(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Dh,"isPlainObject");var Ch=new Set(["string","number","symbol"]);function zo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(zo,"escapeRegex");function Ea(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}o(Ea,"clone");function at(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:o(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:o(()=>e.error,"error")}:e}o(at,"normalizeParams");function Nh(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(Nh,"optionalKeys");var eI={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 In(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(In,"prefixIssues");function xa(t){return typeof t=="string"?t:t?.message}o(xa,"unwrapMessage");function Rn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=xa(t.inst?._zod.def?.error?.(t))??xa(e?.error?.(t))??xa(r.customError?.(t))??xa(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(Rn,"finalizeIssue");function zh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(zh,"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 Uh=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,$h,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),kh=de("$ZodError",Uh),Ni=de("$ZodError",Uh,{Parent:Error});var rI=o(t=>(e,r,n,i)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},f=e._zod.run({value:r,issues:[]},a);if(f instanceof Promise)throw new Dr;if(f.issues.length){let m=new(i?.Err??t)(f.issues.map(h=>Rn(h,a,nn())));throw vl(m,i?.callee),m}return f.value},"_parse"),ba=rI(Ni),nI=o(t=>async(e,r,n,i)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},f=e._zod.run({value:r,issues:[]},a);if(f instanceof Promise&&(f=await f),f.issues.length){let m=new(i?.Err??t)(f.issues.map(h=>Rn(h,a,nn())));throw vl(m,i?.callee),m}return f.value},"_parseAsync"),Aa=nI(Ni),oI=o(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Dr;return a.issues.length?{success:!1,error:new(t??kh)(a.issues.map(f=>Rn(f,i,nn())))}:{success:!0,data:a.value}},"_safeParse"),zi=oI(Ni),iI=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},a=e._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new t(a.issues.map(f=>Rn(f,i,nn())))}:{success:!0,data:a.value}},"_safeParseAsync"),Ui=iI(Ni);var sI="(?:(?:\\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])))",aI=new RegExp(`^${sI}$`);var jh=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),Mh=/^-?\d+n?$/;var Pl=/^-?\d+(?:\.\d+)?$/,Fh=/^(?:true|false)$/i;var ko=de("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])});var Lh=de("$ZodCheckMinLength",(t,e)=>{var r;ko.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Oh(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let f=zh(i);n.issues.push({origin:f,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var wl=de("$ZodCheckStringFormat",(t,e)=>{var r,n;ko.init(t,e),t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,e.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),qh=de("$ZodCheckRegex",(t,e)=>{wl.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 Vh={major:4,minor:3,patch:6};var ut=de("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Vh;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let a of i._zod.onattach)a(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=o((f,m,h)=>{let _=Uo(f),P;for(let E of m){if(E._zod.def.when){if(!E._zod.def.when(f))continue}else if(_)continue;let S=f.issues.length,w=E._zod.check(f);if(w instanceof Promise&&h?.async===!1)throw new Dr;if(P||w instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await w,f.issues.length!==S&&(_||(_=Uo(f,S)))});else{if(f.issues.length===S)continue;_||(_=Uo(f,S))}}return P?P.then(()=>f):f},"runChecks"),a=o((f,m,h)=>{if(Uo(f))return f.aborted=!0,f;let _=i(m,n,h);if(_ instanceof Promise){if(h.async===!1)throw new Dr;return _.then(P=>t._zod.parse(P,h))}return t._zod.parse(_,h)},"handleCanaryResult");t._zod.run=(f,m)=>{if(m.skipChecks)return t._zod.parse(f,m);if(m.direction==="backward"){let _=t._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return _ instanceof Promise?_.then(P=>a(P,f,m)):a(_,f,m)}let h=t._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new Dr;return h.then(_=>i(_,n,m))}return i(h,n,m)}}ft(t,"~standard",()=>({validate:o(i=>{try{let a=zi(t,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Ui(t,i).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},"validate"),vendor:"zod",version:1}))}),$a=de("$ZodString",(t,e)=>{ut.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??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}}),xl=de("$ZodStringFormat",(t,e)=>{wl.init(t,e),$a.init(t,e)});var Kh=de("$ZodURL",(t,e)=>{xl.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 Jh=de("$ZodNumber",(t,e)=>{ut.init(t,e),t._zod.pattern=t._zod.bag.pattern??Pl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...a?{received:a}:{}}),r}});var Sl=de("$ZodBoolean",(t,e)=>{ut.init(t,e),t._zod.pattern=Fh,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}}),Yh=de("$ZodBigInt",(t,e)=>{ut.init(t,e),t._zod.pattern=Mh,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 Xh=de("$ZodAny",(t,e)=>{ut.init(t,e),t._zod.parse=r=>r}),Qh=de("$ZodUnknown",(t,e)=>{ut.init(t,e),t._zod.parse=r=>r});var eg=de("$ZodVoid",(t,e)=>{ut.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),tg=de("$ZodDate",(t,e)=>{ut.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:t}),r}});function Gh(t,e,r){t.issues.length&&e.issues.push(...In(r,t.issues)),e.value[r]=t.value}o(Gh,"handleArrayResult");var rg=de("$ZodArray",(t,e)=>{ut.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let a=[];for(let f=0;f<i.length;f++){let m=i[f],h=e.element._zod.run({value:m,issues:[]},n);h instanceof Promise?a.push(h.then(_=>Gh(_,r,f))):Gh(h,r,f)}return a.length?Promise.all(a).then(()=>r):r}});function Ra(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...In(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(Ra,"handlePropertyResult");function uI(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=Nh(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(uI,"normalizeDef");function cI(t,e,r,n,i,a){let f=[],m=i.keySet,h=i.catchall._zod,_=h.def.type,P=h.optout==="optional";for(let E in e){if(m.has(E))continue;if(_==="never"){f.push(E);continue}let S=h.run({value:e[E],issues:[]},n);S instanceof Promise?t.push(S.then(w=>Ra(w,r,E,e,P))):Ra(S,r,E,e,P)}return f.length&&r.issues.push({code:"unrecognized_keys",keys:f,input:e,inst:a}),t.length?Promise.all(t).then(()=>r):r}o(cI,"handleCatchall");var ng=de("$ZodObject",(t,e)=>{if(ut.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let m=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let h={...m};return Object.defineProperty(e,"shape",{value:h}),h},"get")})}let n=Sa(()=>uI(e));ft(t._zod,"propValues",()=>{let m=e.shape,h={};for(let _ in m){let P=m[_]._zod;if(P.values){h[_]??(h[_]=new Set);for(let E of P.values)h[_].add(E)}}return h});let i=Ci,a=e.catchall,f;t._zod.parse=(m,h)=>{f??(f=n.value);let _=m.value;if(!i(_))return m.issues.push({expected:"object",code:"invalid_type",input:_,inst:t}),m;m.value={};let P=[],E=f.shape;for(let S of f.keys){let w=E[S],T=w._zod.optout==="optional",$=w._zod.run({value:_[S],issues:[]},h);$ instanceof Promise?P.push($.then(b=>Ra(b,m,S,_,T))):Ra($,m,S,_,T)}return a?cI(P,_,m,h,n.value,t):P.length?Promise.all(P).then(()=>m):m}});function Hh(t,e,r,n){for(let a of t)if(a.issues.length===0)return e.value=a.value,e;let i=t.filter(a=>!Uo(a));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(a=>a.issues.map(f=>Rn(f,n,nn())))}),e)}o(Hh,"handleUnionResults");var Tl=de("$ZodUnion",(t,e)=>{ut.init(t,e),ft(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ft(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ft(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),ft(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>Ta(a.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,a)=>{if(r)return n(i,a);let f=!1,m=[];for(let h of e.options){let _=h._zod.run({value:i.value,issues:[]},a);if(_ instanceof Promise)m.push(_),f=!0;else{if(_.issues.length===0)return _;m.push(_)}}return f?Promise.all(m).then(h=>Hh(h,i,t,a)):Hh(m,i,t,a)}});var og=de("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Tl.init(t,e);let r=t._zod.parse;ft(t._zod,"propValues",()=>{let i={};for(let a of e.options){let f=a._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let[m,h]of Object.entries(f)){i[m]||(i[m]=new Set);for(let _ of h)i[m].add(_)}}return i});let n=Sa(()=>{let i=e.options,a=new Map;for(let f of i){let m=f._zod.propValues?.[e.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(f)}"`);for(let h of m){if(a.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);a.set(h,f)}}return a});t._zod.parse=(i,a)=>{let f=i.value;if(!Ci(f))return i.issues.push({code:"invalid_type",expected:"object",input:f,inst:t}),i;let m=n.value.get(f?.[e.discriminator]);return m?m._zod.run(i,a):e.unionFallback?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:f,path:[e.discriminator],inst:t}),i)}});var ig=de("$ZodRecord",(t,e)=>{ut.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Dh(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let a=[],f=e.keyType._zod.values;if(f){r.value={};let m=new Set;for(let _ of f)if(typeof _=="string"||typeof _=="number"||typeof _=="symbol"){m.add(typeof _=="number"?_.toString():_);let P=e.valueType._zod.run({value:i[_],issues:[]},n);P instanceof Promise?a.push(P.then(E=>{E.issues.length&&r.issues.push(...In(_,E.issues)),r.value[_]=E.value})):(P.issues.length&&r.issues.push(...In(_,P.issues)),r.value[_]=P.value)}let h;for(let _ in i)m.has(_)||(h=h??[],h.push(_));h&&h.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:h})}else{r.value={};for(let m of Reflect.ownKeys(i)){if(m==="__proto__")continue;let h=e.keyType._zod.run({value:m,issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&Pl.test(m)&&h.issues.length){let E=e.keyType._zod.run({value:Number(m),issues:[]},n);if(E instanceof Promise)throw new Error("Async schemas not supported in object keys currently");E.issues.length===0&&(h=E)}if(h.issues.length){e.mode==="loose"?r.value[m]=i[m]:r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(E=>Rn(E,n,nn())),input:m,path:[m],inst:t});continue}let P=e.valueType._zod.run({value:i[m],issues:[]},n);P instanceof Promise?a.push(P.then(E=>{E.issues.length&&r.issues.push(...In(m,E.issues)),r.value[h.value]=E.value})):(P.issues.length&&r.issues.push(...In(m,P.issues)),r.value[h.value]=P.value)}}return a.length?Promise.all(a).then(()=>r):r}});var sg=de("$ZodEnum",(t,e)=>{ut.init(t,e);let r=yl(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>Ch.has(typeof i)).map(i=>typeof i=="string"?zo(i):i.toString()).join("|")})$`),t._zod.parse=(i,a)=>{let f=i.value;return n.has(f)||i.issues.push({code:"invalid_value",values:r,input:f,inst:t}),i}}),ag=de("$ZodLiteral",(t,e)=>{if(ut.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?zo(n):n?zo(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:e.values,input:a,inst:t}),n}});var ug=de("$ZodTransform",(t,e)=>{ut.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new wa(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(f=>(r.value=f,r));if(i instanceof Promise)throw new Dr;return r.value=i,r}});function Wh(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(Wh,"handleOptionalResult");var cg=de("$ZodOptional",(t,e)=>{ut.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ft(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ft(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Ta(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>Wh(a,r.value)):Wh(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var lg=de("$ZodNullable",(t,e)=>{ut.init(t,e),ft(t._zod,"optin",()=>e.innerType._zod.optin),ft(t._zod,"optout",()=>e.innerType._zod.optout),ft(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Ta(r.source)}|null)$`):void 0}),ft(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)});var dg=de("$ZodPipe",(t,e)=>{ut.init(t,e),ft(t._zod,"values",()=>e.in._zod.values),ft(t._zod,"optin",()=>e.in._zod.optin),ft(t._zod,"optout",()=>e.out._zod.optout),ft(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let a=e.out._zod.run(r,n);return a instanceof Promise?a.then(f=>Ia(f,e.in,n)):Ia(a,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(a=>Ia(a,e.out,n)):Ia(i,e.out,n)}});function Ia(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(Ia,"handlePipeResult");var pg=de("$ZodCustom",(t,e)=>{ko.init(t,e),ut.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(a=>Zh(a,r,n,t));Zh(i,r,n,t)}});function Zh(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(Zh,"handleRefineResult");var mg,fI=Symbol("ZodOutput"),mI=Symbol("ZodInput"),El=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 hg(){return new El}o(hg,"registry");(mg=globalThis).__zod_globalRegistry??(mg.__zod_globalRegistry=hg());var bl=globalThis.__zod_globalRegistry;function gg(t,e){return new t({type:"string",...at(e)})}o(gg,"_string");function yg(t,e){return new t({type:"string",coerce:!0,...at(e)})}o(yg,"_coercedString");function vg(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...at(e)})}o(vg,"_url");function _g(t,e){return new t({type:"number",checks:[],...at(e)})}o(_g,"_number");function Pg(t,e){return new t({type:"number",coerce:!0,checks:[],...at(e)})}o(Pg,"_coercedNumber");function wg(t,e){return new t({type:"boolean",...at(e)})}o(wg,"_boolean");function xg(t,e){return new t({type:"boolean",coerce:!0,...at(e)})}o(xg,"_coercedBoolean");function Sg(t,e){return new t({type:"bigint",coerce:!0,...at(e)})}o(Sg,"_coercedBigint");function Tg(t){return new t({type:"any"})}o(Tg,"_any");function Eg(t){return new t({type:"unknown"})}o(Eg,"_unknown");function bg(t,e){return new t({type:"void",...at(e)})}o(bg,"_void");function Ag(t,e){return new t({type:"date",coerce:!0,...at(e)})}o(Ag,"_coercedDate");function _r(t,e){return new Lh({check:"min_length",...at(e),minimum:t})}o(_r,"_minLength");function $n(t,e){return new qh({check:"string_format",format:"regex",...at(e),pattern:t})}o($n,"_regex");function Ig(t,e,r){let n=at(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(Ig,"_custom");var mt=de("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");ut.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>ba(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>zi(t,r,n),t.parseAsync=async(r,n)=>Aa(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Ui(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>Ea(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.apply=r=>r(t)}),Da=de("ZodMiniString",(t,e)=>{$a.init(t,e),mt.init(t,e)});function I(t){return gg(Da,t)}o(I,"string");var Rg=de("ZodMiniStringFormat",(t,e)=>{xl.init(t,e),Da.init(t,e)});var TI=de("ZodMiniURL",(t,e)=>{Kh.init(t,e),Rg.init(t,e)});function $g(t){return vg(TI,t)}o($g,"url");var Al=de("ZodMiniNumber",(t,e)=>{Jh.init(t,e),mt.init(t,e)});function Ot(t){return _g(Al,t)}o(Ot,"number");var Il=de("ZodMiniBoolean",(t,e)=>{Sl.init(t,e),mt.init(t,e)});function Ke(t){return wg(Il,t)}o(Ke,"boolean");var Og=de("ZodMiniBigInt",(t,e)=>{Yh.init(t,e),mt.init(t,e)});var EI=de("ZodMiniAny",(t,e)=>{Xh.init(t,e),mt.init(t,e)});function ji(){return Tg(EI)}o(ji,"any");var bI=de("ZodMiniUnknown",(t,e)=>{Qh.init(t,e),mt.init(t,e)});function we(){return Eg(bI)}o(we,"unknown");var AI=de("ZodMiniVoid",(t,e)=>{eg.init(t,e),mt.init(t,e)});function Dg(t){return bg(AI,t)}o(Dg,"_void");var Cg=de("ZodMiniDate",(t,e)=>{tg.init(t,e),mt.init(t,e)});var II=de("ZodMiniArray",(t,e)=>{rg.init(t,e),mt.init(t,e)});function be(t,e){return new II({type:"array",element:t,...at(e)})}o(be,"array");var RI=de("ZodMiniObject",(t,e)=>{ng.init(t,e),mt.init(t,e),ft(t,"shape",()=>e.shape)});function k(t,e){let r={type:"object",shape:t??{},...at(e)};return new RI(r)}o(k,"object");var $I=de("ZodMiniUnion",(t,e)=>{Tl.init(t,e),mt.init(t,e)});function Re(t,e){return new $I({type:"union",options:t,...at(e)})}o(Re,"union");var OI=de("ZodMiniDiscriminatedUnion",(t,e)=>{og.init(t,e),mt.init(t,e)});function jo(t,e,r){return new OI({type:"union",options:e,discriminator:t,...at(r)})}o(jo,"discriminatedUnion");var DI=de("ZodMiniRecord",(t,e)=>{ig.init(t,e),mt.init(t,e)});function xe(t,e,r){return new DI({type:"record",keyType:t,valueType:e,...at(r)})}o(xe,"record");var CI=de("ZodMiniEnum",(t,e)=>{sg.init(t,e),mt.init(t,e),t.options=Object.values(e.entries)});function Ne(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new CI({type:"enum",entries:r,...at(e)})}o(Ne,"_enum");var NI=de("ZodMiniLiteral",(t,e)=>{ag.init(t,e),mt.init(t,e)});function ge(t,e){return new NI({type:"literal",values:Array.isArray(t)?t:[t],...at(e)})}o(ge,"literal");var zI=de("ZodMiniTransform",(t,e)=>{ug.init(t,e),mt.init(t,e)});function On(t){return new zI({type:"transform",transform:t})}o(On,"transform");var UI=de("ZodMiniOptional",(t,e)=>{cg.init(t,e),mt.init(t,e)});function Y(t){return new UI({type:"optional",innerType:t})}o(Y,"optional");var kI=de("ZodMiniNullable",(t,e)=>{lg.init(t,e),mt.init(t,e)});function Mi(t){return new kI({type:"nullable",innerType:t})}o(Mi,"nullable");var jI=de("ZodMiniPipe",(t,e)=>{dg.init(t,e),mt.init(t,e)});function Dn(t,e){return new jI({type:"pipe",in:t,out:e})}o(Dn,"pipe");var MI=de("ZodMiniCustom",(t,e)=>{pg.init(t,e),mt.init(t,e)});function Ca(t,e){return Ig(MI,t??(()=>!0),e)}o(Ca,"custom");var Fi={};Pa(Fi,{bigint:()=>HI,boolean:()=>GI,date:()=>WI,number:()=>VI,string:()=>BI});function BI(t){return yg(Da,t)}o(BI,"string");function VI(t){return Pg(Al,t)}o(VI,"number");function GI(t){return xg(Il,t)}o(GI,"boolean");function HI(t){return Sg(Og,t)}o(HI,"bigint");function WI(t){return Ag(Cg,t)}o(WI,"date");var $l=k({retryOnFailure:k({defaultValue:Y(Ke()),hide:Y(Ke())}),continueOnFailure:k({defaultValue:Y(Ke()),hide:Y(Ke())})}),Rl=class{constructor(e,r,n,i,a,f,m,h,_,P,E){this.name=e;this.displayName=r;this.description=n;this.props=i;this.run=a;this.test=f;this.requireAuth=m;this.errorHandlingOptions=h;this.outputSchema=_;this.audience=P;this.aiMetadata=E}static{o(this,"IAction")}},qe=o(t=>new Rl(t.name,t.displayName,t.description,t.props,t.run,t.test??t.run,t.requireAuth??!0,t.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},t.outputSchema,t.audience,t.aiMetadata),"createAction");var Be=k({displayName:I(),description:Y(I())}),$e=o((t,e)=>k({type:ge(e),required:Ke(),defaultValue:Y(ji())}),"TPropertyValue");var Vt=k({...Be.shape,...$e(I(),"SHORT_TEXT").shape}),on=k({...Be.shape,...$e(I(),"LONG_TEXT").shape});var zg=k({label:I(),value:we()}),Na=k({disabled:Y(Ke()),placeholder:Y(I()),options:be(zg)});var Gt=k({...Be.shape,options:Na,...$e(we(),"STATIC_DROPDOWN").shape}),sn=k({...Be.shape,options:Na,...$e(be(we()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Ol=k({...Be.shape,...$e(we(),"DROPDOWN").shape,refreshers:be(I())}),Li=k({...Be.shape,...$e(be(we()),"MULTI_SELECT_DROPDOWN").shape,refreshers:be(I())});var an=k({...Be.shape,...$e(Ke(),"CHECKBOX").shape});var un=k({...Be.shape,...$e(Ot(),"NUMBER").shape});var qi=k({...Be.shape,...$e(we(),"FILE").shape});var Bi=k({...Be.shape,...$e(I(),"DATE_TIME").shape});var Ug=xe(I(),Re([Vt,on,Gt,Li,sn,an,un,qi,Bi])),Vi=k({...Be.shape,properties:Ug,...$e(be(we()),"ARRAY").shape});var Gi=k({...Be.shape,...$e(Re([xe(I(),we())]),"JSON").shape});var kg=Re([Vt,Gt,Gi,Vi,sn]),KI=xe(I(),kg),Dl=k({refreshers:be(I()),...Be.shape,...$e(we(),"DYNAMIC").shape});var za=k({...Be.shape,...$e(Dg(),"MARKDOWN").shape});var Hi=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Hi||{}),Mo=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Mo||{}),Fo=(u=>(u.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",u.COMMUNICATION="COMMUNICATION",u.COMMERCE="COMMERCE",u.CORE="CORE",u.UNIVERSAL_AI="UNIVERSAL_AI",u.FLOW_CONTROL="FLOW_CONTROL",u.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",u.ACCOUNTING="ACCOUNTING",u.PRODUCTIVITY="PRODUCTIVITY",u.CONTENT_AND_FILES="CONTENT_AND_FILES",u.DEVELOPER_TOOLS="DEVELOPER_TOOLS",u.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",u.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",u.HUMAN_RESOURCES="HUMAN_RESOURCES",u.PAYMENT_PROCESSING="PAYMENT_PROCESSING",u.MARKETING="MARKETING",u.SALES_AND_CRM="SALES_AND_CRM",u))(Fo||{});var Wi=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Wi||{}),Cl="both_client_credentials_and_authorization_code";var cn=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(cn||{}),Zi=(a=>(a.NONE="NONE",a.HEADER_PRESENT="HEADER_PRESENT",a.QUERY_PRESENT="QUERY_PRESENT",a.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",a.HEAD_REQUEST="HEAD_REQUEST",a))(Zi||{}),JI=k({strategy:Ne(Zi),paramName:Y(I())}),Ki=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Ki||{});var Ua=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ua||{}),jg=k({status:Y(Ot()),body:Y(we()),headers:Y(xe(I(),I()))}),Mg=k({type:ge("DELAY"),resumeDateTime:I(),requestIdToReply:Y(I()),handlerId:Y(I()),streamStepProgress:Y(Ne(Ua))}),Fg=k({type:ge("WEBHOOK"),requestId:I(),requestIdToReply:Y(I()),response:jg,handlerId:Y(I()),streamStepProgress:Y(Ne(Ua))}),YI=Re([Mg,Fg]);var XI=k({body:we(),rawBody:Y(we()),headers:xe(I(),I()),queryParams:xe(I(),I())});function Et(t){return t==null}o(Et,"isNil");function Ji(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(Ji,"isEmpty");function ka(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(ka,"assertNotNullOrUndefined");var Nl=ze(require("crypto"),1);var QI=128,to,Lo,eR=o(t=>{!to||to.length<t?(to=Buffer.allocUnsafe(t*QI),Nl.default.randomFillSync(to),Lo=0):Lo+t>to.length&&(Nl.default.randomFillSync(to),Lo=0),Lo+=t},"fillPool"),tR=o(t=>(eR(t|=0),to.subarray(Lo-t,Lo)),"random"),rR=o((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(a=e)=>{let f="";for(;;){let m=r(i),h=i;for(;h--;)if(f+=t[m[h]&n]||"",f.length===a)return f}}},"customRandom"),qg=o((t,e=21)=>rR(t,e,tR),"customAlphabet");var nR="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Bg=21,G2=I().check($n(new RegExp(`^[0-9a-zA-Z]{${Bg}}$`))),oR=qg(nR,Bg);var Cn=Dn(On(t=>t instanceof Date?t.toISOString():t),I()),ar={id:I(),created:Cn,updated:Cn},ot=o(t=>Y(Mi(t)),"Nullable");function zl(t){return Y(Mi(Ne(t)))}o(zl,"NullableEnum");var Z2=Dn(On(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),Y(Ke())),ja=o(t=>Dn(On(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),Y(be(t))),"OptionalArrayFromQuery");var Y2=xe(I(),we());var Yi=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(Yi||{});var cG=I().check($n(/^#[0-9A-Fa-f]{6}$/));var dG=k({filename:I(),data:we(),type:ge("file"),mimetype:Y(I())});var iR=ze(Gg());var vG=k({...ar,name:I(),permissions:be(I()),platformId:ot(I()),type:I(),userCount:Y(Ot())});var Hg=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Hg||{}),Ul=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ul||{}),kl=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(kl||{});var jl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(jl||{});var Ml=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ml||{});var sR=k({mode:Ne(Hg),value:we()}),aR=k({auth:Y(I()),fields:xe(I(),sR)}),uR=k({pieceName:I(),pieceVersion:I(),actionName:I(),predefinedInput:Y(aR)}),cR=k({type:ge("PIECE"),toolName:I().check(_r(1)),pieceMetadata:uR}),lR=k({type:ge("none")}),dR=k({type:ge("access_token"),accessToken:I()}),pR=k({type:ge("api_key"),apiKey:I(),apiKeyHeader:I()}),fR=k({type:ge("headers"),headers:xe(I(),I())}),mR=jo("type",[lR,dR,pR,fR]),Wg=k({type:ge("FLOW"),toolName:I().check(_r(1)),externalFlowId:I(),flowDisplayName:Y(I())}),Zg=k({type:ge("MCP"),toolName:I().check(_r(1)),serverUrl:$g(),protocol:Ne(kl),auth:mR}),Kg=k({type:ge("KNOWLEDGE_BASE"),toolName:I().check(_r(1)),sourceType:Ne(Ul),sourceId:I(),sourceName:I()}),hR=jo("type",[cR,Wg,Zg,Kg]),gR=k({displayName:I(),description:Y(I()),type:Ne(jl)}),Jg=k({type:ge("MARKDOWN"),markdown:I()}),qo={type:ge("TOOL_CALL"),input:ot(xe(I(),we())),output:Y(we()),toolName:I(),status:Ne(Ml),toolCallId:I(),startTime:I(),endTime:Y(I())},GG=k(qo),Yg=jo("toolCallType",[k({...qo,toolCallType:ge("PIECE"),pieceName:I(),pieceVersion:I(),actionName:I()}),k({...qo,toolCallType:ge("FLOW"),displayName:I(),externalFlowId:I()}),k({...qo,toolCallType:ge("MCP"),displayName:I(),serverUrl:I()}),k({...qo,toolCallType:ge("KNOWLEDGE_BASE"),displayName:I(),sourceType:I()}),k({...qo,toolCallType:ge("UNKNOWN"),displayName:I()})]),yR=Re([Jg,Yg]);var Fl=(r=>(r.IMAGE="image",r.TEXT="text",r))(Fl||{}),ln=k({apiKey:I()}),vR=ln,_R=k({apiKey:I(),apiKeyHash:I()}),PR=ln,wR=ln,xR=ln,SR=ln,TR=ln,ER=ln,bR=ln,Xg=k({accessKeyId:I().check(_r(1)),secretAccessKey:I().check(_r(1))}),AR=k({}),IR=k({}),RR=k({}),$R=k({}),OR=k({}),DR=k({}),Qg=k({modelId:I(),modelName:I(),modelType:Ne(Fl)}),ey=k({apiKeyHeader:I(),baseUrl:I(),models:be(Qg),defaultHeaders:Y(xe(I(),I()))}),ty=k({accountId:I(),gatewayId:I(),models:be(Qg),vertexProject:Y(I()),vertexRegion:Y(I())}),ry=k({resourceName:I(),apiVersion:Dn(On(t=>typeof t=="string"&&t.trim().length===0?void 0:t),Y(I()))}),ny=k({region:I().check(_r(1))}),CR=Re([vR,xR,SR,TR,ER,wR,PR,_R,Xg,bR]),oy=Re([ey,ty,ry,ny,AR,RR,$R,OR,IR,DR]),NR=k({id:I(),name:I(),type:Ne(Fl)}),zR=k({id:I(),name:I(),provider:Ne(Yi),config:oy,enabledForChat:Ke()}),UR=k({provider:Ne(Yi),config:oy,auth:CR,platformId:I()});var KG={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var kR=k({base64Url:I(),fileName:I(),extension:Y(I())}),jR=k({mimeType:I(),url:I(),fileName:Y(I())}),Ll=Re([kR,jR]);var MR=Re([k({type:ge("file"),value:Ll}),k({type:ge("markdown"),value:I(),files:Y(be(Ll))})]),FR=k({sessionId:I(),message:I(),files:Y(be(I()))});var sy=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(sy||{}),ay=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ay||{}),ql=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(ql||{});var LR=Re([k({...ar,name:I(),externalId:I(),type:ge("STATIC_DROPDOWN"),tableId:I(),projectId:I(),data:k({options:be(k({value:I()}))})}),k({...ar,name:I(),externalId:I(),type:Re([ge("TEXT"),ge("NUMBER"),ge("DATE")]),tableId:I(),projectId:I()})]),qR=k({...ar,name:I(),folderId:ot(I()),projectId:I(),externalId:I(),status:zl(ay),trigger:zl(sy)}),BR=k({...ar,tableId:I(),projectId:I(),cells:xe(I(),k({updated:I(),created:I(),value:we(),fieldName:I()}))}),VR=k({events:be(Ne(ql)),webhookUrl:I(),flowId:I()}),GR=k({fields:be(k({id:I(),name:I()})),rows:be(xe(I(),I())),name:I()}),HR=k({projectId:I(),limit:Y(Fi.number()),cursor:Y(I()),name:Y(I()),externalIds:ja(I()),folderId:Y(I()),folderIds:ja(I())}),WR=k({records:be(be(k({fieldId:I(),value:cy()}))),tableId:I()}),ZR=k({cells:Y(be(k({fieldId:I(),value:cy()}))),tableId:I(),agentUpdate:Y(Ke())}),uy=jo("operator",[ro("eq"),ro("neq"),ro("gt"),ro("gte"),ro("lt"),ro("lte"),ro("co"),iy("exists"),iy("not_exists")]),KR=k({tableId:I(),limit:Y(Fi.number()),cursor:Y(I()),filters:ja(uy)});function cy(){return Dn(On(t=>t==null?t:String(t)),Mi(I()))}o(cy,"coerceToString");function ro(t){return k({fieldId:I(),operator:ge(t),value:I()})}o(ro,"valueFilter");function iy(t){return k({fieldId:I(),operator:ge(t)})}o(iy,"existenceFilter");var JR=k({status:Y(Ot()),body:Y(we()),headers:Y(xe(I(),I()))}),YR=k({...ar,deleted:ot(Cn),ownerId:I(),displayName:I(),platformId:I(),externalId:ot(I())});var ly=k({name:I(),description:Y(I()),type:I(),required:Ke()}),XR=k({pieceName:I(),triggerName:I(),input:k({toolName:I(),toolDescription:I(),inputSchema:be(ly),returnsResponse:Ke()})});var dy="^[0-9]+\\.[0-9]+\\.[0-9]+$",mH=new RegExp(dy),e0="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",hH=I().check($n(new RegExp(dy))),gH=I().check($n(new RegExp(e0))),t0=k({packageType:ge("ARCHIVE"),pieceType:Ne(Mo),pieceName:I(),pieceVersion:I(),archiveId:I(),platformId:I()}),py=k({packageType:ge("REGISTRY"),pieceType:ge("OFFICIAL"),pieceName:I(),pieceVersion:I()}),fy=k({packageType:ge("REGISTRY"),pieceType:ge("CUSTOM"),pieceName:I(),pieceVersion:I(),platformId:I()}),yH=Re([py,fy]),vH=Re([t0,py,fy]),my=(e=>(e.CRON_EXPRESSION="CRON_EXPRESSION",e))(my||{}),r0=k({type:Ne(my),cronExpression:I(),timezone:I()}),_H=k({...ar,type:Ne(cn),projectId:I(),flowId:I(),triggerName:I(),schedule:ot(r0),flowVersionId:I(),pieceName:I(),pieceVersion:I(),deleted:ot(I()),simulate:Ke()}),hy=(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))(hy||{}),gy=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(gy||{}),yy=(r=>(r.S3="S3",r.DB="DB",r))(yy||{}),PH=k({...ar,projectId:ot(I()),platformId:ot(I()),type:Ne(hy),compression:Ne(gy),data:Y(we()),location:Ne(yy),size:ot(Ot()),fileName:ot(I()),s3Key:ot(I()),metadata:ot(xe(I(),I()))}),vy=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(vy||{}),_y=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(_y||{}),wH=k({id:I(),email:I(),firstName:I(),status:Ne(_y),externalId:ot(I()),platformId:ot(I()),platformRole:Ne(vy),lastName:I(),created:Cn,updated:Cn,lastActiveDate:ot(Cn),imageUrl:ot(I())});var Vl=k({...Be.shape,...$e(xe(I(),we()),"OBJECT").shape});var xy=k({...Be.shape,...$e(I(),"COLOR").shape});var Gl=Re([Vt,on,za,an,Gt,sn,Ol,Li,Dl,un,Vi,Vl,Gi,Bi,qi,xy]),oe={ShortText(t){return{...t,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(t){return{...t,valueSchema:void 0,type:"CHECKBOX"}},LongText(t){return{...t,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(t){return{displayName:"Markdown",required:!1,description:t.value,type:"MARKDOWN",valueSchema:void 0,variant:t.variant??"INFO"}},Number(t){return{...t,valueSchema:void 0,type:"NUMBER"}},Json(t){return{...t,valueSchema:void 0,type:"JSON"}},Array(t){return{...t,valueSchema:void 0,type:"ARRAY"}},Object(t){return{...t,valueSchema:void 0,type:"OBJECT"}},Dropdown(t){return{...t,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(t){return{...t,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(t){return{...t,valueSchema:void 0,type:"DATE_TIME"}},File(t){return{...t,valueSchema:void 0,type:"FILE"}},Custom(t){let e=t.code.toString();return{...t,code:e,valueSchema:void 0,type:"CUSTOM"}},Color(t){return{...t,valueSchema:void 0,type:"COLOR"}}};var Cr=k({displayName:I(),description:Y(I())});var Sy=k({username:I(),password:I()}),Hl=k({...Cr.shape,username:k({displayName:I(),description:Y(I())}),password:k({displayName:I(),description:Y(I())}),...$e(Sy,"BASIC_AUTH").shape});var s0=xe(I(),Re([Vt,on,un,an,Gt])),Wl=k({...Cr.shape,props:s0,...$e(we(),"CUSTOM_AUTH").shape});var no=k({...Cr.shape,...$e(k({auth:I()}),"SECRET_TEXT").shape});var a0=xe(I(),Re([Vt,on,no,un,an,Gt,sn,za])),Ty=k({...Cr.shape,props:a0,...$e(we(),"OIDC").shape});var Zl=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Zl||{}),Ey=Re([Vt,no,Gt]),by=xe(I(),Ey),u0=k({props:Y(xe(I(),Ey)),authUrl:I(),tokenUrl:I(),scope:be(I()),prompt:Y(Re([ge("none"),ge("consent"),ge("login"),ge("omit")])),pkce:Y(Ke()),pkceMethod:Y(Re([ge("plain"),ge("S256")])),authorizationMethod:Y(Ne(Zl)),grantType:Y(Re([Ne(Wi),ge(Cl)])),extra:Y(xe(I(),I()))}),Ay=k({access_token:I(),props:Y(by),data:xe(I(),ji())}),Kl=k({...Cr.shape,...u0.shape,...$e(Ay,"OAUTH2").shape});var Bo=Re([Hl,Wl,Ty,Kl,no]),Xi="Connection",Fa={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||Xi}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||Xi,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||Xi}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||Xi}},None(){}};var QW={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 c0=k({...Be.shape,...$e(we(),"CUSTOM").shape,code:I()});var l0=Re([Gl,Bo]),Jl=xe(I(),l0),_Z=xe(I(),Gl);var Iy=Re([k({strategy:ge("CRON"),cronExpression:I()}),k({strategy:ge("NONE")})]),Vo=class{constructor(e,r,n,i,a,f,m,h,_,P,E,S,w,T,$,b,u,p,c){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=a;this.type=f;this.handshakeConfiguration=m;this.onHandshake=h;this.renewConfiguration=_;this.onRenew=P;this.onEnable=E;this.onDisable=S;this.onStart=w;this.run=T;this.test=$;this.sampleData=b;this.testStrategy=u;this.outputSchema=p;this.aiMetadata=c}static{o(this,"ITrigger")}},La=o(t=>{switch(t.type){case"WEBHOOK":return new Vo(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 Vo(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 Vo(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 Vo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,Et(t.sampleData)&&Et(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var Ry="2",qa="0.82.0";var Yl=class{constructor(e,r,n,i,a,f,m,h,_=qa,P,E=""){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=m;this.auth=h;this.minimumSupportedRelease=_;this.maximumSupportedRelease=P;this.description=E;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ry}),"getContextInfo");(!d0(_)||p0(_,qa))&&(this.minimumSupportedRelease=qa),a.forEach(S=>this._actions[S.name]=S),f.forEach(S=>this._triggers[S.name]=S)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(e){return this._actions[e]}getTrigger(e){return this._triggers[e]}actions(){return this._actions}triggers(){return this._triggers}},$y=o(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,i)=>n===i.findIndex(a=>a.type===r.type)))throw new Error("Auth properties must be unique by type");return new Yl(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description)},"createPiece");function d0(t){return/^\d+\.\d+\.\d+$/.test(t)}o(d0,"isValidSimpleSemver");function p0(t,e){let[r,n,i]=t.split(".").map(Number),[a,f,m]=e.split(".").map(Number);return r!==a?r<a:n!==f?n<f:i<m}o(p0,"isSemverLessThan");var f0=Y(xe(I(),xe(I(),I()))),Oy=k({id:Y(I()),name:I(),displayName:I(),logoUrl:I(),description:I(),authors:be(I()),platformId:Y(I()),directoryPath:Y(I()),auth:Y(Re([Bo,be(Bo)])),version:I(),categories:Y(be(Ne(Fo))),minimumSupportedRelease:Y(I()),maximumSupportedRelease:Y(I()),i18n:f0}),m0=Ne(["human","ai","both"]),Dy=k({description:Y(I()),idempotent:Y(Ke())}),Cy=k({name:I(),displayName:I(),description:I(),props:Jl,requireAuth:Ke(),errorHandlingOptions:Y($l),outputSchema:Y(Ca()),audience:Y(m0),aiMetadata:Y(Dy)}),Ny=k({name:I(),displayName:I(),description:I(),props:Jl,errorHandlingOptions:Y($l),type:Ne(cn),sampleData:we(),handshakeConfiguration:Y(Ca()),renewConfiguration:Y(Iy),testStrategy:Ne(Ki),outputSchema:Y(Ca()),aiMetadata:Y(Dy)}),h0=k({...Oy.shape,actions:xe(I(),Cy),triggers:xe(I(),Ny)}),g0=k({...Oy.shape,actions:Ot(),triggers:Ot(),suggestedActions:Y(be(Ny)),suggestedTriggers:Y(be(Cy))}),zy=k({projectUsage:Ot(),tags:Y(be(I())),pieceType:Ne(Mo),packageType:Ne(Hi),platformId:Y(I()),archiveId:Y(I())}),_3=k({...h0.shape,...zy.shape}),P3=k({...g0.shape,...zy.shape}),w3=k({name:I(),version:I()});var y0=ze(require("path")),v0=ze(require("fs/promises"));var Ba=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((a,f)=>{i.append(f,a)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};if(e.authentication&&this.populateAuthentication(e.authentication,r),e.body)switch(e.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return e.headers&&(r={...r,...e.headers}),r}populateAuthentication(e,r){this.authenticationConverter.convert(e,r)}};var Va=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new Xl,r=new Ql){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},Xl=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},Ql=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(e,r){let n=`${e.username}:${e.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Ga=class extends Error{constructor(r,n){let i=n.status||500,a=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:a},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=a}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Ha=class extends Ba{static{o(this,"FetchHttpClient")}constructor(e="",r=new Va){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),a=this.getHeaders(e),f=e.queryParams??{};for(let[c,y]of Object.entries(f))i.append(c,y);let m=i.toString(),h=m?`${n}?${m}`:n,_=e.responseType??"json",P=e.followRedirects??!0,E=e.retries??0,{body:S,extraHeaders:w,isStream:T}=_0(e.body,a),$=w0({...a,...w}),b=await P0(async()=>{let c=new AbortController,y=e.timeout&&e.timeout>0?setTimeout(()=>c.abort(),e.timeout):void 0;try{let l={method:e.method.toString(),headers:$,body:S,redirect:P?"follow":"manual",signal:c.signal};return T&&(l.duplex="half"),r?.dispatcher!==void 0&&(l.dispatcher=r.dispatcher),await fetch(h,l)}finally{y!==void 0&&clearTimeout(y)}},E),u=P?300:400;if(b.status<200||b.status>=u){let c=await Uy(b,_),y=new Ga(e.body,{status:b.status,responseBody:c});throw console.error("[HttpClient#(sanitized error message)] Request failed:",y),y}let p=await Uy(b,_);return{status:b.status,headers:x0(b.headers),body:p}}};function _0(t,e){return T0(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(_0,"serializeBody");async function Uy(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(Uy,"parseResponseBody");async function P0(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(P0,"sendWithRetries");function ky(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(ky,"backoff");function w0(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(w0,"normalizeHeaders");function x0(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(x0,"toHttpHeaders");function S0(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"}o(S0,"isNodeFormData");function T0(t){return t==null}o(T0,"isNil");var Pr=new Ha;var oo=(f=>(f.GET="GET",f.POST="POST",f.PATCH="PATCH",f.PUT="PUT",f.DELETE="DELETE",f.HEAD="HEAD",f))(oo||{});var uO=ze(require("fs")),U_=ze(nu());var cO={"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 lO(t){let e=t.split(";")[0].trim().toLowerCase();return cO[e]??""}o(lO,"contentTypeToExtension");var dO=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),pO=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 k_({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:a,props:f,extraProps:m,authLocation:h="headers"}){return qe({audience:"human",name:a||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:oe.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:_})=>({url:oe.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
69
|
+
i.e ${pO(e,_)}/resource or /resource`,required:!0,defaultValue:_?e(_):"",...f?.url??{}})}),"props")}),method:oe.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(oo).map(_=>({label:_,value:_}))},...f?.method??{}}),headers:oe.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...f?.headers??{}}),queryParams:oe.Object({displayName:"Query Parameters",required:!0,...f?.queryParams??{}}),body_type:oe.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:oe.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:_})=>{if(!_)return{};let P=_,E={};switch(P){case"none":break;case"json":E.data=oe.Json({displayName:"JSON Body",required:!0,...f?.body??{}});break;case"raw":E.data=oe.LongText({displayName:"Raw Body",required:!0});break;case"form_data":E.data=oe.Array({displayName:"Form Data",required:!0,properties:{fieldName:oe.ShortText({displayName:"Field Name",required:!0}),fieldType:oe.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:oe.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:oe.File({displayName:"File Field Value",required:!1})}});break}return E},"props")}),response_is_binary:oe.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:oe.Checkbox({displayName:"No Error on Failure",required:!1,...f?.failsafe??{}}),timeout:oe.Number({displayName:"Timeout (in seconds)",required:!1,...f?.timeout??{}}),followRedirects:oe.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...m},run:o(async _=>{let{method:P,url:E,headers:S,queryParams:w,body:T,body_type:$,failsafe:b,timeout:u,response_is_binary:p,followRedirects:c}=_.propsValue;ka(P,"Method"),ka(E,"URL");let y=Et(r)?{}:await r(_.auth,_.propsValue),l=E.url,x=l.startsWith("http://")||l.startsWith("https://")?l:dO({baseUrl:e(_.auth),relativePath:l}),g={method:P,url:x,headers:{...S??{},...h==="headers"||!Et(h)?y:{}},queryParams:{...h==="queryParams"?y:{},...w??{}},timeout:u?u*1e3:0,followRedirects:c};if(p&&(g.responseType="arraybuffer"),T)if($&&$!=="none"){let re=T.data;if($==="form_data"){let ee=re,Te=new U_.default;for(let{fieldName:ne,fieldType:K,textFieldValue:Z,fileFieldValue:Q}of ee)K==="text"&&!Ji(Z)?Te.append(ne,Z):K==="file"&&!Ji(Q)&&Te.append(ne,Q.data,{filename:Q?.filename});g.body=Te,g.headers={...g.headers,...Te.getHeaders()}}else g.body=re}else $||(g.body=T);try{let re=await Pr.sendRequest(g);return await fO(_.files,re.body,re.status,re.headers,p)}catch(re){if(b)return re.errorMessage();throw re}},"run")})}o(k_,"createCustomApiCallAction");var fO=o(async(t,e,r,n,i)=>{let a;if(i&&mO(e)){let f=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],m=lO(f??"")||"txt",h;e instanceof ArrayBuffer?h=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?h=e:h=Buffer.from(e),a=await t.write({fileName:`output.${m}`,data:h})}else a=e;return{status:r,headers:n,body:a}},"handleBinaryResponse"),mO=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var Nr={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:a,server:f}){switch(t.strategy){case 0:{let m=await e.get("lastPoll");if(Et(m))throw new Error("lastPoll doesn't exist in the store.");let h=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:m,server:f}),_=h.reduce((P,E)=>Math.max(P,E.epochMilliSeconds),m);return await e.put("lastPoll",_),h.filter(P=>P.epochMilliSeconds>m).map(P=>P.data)}case 1:{let m=await e.get("lastItem"),h=await t.items({store:e,auth:r,propsValue:n,lastItemId:m,files:a,server:f}),_=h.findIndex(S=>S.id===m),P=[];Et(m)||_==-1?P=h??[]:P=h?.slice(0,_)??[],Et(i)||(P=P.slice(-i));let E=P?.[0]?.id;return Et(E)||await e.put("lastItem",E),P.map(S=>S.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i}){switch(t.strategy){case 0:{await e.put("lastPoll",Date.now());break}case 1:{let f=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;Et(f)?await e.delete("lastItem"):await e.put("lastItem",f);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:i,server:a}){let f=[];switch(t.strategy){case 0:{f=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:a});break}case 1:{f=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:a});break}}return hO(f.map(m=>m.data))}};function hO(t){return t.length<=5?t:t.slice(0,5)}o(hO,"getFirstFiveOrAll");var Pc=ze(zs());var BS=["https://www.googleapis.com/auth/drive"],Oe=[Fa.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:BS}),Fa.CustomAuth({displayName:"Service Account (Advanced)",description:"Authenticate via service account from https://console.cloud.google.com/ > IAM & Admin > Service Accounts > Create Service Account > Keys > Add key. <br> <br> You can optionally use domain-wide delegation (https://support.google.com/a/answer/162106?hl=en#zippy=%2Cset-up-domain-wide-delegation-for-a-client) to access files without adding the service account to each one. <br> <br> **Note:** Without a user email, the service account only has access to files/folders you explicitly share with it.",required:!0,props:{serviceAccount:oe.LongText({displayName:"Service Account JSON Key",required:!0}),userEmail:oe.ShortText({displayName:"User Email",required:!1,description:"Email address of the user to impersonate for domain-wide delegation."})},validate:o(async({auth:t})=>{try{await Rt({type:"CUSTOM_AUTH",props:{...t}})}catch(e){return{valid:!1,error:e.message}}return{valid:!0}},"validate")})];async function Ye(t){if(t.type==="CUSTOM_AUTH"){let r;try{r=JSON.parse(t.props.serviceAccount)}catch{throw new Error("Invalid Service Account JSON Key. Please provide a valid JSON string.")}return new Pc.JWT({email:r.client_email,key:r.private_key,scopes:BS,subject:t.props.userEmail})}let e=new Pc.OAuth2Client;return e.setCredentials(t),e}o(Ye,"createGoogleClient");var Rt=o(async t=>{if(t.type==="CUSTOM_AUTH"){let r=await(await Ye(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 EE=ze(or());var Sm=ze(Mc()),Tm=ze(or());var ij=1e3,sj=o(t=>t.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),"escapeDriveQueryLiteral"),ke={properties:{parentFolder:oe.Dropdown({displayName:"Parent Folder",description:"The Drive folder to target. Leave empty to use the root of My Drive. Type in the box to search your Drive by folder name. If the folder still isn't listed, switch this field to 'Dynamic value' (the toggle next to the field) and paste the folder ID \u2014 you can copy it from the folder's URL in Drive, after /folders/ (e.g. https://drive.google.com/drive/folders/<FOLDER_ID>).",required:!1,auth:Oe,refreshers:["include_team_drives"],refreshOnSearch:!0,options:o(async({auth:t,include_team_drives:e},r)=>{if(!t)return{disabled:!0,options:[],placeholder:"Please authenticate first"};let i=await Rt(t),a=r?.searchValue?.trim()??"",f=["mimeType='application/vnd.google-apps.folder'","trashed = false"];a.length>0&&f.push(`name contains '${sj(a)}'`);let m={method:"GET",url:"https://www.googleapis.com/drive/v3/files",queryParams:{q:f.join(" and "),includeItemsFromAllDrives:e?"true":"false",supportsAllDrives:"true",corpora:e?"allDrives":"user",pageSize:String(ij),fields:"nextPageToken, files(id, name)"},authentication:{type:"BEARER_TOKEN",token:i}},h=[],_=!1;try{let P=await Pr.sendRequest(m);h=P.body.files??[],_=!!P.body.nextPageToken}catch(P){throw new Error(`Failed to get folders
|
|
70
|
+
Error:${P}`)}return{disabled:!1,placeholder:_?`Showing first ${h.length} matches \u2014 type to narrow the list, or switch to Dynamic value to paste an ID.`:void 0,options:h.map(P=>({label:P.name,value:P.id}))}},"options")}),include_team_drives:oe.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},async getFiles(t,e,r){let n=await Ye(t),i=(0,Tm.drive)({version:"v3",auth:n}),a=[];e?.parent&&a.push(`'${e.parent}' in parents`),e?.createdTime&&a.push(`createdTime ${e.createdTimeOp??">"} '${(0,Sm.default)(e.createdTime).format()}'`),a.push("trashed = false");let f=[],m;do{let h={q:a.concat("mimeType!='application/vnd.google-apps.folder'").join(" and "),fields:"nextPageToken, files(id, name, mimeType, webViewLink, kind, createdTime)",orderBy:r??"createdTime desc",supportsAllDrives:!0,includeItemsFromAllDrives:e?.includeTeamDrive,corpora:e?.includeTeamDrive?"allDrives":"user"};m&&(h.pageToken=m);let _=await i.files.list(h);f.push(..._.data.files??[]),m=_.data.nextPageToken??void 0}while(m);return f},async getFolders(t,e,r){let n=await Ye(t),i=(0,Tm.drive)({version:"v3",auth:n}),a=["mimeType='application/vnd.google-apps.folder'"];e?.parent&&a.push(`'${e.parent}' in parents`),e?.createdTime&&a.push(`createdTime ${e.createdTimeOp??">"} '${(0,Sm.default)(e.createdTime).format()}'`),a.push("trashed = false");let f=[],m;do{let h={q:a.join(" and "),fields:"nextPageToken, files(id, name, createdTime)",orderBy:r??"createdTime desc",supportsAllDrives:!0,includeItemsFromAllDrives:e?.includeTeamDrive,corpora:e?.includeTeamDrive?"allDrives":"user"};m&&(h.pageToken=m);let _=await i.files.list(h);f.push(..._.data.files??[]),m=_.data.nextPageToken??void 0}while(m);return f}};var cE={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},lE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},dE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},pE={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},fE={fields:[{key:"name",label:"Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},mE={fields:[{key:"files",label:"Files",labelKey:"name",listItems:[{key:"name",label:"Name",value:"name"},{key:"id",label:"File ID",value:"id"},{key:"mimeType",label:"MIME Type",value:"mimeType"},{key:"trashed",label:"Trashed",value:"trashed",format:"boolean"},{key:"parents",label:"Parent Folder ID",value:"parents[0]"}]},{key:"incompleteSearch",label:"Incomplete Search",value:"incompleteSearch",format:"boolean"}]},hE={fields:[{key:"results",label:"Results",value:"",labelKey:"name",listItems:[{key:"name",label:"Name",value:"name"},{key:"mimeType",label:"MIME Type",value:"mimeType"},{key:"id",label:"File ID",value:"id"},{key:"createdTime",label:"Created Time",value:"createdTime",format:"datetime"},{key:"modifiedTime",label:"Modified Time",value:"modifiedTime",format:"datetime"}]}]},gE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},yE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},vE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"iconLink",label:"Icon",format:"image"},{key:"size",label:"Size",format:"filesize"},{key:"fileExtension",label:"File Extension"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"shared",label:"Shared",format:"boolean"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]},{key:"lastModifyingUser",label:"Last Modifying User",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]},{key:"permissions",label:"Permissions",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"role",label:"Role"},{key:"type",label:"Type"},{key:"id",label:"Permission ID"}]}]},_E={fields:[{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"id",label:"Permission ID"},{key:"allowFileDiscovery",label:"Allow File Discovery",format:"boolean"},{key:"downloadUrl",label:"Download URL",format:"url"},{key:"kind",label:"Kind"}]},PE={fields:[{key:"role",label:"Role"},{key:"type",label:"Type"},{key:"id",label:"Permission ID"}]},wE={fields:[{key:"removed",label:"Removed",value:"removed",format:"boolean"},{key:"message",label:"Message",value:"message"}]},xE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},SE={fields:[{key:"name",label:"File Name"},{key:"webViewLink",label:"View Link",format:"url"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"id",label:"File ID"}]},TE={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"createdTime",label:"Created Time",format:"datetime"}]};var bE=qe({auth:Oe,name:"update_permissions",description:"Update permissions for a file or folder",audience:"both",aiMetadata:{description:"Grants a specified role (reader, commenter, writer, fileOrganizer, or organizer) on a Drive file or folder to a user identified by email, optionally sending a notification email. Use to share a resource with a person. Requires the file/folder ID and target email. Not idempotent: each call creates a new permission grant.",idempotent:!1},displayName:"Update permissions",props:{fileId:oe.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:oe.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:oe.StaticDropdown({displayName:"Role",description:"The role to grant to user. See more at: https://developers.google.com/drive/api/guides/ref-roles",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}}),include_team_drives:ke.properties.include_team_drives,send_invitation_email:oe.Checkbox({displayName:"Send invitation email",description:"Send an email to the user to notify them of the new permissions",required:!0})},outputSchema:PE,async run(t){let{fileId:e,user_email:r,permission_name:n,send_invitation_email:i,include_team_drives:a}=t.propsValue,f=await Ye(t.auth),m=(0,EE.drive)({version:"v3",auth:f}),h={type:"user",role:n,emailAddress:r};return(await m.permissions.create({requestBody:h,fileId:e,sendNotificationEmail:i,supportsAllDrives:a})).data}});var AE=ze(or());var IE=qe({auth:Oe,name:"create_new_gdrive_folder",description:"Create a new empty folder in your Google Drive",audience:"both",aiMetadata:{description:"Creates a new empty folder in Google Drive, optionally nested under a parent folder. Use to set up a destination before uploading or moving files. Not idempotent: each call creates a distinct folder even with the same name (Drive permits duplicate folder names).",idempotent:!1},displayName:"Create new folder",props:{folderName:oe.ShortText({displayName:"Folder name",description:"The name of the new folder",required:!0}),parentFolder:ke.properties.parentFolder,include_team_drives:ke.properties.include_team_drives},outputSchema:cE,async run(t){let e=await Ye(t.auth);return(await(0,AE.drive)({version:"v3",auth:e}).files.create({requestBody:{mimeType:"application/vnd.google-apps.folder",name:t.propsValue.folderName,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},supportsAllDrives:t.propsValue.include_team_drives})).data}});var RE=ze(nu());var $E=qe({auth:Oe,name:"create_new_gdrive_file",description:"Create a new text file in your Google Drive from text",audience:"both",aiMetadata:{description:"Creates a new file in Google Drive from inline text content as plain text, CSV, or XML, optionally inside a parent folder. Use when an agent has generated text it needs to persist as a Drive file. Not idempotent: each call creates a new file.",idempotent:!1},displayName:"Create new file",props:{fileName:oe.ShortText({displayName:"File name",description:"The name of the new text file",required:!0}),text:oe.LongText({displayName:"Text",description:"The text content to add to file",required:!0}),fileType:oe.StaticDropdown({displayName:"Content type",description:"Select file type",required:!0,defaultValue:"plain/text",options:{options:[{label:"Text",value:"plain/text"},{label:"CSV",value:"text/csv"},{label:"XML",value:"text/xml"}]}}),parentFolder:ke.properties.parentFolder,include_team_drives:ke.properties.include_team_drives},outputSchema:lE,async run(t){let e={mimeType:t.propsValue.fileType,name:t.propsValue.fileName,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},r=Buffer.from(JSON.stringify(e),"utf-8"),n=Buffer.from(t.propsValue.text,"utf-8"),i=new RE.default;i.append("Metadata",r,{contentType:"application/json"}),i.append("Media",n,{contentType:t.propsValue.fileType});let a=await Pr.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart",body:i,headers:{...i.getHeaders()},queryParams:{supportsAllDrives:String(t.propsValue.include_team_drives||!1)},authentication:{type:"BEARER_TOKEN",token:await Rt(t.auth)}});return console.debug("File creation response",a),a.body}});var OE=ze(or());var DE=qe({auth:Oe,name:"delete_permissions",description:"Removes a role from an user for a file or folder",audience:"both",aiMetadata:{description:"Revokes a specific role from a user (matched by email and role) on a Drive file or folder. Use to unshare or downgrade access for someone. Requires the file/folder ID, the user email, and the role to remove. Idempotent: if no matching permission exists, the call is a no-op.",idempotent:!0},displayName:"Delete permissions",props:{fileId:oe.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:oe.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:oe.StaticDropdown({displayName:"Role",description:"The role to remove from user.",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}})},outputSchema:wE,async run(t){let[e,r]=[t.propsValue.fileId,t.propsValue.user_email],n=await Ye(t.auth),i=(0,OE.drive)({version:"v3",auth:n}),a=await i.permissions.list({fileId:e,fields:"permissions(id, emailAddress, role)"});if(a.data.permissions){for(let f of a.data.permissions)if(f.emailAddress===r&&f.role===t.propsValue.permission_name)return await i.permissions.delete({fileId:e,permissionId:f.id?f.id:""}),{removed:!0,message:"Permission removed"}}return{removed:!1,message:"Permission not found"}}});var CE=ze(or());var NE=qe({displayName:"Duplicate File",auth:Oe,name:"duplicate_file",description:"Duplicate a file from Google Drive. Returns the new file ID.",audience:"both",aiMetadata:{description:"Copies an existing Drive file into a target folder under a new name, optionally converting it to a Google Sheet or Google Doc. Use to clone a file or create an editable Google-format copy. Requires the source file ID and destination folder ID. Not idempotent: each call creates a new copy.",idempotent:!1},props:{fileId:oe.ShortText({displayName:"File ID",description:"The ID of the file to duplicate",required:!0}),name:oe.ShortText({displayName:"Name",description:"The name of the new file",required:!0}),folderId:oe.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be duplicated",required:!0}),mimeType:oe.StaticDropdown({displayName:"Duplicate as",description:"If left unselected the file will be duplicated as it is",required:!1,options:{options:[{label:"Google Sheets",value:"application/vnd.google-apps.spreadsheet"},{label:"Google Docs",value:"application/vnd.google-apps.document"}]}}),include_team_drives:ke.properties.include_team_drives},outputSchema:gE,async run(t){let e=await Ye(t.auth),r=t.propsValue.fileId,n=t.propsValue.name,i=t.propsValue.folderId,a=t.propsValue.mimeType,f=(0,CE.drive)({version:"v3",auth:e}),m={name:n,parents:[i]};a&&(m.mimeType=a);let h=await f.files.copy({fileId:r,auth:e,requestBody:m,supportsAllDrives:t.propsValue.include_team_drives});if(h.status!==200)throw new Error("Error duplicating file");return h.data}});var zE=ze(or());var UE=qe({auth:Oe,name:"get-file-or-folder-by-id",displayName:"Get File Information",description:"Get a file folder for files/sub-folders",audience:"both",aiMetadata:{description:"Fetches metadata for a single file or folder in Google Drive by its exact ID (name, MIME type, parents, etc.). Use when an agent already has a file/folder ID and needs its details. Read-only and idempotent. Requires the resource ID, not a name or path.",idempotent:!0},props:{id:oe.ShortText({displayName:"File / Folder Id",description:"The Id of the file/folder to search for.",required:!0}),include_team_drives:ke.properties.include_team_drives},outputSchema:fE,async run(t){let e=await Ye(t.auth),n=await(0,zE.drive)({version:"v3",auth:e}).files.get({fileId:t.propsValue.id,supportsAllDrives:t.propsValue.include_team_drives});return n.data?n.data:(console.log("The specified ID corresponds to a folder. Returning null."),null)}});var Em=ze(require("querystring"));var jE=ze(Za());async function ME(t,e){let r=await Rt(t);return(await fetch(`https://www.googleapis.com/drive/v3/files/${e}?fields=mimeType&supportsAllDrives=true`,{headers:{Authorization:`Bearer ${r}`}}).then(i=>i.json())).mimeType}o(ME,"getMimeType");var kE=o(async(t,e,r,n,i)=>{let a=await ME(e,r),f=await Rt(e),m=await fetch(t,{headers:{Authorization:`Bearer ${f}`}}).then(E=>E.ok?E.blob():Promise.reject(E)).catch(E=>Promise.reject(new Error(`Error when download file:
|
|
71
|
+
Download file response: ${E.message??E}`))),h=(0,jE.extension)(a),_=h?"."+h:"",P=i??r+_;return n.write({fileName:P,data:Buffer.from(await m.arrayBuffer())})},"googledlCall");async function Hn(t,e,r,n){let i=await ME(t,r);if(["application/vnd.google-apps.document","application/vnd.google-apps.spreadsheet","application/vnd.google-apps.presentation"].includes(i)){switch(i){case"application/vnd.google-apps.document":i="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case"application/vnd.google-apps.spreadsheet":i="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;case"application/vnd.google-apps.presentation":i="application/vnd.openxmlformats-officedocument.presentationml.presentation";break}return await kE(`https://www.googleapis.com/drive/v3/files/${r}/export?mimeType=${i}&supportsAllDrives=true`,t,r,e,n)}else return await kE(`https://www.googleapis.com/drive/v3/files/${r}?alt=media&supportsAllDrives=true`,t,r,e,n)}o(Hn,"downloadFileFromDrive");async function FE(t,e,r,n,i,a=0){let f=[];if(a>r)return f;let m=await Rt(t),h=`'${e}' in parents`;n||(h+=" and trashed=false");let _={q:h,fields:"nextPageToken,files(id,kind,mimeType,name,trashed,parents)",supportsAllDrives:"true",includeItemsFromAllDrives:i?"true":"false",corpora:i?"allDrives":"user",pageSize:"1000"},P=await Pr.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Em.default.stringify(_)}`,headers:{Authorization:`Bearer ${m}`}});for(let E of P.body.files)f.push({file:E,level:a,parentFolder:e});for(;P.body.nextPageToken;){_.pageToken=P.body.nextPageToken,P=await Pr.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Em.default.stringify(_)}`,headers:{Authorization:`Bearer ${m}`}});for(let E of P.body.files)f.push({file:E,level:a,parentFolder:e})}if(a+1<r){let E=f.filter(S=>S.file.mimeType==="application/vnd.google-apps.folder");for(let S of E){let w=await FE(t,S.file.id,r,n,i,a+1);f.push(...w)}}return f}o(FE,"getFilesRecursively");var LE=qe({auth:Oe,name:"list-files",displayName:"List files",description:"List files from a Google Drive folder",audience:"both",aiMetadata:{description:"Lists files and subfolders inside a given Drive folder, with optional recursion to a chosen depth and optional download of each file's content. Use to enumerate the contents of a known folder ID. Read-only and idempotent. Requires the folder ID, not a name.",idempotent:!0},props:{folderId:oe.ShortText({displayName:"Folder ID",description:"Folder ID coming from | New Folder -> id | (or any other source)",required:!0}),include_team_drives:ke.properties.include_team_drives,includeTrashed:oe.Checkbox({displayName:"Include Trashed",description:"Include new files that have been trashed.",required:!1,defaultValue:!1}),depthLevel:oe.Number({displayName:"Depth Level",description:"How many levels deep to search for files. 1 = current folder only, 2 = current + next level, etc.",required:!1,defaultValue:1}),downloadFiles:oe.Checkbox({displayName:"Download Files",description:"Download all file contents in a list",required:!1,defaultValue:!1})},outputSchema:mE,async run(t){let e={type:"drive#fileList",incompleteSearch:!1,files:[]},r=t.propsValue.depthLevel||1,n=await FE(t.auth,t.propsValue.folderId,r,t.propsValue.includeTrashed??!1,t.propsValue.include_team_drives??!1);if(e.files=n.map(i=>i.file),t.propsValue.downloadFiles){let i=[],a={"application/pdf":".pdf","image/jpeg":".jpg","image/png":".png","image/tiff":".tiff","text/plain":".txt","text/csv":".csv","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":".xlsx"};for(let f of n){let m=f.file;if(m.mimeType==="application/vnd.google-apps.folder")continue;let h=m.name,_=a[m.mimeType];_&&!h.toLowerCase().endsWith(_)&&(m.mimeType==="image/jpeg"&&h.toLowerCase().endsWith(".jpeg")||(h=h+_));try{let P=await Hn(t.auth,t.files,m.id,h);i.push(P)}catch(P){console.warn(`Failed to download file ${m.name}: ${P instanceof Error?P.message:"Download failed"}`)}}e.downloadedFiles=i}return e}});var qE=qe({auth:Oe,name:"read-file",displayName:"Read File Content",description:"Read a selected file from google drive file",audience:"both",aiMetadata:{description:"Downloads the content of a Drive file by its file ID and returns it as a usable file reference. Use to retrieve a file an agent already knows the ID of (e.g. from a trigger or search). Read-only and idempotent. Requires the exact file ID, not a name.",idempotent:!0},props:{fileId:oe.ShortText({displayName:"File ID",description:"File ID coming from | New File -> id |",required:!0}),fileName:oe.ShortText({displayName:"Destination File name",required:!1})},outputSchema:pE,run:o(async({auth:t,propsValue:e,files:r})=>Hn(t,r,e.fileId,e.fileName),"run")});var BE=ze(or()),VE=require("stream");var GE=qe({displayName:"Save Document as PDF",auth:Oe,name:"save_file_as_pdf",description:"Save a document as PDF in a Google Drive folder",audience:"both",aiMetadata:{description:"Exports a Google document to PDF and saves it as a new file in a target Drive folder. Use to produce a PDF rendition of a Google Doc/Sheet/Slides for sharing or archival. Requires the source document ID and destination folder ID. Not idempotent: each call creates a new PDF file.",idempotent:!1},props:{documentId:oe.ShortText({displayName:"Document ID",description:"The ID of the document to export",required:!0}),folderId:oe.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be exported",required:!0}),name:oe.ShortText({displayName:"Name",description:"The name of the new file (do not include the extension)",required:!0}),include_team_drives:ke.properties.include_team_drives},outputSchema:yE,async run(t){let e=await Ye(t.auth),r=t.propsValue.documentId,n=t.propsValue.folderId,i=t.propsValue.name,a=(0,BE.drive)({version:"v3",auth:e}),f=await a.files.export({fileId:r,mimeType:"application/pdf"},{responseType:"arraybuffer"}),m={name:i+".pdf",parents:[n]},h=Buffer.from(f.data,"base64"),P={mimeType:"application/pdf",body:new VE.Stream.PassThrough().end(h)};return(await a.files.create({requestBody:m,media:P,supportsAllDrives:t.propsValue.include_team_drives})).data}});var HE=ze(or());var WE=qe({auth:Oe,name:"search-folder",displayName:"Search",description:"Search a Google Drive folder for files/sub-folders",audience:"both",aiMetadata:{description:"Searches Google Drive for files or folders matching a name, full-text, or MIME-type query, optionally scoped to a parent folder and filtered to files or folders only. Use to resolve a file/folder ID from a human-readable name before acting on it. Read-only and idempotent.",idempotent:!0},props:{queryTerm:oe.StaticDropdown({displayName:"Query Term",description:"The Query term or field of file/folder to search upon.",defaultValue:"name",options:{options:[{label:"File name",value:"name"},{label:"Full text search",value:"fullText"},{label:"Content type",value:"mimeType"}]},required:!0}),operator:oe.StaticDropdown({displayName:"Operator",description:"The operator to create criteria.",required:!0,options:{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"="}]},defaultValue:"contains"}),query:oe.ShortText({displayName:"Value",description:"Value of the field of file/folder to search for.",required:!0}),type:oe.StaticDropdown({displayName:"File Type",description:"(Optional) Choose between files and folders.",required:!1,options:{options:[{label:"All",value:"all"},{label:"Files",value:"file"},{label:"Folders",value:"folder"}]},defaultValue:"all"}),parentFolder:ke.properties.parentFolder,include_team_drives:ke.properties.include_team_drives},outputSchema:hE,async run(t){let e=await Ye(t.auth),r=(0,HE.drive)({version:"v3",auth:e}),n=t.propsValue.operator??"contains",a=`${t.propsValue.queryTerm??"name"} ${n} '${t.propsValue.query}'`;switch(t.propsValue.parentFolder&&(a=`${a} and '${t.propsValue.parentFolder}' in parents`),t.propsValue.type??"all"){case"file":a=`${a} and mimeType!='application/vnd.google-apps.folder'`;break;case"folder":a=`${a} and mimeType='application/vnd.google-apps.folder'`;break;default:break}let m=[],h;do{let _={q:a,fields:"nextPageToken, files(id, name, mimeType, createdTime, modifiedTime)",includeItemsFromAllDrives:t.propsValue.include_team_drives,supportsAllDrives:!0,corpora:t.propsValue.include_team_drives?"allDrives":"user",pageSize:1e3};h&&(_.pageToken=h);let P=await r.files.list(_);if(P.status!==200)throw console.error(P),new Error("Error searching for the file/folder");m.push(...P.data.files??[]),h=P.data.nextPageToken??void 0}while(h);return m.length>0?m:(console.log("Resource not found"),[])}});var ZE=ze(nu());var KE=ze(Za());var JE=qe({auth:Oe,name:"upload_gdrive_file",description:"Upload a file in your Google Drive",audience:"both",aiMetadata:{description:"Uploads a binary file (from a URL or base64 input) into Google Drive, optionally inside a parent folder. Use to store an existing file or attachment in Drive; the MIME type is inferred from the file extension. Not idempotent: each call creates a new file.",idempotent:!1},displayName:"Upload file",props:{fileName:oe.ShortText({displayName:"File name",description:"The name of the file",required:!0}),file:oe.File({displayName:"File",description:"The file URL or base64 to upload",required:!0}),parentFolder:ke.properties.parentFolder,include_team_drives:ke.properties.include_team_drives},outputSchema:dE,async run(t){let e=t.propsValue.file,n={mimeType:KE.default.lookup(e.extension?e.extension:""),name:t.propsValue.fileName,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},i=Buffer.from(JSON.stringify(n),"utf-8"),a=Buffer.from(e.base64,"base64"),f=new ZE.default;f.append("Metadata",i,{contentType:"application/json"}),f.append("Media",a);let m=await Pr.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files",queryParams:{uploadType:"multipart",supportsAllDrives:String(t.propsValue.include_team_drives||!1)},body:f,headers:{...f.getHeaders()},authentication:{type:"BEARER_TOKEN",token:await Rt(t.auth)}});return console.debug("File upload response",m),m.body}});var XE=ze(Mc());var Fc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await ke.getFiles(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(a=>({epochMilliSeconds:(0,XE.default)(a.createdTime).valueOf(),data:a})),"items")},QE=La({auth:Oe,name:"new_file",displayName:"New File",description:"Trigger when a new file is uploaded.",aiMetadata:{description:"Fires when a new file appears in Google Drive, optionally scoped to a specific parent folder. Each event represents one newly created file and its metadata, with optional inclusion of the file content."},props:{parentFolder:ke.properties.parentFolder,include_team_drives:ke.properties.include_team_drives,include_file_content:oe.Checkbox({displayName:"Include File Content",description:"Include the file content in the output. This will increase the time taken to fetch the files and might cause issues with large files.",required:!1,defaultValue:!1})},outputSchema:SE,type:"POLLING",onEnable:o(async t=>{await Nr.onEnable(Fc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:o(async t=>{await Nr.onDisable(Fc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:o(async t=>{let e=await Nr.poll(Fc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await YE(e,t)},"run"),test:o(async t=>{let e=await Nr.test(Fc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await YE(e,t)},"test"),sampleData:{kind:"drive#file",mimeType:"image/png",id:"1dpv4-sKJfKRwI9qx1vWqQhEGEn3EpbI5",name:"google-drive.png",link:"https://cdn.activepieces.com/pieces/google-drive.png"}});async function YE(t,e){let r=JSON.parse(JSON.stringify(t));if(e.propsValue.include_file_content){let n=[];for(let a of r)n.push(Hn(e.auth,e.files,a.id,a.name));let i=await Promise.all(n);for(let a=0;a<r.length;a++)r[a].content=i[a]}return r}o(YE,"handleFileContent");var eb=ze(Mc());var Lc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await ke.getFolders(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(a=>({epochMilliSeconds:(0,eb.default)(a.createdTime).valueOf(),data:a})),"items")},tb=La({auth:Oe,name:"new_folder",displayName:"New Folder",description:"Trigger when a new folder is created or uploaded.",aiMetadata:{description:"Fires when a new folder is created in Google Drive, optionally scoped to a specific parent folder. Each event represents one newly created folder and its metadata."},props:{parentFolder:ke.properties.parentFolder,include_team_drives:ke.properties.include_team_drives},outputSchema:TE,type:"POLLING",onEnable:o(async t=>{await Nr.onEnable(Lc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:o(async t=>{await Nr.onDisable(Lc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:o(async t=>await Nr.poll(Lc,t),"run"),test:o(async t=>await Nr.test(Lc,t),"test"),sampleData:{kind:"drive#file",mimeType:"application/vnd.google-apps.folder",id:"1aMEtTqIYn5651wdK7WLxaK_SDim4mvXW",name:"New Folder WOOOO"}});var rb=ze(or());var nb=qe({auth:Oe,name:"set_public_access",description:"Set public access for a file or folder",audience:"both",aiMetadata:{description:"Makes a Drive file or folder accessible to anyone with the link at the chosen role (reader, commenter, or writer) and returns its shareable view/download URL. Use to publish a resource publicly. Requires the file/folder ID. Not idempotent: each call adds a new anyone-with-link permission.",idempotent:!1},displayName:"Set public access",props:{fileId:oe.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),role:oe.StaticDropdown({displayName:"Role",description:"The role to assign for public access",options:{options:[{label:"Reader",value:"reader"},{label:"Commenter",value:"commenter"},{label:"Editor",value:"writer"}]},defaultValue:"reader",required:!0})},outputSchema:_E,async run(t){let e=await Ye(t.auth),r=t.propsValue.fileId,n=t.propsValue.role,i=(0,rb.drive)({version:"v3",auth:e}),a={role:n,type:"anyone"},f=await i.permissions.create({fileId:r,requestBody:a}),m=await i.files.get({fileId:r,fields:"name,mimeType,webContentLink,webViewLink"});if(m.data.mimeType==="application/vnd.google-apps.folder")return{...f.data,webViewLink:m.data.webViewLink,downloadUrl:null};let h=await Hn(t.auth,t.files,r,m.data.name);return{...f.data,downloadUrl:h}}});var ob=ze(or());var ib=qe({auth:Oe,name:"google-drive-move-file",displayName:"Move File",description:"Moves a file from one folder to another.",audience:"both",aiMetadata:{description:"Relocates a Drive file to a target folder, detaching it from its current parents and attaching it to the new one. Use to reorganize a file once you know its ID and the destination folder ID. Idempotent: repeating with the same destination leaves the file in the same folder.",idempotent:!0},props:{fileId:oe.ShortText({displayName:"File ID",description:"You can use **Search Folder/File** action to retrieve ID.",required:!0}),include_team_drives:ke.properties.include_team_drives,folderId:ke.properties.parentFolder},outputSchema:vE,async run(t){let e=t.propsValue.fileId,r=t.propsValue.folderId,n=await Ye(t.auth),i=(0,ob.drive)({version:"v3",auth:n}),a=await i.files.get({fileId:e,supportsAllDrives:t.propsValue.include_team_drives,fields:"id,parents"});return(await i.files.update({fileId:e,fields:"*",removeParents:a.data.parents?.join(","),addParents:r,supportsAllDrives:t.propsValue.include_team_drives})).data}});var sb=ze(or()),ab=qe({auth:Oe,name:"delete_gdrive_file",description:"Delete permanently a file from your Google Drive",audience:"both",aiMetadata:{description:"Permanently deletes a file from Google Drive by its ID, bypassing the trash and making it unrecoverable. Use only when permanent removal is intended; prefer Trash file for reversible deletion. Requires the file ID. Not idempotent: a repeat call fails because the file no longer exists.",idempotent:!1},displayName:"Delete file",props:{fileId:oe.ShortText({displayName:"File ID",description:"The ID of the file to delete",required:!0}),include_team_drives:ke.properties.include_team_drives},async run(t){let e=await Ye(t.auth);return(await(0,sb.drive)({version:"v3",auth:e}).files.delete({fileId:t.propsValue.fileId,supportsAllDrives:t.propsValue.include_team_drives})).data}});var ub=ze(or());var cb=qe({auth:Oe,name:"trash_gdrive_file",description:"Move a file to the trash in your Google Drive",audience:"both",aiMetadata:{description:"Moves a Drive file to the trash by its ID, a reversible deletion that can be restored from Drive. Use for safe removal instead of permanent deletion. Requires the file ID. Idempotent: re-trashing an already-trashed file leaves it in the same state.",idempotent:!0},displayName:"Trash file",props:{fileId:oe.ShortText({displayName:"File ID",description:"The ID of the file to trash",required:!0}),include_team_drives:ke.properties.include_team_drives},outputSchema:xE,async run(t){let e=await Ye(t.auth),r=(0,ub.drive)({version:"v3",auth:e}),n={trashed:!0};return(await r.files.update({fileId:t.propsValue.fileId,supportsAllDrives:t.propsValue.include_team_drives,requestBody:n})).data}});var uj=$y({minimumSupportedRelease:"0.5.6",logoUrl:"https://cdn.activepieces.com/pieces/google-drive.png",categories:["CONTENT_AND_FILES"],displayName:"Google Drive",description:"Cloud storage and file backup",authors:["BastienMe","ArmanGiau3","Vitalini","pfernandez98","kanarelo","Salem-Alaa","kishanprmr","MoShizzle","AbdulTheActivePiecer","khaledmashaly","abuaboud","geekyme"],triggers:[QE,tb],actions:[IE,$E,JE,qE,UE,LE,WE,NE,GE,bE,DE,nb,ib,ab,cb,k_({baseUrl:o(()=>"https://www.googleapis.com/drive/v3","baseUrl"),auth:Oe,authMapping:o(async t=>({Authorization:`Bearer ${await Rt(t)}`}),"authMapping")})],auth:Oe});0&&(module.exports={createGoogleClient,getAccessToken,googleDrive,googleDriveAuth});
|
|
72
|
+
/*! Bundled license information:
|
|
73
|
+
|
|
74
|
+
mime-types/index.js:
|
|
75
|
+
(*!
|
|
76
|
+
* mime-types
|
|
77
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
78
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
79
|
+
* MIT Licensed
|
|
80
|
+
*)
|
|
81
|
+
|
|
82
|
+
web-streams-polyfill/dist/ponyfill.es2018.js:
|
|
83
|
+
(**
|
|
84
|
+
* @license
|
|
85
|
+
* web-streams-polyfill v3.3.3
|
|
86
|
+
* Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
|
|
87
|
+
* This code is released under the MIT license.
|
|
88
|
+
* SPDX-License-Identifier: MIT
|
|
89
|
+
*)
|
|
90
|
+
|
|
91
|
+
fetch-blob/index.js:
|
|
92
|
+
(*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
93
|
+
|
|
94
|
+
formdata-polyfill/esm.min.js:
|
|
95
|
+
(*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
96
|
+
|
|
97
|
+
node-domexception/index.js:
|
|
98
|
+
(*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
99
|
+
|
|
100
|
+
safe-buffer/index.js:
|
|
101
|
+
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
102
|
+
|
|
103
|
+
gtoken/build/cjs/src/index.cjs:
|
|
104
|
+
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
|
|
105
|
+
|
|
106
|
+
@googleapis/drive/build/index.js:
|
|
107
|
+
(*! THIS FILE IS AUTO-GENERATED *)
|
|
108
|
+
*/
|