@activepieces/piece-stripe 0.6.12 → 0.6.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +11 -11
package/src/index.js CHANGED
@@ -1,19 +1,19 @@
1
- "use strict";var h_=Object.create;var wr=Object.defineProperty;var y_=Object.getOwnPropertyDescriptor;var g_=Object.getOwnPropertyNames;var v_=Object.getPrototypeOf,__=Object.prototype.hasOwnProperty;var a=(e,t)=>wr(e,"name",{value:t,configurable:!0});var C=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},zn=(e,t)=>{for(var r in t)wr(e,r,{get:t[r],enumerable:!0})},zs=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of g_(t))!__.call(e,o)&&o!==r&&wr(e,o,{get:()=>t[o],enumerable:!(n=y_(t,o))||n.enumerable});return e};var Me=(e,t,r)=>(r=e!=null?h_(v_(e)):{},zs(t||!e||!e.__esModule?wr(r,"default",{value:e,enumerable:!0}):r,e)),b_=e=>zs(wr({},"__esModule",{value:!0}),e);var ic=C((oc,no)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),i="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(i,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${i})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${i})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${t}\\.${t}\\.${t}\\.${t}(${i})?$`,"i")};function d(p,h){if(p.indexOf("::")!==p.lastIndexOf("::"))return null;let E=0,S=-1,T=(p.match(l.zoneIndex)||[])[0],A,k;for(T&&(T=T.substring(1),p=p.replace(/%.+$/,""));(S=p.indexOf(":",S+1))>=0;)E++;if(p.substr(0,2)==="::"&&E--,p.substr(-2,2)==="::"&&E--,E>h)return null;for(k=h-E,A=":";k--;)A+="0:";return p=p.replace("::",A),p[0]===":"&&(p=p.slice(1)),p[p.length-1]===":"&&(p=p.slice(0,-1)),h=(function(){let F=p.split(":"),Y=[];for(let Ae=0;Ae<F.length;Ae++)Y.push(parseInt(F[Ae],16));return Y})(),{parts:h,zoneId:T}}a(d,"expandIPv6");function b(p,h,E,S){if(p.length!==h.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let T=0,A;for(;S>0;){if(A=E-S,A<0&&(A=0),p[T]>>A!==h[T]>>A)return!1;S-=E,T+=1}return!0}a(b,"matchCIDR");function m(p){if(o.test(p))return parseInt(p,16);if(p[0]==="0"&&!isNaN(parseInt(p[1],10))){if(n.test(p))return parseInt(p,8);throw new Error(`ipaddr: cannot parse ${p} as octal`)}return parseInt(p,10)}a(m,"parseIntAuto");function P(p,h){for(;p.length<h;)p=`0${p}`;return p}a(P,"padPart");let y={};y.IPv4=(function(){function p(h){if(h.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let E,S;for(E=0;E<h.length;E++)if(S=h[E],!(0<=S&&S<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=h}return a(p,"IPv4"),p.prototype.SpecialRanges={unspecified:[[new p([0,0,0,0]),8]],broadcast:[[new p([255,255,255,255]),32]],multicast:[[new p([224,0,0,0]),4]],linkLocal:[[new p([169,254,0,0]),16]],loopback:[[new p([127,0,0,0]),8]],carrierGradeNat:[[new p([100,64,0,0]),10]],private:[[new p([10,0,0,0]),8],[new p([172,16,0,0]),12],[new p([192,168,0,0]),16]],reserved:[[new p([192,0,0,0]),24],[new p([192,0,2,0]),24],[new p([192,88,99,0]),24],[new p([198,18,0,0]),15],[new p([198,51,100,0]),24],[new p([203,0,113,0]),24],[new p([240,0,0,0]),4]],as112:[[new p([192,175,48,0]),24],[new p([192,31,196,0]),24]],amt:[[new p([192,52,193,0]),24]]},p.prototype.kind=function(){return"ipv4"},p.prototype.match=function(h,E){let S;if(E===void 0&&(S=h,h=S[0],E=S[1]),h.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return b(this.octets,h.octets,8,E)},p.prototype.prefixLengthFromSubnetMask=function(){let h=0,E=!1,S={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},T,A,k;for(T=3;T>=0;T-=1)if(A=this.octets[T],A in S){if(k=S[A],E&&k!==0)return null;k!==8&&(E=!0),h+=k}else return null;return 32-h},p.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){return this.octets.slice(0)},p.prototype.toIPv4MappedAddress=function(){return y.IPv6.parse(`::ffff:${this.toString()}`)},p.prototype.toNormalizedString=function(){return this.toString()},p.prototype.toString=function(){return this.octets.join(".")},p})(),y.IPv4.broadcastAddressFromCIDR=function(p){try{let h=this.parseCIDR(p),E=h[0].toByteArray(),S=this.subnetMaskFromPrefixLength(h[1]).toByteArray(),T=[],A=0;for(;A<4;)T.push(parseInt(E[A],10)|parseInt(S[A],10)^255),A++;return new this(T)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.isIPv4=function(p){return this.parser(p)!==null},y.IPv4.isValid=function(p){try{return new this(this.parser(p)),!0}catch{return!1}},y.IPv4.isValidCIDR=function(p){try{return this.parseCIDR(p),!0}catch{return!1}},y.IPv4.isValidFourPartDecimal=function(p){return!!(y.IPv4.isValid(p)&&p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},y.IPv4.isValidCIDRFourPartDecimal=function(p){let h=p.match(/^(.+)\/(\d+)$/);return!y.IPv4.isValidCIDR(p)||!h?!1:y.IPv4.isValidFourPartDecimal(h[1])},y.IPv4.networkAddressFromCIDR=function(p){let h,E,S,T,A;try{for(h=this.parseCIDR(p),S=h[0].toByteArray(),A=this.subnetMaskFromPrefixLength(h[1]).toByteArray(),T=[],E=0;E<4;)T.push(parseInt(S[E],10)&parseInt(A[E],10)),E++;return new this(T)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.parse=function(p){let h=this.parser(p);if(h===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(h)},y.IPv4.parseCIDR=function(p){let h;if(h=p.match(/^(.+)\/(\d+)$/)){let E=parseInt(h[2]);if(E>=0&&E<=32){let S=[this.parse(h[1]),E];return Object.defineProperty(S,"toString",{value:a(function(){return this.join("/")},"value")}),S}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},y.IPv4.parser=function(p){let h,E,S;if(h=p.match(r.fourOctet))return(function(){let T=h.slice(1,6),A=[];for(let k=0;k<T.length;k++)E=T[k],A.push(m(E));return A})();if(h=p.match(r.longValue)){if(S=m(h[1]),S>4294967295||S<0)throw new Error("ipaddr: address outside defined range");return(function(){let T=[],A;for(A=0;A<=24;A+=8)T.push(S>>A&255);return T})().reverse()}else return(h=p.match(r.twoOctet))?(function(){let T=h.slice(1,4),A=[];if(S=m(T[1]),S>16777215||S<0)throw new Error("ipaddr: address outside defined range");return A.push(m(T[0])),A.push(S>>16&255),A.push(S>>8&255),A.push(S&255),A})():(h=p.match(r.threeOctet))?(function(){let T=h.slice(1,5),A=[];if(S=m(T[2]),S>65535||S<0)throw new Error("ipaddr: address outside defined range");return A.push(m(T[0])),A.push(m(T[1])),A.push(S>>8&255),A.push(S&255),A})():null},y.IPv4.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>32)throw new Error("ipaddr: invalid IPv4 prefix length");let h=[0,0,0,0],E=0,S=Math.floor(p/8);for(;E<S;)h[E]=255,E++;return S<4&&(h[S]=Math.pow(2,p%8)-1<<8-p%8),new this(h)},y.IPv6=(function(){function p(h,E){let S,T;if(h.length===16)for(this.parts=[],S=0;S<=14;S+=2)this.parts.push(h[S]<<8|h[S+1]);else if(h.length===8)this.parts=h;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(S=0;S<this.parts.length;S++)if(T=this.parts[S],!(0<=T&&T<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");E&&(this.zoneId=E)}return a(p,"IPv6"),p.prototype.SpecialRanges={unspecified:[new p([0,0,0,0,0,0,0,0]),128],linkLocal:[new p([65152,0,0,0,0,0,0,0]),10],multicast:[new p([65280,0,0,0,0,0,0,0]),8],loopback:[new p([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new p([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new p([0,0,0,0,0,65535,0,0]),96],discard:[new p([256,0,0,0,0,0,0,0]),64],rfc6145:[new p([0,0,0,0,65535,0,0,0]),96],rfc6052:[new p([100,65435,0,0,0,0,0,0]),96],"6to4":[new p([8194,0,0,0,0,0,0,0]),16],teredo:[new p([8193,0,0,0,0,0,0,0]),32],benchmarking:[new p([8193,2,0,0,0,0,0,0]),48],amt:[new p([8193,3,0,0,0,0,0,0]),32],as112v6:[[new p([8193,4,274,0,0,0,0,0]),48],[new p([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new p([8193,16,0,0,0,0,0,0]),28],orchid2:[new p([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new p([8193,48,0,0,0,0,0,0]),28],reserved:[[new p([8193,0,0,0,0,0,0,0]),23],[new p([8193,3512,0,0,0,0,0,0]),32]]},p.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},p.prototype.kind=function(){return"ipv6"},p.prototype.match=function(h,E){let S;if(E===void 0&&(S=h,h=S[0],E=S[1]),h.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return b(this.parts,h.parts,16,E)},p.prototype.prefixLengthFromSubnetMask=function(){let h=0,E=!1,S={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},T,A;for(let k=7;k>=0;k-=1)if(T=this.parts[k],T in S){if(A=S[T],E&&A!==0)return null;A!==16&&(E=!0),h+=A}else return null;return 128-h},p.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){let h,E=[],S=this.parts;for(let T=0;T<S.length;T++)h=S[T],E.push(h>>8),E.push(h&255);return E},p.prototype.toFixedLengthString=function(){let h=(function(){let S=[];for(let T=0;T<this.parts.length;T++)S.push(P(this.parts[T].toString(16),4));return S}).call(this).join(":"),E="";return this.zoneId&&(E=`%${this.zoneId}`),h+E},p.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let h=this.parts.slice(-2),E=h[0],S=h[1];return new y.IPv4([E>>8,E&255,S>>8,S&255])},p.prototype.toNormalizedString=function(){let h=(function(){let S=[];for(let T=0;T<this.parts.length;T++)S.push(this.parts[T].toString(16));return S}).call(this).join(":"),E="";return this.zoneId&&(E=`%${this.zoneId}`),h+E},p.prototype.toRFC5952String=function(){let h=/((^|:)(0(:|$)){2,})/g,E=this.toNormalizedString(),S=0,T=-1,A;for(;A=h.exec(E);)A[0].length>T&&(S=A.index,T=A[0].length);return T<0?E:`${E.substring(0,S)}::${E.substring(S+T)}`},p.prototype.toString=function(){return this.toRFC5952String()},p})(),y.IPv6.broadcastAddressFromCIDR=function(p){try{let h=this.parseCIDR(p),E=h[0].toByteArray(),S=this.subnetMaskFromPrefixLength(h[1]).toByteArray(),T=[],A=0;for(;A<16;)T.push(parseInt(E[A],10)|parseInt(S[A],10)^255),A++;return new this(T)}catch(h){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${h})`)}},y.IPv6.isIPv6=function(p){return this.parser(p)!==null},y.IPv6.isValid=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{let h=this.parser(p);return new this(h.parts,h.zoneId),!0}catch{return!1}},y.IPv6.isValidCIDR=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{return this.parseCIDR(p),!0}catch{return!1}},y.IPv6.networkAddressFromCIDR=function(p){let h,E,S,T,A;try{for(h=this.parseCIDR(p),S=h[0].toByteArray(),A=this.subnetMaskFromPrefixLength(h[1]).toByteArray(),T=[],E=0;E<16;)T.push(parseInt(S[E],10)&parseInt(A[E],10)),E++;return new this(T)}catch(k){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${k})`)}},y.IPv6.parse=function(p){let h=this.parser(p);if(h.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(h.parts,h.zoneId)},y.IPv6.parseCIDR=function(p){let h,E,S;if((E=p.match(/^(.+)\/(\d+)$/))&&(h=parseInt(E[2]),h>=0&&h<=128))return S=[this.parse(E[1]),h],Object.defineProperty(S,"toString",{value:a(function(){return this.join("/")},"value")}),S;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},y.IPv6.parser=function(p){let h,E,S,T,A,k;if(S=p.match(l.deprecatedTransitional))return this.parser(`::ffff:${S[1]}`);if(l.native.test(p))return d(p,8);if((S=p.match(l.transitional))&&(k=S[6]||"",h=S[1],S[1].endsWith("::")||(h=h.slice(0,-1)),h=d(h+k,6),h.parts)){for(A=[parseInt(S[2]),parseInt(S[3]),parseInt(S[4]),parseInt(S[5])],E=0;E<A.length;E++)if(T=A[E],!(0<=T&&T<=255))return null;return h.parts.push(A[0]<<8|A[1]),h.parts.push(A[2]<<8|A[3]),{parts:h.parts,zoneId:h.zoneId}}return null},y.IPv6.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>128)throw new Error("ipaddr: invalid IPv6 prefix length");let h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E=0,S=Math.floor(p/8);for(;E<S;)h[E]=255,E++;return S<16&&(h[S]=Math.pow(2,p%8)-1<<8-p%8),new this(h)},y.fromByteArray=function(p){let h=p.length;if(h===4)return new y.IPv4(p);if(h===16)return new y.IPv6(p);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},y.isValid=function(p){return y.IPv6.isValid(p)||y.IPv4.isValid(p)},y.isValidCIDR=function(p){return y.IPv6.isValidCIDR(p)||y.IPv4.isValidCIDR(p)},y.parse=function(p){if(y.IPv6.isValid(p))return y.IPv6.parse(p);if(y.IPv4.isValid(p))return y.IPv4.parse(p);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},y.parseCIDR=function(p){try{return y.IPv6.parseCIDR(p)}catch{try{return y.IPv4.parseCIDR(p)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},y.process=function(p){let h=this.parse(p);return h.kind()==="ipv6"&&h.isIPv4MappedAddress()?h.toIPv4Address():h},y.subnetMatch=function(p,h,E){let S,T,A,k;E==null&&(E="unicast");for(T in h)if(Object.prototype.hasOwnProperty.call(h,T)){for(A=h[T],A[0]&&!(A[0]instanceof Array)&&(A=[A]),S=0;S<A.length;S++)if(k=A[S],p.kind()===k[0].kind()&&p.match.apply(p,k))return T}return E},typeof no<"u"&&no.exports?no.exports=y:e.ipaddr=y})(oc)});var al=C((vq,il)=>{var ol=require("stream").Stream,rx=require("util");il.exports=Le;function Le(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}a(Le,"DelayedStream");rx.inherits(Le,ol);Le.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(Le.prototype,"readable",{configurable:!0,enumerable:!0,get:a(function(){return this.source.readable},"get")});Le.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Le.prototype.resume=function(){this._released||this.release(),this.source.resume()};Le.prototype.pause=function(){this.source.pause()};Le.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};Le.prototype.pipe=function(){var e=ol.prototype.pipe.apply(this,arguments);return this.resume(),e};Le.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};Le.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var ll=C((bq,cl)=>{var nx=require("util"),ul=require("stream").Stream,sl=al();cl.exports=ce;function ce(){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}a(ce,"CombinedStream");nx.inherits(ce,ul);ce.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};ce.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};ce.prototype.append=function(e){var t=ce.isStreamLike(e);if(t){if(!(e instanceof sl)){var r=sl.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};ce.prototype.pipe=function(e,t){return ul.prototype.pipe.call(this,e,t),this.resume(),e};ce.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}};ce.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=ce.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ce.prototype._pipeNext=function(e){this._currentStream=e;var t=ce.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};ce.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};ce.prototype.write=function(e){this.emit("data",e)};ce.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ce.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")};ce.prototype.end=function(){this._reset(),this.emit("end")};ce.prototype.destroy=function(){this._reset(),this.emit("close")};ce.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ce.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};ce.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};ce.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var dl=C((xq,pl)=>{"use strict";pl.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 hl=C(we=>{"use strict";var uo=dl(),ox=require("path").extname,ml=/^\s*([^;\s]*)(?:;|\s|$)/,ix=/^text\//i;we.charset=fl;we.charsets={lookup:fl};we.contentType=ax;we.extension=sx;we.extensions=Object.create(null);we.lookup=ux;we.types=Object.create(null);cx(we.extensions,we.types);function fl(e){if(!e||typeof e!="string")return!1;var t=ml.exec(e),r=t&&uo[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&ix.test(t[1])?"UTF-8":!1}a(fl,"charset");function ax(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?we.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=we.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}a(ax,"contentType");function sx(e){if(!e||typeof e!="string")return!1;var t=ml.exec(e),r=t&&we.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}a(sx,"extension");function ux(e){if(!e||typeof e!="string")return!1;var t=ox("x."+e).toLowerCase().substr(1);return t&&we.types[t]||!1}a(ux,"lookup");function cx(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(uo).forEach(a(function(o){var i=uo[o],s=i.extensions;if(!(!s||!s.length)){e[o]=s;for(var l=0;l<s.length;l++){var d=s[l];if(t[d]){var b=r.indexOf(uo[t[d]].source),m=r.indexOf(i.source);if(t[d]!=="application/octet-stream"&&(b>m||b===m&&t[d].substr(0,12)==="application/"))continue}t[d]=o}}},"forEachMimeType"))}a(cx,"populateMaps")});var gl=C((Eq,yl)=>{yl.exports=lx;function lx(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}a(lx,"defer")});var la=C((Aq,_l)=>{var vl=gl();_l.exports=px;function px(e){var t=!1;return vl(function(){t=!0}),a(function(n,o){t?e(n,o):vl(a(function(){e(n,o)},"nextTick_callback"))},"async_callback")}a(px,"async")});var pa=C((wq,bl)=>{bl.exports=dx;function dx(e){Object.keys(e.jobs).forEach(mx.bind(e)),e.jobs={}}a(dx,"abort");function mx(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}a(mx,"clean")});var da=C((Rq,xl)=>{var Pl=la(),fx=pa();xl.exports=hx;function hx(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=yx(t,o,e[o],function(i,s){o in r.jobs&&(delete r.jobs[o],i?fx(r):r.results[o]=s,n(i,r.results))})}a(hx,"iterate");function yx(e,t,r,n){var o;return e.length==2?o=e(r,Pl(n)):o=e(r,t,Pl(n)),o}a(yx,"runJob")});var ma=C(($q,Sl)=>{Sl.exports=gx;function gx(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,i){return t(e[o],e[i])}),n}a(gx,"state")});var fa=C((Dq,Tl)=>{var vx=pa(),_x=la();Tl.exports=bx;function bx(e){Object.keys(this.jobs).length&&(this.index=this.size,vx(this),_x(e)(null,this.results))}a(bx,"terminator")});var Il=C((Mq,El)=>{var Px=da(),xx=ma(),Sx=fa();El.exports=Tx;function Tx(e,t,r){for(var n=xx(e);n.index<(n.keyedList||e).length;)Px(e,t,n,function(o,i){if(o){r(o,i);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Sx.bind(n,r)}a(Tx,"parallel")});var ha=C((Lq,co)=>{var Al=da(),Ex=ma(),Ix=fa();co.exports=Ax;co.exports.ascending=kl;co.exports.descending=kx;function Ax(e,t,r,n){var o=Ex(e,r);return Al(e,t,o,a(function i(s,l){if(s){n(s,l);return}if(o.index++,o.index<(o.keyedList||e).length){Al(e,t,o,i);return}n(null,o.results)},"iteratorHandler")),Ix.bind(o,n)}a(Ax,"serialOrdered");function kl(e,t){return e<t?-1:e>t?1:0}a(kl,"ascending");function kx(e,t){return-1*kl(e,t)}a(kx,"descending")});var Ol=C((jq,wl)=>{var wx=ha();wl.exports=Ox;function Ox(e,t,r){return wx(e,t,null,r)}a(Ox,"serial")});var Cl=C((Bq,Rl)=>{Rl.exports={parallel:Il(),serial:Ol(),serialOrdered:ha()}});var ya=C((Vq,$l)=>{"use strict";$l.exports=Object});var Dl=C((Gq,Nl)=>{"use strict";Nl.exports=Error});var Ml=C((Hq,zl)=>{"use strict";zl.exports=EvalError});var Ll=C((Zq,Ul)=>{"use strict";Ul.exports=RangeError});var jl=C((Wq,ql)=>{"use strict";ql.exports=ReferenceError});var Bl=C((Kq,Fl)=>{"use strict";Fl.exports=SyntaxError});var gt=C((Jq,Vl)=>{"use strict";Vl.exports=TypeError});var Hl=C((Xq,Gl)=>{"use strict";Gl.exports=URIError});var Wl=C((Yq,Zl)=>{"use strict";Zl.exports=Math.abs});var Jl=C((Qq,Kl)=>{"use strict";Kl.exports=Math.floor});var Yl=C((ej,Xl)=>{"use strict";Xl.exports=Math.max});var ep=C((tj,Ql)=>{"use strict";Ql.exports=Math.min});var rp=C((rj,tp)=>{"use strict";tp.exports=Math.pow});var op=C((nj,np)=>{"use strict";np.exports=Math.round});var ap=C((oj,ip)=>{"use strict";ip.exports=Number.isNaN||a(function(t){return t!==t},"isNaN")});var up=C((aj,sp)=>{"use strict";var Rx=ap();sp.exports=a(function(t){return Rx(t)||t===0?t:t<0?-1:1},"sign")});var lp=C((uj,cp)=>{"use strict";cp.exports=Object.getOwnPropertyDescriptor});var ga=C((cj,pp)=>{"use strict";var lo=lp();if(lo)try{lo([],"length")}catch{lo=null}pp.exports=lo});var mp=C((lj,dp)=>{"use strict";var po=Object.defineProperty||!1;if(po)try{po({},"a",{value:1})}catch{po=!1}dp.exports=po});var va=C((pj,fp)=>{"use strict";fp.exports=a(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var i in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var gp=C((mj,yp)=>{"use strict";var hp=typeof Symbol<"u"&&Symbol,Cx=va();yp.exports=a(function(){return typeof hp!="function"||typeof Symbol!="function"||typeof hp("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Cx()},"hasNativeSymbols")});var _a=C((hj,vp)=>{"use strict";vp.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var ba=C((yj,_p)=>{"use strict";var $x=ya();_p.exports=$x.getPrototypeOf||null});var xp=C((gj,Pp)=>{"use strict";var Nx="Function.prototype.bind called on incompatible ",Dx=Object.prototype.toString,zx=Math.max,Mx="[object Function]",bp=a(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var i=0;i<r.length;i+=1)n[i+t.length]=r[i];return n},"concatty"),Ux=a(function(t,r){for(var n=[],o=r||0,i=0;o<t.length;o+=1,i+=1)n[i]=t[o];return n},"slicy"),Lx=a(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Pp.exports=a(function(t){var r=this;if(typeof r!="function"||Dx.apply(r)!==Mx)throw new TypeError(Nx+r);for(var n=Ux(arguments,1),o,i=a(function(){if(this instanceof o){var m=r.apply(this,bp(n,arguments));return Object(m)===m?m:this}return r.apply(t,bp(n,arguments))},"binder"),s=zx(0,r.length-n.length),l=[],d=0;d<s;d++)l[d]="$"+d;if(o=Function("binder","return function ("+Lx(l,",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var b=a(function(){},"Empty");b.prototype=r.prototype,o.prototype=new b,b.prototype=null}return o},"bind")});var Yt=C((_j,Sp)=>{"use strict";var qx=xp();Sp.exports=Function.prototype.bind||qx});var mo=C((bj,Tp)=>{"use strict";Tp.exports=Function.prototype.call});var Pa=C((Pj,Ep)=>{"use strict";Ep.exports=Function.prototype.apply});var Ap=C((xj,Ip)=>{"use strict";Ip.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var wp=C((Sj,kp)=>{"use strict";var jx=Yt(),Fx=Pa(),Bx=mo(),Vx=Ap();kp.exports=Vx||jx.call(Bx,Fx)});var xa=C((Tj,Op)=>{"use strict";var Gx=Yt(),Hx=gt(),Zx=mo(),Wx=wp();Op.exports=a(function(t){if(t.length<1||typeof t[0]!="function")throw new Hx("a function is required");return Wx(Gx,Zx,t)},"callBindBasic")});var zp=C((Ij,Dp)=>{"use strict";var Kx=xa(),Rp=ga(),$p;try{$p=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Sa=!!$p&&Rp&&Rp(Object.prototype,"__proto__"),Np=Object,Cp=Np.getPrototypeOf;Dp.exports=Sa&&typeof Sa.get=="function"?Kx([Sa.get]):typeof Cp=="function"?a(function(t){return Cp(t==null?t:Np(t))},"getDunder"):!1});var jp=C((kj,qp)=>{"use strict";var Mp=_a(),Up=ba(),Lp=zp();qp.exports=Mp?a(function(t){return Mp(t)},"getProto"):Up?a(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Up(t)},"getProto"):Lp?a(function(t){return Lp(t)},"getProto"):null});var Ta=C((Oj,Fp)=>{"use strict";var Jx=Function.prototype.call,Xx=Object.prototype.hasOwnProperty,Yx=Yt();Fp.exports=Yx.call(Jx,Xx)});var Qr=C((Rj,Wp)=>{"use strict";var W,Qx=ya(),eS=Dl(),tS=Ml(),rS=Ll(),nS=jl(),rr=Bl(),tr=gt(),oS=Hl(),iS=Wl(),aS=Jl(),sS=Yl(),uS=ep(),cS=rp(),lS=op(),pS=up(),Hp=Function,Ea=a(function(e){try{return Hp('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Jr=ga(),dS=mp(),Ia=a(function(){throw new tr},"throwTypeError"),mS=Jr?(function(){try{return arguments.callee,Ia}catch{try{return Jr(arguments,"callee").get}catch{return Ia}}})():Ia,Qt=gp()(),_e=jp(),fS=ba(),hS=_a(),Zp=Pa(),Xr=mo(),er={},yS=typeof Uint8Array>"u"||!_e?W:_e(Uint8Array),Dt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?W:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?W:ArrayBuffer,"%ArrayIteratorPrototype%":Qt&&_e?_e([][Symbol.iterator]()):W,"%AsyncFromSyncIteratorPrototype%":W,"%AsyncFunction%":er,"%AsyncGenerator%":er,"%AsyncGeneratorFunction%":er,"%AsyncIteratorPrototype%":er,"%Atomics%":typeof Atomics>"u"?W:Atomics,"%BigInt%":typeof BigInt>"u"?W:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?W:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?W:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?W:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":eS,"%eval%":eval,"%EvalError%":tS,"%Float16Array%":typeof Float16Array>"u"?W:Float16Array,"%Float32Array%":typeof Float32Array>"u"?W:Float32Array,"%Float64Array%":typeof Float64Array>"u"?W:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?W:FinalizationRegistry,"%Function%":Hp,"%GeneratorFunction%":er,"%Int8Array%":typeof Int8Array>"u"?W:Int8Array,"%Int16Array%":typeof Int16Array>"u"?W:Int16Array,"%Int32Array%":typeof Int32Array>"u"?W:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Qt&&_e?_e(_e([][Symbol.iterator]())):W,"%JSON%":typeof JSON=="object"?JSON:W,"%Map%":typeof Map>"u"?W:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Qt||!_e?W:_e(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Qx,"%Object.getOwnPropertyDescriptor%":Jr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?W:Promise,"%Proxy%":typeof Proxy>"u"?W:Proxy,"%RangeError%":rS,"%ReferenceError%":nS,"%Reflect%":typeof Reflect>"u"?W:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?W:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Qt||!_e?W:_e(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?W:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Qt&&_e?_e(""[Symbol.iterator]()):W,"%Symbol%":Qt?Symbol:W,"%SyntaxError%":rr,"%ThrowTypeError%":mS,"%TypedArray%":yS,"%TypeError%":tr,"%Uint8Array%":typeof Uint8Array>"u"?W:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?W:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?W:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?W:Uint32Array,"%URIError%":oS,"%WeakMap%":typeof WeakMap>"u"?W:WeakMap,"%WeakRef%":typeof WeakRef>"u"?W:WeakRef,"%WeakSet%":typeof WeakSet>"u"?W:WeakSet,"%Function.prototype.call%":Xr,"%Function.prototype.apply%":Zp,"%Object.defineProperty%":dS,"%Object.getPrototypeOf%":fS,"%Math.abs%":iS,"%Math.floor%":aS,"%Math.max%":sS,"%Math.min%":uS,"%Math.pow%":cS,"%Math.round%":lS,"%Math.sign%":pS,"%Reflect.getPrototypeOf%":hS};if(_e)try{null.error}catch(e){Bp=_e(_e(e)),Dt["%Error.prototype%"]=Bp}var Bp,gS=a(function e(t){var r;if(t==="%AsyncFunction%")r=Ea("async function () {}");else if(t==="%GeneratorFunction%")r=Ea("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Ea("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&_e&&(r=_e(o.prototype))}return Dt[t]=r,r},"doEval"),Vp={__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"]},Yr=Yt(),fo=Ta(),vS=Yr.call(Xr,Array.prototype.concat),_S=Yr.call(Zp,Array.prototype.splice),Gp=Yr.call(Xr,String.prototype.replace),ho=Yr.call(Xr,String.prototype.slice),bS=Yr.call(Xr,RegExp.prototype.exec),PS=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xS=/\\(\\)?/g,SS=a(function(t){var r=ho(t,0,1),n=ho(t,-1);if(r==="%"&&n!=="%")throw new rr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new rr("invalid intrinsic syntax, expected opening `%`");var o=[];return Gp(t,PS,function(i,s,l,d){o[o.length]=l?Gp(d,xS,"$1"):s||i}),o},"stringToPath"),TS=a(function(t,r){var n=t,o;if(fo(Vp,n)&&(o=Vp[n],n="%"+o[0]+"%"),fo(Dt,n)){var i=Dt[n];if(i===er&&(i=gS(n)),typeof i>"u"&&!r)throw new tr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new rr("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Wp.exports=a(function(t,r){if(typeof t!="string"||t.length===0)throw new tr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new tr('"allowMissing" argument must be a boolean');if(bS(/^%?[^%]*%?$/,t)===null)throw new rr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=SS(t),o=n.length>0?n[0]:"",i=TS("%"+o+"%",r),s=i.name,l=i.value,d=!1,b=i.alias;b&&(o=b[0],_S(n,vS([0,1],b)));for(var m=1,P=!0;m<n.length;m+=1){var y=n[m],p=ho(y,0,1),h=ho(y,-1);if((p==='"'||p==="'"||p==="`"||h==='"'||h==="'"||h==="`")&&p!==h)throw new rr("property names with quotes must have matching quotes");if((y==="constructor"||!P)&&(d=!0),o+="."+y,s="%"+o+"%",fo(Dt,s))l=Dt[s];else if(l!=null){if(!(y in l)){if(!r)throw new tr("base intrinsic for "+t+" exists, but the property is not available.");return}if(Jr&&m+1>=n.length){var E=Jr(l,y);P=!!E,P&&"get"in E&&!("originalValue"in E.get)?l=E.get:l=l[y]}else P=fo(l,y),l=l[y];P&&!d&&(Dt[s]=l)}}return l},"GetIntrinsic")});var Jp=C(($j,Kp)=>{"use strict";var ES=va();Kp.exports=a(function(){return ES()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Qp=C((Dj,Yp)=>{"use strict";var IS=Qr(),Xp=IS("%Object.defineProperty%",!0),AS=Jp()(),kS=Ta(),wS=gt(),yo=AS?Symbol.toStringTag:null;Yp.exports=a(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new wS("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");yo&&(n||!kS(t,yo))&&(Xp?Xp(t,yo,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[yo]=r)},"setToStringTag")});var td=C((Mj,ed)=>{"use strict";var OS=Function.prototype.call,RS=Object.prototype.hasOwnProperty,CS=Yt();ed.exports=CS.call(OS,RS)});var nd=C((Uj,rd)=>{"use strict";rd.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var ad=C((Lj,id)=>{"use strict";var Oa=ll(),$S=require("util"),Aa=require("path"),NS=require("http"),DS=require("https"),zS=require("url").parse,MS=require("fs"),US=require("stream").Stream,LS=require("crypto"),ka=hl(),qS=Cl(),jS=Qp(),vt=td(),wa=nd();function od(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}a(od,"escapeHeaderParam");function K(e){if(!(this instanceof K))return new K(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Oa.call(this),e=e||{};for(var t in e)this[t]=e[t]}a(K,"FormData");$S.inherits(K,Oa);K.LINE_BREAK=`\r
2
- `;K.DEFAULT_CONTENT_TYPE="application/octet-stream";K.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Oa.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),i=this._multiPartFooter();n(o),n(t),n(i),this._trackLength(o,t,r)};K.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+K.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&vt(t,"httpVersion"))&&!(t instanceof US))&&(r.knownLength||this._valuesToMeasure.push(t))};K.prototype._lengthRetriever=function(e,t){vt(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):MS.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):vt(e,"httpVersion")?t(null,Number(e.headers["content-length"])):vt(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};K.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),i="",s={"Content-Disposition":["form-data",'name="'+od(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&wa(s,r.header);var l;for(var d in s)if(vt(s,d)){if(l=s[d],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(i+=d+": "+l.join("; ")+K.LINE_BREAK)}return"--"+this.getBoundary()+K.LINE_BREAK+i+K.LINE_BREAK};K.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=Aa.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Aa.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&vt(e,"httpVersion")&&(r=Aa.basename(e.client._httpMessage.path||"")),r)return'filename="'+od(r)+'"'};K.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=ka.lookup(e.name)),!r&&e&&e.path&&(r=ka.lookup(e.path)),!r&&e&&e.readable&&vt(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=ka.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=K.DEFAULT_CONTENT_TYPE),r};K.prototype._multiPartFooter=function(){return function(e){var t=K.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};K.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+K.LINE_BREAK};K.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)vt(e,t)&&(r[t.toLowerCase()]=e[t]);return r};K.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};K.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};K.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(K.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};K.prototype._generateBoundary=function(){this._boundary="--------------------------"+LS.randomBytes(12).toString("hex")};K.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};K.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};K.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}qS.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};K.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=zS(e),n=wa({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=wa(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=DS.request(n):r=NS.request(n),this.getLength(function(i,s){if(i&&i!=="Unknown stream"){this._error(i);return}if(s&&r.setHeader("Content-Length",s),this.pipe(r),t){var l,d=a(function(b,m){return r.removeListener("error",d),r.removeListener("response",l),t.call(this,b,m)},"callback");l=d.bind(this,null),r.on("error",d),r.on("response",l)}}.bind(this)),r};K.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};K.prototype.toString=function(){return"[object FormData]"};jS(K.prototype,"FormData");id.exports=K});var am=C((RF,im)=>{im.exports=require("util").inspect});var an=C((CF,Im)=>{var Ja=typeof Map=="function"&&Map.prototype,ja=Object.getOwnPropertyDescriptor&&Ja?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ao=Ja&&ja&&typeof ja.get=="function"?ja.get:null,sm=Ja&&Map.prototype.forEach,Xa=typeof Set=="function"&&Set.prototype,Fa=Object.getOwnPropertyDescriptor&&Xa?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ko=Xa&&Fa&&typeof Fa.get=="function"?Fa.get:null,um=Xa&&Set.prototype.forEach,tT=typeof WeakMap=="function"&&WeakMap.prototype,rn=tT?WeakMap.prototype.has:null,rT=typeof WeakSet=="function"&&WeakSet.prototype,nn=rT?WeakSet.prototype.has:null,nT=typeof WeakRef=="function"&&WeakRef.prototype,cm=nT?WeakRef.prototype.deref:null,oT=Boolean.prototype.valueOf,iT=Object.prototype.toString,aT=Function.prototype.toString,sT=String.prototype.match,Ya=String.prototype.slice,Et=String.prototype.replace,uT=String.prototype.toUpperCase,lm=String.prototype.toLowerCase,_m=RegExp.prototype.test,pm=Array.prototype.concat,He=Array.prototype.join,cT=Array.prototype.slice,dm=Math.floor,Ga=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ba=Object.getOwnPropertySymbols,Ha=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,cr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",on=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===cr||!0)?Symbol.toStringTag:null,bm=Object.prototype.propertyIsEnumerable,mm=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function fm(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||_m.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-dm(-e):dm(e);if(n!==e){var o=String(n),i=Ya.call(t,o.length+1);return Et.call(o,r,"$&_")+"."+Et.call(Et.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Et.call(t,r,"$&_")}a(fm,"addNumericSeparator");var Za=am(),hm=Za.custom,ym=Sm(hm)?hm:null,Pm={__proto__:null,double:'"',single:"'"},lT={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Im.exports=a(function e(t,r,n,o){var i=r||{};if(st(i,"quoteStyle")&&!st(Pm,i.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(st(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=st(i,"customInspect")?i.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(st(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(st(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=i.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Em(t,i);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var d=String(t);return l?fm(t,d):d}if(typeof t=="bigint"){var b=String(t)+"n";return l?fm(t,b):b}var m=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=m&&m>0&&typeof t=="object")return Wa(t)?"[Array]":"[Object]";var P=kT(i,n);if(typeof o>"u")o=[];else if(Tm(o,t)>=0)return"[Circular]";function y(ke,Ne,et){if(Ne&&(o=cT.call(o),o.push(Ne)),et){var kr={depth:i.depth};return st(i,"quoteStyle")&&(kr.quoteStyle=i.quoteStyle),e(ke,kr,n+1,o)}return e(ke,i,n+1,o)}if(a(y,"inspect"),typeof t=="function"&&!gm(t)){var p=_T(t),h=Io(t,y);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(h.length>0?" { "+He.call(h,", ")+" }":"")}if(Sm(t)){var E=cr?Et.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ha.call(t);return typeof t=="object"&&!cr?tn(E):E}if(ET(t)){for(var S="<"+lm.call(String(t.nodeName)),T=t.attributes||[],A=0;A<T.length;A++)S+=" "+T[A].name+"="+xm(pT(T[A].value),"double",i);return S+=">",t.childNodes&&t.childNodes.length&&(S+="..."),S+="</"+lm.call(String(t.nodeName))+">",S}if(Wa(t)){if(t.length===0)return"[]";var k=Io(t,y);return P&&!AT(k)?"["+Ka(k,P)+"]":"[ "+He.call(k,", ")+" ]"}if(mT(t)){var F=Io(t,y);return!("cause"in Error.prototype)&&"cause"in t&&!bm.call(t,"cause")?"{ ["+String(t)+"] "+He.call(pm.call("[cause]: "+y(t.cause),F),", ")+" }":F.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+He.call(F,", ")+" }"}if(typeof t=="object"&&s){if(ym&&typeof t[ym]=="function"&&Za)return Za(t,{depth:m-n});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(bT(t)){var Y=[];return sm&&sm.call(t,function(ke,Ne){Y.push(y(Ne,t,!0)+" => "+y(ke,t))}),vm("Map",Ao.call(t),Y,P)}if(ST(t)){var Ae=[];return um&&um.call(t,function(ke){Ae.push(y(ke,t))}),vm("Set",ko.call(t),Ae,P)}if(PT(t))return Va("WeakMap");if(TT(t))return Va("WeakSet");if(xT(t))return Va("WeakRef");if(hT(t))return tn(y(Number(t)));if(gT(t))return tn(y(Ga.call(t)));if(yT(t))return tn(oT.call(t));if(fT(t))return tn(y(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!dT(t)&&!gm(t)){var ee=Io(t,y),ie=mm?mm(t)===Object.prototype:t instanceof Object||t.constructor===Object,Se=t instanceof Object?"":"null prototype",re=!ie&&on&&Object(t)===t&&on in t?Ya.call(It(t),8,-1):Se?"Object":"",Ye=ie||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",Qe=Ye+(re||Se?"["+He.call(pm.call([],re||[],Se||[]),": ")+"] ":"");return ee.length===0?Qe+"{}":P?Qe+"{"+Ka(ee,P)+"}":Qe+"{ "+He.call(ee,", ")+" }"}return String(t)},"inspect_");function xm(e,t,r){var n=r.quoteStyle||t,o=Pm[n];return o+e+o}a(xm,"wrapQuotes");function pT(e){return Et.call(String(e),/"/g,"&quot;")}a(pT,"quote");function zt(e){return!on||!(typeof e=="object"&&(on in e||typeof e[on]<"u"))}a(zt,"canTrustToString");function Wa(e){return It(e)==="[object Array]"&&zt(e)}a(Wa,"isArray");function dT(e){return It(e)==="[object Date]"&&zt(e)}a(dT,"isDate");function gm(e){return It(e)==="[object RegExp]"&&zt(e)}a(gm,"isRegExp");function mT(e){return It(e)==="[object Error]"&&zt(e)}a(mT,"isError");function fT(e){return It(e)==="[object String]"&&zt(e)}a(fT,"isString");function hT(e){return It(e)==="[object Number]"&&zt(e)}a(hT,"isNumber");function yT(e){return It(e)==="[object Boolean]"&&zt(e)}a(yT,"isBoolean");function Sm(e){if(cr)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Ha)return!1;try{return Ha.call(e),!0}catch{}return!1}a(Sm,"isSymbol");function gT(e){if(!e||typeof e!="object"||!Ga)return!1;try{return Ga.call(e),!0}catch{}return!1}a(gT,"isBigInt");var vT=Object.prototype.hasOwnProperty||function(e){return e in this};function st(e,t){return vT.call(e,t)}a(st,"has");function It(e){return iT.call(e)}a(It,"toStr");function _T(e){if(e.name)return e.name;var t=sT.call(aT.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}a(_T,"nameOf");function Tm(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}a(Tm,"indexOf");function bT(e){if(!Ao||!e||typeof e!="object")return!1;try{Ao.call(e);try{ko.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}a(bT,"isMap");function PT(e){if(!rn||!e||typeof e!="object")return!1;try{rn.call(e,rn);try{nn.call(e,nn)}catch{return!0}return e instanceof WeakMap}catch{}return!1}a(PT,"isWeakMap");function xT(e){if(!cm||!e||typeof e!="object")return!1;try{return cm.call(e),!0}catch{}return!1}a(xT,"isWeakRef");function ST(e){if(!ko||!e||typeof e!="object")return!1;try{ko.call(e);try{Ao.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}a(ST,"isSet");function TT(e){if(!nn||!e||typeof e!="object")return!1;try{nn.call(e,nn);try{rn.call(e,rn)}catch{return!0}return e instanceof WeakSet}catch{}return!1}a(TT,"isWeakSet");function ET(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}a(ET,"isElement");function Em(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Em(Ya.call(e,0,t.maxStringLength),t)+n}var o=lT[t.quoteStyle||"single"];o.lastIndex=0;var i=Et.call(Et.call(e,o,"\\$1"),/[\x00-\x1f]/g,IT);return xm(i,"single",t)}a(Em,"inspectString");function IT(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+uT.call(t.toString(16))}a(IT,"lowbyte");function tn(e){return"Object("+e+")"}a(tn,"markBoxed");function Va(e){return e+" { ? }"}a(Va,"weakCollectionOf");function vm(e,t,r,n){var o=n?Ka(r,n):He.call(r,", ");return e+" ("+t+") {"+o+"}"}a(vm,"collectionOf");function AT(e){for(var t=0;t<e.length;t++)if(Tm(e[t],`
3
- `)>=0)return!1;return!0}a(AT,"singleLineValues");function kT(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=He.call(Array(e.indent+1)," ");else return null;return{base:r,prev:He.call(Array(t+1),r)}}a(kT,"getIndent");function Ka(e,t){if(e.length===0)return"";var r=`
4
- `+t.prev+t.base;return r+He.call(e,","+r)+`
5
- `+t.prev}a(Ka,"indentedJoin");function Io(e,t){var r=Wa(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=st(e,o)?t(e[o],e):""}var i=typeof Ba=="function"?Ba(e):[],s;if(cr){s={};for(var l=0;l<i.length;l++)s["$"+i[l]]=i[l]}for(var d in e)st(e,d)&&(r&&String(Number(d))===d&&d<e.length||cr&&s["$"+d]instanceof Symbol||(_m.call(/[^\w$]/,d)?n.push(t(d,e)+": "+t(e[d],e)):n.push(d+": "+t(e[d],e))));if(typeof Ba=="function")for(var b=0;b<i.length;b++)bm.call(e,i[b])&&n.push("["+t(i[b])+"]: "+t(e[i[b]],e));return n}a(Io,"arrObjKeys")});var km=C((NF,Am)=>{"use strict";var wT=an(),OT=gt(),wo=a(function(e,t,r){for(var n=e,o;(o=n.next)!=null;n=o)if(o.key===t)return n.next=o.next,r||(o.next=e.next,e.next=o),o},"listGetNode"),RT=a(function(e,t){if(e){var r=wo(e,t);return r&&r.value}},"listGet"),CT=a(function(e,t,r){var n=wo(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},"listSet"),$T=a(function(e,t){return e?!!wo(e,t):!1},"listHas"),NT=a(function(e,t){if(e)return wo(e,t,!0)},"listDelete");Am.exports=a(function(){var t,r={assert:a(function(n){if(!r.has(n))throw new OT("Side channel does not contain "+wT(n))},"assert"),delete:a(function(n){var o=NT(t,n);return o&&t&&!t.next&&(t=void 0),!!o},"delete"),get:a(function(n){return RT(t,n)},"get"),has:a(function(n){return $T(t,n)},"has"),set:a(function(n,o){t||(t={next:void 0}),CT(t,n,o)},"set")};return r},"getSideChannelList")});var Qa=C((zF,Rm)=>{"use strict";var wm=Qr(),Om=xa(),DT=Om([wm("%String.prototype.indexOf%")]);Rm.exports=a(function(t,r){var n=wm(t,!!r);return typeof n=="function"&&DT(t,".prototype.")>-1?Om([n]):n},"callBoundIntrinsic")});var es=C((UF,$m)=>{"use strict";var zT=Qr(),sn=Qa(),MT=an(),UT=gt(),Cm=zT("%Map%",!0),LT=sn("Map.prototype.get",!0),qT=sn("Map.prototype.set",!0),jT=sn("Map.prototype.has",!0),FT=sn("Map.prototype.delete",!0),BT=sn("Map.prototype.size",!0);$m.exports=!!Cm&&a(function(){var t,r={assert:a(function(n){if(!r.has(n))throw new UT("Side channel does not contain "+MT(n))},"assert"),delete:a(function(n){if(t){var o=FT(t,n);return BT(t)===0&&(t=void 0),o}return!1},"delete"),get:a(function(n){if(t)return LT(t,n)},"get"),has:a(function(n){return t?jT(t,n):!1},"has"),set:a(function(n,o){t||(t=new Cm),qT(t,n,o)},"set")};return r},"getSideChannelMap")});var Dm=C((qF,Nm)=>{"use strict";var VT=Qr(),Ro=Qa(),GT=an(),Oo=es(),HT=gt(),lr=VT("%WeakMap%",!0),ZT=Ro("WeakMap.prototype.get",!0),WT=Ro("WeakMap.prototype.set",!0),KT=Ro("WeakMap.prototype.has",!0),JT=Ro("WeakMap.prototype.delete",!0);Nm.exports=lr?a(function(){var t,r,n={assert:a(function(o){if(!n.has(o))throw new HT("Side channel does not contain "+GT(o))},"assert"),delete:a(function(o){if(lr&&o&&(typeof o=="object"||typeof o=="function")){if(t)return JT(t,o)}else if(Oo&&r)return r.delete(o);return!1},"delete"),get:a(function(o){return lr&&o&&(typeof o=="object"||typeof o=="function")&&t?ZT(t,o):r&&r.get(o)},"get"),has:a(function(o){return lr&&o&&(typeof o=="object"||typeof o=="function")&&t?KT(t,o):!!r&&r.has(o)},"has"),set:a(function(o,i){lr&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new lr),WT(t,o,i)):Oo&&(r||(r=Oo()),r.set(o,i))},"set")};return n},"getSideChannelWeakMap"):Oo});var ts=C((FF,zm)=>{"use strict";var XT=gt(),YT=an(),QT=km(),eE=es(),tE=Dm(),rE=tE||eE||QT;zm.exports=a(function(){var t,r={assert:a(function(n){if(!r.has(n))throw new XT("Side channel does not contain "+YT(n))},"assert"),delete:a(function(n){return!!t&&t.delete(n)},"delete"),get:a(function(n){return t&&t.get(n)},"get"),has:a(function(n){return!!t&&t.has(n)},"has"),set:a(function(n,o){t||(t=rE()),t.set(n,o)},"set")};return r},"getSideChannel")});var Co=C((VF,Mm)=>{"use strict";var nE=String.prototype.replace,oE=/%20/g,rs={RFC1738:"RFC1738",RFC3986:"RFC3986"};Mm.exports={default:rs.RFC3986,formatters:{RFC1738:a(function(e){return nE.call(e,oE,"+")},"RFC1738"),RFC3986:a(function(e){return String(e)},"RFC3986")},RFC1738:rs.RFC1738,RFC3986:rs.RFC3986}});var as=C((HF,Um)=>{"use strict";var iE=Co(),aE=ts(),ns=Object.prototype.hasOwnProperty,Mt=Array.isArray,$o=aE(),pr=a(function(t,r){return $o.set(t,r),t},"markOverflow"),Ut=a(function(t){return $o.has(t)},"isOverflow"),un=a(function(t){return $o.get(t)},"getMaxIndex"),is=a(function(t,r){$o.set(t,r)},"setMaxIndex"),Ze=(function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e})(),sE=a(function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(Mt(n)){for(var o=[],i=0;i<n.length;++i)typeof n[i]<"u"&&(o[o.length]=n[i]);r.obj[r.prop]=o}}},"compactQueue"),cn=a(function(t,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},o=0;o<t.length;++o)typeof t[o]<"u"&&(n[o]=t[o]);return n},"arrayToObject"),uE=a(function e(t,r,n){if(!r)return t;if(typeof r!="object"&&typeof r!="function"){if(Mt(t)){var o=t.length;if(n&&typeof n.arrayLimit=="number"&&o>n.arrayLimit)return pr(cn(t.concat(r),n),o);t[o]=r}else if(t&&typeof t=="object")if(Ut(t)){var i=un(t)+1;t[i]=r,is(t,i)}else(n&&(n.plainObjects||n.allowPrototypes)||!ns.call(Object.prototype,r))&&(t[r]=!0);else return[t,r];return t}if(!t||typeof t!="object"){if(Ut(r)){for(var s=Object.keys(r),l=n&&n.plainObjects?{__proto__:null,0:t}:{0:t},d=0;d<s.length;d++){var b=parseInt(s[d],10);l[b+1]=r[s[d]]}return pr(l,un(r)+1)}var m=[t].concat(r);return n&&typeof n.arrayLimit=="number"&&m.length>n.arrayLimit?pr(cn(m,n),m.length-1):m}var P=t;return Mt(t)&&!Mt(r)&&(P=cn(t,n)),Mt(t)&&Mt(r)?(r.forEach(function(y,p){if(ns.call(t,p)){var h=t[p];h&&typeof h=="object"&&y&&typeof y=="object"?t[p]=e(h,y,n):t[t.length]=y}else t[p]=y}),t):Object.keys(r).reduce(function(y,p){var h=r[p];if(ns.call(y,p)?y[p]=e(y[p],h,n):y[p]=h,Ut(r)&&!Ut(y)&&pr(y,un(r)),Ut(y)){var E=parseInt(p,10);String(E)===p&&E>=0&&E>un(y)&&is(y,E)}return y},P)},"merge"),cE=a(function(t,r){return Object.keys(r).reduce(function(n,o){return n[o]=r[o],n},t)},"assignSingleSource"),lE=a(function(e,t,r){var n=e.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},"decode"),os=1024,pE=a(function(t,r,n,o,i){if(t.length===0)return t;var s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(p){return"%26%23"+parseInt(p.slice(2),16)+"%3B"});for(var l="",d=0;d<s.length;d+=os){for(var b=s.length>=os?s.slice(d,d+os):s,m=[],P=0;P<b.length;++P){var y=b.charCodeAt(P);if(y===45||y===46||y===95||y===126||y>=48&&y<=57||y>=65&&y<=90||y>=97&&y<=122||i===iE.RFC1738&&(y===40||y===41)){m[m.length]=b.charAt(P);continue}if(y<128){m[m.length]=Ze[y];continue}if(y<2048){m[m.length]=Ze[192|y>>6]+Ze[128|y&63];continue}if(y<55296||y>=57344){m[m.length]=Ze[224|y>>12]+Ze[128|y>>6&63]+Ze[128|y&63];continue}P+=1,y=65536+((y&1023)<<10|b.charCodeAt(P)&1023),m[m.length]=Ze[240|y>>18]+Ze[128|y>>12&63]+Ze[128|y>>6&63]+Ze[128|y&63]}l+=m.join("")}return l},"encode"),dE=a(function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],o=0;o<r.length;++o)for(var i=r[o],s=i.obj[i.prop],l=Object.keys(s),d=0;d<l.length;++d){var b=l[d],m=s[b];typeof m=="object"&&m!==null&&n.indexOf(m)===-1&&(r[r.length]={obj:s,prop:b},n[n.length]=m)}return sE(r),t},"compact"),mE=a(function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},"isRegExp"),fE=a(function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},"isBuffer"),hE=a(function(t,r,n,o){if(Ut(t)){var i=un(t)+1;return t[i]=r,is(t,i),t}var s=[].concat(t,r);return s.length>n?pr(cn(s,{plainObjects:o}),s.length-1):s},"combine"),yE=a(function(t,r){if(Mt(t)){for(var n=[],o=0;o<t.length;o+=1)n[n.length]=r(t[o]);return n}return r(t)},"maybeMap");Um.exports={arrayToObject:cn,assign:cE,combine:hE,compact:dE,decode:lE,encode:pE,isBuffer:fE,isOverflow:Ut,isRegExp:mE,markOverflow:pr,maybeMap:yE,merge:uE}});var Vm=C((WF,Bm)=>{"use strict";var qm=ts(),No=as(),ln=Co(),gE=Object.prototype.hasOwnProperty,jm={brackets:a(function(t){return t+"[]"},"brackets"),comma:"comma",indices:a(function(t,r){return t+"["+r+"]"},"indices"),repeat:a(function(t){return t},"repeat")},We=Array.isArray,vE=Array.prototype.push,Fm=a(function(e,t){vE.apply(e,We(t)?t:[t])},"pushToArray"),_E=Date.prototype.toISOString,Lm=ln.default,ve={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:No.encode,encodeValuesOnly:!1,filter:void 0,format:Lm,formatter:ln.formatters[Lm],indices:!1,serializeDate:a(function(t){return _E.call(t)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},bE=a(function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},"isNonNullishPrimitive"),ss={},PE=a(function e(t,r,n,o,i,s,l,d,b,m,P,y,p,h,E,S,T,A){for(var k=t,F=A,Y=0,Ae=!1;(F=F.get(ss))!==void 0&&!Ae;){var ee=F.get(t);if(Y+=1,typeof ee<"u"){if(ee===Y)throw new RangeError("Cyclic object value");Ae=!0}typeof F.get(ss)>"u"&&(Y=0)}if(typeof m=="function"?k=m(r,k):k instanceof Date?k=p(k):n==="comma"&&We(k)&&(k=No.maybeMap(k,function(Ti){return Ti instanceof Date?p(Ti):Ti})),k===null){if(s)return b&&!S?b(r,ve.encoder,T,"key",h):r;k=""}if(bE(k)||No.isBuffer(k)){if(b){var ie=S?r:b(r,ve.encoder,T,"key",h);return[E(ie)+"="+E(b(k,ve.encoder,T,"value",h))]}return[E(r)+"="+E(String(k))]}var Se=[];if(typeof k>"u")return Se;var re;if(n==="comma"&&We(k))S&&b&&(k=No.maybeMap(k,b)),re=[{value:k.length>0?k.join(",")||null:void 0}];else if(We(m))re=m;else{var Ye=Object.keys(k);re=P?Ye.sort(P):Ye}var Qe=d?String(r).replace(/\./g,"%2E"):String(r),ke=o&&We(k)&&k.length===1?Qe+"[]":Qe;if(i&&We(k)&&k.length===0)return ke+"[]";for(var Ne=0;Ne<re.length;++Ne){var et=re[Ne],kr=typeof et=="object"&&et&&typeof et.value<"u"?et.value:k[et];if(!(l&&kr===null)){var Si=y&&d?String(et).replace(/\./g,"%2E"):String(et),f_=We(k)?typeof n=="function"?n(ke,Si):ke:ke+(y?"."+Si:"["+Si+"]");A.set(t,Y);var Ds=qm();Ds.set(ss,A),Fm(Se,e(kr,f_,n,o,i,s,l,d,n==="comma"&&S&&We(k)?null:b,m,P,y,p,h,E,S,T,Ds))}}return Se},"stringify"),xE=a(function(t){if(!t)return ve;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=t.charset||ve.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=ln.default;if(typeof t.format<"u"){if(!gE.call(ln.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var o=ln.formatters[n],i=ve.filter;(typeof t.filter=="function"||We(t.filter))&&(i=t.filter);var s;if(t.arrayFormat in jm?s=t.arrayFormat:"indices"in t?s=t.indices?"indices":"repeat":s=ve.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:ve.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:ve.addQueryPrefix,allowDots:l,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:ve.allowEmptyArrays,arrayFormat:s,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:ve.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?ve.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:ve.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:ve.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:ve.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:ve.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:ve.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:ve.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:ve.strictNullHandling}},"normalizeStringifyOptions");Bm.exports=function(e,t){var r=e,n=xE(t),o,i;typeof n.filter=="function"?(i=n.filter,r=i("",r)):We(n.filter)&&(i=n.filter,o=i);var s=[];if(typeof r!="object"||r===null)return"";var l=jm[n.arrayFormat],d=l==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var b=qm(),m=0;m<o.length;++m){var P=o[m],y=r[P];n.skipNulls&&y===null||Fm(s,PE(y,P,l,d,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,b))}var p=s.join(n.delimiter),h=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),p.length>0?h+p:""}});var Zm=C((JF,Hm)=>{"use strict";var Ke=as(),Do=Object.prototype.hasOwnProperty,us=Array.isArray,pe={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Ke.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},SE=a(function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),Gm=a(function(e,t,r){if(e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return e},"parseArrayValue"),TE="utf8=%26%2310003%3B",EE="utf8=%E2%9C%93",IE=a(function(t,r){var n={__proto__:null},o=r.ignoreQueryPrefix?t.replace(/^\?/,""):t;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var i=r.parameterLimit===1/0?void 0:r.parameterLimit,s=o.split(r.delimiter,r.throwOnLimitExceeded?i+1:i);if(r.throwOnLimitExceeded&&s.length>i)throw new RangeError("Parameter limit exceeded. Only "+i+" parameter"+(i===1?"":"s")+" allowed.");var l=-1,d,b=r.charset;if(r.charsetSentinel)for(d=0;d<s.length;++d)s[d].indexOf("utf8=")===0&&(s[d]===EE?b="utf-8":s[d]===TE&&(b="iso-8859-1"),l=d,d=s.length);for(d=0;d<s.length;++d)if(d!==l){var m=s[d],P=m.indexOf("]="),y=P===-1?m.indexOf("="):P+1,p,h;if(y===-1?(p=r.decoder(m,pe.decoder,b,"key"),h=r.strictNullHandling?null:""):(p=r.decoder(m.slice(0,y),pe.decoder,b,"key"),p!==null&&(h=Ke.maybeMap(Gm(m.slice(y+1),r,us(n[p])?n[p].length:0),function(S){return r.decoder(S,pe.decoder,b,"value")}))),h&&r.interpretNumericEntities&&b==="iso-8859-1"&&(h=SE(String(h))),m.indexOf("[]=")>-1&&(h=us(h)?[h]:h),r.comma&&us(h)&&h.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");h=Ke.combine([],h,r.arrayLimit,r.plainObjects)}if(p!==null){var E=Do.call(n,p);E&&r.duplicates==="combine"?n[p]=Ke.combine(n[p],h,r.arrayLimit,r.plainObjects):(!E||r.duplicates==="last")&&(n[p]=h)}}return n},"parseQueryStringValues"),AE=a(function(e,t,r,n){var o=0;if(e.length>0&&e[e.length-1]==="[]"){var i=e.slice(0,-1).join("");o=Array.isArray(t)&&t[i]?t[i].length:0}for(var s=n?t:Gm(t,r,o),l=e.length-1;l>=0;--l){var d,b=e[l];if(b==="[]"&&r.parseArrays)Ke.isOverflow(s)?d=s:d=r.allowEmptyArrays&&(s===""||r.strictNullHandling&&s===null)?[]:Ke.combine([],s,r.arrayLimit,r.plainObjects);else{d=r.plainObjects?{__proto__:null}:{};var m=b.charAt(0)==="["&&b.charAt(b.length-1)==="]"?b.slice(1,-1):b,P=r.decodeDotInKeys?m.replace(/%2E/g,"."):m,y=parseInt(P,10),p=!isNaN(y)&&b!==P&&String(y)===P&&y>=0&&r.parseArrays;if(!r.parseArrays&&P==="")d={0:s};else if(p&&y<r.arrayLimit)d=[],d[y]=s;else{if(p&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");p?(d[y]=s,Ke.markOverflow(d,y)):P!=="__proto__"&&(d[P]=s)}}s=d}return s},"parseObject"),kE=a(function(t,r){var n=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(r.depth<=0)return!r.plainObjects&&Do.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var o=/(\[[^[\]]*])/,i=/(\[[^[\]]*])/g,s=o.exec(n),l=s?n.slice(0,s.index):n,d=[];if(l){if(!r.plainObjects&&Do.call(Object.prototype,l)&&!r.allowPrototypes)return;d[d.length]=l}for(var b=0;(s=i.exec(n))!==null&&b<r.depth;){b+=1;var m=s[1].slice(1,-1);if(!r.plainObjects&&Do.call(Object.prototype,m)&&!r.allowPrototypes)return;d[d.length]=s[1]}if(s){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");d[d.length]="["+n.slice(s.index)+"]"}return d},"splitKeyIntoSegments"),wE=a(function(t,r,n,o){if(t){var i=kE(t,n);if(i)return AE(i,r,n,o)}},"parseQueryStringKeys"),OE=a(function(t){if(!t)return pe;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof t.charset>"u"?pe.charset:t.charset,n=typeof t.duplicates>"u"?pe.duplicates:t.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:pe.allowDots:!!t.allowDots;return{allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:pe.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:pe.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:pe.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:pe.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:pe.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:pe.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:pe.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:pe.decoder,delimiter:typeof t.delimiter=="string"||Ke.isRegExp(t.delimiter)?t.delimiter:pe.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:pe.depth,duplicates:n,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:pe.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:pe.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:pe.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:pe.strictDepth,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:pe.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}},"normalizeParseOptions");Hm.exports=function(e,t){var r=OE(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof e=="string"?IE(e,r):e,o=r.plainObjects?{__proto__:null}:{},i=Object.keys(n),s=0;s<i.length;++s){var l=i[s],d=wE(l,n[l],r,typeof e=="string");o=Ke.merge(o,d,r)}return r.allowSparse===!0?o:Ke.compact(o)}});var Km=C((YF,Wm)=>{"use strict";var RE=Vm(),CE=Zm(),$E=Co();Wm.exports={formats:$E,parse:CE,stringify:RE}});var UI={};zn(UI,{stripe:()=>MI,stripeAuth:()=>g});module.exports=b_(UI);var P_=Object.freeze({status:"aborted"});function $(e,t,r){function n(l,d){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:d,constr:s,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,d);let b=s.prototype,m=Object.keys(b);for(let P=0;P<m.length;P++){let y=m[P];y in l||(l[y]=b[y].bind(l))}}a(n,"init");let o=r?.Parent??Object;class i extends o{static{a(this,"Definition")}}Object.defineProperty(i,"name",{value:e});function s(l){var d;let b=r?.Parent?new i:this;n(b,l),(d=b._zod).deferred??(d.deferred=[]);for(let m of b._zod.deferred)m();return b}return a(s,"_"),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(s,"name",{value:e}),s}a($,"$constructor");var Be=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Mn=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Ei={};function tt(e){return e&&Object.assign(Ei,e),Ei}a(tt,"config");function Ai(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}a(Ai,"getEnumValues");function Us(e,t){return typeof t=="bigint"?t.toString():t}a(Us,"jsonStringifyReplacer");function Ln(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Ln,"cached");function Ls(e){return e==null}a(Ls,"nullish");function qn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(qn,"cleanRegex");var Ms=Symbol("evaluating");function fe(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ms)return n===void 0&&(n=Ms,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}a(fe,"defineLazy");var ki="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Or(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(Or,"isObject");var x_=Ln(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function qs(e){if(Or(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Or(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(qs,"isPlainObject");var js=new Set(["string","number","symbol"]);function Vt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Vt,"escapeRegex");function jn(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}a(jn,"clone");function ne(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:a(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:a(()=>t.error,"error")}:t}a(ne,"normalizeParams");function Fs(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(Fs,"optionalKeys");var Bs={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 Gt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}a(Gt,"aborted");function ct(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}a(ct,"prefixIssues");function Un(e){return typeof e=="string"?e:e?.message}a(Un,"unwrapMessage");function lt(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Un(e.inst?._zod.def?.error?.(e))??Un(t?.error?.(e))??Un(r.customError?.(e))??Un(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}a(lt,"finalizeIssue");function Vs(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(Vs,"getLengthableOrigin");function wi(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}a(wi,"issue");var Gs=a((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Us,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),Hs=$("$ZodError",Gs),Rr=$("$ZodError",Gs,{Parent:Error});var T_=a(e=>(t,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Be;if(s.issues.length){let l=new(o?.Err??e)(s.issues.map(d=>lt(d,i,tt())));throw ki(l,o?.callee),l}return s.value},"_parse"),Fn=T_(Rr),E_=a(e=>async(t,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let l=new(o?.Err??e)(s.issues.map(d=>lt(d,i,tt())));throw ki(l,o?.callee),l}return s.value},"_parseAsync"),Bn=E_(Rr),I_=a(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Be;return i.issues.length?{success:!1,error:new(e??Hs)(i.issues.map(s=>lt(s,o,tt())))}:{success:!0,data:i.value}},"_safeParse"),Cr=I_(Rr),A_=a(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>lt(s,o,tt())))}:{success:!0,data:i.value}},"_safeParseAsync"),$r=A_(Rr);var k_="(?:(?:\\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])))",w_=new RegExp(`^${k_}$`);var Zs=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Ws=/^-?\d+n?$/,Ks=/^-?\d+$/,Oi=/^-?\d+(?:\.\d+)?$/,Js=/^(?:true|false)$/i;var pt=$("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),O_={number:"number",bigint:"bigint",object:"date"};var Xs=$("$ZodCheckGreaterThan",(e,t)=>{pt.init(e,t);let r=O_[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Ys=$("$ZodCheckNumberFormat",(e,t)=>{pt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Bs[t.format];e._zod.onattach.push(s=>{let l=s._zod.bag;l.format=t.format,l.minimum=o,l.maximum=i,r&&(l.pattern=Ks)}),e._zod.check=s=>{let l=s.value;if(r){if(!Number.isInteger(l)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?s.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<o&&s.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>i&&s.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var Qs=$("$ZodCheckMinLength",(e,t)=>{var r;pt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Ls(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let s=Vs(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var Ri=$("$ZodCheckStringFormat",(e,t)=>{var r,n;pt.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),eu=$("$ZodCheckRegex",(e,t)=>{Ri.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var ru={major:4,minor:3,patch:6};var se=$("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ru;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=a((s,l,d)=>{let b=Gt(s),m;for(let P of l){if(P._zod.def.when){if(!P._zod.def.when(s))continue}else if(b)continue;let y=s.issues.length,p=P._zod.check(s);if(p instanceof Promise&&d?.async===!1)throw new Be;if(m||p instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await p,s.issues.length!==y&&(b||(b=Gt(s,y)))});else{if(s.issues.length===y)continue;b||(b=Gt(s,y))}}return m?m.then(()=>s):s},"runChecks"),i=a((s,l,d)=>{if(Gt(s))return s.aborted=!0,s;let b=o(l,n,d);if(b instanceof Promise){if(d.async===!1)throw new Be;return b.then(m=>e._zod.parse(m,d))}return e._zod.parse(b,d)},"handleCanaryResult");e._zod.run=(s,l)=>{if(l.skipChecks)return e._zod.parse(s,l);if(l.direction==="backward"){let b=e._zod.parse({value:s.value,issues:[]},{...l,skipChecks:!0});return b instanceof Promise?b.then(m=>i(m,s,l)):i(b,s,l)}let d=e._zod.parse(s,l);if(d instanceof Promise){if(l.async===!1)throw new Be;return d.then(b=>o(b,n,l))}return o(d,n,l)}}fe(e,"~standard",()=>({validate:a(o=>{try{let i=Cr(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return $r(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Hn=$("$ZodString",(e,t)=>{se.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Zs(e._zod.bag),e._zod.parse=(r,n)=>{if(t.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:e}),r}}),Ci=$("$ZodStringFormat",(e,t)=>{Ri.init(e,t),Hn.init(e,t)});var su=$("$ZodURL",(e,t)=>{Ci.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var $i=$("$ZodNumber",(e,t)=>{se.init(e,t),e._zod.pattern=e._zod.bag.pattern??Oi,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),uu=$("$ZodNumberFormat",(e,t)=>{Ys.init(e,t),$i.init(e,t)}),Ni=$("$ZodBoolean",(e,t)=>{se.init(e,t),e._zod.pattern=Js,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),cu=$("$ZodBigInt",(e,t)=>{se.init(e,t),e._zod.pattern=Ws,e._zod.parse=(r,n)=>{if(t.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:e}),r}});var lu=$("$ZodAny",(e,t)=>{se.init(e,t),e._zod.parse=r=>r}),pu=$("$ZodUnknown",(e,t)=>{se.init(e,t),e._zod.parse=r=>r});var du=$("$ZodVoid",(e,t)=>{se.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),mu=$("$ZodDate",(e,t)=>{se.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});function nu(e,t,r){e.issues.length&&t.issues.push(...ct(r,e.issues)),t.value[r]=e.value}a(nu,"handleArrayResult");var fu=$("$ZodArray",(e,t)=>{se.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let i=[];for(let s=0;s<o.length;s++){let l=o[s],d=t.element._zod.run({value:l,issues:[]},n);d instanceof Promise?i.push(d.then(b=>nu(b,r,s))):nu(d,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function Gn(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...ct(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}a(Gn,"handlePropertyResult");function R_(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Fs(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(R_,"normalizeDef");function C_(e,t,r,n,o,i){let s=[],l=o.keySet,d=o.catchall._zod,b=d.def.type,m=d.optout==="optional";for(let P in t){if(l.has(P))continue;if(b==="never"){s.push(P);continue}let y=d.run({value:t[P],issues:[]},n);y instanceof Promise?e.push(y.then(p=>Gn(p,r,P,t,m))):Gn(y,r,P,t,m)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}a(C_,"handleCatchall");var hu=$("$ZodObject",(e,t)=>{if(se.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:a(()=>{let d={...l};return Object.defineProperty(t,"shape",{value:d}),d},"get")})}let n=Ln(()=>R_(t));fe(e._zod,"propValues",()=>{let l=t.shape,d={};for(let b in l){let m=l[b]._zod;if(m.values){d[b]??(d[b]=new Set);for(let P of m.values)d[b].add(P)}}return d});let o=Or,i=t.catchall,s;e._zod.parse=(l,d)=>{s??(s=n.value);let b=l.value;if(!o(b))return l.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),l;l.value={};let m=[],P=s.shape;for(let y of s.keys){let p=P[y],h=p._zod.optout==="optional",E=p._zod.run({value:b[y],issues:[]},d);E instanceof Promise?m.push(E.then(S=>Gn(S,l,y,b,h))):Gn(E,l,y,b,h)}return i?C_(m,b,l,d,n.value,e):m.length?Promise.all(m).then(()=>l):l}});function ou(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!Gt(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>lt(s,n,tt())))}),t)}a(ou,"handleUnionResults");var Di=$("$ZodUnion",(e,t)=>{se.init(e,t),fe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),fe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),fe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),fe(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>qn(i.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(r)return n(o,i);let s=!1,l=[];for(let d of t.options){let b=d._zod.run({value:o.value,issues:[]},i);if(b instanceof Promise)l.push(b),s=!0;else{if(b.issues.length===0)return b;l.push(b)}}return s?Promise.all(l).then(d=>ou(d,o,e,i)):ou(l,o,e,i)}});var yu=$("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Di.init(e,t);let r=e._zod.parse;fe(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[l,d]of Object.entries(s)){o[l]||(o[l]=new Set);for(let b of d)o[l].add(b)}}return o});let n=Ln(()=>{let o=t.options,i=new Map;for(let s of o){let l=s._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let d of l){if(i.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);i.set(d,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!Or(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let l=n.value.get(s?.[t.discriminator]);return l?l._zod.run(o,i):t.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o)}});var gu=$("$ZodRecord",(e,t)=>{se.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!qs(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let l=new Set;for(let b of s)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){l.add(typeof b=="number"?b.toString():b);let m=t.valueType._zod.run({value:o[b],issues:[]},n);m instanceof Promise?i.push(m.then(P=>{P.issues.length&&r.issues.push(...ct(b,P.issues)),r.value[b]=P.value})):(m.issues.length&&r.issues.push(...ct(b,m.issues)),r.value[b]=m.value)}let d;for(let b in o)l.has(b)||(d=d??[],d.push(b));d&&d.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:d})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let d=t.keyType._zod.run({value:l,issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Oi.test(l)&&d.issues.length){let P=t.keyType._zod.run({value:Number(l),issues:[]},n);if(P instanceof Promise)throw new Error("Async schemas not supported in object keys currently");P.issues.length===0&&(d=P)}if(d.issues.length){t.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(P=>lt(P,n,tt())),input:l,path:[l],inst:e});continue}let m=t.valueType._zod.run({value:o[l],issues:[]},n);m instanceof Promise?i.push(m.then(P=>{P.issues.length&&r.issues.push(...ct(l,P.issues)),r.value[d.value]=P.value})):(m.issues.length&&r.issues.push(...ct(l,m.issues)),r.value[d.value]=m.value)}}return i.length?Promise.all(i).then(()=>r):r}});var vu=$("$ZodEnum",(e,t)=>{se.init(e,t);let r=Ai(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>js.has(typeof o)).map(o=>typeof o=="string"?Vt(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),_u=$("$ZodLiteral",(e,t)=>{if(se.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Vt(n):n?Vt(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});var bu=$("$ZodTransform",(e,t)=>{se.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Mn(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new Be;return r.value=o,r}});function iu(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(iu,"handleOptionalResult");var Pu=$("$ZodOptional",(e,t)=>{se.init(e,t),e._zod.optin="optional",e._zod.optout="optional",fe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),fe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${qn(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>iu(i,r.value)):iu(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var xu=$("$ZodNullable",(e,t)=>{se.init(e,t),fe(e._zod,"optin",()=>t.innerType._zod.optin),fe(e._zod,"optout",()=>t.innerType._zod.optout),fe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${qn(r.source)}|null)$`):void 0}),fe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Su=$("$ZodPipe",(e,t)=>{se.init(e,t),fe(e._zod,"values",()=>t.in._zod.values),fe(e._zod,"optin",()=>t.in._zod.optin),fe(e._zod,"optout",()=>t.out._zod.optout),fe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>Vn(s,t.in,n)):Vn(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Vn(i,t.out,n)):Vn(o,t.out,n)}});function Vn(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(Vn,"handlePipeResult");var Tu=$("$ZodCustom",(e,t)=>{pt.init(e,t),se.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>au(i,r,n,e));au(o,r,n,e)}});function au(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(wi(o))}}a(au,"handleRefineResult");var Iu;var zi=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Au(){return new zi}a(Au,"registry");(Iu=globalThis).__zod_globalRegistry??(Iu.__zod_globalRegistry=Au());var Mi=globalThis.__zod_globalRegistry;function ku(e,t){return new e({type:"string",...ne(t)})}a(ku,"_string");function wu(e,t){return new e({type:"string",coerce:!0,...ne(t)})}a(wu,"_coercedString");function Ou(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ne(t)})}a(Ou,"_url");function Ru(e,t){return new e({type:"number",checks:[],...ne(t)})}a(Ru,"_number");function Cu(e,t){return new e({type:"number",coerce:!0,checks:[],...ne(t)})}a(Cu,"_coercedNumber");function $u(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ne(t)})}a($u,"_int");function Nu(e,t){return new e({type:"boolean",...ne(t)})}a(Nu,"_boolean");function Du(e,t){return new e({type:"boolean",coerce:!0,...ne(t)})}a(Du,"_coercedBoolean");function zu(e,t){return new e({type:"bigint",coerce:!0,...ne(t)})}a(zu,"_coercedBigint");function Mu(e){return new e({type:"any"})}a(Mu,"_any");function Uu(e){return new e({type:"unknown"})}a(Uu,"_unknown");function Lu(e,t){return new e({type:"void",...ne(t)})}a(Lu,"_void");function qu(e,t){return new e({type:"date",coerce:!0,...ne(t)})}a(qu,"_coercedDate");function Zn(e,t){return new Xs({check:"greater_than",...ne(t),value:e,inclusive:!0})}a(Zn,"_gte");function Ue(e,t){return new Qs({check:"min_length",...ne(t),minimum:e})}a(Ue,"_minLength");function dt(e,t){return new eu({check:"string_format",format:"regex",...ne(t),pattern:e})}a(dt,"_regex");function ju(e,t,r){let n=ne(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}a(ju,"_custom");var he=$("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");se.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Fn(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Cr(e,r,n),e.parseAsync=async(r,n)=>Bn(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>$r(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>jn(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Kn=$("ZodMiniString",(e,t)=>{Hn.init(e,t),he.init(e,t)});function f(e){return ku(Kn,e)}a(f,"string");var Fu=$("ZodMiniStringFormat",(e,t)=>{Ci.init(e,t),Kn.init(e,t)});var G_=$("ZodMiniURL",(e,t)=>{su.init(e,t),Fu.init(e,t)});function Bu(e){return Ou(G_,e)}a(Bu,"url");var Jn=$("ZodMiniNumber",(e,t)=>{$i.init(e,t),he.init(e,t)});function Ee(e){return Ru(Jn,e)}a(Ee,"number");var H_=$("ZodMiniNumberFormat",(e,t)=>{uu.init(e,t),Jn.init(e,t)});function Vu(e){return $u(H_,e)}a(Vu,"int");var Ui=$("ZodMiniBoolean",(e,t)=>{Ni.init(e,t),he.init(e,t)});function X(e){return Nu(Ui,e)}a(X,"boolean");var Gu=$("ZodMiniBigInt",(e,t)=>{cu.init(e,t),he.init(e,t)});var Z_=$("ZodMiniAny",(e,t)=>{lu.init(e,t),he.init(e,t)});function Dr(){return Mu(Z_)}a(Dr,"any");var W_=$("ZodMiniUnknown",(e,t)=>{pu.init(e,t),he.init(e,t)});function L(){return Uu(W_)}a(L,"unknown");var K_=$("ZodMiniVoid",(e,t)=>{du.init(e,t),he.init(e,t)});function Hu(e){return Lu(K_,e)}a(Hu,"_void");var Zu=$("ZodMiniDate",(e,t)=>{mu.init(e,t),he.init(e,t)});var J_=$("ZodMiniArray",(e,t)=>{fu.init(e,t),he.init(e,t)});function V(e,t){return new J_({type:"array",element:e,...ne(t)})}a(V,"array");var X_=$("ZodMiniObject",(e,t)=>{hu.init(e,t),he.init(e,t),fe(e,"shape",()=>t.shape)});function I(e,t){let r={type:"object",shape:e??{},...ne(t)};return new X_(r)}a(I,"object");var Y_=$("ZodMiniUnion",(e,t)=>{Di.init(e,t),he.init(e,t)});function G(e,t){return new Y_({type:"union",options:e,...ne(t)})}a(G,"union");var Q_=$("ZodMiniDiscriminatedUnion",(e,t)=>{yu.init(e,t),he.init(e,t)});function mt(e,t,r){return new Q_({type:"union",options:t,discriminator:e,...ne(r)})}a(mt,"discriminatedUnion");var eb=$("ZodMiniRecord",(e,t)=>{gu.init(e,t),he.init(e,t)});function q(e,t,r){return new eb({type:"record",keyType:e,valueType:t,...ne(r)})}a(q,"record");var tb=$("ZodMiniEnum",(e,t)=>{vu.init(e,t),he.init(e,t),e.options=Object.values(t.entries)});function Z(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new tb({type:"enum",entries:r,...ne(t)})}a(Z,"_enum");var rb=$("ZodMiniLiteral",(e,t)=>{_u.init(e,t),he.init(e,t)});function D(e,t){return new rb({type:"literal",values:Array.isArray(e)?e:[e],...ne(t)})}a(D,"literal");var nb=$("ZodMiniTransform",(e,t)=>{bu.init(e,t),he.init(e,t)});function ft(e){return new nb({type:"transform",transform:e})}a(ft,"transform");var ob=$("ZodMiniOptional",(e,t)=>{Pu.init(e,t),he.init(e,t)});function w(e){return new ob({type:"optional",innerType:e})}a(w,"optional");var ib=$("ZodMiniNullable",(e,t)=>{xu.init(e,t),he.init(e,t)});function zr(e){return new ib({type:"nullable",innerType:e})}a(zr,"nullable");var ab=$("ZodMiniPipe",(e,t)=>{Su.init(e,t),he.init(e,t)});function ht(e,t){return new ab({type:"pipe",in:e,out:t})}a(ht,"pipe");var sb=$("ZodMiniCustom",(e,t)=>{Tu.init(e,t),he.init(e,t)});function Xn(e,t){return ju(sb,e??(()=>!0),t)}a(Xn,"custom");var Mr={};zn(Mr,{bigint:()=>mb,boolean:()=>db,date:()=>fb,number:()=>pb,string:()=>lb});function lb(e){return wu(Kn,e)}a(lb,"string");function pb(e){return Cu(Jn,e)}a(pb,"number");function db(e){return Du(Ui,e)}a(db,"boolean");function mb(e){return zu(Gu,e)}a(mb,"bigint");function fb(e){return qu(Zu,e)}a(fb,"date");var qi=I({retryOnFailure:I({defaultValue:w(X()),hide:w(X())}),continueOnFailure:I({defaultValue:w(X()),hide:w(X())})}),Li=class{constructor(t,r,n,o,i,s,l,d,b,m,P){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=i;this.test=s;this.requireAuth=l;this.errorHandlingOptions=d;this.outputSchema=b;this.audience=m;this.aiMetadata=P}static{a(this,"IAction")}},x=a(e=>new Li(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var J=I({displayName:f(),description:w(f())}),H=a((e,t)=>I({type:D(t),required:X(),defaultValue:w(Dr())}),"TPropertyValue");var Re=I({...J.shape,...H(f(),"SHORT_TEXT").shape}),rt=I({...J.shape,...H(f(),"LONG_TEXT").shape});var Ku=I({label:f(),value:L()}),Yn=I({disabled:w(X()),placeholder:w(f()),options:V(Ku)});var Ce=I({...J.shape,options:Yn,...H(L(),"STATIC_DROPDOWN").shape}),nt=I({...J.shape,options:Yn,...H(V(L()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var ji=I({...J.shape,...H(L(),"DROPDOWN").shape,refreshers:V(f())}),Ur=I({...J.shape,...H(V(L()),"MULTI_SELECT_DROPDOWN").shape,refreshers:V(f())});var ot=I({...J.shape,...H(X(),"CHECKBOX").shape});var it=I({...J.shape,...H(Ee(),"NUMBER").shape});var Lr=I({...J.shape,streaming:w(X()),...H(L(),"FILE").shape});var qr=I({...J.shape,...H(f(),"DATE_TIME").shape});var Ju=q(f(),G([Re,rt,Ce,Ur,nt,ot,it,Lr,qr])),jr=I({...J.shape,properties:Ju,...H(V(L()),"ARRAY").shape});var Fr=I({...J.shape,...H(G([q(f(),L())]),"JSON").shape});var Xu=G([Re,Ce,Fr,jr,nt]),yb=q(f(),Xu),Fi=I({refreshers:V(f()),...J.shape,...H(L(),"DYNAMIC").shape});var Qn=I({...J.shape,...H(Hu(),"MARKDOWN").shape});var Br=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Br||{}),Ht=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ht||{}),Zt=(T=>(T.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",T.COMMUNICATION="COMMUNICATION",T.COMMERCE="COMMERCE",T.CORE="CORE",T.UNIVERSAL_AI="UNIVERSAL_AI",T.FLOW_CONTROL="FLOW_CONTROL",T.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",T.ACCOUNTING="ACCOUNTING",T.PRODUCTIVITY="PRODUCTIVITY",T.CONTENT_AND_FILES="CONTENT_AND_FILES",T.DEVELOPER_TOOLS="DEVELOPER_TOOLS",T.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",T.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",T.HUMAN_RESOURCES="HUMAN_RESOURCES",T.PAYMENT_PROCESSING="PAYMENT_PROCESSING",T.MARKETING="MARKETING",T.SALES_AND_CRM="SALES_AND_CRM",T))(Zt||{});var Vr=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Vr||{}),Bi="both_client_credentials_and_authorization_code";var ye=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(ye||{}),Gr=(i=>(i.NONE="NONE",i.HEADER_PRESENT="HEADER_PRESENT",i.QUERY_PRESENT="QUERY_PRESENT",i.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",i.HEAD_REQUEST="HEAD_REQUEST",i))(Gr||{}),gb=I({strategy:Z(Gr),paramName:w(f())}),Hr=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Hr||{});var eo=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(eo||{}),Yu=I({status:w(Ee()),body:w(L()),headers:w(q(f(),f()))}),Qu=I({type:D("DELAY"),resumeDateTime:f(),requestIdToReply:w(f()),handlerId:w(f()),streamStepProgress:w(Z(eo))}),ec=I({type:D("WEBHOOK"),requestId:f(),requestIdToReply:w(f()),response:Yu,handlerId:w(f()),streamStepProgress:w(Z(eo))}),vb=G([Qu,ec]);var _b=I({body:L(),rawBody:w(L()),headers:q(f(),f()),queryParams:q(f(),f())});function $e(e){return e==null}a($e,"isNil");function B(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}a(B,"isEmpty");function to(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}a(to,"assertNotNullOrUndefined");var Vi=Me(require("crypto"),1);var bb=128,Ct,Wt,Pb=a(e=>{!Ct||Ct.length<e?(Ct=Buffer.allocUnsafe(e*bb),Vi.default.randomFillSync(Ct),Wt=0):Wt+e>Ct.length&&(Vi.default.randomFillSync(Ct),Wt=0),Wt+=e},"fillPool"),xb=a(e=>(Pb(e|=0),Ct.subarray(Wt-e,Wt)),"random"),Sb=a((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(i=t)=>{let s="";for(;;){let l=r(o),d=o;for(;d--;)if(s+=e[l[d]&n]||"",s.length===i)return s}}},"customRandom"),rc=a((e,t=21)=>Sb(e,t,xb),"customAlphabet");var Tb="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",nc=21,vz=f().check(dt(new RegExp(`^[0-9a-zA-Z]{${nc}}$`))),Eb=rc(Tb,nc);var yt=ht(ft(e=>e instanceof Date?e.toISOString():e),f()),De={id:f(),created:yt,updated:yt},ae=a(e=>w(zr(e)),"Nullable");function Gi(e){return w(zr(Z(e)))}a(Gi,"NullableEnum");var Pz=ht(ft(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),w(X())),ro=a(e=>ht(ft(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),w(V(e))),"OptionalArrayFromQuery");var Tz=q(f(),L());var Zr=(m=>(m.OPENAI="openai",m.OPENROUTER="openrouter",m.ANTHROPIC="anthropic",m.AZURE="azure",m.GOOGLE="google",m.ACTIVEPIECES="activepieces",m.CLOUDFLARE_GATEWAY="cloudflare-gateway",m.CUSTOM="custom",m.BEDROCK="bedrock",m.MISTRAL="mistral",m))(Zr||{});var zz=f().check(dt(/^#[0-9A-Fa-f]{6}$/));var Uz=I({filename:f(),data:L(),type:D("file"),mimetype:w(f())});var Ib=Me(ic());var Gz=I({...De,name:f(),permissions:V(f()),platformId:ae(f()),type:f(),userCount:w(Ee())});var ac=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ac||{}),Hi=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Hi||{}),Zi=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Zi||{});var Wi=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Wi||{});var Ki=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ki||{});var Ab=I({mode:Z(ac),value:L()}),kb=I({auth:w(f()),fields:q(f(),Ab)}),wb=I({pieceName:f(),pieceVersion:f(),actionName:f(),predefinedInput:w(kb)}),Ob=I({type:D("PIECE"),toolName:f().check(Ue(1)),pieceMetadata:wb}),Rb=I({type:D("none")}),Cb=I({type:D("access_token"),accessToken:f()}),$b=I({type:D("api_key"),apiKey:f(),apiKeyHeader:f()}),Nb=I({type:D("headers"),headers:q(f(),f())}),Db=mt("type",[Rb,Cb,$b,Nb]),sc=I({type:D("FLOW"),toolName:f().check(Ue(1)),externalFlowId:f(),flowDisplayName:w(f())}),uc=I({type:D("MCP"),toolName:f().check(Ue(1)),serverUrl:Bu(),protocol:Z(Zi),auth:Db}),cc=I({type:D("KNOWLEDGE_BASE"),toolName:f().check(Ue(1)),sourceType:Z(Hi),sourceId:f(),sourceName:f()}),zb=mt("type",[Ob,sc,uc,cc]),Mb=I({displayName:f(),description:w(f()),type:Z(Wi)}),lc=I({type:D("MARKDOWN"),markdown:f()}),Kt={type:D("TOOL_CALL"),input:ae(q(f(),L())),output:w(L()),toolName:f(),status:Z(Ki),toolCallId:f(),startTime:f(),endTime:w(f())},xM=I(Kt),pc=mt("toolCallType",[I({...Kt,toolCallType:D("PIECE"),pieceName:f(),pieceVersion:f(),actionName:f()}),I({...Kt,toolCallType:D("FLOW"),displayName:f(),externalFlowId:f()}),I({...Kt,toolCallType:D("MCP"),displayName:f(),serverUrl:f()}),I({...Kt,toolCallType:D("KNOWLEDGE_BASE"),displayName:f(),sourceType:f()}),I({...Kt,toolCallType:D("UNKNOWN"),displayName:f()})]),Ub=G([lc,pc]);var Ji=(r=>(r.IMAGE="image",r.TEXT="text",r))(Ji||{}),at=I({apiKey:f()}),Lb=at,qb=I({apiKey:f(),apiKeyHash:f()}),jb=at,Fb=at,Bb=at,Vb=at,Gb=at,Hb=at,Zb=at,yc=I({accessKeyId:f().check(Ue(1)),secretAccessKey:f().check(Ue(1))}),Wb=I({}),Kb=I({}),Jb=I({}),Xb=I({}),Yb=I({}),Qb=I({}),gc=I({modelId:f(),modelName:f(),modelType:Z(Ji)}),vc=I({apiKeyHeader:f(),baseUrl:f(),models:V(gc),defaultHeaders:w(q(f(),f()))}),_c=I({accountId:f(),gatewayId:f(),models:V(gc),vertexProject:w(f()),vertexRegion:w(f())}),bc=I({resourceName:f(),apiVersion:ht(ft(e=>typeof e=="string"&&e.trim().length===0?void 0:e),w(f()))}),Pc=I({region:f().check(Ue(1))}),eP=G([Lb,Bb,Vb,Gb,Hb,Fb,jb,qb,yc,Zb]),xc=G([vc,_c,bc,Pc,Wb,Jb,Xb,Yb,Kb,Qb]),tP=I({id:f(),name:f(),type:Z(Ji)}),rP=I({id:f(),name:f(),provider:Z(Zr),config:xc,enabledForChat:X()}),nP=I({provider:Z(Zr),config:xc,auth:eP,platformId:f()});var IM={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},dc=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],oP=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],iP=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],mc=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],aP=["grok-4.20","grok-4.1-fast"],sP={openai:dc,anthropic:oP,google:mc,activepieces:[...iP.map(e=>`anthropic/${e}`),...dc.map(e=>`openai/${e}`),...mc.map(e=>`google/${e}`),...aP.map(e=>`x-ai/${e}`)]};var fc=128e3,uP={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function cP({provider:e}){return e?uP[e]??fc:fc}a(cP,"getMaxContextTokens");var hc={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},lP={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},pP=new Set(["anthropic","mistral"]);function Ve(e){return{chatModels:sP[e],maxContextTokens:cP({provider:e}),defaultEmbeddingModel:hc[e],supportsEmbedding:hc[e]!==void 0,supportsImageGeneration:!pP.has(e),webSearch:lP[e]}}a(Ve,"buildProviderCapabilities");var dP={openai:Ve("openai"),anthropic:Ve("anthropic"),openrouter:Ve("openrouter"),azure:Ve("azure"),google:Ve("google"),"cloudflare-gateway":Ve("cloudflare-gateway"),custom:Ve("custom"),bedrock:Ve("bedrock"),mistral:Ve("mistral"),activepieces:Ve("activepieces")};var mP=I({base64Url:f(),fileName:f(),extension:w(f())}),fP=I({mimeType:f(),url:f(),fileName:w(f())}),Xi=G([mP,fP]);var hP=G([I({type:D("file"),value:Xi}),I({type:D("markdown"),value:f(),files:w(V(Xi))})]),yP=I({sessionId:f(),message:f(),files:w(V(f()))});var Tc=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Tc||{}),Ec=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ec||{}),Yi=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Yi||{});var gP=G([I({...De,name:f(),externalId:f(),type:D("STATIC_DROPDOWN"),tableId:f(),projectId:f(),data:I({options:V(I({value:f()}))})}),I({...De,name:f(),externalId:f(),type:G([D("TEXT"),D("NUMBER"),D("DATE")]),tableId:f(),projectId:f()})]),vP=I({...De,name:f(),folderId:ae(f()),projectId:f(),externalId:f(),status:Gi(Ec),trigger:Gi(Tc)}),_P=I({...De,tableId:f(),projectId:f(),cells:q(f(),I({updated:f(),created:f(),value:L(),fieldName:f()}))}),bP=I({events:V(Z(Yi)),webhookUrl:f(),flowId:f()}),PP=I({fields:V(I({id:f(),name:f()})),rows:V(q(f(),f())),name:f()}),xP=I({projectId:f(),limit:w(Mr.number()),cursor:w(f()),name:w(f()),externalIds:ro(f()),folderId:w(f()),folderIds:ro(f())}),SP=I({records:V(V(I({fieldId:f(),value:Ac()}))),tableId:f()}),TP=I({cells:w(V(I({fieldId:f(),value:Ac()}))),tableId:f(),agentUpdate:w(X())}),Ic=mt("operator",[$t("eq"),$t("neq"),$t("gt"),$t("gte"),$t("lt"),$t("lte"),$t("co"),Sc("exists"),Sc("not_exists")]),EP=I({tableId:f(),limit:w(Mr.number()),cursor:w(f()),filters:ro(Ic)});function Ac(){return ht(ft(e=>e==null?e:String(e)),zr(f()))}a(Ac,"coerceToString");function $t(e){return I({fieldId:f(),operator:D(e),value:f()})}a($t,"valueFilter");function Sc(e){return I({fieldId:f(),operator:D(e)})}a(Sc,"existenceFilter");var IP=I({status:w(Ee()),body:w(L()),headers:w(q(f(),f()))}),AP=I({...De,deleted:ae(yt),ownerId:f(),displayName:f(),platformId:f(),externalId:ae(f())});var kc=I({name:f(),description:w(f()),type:f(),required:X()}),kP=I({pieceName:f(),triggerName:f(),input:I({toolName:f(),toolDescription:f(),inputSchema:V(kc),returnsResponse:X()})});var wc="^[0-9]+\\.[0-9]+\\.[0-9]+$",GM=new RegExp(wc),OP="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",HM=f().check(dt(new RegExp(wc))),ZM=f().check(dt(new RegExp(OP))),RP=I({packageType:D("ARCHIVE"),pieceType:Z(Ht),pieceName:f(),pieceVersion:f(),archiveId:f(),platformId:f()}),Oc=I({packageType:D("REGISTRY"),pieceType:D("OFFICIAL"),pieceName:f(),pieceVersion:f()}),Rc=I({packageType:D("REGISTRY"),pieceType:D("CUSTOM"),pieceName:f(),pieceVersion:f(),platformId:f()}),WM=G([Oc,Rc]),KM=G([RP,Oc,Rc]);var CP=mt("type",[I({type:D("CRON_EXPRESSION"),cronExpression:f(),timezone:f()}),I({type:D("INTERVAL"),intervalMs:Vu().check(Zn(6e4))})]),JM=I({...De,type:Z(ye),projectId:f(),flowId:f(),triggerName:f(),schedule:ae(CP),flowVersionId:f(),pieceName:f(),pieceVersion:f(),deleted:ae(f()),simulate:X()}),Cc=(S=>(S.UNKNOWN="UNKNOWN",S.FLOW_RUN_LOG="FLOW_RUN_LOG",S.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",S.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",S.FLOW_STEP_FILE="FLOW_STEP_FILE",S.SAMPLE_DATA="SAMPLE_DATA",S.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",S.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",S.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",S.PROJECT_RELEASE="PROJECT_RELEASE",S.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",S.PLATFORM_ASSET="PLATFORM_ASSET",S.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",S.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",S.KNOWLEDGE_BASE="KNOWLEDGE_BASE",S.FLOW_BUNDLE="FLOW_BUNDLE",S))(Cc||{}),$c=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))($c||{}),Nc=(r=>(r.S3="S3",r.DB="DB",r))(Nc||{}),XM=I({...De,projectId:ae(f()),platformId:ae(f()),type:Z(Cc),compression:Z($c),data:w(L()),location:Z(Nc),size:ae(Ee()),fileName:ae(f()),s3Key:ae(f()),metadata:ae(q(f(),f()))}),Dc=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Dc||{}),zc=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(zc||{}),YM=I({id:f(),email:f(),firstName:f(),status:Z(zc),externalId:ae(f()),platformId:ae(f()),platformRole:Z(Dc),lastName:f(),created:yt,updated:yt,lastActiveDate:ae(yt),imageUrl:ae(f())});var Qi=I({...J.shape,...H(q(f(),L()),"OBJECT").shape});var qc=I({...J.shape,...H(f(),"COLOR").shape});var ea=G([Re,rt,Qn,ot,Ce,nt,ji,Ur,Fi,it,jr,Qi,Fr,qr,Lr,qc]),u={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var Ge=I({displayName:f(),description:w(f())});var jc=I({username:f(),password:f()}),ta=I({...Ge.shape,username:I({displayName:f(),description:w(f())}),password:I({displayName:f(),description:w(f())}),...H(jc,"BASIC_AUTH").shape});var zP=q(f(),G([Re,rt,it,ot,Ce])),ra=I({...Ge.shape,props:zP,...H(L(),"CUSTOM_AUTH").shape});var Nt=I({...Ge.shape,...H(I({auth:f()}),"SECRET_TEXT").shape});var MP=q(f(),G([Re,rt,Nt,it,ot,Ce,nt,Qn])),Fc=I({...Ge.shape,props:MP,...H(L(),"OIDC").shape});var na=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(na||{}),Bc=G([Re,Nt,Ce]),Vc=q(f(),Bc),UP=I({props:w(q(f(),Bc)),authUrl:f(),tokenUrl:f(),scope:V(f()),prompt:w(G([D("none"),D("consent"),D("login"),D("omit")])),pkce:w(X()),pkceMethod:w(G([D("plain"),D("S256")])),authorizationMethod:w(Z(na)),grantType:w(G([Z(Vr),D(Bi)])),extra:w(q(f(),f()))}),Gc=I({access_token:f(),props:w(Vc),data:q(f(),Dr())}),oa=I({...Ge.shape,...UP.shape,...H(Gc,"OAUTH2").shape});var Jt=G([ta,ra,Fc,oa,Nt]),Wr="Connection",ia={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Wr}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Wr,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Wr}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Wr}},None(){}};var O1={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 LP=I({...J.shape,...H(L(),"CUSTOM").shape,code:f()});var qP=G([ea,Jt]),aa=q(f(),qP),J1=q(f(),ea);var Hc=G([I({strategy:D("CRON"),cronExpression:f()}),I({strategy:D("NONE")})]),Xt=class{constructor(t,r,n,o,i,s,l,d,b,m,P,y,p,h,E,S,T,A,k){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=i;this.type=s;this.handshakeConfiguration=l;this.onHandshake=d;this.renewConfiguration=b;this.onRenew=m;this.onEnable=P;this.onDisable=y;this.onStart=p;this.run=h;this.test=E;this.sampleData=S;this.testStrategy=T;this.outputSchema=A;this.aiMetadata=k}static{a(this,"ITrigger")}},te=a(e=>{switch(e.type){case"WEBHOOK":return new Xt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Xt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Xt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Xt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,$e(e.sampleData)&&$e(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Zc="2",oo="0.82.0";var sa=class{constructor(t,r,n,o,i,s,l,d,b=oo,m,P="",y){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=d;this.minimumSupportedRelease=b;this.maximumSupportedRelease=m;this.description=P;this.deprecated=y;this._actions={};this._triggers={};this.getContextInfo=a(()=>({version:Zc}),"getContextInfo");(!jP(b)||FP(b,oo))&&(this.minimumSupportedRelease=oo),i.forEach(p=>this._actions[p.name]=p),s.forEach(p=>this._triggers[p.name]=p)}static{a(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Wc=a(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(i=>i.type===r.type)))throw new Error("Auth properties must be unique by type");return new sa(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function jP(e){return/^\d+\.\d+\.\d+$/.test(e)}a(jP,"isValidSimpleSemver");function FP(e,t){let[r,n,o]=e.split(".").map(Number),[i,s,l]=t.split(".").map(Number);return r!==i?r<i:n!==s?n<s:o<l}a(FP,"isSemverLessThan");var BP=w(q(f(),q(f(),f()))),Kc=I({id:w(f()),name:f(),displayName:f(),logoUrl:f(),description:f(),authors:V(f()),platformId:w(f()),directoryPath:w(f()),auth:w(G([Jt,V(Jt)])),version:f(),categories:w(V(Z(Zt))),minimumSupportedRelease:w(f()),maximumSupportedRelease:w(f()),deprecated:w(X()),i18n:BP}),VP=Z(["human","ai","both"]),Jc=I({description:w(f()),idempotent:w(X())}),Xc=I({name:f(),displayName:f(),description:f(),props:aa,requireAuth:X(),errorHandlingOptions:w(qi),outputSchema:w(Xn()),audience:w(VP),aiMetadata:w(Jc)}),Yc=I({name:f(),displayName:f(),description:f(),props:aa,errorHandlingOptions:w(qi),type:Z(ye),sampleData:L(),handshakeConfiguration:w(Xn()),renewConfiguration:w(Hc),testStrategy:Z(Hr),outputSchema:w(Xn()),aiMetadata:w(Jc)}),GP=I({...Kc.shape,actions:q(f(),Xc),triggers:q(f(),Yc)}),HP=I({...Kc.shape,actions:Ee(),triggers:Ee(),suggestedActions:w(V(Xc)),suggestedTriggers:w(V(Yc))}),Qc=I({projectUsage:Ee(),pieceType:Z(Ht),packageType:Z(Br),platformId:w(f()),archiveId:w(f())}),JU=I({...GP.shape,...Qc.shape}),XU=I({...HP.shape,...Qc.shape}),YU=I({name:f(),version:f()});var ZP=Me(require("path")),WP=Me(require("fs/promises"));var nl=require("node:stream");var io=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{a(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((i,s)=>{o.append(s,i)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var ao=class{static{a(this,"DelegatingAuthenticationConverter")}constructor(t=new ua,r=new ca){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},ua=class{static{a(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},ca=class{static{a(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var Kr=class extends Error{constructor(r,n){let o=n.status||500,i=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:i},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=i}static{a(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function el({error:e,requestBody:t}){return e instanceof Kr?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}a(el,"toFailsafeOutput");var O=(s=>(s.GET="GET",s.POST="POST",s.PATCH="PATCH",s.PUT="PUT",s.DELETE="DELETE",s.HEAD="HEAD",s))(O||{});var so=class extends io{static{a(this,"FetchHttpClient")}constructor(t="",r=new ao){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),i=this.getHeaders(t),s=t.queryParams??{};for(let[k,F]of Object.entries(s))o.append(k,F);let l=o.toString(),d=l?`${n}?${l}`:n,b=t.responseType??"json",m=t.followRedirects??!0,P=t.retries??0,{body:y,extraHeaders:p,isStream:h}=KP(t.method)?JP(t.body,i):{body:void 0,extraHeaders:{},isStream:!1},E=YP({...i,...p}),S=await XP(async()=>{let k=new AbortController,F=t.timeout&&t.timeout>0?setTimeout(()=>k.abort(),t.timeout):void 0;try{let Y={method:t.method.toString(),headers:E,body:y,redirect:m?"follow":"manual",signal:k.signal};return h&&(Y.duplex="half"),r?.dispatcher!==void 0&&(Y.dispatcher=r.dispatcher),await fetch(d,Y)}finally{F!==void 0&&clearTimeout(F)}},P),T=m?300:400;if(S.status<200||S.status>=T){let k=await tl(S,b),F=new Kr(t.body,{status:S.status,responseBody:k});throw console.error("[HttpClient#(sanitized error message)] Request failed:",F),F}let A=await tl(S,b);return{status:S.status,headers:QP(S.headers),body:A}}};function KP(e){return e!=="GET"&&e!=="HEAD"}a(KP,"acceptsRequestBody");function JP(e,t){if(tx(e))return{body:void 0,extraHeaders:{},isStream:!1};if(ex(e)){let n=new nl.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}a(JP,"serializeBody");async function tl(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}a(tl,"parseResponseBody");async function XP(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await rl(n);continue}return o}catch(o){if(r=o,n<t){await rl(n);continue}throw o}throw r}a(XP,"sendWithRetries");function rl(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}a(rl,"backoff");function YP(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}a(YP,"normalizeHeaders");function QP(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}a(QP,"toHttpHeaders");function ex(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}a(ex,"isNodeFormData");function tx(e){return e==null}a(tx,"isNil");var v=new so;var FS=Me(require("fs")),sd=Me(ad());var BS={"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 VS(e){let t=e.split(";")[0].trim().toLowerCase();return BS[t]??""}a(VS,"contentTypeToExtension");var GS=a(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),HS=a((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function ud({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:i,props:s,extraProps:l,authLocation:d="headers"}){return x({audience:"human",name:i||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:u.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:a(async({auth:b})=>({url:u.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
6
- i.e ${HS(t,b)}/resource or /resource`,required:!0,defaultValue:b?t(b):"",...s?.url??{}})}),"props")}),method:u.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(O).map(b=>({label:b,value:b}))},...s?.method??{}}),headers:u.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...s?.headers??{}}),queryParams:u.Object({displayName:"Query Parameters",required:!0,...s?.queryParams??{}}),body_type:u.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:u.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:a(async({body_type:b})=>{if(!b)return{};let m=b,P={};switch(m){case"none":break;case"json":P.data=u.Json({displayName:"JSON Body",required:!0,...s?.body??{}});break;case"raw":P.data=u.LongText({displayName:"Raw Body",required:!0});break;case"form_data":P.data=u.Array({displayName:"Form Data",required:!0,properties:{fieldName:u.ShortText({displayName:"Field Name",required:!0}),fieldType:u.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:u.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:u.File({displayName:"File Field Value",required:!1})}});break}return P},"props")}),response_is_binary:u.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:u.Checkbox({displayName:"No Error on Failure",required:!1,...s?.failsafe??{}}),timeout:u.Number({displayName:"Timeout (in seconds)",required:!1,...s?.timeout??{}}),followRedirects:u.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:a(async b=>{let{method:m,url:P,headers:y,queryParams:p,body:h,body_type:E,failsafe:S,timeout:T,response_is_binary:A,followRedirects:k}=b.propsValue;to(m,"Method"),to(P,"URL");let F=$e(r)?{}:await r(b.auth,b.propsValue),Y=P.url,Ae=Y.startsWith("http://")||Y.startsWith("https://")?Y:GS({baseUrl:t(b.auth),relativePath:Y}),ee={method:m,url:Ae,headers:{...y??{},...d==="headers"||!$e(d)?F:{}},queryParams:{...d==="queryParams"?F:{},...p??{}},timeout:T?T*1e3:0,followRedirects:k};if(A&&(ee.responseType="arraybuffer"),h)if(E&&E!=="none"){let ie=h.data;if(E==="form_data"){let Se=ie,re=new sd.default;for(let{fieldName:Ye,fieldType:Qe,textFieldValue:ke,fileFieldValue:Ne}of Se)Qe==="text"&&!B(ke)?re.append(Ye,ke):Qe==="file"&&!B(Ne)&&re.append(Ye,Ne.data,{filename:Ne?.filename});ee.body=re,ee.headers={...ee.headers,...re.getHeaders()}}else ee.body=ie}else E||(ee.body=h);try{let ie=await v.sendRequest(ee);return await ZS(b.files,ie.body,ie.status,ie.headers,A)}catch(ie){if(S)return el({error:ie,requestBody:ee.body});throw ie}},"run")})}a(ud,"createCustomApiCallAction");var ZS=a(async(e,t,r,n,o)=>{let i;if(o&&WS(t)){let s=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=VS(s??"")||"txt",d;t instanceof ArrayBuffer?d=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?d=t:d=Buffer.from(t),i=await e.write({fileName:`output.${l}`,data:d})}else i=t;return{status:r,headers:n,body:i}},"handleBinaryResponse"),WS=a(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");function le(e,t){return{fields:[{key:"data",label:"Data",labelKey:t,listItems:e},{key:"has_more",label:"Has More",format:"boolean"},{key:"url",label:"URL"}]}}a(le,"listSchema");function nr(e,t){return{fields:[{key:"data",label:"Results",labelKey:t,listItems:e},{key:"has_more",label:"Has More",format:"boolean"},{key:"next_page",label:"Next Page"},{key:"url",label:"URL"}]}}a(nr,"searchSchema");var ld=[{key:"line1",label:"Line 1"},{key:"line2",label:"Line 2"},{key:"city",label:"City"},{key:"state",label:"State"},{key:"postal_code",label:"Postal Code"},{key:"country",label:"Country"}],KS=[{key:"brand",label:"Brand"},{key:"last4",label:"Last 4"},{key:"exp_month",label:"Expiry Month",format:"number"},{key:"exp_year",label:"Expiry Year",format:"number"},{key:"funding",label:"Funding"},{key:"country",label:"Country"},{key:"display_brand",label:"Display Brand"}],pd=[{key:"name",label:"Name"},{key:"email",label:"Email",format:"email"},{key:"phone",label:"Phone"},{key:"address",label:"Address",children:ld}],Ra=[{key:"id",label:"Customer ID"},{key:"email",label:"Email",format:"email"},{key:"name",label:"Name"},{key:"description",label:"Description"},{key:"phone",label:"Phone"},{key:"address",label:"Address",children:ld},{key:"balance",label:"Balance",format:"number"},{key:"currency",label:"Currency"},{key:"delinquent",label:"Delinquent",format:"boolean"},{key:"invoice_prefix",label:"Invoice Prefix"},{key:"tax_exempt",label:"Tax Exempt"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Ca=[{key:"id",label:"Product ID"},{key:"name",label:"Name"},{key:"description",label:"Description"},{key:"active",label:"Active",format:"boolean"},{key:"default_price",label:"Default Price"},{key:"images",label:"Images"},{key:"url",label:"URL",format:"url"},{key:"unit_label",label:"Unit Label"},{key:"type",label:"Type"},{key:"created",label:"Created",format:"datetime"},{key:"updated",label:"Updated",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],go=[{key:"id",label:"Price ID"},{key:"active",label:"Active",format:"boolean"},{key:"currency",label:"Currency"},{key:"product",label:"Product"},{key:"nickname",label:"Nickname"},{key:"unit_amount",label:"Unit Amount",format:"number"},{key:"unit_amount_decimal",label:"Unit Amount Decimal"},{key:"type",label:"Type"},{key:"billing_scheme",label:"Billing Scheme"},{key:"tax_behavior",label:"Tax Behavior"},{key:"lookup_key",label:"Lookup Key"},{key:"recurring",label:"Recurring",children:[{key:"interval",label:"Interval"},{key:"interval_count",label:"Interval Count",format:"number"},{key:"trial_period_days",label:"Trial Period Days",format:"number"},{key:"usage_type",label:"Usage Type"}]},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],$a=[{key:"id",label:"Coupon ID"},{key:"name",label:"Name"},{key:"amount_off",label:"Amount Off",format:"number"},{key:"percent_off",label:"Percent Off",format:"number"},{key:"currency",label:"Currency"},{key:"duration",label:"Duration"},{key:"duration_in_months",label:"Duration In Months",format:"number"},{key:"max_redemptions",label:"Max Redemptions",format:"number"},{key:"times_redeemed",label:"Times Redeemed",format:"number"},{key:"redeem_by",label:"Redeem By",format:"datetime"},{key:"valid",label:"Valid",format:"boolean"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],dd=[{key:"id",label:"Promotion Code ID"},{key:"code",label:"Code"},{key:"active",label:"Active",format:"boolean"},{key:"customer",label:"Customer"},{key:"coupon",label:"Coupon",children:$a},{key:"expires_at",label:"Expires At",format:"datetime"},{key:"max_redemptions",label:"Max Redemptions",format:"number"},{key:"times_redeemed",label:"Times Redeemed",format:"number"},{key:"restrictions",label:"Restrictions",children:[{key:"first_time_transaction",label:"First Time Transaction",format:"boolean"},{key:"minimum_amount",label:"Minimum Amount",format:"number"},{key:"minimum_amount_currency",label:"Minimum Amount Currency"}]},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],md=[{key:"id",label:"Tax Rate ID"},{key:"display_name",label:"Display Name"},{key:"description",label:"Description"},{key:"active",label:"Active",format:"boolean"},{key:"percentage",label:"Percentage",format:"number"},{key:"effective_percentage",label:"Effective Percentage",format:"number"},{key:"inclusive",label:"Inclusive",format:"boolean"},{key:"country",label:"Country"},{key:"state",label:"State"},{key:"jurisdiction",label:"Jurisdiction"},{key:"tax_type",label:"Tax Type"},{key:"rate_type",label:"Rate Type"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],fd=[{key:"id",label:"Payment Method ID"},{key:"type",label:"Type"},{key:"customer",label:"Customer"},{key:"billing_details",label:"Billing Details",children:pd},{key:"card",label:"Card",children:KS},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Na=[{key:"id",label:"Payment Intent ID"},{key:"amount",label:"Amount",format:"number"},{key:"amount_received",label:"Amount Received",format:"number"},{key:"amount_capturable",label:"Amount Capturable",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"customer",label:"Customer"},{key:"description",label:"Description"},{key:"payment_method",label:"Payment Method"},{key:"latest_charge",label:"Latest Charge"},{key:"capture_method",label:"Capture Method"},{key:"confirmation_method",label:"Confirmation Method"},{key:"client_secret",label:"Client Secret"},{key:"receipt_email",label:"Receipt Email",format:"email"},{key:"setup_future_usage",label:"Setup Future Usage"},{key:"cancellation_reason",label:"Cancellation Reason"},{key:"canceled_at",label:"Canceled At",format:"datetime"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Da=[{key:"id",label:"Charge ID"},{key:"amount",label:"Amount",format:"number"},{key:"amount_captured",label:"Amount Captured",format:"number"},{key:"amount_refunded",label:"Amount Refunded",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"paid",label:"Paid",format:"boolean"},{key:"captured",label:"Captured",format:"boolean"},{key:"refunded",label:"Refunded",format:"boolean"},{key:"disputed",label:"Disputed",format:"boolean"},{key:"customer",label:"Customer"},{key:"description",label:"Description"},{key:"payment_intent",label:"Payment Intent"},{key:"payment_method",label:"Payment Method"},{key:"balance_transaction",label:"Balance Transaction"},{key:"receipt_url",label:"Receipt URL",format:"url"},{key:"receipt_email",label:"Receipt Email",format:"email"},{key:"receipt_number",label:"Receipt Number"},{key:"calculated_statement_descriptor",label:"Statement Descriptor"},{key:"billing_details",label:"Billing Details",children:pd},{key:"payment_method_details",label:"Payment Method Details",children:[{key:"type",label:"Type"},{key:"card",label:"Card",children:[{key:"brand",label:"Brand"},{key:"last4",label:"Last 4"},{key:"exp_month",label:"Expiry Month",format:"number"},{key:"exp_year",label:"Expiry Year",format:"number"},{key:"funding",label:"Funding"},{key:"country",label:"Country"},{key:"network",label:"Network"}]}]},{key:"outcome",label:"Outcome",children:[{key:"network_status",label:"Network Status"},{key:"risk_level",label:"Risk Level"},{key:"risk_score",label:"Risk Score",format:"number"},{key:"seller_message",label:"Seller Message"},{key:"type",label:"Type"}]},{key:"failure_code",label:"Failure Code"},{key:"failure_message",label:"Failure Message"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],JS=[{key:"id",label:"Balance Transaction ID"},{key:"amount",label:"Amount",format:"number"},{key:"net",label:"Net",format:"number"},{key:"fee",label:"Fee",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"type",label:"Type"},{key:"description",label:"Description"},{key:"reporting_category",label:"Reporting Category"},{key:"source",label:"Source"},{key:"available_on",label:"Available On",format:"datetime"},{key:"created",label:"Created",format:"datetime"},{key:"fee_details",label:"Fee Details",labelKey:"description",listItems:[{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"type",label:"Type"},{key:"description",label:"Description"}]}],hd=[{key:"id",label:"Refund ID"},{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"charge",label:"Charge"},{key:"payment_intent",label:"Payment Intent"},{key:"payment_method",label:"Payment Method"},{key:"balance_transaction",label:"Balance Transaction"},{key:"reason",label:"Reason"},{key:"receipt_number",label:"Receipt Number"},{key:"created",label:"Created",format:"datetime"},{key:"metadata",label:"Metadata",dynamicKey:!0}],XS=[{key:"id",label:"Invoice Item ID"},{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"customer",label:"Customer"},{key:"invoice",label:"Invoice"},{key:"description",label:"Description"},{key:"quantity",label:"Quantity",format:"number"},{key:"date",label:"Date",format:"datetime"},{key:"discountable",label:"Discountable",format:"boolean"},{key:"proration",label:"Proration",format:"boolean"},{key:"period",label:"Period",children:[{key:"start",label:"Start",format:"datetime"},{key:"end",label:"End",format:"datetime"}]},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],yd=[{key:"id",label:"Credit Note ID"},{key:"number",label:"Number"},{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"type",label:"Type"},{key:"reason",label:"Reason"},{key:"customer",label:"Customer"},{key:"invoice",label:"Invoice"},{key:"memo",label:"Memo"},{key:"subtotal",label:"Subtotal",format:"number"},{key:"subtotal_excluding_tax",label:"Subtotal Excluding Tax",format:"number"},{key:"total",label:"Total",format:"number"},{key:"total_excluding_tax",label:"Total Excluding Tax",format:"number"},{key:"discount_amount",label:"Discount Amount",format:"number"},{key:"pre_payment_amount",label:"Pre-Payment Amount",format:"number"},{key:"post_payment_amount",label:"Post-Payment Amount",format:"number"},{key:"pdf",label:"PDF",format:"url"},{key:"created",label:"Created",format:"datetime"},{key:"effective_at",label:"Effective At",format:"datetime"},{key:"voided_at",label:"Voided At",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],gd=[{key:"id",label:"Checkout Session ID"},{key:"status",label:"Status"},{key:"payment_status",label:"Payment Status"},{key:"mode",label:"Mode"},{key:"url",label:"URL",format:"url"},{key:"success_url",label:"Success URL",format:"url"},{key:"cancel_url",label:"Cancel URL",format:"url"},{key:"amount_subtotal",label:"Amount Subtotal",format:"number"},{key:"amount_total",label:"Amount Total",format:"number"},{key:"currency",label:"Currency"},{key:"customer",label:"Customer"},{key:"customer_email",label:"Customer Email",format:"email"},{key:"payment_intent",label:"Payment Intent"},{key:"subscription",label:"Subscription"},{key:"invoice",label:"Invoice"},{key:"payment_link",label:"Payment Link"},{key:"client_reference_id",label:"Client Reference ID"},{key:"total_details",label:"Total Details",children:[{key:"amount_discount",label:"Amount Discount",format:"number"},{key:"amount_shipping",label:"Amount Shipping",format:"number"},{key:"amount_tax",label:"Amount Tax",format:"number"}]},{key:"expires_at",label:"Expires At",format:"datetime"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],vd=[{key:"id",label:"Payment Link ID"},{key:"active",label:"Active",format:"boolean"},{key:"url",label:"URL",format:"url"},{key:"currency",label:"Currency"},{key:"allow_promotion_codes",label:"Allow Promotion Codes",format:"boolean"},{key:"billing_address_collection",label:"Billing Address Collection"},{key:"customer_creation",label:"Customer Creation"},{key:"payment_method_collection",label:"Payment Method Collection"},{key:"submit_type",label:"Submit Type"},{key:"application_fee_amount",label:"Application Fee Amount",format:"number"},{key:"application_fee_percent",label:"Application Fee Percent",format:"number"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],_d=[{key:"id",label:"Dispute ID"},{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"reason",label:"Reason"},{key:"charge",label:"Charge"},{key:"payment_intent",label:"Payment Intent"},{key:"balance_transaction",label:"Balance Transaction"},{key:"is_charge_refundable",label:"Is Charge Refundable",format:"boolean"},{key:"evidence_details",label:"Evidence Details",children:[{key:"due_by",label:"Due By",format:"datetime"},{key:"has_evidence",label:"Has Evidence",format:"boolean"},{key:"past_due",label:"Past Due",format:"boolean"},{key:"submission_count",label:"Submission Count",format:"number"}]},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],bd=[{key:"id",label:"Payout ID"},{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"type",label:"Type"},{key:"method",label:"Method"},{key:"automatic",label:"Automatic",format:"boolean"},{key:"arrival_date",label:"Arrival Date",format:"datetime"},{key:"balance_transaction",label:"Balance Transaction"},{key:"destination",label:"Destination"},{key:"description",label:"Description"},{key:"statement_descriptor",label:"Statement Descriptor"},{key:"source_type",label:"Source Type"},{key:"failure_code",label:"Failure Code"},{key:"failure_message",label:"Failure Message"},{key:"reconciliation_status",label:"Reconciliation Status"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],YS=[{key:"id",label:"Transfer ID"},{key:"amount",label:"Amount",format:"number"},{key:"amount_reversed",label:"Amount Reversed",format:"number"},{key:"currency",label:"Currency"},{key:"description",label:"Description"},{key:"destination",label:"Destination"},{key:"source_transaction",label:"Source Transaction"},{key:"transfer_group",label:"Transfer Group"},{key:"reversed",label:"Reversed",format:"boolean"},{key:"balance_transaction",label:"Balance Transaction"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Pd=[{key:"id",label:"Event ID"},{key:"type",label:"Type"},{key:"api_version",label:"API Version"},{key:"created",label:"Created",format:"datetime"},{key:"pending_webhooks",label:"Pending Webhooks",format:"number"},{key:"request",label:"Request",children:[{key:"id",label:"Request ID"},{key:"idempotency_key",label:"Idempotency Key"}]},{key:"data",label:"Data",children:[{key:"object",label:"Object"}]},{key:"livemode",label:"Live Mode",format:"boolean"}],xd=[{key:"id",label:"Subscription Item ID"},{key:"quantity",label:"Quantity",format:"number"},{key:"subscription",label:"Subscription"},{key:"current_period_start",label:"Current Period Start",format:"datetime"},{key:"current_period_end",label:"Current Period End",format:"datetime"},{key:"price",label:"Price",children:go},{key:"created",label:"Created",format:"datetime"},{key:"metadata",label:"Metadata",dynamicKey:!0}],za=[{key:"id",label:"Subscription ID"},{key:"status",label:"Status"},{key:"customer",label:"Customer"},{key:"currency",label:"Currency"},{key:"description",label:"Description"},{key:"collection_method",label:"Collection Method"},{key:"latest_invoice",label:"Latest Invoice"},{key:"default_payment_method",label:"Default Payment Method"},{key:"quantity",label:"Quantity",format:"number"},{key:"start_date",label:"Start Date",format:"datetime"},{key:"billing_cycle_anchor",label:"Billing Cycle Anchor",format:"datetime"},{key:"cancel_at",label:"Cancel At",format:"datetime"},{key:"canceled_at",label:"Canceled At",format:"datetime"},{key:"cancel_at_period_end",label:"Cancel At Period End",format:"boolean"},{key:"ended_at",label:"Ended At",format:"datetime"},{key:"trial_start",label:"Trial Start",format:"datetime"},{key:"trial_end",label:"Trial End",format:"datetime"},{key:"items",label:"Items",children:[{key:"data",label:"Data",labelKey:"id",listItems:xd}]},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Sd=[{key:"id",label:"Line ID"},{key:"description",label:"Description"},{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"quantity",label:"Quantity",format:"number"},{key:"subtotal",label:"Subtotal",format:"number"},{key:"invoice",label:"Invoice"},{key:"period",label:"Period",children:[{key:"start",label:"Start",format:"datetime"},{key:"end",label:"End",format:"datetime"}]},{key:"discountable",label:"Discountable",format:"boolean"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Ma=[{key:"id",label:"Invoice ID"},{key:"number",label:"Number"},{key:"status",label:"Status"},{key:"currency",label:"Currency"},{key:"customer",label:"Customer"},{key:"customer_email",label:"Customer Email",format:"email"},{key:"customer_name",label:"Customer Name"},{key:"customer_phone",label:"Customer Phone"},{key:"description",label:"Description"},{key:"collection_method",label:"Collection Method"},{key:"billing_reason",label:"Billing Reason"},{key:"amount_due",label:"Amount Due",format:"number"},{key:"amount_paid",label:"Amount Paid",format:"number"},{key:"amount_remaining",label:"Amount Remaining",format:"number"},{key:"subtotal",label:"Subtotal",format:"number"},{key:"total",label:"Total",format:"number"},{key:"attempt_count",label:"Attempt Count",format:"number"},{key:"attempted",label:"Attempted",format:"boolean"},{key:"auto_advance",label:"Auto Advance",format:"boolean"},{key:"due_date",label:"Due Date",format:"datetime"},{key:"created",label:"Created",format:"datetime"},{key:"period_start",label:"Period Start",format:"datetime"},{key:"period_end",label:"Period End",format:"datetime"},{key:"effective_at",label:"Effective At",format:"datetime"},{key:"hosted_invoice_url",label:"Hosted Invoice URL",format:"url"},{key:"invoice_pdf",label:"Invoice PDF",format:"url"},{key:"receipt_number",label:"Receipt Number"},{key:"starting_balance",label:"Starting Balance",format:"number"},{key:"ending_balance",label:"Ending Balance",format:"number"},{key:"status_transitions",label:"Status Transitions",children:[{key:"finalized_at",label:"Finalized At",format:"datetime"},{key:"paid_at",label:"Paid At",format:"datetime"},{key:"marked_uncollectible_at",label:"Marked Uncollectible At",format:"datetime"},{key:"voided_at",label:"Voided At",format:"datetime"}]},{key:"lines",label:"Lines",children:[{key:"data",label:"Data",labelKey:"description",listItems:Sd}]},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],cd=[{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"}],Oe={fields:Ra},_t={fields:Ca},bt={fields:go},vo={fields:$a},_o={fields:dd},bo={fields:md},or={fields:fd},Te={fields:Na},ir={fields:Da},Pt={fields:hd},Td={fields:XS},ge={fields:Ma},be={fields:za},ar={fields:yd},ze={fields:vd},sr={fields:gd},xt={fields:_d},Po={fields:bd},Ed={fields:Pd},Id={fields:[{key:"available",label:"Available",labelKey:"currency",listItems:cd},{key:"pending",label:"Pending",labelKey:"currency",listItems:cd},{key:"livemode",label:"Live Mode",format:"boolean"}]},Ad=le(Ra,"email"),kd=le(Ca,"name"),wd=le(go,"id"),Od=le($a,"name"),Rd=le(dd,"code"),Cd=le(md,"display_name"),$d=le(fd,"id"),Nd=le(Na,"id"),Dd=le(Da,"id"),zd=le(hd,"id"),Md=le(Ma,"number"),Ud=le(Sd,"description"),Ld=le(za,"id"),qd=le(xd,"id"),jd=le(yd,"number"),Fd=le(vd,"id"),Bd=le(gd,"id"),Vd=le(_d,"id"),Gd=le(bd,"id"),Hd=le(YS,"id"),Zd=le(Pd,"type"),Wd=le(JS,"id"),Kd=nr(Da,"id"),xo=nr(Ra,"email"),Jd=nr(Ma,"number"),Xd=nr(Na,"id"),Yd=nr(go,"id"),Qd=nr(Ca,"name"),So={fields:[{key:"success",label:"Success",format:"boolean"},{key:"count",label:"Count",format:"number"},{key:"total_fetched",label:"Total Fetched",format:"number"},{key:"requests_made",label:"Requests Made",format:"number"},{key:"has_more_available",label:"Has More Available",format:"boolean"},{key:"subscriptions",label:"Subscriptions",labelKey:"id",listItems:za}]};var em=x({name:"create_customer",auth:g,displayName:"Create Customer",description:"Create a customer in stripe",audience:"human",aiMetadata:{description:"Creates a new customer record in Stripe from an email and name, with optional contact and address fields. Use when onboarding a new payer before charging, invoicing, or subscribing them. Not idempotent: each call creates a distinct customer even with identical input.",idempotent:!1},props:{email:u.ShortText({displayName:"Email",description:void 0,required:!0}),name:u.ShortText({displayName:"Name",required:!0}),description:u.LongText({displayName:"Description",required:!1}),phone:u.ShortText({displayName:"Phone",required:!1}),line1:u.ShortText({displayName:"Address Line 1",required:!1}),postal_code:u.ShortText({displayName:"Postal Code",required:!1}),city:u.ShortText({displayName:"City",required:!1}),state:u.ShortText({displayName:"State",required:!1}),country:u.ShortText({displayName:"Country",required:!1})},outputSchema:Oe,async run(e){let t={email:e.propsValue.email,name:e.propsValue.name,description:e.propsValue.description,phone:e.propsValue.phone,address:{line1:e.propsValue.line1,postal_code:e.propsValue.postal_code,city:e.propsValue.city,state:e.propsValue.state,country:e.propsValue.country}};return(await v.sendRequest({method:"POST",url:"https://api.stripe.com/v1/customers",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},body:{email:t.email,name:t.name,description:t.description,phone:t.phone,address:t.address}})).body}});var tm=x({name:"create_invoice",auth:g,displayName:"Create Invoice",description:"Create an Invoice in stripe",audience:"human",aiMetadata:{description:"Creates a draft invoice in Stripe for an existing customer in the given currency. Use to bill a customer for pending invoice items. Requires a valid Stripe customer ID; not idempotent, as each call creates a separate invoice.",idempotent:!1},props:{customer_id:u.ShortText({displayName:"Customer ID",description:"Stripe Customer ID",required:!0}),currency:u.ShortText({displayName:"Currency",description:"Currency for the invoice (e.g., USD)",required:!0}),description:u.LongText({displayName:"Description",description:"Description for the invoice",required:!1})},outputSchema:ge,async run(e){let t={customer:e.propsValue.customer_id,currency:e.propsValue.currency,description:e.propsValue.description};return(await v.sendRequest({method:"POST",url:"https://api.stripe.com/v1/invoices",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},body:{customer:t.customer,currency:t.currency,description:t.description}})).body}});var rm=x({name:"retrieve_customer",auth:g,displayName:"Retrieve Customer",description:"Retrieve a customer in stripe by id",audience:"human",aiMetadata:{description:"Fetches the full details of a single Stripe customer by its customer ID (e.g., cus_...). Use when you already have the exact ID and need the current record; for lookup by email use Search Customer instead. Read-only and idempotent.",idempotent:!0},props:{id:u.ShortText({displayName:"ID",description:void 0,required:!0})},outputSchema:Oe,async run(e){let t={id:e.propsValue.id};return(await v.sendRequest({method:"GET",url:`https://api.stripe.com/v1/customers/${t.id}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var gr=Me(require("crypto"),1),ms=require("events");var Eo=Me(require("crypto"),1);var St=class{static{a(this,"CryptoProvider")}computeHMACSignature(t,r){throw new Error("computeHMACSignature not implemented.")}computeHMACSignatureAsync(t,r){throw new Error("computeHMACSignatureAsync not implemented.")}computeSHA256Async(t){throw new Error("computeSHA256 not implemented.")}},ur=class extends Error{static{a(this,"CryptoProviderOnlySupportsAsyncError")}};var To=class extends St{static{a(this,"NodeCryptoProvider")}computeHMACSignature(t,r){return Eo.createHmac("sha256",r).update(t,"utf8").digest("hex")}async computeHMACSignatureAsync(t,r){return await this.computeHMACSignature(t,r)}async computeSHA256Async(t){return new Uint8Array(await Eo.createHash("sha256").update(t).digest())}};var La=Me(require("http"),1),qa=Me(require("https"),1);var xe=class e{static{a(this,"HttpClient")}getClientName(){throw new Error("getClientName not implemented.")}makeRequest(t,r,n,o,i,s,l,d){throw new Error("makeRequest not implemented.")}static makeTimeoutError(){let t=new TypeError(e.TIMEOUT_ERROR_CODE);return t.code=e.TIMEOUT_ERROR_CODE,t}};xe.CONNECTION_CLOSED_ERROR_CODES=["ECONNRESET","EPIPE"];xe.TIMEOUT_ERROR_CODE="ETIMEDOUT";var Tt=class{static{a(this,"HttpClientResponse")}constructor(t,r){this._statusCode=t,this._headers=r}getStatusCode(){return this._statusCode}getHeaders(){return this._headers}getRawResponse(){throw new Error("getRawResponse not implemented.")}toStream(t){throw new Error("toStream not implemented.")}toJSON(){throw new Error("toJSON not implemented.")}};var nm=La.default||La,om=qa.default||qa,QS=new nm.Agent({keepAlive:!0}),eT=new om.Agent({keepAlive:!0}),en=class extends xe{static{a(this,"NodeHttpClient")}constructor(t){super(),this._agent=t}getClientName(){return"node"}makeRequest(t,r,n,o,i,s,l,d){let b=l==="http",m=this._agent;return m||(m=b?QS:eT),new Promise((y,p)=>{let h=(b?nm:om).request({host:t,port:r,path:n,method:o,agent:m,headers:i,ciphers:"DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:!MD5"});h.setTimeout(d,()=>{h.destroy(xe.makeTimeoutError())}),h.on("response",E=>{y(new Ua(E))}),h.on("error",E=>{p(E)}),h.once("socket",E=>{E.connecting?E.once(b?"connect":"secureConnect",()=>{h.write(s),h.end()}):(h.write(s),h.end())})})}},Ua=class extends Tt{static{a(this,"NodeHttpClientResponse")}constructor(t){super(t.statusCode,t.headers||{}),this._res=t}getRawResponse(){return this._res}toStream(t){return this._res.once("end",()=>t()),this._res}toJSON(){return new Promise((t,r)=>{let n="";this._res.setEncoding("utf8"),this._res.on("data",o=>{n+=o}),this._res.once("end",()=>{try{t(JSON.parse(n))}catch(o){r(o)}})})}};var Jm=Me(Km(),1);var cs=["apiKey","idempotencyKey","stripeAccount","apiVersion","maxNetworkRetries","timeout","host","authenticator","stripeContext","additionalHeaders","streaming"];function Xm(e){return e&&typeof e=="object"&&cs.some(t=>Object.prototype.hasOwnProperty.call(e,t))}a(Xm,"isOptionsHash");function At(e,t){return Jm.stringify(e,{serializeDate:a(r=>Math.floor(r.getTime()/1e3).toString(),"serializeDate"),arrayFormat:t=="v2"?"repeat":"indices"}).replace(/%5B/g,"[").replace(/%5D/g,"]")}a(At,"queryStringifyRequestData");var Mo=(()=>{let e={"\n":"\\n",'"':'\\"',"\u2028":"\\u2028","\u2029":"\\u2029"};return t=>{let r=t.replace(/["\n\r\u2028\u2029]/g,n=>e[n]);return n=>r.replace(/\{([\s\S]+?)\}/g,(o,i)=>{let s=n[i];return NE(s)?encodeURIComponent(s):""})}})();function NE(e){return["number","string","boolean"].includes(typeof e)}a(NE,"isValidEncodeUriComponentType");function Ym(e){let t=e.match(/\{\w+\}/g);return t?t.map(r=>r.replace(/[{}]/g,"")):[]}a(Ym,"extractUrlParams");function dr(e){if(!Array.isArray(e)||!e[0]||typeof e[0]!="object")return{};if(!Xm(e[0]))return e.shift();let t=Object.keys(e[0]),r=t.filter(n=>cs.includes(n));return r.length>0&&r.length!==t.length&&dn(`Options found in arguments (${r.join(", ")}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.`),{}}a(dr,"getDataFromArgs");function Uo(e){let t={host:null,headers:{},settings:{},streaming:!1};if(e.length>0){let r=e[e.length-1];if(typeof r=="string")t.authenticator=zo(e.pop());else if(Xm(r)){let n=Object.assign({},e.pop()),o=Object.keys(n).filter(i=>!cs.includes(i));if(o.length&&dn(`Invalid options found (${o.join(", ")}); ignoring.`),n.apiKey&&(t.authenticator=zo(n.apiKey)),n.idempotencyKey&&(t.headers["Idempotency-Key"]=n.idempotencyKey),n.stripeAccount&&(t.headers["Stripe-Account"]=n.stripeAccount),n.stripeContext){if(t.headers["Stripe-Account"])throw new Error("Can't specify both stripeAccount and stripeContext.");t.headers["Stripe-Context"]=n.stripeContext}if(n.apiVersion&&(t.headers["Stripe-Version"]=n.apiVersion),Number.isInteger(n.maxNetworkRetries)&&(t.settings.maxNetworkRetries=n.maxNetworkRetries),Number.isInteger(n.timeout)&&(t.settings.timeout=n.timeout),n.host&&(t.host=n.host),n.authenticator){if(n.apiKey)throw new Error("Can't specify both apiKey and authenticator.");if(typeof n.authenticator!="function")throw new Error("The authenticator must be a function receiving a request as the first parameter.");t.authenticator=n.authenticator}n.additionalHeaders&&(t.headers=n.additionalHeaders),n.streaming&&(t.streaming=!0)}}return t}a(Uo,"getOptionsFromArgs");function Qm(e){let t=this,r=Object.prototype.hasOwnProperty.call(e,"constructor")?e.constructor:function(...n){t.apply(this,n)};return Object.assign(r,t),r.prototype=Object.create(t.prototype),Object.assign(r.prototype,e),r}a(Qm,"protoExtend");function Lo(e){if(typeof e!="object")throw new Error("Argument must be an object");return Object.keys(e).reduce((t,r)=>(e[r]!=null&&(t[r]=e[r]),t),{})}a(Lo,"removeNullish");function ef(e){return e&&typeof e=="object"?Object.keys(e).reduce((t,r)=>(t[DE(r)]=e[r],t),{}):e}a(ef,"normalizeHeaders");function DE(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()).join("-")}a(DE,"normalizeHeader");function pn(e,t){return t?e.then(r=>{setTimeout(()=>{t(null,r)},0)},r=>{setTimeout(()=>{t(r,null)},0)}):e}a(pn,"callbackifyPromiseWithTimeout");function tf(e){return e==="OAuth"?"oauth":e[0].toLowerCase()+e.substring(1)}a(tf,"pascalToCamelCase");function dn(e){return typeof process.emitWarning!="function"?console.warn(`Stripe: ${e}`):process.emitWarning(e,"Stripe")}a(dn,"emitWarning");function zE(e){let t=typeof e;return(t==="function"||t==="object")&&!!e}a(zE,"isObject");function rf(e){let t={},r=a((n,o)=>{Object.entries(n).forEach(([i,s])=>{let l=o?`${o}[${i}]`:i;if(zE(s)){if(!(s instanceof Uint8Array)&&!Object.prototype.hasOwnProperty.call(s,"data"))return r(s,l);t[l]=s}else t[l]=String(s)})},"step");return r(e,null),t}a(rf,"flattenAndStringify");function qo(e,t,r){if(!Number.isInteger(t)){if(r!==void 0)return r;throw new Error(`${e} must be an integer`)}return t}a(qo,"validateInteger");function nf(){return typeof process>"u"?{}:{lang_version:process.version,platform:process.platform}}a(nf,"determineProcessUserAgentProperties");function zo(e){let t=a(r=>(r.headers.Authorization="Bearer "+e,Promise.resolve()),"authenticator");return t._apiKey=e,t}a(zo,"createApiKeyAuthenticator");function of(e){let t=e.reduce((o,i)=>o+i.length,0),r=new Uint8Array(t),n=0;return e.forEach(o=>{r.set(o,n),n+=o.length}),r}a(of,"concat");function ME(e,t){return this[e]instanceof Date?Math.floor(this[e].getTime()/1e3).toString():t}a(ME,"dateTimeReplacer");function af(e){return JSON.stringify(e,ME)}a(af,"jsonStringifyRequestData");function mr(e){return e&&e.startsWith("/v2")?"v2":"v1"}a(mr,"getAPIMode");function jo(e){return Array.isArray(e)?e.join(", "):String(e)}a(jo,"parseHttpHeaderAsString");function sf(e){let t=Array.isArray(e)?e[0]:e;return Number(t)}a(sf,"parseHttpHeaderAsNumber");function uf(e){return Object.entries(e).map(([t,r])=>[t,jo(r)])}a(uf,"parseHeadersForFetch");var Fo=class e extends xe{static{a(this,"FetchHttpClient")}constructor(t){if(super(),!t){if(!globalThis.fetch)throw new Error("fetch() function not provided and is not defined in the global scope. You must provide a fetch implementation.");t=globalThis.fetch}globalThis.AbortController?this._fetchFn=e.makeFetchWithAbortTimeout(t):this._fetchFn=e.makeFetchWithRaceTimeout(t)}static makeFetchWithRaceTimeout(t){return(r,n,o)=>{let i,s=new Promise((d,b)=>{i=setTimeout(()=>{i=null,b(xe.makeTimeoutError())},o)}),l=t(r,n);return Promise.race([l,s]).finally(()=>{i&&clearTimeout(i)})}}static makeFetchWithAbortTimeout(t){return async(r,n,o)=>{let i=new AbortController,s=setTimeout(()=>{s=null,i.abort(xe.makeTimeoutError())},o);try{return await t(r,Object.assign(Object.assign({},n),{signal:i.signal}))}catch(l){throw l.name==="AbortError"?xe.makeTimeoutError():l}finally{s&&clearTimeout(s)}}}getClientName(){return"fetch"}async makeRequest(t,r,n,o,i,s,l,d){let b=l==="http",m=new URL(n,`${b?"http":"https"}://${t}`);m.port=r;let P=o=="POST"||o=="PUT"||o=="PATCH",y=s||(P?"":void 0),p=await this._fetchFn(m.toString(),{method:o,headers:uf(i),body:typeof y=="object"?JSON.stringify(y):y},d);return new ls(p)}},ls=class e extends Tt{static{a(this,"FetchHttpClientResponse")}constructor(t){super(t.status,e._transformHeadersToObject(t.headers)),this._res=t}getRawResponse(){return this._res}toStream(t){return t(),this._res.body}toJSON(){return this._res.json()}static _transformHeadersToObject(t){let r={};for(let n of t){if(!Array.isArray(n)||n.length!=2)throw new Error("Response objects produced by the fetch function given to FetchHttpClient do not have an iterable headers map. Response#headers should be an iterable object.");r[n[0]]=n[1]}return r}};var Bo=class extends St{static{a(this,"SubtleCryptoProvider")}constructor(t){super(),this.subtleCrypto=t||crypto.subtle}computeHMACSignature(t,r){throw new ur("SubtleCryptoProvider cannot be used in a synchronous context.")}async computeHMACSignatureAsync(t,r){let n=new TextEncoder,o=await this.subtleCrypto.importKey("raw",n.encode(r),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),i=await this.subtleCrypto.sign("hmac",o,n.encode(t)),s=new Uint8Array(i),l=new Array(s.length);for(let d=0;d<s.length;d++)l[d]=ps[s[d]];return l.join("")}async computeSHA256Async(t){return new Uint8Array(await this.subtleCrypto.digest("SHA-256",t))}},ps=new Array(256);for(let e=0;e<ps.length;e++)ps[e]=e.toString(16).padStart(2,"0");var Vo=class{static{a(this,"PlatformFunctions")}constructor(){this._fetchFn=null,this._agent=null}getUname(){throw new Error("getUname not implemented.")}uuid4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})}secureCompare(t,r){if(t.length!==r.length)return!1;let n=t.length,o=0;for(let i=0;i<n;++i)o|=t.charCodeAt(i)^r.charCodeAt(i);return o===0}createEmitter(){throw new Error("createEmitter not implemented.")}tryBufferData(t){throw new Error("tryBufferData not implemented.")}createNodeHttpClient(t){throw new Error("createNodeHttpClient not implemented.")}createFetchHttpClient(t){return new Fo(t)}createDefaultHttpClient(){throw new Error("createDefaultHttpClient not implemented.")}createNodeCryptoProvider(){throw new Error("createNodeCryptoProvider not implemented.")}createSubtleCryptoProvider(t){return new Bo(t)}createDefaultCryptoProvider(){throw new Error("createDefaultCryptoProvider not implemented.")}};var Jo={};zn(Jo,{StripeAPIError:()=>fr,StripeAuthenticationError:()=>hr,StripeCardError:()=>Go,StripeConnectionError:()=>hn,StripeError:()=>de,StripeIdempotencyError:()=>Ho,StripeInvalidGrantError:()=>Zo,StripeInvalidRequestError:()=>mn,StripePermissionError:()=>fn,StripeRateLimitError:()=>yr,StripeSignatureVerificationError:()=>qe,StripeUnknownError:()=>Wo,TemporarySessionExpiredError:()=>Ko,generateV1Error:()=>yn,generateV2Error:()=>ds});var yn=a(e=>{switch(e.type){case"card_error":return new Go(e);case"invalid_request_error":return new mn(e);case"api_error":return new fr(e);case"authentication_error":return new hr(e);case"rate_limit_error":return new yr(e);case"idempotency_error":return new Ho(e);case"invalid_grant":return new Zo(e);default:return new Wo(e)}},"generateV1Error"),ds=a(e=>e.type==="temporary_session_expired"?new Ko(e):e.code==="invalid_fields"?new mn(e):yn(e),"generateV2Error"),de=class extends Error{static{a(this,"StripeError")}constructor(t={},r=null){var n;super(t.message),this.type=r||this.constructor.name,this.raw=t,this.rawType=t.type,this.code=t.code,this.doc_url=t.doc_url,this.param=t.param,this.detail=t.detail,this.headers=t.headers,this.requestId=t.requestId,this.statusCode=t.statusCode,this.message=(n=t.message)!==null&&n!==void 0?n:"",this.userMessage=t.user_message,this.charge=t.charge,this.decline_code=t.decline_code,this.payment_intent=t.payment_intent,this.payment_method=t.payment_method,this.payment_method_type=t.payment_method_type,this.setup_intent=t.setup_intent,this.source=t.source}};de.generate=yn;var Go=class extends de{static{a(this,"StripeCardError")}constructor(t={}){super(t,"StripeCardError")}},mn=class extends de{static{a(this,"StripeInvalidRequestError")}constructor(t={}){super(t,"StripeInvalidRequestError")}},fr=class extends de{static{a(this,"StripeAPIError")}constructor(t={}){super(t,"StripeAPIError")}},hr=class extends de{static{a(this,"StripeAuthenticationError")}constructor(t={}){super(t,"StripeAuthenticationError")}},fn=class extends de{static{a(this,"StripePermissionError")}constructor(t={}){super(t,"StripePermissionError")}},yr=class extends de{static{a(this,"StripeRateLimitError")}constructor(t={}){super(t,"StripeRateLimitError")}},hn=class extends de{static{a(this,"StripeConnectionError")}constructor(t={}){super(t,"StripeConnectionError")}},qe=class extends de{static{a(this,"StripeSignatureVerificationError")}constructor(t,r,n={}){super(n,"StripeSignatureVerificationError"),this.header=t,this.payload=r}},Ho=class extends de{static{a(this,"StripeIdempotencyError")}constructor(t={}){super(t,"StripeIdempotencyError")}},Zo=class extends de{static{a(this,"StripeInvalidGrantError")}constructor(t={}){super(t,"StripeInvalidGrantError")}},Wo=class extends de{static{a(this,"StripeUnknownError")}constructor(t={}){super(t,"StripeUnknownError")}},Ko=class extends de{static{a(this,"TemporarySessionExpiredError")}constructor(t={}){super(t,"TemporarySessionExpiredError")}};var cf=require("child_process");var fs=class extends de{static{a(this,"StreamProcessingError")}},Xo=class extends Vo{static{a(this,"NodePlatformFunctions")}constructor(){super(),this._exec=cf.exec,this._UNAME_CACHE=null}uuid4(){return gr.randomUUID?gr.randomUUID():super.uuid4()}getUname(){return this._UNAME_CACHE||(this._UNAME_CACHE=new Promise((t,r)=>{try{this._exec("uname -a",(n,o)=>{if(n)return t(null);t(o)})}catch{t(null)}})),this._UNAME_CACHE}secureCompare(t,r){if(!t||!r)throw new Error("secureCompare must receive two arguments");if(t.length!==r.length)return!1;if(gr.timingSafeEqual){let n=new TextEncoder,o=n.encode(t),i=n.encode(r);return gr.timingSafeEqual(o,i)}return super.secureCompare(t,r)}createEmitter(){return new ms.EventEmitter}tryBufferData(t){if(!(t.file.data instanceof ms.EventEmitter))return Promise.resolve(t);let r=[];return new Promise((n,o)=>{t.file.data.on("data",i=>{r.push(i)}).once("end",()=>{let i=Object.assign({},t);i.file.data=of(r),n(i)}).on("error",i=>{o(new fs({message:"An error occurred while attempting to process the file for upload.",detail:i}))})})}createNodeHttpClient(t){return new en(t)}createDefaultHttpClient(){return new en}createNodeCryptoProvider(){return new To}createDefaultCryptoProvider(){return this.createNodeCryptoProvider()}};var UE=60,Yo=class e{static{a(this,"RequestSender")}constructor(t,r){this._stripe=t,this._maxBufferedRequestMetric=r}_addHeadersDirectlyToObject(t,r){t.requestId=r["request-id"],t.stripeAccount=t.stripeAccount||r["stripe-account"],t.apiVersion=t.apiVersion||r["stripe-version"],t.idempotencyKey=t.idempotencyKey||r["idempotency-key"]}_makeResponseEvent(t,r,n){let o=Date.now(),i=o-t.request_start_time;return Lo({api_version:n["stripe-version"],account:n["stripe-account"],idempotency_key:n["idempotency-key"],method:t.method,path:t.path,status:r,request_id:this._getRequestId(n),elapsed:i,request_start_time:t.request_start_time,request_end_time:o})}_getRequestId(t){return t["request-id"]}_streamingResponseHandler(t,r,n){return o=>{let i=o.getHeaders(),s=a(()=>{let d=this._makeResponseEvent(t,o.getStatusCode(),i);this._stripe._emitter.emit("response",d),this._recordRequestMetrics(this._getRequestId(i),d.elapsed,r)},"streamCompleteCallback"),l=o.toStream(s);return this._addHeadersDirectlyToObject(l,i),n(null,l)}}_jsonResponseHandler(t,r,n,o){return i=>{let s=i.getHeaders(),l=this._getRequestId(s),d=i.getStatusCode(),b=this._makeResponseEvent(t,d,s);this._stripe._emitter.emit("response",b),i.toJSON().then(m=>{if(m.error){let P;throw typeof m.error=="string"&&(m.error={type:m.error,message:m.error_description}),m.error.headers=s,m.error.statusCode=d,m.error.requestId=l,d===401?P=new hr(m.error):d===403?P=new fn(m.error):d===429?P=new yr(m.error):r==="v2"?P=ds(m.error):P=yn(m.error),P}return m},m=>{throw new fr({message:"Invalid JSON received from the Stripe API",exception:m,requestId:s["request-id"]})}).then(m=>{this._recordRequestMetrics(l,b.elapsed,n);let P=i.getRawResponse();this._addHeadersDirectlyToObject(P,s),Object.defineProperty(m,"lastResponse",{enumerable:!1,writable:!1,value:P}),o(null,m)},m=>o(m,null))}}static _generateConnectionErrorMessage(t){return`An error occurred with our connection to Stripe.${t>0?` Request was retried ${t} times.`:""}`}static _shouldRetry(t,r,n,o){return o&&r===0&&xe.CONNECTION_CLOSED_ERROR_CODES.includes(o.code)?!0:r>=n?!1:t?t.getHeaders()["stripe-should-retry"]==="false"?!1:t.getHeaders()["stripe-should-retry"]==="true"||t.getStatusCode()===409||t.getStatusCode()>=500:!0}_getSleepTimeInMS(t,r=null){let n=this._stripe.getInitialNetworkRetryDelay(),o=this._stripe.getMaxNetworkRetryDelay(),i=Math.min(n*Math.pow(2,t-1),o);return i*=.5*(1+Math.random()),i=Math.max(n,i),Number.isInteger(r)&&r<=UE&&(i=Math.max(i,r)),i*1e3}_getMaxNetworkRetries(t={}){return t.maxNetworkRetries!==void 0&&Number.isInteger(t.maxNetworkRetries)?t.maxNetworkRetries:this._stripe.getMaxNetworkRetries()}_defaultIdempotencyKey(t,r,n){let o=this._getMaxNetworkRetries(r),i=a(()=>`stripe-node-retry-${this._stripe._platformFunctions.uuid4()}`,"genKey");if(n==="v2"){if(t==="POST"||t==="DELETE")return i()}else if(n==="v1"&&t==="POST"&&o>0)return i();return null}_makeHeaders({contentType:t,contentLength:r,apiVersion:n,clientUserAgent:o,method:i,userSuppliedHeaders:s,userSuppliedSettings:l,stripeAccount:d,stripeContext:b,apiMode:m}){let P={Accept:"application/json","Content-Type":t,"User-Agent":this._getUserAgentString(m),"X-Stripe-Client-User-Agent":o,"X-Stripe-Client-Telemetry":this._getTelemetryHeader(),"Stripe-Version":n,"Stripe-Account":d,"Stripe-Context":b,"Idempotency-Key":this._defaultIdempotencyKey(i,l,m)},y=i=="POST"||i=="PUT"||i=="PATCH";return(y||r)&&(y||dn(`${i} method had non-zero contentLength but no payload is expected for this verb`),P["Content-Length"]=r),Object.assign(Lo(P),ef(s))}_getUserAgentString(t){let r=this._stripe.getConstant("PACKAGE_VERSION"),n=this._stripe._appInfo?this._stripe.getAppInfoAsString():"";return`Stripe/${t} NodeBindings/${r} ${n}`.trim()}_getTelemetryHeader(){if(this._stripe.getTelemetryEnabled()&&this._stripe._prevRequestMetrics.length>0){let t=this._stripe._prevRequestMetrics.shift();return JSON.stringify({last_request_metrics:t})}}_recordRequestMetrics(t,r,n){if(this._stripe.getTelemetryEnabled()&&t)if(this._stripe._prevRequestMetrics.length>this._maxBufferedRequestMetric)dn("Request metrics buffer is full, dropping telemetry message.");else{let o={request_id:t,request_duration_ms:r};n&&n.length>0&&(o.usage=n),this._stripe._prevRequestMetrics.push(o)}}_rawRequest(t,r,n,o){return new Promise((s,l)=>{let d;try{let p=t.toUpperCase();if(p!=="POST"&&n&&Object.keys(n).length!==0)throw new Error("rawRequest only supports params on POST requests. Please pass null and add your parameters to path.");let h=[].slice.call([n,o]),E=dr(h),S=p==="POST"?Object.assign({},E):null,T=Uo(h),A=T.headers,k=T.authenticator;d={requestMethod:p,requestPath:r,bodyData:S,queryData:{},authenticator:k,headers:A,host:T.host,streaming:!!T.streaming,settings:{},usage:["raw_request"]}}catch(p){l(p);return}function b(p,h){p?l(p):s(h)}a(b,"requestCallback");let{headers:m,settings:P}=d,y=d.authenticator;this._request(d.requestMethod,d.host,r,d.bodyData,y,{headers:m,settings:P,streaming:d.streaming},d.usage,b)})}_request(t,r,n,o,i,s,l=[],d,b=null){var m;let P;i=(m=i??this._stripe._authenticator)!==null&&m!==void 0?m:null;let y=mr(n),p=a((S,T,A,k,F)=>setTimeout(S,this._getSleepTimeInMS(k,F),T,A,k+1),"retryRequest"),h=a((S,T,A)=>{let k=s.settings&&s.settings.timeout&&Number.isInteger(s.settings.timeout)&&s.settings.timeout>=0?s.settings.timeout:this._stripe.getApiField("timeout"),F={host:r||this._stripe.getApiField("host"),port:this._stripe.getApiField("port"),path:n,method:t,headers:Object.assign({},T),body:P,protocol:this._stripe.getApiField("protocol")};i(F).then(()=>{let Y=this._stripe.getApiField("httpClient").makeRequest(F.host,F.port,F.path,F.method,F.headers,F.body,F.protocol,k),Ae=Date.now(),ee=Lo({api_version:S,account:jo(T["Stripe-Account"]),idempotency_key:jo(T["Idempotency-Key"]),method:t,path:n,request_start_time:Ae}),ie=A||0,Se=this._getMaxNetworkRetries(s.settings||{});this._stripe._emitter.emit("request",ee),Y.then(re=>e._shouldRetry(re,ie,Se)?p(h,S,T,ie,sf(re.getHeaders()["retry-after"])):s.streaming&&re.getStatusCode()<400?this._streamingResponseHandler(ee,l,d)(re):this._jsonResponseHandler(ee,y,l,d)(re)).catch(re=>{if(e._shouldRetry(null,ie,Se,re))return p(h,S,T,ie,null);{let Ye=re.code&&re.code===xe.TIMEOUT_ERROR_CODE;return d(new hn({message:Ye?`Request aborted due to timeout being reached (${k}ms)`:e._generateConnectionErrorMessage(ie),detail:re}))}})}).catch(Y=>{throw new de({message:"Unable to authenticate the request",exception:Y})})},"makeRequest"),E=a((S,T)=>{if(S)return d(S);P=T,this._stripe.getClientUserAgent(A=>{let k=this._stripe.getApiField("version"),F=this._makeHeaders({contentType:y=="v2"?"application/json":"application/x-www-form-urlencoded",contentLength:P.length,apiVersion:k,clientUserAgent:A,method:t,userSuppliedHeaders:s.headers,userSuppliedSettings:s.settings,stripeAccount:y=="v2"?null:this._stripe.getApiField("stripeAccount"),stripeContext:y=="v2"?this._stripe.getApiField("stripeContext"):null,apiMode:y});h(k,F,0)})},"prepareAndMakeRequest");if(b)b(t,o,s.headers,E);else{let S;y=="v2"?S=o?af(o):"":S=At(o||{},y),E(null,S)}}};var Qo=class{static{a(this,"V1Iterator")}constructor(t,r,n,o){this.index=0,this.pagePromise=t,this.promiseCache={currentPromise:null},this.requestArgs=r,this.spec=n,this.stripeResource=o}async iterate(t){if(!(t&&t.data&&typeof t.data.length=="number"))throw Error("Unexpected: Stripe API response does not have a well-formed `data` array.");let r=pf(this.requestArgs);if(this.index<t.data.length){let n=r?t.data.length-1-this.index:this.index,o=t.data[n];return this.index+=1,{value:o,done:!1}}else if(t.has_more){this.index=0,this.pagePromise=this.getNextPage(t);let n=await this.pagePromise;return this.iterate(n)}return{done:!0,value:void 0}}getNextPage(t){throw new Error("Unimplemented")}async _next(){return this.iterate(await this.pagePromise)}next(){if(this.promiseCache.currentPromise)return this.promiseCache.currentPromise;let t=(async()=>{let r=await this._next();return this.promiseCache.currentPromise=null,r})();return this.promiseCache.currentPromise=t,t}},ys=class extends Qo{static{a(this,"V1ListIterator")}getNextPage(t){let r=pf(this.requestArgs),n=FE(t,r);return this.stripeResource._makeRequest(this.requestArgs,this.spec,{[r?"ending_before":"starting_after"]:n})}},gs=class extends Qo{static{a(this,"V1SearchIterator")}getNextPage(t){if(!t.next_page)throw Error("Unexpected: Stripe API response does not have a well-formed `next_page` field, but `has_more` was true.");return this.stripeResource._makeRequest(this.requestArgs,this.spec,{page:t.next_page})}},vs=class{static{a(this,"V2ListIterator")}constructor(t,r,n,o){this.currentPageIterator=(async()=>(await t).data[Symbol.iterator]())(),this.nextPageUrl=(async()=>(await t).next_page_url||null)(),this.requestArgs=r,this.spec=n,this.stripeResource=o}async turnPage(){let t=await this.nextPageUrl;if(!t)return null;this.spec.fullPath=t;let r=await this.stripeResource._makeRequest([],this.spec,{});return this.nextPageUrl=Promise.resolve(r.next_page_url),this.currentPageIterator=Promise.resolve(r.data[Symbol.iterator]()),this.currentPageIterator}async next(){{let n=(await this.currentPageIterator).next();if(!n.done)return{done:!1,value:n.value}}let t=await this.turnPage();if(!t)return{done:!0,value:void 0};let r=t.next();return r.done?{done:!0,value:void 0}:{done:!1,value:r.value}}},lf=a((e,t,r,n)=>{let o=mr(r.fullPath||r.path);return o!=="v2"&&r.methodType==="search"?hs(new gs(n,t,r,e)):o!=="v2"&&r.methodType==="list"?hs(new ys(n,t,r,e)):o==="v2"&&r.methodType==="list"?hs(new vs(n,t,r,e)):null},"makeAutoPaginationMethods"),hs=a(e=>{let t=BE((...o)=>e.next(...o)),r=VE(t),n={autoPagingEach:t,autoPagingToArray:r,next:a(()=>e.next(),"next"),return:a(()=>({}),"return"),[LE()]:()=>n};return n},"makeAutoPaginationMethodsFromIterator");function LE(){return typeof Symbol<"u"&&Symbol.asyncIterator?Symbol.asyncIterator:"@@asyncIterator"}a(LE,"getAsyncIteratorSymbol");function qE(e){if(e.length<2)return null;let t=e[1];if(typeof t!="function")throw Error(`The second argument to autoPagingEach, if present, must be a callback function; received ${typeof t}`);return t}a(qE,"getDoneCallback");function jE(e){if(e.length===0)return;let t=e[0];if(typeof t!="function")throw Error(`The first argument to autoPagingEach, if present, must be a callback function; received ${typeof t}`);if(t.length===2)return t;if(t.length>2)throw Error(`The \`onItem\` callback function passed to autoPagingEach must accept at most two arguments; got ${t}`);return a(function(n,o){let i=t(n);o(i)},"_onItem")}a(jE,"getItemCallback");function FE(e,t){let r=t?0:e.data.length-1,n=e.data[r],o=n&&n.id;if(!o)throw Error("Unexpected: No `id` found on the last item while auto-paging a list.");return o}a(FE,"getLastId");function BE(e){return a(function(){let r=[].slice.call(arguments),n=jE(r),o=qE(r);if(r.length>2)throw Error(`autoPagingEach takes up to two arguments; received ${r}`);let i=GE(e,n);return pn(i,o)},"autoPagingEach")}a(BE,"makeAutoPagingEach");function VE(e){return a(function(r,n){let o=r&&r.limit;if(!o)throw Error("You must pass a `limit` option to autoPagingToArray, e.g., `autoPagingToArray({limit: 1000});`.");if(o>1e4)throw Error("You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.");let i=new Promise((s,l)=>{let d=[];e(b=>{if(d.push(b),d.length>=o)return!1}).then(()=>{s(d)}).catch(l)});return pn(i,n)},"autoPagingToArray")}a(VE,"makeAutoPagingToArray");function GE(e,t){return new Promise((r,n)=>{function o(i){if(i.done){r();return}let s=i.value;return new Promise(l=>{t(s,l)}).then(l=>l===!1?o({done:!0,value:void 0}):e().then(o))}a(o,"handleIteration"),e().then(o).catch(n)})}a(GE,"wrapAsyncIteratorWithCallback");function pf(e){let t=[].slice.call(e);return!!dr(t).ending_before}a(pf,"isReverseIteration");function df(e){if(e.path!==void 0&&e.fullPath!==void 0)throw new Error(`Method spec specified both a 'path' (${e.path}) and a 'fullPath' (${e.fullPath}).`);return function(...t){let r=typeof t[t.length-1]=="function"&&t.pop();e.urlParams=Ym(e.fullPath||this.createResourcePathWithSymbols(e.path||""));let n=pn(this._makeRequest(t,e,{}),r);return Object.assign(n,lf(this,t,e,n)),n}}a(df,"stripeMethod");c.extend=Qm;c.method=df;c.MAX_BUFFERED_REQUEST_METRICS=100;function c(e,t){if(this._stripe=e,t)throw new Error("Support for curried url params was dropped in stripe-node v7.0.0. Instead, pass two ids.");this.basePath=Mo(this.basePath||e.getApiField("basePath")),this.resourcePath=this.path,this.path=Mo(this.path),this.initialize(...arguments)}a(c,"StripeResource");c.prototype={_stripe:null,path:"",resourcePath:"",basePath:null,initialize(){},requestDataProcessor:null,validateRequest:null,createFullPath(e,t){let r=[this.basePath(t),this.path(t)];if(typeof e=="function"){let n=e(t);n&&r.push(n)}else r.push(e);return this._joinUrlParts(r)},createResourcePathWithSymbols(e){return e?`/${this._joinUrlParts([this.resourcePath,e])}`:`/${this.resourcePath}`},_joinUrlParts(e){return e.join("/").replace(/\/{2,}/g,"/")},_getRequestOpts(e,t,r){var n;let o=(t.method||"GET").toUpperCase(),i=t.usage||[],s=t.urlParams||[],l=t.encode||(ee=>ee),d=!!t.fullPath,b=Mo(d?t.fullPath:t.path||""),m=d?t.fullPath:this.createResourcePathWithSymbols(t.path),P=[].slice.call(e),y=s.reduce((ee,ie)=>{let Se=P.shift();if(typeof Se!="string")throw new Error(`Stripe: Argument "${ie}" must be a string, but got: ${Se} (on API request to \`${o} ${m}\`)`);return ee[ie]=Se,ee},{}),p=dr(P),h=l(Object.assign({},p,r)),E=Uo(P),S=E.host||t.host,T=!!t.streaming||!!E.streaming;if(P.filter(ee=>ee!=null).length)throw new Error(`Stripe: Unknown arguments (${P}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to ${o} \`${m}\`)`);let A=d?b(y):this.createFullPath(b,y),k=Object.assign(E.headers,t.headers);t.validator&&t.validator(h,{headers:k});let F=t.method==="GET"||t.method==="DELETE";return{requestMethod:o,requestPath:A,bodyData:F?null:h,queryData:F?h:{},authenticator:(n=E.authenticator)!==null&&n!==void 0?n:null,headers:k,host:S??null,streaming:T,settings:E.settings,usage:i}},_makeRequest(e,t,r){return new Promise((n,o)=>{var i;let s;try{s=this._getRequestOpts(e,t,r)}catch(y){o(y);return}function l(y,p){y?o(y):n(t.transformResponseData?t.transformResponseData(p):p)}a(l,"requestCallback");let d=Object.keys(s.queryData).length===0,b=[s.requestPath,d?"":"?",At(s.queryData,mr(s.requestPath))].join(""),{headers:m,settings:P}=s;this._stripe._requestSender._request(s.requestMethod,s.host,b,s.bodyData,s.authenticator,{headers:m,settings:P,streaming:s.streaming},s.usage,l,(i=this.requestDataProcessor)===null||i===void 0?void 0:i.bind(this))})}};function mf(e){let t={DEFAULT_TOLERANCE:300,signature:null,constructEvent(m,P,y,p,h,E){try{if(!this.signature)throw new Error("ERR: missing signature helper, unable to verify");this.signature.verifyHeader(m,P,y,p||t.DEFAULT_TOLERANCE,h,E)}catch(T){throw T instanceof ur&&(T.message+="\nUse `await constructEventAsync(...)` instead of `constructEvent(...)`"),T}return m instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(m)):JSON.parse(m)},async constructEventAsync(m,P,y,p,h,E){if(!this.signature)throw new Error("ERR: missing signature helper, unable to verify");return await this.signature.verifyHeaderAsync(m,P,y,p||t.DEFAULT_TOLERANCE,h,E),m instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(m)):JSON.parse(m)},generateTestHeaderString:a(function(m){let P=b(m),y=P.signature||P.cryptoProvider.computeHMACSignature(P.payloadString,P.secret);return P.generateHeaderString(y)},"generateTestHeaderString"),generateTestHeaderStringAsync:a(async function(m){let P=b(m),y=P.signature||await P.cryptoProvider.computeHMACSignatureAsync(P.payloadString,P.secret);return P.generateHeaderString(y)},"generateTestHeaderStringAsync")},r={EXPECTED_SCHEME:"v1",verifyHeader(m,P,y,p,h,E){let{decodedHeader:S,decodedPayload:T,details:A,suspectPayloadType:k}=o(m,P,this.EXPECTED_SCHEME),F=/\s/.test(y);h=h||d();let Y=h.computeHMACSignature(n(T,A),y);return i(T,S,A,Y,p,k,F,E),!0},async verifyHeaderAsync(m,P,y,p,h,E){let{decodedHeader:S,decodedPayload:T,details:A,suspectPayloadType:k}=o(m,P,this.EXPECTED_SCHEME),F=/\s/.test(y);h=h||d();let Y=await h.computeHMACSignatureAsync(n(T,A),y);return i(T,S,A,Y,p,k,F,E)}};function n(m,P){return`${P.timestamp}.${m}`}a(n,"makeHMACContent");function o(m,P,y){if(!m)throw new qe(P,m,{message:"No webhook payload was provided."});let p=typeof m!="string"&&!(m instanceof Uint8Array),h=new TextDecoder("utf8"),E=m instanceof Uint8Array?h.decode(m):m;if(Array.isArray(P))throw new Error("Unexpected: An array was passed as a header, which should not be possible for the stripe-signature header.");if(P==null||P=="")throw new qe(P,m,{message:"No stripe-signature header value was provided."});let S=P instanceof Uint8Array?h.decode(P):P,T=s(S,y);if(!T||T.timestamp===-1)throw new qe(S,E,{message:"Unable to extract timestamp and signatures from header"});if(!T.signatures.length)throw new qe(S,E,{message:"No signatures found with expected scheme"});return{decodedPayload:E,decodedHeader:S,details:T,suspectPayloadType:p}}a(o,"parseEventDetails");function i(m,P,y,p,h,E,S,T){let A=!!y.signatures.filter(e.secureCompare.bind(e,p)).length,k=`
7
- Learn more about webhook signing and explore webhook integration examples for various frameworks at https://docs.stripe.com/webhooks/signature`,F=S?`
1
+ "use strict";var S_=Object.create;var Rr=Object.defineProperty;var T_=Object.getOwnPropertyDescriptor;var E_=Object.getOwnPropertyNames;var I_=Object.getPrototypeOf,A_=Object.prototype.hasOwnProperty;var a=(e,t)=>Rr(e,"name",{value:t,configurable:!0});var C=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Mn=(e,t)=>{for(var r in t)Rr(e,r,{get:t[r],enumerable:!0})},Ls=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of E_(t))!A_.call(e,o)&&o!==r&&Rr(e,o,{get:()=>t[o],enumerable:!(n=T_(t,o))||n.enumerable});return e};var Le=(e,t,r)=>(r=e!=null?S_(I_(e)):{},Ls(t||!e||!e.__esModule?Rr(r,"default",{value:e,enumerable:!0}):r,e)),w_=e=>Ls(Rr({},"__esModule",{value:!0}),e);var lc=C((cc,oo)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),i="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(i,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${i})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${i})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${t}\\.${t}\\.${t}\\.${t}(${i})?$`,"i")};function f(d,y){if(d.indexOf("::")!==d.lastIndexOf("::"))return null;let I=0,S=-1,T=(d.match(l.zoneIndex)||[])[0],A,k;for(T&&(T=T.substring(1),d=d.replace(/%.+$/,""));(S=d.indexOf(":",S+1))>=0;)I++;if(d.substr(0,2)==="::"&&I--,d.substr(-2,2)==="::"&&I--,I>y)return null;for(k=y-I,A=":";k--;)A+="0:";return d=d.replace("::",A),d[0]===":"&&(d=d.slice(1)),d[d.length-1]===":"&&(d=d.slice(0,-1)),y=(function(){let G=d.split(":"),Y=[];for(let Te=0;Te<G.length;Te++)Y.push(parseInt(G[Te],16));return Y})(),{parts:y,zoneId:T}}a(f,"expandIPv6");function b(d,y,I,S){if(d.length!==y.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let T=0,A;for(;S>0;){if(A=I-S,A<0&&(A=0),d[T]>>A!==y[T]>>A)return!1;S-=I,T+=1}return!0}a(b,"matchCIDR");function m(d){if(o.test(d))return parseInt(d,16);if(d[0]==="0"&&!isNaN(parseInt(d[1],10))){if(n.test(d))return parseInt(d,8);throw new Error(`ipaddr: cannot parse ${d} as octal`)}return parseInt(d,10)}a(m,"parseIntAuto");function P(d,y){for(;d.length<y;)d=`0${d}`;return d}a(P,"padPart");let h={};h.IPv4=(function(){function d(y){if(y.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let I,S;for(I=0;I<y.length;I++)if(S=y[I],!(0<=S&&S<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=y}return a(d,"IPv4"),d.prototype.SpecialRanges={unspecified:[[new d([0,0,0,0]),8]],broadcast:[[new d([255,255,255,255]),32]],multicast:[[new d([224,0,0,0]),4]],linkLocal:[[new d([169,254,0,0]),16]],loopback:[[new d([127,0,0,0]),8]],carrierGradeNat:[[new d([100,64,0,0]),10]],private:[[new d([10,0,0,0]),8],[new d([172,16,0,0]),12],[new d([192,168,0,0]),16]],reserved:[[new d([192,0,0,0]),24],[new d([192,0,2,0]),24],[new d([192,88,99,0]),24],[new d([198,18,0,0]),15],[new d([198,51,100,0]),24],[new d([203,0,113,0]),24],[new d([240,0,0,0]),4]],as112:[[new d([192,175,48,0]),24],[new d([192,31,196,0]),24]],amt:[[new d([192,52,193,0]),24]]},d.prototype.kind=function(){return"ipv4"},d.prototype.match=function(y,I){let S;if(I===void 0&&(S=y,y=S[0],I=S[1]),y.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return b(this.octets,y.octets,8,I)},d.prototype.prefixLengthFromSubnetMask=function(){let y=0,I=!1,S={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},T,A,k;for(T=3;T>=0;T-=1)if(A=this.octets[T],A in S){if(k=S[A],I&&k!==0)return null;k!==8&&(I=!0),y+=k}else return null;return 32-y},d.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},d.prototype.toByteArray=function(){return this.octets.slice(0)},d.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},d.prototype.toNormalizedString=function(){return this.toString()},d.prototype.toString=function(){return this.octets.join(".")},d})(),h.IPv4.broadcastAddressFromCIDR=function(d){try{let y=this.parseCIDR(d),I=y[0].toByteArray(),S=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),T=[],A=0;for(;A<4;)T.push(parseInt(I[A],10)|parseInt(S[A],10)^255),A++;return new this(T)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(d){return this.parser(d)!==null},h.IPv4.isValid=function(d){try{return new this(this.parser(d)),!0}catch{return!1}},h.IPv4.isValidCIDR=function(d){try{return this.parseCIDR(d),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(d){return!!(h.IPv4.isValid(d)&&d.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.isValidCIDRFourPartDecimal=function(d){let y=d.match(/^(.+)\/(\d+)$/);return!h.IPv4.isValidCIDR(d)||!y?!1:h.IPv4.isValidFourPartDecimal(y[1])},h.IPv4.networkAddressFromCIDR=function(d){let y,I,S,T,A;try{for(y=this.parseCIDR(d),S=y[0].toByteArray(),A=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),T=[],I=0;I<4;)T.push(parseInt(S[I],10)&parseInt(A[I],10)),I++;return new this(T)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.parse=function(d){let y=this.parser(d);if(y===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(y)},h.IPv4.parseCIDR=function(d){let y;if(y=d.match(/^(.+)\/(\d+)$/)){let I=parseInt(y[2]);if(I>=0&&I<=32){let S=[this.parse(y[1]),I];return Object.defineProperty(S,"toString",{value:a(function(){return this.join("/")},"value")}),S}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},h.IPv4.parser=function(d){let y,I,S;if(y=d.match(r.fourOctet))return(function(){let T=y.slice(1,6),A=[];for(let k=0;k<T.length;k++)I=T[k],A.push(m(I));return A})();if(y=d.match(r.longValue)){if(S=m(y[1]),S>4294967295||S<0)throw new Error("ipaddr: address outside defined range");return(function(){let T=[],A;for(A=0;A<=24;A+=8)T.push(S>>A&255);return T})().reverse()}else return(y=d.match(r.twoOctet))?(function(){let T=y.slice(1,4),A=[];if(S=m(T[1]),S>16777215||S<0)throw new Error("ipaddr: address outside defined range");return A.push(m(T[0])),A.push(S>>16&255),A.push(S>>8&255),A.push(S&255),A})():(y=d.match(r.threeOctet))?(function(){let T=y.slice(1,5),A=[];if(S=m(T[2]),S>65535||S<0)throw new Error("ipaddr: address outside defined range");return A.push(m(T[0])),A.push(m(T[1])),A.push(S>>8&255),A.push(S&255),A})():null},h.IPv4.subnetMaskFromPrefixLength=function(d){if(d=parseInt(d),d<0||d>32)throw new Error("ipaddr: invalid IPv4 prefix length");let y=[0,0,0,0],I=0,S=Math.floor(d/8);for(;I<S;)y[I]=255,I++;return S<4&&(y[S]=Math.pow(2,d%8)-1<<8-d%8),new this(y)},h.IPv6=(function(){function d(y,I){let S,T;if(y.length===16)for(this.parts=[],S=0;S<=14;S+=2)this.parts.push(y[S]<<8|y[S+1]);else if(y.length===8)this.parts=y;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(S=0;S<this.parts.length;S++)if(T=this.parts[S],!(0<=T&&T<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");I&&(this.zoneId=I)}return a(d,"IPv6"),d.prototype.SpecialRanges={unspecified:[new d([0,0,0,0,0,0,0,0]),128],linkLocal:[new d([65152,0,0,0,0,0,0,0]),10],multicast:[new d([65280,0,0,0,0,0,0,0]),8],loopback:[new d([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new d([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new d([0,0,0,0,0,65535,0,0]),96],discard:[new d([256,0,0,0,0,0,0,0]),64],rfc6145:[new d([0,0,0,0,65535,0,0,0]),96],rfc6052:[new d([100,65435,0,0,0,0,0,0]),96],"6to4":[new d([8194,0,0,0,0,0,0,0]),16],teredo:[new d([8193,0,0,0,0,0,0,0]),32],benchmarking:[new d([8193,2,0,0,0,0,0,0]),48],amt:[new d([8193,3,0,0,0,0,0,0]),32],as112v6:[[new d([8193,4,274,0,0,0,0,0]),48],[new d([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new d([8193,16,0,0,0,0,0,0]),28],orchid2:[new d([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new d([8193,48,0,0,0,0,0,0]),28],reserved:[[new d([8193,0,0,0,0,0,0,0]),23],[new d([8193,3512,0,0,0,0,0,0]),32]]},d.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},d.prototype.kind=function(){return"ipv6"},d.prototype.match=function(y,I){let S;if(I===void 0&&(S=y,y=S[0],I=S[1]),y.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return b(this.parts,y.parts,16,I)},d.prototype.prefixLengthFromSubnetMask=function(){let y=0,I=!1,S={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},T,A;for(let k=7;k>=0;k-=1)if(T=this.parts[k],T in S){if(A=S[T],I&&A!==0)return null;A!==16&&(I=!0),y+=A}else return null;return 128-y},d.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},d.prototype.toByteArray=function(){let y,I=[],S=this.parts;for(let T=0;T<S.length;T++)y=S[T],I.push(y>>8),I.push(y&255);return I},d.prototype.toFixedLengthString=function(){let y=(function(){let S=[];for(let T=0;T<this.parts.length;T++)S.push(P(this.parts[T].toString(16),4));return S}).call(this).join(":"),I="";return this.zoneId&&(I=`%${this.zoneId}`),y+I},d.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let y=this.parts.slice(-2),I=y[0],S=y[1];return new h.IPv4([I>>8,I&255,S>>8,S&255])},d.prototype.toNormalizedString=function(){let y=(function(){let S=[];for(let T=0;T<this.parts.length;T++)S.push(this.parts[T].toString(16));return S}).call(this).join(":"),I="";return this.zoneId&&(I=`%${this.zoneId}`),y+I},d.prototype.toRFC5952String=function(){let y=/((^|:)(0(:|$)){2,})/g,I=this.toNormalizedString(),S=0,T=-1,A;for(;A=y.exec(I);)A[0].length>T&&(S=A.index,T=A[0].length);return T<0?I:`${I.substring(0,S)}::${I.substring(S+T)}`},d.prototype.toString=function(){return this.toRFC5952String()},d})(),h.IPv6.broadcastAddressFromCIDR=function(d){try{let y=this.parseCIDR(d),I=y[0].toByteArray(),S=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),T=[],A=0;for(;A<16;)T.push(parseInt(I[A],10)|parseInt(S[A],10)^255),A++;return new this(T)}catch(y){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${y})`)}},h.IPv6.isIPv6=function(d){return this.parser(d)!==null},h.IPv6.isValid=function(d){if(typeof d=="string"&&d.indexOf(":")===-1)return!1;try{let y=this.parser(d);return new this(y.parts,y.zoneId),!0}catch{return!1}},h.IPv6.isValidCIDR=function(d){if(typeof d=="string"&&d.indexOf(":")===-1)return!1;try{return this.parseCIDR(d),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(d){let y,I,S,T,A;try{for(y=this.parseCIDR(d),S=y[0].toByteArray(),A=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),T=[],I=0;I<16;)T.push(parseInt(S[I],10)&parseInt(A[I],10)),I++;return new this(T)}catch(k){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${k})`)}},h.IPv6.parse=function(d){let y=this.parser(d);if(y.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(y.parts,y.zoneId)},h.IPv6.parseCIDR=function(d){let y,I,S;if((I=d.match(/^(.+)\/(\d+)$/))&&(y=parseInt(I[2]),y>=0&&y<=128))return S=[this.parse(I[1]),y],Object.defineProperty(S,"toString",{value:a(function(){return this.join("/")},"value")}),S;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},h.IPv6.parser=function(d){let y,I,S,T,A,k;if(S=d.match(l.deprecatedTransitional))return this.parser(`::ffff:${S[1]}`);if(l.native.test(d))return f(d,8);if((S=d.match(l.transitional))&&(k=S[6]||"",y=S[1],S[1].endsWith("::")||(y=y.slice(0,-1)),y=f(y+k,6),y.parts)){for(A=[parseInt(S[2]),parseInt(S[3]),parseInt(S[4]),parseInt(S[5])],I=0;I<A.length;I++)if(T=A[I],!(0<=T&&T<=255))return null;return y.parts.push(A[0]<<8|A[1]),y.parts.push(A[2]<<8|A[3]),{parts:y.parts,zoneId:y.zoneId}}return null},h.IPv6.subnetMaskFromPrefixLength=function(d){if(d=parseInt(d),d<0||d>128)throw new Error("ipaddr: invalid IPv6 prefix length");let y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],I=0,S=Math.floor(d/8);for(;I<S;)y[I]=255,I++;return S<16&&(y[S]=Math.pow(2,d%8)-1<<8-d%8),new this(y)},h.fromByteArray=function(d){let y=d.length;if(y===4)return new h.IPv4(d);if(y===16)return new h.IPv6(d);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},h.isValid=function(d){return h.IPv6.isValid(d)||h.IPv4.isValid(d)},h.isValidCIDR=function(d){return h.IPv6.isValidCIDR(d)||h.IPv4.isValidCIDR(d)},h.parse=function(d){if(h.IPv6.isValid(d))return h.IPv6.parse(d);if(h.IPv4.isValid(d))return h.IPv4.parse(d);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},h.parseCIDR=function(d){try{return h.IPv6.parseCIDR(d)}catch{try{return h.IPv4.parseCIDR(d)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},h.process=function(d){let y=this.parse(d);return y.kind()==="ipv6"&&y.isIPv4MappedAddress()?y.toIPv4Address():y},h.subnetMatch=function(d,y,I){let S,T,A,k;I==null&&(I="unicast");for(T in y)if(Object.prototype.hasOwnProperty.call(y,T)){for(A=y[T],A[0]&&!(A[0]instanceof Array)&&(A=[A]),S=0;S<A.length;S++)if(k=A[S],d.kind()===k[0].kind()&&d.match.apply(d,k))return T}return I},typeof oo<"u"&&oo.exports?oo.exports=h:e.ipaddr=h})(cc)});var fl=C((Bq,ml)=>{var dl=require("stream").Stream,dx=require("util");ml.exports=je;function je(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}a(je,"DelayedStream");dx.inherits(je,dl);je.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(je.prototype,"readable",{configurable:!0,enumerable:!0,get:a(function(){return this.source.readable},"get")});je.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};je.prototype.resume=function(){this._released||this.release(),this.source.resume()};je.prototype.pause=function(){this.source.pause()};je.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};je.prototype.pipe=function(){var e=dl.prototype.pipe.apply(this,arguments);return this.resume(),e};je.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};je.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var vl=C((Vq,gl)=>{var mx=require("util"),yl=require("stream").Stream,hl=fl();gl.exports=ue;function ue(){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}a(ue,"CombinedStream");mx.inherits(ue,yl);ue.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};ue.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};ue.prototype.append=function(e){var t=ue.isStreamLike(e);if(t){if(!(e instanceof hl)){var r=hl.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};ue.prototype.pipe=function(e,t){return yl.prototype.pipe.call(this,e,t),this.resume(),e};ue.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}};ue.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=ue.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ue.prototype._pipeNext=function(e){this._currentStream=e;var t=ue.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};ue.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};ue.prototype.write=function(e){this.emit("data",e)};ue.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ue.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")};ue.prototype.end=function(){this._reset(),this.emit("end")};ue.prototype.destroy=function(){this._reset(),this.emit("close")};ue.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ue.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};ue.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};ue.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var bl=C((Zq,_l)=>{"use strict";_l.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 Sl=C(ke=>{"use strict";var co=bl(),fx=require("path").extname,Pl=/^\s*([^;\s]*)(?:;|\s|$)/,hx=/^text\//i;ke.charset=xl;ke.charsets={lookup:xl};ke.contentType=yx;ke.extension=gx;ke.extensions=Object.create(null);ke.lookup=vx;ke.types=Object.create(null);_x(ke.extensions,ke.types);function xl(e){if(!e||typeof e!="string")return!1;var t=Pl.exec(e),r=t&&co[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&hx.test(t[1])?"UTF-8":!1}a(xl,"charset");function yx(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?ke.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=ke.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}a(yx,"contentType");function gx(e){if(!e||typeof e!="string")return!1;var t=Pl.exec(e),r=t&&ke.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}a(gx,"extension");function vx(e){if(!e||typeof e!="string")return!1;var t=fx("x."+e).toLowerCase().substr(1);return t&&ke.types[t]||!1}a(vx,"lookup");function _x(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(co).forEach(a(function(o){var i=co[o],s=i.extensions;if(!(!s||!s.length)){e[o]=s;for(var l=0;l<s.length;l++){var f=s[l];if(t[f]){var b=r.indexOf(co[t[f]].source),m=r.indexOf(i.source);if(t[f]!=="application/octet-stream"&&(b>m||b===m&&t[f].substr(0,12)==="application/"))continue}t[f]=o}}},"forEachMimeType"))}a(_x,"populateMaps")});var El=C((Jq,Tl)=>{Tl.exports=bx;function bx(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}a(bx,"defer")});var ma=C((Yq,Al)=>{var Il=El();Al.exports=Px;function Px(e){var t=!1;return Il(function(){t=!0}),a(function(n,o){t?e(n,o):Il(a(function(){e(n,o)},"nextTick_callback"))},"async_callback")}a(Px,"async")});var fa=C((ej,wl)=>{wl.exports=xx;function xx(e){Object.keys(e.jobs).forEach(Sx.bind(e)),e.jobs={}}a(xx,"abort");function Sx(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}a(Sx,"clean")});var ha=C((rj,Rl)=>{var kl=ma(),Tx=fa();Rl.exports=Ex;function Ex(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Ix(t,o,e[o],function(i,s){o in r.jobs&&(delete r.jobs[o],i?Tx(r):r.results[o]=s,n(i,r.results))})}a(Ex,"iterate");function Ix(e,t,r,n){var o;return e.length==2?o=e(r,kl(n)):o=e(r,t,kl(n)),o}a(Ix,"runJob")});var ya=C((oj,Ol)=>{Ol.exports=Ax;function Ax(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,i){return t(e[o],e[i])}),n}a(Ax,"state")});var ga=C((aj,Cl)=>{var wx=fa(),kx=ma();Cl.exports=Rx;function Rx(e){Object.keys(this.jobs).length&&(this.index=this.size,wx(this),kx(e)(null,this.results))}a(Rx,"terminator")});var Nl=C((uj,$l)=>{var Ox=ha(),Cx=ya(),$x=ga();$l.exports=Nx;function Nx(e,t,r){for(var n=Cx(e);n.index<(n.keyedList||e).length;)Ox(e,t,n,function(o,i){if(o){r(o,i);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return $x.bind(n,r)}a(Nx,"parallel")});var va=C((lj,lo)=>{var Dl=ha(),Dx=ya(),zx=ga();lo.exports=Mx;lo.exports.ascending=zl;lo.exports.descending=Ux;function Mx(e,t,r,n){var o=Dx(e,r);return Dl(e,t,o,a(function i(s,l){if(s){n(s,l);return}if(o.index++,o.index<(o.keyedList||e).length){Dl(e,t,o,i);return}n(null,o.results)},"iteratorHandler")),zx.bind(o,n)}a(Mx,"serialOrdered");function zl(e,t){return e<t?-1:e>t?1:0}a(zl,"ascending");function Ux(e,t){return-1*zl(e,t)}a(Ux,"descending")});var Ul=C((dj,Ml)=>{var Lx=va();Ml.exports=qx;function qx(e,t,r){return Lx(e,t,null,r)}a(qx,"serial")});var ql=C((fj,Ll)=>{Ll.exports={parallel:Nl(),serial:Ul(),serialOrdered:va()}});var _a=C((hj,jl)=>{"use strict";jl.exports=Object});var Bl=C((yj,Fl)=>{"use strict";Fl.exports=Error});var Vl=C((gj,Gl)=>{"use strict";Gl.exports=EvalError});var Zl=C((vj,Hl)=>{"use strict";Hl.exports=RangeError});var Kl=C((_j,Wl)=>{"use strict";Wl.exports=ReferenceError});var Xl=C((bj,Jl)=>{"use strict";Jl.exports=SyntaxError});var vt=C((Pj,Yl)=>{"use strict";Yl.exports=TypeError});var ep=C((xj,Ql)=>{"use strict";Ql.exports=URIError});var rp=C((Sj,tp)=>{"use strict";tp.exports=Math.abs});var op=C((Tj,np)=>{"use strict";np.exports=Math.floor});var ap=C((Ej,ip)=>{"use strict";ip.exports=Math.max});var up=C((Ij,sp)=>{"use strict";sp.exports=Math.min});var lp=C((Aj,cp)=>{"use strict";cp.exports=Math.pow});var dp=C((wj,pp)=>{"use strict";pp.exports=Math.round});var fp=C((kj,mp)=>{"use strict";mp.exports=Number.isNaN||a(function(t){return t!==t},"isNaN")});var yp=C((Oj,hp)=>{"use strict";var jx=fp();hp.exports=a(function(t){return jx(t)||t===0?t:t<0?-1:1},"sign")});var vp=C(($j,gp)=>{"use strict";gp.exports=Object.getOwnPropertyDescriptor});var ba=C((Nj,_p)=>{"use strict";var po=vp();if(po)try{po([],"length")}catch{po=null}_p.exports=po});var Pp=C((Dj,bp)=>{"use strict";var mo=Object.defineProperty||!1;if(mo)try{mo({},"a",{value:1})}catch{mo=!1}bp.exports=mo});var Pa=C((zj,xp)=>{"use strict";xp.exports=a(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var i in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ep=C((Uj,Tp)=>{"use strict";var Sp=typeof Symbol<"u"&&Symbol,Fx=Pa();Tp.exports=a(function(){return typeof Sp!="function"||typeof Symbol!="function"||typeof Sp("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Fx()},"hasNativeSymbols")});var xa=C((qj,Ip)=>{"use strict";Ip.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Sa=C((jj,Ap)=>{"use strict";var Bx=_a();Ap.exports=Bx.getPrototypeOf||null});var Rp=C((Fj,kp)=>{"use strict";var Gx="Function.prototype.bind called on incompatible ",Vx=Object.prototype.toString,Hx=Math.max,Zx="[object Function]",wp=a(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var i=0;i<r.length;i+=1)n[i+t.length]=r[i];return n},"concatty"),Wx=a(function(t,r){for(var n=[],o=r||0,i=0;o<t.length;o+=1,i+=1)n[i]=t[o];return n},"slicy"),Kx=a(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");kp.exports=a(function(t){var r=this;if(typeof r!="function"||Vx.apply(r)!==Zx)throw new TypeError(Gx+r);for(var n=Wx(arguments,1),o,i=a(function(){if(this instanceof o){var m=r.apply(this,wp(n,arguments));return Object(m)===m?m:this}return r.apply(t,wp(n,arguments))},"binder"),s=Hx(0,r.length-n.length),l=[],f=0;f<s;f++)l[f]="$"+f;if(o=Function("binder","return function ("+Kx(l,",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var b=a(function(){},"Empty");b.prototype=r.prototype,o.prototype=new b,b.prototype=null}return o},"bind")});var Qt=C((Gj,Op)=>{"use strict";var Jx=Rp();Op.exports=Function.prototype.bind||Jx});var fo=C((Vj,Cp)=>{"use strict";Cp.exports=Function.prototype.call});var Ta=C((Hj,$p)=>{"use strict";$p.exports=Function.prototype.apply});var Dp=C((Zj,Np)=>{"use strict";Np.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Mp=C((Wj,zp)=>{"use strict";var Xx=Qt(),Yx=Ta(),Qx=fo(),eS=Dp();zp.exports=eS||Xx.call(Qx,Yx)});var Ea=C((Kj,Up)=>{"use strict";var tS=Qt(),rS=vt(),nS=fo(),oS=Mp();Up.exports=a(function(t){if(t.length<1||typeof t[0]!="function")throw new rS("a function is required");return oS(tS,nS,t)},"callBindBasic")});var Gp=C((Xj,Bp)=>{"use strict";var iS=Ea(),Lp=ba(),jp;try{jp=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Ia=!!jp&&Lp&&Lp(Object.prototype,"__proto__"),Fp=Object,qp=Fp.getPrototypeOf;Bp.exports=Ia&&typeof Ia.get=="function"?iS([Ia.get]):typeof qp=="function"?a(function(t){return qp(t==null?t:Fp(t))},"getDunder"):!1});var Kp=C((Qj,Wp)=>{"use strict";var Vp=xa(),Hp=Sa(),Zp=Gp();Wp.exports=Vp?a(function(t){return Vp(t)},"getProto"):Hp?a(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Hp(t)},"getProto"):Zp?a(function(t){return Zp(t)},"getProto"):null});var Aa=C((tF,Jp)=>{"use strict";var aS=Function.prototype.call,sS=Object.prototype.hasOwnProperty,uS=Qt();Jp.exports=uS.call(aS,sS)});var en=C((rF,rd)=>{"use strict";var W,cS=_a(),lS=Bl(),pS=Vl(),dS=Zl(),mS=Kl(),nr=Xl(),rr=vt(),fS=ep(),hS=rp(),yS=op(),gS=ap(),vS=up(),_S=lp(),bS=dp(),PS=yp(),ed=Function,wa=a(function(e){try{return ed('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Xr=ba(),xS=Pp(),ka=a(function(){throw new rr},"throwTypeError"),SS=Xr?(function(){try{return arguments.callee,ka}catch{try{return Xr(arguments,"callee").get}catch{return ka}}})():ka,er=Ep()(),Pe=Kp(),TS=Sa(),ES=xa(),td=Ta(),Yr=fo(),tr={},IS=typeof Uint8Array>"u"||!Pe?W:Pe(Uint8Array),Dt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?W:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?W:ArrayBuffer,"%ArrayIteratorPrototype%":er&&Pe?Pe([][Symbol.iterator]()):W,"%AsyncFromSyncIteratorPrototype%":W,"%AsyncFunction%":tr,"%AsyncGenerator%":tr,"%AsyncGeneratorFunction%":tr,"%AsyncIteratorPrototype%":tr,"%Atomics%":typeof Atomics>"u"?W:Atomics,"%BigInt%":typeof BigInt>"u"?W:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?W:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?W:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?W:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":lS,"%eval%":eval,"%EvalError%":pS,"%Float16Array%":typeof Float16Array>"u"?W:Float16Array,"%Float32Array%":typeof Float32Array>"u"?W:Float32Array,"%Float64Array%":typeof Float64Array>"u"?W:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?W:FinalizationRegistry,"%Function%":ed,"%GeneratorFunction%":tr,"%Int8Array%":typeof Int8Array>"u"?W:Int8Array,"%Int16Array%":typeof Int16Array>"u"?W:Int16Array,"%Int32Array%":typeof Int32Array>"u"?W:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":er&&Pe?Pe(Pe([][Symbol.iterator]())):W,"%JSON%":typeof JSON=="object"?JSON:W,"%Map%":typeof Map>"u"?W:Map,"%MapIteratorPrototype%":typeof Map>"u"||!er||!Pe?W:Pe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":cS,"%Object.getOwnPropertyDescriptor%":Xr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?W:Promise,"%Proxy%":typeof Proxy>"u"?W:Proxy,"%RangeError%":dS,"%ReferenceError%":mS,"%Reflect%":typeof Reflect>"u"?W:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?W:Set,"%SetIteratorPrototype%":typeof Set>"u"||!er||!Pe?W:Pe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?W:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":er&&Pe?Pe(""[Symbol.iterator]()):W,"%Symbol%":er?Symbol:W,"%SyntaxError%":nr,"%ThrowTypeError%":SS,"%TypedArray%":IS,"%TypeError%":rr,"%Uint8Array%":typeof Uint8Array>"u"?W:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?W:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?W:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?W:Uint32Array,"%URIError%":fS,"%WeakMap%":typeof WeakMap>"u"?W:WeakMap,"%WeakRef%":typeof WeakRef>"u"?W:WeakRef,"%WeakSet%":typeof WeakSet>"u"?W:WeakSet,"%Function.prototype.call%":Yr,"%Function.prototype.apply%":td,"%Object.defineProperty%":xS,"%Object.getPrototypeOf%":TS,"%Math.abs%":hS,"%Math.floor%":yS,"%Math.max%":gS,"%Math.min%":vS,"%Math.pow%":_S,"%Math.round%":bS,"%Math.sign%":PS,"%Reflect.getPrototypeOf%":ES};if(Pe)try{null.error}catch(e){Xp=Pe(Pe(e)),Dt["%Error.prototype%"]=Xp}var Xp,AS=a(function e(t){var r;if(t==="%AsyncFunction%")r=wa("async function () {}");else if(t==="%GeneratorFunction%")r=wa("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=wa("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Pe&&(r=Pe(o.prototype))}return Dt[t]=r,r},"doEval"),Yp={__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"]},Qr=Qt(),ho=Aa(),wS=Qr.call(Yr,Array.prototype.concat),kS=Qr.call(td,Array.prototype.splice),Qp=Qr.call(Yr,String.prototype.replace),yo=Qr.call(Yr,String.prototype.slice),RS=Qr.call(Yr,RegExp.prototype.exec),OS=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,CS=/\\(\\)?/g,$S=a(function(t){var r=yo(t,0,1),n=yo(t,-1);if(r==="%"&&n!=="%")throw new nr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new nr("invalid intrinsic syntax, expected opening `%`");var o=[];return Qp(t,OS,function(i,s,l,f){o[o.length]=l?Qp(f,CS,"$1"):s||i}),o},"stringToPath"),NS=a(function(t,r){var n=t,o;if(ho(Yp,n)&&(o=Yp[n],n="%"+o[0]+"%"),ho(Dt,n)){var i=Dt[n];if(i===tr&&(i=AS(n)),typeof i>"u"&&!r)throw new rr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new nr("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");rd.exports=a(function(t,r){if(typeof t!="string"||t.length===0)throw new rr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new rr('"allowMissing" argument must be a boolean');if(RS(/^%?[^%]*%?$/,t)===null)throw new nr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=$S(t),o=n.length>0?n[0]:"",i=NS("%"+o+"%",r),s=i.name,l=i.value,f=!1,b=i.alias;b&&(o=b[0],kS(n,wS([0,1],b)));for(var m=1,P=!0;m<n.length;m+=1){var h=n[m],d=yo(h,0,1),y=yo(h,-1);if((d==='"'||d==="'"||d==="`"||y==='"'||y==="'"||y==="`")&&d!==y)throw new nr("property names with quotes must have matching quotes");if((h==="constructor"||!P)&&(f=!0),o+="."+h,s="%"+o+"%",ho(Dt,s))l=Dt[s];else if(l!=null){if(!(h in l)){if(!r)throw new rr("base intrinsic for "+t+" exists, but the property is not available.");return}if(Xr&&m+1>=n.length){var I=Xr(l,h);P=!!I,P&&"get"in I&&!("originalValue"in I.get)?l=I.get:l=l[h]}else P=ho(l,h),l=l[h];P&&!f&&(Dt[s]=l)}}return l},"GetIntrinsic")});var od=C((oF,nd)=>{"use strict";var DS=Pa();nd.exports=a(function(){return DS()&&!!Symbol.toStringTag},"hasToStringTagShams")});var sd=C((aF,ad)=>{"use strict";var zS=en(),id=zS("%Object.defineProperty%",!0),MS=od()(),US=Aa(),LS=vt(),go=MS?Symbol.toStringTag:null;ad.exports=a(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new LS("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");go&&(n||!US(t,go))&&(id?id(t,go,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[go]=r)},"setToStringTag")});var cd=C((uF,ud)=>{"use strict";var qS=Function.prototype.call,jS=Object.prototype.hasOwnProperty,FS=Qt();ud.exports=FS.call(qS,jS)});var pd=C((cF,ld)=>{"use strict";ld.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var fd=C((lF,md)=>{"use strict";var $a=vl(),BS=require("util"),Ra=require("path"),GS=require("http"),VS=require("https"),HS=require("url").parse,ZS=require("fs"),WS=require("stream").Stream,KS=require("crypto"),Oa=Sl(),JS=ql(),XS=sd(),_t=cd(),Ca=pd();function dd(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}a(dd,"escapeHeaderParam");function X(e){if(!(this instanceof X))return new X(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],$a.call(this),e=e||{};for(var t in e)this[t]=e[t]}a(X,"FormData");BS.inherits(X,$a);X.LINE_BREAK=`\r
2
+ `;X.DEFAULT_CONTENT_TYPE="application/octet-stream";X.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=$a.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),i=this._multiPartFooter();n(o),n(t),n(i),this._trackLength(o,t,r)};X.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+X.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&_t(t,"httpVersion"))&&!(t instanceof WS))&&(r.knownLength||this._valuesToMeasure.push(t))};X.prototype._lengthRetriever=function(e,t){_t(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):ZS.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):_t(e,"httpVersion")?t(null,Number(e.headers["content-length"])):_t(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};X.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),i="",s={"Content-Disposition":["form-data",'name="'+dd(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&Ca(s,r.header);var l;for(var f in s)if(_t(s,f)){if(l=s[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(i+=f+": "+l.join("; ")+X.LINE_BREAK)}return"--"+this.getBoundary()+X.LINE_BREAK+i+X.LINE_BREAK};X.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=Ra.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Ra.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&_t(e,"httpVersion")&&(r=Ra.basename(e.client._httpMessage.path||"")),r)return'filename="'+dd(r)+'"'};X.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=Oa.lookup(e.name)),!r&&e&&e.path&&(r=Oa.lookup(e.path)),!r&&e&&e.readable&&_t(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=Oa.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=X.DEFAULT_CONTENT_TYPE),r};X.prototype._multiPartFooter=function(){return function(e){var t=X.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};X.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+X.LINE_BREAK};X.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)_t(e,t)&&(r[t.toLowerCase()]=e[t]);return r};X.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};X.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};X.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(X.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};X.prototype._generateBoundary=function(){this._boundary="--------------------------"+KS.randomBytes(12).toString("hex")};X.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};X.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};X.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}JS.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};X.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=HS(e),n=Ca({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=Ca(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=VS.request(n):r=GS.request(n),this.getLength(function(i,s){if(i&&i!=="Unknown stream"){this._error(i);return}if(s&&r.setHeader("Content-Length",s),this.pipe(r),t){var l,f=a(function(b,m){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,b,m)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};X.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};X.prototype.toString=function(){return"[object FormData]"};XS(X.prototype,"FormData");md.exports=X});var fm=C((n4,mm)=>{mm.exports=require("util").inspect});var sn=C((o4,Nm)=>{var Qa=typeof Map=="function"&&Map.prototype,Ga=Object.getOwnPropertyDescriptor&&Qa?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,wo=Qa&&Ga&&typeof Ga.get=="function"?Ga.get:null,hm=Qa&&Map.prototype.forEach,es=typeof Set=="function"&&Set.prototype,Va=Object.getOwnPropertyDescriptor&&es?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ko=es&&Va&&typeof Va.get=="function"?Va.get:null,ym=es&&Set.prototype.forEach,pT=typeof WeakMap=="function"&&WeakMap.prototype,nn=pT?WeakMap.prototype.has:null,dT=typeof WeakSet=="function"&&WeakSet.prototype,on=dT?WeakSet.prototype.has:null,mT=typeof WeakRef=="function"&&WeakRef.prototype,gm=mT?WeakRef.prototype.deref:null,fT=Boolean.prototype.valueOf,hT=Object.prototype.toString,yT=Function.prototype.toString,gT=String.prototype.match,ts=String.prototype.slice,It=String.prototype.replace,vT=String.prototype.toUpperCase,vm=String.prototype.toLowerCase,Am=RegExp.prototype.test,_m=Array.prototype.concat,We=Array.prototype.join,_T=Array.prototype.slice,bm=Math.floor,Wa=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ha=Object.getOwnPropertySymbols,Ka=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,lr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",an=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===lr||!0)?Symbol.toStringTag:null,wm=Object.prototype.propertyIsEnumerable,Pm=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function xm(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Am.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-bm(-e):bm(e);if(n!==e){var o=String(n),i=ts.call(t,o.length+1);return It.call(o,r,"$&_")+"."+It.call(It.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return It.call(t,r,"$&_")}a(xm,"addNumericSeparator");var Ja=fm(),Sm=Ja.custom,Tm=Om(Sm)?Sm:null,km={__proto__:null,double:'"',single:"'"},bT={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Nm.exports=a(function e(t,r,n,o){var i=r||{};if(st(i,"quoteStyle")&&!st(km,i.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(st(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=st(i,"customInspect")?i.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(st(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(st(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=i.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return $m(t,i);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var f=String(t);return l?xm(t,f):f}if(typeof t=="bigint"){var b=String(t)+"n";return l?xm(t,b):b}var m=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=m&&m>0&&typeof t=="object")return Xa(t)?"[Array]":"[Object]";var P=UT(i,n);if(typeof o>"u")o=[];else if(Cm(o,t)>=0)return"[Circular]";function h(we,Ue,Oe){if(Ue&&(o=_T.call(o),o.push(Ue)),Oe){var kr={depth:i.depth};return st(i,"quoteStyle")&&(kr.quoteStyle=i.quoteStyle),e(we,kr,n+1,o)}return e(we,i,n+1,o)}if(a(h,"inspect"),typeof t=="function"&&!Em(t)){var d=kT(t),y=Ao(t,h);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(y.length>0?" { "+We.call(y,", ")+" }":"")}if(Om(t)){var I=lr?It.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ka.call(t);return typeof t=="object"&&!lr?rn(I):I}if(DT(t)){for(var S="<"+vm.call(String(t.nodeName)),T=t.attributes||[],A=0;A<T.length;A++)S+=" "+T[A].name+"="+Rm(PT(T[A].value),"double",i);return S+=">",t.childNodes&&t.childNodes.length&&(S+="..."),S+="</"+vm.call(String(t.nodeName))+">",S}if(Xa(t)){if(t.length===0)return"[]";var k=Ao(t,h);return P&&!MT(k)?"["+Ya(k,P)+"]":"[ "+We.call(k,", ")+" ]"}if(ST(t)){var G=Ao(t,h);return!("cause"in Error.prototype)&&"cause"in t&&!wm.call(t,"cause")?"{ ["+String(t)+"] "+We.call(_m.call("[cause]: "+h(t.cause),G),", ")+" }":G.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+We.call(G,", ")+" }"}if(typeof t=="object"&&s){if(Tm&&typeof t[Tm]=="function"&&Ja)return Ja(t,{depth:m-n});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(RT(t)){var Y=[];return hm&&hm.call(t,function(we,Ue){Y.push(h(Ue,t,!0)+" => "+h(we,t))}),Im("Map",wo.call(t),Y,P)}if($T(t)){var Te=[];return ym&&ym.call(t,function(we){Te.push(h(we,t))}),Im("Set",ko.call(t),Te,P)}if(OT(t))return Za("WeakMap");if(NT(t))return Za("WeakSet");if(CT(t))return Za("WeakRef");if(ET(t))return rn(h(Number(t)));if(AT(t))return rn(h(Wa.call(t)));if(IT(t))return rn(fT.call(t));if(TT(t))return rn(h(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!xT(t)&&!Em(t)){var ve=Ao(t,h),ae=Pm?Pm(t)===Object.prototype:t instanceof Object||t.constructor===Object,te=t instanceof Object?"":"null prototype",me=!ae&&an&&Object(t)===t&&an in t?ts.call(At(t),8,-1):te?"Object":"",Me=ae||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",et=Me+(me||te?"["+We.call(_m.call([],me||[],te||[]),": ")+"] ":"");return ve.length===0?et+"{}":P?et+"{"+Ya(ve,P)+"}":et+"{ "+We.call(ve,", ")+" }"}return String(t)},"inspect_");function Rm(e,t,r){var n=r.quoteStyle||t,o=km[n];return o+e+o}a(Rm,"wrapQuotes");function PT(e){return It.call(String(e),/"/g,"&quot;")}a(PT,"quote");function zt(e){return!an||!(typeof e=="object"&&(an in e||typeof e[an]<"u"))}a(zt,"canTrustToString");function Xa(e){return At(e)==="[object Array]"&&zt(e)}a(Xa,"isArray");function xT(e){return At(e)==="[object Date]"&&zt(e)}a(xT,"isDate");function Em(e){return At(e)==="[object RegExp]"&&zt(e)}a(Em,"isRegExp");function ST(e){return At(e)==="[object Error]"&&zt(e)}a(ST,"isError");function TT(e){return At(e)==="[object String]"&&zt(e)}a(TT,"isString");function ET(e){return At(e)==="[object Number]"&&zt(e)}a(ET,"isNumber");function IT(e){return At(e)==="[object Boolean]"&&zt(e)}a(IT,"isBoolean");function Om(e){if(lr)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Ka)return!1;try{return Ka.call(e),!0}catch{}return!1}a(Om,"isSymbol");function AT(e){if(!e||typeof e!="object"||!Wa)return!1;try{return Wa.call(e),!0}catch{}return!1}a(AT,"isBigInt");var wT=Object.prototype.hasOwnProperty||function(e){return e in this};function st(e,t){return wT.call(e,t)}a(st,"has");function At(e){return hT.call(e)}a(At,"toStr");function kT(e){if(e.name)return e.name;var t=gT.call(yT.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}a(kT,"nameOf");function Cm(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}a(Cm,"indexOf");function RT(e){if(!wo||!e||typeof e!="object")return!1;try{wo.call(e);try{ko.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}a(RT,"isMap");function OT(e){if(!nn||!e||typeof e!="object")return!1;try{nn.call(e,nn);try{on.call(e,on)}catch{return!0}return e instanceof WeakMap}catch{}return!1}a(OT,"isWeakMap");function CT(e){if(!gm||!e||typeof e!="object")return!1;try{return gm.call(e),!0}catch{}return!1}a(CT,"isWeakRef");function $T(e){if(!ko||!e||typeof e!="object")return!1;try{ko.call(e);try{wo.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}a($T,"isSet");function NT(e){if(!on||!e||typeof e!="object")return!1;try{on.call(e,on);try{nn.call(e,nn)}catch{return!0}return e instanceof WeakSet}catch{}return!1}a(NT,"isWeakSet");function DT(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}a(DT,"isElement");function $m(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return $m(ts.call(e,0,t.maxStringLength),t)+n}var o=bT[t.quoteStyle||"single"];o.lastIndex=0;var i=It.call(It.call(e,o,"\\$1"),/[\x00-\x1f]/g,zT);return Rm(i,"single",t)}a($m,"inspectString");function zT(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+vT.call(t.toString(16))}a(zT,"lowbyte");function rn(e){return"Object("+e+")"}a(rn,"markBoxed");function Za(e){return e+" { ? }"}a(Za,"weakCollectionOf");function Im(e,t,r,n){var o=n?Ya(r,n):We.call(r,", ");return e+" ("+t+") {"+o+"}"}a(Im,"collectionOf");function MT(e){for(var t=0;t<e.length;t++)if(Cm(e[t],`
3
+ `)>=0)return!1;return!0}a(MT,"singleLineValues");function UT(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=We.call(Array(e.indent+1)," ");else return null;return{base:r,prev:We.call(Array(t+1),r)}}a(UT,"getIndent");function Ya(e,t){if(e.length===0)return"";var r=`
4
+ `+t.prev+t.base;return r+We.call(e,","+r)+`
5
+ `+t.prev}a(Ya,"indentedJoin");function Ao(e,t){var r=Xa(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=st(e,o)?t(e[o],e):""}var i=typeof Ha=="function"?Ha(e):[],s;if(lr){s={};for(var l=0;l<i.length;l++)s["$"+i[l]]=i[l]}for(var f in e)st(e,f)&&(r&&String(Number(f))===f&&f<e.length||lr&&s["$"+f]instanceof Symbol||(Am.call(/[^\w$]/,f)?n.push(t(f,e)+": "+t(e[f],e)):n.push(f+": "+t(e[f],e))));if(typeof Ha=="function")for(var b=0;b<i.length;b++)wm.call(e,i[b])&&n.push("["+t(i[b])+"]: "+t(e[i[b]],e));return n}a(Ao,"arrObjKeys")});var zm=C((a4,Dm)=>{"use strict";var LT=sn(),qT=vt(),Ro=a(function(e,t,r){for(var n=e,o;(o=n.next)!=null;n=o)if(o.key===t)return n.next=o.next,r||(o.next=e.next,e.next=o),o},"listGetNode"),jT=a(function(e,t){if(e){var r=Ro(e,t);return r&&r.value}},"listGet"),FT=a(function(e,t,r){var n=Ro(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},"listSet"),BT=a(function(e,t){return e?!!Ro(e,t):!1},"listHas"),GT=a(function(e,t){if(e)return Ro(e,t,!0)},"listDelete");Dm.exports=a(function(){var t,r={assert:a(function(n){if(!r.has(n))throw new qT("Side channel does not contain "+LT(n))},"assert"),delete:a(function(n){var o=GT(t,n);return o&&t&&!t.next&&(t=void 0),!!o},"delete"),get:a(function(n){return jT(t,n)},"get"),has:a(function(n){return BT(t,n)},"has"),set:a(function(n,o){t||(t={next:void 0}),FT(t,n,o)},"set")};return r},"getSideChannelList")});var rs=C((u4,Lm)=>{"use strict";var Mm=en(),Um=Ea(),VT=Um([Mm("%String.prototype.indexOf%")]);Lm.exports=a(function(t,r){var n=Mm(t,!!r);return typeof n=="function"&&VT(t,".prototype.")>-1?Um([n]):n},"callBoundIntrinsic")});var ns=C((l4,jm)=>{"use strict";var HT=en(),un=rs(),ZT=sn(),WT=vt(),qm=HT("%Map%",!0),KT=un("Map.prototype.get",!0),JT=un("Map.prototype.set",!0),XT=un("Map.prototype.has",!0),YT=un("Map.prototype.delete",!0),QT=un("Map.prototype.size",!0);jm.exports=!!qm&&a(function(){var t,r={assert:a(function(n){if(!r.has(n))throw new WT("Side channel does not contain "+ZT(n))},"assert"),delete:a(function(n){if(t){var o=YT(t,n);return QT(t)===0&&(t=void 0),o}return!1},"delete"),get:a(function(n){if(t)return KT(t,n)},"get"),has:a(function(n){return t?XT(t,n):!1},"has"),set:a(function(n,o){t||(t=new qm),JT(t,n,o)},"set")};return r},"getSideChannelMap")});var Bm=C((d4,Fm)=>{"use strict";var eE=en(),Co=rs(),tE=sn(),Oo=ns(),rE=vt(),pr=eE("%WeakMap%",!0),nE=Co("WeakMap.prototype.get",!0),oE=Co("WeakMap.prototype.set",!0),iE=Co("WeakMap.prototype.has",!0),aE=Co("WeakMap.prototype.delete",!0);Fm.exports=pr?a(function(){var t,r,n={assert:a(function(o){if(!n.has(o))throw new rE("Side channel does not contain "+tE(o))},"assert"),delete:a(function(o){if(pr&&o&&(typeof o=="object"||typeof o=="function")){if(t)return aE(t,o)}else if(Oo&&r)return r.delete(o);return!1},"delete"),get:a(function(o){return pr&&o&&(typeof o=="object"||typeof o=="function")&&t?nE(t,o):r&&r.get(o)},"get"),has:a(function(o){return pr&&o&&(typeof o=="object"||typeof o=="function")&&t?iE(t,o):!!r&&r.has(o)},"has"),set:a(function(o,i){pr&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new pr),oE(t,o,i)):Oo&&(r||(r=Oo()),r.set(o,i))},"set")};return n},"getSideChannelWeakMap"):Oo});var os=C((f4,Gm)=>{"use strict";var sE=vt(),uE=sn(),cE=zm(),lE=ns(),pE=Bm(),dE=pE||lE||cE;Gm.exports=a(function(){var t,r={assert:a(function(n){if(!r.has(n))throw new sE("Side channel does not contain "+uE(n))},"assert"),delete:a(function(n){return!!t&&t.delete(n)},"delete"),get:a(function(n){return t&&t.get(n)},"get"),has:a(function(n){return!!t&&t.has(n)},"has"),set:a(function(n,o){t||(t=dE()),t.set(n,o)},"set")};return r},"getSideChannel")});var $o=C((y4,Vm)=>{"use strict";var mE=String.prototype.replace,fE=/%20/g,is={RFC1738:"RFC1738",RFC3986:"RFC3986"};Vm.exports={default:is.RFC3986,formatters:{RFC1738:a(function(e){return mE.call(e,fE,"+")},"RFC1738"),RFC3986:a(function(e){return String(e)},"RFC3986")},RFC1738:is.RFC1738,RFC3986:is.RFC3986}});var cs=C((v4,Hm)=>{"use strict";var hE=$o(),yE=os(),as=Object.prototype.hasOwnProperty,Mt=Array.isArray,No=yE(),dr=a(function(t,r){return No.set(t,r),t},"markOverflow"),Ut=a(function(t){return No.has(t)},"isOverflow"),cn=a(function(t){return No.get(t)},"getMaxIndex"),us=a(function(t,r){No.set(t,r)},"setMaxIndex"),Ke=(function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e})(),gE=a(function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(Mt(n)){for(var o=[],i=0;i<n.length;++i)typeof n[i]<"u"&&(o[o.length]=n[i]);r.obj[r.prop]=o}}},"compactQueue"),ln=a(function(t,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},o=0;o<t.length;++o)typeof t[o]<"u"&&(n[o]=t[o]);return n},"arrayToObject"),vE=a(function e(t,r,n){if(!r)return t;if(typeof r!="object"&&typeof r!="function"){if(Mt(t)){var o=t.length;if(n&&typeof n.arrayLimit=="number"&&o>n.arrayLimit)return dr(ln(t.concat(r),n),o);t[o]=r}else if(t&&typeof t=="object")if(Ut(t)){var i=cn(t)+1;t[i]=r,us(t,i)}else(n&&(n.plainObjects||n.allowPrototypes)||!as.call(Object.prototype,r))&&(t[r]=!0);else return[t,r];return t}if(!t||typeof t!="object"){if(Ut(r)){for(var s=Object.keys(r),l=n&&n.plainObjects?{__proto__:null,0:t}:{0:t},f=0;f<s.length;f++){var b=parseInt(s[f],10);l[b+1]=r[s[f]]}return dr(l,cn(r)+1)}var m=[t].concat(r);return n&&typeof n.arrayLimit=="number"&&m.length>n.arrayLimit?dr(ln(m,n),m.length-1):m}var P=t;return Mt(t)&&!Mt(r)&&(P=ln(t,n)),Mt(t)&&Mt(r)?(r.forEach(function(h,d){if(as.call(t,d)){var y=t[d];y&&typeof y=="object"&&h&&typeof h=="object"?t[d]=e(y,h,n):t[t.length]=h}else t[d]=h}),t):Object.keys(r).reduce(function(h,d){var y=r[d];if(as.call(h,d)?h[d]=e(h[d],y,n):h[d]=y,Ut(r)&&!Ut(h)&&dr(h,cn(r)),Ut(h)){var I=parseInt(d,10);String(I)===d&&I>=0&&I>cn(h)&&us(h,I)}return h},P)},"merge"),_E=a(function(t,r){return Object.keys(r).reduce(function(n,o){return n[o]=r[o],n},t)},"assignSingleSource"),bE=a(function(e,t,r){var n=e.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},"decode"),ss=1024,PE=a(function(t,r,n,o,i){if(t.length===0)return t;var s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var l="",f=0;f<s.length;f+=ss){for(var b=s.length>=ss?s.slice(f,f+ss):s,m=[],P=0;P<b.length;++P){var h=b.charCodeAt(P);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||i===hE.RFC1738&&(h===40||h===41)){m[m.length]=b.charAt(P);continue}if(h<128){m[m.length]=Ke[h];continue}if(h<2048){m[m.length]=Ke[192|h>>6]+Ke[128|h&63];continue}if(h<55296||h>=57344){m[m.length]=Ke[224|h>>12]+Ke[128|h>>6&63]+Ke[128|h&63];continue}P+=1,h=65536+((h&1023)<<10|b.charCodeAt(P)&1023),m[m.length]=Ke[240|h>>18]+Ke[128|h>>12&63]+Ke[128|h>>6&63]+Ke[128|h&63]}l+=m.join("")}return l},"encode"),xE=a(function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],o=0;o<r.length;++o)for(var i=r[o],s=i.obj[i.prop],l=Object.keys(s),f=0;f<l.length;++f){var b=l[f],m=s[b];typeof m=="object"&&m!==null&&n.indexOf(m)===-1&&(r[r.length]={obj:s,prop:b},n[n.length]=m)}return gE(r),t},"compact"),SE=a(function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},"isRegExp"),TE=a(function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},"isBuffer"),EE=a(function(t,r,n,o){if(Ut(t)){var i=cn(t)+1;return t[i]=r,us(t,i),t}var s=[].concat(t,r);return s.length>n?dr(ln(s,{plainObjects:o}),s.length-1):s},"combine"),IE=a(function(t,r){if(Mt(t)){for(var n=[],o=0;o<t.length;o+=1)n[n.length]=r(t[o]);return n}return r(t)},"maybeMap");Hm.exports={arrayToObject:ln,assign:_E,combine:EE,compact:xE,decode:bE,encode:PE,isBuffer:TE,isOverflow:Ut,isRegExp:SE,markOverflow:dr,maybeMap:IE,merge:vE}});var Ym=C((b4,Xm)=>{"use strict";var Wm=os(),Do=cs(),pn=$o(),AE=Object.prototype.hasOwnProperty,Km={brackets:a(function(t){return t+"[]"},"brackets"),comma:"comma",indices:a(function(t,r){return t+"["+r+"]"},"indices"),repeat:a(function(t){return t},"repeat")},Je=Array.isArray,wE=Array.prototype.push,Jm=a(function(e,t){wE.apply(e,Je(t)?t:[t])},"pushToArray"),kE=Date.prototype.toISOString,Zm=pn.default,_e={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Do.encode,encodeValuesOnly:!1,filter:void 0,format:Zm,formatter:pn.formatters[Zm],indices:!1,serializeDate:a(function(t){return kE.call(t)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},RE=a(function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},"isNonNullishPrimitive"),ls={},OE=a(function e(t,r,n,o,i,s,l,f,b,m,P,h,d,y,I,S,T,A){for(var k=t,G=A,Y=0,Te=!1;(G=G.get(ls))!==void 0&&!Te;){var ve=G.get(t);if(Y+=1,typeof ve<"u"){if(ve===Y)throw new RangeError("Cyclic object value");Te=!0}typeof G.get(ls)>"u"&&(Y=0)}if(typeof m=="function"?k=m(r,k):k instanceof Date?k=d(k):n==="comma"&&Je(k)&&(k=Do.maybeMap(k,function(Ei){return Ei instanceof Date?d(Ei):Ei})),k===null){if(s)return b&&!S?b(r,_e.encoder,T,"key",y):r;k=""}if(RE(k)||Do.isBuffer(k)){if(b){var ae=S?r:b(r,_e.encoder,T,"key",y);return[I(ae)+"="+I(b(k,_e.encoder,T,"value",y))]}return[I(r)+"="+I(String(k))]}var te=[];if(typeof k>"u")return te;var me;if(n==="comma"&&Je(k))S&&b&&(k=Do.maybeMap(k,b)),me=[{value:k.length>0?k.join(",")||null:void 0}];else if(Je(m))me=m;else{var Me=Object.keys(k);me=P?Me.sort(P):Me}var et=f?String(r).replace(/\./g,"%2E"):String(r),we=o&&Je(k)&&k.length===1?et+"[]":et;if(i&&Je(k)&&k.length===0)return we+"[]";for(var Ue=0;Ue<me.length;++Ue){var Oe=me[Ue],kr=typeof Oe=="object"&&Oe&&typeof Oe.value<"u"?Oe.value:k[Oe];if(!(l&&kr===null)){var Ti=h&&f?String(Oe).replace(/\./g,"%2E"):String(Oe),x_=Je(k)?typeof n=="function"?n(we,Ti):we:we+(h?"."+Ti:"["+Ti+"]");A.set(t,Y);var Us=Wm();Us.set(ls,A),Jm(te,e(kr,x_,n,o,i,s,l,f,n==="comma"&&S&&Je(k)?null:b,m,P,h,d,y,I,S,T,Us))}}return te},"stringify"),CE=a(function(t){if(!t)return _e;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=t.charset||_e.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=pn.default;if(typeof t.format<"u"){if(!AE.call(pn.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var o=pn.formatters[n],i=_e.filter;(typeof t.filter=="function"||Je(t.filter))&&(i=t.filter);var s;if(t.arrayFormat in Km?s=t.arrayFormat:"indices"in t?s=t.indices?"indices":"repeat":s=_e.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:_e.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:_e.addQueryPrefix,allowDots:l,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:_e.allowEmptyArrays,arrayFormat:s,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:_e.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?_e.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:_e.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:_e.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:_e.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:_e.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:_e.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:_e.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:_e.strictNullHandling}},"normalizeStringifyOptions");Xm.exports=function(e,t){var r=e,n=CE(t),o,i;typeof n.filter=="function"?(i=n.filter,r=i("",r)):Je(n.filter)&&(i=n.filter,o=i);var s=[];if(typeof r!="object"||r===null)return"";var l=Km[n.arrayFormat],f=l==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var b=Wm(),m=0;m<o.length;++m){var P=o[m],h=r[P];n.skipNulls&&h===null||Jm(s,OE(h,P,l,f,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,b))}var d=s.join(n.delimiter),y=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),d.length>0?y+d:""}});var tf=C((x4,ef)=>{"use strict";var Xe=cs(),zo=Object.prototype.hasOwnProperty,ps=Array.isArray,le={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Xe.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},$E=a(function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),Qm=a(function(e,t,r){if(e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return e},"parseArrayValue"),NE="utf8=%26%2310003%3B",DE="utf8=%E2%9C%93",zE=a(function(t,r){var n={__proto__:null},o=r.ignoreQueryPrefix?t.replace(/^\?/,""):t;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var i=r.parameterLimit===1/0?void 0:r.parameterLimit,s=o.split(r.delimiter,r.throwOnLimitExceeded?i+1:i);if(r.throwOnLimitExceeded&&s.length>i)throw new RangeError("Parameter limit exceeded. Only "+i+" parameter"+(i===1?"":"s")+" allowed.");var l=-1,f,b=r.charset;if(r.charsetSentinel)for(f=0;f<s.length;++f)s[f].indexOf("utf8=")===0&&(s[f]===DE?b="utf-8":s[f]===NE&&(b="iso-8859-1"),l=f,f=s.length);for(f=0;f<s.length;++f)if(f!==l){var m=s[f],P=m.indexOf("]="),h=P===-1?m.indexOf("="):P+1,d,y;if(h===-1?(d=r.decoder(m,le.decoder,b,"key"),y=r.strictNullHandling?null:""):(d=r.decoder(m.slice(0,h),le.decoder,b,"key"),d!==null&&(y=Xe.maybeMap(Qm(m.slice(h+1),r,ps(n[d])?n[d].length:0),function(S){return r.decoder(S,le.decoder,b,"value")}))),y&&r.interpretNumericEntities&&b==="iso-8859-1"&&(y=$E(String(y))),m.indexOf("[]=")>-1&&(y=ps(y)?[y]:y),r.comma&&ps(y)&&y.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");y=Xe.combine([],y,r.arrayLimit,r.plainObjects)}if(d!==null){var I=zo.call(n,d);I&&r.duplicates==="combine"?n[d]=Xe.combine(n[d],y,r.arrayLimit,r.plainObjects):(!I||r.duplicates==="last")&&(n[d]=y)}}return n},"parseQueryStringValues"),ME=a(function(e,t,r,n){var o=0;if(e.length>0&&e[e.length-1]==="[]"){var i=e.slice(0,-1).join("");o=Array.isArray(t)&&t[i]?t[i].length:0}for(var s=n?t:Qm(t,r,o),l=e.length-1;l>=0;--l){var f,b=e[l];if(b==="[]"&&r.parseArrays)Xe.isOverflow(s)?f=s:f=r.allowEmptyArrays&&(s===""||r.strictNullHandling&&s===null)?[]:Xe.combine([],s,r.arrayLimit,r.plainObjects);else{f=r.plainObjects?{__proto__:null}:{};var m=b.charAt(0)==="["&&b.charAt(b.length-1)==="]"?b.slice(1,-1):b,P=r.decodeDotInKeys?m.replace(/%2E/g,"."):m,h=parseInt(P,10),d=!isNaN(h)&&b!==P&&String(h)===P&&h>=0&&r.parseArrays;if(!r.parseArrays&&P==="")f={0:s};else if(d&&h<r.arrayLimit)f=[],f[h]=s;else{if(d&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");d?(f[h]=s,Xe.markOverflow(f,h)):P!=="__proto__"&&(f[P]=s)}}s=f}return s},"parseObject"),UE=a(function(t,r){var n=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(r.depth<=0)return!r.plainObjects&&zo.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var o=/(\[[^[\]]*])/,i=/(\[[^[\]]*])/g,s=o.exec(n),l=s?n.slice(0,s.index):n,f=[];if(l){if(!r.plainObjects&&zo.call(Object.prototype,l)&&!r.allowPrototypes)return;f[f.length]=l}for(var b=0;(s=i.exec(n))!==null&&b<r.depth;){b+=1;var m=s[1].slice(1,-1);if(!r.plainObjects&&zo.call(Object.prototype,m)&&!r.allowPrototypes)return;f[f.length]=s[1]}if(s){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");f[f.length]="["+n.slice(s.index)+"]"}return f},"splitKeyIntoSegments"),LE=a(function(t,r,n,o){if(t){var i=UE(t,n);if(i)return ME(i,r,n,o)}},"parseQueryStringKeys"),qE=a(function(t){if(!t)return le;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof t.charset>"u"?le.charset:t.charset,n=typeof t.duplicates>"u"?le.duplicates:t.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:le.allowDots:!!t.allowDots;return{allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:le.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:le.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:le.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:le.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:le.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:le.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:le.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:le.decoder,delimiter:typeof t.delimiter=="string"||Xe.isRegExp(t.delimiter)?t.delimiter:le.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:le.depth,duplicates:n,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:le.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:le.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:le.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:le.strictDepth,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:le.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}},"normalizeParseOptions");ef.exports=function(e,t){var r=qE(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof e=="string"?zE(e,r):e,o=r.plainObjects?{__proto__:null}:{},i=Object.keys(n),s=0;s<i.length;++s){var l=i[s],f=LE(l,n[l],r,typeof e=="string");o=Xe.merge(o,f,r)}return r.allowSparse===!0?o:Xe.compact(o)}});var nf=C((T4,rf)=>{"use strict";var jE=Ym(),FE=tf(),BE=$o();rf.exports={formats:BE,parse:FE,stringify:jE}});var WI={};Mn(WI,{stripe:()=>ZI,stripeAuth:()=>g});module.exports=w_(WI);var k_=Object.freeze({status:"aborted"});function $(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:s,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let b=s.prototype,m=Object.keys(b);for(let P=0;P<m.length;P++){let h=m[P];h in l||(l[h]=b[h].bind(l))}}a(n,"init");let o=r?.Parent??Object;class i extends o{static{a(this,"Definition")}}Object.defineProperty(i,"name",{value:e});function s(l){var f;let b=r?.Parent?new i:this;n(b,l),(f=b._zod).deferred??(f.deferred=[]);for(let m of b._zod.deferred)m();return b}return a(s,"_"),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(s,"name",{value:e}),s}a($,"$constructor");var Ve=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Un=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Ii={};function tt(e){return e&&Object.assign(Ii,e),Ii}a(tt,"config");function wi(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}a(wi,"getEnumValues");function js(e,t){return typeof t=="bigint"?t.toString():t}a(js,"jsonStringifyReplacer");function qn(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(qn,"cached");function Fs(e){return e==null}a(Fs,"nullish");function jn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(jn,"cleanRegex");var qs=Symbol("evaluating");function fe(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==qs)return n===void 0&&(n=qs,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}a(fe,"defineLazy");var ki="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Or(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(Or,"isObject");var R_=qn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Bs(e){if(Or(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Or(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Bs,"isPlainObject");var Gs=new Set(["string","number","symbol"]);function Gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Gt,"escapeRegex");function Fn(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}a(Fn,"clone");function re(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:a(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:a(()=>t.error,"error")}:t}a(re,"normalizeParams");function Vs(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(Vs,"optionalKeys");var Hs={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 Vt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}a(Vt,"aborted");function ct(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}a(ct,"prefixIssues");function Ln(e){return typeof e=="string"?e:e?.message}a(Ln,"unwrapMessage");function lt(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Ln(e.inst?._zod.def?.error?.(e))??Ln(t?.error?.(e))??Ln(r.customError?.(e))??Ln(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}a(lt,"finalizeIssue");function Zs(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(Zs,"getLengthableOrigin");function Ri(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}a(Ri,"issue");var Ws=a((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,js,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),Ks=$("$ZodError",Ws),Cr=$("$ZodError",Ws,{Parent:Error});var C_=a(e=>(t,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Ve;if(s.issues.length){let l=new(o?.Err??e)(s.issues.map(f=>lt(f,i,tt())));throw ki(l,o?.callee),l}return s.value},"_parse"),Bn=C_(Cr),$_=a(e=>async(t,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let l=new(o?.Err??e)(s.issues.map(f=>lt(f,i,tt())));throw ki(l,o?.callee),l}return s.value},"_parseAsync"),Gn=$_(Cr),N_=a(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Ve;return i.issues.length?{success:!1,error:new(e??Ks)(i.issues.map(s=>lt(s,o,tt())))}:{success:!0,data:i.value}},"_safeParse"),$r=N_(Cr),D_=a(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>lt(s,o,tt())))}:{success:!0,data:i.value}},"_safeParseAsync"),Nr=D_(Cr);var z_="(?:(?:\\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])))",M_=new RegExp(`^${z_}$`);var Js=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Xs=/^-?\d+n?$/,Ys=/^-?\d+$/,Oi=/^-?\d+(?:\.\d+)?$/,Qs=/^(?:true|false)$/i;var pt=$("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),U_={number:"number",bigint:"bigint",object:"date"};var eu=$("$ZodCheckGreaterThan",(e,t)=>{pt.init(e,t);let r=U_[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var tu=$("$ZodCheckNumberFormat",(e,t)=>{pt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Hs[t.format];e._zod.onattach.push(s=>{let l=s._zod.bag;l.format=t.format,l.minimum=o,l.maximum=i,r&&(l.pattern=Ys)}),e._zod.check=s=>{let l=s.value;if(r){if(!Number.isInteger(l)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?s.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<o&&s.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>i&&s.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var ru=$("$ZodCheckMinLength",(e,t)=>{var r;pt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Fs(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let s=Zs(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var Ci=$("$ZodCheckStringFormat",(e,t)=>{var r,n;pt.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),nu=$("$ZodCheckRegex",(e,t)=>{Ci.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var iu={major:4,minor:3,patch:6};var se=$("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=iu;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=a((s,l,f)=>{let b=Vt(s),m;for(let P of l){if(P._zod.def.when){if(!P._zod.def.when(s))continue}else if(b)continue;let h=s.issues.length,d=P._zod.check(s);if(d instanceof Promise&&f?.async===!1)throw new Ve;if(m||d instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await d,s.issues.length!==h&&(b||(b=Vt(s,h)))});else{if(s.issues.length===h)continue;b||(b=Vt(s,h))}}return m?m.then(()=>s):s},"runChecks"),i=a((s,l,f)=>{if(Vt(s))return s.aborted=!0,s;let b=o(l,n,f);if(b instanceof Promise){if(f.async===!1)throw new Ve;return b.then(m=>e._zod.parse(m,f))}return e._zod.parse(b,f)},"handleCanaryResult");e._zod.run=(s,l)=>{if(l.skipChecks)return e._zod.parse(s,l);if(l.direction==="backward"){let b=e._zod.parse({value:s.value,issues:[]},{...l,skipChecks:!0});return b instanceof Promise?b.then(m=>i(m,s,l)):i(b,s,l)}let f=e._zod.parse(s,l);if(f instanceof Promise){if(l.async===!1)throw new Ve;return f.then(b=>o(b,n,l))}return o(f,n,l)}}fe(e,"~standard",()=>({validate:a(o=>{try{let i=$r(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Nr(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Zn=$("$ZodString",(e,t)=>{se.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Js(e._zod.bag),e._zod.parse=(r,n)=>{if(t.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:e}),r}}),$i=$("$ZodStringFormat",(e,t)=>{Ci.init(e,t),Zn.init(e,t)});var lu=$("$ZodURL",(e,t)=>{$i.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Ni=$("$ZodNumber",(e,t)=>{se.init(e,t),e._zod.pattern=e._zod.bag.pattern??Oi,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),pu=$("$ZodNumberFormat",(e,t)=>{tu.init(e,t),Ni.init(e,t)}),Di=$("$ZodBoolean",(e,t)=>{se.init(e,t),e._zod.pattern=Qs,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),du=$("$ZodBigInt",(e,t)=>{se.init(e,t),e._zod.pattern=Xs,e._zod.parse=(r,n)=>{if(t.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:e}),r}});var mu=$("$ZodAny",(e,t)=>{se.init(e,t),e._zod.parse=r=>r}),fu=$("$ZodUnknown",(e,t)=>{se.init(e,t),e._zod.parse=r=>r});var hu=$("$ZodVoid",(e,t)=>{se.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),yu=$("$ZodDate",(e,t)=>{se.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});function au(e,t,r){e.issues.length&&t.issues.push(...ct(r,e.issues)),t.value[r]=e.value}a(au,"handleArrayResult");var gu=$("$ZodArray",(e,t)=>{se.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let i=[];for(let s=0;s<o.length;s++){let l=o[s],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?i.push(f.then(b=>au(b,r,s))):au(f,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function Hn(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...ct(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}a(Hn,"handlePropertyResult");function L_(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Vs(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(L_,"normalizeDef");function q_(e,t,r,n,o,i){let s=[],l=o.keySet,f=o.catchall._zod,b=f.def.type,m=f.optout==="optional";for(let P in t){if(l.has(P))continue;if(b==="never"){s.push(P);continue}let h=f.run({value:t[P],issues:[]},n);h instanceof Promise?e.push(h.then(d=>Hn(d,r,P,t,m))):Hn(h,r,P,t,m)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}a(q_,"handleCatchall");var vu=$("$ZodObject",(e,t)=>{if(se.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:a(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=qn(()=>L_(t));fe(e._zod,"propValues",()=>{let l=t.shape,f={};for(let b in l){let m=l[b]._zod;if(m.values){f[b]??(f[b]=new Set);for(let P of m.values)f[b].add(P)}}return f});let o=Or,i=t.catchall,s;e._zod.parse=(l,f)=>{s??(s=n.value);let b=l.value;if(!o(b))return l.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),l;l.value={};let m=[],P=s.shape;for(let h of s.keys){let d=P[h],y=d._zod.optout==="optional",I=d._zod.run({value:b[h],issues:[]},f);I instanceof Promise?m.push(I.then(S=>Hn(S,l,h,b,y))):Hn(I,l,h,b,y)}return i?q_(m,b,l,f,n.value,e):m.length?Promise.all(m).then(()=>l):l}});function su(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!Vt(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>lt(s,n,tt())))}),t)}a(su,"handleUnionResults");var zi=$("$ZodUnion",(e,t)=>{se.init(e,t),fe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),fe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),fe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),fe(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>jn(i.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(r)return n(o,i);let s=!1,l=[];for(let f of t.options){let b=f._zod.run({value:o.value,issues:[]},i);if(b instanceof Promise)l.push(b),s=!0;else{if(b.issues.length===0)return b;l.push(b)}}return s?Promise.all(l).then(f=>su(f,o,e,i)):su(l,o,e,i)}});var _u=$("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,zi.init(e,t);let r=e._zod.parse;fe(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[l,f]of Object.entries(s)){o[l]||(o[l]=new Set);for(let b of f)o[l].add(b)}}return o});let n=qn(()=>{let o=t.options,i=new Map;for(let s of o){let l=s._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let f of l){if(i.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);i.set(f,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!Or(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let l=n.value.get(s?.[t.discriminator]);return l?l._zod.run(o,i):t.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o)}});var bu=$("$ZodRecord",(e,t)=>{se.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Bs(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let l=new Set;for(let b of s)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){l.add(typeof b=="number"?b.toString():b);let m=t.valueType._zod.run({value:o[b],issues:[]},n);m instanceof Promise?i.push(m.then(P=>{P.issues.length&&r.issues.push(...ct(b,P.issues)),r.value[b]=P.value})):(m.issues.length&&r.issues.push(...ct(b,m.issues)),r.value[b]=m.value)}let f;for(let b in o)l.has(b)||(f=f??[],f.push(b));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Oi.test(l)&&f.issues.length){let P=t.keyType._zod.run({value:Number(l),issues:[]},n);if(P instanceof Promise)throw new Error("Async schemas not supported in object keys currently");P.issues.length===0&&(f=P)}if(f.issues.length){t.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(P=>lt(P,n,tt())),input:l,path:[l],inst:e});continue}let m=t.valueType._zod.run({value:o[l],issues:[]},n);m instanceof Promise?i.push(m.then(P=>{P.issues.length&&r.issues.push(...ct(l,P.issues)),r.value[f.value]=P.value})):(m.issues.length&&r.issues.push(...ct(l,m.issues)),r.value[f.value]=m.value)}}return i.length?Promise.all(i).then(()=>r):r}});var Pu=$("$ZodEnum",(e,t)=>{se.init(e,t);let r=wi(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Gs.has(typeof o)).map(o=>typeof o=="string"?Gt(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),xu=$("$ZodLiteral",(e,t)=>{if(se.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Gt(n):n?Gt(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});var Su=$("$ZodTransform",(e,t)=>{se.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Un(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new Ve;return r.value=o,r}});function uu(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(uu,"handleOptionalResult");var Tu=$("$ZodOptional",(e,t)=>{se.init(e,t),e._zod.optin="optional",e._zod.optout="optional",fe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),fe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${jn(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>uu(i,r.value)):uu(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Eu=$("$ZodNullable",(e,t)=>{se.init(e,t),fe(e._zod,"optin",()=>t.innerType._zod.optin),fe(e._zod,"optout",()=>t.innerType._zod.optout),fe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${jn(r.source)}|null)$`):void 0}),fe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Iu=$("$ZodPipe",(e,t)=>{se.init(e,t),fe(e._zod,"values",()=>t.in._zod.values),fe(e._zod,"optin",()=>t.in._zod.optin),fe(e._zod,"optout",()=>t.out._zod.optout),fe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>Vn(s,t.in,n)):Vn(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Vn(i,t.out,n)):Vn(o,t.out,n)}});function Vn(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(Vn,"handlePipeResult");var Au=$("$ZodCustom",(e,t)=>{pt.init(e,t),se.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>cu(i,r,n,e));cu(o,r,n,e)}});function cu(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Ri(o))}}a(cu,"handleRefineResult");var ku;var Mi=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Ru(){return new Mi}a(Ru,"registry");(ku=globalThis).__zod_globalRegistry??(ku.__zod_globalRegistry=Ru());var Ui=globalThis.__zod_globalRegistry;function Ou(e,t){return new e({type:"string",...re(t)})}a(Ou,"_string");function Cu(e,t){return new e({type:"string",coerce:!0,...re(t)})}a(Cu,"_coercedString");function $u(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...re(t)})}a($u,"_url");function Nu(e,t){return new e({type:"number",checks:[],...re(t)})}a(Nu,"_number");function Du(e,t){return new e({type:"number",coerce:!0,checks:[],...re(t)})}a(Du,"_coercedNumber");function zu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...re(t)})}a(zu,"_int");function Mu(e,t){return new e({type:"boolean",...re(t)})}a(Mu,"_boolean");function Uu(e,t){return new e({type:"boolean",coerce:!0,...re(t)})}a(Uu,"_coercedBoolean");function Lu(e,t){return new e({type:"bigint",coerce:!0,...re(t)})}a(Lu,"_coercedBigint");function qu(e){return new e({type:"any"})}a(qu,"_any");function ju(e){return new e({type:"unknown"})}a(ju,"_unknown");function Fu(e,t){return new e({type:"void",...re(t)})}a(Fu,"_void");function Bu(e,t){return new e({type:"date",coerce:!0,...re(t)})}a(Bu,"_coercedDate");function Wn(e,t){return new eu({check:"greater_than",...re(t),value:e,inclusive:!0})}a(Wn,"_gte");function qe(e,t){return new ru({check:"min_length",...re(t),minimum:e})}a(qe,"_minLength");function dt(e,t){return new nu({check:"string_format",format:"regex",...re(t),pattern:e})}a(dt,"_regex");function Gu(e,t,r){let n=re(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}a(Gu,"_custom");var he=$("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");se.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Bn(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>$r(e,r,n),e.parseAsync=async(r,n)=>Gn(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Nr(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>Fn(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Jn=$("ZodMiniString",(e,t)=>{Zn.init(e,t),he.init(e,t)});function p(e){return Ou(Jn,e)}a(p,"string");var Vu=$("ZodMiniStringFormat",(e,t)=>{$i.init(e,t),Jn.init(e,t)});var Q_=$("ZodMiniURL",(e,t)=>{lu.init(e,t),Vu.init(e,t)});function Hu(e){return $u(Q_,e)}a(Hu,"url");var Xn=$("ZodMiniNumber",(e,t)=>{Ni.init(e,t),he.init(e,t)});function be(e){return Nu(Xn,e)}a(be,"number");var eb=$("ZodMiniNumberFormat",(e,t)=>{pu.init(e,t),Xn.init(e,t)});function Zu(e){return zu(eb,e)}a(Zu,"int");var Li=$("ZodMiniBoolean",(e,t)=>{Di.init(e,t),he.init(e,t)});function J(e){return Mu(Li,e)}a(J,"boolean");var Wu=$("ZodMiniBigInt",(e,t)=>{du.init(e,t),he.init(e,t)});var tb=$("ZodMiniAny",(e,t)=>{mu.init(e,t),he.init(e,t)});function zr(){return qu(tb)}a(zr,"any");var rb=$("ZodMiniUnknown",(e,t)=>{fu.init(e,t),he.init(e,t)});function F(){return ju(rb)}a(F,"unknown");var nb=$("ZodMiniVoid",(e,t)=>{hu.init(e,t),he.init(e,t)});function Ku(e){return Fu(nb,e)}a(Ku,"_void");var Ju=$("ZodMiniDate",(e,t)=>{yu.init(e,t),he.init(e,t)});var ob=$("ZodMiniArray",(e,t)=>{gu.init(e,t),he.init(e,t)});function U(e,t){return new ob({type:"array",element:e,...re(t)})}a(U,"array");var ib=$("ZodMiniObject",(e,t)=>{vu.init(e,t),he.init(e,t),fe(e,"shape",()=>t.shape)});function E(e,t){let r={type:"object",shape:e??{},...re(t)};return new ib(r)}a(E,"object");var ab=$("ZodMiniUnion",(e,t)=>{zi.init(e,t),he.init(e,t)});function Z(e,t){return new ab({type:"union",options:e,...re(t)})}a(Z,"union");var sb=$("ZodMiniDiscriminatedUnion",(e,t)=>{_u.init(e,t),he.init(e,t)});function mt(e,t,r){return new sb({type:"union",options:t,discriminator:e,...re(r)})}a(mt,"discriminatedUnion");var ub=$("ZodMiniRecord",(e,t)=>{bu.init(e,t),he.init(e,t)});function B(e,t,r){return new ub({type:"record",keyType:e,valueType:t,...re(r)})}a(B,"record");var cb=$("ZodMiniEnum",(e,t)=>{Pu.init(e,t),he.init(e,t),e.options=Object.values(t.entries)});function z(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new cb({type:"enum",entries:r,...re(t)})}a(z,"_enum");var lb=$("ZodMiniLiteral",(e,t)=>{xu.init(e,t),he.init(e,t)});function D(e,t){return new lb({type:"literal",values:Array.isArray(e)?e:[e],...re(t)})}a(D,"literal");var pb=$("ZodMiniTransform",(e,t)=>{Su.init(e,t),he.init(e,t)});function ft(e){return new pb({type:"transform",transform:e})}a(ft,"transform");var db=$("ZodMiniOptional",(e,t)=>{Tu.init(e,t),he.init(e,t)});function w(e){return new db({type:"optional",innerType:e})}a(w,"optional");var mb=$("ZodMiniNullable",(e,t)=>{Eu.init(e,t),he.init(e,t)});function Mr(e){return new mb({type:"nullable",innerType:e})}a(Mr,"nullable");var fb=$("ZodMiniPipe",(e,t)=>{Iu.init(e,t),he.init(e,t)});function ht(e,t){return new fb({type:"pipe",in:e,out:t})}a(ht,"pipe");var hb=$("ZodMiniCustom",(e,t)=>{Au.init(e,t),he.init(e,t)});function Yn(e,t){return Gu(hb,e??(()=>!0),t)}a(Yn,"custom");var Ur={};Mn(Ur,{bigint:()=>Pb,boolean:()=>bb,date:()=>xb,number:()=>_b,string:()=>vb});function vb(e){return Cu(Jn,e)}a(vb,"string");function _b(e){return Du(Xn,e)}a(_b,"number");function bb(e){return Uu(Li,e)}a(bb,"boolean");function Pb(e){return Lu(Wu,e)}a(Pb,"bigint");function xb(e){return Bu(Ju,e)}a(xb,"date");var ji=E({retryOnFailure:E({defaultValue:w(J()),hide:w(J())}),continueOnFailure:E({defaultValue:w(J()),hide:w(J())})}),qi=class{constructor(t,r,n,o,i,s,l,f,b,m,P,h,d){this.name=t;this.displayName=r;this.description=n;this.props=o;this.propertyGroups=i;this.run=s;this.test=l;this.requireAuth=f;this.errorHandlingOptions=b;this.outputSchema=m;this.audience=P;this.aiMetadata=h;this.classification=d}static{a(this,"IAction")}},x=a(e=>new qi(e.name,e.displayName,e.description,e.props,e.propertyGroups,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata,e.classification),"createAction");var K=E({displayName:p(),description:w(p()),advanced:w(J()),width:w(z(["half","full"])),icon:w(p()),placeholder:w(p())}),V=a((e,t)=>E({type:D(t),required:J(),defaultValue:w(zr())}),"TPropertyValue");var Ce=E({...K.shape,...V(p(),"SHORT_TEXT").shape}),rt=E({...K.shape,...V(p(),"LONG_TEXT").shape});var Yu=E({label:p(),value:F(),description:w(p()),icon:w(p())}),Qn=E({disabled:w(J()),placeholder:w(p()),options:U(Yu)});var Tb=z(["cards"]),$e=E({...K.shape,options:Qn,display:w(Tb),...V(F(),"STATIC_DROPDOWN").shape}),nt=E({...K.shape,options:Qn,...V(U(F()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Fi=E({...K.shape,...V(F(),"DROPDOWN").shape,refreshers:U(p())}),Lr=E({...K.shape,...V(U(F()),"MULTI_SELECT_DROPDOWN").shape,refreshers:U(p())});var ot=E({...K.shape,reveals:w(U(p())),...V(J(),"CHECKBOX").shape});var it=E({...K.shape,display:w(z(["stepper"])),min:w(be()),max:w(be()),step:w(be()),...V(be(),"NUMBER").shape});var qr=E({...K.shape,streaming:w(J()),...V(F(),"FILE").shape});var jr=E({...K.shape,...V(p(),"DATE_TIME").shape});var Qu=B(p(),Z([Ce,rt,$e,Lr,nt,ot,it,qr,jr])),Fr=E({...K.shape,properties:Qu,...V(U(F()),"ARRAY").shape});var ec=z(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),tc=E({preset:w(ec),after:w(p()),before:w(p())}),Bi=E({...K.shape,display:w(z(["dropdown"])),...V(tc,"DATE_RANGE").shape});var Br=E({...K.shape,...V(Z([B(p(),F())]),"JSON").shape});var rc=Z([Ce,$e,Br,Fr,nt]),Eb=B(p(),rc),Gi=E({refreshers:U(p()),...K.shape,...V(F(),"DYNAMIC").shape});var eo=E({...K.shape,...V(Ku(),"MARKDOWN").shape});var Gr=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Gr||{}),Ht=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ht||{}),Zt=(T=>(T.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",T.COMMUNICATION="COMMUNICATION",T.COMMERCE="COMMERCE",T.CORE="CORE",T.UNIVERSAL_AI="UNIVERSAL_AI",T.FLOW_CONTROL="FLOW_CONTROL",T.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",T.ACCOUNTING="ACCOUNTING",T.PRODUCTIVITY="PRODUCTIVITY",T.CONTENT_AND_FILES="CONTENT_AND_FILES",T.DEVELOPER_TOOLS="DEVELOPER_TOOLS",T.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",T.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",T.HUMAN_RESOURCES="HUMAN_RESOURCES",T.PAYMENT_PROCESSING="PAYMENT_PROCESSING",T.MARKETING="MARKETING",T.SALES_AND_CRM="SALES_AND_CRM",T))(Zt||{});var Vr=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Vr||{}),Vi="both_client_credentials_and_authorization_code";var ye=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(ye||{}),Hr=(i=>(i.NONE="NONE",i.HEADER_PRESENT="HEADER_PRESENT",i.QUERY_PRESENT="QUERY_PRESENT",i.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",i.HEAD_REQUEST="HEAD_REQUEST",i))(Hr||{}),Ib=E({strategy:z(Hr),paramName:w(p())}),Zr=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Zr||{});var to=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(to||{}),nc=E({status:w(be()),body:w(F()),headers:w(B(p(),p()))}),oc=E({type:D("DELAY"),resumeDateTime:p(),requestIdToReply:w(p()),handlerId:w(p()),streamStepProgress:w(z(to))}),ic=E({type:D("WEBHOOK"),requestId:p(),requestIdToReply:w(p()),response:nc,handlerId:w(p()),streamStepProgress:w(z(to))}),Ab=Z([oc,ic]);var wb=E({body:F(),rawBody:w(F()),headers:B(p(),p()),queryParams:B(p(),p())});function Ne(e){return e==null}a(Ne,"isNil");function H(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}a(H,"isEmpty");function ro(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}a(ro,"assertNotNullOrUndefined");var Hi=Le(require("crypto"),1);var kb=128,yt,Wt,Rb=a(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!yt||yt.length<e?(yt=Buffer.allocUnsafe(e*kb),Hi.default.randomFillSync(yt),Wt=0):Wt+e>yt.length&&(Hi.default.randomFillSync(yt),Wt=0)}catch(t){throw yt=void 0,t}Wt+=e},"fillPool"),Ob=a(e=>(Rb(e|=0),yt.subarray(Wt-e,Wt)),"random"),Cb=a((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(i=t)=>{if(i<=0)return"";let s="";for(;;){let l=r(o),f=o;for(;f--;)if(s+=e[l[f]&n]||"",s.length===i)return s}}},"customRandom"),sc=a((e,t=21)=>Cb(e,t,Ob),"customAlphabet");var $b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",uc=21,Cz=p().check(dt(new RegExp(`^[0-9a-zA-Z]{${uc}}$`))),Nb=sc($b,uc);var gt=ht(ft(e=>e instanceof Date?e.toISOString():e),p()),De={id:p(),created:gt,updated:gt},ie=a(e=>w(Mr(e)),"Nullable");function Zi(e){return w(Mr(z(e)))}a(Zi,"NullableEnum");var Dz=ht(ft(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),w(J())),no=a(e=>ht(ft(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),w(U(e))),"OptionalArrayFromQuery");var Uz=B(p(),F());var Wr=(m=>(m.OPENAI="openai",m.OPENROUTER="openrouter",m.ANTHROPIC="anthropic",m.AZURE="azure",m.GOOGLE="google",m.ACTIVEPIECES="activepieces",m.CLOUDFLARE_GATEWAY="cloudflare-gateway",m.CUSTOM="custom",m.BEDROCK="bedrock",m.MISTRAL="mistral",m))(Wr||{});var Jz=p().check(dt(/^#[0-9A-Fa-f]{6}$/));var Yz=E({filename:p(),data:F(),type:D("file"),mimetype:w(p())});var Db=Le(lc());var iM=E({...De,name:p(),permissions:U(p()),platformId:ie(p()),type:p(),userCount:w(be())});var pc=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(pc||{}),Wi=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Wi||{}),Ki=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Ki||{});var Ji=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Ji||{});var Xi=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Xi||{});var zb=E({mode:z(pc),value:F()}),Mb=E({auth:w(p()),fields:B(p(),zb)}),Ub=E({pieceName:p(),pieceVersion:p(),actionName:p(),predefinedInput:w(Mb)}),Lb=E({type:D("PIECE"),toolName:p().check(qe(1)),pieceMetadata:Ub}),qb=E({type:D("none")}),jb=E({type:D("access_token"),accessToken:p()}),Fb=E({type:D("api_key"),apiKey:p(),apiKeyHeader:p()}),Bb=E({type:D("headers"),headers:B(p(),p())}),Gb=mt("type",[qb,jb,Fb,Bb]),dc=E({type:D("FLOW"),toolName:p().check(qe(1)),externalFlowId:p(),flowDisplayName:w(p())}),mc=E({type:D("MCP"),toolName:p().check(qe(1)),serverUrl:Hu(),protocol:z(Ki),auth:Gb}),fc=E({type:D("KNOWLEDGE_BASE"),toolName:p().check(qe(1)),sourceType:z(Wi),sourceId:p(),sourceName:p()}),Vb=mt("type",[Lb,dc,mc,fc]),Hb=E({displayName:p(),description:w(p()),type:z(Ji)}),hc=E({type:D("MARKDOWN"),markdown:p()}),Kt={type:D("TOOL_CALL"),input:ie(B(p(),F())),output:w(F()),toolName:p(),status:z(Xi),toolCallId:p(),startTime:p(),endTime:w(p())},zM=E(Kt),yc=mt("toolCallType",[E({...Kt,toolCallType:D("PIECE"),pieceName:p(),pieceVersion:p(),actionName:p()}),E({...Kt,toolCallType:D("FLOW"),displayName:p(),externalFlowId:p()}),E({...Kt,toolCallType:D("MCP"),displayName:p(),serverUrl:p()}),E({...Kt,toolCallType:D("KNOWLEDGE_BASE"),displayName:p(),sourceType:p()}),E({...Kt,toolCallType:D("UNKNOWN"),displayName:p()})]),Zb=Z([hc,yc]);var Yi=(r=>(r.IMAGE="image",r.TEXT="text",r))(Yi||{}),at=E({apiKey:p()}),Wb=at,Kb=E({apiKey:p(),apiKeyHash:p()}),Jb=at,Xb=at,Yb=at,Qb=at,eP=at,tP=at,rP=at,Pc=E({accessKeyId:p().check(qe(1)),secretAccessKey:p().check(qe(1))}),nP=E({}),oP=E({}),iP=E({}),aP=E({}),sP=E({}),uP=E({}),xc=E({modelId:p(),modelName:p(),modelType:z(Yi)}),Sc=E({apiKeyHeader:p(),baseUrl:p(),models:U(xc),defaultHeaders:w(B(p(),p()))}),Tc=E({accountId:p(),gatewayId:p(),models:U(xc),vertexProject:w(p()),vertexRegion:w(p())}),Ec=E({resourceName:p(),apiVersion:ht(ft(e=>typeof e=="string"&&e.trim().length===0?void 0:e),w(p()))}),Ic=E({region:p().check(qe(1))}),cP=Z([Wb,Yb,Qb,eP,tP,Xb,Jb,Kb,Pc,rP]),Ac=Z([Sc,Tc,Ec,Ic,nP,iP,aP,sP,oP,uP]),lP=E({id:p(),name:p(),type:z(Yi)}),pP=E({id:p(),name:p(),provider:z(Wr),config:Ac,enabledForChat:J()}),dP=E({provider:z(Wr),config:Ac,auth:cP,platformId:p()});var qM={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},gc=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],mP=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],fP=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],vc=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],hP=["grok-4.20","grok-4.1-fast"],yP={openai:gc,anthropic:mP,google:vc,activepieces:[...fP.map(e=>`anthropic/${e}`),...gc.map(e=>`openai/${e}`),...vc.map(e=>`google/${e}`),...hP.map(e=>`x-ai/${e}`)]};var _c=128e3,gP={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function vP({provider:e}){return e?gP[e]??_c:_c}a(vP,"getMaxContextTokens");var bc={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},_P={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},bP=new Set(["anthropic","mistral"]);function He(e){return{chatModels:yP[e],maxContextTokens:vP({provider:e}),defaultEmbeddingModel:bc[e],supportsEmbedding:bc[e]!==void 0,supportsImageGeneration:!bP.has(e),webSearch:_P[e]}}a(He,"buildProviderCapabilities");var PP={openai:He("openai"),anthropic:He("anthropic"),openrouter:He("openrouter"),azure:He("azure"),google:He("google"),"cloudflare-gateway":He("cloudflare-gateway"),custom:He("custom"),bedrock:He("bedrock"),mistral:He("mistral"),activepieces:He("activepieces")};var xP=E({base64Url:p(),fileName:p(),extension:w(p())}),SP=E({mimeType:p(),url:p(),fileName:w(p())}),Qi=Z([xP,SP]);var TP=Z([E({type:D("file"),value:Qi}),E({type:D("markdown"),value:p(),files:w(U(Qi))})]),EP=E({sessionId:p(),message:p(),files:w(U(p()))});var kc=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(kc||{}),Rc=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Rc||{}),ea=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(ea||{});var IP=Z([E({...De,name:p(),externalId:p(),type:D("STATIC_DROPDOWN"),tableId:p(),projectId:p(),data:E({options:U(E({value:p()}))})}),E({...De,name:p(),externalId:p(),type:Z([D("TEXT"),D("NUMBER"),D("DATE"),D("DATETIME")]),tableId:p(),projectId:p()})]),AP=E({...De,name:p(),folderId:ie(p()),projectId:p(),externalId:p(),status:Zi(Rc),trigger:Zi(kc)}),wP=E({...De,tableId:p(),projectId:p(),cells:B(p(),E({updated:p(),created:p(),value:F(),fieldName:p()}))}),kP=E({events:U(z(ea)),webhookUrl:p(),flowId:p()}),RP=E({fields:U(E({id:p(),name:p()})),rows:U(B(p(),p())),name:p()}),OP=E({projectId:p(),limit:w(Ur.number()),cursor:w(p()),name:w(p()),externalIds:no(p()),folderId:w(p()),folderIds:no(p())}),CP=E({records:U(U(E({fieldId:p(),value:Cc()}))),tableId:p()}),$P=E({cells:w(U(E({fieldId:p(),value:Cc()}))),tableId:p(),agentUpdate:w(J())}),Oc=mt("operator",[$t("eq"),$t("neq"),$t("gt"),$t("gte"),$t("lt"),$t("lte"),$t("co"),wc("exists"),wc("not_exists")]),NP=E({tableId:p(),limit:w(Ur.number()),cursor:w(p()),filters:no(Oc)});function Cc(){return ht(ft(e=>e==null?e:String(e)),Mr(p()))}a(Cc,"coerceToString");function $t(e){return E({fieldId:p(),operator:D(e),value:p()})}a($t,"valueFilter");function wc(e){return E({fieldId:p(),operator:D(e)})}a(wc,"existenceFilter");var DP=E({status:w(be()),body:w(F()),headers:w(B(p(),p()))}),zP=E({...De,deleted:ie(gt),ownerId:p(),displayName:p(),platformId:p(),externalId:ie(p())});var $c=E({name:p(),description:w(p()),type:p(),required:J()}),MP=E({pieceName:p(),triggerName:p(),input:E({toolName:p(),toolDescription:p(),inputSchema:U($c),returnsResponse:J()})});var Nc="^[0-9]+\\.[0-9]+\\.[0-9]+$",i0=new RegExp(Nc),LP="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",a0=p().check(dt(new RegExp(Nc))),s0=p().check(dt(new RegExp(LP))),qP=E({packageType:D("ARCHIVE"),pieceType:z(Ht),pieceName:p(),pieceVersion:p(),archiveId:p(),platformId:p()}),Dc=E({packageType:D("REGISTRY"),pieceType:D("OFFICIAL"),pieceName:p(),pieceVersion:p()}),zc=E({packageType:D("REGISTRY"),pieceType:D("CUSTOM"),pieceName:p(),pieceVersion:p(),platformId:p()}),u0=Z([Dc,zc]),c0=Z([qP,Dc,zc]);var jP=mt("type",[E({type:D("CRON_EXPRESSION"),cronExpression:p(),timezone:p()}),E({type:D("INTERVAL"),intervalMs:Zu().check(Wn(6e4))})]),l0=E({...De,type:z(ye),projectId:p(),flowId:p(),triggerName:p(),schedule:ie(jP),flowVersionId:p(),pieceName:p(),pieceVersion:p(),deleted:ie(p()),simulate:J()}),Mc=(S=>(S.UNKNOWN="UNKNOWN",S.FLOW_RUN_LOG="FLOW_RUN_LOG",S.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",S.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",S.FLOW_STEP_FILE="FLOW_STEP_FILE",S.SAMPLE_DATA="SAMPLE_DATA",S.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",S.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",S.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",S.PROJECT_RELEASE="PROJECT_RELEASE",S.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",S.PLATFORM_ASSET="PLATFORM_ASSET",S.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",S.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",S.KNOWLEDGE_BASE="KNOWLEDGE_BASE",S.FLOW_BUNDLE="FLOW_BUNDLE",S))(Mc||{}),Uc=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Uc||{}),Lc=(r=>(r.S3="S3",r.DB="DB",r))(Lc||{}),p0=E({...De,projectId:ie(p()),platformId:ie(p()),type:z(Mc),compression:z(Uc),data:w(F()),location:z(Lc),size:ie(be()),fileName:ie(p()),s3Key:ie(p()),metadata:ie(B(p(),p()))}),qc=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(qc||{}),jc=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(jc||{}),d0=E({id:p(),email:p(),firstName:p(),status:z(jc),externalId:ie(p()),platformId:ie(p()),platformRole:z(qc),lastName:p(),created:gt,updated:gt,lastActiveDate:ie(gt),imageUrl:ie(p())});var ta=E({...K.shape,...V(B(p(),F()),"OBJECT").shape});var ra=E({...K.shape,formatProperty:w(p()),...V(p(),"RICH_TEXT").shape});var Vc=E({...K.shape,...V(p(),"COLOR").shape});var na=Z([Ce,rt,ra,eo,ot,$e,nt,Fi,Lr,Gi,it,Fr,ta,Br,jr,Bi,qr,Vc]),u={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},RichText(e){return{...e,valueSchema:void 0,type:"RICH_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},DateRange(e){return{...e,valueSchema:void 0,type:"DATE_RANGE"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var Ze=E({displayName:p(),description:w(p()),hasConnectionIdentifier:w(J())});var Hc=E({username:p(),password:p()}),oa=E({...Ze.shape,username:E({displayName:p(),description:w(p())}),password:E({displayName:p(),description:w(p())}),...V(Hc,"BASIC_AUTH").shape});var VP=B(p(),Z([Ce,rt,it,ot,$e])),ia=E({...Ze.shape,props:VP,...V(F(),"CUSTOM_AUTH").shape});var Nt=E({...Ze.shape,...V(E({auth:p()}),"SECRET_TEXT").shape});var HP=B(p(),Z([Ce,rt,Nt,it,ot,$e,nt,eo])),Zc=E({...Ze.shape,props:HP,...V(F(),"OIDC").shape});var aa=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(aa||{}),Wc=Z([Ce,Nt,$e]),Kc=B(p(),Wc),ZP=E({props:w(B(p(),Wc)),authUrl:p(),tokenUrl:p(),scope:U(p()),prompt:w(Z([D("none"),D("consent"),D("login"),D("omit")])),pkce:w(J()),pkceMethod:w(Z([D("plain"),D("S256")])),authorizationMethod:w(z(aa)),grantType:w(Z([z(Vr),D(Vi)])),extra:w(B(p(),p()))}),Jc=E({access_token:p(),props:w(Kc),data:B(p(),zr())}),sa=E({...Ze.shape,...ZP.shape,...V(Jc,"OAUTH2").shape});var Jt=Z([oa,ia,Zc,sa,Nt]),Kr="Connection",ua={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Kr}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Kr,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Kr}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Kr}},None(){}};var K1={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 WP=E({...K.shape,...V(F(),"CUSTOM").shape,code:p()});var KP=Z([na,Jt]),ca=B(p(),KP),yU=B(p(),na);var Xc=Z([E({strategy:D("CRON"),cronExpression:p()}),E({strategy:D("NONE")})]),Xt=class{constructor(t,r,n,o,i,s,l,f,b,m,P,h,d,y,I,S,T,A,k,G,Y){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=i;this.type=s;this.handshakeConfiguration=l;this.onHandshake=f;this.renewConfiguration=b;this.onRenew=m;this.onEnable=P;this.onDisable=h;this.onStart=d;this.run=y;this.test=I;this.sampleData=S;this.testStrategy=T;this.outputSchema=A;this.aiMetadata=k;this.classification=G;this.propertyGroups=Y}static{a(this,"ITrigger")}},ee=a(e=>{switch(e.type){case"WEBHOOK":return new Xt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"POLLING":return new Xt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"MANUAL":return new Xt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"APP_WEBHOOK":return new Xt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,Ne(e.sampleData)&&Ne(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups)}},"createTrigger");var Yc="2",io="0.82.0";var la=class{constructor(t,r,n,o,i,s,l,f,b=io,m,P="",h){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=f;this.minimumSupportedRelease=b;this.maximumSupportedRelease=m;this.description=P;this.deprecated=h;this._actions={};this._triggers={};this.getContextInfo=a(()=>({version:Yc}),"getContextInfo");(!XP(b)||YP(b,io))&&(this.minimumSupportedRelease=io),i.forEach(d=>this._actions[d.name]=d),s.forEach(d=>this._triggers[d.name]=d)}static{a(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:JP(this.auth),minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},el=a(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(i=>i.type===r.type)))throw new Error("Auth properties must be unique by type");return new la(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function JP(e){if(e!==void 0)return Array.isArray(e)?e.map(Qc):Qc(e)}a(JP,"withConnectionIdentifierFlag");function Qc(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}a(Qc,"flagConnectionIdentifier");function XP(e){return/^\d+\.\d+\.\d+$/.test(e)}a(XP,"isValidSimpleSemver");function YP(e,t){let[r,n,o]=e.split(".").map(Number),[i,s,l]=t.split(".").map(Number);return r!==i?r<i:n!==s?n<s:o<l}a(YP,"isSemverLessThan");var QP=w(B(p(),B(p(),p()))),tl=E({id:w(p()),name:p(),displayName:p(),logoUrl:p(),description:p(),authors:U(p()),platformId:w(p()),directoryPath:w(p()),auth:w(Z([Jt,U(Jt)])),version:p(),categories:w(U(z(Zt))),minimumSupportedRelease:w(p()),maximumSupportedRelease:w(p()),deprecated:w(J()),i18n:QP}),ex=z(["human","ai","both"]),rl=E({description:w(p()),idempotent:w(J())}),nl=z(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var tx=z(["tabs","section","summary","builder","footer"]),ol=E({key:p(),display:tx,label:w(p()),description:w(p()),icon:w(p()),props:U(p())}),il=E({name:p(),displayName:p(),description:p(),props:ca,propertyGroups:w(U(ol)),requireAuth:J(),errorHandlingOptions:w(ji),outputSchema:w(Yn()),audience:w(ex),aiMetadata:w(rl),classification:w(nl)}),al=E({name:p(),displayName:p(),description:p(),props:ca,propertyGroups:w(U(ol)),errorHandlingOptions:w(ji),type:z(ye),sampleData:F(),handshakeConfiguration:w(Yn()),renewConfiguration:w(Xc),testStrategy:z(Zr),outputSchema:w(Yn()),aiMetadata:w(rl),classification:w(nl)}),rx=E({...tl.shape,actions:B(p(),il),triggers:B(p(),al)}),nx=E({...tl.shape,actions:be(),triggers:be(),suggestedActions:w(U(il)),suggestedTriggers:w(U(al))}),sl=E({projectUsage:be(),pieceType:z(Ht),packageType:z(Gr),platformId:w(p()),archiveId:w(p())}),vL=E({...rx.shape,...sl.shape}),_L=E({...nx.shape,...sl.shape}),bL=E({name:p(),version:p()});var ox=Le(require("path")),ix=Le(require("fs/promises"));var Yt=require("node:stream");var ao=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{a(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((i,s)=>{o.append(s,i)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var so=class{static{a(this,"DelegatingAuthenticationConverter")}constructor(t=new pa,r=new da){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},pa=class{static{a(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},da=class{static{a(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var Jr=class extends Error{constructor(r,n){let o=n.status||500,i=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:i},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=i}static{a(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function ul({error:e,requestBody:t}){return e instanceof Jr?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}a(ul,"toFailsafeOutput");var R=(s=>(s.GET="GET",s.POST="POST",s.PATCH="PATCH",s.PUT="PUT",s.DELETE="DELETE",s.HEAD="HEAD",s))(R||{});var uo=class extends ao{static{a(this,"FetchHttpClient")}constructor(t="",r=new so){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),i=this.getHeaders(t),s=t.queryParams??{};for(let[k,G]of Object.entries(s))o.append(k,G);let l=o.toString(),f=l?`${n}?${l}`:n,b=t.responseType??"json",m=t.followRedirects??!0,P=t.retries??0,{body:h,extraHeaders:d,isStream:y}=ax(t.method)?sx(t.body,i):{body:void 0,extraHeaders:{},isStream:!1},I=cx({...i,...d}),S=await ux(async()=>{let k=new AbortController,G=t.timeout&&t.timeout>0?setTimeout(()=>k.abort(),t.timeout):void 0;try{let Y={method:t.method.toString(),headers:I,body:h,redirect:m?"follow":"manual",signal:k.signal};return y&&(Y.duplex="half"),r?.dispatcher!==void 0&&(Y.dispatcher=r.dispatcher),await fetch(f,Y)}finally{G!==void 0&&clearTimeout(G)}},y?0:P),T=m?300:400;if(S.status<200||S.status>=T){let k=await cl(S,b==="stream"?"text":b),G=new Jr(t.body,{status:S.status,responseBody:k});throw console.error("[HttpClient#(sanitized error message)] Request failed:",G),G}let A=await cl(S,b);return{status:S.status,headers:lx(S.headers),body:A}}};function ax(e){return e!=="GET"&&e!=="HEAD"}a(ax,"acceptsRequestBody");function sx(e,t){if(pl(e))return{body:void 0,extraHeaders:{},isStream:!1};if(px(e)){let n=new Yt.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof Yt.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}a(sx,"serializeBody");async function cl(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return pl(e.body)?Yt.Readable.from([]):Yt.Readable.fromWeb(e.body);case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}a(cl,"parseResponseBody");async function ux(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await ll(n);continue}return o}catch(o){if(r=o,n<t){await ll(n);continue}throw o}throw r}a(ux,"sendWithRetries");function ll(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}a(ll,"backoff");function cx(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}a(cx,"normalizeHeaders");function lx(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}a(lx,"toHttpHeaders");function px(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}a(px,"isNodeFormData");function pl(e){return e==null}a(pl,"isNil");var v=new uo;var YS=Le(require("fs")),hd=Le(fd());var QS={"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 eT(e){let t=e.split(";")[0].trim().toLowerCase();return QS[t]??""}a(eT,"contentTypeToExtension");var tT=a(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),rT=a((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function yd({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:i,props:s,extraProps:l,authLocation:f="headers",classification:b="WRITE"}){return x({audience:"human",name:i||"custom_api_call",classification:b,displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:u.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:a(async({auth:m})=>({url:u.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
6
+ i.e ${rT(t,m)}/resource or /resource`,required:!0,defaultValue:m?t(m):"",...s?.url??{}})}),"props")}),method:u.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(R).map(m=>({label:m,value:m}))},...s?.method??{}}),headers:u.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...s?.headers??{}}),queryParams:u.Object({displayName:"Query Parameters",required:!0,...s?.queryParams??{}}),body_type:u.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:u.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:a(async({body_type:m})=>{if(!m)return{};let P=m,h={};switch(P){case"none":break;case"json":h.data=u.Json({displayName:"JSON Body",required:!0,...s?.body??{}});break;case"raw":h.data=u.LongText({displayName:"Raw Body",required:!0});break;case"form_data":h.data=u.Array({displayName:"Form Data",required:!0,properties:{fieldName:u.ShortText({displayName:"Field Name",required:!0}),fieldType:u.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:u.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:u.File({displayName:"File Field Value",required:!1})}});break}return h},"props")}),response_is_binary:u.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:u.Checkbox({displayName:"No Error on Failure",required:!1,...s?.failsafe??{}}),timeout:u.Number({displayName:"Timeout (in seconds)",required:!1,...s?.timeout??{}}),followRedirects:u.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:a(async m=>{let{method:P,url:h,headers:d,queryParams:y,body:I,body_type:S,failsafe:T,timeout:A,response_is_binary:k,followRedirects:G}=m.propsValue;ro(P,"Method"),ro(h,"URL");let Y=Ne(r)?{}:await r(m.auth,m.propsValue),Te=h.url,ve=Te.startsWith("http://")||Te.startsWith("https://")?Te:tT({baseUrl:t(m.auth),relativePath:Te}),ae={method:P,url:ve,headers:{...d??{},...f==="headers"||!Ne(f)?Y:{}},queryParams:{...f==="queryParams"?Y:{},...y??{}},timeout:A?A*1e3:0,followRedirects:G};if(k&&(ae.responseType="arraybuffer"),I)if(S&&S!=="none"){let te=I.data;if(S==="form_data"){let me=te,Me=new hd.default;for(let{fieldName:et,fieldType:we,textFieldValue:Ue,fileFieldValue:Oe}of me)we==="text"&&!H(Ue)?Me.append(et,Ue):we==="file"&&!H(Oe)&&Me.append(et,Oe.data,{filename:Oe?.filename});ae.body=Me,ae.headers={...ae.headers,...Me.getHeaders()}}else ae.body=te}else S||(ae.body=I);try{let te=await v.sendRequest(ae);return await nT(m.files,te.body,te.status,te.headers,k)}catch(te){if(T)return ul({error:te,requestBody:ae.body});throw te}},"run")})}a(yd,"createCustomApiCallAction");var nT=a(async(e,t,r,n,o)=>{let i;if(o&&oT(t)){let s=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=eT(s??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),i=await e.write({fileName:`output.${l}`,data:f})}else i=t;return{status:r,headers:n,body:i}},"handleBinaryResponse"),oT=a(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");function ce(e,t){return{fields:[{key:"data",label:"Data",labelKey:t,listItems:e},{key:"has_more",label:"Has More",format:"boolean"},{key:"url",label:"URL"}]}}a(ce,"listSchema");function or(e,t){return{fields:[{key:"data",label:"Results",labelKey:t,listItems:e},{key:"has_more",label:"Has More",format:"boolean"},{key:"next_page",label:"Next Page"},{key:"url",label:"URL"}]}}a(or,"searchSchema");var vd=[{key:"line1",label:"Line 1"},{key:"line2",label:"Line 2"},{key:"city",label:"City"},{key:"state",label:"State"},{key:"postal_code",label:"Postal Code"},{key:"country",label:"Country"}],iT=[{key:"brand",label:"Brand"},{key:"last4",label:"Last 4"},{key:"exp_month",label:"Expiry Month",format:"number"},{key:"exp_year",label:"Expiry Year",format:"number"},{key:"funding",label:"Funding"},{key:"country",label:"Country"},{key:"display_brand",label:"Display Brand"}],_d=[{key:"name",label:"Name"},{key:"email",label:"Email",format:"email"},{key:"phone",label:"Phone"},{key:"address",label:"Address",children:vd}],Na=[{key:"id",label:"Customer ID"},{key:"email",label:"Email",format:"email"},{key:"name",label:"Name"},{key:"description",label:"Description"},{key:"phone",label:"Phone"},{key:"address",label:"Address",children:vd},{key:"balance",label:"Balance",format:"number"},{key:"currency",label:"Currency"},{key:"delinquent",label:"Delinquent",format:"boolean"},{key:"invoice_prefix",label:"Invoice Prefix"},{key:"tax_exempt",label:"Tax Exempt"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Da=[{key:"id",label:"Product ID"},{key:"name",label:"Name"},{key:"description",label:"Description"},{key:"active",label:"Active",format:"boolean"},{key:"default_price",label:"Default Price"},{key:"images",label:"Images"},{key:"url",label:"URL",format:"url"},{key:"unit_label",label:"Unit Label"},{key:"type",label:"Type"},{key:"created",label:"Created",format:"datetime"},{key:"updated",label:"Updated",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],vo=[{key:"id",label:"Price ID"},{key:"active",label:"Active",format:"boolean"},{key:"currency",label:"Currency"},{key:"product",label:"Product"},{key:"nickname",label:"Nickname"},{key:"unit_amount",label:"Unit Amount",format:"number"},{key:"unit_amount_decimal",label:"Unit Amount Decimal"},{key:"type",label:"Type"},{key:"billing_scheme",label:"Billing Scheme"},{key:"tax_behavior",label:"Tax Behavior"},{key:"lookup_key",label:"Lookup Key"},{key:"recurring",label:"Recurring",children:[{key:"interval",label:"Interval"},{key:"interval_count",label:"Interval Count",format:"number"},{key:"trial_period_days",label:"Trial Period Days",format:"number"},{key:"usage_type",label:"Usage Type"}]},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],za=[{key:"id",label:"Coupon ID"},{key:"name",label:"Name"},{key:"amount_off",label:"Amount Off",format:"number"},{key:"percent_off",label:"Percent Off",format:"number"},{key:"currency",label:"Currency"},{key:"duration",label:"Duration"},{key:"duration_in_months",label:"Duration In Months",format:"number"},{key:"max_redemptions",label:"Max Redemptions",format:"number"},{key:"times_redeemed",label:"Times Redeemed",format:"number"},{key:"redeem_by",label:"Redeem By",format:"datetime"},{key:"valid",label:"Valid",format:"boolean"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],bd=[{key:"id",label:"Promotion Code ID"},{key:"code",label:"Code"},{key:"active",label:"Active",format:"boolean"},{key:"customer",label:"Customer"},{key:"coupon",label:"Coupon",children:za},{key:"expires_at",label:"Expires At",format:"datetime"},{key:"max_redemptions",label:"Max Redemptions",format:"number"},{key:"times_redeemed",label:"Times Redeemed",format:"number"},{key:"restrictions",label:"Restrictions",children:[{key:"first_time_transaction",label:"First Time Transaction",format:"boolean"},{key:"minimum_amount",label:"Minimum Amount",format:"number"},{key:"minimum_amount_currency",label:"Minimum Amount Currency"}]},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Pd=[{key:"id",label:"Tax Rate ID"},{key:"display_name",label:"Display Name"},{key:"description",label:"Description"},{key:"active",label:"Active",format:"boolean"},{key:"percentage",label:"Percentage",format:"number"},{key:"effective_percentage",label:"Effective Percentage",format:"number"},{key:"inclusive",label:"Inclusive",format:"boolean"},{key:"country",label:"Country"},{key:"state",label:"State"},{key:"jurisdiction",label:"Jurisdiction"},{key:"tax_type",label:"Tax Type"},{key:"rate_type",label:"Rate Type"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],xd=[{key:"id",label:"Payment Method ID"},{key:"type",label:"Type"},{key:"customer",label:"Customer"},{key:"billing_details",label:"Billing Details",children:_d},{key:"card",label:"Card",children:iT},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Ma=[{key:"id",label:"Payment Intent ID"},{key:"amount",label:"Amount",format:"number"},{key:"amount_received",label:"Amount Received",format:"number"},{key:"amount_capturable",label:"Amount Capturable",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"customer",label:"Customer"},{key:"description",label:"Description"},{key:"payment_method",label:"Payment Method"},{key:"latest_charge",label:"Latest Charge"},{key:"capture_method",label:"Capture Method"},{key:"confirmation_method",label:"Confirmation Method"},{key:"client_secret",label:"Client Secret"},{key:"receipt_email",label:"Receipt Email",format:"email"},{key:"setup_future_usage",label:"Setup Future Usage"},{key:"cancellation_reason",label:"Cancellation Reason"},{key:"canceled_at",label:"Canceled At",format:"datetime"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Ua=[{key:"id",label:"Charge ID"},{key:"amount",label:"Amount",format:"number"},{key:"amount_captured",label:"Amount Captured",format:"number"},{key:"amount_refunded",label:"Amount Refunded",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"paid",label:"Paid",format:"boolean"},{key:"captured",label:"Captured",format:"boolean"},{key:"refunded",label:"Refunded",format:"boolean"},{key:"disputed",label:"Disputed",format:"boolean"},{key:"customer",label:"Customer"},{key:"description",label:"Description"},{key:"payment_intent",label:"Payment Intent"},{key:"payment_method",label:"Payment Method"},{key:"balance_transaction",label:"Balance Transaction"},{key:"receipt_url",label:"Receipt URL",format:"url"},{key:"receipt_email",label:"Receipt Email",format:"email"},{key:"receipt_number",label:"Receipt Number"},{key:"calculated_statement_descriptor",label:"Statement Descriptor"},{key:"billing_details",label:"Billing Details",children:_d},{key:"payment_method_details",label:"Payment Method Details",children:[{key:"type",label:"Type"},{key:"card",label:"Card",children:[{key:"brand",label:"Brand"},{key:"last4",label:"Last 4"},{key:"exp_month",label:"Expiry Month",format:"number"},{key:"exp_year",label:"Expiry Year",format:"number"},{key:"funding",label:"Funding"},{key:"country",label:"Country"},{key:"network",label:"Network"}]}]},{key:"outcome",label:"Outcome",children:[{key:"network_status",label:"Network Status"},{key:"risk_level",label:"Risk Level"},{key:"risk_score",label:"Risk Score",format:"number"},{key:"seller_message",label:"Seller Message"},{key:"type",label:"Type"}]},{key:"failure_code",label:"Failure Code"},{key:"failure_message",label:"Failure Message"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],aT=[{key:"id",label:"Balance Transaction ID"},{key:"amount",label:"Amount",format:"number"},{key:"net",label:"Net",format:"number"},{key:"fee",label:"Fee",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"type",label:"Type"},{key:"description",label:"Description"},{key:"reporting_category",label:"Reporting Category"},{key:"source",label:"Source"},{key:"available_on",label:"Available On",format:"datetime"},{key:"created",label:"Created",format:"datetime"},{key:"fee_details",label:"Fee Details",labelKey:"description",listItems:[{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"type",label:"Type"},{key:"description",label:"Description"}]}],Sd=[{key:"id",label:"Refund ID"},{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"charge",label:"Charge"},{key:"payment_intent",label:"Payment Intent"},{key:"payment_method",label:"Payment Method"},{key:"balance_transaction",label:"Balance Transaction"},{key:"reason",label:"Reason"},{key:"receipt_number",label:"Receipt Number"},{key:"created",label:"Created",format:"datetime"},{key:"metadata",label:"Metadata",dynamicKey:!0}],sT=[{key:"id",label:"Invoice Item ID"},{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"customer",label:"Customer"},{key:"invoice",label:"Invoice"},{key:"description",label:"Description"},{key:"quantity",label:"Quantity",format:"number"},{key:"date",label:"Date",format:"datetime"},{key:"discountable",label:"Discountable",format:"boolean"},{key:"proration",label:"Proration",format:"boolean"},{key:"period",label:"Period",children:[{key:"start",label:"Start",format:"datetime"},{key:"end",label:"End",format:"datetime"}]},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Td=[{key:"id",label:"Credit Note ID"},{key:"number",label:"Number"},{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"type",label:"Type"},{key:"reason",label:"Reason"},{key:"customer",label:"Customer"},{key:"invoice",label:"Invoice"},{key:"memo",label:"Memo"},{key:"subtotal",label:"Subtotal",format:"number"},{key:"subtotal_excluding_tax",label:"Subtotal Excluding Tax",format:"number"},{key:"total",label:"Total",format:"number"},{key:"total_excluding_tax",label:"Total Excluding Tax",format:"number"},{key:"discount_amount",label:"Discount Amount",format:"number"},{key:"pre_payment_amount",label:"Pre-Payment Amount",format:"number"},{key:"post_payment_amount",label:"Post-Payment Amount",format:"number"},{key:"pdf",label:"PDF",format:"url"},{key:"created",label:"Created",format:"datetime"},{key:"effective_at",label:"Effective At",format:"datetime"},{key:"voided_at",label:"Voided At",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Ed=[{key:"id",label:"Checkout Session ID"},{key:"status",label:"Status"},{key:"payment_status",label:"Payment Status"},{key:"mode",label:"Mode"},{key:"url",label:"URL",format:"url"},{key:"success_url",label:"Success URL",format:"url"},{key:"cancel_url",label:"Cancel URL",format:"url"},{key:"amount_subtotal",label:"Amount Subtotal",format:"number"},{key:"amount_total",label:"Amount Total",format:"number"},{key:"currency",label:"Currency"},{key:"customer",label:"Customer"},{key:"customer_email",label:"Customer Email",format:"email"},{key:"payment_intent",label:"Payment Intent"},{key:"subscription",label:"Subscription"},{key:"invoice",label:"Invoice"},{key:"payment_link",label:"Payment Link"},{key:"client_reference_id",label:"Client Reference ID"},{key:"total_details",label:"Total Details",children:[{key:"amount_discount",label:"Amount Discount",format:"number"},{key:"amount_shipping",label:"Amount Shipping",format:"number"},{key:"amount_tax",label:"Amount Tax",format:"number"}]},{key:"expires_at",label:"Expires At",format:"datetime"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Id=[{key:"id",label:"Payment Link ID"},{key:"active",label:"Active",format:"boolean"},{key:"url",label:"URL",format:"url"},{key:"currency",label:"Currency"},{key:"allow_promotion_codes",label:"Allow Promotion Codes",format:"boolean"},{key:"billing_address_collection",label:"Billing Address Collection"},{key:"customer_creation",label:"Customer Creation"},{key:"payment_method_collection",label:"Payment Method Collection"},{key:"submit_type",label:"Submit Type"},{key:"application_fee_amount",label:"Application Fee Amount",format:"number"},{key:"application_fee_percent",label:"Application Fee Percent",format:"number"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Ad=[{key:"id",label:"Dispute ID"},{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"reason",label:"Reason"},{key:"charge",label:"Charge"},{key:"payment_intent",label:"Payment Intent"},{key:"balance_transaction",label:"Balance Transaction"},{key:"is_charge_refundable",label:"Is Charge Refundable",format:"boolean"},{key:"evidence_details",label:"Evidence Details",children:[{key:"due_by",label:"Due By",format:"datetime"},{key:"has_evidence",label:"Has Evidence",format:"boolean"},{key:"past_due",label:"Past Due",format:"boolean"},{key:"submission_count",label:"Submission Count",format:"number"}]},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],wd=[{key:"id",label:"Payout ID"},{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"status",label:"Status"},{key:"type",label:"Type"},{key:"method",label:"Method"},{key:"automatic",label:"Automatic",format:"boolean"},{key:"arrival_date",label:"Arrival Date",format:"datetime"},{key:"balance_transaction",label:"Balance Transaction"},{key:"destination",label:"Destination"},{key:"description",label:"Description"},{key:"statement_descriptor",label:"Statement Descriptor"},{key:"source_type",label:"Source Type"},{key:"failure_code",label:"Failure Code"},{key:"failure_message",label:"Failure Message"},{key:"reconciliation_status",label:"Reconciliation Status"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],uT=[{key:"id",label:"Transfer ID"},{key:"amount",label:"Amount",format:"number"},{key:"amount_reversed",label:"Amount Reversed",format:"number"},{key:"currency",label:"Currency"},{key:"description",label:"Description"},{key:"destination",label:"Destination"},{key:"source_transaction",label:"Source Transaction"},{key:"transfer_group",label:"Transfer Group"},{key:"reversed",label:"Reversed",format:"boolean"},{key:"balance_transaction",label:"Balance Transaction"},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],kd=[{key:"id",label:"Event ID"},{key:"type",label:"Type"},{key:"api_version",label:"API Version"},{key:"created",label:"Created",format:"datetime"},{key:"pending_webhooks",label:"Pending Webhooks",format:"number"},{key:"request",label:"Request",children:[{key:"id",label:"Request ID"},{key:"idempotency_key",label:"Idempotency Key"}]},{key:"data",label:"Data",children:[{key:"object",label:"Object"}]},{key:"livemode",label:"Live Mode",format:"boolean"}],Rd=[{key:"id",label:"Subscription Item ID"},{key:"quantity",label:"Quantity",format:"number"},{key:"subscription",label:"Subscription"},{key:"current_period_start",label:"Current Period Start",format:"datetime"},{key:"current_period_end",label:"Current Period End",format:"datetime"},{key:"price",label:"Price",children:vo},{key:"created",label:"Created",format:"datetime"},{key:"metadata",label:"Metadata",dynamicKey:!0}],La=[{key:"id",label:"Subscription ID"},{key:"status",label:"Status"},{key:"customer",label:"Customer"},{key:"currency",label:"Currency"},{key:"description",label:"Description"},{key:"collection_method",label:"Collection Method"},{key:"latest_invoice",label:"Latest Invoice"},{key:"default_payment_method",label:"Default Payment Method"},{key:"quantity",label:"Quantity",format:"number"},{key:"start_date",label:"Start Date",format:"datetime"},{key:"billing_cycle_anchor",label:"Billing Cycle Anchor",format:"datetime"},{key:"cancel_at",label:"Cancel At",format:"datetime"},{key:"canceled_at",label:"Canceled At",format:"datetime"},{key:"cancel_at_period_end",label:"Cancel At Period End",format:"boolean"},{key:"ended_at",label:"Ended At",format:"datetime"},{key:"trial_start",label:"Trial Start",format:"datetime"},{key:"trial_end",label:"Trial End",format:"datetime"},{key:"items",label:"Items",children:[{key:"data",label:"Data",labelKey:"id",listItems:Rd}]},{key:"created",label:"Created",format:"datetime"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],Od=[{key:"id",label:"Line ID"},{key:"description",label:"Description"},{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"},{key:"quantity",label:"Quantity",format:"number"},{key:"subtotal",label:"Subtotal",format:"number"},{key:"invoice",label:"Invoice"},{key:"period",label:"Period",children:[{key:"start",label:"Start",format:"datetime"},{key:"end",label:"End",format:"datetime"}]},{key:"discountable",label:"Discountable",format:"boolean"},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],qa=[{key:"id",label:"Invoice ID"},{key:"number",label:"Number"},{key:"status",label:"Status"},{key:"currency",label:"Currency"},{key:"customer",label:"Customer"},{key:"customer_email",label:"Customer Email",format:"email"},{key:"customer_name",label:"Customer Name"},{key:"customer_phone",label:"Customer Phone"},{key:"description",label:"Description"},{key:"collection_method",label:"Collection Method"},{key:"billing_reason",label:"Billing Reason"},{key:"amount_due",label:"Amount Due",format:"number"},{key:"amount_paid",label:"Amount Paid",format:"number"},{key:"amount_remaining",label:"Amount Remaining",format:"number"},{key:"subtotal",label:"Subtotal",format:"number"},{key:"total",label:"Total",format:"number"},{key:"attempt_count",label:"Attempt Count",format:"number"},{key:"attempted",label:"Attempted",format:"boolean"},{key:"auto_advance",label:"Auto Advance",format:"boolean"},{key:"due_date",label:"Due Date",format:"datetime"},{key:"created",label:"Created",format:"datetime"},{key:"period_start",label:"Period Start",format:"datetime"},{key:"period_end",label:"Period End",format:"datetime"},{key:"effective_at",label:"Effective At",format:"datetime"},{key:"hosted_invoice_url",label:"Hosted Invoice URL",format:"url"},{key:"invoice_pdf",label:"Invoice PDF",format:"url"},{key:"receipt_number",label:"Receipt Number"},{key:"starting_balance",label:"Starting Balance",format:"number"},{key:"ending_balance",label:"Ending Balance",format:"number"},{key:"status_transitions",label:"Status Transitions",children:[{key:"finalized_at",label:"Finalized At",format:"datetime"},{key:"paid_at",label:"Paid At",format:"datetime"},{key:"marked_uncollectible_at",label:"Marked Uncollectible At",format:"datetime"},{key:"voided_at",label:"Voided At",format:"datetime"}]},{key:"lines",label:"Lines",children:[{key:"data",label:"Data",labelKey:"description",listItems:Od}]},{key:"livemode",label:"Live Mode",format:"boolean"},{key:"metadata",label:"Metadata",dynamicKey:!0}],gd=[{key:"amount",label:"Amount",format:"number"},{key:"currency",label:"Currency"}],Re={fields:Na},bt={fields:Da},Pt={fields:vo},_o={fields:za},bo={fields:bd},Po={fields:Pd},ir={fields:xd},Ie={fields:Ma},ar={fields:Ua},xt={fields:Sd},Cd={fields:sT},ge={fields:qa},xe={fields:La},sr={fields:Td},ze={fields:Id},ur={fields:Ed},St={fields:Ad},xo={fields:wd},$d={fields:kd},Nd={fields:[{key:"available",label:"Available",labelKey:"currency",listItems:gd},{key:"pending",label:"Pending",labelKey:"currency",listItems:gd},{key:"livemode",label:"Live Mode",format:"boolean"}]},Dd=ce(Na,"email"),zd=ce(Da,"name"),Md=ce(vo,"id"),Ud=ce(za,"name"),Ld=ce(bd,"code"),qd=ce(Pd,"display_name"),jd=ce(xd,"id"),Fd=ce(Ma,"id"),Bd=ce(Ua,"id"),Gd=ce(Sd,"id"),Vd=ce(qa,"number"),Hd=ce(Od,"description"),Zd=ce(La,"id"),Wd=ce(Rd,"id"),Kd=ce(Td,"number"),Jd=ce(Id,"id"),Xd=ce(Ed,"id"),Yd=ce(Ad,"id"),Qd=ce(wd,"id"),em=ce(uT,"id"),tm=ce(kd,"type"),rm=ce(aT,"id"),nm=or(Ua,"id"),So=or(Na,"email"),om=or(qa,"number"),im=or(Ma,"id"),am=or(vo,"id"),sm=or(Da,"name"),To={fields:[{key:"success",label:"Success",format:"boolean"},{key:"count",label:"Count",format:"number"},{key:"total_fetched",label:"Total Fetched",format:"number"},{key:"requests_made",label:"Requests Made",format:"number"},{key:"has_more_available",label:"Has More Available",format:"boolean"},{key:"subscriptions",label:"Subscriptions",labelKey:"id",listItems:La}]};var um=x({name:"create_customer",classification:"WRITE",auth:g,displayName:"Create Customer",description:"Create a customer in stripe",audience:"human",aiMetadata:{description:"Creates a new customer record in Stripe from an email and name, with optional contact and address fields. Use when onboarding a new payer before charging, invoicing, or subscribing them. Not idempotent: each call creates a distinct customer even with identical input.",idempotent:!1},props:{email:u.ShortText({displayName:"Email",description:void 0,required:!0}),name:u.ShortText({displayName:"Name",required:!0}),description:u.LongText({displayName:"Description",required:!1}),phone:u.ShortText({displayName:"Phone",required:!1}),line1:u.ShortText({displayName:"Address Line 1",required:!1}),postal_code:u.ShortText({displayName:"Postal Code",required:!1}),city:u.ShortText({displayName:"City",required:!1}),state:u.ShortText({displayName:"State",required:!1}),country:u.ShortText({displayName:"Country",required:!1})},outputSchema:Re,async run(e){let t={email:e.propsValue.email,name:e.propsValue.name,description:e.propsValue.description,phone:e.propsValue.phone,address:{line1:e.propsValue.line1,postal_code:e.propsValue.postal_code,city:e.propsValue.city,state:e.propsValue.state,country:e.propsValue.country}};return(await v.sendRequest({method:"POST",url:"https://api.stripe.com/v1/customers",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},body:{email:t.email,name:t.name,description:t.description,phone:t.phone,address:t.address}})).body}});var cm=x({name:"create_invoice",classification:"WRITE",auth:g,displayName:"Create Invoice",description:"Create an Invoice in stripe",audience:"human",aiMetadata:{description:"Creates a draft invoice in Stripe for an existing customer in the given currency. Use to bill a customer for pending invoice items. Requires a valid Stripe customer ID; not idempotent, as each call creates a separate invoice.",idempotent:!1},props:{customer_id:u.ShortText({displayName:"Customer ID",description:"Stripe Customer ID",required:!0}),currency:u.ShortText({displayName:"Currency",description:"Currency for the invoice (e.g., USD)",required:!0}),description:u.LongText({displayName:"Description",description:"Description for the invoice",required:!1})},outputSchema:ge,async run(e){let t={customer:e.propsValue.customer_id,currency:e.propsValue.currency,description:e.propsValue.description};return(await v.sendRequest({method:"POST",url:"https://api.stripe.com/v1/invoices",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},body:{customer:t.customer,currency:t.currency,description:t.description}})).body}});var lm=x({name:"retrieve_customer",classification:"READ",auth:g,displayName:"Retrieve Customer",description:"Retrieve a customer in stripe by id",audience:"human",aiMetadata:{description:"Fetches the full details of a single Stripe customer by its customer ID (e.g., cus_...). Use when you already have the exact ID and need the current record; for lookup by email use Search Customer instead. Read-only and idempotent.",idempotent:!0},props:{id:u.ShortText({displayName:"ID",description:void 0,required:!0})},outputSchema:Re,async run(e){let t={id:e.propsValue.id};return(await v.sendRequest({method:"GET",url:`https://api.stripe.com/v1/customers/${t.id}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var vr=Le(require("crypto"),1),ys=require("events");var Io=Le(require("crypto"),1);var Tt=class{static{a(this,"CryptoProvider")}computeHMACSignature(t,r){throw new Error("computeHMACSignature not implemented.")}computeHMACSignatureAsync(t,r){throw new Error("computeHMACSignatureAsync not implemented.")}computeSHA256Async(t){throw new Error("computeSHA256 not implemented.")}},cr=class extends Error{static{a(this,"CryptoProviderOnlySupportsAsyncError")}};var Eo=class extends Tt{static{a(this,"NodeCryptoProvider")}computeHMACSignature(t,r){return Io.createHmac("sha256",r).update(t,"utf8").digest("hex")}async computeHMACSignatureAsync(t,r){return await this.computeHMACSignature(t,r)}async computeSHA256Async(t){return new Uint8Array(await Io.createHash("sha256").update(t).digest())}};var Fa=Le(require("http"),1),Ba=Le(require("https"),1);var Ee=class e{static{a(this,"HttpClient")}getClientName(){throw new Error("getClientName not implemented.")}makeRequest(t,r,n,o,i,s,l,f){throw new Error("makeRequest not implemented.")}static makeTimeoutError(){let t=new TypeError(e.TIMEOUT_ERROR_CODE);return t.code=e.TIMEOUT_ERROR_CODE,t}};Ee.CONNECTION_CLOSED_ERROR_CODES=["ECONNRESET","EPIPE"];Ee.TIMEOUT_ERROR_CODE="ETIMEDOUT";var Et=class{static{a(this,"HttpClientResponse")}constructor(t,r){this._statusCode=t,this._headers=r}getStatusCode(){return this._statusCode}getHeaders(){return this._headers}getRawResponse(){throw new Error("getRawResponse not implemented.")}toStream(t){throw new Error("toStream not implemented.")}toJSON(){throw new Error("toJSON not implemented.")}};var pm=Fa.default||Fa,dm=Ba.default||Ba,cT=new pm.Agent({keepAlive:!0}),lT=new dm.Agent({keepAlive:!0}),tn=class extends Ee{static{a(this,"NodeHttpClient")}constructor(t){super(),this._agent=t}getClientName(){return"node"}makeRequest(t,r,n,o,i,s,l,f){let b=l==="http",m=this._agent;return m||(m=b?cT:lT),new Promise((h,d)=>{let y=(b?pm:dm).request({host:t,port:r,path:n,method:o,agent:m,headers:i,ciphers:"DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:!MD5"});y.setTimeout(f,()=>{y.destroy(Ee.makeTimeoutError())}),y.on("response",I=>{h(new ja(I))}),y.on("error",I=>{d(I)}),y.once("socket",I=>{I.connecting?I.once(b?"connect":"secureConnect",()=>{y.write(s),y.end()}):(y.write(s),y.end())})})}},ja=class extends Et{static{a(this,"NodeHttpClientResponse")}constructor(t){super(t.statusCode,t.headers||{}),this._res=t}getRawResponse(){return this._res}toStream(t){return this._res.once("end",()=>t()),this._res}toJSON(){return new Promise((t,r)=>{let n="";this._res.setEncoding("utf8"),this._res.on("data",o=>{n+=o}),this._res.once("end",()=>{try{t(JSON.parse(n))}catch(o){r(o)}})})}};var of=Le(nf(),1);var ds=["apiKey","idempotencyKey","stripeAccount","apiVersion","maxNetworkRetries","timeout","host","authenticator","stripeContext","additionalHeaders","streaming"];function af(e){return e&&typeof e=="object"&&ds.some(t=>Object.prototype.hasOwnProperty.call(e,t))}a(af,"isOptionsHash");function wt(e,t){return of.stringify(e,{serializeDate:a(r=>Math.floor(r.getTime()/1e3).toString(),"serializeDate"),arrayFormat:t=="v2"?"repeat":"indices"}).replace(/%5B/g,"[").replace(/%5D/g,"]")}a(wt,"queryStringifyRequestData");var Uo=(()=>{let e={"\n":"\\n",'"':'\\"',"\u2028":"\\u2028","\u2029":"\\u2029"};return t=>{let r=t.replace(/["\n\r\u2028\u2029]/g,n=>e[n]);return n=>r.replace(/\{([\s\S]+?)\}/g,(o,i)=>{let s=n[i];return GE(s)?encodeURIComponent(s):""})}})();function GE(e){return["number","string","boolean"].includes(typeof e)}a(GE,"isValidEncodeUriComponentType");function sf(e){let t=e.match(/\{\w+\}/g);return t?t.map(r=>r.replace(/[{}]/g,"")):[]}a(sf,"extractUrlParams");function mr(e){if(!Array.isArray(e)||!e[0]||typeof e[0]!="object")return{};if(!af(e[0]))return e.shift();let t=Object.keys(e[0]),r=t.filter(n=>ds.includes(n));return r.length>0&&r.length!==t.length&&mn(`Options found in arguments (${r.join(", ")}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.`),{}}a(mr,"getDataFromArgs");function Lo(e){let t={host:null,headers:{},settings:{},streaming:!1};if(e.length>0){let r=e[e.length-1];if(typeof r=="string")t.authenticator=Mo(e.pop());else if(af(r)){let n=Object.assign({},e.pop()),o=Object.keys(n).filter(i=>!ds.includes(i));if(o.length&&mn(`Invalid options found (${o.join(", ")}); ignoring.`),n.apiKey&&(t.authenticator=Mo(n.apiKey)),n.idempotencyKey&&(t.headers["Idempotency-Key"]=n.idempotencyKey),n.stripeAccount&&(t.headers["Stripe-Account"]=n.stripeAccount),n.stripeContext){if(t.headers["Stripe-Account"])throw new Error("Can't specify both stripeAccount and stripeContext.");t.headers["Stripe-Context"]=n.stripeContext}if(n.apiVersion&&(t.headers["Stripe-Version"]=n.apiVersion),Number.isInteger(n.maxNetworkRetries)&&(t.settings.maxNetworkRetries=n.maxNetworkRetries),Number.isInteger(n.timeout)&&(t.settings.timeout=n.timeout),n.host&&(t.host=n.host),n.authenticator){if(n.apiKey)throw new Error("Can't specify both apiKey and authenticator.");if(typeof n.authenticator!="function")throw new Error("The authenticator must be a function receiving a request as the first parameter.");t.authenticator=n.authenticator}n.additionalHeaders&&(t.headers=n.additionalHeaders),n.streaming&&(t.streaming=!0)}}return t}a(Lo,"getOptionsFromArgs");function uf(e){let t=this,r=Object.prototype.hasOwnProperty.call(e,"constructor")?e.constructor:function(...n){t.apply(this,n)};return Object.assign(r,t),r.prototype=Object.create(t.prototype),Object.assign(r.prototype,e),r}a(uf,"protoExtend");function qo(e){if(typeof e!="object")throw new Error("Argument must be an object");return Object.keys(e).reduce((t,r)=>(e[r]!=null&&(t[r]=e[r]),t),{})}a(qo,"removeNullish");function cf(e){return e&&typeof e=="object"?Object.keys(e).reduce((t,r)=>(t[VE(r)]=e[r],t),{}):e}a(cf,"normalizeHeaders");function VE(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()).join("-")}a(VE,"normalizeHeader");function dn(e,t){return t?e.then(r=>{setTimeout(()=>{t(null,r)},0)},r=>{setTimeout(()=>{t(r,null)},0)}):e}a(dn,"callbackifyPromiseWithTimeout");function lf(e){return e==="OAuth"?"oauth":e[0].toLowerCase()+e.substring(1)}a(lf,"pascalToCamelCase");function mn(e){return typeof process.emitWarning!="function"?console.warn(`Stripe: ${e}`):process.emitWarning(e,"Stripe")}a(mn,"emitWarning");function HE(e){let t=typeof e;return(t==="function"||t==="object")&&!!e}a(HE,"isObject");function pf(e){let t={},r=a((n,o)=>{Object.entries(n).forEach(([i,s])=>{let l=o?`${o}[${i}]`:i;if(HE(s)){if(!(s instanceof Uint8Array)&&!Object.prototype.hasOwnProperty.call(s,"data"))return r(s,l);t[l]=s}else t[l]=String(s)})},"step");return r(e,null),t}a(pf,"flattenAndStringify");function jo(e,t,r){if(!Number.isInteger(t)){if(r!==void 0)return r;throw new Error(`${e} must be an integer`)}return t}a(jo,"validateInteger");function df(){return typeof process>"u"?{}:{lang_version:process.version,platform:process.platform}}a(df,"determineProcessUserAgentProperties");function Mo(e){let t=a(r=>(r.headers.Authorization="Bearer "+e,Promise.resolve()),"authenticator");return t._apiKey=e,t}a(Mo,"createApiKeyAuthenticator");function mf(e){let t=e.reduce((o,i)=>o+i.length,0),r=new Uint8Array(t),n=0;return e.forEach(o=>{r.set(o,n),n+=o.length}),r}a(mf,"concat");function ZE(e,t){return this[e]instanceof Date?Math.floor(this[e].getTime()/1e3).toString():t}a(ZE,"dateTimeReplacer");function ff(e){return JSON.stringify(e,ZE)}a(ff,"jsonStringifyRequestData");function fr(e){return e&&e.startsWith("/v2")?"v2":"v1"}a(fr,"getAPIMode");function Fo(e){return Array.isArray(e)?e.join(", "):String(e)}a(Fo,"parseHttpHeaderAsString");function hf(e){let t=Array.isArray(e)?e[0]:e;return Number(t)}a(hf,"parseHttpHeaderAsNumber");function yf(e){return Object.entries(e).map(([t,r])=>[t,Fo(r)])}a(yf,"parseHeadersForFetch");var Bo=class e extends Ee{static{a(this,"FetchHttpClient")}constructor(t){if(super(),!t){if(!globalThis.fetch)throw new Error("fetch() function not provided and is not defined in the global scope. You must provide a fetch implementation.");t=globalThis.fetch}globalThis.AbortController?this._fetchFn=e.makeFetchWithAbortTimeout(t):this._fetchFn=e.makeFetchWithRaceTimeout(t)}static makeFetchWithRaceTimeout(t){return(r,n,o)=>{let i,s=new Promise((f,b)=>{i=setTimeout(()=>{i=null,b(Ee.makeTimeoutError())},o)}),l=t(r,n);return Promise.race([l,s]).finally(()=>{i&&clearTimeout(i)})}}static makeFetchWithAbortTimeout(t){return async(r,n,o)=>{let i=new AbortController,s=setTimeout(()=>{s=null,i.abort(Ee.makeTimeoutError())},o);try{return await t(r,Object.assign(Object.assign({},n),{signal:i.signal}))}catch(l){throw l.name==="AbortError"?Ee.makeTimeoutError():l}finally{s&&clearTimeout(s)}}}getClientName(){return"fetch"}async makeRequest(t,r,n,o,i,s,l,f){let b=l==="http",m=new URL(n,`${b?"http":"https"}://${t}`);m.port=r;let P=o=="POST"||o=="PUT"||o=="PATCH",h=s||(P?"":void 0),d=await this._fetchFn(m.toString(),{method:o,headers:yf(i),body:typeof h=="object"?JSON.stringify(h):h},f);return new ms(d)}},ms=class e extends Et{static{a(this,"FetchHttpClientResponse")}constructor(t){super(t.status,e._transformHeadersToObject(t.headers)),this._res=t}getRawResponse(){return this._res}toStream(t){return t(),this._res.body}toJSON(){return this._res.json()}static _transformHeadersToObject(t){let r={};for(let n of t){if(!Array.isArray(n)||n.length!=2)throw new Error("Response objects produced by the fetch function given to FetchHttpClient do not have an iterable headers map. Response#headers should be an iterable object.");r[n[0]]=n[1]}return r}};var Go=class extends Tt{static{a(this,"SubtleCryptoProvider")}constructor(t){super(),this.subtleCrypto=t||crypto.subtle}computeHMACSignature(t,r){throw new cr("SubtleCryptoProvider cannot be used in a synchronous context.")}async computeHMACSignatureAsync(t,r){let n=new TextEncoder,o=await this.subtleCrypto.importKey("raw",n.encode(r),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),i=await this.subtleCrypto.sign("hmac",o,n.encode(t)),s=new Uint8Array(i),l=new Array(s.length);for(let f=0;f<s.length;f++)l[f]=fs[s[f]];return l.join("")}async computeSHA256Async(t){return new Uint8Array(await this.subtleCrypto.digest("SHA-256",t))}},fs=new Array(256);for(let e=0;e<fs.length;e++)fs[e]=e.toString(16).padStart(2,"0");var Vo=class{static{a(this,"PlatformFunctions")}constructor(){this._fetchFn=null,this._agent=null}getUname(){throw new Error("getUname not implemented.")}uuid4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})}secureCompare(t,r){if(t.length!==r.length)return!1;let n=t.length,o=0;for(let i=0;i<n;++i)o|=t.charCodeAt(i)^r.charCodeAt(i);return o===0}createEmitter(){throw new Error("createEmitter not implemented.")}tryBufferData(t){throw new Error("tryBufferData not implemented.")}createNodeHttpClient(t){throw new Error("createNodeHttpClient not implemented.")}createFetchHttpClient(t){return new Bo(t)}createDefaultHttpClient(){throw new Error("createDefaultHttpClient not implemented.")}createNodeCryptoProvider(){throw new Error("createNodeCryptoProvider not implemented.")}createSubtleCryptoProvider(t){return new Go(t)}createDefaultCryptoProvider(){throw new Error("createDefaultCryptoProvider not implemented.")}};var Xo={};Mn(Xo,{StripeAPIError:()=>hr,StripeAuthenticationError:()=>yr,StripeCardError:()=>Ho,StripeConnectionError:()=>yn,StripeError:()=>pe,StripeIdempotencyError:()=>Zo,StripeInvalidGrantError:()=>Wo,StripeInvalidRequestError:()=>fn,StripePermissionError:()=>hn,StripeRateLimitError:()=>gr,StripeSignatureVerificationError:()=>Fe,StripeUnknownError:()=>Ko,TemporarySessionExpiredError:()=>Jo,generateV1Error:()=>gn,generateV2Error:()=>hs});var gn=a(e=>{switch(e.type){case"card_error":return new Ho(e);case"invalid_request_error":return new fn(e);case"api_error":return new hr(e);case"authentication_error":return new yr(e);case"rate_limit_error":return new gr(e);case"idempotency_error":return new Zo(e);case"invalid_grant":return new Wo(e);default:return new Ko(e)}},"generateV1Error"),hs=a(e=>e.type==="temporary_session_expired"?new Jo(e):e.code==="invalid_fields"?new fn(e):gn(e),"generateV2Error"),pe=class extends Error{static{a(this,"StripeError")}constructor(t={},r=null){var n;super(t.message),this.type=r||this.constructor.name,this.raw=t,this.rawType=t.type,this.code=t.code,this.doc_url=t.doc_url,this.param=t.param,this.detail=t.detail,this.headers=t.headers,this.requestId=t.requestId,this.statusCode=t.statusCode,this.message=(n=t.message)!==null&&n!==void 0?n:"",this.userMessage=t.user_message,this.charge=t.charge,this.decline_code=t.decline_code,this.payment_intent=t.payment_intent,this.payment_method=t.payment_method,this.payment_method_type=t.payment_method_type,this.setup_intent=t.setup_intent,this.source=t.source}};pe.generate=gn;var Ho=class extends pe{static{a(this,"StripeCardError")}constructor(t={}){super(t,"StripeCardError")}},fn=class extends pe{static{a(this,"StripeInvalidRequestError")}constructor(t={}){super(t,"StripeInvalidRequestError")}},hr=class extends pe{static{a(this,"StripeAPIError")}constructor(t={}){super(t,"StripeAPIError")}},yr=class extends pe{static{a(this,"StripeAuthenticationError")}constructor(t={}){super(t,"StripeAuthenticationError")}},hn=class extends pe{static{a(this,"StripePermissionError")}constructor(t={}){super(t,"StripePermissionError")}},gr=class extends pe{static{a(this,"StripeRateLimitError")}constructor(t={}){super(t,"StripeRateLimitError")}},yn=class extends pe{static{a(this,"StripeConnectionError")}constructor(t={}){super(t,"StripeConnectionError")}},Fe=class extends pe{static{a(this,"StripeSignatureVerificationError")}constructor(t,r,n={}){super(n,"StripeSignatureVerificationError"),this.header=t,this.payload=r}},Zo=class extends pe{static{a(this,"StripeIdempotencyError")}constructor(t={}){super(t,"StripeIdempotencyError")}},Wo=class extends pe{static{a(this,"StripeInvalidGrantError")}constructor(t={}){super(t,"StripeInvalidGrantError")}},Ko=class extends pe{static{a(this,"StripeUnknownError")}constructor(t={}){super(t,"StripeUnknownError")}},Jo=class extends pe{static{a(this,"TemporarySessionExpiredError")}constructor(t={}){super(t,"TemporarySessionExpiredError")}};var gf=require("child_process");var gs=class extends pe{static{a(this,"StreamProcessingError")}},Yo=class extends Vo{static{a(this,"NodePlatformFunctions")}constructor(){super(),this._exec=gf.exec,this._UNAME_CACHE=null}uuid4(){return vr.randomUUID?vr.randomUUID():super.uuid4()}getUname(){return this._UNAME_CACHE||(this._UNAME_CACHE=new Promise((t,r)=>{try{this._exec("uname -a",(n,o)=>{if(n)return t(null);t(o)})}catch{t(null)}})),this._UNAME_CACHE}secureCompare(t,r){if(!t||!r)throw new Error("secureCompare must receive two arguments");if(t.length!==r.length)return!1;if(vr.timingSafeEqual){let n=new TextEncoder,o=n.encode(t),i=n.encode(r);return vr.timingSafeEqual(o,i)}return super.secureCompare(t,r)}createEmitter(){return new ys.EventEmitter}tryBufferData(t){if(!(t.file.data instanceof ys.EventEmitter))return Promise.resolve(t);let r=[];return new Promise((n,o)=>{t.file.data.on("data",i=>{r.push(i)}).once("end",()=>{let i=Object.assign({},t);i.file.data=mf(r),n(i)}).on("error",i=>{o(new gs({message:"An error occurred while attempting to process the file for upload.",detail:i}))})})}createNodeHttpClient(t){return new tn(t)}createDefaultHttpClient(){return new tn}createNodeCryptoProvider(){return new Eo}createDefaultCryptoProvider(){return this.createNodeCryptoProvider()}};var WE=60,Qo=class e{static{a(this,"RequestSender")}constructor(t,r){this._stripe=t,this._maxBufferedRequestMetric=r}_addHeadersDirectlyToObject(t,r){t.requestId=r["request-id"],t.stripeAccount=t.stripeAccount||r["stripe-account"],t.apiVersion=t.apiVersion||r["stripe-version"],t.idempotencyKey=t.idempotencyKey||r["idempotency-key"]}_makeResponseEvent(t,r,n){let o=Date.now(),i=o-t.request_start_time;return qo({api_version:n["stripe-version"],account:n["stripe-account"],idempotency_key:n["idempotency-key"],method:t.method,path:t.path,status:r,request_id:this._getRequestId(n),elapsed:i,request_start_time:t.request_start_time,request_end_time:o})}_getRequestId(t){return t["request-id"]}_streamingResponseHandler(t,r,n){return o=>{let i=o.getHeaders(),s=a(()=>{let f=this._makeResponseEvent(t,o.getStatusCode(),i);this._stripe._emitter.emit("response",f),this._recordRequestMetrics(this._getRequestId(i),f.elapsed,r)},"streamCompleteCallback"),l=o.toStream(s);return this._addHeadersDirectlyToObject(l,i),n(null,l)}}_jsonResponseHandler(t,r,n,o){return i=>{let s=i.getHeaders(),l=this._getRequestId(s),f=i.getStatusCode(),b=this._makeResponseEvent(t,f,s);this._stripe._emitter.emit("response",b),i.toJSON().then(m=>{if(m.error){let P;throw typeof m.error=="string"&&(m.error={type:m.error,message:m.error_description}),m.error.headers=s,m.error.statusCode=f,m.error.requestId=l,f===401?P=new yr(m.error):f===403?P=new hn(m.error):f===429?P=new gr(m.error):r==="v2"?P=hs(m.error):P=gn(m.error),P}return m},m=>{throw new hr({message:"Invalid JSON received from the Stripe API",exception:m,requestId:s["request-id"]})}).then(m=>{this._recordRequestMetrics(l,b.elapsed,n);let P=i.getRawResponse();this._addHeadersDirectlyToObject(P,s),Object.defineProperty(m,"lastResponse",{enumerable:!1,writable:!1,value:P}),o(null,m)},m=>o(m,null))}}static _generateConnectionErrorMessage(t){return`An error occurred with our connection to Stripe.${t>0?` Request was retried ${t} times.`:""}`}static _shouldRetry(t,r,n,o){return o&&r===0&&Ee.CONNECTION_CLOSED_ERROR_CODES.includes(o.code)?!0:r>=n?!1:t?t.getHeaders()["stripe-should-retry"]==="false"?!1:t.getHeaders()["stripe-should-retry"]==="true"||t.getStatusCode()===409||t.getStatusCode()>=500:!0}_getSleepTimeInMS(t,r=null){let n=this._stripe.getInitialNetworkRetryDelay(),o=this._stripe.getMaxNetworkRetryDelay(),i=Math.min(n*Math.pow(2,t-1),o);return i*=.5*(1+Math.random()),i=Math.max(n,i),Number.isInteger(r)&&r<=WE&&(i=Math.max(i,r)),i*1e3}_getMaxNetworkRetries(t={}){return t.maxNetworkRetries!==void 0&&Number.isInteger(t.maxNetworkRetries)?t.maxNetworkRetries:this._stripe.getMaxNetworkRetries()}_defaultIdempotencyKey(t,r,n){let o=this._getMaxNetworkRetries(r),i=a(()=>`stripe-node-retry-${this._stripe._platformFunctions.uuid4()}`,"genKey");if(n==="v2"){if(t==="POST"||t==="DELETE")return i()}else if(n==="v1"&&t==="POST"&&o>0)return i();return null}_makeHeaders({contentType:t,contentLength:r,apiVersion:n,clientUserAgent:o,method:i,userSuppliedHeaders:s,userSuppliedSettings:l,stripeAccount:f,stripeContext:b,apiMode:m}){let P={Accept:"application/json","Content-Type":t,"User-Agent":this._getUserAgentString(m),"X-Stripe-Client-User-Agent":o,"X-Stripe-Client-Telemetry":this._getTelemetryHeader(),"Stripe-Version":n,"Stripe-Account":f,"Stripe-Context":b,"Idempotency-Key":this._defaultIdempotencyKey(i,l,m)},h=i=="POST"||i=="PUT"||i=="PATCH";return(h||r)&&(h||mn(`${i} method had non-zero contentLength but no payload is expected for this verb`),P["Content-Length"]=r),Object.assign(qo(P),cf(s))}_getUserAgentString(t){let r=this._stripe.getConstant("PACKAGE_VERSION"),n=this._stripe._appInfo?this._stripe.getAppInfoAsString():"";return`Stripe/${t} NodeBindings/${r} ${n}`.trim()}_getTelemetryHeader(){if(this._stripe.getTelemetryEnabled()&&this._stripe._prevRequestMetrics.length>0){let t=this._stripe._prevRequestMetrics.shift();return JSON.stringify({last_request_metrics:t})}}_recordRequestMetrics(t,r,n){if(this._stripe.getTelemetryEnabled()&&t)if(this._stripe._prevRequestMetrics.length>this._maxBufferedRequestMetric)mn("Request metrics buffer is full, dropping telemetry message.");else{let o={request_id:t,request_duration_ms:r};n&&n.length>0&&(o.usage=n),this._stripe._prevRequestMetrics.push(o)}}_rawRequest(t,r,n,o){return new Promise((s,l)=>{let f;try{let d=t.toUpperCase();if(d!=="POST"&&n&&Object.keys(n).length!==0)throw new Error("rawRequest only supports params on POST requests. Please pass null and add your parameters to path.");let y=[].slice.call([n,o]),I=mr(y),S=d==="POST"?Object.assign({},I):null,T=Lo(y),A=T.headers,k=T.authenticator;f={requestMethod:d,requestPath:r,bodyData:S,queryData:{},authenticator:k,headers:A,host:T.host,streaming:!!T.streaming,settings:{},usage:["raw_request"]}}catch(d){l(d);return}function b(d,y){d?l(d):s(y)}a(b,"requestCallback");let{headers:m,settings:P}=f,h=f.authenticator;this._request(f.requestMethod,f.host,r,f.bodyData,h,{headers:m,settings:P,streaming:f.streaming},f.usage,b)})}_request(t,r,n,o,i,s,l=[],f,b=null){var m;let P;i=(m=i??this._stripe._authenticator)!==null&&m!==void 0?m:null;let h=fr(n),d=a((S,T,A,k,G)=>setTimeout(S,this._getSleepTimeInMS(k,G),T,A,k+1),"retryRequest"),y=a((S,T,A)=>{let k=s.settings&&s.settings.timeout&&Number.isInteger(s.settings.timeout)&&s.settings.timeout>=0?s.settings.timeout:this._stripe.getApiField("timeout"),G={host:r||this._stripe.getApiField("host"),port:this._stripe.getApiField("port"),path:n,method:t,headers:Object.assign({},T),body:P,protocol:this._stripe.getApiField("protocol")};i(G).then(()=>{let Y=this._stripe.getApiField("httpClient").makeRequest(G.host,G.port,G.path,G.method,G.headers,G.body,G.protocol,k),Te=Date.now(),ve=qo({api_version:S,account:Fo(T["Stripe-Account"]),idempotency_key:Fo(T["Idempotency-Key"]),method:t,path:n,request_start_time:Te}),ae=A||0,te=this._getMaxNetworkRetries(s.settings||{});this._stripe._emitter.emit("request",ve),Y.then(me=>e._shouldRetry(me,ae,te)?d(y,S,T,ae,hf(me.getHeaders()["retry-after"])):s.streaming&&me.getStatusCode()<400?this._streamingResponseHandler(ve,l,f)(me):this._jsonResponseHandler(ve,h,l,f)(me)).catch(me=>{if(e._shouldRetry(null,ae,te,me))return d(y,S,T,ae,null);{let Me=me.code&&me.code===Ee.TIMEOUT_ERROR_CODE;return f(new yn({message:Me?`Request aborted due to timeout being reached (${k}ms)`:e._generateConnectionErrorMessage(ae),detail:me}))}})}).catch(Y=>{throw new pe({message:"Unable to authenticate the request",exception:Y})})},"makeRequest"),I=a((S,T)=>{if(S)return f(S);P=T,this._stripe.getClientUserAgent(A=>{let k=this._stripe.getApiField("version"),G=this._makeHeaders({contentType:h=="v2"?"application/json":"application/x-www-form-urlencoded",contentLength:P.length,apiVersion:k,clientUserAgent:A,method:t,userSuppliedHeaders:s.headers,userSuppliedSettings:s.settings,stripeAccount:h=="v2"?null:this._stripe.getApiField("stripeAccount"),stripeContext:h=="v2"?this._stripe.getApiField("stripeContext"):null,apiMode:h});y(k,G,0)})},"prepareAndMakeRequest");if(b)b(t,o,s.headers,I);else{let S;h=="v2"?S=o?ff(o):"":S=wt(o||{},h),I(null,S)}}};var ei=class{static{a(this,"V1Iterator")}constructor(t,r,n,o){this.index=0,this.pagePromise=t,this.promiseCache={currentPromise:null},this.requestArgs=r,this.spec=n,this.stripeResource=o}async iterate(t){if(!(t&&t.data&&typeof t.data.length=="number"))throw Error("Unexpected: Stripe API response does not have a well-formed `data` array.");let r=_f(this.requestArgs);if(this.index<t.data.length){let n=r?t.data.length-1-this.index:this.index,o=t.data[n];return this.index+=1,{value:o,done:!1}}else if(t.has_more){this.index=0,this.pagePromise=this.getNextPage(t);let n=await this.pagePromise;return this.iterate(n)}return{done:!0,value:void 0}}getNextPage(t){throw new Error("Unimplemented")}async _next(){return this.iterate(await this.pagePromise)}next(){if(this.promiseCache.currentPromise)return this.promiseCache.currentPromise;let t=(async()=>{let r=await this._next();return this.promiseCache.currentPromise=null,r})();return this.promiseCache.currentPromise=t,t}},_s=class extends ei{static{a(this,"V1ListIterator")}getNextPage(t){let r=_f(this.requestArgs),n=YE(t,r);return this.stripeResource._makeRequest(this.requestArgs,this.spec,{[r?"ending_before":"starting_after"]:n})}},bs=class extends ei{static{a(this,"V1SearchIterator")}getNextPage(t){if(!t.next_page)throw Error("Unexpected: Stripe API response does not have a well-formed `next_page` field, but `has_more` was true.");return this.stripeResource._makeRequest(this.requestArgs,this.spec,{page:t.next_page})}},Ps=class{static{a(this,"V2ListIterator")}constructor(t,r,n,o){this.currentPageIterator=(async()=>(await t).data[Symbol.iterator]())(),this.nextPageUrl=(async()=>(await t).next_page_url||null)(),this.requestArgs=r,this.spec=n,this.stripeResource=o}async turnPage(){let t=await this.nextPageUrl;if(!t)return null;this.spec.fullPath=t;let r=await this.stripeResource._makeRequest([],this.spec,{});return this.nextPageUrl=Promise.resolve(r.next_page_url),this.currentPageIterator=Promise.resolve(r.data[Symbol.iterator]()),this.currentPageIterator}async next(){{let n=(await this.currentPageIterator).next();if(!n.done)return{done:!1,value:n.value}}let t=await this.turnPage();if(!t)return{done:!0,value:void 0};let r=t.next();return r.done?{done:!0,value:void 0}:{done:!1,value:r.value}}},vf=a((e,t,r,n)=>{let o=fr(r.fullPath||r.path);return o!=="v2"&&r.methodType==="search"?vs(new bs(n,t,r,e)):o!=="v2"&&r.methodType==="list"?vs(new _s(n,t,r,e)):o==="v2"&&r.methodType==="list"?vs(new Ps(n,t,r,e)):null},"makeAutoPaginationMethods"),vs=a(e=>{let t=QE((...o)=>e.next(...o)),r=eI(t),n={autoPagingEach:t,autoPagingToArray:r,next:a(()=>e.next(),"next"),return:a(()=>({}),"return"),[KE()]:()=>n};return n},"makeAutoPaginationMethodsFromIterator");function KE(){return typeof Symbol<"u"&&Symbol.asyncIterator?Symbol.asyncIterator:"@@asyncIterator"}a(KE,"getAsyncIteratorSymbol");function JE(e){if(e.length<2)return null;let t=e[1];if(typeof t!="function")throw Error(`The second argument to autoPagingEach, if present, must be a callback function; received ${typeof t}`);return t}a(JE,"getDoneCallback");function XE(e){if(e.length===0)return;let t=e[0];if(typeof t!="function")throw Error(`The first argument to autoPagingEach, if present, must be a callback function; received ${typeof t}`);if(t.length===2)return t;if(t.length>2)throw Error(`The \`onItem\` callback function passed to autoPagingEach must accept at most two arguments; got ${t}`);return a(function(n,o){let i=t(n);o(i)},"_onItem")}a(XE,"getItemCallback");function YE(e,t){let r=t?0:e.data.length-1,n=e.data[r],o=n&&n.id;if(!o)throw Error("Unexpected: No `id` found on the last item while auto-paging a list.");return o}a(YE,"getLastId");function QE(e){return a(function(){let r=[].slice.call(arguments),n=XE(r),o=JE(r);if(r.length>2)throw Error(`autoPagingEach takes up to two arguments; received ${r}`);let i=tI(e,n);return dn(i,o)},"autoPagingEach")}a(QE,"makeAutoPagingEach");function eI(e){return a(function(r,n){let o=r&&r.limit;if(!o)throw Error("You must pass a `limit` option to autoPagingToArray, e.g., `autoPagingToArray({limit: 1000});`.");if(o>1e4)throw Error("You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.");let i=new Promise((s,l)=>{let f=[];e(b=>{if(f.push(b),f.length>=o)return!1}).then(()=>{s(f)}).catch(l)});return dn(i,n)},"autoPagingToArray")}a(eI,"makeAutoPagingToArray");function tI(e,t){return new Promise((r,n)=>{function o(i){if(i.done){r();return}let s=i.value;return new Promise(l=>{t(s,l)}).then(l=>l===!1?o({done:!0,value:void 0}):e().then(o))}a(o,"handleIteration"),e().then(o).catch(n)})}a(tI,"wrapAsyncIteratorWithCallback");function _f(e){let t=[].slice.call(e);return!!mr(t).ending_before}a(_f,"isReverseIteration");function bf(e){if(e.path!==void 0&&e.fullPath!==void 0)throw new Error(`Method spec specified both a 'path' (${e.path}) and a 'fullPath' (${e.fullPath}).`);return function(...t){let r=typeof t[t.length-1]=="function"&&t.pop();e.urlParams=sf(e.fullPath||this.createResourcePathWithSymbols(e.path||""));let n=dn(this._makeRequest(t,e,{}),r);return Object.assign(n,vf(this,t,e,n)),n}}a(bf,"stripeMethod");c.extend=uf;c.method=bf;c.MAX_BUFFERED_REQUEST_METRICS=100;function c(e,t){if(this._stripe=e,t)throw new Error("Support for curried url params was dropped in stripe-node v7.0.0. Instead, pass two ids.");this.basePath=Uo(this.basePath||e.getApiField("basePath")),this.resourcePath=this.path,this.path=Uo(this.path),this.initialize(...arguments)}a(c,"StripeResource");c.prototype={_stripe:null,path:"",resourcePath:"",basePath:null,initialize(){},requestDataProcessor:null,validateRequest:null,createFullPath(e,t){let r=[this.basePath(t),this.path(t)];if(typeof e=="function"){let n=e(t);n&&r.push(n)}else r.push(e);return this._joinUrlParts(r)},createResourcePathWithSymbols(e){return e?`/${this._joinUrlParts([this.resourcePath,e])}`:`/${this.resourcePath}`},_joinUrlParts(e){return e.join("/").replace(/\/{2,}/g,"/")},_getRequestOpts(e,t,r){var n;let o=(t.method||"GET").toUpperCase(),i=t.usage||[],s=t.urlParams||[],l=t.encode||(ve=>ve),f=!!t.fullPath,b=Uo(f?t.fullPath:t.path||""),m=f?t.fullPath:this.createResourcePathWithSymbols(t.path),P=[].slice.call(e),h=s.reduce((ve,ae)=>{let te=P.shift();if(typeof te!="string")throw new Error(`Stripe: Argument "${ae}" must be a string, but got: ${te} (on API request to \`${o} ${m}\`)`);return ve[ae]=te,ve},{}),d=mr(P),y=l(Object.assign({},d,r)),I=Lo(P),S=I.host||t.host,T=!!t.streaming||!!I.streaming;if(P.filter(ve=>ve!=null).length)throw new Error(`Stripe: Unknown arguments (${P}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to ${o} \`${m}\`)`);let A=f?b(h):this.createFullPath(b,h),k=Object.assign(I.headers,t.headers);t.validator&&t.validator(y,{headers:k});let G=t.method==="GET"||t.method==="DELETE";return{requestMethod:o,requestPath:A,bodyData:G?null:y,queryData:G?y:{},authenticator:(n=I.authenticator)!==null&&n!==void 0?n:null,headers:k,host:S??null,streaming:T,settings:I.settings,usage:i}},_makeRequest(e,t,r){return new Promise((n,o)=>{var i;let s;try{s=this._getRequestOpts(e,t,r)}catch(h){o(h);return}function l(h,d){h?o(h):n(t.transformResponseData?t.transformResponseData(d):d)}a(l,"requestCallback");let f=Object.keys(s.queryData).length===0,b=[s.requestPath,f?"":"?",wt(s.queryData,fr(s.requestPath))].join(""),{headers:m,settings:P}=s;this._stripe._requestSender._request(s.requestMethod,s.host,b,s.bodyData,s.authenticator,{headers:m,settings:P,streaming:s.streaming},s.usage,l,(i=this.requestDataProcessor)===null||i===void 0?void 0:i.bind(this))})}};function Pf(e){let t={DEFAULT_TOLERANCE:300,signature:null,constructEvent(m,P,h,d,y,I){try{if(!this.signature)throw new Error("ERR: missing signature helper, unable to verify");this.signature.verifyHeader(m,P,h,d||t.DEFAULT_TOLERANCE,y,I)}catch(T){throw T instanceof cr&&(T.message+="\nUse `await constructEventAsync(...)` instead of `constructEvent(...)`"),T}return m instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(m)):JSON.parse(m)},async constructEventAsync(m,P,h,d,y,I){if(!this.signature)throw new Error("ERR: missing signature helper, unable to verify");return await this.signature.verifyHeaderAsync(m,P,h,d||t.DEFAULT_TOLERANCE,y,I),m instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(m)):JSON.parse(m)},generateTestHeaderString:a(function(m){let P=b(m),h=P.signature||P.cryptoProvider.computeHMACSignature(P.payloadString,P.secret);return P.generateHeaderString(h)},"generateTestHeaderString"),generateTestHeaderStringAsync:a(async function(m){let P=b(m),h=P.signature||await P.cryptoProvider.computeHMACSignatureAsync(P.payloadString,P.secret);return P.generateHeaderString(h)},"generateTestHeaderStringAsync")},r={EXPECTED_SCHEME:"v1",verifyHeader(m,P,h,d,y,I){let{decodedHeader:S,decodedPayload:T,details:A,suspectPayloadType:k}=o(m,P,this.EXPECTED_SCHEME),G=/\s/.test(h);y=y||f();let Y=y.computeHMACSignature(n(T,A),h);return i(T,S,A,Y,d,k,G,I),!0},async verifyHeaderAsync(m,P,h,d,y,I){let{decodedHeader:S,decodedPayload:T,details:A,suspectPayloadType:k}=o(m,P,this.EXPECTED_SCHEME),G=/\s/.test(h);y=y||f();let Y=await y.computeHMACSignatureAsync(n(T,A),h);return i(T,S,A,Y,d,k,G,I)}};function n(m,P){return`${P.timestamp}.${m}`}a(n,"makeHMACContent");function o(m,P,h){if(!m)throw new Fe(P,m,{message:"No webhook payload was provided."});let d=typeof m!="string"&&!(m instanceof Uint8Array),y=new TextDecoder("utf8"),I=m instanceof Uint8Array?y.decode(m):m;if(Array.isArray(P))throw new Error("Unexpected: An array was passed as a header, which should not be possible for the stripe-signature header.");if(P==null||P=="")throw new Fe(P,m,{message:"No stripe-signature header value was provided."});let S=P instanceof Uint8Array?y.decode(P):P,T=s(S,h);if(!T||T.timestamp===-1)throw new Fe(S,I,{message:"Unable to extract timestamp and signatures from header"});if(!T.signatures.length)throw new Fe(S,I,{message:"No signatures found with expected scheme"});return{decodedPayload:I,decodedHeader:S,details:T,suspectPayloadType:d}}a(o,"parseEventDetails");function i(m,P,h,d,y,I,S,T){let A=!!h.signatures.filter(e.secureCompare.bind(e,d)).length,k=`
7
+ Learn more about webhook signing and explore webhook integration examples for various frameworks at https://docs.stripe.com/webhooks/signature`,G=S?`
8
8
 
9
- Note: The provided signing secret contains whitespace. This often indicates an extra newline or space is in the value`:"";if(!A)throw E?new qe(P,m,{message:`Webhook payload must be provided as a string or a Buffer (https://nodejs.org/api/buffer.html) instance representing the _raw_ request body.Payload was provided as a parsed JavaScript object instead.
9
+ Note: The provided signing secret contains whitespace. This often indicates an extra newline or space is in the value`:"";if(!A)throw I?new Fe(P,m,{message:`Webhook payload must be provided as a string or a Buffer (https://nodejs.org/api/buffer.html) instance representing the _raw_ request body.Payload was provided as a parsed JavaScript object instead.
10
10
  Signature verification is impossible without access to the original signed material.
11
11
  `+k+`
12
- `+F}):new qe(P,m,{message:`No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe?
12
+ `+G}):new Fe(P,m,{message:`No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe?
13
13
  If a webhook request is being forwarded by a third-party tool, ensure that the exact request body, including JSON formatting and new line style, is preserved.
14
14
  `+k+`
15
- `+F});let Y=Math.floor((typeof T=="number"?T:Date.now())/1e3)-y.timestamp;if(h>0&&Y>h)throw new qe(P,m,{message:"Timestamp outside the tolerance zone"});return!0}a(i,"validateComputedSignature");function s(m,P){return typeof m!="string"?null:m.split(",").reduce((y,p)=>{let h=p.split("=");return h[0]==="t"&&(y.timestamp=parseInt(h[1],10)),h[0]===P&&y.signatures.push(h[1]),y},{timestamp:-1,signatures:[]})}a(s,"parseHeader");let l=null;function d(){return l||(l=e.createDefaultCryptoProvider()),l}a(d,"getCryptoProvider");function b(m){if(!m)throw new de({message:"Options are required"});let P=Math.floor(m.timestamp)||Math.floor(Date.now()/1e3),y=m.scheme||r.EXPECTED_SCHEME,p=m.cryptoProvider||d(),h=`${P}.${m.payload}`,E=a(S=>`t=${P},${y}=${S}`,"generateHeaderString");return Object.assign(Object.assign({},m),{timestamp:P,scheme:y,cryptoProvider:p,payloadString:h,generateHeaderString:E})}return a(b,"prepareOptions"),t.signature=r,t}a(mf,"createWebhooks");var ff="2025-05-28.basil";var Ar={};zn(Ar,{Account:()=>Rs,AccountLinks:()=>Xh,AccountSessions:()=>Yh,Accounts:()=>Rs,ApplePayDomains:()=>Qh,ApplicationFees:()=>ey,Apps:()=>hI,Balance:()=>ty,BalanceTransactions:()=>ny,Billing:()=>yI,BillingPortal:()=>gI,Charges:()=>oy,Checkout:()=>vI,Climate:()=>_I,ConfirmationTokens:()=>iy,CountrySpecs:()=>sy,Coupons:()=>uy,CreditNotes:()=>cy,CustomerSessions:()=>ly,Customers:()=>py,Disputes:()=>dy,Entitlements:()=>bI,EphemeralKeys:()=>fy,Events:()=>yy,ExchangeRates:()=>vy,FileLinks:()=>_y,Files:()=>Py,FinancialConnections:()=>PI,Forwarding:()=>xI,Identity:()=>SI,InvoiceItems:()=>xy,InvoicePayments:()=>Ty,InvoiceRenderingTemplates:()=>Ey,Invoices:()=>Iy,Issuing:()=>TI,Mandates:()=>Ay,OAuth:()=>wy,PaymentIntents:()=>Oy,PaymentLinks:()=>Ry,PaymentMethodConfigurations:()=>Cy,PaymentMethodDomains:()=>$y,PaymentMethods:()=>Ny,Payouts:()=>Dy,Plans:()=>zy,Prices:()=>My,Products:()=>Uy,PromotionCodes:()=>Ly,Quotes:()=>qy,Radar:()=>EI,Refunds:()=>jy,Reporting:()=>II,Reviews:()=>Fy,SetupAttempts:()=>By,SetupIntents:()=>Vy,ShippingRates:()=>Gy,Sigma:()=>AI,Sources:()=>Hy,SubscriptionItems:()=>Zy,SubscriptionSchedules:()=>Wy,Subscriptions:()=>Ky,Tax:()=>kI,TaxCodes:()=>Xy,TaxIds:()=>Yy,TaxRates:()=>Qy,Terminal:()=>wI,TestHelpers:()=>OI,Tokens:()=>tg,Topups:()=>rg,Transfers:()=>ng,Treasury:()=>RI,V2:()=>CI,WebhookEndpoints:()=>og});function HE(e,t){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let n=r[0].toLowerCase()+r.substring(1),o=new t[r](e);this[n]=o}}a(HE,"ResourceNamespace");function oe(e,t){return function(r){return new HE(r,t)}}a(oe,"resourceNamespace");var Lt=c.method,hf=c.extend({retrieve:Lt({method:"GET",fullPath:"/v1/financial_connections/accounts/{account}"}),list:Lt({method:"GET",fullPath:"/v1/financial_connections/accounts",methodType:"list"}),disconnect:Lt({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/disconnect"}),listOwners:Lt({method:"GET",fullPath:"/v1/financial_connections/accounts/{account}/owners",methodType:"list"}),refresh:Lt({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/refresh"}),subscribe:Lt({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/subscribe"}),unsubscribe:Lt({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/unsubscribe"})});var yf=c.method,gf=c.extend({retrieve:yf({method:"GET",fullPath:"/v1/entitlements/active_entitlements/{id}"}),list:yf({method:"GET",fullPath:"/v1/entitlements/active_entitlements",methodType:"list"})});var vr=c.method,vf=c.extend({create:vr({method:"POST",fullPath:"/v1/billing/alerts"}),retrieve:vr({method:"GET",fullPath:"/v1/billing/alerts/{id}"}),list:vr({method:"GET",fullPath:"/v1/billing/alerts",methodType:"list"}),activate:vr({method:"POST",fullPath:"/v1/billing/alerts/{id}/activate"}),archive:vr({method:"POST",fullPath:"/v1/billing/alerts/{id}/archive"}),deactivate:vr({method:"POST",fullPath:"/v1/billing/alerts/{id}/deactivate"})});var qt=c.method,_f=c.extend({create:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations"}),capture:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/capture"}),expire:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/expire"}),finalizeAmount:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount"}),increment:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/increment"}),respond:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond"}),reverse:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/reverse"})});var gn=c.method,bf=c.extend({retrieve:gn({method:"GET",fullPath:"/v1/issuing/authorizations/{authorization}"}),update:gn({method:"POST",fullPath:"/v1/issuing/authorizations/{authorization}"}),list:gn({method:"GET",fullPath:"/v1/issuing/authorizations",methodType:"list"}),approve:gn({method:"POST",fullPath:"/v1/issuing/authorizations/{authorization}/approve"}),decline:gn({method:"POST",fullPath:"/v1/issuing/authorizations/{authorization}/decline"})});var _s=c.method,Pf=c.extend({create:_s({method:"POST",fullPath:"/v1/tax/calculations"}),retrieve:_s({method:"GET",fullPath:"/v1/tax/calculations/{calculation}"}),listLineItems:_s({method:"GET",fullPath:"/v1/tax/calculations/{calculation}/line_items",methodType:"list"})});var ei=c.method,xf=c.extend({create:ei({method:"POST",fullPath:"/v1/issuing/cardholders"}),retrieve:ei({method:"GET",fullPath:"/v1/issuing/cardholders/{cardholder}"}),update:ei({method:"POST",fullPath:"/v1/issuing/cardholders/{cardholder}"}),list:ei({method:"GET",fullPath:"/v1/issuing/cardholders",methodType:"list"})});var vn=c.method,Sf=c.extend({deliverCard:vn({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/deliver"}),failCard:vn({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/fail"}),returnCard:vn({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/return"}),shipCard:vn({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/ship"}),submitCard:vn({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/submit"})});var ti=c.method,Tf=c.extend({create:ti({method:"POST",fullPath:"/v1/issuing/cards"}),retrieve:ti({method:"GET",fullPath:"/v1/issuing/cards/{card}"}),update:ti({method:"POST",fullPath:"/v1/issuing/cards/{card}"}),list:ti({method:"GET",fullPath:"/v1/issuing/cards",methodType:"list"})});var ri=c.method,Ef=c.extend({create:ri({method:"POST",fullPath:"/v1/billing_portal/configurations"}),retrieve:ri({method:"GET",fullPath:"/v1/billing_portal/configurations/{configuration}"}),update:ri({method:"POST",fullPath:"/v1/billing_portal/configurations/{configuration}"}),list:ri({method:"GET",fullPath:"/v1/billing_portal/configurations",methodType:"list"})});var _n=c.method,If=c.extend({create:_n({method:"POST",fullPath:"/v1/terminal/configurations"}),retrieve:_n({method:"GET",fullPath:"/v1/terminal/configurations/{configuration}"}),update:_n({method:"POST",fullPath:"/v1/terminal/configurations/{configuration}"}),list:_n({method:"GET",fullPath:"/v1/terminal/configurations",methodType:"list"}),del:_n({method:"DELETE",fullPath:"/v1/terminal/configurations/{configuration}"})});var ZE=c.method,Af=c.extend({create:ZE({method:"POST",fullPath:"/v1/test_helpers/confirmation_tokens"})});var WE=c.method,kf=c.extend({create:WE({method:"POST",fullPath:"/v1/terminal/connection_tokens"})});var KE=c.method,wf=c.extend({retrieve:KE({method:"GET",fullPath:"/v1/billing/credit_balance_summary"})});var Of=c.method,Rf=c.extend({retrieve:Of({method:"GET",fullPath:"/v1/billing/credit_balance_transactions/{id}"}),list:Of({method:"GET",fullPath:"/v1/billing/credit_balance_transactions",methodType:"list"})});var _r=c.method,Cf=c.extend({create:_r({method:"POST",fullPath:"/v1/billing/credit_grants"}),retrieve:_r({method:"GET",fullPath:"/v1/billing/credit_grants/{id}"}),update:_r({method:"POST",fullPath:"/v1/billing/credit_grants/{id}"}),list:_r({method:"GET",fullPath:"/v1/billing/credit_grants",methodType:"list"}),expire:_r({method:"POST",fullPath:"/v1/billing/credit_grants/{id}/expire"}),voidGrant:_r({method:"POST",fullPath:"/v1/billing/credit_grants/{id}/void"})});var bs=c.method,$f=c.extend({create:bs({method:"POST",fullPath:"/v1/treasury/credit_reversals"}),retrieve:bs({method:"GET",fullPath:"/v1/treasury/credit_reversals/{credit_reversal}"}),list:bs({method:"GET",fullPath:"/v1/treasury/credit_reversals",methodType:"list"})});var JE=c.method,Nf=c.extend({fundCashBalance:JE({method:"POST",fullPath:"/v1/test_helpers/customers/{customer}/fund_cash_balance"})});var Ps=c.method,Df=c.extend({create:Ps({method:"POST",fullPath:"/v1/treasury/debit_reversals"}),retrieve:Ps({method:"GET",fullPath:"/v1/treasury/debit_reversals/{debit_reversal}"}),list:Ps({method:"GET",fullPath:"/v1/treasury/debit_reversals",methodType:"list"})});var bn=c.method,zf=c.extend({create:bn({method:"POST",fullPath:"/v1/issuing/disputes"}),retrieve:bn({method:"GET",fullPath:"/v1/issuing/disputes/{dispute}"}),update:bn({method:"POST",fullPath:"/v1/issuing/disputes/{dispute}"}),list:bn({method:"GET",fullPath:"/v1/issuing/disputes",methodType:"list"}),submit:bn({method:"POST",fullPath:"/v1/issuing/disputes/{dispute}/submit"})});var Mf=c.method,Uf=c.extend({retrieve:Mf({method:"GET",fullPath:"/v1/radar/early_fraud_warnings/{early_fraud_warning}"}),list:Mf({method:"GET",fullPath:"/v1/radar/early_fraud_warnings",methodType:"list"})});var kt=c.method,Lf=c.extend({create:kt({method:"POST",fullPath:"/v2/core/event_destinations"}),retrieve:kt({method:"GET",fullPath:"/v2/core/event_destinations/{id}"}),update:kt({method:"POST",fullPath:"/v2/core/event_destinations/{id}"}),list:kt({method:"GET",fullPath:"/v2/core/event_destinations",methodType:"list"}),del:kt({method:"DELETE",fullPath:"/v2/core/event_destinations/{id}"}),disable:kt({method:"POST",fullPath:"/v2/core/event_destinations/{id}/disable"}),enable:kt({method:"POST",fullPath:"/v2/core/event_destinations/{id}/enable"}),ping:kt({method:"POST",fullPath:"/v2/core/event_destinations/{id}/ping"})});var xs=c.method,qf=c.extend({retrieve(...e){return xs({method:"GET",fullPath:"/v2/core/events/{id}",transformResponseData:a(r=>this.addFetchRelatedObjectIfNeeded(r),"transformResponseData")}).apply(this,e)},list(...e){return xs({method:"GET",fullPath:"/v2/core/events",methodType:"list",transformResponseData:a(r=>Object.assign(Object.assign({},r),{data:r.data.map(this.addFetchRelatedObjectIfNeeded.bind(this))}),"transformResponseData")}).apply(this,e)},addFetchRelatedObjectIfNeeded(e){return!e.related_object||!e.related_object.url?e:Object.assign(Object.assign({},e),{fetchRelatedObject:a(()=>xs({method:"GET",fullPath:e.related_object.url}).apply(this,[{stripeAccount:e.context}]),"fetchRelatedObject")})}});var ni=c.method,jf=c.extend({create:ni({method:"POST",fullPath:"/v1/entitlements/features"}),retrieve:ni({method:"GET",fullPath:"/v1/entitlements/features/{id}"}),update:ni({method:"POST",fullPath:"/v1/entitlements/features/{id}"}),list:ni({method:"GET",fullPath:"/v1/entitlements/features",methodType:"list"})});var jt=c.method,Ff=c.extend({create:jt({method:"POST",fullPath:"/v1/treasury/financial_accounts"}),retrieve:jt({method:"GET",fullPath:"/v1/treasury/financial_accounts/{financial_account}"}),update:jt({method:"POST",fullPath:"/v1/treasury/financial_accounts/{financial_account}"}),list:jt({method:"GET",fullPath:"/v1/treasury/financial_accounts",methodType:"list"}),close:jt({method:"POST",fullPath:"/v1/treasury/financial_accounts/{financial_account}/close"}),retrieveFeatures:jt({method:"GET",fullPath:"/v1/treasury/financial_accounts/{financial_account}/features"}),updateFeatures:jt({method:"POST",fullPath:"/v1/treasury/financial_accounts/{financial_account}/features"})});var Ss=c.method,Bf=c.extend({fail:Ss({method:"POST",fullPath:"/v1/test_helpers/treasury/inbound_transfers/{id}/fail"}),returnInboundTransfer:Ss({method:"POST",fullPath:"/v1/test_helpers/treasury/inbound_transfers/{id}/return"}),succeed:Ss({method:"POST",fullPath:"/v1/test_helpers/treasury/inbound_transfers/{id}/succeed"})});var oi=c.method,Vf=c.extend({create:oi({method:"POST",fullPath:"/v1/treasury/inbound_transfers"}),retrieve:oi({method:"GET",fullPath:"/v1/treasury/inbound_transfers/{id}"}),list:oi({method:"GET",fullPath:"/v1/treasury/inbound_transfers",methodType:"list"}),cancel:oi({method:"POST",fullPath:"/v1/treasury/inbound_transfers/{inbound_transfer}/cancel"})});var Pn=c.method,Gf=c.extend({create:Pn({method:"POST",fullPath:"/v1/terminal/locations"}),retrieve:Pn({method:"GET",fullPath:"/v1/terminal/locations/{location}"}),update:Pn({method:"POST",fullPath:"/v1/terminal/locations/{location}"}),list:Pn({method:"GET",fullPath:"/v1/terminal/locations",methodType:"list"}),del:Pn({method:"DELETE",fullPath:"/v1/terminal/locations/{location}"})});var XE=c.method,Hf=c.extend({create:XE({method:"POST",fullPath:"/v1/billing/meter_event_adjustments"})});var YE=c.method,Zf=c.extend({create:YE({method:"POST",fullPath:"/v2/billing/meter_event_adjustments"})});var QE=c.method,Wf=c.extend({create:QE({method:"POST",fullPath:"/v2/billing/meter_event_session"})});var eI=c.method,Kf=c.extend({create:eI({method:"POST",fullPath:"/v2/billing/meter_event_stream",host:"meter-events.stripe.com"})});var tI=c.method,Jf=c.extend({create:tI({method:"POST",fullPath:"/v1/billing/meter_events"})});var rI=c.method,Xf=c.extend({create:rI({method:"POST",fullPath:"/v2/billing/meter_events"})});var Ft=c.method,Yf=c.extend({create:Ft({method:"POST",fullPath:"/v1/billing/meters"}),retrieve:Ft({method:"GET",fullPath:"/v1/billing/meters/{id}"}),update:Ft({method:"POST",fullPath:"/v1/billing/meters/{id}"}),list:Ft({method:"GET",fullPath:"/v1/billing/meters",methodType:"list"}),deactivate:Ft({method:"POST",fullPath:"/v1/billing/meters/{id}/deactivate"}),listEventSummaries:Ft({method:"GET",fullPath:"/v1/billing/meters/{id}/event_summaries",methodType:"list"}),reactivate:Ft({method:"POST",fullPath:"/v1/billing/meters/{id}/reactivate"})});var xn=c.method,Qf=c.extend({create:xn({method:"POST",fullPath:"/v1/climate/orders"}),retrieve:xn({method:"GET",fullPath:"/v1/climate/orders/{order}"}),update:xn({method:"POST",fullPath:"/v1/climate/orders/{order}"}),list:xn({method:"GET",fullPath:"/v1/climate/orders",methodType:"list"}),cancel:xn({method:"POST",fullPath:"/v1/climate/orders/{order}/cancel"})});var ii=c.method,eh=c.extend({update:ii({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}"}),fail:ii({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}/fail"}),post:ii({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}/post"}),returnOutboundPayment:ii({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}/return"})});var ai=c.method,th=c.extend({create:ai({method:"POST",fullPath:"/v1/treasury/outbound_payments"}),retrieve:ai({method:"GET",fullPath:"/v1/treasury/outbound_payments/{id}"}),list:ai({method:"GET",fullPath:"/v1/treasury/outbound_payments",methodType:"list"}),cancel:ai({method:"POST",fullPath:"/v1/treasury/outbound_payments/{id}/cancel"})});var si=c.method,rh=c.extend({update:si({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}"}),fail:si({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail"}),post:si({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post"}),returnOutboundTransfer:si({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return"})});var ui=c.method,nh=c.extend({create:ui({method:"POST",fullPath:"/v1/treasury/outbound_transfers"}),retrieve:ui({method:"GET",fullPath:"/v1/treasury/outbound_transfers/{outbound_transfer}"}),list:ui({method:"GET",fullPath:"/v1/treasury/outbound_transfers",methodType:"list"}),cancel:ui({method:"POST",fullPath:"/v1/treasury/outbound_transfers/{outbound_transfer}/cancel"})});var Ts=c.method,oh=c.extend({activate:Ts({method:"POST",fullPath:"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate"}),deactivate:Ts({method:"POST",fullPath:"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate"}),reject:Ts({method:"POST",fullPath:"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject"})});var ci=c.method,ih=c.extend({create:ci({method:"POST",fullPath:"/v1/issuing/personalization_designs"}),retrieve:ci({method:"GET",fullPath:"/v1/issuing/personalization_designs/{personalization_design}"}),update:ci({method:"POST",fullPath:"/v1/issuing/personalization_designs/{personalization_design}"}),list:ci({method:"GET",fullPath:"/v1/issuing/personalization_designs",methodType:"list"})});var ah=c.method,sh=c.extend({retrieve:ah({method:"GET",fullPath:"/v1/issuing/physical_bundles/{physical_bundle}"}),list:ah({method:"GET",fullPath:"/v1/issuing/physical_bundles",methodType:"list"})});var uh=c.method,ch=c.extend({retrieve:uh({method:"GET",fullPath:"/v1/climate/products/{product}"}),list:uh({method:"GET",fullPath:"/v1/climate/products",methodType:"list"})});var Es=c.method,lh=c.extend({presentPaymentMethod:Es({method:"POST",fullPath:"/v1/test_helpers/terminal/readers/{reader}/present_payment_method"}),succeedInputCollection:Es({method:"POST",fullPath:"/v1/test_helpers/terminal/readers/{reader}/succeed_input_collection"}),timeoutInputCollection:Es({method:"POST",fullPath:"/v1/test_helpers/terminal/readers/{reader}/timeout_input_collection"})});var je=c.method,ph=c.extend({create:je({method:"POST",fullPath:"/v1/terminal/readers"}),retrieve:je({method:"GET",fullPath:"/v1/terminal/readers/{reader}"}),update:je({method:"POST",fullPath:"/v1/terminal/readers/{reader}"}),list:je({method:"GET",fullPath:"/v1/terminal/readers",methodType:"list"}),del:je({method:"DELETE",fullPath:"/v1/terminal/readers/{reader}"}),cancelAction:je({method:"POST",fullPath:"/v1/terminal/readers/{reader}/cancel_action"}),collectInputs:je({method:"POST",fullPath:"/v1/terminal/readers/{reader}/collect_inputs"}),processPaymentIntent:je({method:"POST",fullPath:"/v1/terminal/readers/{reader}/process_payment_intent"}),processSetupIntent:je({method:"POST",fullPath:"/v1/terminal/readers/{reader}/process_setup_intent"}),refundPayment:je({method:"POST",fullPath:"/v1/terminal/readers/{reader}/refund_payment"}),setReaderDisplay:je({method:"POST",fullPath:"/v1/terminal/readers/{reader}/set_reader_display"})});var nI=c.method,dh=c.extend({create:nI({method:"POST",fullPath:"/v1/test_helpers/treasury/received_credits"})});var mh=c.method,fh=c.extend({retrieve:mh({method:"GET",fullPath:"/v1/treasury/received_credits/{id}"}),list:mh({method:"GET",fullPath:"/v1/treasury/received_credits",methodType:"list"})});var oI=c.method,hh=c.extend({create:oI({method:"POST",fullPath:"/v1/test_helpers/treasury/received_debits"})});var yh=c.method,gh=c.extend({retrieve:yh({method:"GET",fullPath:"/v1/treasury/received_debits/{id}"}),list:yh({method:"GET",fullPath:"/v1/treasury/received_debits",methodType:"list"})});var iI=c.method,vh=c.extend({expire:iI({method:"POST",fullPath:"/v1/test_helpers/refunds/{refund}/expire"})});var li=c.method,_h=c.extend({create:li({method:"POST",fullPath:"/v1/tax/registrations"}),retrieve:li({method:"GET",fullPath:"/v1/tax/registrations/{id}"}),update:li({method:"POST",fullPath:"/v1/tax/registrations/{id}"}),list:li({method:"GET",fullPath:"/v1/tax/registrations",methodType:"list"})});var Is=c.method,bh=c.extend({create:Is({method:"POST",fullPath:"/v1/reporting/report_runs"}),retrieve:Is({method:"GET",fullPath:"/v1/reporting/report_runs/{report_run}"}),list:Is({method:"GET",fullPath:"/v1/reporting/report_runs",methodType:"list"})});var Ph=c.method,xh=c.extend({retrieve:Ph({method:"GET",fullPath:"/v1/reporting/report_types/{report_type}"}),list:Ph({method:"GET",fullPath:"/v1/reporting/report_types",methodType:"list"})});var As=c.method,Sh=c.extend({create:As({method:"POST",fullPath:"/v1/forwarding/requests"}),retrieve:As({method:"GET",fullPath:"/v1/forwarding/requests/{id}"}),list:As({method:"GET",fullPath:"/v1/forwarding/requests",methodType:"list"})});var Th=c.method,Eh=c.extend({retrieve:Th({method:"GET",fullPath:"/v1/sigma/scheduled_query_runs/{scheduled_query_run}"}),list:Th({method:"GET",fullPath:"/v1/sigma/scheduled_query_runs",methodType:"list"})});var pi=c.method,Ih=c.extend({create:pi({method:"POST",fullPath:"/v1/apps/secrets"}),list:pi({method:"GET",fullPath:"/v1/apps/secrets",methodType:"list"}),deleteWhere:pi({method:"POST",fullPath:"/v1/apps/secrets/delete"}),find:pi({method:"GET",fullPath:"/v1/apps/secrets/find"})});var aI=c.method,Ah=c.extend({create:aI({method:"POST",fullPath:"/v1/billing_portal/sessions"})});var br=c.method,kh=c.extend({create:br({method:"POST",fullPath:"/v1/checkout/sessions"}),retrieve:br({method:"GET",fullPath:"/v1/checkout/sessions/{session}"}),update:br({method:"POST",fullPath:"/v1/checkout/sessions/{session}"}),list:br({method:"GET",fullPath:"/v1/checkout/sessions",methodType:"list"}),expire:br({method:"POST",fullPath:"/v1/checkout/sessions/{session}/expire"}),listLineItems:br({method:"GET",fullPath:"/v1/checkout/sessions/{session}/line_items",methodType:"list"})});var wh=c.method,Oh=c.extend({create:wh({method:"POST",fullPath:"/v1/financial_connections/sessions"}),retrieve:wh({method:"GET",fullPath:"/v1/financial_connections/sessions/{session}"})});var Rh=c.method,Ch=c.extend({retrieve:Rh({method:"GET",fullPath:"/v1/tax/settings"}),update:Rh({method:"POST",fullPath:"/v1/tax/settings"})});var $h=c.method,Nh=c.extend({retrieve:$h({method:"GET",fullPath:"/v1/climate/suppliers/{supplier}"}),list:$h({method:"GET",fullPath:"/v1/climate/suppliers",methodType:"list"})});var Sn=c.method,Dh=c.extend({create:Sn({method:"POST",fullPath:"/v1/test_helpers/test_clocks"}),retrieve:Sn({method:"GET",fullPath:"/v1/test_helpers/test_clocks/{test_clock}"}),list:Sn({method:"GET",fullPath:"/v1/test_helpers/test_clocks",methodType:"list"}),del:Sn({method:"DELETE",fullPath:"/v1/test_helpers/test_clocks/{test_clock}"}),advance:Sn({method:"POST",fullPath:"/v1/test_helpers/test_clocks/{test_clock}/advance"})});var ks=c.method,zh=c.extend({retrieve:ks({method:"GET",fullPath:"/v1/issuing/tokens/{token}"}),update:ks({method:"POST",fullPath:"/v1/issuing/tokens/{token}"}),list:ks({method:"GET",fullPath:"/v1/issuing/tokens",methodType:"list"})});var Mh=c.method,Uh=c.extend({retrieve:Mh({method:"GET",fullPath:"/v1/treasury/transaction_entries/{id}"}),list:Mh({method:"GET",fullPath:"/v1/treasury/transaction_entries",methodType:"list"})});var ws=c.method,Lh=c.extend({createForceCapture:ws({method:"POST",fullPath:"/v1/test_helpers/issuing/transactions/create_force_capture"}),createUnlinkedRefund:ws({method:"POST",fullPath:"/v1/test_helpers/issuing/transactions/create_unlinked_refund"}),refund:ws({method:"POST",fullPath:"/v1/test_helpers/issuing/transactions/{transaction}/refund"})});var qh=c.method,jh=c.extend({retrieve:qh({method:"GET",fullPath:"/v1/financial_connections/transactions/{transaction}"}),list:qh({method:"GET",fullPath:"/v1/financial_connections/transactions",methodType:"list"})});var Os=c.method,Fh=c.extend({retrieve:Os({method:"GET",fullPath:"/v1/issuing/transactions/{transaction}"}),update:Os({method:"POST",fullPath:"/v1/issuing/transactions/{transaction}"}),list:Os({method:"GET",fullPath:"/v1/issuing/transactions",methodType:"list"})});var di=c.method,Bh=c.extend({retrieve:di({method:"GET",fullPath:"/v1/tax/transactions/{transaction}"}),createFromCalculation:di({method:"POST",fullPath:"/v1/tax/transactions/create_from_calculation"}),createReversal:di({method:"POST",fullPath:"/v1/tax/transactions/create_reversal"}),listLineItems:di({method:"GET",fullPath:"/v1/tax/transactions/{transaction}/line_items",methodType:"list"})});var Vh=c.method,Gh=c.extend({retrieve:Vh({method:"GET",fullPath:"/v1/treasury/transactions/{id}"}),list:Vh({method:"GET",fullPath:"/v1/treasury/transactions",methodType:"list"})});var mi=c.method,Hh=c.extend({create:mi({method:"POST",fullPath:"/v1/radar/value_list_items"}),retrieve:mi({method:"GET",fullPath:"/v1/radar/value_list_items/{item}"}),list:mi({method:"GET",fullPath:"/v1/radar/value_list_items",methodType:"list"}),del:mi({method:"DELETE",fullPath:"/v1/radar/value_list_items/{item}"})});var Tn=c.method,Zh=c.extend({create:Tn({method:"POST",fullPath:"/v1/radar/value_lists"}),retrieve:Tn({method:"GET",fullPath:"/v1/radar/value_lists/{value_list}"}),update:Tn({method:"POST",fullPath:"/v1/radar/value_lists/{value_list}"}),list:Tn({method:"GET",fullPath:"/v1/radar/value_lists",methodType:"list"}),del:Tn({method:"DELETE",fullPath:"/v1/radar/value_lists/{value_list}"})});var Wh=c.method,Kh=c.extend({retrieve:Wh({method:"GET",fullPath:"/v1/identity/verification_reports/{report}"}),list:Wh({method:"GET",fullPath:"/v1/identity/verification_reports",methodType:"list"})});var Pr=c.method,Jh=c.extend({create:Pr({method:"POST",fullPath:"/v1/identity/verification_sessions"}),retrieve:Pr({method:"GET",fullPath:"/v1/identity/verification_sessions/{session}"}),update:Pr({method:"POST",fullPath:"/v1/identity/verification_sessions/{session}"}),list:Pr({method:"GET",fullPath:"/v1/identity/verification_sessions",methodType:"list"}),cancel:Pr({method:"POST",fullPath:"/v1/identity/verification_sessions/{session}/cancel"}),redact:Pr({method:"POST",fullPath:"/v1/identity/verification_sessions/{session}/redact"})});var me=c.method,Rs=c.extend({create:me({method:"POST",fullPath:"/v1/accounts"}),retrieve(e,...t){return typeof e=="string"?me({method:"GET",fullPath:"/v1/accounts/{id}"}).apply(this,[e,...t]):(e==null&&[].shift.apply([e,...t]),me({method:"GET",fullPath:"/v1/account"}).apply(this,[e,...t]))},update:me({method:"POST",fullPath:"/v1/accounts/{account}"}),list:me({method:"GET",fullPath:"/v1/accounts",methodType:"list"}),del:me({method:"DELETE",fullPath:"/v1/accounts/{account}"}),createExternalAccount:me({method:"POST",fullPath:"/v1/accounts/{account}/external_accounts"}),createLoginLink:me({method:"POST",fullPath:"/v1/accounts/{account}/login_links"}),createPerson:me({method:"POST",fullPath:"/v1/accounts/{account}/persons"}),deleteExternalAccount:me({method:"DELETE",fullPath:"/v1/accounts/{account}/external_accounts/{id}"}),deletePerson:me({method:"DELETE",fullPath:"/v1/accounts/{account}/persons/{person}"}),listCapabilities:me({method:"GET",fullPath:"/v1/accounts/{account}/capabilities",methodType:"list"}),listExternalAccounts:me({method:"GET",fullPath:"/v1/accounts/{account}/external_accounts",methodType:"list"}),listPersons:me({method:"GET",fullPath:"/v1/accounts/{account}/persons",methodType:"list"}),reject:me({method:"POST",fullPath:"/v1/accounts/{account}/reject"}),retrieveCurrent:me({method:"GET",fullPath:"/v1/account"}),retrieveCapability:me({method:"GET",fullPath:"/v1/accounts/{account}/capabilities/{capability}"}),retrieveExternalAccount:me({method:"GET",fullPath:"/v1/accounts/{account}/external_accounts/{id}"}),retrievePerson:me({method:"GET",fullPath:"/v1/accounts/{account}/persons/{person}"}),updateCapability:me({method:"POST",fullPath:"/v1/accounts/{account}/capabilities/{capability}"}),updateExternalAccount:me({method:"POST",fullPath:"/v1/accounts/{account}/external_accounts/{id}"}),updatePerson:me({method:"POST",fullPath:"/v1/accounts/{account}/persons/{person}"})});var sI=c.method,Xh=c.extend({create:sI({method:"POST",fullPath:"/v1/account_links"})});var uI=c.method,Yh=c.extend({create:uI({method:"POST",fullPath:"/v1/account_sessions"})});var fi=c.method,Qh=c.extend({create:fi({method:"POST",fullPath:"/v1/apple_pay/domains"}),retrieve:fi({method:"GET",fullPath:"/v1/apple_pay/domains/{domain}"}),list:fi({method:"GET",fullPath:"/v1/apple_pay/domains",methodType:"list"}),del:fi({method:"DELETE",fullPath:"/v1/apple_pay/domains/{domain}"})});var xr=c.method,ey=c.extend({retrieve:xr({method:"GET",fullPath:"/v1/application_fees/{id}"}),list:xr({method:"GET",fullPath:"/v1/application_fees",methodType:"list"}),createRefund:xr({method:"POST",fullPath:"/v1/application_fees/{id}/refunds"}),listRefunds:xr({method:"GET",fullPath:"/v1/application_fees/{id}/refunds",methodType:"list"}),retrieveRefund:xr({method:"GET",fullPath:"/v1/application_fees/{fee}/refunds/{id}"}),updateRefund:xr({method:"POST",fullPath:"/v1/application_fees/{fee}/refunds/{id}"})});var cI=c.method,ty=c.extend({retrieve:cI({method:"GET",fullPath:"/v1/balance"})});var ry=c.method,ny=c.extend({retrieve:ry({method:"GET",fullPath:"/v1/balance_transactions/{id}"}),list:ry({method:"GET",fullPath:"/v1/balance_transactions",methodType:"list"})});var Sr=c.method,oy=c.extend({create:Sr({method:"POST",fullPath:"/v1/charges"}),retrieve:Sr({method:"GET",fullPath:"/v1/charges/{charge}"}),update:Sr({method:"POST",fullPath:"/v1/charges/{charge}"}),list:Sr({method:"GET",fullPath:"/v1/charges",methodType:"list"}),capture:Sr({method:"POST",fullPath:"/v1/charges/{charge}/capture"}),search:Sr({method:"GET",fullPath:"/v1/charges/search",methodType:"search"})});var lI=c.method,iy=c.extend({retrieve:lI({method:"GET",fullPath:"/v1/confirmation_tokens/{confirmation_token}"})});var ay=c.method,sy=c.extend({retrieve:ay({method:"GET",fullPath:"/v1/country_specs/{country}"}),list:ay({method:"GET",fullPath:"/v1/country_specs",methodType:"list"})});var En=c.method,uy=c.extend({create:En({method:"POST",fullPath:"/v1/coupons"}),retrieve:En({method:"GET",fullPath:"/v1/coupons/{coupon}"}),update:En({method:"POST",fullPath:"/v1/coupons/{coupon}"}),list:En({method:"GET",fullPath:"/v1/coupons",methodType:"list"}),del:En({method:"DELETE",fullPath:"/v1/coupons/{coupon}"})});var wt=c.method,cy=c.extend({create:wt({method:"POST",fullPath:"/v1/credit_notes"}),retrieve:wt({method:"GET",fullPath:"/v1/credit_notes/{id}"}),update:wt({method:"POST",fullPath:"/v1/credit_notes/{id}"}),list:wt({method:"GET",fullPath:"/v1/credit_notes",methodType:"list"}),listLineItems:wt({method:"GET",fullPath:"/v1/credit_notes/{credit_note}/lines",methodType:"list"}),listPreviewLineItems:wt({method:"GET",fullPath:"/v1/credit_notes/preview/lines",methodType:"list"}),preview:wt({method:"GET",fullPath:"/v1/credit_notes/preview"}),voidCreditNote:wt({method:"POST",fullPath:"/v1/credit_notes/{id}/void"})});var pI=c.method,ly=c.extend({create:pI({method:"POST",fullPath:"/v1/customer_sessions"})});var Q=c.method,py=c.extend({create:Q({method:"POST",fullPath:"/v1/customers"}),retrieve:Q({method:"GET",fullPath:"/v1/customers/{customer}"}),update:Q({method:"POST",fullPath:"/v1/customers/{customer}"}),list:Q({method:"GET",fullPath:"/v1/customers",methodType:"list"}),del:Q({method:"DELETE",fullPath:"/v1/customers/{customer}"}),createBalanceTransaction:Q({method:"POST",fullPath:"/v1/customers/{customer}/balance_transactions"}),createFundingInstructions:Q({method:"POST",fullPath:"/v1/customers/{customer}/funding_instructions"}),createSource:Q({method:"POST",fullPath:"/v1/customers/{customer}/sources"}),createTaxId:Q({method:"POST",fullPath:"/v1/customers/{customer}/tax_ids"}),deleteDiscount:Q({method:"DELETE",fullPath:"/v1/customers/{customer}/discount"}),deleteSource:Q({method:"DELETE",fullPath:"/v1/customers/{customer}/sources/{id}"}),deleteTaxId:Q({method:"DELETE",fullPath:"/v1/customers/{customer}/tax_ids/{id}"}),listBalanceTransactions:Q({method:"GET",fullPath:"/v1/customers/{customer}/balance_transactions",methodType:"list"}),listCashBalanceTransactions:Q({method:"GET",fullPath:"/v1/customers/{customer}/cash_balance_transactions",methodType:"list"}),listPaymentMethods:Q({method:"GET",fullPath:"/v1/customers/{customer}/payment_methods",methodType:"list"}),listSources:Q({method:"GET",fullPath:"/v1/customers/{customer}/sources",methodType:"list"}),listTaxIds:Q({method:"GET",fullPath:"/v1/customers/{customer}/tax_ids",methodType:"list"}),retrieveBalanceTransaction:Q({method:"GET",fullPath:"/v1/customers/{customer}/balance_transactions/{transaction}"}),retrieveCashBalance:Q({method:"GET",fullPath:"/v1/customers/{customer}/cash_balance"}),retrieveCashBalanceTransaction:Q({method:"GET",fullPath:"/v1/customers/{customer}/cash_balance_transactions/{transaction}"}),retrievePaymentMethod:Q({method:"GET",fullPath:"/v1/customers/{customer}/payment_methods/{payment_method}"}),retrieveSource:Q({method:"GET",fullPath:"/v1/customers/{customer}/sources/{id}"}),retrieveTaxId:Q({method:"GET",fullPath:"/v1/customers/{customer}/tax_ids/{id}"}),search:Q({method:"GET",fullPath:"/v1/customers/search",methodType:"search"}),updateBalanceTransaction:Q({method:"POST",fullPath:"/v1/customers/{customer}/balance_transactions/{transaction}"}),updateCashBalance:Q({method:"POST",fullPath:"/v1/customers/{customer}/cash_balance"}),updateSource:Q({method:"POST",fullPath:"/v1/customers/{customer}/sources/{id}"}),verifySource:Q({method:"POST",fullPath:"/v1/customers/{customer}/sources/{id}/verify"})});var hi=c.method,dy=c.extend({retrieve:hi({method:"GET",fullPath:"/v1/disputes/{dispute}"}),update:hi({method:"POST",fullPath:"/v1/disputes/{dispute}"}),list:hi({method:"GET",fullPath:"/v1/disputes",methodType:"list"}),close:hi({method:"POST",fullPath:"/v1/disputes/{dispute}/close"})});var my=c.method,fy=c.extend({create:my({method:"POST",fullPath:"/v1/ephemeral_keys",validator:a((e,t)=>{if(!t.headers||!t.headers["Stripe-Version"])throw new Error("Passing apiVersion in a separate options hash is required to create an ephemeral key. See https://stripe.com/docs/api/versioning?lang=node")},"validator")}),del:my({method:"DELETE",fullPath:"/v1/ephemeral_keys/{key}"})});var hy=c.method,yy=c.extend({retrieve:hy({method:"GET",fullPath:"/v1/events/{id}"}),list:hy({method:"GET",fullPath:"/v1/events",methodType:"list"})});var gy=c.method,vy=c.extend({retrieve:gy({method:"GET",fullPath:"/v1/exchange_rates/{rate_id}"}),list:gy({method:"GET",fullPath:"/v1/exchange_rates",methodType:"list"})});var yi=c.method,_y=c.extend({create:yi({method:"POST",fullPath:"/v1/file_links"}),retrieve:yi({method:"GET",fullPath:"/v1/file_links/{link}"}),update:yi({method:"POST",fullPath:"/v1/file_links/{link}"}),list:yi({method:"GET",fullPath:"/v1/file_links",methodType:"list"})});var dI=a((e,t,r)=>{let n=(Math.round(Math.random()*1e16)+Math.round(Math.random()*1e16)).toString();r["Content-Type"]=`multipart/form-data; boundary=${n}`;let o=new TextEncoder,i=new Uint8Array(0),s=o.encode(`\r
16
- `);function l(m){let P=i,y=m instanceof Uint8Array?m:new Uint8Array(o.encode(m));i=new Uint8Array(P.length+y.length+2),i.set(P),i.set(y,P.length),i.set(s,i.length-2)}a(l,"push");function d(m){return`"${m.replace(/"|"/g,"%22").replace(/\r\n|\r|\n/g," ")}"`}a(d,"q");let b=rf(t);for(let m in b){if(!Object.prototype.hasOwnProperty.call(b,m))continue;let P=b[m];if(l(`--${n}`),Object.prototype.hasOwnProperty.call(P,"data")){let y=P;l(`Content-Disposition: form-data; name=${d(m)}; filename=${d(y.name||"blob")}`),l(`Content-Type: ${y.type||"application/octet-stream"}`),l(""),l(y.data)}else l(`Content-Disposition: form-data; name=${d(m)}`),l(""),l(P)}return l(`--${n}--`),i},"multipartDataGenerator");function by(e,t,r,n){if(t=t||{},e!=="POST")return n(null,At(t));this._stripe._platformFunctions.tryBufferData(t).then(o=>{let i=dI(e,o,r);return n(null,i)}).catch(o=>n(o,null))}a(by,"multipartRequestDataProcessor");var Cs=c.method,Py=c.extend({create:Cs({method:"POST",fullPath:"/v1/files",headers:{"Content-Type":"multipart/form-data"},host:"files.stripe.com"}),retrieve:Cs({method:"GET",fullPath:"/v1/files/{file}"}),list:Cs({method:"GET",fullPath:"/v1/files",methodType:"list"}),requestDataProcessor:by});var In=c.method,xy=c.extend({create:In({method:"POST",fullPath:"/v1/invoiceitems"}),retrieve:In({method:"GET",fullPath:"/v1/invoiceitems/{invoiceitem}"}),update:In({method:"POST",fullPath:"/v1/invoiceitems/{invoiceitem}"}),list:In({method:"GET",fullPath:"/v1/invoiceitems",methodType:"list"}),del:In({method:"DELETE",fullPath:"/v1/invoiceitems/{invoiceitem}"})});var Sy=c.method,Ty=c.extend({retrieve:Sy({method:"GET",fullPath:"/v1/invoice_payments/{invoice_payment}"}),list:Sy({method:"GET",fullPath:"/v1/invoice_payments",methodType:"list"})});var gi=c.method,Ey=c.extend({retrieve:gi({method:"GET",fullPath:"/v1/invoice_rendering_templates/{template}"}),list:gi({method:"GET",fullPath:"/v1/invoice_rendering_templates",methodType:"list"}),archive:gi({method:"POST",fullPath:"/v1/invoice_rendering_templates/{template}/archive"}),unarchive:gi({method:"POST",fullPath:"/v1/invoice_rendering_templates/{template}/unarchive"})});var Pe=c.method,Iy=c.extend({create:Pe({method:"POST",fullPath:"/v1/invoices"}),retrieve:Pe({method:"GET",fullPath:"/v1/invoices/{invoice}"}),update:Pe({method:"POST",fullPath:"/v1/invoices/{invoice}"}),list:Pe({method:"GET",fullPath:"/v1/invoices",methodType:"list"}),del:Pe({method:"DELETE",fullPath:"/v1/invoices/{invoice}"}),addLines:Pe({method:"POST",fullPath:"/v1/invoices/{invoice}/add_lines"}),attachPayment:Pe({method:"POST",fullPath:"/v1/invoices/{invoice}/attach_payment"}),createPreview:Pe({method:"POST",fullPath:"/v1/invoices/create_preview"}),finalizeInvoice:Pe({method:"POST",fullPath:"/v1/invoices/{invoice}/finalize"}),listLineItems:Pe({method:"GET",fullPath:"/v1/invoices/{invoice}/lines",methodType:"list"}),markUncollectible:Pe({method:"POST",fullPath:"/v1/invoices/{invoice}/mark_uncollectible"}),pay:Pe({method:"POST",fullPath:"/v1/invoices/{invoice}/pay"}),removeLines:Pe({method:"POST",fullPath:"/v1/invoices/{invoice}/remove_lines"}),search:Pe({method:"GET",fullPath:"/v1/invoices/search",methodType:"search"}),sendInvoice:Pe({method:"POST",fullPath:"/v1/invoices/{invoice}/send"}),updateLines:Pe({method:"POST",fullPath:"/v1/invoices/{invoice}/update_lines"}),updateLineItem:Pe({method:"POST",fullPath:"/v1/invoices/{invoice}/lines/{line_item_id}"}),voidInvoice:Pe({method:"POST",fullPath:"/v1/invoices/{invoice}/void"})});var mI=c.method,Ay=c.extend({retrieve:mI({method:"GET",fullPath:"/v1/mandates/{mandate}"})});var ky=c.method,$s="connect.stripe.com",wy=c.extend({basePath:"/",authorizeUrl(e,t){e=e||{},t=t||{};let r="oauth/authorize";return t.express&&(r=`express/${r}`),e.response_type||(e.response_type="code"),e.client_id||(e.client_id=this._stripe.getClientId()),e.scope||(e.scope="read_write"),`https://${$s}/${r}?${At(e)}`},token:ky({method:"POST",path:"oauth/token",host:$s}),deauthorize(e,...t){return e.client_id||(e.client_id=this._stripe.getClientId()),ky({method:"POST",path:"oauth/deauthorize",host:$s}).apply(this,[e,...t])}});var Fe=c.method,Oy=c.extend({create:Fe({method:"POST",fullPath:"/v1/payment_intents"}),retrieve:Fe({method:"GET",fullPath:"/v1/payment_intents/{intent}"}),update:Fe({method:"POST",fullPath:"/v1/payment_intents/{intent}"}),list:Fe({method:"GET",fullPath:"/v1/payment_intents",methodType:"list"}),applyCustomerBalance:Fe({method:"POST",fullPath:"/v1/payment_intents/{intent}/apply_customer_balance"}),cancel:Fe({method:"POST",fullPath:"/v1/payment_intents/{intent}/cancel"}),capture:Fe({method:"POST",fullPath:"/v1/payment_intents/{intent}/capture"}),confirm:Fe({method:"POST",fullPath:"/v1/payment_intents/{intent}/confirm"}),incrementAuthorization:Fe({method:"POST",fullPath:"/v1/payment_intents/{intent}/increment_authorization"}),search:Fe({method:"GET",fullPath:"/v1/payment_intents/search",methodType:"search"}),verifyMicrodeposits:Fe({method:"POST",fullPath:"/v1/payment_intents/{intent}/verify_microdeposits"})});var An=c.method,Ry=c.extend({create:An({method:"POST",fullPath:"/v1/payment_links"}),retrieve:An({method:"GET",fullPath:"/v1/payment_links/{payment_link}"}),update:An({method:"POST",fullPath:"/v1/payment_links/{payment_link}"}),list:An({method:"GET",fullPath:"/v1/payment_links",methodType:"list"}),listLineItems:An({method:"GET",fullPath:"/v1/payment_links/{payment_link}/line_items",methodType:"list"})});var vi=c.method,Cy=c.extend({create:vi({method:"POST",fullPath:"/v1/payment_method_configurations"}),retrieve:vi({method:"GET",fullPath:"/v1/payment_method_configurations/{configuration}"}),update:vi({method:"POST",fullPath:"/v1/payment_method_configurations/{configuration}"}),list:vi({method:"GET",fullPath:"/v1/payment_method_configurations",methodType:"list"})});var kn=c.method,$y=c.extend({create:kn({method:"POST",fullPath:"/v1/payment_method_domains"}),retrieve:kn({method:"GET",fullPath:"/v1/payment_method_domains/{payment_method_domain}"}),update:kn({method:"POST",fullPath:"/v1/payment_method_domains/{payment_method_domain}"}),list:kn({method:"GET",fullPath:"/v1/payment_method_domains",methodType:"list"}),validate:kn({method:"POST",fullPath:"/v1/payment_method_domains/{payment_method_domain}/validate"})});var Tr=c.method,Ny=c.extend({create:Tr({method:"POST",fullPath:"/v1/payment_methods"}),retrieve:Tr({method:"GET",fullPath:"/v1/payment_methods/{payment_method}"}),update:Tr({method:"POST",fullPath:"/v1/payment_methods/{payment_method}"}),list:Tr({method:"GET",fullPath:"/v1/payment_methods",methodType:"list"}),attach:Tr({method:"POST",fullPath:"/v1/payment_methods/{payment_method}/attach"}),detach:Tr({method:"POST",fullPath:"/v1/payment_methods/{payment_method}/detach"})});var Er=c.method,Dy=c.extend({create:Er({method:"POST",fullPath:"/v1/payouts"}),retrieve:Er({method:"GET",fullPath:"/v1/payouts/{payout}"}),update:Er({method:"POST",fullPath:"/v1/payouts/{payout}"}),list:Er({method:"GET",fullPath:"/v1/payouts",methodType:"list"}),cancel:Er({method:"POST",fullPath:"/v1/payouts/{payout}/cancel"}),reverse:Er({method:"POST",fullPath:"/v1/payouts/{payout}/reverse"})});var wn=c.method,zy=c.extend({create:wn({method:"POST",fullPath:"/v1/plans"}),retrieve:wn({method:"GET",fullPath:"/v1/plans/{plan}"}),update:wn({method:"POST",fullPath:"/v1/plans/{plan}"}),list:wn({method:"GET",fullPath:"/v1/plans",methodType:"list"}),del:wn({method:"DELETE",fullPath:"/v1/plans/{plan}"})});var On=c.method,My=c.extend({create:On({method:"POST",fullPath:"/v1/prices"}),retrieve:On({method:"GET",fullPath:"/v1/prices/{price}"}),update:On({method:"POST",fullPath:"/v1/prices/{price}"}),list:On({method:"GET",fullPath:"/v1/prices",methodType:"list"}),search:On({method:"GET",fullPath:"/v1/prices/search",methodType:"search"})});var Je=c.method,Uy=c.extend({create:Je({method:"POST",fullPath:"/v1/products"}),retrieve:Je({method:"GET",fullPath:"/v1/products/{id}"}),update:Je({method:"POST",fullPath:"/v1/products/{id}"}),list:Je({method:"GET",fullPath:"/v1/products",methodType:"list"}),del:Je({method:"DELETE",fullPath:"/v1/products/{id}"}),createFeature:Je({method:"POST",fullPath:"/v1/products/{product}/features"}),deleteFeature:Je({method:"DELETE",fullPath:"/v1/products/{product}/features/{id}"}),listFeatures:Je({method:"GET",fullPath:"/v1/products/{product}/features",methodType:"list"}),retrieveFeature:Je({method:"GET",fullPath:"/v1/products/{product}/features/{id}"}),search:Je({method:"GET",fullPath:"/v1/products/search",methodType:"search"})});var _i=c.method,Ly=c.extend({create:_i({method:"POST",fullPath:"/v1/promotion_codes"}),retrieve:_i({method:"GET",fullPath:"/v1/promotion_codes/{promotion_code}"}),update:_i({method:"POST",fullPath:"/v1/promotion_codes/{promotion_code}"}),list:_i({method:"GET",fullPath:"/v1/promotion_codes",methodType:"list"})});var Xe=c.method,qy=c.extend({create:Xe({method:"POST",fullPath:"/v1/quotes"}),retrieve:Xe({method:"GET",fullPath:"/v1/quotes/{quote}"}),update:Xe({method:"POST",fullPath:"/v1/quotes/{quote}"}),list:Xe({method:"GET",fullPath:"/v1/quotes",methodType:"list"}),accept:Xe({method:"POST",fullPath:"/v1/quotes/{quote}/accept"}),cancel:Xe({method:"POST",fullPath:"/v1/quotes/{quote}/cancel"}),finalizeQuote:Xe({method:"POST",fullPath:"/v1/quotes/{quote}/finalize"}),listComputedUpfrontLineItems:Xe({method:"GET",fullPath:"/v1/quotes/{quote}/computed_upfront_line_items",methodType:"list"}),listLineItems:Xe({method:"GET",fullPath:"/v1/quotes/{quote}/line_items",methodType:"list"}),pdf:Xe({method:"GET",fullPath:"/v1/quotes/{quote}/pdf",host:"files.stripe.com",streaming:!0})});var Rn=c.method,jy=c.extend({create:Rn({method:"POST",fullPath:"/v1/refunds"}),retrieve:Rn({method:"GET",fullPath:"/v1/refunds/{refund}"}),update:Rn({method:"POST",fullPath:"/v1/refunds/{refund}"}),list:Rn({method:"GET",fullPath:"/v1/refunds",methodType:"list"}),cancel:Rn({method:"POST",fullPath:"/v1/refunds/{refund}/cancel"})});var Ns=c.method,Fy=c.extend({retrieve:Ns({method:"GET",fullPath:"/v1/reviews/{review}"}),list:Ns({method:"GET",fullPath:"/v1/reviews",methodType:"list"}),approve:Ns({method:"POST",fullPath:"/v1/reviews/{review}/approve"})});var fI=c.method,By=c.extend({list:fI({method:"GET",fullPath:"/v1/setup_attempts",methodType:"list"})});var Bt=c.method,Vy=c.extend({create:Bt({method:"POST",fullPath:"/v1/setup_intents"}),retrieve:Bt({method:"GET",fullPath:"/v1/setup_intents/{intent}"}),update:Bt({method:"POST",fullPath:"/v1/setup_intents/{intent}"}),list:Bt({method:"GET",fullPath:"/v1/setup_intents",methodType:"list"}),cancel:Bt({method:"POST",fullPath:"/v1/setup_intents/{intent}/cancel"}),confirm:Bt({method:"POST",fullPath:"/v1/setup_intents/{intent}/confirm"}),verifyMicrodeposits:Bt({method:"POST",fullPath:"/v1/setup_intents/{intent}/verify_microdeposits"})});var bi=c.method,Gy=c.extend({create:bi({method:"POST",fullPath:"/v1/shipping_rates"}),retrieve:bi({method:"GET",fullPath:"/v1/shipping_rates/{shipping_rate_token}"}),update:bi({method:"POST",fullPath:"/v1/shipping_rates/{shipping_rate_token}"}),list:bi({method:"GET",fullPath:"/v1/shipping_rates",methodType:"list"})});var Cn=c.method,Hy=c.extend({create:Cn({method:"POST",fullPath:"/v1/sources"}),retrieve:Cn({method:"GET",fullPath:"/v1/sources/{source}"}),update:Cn({method:"POST",fullPath:"/v1/sources/{source}"}),listSourceTransactions:Cn({method:"GET",fullPath:"/v1/sources/{source}/source_transactions",methodType:"list"}),verify:Cn({method:"POST",fullPath:"/v1/sources/{source}/verify"})});var $n=c.method,Zy=c.extend({create:$n({method:"POST",fullPath:"/v1/subscription_items"}),retrieve:$n({method:"GET",fullPath:"/v1/subscription_items/{item}"}),update:$n({method:"POST",fullPath:"/v1/subscription_items/{item}"}),list:$n({method:"GET",fullPath:"/v1/subscription_items",methodType:"list"}),del:$n({method:"DELETE",fullPath:"/v1/subscription_items/{item}"})});var Ir=c.method,Wy=c.extend({create:Ir({method:"POST",fullPath:"/v1/subscription_schedules"}),retrieve:Ir({method:"GET",fullPath:"/v1/subscription_schedules/{schedule}"}),update:Ir({method:"POST",fullPath:"/v1/subscription_schedules/{schedule}"}),list:Ir({method:"GET",fullPath:"/v1/subscription_schedules",methodType:"list"}),cancel:Ir({method:"POST",fullPath:"/v1/subscription_schedules/{schedule}/cancel"}),release:Ir({method:"POST",fullPath:"/v1/subscription_schedules/{schedule}/release"})});var Ot=c.method,Ky=c.extend({create:Ot({method:"POST",fullPath:"/v1/subscriptions"}),retrieve:Ot({method:"GET",fullPath:"/v1/subscriptions/{subscription_exposed_id}"}),update:Ot({method:"POST",fullPath:"/v1/subscriptions/{subscription_exposed_id}"}),list:Ot({method:"GET",fullPath:"/v1/subscriptions",methodType:"list"}),cancel:Ot({method:"DELETE",fullPath:"/v1/subscriptions/{subscription_exposed_id}"}),deleteDiscount:Ot({method:"DELETE",fullPath:"/v1/subscriptions/{subscription_exposed_id}/discount"}),resume:Ot({method:"POST",fullPath:"/v1/subscriptions/{subscription}/resume"}),search:Ot({method:"GET",fullPath:"/v1/subscriptions/search",methodType:"search"})});var Jy=c.method,Xy=c.extend({retrieve:Jy({method:"GET",fullPath:"/v1/tax_codes/{id}"}),list:Jy({method:"GET",fullPath:"/v1/tax_codes",methodType:"list"})});var Pi=c.method,Yy=c.extend({create:Pi({method:"POST",fullPath:"/v1/tax_ids"}),retrieve:Pi({method:"GET",fullPath:"/v1/tax_ids/{id}"}),list:Pi({method:"GET",fullPath:"/v1/tax_ids",methodType:"list"}),del:Pi({method:"DELETE",fullPath:"/v1/tax_ids/{id}"})});var xi=c.method,Qy=c.extend({create:xi({method:"POST",fullPath:"/v1/tax_rates"}),retrieve:xi({method:"GET",fullPath:"/v1/tax_rates/{tax_rate}"}),update:xi({method:"POST",fullPath:"/v1/tax_rates/{tax_rate}"}),list:xi({method:"GET",fullPath:"/v1/tax_rates",methodType:"list"})});var eg=c.method,tg=c.extend({create:eg({method:"POST",fullPath:"/v1/tokens"}),retrieve:eg({method:"GET",fullPath:"/v1/tokens/{token}"})});var Nn=c.method,rg=c.extend({create:Nn({method:"POST",fullPath:"/v1/topups"}),retrieve:Nn({method:"GET",fullPath:"/v1/topups/{topup}"}),update:Nn({method:"POST",fullPath:"/v1/topups/{topup}"}),list:Nn({method:"GET",fullPath:"/v1/topups",methodType:"list"}),cancel:Nn({method:"POST",fullPath:"/v1/topups/{topup}/cancel"})});var Rt=c.method,ng=c.extend({create:Rt({method:"POST",fullPath:"/v1/transfers"}),retrieve:Rt({method:"GET",fullPath:"/v1/transfers/{transfer}"}),update:Rt({method:"POST",fullPath:"/v1/transfers/{transfer}"}),list:Rt({method:"GET",fullPath:"/v1/transfers",methodType:"list"}),createReversal:Rt({method:"POST",fullPath:"/v1/transfers/{id}/reversals"}),listReversals:Rt({method:"GET",fullPath:"/v1/transfers/{id}/reversals",methodType:"list"}),retrieveReversal:Rt({method:"GET",fullPath:"/v1/transfers/{transfer}/reversals/{id}"}),updateReversal:Rt({method:"POST",fullPath:"/v1/transfers/{transfer}/reversals/{id}"})});var Dn=c.method,og=c.extend({create:Dn({method:"POST",fullPath:"/v1/webhook_endpoints"}),retrieve:Dn({method:"GET",fullPath:"/v1/webhook_endpoints/{webhook_endpoint}"}),update:Dn({method:"POST",fullPath:"/v1/webhook_endpoints/{webhook_endpoint}"}),list:Dn({method:"GET",fullPath:"/v1/webhook_endpoints",methodType:"list"}),del:Dn({method:"DELETE",fullPath:"/v1/webhook_endpoints/{webhook_endpoint}"})});var hI=oe("apps",{Secrets:Ih}),yI=oe("billing",{Alerts:vf,CreditBalanceSummary:wf,CreditBalanceTransactions:Rf,CreditGrants:Cf,MeterEventAdjustments:Hf,MeterEvents:Jf,Meters:Yf}),gI=oe("billingPortal",{Configurations:Ef,Sessions:Ah}),vI=oe("checkout",{Sessions:kh}),_I=oe("climate",{Orders:Qf,Products:ch,Suppliers:Nh}),bI=oe("entitlements",{ActiveEntitlements:gf,Features:jf}),PI=oe("financialConnections",{Accounts:hf,Sessions:Oh,Transactions:jh}),xI=oe("forwarding",{Requests:Sh}),SI=oe("identity",{VerificationReports:Kh,VerificationSessions:Jh}),TI=oe("issuing",{Authorizations:bf,Cardholders:xf,Cards:Tf,Disputes:zf,PersonalizationDesigns:ih,PhysicalBundles:sh,Tokens:zh,Transactions:Fh}),EI=oe("radar",{EarlyFraudWarnings:Uf,ValueListItems:Hh,ValueLists:Zh}),II=oe("reporting",{ReportRuns:bh,ReportTypes:xh}),AI=oe("sigma",{ScheduledQueryRuns:Eh}),kI=oe("tax",{Calculations:Pf,Registrations:_h,Settings:Ch,Transactions:Bh}),wI=oe("terminal",{Configurations:If,ConnectionTokens:kf,Locations:Gf,Readers:ph}),OI=oe("testHelpers",{ConfirmationTokens:Af,Customers:Nf,Refunds:vh,TestClocks:Dh,Issuing:oe("issuing",{Authorizations:_f,Cards:Sf,PersonalizationDesigns:oh,Transactions:Lh}),Terminal:oe("terminal",{Readers:lh}),Treasury:oe("treasury",{InboundTransfers:Bf,OutboundPayments:eh,OutboundTransfers:rh,ReceivedCredits:dh,ReceivedDebits:hh})}),RI=oe("treasury",{CreditReversals:$f,DebitReversals:Df,FinancialAccounts:Ff,InboundTransfers:Vf,OutboundPayments:th,OutboundTransfers:nh,ReceivedCredits:fh,ReceivedDebits:gh,TransactionEntries:Uh,Transactions:Gh}),CI=oe("v2",{Billing:oe("billing",{MeterEventAdjustments:Zf,MeterEventSession:Wf,MeterEventStream:Kf,MeterEvents:Xf}),Core:oe("core",{EventDestinations:Lf,Events:qf})});var ig="api.stripe.com",ag="443",sg="/v1/",ug=ff,cg=8e4,lg=5,pg=.5,$I=["name","version","url","partner_id"],dg=["authenticator","apiVersion","typescript","maxNetworkRetries","httpAgent","httpClient","timeout","host","port","protocol","telemetry","appInfo","stripeAccount","stripeContext"],NI=a(e=>new Yo(e,c.MAX_BUFFERED_REQUEST_METRICS),"defaultRequestSenderFactory");function mg(e,t=NI){r.PACKAGE_VERSION="18.2.1",r.USER_AGENT=Object.assign({bindings_version:r.PACKAGE_VERSION,lang:"node",publisher:"stripe",uname:null,typescript:!1},nf()),r.StripeResource=c,r.resources=Ar,r.HttpClient=xe,r.HttpClientResponse=Tt,r.CryptoProvider=St,r.webhooks=mf(e);function r(n,o={}){if(!(this instanceof r))return new r(n,o);let i=this._getPropsFromConfig(o);this._platformFunctions=e,Object.defineProperty(this,"_emitter",{value:this._platformFunctions.createEmitter(),enumerable:!1,configurable:!1,writable:!1}),this.VERSION=r.PACKAGE_VERSION,this.on=this._emitter.on.bind(this._emitter),this.once=this._emitter.once.bind(this._emitter),this.off=this._emitter.removeListener.bind(this._emitter);let s=i.httpAgent||null;this._api={host:i.host||ig,port:i.port||ag,protocol:i.protocol||"https",basePath:sg,version:i.apiVersion||ug,timeout:qo("timeout",i.timeout,cg),maxNetworkRetries:qo("maxNetworkRetries",i.maxNetworkRetries,2),agent:s,httpClient:i.httpClient||(s?this._platformFunctions.createNodeHttpClient(s):this._platformFunctions.createDefaultHttpClient()),dev:!1,stripeAccount:i.stripeAccount||null,stripeContext:i.stripeContext||null};let l=i.typescript||!1;l!==r.USER_AGENT.typescript&&(r.USER_AGENT.typescript=l),i.appInfo&&this._setAppInfo(i.appInfo),this._prepResources(),this._setAuthenticator(n,i.authenticator),this.errors=Jo,this.webhooks=r.webhooks,this._prevRequestMetrics=[],this._enableTelemetry=i.telemetry!==!1,this._requestSender=t(this),this.StripeResource=r.StripeResource}return a(r,"Stripe"),r.errors=Jo,r.createNodeHttpClient=e.createNodeHttpClient,r.createFetchHttpClient=e.createFetchHttpClient,r.createNodeCryptoProvider=e.createNodeCryptoProvider,r.createSubtleCryptoProvider=e.createSubtleCryptoProvider,r.prototype={_appInfo:void 0,on:null,off:null,once:null,VERSION:null,StripeResource:null,webhooks:null,errors:null,_api:null,_prevRequestMetrics:null,_emitter:null,_enableTelemetry:null,_requestSender:null,_platformFunctions:null,rawRequest(n,o,i,s){return this._requestSender._rawRequest(n,o,i,s)},_setAuthenticator(n,o){if(n&&o)throw new Error("Can't specify both apiKey and authenticator");if(!n&&!o)throw new Error("Neither apiKey nor config.authenticator provided");this._authenticator=n?zo(n):o},_setAppInfo(n){if(n&&typeof n!="object")throw new Error("AppInfo must be an object.");if(n&&!n.name)throw new Error("AppInfo.name is required");n=n||{},this._appInfo=$I.reduce((o,i)=>(typeof n[i]=="string"&&(o=o||{},o[i]=n[i]),o),{})},_setApiField(n,o){this._api[n]=o},getApiField(n){return this._api[n]},setClientId(n){this._clientId=n},getClientId(){return this._clientId},getConstant:a(n=>{switch(n){case"DEFAULT_HOST":return ig;case"DEFAULT_PORT":return ag;case"DEFAULT_BASE_PATH":return sg;case"DEFAULT_API_VERSION":return ug;case"DEFAULT_TIMEOUT":return cg;case"MAX_NETWORK_RETRY_DELAY_SEC":return lg;case"INITIAL_NETWORK_RETRY_DELAY_SEC":return pg}return r[n]},"getConstant"),getMaxNetworkRetries(){return this.getApiField("maxNetworkRetries")},_setApiNumberField(n,o,i){let s=qo(n,o,i);this._setApiField(n,s)},getMaxNetworkRetryDelay(){return lg},getInitialNetworkRetryDelay(){return pg},getClientUserAgent(n){return this.getClientUserAgentSeeded(r.USER_AGENT,n)},getClientUserAgentSeeded(n,o){this._platformFunctions.getUname().then(i=>{var s;let l={};for(let b in n)Object.prototype.hasOwnProperty.call(n,b)&&(l[b]=encodeURIComponent((s=n[b])!==null&&s!==void 0?s:"null"));l.uname=encodeURIComponent(i||"UNKNOWN");let d=this.getApiField("httpClient");d&&(l.httplib=encodeURIComponent(d.getClientName())),this._appInfo&&(l.application=this._appInfo),o(JSON.stringify(l))})},getAppInfoAsString(){if(!this._appInfo)return"";let n=this._appInfo.name;return this._appInfo.version&&(n+=`/${this._appInfo.version}`),this._appInfo.url&&(n+=` (${this._appInfo.url})`),n},getTelemetryEnabled(){return this._enableTelemetry},_prepResources(){for(let n in Ar)Object.prototype.hasOwnProperty.call(Ar,n)&&(this[tf(n)]=new Ar[n](this))},_getPropsFromConfig(n){if(!n)return{};let o=typeof n=="string";if(!(n===Object(n)&&!Array.isArray(n))&&!o)throw new Error("Config must either be an object or a string");if(o)return{apiVersion:n};if(Object.keys(n).filter(l=>!dg.includes(l)).length>0)throw new Error(`Config object may only contain the following: ${dg.join(", ")}`);return n},parseThinEvent(n,o,i,s,l,d){return this.webhooks.constructEvent(n,o,i,s,l,d)}},r}a(mg,"createStripe");var fg=mg(new Xo);var ut="https://api.stripe.com/v1",Ie=a(e=>new fg(e,{apiVersion:"2025-05-28.basil"}),"getClient"),_={baseUrl:ut,subscribeWebhook:a(async(e,t,r)=>{let n={method:"POST",url:`${ut}/webhook_endpoints`,headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{enabled_events:[e],url:t},authentication:{type:"BEARER_TOKEN",token:r},queryParams:{}},{body:o}=await v.sendRequest(n);return o},"subscribeWebhook"),unsubscribeWebhook:a(async(e,t)=>{let r={method:"DELETE",url:`${ut}/webhook_endpoints/${e}`,authentication:{type:"BEARER_TOKEN",token:t}};return await v.sendRequest(r)},"unsubscribeWebhook"),invoice:u.Dropdown({auth:g,displayName:"Invoice",required:!0,refreshers:[],options:a(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your Stripe account first"};try{return{disabled:!1,options:(await Ie(e.secret_text).invoices.list({limit:100,expand:["data.customer"]})).data.map(n=>{let o=n.customer,i=o?.name||o?.email||"Unknown Customer",s=(n.total/100).toFixed(2),l=`Invoice #${n.number||n.id} for ${i} (${s} ${n.currency.toUpperCase()})`;return{value:n.id,label:l}}).filter(n=>n.value!==void 0&&n.value!==null)}}catch(t){return console.error("Failed to load Stripe invoices:",t),{disabled:!0,options:[],placeholder:"Error loading invoices. Check connection."}}},"options")}),customer:u.Dropdown({auth:g,displayName:"Customer",required:!0,refreshers:[],options:a(async({auth:e,searchValue:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account"};let r={method:"GET",authentication:{type:"BEARER_TOKEN",token:e.secret_text},url:t?`${ut}/customers/search`:`${ut}/customers`,queryParams:t?{query:`name~"${t}" OR email~"${t}"`}:{limit:"100"}},n=await v.sendRequest(r);return n.status===200?{disabled:!1,options:n.body.data.map(o=>({value:o.id,label:`${o.name||o.id} (${o.email||"No Email"})`}))}:{disabled:!0,options:[],placeholder:"Couldn't load customers"}},"options")}),product:u.Dropdown({auth:g,displayName:"Product",required:!0,refreshers:[],options:a(async({auth:e,searchValue:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account"};let r="active:'true'";t&&(r+=` AND name~"${t}"`);let n=await v.sendRequest({method:"GET",url:`${ut}/products/search`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},queryParams:{query:r}});return n.status===200?{disabled:!1,options:n.body.data.map(o=>({value:o.id,label:o.name}))}:{disabled:!0,options:[],placeholder:"Couldn't load products"}},"options")}),price:u.Dropdown({auth:g,displayName:"Price",required:!0,refreshers:[],options:a(async({auth:e,searchValue:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account"};let r=await v.sendRequest({method:"GET",url:`${ut}/prices/search`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},queryParams:{query:`active:'true' AND type:'recurring' AND (product.name~"${t||""}" OR nickname~"${t||""}")`,expand:"data.product"}});return r.status===200?{disabled:!1,options:r.body.data.map(n=>{let o=n.nickname?`${n.nickname} (${n.product.name})`:n.product.name;return{value:n.id,label:o}})}:{disabled:!0,options:[],placeholder:"Couldn't load prices"}},"options")}),subscription:u.Dropdown({auth:g,displayName:"Subscription",required:!0,refreshers:[],options:a(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:(await Ie(e.secret_text).subscriptions.list({limit:100,status:"active",expand:["data.customer"]})).data.map(n=>{let o=n.customer,s=`Subscription for ${o?.name||o?.email||"Unknown Customer"} (${n.id})`;return{value:n.id,label:s}})}}catch(t){return console.error("Failed to load Stripe subscriptions:",t),{disabled:!0,options:[],placeholder:"Couldn't load subscriptions. See console."}}},"options")}),payout:u.Dropdown({auth:g,displayName:"Payout",required:!0,refreshers:[],options:a(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account"};let t=await v.sendRequest({method:"GET",url:`${ut}/payouts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},queryParams:{limit:"100"}});return t.status===200?{disabled:!1,options:t.body.data.map(r=>{let n=new Date(r.arrival_date*1e3).toLocaleDateString(),o=(r.amount/100).toFixed(2),i=`Payout on ${n} - ${o} ${r.currency.toUpperCase()} (${r.status})`;return{value:r.id,label:i}})}:{disabled:!0,options:[],placeholder:"Couldn't load payouts"}},"options")}),paymentIntent:u.Dropdown({auth:g,displayName:"Payment Intent",required:!0,refreshers:[],options:a(async({auth:e,searchValue:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account"};let r="status:'succeeded'";t&&(r+=` AND customer.email~"${t}"`);let n=await v.sendRequest({method:"GET",url:`${ut}/payment_intents/search`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},queryParams:{query:r,"expand[]":"data.customer"}});return n.status===200?{disabled:!1,options:n.body.data.map(o=>{let i=o.customer?.name||o.customer?.email||"Unknown Customer",s=(o.amount/100).toFixed(2),l=`Payment from ${i} - ${s} ${o.currency.toUpperCase()}`;return{value:o.id,label:l}})}:{disabled:!0,options:[],placeholder:"Couldn't load payment intents"}},"options")}),paymentLink:u.Dropdown({auth:g,displayName:"Payment Link",required:!0,refreshers:[],options:a(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account"};try{return{disabled:!1,options:(await Ie(e.secret_text).paymentLinks.list({active:!0,limit:100})).data.map(n=>({value:n.id,label:n.url}))}}catch{return{disabled:!0,options:[],placeholder:"Couldn't load payment links"}}},"options")})};var hg=x({name:"search_customer",auth:g,displayName:"Search Customer",description:"Search for a customer in stripe by email",audience:"human",aiMetadata:{description:"Looks up Stripe customers matching a given email address. Use to find an existing customer record before creating, updating, or charging one, to avoid duplicates. Read-only and idempotent; matches on the exact email.",idempotent:!0},props:{email:u.ShortText({displayName:"Email",description:void 0,required:!0})},outputSchema:xo,async run(e){let t={email:e.propsValue.email};return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/customers/search`,headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded","Stripe-Version":"2026-02-25.clover"},body:{query:`email:'${t.email}'`}})).body}});var yg=te({auth:g,name:"new_customer",displayName:"New Customer",description:"Triggers when a new customer is created",aiMetadata:{description:"Fires when a new customer is created in Stripe (the customer.created event), emitting the new customer record. Use to react to customer onboarding, such as syncing them to a CRM or sending a welcome flow."},props:{},outputSchema:Oe,sampleData:{id:"cus_NGtyEf4hNGTj3p",object:"customer",address:null,balance:0,created:1675180509,currency:null,default_currency:null,default_source:null,delinquent:!1,description:null,discount:null,email:"jane@example.com",invoice_prefix:"B7162248",invoice_settings:{custom_fields:null,default_payment_method:null,footer:null,rendering_options:null},livemode:!1,metadata:{},name:"John Doe",next_invoice_sequence:1,phone:null,preferred_locales:[],shipping:null,tax_exempt:"none",test_clock:null},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("customer.created",e.webhookUrl,e.auth.secret_text);await e.store.put("_new_customer_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store?.get("_new_customer_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/customers",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded","Stripe-Version":"2026-02-25.clover"},queryParams:{limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){return[e.payload.body.data.object]}});var gg=te({auth:g,name:"new_payment",displayName:"New Payment",description:"Triggers when a new payment is made",aiMetadata:{description:"Fires when a payment succeeds in Stripe (the payment_intent.succeeded event), emitting the completed payment. Use to react to a successful payment, such as fulfilling an order or recording revenue."},props:{},type:"WEBHOOK",outputSchema:Te,sampleData:{id:"pi_3MWM7aKZ0dZRqLEK1soCKVrq",object:"payment_intent",amount:1e4,amount_capturable:0,amount_received:1e4,capture_method:"automatic_async",confirmation_method:"automatic",created:1675180355,currency:"usd",customer:"cus_NGtvUQ18FJXcGI",description:"Subscription creation",latest_charge:"ch_3MWM7aKZ0dZRqLEK1soCKVrq",livemode:!1,metadata:{},payment_method:"pm_1MWM8MKZ0dZRqLEKnIH41f76",receipt_email:null,setup_future_usage:null,status:"succeeded"},async onEnable(e){let t=await _.subscribeWebhook("payment_intent.succeeded",e.webhookUrl,e.auth.secret_text);await e.store?.put("_new_payment_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store?.get("_new_payment_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/payment_intents/search",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded","Stripe-Version":"2026-02-25.clover"},queryParams:{query:'status:"succeeded"',limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){return[e.payload.body.data.object]}});var vg=te({auth:g,name:"new_subscription",displayName:"New Subscription",description:"Triggers when a new subscription is made",aiMetadata:{description:"Fires when a new subscription is created in Stripe (the customer.subscription.created event), emitting the new subscription. Use to react to a customer starting recurring billing, such as provisioning access or sending an onboarding flow."},props:{},type:"WEBHOOK",outputSchema:be,sampleData:{id:"sub_1MWMJXKZ0dZRqLEKJX80JXfv",object:"subscription",application:null,application_fee_percent:null,automatic_tax:{enabled:!0},billing_cycle_anchor:1675181047,billing_thresholds:null,cancel_at:null,cancel_at_period_end:!1,canceled_at:null,collection_method:"charge_automatically",created:1675181047,currency:"usd",current_period_end:1677600247,current_period_start:1675181047,customer:"cus_NGtvUQ18FJXcGI",days_until_due:null,default_payment_method:"pm_1MWM8MKZ0dZRqLEKnIH41f76",default_source:null,default_tax_rates:[],description:null,discount:null,ended_at:null,items:{object:"list",data:[{id:"si_NGu7pb7hS3Rps3",object:"subscription_item",billing_thresholds:null,created:1675181048,metadata:{},plan:{id:"price_1MWLz3KZ0dZRqLEK06gRMHCF",object:"plan",active:!0,aggregate_usage:null,amount:1e4,amount_decimal:"10000",billing_scheme:"per_unit",created:1675179777,currency:"usd",interval:"month",interval_count:1,livemode:!1,metadata:{},nickname:null,product:"prod_NGtm3AlvaGjaLN",tiers_mode:null,transform_usage:null,trial_period_days:null,usage_type:"licensed"},price:{id:"price_1MWLz3KZ0dZRqLEK06gRMHCF",object:"price",active:!0,billing_scheme:"per_unit",created:1675179777,currency:"usd",custom_unit_amount:null,livemode:!1,lookup_key:null,metadata:{},nickname:null,product:"prod_NGtm3AlvaGjaLN",recurring:{aggregate_usage:null,interval:"month",interval_count:1,trial_period_days:null,usage_type:"licensed"},tax_behavior:"exclusive",tiers_mode:null,transform_quantity:null,type:"recurring",unit_amount:1e4,unit_amount_decimal:"10000"},quantity:1,subscription:"sub_1MWMJXKZ0dZRqLEKJX80JXfv",tax_rates:[]}],has_more:!1,total_count:1,url:"/v1/subscription_items?subscription=sub_1MWMJXKZ0dZRqLEKJX80JXfv"},latest_invoice:"in_1MWMJXKZ0dZRqLEKIu4a51u7",livemode:!1,metadata:{},next_pending_invoice_item_invoice:null,on_behalf_of:null,pause_collection:null,payment_settings:{payment_method_options:null,payment_method_types:null,save_default_payment_method:"off"},pending_invoice_item_interval:null,pending_setup_intent:null,pending_update:null,plan:{id:"price_1MWLz3KZ0dZRqLEK06gRMHCF",object:"plan",active:!0,aggregate_usage:null,amount:1e4,amount_decimal:"10000",billing_scheme:"per_unit",created:1675179777,currency:"usd",interval:"month",interval_count:1,livemode:!1,metadata:{},nickname:null,product:"prod_NGtm3AlvaGjaLN",tiers_mode:null,transform_usage:null,trial_period_days:null,usage_type:"licensed"},quantity:1,schedule:null,start_date:1675181047,status:"active",test_clock:null,transfer_data:null,trial_end:null,trial_start:null},async onEnable(e){let t=await _.subscribeWebhook("customer.subscription.created",e.webhookUrl,e.auth.secret_text);await e.store?.put("_new_customer_subscription_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store?.get("_new_customer_subscription_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/subscriptions",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){return[e.payload.body.data.object]}});var _g=te({auth:g,name:"payment_failed",displayName:"Payment Failed",description:"Triggers when a payment fails",aiMetadata:{description:"Fires when a charge fails in Stripe (the charge.failed event), emitting the failed charge including its failure code and message. Use to react to declined payments, such as alerting the customer or triggering a retry/dunning flow."},props:{},outputSchema:ir,sampleData:{id:"ch_3MWMPQKZ0dZRqLEK063rxD7q",object:"charge",amount:1e5,amount_captured:0,amount_refunded:0,application:null,application_fee:null,application_fee_amount:null,balance_transaction:null,billing_details:{address:{city:null,country:null,line1:null,line2:null,postal_code:"12321",state:null},email:null,name:null,phone:null},calculated_statement_descriptor:"WWW.ACTIVEPIECES.COM",captured:!1,created:1675181413,currency:"usd",customer:"cus_NGtvUQ18FJXcGI",description:"Failed Payment",destination:null,dispute:null,disputed:!1,failure_balance_transaction:null,failure_code:"card_declined",failure_message:"Your card was declined.",fraud_details:{},invoice:null,livemode:!1,metadata:{},on_behalf_of:null,order:null,outcome:{network_status:"declined_by_network",reason:"generic_decline",risk_level:"normal",risk_score:60,seller_message:"The bank did not return any further details with this decline.",type:"issuer_declined"},paid:!1,payment_intent:"pi_3MWMPQKZ0dZRqLEK0Nsc6WhL",payment_method:"src_1MWMPQKZ0dZRqLEKuQ83wmZI",payment_method_details:{card:{brand:"visa",checks:{address_line1_check:null,address_postal_code_check:"pass",cvc_check:"pass"},country:"US",exp_month:12,exp_year:2031,fingerprint:"mtYxM2Q4edpEt8Pw",funding:"credit",installments:null,last4:"0341",mandate:null,network:"visa",three_d_secure:null,wallet:null},type:"card"},receipt_email:null,receipt_number:null,receipt_url:null,refunded:!1,refunds:{object:"list",data:[],has_more:!1,total_count:0,url:"/v1/charges/ch_3MWMPQKZ0dZRqLEK063rxD7q/refunds"},review:null,shipping:null,source:{id:"src_1MWMPQKZ0dZRqLEKuQ83wmZI",object:"source",amount:null,card:{exp_month:12,exp_year:2031,last4:"0341",country:"US",brand:"Visa",address_zip_check:"pass",cvc_check:"pass",funding:"credit",fingerprint:"mtYxM2Q4edpEt8Pw",three_d_secure:"optional",name:null,address_line1_check:null,tokenization_method:null,dynamic_last4:null},client_secret:"src_client_secret_TlLkl6IvhCvmbx8Cz12YNDVb",created:1675181413,currency:null,flow:"none",livemode:!1,metadata:{},owner:{address:{city:null,country:null,line1:null,line2:null,postal_code:"12321",state:null},email:null,name:null,phone:null,verified_address:null,verified_email:null,verified_name:null,verified_phone:null},statement_descriptor:null,status:"chargeable",type:"card",usage:"reusable"},source_transfer:null,statement_descriptor:"www.activepieces.com",statement_descriptor_suffix:null,status:"failed",transfer_data:null,transfer_group:null},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("charge.failed",e.webhookUrl,e.auth.secret_text);await e.store?.put("_payment_failed_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store?.get("_payment_failed_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/charges/search",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded","Stripe-Version":"2026-02-25.clover"},queryParams:{query:'status:"failed"',limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){return[e.payload.body.data.object]}});var DI=[{label:"All Statuses",value:""},{label:"Active",value:"active"},{label:"Past Due",value:"past_due"},{label:"Unpaid",value:"unpaid"},{label:"Canceled",value:"canceled"},{label:"Incomplete",value:"incomplete"},{label:"Incomplete Expired",value:"incomplete_expired"},{label:"Trialing",value:"trialing"},{label:"Paused",value:"paused"}],bg=x({name:"search_subscriptions",auth:g,displayName:"Search Subscriptions",description:"Search for subscriptions by price ID, status, customer ID and other filters, including customer details",audience:"human",aiMetadata:{description:"Lists and filters Stripe subscriptions by price ID, status, customer ID, and creation date range, optionally expanding full customer details for each. Use to find subscriptions matching criteria or to audit a customer's subscriptions; supports paging through all results. Read-only and idempotent.",idempotent:!0},props:{price_ids:u.LongText({displayName:"Price IDs",description:"Comma-separated list of price IDs to filter by (e.g., price_1ABC123, price_2DEF456)",required:!1}),status:u.StaticDropdown({displayName:"Subscription Status",description:"Filter by subscription status",required:!1,options:{options:DI}}),customer_id:u.ShortText({displayName:"Customer ID",description:"Filter by specific customer ID (optional)",required:!1}),created_after:u.DateTime({displayName:"Created After",description:"Filter subscriptions created after this date (YYYY-MM-DD format)",required:!1}),created_before:u.DateTime({displayName:"Created Before",description:"Filter subscriptions created before this date (YYYY-MM-DD format)",required:!1}),limit:u.Number({displayName:"Limit",description:"Maximum number of subscriptions to return (default: 100, set to 0 for all)",required:!1,defaultValue:100}),fetch_all:u.Checkbox({displayName:"Fetch All Results",description:"Fetch all matching subscriptions (ignores limit, may take longer for large datasets)",required:!1,defaultValue:!1}),include_customer_details:u.Checkbox({displayName:"Include Customer Details",description:"Fetch detailed customer information for each subscription",required:!1,defaultValue:!0})},outputSchema:So,async run(e){let{price_ids:t,status:r,customer_id:n,created_after:o,created_before:i,limit:s=100,fetch_all:l=!1,include_customer_details:d=!0}=e.propsValue,b=a(T=>{let A=new URLSearchParams;if(A.append("limit","100"),A.append("expand[]","data.items.data.price"),d&&A.append("expand[]","data.customer"),r&&A.append("status",r),n&&A.append("customer",n),o){let k=Math.floor(new Date(o).getTime()/1e3);A.append("created[gte]",k.toString())}if(i){let k=Math.floor(new Date(i).getTime()/1e3);A.append("created[lte]",k.toString())}return T&&A.append("starting_after",T),A},"buildQueryParams"),m=[],P=!0,y,p=0,h=l?50:Math.ceil(s/100);for(;P&&p<h;){let T=b(y),A=await v.sendRequest({method:"GET",url:`${_.baseUrl}/subscriptions?${T.toString()}`,headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"}});if(!A.body)throw new Error("Failed to fetch subscriptions from Stripe");let k=A.body.data;if(m=m.concat(k),P=A.body.has_more,p++,P&&k.length>0&&(y=k[k.length-1].id),!l&&m.length>=s){m=m.slice(0,s);break}}let E=m;if(t&&t.trim()){let T=t.split(",").map(A=>A.trim()).filter(A=>A.length>0);T.length>0&&(E=E.filter(A=>A.items.data.some(k=>k.price&&typeof k.price=="object"&&T.includes(k.price.id))))}let S=await Promise.all(E.map(async T=>{let A={...T};if(d){if(typeof T.customer=="object"&&T.customer!==null&&!("deleted"in T.customer&&T.customer.deleted))A.customer=T.customer;else if(typeof T.customer=="string")try{let k=await v.sendRequest({method:"GET",url:`${_.baseUrl}/customers/${T.customer}`,headers:{Authorization:"Bearer "+e.auth.secret_text}});A.customer=k.body}catch(k){console.warn(`Failed to fetch customer details for ${T.customer}:`,k)}}return A}));return{success:!0,count:S.length,total_fetched:m.length,requests_made:p,has_more_available:P&&!l,pagination_info:{limit_requested:l?"All":s,fetch_all_enabled:l,max_requests_limit:h},subscriptions:S,filters_applied:{price_ids:t?t.split(",").map(T=>T.trim()).filter(T=>T.length>0):null,status:r||null,customer_id:n||null,created_after:o||null,created_before:i||null,limit:s,fetch_all:l,include_customer_details:d}}}});var Pg=te({auth:g,name:"new_charge",displayName:"New Charge",description:"Fires when a charge is successfully completed.",aiMetadata:{description:"Fires when a charge is successfully completed in Stripe (the charge.succeeded event), emitting the charge record. Use to react to a successful card charge; note this is the charge-level event, distinct from the New Payment trigger which fires on a succeeded payment intent."},props:{},outputSchema:ir,sampleData:{id:"ch_3MmlLrLkdIwHu7ix0snN0B15",object:"charge",amount:1099,amount_captured:1099,amount_refunded:0,application:null,application_fee:null,application_fee_amount:null,balance_transaction:"txn_3MmlLrLkdIwHu7ix0uke3Ezy",billing_details:{address:{city:null,country:null,line1:null,line2:null,postal_code:null,state:null},email:"customer@example.com",name:"John Doe",phone:null},captured:!0,created:1679090539,currency:"usd",customer:"cus_ABC123",description:"My First Test Charge",disputed:!1,paid:!0,payment_intent:"pi_123",payment_method:"pm_123",receipt_url:"https://pay.stripe.com/receipts/...",refunded:!1,status:"succeeded"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("charge.succeeded",e.webhookUrl,e.auth.secret_text);await e.store.put("_new_charge_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_new_charge_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/charges/search",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded","Stripe-Version":"2026-02-25.clover"},queryParams:{query:'status:"succeeded"',limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){return[e.payload.body.data.object]}});var xg=te({auth:g,name:"new_invoice",displayName:"New Invoice",description:"Fires when an invoice is created. Supports filters like status, customer, subscription.",aiMetadata:{description:"Fires when an invoice is created in Stripe (the invoice.created event), emitting the new invoice. Optional filters narrow firing to a specific status, customer ID, or subscription ID. Use to react to newly issued invoices, for example to record or forward them."},props:{status:u.StaticDropdown({displayName:"Status",description:"Only trigger for invoices with this status.",required:!1,options:{options:[{label:"Draft",value:"draft"},{label:"Open",value:"open"},{label:"Paid",value:"paid"},{label:"Uncollectible",value:"uncollectible"},{label:"Void",value:"void"}]}}),customer:u.ShortText({displayName:"Customer ID",description:"Only trigger for invoices belonging to this customer ID (e.g., `cus_...`).",required:!1}),subscription:u.ShortText({displayName:"Subscription ID",description:"Only trigger for invoices belonging to this subscription ID (e.g., `sub_...`).",required:!1})},outputSchema:ge,sampleData:{id:"in_1MtHbELkdIwHu7ixl4OzzPMv",object:"invoice",customer:"cus_NeZwdNtLEOXuvB",subscription:"sub_12345ABC",status:"paid",amount_due:999,amount_paid:999,amount_remaining:0,billing_reason:"subscription_cycle",collection_method:"charge_automatically",created:1680644467,currency:"usd",customer_email:"jennyrosen@example.com",customer_name:"Jenny Rosen",hosted_invoice_url:"https://invoice.stripe.com/i/acct_...",invoice_pdf:"https://pay.stripe.com/invoice/acct_.../pdf",livemode:!1,number:"ABC-123-456"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("invoice.created",e.webhookUrl,e.auth.secret_text);await e.store.put("_new_invoice_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_new_invoice_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/invoices",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{status:n,customer:o,subscription:i}=e.propsValue;return n&&r.status!==n?[]:o&&r.customer!==o?[]:i&&r.subscription!==i?[]:[r]}});var Sg=te({auth:g,name:"invoice_payment_failed",displayName:"Invoice Payment Failed",description:"Fires when a payment against an invoice fails.",aiMetadata:{description:"Fires when a payment against an invoice fails in Stripe (the invoice.payment_failed event), emitting the affected invoice including the finalization error. An optional customer ID filter narrows firing to one customer. Use to react to failed invoice payments, such as starting a dunning or retry flow."},props:{customer:u.ShortText({displayName:"Customer ID",description:"Only trigger for invoices belonging to this customer ID (e.g., `cus_...`).",required:!1})},outputSchema:ge,sampleData:{id:"in_1MtHbELkdIwHu7ixl4OzzPMv",object:"invoice",customer:"cus_NeZwdNtLEOXuvB",status:"open",amount_due:1500,amount_paid:0,amount_remaining:1500,attempt_count:1,attempted:!0,billing_reason:"subscription_cycle",collection_method:"charge_automatically",created:1680644467,currency:"usd",customer_email:"jennyrosen@example.com",customer_name:"Jenny Rosen",hosted_invoice_url:"https://invoice.stripe.com/i/acct_...",last_finalization_error:{code:"card_declined",doc_url:"https://stripe.com/docs/error-codes/card-declined",message:"Your card was declined.",param:"",payment_intent:{id:"pi_123",object:"payment_intent"},type:"card_error"},livemode:!1,next_payment_attempt:1681251667},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("invoice.payment_failed",e.webhookUrl,e.auth.secret_text);await e.store.put("_invoice_payment_failed_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_invoice_payment_failed_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/invoices",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{status:"open",limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{customer:n}=e.propsValue;return n&&r.customer!==n?[]:[r]}});var Tg=te({auth:g,name:"canceled_subscription",displayName:"Canceled Subscription",description:"Fires when a subscription is canceled.",aiMetadata:{description:"Fires when a subscription is canceled in Stripe (the customer.subscription.deleted event), emitting the canceled subscription including any cancellation details. An optional customer ID filter narrows firing to one customer. Use to react to churn, such as revoking access or sending a win-back flow."},props:{customer:u.ShortText({displayName:"Customer ID",description:"Only trigger for subscriptions belonging to this customer ID (e.g., `cus_...`).",required:!1})},outputSchema:be,sampleData:{id:"sub_1MlPf9LkdIwHu7ixB6VIYRyX",object:"subscription",application:null,application_fee_percent:null,billing_cycle_anchor:1678768838,cancel_at_period_end:!1,canceled_at:1678768842,cancellation_details:{comment:"User requested cancellation via support.",feedback:"missing_features",reason:"cancellation_requested"},collection_method:"charge_automatically",created:1678768838,currency:"usd",customer:"cus_NWSaVkvdacCUi4",ended_at:1678768842,items:{object:"list",data:[{id:"si_NWSaWTp80M123q",object:"subscription_item",price:{id:"price_1MlPf7LkdIwHu7ixgcbP7cwE",object:"price",active:!0,currency:"usd",product:"prod_NWSaMgipulx8IQ",type:"recurring",unit_amount:1099},quantity:1}]},latest_invoice:"in_1MlPf9LkdIwHu7ixEo6hdgCw",livemode:!1,metadata:{},start_date:1678768838,status:"canceled"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("customer.subscription.deleted",e.webhookUrl,e.auth.secret_text);await e.store.put("_canceled_subscription_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_canceled_subscription_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/subscriptions",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{status:"canceled",limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{customer:n}=e.propsValue;return n&&r.customer!==n?[]:[r]}});var Eg=te({auth:g,name:"new_refund",displayName:"New Refund",description:"Fires when a charge is refunded (full or partial).",aiMetadata:{description:"Fires when a refund is created in Stripe (the refund.created event), for a full or partial refund, emitting the refund record. Optional filters narrow firing to a specific charge ID or payment intent ID. Use to react to money returned to a customer, such as updating accounting or notifying them."},props:{charge:u.ShortText({displayName:"Charge ID",description:"Only trigger for refunds related to this Charge ID (e.g., `ch_...`).",required:!1}),payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"Only trigger for refunds related to this Payment Intent ID (e.g., `pi_...`).",required:!1})},outputSchema:Pt,sampleData:{id:"re_1Nispe2eZvKYlo2Cd31jOCgZ",object:"refund",amount:1e3,balance_transaction:"txn_1Nispe2eZvKYlo2CYezqFhEx",charge:"ch_1NirD82eZvKYlo2CIvbtLWuY",created:1692942318,currency:"usd",metadata:{},payment_intent:"pi_1GszsK2eZvKYlo2CfhZyoZLp",reason:"requested_by_customer",receipt_number:null,status:"succeeded"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("refund.created",e.webhookUrl,e.auth.secret_text);await e.store.put("_new_refund_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_new_refund_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/refunds",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{charge:n,payment_intent:o}=e.propsValue;return n&&r.charge!==n?[]:o&&r.payment_intent!==o?[]:[r]}});var Ig=te({auth:g,name:"new_dispute",displayName:"New Dispute",description:"Fires when a customer disputes a charge.",aiMetadata:{description:"Fires when a customer disputes a charge in Stripe (the charge.dispute.created event), emitting the dispute including its reason and evidence due date. Optional filters narrow firing to a specific charge ID or payment intent ID. Use to react to chargebacks, such as alerting a team or gathering evidence."},props:{charge:u.ShortText({displayName:"Charge ID",description:"Only trigger for disputes related to this Charge ID (e.g., `ch_...`).",required:!1}),payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"Only trigger for disputes related to this Payment Intent ID (e.g., `pi_...`).",required:!1})},outputSchema:xt,sampleData:{id:"du_1MtJUT2eZvKYlo2CNaw2HvEv",object:"dispute",amount:1e3,balance_transactions:[],charge:"ch_1AZtxr2eZvKYlo2CJDX8whov",created:1680651737,currency:"usd",evidence_details:{due_by:1682294399,has_evidence:!1,past_due:!1,submission_count:0},is_charge_refundable:!0,livemode:!1,metadata:{},payment_intent:"pi_1AZtxr2eZvKYlo2CJDX8whov",reason:"general",status:"needs_response"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("charge.dispute.created",e.webhookUrl,e.auth.secret_text);await e.store.put("_new_dispute_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_new_dispute_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/issuing/disputes",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{status:"submitted",limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{charge:n,payment_intent:o}=e.propsValue;return n&&r.charge!==n?[]:o&&r.payment_intent!==o?[]:[r]}});var Ag=te({auth:g,name:"new_payment_link",displayName:"New Payment Link",description:"Fires when a new Payment Link is created.",aiMetadata:{description:"Fires when a new payment link is created in Stripe (the payment_link.created event), emitting the new payment link including its shareable URL. Use to react to payment-link creation, such as distributing the URL or logging it."},props:{},outputSchema:ze,sampleData:{id:"plink_1MoC3ULkdIwHu7ixZjtGpVl2",object:"payment_link",active:!0,after_completion:{hosted_confirmation:{custom_message:null},type:"hosted_confirmation"},allow_promotion_codes:!1,currency:"usd",customer_creation:"if_required",livemode:!1,metadata:{},payment_method_collection:"always",url:"https://buy.stripe.com/test_cN25nr0iZ7bUa7meUY"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("payment_link.created",e.webhookUrl,e.auth.secret_text);await e.store.put("_new_payment_link_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_new_payment_link_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/payment_links",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){return[e.payload.body.data.object]}});var kg=te({auth:g,name:"updated_subscription",displayName:"Updated Subscription",description:"Fires when an existing subscription is changed.",aiMetadata:{description:"Fires when an existing subscription is updated in Stripe (the customer.subscription.updated event), emitting the changed subscription. Optional filters narrow firing to a target new status or a specific customer ID. Use to react to plan changes, status transitions, or quantity updates."},props:{status:u.StaticDropdown({displayName:"New Status",description:"Only trigger when the subscription is updated to this status.",required:!1,options:{options:[{label:"Incomplete",value:"incomplete"},{label:"Incomplete - Expired",value:"incomplete_expired"},{label:"Trialing",value:"trialing"},{label:"Active",value:"active"},{label:"Past Due",value:"past_due"},{label:"Canceled",value:"canceled"},{label:"Unpaid",value:"unpaid"},{label:"Paused",value:"paused"}]}}),customer:u.ShortText({displayName:"Customer ID",description:"Only trigger for subscriptions belonging to this customer ID (e.g., `cus_...`).",required:!1})},outputSchema:be,sampleData:{id:"sub_1MowQVLkdIwHu7ixeRlqHVzs",object:"subscription",application:null,application_fee_percent:null,automatic_tax:{enabled:!1},billing_cycle_anchor:1679609767,cancel_at_period_end:!1,canceled_at:null,collection_method:"charge_automatically",created:1679609767,currency:"usd",customer:"cus_Na6dX7aXxi11N4",items:{object:"list",data:[{id:"si_Na6dzxczY5fwHx",object:"subscription_item",price:{id:"price_1MowQULkdIwHu7ixraBm864M",object:"price",product:"prod_Na6dGcTsmU0I4R",unit_amount:2e3},quantity:1}]},latest_invoice:"in_1MowQWLkdIwHu7ixuzkSPfKd",livemode:!1,metadata:{plan:"premium"},start_date:1679609767,status:"active"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("customer.subscription.updated",e.webhookUrl,e.auth.secret_text);await e.store.put("_updated_subscription_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_updated_subscription_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/subscriptions",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{status:"incomplete",limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{status:n,customer:o}=e.propsValue;return n&&r.status!==n?[]:o&&r.customer!==o?[]:[r]}});var wg=te({auth:g,name:"checkout_session_completed",displayName:"Checkout Session Completed",description:"Fires when a Stripe Checkout Session is successfully completed.",aiMetadata:{description:"Fires when a Stripe Checkout Session is successfully completed (the checkout.session.completed event), emitting the completed session including customer and payment details. An optional customer ID filter narrows firing to one customer. Use to react to a completed hosted checkout, such as fulfilling an order or granting access."},props:{customer:u.ShortText({displayName:"Customer ID",description:"Only trigger for checkout sessions created by this customer ID (e.g., `cus_...`).",required:!1})},outputSchema:sr,sampleData:{id:"cs_test_a11YYufWQzNY63zpQ6QSNRQhkUpVph4WRmzW0zWJO2znZKdVujZ0N0S22u",object:"checkout.session",amount_subtotal:2198,amount_total:2198,created:1679600215,currency:"usd",customer:"cus_NWSaVkvdacCUi4",customer_details:{email:"jenny.rosen@example.com",name:"Jenny Rosen",phone:null},livemode:!1,mode:"payment",payment_intent:"pi_12345ABC",payment_status:"paid",status:"complete",success_url:"https://example.com/success",url:null},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("checkout.session.completed",e.webhookUrl,e.auth.secret_text);await e.store.put("_checkout_session_completed_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_checkout_session_completed_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/checkout/sessions",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{status:"complete",limit:"5"}});return B(t.body)||B(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{customer:n}=e.propsValue;return n&&r.customer!==n?[]:[r]}});var Og=x({name:"update_customer",auth:g,displayName:"Update Customer",description:"Modify an existing customer\u2019s details.",audience:"human",aiMetadata:{description:"Updates fields on an existing Stripe customer (email, name, description, phone, address); only the fields you provide are changed. Use to correct or enrich a customer record identified by its customer ID. Idempotent in effect: repeating the same update yields the same final state.",idempotent:!0},props:{customer:_.customer,email:u.ShortText({displayName:"Email",required:!1}),name:u.ShortText({displayName:"Name",required:!1}),description:u.LongText({displayName:"Description",required:!1}),phone:u.ShortText({displayName:"Phone",required:!1}),line1:u.ShortText({displayName:"Address Line 1",required:!1}),postal_code:u.ShortText({displayName:"Postal Code",required:!1}),city:u.ShortText({displayName:"City",required:!1}),state:u.ShortText({displayName:"State",required:!1}),country:u.ShortText({displayName:"Country",required:!1})},outputSchema:Oe,async run(e){let{customer:t,...r}=e.propsValue,n={};r.name&&(n.name=r.name),r.email&&(n.email=r.email),r.description&&(n.description=r.description),r.phone&&(n.phone=r.phone);let o={};return r.line1&&(o.line1=r.line1),r.city&&(o.city=r.city),r.state&&(o.state=r.state),r.postal_code&&(o.postal_code=r.postal_code),r.country&&(o.country=r.country),Object.keys(o).length>0&&(n.address=o),(await v.sendRequest({method:"POST",url:`https://api.stripe.com/v1/customers/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n})).body}});var Rg=x({name:"create_payment_intent",auth:g,displayName:"Create Payment (Payment Intent)",description:"Creates a new payment intent to start a payment flow.",audience:"human",aiMetadata:{description:"Creates a Stripe PaymentIntent for a given amount and currency to begin collecting a payment, optionally tied to a customer. Can run in two modes: leave it unconfirmed to obtain a client secret for client-side completion, or set confirm to immediately charge a supplied payment method (which then also requires a return URL). Not idempotent: each call starts a separate payment.",idempotent:!1},props:{amount:u.Number({displayName:"Amount",description:"The amount to charge, in a decimal format (e.g., 10.50 for $10.50).",required:!0}),currency:u.StaticDropdown({displayName:"Currency",description:"The three-letter ISO code for the currency.",required:!0,options:{options:[{label:"US Dollar",value:"usd"},{label:"Euro",value:"eur"},{label:"Pound Sterling",value:"gbp"},{label:"Australian Dollar",value:"aud"},{label:"Canadian Dollar",value:"cad"},{label:"Swiss Franc",value:"chf"},{label:"Chinese Yuan",value:"cny"},{label:"Japanese Yen",value:"jpy"},{label:"Indian Rupee",value:"inr"},{label:"Singapore Dollar",value:"sgd"}]}}),customer:_.customer,payment_method:u.ShortText({displayName:"Payment Method ID",description:"The ID of the Payment Method to attach (e.g., `pm_...`). Required if you want to confirm the payment immediately.",required:!1}),confirm:u.Checkbox({displayName:"Confirm Payment Immediately",description:"If true, Stripe will attempt to charge the provided payment method. A `Payment Method ID` is required.",required:!1,defaultValue:!1}),return_url:u.ShortText({displayName:"Return URL",description:"The URL to redirect your customer back to after they authenticate their payment. Required when confirming the payment.",required:!1}),description:u.LongText({displayName:"Description",required:!1}),receipt_email:u.ShortText({displayName:"Receipt Email",description:"The email address to send a receipt to. This will override the customer's email address.",required:!1})},outputSchema:Te,async run(e){let{amount:t,currency:r,customer:n,payment_method:o,confirm:i,return_url:s,description:l,receipt_email:d}=e.propsValue;if(i&&!o)throw new Error("A Payment Method ID is required when 'Confirm Payment' is set to true.");if(i&&!s)throw new Error("A Return URL is required when 'Confirm Payment' is set to true.");let m={amount:Math.round(t*100),currency:r};return n&&(m.customer=n),o&&(m.payment_method=o),i&&(m.confirm=i),s&&(m.return_url=s),l&&(m.description=l),d&&(m.receipt_email=d),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_intents`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:m})).body}});var Cg=x({name:"create_product",auth:g,displayName:"Create Product",description:"Create a new product object in Stripe.",audience:"human",aiMetadata:{description:"Creates a new product object in Stripe (the catalog item that prices attach to), with optional description, images, URL, and metadata. Use before creating a price or when adding a sellable item. Not idempotent: each call creates a distinct product.",idempotent:!1},props:{name:u.ShortText({displayName:"Product Name",description:"The product\u2019s name, meant to be displayable to the customer.",required:!0}),description:u.LongText({displayName:"Description",description:"The product\u2019s description, meant to be displayable to the customer.",required:!1}),active:u.Checkbox({displayName:"Active",description:"Whether the product is currently available for purchase. Defaults to true.",required:!1}),images:u.Array({displayName:"Image URLs",description:"A list of up to 8 URLs of images for this product.",required:!1}),url:u.ShortText({displayName:"Product URL",description:"A publicly-accessible online page for this product.",required:!1}),metadata:u.Json({displayName:"Metadata",description:"A set of key-value pairs to store additional information about the product.",required:!1})},outputSchema:_t,async run(e){let{name:t,description:r,active:n,images:o,url:i,metadata:s}=e.propsValue,l={name:t};return r&&(l.description=r),n!==void 0&&(l.active=n),i&&(l.url=i),o&&Array.isArray(o)&&o.forEach((b,m)=>{l[`images[${m}]`]=b}),s&&typeof s=="object"&&Object.keys(s).forEach(b=>{l[`metadata[${b}]`]=s[b]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/products`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})).body}});var $g=x({name:"create_price",auth:g,displayName:"Create Price",description:"Create a price (one-time or recurring), associated with a product.",audience:"human",aiMetadata:{description:"Creates a price for an existing Stripe product, in either one-time or recurring mode depending on the selected billing interval. Use after creating a product to define what to charge before building a subscription or payment link. Requires the product ID; not idempotent, as each call creates a new price.",idempotent:!1},props:{product:_.product,unit_amount:u.Number({displayName:"Unit Amount",description:"The price amount as a decimal, for example, 25.50 for $25.50.",required:!0}),currency:u.StaticDropdown({displayName:"Currency",description:"The three-letter ISO code for the currency.",required:!0,options:{options:[{label:"US Dollar",value:"usd"},{label:"Euro",value:"eur"},{label:"Pound Sterling",value:"gbp"},{label:"Indian Rupee",value:"inr"},{label:"Australian Dollar",value:"aud"},{label:"Canadian Dollar",value:"cad"},{label:"Swiss Franc",value:"chf"},{label:"Chinese Yuan",value:"cny"},{label:"Japanese Yen",value:"jpy"},{label:"Singapore Dollar",value:"sgd"}]}}),recurring_interval:u.StaticDropdown({displayName:"Billing Interval",description:"Specify the billing frequency. Select 'One-Time' for a single, non-recurring payment.",required:!0,defaultValue:"one_time",options:{options:[{label:"One-Time",value:"one_time"},{label:"Daily",value:"day"},{label:"Weekly",value:"week"},{label:"Monthly",value:"month"},{label:"Yearly",value:"year"}]}}),recurring_interval_count:u.Number({displayName:"Interval Count",description:"The number of intervals between subscription billings (e.g., for billing every 3 months, set Interval to Monthly and Interval Count to 3). Only used for recurring prices.",required:!1})},outputSchema:bt,async run(e){let{product:t,unit_amount:r,currency:n,recurring_interval:o,recurring_interval_count:i}=e.propsValue,s=Math.round(r*100),l={product:t,unit_amount:s,currency:n};return o!=="one_time"&&(l["recurring[interval]"]=o,i&&(l["recurring[interval_count]"]=i)),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/prices`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})).body}});var Ng=x({name:"create_subscription",auth:g,displayName:"Create Subscription",description:"Start a subscription for a customer with specified items/prices.",audience:"human",aiMetadata:{description:"Starts a recurring subscription for an existing customer against one or more price IDs, with optional collection method, trial period, and default payment method. Use to enroll a customer in recurring billing. Requires a customer ID and at least one price; not idempotent, as each call creates a separate subscription.",idempotent:!1},props:{customer:_.customer,items:u.Array({displayName:"Subscription Items",description:"A list of prices to subscribe the customer to.",required:!0,properties:{price:u.ShortText({displayName:"Price ID",description:"The ID of the price object (e.g., price_...). You can find this in your Stripe Dashboard under Products.",required:!0}),quantity:u.Number({displayName:"Quantity",description:"The number of units of this price to subscribe to. Defaults to 1.",required:!1})}}),collection_method:u.StaticDropdown({displayName:"Collection Method",description:"How to collect payment. 'charge_automatically' will try to bill the default payment method. 'send_invoice' will email an invoice.",required:!1,options:{options:[{label:"Charge Automatically",value:"charge_automatically"},{label:"Send Invoice",value:"send_invoice"}]}}),days_until_due:u.Number({displayName:"Days Until Due",description:"Number of days before an invoice is due. Required if Collection Method is 'Send Invoice'.",required:!1}),trial_period_days:u.Number({displayName:"Trial Period (Days)",description:"Integer representing the number of trial days the customer receives before the subscription bills for the first time.",required:!1}),default_payment_method:u.ShortText({displayName:"Default Payment Method ID",description:"ID of the default payment method for the subscription (e.g., `pm_...`).",required:!1}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:be,async run(e){let{customer:t,items:r,collection_method:n,days_until_due:o,trial_period_days:i,default_payment_method:s,metadata:l}=e.propsValue,d={customer:t,collection_method:n,days_until_due:o,trial_period_days:i,default_payment_method:s,metadata:l};return Object.keys(d).forEach(m=>{(d[m]===void 0||d[m]===null)&&delete d[m]}),r&&Array.isArray(r)&&r.forEach((m,P)=>{let y=m;d[`items[${P}][price]`]=y.price,y.quantity&&(d[`items[${P}][quantity]`]=y.quantity)}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/subscriptions`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:d})).body}});var Dg=x({name:"cancel_subscription",auth:g,displayName:"Cancel Subscription",description:"Cancel an existing subscription, either immediately or at the end of the current billing period.",audience:"human",aiMetadata:{description:"Cancels an existing Stripe subscription by its ID, in one of two modes: immediately, or scheduled to end at the close of the current billing period. Use to stop recurring billing for a customer. Effectively idempotent: re-running on an already-canceled subscription leaves it canceled.",idempotent:!0},props:{subscription:_.subscription,cancel_at_period_end:u.Checkbox({displayName:"Cancel at Period End",description:"If true, the subscription remains active until the end of the current billing period. If false, it cancels immediately.",required:!1,defaultValue:!1})},outputSchema:be,async run(e){let{subscription:t,cancel_at_period_end:r}=e.propsValue,n=Ie(e.auth.secret_text);return r?await n.subscriptions.update(t,{cancel_at_period_end:!0}):await n.subscriptions.cancel(t)}});var zg=x({name:"retrieve_invoice",auth:g,displayName:"Retrieve an Invoice",description:"Retrieves the details of an existing invoice by its ID.",audience:"human",aiMetadata:{description:"Fetches the full details of a single Stripe invoice by its invoice ID (e.g., in_...). Use when you have the exact invoice ID and need its current status, amounts, or hosted/PDF links. Read-only and idempotent.",idempotent:!0},props:{invoice_id:_.invoice},outputSchema:ge,async run(e){let{invoice_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/invoices/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Mg=x({name:"retrieve_payout",auth:g,displayName:"Retrieve a Payout",description:"Retrieves the details of an existing payout by its ID.",audience:"human",aiMetadata:{description:"Fetches the full details of a single Stripe payout (funds sent to your bank account) by its payout ID (e.g., po_...). Use to check a payout's status, amount, or arrival date. Read-only and idempotent.",idempotent:!0},props:{payout_id:_.payout},outputSchema:Po,async run(e){let{payout_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payouts/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Ug=x({name:"create_refund",auth:g,displayName:"Create a Refund",description:"Create a full or partial refund for a payment.",audience:"human",aiMetadata:{description:"Issues a refund against a payment identified by its PaymentIntent ID; refunds the full amount by default, or a partial amount if one is given, with an optional reason. Use to return funds to a customer for a captured payment. Not idempotent: each call creates a new refund and moves money again.",idempotent:!1},props:{payment_intent:_.paymentIntent,amount:u.Number({displayName:"Amount",description:"The amount to refund (e.g., 12.99). If left blank, a full refund will be issued.",required:!1}),reason:u.StaticDropdown({displayName:"Reason",description:"An optional reason for the refund.",required:!1,options:{options:[{label:"Duplicate",value:"duplicate"},{label:"Fraudulent",value:"fraudulent"},{label:"Requested by Customer",value:"requested_by_customer"}]}}),metadata:u.Json({displayName:"Metadata",description:"A set of key-value pairs to store additional information about the refund.",required:!1})},outputSchema:Pt,async run(e){let{payment_intent:t,amount:r,reason:n,metadata:o}=e.propsValue,i={payment_intent:t};return r!=null&&(i.amount=Math.round(r*100)),n&&(i.reason=n),o&&typeof o=="object"&&Object.keys(o).forEach(l=>{i[`metadata[${l}]`]=o[l]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/refunds`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i})).body}});var Lg=x({name:"create_payment_link",auth:g,displayName:"Create Payment Link",description:"Creates a shareable, Stripe-hosted payment link for one-time purchases or subscriptions.",audience:"human",aiMetadata:{description:"Creates a reusable, Stripe-hosted payment link for the given line items (price IDs and quantities), with optional after-completion redirect, promotion codes, and billing-address collection. Use to generate a shareable checkout URL without building a custom flow. Not idempotent: each call creates a new payment link.",idempotent:!1},props:{line_items:u.Array({displayName:"Line Items",description:"The products and quantities to include in the payment link.",required:!0,properties:{price:u.ShortText({displayName:"Price ID",description:"The ID of the price object (e.g., price_1J2X3Y4Z...). Find this in your Stripe Dashboard under Products.",required:!0}),quantity:u.Number({displayName:"Quantity",required:!0})}}),after_completion_type:u.StaticDropdown({displayName:"After Completion Behavior",description:"Controls the behavior after the purchase is complete. Defaults to showing Stripe's hosted confirmation page.",required:!1,options:{options:[{label:"Show Confirmation Page",value:"hosted_confirmation"},{label:"Redirect to URL",value:"redirect"}]}}),after_completion_redirect_url:u.ShortText({displayName:"Redirect URL",description:'The URL to redirect the customer to after a successful purchase. Only used if the behavior is set to "Redirect to URL".',required:!1}),allow_promotion_codes:u.Checkbox({displayName:"Allow Promotion Codes",description:"Enables the user to enter a promotion code on the Payment Link page.",required:!1}),billing_address_collection:u.StaticDropdown({displayName:"Billing Address Collection",description:"Describes whether Checkout should collect the customer\u2019s billing address.",required:!1,options:{options:[{label:"Auto",value:"auto"},{label:"Required",value:"required"}]}}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:ze,async run(e){let t=Ie(e.auth.secret_text),r=e.propsValue,n={line_items:r.line_items,allow_promotion_codes:r.allow_promotion_codes,billing_address_collection:r.billing_address_collection,metadata:r.metadata};return r.after_completion_type&&(n.after_completion={type:r.after_completion_type},r.after_completion_type==="redirect"&&r.after_completion_redirect_url&&(n.after_completion.redirect={url:r.after_completion_redirect_url})),await t.paymentLinks.create(n)}});var qg=x({name:"deactivate_payment_link",auth:g,displayName:"Deactivate Payment Link",description:"Disable or deactivate a Payment Link so it can no longer be used.",audience:"human",aiMetadata:{description:"Deactivates an existing Stripe payment link by its ID so it can no longer accept payments. Use to retire a shared checkout URL. Idempotent in effect: re-running on an already-inactive link leaves it inactive.",idempotent:!0},props:{payment_link_id:_.paymentLink},outputSchema:ze,async run(e){let{payment_link_id:t}=e.propsValue;return await Ie(e.auth.secret_text).paymentLinks.update(t,{active:!1})}});var jg=x({name:"retrieve_payment_intent",auth:g,displayName:"Find Payment (by Payment Intent ID)",description:"Retrieves the details of a payment by its unique Payment Intent ID.",audience:"human",aiMetadata:{description:"Fetches the full details of a single payment by its PaymentIntent ID (e.g., pi_...). Use when you have the exact ID and need the payment's current status, amount, or associated charge. Read-only and idempotent.",idempotent:!0},props:{payment_intent_id:_.paymentIntent},outputSchema:Te,async run(e){let{payment_intent_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_intents/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Fg=x({name:"find_invoice",auth:g,displayName:"Find Invoice",description:"Finds an invoice by its unique ID.",audience:"human",aiMetadata:{description:"Fetches a single Stripe invoice by its unique invoice ID (e.g., in_...). Use when you already have the exact invoice ID and need its current details. Read-only and idempotent.",idempotent:!0},props:{invoice_id:_.invoice},outputSchema:ge,async run(e){let{invoice_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/invoices/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Bg=x({name:"create_customer_ai",auth:g,displayName:"Create Customer (Agent)",description:"Create a customer in Stripe.",audience:"ai",aiMetadata:{description:"Creates a new Stripe customer from an email and name, with optional phone and address. Use when onboarding a new payer before charging, invoicing, or subscribing them; to avoid duplicates, look the customer up first with Search Customers. Not idempotent: each call creates a distinct customer even with identical input.",idempotent:!1},props:{email:u.ShortText({displayName:"Email",required:!0}),name:u.ShortText({displayName:"Name",required:!0}),description:u.LongText({displayName:"Description",required:!1}),phone:u.ShortText({displayName:"Phone",required:!1}),line1:u.ShortText({displayName:"Address Line 1",required:!1}),postal_code:u.ShortText({displayName:"Postal Code",required:!1}),city:u.ShortText({displayName:"City",required:!1}),state:u.ShortText({displayName:"State",required:!1}),country:u.ShortText({displayName:"Country",required:!1})},outputSchema:Oe,async run(e){let{email:t,name:r,description:n,phone:o,line1:i,postal_code:s,city:l,state:d,country:b}=e.propsValue,m={email:t,name:r};n&&(m.description=n),o&&(m.phone=o);let P={};return i&&(P.line1=i),s&&(P.postal_code=s),l&&(P.city=l),d&&(P.state=d),b&&(P.country=b),Object.keys(P).forEach(p=>{m[`address[${p}]`]=P[p]}),(await v.sendRequest({method:"POST",url:"https://api.stripe.com/v1/customers",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},body:m})).body}});var Vg=x({name:"get_customer",auth:g,displayName:"Get Customer (Agent)",description:"Retrieve a Stripe customer by its ID.",audience:"ai",aiMetadata:{description:"Fetches the full details of a single Stripe customer by its customer ID (e.g., cus_...). Use when you already have the exact ID; to look a customer up by email use Search Customers, or List Customers to page through them. Read-only and idempotent.",idempotent:!0},props:{id:u.ShortText({displayName:"Customer ID",description:"The Stripe customer ID (e.g., cus_...). Obtain it from Search Customers or List Customers.",required:!0})},outputSchema:Oe,async run(e){let t=e.propsValue.id;return(await v.sendRequest({method:"GET",url:`https://api.stripe.com/v1/customers/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Gg=x({name:"update_customer_ai",auth:g,displayName:"Update Customer (Agent)",description:"Modify an existing Stripe customer.",audience:"ai",aiMetadata:{description:"Updates fields on an existing Stripe customer (email, name, description, phone, address); only the fields you supply change. Use to correct or enrich a customer record identified by its customer ID. Idempotent: repeating the same update yields the same final state.",idempotent:!0},props:{customer:u.ShortText({displayName:"Customer ID",description:"The Stripe customer ID (e.g., cus_...) to update. Obtain it from Search Customers or List Customers.",required:!0}),email:u.ShortText({displayName:"Email",required:!1}),name:u.ShortText({displayName:"Name",required:!1}),description:u.LongText({displayName:"Description",required:!1}),phone:u.ShortText({displayName:"Phone",required:!1}),line1:u.ShortText({displayName:"Address Line 1",required:!1}),postal_code:u.ShortText({displayName:"Postal Code",required:!1}),city:u.ShortText({displayName:"City",required:!1}),state:u.ShortText({displayName:"State",required:!1}),country:u.ShortText({displayName:"Country",required:!1})},outputSchema:Oe,async run(e){let{customer:t,...r}=e.propsValue,n={};r.name&&(n.name=r.name),r.email&&(n.email=r.email),r.description&&(n.description=r.description),r.phone&&(n.phone=r.phone);let o={};return r.line1&&(o.line1=r.line1),r.city&&(o.city=r.city),r.state&&(o.state=r.state),r.postal_code&&(o.postal_code=r.postal_code),r.country&&(o.country=r.country),Object.keys(o).forEach(s=>{n[`address[${s}]`]=o[s]}),(await v.sendRequest({method:"POST",url:`https://api.stripe.com/v1/customers/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n})).body}});var Hg=x({name:"search_customers",auth:g,displayName:"Search Customers (Agent)",description:"Search for Stripe customers by email or a raw search query.",audience:"ai",aiMetadata:{description:`Searches Stripe customers using the Stripe Search Query Language. Pass an email to match customers with that exact email, or supply a raw query for richer filters (e.g. "name:'Jane' OR metadata['plan']:'gold'"). Use to find an existing customer before creating/charging one; use Get Customer when you already have the cus_ ID. Read-only and idempotent.`,idempotent:!0},props:{email:u.ShortText({displayName:"Email",description:"Match customers with this exact email. Ignored if a raw Query is provided.",required:!1}),query:u.ShortText({displayName:"Query",description:"A raw Stripe search query (e.g. email:'a@b.com', name:'Jane'). Overrides the Email field when set.",required:!1})},outputSchema:xo,async run(e){let{email:t,query:r}=e.propsValue,n=r||(t?`email:'${t}'`:void 0);if(!n)throw new Error("Provide either an Email or a raw Query to search.");let o={query:n};return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/customers/search`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:o})).body}});var Zg=x({name:"create_payment_intent_ai",auth:g,displayName:"Create Payment Intent (Agent)",description:"Create a Stripe PaymentIntent to start a payment flow.",audience:"ai",aiMetadata:{description:"Creates a Stripe PaymentIntent for an amount and currency, optionally tied to a customer. Leave it unconfirmed to get a client secret for client-side completion, or set confirm with a payment method ID (and return URL) to charge immediately. Amount is a decimal in the major currency unit (e.g. 10.50 for $10.50). Not idempotent: each call starts a separate payment.",idempotent:!1},props:{amount:u.Number({displayName:"Amount",description:"The amount to charge, as a decimal in the major currency unit (e.g., 10.50 for $10.50).",required:!0}),currency:u.ShortText({displayName:"Currency",description:"The three-letter ISO currency code (e.g., usd, eur, gbp).",required:!0}),customer:u.ShortText({displayName:"Customer ID",description:"The Stripe customer ID (e.g., cus_...) to associate. Obtain it from Search Customers or List Customers.",required:!1}),payment_method:u.ShortText({displayName:"Payment Method ID",description:"The PaymentMethod ID to attach (e.g., pm_...). Required to confirm the payment immediately.",required:!1}),confirm:u.Checkbox({displayName:"Confirm Payment Immediately",description:"If true, Stripe attempts to charge the provided payment method. Requires a Payment Method ID and a Return URL.",required:!1,defaultValue:!1}),capture_method:u.StaticDropdown({displayName:"Capture Method",description:"When to capture funds. 'automatic' (default) captures immediately on confirmation; 'manual' authorizes only \u2014 funds are held and you capture later with Capture Payment Intent (auth-and-capture).",required:!1,options:{options:[{label:"Automatic",value:"automatic"},{label:"Manual (authorize only)",value:"manual"}]}}),return_url:u.ShortText({displayName:"Return URL",description:"URL to redirect the customer back to after authenticating the payment. Required when confirming.",required:!1}),description:u.LongText({displayName:"Description",required:!1}),receipt_email:u.ShortText({displayName:"Receipt Email",description:"Email to send a receipt to. Overrides the customer's email.",required:!1})},outputSchema:Te,async run(e){let{amount:t,currency:r,customer:n,payment_method:o,confirm:i,return_url:s,description:l,receipt_email:d,capture_method:b}=e.propsValue;if(i&&!o)throw new Error("A Payment Method ID is required when 'Confirm Payment' is set to true.");if(i&&!s)throw new Error("A Return URL is required when 'Confirm Payment' is set to true.");let P={amount:Math.round(t*100),currency:r};return n&&(P.customer=n),o&&(P.payment_method=o),b&&(P.capture_method=b),i&&(P.confirm=i),s&&(P.return_url=s),l&&(P.description=l),d&&(P.receipt_email=d),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_intents`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:P})).body}});var Wg=x({name:"get_payment_intent",auth:g,displayName:"Get Payment Intent (Agent)",description:"Retrieve a payment by its PaymentIntent ID.",audience:"ai",aiMetadata:{description:"Fetches a single payment by its PaymentIntent ID (e.g., pi_...). Use when you have the exact ID and need the current status, amount, or associated charge; use List/Search Payment Intents to discover IDs. Read-only and idempotent.",idempotent:!0},props:{payment_intent_id:u.ShortText({displayName:"Payment Intent ID",description:"The PaymentIntent ID (e.g., pi_...). Obtain it from List Payment Intents or Search Payment Intents.",required:!0})},outputSchema:Te,async run(e){let{payment_intent_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_intents/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Kg=x({name:"create_refund_ai",auth:g,displayName:"Create Refund (Agent)",description:"Create a full or partial refund for a payment.",audience:"ai",aiMetadata:{description:"Issues a refund against a payment identified by its PaymentIntent ID; refunds the full amount by default, or a partial amount if given, with an optional reason. Amount is in the major currency unit as a decimal. Use to return funds for a captured payment. Not idempotent: each call creates a new refund and moves money again.",idempotent:!1},props:{payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"The PaymentIntent ID (e.g., pi_...) to refund. Obtain it from List/Search Payment Intents.",required:!0}),amount:u.Number({displayName:"Amount",description:"The amount to refund as a decimal (e.g., 12.99). If left blank, a full refund is issued.",required:!1}),reason:u.StaticDropdown({displayName:"Reason",description:"An optional reason for the refund.",required:!1,options:{options:[{label:"Duplicate",value:"duplicate"},{label:"Fraudulent",value:"fraudulent"},{label:"Requested by Customer",value:"requested_by_customer"}]}}),metadata:u.Json({displayName:"Metadata",description:"A set of key-value pairs to store additional information about the refund.",required:!1})},outputSchema:Pt,async run(e){let{payment_intent:t,amount:r,reason:n,metadata:o}=e.propsValue,i={payment_intent:t};return r!=null&&(i.amount=Math.round(r*100)),n&&(i.reason=n),o&&typeof o=="object"&&Object.keys(o).forEach(l=>{i[`metadata[${l}]`]=o[l]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/refunds`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i})).body}});var Jg=x({name:"create_invoice_ai",auth:g,displayName:"Create Invoice (Agent)",description:"Create a draft invoice in Stripe.",audience:"ai",aiMetadata:{description:"Creates a draft invoice for an existing customer in the given currency. Use to bill a customer for pending invoice items; add lines with Create Invoice Item / Add Invoice Lines, then Finalize Invoice and Send Invoice. Requires a valid customer ID. Not idempotent: each call creates a separate invoice.",idempotent:!1},props:{customer_id:u.ShortText({displayName:"Customer ID",description:"The Stripe customer ID (e.g., cus_...). Obtain it from Search Customers or List Customers.",required:!0}),currency:u.ShortText({displayName:"Currency",description:"The three-letter ISO currency code (e.g., usd).",required:!0}),description:u.LongText({displayName:"Description",description:"Description for the invoice.",required:!1}),collection_method:u.StaticDropdown({displayName:"Collection Method",description:"How to collect payment. 'charge_automatically' (default) charges the customer's default payment method when finalized; 'send_invoice' emails the customer a payable invoice (requires Days Until Due) and is the only method that lets you later call Send Invoice.",required:!1,options:{options:[{label:"Charge automatically",value:"charge_automatically"},{label:"Send invoice (email)",value:"send_invoice"}]}}),days_until_due:u.Number({displayName:"Days Until Due",description:"Number of days until the invoice is due. Required when Collection Method is 'send_invoice'.",required:!1})},outputSchema:ge,async run(e){let{customer_id:t,currency:r,description:n,collection_method:o,days_until_due:i}=e.propsValue;if(o==="send_invoice"&&i==null)throw new Error("days_until_due is required when collection_method is 'send_invoice'.");let s={customer:t,currency:r};return n&&(s.description=n),o&&(s.collection_method=o),o==="send_invoice"&&i!==void 0&&i!==null&&(s.days_until_due=i),(await v.sendRequest({method:"POST",url:"https://api.stripe.com/v1/invoices",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},body:s})).body}});var Xg=x({name:"get_invoice",auth:g,displayName:"Get Invoice (Agent)",description:"Retrieve a Stripe invoice by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe invoice by its invoice ID (e.g., in_...). Use when you have the exact ID and need its current status, amounts, lines, or hosted/PDF links; use List/Search Invoices to discover IDs. Read-only and idempotent.",idempotent:!0},props:{invoice_id:u.ShortText({displayName:"Invoice ID",description:"The Stripe invoice ID (e.g., in_...). Obtain it from List Invoices or Search Invoices.",required:!0})},outputSchema:ge,async run(e){let{invoice_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/invoices/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Yg=x({name:"create_product_ai",auth:g,displayName:"Create Product (Agent)",description:"Create a new product object in Stripe.",audience:"ai",aiMetadata:{description:"Creates a new Stripe product (the catalog item that prices attach to), with optional description, images, URL, and metadata. Use before creating a price or when adding a sellable item; to archive a product use Update Product with active=false. Not idempotent: each call creates a distinct product.",idempotent:!1},props:{name:u.ShortText({displayName:"Product Name",description:"The product name, displayable to the customer.",required:!0}),description:u.LongText({displayName:"Description",description:"The product description, displayable to the customer.",required:!1}),active:u.Checkbox({displayName:"Active",description:"Whether the product is currently available for purchase. Defaults to true.",required:!1}),images:u.Array({displayName:"Image URLs",description:"A list of up to 8 URLs of images for this product.",required:!1}),url:u.ShortText({displayName:"Product URL",description:"A publicly-accessible online page for this product.",required:!1}),metadata:u.Json({displayName:"Metadata",description:"A set of key-value pairs to store additional information about the product.",required:!1})},outputSchema:_t,async run(e){let{name:t,description:r,active:n,images:o,url:i,metadata:s}=e.propsValue,l={name:t};return r&&(l.description=r),n!==void 0&&(l.active=n),i&&(l.url=i),o&&Array.isArray(o)&&o.forEach((b,m)=>{l[`images[${m}]`]=b}),s&&typeof s=="object"&&Object.keys(s).forEach(b=>{l[`metadata[${b}]`]=s[b]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/products`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})).body}});var Qg=x({name:"create_price_ai",auth:g,displayName:"Create Price (Agent)",description:"Create a one-time or recurring price for a product.",audience:"ai",aiMetadata:{description:"Creates a price for an existing Stripe product, one-time or recurring depending on the chosen billing interval. Amount is a decimal in the major currency unit. Use after Create Product to define what to charge before building a subscription or payment link. Requires the product ID. Not idempotent: each call creates a new price.",idempotent:!1},props:{product:u.ShortText({displayName:"Product ID",description:"The Stripe product ID (e.g., prod_...) this price attaches to. Obtain it from List/Search Products or Create Product.",required:!0}),unit_amount:u.Number({displayName:"Unit Amount",description:"The price amount as a decimal (e.g., 25.50 for $25.50).",required:!0}),currency:u.ShortText({displayName:"Currency",description:"The three-letter ISO currency code (e.g., usd).",required:!0}),recurring_interval:u.StaticDropdown({displayName:"Billing Interval",description:"Billing frequency. Select 'One-Time' for a single, non-recurring payment.",required:!0,defaultValue:"one_time",options:{options:[{label:"One-Time",value:"one_time"},{label:"Daily",value:"day"},{label:"Weekly",value:"week"},{label:"Monthly",value:"month"},{label:"Yearly",value:"year"}]}}),recurring_interval_count:u.Number({displayName:"Interval Count",description:"Number of intervals between billings (e.g., Monthly + count 3 = every 3 months). Only used for recurring prices.",required:!1})},outputSchema:bt,async run(e){let{product:t,unit_amount:r,currency:n,recurring_interval:o,recurring_interval_count:i}=e.propsValue,s=Math.round(r*100),l={product:t,unit_amount:s,currency:n};return o!=="one_time"&&(l["recurring[interval]"]=o,i&&(l["recurring[interval_count]"]=i)),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/prices`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})).body}});var ev=x({name:"create_subscription_ai",auth:g,displayName:"Create Subscription (Agent)",description:"Start a subscription for a customer with specified prices.",audience:"ai",aiMetadata:{description:"Starts a recurring subscription for an existing customer against one or more price IDs, with optional collection method, trial period, and default payment method. Use to enroll a customer in recurring billing. Requires a customer ID and at least one price. Not idempotent: each call creates a separate subscription.",idempotent:!1},props:{customer:u.ShortText({displayName:"Customer ID",description:"The Stripe customer ID (e.g., cus_...). Obtain it from Search Customers or List Customers.",required:!0}),items:u.Array({displayName:"Subscription Items",description:"A list of prices to subscribe the customer to.",required:!0,properties:{price:u.ShortText({displayName:"Price ID",description:"The price ID (e.g., price_...). Obtain it from List/Search Prices.",required:!0}),quantity:u.Number({displayName:"Quantity",description:"Number of units of this price. Defaults to 1.",required:!1})}}),collection_method:u.StaticDropdown({displayName:"Collection Method",description:"'charge_automatically' bills the default payment method; 'send_invoice' emails an invoice.",required:!1,options:{options:[{label:"Charge Automatically",value:"charge_automatically"},{label:"Send Invoice",value:"send_invoice"}]}}),days_until_due:u.Number({displayName:"Days Until Due",description:"Days before an invoice is due. Required if Collection Method is 'Send Invoice'.",required:!1}),trial_period_days:u.Number({displayName:"Trial Period (Days)",description:"Number of trial days before the subscription bills for the first time.",required:!1}),default_payment_method:u.ShortText({displayName:"Default Payment Method ID",description:"ID of the default payment method (e.g., pm_...).",required:!1}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:be,async run(e){let{customer:t,items:r,collection_method:n,days_until_due:o,trial_period_days:i,default_payment_method:s,metadata:l}=e.propsValue;if(n==="send_invoice"&&o==null)throw new Error("days_until_due is required when collection_method is 'send_invoice'.");let d={customer:t,collection_method:n,days_until_due:o,trial_period_days:i,default_payment_method:s};return Object.keys(d).forEach(m=>{(d[m]===void 0||d[m]===null)&&delete d[m]}),n!=="send_invoice"&&delete d.days_until_due,r&&Array.isArray(r)&&r.forEach((m,P)=>{let y=m;d[`items[${P}][price]`]=y.price,y.quantity&&(d[`items[${P}][quantity]`]=y.quantity)}),l&&typeof l=="object"&&Object.keys(l).forEach(m=>{d[`metadata[${m}]`]=l[m]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/subscriptions`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:d})).body}});var tv=x({name:"cancel_subscription_ai",auth:g,displayName:"Cancel Subscription (Agent)",description:"Cancel a subscription immediately or at the end of the billing period.",audience:"ai",aiMetadata:{description:"Cancels an existing Stripe subscription by its ID, either immediately or scheduled to end at the close of the current billing period (via Cancel at Period End). Use to stop recurring billing. Idempotent: re-running on an already-canceled subscription leaves it canceled.",idempotent:!0},props:{subscription:u.ShortText({displayName:"Subscription ID",description:"The Stripe subscription ID (e.g., sub_...). Obtain it from List/Search Subscriptions.",required:!0}),cancel_at_period_end:u.Checkbox({displayName:"Cancel at Period End",description:"If true, the subscription stays active until the end of the current billing period. If false, it cancels immediately.",required:!1,defaultValue:!1})},outputSchema:be,async run(e){let{subscription:t,cancel_at_period_end:r}=e.propsValue,n=Ie(e.auth.secret_text);return r?await n.subscriptions.update(t,{cancel_at_period_end:!0}):await n.subscriptions.cancel(t)}});var zI=[{label:"All Statuses",value:""},{label:"Active",value:"active"},{label:"Past Due",value:"past_due"},{label:"Unpaid",value:"unpaid"},{label:"Canceled",value:"canceled"},{label:"Incomplete",value:"incomplete"},{label:"Incomplete Expired",value:"incomplete_expired"},{label:"Trialing",value:"trialing"},{label:"Paused",value:"paused"}],rv=x({name:"search_subscriptions_ai",auth:g,displayName:"Search Subscriptions (Agent)",description:"Search subscriptions by price ID, status, customer ID and other filters.",audience:"ai",aiMetadata:{description:"Lists and filters Stripe subscriptions by price ID, status, customer ID, and creation date range, optionally expanding full customer details. Use to find subscriptions matching criteria or audit a customer's subscriptions; use Get Subscription when you already have the sub_ ID. Read-only and idempotent.",idempotent:!0},props:{price_ids:u.LongText({displayName:"Price IDs",description:"Comma-separated list of price IDs to filter by (e.g., price_1ABC123, price_2DEF456)",required:!1}),status:u.StaticDropdown({displayName:"Subscription Status",description:"Filter by subscription status",required:!1,options:{options:zI}}),customer_id:u.ShortText({displayName:"Customer ID",description:"Filter by specific customer ID (optional)",required:!1}),created_after:u.DateTime({displayName:"Created After",description:"Filter subscriptions created after this date (YYYY-MM-DD format)",required:!1}),created_before:u.DateTime({displayName:"Created Before",description:"Filter subscriptions created before this date (YYYY-MM-DD format)",required:!1}),limit:u.Number({displayName:"Limit",description:"Maximum number of subscriptions to return (default: 100, set to 0 for all)",required:!1,defaultValue:100}),fetch_all:u.Checkbox({displayName:"Fetch All Results",description:"Fetch all matching subscriptions (ignores limit, may take longer for large datasets)",required:!1,defaultValue:!1}),include_customer_details:u.Checkbox({displayName:"Include Customer Details",description:"Fetch detailed customer information for each subscription",required:!1,defaultValue:!0})},outputSchema:So,async run(e){let{price_ids:t,status:r,customer_id:n,created_after:o,created_before:i,limit:s=100,fetch_all:l=!1,include_customer_details:d=!0}=e.propsValue,b=a(T=>{let A=new URLSearchParams;if(A.append("limit","100"),A.append("expand[]","data.items.data.price"),d&&A.append("expand[]","data.customer"),r&&A.append("status",r),n&&A.append("customer",n),o){let k=Math.floor(new Date(o).getTime()/1e3);A.append("created[gte]",k.toString())}if(i){let k=Math.floor(new Date(i).getTime()/1e3);A.append("created[lte]",k.toString())}return T&&A.append("starting_after",T),A},"buildQueryParams"),m=[],P=!0,y,p=0,h=l?50:Math.ceil(s/100);for(;P&&p<h;){let T=b(y),A=await v.sendRequest({method:"GET",url:`${_.baseUrl}/subscriptions?${T.toString()}`,headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"}});if(!A.body)throw new Error("Failed to fetch subscriptions from Stripe");let k=A.body.data;if(m=m.concat(k),P=A.body.has_more,p++,P&&k.length>0&&(y=k[k.length-1].id),!l&&m.length>=s){m=m.slice(0,s);break}}let E=m;if(t&&t.trim()){let T=t.split(",").map(A=>A.trim()).filter(A=>A.length>0);T.length>0&&(E=E.filter(A=>A.items.data.some(k=>k.price&&typeof k.price=="object"&&T.includes(k.price.id))))}let S=await Promise.all(E.map(async T=>{let A={...T};if(d){if(typeof T.customer=="object"&&T.customer!==null&&!("deleted"in T.customer&&T.customer.deleted))A.customer=T.customer;else if(typeof T.customer=="string")try{let k=await v.sendRequest({method:"GET",url:`${_.baseUrl}/customers/${T.customer}`,headers:{Authorization:"Bearer "+e.auth.secret_text}});A.customer=k.body}catch(k){console.warn(`Failed to fetch customer details for ${T.customer}:`,k)}}return A}));return{success:!0,count:S.length,total_fetched:m.length,requests_made:p,has_more_available:P&&!l,pagination_info:{limit_requested:l?"All":s,fetch_all_enabled:l,max_requests_limit:h},subscriptions:S,filters_applied:{price_ids:t?t.split(",").map(T=>T.trim()).filter(T=>T.length>0):null,status:r||null,customer_id:n||null,created_after:o||null,created_before:i||null,limit:s,fetch_all:l,include_customer_details:d}}}});var nv=x({name:"create_payment_link_ai",auth:g,displayName:"Create Payment Link (Agent)",description:"Create a shareable, Stripe-hosted payment link.",audience:"ai",aiMetadata:{description:"Creates a reusable, Stripe-hosted payment link for the given line items (price IDs and quantities), with optional after-completion redirect, promotion codes, and billing-address collection. Use to generate a shareable checkout URL without building a custom flow; for a richer one-off hosted page use Create Checkout Session. Not idempotent: each call creates a new payment link.",idempotent:!1},props:{line_items:u.Array({displayName:"Line Items",description:"The products and quantities to include in the payment link.",required:!0,properties:{price:u.ShortText({displayName:"Price ID",description:"The price ID (e.g., price_...). Obtain it from List/Search Prices.",required:!0}),quantity:u.Number({displayName:"Quantity",required:!0})}}),after_completion_type:u.StaticDropdown({displayName:"After Completion Behavior",description:"Behavior after purchase completes. Defaults to Stripe's hosted confirmation page.",required:!1,options:{options:[{label:"Show Confirmation Page",value:"hosted_confirmation"},{label:"Redirect to URL",value:"redirect"}]}}),after_completion_redirect_url:u.ShortText({displayName:"Redirect URL",description:'URL to redirect to after a successful purchase. Only used when behavior is "Redirect to URL".',required:!1}),allow_promotion_codes:u.Checkbox({displayName:"Allow Promotion Codes",description:"Allow the customer to enter a promotion code.",required:!1}),billing_address_collection:u.StaticDropdown({displayName:"Billing Address Collection",description:"Whether Checkout collects the customer's billing address.",required:!1,options:{options:[{label:"Auto",value:"auto"},{label:"Required",value:"required"}]}}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:ze,async run(e){let t=Ie(e.auth.secret_text),r=e.propsValue,n={line_items:r.line_items,allow_promotion_codes:r.allow_promotion_codes,billing_address_collection:r.billing_address_collection,metadata:r.metadata};return r.after_completion_type&&(n.after_completion={type:r.after_completion_type},r.after_completion_type==="redirect"&&r.after_completion_redirect_url&&(n.after_completion.redirect={url:r.after_completion_redirect_url})),await t.paymentLinks.create(n)}});var ov=x({name:"deactivate_payment_link_ai",auth:g,displayName:"Deactivate Payment Link (Agent)",description:"Deactivate a payment link so it can no longer be used.",audience:"ai",aiMetadata:{description:"Deactivates an existing Stripe payment link by its ID so it can no longer accept payments (sets active=false). Use to retire a shared checkout URL; use Get/List Payment Links to find the ID. Idempotent: re-running on an already-inactive link leaves it inactive.",idempotent:!0},props:{payment_link_id:u.ShortText({displayName:"Payment Link ID",description:"The payment link ID (e.g., plink_...). Obtain it from List Payment Links.",required:!0})},outputSchema:ze,async run(e){let{payment_link_id:t}=e.propsValue;return await Ie(e.auth.secret_text).paymentLinks.update(t,{active:!1})}});var iv=x({name:"get_payout",auth:g,displayName:"Get Payout (Agent)",description:"Retrieve a Stripe payout by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe payout (funds sent to your bank account) by its payout ID (e.g., po_...). Use to check a payout's status, amount, or arrival date; use List Payouts to discover IDs. Read-only and idempotent.",idempotent:!0},props:{payout_id:u.ShortText({displayName:"Payout ID",description:"The Stripe payout ID (e.g., po_...). Obtain it from List Payouts.",required:!0})},outputSchema:Po,async run(e){let{payout_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payouts/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var av=x({name:"list_customers",auth:g,displayName:"List Customers (Agent)",description:"List Stripe customers, optionally filtered by email.",audience:"ai",aiMetadata:{description:"Pages through Stripe customers, newest first, optionally filtered by an exact email. Use to enumerate customers or resolve a customer ID; for query-language matching use Search Customers, or Get Customer when you have the cus_ ID. Read-only and idempotent.",idempotent:!0},props:{email:u.ShortText({displayName:"Email",description:"Filter to customers with this exact email.",required:!1}),limit:u.Number({displayName:"Limit",description:"Number of customers to return (1-100, default 10).",required:!1}),starting_after:u.ShortText({displayName:"Starting After",description:"A customer ID; returns the page of results after this cursor for pagination.",required:!1})},outputSchema:Ad,async run(e){let{email:t,limit:r,starting_after:n}=e.propsValue,o={};return t&&(o.email=t),r&&(o.limit=r.toString()),n&&(o.starting_after=n),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/customers`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:o})).body}});var sv=x({name:"confirm_payment_intent",auth:g,displayName:"Confirm Payment Intent (Agent)",description:"Confirm a PaymentIntent to attempt the charge.",audience:"ai",aiMetadata:{description:"Confirms a previously-created PaymentIntent to attempt collecting the payment, optionally supplying a payment method and return URL. Use when a PaymentIntent was created unconfirmed and you now want to charge it; Create Payment Intent can also confirm inline. Money-moving and not idempotent.",idempotent:!1},props:{payment_intent_id:u.ShortText({displayName:"Payment Intent ID",description:"The PaymentIntent ID (e.g., pi_...) to confirm. Obtain it from List/Search Payment Intents.",required:!0}),payment_method:u.ShortText({displayName:"Payment Method ID",description:"The PaymentMethod ID to use (e.g., pm_...).",required:!1}),return_url:u.ShortText({displayName:"Return URL",description:"URL to redirect to after authentication. Required for redirect-based payment methods.",required:!1})},outputSchema:Te,async run(e){let{payment_intent_id:t,payment_method:r,return_url:n}=e.propsValue,o={};return r&&(o.payment_method=r),n&&(o.return_url=n),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_intents/${t}/confirm`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:o})).body}});var uv=x({name:"cancel_payment_intent",auth:g,displayName:"Cancel Payment Intent (Agent)",description:"Cancel a PaymentIntent that has not been captured.",audience:"ai",aiMetadata:{description:"Cancels a PaymentIntent that has not yet been captured (e.g., a manual-capture authorization or an abandoned payment), with an optional cancellation reason. Use to release an authorization or abandon a payment. Idempotent: re-running on an already-canceled PaymentIntent leaves it canceled.",idempotent:!0},props:{payment_intent_id:u.ShortText({displayName:"Payment Intent ID",description:"The PaymentIntent ID (e.g., pi_...) to cancel. Obtain it from List/Search Payment Intents.",required:!0}),cancellation_reason:u.StaticDropdown({displayName:"Cancellation Reason",description:"An optional reason for the cancellation.",required:!1,options:{options:[{label:"Duplicate",value:"duplicate"},{label:"Fraudulent",value:"fraudulent"},{label:"Requested by Customer",value:"requested_by_customer"},{label:"Abandoned",value:"abandoned"}]}})},outputSchema:Te,async run(e){let{payment_intent_id:t,cancellation_reason:r}=e.propsValue,n={};return r&&(n.cancellation_reason=r),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_intents/${t}/cancel`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n})).body}});var cv=x({name:"capture_payment_intent",auth:g,displayName:"Capture Payment Intent (Agent)",description:"Capture funds from an authorized PaymentIntent.",audience:"ai",aiMetadata:{description:"Captures the funds of a PaymentIntent that was authorized with manual capture (status requires_capture). Optionally capture a partial amount (in the smallest currency unit, e.g. cents) and mark it as the final capture. Use to settle a held authorization. Money-moving and not idempotent.",idempotent:!1},props:{payment_intent_id:u.ShortText({displayName:"Payment Intent ID",description:"The PaymentIntent ID (e.g., pi_...) to capture. Obtain it from List/Search Payment Intents.",required:!0}),amount_to_capture:u.Number({displayName:"Amount to Capture",description:"The amount to capture in the smallest currency unit (e.g., 1050 for $10.50). Defaults to the full authorized amount.",required:!1}),final_capture:u.Checkbox({displayName:"Final Capture",description:"If true, the remaining uncaptured amount is released back to the customer.",required:!1}),metadata:u.Json({displayName:"Metadata",description:"A set of key-value pairs to attach.",required:!1})},outputSchema:Te,async run(e){let{payment_intent_id:t,amount_to_capture:r,final_capture:n,metadata:o}=e.propsValue,i={};return r!=null&&(i.amount_to_capture=r),n!==void 0&&(i.final_capture=n),o&&typeof o=="object"&&Object.keys(o).forEach(l=>{i[`metadata[${l}]`]=o[l]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_intents/${t}/capture`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i})).body}});var lv=x({name:"list_payment_intents",auth:g,displayName:"List Payment Intents (Agent)",description:"List Stripe PaymentIntents.",audience:"ai",aiMetadata:{description:"Pages through PaymentIntents, newest first, optionally filtered by customer or a created timestamp range. Use to enumerate payments or resolve a PaymentIntent ID; for query-language matching use Search Payment Intents, or Get Payment Intent when you have the pi_ ID. Read-only and idempotent.",idempotent:!0},props:{customer:u.ShortText({displayName:"Customer ID",description:"Filter to PaymentIntents for this customer (cus_...).",required:!1}),created_after:u.DateTime({displayName:"Created After",description:"Only return PaymentIntents created at or after this time.",required:!1}),created_before:u.DateTime({displayName:"Created Before",description:"Only return PaymentIntents created at or before this time.",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1}),starting_after:u.ShortText({displayName:"Starting After",description:"A PaymentIntent ID cursor for pagination.",required:!1})},outputSchema:Nd,async run(e){let{customer:t,created_after:r,created_before:n,limit:o,starting_after:i}=e.propsValue,s={};return t&&(s.customer=t),o&&(s.limit=o.toString()),i&&(s.starting_after=i),r&&(s["created[gte]"]=Math.floor(new Date(r).getTime()/1e3).toString()),n&&(s["created[lte]"]=Math.floor(new Date(n).getTime()/1e3).toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_intents`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:s})).body}});var pv=x({name:"search_payment_intents",auth:g,displayName:"Search Payment Intents (Agent)",description:"Search PaymentIntents with a Stripe search query.",audience:"ai",aiMetadata:{description:`Searches PaymentIntents using the Stripe Search Query Language (e.g. "status:'succeeded' AND customer:'cus_...'"). Use for ad-hoc filtered lookups; use List Payment Intents for simple paging or Get Payment Intent when you have the pi_ ID. Read-only and idempotent.`,idempotent:!0},props:{query:u.ShortText({displayName:"Query",description:"A Stripe search query (e.g. status:'succeeded' AND amount>1000).",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Xd,async run(e){let{query:t,limit:r}=e.propsValue,n={query:t};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_intents/search`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var dv=x({name:"retrieve_charge",auth:g,displayName:"Retrieve Charge (Agent)",description:"Retrieve a Stripe charge by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe charge by its charge ID (e.g., ch_...). Charges are the legacy, read-mostly view of a payment; for the modern object use Get Payment Intent. Use List/Search Charges to discover IDs. Read-only and idempotent.",idempotent:!0},props:{charge_id:u.ShortText({displayName:"Charge ID",description:"The Stripe charge ID (e.g., ch_...). Obtain it from List Charges or Search Charges.",required:!0})},outputSchema:ir,async run(e){let{charge_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/charges/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var mv=x({name:"list_charges",auth:g,displayName:"List Charges (Agent)",description:"List Stripe charges.",audience:"ai",aiMetadata:{description:"Pages through charges, newest first, optionally filtered by customer, PaymentIntent, or a created timestamp range. Use to enumerate charges or resolve a charge ID; for query-language matching use Search Charges. Read-only and idempotent.",idempotent:!0},props:{customer:u.ShortText({displayName:"Customer ID",description:"Filter to charges for this customer (cus_...).",required:!1}),payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"Filter to charges for this PaymentIntent (pi_...).",required:!1}),created_after:u.DateTime({displayName:"Created After",required:!1}),created_before:u.DateTime({displayName:"Created Before",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Dd,async run(e){let{customer:t,payment_intent:r,created_after:n,created_before:o,limit:i}=e.propsValue,s={};return t&&(s.customer=t),r&&(s.payment_intent=r),i&&(s.limit=i.toString()),n&&(s["created[gte]"]=Math.floor(new Date(n).getTime()/1e3).toString()),o&&(s["created[lte]"]=Math.floor(new Date(o).getTime()/1e3).toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/charges`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:s})).body}});var fv=x({name:"search_charges",auth:g,displayName:"Search Charges (Agent)",description:"Search charges with a Stripe search query.",audience:"ai",aiMetadata:{description:`Searches charges using the Stripe Search Query Language (e.g. "status:'succeeded' AND amount>1000"). Use for ad-hoc filtered lookups; use List Charges for simple paging or Retrieve Charge when you have the ch_ ID. Read-only and idempotent.`,idempotent:!0},props:{query:u.ShortText({displayName:"Query",description:"A Stripe search query (e.g. metadata['order_id']:'6735').",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Kd,async run(e){let{query:t,limit:r}=e.propsValue,n={query:t};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/charges/search`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var hv=x({name:"get_refund",auth:g,displayName:"Get Refund (Agent)",description:"Retrieve a Stripe refund by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe refund by its refund ID (e.g., re_...) to check its status and amount. Use List Refunds to discover IDs. Read-only and idempotent.",idempotent:!0},props:{refund_id:u.ShortText({displayName:"Refund ID",description:"The Stripe refund ID (e.g., re_...). Obtain it from List Refunds.",required:!0})},outputSchema:Pt,async run(e){let{refund_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/refunds/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var yv=x({name:"list_refunds",auth:g,displayName:"List Refunds (Agent)",description:"List Stripe refunds.",audience:"ai",aiMetadata:{description:"Pages through refunds, newest first, optionally filtered by PaymentIntent or charge. Use to enumerate refunds for a payment or resolve a refund ID; use Get Refund when you have the re_ ID. Read-only and idempotent.",idempotent:!0},props:{payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"Filter to refunds for this PaymentIntent (pi_...).",required:!1}),charge:u.ShortText({displayName:"Charge ID",description:"Filter to refunds for this charge (ch_...).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:zd,async run(e){let{payment_intent:t,charge:r,limit:n}=e.propsValue,o={};return t&&(o.payment_intent=t),r&&(o.charge=r),n&&(o.limit=n.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/refunds`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:o})).body}});var gv=x({name:"list_invoices",auth:g,displayName:"List Invoices (Agent)",description:"List Stripe invoices.",audience:"ai",aiMetadata:{description:"Pages through invoices, newest first, optionally filtered by customer, status, or subscription. Use to enumerate invoices or resolve an invoice ID; for query-language matching use Search Invoices, or Get Invoice when you have the in_ ID. Read-only and idempotent.",idempotent:!0},props:{customer:u.ShortText({displayName:"Customer ID",description:"Filter to invoices for this customer (cus_...).",required:!1}),status:u.StaticDropdown({displayName:"Status",description:"Filter by invoice status.",required:!1,options:{options:[{label:"Draft",value:"draft"},{label:"Open",value:"open"},{label:"Paid",value:"paid"},{label:"Uncollectible",value:"uncollectible"},{label:"Void",value:"void"}]}}),subscription:u.ShortText({displayName:"Subscription ID",description:"Filter to invoices for this subscription (sub_...).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Md,async run(e){let{customer:t,status:r,subscription:n,limit:o}=e.propsValue,i={};return t&&(i.customer=t),r&&(i.status=r),n&&(i.subscription=n),o&&(i.limit=o.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/invoices`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:i})).body}});var vv=x({name:"search_invoices",auth:g,displayName:"Search Invoices (Agent)",description:"Search invoices with a Stripe search query.",audience:"ai",aiMetadata:{description:`Searches invoices using the Stripe Search Query Language (e.g. "status:'open' AND customer:'cus_...'"). Use for ad-hoc filtered lookups; use List Invoices for simple paging or Get Invoice when you have the in_ ID. Read-only and idempotent.`,idempotent:!0},props:{query:u.ShortText({displayName:"Query",description:"A Stripe search query (e.g. total>1000 AND status:'paid').",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Jd,async run(e){let{query:t,limit:r}=e.propsValue,n={query:t};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/invoices/search`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var _v=x({name:"finalize_invoice",auth:g,displayName:"Finalize Invoice (Agent)",description:"Finalize a draft invoice so it becomes payable.",audience:"ai",aiMetadata:{description:"Finalizes a draft Stripe invoice, locking its line items and making it payable. Use after adding all line items and before Send Invoice. Not idempotent: it errors if the invoice is already finalized.",idempotent:!1},props:{invoice_id:u.ShortText({displayName:"Invoice ID",description:"The draft invoice ID (e.g., in_...). Obtain it from List/Search Invoices.",required:!0}),auto_advance:u.Checkbox({displayName:"Auto Advance",description:"If true, Stripe automatically collects the invoice (sends/charges per its settings) after finalizing.",required:!1})},outputSchema:ge,async run(e){let{invoice_id:t,auto_advance:r}=e.propsValue,n={};return r!==void 0&&(n.auto_advance=r),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/invoices/${t}/finalize`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n})).body}});var bv=x({name:"send_invoice",auth:g,displayName:"Send Invoice (Agent)",description:"Email a finalized invoice to the customer.",audience:"ai",aiMetadata:{description:"Emails a finalized Stripe invoice to the customer. The invoice must already be finalized (use Finalize Invoice first). Not idempotent: each call sends the invoice email again.",idempotent:!1},props:{invoice_id:u.ShortText({displayName:"Invoice ID",description:"The finalized invoice ID (e.g., in_...). Obtain it from List/Search Invoices.",required:!0})},outputSchema:ge,async run(e){let{invoice_id:t}=e.propsValue;return(await v.sendRequest({method:"POST",url:`${_.baseUrl}/invoices/${t}/send`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{}})).body}});var Pv=x({name:"add_invoice_lines",auth:g,displayName:"Add Invoice Lines (Agent)",description:"Bulk-add line items to a draft invoice.",audience:"ai",aiMetadata:{description:"Adds one or more line items to a draft Stripe invoice in a single call. Each line supplies either a price ID or an ad-hoc amount (smallest currency unit) plus currency, with an optional description and quantity. Use to populate a draft before Finalize Invoice. Not idempotent: each call appends new lines.",idempotent:!1},props:{invoice_id:u.ShortText({displayName:"Invoice ID",description:"The draft invoice ID (e.g., in_...). Obtain it from List/Search Invoices.",required:!0}),lines:u.Array({displayName:"Lines",description:"The line items to add to the invoice.",required:!0,properties:{description:u.ShortText({displayName:"Description",required:!1}),amount:u.Number({displayName:"Amount",description:"Ad-hoc amount in the smallest currency unit (e.g., 1050 for $10.50), in the invoice's currency. Provide either an Amount or a Price ID (not both).",required:!1}),price:u.ShortText({displayName:"Price ID",description:"A price ID (e.g., price_...) instead of an ad-hoc amount.",required:!1}),quantity:u.Number({displayName:"Quantity",required:!1})}})},outputSchema:ge,async run(e){let{invoice_id:t,lines:r}=e.propsValue;if(!r||!Array.isArray(r)||r.length===0)throw new Error("Provide at least one line item to add.");let n={};return r.forEach((i,s)=>{i.description!==void 0&&i.description!==null&&i.description!==""&&(n[`lines[${s}][description]`]=i.description),i.price?(n[`lines[${s}][pricing][price]`]=i.price,i.quantity!==void 0&&i.quantity!==null&&(n[`lines[${s}][quantity]`]=i.quantity)):i.amount!==void 0&&i.amount!==null&&(n[`lines[${s}][amount]`]=i.amount)}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/invoices/${t}/add_lines`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n})).body}});var xv=x({name:"list_invoice_lines",auth:g,displayName:"List Invoice Lines (Agent)",description:"List the line items on an invoice.",audience:"ai",aiMetadata:{description:"Pages through the line items of a single Stripe invoice. Use when you need only the lines; the lines are also returned inline by Get Invoice. Read-only and idempotent.",idempotent:!0},props:{invoice_id:u.ShortText({displayName:"Invoice ID",description:"The invoice ID (e.g., in_...). Obtain it from List/Search Invoices.",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Ud,async run(e){let{invoice_id:t,limit:r}=e.propsValue,n={};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/invoices/${t}/lines`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var Sv=x({name:"create_invoice_item",auth:g,displayName:"Create Invoice Item (Agent)",description:"Add a one-off pending line item to a customer.",audience:"ai",aiMetadata:{description:"Creates a pending invoice item for a customer that attaches to their next invoice, or to a specific invoice if one is given. Amount is in the smallest currency unit (e.g. cents) \u2014 pass a raw integer, not a decimal. Use to add ad-hoc charges before invoicing. Not idempotent: each call creates a new item.",idempotent:!1},props:{customer:u.ShortText({displayName:"Customer ID",description:"The Stripe customer ID (e.g., cus_...). Obtain it from Search/List Customers.",required:!0}),amount:u.Number({displayName:"Amount",description:"The amount in the smallest currency unit (e.g., 1050 for $10.50). Raw integer, not a decimal.",required:!0}),currency:u.ShortText({displayName:"Currency",description:"The three-letter ISO currency code (e.g., usd).",required:!0}),description:u.LongText({displayName:"Description",required:!1}),invoice:u.ShortText({displayName:"Invoice ID",description:"Attach to this specific draft invoice (in_...) instead of the next upcoming one.",required:!1}),price:u.ShortText({displayName:"Price ID",description:"Use a price ID (price_...) instead of an ad-hoc amount. If set, leave Amount/Currency blank.",required:!1})},outputSchema:Td,async run(e){let{customer:t,amount:r,currency:n,description:o,invoice:i,price:s}=e.propsValue,l={customer:t};return s?l.price=s:(l.amount=r,l.currency=n),o&&(l.description=o),i&&(l.invoice=i),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/invoiceitems`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})).body}});var Tv=x({name:"update_product",auth:g,displayName:"Update Product (Agent)",description:"Update or archive a Stripe product.",audience:"ai",aiMetadata:{description:'Updates a Stripe product (rename, change description/metadata, or set active=false to archive it). Archiving is the agent path to "delete" a product, since products with prices cannot be hard-deleted. Only the fields you supply change. Idempotent: re-applying the same update converges.',idempotent:!0},props:{product_id:u.ShortText({displayName:"Product ID",description:"The product ID (e.g., prod_...). Obtain it from List/Search Products.",required:!0}),name:u.ShortText({displayName:"Name",required:!1}),description:u.LongText({displayName:"Description",required:!1}),active:u.Checkbox({displayName:"Active",description:"Set to false to archive the product.",required:!1}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:_t,async run(e){let{product_id:t,name:r,description:n,active:o,metadata:i}=e.propsValue,s={};return r&&(s.name=r),n&&(s.description=n),o!==void 0&&(s.active=o),i&&typeof i=="object"&&Object.keys(i).forEach(d=>{s[`metadata[${d}]`]=i[d]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/products/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})).body}});var Ev=x({name:"get_product",auth:g,displayName:"Get Product (Agent)",description:"Retrieve a Stripe product by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe product by its product ID (e.g., prod_...). Use List/Search Products to discover IDs. Read-only and idempotent.",idempotent:!0},props:{product_id:u.ShortText({displayName:"Product ID",description:"The product ID (e.g., prod_...). Obtain it from List/Search Products.",required:!0})},outputSchema:_t,async run(e){let{product_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/products/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Iv=x({name:"list_products",auth:g,displayName:"List Products (Agent)",description:"List Stripe products.",audience:"ai",aiMetadata:{description:"Pages through products, newest first, optionally filtered by active status. Use to enumerate the catalog or resolve a product ID; for name matching use Search Products, or Get Product when you have the prod_ ID. Read-only and idempotent.",idempotent:!0},props:{active:u.StaticDropdown({displayName:"Active",description:"Filter by active state.",required:!1,options:{options:[{label:"Active only",value:"true"},{label:"Inactive only",value:"false"}]}}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:kd,async run(e){let{active:t,limit:r}=e.propsValue,n={};return t&&(n.active=t),r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/products`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var Av=x({name:"search_products",auth:g,displayName:"Search Products (Agent)",description:"Search products with a Stripe search query.",audience:"ai",aiMetadata:{description:`Searches products using the Stripe Search Query Language (e.g. "active:'true' AND name~'shirt'"). Use for name/metadata matching; use List Products for simple paging or Get Product when you have the prod_ ID. Read-only and idempotent.`,idempotent:!0},props:{query:u.ShortText({displayName:"Query",description:"A Stripe search query (e.g. name~'shirt').",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Qd,async run(e){let{query:t,limit:r}=e.propsValue,n={query:t};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/products/search`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var kv=x({name:"update_price",auth:g,displayName:"Update Price (Agent)",description:"Update or archive a Stripe price.",audience:"ai",aiMetadata:{description:"Updates a Stripe price (set active=false to archive it, or edit its nickname/metadata). The unit amount is immutable \u2014 create a new price to change it. Only the fields you supply change. Idempotent: re-applying the same update converges.",idempotent:!0},props:{price_id:u.ShortText({displayName:"Price ID",description:"The price ID (e.g., price_...). Obtain it from List/Search Prices.",required:!0}),active:u.Checkbox({displayName:"Active",description:"Set to false to archive the price.",required:!1}),nickname:u.ShortText({displayName:"Nickname",required:!1}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:bt,async run(e){let{price_id:t,active:r,nickname:n,metadata:o}=e.propsValue,i={};return r!==void 0&&(i.active=r),n&&(i.nickname=n),o&&typeof o=="object"&&Object.keys(o).forEach(l=>{i[`metadata[${l}]`]=o[l]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/prices/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i})).body}});var wv=x({name:"get_price",auth:g,displayName:"Get Price (Agent)",description:"Retrieve a Stripe price by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe price by its price ID (e.g., price_...). Use List/Search Prices to discover IDs. Read-only and idempotent.",idempotent:!0},props:{price_id:u.ShortText({displayName:"Price ID",description:"The price ID (e.g., price_...). Obtain it from List/Search Prices.",required:!0})},outputSchema:bt,async run(e){let{price_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/prices/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Ov=x({name:"list_prices",auth:g,displayName:"List Prices (Agent)",description:"List Stripe prices.",audience:"ai",aiMetadata:{description:"Pages through prices, newest first, optionally filtered by product, active state, type (one_time/recurring), or currency. Use to enumerate prices or resolve a price ID; for query matching use Search Prices, or Get Price when you have the price_ ID. Read-only and idempotent.",idempotent:!0},props:{product:u.ShortText({displayName:"Product ID",description:"Filter to prices for this product (prod_...).",required:!1}),active:u.StaticDropdown({displayName:"Active",required:!1,options:{options:[{label:"Active only",value:"true"},{label:"Inactive only",value:"false"}]}}),type:u.StaticDropdown({displayName:"Type",required:!1,options:{options:[{label:"One-time",value:"one_time"},{label:"Recurring",value:"recurring"}]}}),currency:u.ShortText({displayName:"Currency",description:"Three-letter ISO currency code (e.g., usd).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:wd,async run(e){let{product:t,active:r,type:n,currency:o,limit:i}=e.propsValue,s={};return t&&(s.product=t),r&&(s.active=r),n&&(s.type=n),o&&(s.currency=o),i&&(s.limit=i.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/prices`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:s})).body}});var Rv=x({name:"search_prices",auth:g,displayName:"Search Prices (Agent)",description:"Search prices with a Stripe search query.",audience:"ai",aiMetadata:{description:`Searches prices using the Stripe Search Query Language (e.g. "active:'true' AND currency:'usd'"). Use for metadata/attribute matching; use List Prices for simple paging or Get Price when you have the price_ ID. Read-only and idempotent.`,idempotent:!0},props:{query:u.ShortText({displayName:"Query",description:"A Stripe search query (e.g. lookup_key:'standard_monthly').",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Yd,async run(e){let{query:t,limit:r}=e.propsValue,n={query:t};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/prices/search`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var Cv=x({name:"update_subscription",auth:g,displayName:"Update Subscription (Agent)",description:"Update an existing Stripe subscription.",audience:"ai",aiMetadata:{description:"Updates an existing subscription: change its items (price + quantity), proration behavior, metadata, or schedule cancellation at period end. To cancel outright use Cancel Subscription. Only the fields you supply change. Idempotent: re-applying the same update converges.",idempotent:!0},props:{subscription_id:u.ShortText({displayName:"Subscription ID",description:"The subscription ID (e.g., sub_...). Obtain it from List/Search Subscriptions.",required:!0}),items:u.Array({displayName:"Items",description:"New/updated items. To modify an existing item include its subscription-item id; to add one supply a price.",required:!1,properties:{id:u.ShortText({displayName:"Subscription Item ID",description:"Existing item id (si_...) to update. Obtain it from List Subscription Items.",required:!1}),price:u.ShortText({displayName:"Price ID",required:!1}),quantity:u.Number({displayName:"Quantity",required:!1})}}),proration_behavior:u.StaticDropdown({displayName:"Proration Behavior",required:!1,options:{options:[{label:"Create Prorations",value:"create_prorations"},{label:"None",value:"none"},{label:"Always Invoice",value:"always_invoice"}]}}),cancel_at_period_end:u.Checkbox({displayName:"Cancel at Period End",required:!1}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:be,async run(e){let{subscription_id:t,items:r,proration_behavior:n,cancel_at_period_end:o,metadata:i}=e.propsValue,s={};return n&&(s.proration_behavior=n),o!==void 0&&(s.cancel_at_period_end=o),i&&typeof i=="object"&&Object.keys(i).forEach(d=>{s[`metadata[${d}]`]=i[d]}),r&&Array.isArray(r)&&r.forEach((d,b)=>{let m=d;m.id&&(s[`items[${b}][id]`]=m.id),m.price&&(s[`items[${b}][price]`]=m.price),m.quantity!==void 0&&m.quantity!==null&&(s[`items[${b}][quantity]`]=m.quantity)}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/subscriptions/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})).body}});var $v=x({name:"get_subscription",auth:g,displayName:"Get Subscription (Agent)",description:"Retrieve a Stripe subscription by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe subscription by its subscription ID (e.g., sub_...). Use List/Search Subscriptions to discover IDs. Read-only and idempotent.",idempotent:!0},props:{subscription_id:u.ShortText({displayName:"Subscription ID",description:"The subscription ID (e.g., sub_...). Obtain it from List/Search Subscriptions.",required:!0})},outputSchema:be,async run(e){let{subscription_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/subscriptions/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Nv=x({name:"list_subscriptions",auth:g,displayName:"List Subscriptions (Agent)",description:"List Stripe subscriptions.",audience:"ai",aiMetadata:{description:"Pages through subscriptions, newest first, optionally filtered by customer, status, or price. Use to enumerate or audit a customer's subscriptions; for rich filters/customer-hydration use Search Subscriptions, or Get Subscription when you have the sub_ ID. Read-only and idempotent.",idempotent:!0},props:{customer:u.ShortText({displayName:"Customer ID",description:"Filter to subscriptions for this customer (cus_...).",required:!1}),status:u.StaticDropdown({displayName:"Status",required:!1,options:{options:[{label:"All",value:"all"},{label:"Active",value:"active"},{label:"Past Due",value:"past_due"},{label:"Unpaid",value:"unpaid"},{label:"Canceled",value:"canceled"},{label:"Incomplete",value:"incomplete"},{label:"Incomplete Expired",value:"incomplete_expired"},{label:"Trialing",value:"trialing"},{label:"Paused",value:"paused"}]}}),price:u.ShortText({displayName:"Price ID",description:"Filter to subscriptions containing this price (price_...).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Ld,async run(e){let{customer:t,status:r,price:n,limit:o}=e.propsValue,i={};return t&&(i.customer=t),r&&(i.status=r),n&&(i.price=n),o&&(i.limit=o.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/subscriptions`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:i})).body}});var Dv=x({name:"list_subscription_items",auth:g,displayName:"List Subscription Items (Agent)",description:"List the line items of a subscription.",audience:"ai",aiMetadata:{description:"Pages through the items of a single subscription, returning the subscription-item IDs (si_...) needed to update quantity or report usage. Use before Update Subscription when modifying a specific item. Read-only and idempotent.",idempotent:!0},props:{subscription_id:u.ShortText({displayName:"Subscription ID",description:"The subscription ID (e.g., sub_...). Obtain it from List/Search Subscriptions.",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:qd,async run(e){let{subscription_id:t,limit:r}=e.propsValue,n={subscription:t};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/subscription_items`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var zv=x({name:"get_payment_link",auth:g,displayName:"Get Payment Link (Agent)",description:"Retrieve a Stripe payment link by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe payment link by its ID (e.g., plink_...), including its URL, active state, and line items. Use List Payment Links to discover IDs. Read-only and idempotent.",idempotent:!0},props:{payment_link_id:u.ShortText({displayName:"Payment Link ID",description:"The payment link ID (e.g., plink_...). Obtain it from List Payment Links.",required:!0})},outputSchema:ze,async run(e){let{payment_link_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_links/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Mv=x({name:"list_payment_links",auth:g,displayName:"List Payment Links (Agent)",description:"List Stripe payment links.",audience:"ai",aiMetadata:{description:"Pages through payment links, optionally filtered by active state. Use to enumerate links or resolve a payment link ID; use Get Payment Link when you have the plink_ ID. Read-only and idempotent.",idempotent:!0},props:{active:u.StaticDropdown({displayName:"Active",required:!1,options:{options:[{label:"Active only",value:"true"},{label:"Inactive only",value:"false"}]}}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Fd,async run(e){let{active:t,limit:r}=e.propsValue,n={};return t&&(n.active=t),r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_links`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var Uv=x({name:"create_checkout_session",auth:g,displayName:"Create Checkout Session (Agent)",description:"Create a Stripe-hosted Checkout Session.",audience:"ai",aiMetadata:{description:"Creates a Stripe-hosted Checkout Session for one-time payment, subscription, or setup mode, with line items (price IDs + quantities) and success/cancel URLs. Richer than a payment link for one-off flows; for a reusable shareable URL use Create Payment Link. Not idempotent: each call creates a new session.",idempotent:!1},props:{mode:u.StaticDropdown({displayName:"Mode",description:"The Checkout mode.",required:!0,options:{options:[{label:"Payment (one-time)",value:"payment"},{label:"Subscription",value:"subscription"},{label:"Setup (save payment method)",value:"setup"}]}}),line_items:u.Array({displayName:"Line Items",description:"The prices and quantities. Required for payment and subscription modes.",required:!1,properties:{price:u.ShortText({displayName:"Price ID",description:"The price ID (e.g., price_...).",required:!0}),quantity:u.Number({displayName:"Quantity",required:!0})}}),success_url:u.ShortText({displayName:"Success URL",description:"URL to redirect to after successful payment.",required:!1}),cancel_url:u.ShortText({displayName:"Cancel URL",description:"URL to redirect to if the customer cancels.",required:!1}),customer:u.ShortText({displayName:"Customer ID",description:"An existing customer (cus_...) to associate with the session.",required:!1})},outputSchema:sr,async run(e){let{mode:t,line_items:r,success_url:n,cancel_url:o,customer:i}=e.propsValue,s={mode:t};return n&&(s.success_url=n),o&&(s.cancel_url=o),i&&(s.customer=i),r&&Array.isArray(r)&&r.forEach((d,b)=>{let m=d;s[`line_items[${b}][price]`]=m.price,s[`line_items[${b}][quantity]`]=m.quantity}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/checkout/sessions`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})).body}});var Lv=x({name:"get_checkout_session",auth:g,displayName:"Get Checkout Session (Agent)",description:"Retrieve a Stripe Checkout Session by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Checkout Session by its ID (e.g., cs_...), including payment status, customer, and amounts. Use List Checkout Sessions to discover IDs. Read-only and idempotent.",idempotent:!0},props:{session_id:u.ShortText({displayName:"Session ID",description:"The Checkout Session ID (e.g., cs_...). Obtain it from List Checkout Sessions.",required:!0})},outputSchema:sr,async run(e){let{session_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/checkout/sessions/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var qv=x({name:"list_checkout_sessions",auth:g,displayName:"List Checkout Sessions (Agent)",description:"List Stripe Checkout Sessions.",audience:"ai",aiMetadata:{description:"Pages through Checkout Sessions, newest first, optionally filtered by customer, PaymentIntent, or status. Use to enumerate sessions or resolve a session ID; use Get Checkout Session when you have the cs_ ID. Read-only and idempotent.",idempotent:!0},props:{customer:u.ShortText({displayName:"Customer ID",description:"Filter to sessions for this customer (cus_...).",required:!1}),payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"Filter to the session for this PaymentIntent (pi_...).",required:!1}),status:u.StaticDropdown({displayName:"Status",required:!1,options:{options:[{label:"Open",value:"open"},{label:"Complete",value:"complete"},{label:"Expired",value:"expired"}]}}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Bd,async run(e){let{customer:t,payment_intent:r,status:n,limit:o}=e.propsValue,i={};return t&&(i.customer=t),r&&(i.payment_intent=r),n&&(i.status=n),o&&(i.limit=o.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/checkout/sessions`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:i})).body}});var jv=x({name:"create_payment_method",auth:g,displayName:"Create Payment Method (Agent)",description:"Create a PaymentMethod from a token.",audience:"ai",aiMetadata:{description:"Creates a Stripe PaymentMethod of the given type from a single-use token (e.g. tok_visa, or a token produced by Stripe.js), with optional billing details. NEVER pass raw card numbers \u2014 raw PAN entry is restricted to PCI-compliant integrations; supply a token instead. Use before Attach Payment Method. Not idempotent: each call creates a new PaymentMethod.",idempotent:!1},props:{type:u.ShortText({displayName:"Type",description:"The PaymentMethod type (e.g., card).",required:!0}),token:u.ShortText({displayName:"Card Token",description:"A single-use card token (e.g., tok_visa or a Stripe.js token). Required for card type. Do NOT pass a raw card number.",required:!1}),billing_name:u.ShortText({displayName:"Billing Name",required:!1}),billing_email:u.ShortText({displayName:"Billing Email",required:!1})},outputSchema:or,async run(e){let{type:t,token:r,billing_name:n,billing_email:o}=e.propsValue,i={type:t};return r&&(i["card[token]"]=r),n&&(i["billing_details[name]"]=n),o&&(i["billing_details[email]"]=o),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_methods`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i})).body}});var Fv=x({name:"attach_payment_method",auth:g,displayName:"Attach Payment Method (Agent)",description:"Attach a PaymentMethod to a customer.",audience:"ai",aiMetadata:{description:"Attaches a PaymentMethod to a customer so it can be charged off-session (e.g. for subscriptions or saved cards). Use after Create Payment Method. Idempotent: re-attaching the same PaymentMethod to the same customer is a no-op.",idempotent:!0},props:{payment_method_id:u.ShortText({displayName:"Payment Method ID",description:"The PaymentMethod ID (e.g., pm_...) to attach. Obtain it from Create Payment Method or List Customer Payment Methods.",required:!0}),customer:u.ShortText({displayName:"Customer ID",description:"The customer ID (e.g., cus_...) to attach the PaymentMethod to.",required:!0})},outputSchema:or,async run(e){let{payment_method_id:t,customer:r}=e.propsValue;return(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_methods/${t}/attach`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{customer:r}})).body}});var Bv=x({name:"get_payment_method",auth:g,displayName:"Get Payment Method (Agent)",description:"Retrieve a PaymentMethod by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single PaymentMethod by its ID (e.g., pm_...), including type and (masked) card details. Use List Customer Payment Methods to discover a customer's PaymentMethod IDs. Read-only and idempotent.",idempotent:!0},props:{payment_method_id:u.ShortText({displayName:"Payment Method ID",description:"The PaymentMethod ID (e.g., pm_...). Obtain it from List Customer Payment Methods.",required:!0})},outputSchema:or,async run(e){let{payment_method_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_methods/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Vv=x({name:"list_customer_payment_methods",auth:g,displayName:"List Customer Payment Methods (Agent)",description:"List a customer's attached payment methods.",audience:"ai",aiMetadata:{description:"Pages through the PaymentMethods attached to a customer, returning the pm_ IDs you can charge off-session. Use to find a customer's saved card before creating a payment. Read-only and idempotent.",idempotent:!0},props:{customer_id:u.ShortText({displayName:"Customer ID",description:"The customer ID (e.g., cus_...). Obtain it from Search/List Customers.",required:!0}),type:u.ShortText({displayName:"Type",description:"Filter by PaymentMethod type (e.g., card).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:$d,async run(e){let{customer_id:t,type:r,limit:n}=e.propsValue,o={};return r&&(o.type=r),n&&(o.limit=n.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/customers/${t}/payment_methods`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:o})).body}});var Gv=x({name:"create_coupon",auth:g,displayName:"Create Coupon (Agent)",description:"Create a discount coupon.",audience:"ai",aiMetadata:{description:"Creates a discount coupon \u2014 either percent_off or amount_off (the latter requires a currency), with a duration of once, repeating (with duration_in_months), or forever. To expose it to customers wrap it in a Promotion Code. Not idempotent: each call creates a new coupon, and supplying a duplicate stable id returns a 409.",idempotent:!1},props:{percent_off:u.Number({displayName:"Percent Off",description:"Percentage discount (e.g., 25 for 25%). Use this OR Amount Off.",required:!1}),amount_off:u.Number({displayName:"Amount Off",description:"Flat discount in the smallest currency unit (e.g., 500 for $5.00). Requires Currency.",required:!1}),currency:u.ShortText({displayName:"Currency",description:"Three-letter ISO currency code. Required with Amount Off.",required:!1}),duration:u.StaticDropdown({displayName:"Duration",description:"How long the discount applies.",required:!0,options:{options:[{label:"Once",value:"once"},{label:"Repeating",value:"repeating"},{label:"Forever",value:"forever"}]}}),duration_in_months:u.Number({displayName:"Duration in Months",description:"Number of months the discount lasts. Required if duration is repeating.",required:!1}),name:u.ShortText({displayName:"Name",description:"Name shown to customers on invoices/receipts.",required:!1}),id:u.ShortText({displayName:"ID",description:"A custom unique coupon ID. If omitted, Stripe generates one. Reusing an existing id returns an error.",required:!1})},outputSchema:vo,async run(e){let{percent_off:t,amount_off:r,currency:n,duration:o,duration_in_months:i,name:s,id:l}=e.propsValue,d={duration:o};return t!=null&&(d.percent_off=t),r!=null&&(d.amount_off=r),n&&(d.currency=n),i!=null&&(d.duration_in_months=i),s&&(d.name=s),l&&(d.id=l),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/coupons`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:d})).body}});var Hv=x({name:"get_coupon",auth:g,displayName:"Get Coupon (Agent)",description:"Retrieve a coupon by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single coupon by its ID. Use List Coupons to discover IDs. Read-only and idempotent.",idempotent:!0},props:{coupon_id:u.ShortText({displayName:"Coupon ID",description:"The coupon ID. Obtain it from List Coupons.",required:!0})},outputSchema:vo,async run(e){let{coupon_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/coupons/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Zv=x({name:"list_coupons",auth:g,displayName:"List Coupons (Agent)",description:"List Stripe coupons.",audience:"ai",aiMetadata:{description:"Pages through coupons, newest first. Use to enumerate coupons or resolve a coupon ID; use Get Coupon when you have the ID. Read-only and idempotent.",idempotent:!0},props:{limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Od,async run(e){let{limit:t}=e.propsValue,r={};return t&&(r.limit=t.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/coupons`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:r})).body}});var Wv=x({name:"create_promotion_code",auth:g,displayName:"Create Promotion Code (Agent)",description:"Create a customer-facing promotion code for a coupon.",audience:"ai",aiMetadata:{description:"Creates a customer-facing promotion code that maps to an existing coupon, with optional custom code string, customer restriction, max redemptions, and expiry. Create the coupon first with Create Coupon. Not idempotent: each call creates a new promotion code.",idempotent:!1},props:{coupon:u.ShortText({displayName:"Coupon ID",description:"The coupon ID this promotion code applies. Obtain it from List Coupons or Create Coupon.",required:!0}),code:u.ShortText({displayName:"Code",description:"The customer-facing code (e.g., SUMMER25). If omitted, Stripe generates one.",required:!1}),customer:u.ShortText({displayName:"Customer ID",description:"Restrict the code to this customer (cus_...).",required:!1}),max_redemptions:u.Number({displayName:"Max Redemptions",description:"Maximum number of times the code can be redeemed.",required:!1}),expires_at:u.DateTime({displayName:"Expires At",description:"When the promotion code expires.",required:!1}),active:u.Checkbox({displayName:"Active",required:!1})},outputSchema:_o,async run(e){let{coupon:t,code:r,customer:n,max_redemptions:o,expires_at:i,active:s}=e.propsValue,l={coupon:t};return r&&(l.code=r),n&&(l.customer=n),o!=null&&(l.max_redemptions=o),i&&(l.expires_at=Math.floor(new Date(i).getTime()/1e3)),s!==void 0&&(l.active=s),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/promotion_codes`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded","Stripe-Version":"2025-05-28.basil"},body:l})).body}});var Kv=x({name:"get_promotion_code",auth:g,displayName:"Get Promotion Code (Agent)",description:"Retrieve a promotion code by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single promotion code by its ID (e.g., promo_...). Use List Promotion Codes to discover IDs. Read-only and idempotent.",idempotent:!0},props:{promotion_code_id:u.ShortText({displayName:"Promotion Code ID",description:"The promotion code ID (e.g., promo_...). Obtain it from List Promotion Codes.",required:!0})},outputSchema:_o,async run(e){let{promotion_code_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/promotion_codes/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Jv=x({name:"list_promotion_codes",auth:g,displayName:"List Promotion Codes (Agent)",description:"List Stripe promotion codes.",audience:"ai",aiMetadata:{description:"Pages through promotion codes, optionally filtered by coupon, active state, or the literal code string. Use to enumerate codes or resolve an ID; use Get Promotion Code when you have the promo_ ID. Read-only and idempotent.",idempotent:!0},props:{coupon:u.ShortText({displayName:"Coupon ID",description:"Filter to codes for this coupon.",required:!1}),active:u.StaticDropdown({displayName:"Active",required:!1,options:{options:[{label:"Active only",value:"true"},{label:"Inactive only",value:"false"}]}}),code:u.ShortText({displayName:"Code",description:"Filter to the literal code string (e.g., SUMMER25).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Rd,async run(e){let{coupon:t,active:r,code:n,limit:o}=e.propsValue,i={};return t&&(i.coupon=t),r&&(i.active=r),n&&(i.code=n),o&&(i.limit=o.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/promotion_codes`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:i})).body}});var Xv=x({name:"retrieve_balance",auth:g,displayName:"Retrieve Balance (Agent)",description:"Get the current Stripe account balance.",audience:"ai",aiMetadata:{description:"Fetches the current Stripe account balance, broken down into available and pending funds by currency. Use to check how much can be paid out. Read-only and idempotent; takes no parameters.",idempotent:!0},props:{},outputSchema:Id,async run(e){return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/balance`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Yv=x({name:"list_balance_transactions",auth:g,displayName:"List Balance Transactions (Agent)",description:"List balance transactions (the reconciliation ledger).",audience:"ai",aiMetadata:{description:"Pages through the balance-transaction ledger \u2014 every item that affected the account balance (charges, refunds, fees, payouts), newest first. Optionally filter by type, payout, or created range. Use to reconcile activity to a payout. Read-only and idempotent.",idempotent:!0},props:{type:u.ShortText({displayName:"Type",description:"Filter by transaction type (e.g., charge, refund, payout).",required:!1}),payout:u.ShortText({displayName:"Payout ID",description:"Filter to transactions paid out in this payout (po_...).",required:!1}),created_after:u.DateTime({displayName:"Created After",required:!1}),created_before:u.DateTime({displayName:"Created Before",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Wd,async run(e){let{type:t,payout:r,created_after:n,created_before:o,limit:i}=e.propsValue,s={};return t&&(s.type=t),r&&(s.payout=r),i&&(s.limit=i.toString()),n&&(s["created[gte]"]=Math.floor(new Date(n).getTime()/1e3).toString()),o&&(s["created[lte]"]=Math.floor(new Date(o).getTime()/1e3).toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/balance_transactions`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:s})).body}});var Qv=x({name:"list_payouts",auth:g,displayName:"List Payouts (Agent)",description:"List payouts to the bank account.",audience:"ai",aiMetadata:{description:"Pages through payouts (funds sent to your bank account), newest first, optionally filtered by status or arrival date. Use to enumerate payouts or resolve a payout ID; use Get Payout when you have the po_ ID. Read-only and idempotent.",idempotent:!0},props:{status:u.StaticDropdown({displayName:"Status",required:!1,options:{options:[{label:"Pending",value:"pending"},{label:"In Transit",value:"in_transit"},{label:"Paid",value:"paid"},{label:"Failed",value:"failed"},{label:"Canceled",value:"canceled"}]}}),arrival_date_after:u.DateTime({displayName:"Arrival Date After",required:!1}),arrival_date_before:u.DateTime({displayName:"Arrival Date Before",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Gd,async run(e){let{status:t,arrival_date_after:r,arrival_date_before:n,limit:o}=e.propsValue,i={};return t&&(i.status=t),o&&(i.limit=o.toString()),r&&(i["arrival_date[gte]"]=Math.floor(new Date(r).getTime()/1e3).toString()),n&&(i["arrival_date[lte]"]=Math.floor(new Date(n).getTime()/1e3).toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payouts`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:i})).body}});var e_=x({name:"create_tax_rate",auth:g,displayName:"Create Tax Rate (Agent)",description:"Create a manual tax rate.",audience:"ai",aiMetadata:{description:"Creates a manual Stripe tax rate (a fixed percentage with a display name and inclusive/exclusive flag), for applying to invoices or subscriptions. This is the manual tax-rate object, not Stripe Tax automation. Not idempotent: each call creates a new tax rate.",idempotent:!1},props:{display_name:u.ShortText({displayName:"Display Name",description:"Name shown to customers (e.g., VAT).",required:!0}),percentage:u.Number({displayName:"Percentage",description:"The tax rate percentage (e.g., 20 for 20%).",required:!0}),inclusive:u.Checkbox({displayName:"Inclusive",description:"Whether the tax is included in the price.",required:!0}),jurisdiction:u.ShortText({displayName:"Jurisdiction",description:"Optional jurisdiction text (e.g., UK).",required:!1}),country:u.ShortText({displayName:"Country",description:"Two-letter ISO country code.",required:!1})},outputSchema:bo,async run(e){let{display_name:t,percentage:r,inclusive:n,jurisdiction:o,country:i}=e.propsValue,s={display_name:t,percentage:r,inclusive:n};return o&&(s.jurisdiction=o),i&&(s.country=i),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/tax_rates`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})).body}});var t_=x({name:"get_tax_rate",auth:g,displayName:"Get Tax Rate (Agent)",description:"Retrieve a tax rate by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single tax rate by its ID (e.g., txr_...). Use List Tax Rates to discover IDs. Read-only and idempotent.",idempotent:!0},props:{tax_rate_id:u.ShortText({displayName:"Tax Rate ID",description:"The tax rate ID (e.g., txr_...). Obtain it from List Tax Rates.",required:!0})},outputSchema:bo,async run(e){let{tax_rate_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/tax_rates/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var r_=x({name:"list_tax_rates",auth:g,displayName:"List Tax Rates (Agent)",description:"List Stripe tax rates.",audience:"ai",aiMetadata:{description:"Pages through tax rates, optionally filtered by active or inclusive flags. Use to enumerate tax rates or resolve a tax rate ID; use Get Tax Rate when you have the txr_ ID. Read-only and idempotent.",idempotent:!0},props:{active:u.StaticDropdown({displayName:"Active",required:!1,options:{options:[{label:"Active only",value:"true"},{label:"Inactive only",value:"false"}]}}),inclusive:u.StaticDropdown({displayName:"Inclusive",required:!1,options:{options:[{label:"Inclusive only",value:"true"},{label:"Exclusive only",value:"false"}]}}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Cd,async run(e){let{active:t,inclusive:r,limit:n}=e.propsValue,o={};return t&&(o.active=t),r&&(o.inclusive=r),n&&(o.limit=n.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/tax_rates`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:o})).body}});var n_=x({name:"create_credit_note",auth:g,displayName:"Create Credit Note (Agent)",description:"Issue a credit note against a finalized invoice.",audience:"ai",aiMetadata:{description:"Issues a credit note against a finalized invoice \u2014 a post-payment adjustment (credit, refund, or out-of-band amount). Supply either a total credit_amount or itemized lines (in the smallest currency unit). The invoice must already be finalized. Not idempotent: each call creates a new credit note.",idempotent:!1},props:{invoice:u.ShortText({displayName:"Invoice ID",description:"The finalized invoice ID (e.g., in_...) to credit. Obtain it from List/Search Invoices.",required:!0}),amount:u.Number({displayName:"Amount",description:"Total amount of the credit note, in the smallest currency unit (e.g., 500 for $5.00). Stripe requires this (or itemized lines); it must not exceed the invoice total. By default the full amount credits the customer balance unless you also set Credit Amount / Refund Amount to split it.",required:!0}),credit_amount:u.Number({displayName:"Credit Amount",description:"The amount to credit to the customer balance, in the smallest currency unit (e.g., 500 for $5.00).",required:!1}),refund_amount:u.Number({displayName:"Refund Amount",description:"The amount to refund, in the smallest currency unit. Refunds against the original payment.",required:!1}),reason:u.StaticDropdown({displayName:"Reason",required:!1,options:{options:[{label:"Duplicate",value:"duplicate"},{label:"Fraudulent",value:"fraudulent"},{label:"Order Change",value:"order_change"},{label:"Product Unsatisfactory",value:"product_unsatisfactory"}]}}),memo:u.LongText({displayName:"Memo",required:!1})},outputSchema:ar,async run(e){let{invoice:t,amount:r,credit_amount:n,refund_amount:o,reason:i,memo:s}=e.propsValue,l={invoice:t};return r!=null&&(l.amount=r),n!=null&&(l.credit_amount=n),o!=null&&(l.refund_amount=o),i&&(l.reason=i),s&&(l.memo=s),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/credit_notes`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})).body}});var o_=x({name:"void_credit_note",auth:g,displayName:"Void Credit Note (Agent)",description:"Void a credit note.",audience:"ai",aiMetadata:{description:"Voids a Stripe credit note, reversing the credit/refund it represented. Not idempotent: it errors if the credit note is already void.",idempotent:!1},props:{credit_note_id:u.ShortText({displayName:"Credit Note ID",description:"The credit note ID (e.g., cn_...). Obtain it from List Credit Notes.",required:!0})},outputSchema:ar,async run(e){let{credit_note_id:t}=e.propsValue;return(await v.sendRequest({method:"POST",url:`${_.baseUrl}/credit_notes/${t}/void`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{}})).body}});var i_=x({name:"get_credit_note",auth:g,displayName:"Get Credit Note (Agent)",description:"Retrieve a credit note by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single credit note by its ID (e.g., cn_...), including its line items. Use List Credit Notes to discover IDs. Read-only and idempotent.",idempotent:!0},props:{credit_note_id:u.ShortText({displayName:"Credit Note ID",description:"The credit note ID (e.g., cn_...). Obtain it from List Credit Notes.",required:!0})},outputSchema:ar,async run(e){let{credit_note_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/credit_notes/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var a_=x({name:"list_credit_notes",auth:g,displayName:"List Credit Notes (Agent)",description:"List Stripe credit notes.",audience:"ai",aiMetadata:{description:"Pages through credit notes, newest first, optionally filtered by invoice or customer. Use to enumerate credit notes or resolve a credit note ID; use Get Credit Note when you have the cn_ ID. Read-only and idempotent.",idempotent:!0},props:{invoice:u.ShortText({displayName:"Invoice ID",description:"Filter to credit notes for this invoice (in_...).",required:!1}),customer:u.ShortText({displayName:"Customer ID",description:"Filter to credit notes for this customer (cus_...).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:jd,async run(e){let{invoice:t,customer:r,limit:n}=e.propsValue,o={};return t&&(o.invoice=t),r&&(o.customer=r),n&&(o.limit=n.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/credit_notes`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:o})).body}});var s_=x({name:"list_events",auth:g,displayName:"List Events (Agent)",description:"List Stripe account events.",audience:"ai",aiMetadata:{description:"Pages through the account event log (the audit feed of everything that happened), newest first, optionally filtered by event type (e.g. invoice.paid) or created range. Use to investigate what happened to a resource. Read-only and idempotent.",idempotent:!0},props:{type:u.ShortText({displayName:"Type",description:"Filter by event type (e.g., invoice.paid, charge.refunded).",required:!1}),created_after:u.DateTime({displayName:"Created After",required:!1}),created_before:u.DateTime({displayName:"Created Before",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Zd,async run(e){let{type:t,created_after:r,created_before:n,limit:o}=e.propsValue,i={};return t&&(i.type=t),o&&(i.limit=o.toString()),r&&(i["created[gte]"]=Math.floor(new Date(r).getTime()/1e3).toString()),n&&(i["created[lte]"]=Math.floor(new Date(n).getTime()/1e3).toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/events`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:i})).body}});var u_=x({name:"get_event",auth:g,displayName:"Get Event (Agent)",description:"Retrieve a single Stripe event by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe event by its ID (e.g., evt_...), including the object snapshot it carried. Use List Events or a webhook payload to obtain the ID. Read-only and idempotent.",idempotent:!0},props:{event_id:u.ShortText({displayName:"Event ID",description:"The event ID (e.g., evt_...). Obtain it from List Events or a webhook payload.",required:!0})},outputSchema:Ed,async run(e){let{event_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/events/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var c_=x({name:"get_dispute",auth:g,displayName:"Get Dispute (Agent)",description:"Retrieve a dispute by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe dispute (chargeback) by its ID (e.g., dp_...), including its status, reason, and evidence due date. Use List Disputes to discover IDs. Read-only and idempotent.",idempotent:!0},props:{dispute_id:u.ShortText({displayName:"Dispute ID",description:"The dispute ID (e.g., dp_...). Obtain it from List Disputes.",required:!0})},outputSchema:xt,async run(e){let{dispute_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/disputes/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var l_=x({name:"list_disputes",auth:g,displayName:"List Disputes (Agent)",description:"List Stripe disputes (chargebacks).",audience:"ai",aiMetadata:{description:"Pages through disputes (chargebacks), newest first, optionally filtered by charge, PaymentIntent, or created range. Use to enumerate disputes or resolve a dispute ID; use Get Dispute when you have the dp_ ID. Read-only and idempotent.",idempotent:!0},props:{charge:u.ShortText({displayName:"Charge ID",description:"Filter to disputes for this charge (ch_...).",required:!1}),payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"Filter to disputes for this PaymentIntent (pi_...).",required:!1}),created_after:u.DateTime({displayName:"Created After",required:!1}),created_before:u.DateTime({displayName:"Created Before",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Vd,async run(e){let{charge:t,payment_intent:r,created_after:n,created_before:o,limit:i}=e.propsValue,s={};return t&&(s.charge=t),r&&(s.payment_intent=r),i&&(s.limit=i.toString()),n&&(s["created[gte]"]=Math.floor(new Date(n).getTime()/1e3).toString()),o&&(s["created[lte]"]=Math.floor(new Date(o).getTime()/1e3).toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/disputes`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:s})).body}});var p_=x({name:"list_transfers",auth:g,displayName:"List Transfers (Agent)",description:"List transfers to connected accounts (Stripe Connect).",audience:"ai",aiMetadata:{description:"Pages through transfers to connected accounts, newest first, optionally filtered by destination. Stripe Connect platforms only \u2014 on a standard (non-Connect) account this returns an empty list, which is expected, not an error. Read-only and idempotent.",idempotent:!0},props:{destination:u.ShortText({displayName:"Destination Account ID",description:"Filter to transfers to this connected account (acct_...).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Hd,async run(e){let{destination:t,limit:r}=e.propsValue,n={};return t&&(n.destination=t),r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/transfers`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var d_=x({name:"update_dispute",auth:g,displayName:"Update Dispute (Agent)",description:"Submit or update evidence on a dispute.",audience:"ai",aiMetadata:{description:"Submits or updates evidence and metadata on a Stripe dispute (chargeback) to contest it. Set submit=true to finalize and submit the evidence to the bank \u2014 once submitted, evidence can no longer be changed. Prefer this (contest with evidence) over Close Dispute (which concedes). Idempotent for metadata/evidence edits; submitting is a one-way action.",idempotent:!0},props:{dispute_id:u.ShortText({displayName:"Dispute ID",description:"The dispute ID (e.g., dp_...). Obtain it from List Disputes.",required:!0}),evidence:u.Json({displayName:"Evidence",description:'A Stripe dispute evidence object (e.g., {"product_description":"...","customer_name":"..."}).',required:!1}),submit:u.Checkbox({displayName:"Submit",description:"If true, finalizes and submits the evidence to the bank. This cannot be undone.",required:!1}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:xt,async run(e){let{dispute_id:t,evidence:r,submit:n,metadata:o}=e.propsValue,i={};return n!==void 0&&(i.submit=n),r&&typeof r=="object"&&Object.keys(r).forEach(l=>{i[`evidence[${l}]`]=r[l]}),o&&typeof o=="object"&&Object.keys(o).forEach(l=>{i[`metadata[${l}]`]=o[l]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/disputes/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i})).body}});var m_=x({name:"close_dispute",auth:g,displayName:"Close Dispute (Agent)",description:"Concede a dispute (DESTRUCTIVE \u2014 forfeits the funds).",audience:"ai",aiMetadata:{description:"DESTRUCTIVE AND IRREVERSIBLE: closing a dispute concedes the chargeback and permanently forfeits the disputed funds \u2014 the money is lost and cannot be recovered. Almost always prefer Update Dispute (submit evidence to contest) instead. Only use when you explicitly intend to give up the dispute. Not idempotent.",idempotent:!1},props:{dispute_id:u.ShortText({displayName:"Dispute ID",description:"The dispute ID (e.g., dp_...) to concede. Obtain it from List Disputes.",required:!0})},outputSchema:xt,async run(e){let{dispute_id:t}=e.propsValue;return(await v.sendRequest({method:"POST",url:`${_.baseUrl}/disputes/${t}/close`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{}})).body}});var g=ia.SecretText({displayName:"Secret API Key",required:!0,description:"Secret key acquired from your Stripe dashboard",validate:a(async({auth:e})=>{try{return await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/customers",headers:{Authorization:`Bearer ${e}`}}),{valid:!0}}catch{return{valid:!1,error:"Invalid API Key. Please check the key and try again."}}},"validate")}),MI=Wc({displayName:"Stripe",description:"Online payment processing for internet businesses",minimumSupportedRelease:"0.86.4",logoUrl:"https://cdn.activepieces.com/pieces/stripe.png",authors:["lldiegon","doskyft","kishanprmr","MoShizzle","AbdulTheActivePiecer","khaledmashaly","abuaboud","Prabhukiran161","sanket-a11y"],categories:["COMMERCE","PAYMENT_PROCESSING"],auth:g,actions:[em,tm,hg,bg,rm,Og,Rg,Cg,$g,Ng,Dg,zg,Mg,Ug,Lg,qg,jg,Fg,Bg,Vg,Gg,Hg,Zg,Wg,Kg,Jg,Xg,Yg,Qg,ev,tv,rv,nv,ov,iv,av,sv,uv,cv,lv,pv,dv,mv,fv,hv,yv,gv,vv,_v,bv,Pv,xv,Sv,Tv,Ev,Iv,Av,kv,wv,Ov,Rv,Cv,$v,Nv,Dv,zv,Mv,Uv,Lv,qv,jv,Fv,Bv,Vv,Gv,Hv,Zv,Wv,Kv,Jv,Xv,Yv,Qv,e_,t_,r_,n_,o_,i_,a_,s_,u_,c_,l_,p_,d_,m_,ud({baseUrl:a(()=>"https://api.stripe.com/v1","baseUrl"),auth:g,authMapping:a(async e=>({Authorization:`Bearer ${e.secret_text}`}),"authMapping")})],triggers:[gg,yg,_g,vg,Pg,xg,Sg,Tg,Eg,Ig,Ag,kg,wg]});0&&(module.exports={stripe,stripeAuth});
15
+ `+G});let Y=Math.floor((typeof T=="number"?T:Date.now())/1e3)-h.timestamp;if(y>0&&Y>y)throw new Fe(P,m,{message:"Timestamp outside the tolerance zone"});return!0}a(i,"validateComputedSignature");function s(m,P){return typeof m!="string"?null:m.split(",").reduce((h,d)=>{let y=d.split("=");return y[0]==="t"&&(h.timestamp=parseInt(y[1],10)),y[0]===P&&h.signatures.push(y[1]),h},{timestamp:-1,signatures:[]})}a(s,"parseHeader");let l=null;function f(){return l||(l=e.createDefaultCryptoProvider()),l}a(f,"getCryptoProvider");function b(m){if(!m)throw new pe({message:"Options are required"});let P=Math.floor(m.timestamp)||Math.floor(Date.now()/1e3),h=m.scheme||r.EXPECTED_SCHEME,d=m.cryptoProvider||f(),y=`${P}.${m.payload}`,I=a(S=>`t=${P},${h}=${S}`,"generateHeaderString");return Object.assign(Object.assign({},m),{timestamp:P,scheme:h,cryptoProvider:d,payloadString:y,generateHeaderString:I})}return a(b,"prepareOptions"),t.signature=r,t}a(Pf,"createWebhooks");var xf="2025-05-28.basil";var wr={};Mn(wr,{Account:()=>Ns,AccountLinks:()=>iy,AccountSessions:()=>ay,Accounts:()=>Ns,ApplePayDomains:()=>sy,ApplicationFees:()=>uy,Apps:()=>EI,Balance:()=>cy,BalanceTransactions:()=>py,Billing:()=>II,BillingPortal:()=>AI,Charges:()=>dy,Checkout:()=>wI,Climate:()=>kI,ConfirmationTokens:()=>my,CountrySpecs:()=>hy,Coupons:()=>yy,CreditNotes:()=>gy,CustomerSessions:()=>vy,Customers:()=>_y,Disputes:()=>by,Entitlements:()=>RI,EphemeralKeys:()=>xy,Events:()=>Ty,ExchangeRates:()=>Iy,FileLinks:()=>Ay,Files:()=>ky,FinancialConnections:()=>OI,Forwarding:()=>CI,Identity:()=>$I,InvoiceItems:()=>Ry,InvoicePayments:()=>Cy,InvoiceRenderingTemplates:()=>$y,Invoices:()=>Ny,Issuing:()=>NI,Mandates:()=>Dy,OAuth:()=>My,PaymentIntents:()=>Uy,PaymentLinks:()=>Ly,PaymentMethodConfigurations:()=>qy,PaymentMethodDomains:()=>jy,PaymentMethods:()=>Fy,Payouts:()=>By,Plans:()=>Gy,Prices:()=>Vy,Products:()=>Hy,PromotionCodes:()=>Zy,Quotes:()=>Wy,Radar:()=>DI,Refunds:()=>Ky,Reporting:()=>zI,Reviews:()=>Jy,SetupAttempts:()=>Xy,SetupIntents:()=>Yy,ShippingRates:()=>Qy,Sigma:()=>MI,Sources:()=>eg,SubscriptionItems:()=>tg,SubscriptionSchedules:()=>rg,Subscriptions:()=>ng,Tax:()=>UI,TaxCodes:()=>ig,TaxIds:()=>ag,TaxRates:()=>sg,Terminal:()=>LI,TestHelpers:()=>qI,Tokens:()=>cg,Topups:()=>lg,Transfers:()=>pg,Treasury:()=>jI,V2:()=>FI,WebhookEndpoints:()=>dg});function rI(e,t){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let n=r[0].toLowerCase()+r.substring(1),o=new t[r](e);this[n]=o}}a(rI,"ResourceNamespace");function oe(e,t){return function(r){return new rI(r,t)}}a(oe,"resourceNamespace");var Lt=c.method,Sf=c.extend({retrieve:Lt({method:"GET",fullPath:"/v1/financial_connections/accounts/{account}"}),list:Lt({method:"GET",fullPath:"/v1/financial_connections/accounts",methodType:"list"}),disconnect:Lt({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/disconnect"}),listOwners:Lt({method:"GET",fullPath:"/v1/financial_connections/accounts/{account}/owners",methodType:"list"}),refresh:Lt({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/refresh"}),subscribe:Lt({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/subscribe"}),unsubscribe:Lt({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/unsubscribe"})});var Tf=c.method,Ef=c.extend({retrieve:Tf({method:"GET",fullPath:"/v1/entitlements/active_entitlements/{id}"}),list:Tf({method:"GET",fullPath:"/v1/entitlements/active_entitlements",methodType:"list"})});var _r=c.method,If=c.extend({create:_r({method:"POST",fullPath:"/v1/billing/alerts"}),retrieve:_r({method:"GET",fullPath:"/v1/billing/alerts/{id}"}),list:_r({method:"GET",fullPath:"/v1/billing/alerts",methodType:"list"}),activate:_r({method:"POST",fullPath:"/v1/billing/alerts/{id}/activate"}),archive:_r({method:"POST",fullPath:"/v1/billing/alerts/{id}/archive"}),deactivate:_r({method:"POST",fullPath:"/v1/billing/alerts/{id}/deactivate"})});var qt=c.method,Af=c.extend({create:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations"}),capture:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/capture"}),expire:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/expire"}),finalizeAmount:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount"}),increment:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/increment"}),respond:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond"}),reverse:qt({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/reverse"})});var vn=c.method,wf=c.extend({retrieve:vn({method:"GET",fullPath:"/v1/issuing/authorizations/{authorization}"}),update:vn({method:"POST",fullPath:"/v1/issuing/authorizations/{authorization}"}),list:vn({method:"GET",fullPath:"/v1/issuing/authorizations",methodType:"list"}),approve:vn({method:"POST",fullPath:"/v1/issuing/authorizations/{authorization}/approve"}),decline:vn({method:"POST",fullPath:"/v1/issuing/authorizations/{authorization}/decline"})});var xs=c.method,kf=c.extend({create:xs({method:"POST",fullPath:"/v1/tax/calculations"}),retrieve:xs({method:"GET",fullPath:"/v1/tax/calculations/{calculation}"}),listLineItems:xs({method:"GET",fullPath:"/v1/tax/calculations/{calculation}/line_items",methodType:"list"})});var ti=c.method,Rf=c.extend({create:ti({method:"POST",fullPath:"/v1/issuing/cardholders"}),retrieve:ti({method:"GET",fullPath:"/v1/issuing/cardholders/{cardholder}"}),update:ti({method:"POST",fullPath:"/v1/issuing/cardholders/{cardholder}"}),list:ti({method:"GET",fullPath:"/v1/issuing/cardholders",methodType:"list"})});var _n=c.method,Of=c.extend({deliverCard:_n({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/deliver"}),failCard:_n({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/fail"}),returnCard:_n({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/return"}),shipCard:_n({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/ship"}),submitCard:_n({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/submit"})});var ri=c.method,Cf=c.extend({create:ri({method:"POST",fullPath:"/v1/issuing/cards"}),retrieve:ri({method:"GET",fullPath:"/v1/issuing/cards/{card}"}),update:ri({method:"POST",fullPath:"/v1/issuing/cards/{card}"}),list:ri({method:"GET",fullPath:"/v1/issuing/cards",methodType:"list"})});var ni=c.method,$f=c.extend({create:ni({method:"POST",fullPath:"/v1/billing_portal/configurations"}),retrieve:ni({method:"GET",fullPath:"/v1/billing_portal/configurations/{configuration}"}),update:ni({method:"POST",fullPath:"/v1/billing_portal/configurations/{configuration}"}),list:ni({method:"GET",fullPath:"/v1/billing_portal/configurations",methodType:"list"})});var bn=c.method,Nf=c.extend({create:bn({method:"POST",fullPath:"/v1/terminal/configurations"}),retrieve:bn({method:"GET",fullPath:"/v1/terminal/configurations/{configuration}"}),update:bn({method:"POST",fullPath:"/v1/terminal/configurations/{configuration}"}),list:bn({method:"GET",fullPath:"/v1/terminal/configurations",methodType:"list"}),del:bn({method:"DELETE",fullPath:"/v1/terminal/configurations/{configuration}"})});var nI=c.method,Df=c.extend({create:nI({method:"POST",fullPath:"/v1/test_helpers/confirmation_tokens"})});var oI=c.method,zf=c.extend({create:oI({method:"POST",fullPath:"/v1/terminal/connection_tokens"})});var iI=c.method,Mf=c.extend({retrieve:iI({method:"GET",fullPath:"/v1/billing/credit_balance_summary"})});var Uf=c.method,Lf=c.extend({retrieve:Uf({method:"GET",fullPath:"/v1/billing/credit_balance_transactions/{id}"}),list:Uf({method:"GET",fullPath:"/v1/billing/credit_balance_transactions",methodType:"list"})});var br=c.method,qf=c.extend({create:br({method:"POST",fullPath:"/v1/billing/credit_grants"}),retrieve:br({method:"GET",fullPath:"/v1/billing/credit_grants/{id}"}),update:br({method:"POST",fullPath:"/v1/billing/credit_grants/{id}"}),list:br({method:"GET",fullPath:"/v1/billing/credit_grants",methodType:"list"}),expire:br({method:"POST",fullPath:"/v1/billing/credit_grants/{id}/expire"}),voidGrant:br({method:"POST",fullPath:"/v1/billing/credit_grants/{id}/void"})});var Ss=c.method,jf=c.extend({create:Ss({method:"POST",fullPath:"/v1/treasury/credit_reversals"}),retrieve:Ss({method:"GET",fullPath:"/v1/treasury/credit_reversals/{credit_reversal}"}),list:Ss({method:"GET",fullPath:"/v1/treasury/credit_reversals",methodType:"list"})});var aI=c.method,Ff=c.extend({fundCashBalance:aI({method:"POST",fullPath:"/v1/test_helpers/customers/{customer}/fund_cash_balance"})});var Ts=c.method,Bf=c.extend({create:Ts({method:"POST",fullPath:"/v1/treasury/debit_reversals"}),retrieve:Ts({method:"GET",fullPath:"/v1/treasury/debit_reversals/{debit_reversal}"}),list:Ts({method:"GET",fullPath:"/v1/treasury/debit_reversals",methodType:"list"})});var Pn=c.method,Gf=c.extend({create:Pn({method:"POST",fullPath:"/v1/issuing/disputes"}),retrieve:Pn({method:"GET",fullPath:"/v1/issuing/disputes/{dispute}"}),update:Pn({method:"POST",fullPath:"/v1/issuing/disputes/{dispute}"}),list:Pn({method:"GET",fullPath:"/v1/issuing/disputes",methodType:"list"}),submit:Pn({method:"POST",fullPath:"/v1/issuing/disputes/{dispute}/submit"})});var Vf=c.method,Hf=c.extend({retrieve:Vf({method:"GET",fullPath:"/v1/radar/early_fraud_warnings/{early_fraud_warning}"}),list:Vf({method:"GET",fullPath:"/v1/radar/early_fraud_warnings",methodType:"list"})});var kt=c.method,Zf=c.extend({create:kt({method:"POST",fullPath:"/v2/core/event_destinations"}),retrieve:kt({method:"GET",fullPath:"/v2/core/event_destinations/{id}"}),update:kt({method:"POST",fullPath:"/v2/core/event_destinations/{id}"}),list:kt({method:"GET",fullPath:"/v2/core/event_destinations",methodType:"list"}),del:kt({method:"DELETE",fullPath:"/v2/core/event_destinations/{id}"}),disable:kt({method:"POST",fullPath:"/v2/core/event_destinations/{id}/disable"}),enable:kt({method:"POST",fullPath:"/v2/core/event_destinations/{id}/enable"}),ping:kt({method:"POST",fullPath:"/v2/core/event_destinations/{id}/ping"})});var Es=c.method,Wf=c.extend({retrieve(...e){return Es({method:"GET",fullPath:"/v2/core/events/{id}",transformResponseData:a(r=>this.addFetchRelatedObjectIfNeeded(r),"transformResponseData")}).apply(this,e)},list(...e){return Es({method:"GET",fullPath:"/v2/core/events",methodType:"list",transformResponseData:a(r=>Object.assign(Object.assign({},r),{data:r.data.map(this.addFetchRelatedObjectIfNeeded.bind(this))}),"transformResponseData")}).apply(this,e)},addFetchRelatedObjectIfNeeded(e){return!e.related_object||!e.related_object.url?e:Object.assign(Object.assign({},e),{fetchRelatedObject:a(()=>Es({method:"GET",fullPath:e.related_object.url}).apply(this,[{stripeAccount:e.context}]),"fetchRelatedObject")})}});var oi=c.method,Kf=c.extend({create:oi({method:"POST",fullPath:"/v1/entitlements/features"}),retrieve:oi({method:"GET",fullPath:"/v1/entitlements/features/{id}"}),update:oi({method:"POST",fullPath:"/v1/entitlements/features/{id}"}),list:oi({method:"GET",fullPath:"/v1/entitlements/features",methodType:"list"})});var jt=c.method,Jf=c.extend({create:jt({method:"POST",fullPath:"/v1/treasury/financial_accounts"}),retrieve:jt({method:"GET",fullPath:"/v1/treasury/financial_accounts/{financial_account}"}),update:jt({method:"POST",fullPath:"/v1/treasury/financial_accounts/{financial_account}"}),list:jt({method:"GET",fullPath:"/v1/treasury/financial_accounts",methodType:"list"}),close:jt({method:"POST",fullPath:"/v1/treasury/financial_accounts/{financial_account}/close"}),retrieveFeatures:jt({method:"GET",fullPath:"/v1/treasury/financial_accounts/{financial_account}/features"}),updateFeatures:jt({method:"POST",fullPath:"/v1/treasury/financial_accounts/{financial_account}/features"})});var Is=c.method,Xf=c.extend({fail:Is({method:"POST",fullPath:"/v1/test_helpers/treasury/inbound_transfers/{id}/fail"}),returnInboundTransfer:Is({method:"POST",fullPath:"/v1/test_helpers/treasury/inbound_transfers/{id}/return"}),succeed:Is({method:"POST",fullPath:"/v1/test_helpers/treasury/inbound_transfers/{id}/succeed"})});var ii=c.method,Yf=c.extend({create:ii({method:"POST",fullPath:"/v1/treasury/inbound_transfers"}),retrieve:ii({method:"GET",fullPath:"/v1/treasury/inbound_transfers/{id}"}),list:ii({method:"GET",fullPath:"/v1/treasury/inbound_transfers",methodType:"list"}),cancel:ii({method:"POST",fullPath:"/v1/treasury/inbound_transfers/{inbound_transfer}/cancel"})});var xn=c.method,Qf=c.extend({create:xn({method:"POST",fullPath:"/v1/terminal/locations"}),retrieve:xn({method:"GET",fullPath:"/v1/terminal/locations/{location}"}),update:xn({method:"POST",fullPath:"/v1/terminal/locations/{location}"}),list:xn({method:"GET",fullPath:"/v1/terminal/locations",methodType:"list"}),del:xn({method:"DELETE",fullPath:"/v1/terminal/locations/{location}"})});var sI=c.method,eh=c.extend({create:sI({method:"POST",fullPath:"/v1/billing/meter_event_adjustments"})});var uI=c.method,th=c.extend({create:uI({method:"POST",fullPath:"/v2/billing/meter_event_adjustments"})});var cI=c.method,rh=c.extend({create:cI({method:"POST",fullPath:"/v2/billing/meter_event_session"})});var lI=c.method,nh=c.extend({create:lI({method:"POST",fullPath:"/v2/billing/meter_event_stream",host:"meter-events.stripe.com"})});var pI=c.method,oh=c.extend({create:pI({method:"POST",fullPath:"/v1/billing/meter_events"})});var dI=c.method,ih=c.extend({create:dI({method:"POST",fullPath:"/v2/billing/meter_events"})});var Ft=c.method,ah=c.extend({create:Ft({method:"POST",fullPath:"/v1/billing/meters"}),retrieve:Ft({method:"GET",fullPath:"/v1/billing/meters/{id}"}),update:Ft({method:"POST",fullPath:"/v1/billing/meters/{id}"}),list:Ft({method:"GET",fullPath:"/v1/billing/meters",methodType:"list"}),deactivate:Ft({method:"POST",fullPath:"/v1/billing/meters/{id}/deactivate"}),listEventSummaries:Ft({method:"GET",fullPath:"/v1/billing/meters/{id}/event_summaries",methodType:"list"}),reactivate:Ft({method:"POST",fullPath:"/v1/billing/meters/{id}/reactivate"})});var Sn=c.method,sh=c.extend({create:Sn({method:"POST",fullPath:"/v1/climate/orders"}),retrieve:Sn({method:"GET",fullPath:"/v1/climate/orders/{order}"}),update:Sn({method:"POST",fullPath:"/v1/climate/orders/{order}"}),list:Sn({method:"GET",fullPath:"/v1/climate/orders",methodType:"list"}),cancel:Sn({method:"POST",fullPath:"/v1/climate/orders/{order}/cancel"})});var ai=c.method,uh=c.extend({update:ai({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}"}),fail:ai({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}/fail"}),post:ai({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}/post"}),returnOutboundPayment:ai({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}/return"})});var si=c.method,ch=c.extend({create:si({method:"POST",fullPath:"/v1/treasury/outbound_payments"}),retrieve:si({method:"GET",fullPath:"/v1/treasury/outbound_payments/{id}"}),list:si({method:"GET",fullPath:"/v1/treasury/outbound_payments",methodType:"list"}),cancel:si({method:"POST",fullPath:"/v1/treasury/outbound_payments/{id}/cancel"})});var ui=c.method,lh=c.extend({update:ui({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}"}),fail:ui({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail"}),post:ui({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post"}),returnOutboundTransfer:ui({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return"})});var ci=c.method,ph=c.extend({create:ci({method:"POST",fullPath:"/v1/treasury/outbound_transfers"}),retrieve:ci({method:"GET",fullPath:"/v1/treasury/outbound_transfers/{outbound_transfer}"}),list:ci({method:"GET",fullPath:"/v1/treasury/outbound_transfers",methodType:"list"}),cancel:ci({method:"POST",fullPath:"/v1/treasury/outbound_transfers/{outbound_transfer}/cancel"})});var As=c.method,dh=c.extend({activate:As({method:"POST",fullPath:"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate"}),deactivate:As({method:"POST",fullPath:"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate"}),reject:As({method:"POST",fullPath:"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject"})});var li=c.method,mh=c.extend({create:li({method:"POST",fullPath:"/v1/issuing/personalization_designs"}),retrieve:li({method:"GET",fullPath:"/v1/issuing/personalization_designs/{personalization_design}"}),update:li({method:"POST",fullPath:"/v1/issuing/personalization_designs/{personalization_design}"}),list:li({method:"GET",fullPath:"/v1/issuing/personalization_designs",methodType:"list"})});var fh=c.method,hh=c.extend({retrieve:fh({method:"GET",fullPath:"/v1/issuing/physical_bundles/{physical_bundle}"}),list:fh({method:"GET",fullPath:"/v1/issuing/physical_bundles",methodType:"list"})});var yh=c.method,gh=c.extend({retrieve:yh({method:"GET",fullPath:"/v1/climate/products/{product}"}),list:yh({method:"GET",fullPath:"/v1/climate/products",methodType:"list"})});var ws=c.method,vh=c.extend({presentPaymentMethod:ws({method:"POST",fullPath:"/v1/test_helpers/terminal/readers/{reader}/present_payment_method"}),succeedInputCollection:ws({method:"POST",fullPath:"/v1/test_helpers/terminal/readers/{reader}/succeed_input_collection"}),timeoutInputCollection:ws({method:"POST",fullPath:"/v1/test_helpers/terminal/readers/{reader}/timeout_input_collection"})});var Be=c.method,_h=c.extend({create:Be({method:"POST",fullPath:"/v1/terminal/readers"}),retrieve:Be({method:"GET",fullPath:"/v1/terminal/readers/{reader}"}),update:Be({method:"POST",fullPath:"/v1/terminal/readers/{reader}"}),list:Be({method:"GET",fullPath:"/v1/terminal/readers",methodType:"list"}),del:Be({method:"DELETE",fullPath:"/v1/terminal/readers/{reader}"}),cancelAction:Be({method:"POST",fullPath:"/v1/terminal/readers/{reader}/cancel_action"}),collectInputs:Be({method:"POST",fullPath:"/v1/terminal/readers/{reader}/collect_inputs"}),processPaymentIntent:Be({method:"POST",fullPath:"/v1/terminal/readers/{reader}/process_payment_intent"}),processSetupIntent:Be({method:"POST",fullPath:"/v1/terminal/readers/{reader}/process_setup_intent"}),refundPayment:Be({method:"POST",fullPath:"/v1/terminal/readers/{reader}/refund_payment"}),setReaderDisplay:Be({method:"POST",fullPath:"/v1/terminal/readers/{reader}/set_reader_display"})});var mI=c.method,bh=c.extend({create:mI({method:"POST",fullPath:"/v1/test_helpers/treasury/received_credits"})});var Ph=c.method,xh=c.extend({retrieve:Ph({method:"GET",fullPath:"/v1/treasury/received_credits/{id}"}),list:Ph({method:"GET",fullPath:"/v1/treasury/received_credits",methodType:"list"})});var fI=c.method,Sh=c.extend({create:fI({method:"POST",fullPath:"/v1/test_helpers/treasury/received_debits"})});var Th=c.method,Eh=c.extend({retrieve:Th({method:"GET",fullPath:"/v1/treasury/received_debits/{id}"}),list:Th({method:"GET",fullPath:"/v1/treasury/received_debits",methodType:"list"})});var hI=c.method,Ih=c.extend({expire:hI({method:"POST",fullPath:"/v1/test_helpers/refunds/{refund}/expire"})});var pi=c.method,Ah=c.extend({create:pi({method:"POST",fullPath:"/v1/tax/registrations"}),retrieve:pi({method:"GET",fullPath:"/v1/tax/registrations/{id}"}),update:pi({method:"POST",fullPath:"/v1/tax/registrations/{id}"}),list:pi({method:"GET",fullPath:"/v1/tax/registrations",methodType:"list"})});var ks=c.method,wh=c.extend({create:ks({method:"POST",fullPath:"/v1/reporting/report_runs"}),retrieve:ks({method:"GET",fullPath:"/v1/reporting/report_runs/{report_run}"}),list:ks({method:"GET",fullPath:"/v1/reporting/report_runs",methodType:"list"})});var kh=c.method,Rh=c.extend({retrieve:kh({method:"GET",fullPath:"/v1/reporting/report_types/{report_type}"}),list:kh({method:"GET",fullPath:"/v1/reporting/report_types",methodType:"list"})});var Rs=c.method,Oh=c.extend({create:Rs({method:"POST",fullPath:"/v1/forwarding/requests"}),retrieve:Rs({method:"GET",fullPath:"/v1/forwarding/requests/{id}"}),list:Rs({method:"GET",fullPath:"/v1/forwarding/requests",methodType:"list"})});var Ch=c.method,$h=c.extend({retrieve:Ch({method:"GET",fullPath:"/v1/sigma/scheduled_query_runs/{scheduled_query_run}"}),list:Ch({method:"GET",fullPath:"/v1/sigma/scheduled_query_runs",methodType:"list"})});var di=c.method,Nh=c.extend({create:di({method:"POST",fullPath:"/v1/apps/secrets"}),list:di({method:"GET",fullPath:"/v1/apps/secrets",methodType:"list"}),deleteWhere:di({method:"POST",fullPath:"/v1/apps/secrets/delete"}),find:di({method:"GET",fullPath:"/v1/apps/secrets/find"})});var yI=c.method,Dh=c.extend({create:yI({method:"POST",fullPath:"/v1/billing_portal/sessions"})});var Pr=c.method,zh=c.extend({create:Pr({method:"POST",fullPath:"/v1/checkout/sessions"}),retrieve:Pr({method:"GET",fullPath:"/v1/checkout/sessions/{session}"}),update:Pr({method:"POST",fullPath:"/v1/checkout/sessions/{session}"}),list:Pr({method:"GET",fullPath:"/v1/checkout/sessions",methodType:"list"}),expire:Pr({method:"POST",fullPath:"/v1/checkout/sessions/{session}/expire"}),listLineItems:Pr({method:"GET",fullPath:"/v1/checkout/sessions/{session}/line_items",methodType:"list"})});var Mh=c.method,Uh=c.extend({create:Mh({method:"POST",fullPath:"/v1/financial_connections/sessions"}),retrieve:Mh({method:"GET",fullPath:"/v1/financial_connections/sessions/{session}"})});var Lh=c.method,qh=c.extend({retrieve:Lh({method:"GET",fullPath:"/v1/tax/settings"}),update:Lh({method:"POST",fullPath:"/v1/tax/settings"})});var jh=c.method,Fh=c.extend({retrieve:jh({method:"GET",fullPath:"/v1/climate/suppliers/{supplier}"}),list:jh({method:"GET",fullPath:"/v1/climate/suppliers",methodType:"list"})});var Tn=c.method,Bh=c.extend({create:Tn({method:"POST",fullPath:"/v1/test_helpers/test_clocks"}),retrieve:Tn({method:"GET",fullPath:"/v1/test_helpers/test_clocks/{test_clock}"}),list:Tn({method:"GET",fullPath:"/v1/test_helpers/test_clocks",methodType:"list"}),del:Tn({method:"DELETE",fullPath:"/v1/test_helpers/test_clocks/{test_clock}"}),advance:Tn({method:"POST",fullPath:"/v1/test_helpers/test_clocks/{test_clock}/advance"})});var Os=c.method,Gh=c.extend({retrieve:Os({method:"GET",fullPath:"/v1/issuing/tokens/{token}"}),update:Os({method:"POST",fullPath:"/v1/issuing/tokens/{token}"}),list:Os({method:"GET",fullPath:"/v1/issuing/tokens",methodType:"list"})});var Vh=c.method,Hh=c.extend({retrieve:Vh({method:"GET",fullPath:"/v1/treasury/transaction_entries/{id}"}),list:Vh({method:"GET",fullPath:"/v1/treasury/transaction_entries",methodType:"list"})});var Cs=c.method,Zh=c.extend({createForceCapture:Cs({method:"POST",fullPath:"/v1/test_helpers/issuing/transactions/create_force_capture"}),createUnlinkedRefund:Cs({method:"POST",fullPath:"/v1/test_helpers/issuing/transactions/create_unlinked_refund"}),refund:Cs({method:"POST",fullPath:"/v1/test_helpers/issuing/transactions/{transaction}/refund"})});var Wh=c.method,Kh=c.extend({retrieve:Wh({method:"GET",fullPath:"/v1/financial_connections/transactions/{transaction}"}),list:Wh({method:"GET",fullPath:"/v1/financial_connections/transactions",methodType:"list"})});var $s=c.method,Jh=c.extend({retrieve:$s({method:"GET",fullPath:"/v1/issuing/transactions/{transaction}"}),update:$s({method:"POST",fullPath:"/v1/issuing/transactions/{transaction}"}),list:$s({method:"GET",fullPath:"/v1/issuing/transactions",methodType:"list"})});var mi=c.method,Xh=c.extend({retrieve:mi({method:"GET",fullPath:"/v1/tax/transactions/{transaction}"}),createFromCalculation:mi({method:"POST",fullPath:"/v1/tax/transactions/create_from_calculation"}),createReversal:mi({method:"POST",fullPath:"/v1/tax/transactions/create_reversal"}),listLineItems:mi({method:"GET",fullPath:"/v1/tax/transactions/{transaction}/line_items",methodType:"list"})});var Yh=c.method,Qh=c.extend({retrieve:Yh({method:"GET",fullPath:"/v1/treasury/transactions/{id}"}),list:Yh({method:"GET",fullPath:"/v1/treasury/transactions",methodType:"list"})});var fi=c.method,ey=c.extend({create:fi({method:"POST",fullPath:"/v1/radar/value_list_items"}),retrieve:fi({method:"GET",fullPath:"/v1/radar/value_list_items/{item}"}),list:fi({method:"GET",fullPath:"/v1/radar/value_list_items",methodType:"list"}),del:fi({method:"DELETE",fullPath:"/v1/radar/value_list_items/{item}"})});var En=c.method,ty=c.extend({create:En({method:"POST",fullPath:"/v1/radar/value_lists"}),retrieve:En({method:"GET",fullPath:"/v1/radar/value_lists/{value_list}"}),update:En({method:"POST",fullPath:"/v1/radar/value_lists/{value_list}"}),list:En({method:"GET",fullPath:"/v1/radar/value_lists",methodType:"list"}),del:En({method:"DELETE",fullPath:"/v1/radar/value_lists/{value_list}"})});var ry=c.method,ny=c.extend({retrieve:ry({method:"GET",fullPath:"/v1/identity/verification_reports/{report}"}),list:ry({method:"GET",fullPath:"/v1/identity/verification_reports",methodType:"list"})});var xr=c.method,oy=c.extend({create:xr({method:"POST",fullPath:"/v1/identity/verification_sessions"}),retrieve:xr({method:"GET",fullPath:"/v1/identity/verification_sessions/{session}"}),update:xr({method:"POST",fullPath:"/v1/identity/verification_sessions/{session}"}),list:xr({method:"GET",fullPath:"/v1/identity/verification_sessions",methodType:"list"}),cancel:xr({method:"POST",fullPath:"/v1/identity/verification_sessions/{session}/cancel"}),redact:xr({method:"POST",fullPath:"/v1/identity/verification_sessions/{session}/redact"})});var de=c.method,Ns=c.extend({create:de({method:"POST",fullPath:"/v1/accounts"}),retrieve(e,...t){return typeof e=="string"?de({method:"GET",fullPath:"/v1/accounts/{id}"}).apply(this,[e,...t]):(e==null&&[].shift.apply([e,...t]),de({method:"GET",fullPath:"/v1/account"}).apply(this,[e,...t]))},update:de({method:"POST",fullPath:"/v1/accounts/{account}"}),list:de({method:"GET",fullPath:"/v1/accounts",methodType:"list"}),del:de({method:"DELETE",fullPath:"/v1/accounts/{account}"}),createExternalAccount:de({method:"POST",fullPath:"/v1/accounts/{account}/external_accounts"}),createLoginLink:de({method:"POST",fullPath:"/v1/accounts/{account}/login_links"}),createPerson:de({method:"POST",fullPath:"/v1/accounts/{account}/persons"}),deleteExternalAccount:de({method:"DELETE",fullPath:"/v1/accounts/{account}/external_accounts/{id}"}),deletePerson:de({method:"DELETE",fullPath:"/v1/accounts/{account}/persons/{person}"}),listCapabilities:de({method:"GET",fullPath:"/v1/accounts/{account}/capabilities",methodType:"list"}),listExternalAccounts:de({method:"GET",fullPath:"/v1/accounts/{account}/external_accounts",methodType:"list"}),listPersons:de({method:"GET",fullPath:"/v1/accounts/{account}/persons",methodType:"list"}),reject:de({method:"POST",fullPath:"/v1/accounts/{account}/reject"}),retrieveCurrent:de({method:"GET",fullPath:"/v1/account"}),retrieveCapability:de({method:"GET",fullPath:"/v1/accounts/{account}/capabilities/{capability}"}),retrieveExternalAccount:de({method:"GET",fullPath:"/v1/accounts/{account}/external_accounts/{id}"}),retrievePerson:de({method:"GET",fullPath:"/v1/accounts/{account}/persons/{person}"}),updateCapability:de({method:"POST",fullPath:"/v1/accounts/{account}/capabilities/{capability}"}),updateExternalAccount:de({method:"POST",fullPath:"/v1/accounts/{account}/external_accounts/{id}"}),updatePerson:de({method:"POST",fullPath:"/v1/accounts/{account}/persons/{person}"})});var gI=c.method,iy=c.extend({create:gI({method:"POST",fullPath:"/v1/account_links"})});var vI=c.method,ay=c.extend({create:vI({method:"POST",fullPath:"/v1/account_sessions"})});var hi=c.method,sy=c.extend({create:hi({method:"POST",fullPath:"/v1/apple_pay/domains"}),retrieve:hi({method:"GET",fullPath:"/v1/apple_pay/domains/{domain}"}),list:hi({method:"GET",fullPath:"/v1/apple_pay/domains",methodType:"list"}),del:hi({method:"DELETE",fullPath:"/v1/apple_pay/domains/{domain}"})});var Sr=c.method,uy=c.extend({retrieve:Sr({method:"GET",fullPath:"/v1/application_fees/{id}"}),list:Sr({method:"GET",fullPath:"/v1/application_fees",methodType:"list"}),createRefund:Sr({method:"POST",fullPath:"/v1/application_fees/{id}/refunds"}),listRefunds:Sr({method:"GET",fullPath:"/v1/application_fees/{id}/refunds",methodType:"list"}),retrieveRefund:Sr({method:"GET",fullPath:"/v1/application_fees/{fee}/refunds/{id}"}),updateRefund:Sr({method:"POST",fullPath:"/v1/application_fees/{fee}/refunds/{id}"})});var _I=c.method,cy=c.extend({retrieve:_I({method:"GET",fullPath:"/v1/balance"})});var ly=c.method,py=c.extend({retrieve:ly({method:"GET",fullPath:"/v1/balance_transactions/{id}"}),list:ly({method:"GET",fullPath:"/v1/balance_transactions",methodType:"list"})});var Tr=c.method,dy=c.extend({create:Tr({method:"POST",fullPath:"/v1/charges"}),retrieve:Tr({method:"GET",fullPath:"/v1/charges/{charge}"}),update:Tr({method:"POST",fullPath:"/v1/charges/{charge}"}),list:Tr({method:"GET",fullPath:"/v1/charges",methodType:"list"}),capture:Tr({method:"POST",fullPath:"/v1/charges/{charge}/capture"}),search:Tr({method:"GET",fullPath:"/v1/charges/search",methodType:"search"})});var bI=c.method,my=c.extend({retrieve:bI({method:"GET",fullPath:"/v1/confirmation_tokens/{confirmation_token}"})});var fy=c.method,hy=c.extend({retrieve:fy({method:"GET",fullPath:"/v1/country_specs/{country}"}),list:fy({method:"GET",fullPath:"/v1/country_specs",methodType:"list"})});var In=c.method,yy=c.extend({create:In({method:"POST",fullPath:"/v1/coupons"}),retrieve:In({method:"GET",fullPath:"/v1/coupons/{coupon}"}),update:In({method:"POST",fullPath:"/v1/coupons/{coupon}"}),list:In({method:"GET",fullPath:"/v1/coupons",methodType:"list"}),del:In({method:"DELETE",fullPath:"/v1/coupons/{coupon}"})});var Rt=c.method,gy=c.extend({create:Rt({method:"POST",fullPath:"/v1/credit_notes"}),retrieve:Rt({method:"GET",fullPath:"/v1/credit_notes/{id}"}),update:Rt({method:"POST",fullPath:"/v1/credit_notes/{id}"}),list:Rt({method:"GET",fullPath:"/v1/credit_notes",methodType:"list"}),listLineItems:Rt({method:"GET",fullPath:"/v1/credit_notes/{credit_note}/lines",methodType:"list"}),listPreviewLineItems:Rt({method:"GET",fullPath:"/v1/credit_notes/preview/lines",methodType:"list"}),preview:Rt({method:"GET",fullPath:"/v1/credit_notes/preview"}),voidCreditNote:Rt({method:"POST",fullPath:"/v1/credit_notes/{id}/void"})});var PI=c.method,vy=c.extend({create:PI({method:"POST",fullPath:"/v1/customer_sessions"})});var Q=c.method,_y=c.extend({create:Q({method:"POST",fullPath:"/v1/customers"}),retrieve:Q({method:"GET",fullPath:"/v1/customers/{customer}"}),update:Q({method:"POST",fullPath:"/v1/customers/{customer}"}),list:Q({method:"GET",fullPath:"/v1/customers",methodType:"list"}),del:Q({method:"DELETE",fullPath:"/v1/customers/{customer}"}),createBalanceTransaction:Q({method:"POST",fullPath:"/v1/customers/{customer}/balance_transactions"}),createFundingInstructions:Q({method:"POST",fullPath:"/v1/customers/{customer}/funding_instructions"}),createSource:Q({method:"POST",fullPath:"/v1/customers/{customer}/sources"}),createTaxId:Q({method:"POST",fullPath:"/v1/customers/{customer}/tax_ids"}),deleteDiscount:Q({method:"DELETE",fullPath:"/v1/customers/{customer}/discount"}),deleteSource:Q({method:"DELETE",fullPath:"/v1/customers/{customer}/sources/{id}"}),deleteTaxId:Q({method:"DELETE",fullPath:"/v1/customers/{customer}/tax_ids/{id}"}),listBalanceTransactions:Q({method:"GET",fullPath:"/v1/customers/{customer}/balance_transactions",methodType:"list"}),listCashBalanceTransactions:Q({method:"GET",fullPath:"/v1/customers/{customer}/cash_balance_transactions",methodType:"list"}),listPaymentMethods:Q({method:"GET",fullPath:"/v1/customers/{customer}/payment_methods",methodType:"list"}),listSources:Q({method:"GET",fullPath:"/v1/customers/{customer}/sources",methodType:"list"}),listTaxIds:Q({method:"GET",fullPath:"/v1/customers/{customer}/tax_ids",methodType:"list"}),retrieveBalanceTransaction:Q({method:"GET",fullPath:"/v1/customers/{customer}/balance_transactions/{transaction}"}),retrieveCashBalance:Q({method:"GET",fullPath:"/v1/customers/{customer}/cash_balance"}),retrieveCashBalanceTransaction:Q({method:"GET",fullPath:"/v1/customers/{customer}/cash_balance_transactions/{transaction}"}),retrievePaymentMethod:Q({method:"GET",fullPath:"/v1/customers/{customer}/payment_methods/{payment_method}"}),retrieveSource:Q({method:"GET",fullPath:"/v1/customers/{customer}/sources/{id}"}),retrieveTaxId:Q({method:"GET",fullPath:"/v1/customers/{customer}/tax_ids/{id}"}),search:Q({method:"GET",fullPath:"/v1/customers/search",methodType:"search"}),updateBalanceTransaction:Q({method:"POST",fullPath:"/v1/customers/{customer}/balance_transactions/{transaction}"}),updateCashBalance:Q({method:"POST",fullPath:"/v1/customers/{customer}/cash_balance"}),updateSource:Q({method:"POST",fullPath:"/v1/customers/{customer}/sources/{id}"}),verifySource:Q({method:"POST",fullPath:"/v1/customers/{customer}/sources/{id}/verify"})});var yi=c.method,by=c.extend({retrieve:yi({method:"GET",fullPath:"/v1/disputes/{dispute}"}),update:yi({method:"POST",fullPath:"/v1/disputes/{dispute}"}),list:yi({method:"GET",fullPath:"/v1/disputes",methodType:"list"}),close:yi({method:"POST",fullPath:"/v1/disputes/{dispute}/close"})});var Py=c.method,xy=c.extend({create:Py({method:"POST",fullPath:"/v1/ephemeral_keys",validator:a((e,t)=>{if(!t.headers||!t.headers["Stripe-Version"])throw new Error("Passing apiVersion in a separate options hash is required to create an ephemeral key. See https://stripe.com/docs/api/versioning?lang=node")},"validator")}),del:Py({method:"DELETE",fullPath:"/v1/ephemeral_keys/{key}"})});var Sy=c.method,Ty=c.extend({retrieve:Sy({method:"GET",fullPath:"/v1/events/{id}"}),list:Sy({method:"GET",fullPath:"/v1/events",methodType:"list"})});var Ey=c.method,Iy=c.extend({retrieve:Ey({method:"GET",fullPath:"/v1/exchange_rates/{rate_id}"}),list:Ey({method:"GET",fullPath:"/v1/exchange_rates",methodType:"list"})});var gi=c.method,Ay=c.extend({create:gi({method:"POST",fullPath:"/v1/file_links"}),retrieve:gi({method:"GET",fullPath:"/v1/file_links/{link}"}),update:gi({method:"POST",fullPath:"/v1/file_links/{link}"}),list:gi({method:"GET",fullPath:"/v1/file_links",methodType:"list"})});var xI=a((e,t,r)=>{let n=(Math.round(Math.random()*1e16)+Math.round(Math.random()*1e16)).toString();r["Content-Type"]=`multipart/form-data; boundary=${n}`;let o=new TextEncoder,i=new Uint8Array(0),s=o.encode(`\r
16
+ `);function l(m){let P=i,h=m instanceof Uint8Array?m:new Uint8Array(o.encode(m));i=new Uint8Array(P.length+h.length+2),i.set(P),i.set(h,P.length),i.set(s,i.length-2)}a(l,"push");function f(m){return`"${m.replace(/"|"/g,"%22").replace(/\r\n|\r|\n/g," ")}"`}a(f,"q");let b=pf(t);for(let m in b){if(!Object.prototype.hasOwnProperty.call(b,m))continue;let P=b[m];if(l(`--${n}`),Object.prototype.hasOwnProperty.call(P,"data")){let h=P;l(`Content-Disposition: form-data; name=${f(m)}; filename=${f(h.name||"blob")}`),l(`Content-Type: ${h.type||"application/octet-stream"}`),l(""),l(h.data)}else l(`Content-Disposition: form-data; name=${f(m)}`),l(""),l(P)}return l(`--${n}--`),i},"multipartDataGenerator");function wy(e,t,r,n){if(t=t||{},e!=="POST")return n(null,wt(t));this._stripe._platformFunctions.tryBufferData(t).then(o=>{let i=xI(e,o,r);return n(null,i)}).catch(o=>n(o,null))}a(wy,"multipartRequestDataProcessor");var Ds=c.method,ky=c.extend({create:Ds({method:"POST",fullPath:"/v1/files",headers:{"Content-Type":"multipart/form-data"},host:"files.stripe.com"}),retrieve:Ds({method:"GET",fullPath:"/v1/files/{file}"}),list:Ds({method:"GET",fullPath:"/v1/files",methodType:"list"}),requestDataProcessor:wy});var An=c.method,Ry=c.extend({create:An({method:"POST",fullPath:"/v1/invoiceitems"}),retrieve:An({method:"GET",fullPath:"/v1/invoiceitems/{invoiceitem}"}),update:An({method:"POST",fullPath:"/v1/invoiceitems/{invoiceitem}"}),list:An({method:"GET",fullPath:"/v1/invoiceitems",methodType:"list"}),del:An({method:"DELETE",fullPath:"/v1/invoiceitems/{invoiceitem}"})});var Oy=c.method,Cy=c.extend({retrieve:Oy({method:"GET",fullPath:"/v1/invoice_payments/{invoice_payment}"}),list:Oy({method:"GET",fullPath:"/v1/invoice_payments",methodType:"list"})});var vi=c.method,$y=c.extend({retrieve:vi({method:"GET",fullPath:"/v1/invoice_rendering_templates/{template}"}),list:vi({method:"GET",fullPath:"/v1/invoice_rendering_templates",methodType:"list"}),archive:vi({method:"POST",fullPath:"/v1/invoice_rendering_templates/{template}/archive"}),unarchive:vi({method:"POST",fullPath:"/v1/invoice_rendering_templates/{template}/unarchive"})});var Se=c.method,Ny=c.extend({create:Se({method:"POST",fullPath:"/v1/invoices"}),retrieve:Se({method:"GET",fullPath:"/v1/invoices/{invoice}"}),update:Se({method:"POST",fullPath:"/v1/invoices/{invoice}"}),list:Se({method:"GET",fullPath:"/v1/invoices",methodType:"list"}),del:Se({method:"DELETE",fullPath:"/v1/invoices/{invoice}"}),addLines:Se({method:"POST",fullPath:"/v1/invoices/{invoice}/add_lines"}),attachPayment:Se({method:"POST",fullPath:"/v1/invoices/{invoice}/attach_payment"}),createPreview:Se({method:"POST",fullPath:"/v1/invoices/create_preview"}),finalizeInvoice:Se({method:"POST",fullPath:"/v1/invoices/{invoice}/finalize"}),listLineItems:Se({method:"GET",fullPath:"/v1/invoices/{invoice}/lines",methodType:"list"}),markUncollectible:Se({method:"POST",fullPath:"/v1/invoices/{invoice}/mark_uncollectible"}),pay:Se({method:"POST",fullPath:"/v1/invoices/{invoice}/pay"}),removeLines:Se({method:"POST",fullPath:"/v1/invoices/{invoice}/remove_lines"}),search:Se({method:"GET",fullPath:"/v1/invoices/search",methodType:"search"}),sendInvoice:Se({method:"POST",fullPath:"/v1/invoices/{invoice}/send"}),updateLines:Se({method:"POST",fullPath:"/v1/invoices/{invoice}/update_lines"}),updateLineItem:Se({method:"POST",fullPath:"/v1/invoices/{invoice}/lines/{line_item_id}"}),voidInvoice:Se({method:"POST",fullPath:"/v1/invoices/{invoice}/void"})});var SI=c.method,Dy=c.extend({retrieve:SI({method:"GET",fullPath:"/v1/mandates/{mandate}"})});var zy=c.method,zs="connect.stripe.com",My=c.extend({basePath:"/",authorizeUrl(e,t){e=e||{},t=t||{};let r="oauth/authorize";return t.express&&(r=`express/${r}`),e.response_type||(e.response_type="code"),e.client_id||(e.client_id=this._stripe.getClientId()),e.scope||(e.scope="read_write"),`https://${zs}/${r}?${wt(e)}`},token:zy({method:"POST",path:"oauth/token",host:zs}),deauthorize(e,...t){return e.client_id||(e.client_id=this._stripe.getClientId()),zy({method:"POST",path:"oauth/deauthorize",host:zs}).apply(this,[e,...t])}});var Ge=c.method,Uy=c.extend({create:Ge({method:"POST",fullPath:"/v1/payment_intents"}),retrieve:Ge({method:"GET",fullPath:"/v1/payment_intents/{intent}"}),update:Ge({method:"POST",fullPath:"/v1/payment_intents/{intent}"}),list:Ge({method:"GET",fullPath:"/v1/payment_intents",methodType:"list"}),applyCustomerBalance:Ge({method:"POST",fullPath:"/v1/payment_intents/{intent}/apply_customer_balance"}),cancel:Ge({method:"POST",fullPath:"/v1/payment_intents/{intent}/cancel"}),capture:Ge({method:"POST",fullPath:"/v1/payment_intents/{intent}/capture"}),confirm:Ge({method:"POST",fullPath:"/v1/payment_intents/{intent}/confirm"}),incrementAuthorization:Ge({method:"POST",fullPath:"/v1/payment_intents/{intent}/increment_authorization"}),search:Ge({method:"GET",fullPath:"/v1/payment_intents/search",methodType:"search"}),verifyMicrodeposits:Ge({method:"POST",fullPath:"/v1/payment_intents/{intent}/verify_microdeposits"})});var wn=c.method,Ly=c.extend({create:wn({method:"POST",fullPath:"/v1/payment_links"}),retrieve:wn({method:"GET",fullPath:"/v1/payment_links/{payment_link}"}),update:wn({method:"POST",fullPath:"/v1/payment_links/{payment_link}"}),list:wn({method:"GET",fullPath:"/v1/payment_links",methodType:"list"}),listLineItems:wn({method:"GET",fullPath:"/v1/payment_links/{payment_link}/line_items",methodType:"list"})});var _i=c.method,qy=c.extend({create:_i({method:"POST",fullPath:"/v1/payment_method_configurations"}),retrieve:_i({method:"GET",fullPath:"/v1/payment_method_configurations/{configuration}"}),update:_i({method:"POST",fullPath:"/v1/payment_method_configurations/{configuration}"}),list:_i({method:"GET",fullPath:"/v1/payment_method_configurations",methodType:"list"})});var kn=c.method,jy=c.extend({create:kn({method:"POST",fullPath:"/v1/payment_method_domains"}),retrieve:kn({method:"GET",fullPath:"/v1/payment_method_domains/{payment_method_domain}"}),update:kn({method:"POST",fullPath:"/v1/payment_method_domains/{payment_method_domain}"}),list:kn({method:"GET",fullPath:"/v1/payment_method_domains",methodType:"list"}),validate:kn({method:"POST",fullPath:"/v1/payment_method_domains/{payment_method_domain}/validate"})});var Er=c.method,Fy=c.extend({create:Er({method:"POST",fullPath:"/v1/payment_methods"}),retrieve:Er({method:"GET",fullPath:"/v1/payment_methods/{payment_method}"}),update:Er({method:"POST",fullPath:"/v1/payment_methods/{payment_method}"}),list:Er({method:"GET",fullPath:"/v1/payment_methods",methodType:"list"}),attach:Er({method:"POST",fullPath:"/v1/payment_methods/{payment_method}/attach"}),detach:Er({method:"POST",fullPath:"/v1/payment_methods/{payment_method}/detach"})});var Ir=c.method,By=c.extend({create:Ir({method:"POST",fullPath:"/v1/payouts"}),retrieve:Ir({method:"GET",fullPath:"/v1/payouts/{payout}"}),update:Ir({method:"POST",fullPath:"/v1/payouts/{payout}"}),list:Ir({method:"GET",fullPath:"/v1/payouts",methodType:"list"}),cancel:Ir({method:"POST",fullPath:"/v1/payouts/{payout}/cancel"}),reverse:Ir({method:"POST",fullPath:"/v1/payouts/{payout}/reverse"})});var Rn=c.method,Gy=c.extend({create:Rn({method:"POST",fullPath:"/v1/plans"}),retrieve:Rn({method:"GET",fullPath:"/v1/plans/{plan}"}),update:Rn({method:"POST",fullPath:"/v1/plans/{plan}"}),list:Rn({method:"GET",fullPath:"/v1/plans",methodType:"list"}),del:Rn({method:"DELETE",fullPath:"/v1/plans/{plan}"})});var On=c.method,Vy=c.extend({create:On({method:"POST",fullPath:"/v1/prices"}),retrieve:On({method:"GET",fullPath:"/v1/prices/{price}"}),update:On({method:"POST",fullPath:"/v1/prices/{price}"}),list:On({method:"GET",fullPath:"/v1/prices",methodType:"list"}),search:On({method:"GET",fullPath:"/v1/prices/search",methodType:"search"})});var Ye=c.method,Hy=c.extend({create:Ye({method:"POST",fullPath:"/v1/products"}),retrieve:Ye({method:"GET",fullPath:"/v1/products/{id}"}),update:Ye({method:"POST",fullPath:"/v1/products/{id}"}),list:Ye({method:"GET",fullPath:"/v1/products",methodType:"list"}),del:Ye({method:"DELETE",fullPath:"/v1/products/{id}"}),createFeature:Ye({method:"POST",fullPath:"/v1/products/{product}/features"}),deleteFeature:Ye({method:"DELETE",fullPath:"/v1/products/{product}/features/{id}"}),listFeatures:Ye({method:"GET",fullPath:"/v1/products/{product}/features",methodType:"list"}),retrieveFeature:Ye({method:"GET",fullPath:"/v1/products/{product}/features/{id}"}),search:Ye({method:"GET",fullPath:"/v1/products/search",methodType:"search"})});var bi=c.method,Zy=c.extend({create:bi({method:"POST",fullPath:"/v1/promotion_codes"}),retrieve:bi({method:"GET",fullPath:"/v1/promotion_codes/{promotion_code}"}),update:bi({method:"POST",fullPath:"/v1/promotion_codes/{promotion_code}"}),list:bi({method:"GET",fullPath:"/v1/promotion_codes",methodType:"list"})});var Qe=c.method,Wy=c.extend({create:Qe({method:"POST",fullPath:"/v1/quotes"}),retrieve:Qe({method:"GET",fullPath:"/v1/quotes/{quote}"}),update:Qe({method:"POST",fullPath:"/v1/quotes/{quote}"}),list:Qe({method:"GET",fullPath:"/v1/quotes",methodType:"list"}),accept:Qe({method:"POST",fullPath:"/v1/quotes/{quote}/accept"}),cancel:Qe({method:"POST",fullPath:"/v1/quotes/{quote}/cancel"}),finalizeQuote:Qe({method:"POST",fullPath:"/v1/quotes/{quote}/finalize"}),listComputedUpfrontLineItems:Qe({method:"GET",fullPath:"/v1/quotes/{quote}/computed_upfront_line_items",methodType:"list"}),listLineItems:Qe({method:"GET",fullPath:"/v1/quotes/{quote}/line_items",methodType:"list"}),pdf:Qe({method:"GET",fullPath:"/v1/quotes/{quote}/pdf",host:"files.stripe.com",streaming:!0})});var Cn=c.method,Ky=c.extend({create:Cn({method:"POST",fullPath:"/v1/refunds"}),retrieve:Cn({method:"GET",fullPath:"/v1/refunds/{refund}"}),update:Cn({method:"POST",fullPath:"/v1/refunds/{refund}"}),list:Cn({method:"GET",fullPath:"/v1/refunds",methodType:"list"}),cancel:Cn({method:"POST",fullPath:"/v1/refunds/{refund}/cancel"})});var Ms=c.method,Jy=c.extend({retrieve:Ms({method:"GET",fullPath:"/v1/reviews/{review}"}),list:Ms({method:"GET",fullPath:"/v1/reviews",methodType:"list"}),approve:Ms({method:"POST",fullPath:"/v1/reviews/{review}/approve"})});var TI=c.method,Xy=c.extend({list:TI({method:"GET",fullPath:"/v1/setup_attempts",methodType:"list"})});var Bt=c.method,Yy=c.extend({create:Bt({method:"POST",fullPath:"/v1/setup_intents"}),retrieve:Bt({method:"GET",fullPath:"/v1/setup_intents/{intent}"}),update:Bt({method:"POST",fullPath:"/v1/setup_intents/{intent}"}),list:Bt({method:"GET",fullPath:"/v1/setup_intents",methodType:"list"}),cancel:Bt({method:"POST",fullPath:"/v1/setup_intents/{intent}/cancel"}),confirm:Bt({method:"POST",fullPath:"/v1/setup_intents/{intent}/confirm"}),verifyMicrodeposits:Bt({method:"POST",fullPath:"/v1/setup_intents/{intent}/verify_microdeposits"})});var Pi=c.method,Qy=c.extend({create:Pi({method:"POST",fullPath:"/v1/shipping_rates"}),retrieve:Pi({method:"GET",fullPath:"/v1/shipping_rates/{shipping_rate_token}"}),update:Pi({method:"POST",fullPath:"/v1/shipping_rates/{shipping_rate_token}"}),list:Pi({method:"GET",fullPath:"/v1/shipping_rates",methodType:"list"})});var $n=c.method,eg=c.extend({create:$n({method:"POST",fullPath:"/v1/sources"}),retrieve:$n({method:"GET",fullPath:"/v1/sources/{source}"}),update:$n({method:"POST",fullPath:"/v1/sources/{source}"}),listSourceTransactions:$n({method:"GET",fullPath:"/v1/sources/{source}/source_transactions",methodType:"list"}),verify:$n({method:"POST",fullPath:"/v1/sources/{source}/verify"})});var Nn=c.method,tg=c.extend({create:Nn({method:"POST",fullPath:"/v1/subscription_items"}),retrieve:Nn({method:"GET",fullPath:"/v1/subscription_items/{item}"}),update:Nn({method:"POST",fullPath:"/v1/subscription_items/{item}"}),list:Nn({method:"GET",fullPath:"/v1/subscription_items",methodType:"list"}),del:Nn({method:"DELETE",fullPath:"/v1/subscription_items/{item}"})});var Ar=c.method,rg=c.extend({create:Ar({method:"POST",fullPath:"/v1/subscription_schedules"}),retrieve:Ar({method:"GET",fullPath:"/v1/subscription_schedules/{schedule}"}),update:Ar({method:"POST",fullPath:"/v1/subscription_schedules/{schedule}"}),list:Ar({method:"GET",fullPath:"/v1/subscription_schedules",methodType:"list"}),cancel:Ar({method:"POST",fullPath:"/v1/subscription_schedules/{schedule}/cancel"}),release:Ar({method:"POST",fullPath:"/v1/subscription_schedules/{schedule}/release"})});var Ot=c.method,ng=c.extend({create:Ot({method:"POST",fullPath:"/v1/subscriptions"}),retrieve:Ot({method:"GET",fullPath:"/v1/subscriptions/{subscription_exposed_id}"}),update:Ot({method:"POST",fullPath:"/v1/subscriptions/{subscription_exposed_id}"}),list:Ot({method:"GET",fullPath:"/v1/subscriptions",methodType:"list"}),cancel:Ot({method:"DELETE",fullPath:"/v1/subscriptions/{subscription_exposed_id}"}),deleteDiscount:Ot({method:"DELETE",fullPath:"/v1/subscriptions/{subscription_exposed_id}/discount"}),resume:Ot({method:"POST",fullPath:"/v1/subscriptions/{subscription}/resume"}),search:Ot({method:"GET",fullPath:"/v1/subscriptions/search",methodType:"search"})});var og=c.method,ig=c.extend({retrieve:og({method:"GET",fullPath:"/v1/tax_codes/{id}"}),list:og({method:"GET",fullPath:"/v1/tax_codes",methodType:"list"})});var xi=c.method,ag=c.extend({create:xi({method:"POST",fullPath:"/v1/tax_ids"}),retrieve:xi({method:"GET",fullPath:"/v1/tax_ids/{id}"}),list:xi({method:"GET",fullPath:"/v1/tax_ids",methodType:"list"}),del:xi({method:"DELETE",fullPath:"/v1/tax_ids/{id}"})});var Si=c.method,sg=c.extend({create:Si({method:"POST",fullPath:"/v1/tax_rates"}),retrieve:Si({method:"GET",fullPath:"/v1/tax_rates/{tax_rate}"}),update:Si({method:"POST",fullPath:"/v1/tax_rates/{tax_rate}"}),list:Si({method:"GET",fullPath:"/v1/tax_rates",methodType:"list"})});var ug=c.method,cg=c.extend({create:ug({method:"POST",fullPath:"/v1/tokens"}),retrieve:ug({method:"GET",fullPath:"/v1/tokens/{token}"})});var Dn=c.method,lg=c.extend({create:Dn({method:"POST",fullPath:"/v1/topups"}),retrieve:Dn({method:"GET",fullPath:"/v1/topups/{topup}"}),update:Dn({method:"POST",fullPath:"/v1/topups/{topup}"}),list:Dn({method:"GET",fullPath:"/v1/topups",methodType:"list"}),cancel:Dn({method:"POST",fullPath:"/v1/topups/{topup}/cancel"})});var Ct=c.method,pg=c.extend({create:Ct({method:"POST",fullPath:"/v1/transfers"}),retrieve:Ct({method:"GET",fullPath:"/v1/transfers/{transfer}"}),update:Ct({method:"POST",fullPath:"/v1/transfers/{transfer}"}),list:Ct({method:"GET",fullPath:"/v1/transfers",methodType:"list"}),createReversal:Ct({method:"POST",fullPath:"/v1/transfers/{id}/reversals"}),listReversals:Ct({method:"GET",fullPath:"/v1/transfers/{id}/reversals",methodType:"list"}),retrieveReversal:Ct({method:"GET",fullPath:"/v1/transfers/{transfer}/reversals/{id}"}),updateReversal:Ct({method:"POST",fullPath:"/v1/transfers/{transfer}/reversals/{id}"})});var zn=c.method,dg=c.extend({create:zn({method:"POST",fullPath:"/v1/webhook_endpoints"}),retrieve:zn({method:"GET",fullPath:"/v1/webhook_endpoints/{webhook_endpoint}"}),update:zn({method:"POST",fullPath:"/v1/webhook_endpoints/{webhook_endpoint}"}),list:zn({method:"GET",fullPath:"/v1/webhook_endpoints",methodType:"list"}),del:zn({method:"DELETE",fullPath:"/v1/webhook_endpoints/{webhook_endpoint}"})});var EI=oe("apps",{Secrets:Nh}),II=oe("billing",{Alerts:If,CreditBalanceSummary:Mf,CreditBalanceTransactions:Lf,CreditGrants:qf,MeterEventAdjustments:eh,MeterEvents:oh,Meters:ah}),AI=oe("billingPortal",{Configurations:$f,Sessions:Dh}),wI=oe("checkout",{Sessions:zh}),kI=oe("climate",{Orders:sh,Products:gh,Suppliers:Fh}),RI=oe("entitlements",{ActiveEntitlements:Ef,Features:Kf}),OI=oe("financialConnections",{Accounts:Sf,Sessions:Uh,Transactions:Kh}),CI=oe("forwarding",{Requests:Oh}),$I=oe("identity",{VerificationReports:ny,VerificationSessions:oy}),NI=oe("issuing",{Authorizations:wf,Cardholders:Rf,Cards:Cf,Disputes:Gf,PersonalizationDesigns:mh,PhysicalBundles:hh,Tokens:Gh,Transactions:Jh}),DI=oe("radar",{EarlyFraudWarnings:Hf,ValueListItems:ey,ValueLists:ty}),zI=oe("reporting",{ReportRuns:wh,ReportTypes:Rh}),MI=oe("sigma",{ScheduledQueryRuns:$h}),UI=oe("tax",{Calculations:kf,Registrations:Ah,Settings:qh,Transactions:Xh}),LI=oe("terminal",{Configurations:Nf,ConnectionTokens:zf,Locations:Qf,Readers:_h}),qI=oe("testHelpers",{ConfirmationTokens:Df,Customers:Ff,Refunds:Ih,TestClocks:Bh,Issuing:oe("issuing",{Authorizations:Af,Cards:Of,PersonalizationDesigns:dh,Transactions:Zh}),Terminal:oe("terminal",{Readers:vh}),Treasury:oe("treasury",{InboundTransfers:Xf,OutboundPayments:uh,OutboundTransfers:lh,ReceivedCredits:bh,ReceivedDebits:Sh})}),jI=oe("treasury",{CreditReversals:jf,DebitReversals:Bf,FinancialAccounts:Jf,InboundTransfers:Yf,OutboundPayments:ch,OutboundTransfers:ph,ReceivedCredits:xh,ReceivedDebits:Eh,TransactionEntries:Hh,Transactions:Qh}),FI=oe("v2",{Billing:oe("billing",{MeterEventAdjustments:th,MeterEventSession:rh,MeterEventStream:nh,MeterEvents:ih}),Core:oe("core",{EventDestinations:Zf,Events:Wf})});var mg="api.stripe.com",fg="443",hg="/v1/",yg=xf,gg=8e4,vg=5,_g=.5,BI=["name","version","url","partner_id"],bg=["authenticator","apiVersion","typescript","maxNetworkRetries","httpAgent","httpClient","timeout","host","port","protocol","telemetry","appInfo","stripeAccount","stripeContext"],GI=a(e=>new Qo(e,c.MAX_BUFFERED_REQUEST_METRICS),"defaultRequestSenderFactory");function Pg(e,t=GI){r.PACKAGE_VERSION="18.2.1",r.USER_AGENT=Object.assign({bindings_version:r.PACKAGE_VERSION,lang:"node",publisher:"stripe",uname:null,typescript:!1},df()),r.StripeResource=c,r.resources=wr,r.HttpClient=Ee,r.HttpClientResponse=Et,r.CryptoProvider=Tt,r.webhooks=Pf(e);function r(n,o={}){if(!(this instanceof r))return new r(n,o);let i=this._getPropsFromConfig(o);this._platformFunctions=e,Object.defineProperty(this,"_emitter",{value:this._platformFunctions.createEmitter(),enumerable:!1,configurable:!1,writable:!1}),this.VERSION=r.PACKAGE_VERSION,this.on=this._emitter.on.bind(this._emitter),this.once=this._emitter.once.bind(this._emitter),this.off=this._emitter.removeListener.bind(this._emitter);let s=i.httpAgent||null;this._api={host:i.host||mg,port:i.port||fg,protocol:i.protocol||"https",basePath:hg,version:i.apiVersion||yg,timeout:jo("timeout",i.timeout,gg),maxNetworkRetries:jo("maxNetworkRetries",i.maxNetworkRetries,2),agent:s,httpClient:i.httpClient||(s?this._platformFunctions.createNodeHttpClient(s):this._platformFunctions.createDefaultHttpClient()),dev:!1,stripeAccount:i.stripeAccount||null,stripeContext:i.stripeContext||null};let l=i.typescript||!1;l!==r.USER_AGENT.typescript&&(r.USER_AGENT.typescript=l),i.appInfo&&this._setAppInfo(i.appInfo),this._prepResources(),this._setAuthenticator(n,i.authenticator),this.errors=Xo,this.webhooks=r.webhooks,this._prevRequestMetrics=[],this._enableTelemetry=i.telemetry!==!1,this._requestSender=t(this),this.StripeResource=r.StripeResource}return a(r,"Stripe"),r.errors=Xo,r.createNodeHttpClient=e.createNodeHttpClient,r.createFetchHttpClient=e.createFetchHttpClient,r.createNodeCryptoProvider=e.createNodeCryptoProvider,r.createSubtleCryptoProvider=e.createSubtleCryptoProvider,r.prototype={_appInfo:void 0,on:null,off:null,once:null,VERSION:null,StripeResource:null,webhooks:null,errors:null,_api:null,_prevRequestMetrics:null,_emitter:null,_enableTelemetry:null,_requestSender:null,_platformFunctions:null,rawRequest(n,o,i,s){return this._requestSender._rawRequest(n,o,i,s)},_setAuthenticator(n,o){if(n&&o)throw new Error("Can't specify both apiKey and authenticator");if(!n&&!o)throw new Error("Neither apiKey nor config.authenticator provided");this._authenticator=n?Mo(n):o},_setAppInfo(n){if(n&&typeof n!="object")throw new Error("AppInfo must be an object.");if(n&&!n.name)throw new Error("AppInfo.name is required");n=n||{},this._appInfo=BI.reduce((o,i)=>(typeof n[i]=="string"&&(o=o||{},o[i]=n[i]),o),{})},_setApiField(n,o){this._api[n]=o},getApiField(n){return this._api[n]},setClientId(n){this._clientId=n},getClientId(){return this._clientId},getConstant:a(n=>{switch(n){case"DEFAULT_HOST":return mg;case"DEFAULT_PORT":return fg;case"DEFAULT_BASE_PATH":return hg;case"DEFAULT_API_VERSION":return yg;case"DEFAULT_TIMEOUT":return gg;case"MAX_NETWORK_RETRY_DELAY_SEC":return vg;case"INITIAL_NETWORK_RETRY_DELAY_SEC":return _g}return r[n]},"getConstant"),getMaxNetworkRetries(){return this.getApiField("maxNetworkRetries")},_setApiNumberField(n,o,i){let s=jo(n,o,i);this._setApiField(n,s)},getMaxNetworkRetryDelay(){return vg},getInitialNetworkRetryDelay(){return _g},getClientUserAgent(n){return this.getClientUserAgentSeeded(r.USER_AGENT,n)},getClientUserAgentSeeded(n,o){this._platformFunctions.getUname().then(i=>{var s;let l={};for(let b in n)Object.prototype.hasOwnProperty.call(n,b)&&(l[b]=encodeURIComponent((s=n[b])!==null&&s!==void 0?s:"null"));l.uname=encodeURIComponent(i||"UNKNOWN");let f=this.getApiField("httpClient");f&&(l.httplib=encodeURIComponent(f.getClientName())),this._appInfo&&(l.application=this._appInfo),o(JSON.stringify(l))})},getAppInfoAsString(){if(!this._appInfo)return"";let n=this._appInfo.name;return this._appInfo.version&&(n+=`/${this._appInfo.version}`),this._appInfo.url&&(n+=` (${this._appInfo.url})`),n},getTelemetryEnabled(){return this._enableTelemetry},_prepResources(){for(let n in wr)Object.prototype.hasOwnProperty.call(wr,n)&&(this[lf(n)]=new wr[n](this))},_getPropsFromConfig(n){if(!n)return{};let o=typeof n=="string";if(!(n===Object(n)&&!Array.isArray(n))&&!o)throw new Error("Config must either be an object or a string");if(o)return{apiVersion:n};if(Object.keys(n).filter(l=>!bg.includes(l)).length>0)throw new Error(`Config object may only contain the following: ${bg.join(", ")}`);return n},parseThinEvent(n,o,i,s,l,f){return this.webhooks.constructEvent(n,o,i,s,l,f)}},r}a(Pg,"createStripe");var xg=Pg(new Yo);var ut="https://api.stripe.com/v1",Ae=a(e=>new xg(e,{apiVersion:"2025-05-28.basil"}),"getClient"),_={baseUrl:ut,subscribeWebhook:a(async(e,t,r)=>{let n={method:"POST",url:`${ut}/webhook_endpoints`,headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{enabled_events:[e],url:t},authentication:{type:"BEARER_TOKEN",token:r},queryParams:{}},{body:o}=await v.sendRequest(n);return o},"subscribeWebhook"),unsubscribeWebhook:a(async(e,t)=>{let r={method:"DELETE",url:`${ut}/webhook_endpoints/${e}`,authentication:{type:"BEARER_TOKEN",token:t}};return await v.sendRequest(r)},"unsubscribeWebhook"),invoice:u.Dropdown({auth:g,displayName:"Invoice",required:!0,refreshers:[],options:a(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your Stripe account first"};try{return{disabled:!1,options:(await Ae(e.secret_text).invoices.list({limit:100,expand:["data.customer"]})).data.map(n=>{let o=n.customer,i=o?.name||o?.email||"Unknown Customer",s=(n.total/100).toFixed(2),l=`Invoice #${n.number||n.id} for ${i} (${s} ${n.currency.toUpperCase()})`;return{value:n.id,label:l}}).filter(n=>n.value!==void 0&&n.value!==null)}}catch(t){return console.error("Failed to load Stripe invoices:",t),{disabled:!0,options:[],placeholder:"Error loading invoices. Check connection."}}},"options")}),customer:u.Dropdown({auth:g,displayName:"Customer",required:!0,refreshers:[],options:a(async({auth:e,searchValue:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account"};let r={method:"GET",authentication:{type:"BEARER_TOKEN",token:e.secret_text},url:t?`${ut}/customers/search`:`${ut}/customers`,queryParams:t?{query:`name~"${t}" OR email~"${t}"`}:{limit:"100"}},n=await v.sendRequest(r);return n.status===200?{disabled:!1,options:n.body.data.map(o=>({value:o.id,label:`${o.name||o.id} (${o.email||"No Email"})`}))}:{disabled:!0,options:[],placeholder:"Couldn't load customers"}},"options")}),product:u.Dropdown({auth:g,displayName:"Product",required:!0,refreshers:[],options:a(async({auth:e,searchValue:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account"};let r="active:'true'";t&&(r+=` AND name~"${t}"`);let n=await v.sendRequest({method:"GET",url:`${ut}/products/search`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},queryParams:{query:r}});return n.status===200?{disabled:!1,options:n.body.data.map(o=>({value:o.id,label:o.name}))}:{disabled:!0,options:[],placeholder:"Couldn't load products"}},"options")}),price:u.Dropdown({auth:g,displayName:"Price",required:!0,refreshers:[],options:a(async({auth:e,searchValue:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account"};let r=await v.sendRequest({method:"GET",url:`${ut}/prices/search`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},queryParams:{query:`active:'true' AND type:'recurring' AND (product.name~"${t||""}" OR nickname~"${t||""}")`,expand:"data.product"}});return r.status===200?{disabled:!1,options:r.body.data.map(n=>{let o=n.nickname?`${n.nickname} (${n.product.name})`:n.product.name;return{value:n.id,label:o}})}:{disabled:!0,options:[],placeholder:"Couldn't load prices"}},"options")}),subscription:u.Dropdown({auth:g,displayName:"Subscription",required:!0,refreshers:[],options:a(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:(await Ae(e.secret_text).subscriptions.list({limit:100,status:"active",expand:["data.customer"]})).data.map(n=>{let o=n.customer,s=`Subscription for ${o?.name||o?.email||"Unknown Customer"} (${n.id})`;return{value:n.id,label:s}})}}catch(t){return console.error("Failed to load Stripe subscriptions:",t),{disabled:!0,options:[],placeholder:"Couldn't load subscriptions. See console."}}},"options")}),payout:u.Dropdown({auth:g,displayName:"Payout",required:!0,refreshers:[],options:a(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account"};let t=await v.sendRequest({method:"GET",url:`${ut}/payouts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},queryParams:{limit:"100"}});return t.status===200?{disabled:!1,options:t.body.data.map(r=>{let n=new Date(r.arrival_date*1e3).toLocaleDateString(),o=(r.amount/100).toFixed(2),i=`Payout on ${n} - ${o} ${r.currency.toUpperCase()} (${r.status})`;return{value:r.id,label:i}})}:{disabled:!0,options:[],placeholder:"Couldn't load payouts"}},"options")}),paymentIntent:u.Dropdown({auth:g,displayName:"Payment Intent",required:!0,refreshers:[],options:a(async({auth:e,searchValue:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account"};let r="status:'succeeded'";t&&(r+=` AND customer.email~"${t}"`);let n=await v.sendRequest({method:"GET",url:`${ut}/payment_intents/search`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},queryParams:{query:r,"expand[]":"data.customer"}});return n.status===200?{disabled:!1,options:n.body.data.map(o=>{let i=o.customer?.name||o.customer?.email||"Unknown Customer",s=(o.amount/100).toFixed(2),l=`Payment from ${i} - ${s} ${o.currency.toUpperCase()}`;return{value:o.id,label:l}})}:{disabled:!0,options:[],placeholder:"Couldn't load payment intents"}},"options")}),paymentLink:u.Dropdown({auth:g,displayName:"Payment Link",required:!0,refreshers:[],options:a(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account"};try{return{disabled:!1,options:(await Ae(e.secret_text).paymentLinks.list({active:!0,limit:100})).data.map(n=>({value:n.id,label:n.url}))}}catch{return{disabled:!0,options:[],placeholder:"Couldn't load payment links"}}},"options")})};var Sg=x({name:"search_customer",classification:"SEARCH",auth:g,displayName:"Search Customer",description:"Search for a customer in stripe by email",audience:"human",aiMetadata:{description:"Looks up Stripe customers matching a given email address. Use to find an existing customer record before creating, updating, or charging one, to avoid duplicates. Read-only and idempotent; matches on the exact email.",idempotent:!0},props:{email:u.ShortText({displayName:"Email",description:void 0,required:!0})},outputSchema:So,async run(e){let t={email:e.propsValue.email};return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/customers/search`,headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded","Stripe-Version":"2026-02-25.clover"},body:{query:`email:'${t.email}'`}})).body}});var Tg=ee({auth:g,name:"new_customer",classification:"READ",displayName:"New Customer",description:"Triggers when a new customer is created",aiMetadata:{description:"Fires when a new customer is created in Stripe (the customer.created event), emitting the new customer record. Use to react to customer onboarding, such as syncing them to a CRM or sending a welcome flow."},props:{},outputSchema:Re,sampleData:{id:"cus_NGtyEf4hNGTj3p",object:"customer",address:null,balance:0,created:1675180509,currency:null,default_currency:null,default_source:null,delinquent:!1,description:null,discount:null,email:"jane@example.com",invoice_prefix:"B7162248",invoice_settings:{custom_fields:null,default_payment_method:null,footer:null,rendering_options:null},livemode:!1,metadata:{},name:"John Doe",next_invoice_sequence:1,phone:null,preferred_locales:[],shipping:null,tax_exempt:"none",test_clock:null},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("customer.created",e.webhookUrl,e.auth.secret_text);await e.store.put("_new_customer_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store?.get("_new_customer_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/customers",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded","Stripe-Version":"2026-02-25.clover"},queryParams:{limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){return[e.payload.body.data.object]}});var Eg=ee({auth:g,name:"new_payment",classification:"READ",displayName:"New Payment",description:"Triggers when a new payment is made",aiMetadata:{description:"Fires when a payment succeeds in Stripe (the payment_intent.succeeded event), emitting the completed payment. Use to react to a successful payment, such as fulfilling an order or recording revenue."},props:{},type:"WEBHOOK",outputSchema:Ie,sampleData:{id:"pi_3MWM7aKZ0dZRqLEK1soCKVrq",object:"payment_intent",amount:1e4,amount_capturable:0,amount_received:1e4,capture_method:"automatic_async",confirmation_method:"automatic",created:1675180355,currency:"usd",customer:"cus_NGtvUQ18FJXcGI",description:"Subscription creation",latest_charge:"ch_3MWM7aKZ0dZRqLEK1soCKVrq",livemode:!1,metadata:{},payment_method:"pm_1MWM8MKZ0dZRqLEKnIH41f76",receipt_email:null,setup_future_usage:null,status:"succeeded"},async onEnable(e){let t=await _.subscribeWebhook("payment_intent.succeeded",e.webhookUrl,e.auth.secret_text);await e.store?.put("_new_payment_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store?.get("_new_payment_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/payment_intents/search",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded","Stripe-Version":"2026-02-25.clover"},queryParams:{query:'status:"succeeded"',limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){return[e.payload.body.data.object]}});var Ig=ee({auth:g,name:"new_subscription",classification:"READ",displayName:"New Subscription",description:"Triggers when a new subscription is made",aiMetadata:{description:"Fires when a new subscription is created in Stripe (the customer.subscription.created event), emitting the new subscription. Use to react to a customer starting recurring billing, such as provisioning access or sending an onboarding flow."},props:{},type:"WEBHOOK",outputSchema:xe,sampleData:{id:"sub_1MWMJXKZ0dZRqLEKJX80JXfv",object:"subscription",application:null,application_fee_percent:null,automatic_tax:{enabled:!0},billing_cycle_anchor:1675181047,billing_thresholds:null,cancel_at:null,cancel_at_period_end:!1,canceled_at:null,collection_method:"charge_automatically",created:1675181047,currency:"usd",current_period_end:1677600247,current_period_start:1675181047,customer:"cus_NGtvUQ18FJXcGI",days_until_due:null,default_payment_method:"pm_1MWM8MKZ0dZRqLEKnIH41f76",default_source:null,default_tax_rates:[],description:null,discount:null,ended_at:null,items:{object:"list",data:[{id:"si_NGu7pb7hS3Rps3",object:"subscription_item",billing_thresholds:null,created:1675181048,metadata:{},plan:{id:"price_1MWLz3KZ0dZRqLEK06gRMHCF",object:"plan",active:!0,aggregate_usage:null,amount:1e4,amount_decimal:"10000",billing_scheme:"per_unit",created:1675179777,currency:"usd",interval:"month",interval_count:1,livemode:!1,metadata:{},nickname:null,product:"prod_NGtm3AlvaGjaLN",tiers_mode:null,transform_usage:null,trial_period_days:null,usage_type:"licensed"},price:{id:"price_1MWLz3KZ0dZRqLEK06gRMHCF",object:"price",active:!0,billing_scheme:"per_unit",created:1675179777,currency:"usd",custom_unit_amount:null,livemode:!1,lookup_key:null,metadata:{},nickname:null,product:"prod_NGtm3AlvaGjaLN",recurring:{aggregate_usage:null,interval:"month",interval_count:1,trial_period_days:null,usage_type:"licensed"},tax_behavior:"exclusive",tiers_mode:null,transform_quantity:null,type:"recurring",unit_amount:1e4,unit_amount_decimal:"10000"},quantity:1,subscription:"sub_1MWMJXKZ0dZRqLEKJX80JXfv",tax_rates:[]}],has_more:!1,total_count:1,url:"/v1/subscription_items?subscription=sub_1MWMJXKZ0dZRqLEKJX80JXfv"},latest_invoice:"in_1MWMJXKZ0dZRqLEKIu4a51u7",livemode:!1,metadata:{},next_pending_invoice_item_invoice:null,on_behalf_of:null,pause_collection:null,payment_settings:{payment_method_options:null,payment_method_types:null,save_default_payment_method:"off"},pending_invoice_item_interval:null,pending_setup_intent:null,pending_update:null,plan:{id:"price_1MWLz3KZ0dZRqLEK06gRMHCF",object:"plan",active:!0,aggregate_usage:null,amount:1e4,amount_decimal:"10000",billing_scheme:"per_unit",created:1675179777,currency:"usd",interval:"month",interval_count:1,livemode:!1,metadata:{},nickname:null,product:"prod_NGtm3AlvaGjaLN",tiers_mode:null,transform_usage:null,trial_period_days:null,usage_type:"licensed"},quantity:1,schedule:null,start_date:1675181047,status:"active",test_clock:null,transfer_data:null,trial_end:null,trial_start:null},async onEnable(e){let t=await _.subscribeWebhook("customer.subscription.created",e.webhookUrl,e.auth.secret_text);await e.store?.put("_new_customer_subscription_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store?.get("_new_customer_subscription_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/subscriptions",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){return[e.payload.body.data.object]}});var Ag=ee({auth:g,name:"payment_failed",classification:"READ",displayName:"Payment Failed",description:"Triggers when a payment fails",aiMetadata:{description:"Fires when a charge fails in Stripe (the charge.failed event), emitting the failed charge including its failure code and message. Use to react to declined payments, such as alerting the customer or triggering a retry/dunning flow."},props:{},outputSchema:ar,sampleData:{id:"ch_3MWMPQKZ0dZRqLEK063rxD7q",object:"charge",amount:1e5,amount_captured:0,amount_refunded:0,application:null,application_fee:null,application_fee_amount:null,balance_transaction:null,billing_details:{address:{city:null,country:null,line1:null,line2:null,postal_code:"12321",state:null},email:null,name:null,phone:null},calculated_statement_descriptor:"WWW.ACTIVEPIECES.COM",captured:!1,created:1675181413,currency:"usd",customer:"cus_NGtvUQ18FJXcGI",description:"Failed Payment",destination:null,dispute:null,disputed:!1,failure_balance_transaction:null,failure_code:"card_declined",failure_message:"Your card was declined.",fraud_details:{},invoice:null,livemode:!1,metadata:{},on_behalf_of:null,order:null,outcome:{network_status:"declined_by_network",reason:"generic_decline",risk_level:"normal",risk_score:60,seller_message:"The bank did not return any further details with this decline.",type:"issuer_declined"},paid:!1,payment_intent:"pi_3MWMPQKZ0dZRqLEK0Nsc6WhL",payment_method:"src_1MWMPQKZ0dZRqLEKuQ83wmZI",payment_method_details:{card:{brand:"visa",checks:{address_line1_check:null,address_postal_code_check:"pass",cvc_check:"pass"},country:"US",exp_month:12,exp_year:2031,fingerprint:"mtYxM2Q4edpEt8Pw",funding:"credit",installments:null,last4:"0341",mandate:null,network:"visa",three_d_secure:null,wallet:null},type:"card"},receipt_email:null,receipt_number:null,receipt_url:null,refunded:!1,refunds:{object:"list",data:[],has_more:!1,total_count:0,url:"/v1/charges/ch_3MWMPQKZ0dZRqLEK063rxD7q/refunds"},review:null,shipping:null,source:{id:"src_1MWMPQKZ0dZRqLEKuQ83wmZI",object:"source",amount:null,card:{exp_month:12,exp_year:2031,last4:"0341",country:"US",brand:"Visa",address_zip_check:"pass",cvc_check:"pass",funding:"credit",fingerprint:"mtYxM2Q4edpEt8Pw",three_d_secure:"optional",name:null,address_line1_check:null,tokenization_method:null,dynamic_last4:null},client_secret:"src_client_secret_TlLkl6IvhCvmbx8Cz12YNDVb",created:1675181413,currency:null,flow:"none",livemode:!1,metadata:{},owner:{address:{city:null,country:null,line1:null,line2:null,postal_code:"12321",state:null},email:null,name:null,phone:null,verified_address:null,verified_email:null,verified_name:null,verified_phone:null},statement_descriptor:null,status:"chargeable",type:"card",usage:"reusable"},source_transfer:null,statement_descriptor:"www.activepieces.com",statement_descriptor_suffix:null,status:"failed",transfer_data:null,transfer_group:null},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("charge.failed",e.webhookUrl,e.auth.secret_text);await e.store?.put("_payment_failed_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store?.get("_payment_failed_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/charges/search",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded","Stripe-Version":"2026-02-25.clover"},queryParams:{query:'status:"failed"',limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){return[e.payload.body.data.object]}});var VI=[{label:"All Statuses",value:""},{label:"Active",value:"active"},{label:"Past Due",value:"past_due"},{label:"Unpaid",value:"unpaid"},{label:"Canceled",value:"canceled"},{label:"Incomplete",value:"incomplete"},{label:"Incomplete Expired",value:"incomplete_expired"},{label:"Trialing",value:"trialing"},{label:"Paused",value:"paused"}],wg=x({name:"search_subscriptions",classification:"SEARCH",auth:g,displayName:"Search Subscriptions",description:"Search for subscriptions by price ID, status, customer ID and other filters, including customer details",audience:"human",aiMetadata:{description:"Lists and filters Stripe subscriptions by price ID, status, customer ID, and creation date range, optionally expanding full customer details for each. Use to find subscriptions matching criteria or to audit a customer's subscriptions; supports paging through all results. Read-only and idempotent.",idempotent:!0},props:{price_ids:u.LongText({displayName:"Price IDs",description:"Comma-separated list of price IDs to filter by (e.g., price_1ABC123, price_2DEF456)",required:!1}),status:u.StaticDropdown({displayName:"Subscription Status",description:"Filter by subscription status",required:!1,options:{options:VI}}),customer_id:u.ShortText({displayName:"Customer ID",description:"Filter by specific customer ID (optional)",required:!1}),created_after:u.DateTime({displayName:"Created After",description:"Filter subscriptions created after this date (YYYY-MM-DD format)",required:!1}),created_before:u.DateTime({displayName:"Created Before",description:"Filter subscriptions created before this date (YYYY-MM-DD format)",required:!1}),limit:u.Number({displayName:"Limit",description:"Maximum number of subscriptions to return (default: 100, set to 0 for all)",required:!1,defaultValue:100}),fetch_all:u.Checkbox({displayName:"Fetch All Results",description:"Fetch all matching subscriptions (ignores limit, may take longer for large datasets)",required:!1,defaultValue:!1}),include_customer_details:u.Checkbox({displayName:"Include Customer Details",description:"Fetch detailed customer information for each subscription",required:!1,defaultValue:!0})},outputSchema:To,async run(e){let{price_ids:t,status:r,customer_id:n,created_after:o,created_before:i,limit:s=100,fetch_all:l=!1,include_customer_details:f=!0}=e.propsValue,b=a(T=>{let A=new URLSearchParams;if(A.append("limit","100"),A.append("expand[]","data.items.data.price"),f&&A.append("expand[]","data.customer"),r&&A.append("status",r),n&&A.append("customer",n),o){let k=Math.floor(new Date(o).getTime()/1e3);A.append("created[gte]",k.toString())}if(i){let k=Math.floor(new Date(i).getTime()/1e3);A.append("created[lte]",k.toString())}return T&&A.append("starting_after",T),A},"buildQueryParams"),m=[],P=!0,h,d=0,y=l?50:Math.ceil(s/100);for(;P&&d<y;){let T=b(h),A=await v.sendRequest({method:"GET",url:`${_.baseUrl}/subscriptions?${T.toString()}`,headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"}});if(!A.body)throw new Error("Failed to fetch subscriptions from Stripe");let k=A.body.data;if(m=m.concat(k),P=A.body.has_more,d++,P&&k.length>0&&(h=k[k.length-1].id),!l&&m.length>=s){m=m.slice(0,s);break}}let I=m;if(t&&t.trim()){let T=t.split(",").map(A=>A.trim()).filter(A=>A.length>0);T.length>0&&(I=I.filter(A=>A.items.data.some(k=>k.price&&typeof k.price=="object"&&T.includes(k.price.id))))}let S=await Promise.all(I.map(async T=>{let A={...T};if(f){if(typeof T.customer=="object"&&T.customer!==null&&!("deleted"in T.customer&&T.customer.deleted))A.customer=T.customer;else if(typeof T.customer=="string")try{let k=await v.sendRequest({method:"GET",url:`${_.baseUrl}/customers/${T.customer}`,headers:{Authorization:"Bearer "+e.auth.secret_text}});A.customer=k.body}catch(k){console.warn(`Failed to fetch customer details for ${T.customer}:`,k)}}return A}));return{success:!0,count:S.length,total_fetched:m.length,requests_made:d,has_more_available:P&&!l,pagination_info:{limit_requested:l?"All":s,fetch_all_enabled:l,max_requests_limit:y},subscriptions:S,filters_applied:{price_ids:t?t.split(",").map(T=>T.trim()).filter(T=>T.length>0):null,status:r||null,customer_id:n||null,created_after:o||null,created_before:i||null,limit:s,fetch_all:l,include_customer_details:f}}}});var kg=ee({auth:g,name:"new_charge",classification:"READ",displayName:"New Charge",description:"Fires when a charge is successfully completed.",aiMetadata:{description:"Fires when a charge is successfully completed in Stripe (the charge.succeeded event), emitting the charge record. Use to react to a successful card charge; note this is the charge-level event, distinct from the New Payment trigger which fires on a succeeded payment intent."},props:{},outputSchema:ar,sampleData:{id:"ch_3MmlLrLkdIwHu7ix0snN0B15",object:"charge",amount:1099,amount_captured:1099,amount_refunded:0,application:null,application_fee:null,application_fee_amount:null,balance_transaction:"txn_3MmlLrLkdIwHu7ix0uke3Ezy",billing_details:{address:{city:null,country:null,line1:null,line2:null,postal_code:null,state:null},email:"customer@example.com",name:"John Doe",phone:null},captured:!0,created:1679090539,currency:"usd",customer:"cus_ABC123",description:"My First Test Charge",disputed:!1,paid:!0,payment_intent:"pi_123",payment_method:"pm_123",receipt_url:"https://pay.stripe.com/receipts/...",refunded:!1,status:"succeeded"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("charge.succeeded",e.webhookUrl,e.auth.secret_text);await e.store.put("_new_charge_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_new_charge_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/charges/search",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded","Stripe-Version":"2026-02-25.clover"},queryParams:{query:'status:"succeeded"',limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){return[e.payload.body.data.object]}});var Rg=ee({auth:g,name:"new_invoice",classification:"READ",displayName:"New Invoice",description:"Fires when an invoice is created. Supports filters like status, customer, subscription.",aiMetadata:{description:"Fires when an invoice is created in Stripe (the invoice.created event), emitting the new invoice. Optional filters narrow firing to a specific status, customer ID, or subscription ID. Use to react to newly issued invoices, for example to record or forward them."},props:{status:u.StaticDropdown({displayName:"Status",description:"Only trigger for invoices with this status.",required:!1,options:{options:[{label:"Draft",value:"draft"},{label:"Open",value:"open"},{label:"Paid",value:"paid"},{label:"Uncollectible",value:"uncollectible"},{label:"Void",value:"void"}]}}),customer:u.ShortText({displayName:"Customer ID",description:"Only trigger for invoices belonging to this customer ID (e.g., `cus_...`).",required:!1}),subscription:u.ShortText({displayName:"Subscription ID",description:"Only trigger for invoices belonging to this subscription ID (e.g., `sub_...`).",required:!1})},outputSchema:ge,sampleData:{id:"in_1MtHbELkdIwHu7ixl4OzzPMv",object:"invoice",customer:"cus_NeZwdNtLEOXuvB",subscription:"sub_12345ABC",status:"paid",amount_due:999,amount_paid:999,amount_remaining:0,billing_reason:"subscription_cycle",collection_method:"charge_automatically",created:1680644467,currency:"usd",customer_email:"jennyrosen@example.com",customer_name:"Jenny Rosen",hosted_invoice_url:"https://invoice.stripe.com/i/acct_...",invoice_pdf:"https://pay.stripe.com/invoice/acct_.../pdf",livemode:!1,number:"ABC-123-456"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("invoice.created",e.webhookUrl,e.auth.secret_text);await e.store.put("_new_invoice_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_new_invoice_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/invoices",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{status:n,customer:o,subscription:i}=e.propsValue;return n&&r.status!==n?[]:o&&r.customer!==o?[]:i&&r.subscription!==i?[]:[r]}});var Og=ee({auth:g,name:"invoice_payment_failed",classification:"READ",displayName:"Invoice Payment Failed",description:"Fires when a payment against an invoice fails.",aiMetadata:{description:"Fires when a payment against an invoice fails in Stripe (the invoice.payment_failed event), emitting the affected invoice including the finalization error. An optional customer ID filter narrows firing to one customer. Use to react to failed invoice payments, such as starting a dunning or retry flow."},props:{customer:u.ShortText({displayName:"Customer ID",description:"Only trigger for invoices belonging to this customer ID (e.g., `cus_...`).",required:!1})},outputSchema:ge,sampleData:{id:"in_1MtHbELkdIwHu7ixl4OzzPMv",object:"invoice",customer:"cus_NeZwdNtLEOXuvB",status:"open",amount_due:1500,amount_paid:0,amount_remaining:1500,attempt_count:1,attempted:!0,billing_reason:"subscription_cycle",collection_method:"charge_automatically",created:1680644467,currency:"usd",customer_email:"jennyrosen@example.com",customer_name:"Jenny Rosen",hosted_invoice_url:"https://invoice.stripe.com/i/acct_...",last_finalization_error:{code:"card_declined",doc_url:"https://stripe.com/docs/error-codes/card-declined",message:"Your card was declined.",param:"",payment_intent:{id:"pi_123",object:"payment_intent"},type:"card_error"},livemode:!1,next_payment_attempt:1681251667},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("invoice.payment_failed",e.webhookUrl,e.auth.secret_text);await e.store.put("_invoice_payment_failed_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_invoice_payment_failed_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/invoices",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{status:"open",limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{customer:n}=e.propsValue;return n&&r.customer!==n?[]:[r]}});var Cg=ee({auth:g,name:"canceled_subscription",classification:"READ",displayName:"Canceled Subscription",description:"Fires when a subscription is canceled.",aiMetadata:{description:"Fires when a subscription is canceled in Stripe (the customer.subscription.deleted event), emitting the canceled subscription including any cancellation details. An optional customer ID filter narrows firing to one customer. Use to react to churn, such as revoking access or sending a win-back flow."},props:{customer:u.ShortText({displayName:"Customer ID",description:"Only trigger for subscriptions belonging to this customer ID (e.g., `cus_...`).",required:!1})},outputSchema:xe,sampleData:{id:"sub_1MlPf9LkdIwHu7ixB6VIYRyX",object:"subscription",application:null,application_fee_percent:null,billing_cycle_anchor:1678768838,cancel_at_period_end:!1,canceled_at:1678768842,cancellation_details:{comment:"User requested cancellation via support.",feedback:"missing_features",reason:"cancellation_requested"},collection_method:"charge_automatically",created:1678768838,currency:"usd",customer:"cus_NWSaVkvdacCUi4",ended_at:1678768842,items:{object:"list",data:[{id:"si_NWSaWTp80M123q",object:"subscription_item",price:{id:"price_1MlPf7LkdIwHu7ixgcbP7cwE",object:"price",active:!0,currency:"usd",product:"prod_NWSaMgipulx8IQ",type:"recurring",unit_amount:1099},quantity:1}]},latest_invoice:"in_1MlPf9LkdIwHu7ixEo6hdgCw",livemode:!1,metadata:{},start_date:1678768838,status:"canceled"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("customer.subscription.deleted",e.webhookUrl,e.auth.secret_text);await e.store.put("_canceled_subscription_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_canceled_subscription_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/subscriptions",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{status:"canceled",limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{customer:n}=e.propsValue;return n&&r.customer!==n?[]:[r]}});var $g=ee({auth:g,name:"new_refund",classification:"READ",displayName:"New Refund",description:"Fires when a charge is refunded (full or partial).",aiMetadata:{description:"Fires when a refund is created in Stripe (the refund.created event), for a full or partial refund, emitting the refund record. Optional filters narrow firing to a specific charge ID or payment intent ID. Use to react to money returned to a customer, such as updating accounting or notifying them."},props:{charge:u.ShortText({displayName:"Charge ID",description:"Only trigger for refunds related to this Charge ID (e.g., `ch_...`).",required:!1}),payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"Only trigger for refunds related to this Payment Intent ID (e.g., `pi_...`).",required:!1})},outputSchema:xt,sampleData:{id:"re_1Nispe2eZvKYlo2Cd31jOCgZ",object:"refund",amount:1e3,balance_transaction:"txn_1Nispe2eZvKYlo2CYezqFhEx",charge:"ch_1NirD82eZvKYlo2CIvbtLWuY",created:1692942318,currency:"usd",metadata:{},payment_intent:"pi_1GszsK2eZvKYlo2CfhZyoZLp",reason:"requested_by_customer",receipt_number:null,status:"succeeded"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("refund.created",e.webhookUrl,e.auth.secret_text);await e.store.put("_new_refund_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_new_refund_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/refunds",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{charge:n,payment_intent:o}=e.propsValue;return n&&r.charge!==n?[]:o&&r.payment_intent!==o?[]:[r]}});var Ng=ee({auth:g,name:"new_dispute",classification:"READ",displayName:"New Dispute",description:"Fires when a customer disputes a charge.",aiMetadata:{description:"Fires when a customer disputes a charge in Stripe (the charge.dispute.created event), emitting the dispute including its reason and evidence due date. Optional filters narrow firing to a specific charge ID or payment intent ID. Use to react to chargebacks, such as alerting a team or gathering evidence."},props:{charge:u.ShortText({displayName:"Charge ID",description:"Only trigger for disputes related to this Charge ID (e.g., `ch_...`).",required:!1}),payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"Only trigger for disputes related to this Payment Intent ID (e.g., `pi_...`).",required:!1})},outputSchema:St,sampleData:{id:"du_1MtJUT2eZvKYlo2CNaw2HvEv",object:"dispute",amount:1e3,balance_transactions:[],charge:"ch_1AZtxr2eZvKYlo2CJDX8whov",created:1680651737,currency:"usd",evidence_details:{due_by:1682294399,has_evidence:!1,past_due:!1,submission_count:0},is_charge_refundable:!0,livemode:!1,metadata:{},payment_intent:"pi_1AZtxr2eZvKYlo2CJDX8whov",reason:"general",status:"needs_response"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("charge.dispute.created",e.webhookUrl,e.auth.secret_text);await e.store.put("_new_dispute_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_new_dispute_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/issuing/disputes",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{status:"submitted",limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{charge:n,payment_intent:o}=e.propsValue;return n&&r.charge!==n?[]:o&&r.payment_intent!==o?[]:[r]}});var Dg=ee({auth:g,name:"new_payment_link",classification:"READ",displayName:"New Payment Link",description:"Fires when a new Payment Link is created.",aiMetadata:{description:"Fires when a new payment link is created in Stripe (the payment_link.created event), emitting the new payment link including its shareable URL. Use to react to payment-link creation, such as distributing the URL or logging it."},props:{},outputSchema:ze,sampleData:{id:"plink_1MoC3ULkdIwHu7ixZjtGpVl2",object:"payment_link",active:!0,after_completion:{hosted_confirmation:{custom_message:null},type:"hosted_confirmation"},allow_promotion_codes:!1,currency:"usd",customer_creation:"if_required",livemode:!1,metadata:{},payment_method_collection:"always",url:"https://buy.stripe.com/test_cN25nr0iZ7bUa7meUY"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("payment_link.created",e.webhookUrl,e.auth.secret_text);await e.store.put("_new_payment_link_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_new_payment_link_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/payment_links",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){return[e.payload.body.data.object]}});var zg=ee({auth:g,name:"updated_subscription",classification:"READ",displayName:"Updated Subscription",description:"Fires when an existing subscription is changed.",aiMetadata:{description:"Fires when an existing subscription is updated in Stripe (the customer.subscription.updated event), emitting the changed subscription. Optional filters narrow firing to a target new status or a specific customer ID. Use to react to plan changes, status transitions, or quantity updates."},props:{status:u.StaticDropdown({displayName:"New Status",description:"Only trigger when the subscription is updated to this status.",required:!1,options:{options:[{label:"Incomplete",value:"incomplete"},{label:"Incomplete - Expired",value:"incomplete_expired"},{label:"Trialing",value:"trialing"},{label:"Active",value:"active"},{label:"Past Due",value:"past_due"},{label:"Canceled",value:"canceled"},{label:"Unpaid",value:"unpaid"},{label:"Paused",value:"paused"}]}}),customer:u.ShortText({displayName:"Customer ID",description:"Only trigger for subscriptions belonging to this customer ID (e.g., `cus_...`).",required:!1})},outputSchema:xe,sampleData:{id:"sub_1MowQVLkdIwHu7ixeRlqHVzs",object:"subscription",application:null,application_fee_percent:null,automatic_tax:{enabled:!1},billing_cycle_anchor:1679609767,cancel_at_period_end:!1,canceled_at:null,collection_method:"charge_automatically",created:1679609767,currency:"usd",customer:"cus_Na6dX7aXxi11N4",items:{object:"list",data:[{id:"si_Na6dzxczY5fwHx",object:"subscription_item",price:{id:"price_1MowQULkdIwHu7ixraBm864M",object:"price",product:"prod_Na6dGcTsmU0I4R",unit_amount:2e3},quantity:1}]},latest_invoice:"in_1MowQWLkdIwHu7ixuzkSPfKd",livemode:!1,metadata:{plan:"premium"},start_date:1679609767,status:"active"},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("customer.subscription.updated",e.webhookUrl,e.auth.secret_text);await e.store.put("_updated_subscription_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_updated_subscription_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/subscriptions",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{status:"incomplete",limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{status:n,customer:o}=e.propsValue;return n&&r.status!==n?[]:o&&r.customer!==o?[]:[r]}});var Mg=ee({auth:g,name:"checkout_session_completed",classification:"READ",displayName:"Checkout Session Completed",description:"Fires when a Stripe Checkout Session is successfully completed.",aiMetadata:{description:"Fires when a Stripe Checkout Session is successfully completed (the checkout.session.completed event), emitting the completed session including customer and payment details. An optional customer ID filter narrows firing to one customer. Use to react to a completed hosted checkout, such as fulfilling an order or granting access."},props:{customer:u.ShortText({displayName:"Customer ID",description:"Only trigger for checkout sessions created by this customer ID (e.g., `cus_...`).",required:!1})},outputSchema:ur,sampleData:{id:"cs_test_a11YYufWQzNY63zpQ6QSNRQhkUpVph4WRmzW0zWJO2znZKdVujZ0N0S22u",object:"checkout.session",amount_subtotal:2198,amount_total:2198,created:1679600215,currency:"usd",customer:"cus_NWSaVkvdacCUi4",customer_details:{email:"jenny.rosen@example.com",name:"Jenny Rosen",phone:null},livemode:!1,mode:"payment",payment_intent:"pi_12345ABC",payment_status:"paid",status:"complete",success_url:"https://example.com/success",url:null},type:"WEBHOOK",async onEnable(e){let t=await _.subscribeWebhook("checkout.session.completed",e.webhookUrl,e.auth.secret_text);await e.store.put("_checkout_session_completed_trigger",{webhookId:t.id})},async onDisable(e){let t=await e.store.get("_checkout_session_completed_trigger");t!=null&&await _.unsubscribeWebhook(t.webhookId,e.auth.secret_text)},async test(e){let t=await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/checkout/sessions",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},queryParams:{status:"complete",limit:"5"}});return H(t.body)||H(t.body.data)?[]:t.body.data},async run(e){let r=e.payload.body.data.object,{customer:n}=e.propsValue;return n&&r.customer!==n?[]:[r]}});var Ug=x({name:"update_customer",classification:"WRITE",auth:g,displayName:"Update Customer",description:"Modify an existing customer\u2019s details.",audience:"human",aiMetadata:{description:"Updates fields on an existing Stripe customer (email, name, description, phone, address); only the fields you provide are changed. Use to correct or enrich a customer record identified by its customer ID. Idempotent in effect: repeating the same update yields the same final state.",idempotent:!0},props:{customer:_.customer,email:u.ShortText({displayName:"Email",required:!1}),name:u.ShortText({displayName:"Name",required:!1}),description:u.LongText({displayName:"Description",required:!1}),phone:u.ShortText({displayName:"Phone",required:!1}),line1:u.ShortText({displayName:"Address Line 1",required:!1}),postal_code:u.ShortText({displayName:"Postal Code",required:!1}),city:u.ShortText({displayName:"City",required:!1}),state:u.ShortText({displayName:"State",required:!1}),country:u.ShortText({displayName:"Country",required:!1})},outputSchema:Re,async run(e){let{customer:t,...r}=e.propsValue,n={};r.name&&(n.name=r.name),r.email&&(n.email=r.email),r.description&&(n.description=r.description),r.phone&&(n.phone=r.phone);let o={};return r.line1&&(o.line1=r.line1),r.city&&(o.city=r.city),r.state&&(o.state=r.state),r.postal_code&&(o.postal_code=r.postal_code),r.country&&(o.country=r.country),Object.keys(o).length>0&&(n.address=o),(await v.sendRequest({method:"POST",url:`https://api.stripe.com/v1/customers/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n})).body}});var Lg=x({name:"create_payment_intent",classification:"WRITE",auth:g,displayName:"Create Payment (Payment Intent)",description:"Creates a new payment intent to start a payment flow.",audience:"human",aiMetadata:{description:"Creates a Stripe PaymentIntent for a given amount and currency to begin collecting a payment, optionally tied to a customer. Can run in two modes: leave it unconfirmed to obtain a client secret for client-side completion, or set confirm to immediately charge a supplied payment method (which then also requires a return URL). Not idempotent: each call starts a separate payment.",idempotent:!1},props:{amount:u.Number({displayName:"Amount",description:"The amount to charge, in a decimal format (e.g., 10.50 for $10.50).",required:!0}),currency:u.StaticDropdown({displayName:"Currency",description:"The three-letter ISO code for the currency.",required:!0,options:{options:[{label:"US Dollar",value:"usd"},{label:"Euro",value:"eur"},{label:"Pound Sterling",value:"gbp"},{label:"Australian Dollar",value:"aud"},{label:"Canadian Dollar",value:"cad"},{label:"Swiss Franc",value:"chf"},{label:"Chinese Yuan",value:"cny"},{label:"Japanese Yen",value:"jpy"},{label:"Indian Rupee",value:"inr"},{label:"Singapore Dollar",value:"sgd"}]}}),customer:_.customer,payment_method:u.ShortText({displayName:"Payment Method ID",description:"The ID of the Payment Method to attach (e.g., `pm_...`). Required if you want to confirm the payment immediately.",required:!1}),confirm:u.Checkbox({displayName:"Confirm Payment Immediately",description:"If true, Stripe will attempt to charge the provided payment method. A `Payment Method ID` is required.",required:!1,defaultValue:!1}),return_url:u.ShortText({displayName:"Return URL",description:"The URL to redirect your customer back to after they authenticate their payment. Required when confirming the payment.",required:!1}),description:u.LongText({displayName:"Description",required:!1}),receipt_email:u.ShortText({displayName:"Receipt Email",description:"The email address to send a receipt to. This will override the customer's email address.",required:!1})},outputSchema:Ie,async run(e){let{amount:t,currency:r,customer:n,payment_method:o,confirm:i,return_url:s,description:l,receipt_email:f}=e.propsValue;if(i&&!o)throw new Error("A Payment Method ID is required when 'Confirm Payment' is set to true.");if(i&&!s)throw new Error("A Return URL is required when 'Confirm Payment' is set to true.");let m={amount:Math.round(t*100),currency:r};return n&&(m.customer=n),o&&(m.payment_method=o),i&&(m.confirm=i),s&&(m.return_url=s),l&&(m.description=l),f&&(m.receipt_email=f),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_intents`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:m})).body}});var qg=x({name:"create_product",classification:"WRITE",auth:g,displayName:"Create Product",description:"Create a new product object in Stripe.",audience:"human",aiMetadata:{description:"Creates a new product object in Stripe (the catalog item that prices attach to), with optional description, images, URL, and metadata. Use before creating a price or when adding a sellable item. Not idempotent: each call creates a distinct product.",idempotent:!1},props:{name:u.ShortText({displayName:"Product Name",description:"The product\u2019s name, meant to be displayable to the customer.",required:!0}),description:u.LongText({displayName:"Description",description:"The product\u2019s description, meant to be displayable to the customer.",required:!1}),active:u.Checkbox({displayName:"Active",description:"Whether the product is currently available for purchase. Defaults to true.",required:!1}),images:u.Array({displayName:"Image URLs",description:"A list of up to 8 URLs of images for this product.",required:!1}),url:u.ShortText({displayName:"Product URL",description:"A publicly-accessible online page for this product.",required:!1}),metadata:u.Json({displayName:"Metadata",description:"A set of key-value pairs to store additional information about the product.",required:!1})},outputSchema:bt,async run(e){let{name:t,description:r,active:n,images:o,url:i,metadata:s}=e.propsValue,l={name:t};return r&&(l.description=r),n!==void 0&&(l.active=n),i&&(l.url=i),o&&Array.isArray(o)&&o.forEach((b,m)=>{l[`images[${m}]`]=b}),s&&typeof s=="object"&&Object.keys(s).forEach(b=>{l[`metadata[${b}]`]=s[b]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/products`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})).body}});var jg=x({name:"create_price",classification:"WRITE",auth:g,displayName:"Create Price",description:"Create a price (one-time or recurring), associated with a product.",audience:"human",aiMetadata:{description:"Creates a price for an existing Stripe product, in either one-time or recurring mode depending on the selected billing interval. Use after creating a product to define what to charge before building a subscription or payment link. Requires the product ID; not idempotent, as each call creates a new price.",idempotent:!1},props:{product:_.product,unit_amount:u.Number({displayName:"Unit Amount",description:"The price amount as a decimal, for example, 25.50 for $25.50.",required:!0}),currency:u.StaticDropdown({displayName:"Currency",description:"The three-letter ISO code for the currency.",required:!0,options:{options:[{label:"US Dollar",value:"usd"},{label:"Euro",value:"eur"},{label:"Pound Sterling",value:"gbp"},{label:"Indian Rupee",value:"inr"},{label:"Australian Dollar",value:"aud"},{label:"Canadian Dollar",value:"cad"},{label:"Swiss Franc",value:"chf"},{label:"Chinese Yuan",value:"cny"},{label:"Japanese Yen",value:"jpy"},{label:"Singapore Dollar",value:"sgd"}]}}),recurring_interval:u.StaticDropdown({displayName:"Billing Interval",description:"Specify the billing frequency. Select 'One-Time' for a single, non-recurring payment.",required:!0,defaultValue:"one_time",options:{options:[{label:"One-Time",value:"one_time"},{label:"Daily",value:"day"},{label:"Weekly",value:"week"},{label:"Monthly",value:"month"},{label:"Yearly",value:"year"}]}}),recurring_interval_count:u.Number({displayName:"Interval Count",description:"The number of intervals between subscription billings (e.g., for billing every 3 months, set Interval to Monthly and Interval Count to 3). Only used for recurring prices.",required:!1})},outputSchema:Pt,async run(e){let{product:t,unit_amount:r,currency:n,recurring_interval:o,recurring_interval_count:i}=e.propsValue,s=Math.round(r*100),l={product:t,unit_amount:s,currency:n};return o!=="one_time"&&(l["recurring[interval]"]=o,i&&(l["recurring[interval_count]"]=i)),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/prices`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})).body}});var Fg=x({name:"create_subscription",classification:"WRITE",auth:g,displayName:"Create Subscription",description:"Start a subscription for a customer with specified items/prices.",audience:"human",aiMetadata:{description:"Starts a recurring subscription for an existing customer against one or more price IDs, with optional collection method, trial period, and default payment method. Use to enroll a customer in recurring billing. Requires a customer ID and at least one price; not idempotent, as each call creates a separate subscription.",idempotent:!1},props:{customer:_.customer,items:u.Array({displayName:"Subscription Items",description:"A list of prices to subscribe the customer to.",required:!0,properties:{price:u.ShortText({displayName:"Price ID",description:"The ID of the price object (e.g., price_...). You can find this in your Stripe Dashboard under Products.",required:!0}),quantity:u.Number({displayName:"Quantity",description:"The number of units of this price to subscribe to. Defaults to 1.",required:!1})}}),collection_method:u.StaticDropdown({displayName:"Collection Method",description:"How to collect payment. 'charge_automatically' will try to bill the default payment method. 'send_invoice' will email an invoice.",required:!1,options:{options:[{label:"Charge Automatically",value:"charge_automatically"},{label:"Send Invoice",value:"send_invoice"}]}}),days_until_due:u.Number({displayName:"Days Until Due",description:"Number of days before an invoice is due. Required if Collection Method is 'Send Invoice'.",required:!1}),trial_period_days:u.Number({displayName:"Trial Period (Days)",description:"Integer representing the number of trial days the customer receives before the subscription bills for the first time.",required:!1}),default_payment_method:u.ShortText({displayName:"Default Payment Method ID",description:"ID of the default payment method for the subscription (e.g., `pm_...`).",required:!1}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:xe,async run(e){let{customer:t,items:r,collection_method:n,days_until_due:o,trial_period_days:i,default_payment_method:s,metadata:l}=e.propsValue,f={customer:t,collection_method:n,days_until_due:o,trial_period_days:i,default_payment_method:s,metadata:l};return Object.keys(f).forEach(m=>{(f[m]===void 0||f[m]===null)&&delete f[m]}),r&&Array.isArray(r)&&r.forEach((m,P)=>{let h=m;f[`items[${P}][price]`]=h.price,h.quantity&&(f[`items[${P}][quantity]`]=h.quantity)}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/subscriptions`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:f})).body}});var Bg=x({name:"cancel_subscription",classification:"DESTRUCTIVE",auth:g,displayName:"Cancel Subscription",description:"Cancel an existing subscription, either immediately or at the end of the current billing period.",audience:"human",aiMetadata:{description:"Cancels an existing Stripe subscription by its ID, in one of two modes: immediately, or scheduled to end at the close of the current billing period. Use to stop recurring billing for a customer. Effectively idempotent: re-running on an already-canceled subscription leaves it canceled.",idempotent:!0},props:{subscription:_.subscription,cancel_at_period_end:u.Checkbox({displayName:"Cancel at Period End",description:"If true, the subscription remains active until the end of the current billing period. If false, it cancels immediately.",required:!1,defaultValue:!1})},outputSchema:xe,async run(e){let{subscription:t,cancel_at_period_end:r}=e.propsValue,n=Ae(e.auth.secret_text);return r?await n.subscriptions.update(t,{cancel_at_period_end:!0}):await n.subscriptions.cancel(t)}});var Gg=x({name:"retrieve_invoice",classification:"READ",auth:g,displayName:"Retrieve an Invoice",description:"Retrieves the details of an existing invoice by its ID.",audience:"human",aiMetadata:{description:"Fetches the full details of a single Stripe invoice by its invoice ID (e.g., in_...). Use when you have the exact invoice ID and need its current status, amounts, or hosted/PDF links. Read-only and idempotent.",idempotent:!0},props:{invoice_id:_.invoice},outputSchema:ge,async run(e){let{invoice_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/invoices/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Vg=x({name:"retrieve_payout",classification:"READ",auth:g,displayName:"Retrieve a Payout",description:"Retrieves the details of an existing payout by its ID.",audience:"human",aiMetadata:{description:"Fetches the full details of a single Stripe payout (funds sent to your bank account) by its payout ID (e.g., po_...). Use to check a payout's status, amount, or arrival date. Read-only and idempotent.",idempotent:!0},props:{payout_id:_.payout},outputSchema:xo,async run(e){let{payout_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payouts/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Hg=x({name:"create_refund",classification:"WRITE",auth:g,displayName:"Create a Refund",description:"Create a full or partial refund for a payment.",audience:"human",aiMetadata:{description:"Issues a refund against a payment identified by its PaymentIntent ID; refunds the full amount by default, or a partial amount if one is given, with an optional reason. Use to return funds to a customer for a captured payment. Not idempotent: each call creates a new refund and moves money again.",idempotent:!1},props:{payment_intent:_.paymentIntent,amount:u.Number({displayName:"Amount",description:"The amount to refund (e.g., 12.99). If left blank, a full refund will be issued.",required:!1}),reason:u.StaticDropdown({displayName:"Reason",description:"An optional reason for the refund.",required:!1,options:{options:[{label:"Duplicate",value:"duplicate"},{label:"Fraudulent",value:"fraudulent"},{label:"Requested by Customer",value:"requested_by_customer"}]}}),metadata:u.Json({displayName:"Metadata",description:"A set of key-value pairs to store additional information about the refund.",required:!1})},outputSchema:xt,async run(e){let{payment_intent:t,amount:r,reason:n,metadata:o}=e.propsValue,i={payment_intent:t};return r!=null&&(i.amount=Math.round(r*100)),n&&(i.reason=n),o&&typeof o=="object"&&Object.keys(o).forEach(l=>{i[`metadata[${l}]`]=o[l]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/refunds`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i})).body}});var Zg=x({name:"create_payment_link",classification:"WRITE",auth:g,displayName:"Create Payment Link",description:"Creates a shareable, Stripe-hosted payment link for one-time purchases or subscriptions.",audience:"human",aiMetadata:{description:"Creates a reusable, Stripe-hosted payment link for the given line items (price IDs and quantities), with optional after-completion redirect, promotion codes, and billing-address collection. Use to generate a shareable checkout URL without building a custom flow. Not idempotent: each call creates a new payment link.",idempotent:!1},props:{line_items:u.Array({displayName:"Line Items",description:"The products and quantities to include in the payment link.",required:!0,properties:{price:u.ShortText({displayName:"Price ID",description:"The ID of the price object (e.g., price_1J2X3Y4Z...). Find this in your Stripe Dashboard under Products.",required:!0}),quantity:u.Number({displayName:"Quantity",required:!0})}}),after_completion_type:u.StaticDropdown({displayName:"After Completion Behavior",description:"Controls the behavior after the purchase is complete. Defaults to showing Stripe's hosted confirmation page.",required:!1,options:{options:[{label:"Show Confirmation Page",value:"hosted_confirmation"},{label:"Redirect to URL",value:"redirect"}]}}),after_completion_redirect_url:u.ShortText({displayName:"Redirect URL",description:'The URL to redirect the customer to after a successful purchase. Only used if the behavior is set to "Redirect to URL".',required:!1}),allow_promotion_codes:u.Checkbox({displayName:"Allow Promotion Codes",description:"Enables the user to enter a promotion code on the Payment Link page.",required:!1}),billing_address_collection:u.StaticDropdown({displayName:"Billing Address Collection",description:"Describes whether Checkout should collect the customer\u2019s billing address.",required:!1,options:{options:[{label:"Auto",value:"auto"},{label:"Required",value:"required"}]}}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:ze,async run(e){let t=Ae(e.auth.secret_text),r=e.propsValue,n={line_items:r.line_items,allow_promotion_codes:r.allow_promotion_codes,billing_address_collection:r.billing_address_collection,metadata:r.metadata};return r.after_completion_type&&(n.after_completion={type:r.after_completion_type},r.after_completion_type==="redirect"&&r.after_completion_redirect_url&&(n.after_completion.redirect={url:r.after_completion_redirect_url})),await t.paymentLinks.create(n)}});var Wg=x({name:"deactivate_payment_link",classification:"DESTRUCTIVE",auth:g,displayName:"Deactivate Payment Link",description:"Disable or deactivate a Payment Link so it can no longer be used.",audience:"human",aiMetadata:{description:"Deactivates an existing Stripe payment link by its ID so it can no longer accept payments. Use to retire a shared checkout URL. Idempotent in effect: re-running on an already-inactive link leaves it inactive.",idempotent:!0},props:{payment_link_id:_.paymentLink},outputSchema:ze,async run(e){let{payment_link_id:t}=e.propsValue;return await Ae(e.auth.secret_text).paymentLinks.update(t,{active:!1})}});var Kg=x({name:"retrieve_payment_intent",classification:"READ",auth:g,displayName:"Find Payment (by Payment Intent ID)",description:"Retrieves the details of a payment by its unique Payment Intent ID.",audience:"human",aiMetadata:{description:"Fetches the full details of a single payment by its PaymentIntent ID (e.g., pi_...). Use when you have the exact ID and need the payment's current status, amount, or associated charge. Read-only and idempotent.",idempotent:!0},props:{payment_intent_id:_.paymentIntent},outputSchema:Ie,async run(e){let{payment_intent_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_intents/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Jg=x({name:"find_invoice",classification:"READ",auth:g,displayName:"Find Invoice",description:"Finds an invoice by its unique ID.",audience:"human",aiMetadata:{description:"Fetches a single Stripe invoice by its unique invoice ID (e.g., in_...). Use when you already have the exact invoice ID and need its current details. Read-only and idempotent.",idempotent:!0},props:{invoice_id:_.invoice},outputSchema:ge,async run(e){let{invoice_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/invoices/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Xg=x({name:"create_customer_ai",classification:"WRITE",auth:g,displayName:"Create Customer (Agent)",description:"Create a customer in Stripe.",audience:"ai",aiMetadata:{description:"Creates a new Stripe customer from an email and name, with optional phone and address. Use when onboarding a new payer before charging, invoicing, or subscribing them; to avoid duplicates, look the customer up first with Search Customers. Not idempotent: each call creates a distinct customer even with identical input.",idempotent:!1},props:{email:u.ShortText({displayName:"Email",required:!0}),name:u.ShortText({displayName:"Name",required:!0}),description:u.LongText({displayName:"Description",required:!1}),phone:u.ShortText({displayName:"Phone",required:!1}),line1:u.ShortText({displayName:"Address Line 1",required:!1}),postal_code:u.ShortText({displayName:"Postal Code",required:!1}),city:u.ShortText({displayName:"City",required:!1}),state:u.ShortText({displayName:"State",required:!1}),country:u.ShortText({displayName:"Country",required:!1})},outputSchema:Re,async run(e){let{email:t,name:r,description:n,phone:o,line1:i,postal_code:s,city:l,state:f,country:b}=e.propsValue,m={email:t,name:r};n&&(m.description=n),o&&(m.phone=o);let P={};return i&&(P.line1=i),s&&(P.postal_code=s),l&&(P.city=l),f&&(P.state=f),b&&(P.country=b),Object.keys(P).forEach(d=>{m[`address[${d}]`]=P[d]}),(await v.sendRequest({method:"POST",url:"https://api.stripe.com/v1/customers",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},body:m})).body}});var Yg=x({name:"get_customer",classification:"READ",auth:g,displayName:"Get Customer (Agent)",description:"Retrieve a Stripe customer by its ID.",audience:"ai",aiMetadata:{description:"Fetches the full details of a single Stripe customer by its customer ID (e.g., cus_...). Use when you already have the exact ID; to look a customer up by email use Search Customers, or List Customers to page through them. Read-only and idempotent.",idempotent:!0},props:{id:u.ShortText({displayName:"Customer ID",description:"The Stripe customer ID (e.g., cus_...). Obtain it from Search Customers or List Customers.",required:!0})},outputSchema:Re,async run(e){let t=e.propsValue.id;return(await v.sendRequest({method:"GET",url:`https://api.stripe.com/v1/customers/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Qg=x({name:"update_customer_ai",classification:"WRITE",auth:g,displayName:"Update Customer (Agent)",description:"Modify an existing Stripe customer.",audience:"ai",aiMetadata:{description:"Updates fields on an existing Stripe customer (email, name, description, phone, address); only the fields you supply change. Use to correct or enrich a customer record identified by its customer ID. Idempotent: repeating the same update yields the same final state.",idempotent:!0},props:{customer:u.ShortText({displayName:"Customer ID",description:"The Stripe customer ID (e.g., cus_...) to update. Obtain it from Search Customers or List Customers.",required:!0}),email:u.ShortText({displayName:"Email",required:!1}),name:u.ShortText({displayName:"Name",required:!1}),description:u.LongText({displayName:"Description",required:!1}),phone:u.ShortText({displayName:"Phone",required:!1}),line1:u.ShortText({displayName:"Address Line 1",required:!1}),postal_code:u.ShortText({displayName:"Postal Code",required:!1}),city:u.ShortText({displayName:"City",required:!1}),state:u.ShortText({displayName:"State",required:!1}),country:u.ShortText({displayName:"Country",required:!1})},outputSchema:Re,async run(e){let{customer:t,...r}=e.propsValue,n={};r.name&&(n.name=r.name),r.email&&(n.email=r.email),r.description&&(n.description=r.description),r.phone&&(n.phone=r.phone);let o={};return r.line1&&(o.line1=r.line1),r.city&&(o.city=r.city),r.state&&(o.state=r.state),r.postal_code&&(o.postal_code=r.postal_code),r.country&&(o.country=r.country),Object.keys(o).forEach(s=>{n[`address[${s}]`]=o[s]}),(await v.sendRequest({method:"POST",url:`https://api.stripe.com/v1/customers/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n})).body}});var ev=x({name:"search_customers",classification:"SEARCH",auth:g,displayName:"Search Customers (Agent)",description:"Search for Stripe customers by email or a raw search query.",audience:"ai",aiMetadata:{description:`Searches Stripe customers using the Stripe Search Query Language. Pass an email to match customers with that exact email, or supply a raw query for richer filters (e.g. "name:'Jane' OR metadata['plan']:'gold'"). Use to find an existing customer before creating/charging one; use Get Customer when you already have the cus_ ID. Read-only and idempotent.`,idempotent:!0},props:{email:u.ShortText({displayName:"Email",description:"Match customers with this exact email. Ignored if a raw Query is provided.",required:!1}),query:u.ShortText({displayName:"Query",description:"A raw Stripe search query (e.g. email:'a@b.com', name:'Jane'). Overrides the Email field when set.",required:!1})},outputSchema:So,async run(e){let{email:t,query:r}=e.propsValue,n=r||(t?`email:'${t}'`:void 0);if(!n)throw new Error("Provide either an Email or a raw Query to search.");let o={query:n};return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/customers/search`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:o})).body}});var tv=x({name:"create_payment_intent_ai",classification:"WRITE",auth:g,displayName:"Create Payment Intent (Agent)",description:"Create a Stripe PaymentIntent to start a payment flow.",audience:"ai",aiMetadata:{description:"Creates a Stripe PaymentIntent for an amount and currency, optionally tied to a customer. Leave it unconfirmed to get a client secret for client-side completion, or set confirm with a payment method ID (and return URL) to charge immediately. Amount is a decimal in the major currency unit (e.g. 10.50 for $10.50). Not idempotent: each call starts a separate payment.",idempotent:!1},props:{amount:u.Number({displayName:"Amount",description:"The amount to charge, as a decimal in the major currency unit (e.g., 10.50 for $10.50).",required:!0}),currency:u.ShortText({displayName:"Currency",description:"The three-letter ISO currency code (e.g., usd, eur, gbp).",required:!0}),customer:u.ShortText({displayName:"Customer ID",description:"The Stripe customer ID (e.g., cus_...) to associate. Obtain it from Search Customers or List Customers.",required:!1}),payment_method:u.ShortText({displayName:"Payment Method ID",description:"The PaymentMethod ID to attach (e.g., pm_...). Required to confirm the payment immediately.",required:!1}),confirm:u.Checkbox({displayName:"Confirm Payment Immediately",description:"If true, Stripe attempts to charge the provided payment method. Requires a Payment Method ID and a Return URL.",required:!1,defaultValue:!1}),capture_method:u.StaticDropdown({displayName:"Capture Method",description:"When to capture funds. 'automatic' (default) captures immediately on confirmation; 'manual' authorizes only \u2014 funds are held and you capture later with Capture Payment Intent (auth-and-capture).",required:!1,options:{options:[{label:"Automatic",value:"automatic"},{label:"Manual (authorize only)",value:"manual"}]}}),return_url:u.ShortText({displayName:"Return URL",description:"URL to redirect the customer back to after authenticating the payment. Required when confirming.",required:!1}),description:u.LongText({displayName:"Description",required:!1}),receipt_email:u.ShortText({displayName:"Receipt Email",description:"Email to send a receipt to. Overrides the customer's email.",required:!1})},outputSchema:Ie,async run(e){let{amount:t,currency:r,customer:n,payment_method:o,confirm:i,return_url:s,description:l,receipt_email:f,capture_method:b}=e.propsValue;if(i&&!o)throw new Error("A Payment Method ID is required when 'Confirm Payment' is set to true.");if(i&&!s)throw new Error("A Return URL is required when 'Confirm Payment' is set to true.");let P={amount:Math.round(t*100),currency:r};return n&&(P.customer=n),o&&(P.payment_method=o),b&&(P.capture_method=b),i&&(P.confirm=i),s&&(P.return_url=s),l&&(P.description=l),f&&(P.receipt_email=f),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_intents`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:P})).body}});var rv=x({name:"get_payment_intent",classification:"READ",auth:g,displayName:"Get Payment Intent (Agent)",description:"Retrieve a payment by its PaymentIntent ID.",audience:"ai",aiMetadata:{description:"Fetches a single payment by its PaymentIntent ID (e.g., pi_...). Use when you have the exact ID and need the current status, amount, or associated charge; use List/Search Payment Intents to discover IDs. Read-only and idempotent.",idempotent:!0},props:{payment_intent_id:u.ShortText({displayName:"Payment Intent ID",description:"The PaymentIntent ID (e.g., pi_...). Obtain it from List Payment Intents or Search Payment Intents.",required:!0})},outputSchema:Ie,async run(e){let{payment_intent_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_intents/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var nv=x({name:"create_refund_ai",classification:"WRITE",auth:g,displayName:"Create Refund (Agent)",description:"Create a full or partial refund for a payment.",audience:"ai",aiMetadata:{description:"Issues a refund against a payment identified by its PaymentIntent ID; refunds the full amount by default, or a partial amount if given, with an optional reason. Amount is in the major currency unit as a decimal. Use to return funds for a captured payment. Not idempotent: each call creates a new refund and moves money again.",idempotent:!1},props:{payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"The PaymentIntent ID (e.g., pi_...) to refund. Obtain it from List/Search Payment Intents.",required:!0}),amount:u.Number({displayName:"Amount",description:"The amount to refund as a decimal (e.g., 12.99). If left blank, a full refund is issued.",required:!1}),reason:u.StaticDropdown({displayName:"Reason",description:"An optional reason for the refund.",required:!1,options:{options:[{label:"Duplicate",value:"duplicate"},{label:"Fraudulent",value:"fraudulent"},{label:"Requested by Customer",value:"requested_by_customer"}]}}),metadata:u.Json({displayName:"Metadata",description:"A set of key-value pairs to store additional information about the refund.",required:!1})},outputSchema:xt,async run(e){let{payment_intent:t,amount:r,reason:n,metadata:o}=e.propsValue,i={payment_intent:t};return r!=null&&(i.amount=Math.round(r*100)),n&&(i.reason=n),o&&typeof o=="object"&&Object.keys(o).forEach(l=>{i[`metadata[${l}]`]=o[l]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/refunds`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i})).body}});var ov=x({name:"create_invoice_ai",classification:"WRITE",auth:g,displayName:"Create Invoice (Agent)",description:"Create a draft invoice in Stripe.",audience:"ai",aiMetadata:{description:"Creates a draft invoice for an existing customer in the given currency. Use to bill a customer for pending invoice items; add lines with Create Invoice Item / Add Invoice Lines, then Finalize Invoice and Send Invoice. Requires a valid customer ID. Not idempotent: each call creates a separate invoice.",idempotent:!1},props:{customer_id:u.ShortText({displayName:"Customer ID",description:"The Stripe customer ID (e.g., cus_...). Obtain it from Search Customers or List Customers.",required:!0}),currency:u.ShortText({displayName:"Currency",description:"The three-letter ISO currency code (e.g., usd).",required:!0}),description:u.LongText({displayName:"Description",description:"Description for the invoice.",required:!1}),collection_method:u.StaticDropdown({displayName:"Collection Method",description:"How to collect payment. 'charge_automatically' (default) charges the customer's default payment method when finalized; 'send_invoice' emails the customer a payable invoice (requires Days Until Due) and is the only method that lets you later call Send Invoice.",required:!1,options:{options:[{label:"Charge automatically",value:"charge_automatically"},{label:"Send invoice (email)",value:"send_invoice"}]}}),days_until_due:u.Number({displayName:"Days Until Due",description:"Number of days until the invoice is due. Required when Collection Method is 'send_invoice'.",required:!1})},outputSchema:ge,async run(e){let{customer_id:t,currency:r,description:n,collection_method:o,days_until_due:i}=e.propsValue;if(o==="send_invoice"&&i==null)throw new Error("days_until_due is required when collection_method is 'send_invoice'.");let s={customer:t,currency:r};return n&&(s.description=n),o&&(s.collection_method=o),o==="send_invoice"&&i!==void 0&&i!==null&&(s.days_until_due=i),(await v.sendRequest({method:"POST",url:"https://api.stripe.com/v1/invoices",headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"},body:s})).body}});var iv=x({name:"get_invoice",classification:"READ",auth:g,displayName:"Get Invoice (Agent)",description:"Retrieve a Stripe invoice by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe invoice by its invoice ID (e.g., in_...). Use when you have the exact ID and need its current status, amounts, lines, or hosted/PDF links; use List/Search Invoices to discover IDs. Read-only and idempotent.",idempotent:!0},props:{invoice_id:u.ShortText({displayName:"Invoice ID",description:"The Stripe invoice ID (e.g., in_...). Obtain it from List Invoices or Search Invoices.",required:!0})},outputSchema:ge,async run(e){let{invoice_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/invoices/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var av=x({name:"create_product_ai",classification:"WRITE",auth:g,displayName:"Create Product (Agent)",description:"Create a new product object in Stripe.",audience:"ai",aiMetadata:{description:"Creates a new Stripe product (the catalog item that prices attach to), with optional description, images, URL, and metadata. Use before creating a price or when adding a sellable item; to archive a product use Update Product with active=false. Not idempotent: each call creates a distinct product.",idempotent:!1},props:{name:u.ShortText({displayName:"Product Name",description:"The product name, displayable to the customer.",required:!0}),description:u.LongText({displayName:"Description",description:"The product description, displayable to the customer.",required:!1}),active:u.Checkbox({displayName:"Active",description:"Whether the product is currently available for purchase. Defaults to true.",required:!1}),images:u.Array({displayName:"Image URLs",description:"A list of up to 8 URLs of images for this product.",required:!1}),url:u.ShortText({displayName:"Product URL",description:"A publicly-accessible online page for this product.",required:!1}),metadata:u.Json({displayName:"Metadata",description:"A set of key-value pairs to store additional information about the product.",required:!1})},outputSchema:bt,async run(e){let{name:t,description:r,active:n,images:o,url:i,metadata:s}=e.propsValue,l={name:t};return r&&(l.description=r),n!==void 0&&(l.active=n),i&&(l.url=i),o&&Array.isArray(o)&&o.forEach((b,m)=>{l[`images[${m}]`]=b}),s&&typeof s=="object"&&Object.keys(s).forEach(b=>{l[`metadata[${b}]`]=s[b]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/products`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})).body}});var sv=x({name:"create_price_ai",classification:"WRITE",auth:g,displayName:"Create Price (Agent)",description:"Create a one-time or recurring price for a product.",audience:"ai",aiMetadata:{description:"Creates a price for an existing Stripe product, one-time or recurring depending on the chosen billing interval. Amount is a decimal in the major currency unit. Use after Create Product to define what to charge before building a subscription or payment link. Requires the product ID. Not idempotent: each call creates a new price.",idempotent:!1},props:{product:u.ShortText({displayName:"Product ID",description:"The Stripe product ID (e.g., prod_...) this price attaches to. Obtain it from List/Search Products or Create Product.",required:!0}),unit_amount:u.Number({displayName:"Unit Amount",description:"The price amount as a decimal (e.g., 25.50 for $25.50).",required:!0}),currency:u.ShortText({displayName:"Currency",description:"The three-letter ISO currency code (e.g., usd).",required:!0}),recurring_interval:u.StaticDropdown({displayName:"Billing Interval",description:"Billing frequency. Select 'One-Time' for a single, non-recurring payment.",required:!0,defaultValue:"one_time",options:{options:[{label:"One-Time",value:"one_time"},{label:"Daily",value:"day"},{label:"Weekly",value:"week"},{label:"Monthly",value:"month"},{label:"Yearly",value:"year"}]}}),recurring_interval_count:u.Number({displayName:"Interval Count",description:"Number of intervals between billings (e.g., Monthly + count 3 = every 3 months). Only used for recurring prices.",required:!1})},outputSchema:Pt,async run(e){let{product:t,unit_amount:r,currency:n,recurring_interval:o,recurring_interval_count:i}=e.propsValue,s=Math.round(r*100),l={product:t,unit_amount:s,currency:n};return o!=="one_time"&&(l["recurring[interval]"]=o,i&&(l["recurring[interval_count]"]=i)),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/prices`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})).body}});var uv=x({name:"create_subscription_ai",classification:"WRITE",auth:g,displayName:"Create Subscription (Agent)",description:"Start a subscription for a customer with specified prices.",audience:"ai",aiMetadata:{description:"Starts a recurring subscription for an existing customer against one or more price IDs, with optional collection method, trial period, and default payment method. Use to enroll a customer in recurring billing. Requires a customer ID and at least one price. Not idempotent: each call creates a separate subscription.",idempotent:!1},props:{customer:u.ShortText({displayName:"Customer ID",description:"The Stripe customer ID (e.g., cus_...). Obtain it from Search Customers or List Customers.",required:!0}),items:u.Array({displayName:"Subscription Items",description:"A list of prices to subscribe the customer to.",required:!0,properties:{price:u.ShortText({displayName:"Price ID",description:"The price ID (e.g., price_...). Obtain it from List/Search Prices.",required:!0}),quantity:u.Number({displayName:"Quantity",description:"Number of units of this price. Defaults to 1.",required:!1})}}),collection_method:u.StaticDropdown({displayName:"Collection Method",description:"'charge_automatically' bills the default payment method; 'send_invoice' emails an invoice.",required:!1,options:{options:[{label:"Charge Automatically",value:"charge_automatically"},{label:"Send Invoice",value:"send_invoice"}]}}),days_until_due:u.Number({displayName:"Days Until Due",description:"Days before an invoice is due. Required if Collection Method is 'Send Invoice'.",required:!1}),trial_period_days:u.Number({displayName:"Trial Period (Days)",description:"Number of trial days before the subscription bills for the first time.",required:!1}),default_payment_method:u.ShortText({displayName:"Default Payment Method ID",description:"ID of the default payment method (e.g., pm_...).",required:!1}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:xe,async run(e){let{customer:t,items:r,collection_method:n,days_until_due:o,trial_period_days:i,default_payment_method:s,metadata:l}=e.propsValue;if(n==="send_invoice"&&o==null)throw new Error("days_until_due is required when collection_method is 'send_invoice'.");let f={customer:t,collection_method:n,days_until_due:o,trial_period_days:i,default_payment_method:s};return Object.keys(f).forEach(m=>{(f[m]===void 0||f[m]===null)&&delete f[m]}),n!=="send_invoice"&&delete f.days_until_due,r&&Array.isArray(r)&&r.forEach((m,P)=>{let h=m;f[`items[${P}][price]`]=h.price,h.quantity&&(f[`items[${P}][quantity]`]=h.quantity)}),l&&typeof l=="object"&&Object.keys(l).forEach(m=>{f[`metadata[${m}]`]=l[m]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/subscriptions`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:f})).body}});var cv=x({name:"cancel_subscription_ai",classification:"DESTRUCTIVE",auth:g,displayName:"Cancel Subscription (Agent)",description:"Cancel a subscription immediately or at the end of the billing period.",audience:"ai",aiMetadata:{description:"Cancels an existing Stripe subscription by its ID, either immediately or scheduled to end at the close of the current billing period (via Cancel at Period End). Use to stop recurring billing. Idempotent: re-running on an already-canceled subscription leaves it canceled.",idempotent:!0},props:{subscription:u.ShortText({displayName:"Subscription ID",description:"The Stripe subscription ID (e.g., sub_...). Obtain it from List/Search Subscriptions.",required:!0}),cancel_at_period_end:u.Checkbox({displayName:"Cancel at Period End",description:"If true, the subscription stays active until the end of the current billing period. If false, it cancels immediately.",required:!1,defaultValue:!1})},outputSchema:xe,async run(e){let{subscription:t,cancel_at_period_end:r}=e.propsValue,n=Ae(e.auth.secret_text);return r?await n.subscriptions.update(t,{cancel_at_period_end:!0}):await n.subscriptions.cancel(t)}});var HI=[{label:"All Statuses",value:""},{label:"Active",value:"active"},{label:"Past Due",value:"past_due"},{label:"Unpaid",value:"unpaid"},{label:"Canceled",value:"canceled"},{label:"Incomplete",value:"incomplete"},{label:"Incomplete Expired",value:"incomplete_expired"},{label:"Trialing",value:"trialing"},{label:"Paused",value:"paused"}],lv=x({name:"search_subscriptions_ai",classification:"SEARCH",auth:g,displayName:"Search Subscriptions (Agent)",description:"Search subscriptions by price ID, status, customer ID and other filters.",audience:"ai",aiMetadata:{description:"Lists and filters Stripe subscriptions by price ID, status, customer ID, and creation date range, optionally expanding full customer details. Use to find subscriptions matching criteria or audit a customer's subscriptions; use Get Subscription when you already have the sub_ ID. Read-only and idempotent.",idempotent:!0},props:{price_ids:u.LongText({displayName:"Price IDs",description:"Comma-separated list of price IDs to filter by (e.g., price_1ABC123, price_2DEF456)",required:!1}),status:u.StaticDropdown({displayName:"Subscription Status",description:"Filter by subscription status",required:!1,options:{options:HI}}),customer_id:u.ShortText({displayName:"Customer ID",description:"Filter by specific customer ID (optional)",required:!1}),created_after:u.DateTime({displayName:"Created After",description:"Filter subscriptions created after this date (YYYY-MM-DD format)",required:!1}),created_before:u.DateTime({displayName:"Created Before",description:"Filter subscriptions created before this date (YYYY-MM-DD format)",required:!1}),limit:u.Number({displayName:"Limit",description:"Maximum number of subscriptions to return (default: 100, set to 0 for all)",required:!1,defaultValue:100}),fetch_all:u.Checkbox({displayName:"Fetch All Results",description:"Fetch all matching subscriptions (ignores limit, may take longer for large datasets)",required:!1,defaultValue:!1}),include_customer_details:u.Checkbox({displayName:"Include Customer Details",description:"Fetch detailed customer information for each subscription",required:!1,defaultValue:!0})},outputSchema:To,async run(e){let{price_ids:t,status:r,customer_id:n,created_after:o,created_before:i,limit:s=100,fetch_all:l=!1,include_customer_details:f=!0}=e.propsValue,b=a(T=>{let A=new URLSearchParams;if(A.append("limit","100"),A.append("expand[]","data.items.data.price"),f&&A.append("expand[]","data.customer"),r&&A.append("status",r),n&&A.append("customer",n),o){let k=Math.floor(new Date(o).getTime()/1e3);A.append("created[gte]",k.toString())}if(i){let k=Math.floor(new Date(i).getTime()/1e3);A.append("created[lte]",k.toString())}return T&&A.append("starting_after",T),A},"buildQueryParams"),m=[],P=!0,h,d=0,y=l?50:Math.ceil(s/100);for(;P&&d<y;){let T=b(h),A=await v.sendRequest({method:"GET",url:`${_.baseUrl}/subscriptions?${T.toString()}`,headers:{Authorization:"Bearer "+e.auth.secret_text,"Content-Type":"application/x-www-form-urlencoded"}});if(!A.body)throw new Error("Failed to fetch subscriptions from Stripe");let k=A.body.data;if(m=m.concat(k),P=A.body.has_more,d++,P&&k.length>0&&(h=k[k.length-1].id),!l&&m.length>=s){m=m.slice(0,s);break}}let I=m;if(t&&t.trim()){let T=t.split(",").map(A=>A.trim()).filter(A=>A.length>0);T.length>0&&(I=I.filter(A=>A.items.data.some(k=>k.price&&typeof k.price=="object"&&T.includes(k.price.id))))}let S=await Promise.all(I.map(async T=>{let A={...T};if(f){if(typeof T.customer=="object"&&T.customer!==null&&!("deleted"in T.customer&&T.customer.deleted))A.customer=T.customer;else if(typeof T.customer=="string")try{let k=await v.sendRequest({method:"GET",url:`${_.baseUrl}/customers/${T.customer}`,headers:{Authorization:"Bearer "+e.auth.secret_text}});A.customer=k.body}catch(k){console.warn(`Failed to fetch customer details for ${T.customer}:`,k)}}return A}));return{success:!0,count:S.length,total_fetched:m.length,requests_made:d,has_more_available:P&&!l,pagination_info:{limit_requested:l?"All":s,fetch_all_enabled:l,max_requests_limit:y},subscriptions:S,filters_applied:{price_ids:t?t.split(",").map(T=>T.trim()).filter(T=>T.length>0):null,status:r||null,customer_id:n||null,created_after:o||null,created_before:i||null,limit:s,fetch_all:l,include_customer_details:f}}}});var pv=x({name:"create_payment_link_ai",classification:"WRITE",auth:g,displayName:"Create Payment Link (Agent)",description:"Create a shareable, Stripe-hosted payment link.",audience:"ai",aiMetadata:{description:"Creates a reusable, Stripe-hosted payment link for the given line items (price IDs and quantities), with optional after-completion redirect, promotion codes, and billing-address collection. Use to generate a shareable checkout URL without building a custom flow; for a richer one-off hosted page use Create Checkout Session. Not idempotent: each call creates a new payment link.",idempotent:!1},props:{line_items:u.Array({displayName:"Line Items",description:"The products and quantities to include in the payment link.",required:!0,properties:{price:u.ShortText({displayName:"Price ID",description:"The price ID (e.g., price_...). Obtain it from List/Search Prices.",required:!0}),quantity:u.Number({displayName:"Quantity",required:!0})}}),after_completion_type:u.StaticDropdown({displayName:"After Completion Behavior",description:"Behavior after purchase completes. Defaults to Stripe's hosted confirmation page.",required:!1,options:{options:[{label:"Show Confirmation Page",value:"hosted_confirmation"},{label:"Redirect to URL",value:"redirect"}]}}),after_completion_redirect_url:u.ShortText({displayName:"Redirect URL",description:'URL to redirect to after a successful purchase. Only used when behavior is "Redirect to URL".',required:!1}),allow_promotion_codes:u.Checkbox({displayName:"Allow Promotion Codes",description:"Allow the customer to enter a promotion code.",required:!1}),billing_address_collection:u.StaticDropdown({displayName:"Billing Address Collection",description:"Whether Checkout collects the customer's billing address.",required:!1,options:{options:[{label:"Auto",value:"auto"},{label:"Required",value:"required"}]}}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:ze,async run(e){let t=Ae(e.auth.secret_text),r=e.propsValue,n={line_items:r.line_items,allow_promotion_codes:r.allow_promotion_codes,billing_address_collection:r.billing_address_collection,metadata:r.metadata};return r.after_completion_type&&(n.after_completion={type:r.after_completion_type},r.after_completion_type==="redirect"&&r.after_completion_redirect_url&&(n.after_completion.redirect={url:r.after_completion_redirect_url})),await t.paymentLinks.create(n)}});var dv=x({name:"deactivate_payment_link_ai",classification:"DESTRUCTIVE",auth:g,displayName:"Deactivate Payment Link (Agent)",description:"Deactivate a payment link so it can no longer be used.",audience:"ai",aiMetadata:{description:"Deactivates an existing Stripe payment link by its ID so it can no longer accept payments (sets active=false). Use to retire a shared checkout URL; use Get/List Payment Links to find the ID. Idempotent: re-running on an already-inactive link leaves it inactive.",idempotent:!0},props:{payment_link_id:u.ShortText({displayName:"Payment Link ID",description:"The payment link ID (e.g., plink_...). Obtain it from List Payment Links.",required:!0})},outputSchema:ze,async run(e){let{payment_link_id:t}=e.propsValue;return await Ae(e.auth.secret_text).paymentLinks.update(t,{active:!1})}});var mv=x({name:"get_payout",classification:"READ",auth:g,displayName:"Get Payout (Agent)",description:"Retrieve a Stripe payout by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe payout (funds sent to your bank account) by its payout ID (e.g., po_...). Use to check a payout's status, amount, or arrival date; use List Payouts to discover IDs. Read-only and idempotent.",idempotent:!0},props:{payout_id:u.ShortText({displayName:"Payout ID",description:"The Stripe payout ID (e.g., po_...). Obtain it from List Payouts.",required:!0})},outputSchema:xo,async run(e){let{payout_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payouts/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var fv=x({name:"list_customers",classification:"SEARCH",auth:g,displayName:"List Customers (Agent)",description:"List Stripe customers, optionally filtered by email.",audience:"ai",aiMetadata:{description:"Pages through Stripe customers, newest first, optionally filtered by an exact email. Use to enumerate customers or resolve a customer ID; for query-language matching use Search Customers, or Get Customer when you have the cus_ ID. Read-only and idempotent.",idempotent:!0},props:{email:u.ShortText({displayName:"Email",description:"Filter to customers with this exact email.",required:!1}),limit:u.Number({displayName:"Limit",description:"Number of customers to return (1-100, default 10).",required:!1}),starting_after:u.ShortText({displayName:"Starting After",description:"A customer ID; returns the page of results after this cursor for pagination.",required:!1})},outputSchema:Dd,async run(e){let{email:t,limit:r,starting_after:n}=e.propsValue,o={};return t&&(o.email=t),r&&(o.limit=r.toString()),n&&(o.starting_after=n),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/customers`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:o})).body}});var hv=x({name:"confirm_payment_intent",classification:"WRITE",auth:g,displayName:"Confirm Payment Intent (Agent)",description:"Confirm a PaymentIntent to attempt the charge.",audience:"ai",aiMetadata:{description:"Confirms a previously-created PaymentIntent to attempt collecting the payment, optionally supplying a payment method and return URL. Use when a PaymentIntent was created unconfirmed and you now want to charge it; Create Payment Intent can also confirm inline. Money-moving and not idempotent.",idempotent:!1},props:{payment_intent_id:u.ShortText({displayName:"Payment Intent ID",description:"The PaymentIntent ID (e.g., pi_...) to confirm. Obtain it from List/Search Payment Intents.",required:!0}),payment_method:u.ShortText({displayName:"Payment Method ID",description:"The PaymentMethod ID to use (e.g., pm_...).",required:!1}),return_url:u.ShortText({displayName:"Return URL",description:"URL to redirect to after authentication. Required for redirect-based payment methods.",required:!1})},outputSchema:Ie,async run(e){let{payment_intent_id:t,payment_method:r,return_url:n}=e.propsValue,o={};return r&&(o.payment_method=r),n&&(o.return_url=n),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_intents/${t}/confirm`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:o})).body}});var yv=x({name:"cancel_payment_intent",classification:"DESTRUCTIVE",auth:g,displayName:"Cancel Payment Intent (Agent)",description:"Cancel a PaymentIntent that has not been captured.",audience:"ai",aiMetadata:{description:"Cancels a PaymentIntent that has not yet been captured (e.g., a manual-capture authorization or an abandoned payment), with an optional cancellation reason. Use to release an authorization or abandon a payment. Idempotent: re-running on an already-canceled PaymentIntent leaves it canceled.",idempotent:!0},props:{payment_intent_id:u.ShortText({displayName:"Payment Intent ID",description:"The PaymentIntent ID (e.g., pi_...) to cancel. Obtain it from List/Search Payment Intents.",required:!0}),cancellation_reason:u.StaticDropdown({displayName:"Cancellation Reason",description:"An optional reason for the cancellation.",required:!1,options:{options:[{label:"Duplicate",value:"duplicate"},{label:"Fraudulent",value:"fraudulent"},{label:"Requested by Customer",value:"requested_by_customer"},{label:"Abandoned",value:"abandoned"}]}})},outputSchema:Ie,async run(e){let{payment_intent_id:t,cancellation_reason:r}=e.propsValue,n={};return r&&(n.cancellation_reason=r),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_intents/${t}/cancel`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n})).body}});var gv=x({name:"capture_payment_intent",classification:"WRITE",auth:g,displayName:"Capture Payment Intent (Agent)",description:"Capture funds from an authorized PaymentIntent.",audience:"ai",aiMetadata:{description:"Captures the funds of a PaymentIntent that was authorized with manual capture (status requires_capture). Optionally capture a partial amount (in the smallest currency unit, e.g. cents) and mark it as the final capture. Use to settle a held authorization. Money-moving and not idempotent.",idempotent:!1},props:{payment_intent_id:u.ShortText({displayName:"Payment Intent ID",description:"The PaymentIntent ID (e.g., pi_...) to capture. Obtain it from List/Search Payment Intents.",required:!0}),amount_to_capture:u.Number({displayName:"Amount to Capture",description:"The amount to capture in the smallest currency unit (e.g., 1050 for $10.50). Defaults to the full authorized amount.",required:!1}),final_capture:u.Checkbox({displayName:"Final Capture",description:"If true, the remaining uncaptured amount is released back to the customer.",required:!1}),metadata:u.Json({displayName:"Metadata",description:"A set of key-value pairs to attach.",required:!1})},outputSchema:Ie,async run(e){let{payment_intent_id:t,amount_to_capture:r,final_capture:n,metadata:o}=e.propsValue,i={};return r!=null&&(i.amount_to_capture=r),n!==void 0&&(i.final_capture=n),o&&typeof o=="object"&&Object.keys(o).forEach(l=>{i[`metadata[${l}]`]=o[l]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_intents/${t}/capture`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i})).body}});var vv=x({name:"list_payment_intents",classification:"SEARCH",auth:g,displayName:"List Payment Intents (Agent)",description:"List Stripe PaymentIntents.",audience:"ai",aiMetadata:{description:"Pages through PaymentIntents, newest first, optionally filtered by customer or a created timestamp range. Use to enumerate payments or resolve a PaymentIntent ID; for query-language matching use Search Payment Intents, or Get Payment Intent when you have the pi_ ID. Read-only and idempotent.",idempotent:!0},props:{customer:u.ShortText({displayName:"Customer ID",description:"Filter to PaymentIntents for this customer (cus_...).",required:!1}),created_after:u.DateTime({displayName:"Created After",description:"Only return PaymentIntents created at or after this time.",required:!1}),created_before:u.DateTime({displayName:"Created Before",description:"Only return PaymentIntents created at or before this time.",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1}),starting_after:u.ShortText({displayName:"Starting After",description:"A PaymentIntent ID cursor for pagination.",required:!1})},outputSchema:Fd,async run(e){let{customer:t,created_after:r,created_before:n,limit:o,starting_after:i}=e.propsValue,s={};return t&&(s.customer=t),o&&(s.limit=o.toString()),i&&(s.starting_after=i),r&&(s["created[gte]"]=Math.floor(new Date(r).getTime()/1e3).toString()),n&&(s["created[lte]"]=Math.floor(new Date(n).getTime()/1e3).toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_intents`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:s})).body}});var _v=x({name:"search_payment_intents",classification:"SEARCH",auth:g,displayName:"Search Payment Intents (Agent)",description:"Search PaymentIntents with a Stripe search query.",audience:"ai",aiMetadata:{description:`Searches PaymentIntents using the Stripe Search Query Language (e.g. "status:'succeeded' AND customer:'cus_...'"). Use for ad-hoc filtered lookups; use List Payment Intents for simple paging or Get Payment Intent when you have the pi_ ID. Read-only and idempotent.`,idempotent:!0},props:{query:u.ShortText({displayName:"Query",description:"A Stripe search query (e.g. status:'succeeded' AND amount>1000).",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:im,async run(e){let{query:t,limit:r}=e.propsValue,n={query:t};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_intents/search`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var bv=x({name:"retrieve_charge",classification:"READ",auth:g,displayName:"Retrieve Charge (Agent)",description:"Retrieve a Stripe charge by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe charge by its charge ID (e.g., ch_...). Charges are the legacy, read-mostly view of a payment; for the modern object use Get Payment Intent. Use List/Search Charges to discover IDs. Read-only and idempotent.",idempotent:!0},props:{charge_id:u.ShortText({displayName:"Charge ID",description:"The Stripe charge ID (e.g., ch_...). Obtain it from List Charges or Search Charges.",required:!0})},outputSchema:ar,async run(e){let{charge_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/charges/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Pv=x({name:"list_charges",classification:"SEARCH",auth:g,displayName:"List Charges (Agent)",description:"List Stripe charges.",audience:"ai",aiMetadata:{description:"Pages through charges, newest first, optionally filtered by customer, PaymentIntent, or a created timestamp range. Use to enumerate charges or resolve a charge ID; for query-language matching use Search Charges. Read-only and idempotent.",idempotent:!0},props:{customer:u.ShortText({displayName:"Customer ID",description:"Filter to charges for this customer (cus_...).",required:!1}),payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"Filter to charges for this PaymentIntent (pi_...).",required:!1}),created_after:u.DateTime({displayName:"Created After",required:!1}),created_before:u.DateTime({displayName:"Created Before",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Bd,async run(e){let{customer:t,payment_intent:r,created_after:n,created_before:o,limit:i}=e.propsValue,s={};return t&&(s.customer=t),r&&(s.payment_intent=r),i&&(s.limit=i.toString()),n&&(s["created[gte]"]=Math.floor(new Date(n).getTime()/1e3).toString()),o&&(s["created[lte]"]=Math.floor(new Date(o).getTime()/1e3).toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/charges`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:s})).body}});var xv=x({name:"search_charges",classification:"SEARCH",auth:g,displayName:"Search Charges (Agent)",description:"Search charges with a Stripe search query.",audience:"ai",aiMetadata:{description:`Searches charges using the Stripe Search Query Language (e.g. "status:'succeeded' AND amount>1000"). Use for ad-hoc filtered lookups; use List Charges for simple paging or Retrieve Charge when you have the ch_ ID. Read-only and idempotent.`,idempotent:!0},props:{query:u.ShortText({displayName:"Query",description:"A Stripe search query (e.g. metadata['order_id']:'6735').",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:nm,async run(e){let{query:t,limit:r}=e.propsValue,n={query:t};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/charges/search`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var Sv=x({name:"get_refund",classification:"READ",auth:g,displayName:"Get Refund (Agent)",description:"Retrieve a Stripe refund by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe refund by its refund ID (e.g., re_...) to check its status and amount. Use List Refunds to discover IDs. Read-only and idempotent.",idempotent:!0},props:{refund_id:u.ShortText({displayName:"Refund ID",description:"The Stripe refund ID (e.g., re_...). Obtain it from List Refunds.",required:!0})},outputSchema:xt,async run(e){let{refund_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/refunds/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Tv=x({name:"list_refunds",classification:"SEARCH",auth:g,displayName:"List Refunds (Agent)",description:"List Stripe refunds.",audience:"ai",aiMetadata:{description:"Pages through refunds, newest first, optionally filtered by PaymentIntent or charge. Use to enumerate refunds for a payment or resolve a refund ID; use Get Refund when you have the re_ ID. Read-only and idempotent.",idempotent:!0},props:{payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"Filter to refunds for this PaymentIntent (pi_...).",required:!1}),charge:u.ShortText({displayName:"Charge ID",description:"Filter to refunds for this charge (ch_...).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Gd,async run(e){let{payment_intent:t,charge:r,limit:n}=e.propsValue,o={};return t&&(o.payment_intent=t),r&&(o.charge=r),n&&(o.limit=n.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/refunds`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:o})).body}});var Ev=x({name:"list_invoices",classification:"SEARCH",auth:g,displayName:"List Invoices (Agent)",description:"List Stripe invoices.",audience:"ai",aiMetadata:{description:"Pages through invoices, newest first, optionally filtered by customer, status, or subscription. Use to enumerate invoices or resolve an invoice ID; for query-language matching use Search Invoices, or Get Invoice when you have the in_ ID. Read-only and idempotent.",idempotent:!0},props:{customer:u.ShortText({displayName:"Customer ID",description:"Filter to invoices for this customer (cus_...).",required:!1}),status:u.StaticDropdown({displayName:"Status",description:"Filter by invoice status.",required:!1,options:{options:[{label:"Draft",value:"draft"},{label:"Open",value:"open"},{label:"Paid",value:"paid"},{label:"Uncollectible",value:"uncollectible"},{label:"Void",value:"void"}]}}),subscription:u.ShortText({displayName:"Subscription ID",description:"Filter to invoices for this subscription (sub_...).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Vd,async run(e){let{customer:t,status:r,subscription:n,limit:o}=e.propsValue,i={};return t&&(i.customer=t),r&&(i.status=r),n&&(i.subscription=n),o&&(i.limit=o.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/invoices`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:i})).body}});var Iv=x({name:"search_invoices",classification:"SEARCH",auth:g,displayName:"Search Invoices (Agent)",description:"Search invoices with a Stripe search query.",audience:"ai",aiMetadata:{description:`Searches invoices using the Stripe Search Query Language (e.g. "status:'open' AND customer:'cus_...'"). Use for ad-hoc filtered lookups; use List Invoices for simple paging or Get Invoice when you have the in_ ID. Read-only and idempotent.`,idempotent:!0},props:{query:u.ShortText({displayName:"Query",description:"A Stripe search query (e.g. total>1000 AND status:'paid').",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:om,async run(e){let{query:t,limit:r}=e.propsValue,n={query:t};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/invoices/search`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var Av=x({name:"finalize_invoice",classification:"WRITE",auth:g,displayName:"Finalize Invoice (Agent)",description:"Finalize a draft invoice so it becomes payable.",audience:"ai",aiMetadata:{description:"Finalizes a draft Stripe invoice, locking its line items and making it payable. Use after adding all line items and before Send Invoice. Not idempotent: it errors if the invoice is already finalized.",idempotent:!1},props:{invoice_id:u.ShortText({displayName:"Invoice ID",description:"The draft invoice ID (e.g., in_...). Obtain it from List/Search Invoices.",required:!0}),auto_advance:u.Checkbox({displayName:"Auto Advance",description:"If true, Stripe automatically collects the invoice (sends/charges per its settings) after finalizing.",required:!1})},outputSchema:ge,async run(e){let{invoice_id:t,auto_advance:r}=e.propsValue,n={};return r!==void 0&&(n.auto_advance=r),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/invoices/${t}/finalize`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n})).body}});var wv=x({name:"send_invoice",classification:"WRITE",auth:g,displayName:"Send Invoice (Agent)",description:"Email a finalized invoice to the customer.",audience:"ai",aiMetadata:{description:"Emails a finalized Stripe invoice to the customer. The invoice must already be finalized (use Finalize Invoice first). Not idempotent: each call sends the invoice email again.",idempotent:!1},props:{invoice_id:u.ShortText({displayName:"Invoice ID",description:"The finalized invoice ID (e.g., in_...). Obtain it from List/Search Invoices.",required:!0})},outputSchema:ge,async run(e){let{invoice_id:t}=e.propsValue;return(await v.sendRequest({method:"POST",url:`${_.baseUrl}/invoices/${t}/send`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{}})).body}});var kv=x({name:"add_invoice_lines",classification:"WRITE",auth:g,displayName:"Add Invoice Lines (Agent)",description:"Bulk-add line items to a draft invoice.",audience:"ai",aiMetadata:{description:"Adds one or more line items to a draft Stripe invoice in a single call. Each line supplies either a price ID or an ad-hoc amount (smallest currency unit) plus currency, with an optional description and quantity. Use to populate a draft before Finalize Invoice. Not idempotent: each call appends new lines.",idempotent:!1},props:{invoice_id:u.ShortText({displayName:"Invoice ID",description:"The draft invoice ID (e.g., in_...). Obtain it from List/Search Invoices.",required:!0}),lines:u.Array({displayName:"Lines",description:"The line items to add to the invoice.",required:!0,properties:{description:u.ShortText({displayName:"Description",required:!1}),amount:u.Number({displayName:"Amount",description:"Ad-hoc amount in the smallest currency unit (e.g., 1050 for $10.50), in the invoice's currency. Provide either an Amount or a Price ID (not both).",required:!1}),price:u.ShortText({displayName:"Price ID",description:"A price ID (e.g., price_...) instead of an ad-hoc amount.",required:!1}),quantity:u.Number({displayName:"Quantity",required:!1})}})},outputSchema:ge,async run(e){let{invoice_id:t,lines:r}=e.propsValue;if(!r||!Array.isArray(r)||r.length===0)throw new Error("Provide at least one line item to add.");let n={};return r.forEach((i,s)=>{i.description!==void 0&&i.description!==null&&i.description!==""&&(n[`lines[${s}][description]`]=i.description),i.price?(n[`lines[${s}][pricing][price]`]=i.price,i.quantity!==void 0&&i.quantity!==null&&(n[`lines[${s}][quantity]`]=i.quantity)):i.amount!==void 0&&i.amount!==null&&(n[`lines[${s}][amount]`]=i.amount)}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/invoices/${t}/add_lines`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n})).body}});var Rv=x({name:"list_invoice_lines",classification:"SEARCH",auth:g,displayName:"List Invoice Lines (Agent)",description:"List the line items on an invoice.",audience:"ai",aiMetadata:{description:"Pages through the line items of a single Stripe invoice. Use when you need only the lines; the lines are also returned inline by Get Invoice. Read-only and idempotent.",idempotent:!0},props:{invoice_id:u.ShortText({displayName:"Invoice ID",description:"The invoice ID (e.g., in_...). Obtain it from List/Search Invoices.",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Hd,async run(e){let{invoice_id:t,limit:r}=e.propsValue,n={};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/invoices/${t}/lines`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var Ov=x({name:"create_invoice_item",classification:"WRITE",auth:g,displayName:"Create Invoice Item (Agent)",description:"Add a one-off pending line item to a customer.",audience:"ai",aiMetadata:{description:"Creates a pending invoice item for a customer that attaches to their next invoice, or to a specific invoice if one is given. Amount is in the smallest currency unit (e.g. cents) \u2014 pass a raw integer, not a decimal. Use to add ad-hoc charges before invoicing. Not idempotent: each call creates a new item.",idempotent:!1},props:{customer:u.ShortText({displayName:"Customer ID",description:"The Stripe customer ID (e.g., cus_...). Obtain it from Search/List Customers.",required:!0}),amount:u.Number({displayName:"Amount",description:"The amount in the smallest currency unit (e.g., 1050 for $10.50). Raw integer, not a decimal.",required:!0}),currency:u.ShortText({displayName:"Currency",description:"The three-letter ISO currency code (e.g., usd).",required:!0}),description:u.LongText({displayName:"Description",required:!1}),invoice:u.ShortText({displayName:"Invoice ID",description:"Attach to this specific draft invoice (in_...) instead of the next upcoming one.",required:!1}),price:u.ShortText({displayName:"Price ID",description:"Use a price ID (price_...) instead of an ad-hoc amount. If set, leave Amount/Currency blank.",required:!1})},outputSchema:Cd,async run(e){let{customer:t,amount:r,currency:n,description:o,invoice:i,price:s}=e.propsValue,l={customer:t};return s?l.price=s:(l.amount=r,l.currency=n),o&&(l.description=o),i&&(l.invoice=i),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/invoiceitems`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})).body}});var Cv=x({name:"update_product",classification:"WRITE",auth:g,displayName:"Update Product (Agent)",description:"Update or archive a Stripe product.",audience:"ai",aiMetadata:{description:'Updates a Stripe product (rename, change description/metadata, or set active=false to archive it). Archiving is the agent path to "delete" a product, since products with prices cannot be hard-deleted. Only the fields you supply change. Idempotent: re-applying the same update converges.',idempotent:!0},props:{product_id:u.ShortText({displayName:"Product ID",description:"The product ID (e.g., prod_...). Obtain it from List/Search Products.",required:!0}),name:u.ShortText({displayName:"Name",required:!1}),description:u.LongText({displayName:"Description",required:!1}),active:u.Checkbox({displayName:"Active",description:"Set to false to archive the product.",required:!1}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:bt,async run(e){let{product_id:t,name:r,description:n,active:o,metadata:i}=e.propsValue,s={};return r&&(s.name=r),n&&(s.description=n),o!==void 0&&(s.active=o),i&&typeof i=="object"&&Object.keys(i).forEach(f=>{s[`metadata[${f}]`]=i[f]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/products/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})).body}});var $v=x({name:"get_product",classification:"READ",auth:g,displayName:"Get Product (Agent)",description:"Retrieve a Stripe product by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe product by its product ID (e.g., prod_...). Use List/Search Products to discover IDs. Read-only and idempotent.",idempotent:!0},props:{product_id:u.ShortText({displayName:"Product ID",description:"The product ID (e.g., prod_...). Obtain it from List/Search Products.",required:!0})},outputSchema:bt,async run(e){let{product_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/products/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Nv=x({name:"list_products",classification:"SEARCH",auth:g,displayName:"List Products (Agent)",description:"List Stripe products.",audience:"ai",aiMetadata:{description:"Pages through products, newest first, optionally filtered by active status. Use to enumerate the catalog or resolve a product ID; for name matching use Search Products, or Get Product when you have the prod_ ID. Read-only and idempotent.",idempotent:!0},props:{active:u.StaticDropdown({displayName:"Active",description:"Filter by active state.",required:!1,options:{options:[{label:"Active only",value:"true"},{label:"Inactive only",value:"false"}]}}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:zd,async run(e){let{active:t,limit:r}=e.propsValue,n={};return t&&(n.active=t),r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/products`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var Dv=x({name:"search_products",classification:"SEARCH",auth:g,displayName:"Search Products (Agent)",description:"Search products with a Stripe search query.",audience:"ai",aiMetadata:{description:`Searches products using the Stripe Search Query Language (e.g. "active:'true' AND name~'shirt'"). Use for name/metadata matching; use List Products for simple paging or Get Product when you have the prod_ ID. Read-only and idempotent.`,idempotent:!0},props:{query:u.ShortText({displayName:"Query",description:"A Stripe search query (e.g. name~'shirt').",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:sm,async run(e){let{query:t,limit:r}=e.propsValue,n={query:t};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/products/search`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var zv=x({name:"update_price",classification:"WRITE",auth:g,displayName:"Update Price (Agent)",description:"Update or archive a Stripe price.",audience:"ai",aiMetadata:{description:"Updates a Stripe price (set active=false to archive it, or edit its nickname/metadata). The unit amount is immutable \u2014 create a new price to change it. Only the fields you supply change. Idempotent: re-applying the same update converges.",idempotent:!0},props:{price_id:u.ShortText({displayName:"Price ID",description:"The price ID (e.g., price_...). Obtain it from List/Search Prices.",required:!0}),active:u.Checkbox({displayName:"Active",description:"Set to false to archive the price.",required:!1}),nickname:u.ShortText({displayName:"Nickname",required:!1}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:Pt,async run(e){let{price_id:t,active:r,nickname:n,metadata:o}=e.propsValue,i={};return r!==void 0&&(i.active=r),n&&(i.nickname=n),o&&typeof o=="object"&&Object.keys(o).forEach(l=>{i[`metadata[${l}]`]=o[l]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/prices/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i})).body}});var Mv=x({name:"get_price",classification:"READ",auth:g,displayName:"Get Price (Agent)",description:"Retrieve a Stripe price by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe price by its price ID (e.g., price_...). Use List/Search Prices to discover IDs. Read-only and idempotent.",idempotent:!0},props:{price_id:u.ShortText({displayName:"Price ID",description:"The price ID (e.g., price_...). Obtain it from List/Search Prices.",required:!0})},outputSchema:Pt,async run(e){let{price_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/prices/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Uv=x({name:"list_prices",classification:"SEARCH",auth:g,displayName:"List Prices (Agent)",description:"List Stripe prices.",audience:"ai",aiMetadata:{description:"Pages through prices, newest first, optionally filtered by product, active state, type (one_time/recurring), or currency. Use to enumerate prices or resolve a price ID; for query matching use Search Prices, or Get Price when you have the price_ ID. Read-only and idempotent.",idempotent:!0},props:{product:u.ShortText({displayName:"Product ID",description:"Filter to prices for this product (prod_...).",required:!1}),active:u.StaticDropdown({displayName:"Active",required:!1,options:{options:[{label:"Active only",value:"true"},{label:"Inactive only",value:"false"}]}}),type:u.StaticDropdown({displayName:"Type",required:!1,options:{options:[{label:"One-time",value:"one_time"},{label:"Recurring",value:"recurring"}]}}),currency:u.ShortText({displayName:"Currency",description:"Three-letter ISO currency code (e.g., usd).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Md,async run(e){let{product:t,active:r,type:n,currency:o,limit:i}=e.propsValue,s={};return t&&(s.product=t),r&&(s.active=r),n&&(s.type=n),o&&(s.currency=o),i&&(s.limit=i.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/prices`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:s})).body}});var Lv=x({name:"search_prices",classification:"SEARCH",auth:g,displayName:"Search Prices (Agent)",description:"Search prices with a Stripe search query.",audience:"ai",aiMetadata:{description:`Searches prices using the Stripe Search Query Language (e.g. "active:'true' AND currency:'usd'"). Use for metadata/attribute matching; use List Prices for simple paging or Get Price when you have the price_ ID. Read-only and idempotent.`,idempotent:!0},props:{query:u.ShortText({displayName:"Query",description:"A Stripe search query (e.g. lookup_key:'standard_monthly').",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:am,async run(e){let{query:t,limit:r}=e.propsValue,n={query:t};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/prices/search`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var qv=x({name:"update_subscription",classification:"WRITE",auth:g,displayName:"Update Subscription (Agent)",description:"Update an existing Stripe subscription.",audience:"ai",aiMetadata:{description:"Updates an existing subscription: change its items (price + quantity), proration behavior, metadata, or schedule cancellation at period end. To cancel outright use Cancel Subscription. Only the fields you supply change. Idempotent: re-applying the same update converges.",idempotent:!0},props:{subscription_id:u.ShortText({displayName:"Subscription ID",description:"The subscription ID (e.g., sub_...). Obtain it from List/Search Subscriptions.",required:!0}),items:u.Array({displayName:"Items",description:"New/updated items. To modify an existing item include its subscription-item id; to add one supply a price.",required:!1,properties:{id:u.ShortText({displayName:"Subscription Item ID",description:"Existing item id (si_...) to update. Obtain it from List Subscription Items.",required:!1}),price:u.ShortText({displayName:"Price ID",required:!1}),quantity:u.Number({displayName:"Quantity",required:!1})}}),proration_behavior:u.StaticDropdown({displayName:"Proration Behavior",required:!1,options:{options:[{label:"Create Prorations",value:"create_prorations"},{label:"None",value:"none"},{label:"Always Invoice",value:"always_invoice"}]}}),cancel_at_period_end:u.Checkbox({displayName:"Cancel at Period End",required:!1}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:xe,async run(e){let{subscription_id:t,items:r,proration_behavior:n,cancel_at_period_end:o,metadata:i}=e.propsValue,s={};return n&&(s.proration_behavior=n),o!==void 0&&(s.cancel_at_period_end=o),i&&typeof i=="object"&&Object.keys(i).forEach(f=>{s[`metadata[${f}]`]=i[f]}),r&&Array.isArray(r)&&r.forEach((f,b)=>{let m=f;m.id&&(s[`items[${b}][id]`]=m.id),m.price&&(s[`items[${b}][price]`]=m.price),m.quantity!==void 0&&m.quantity!==null&&(s[`items[${b}][quantity]`]=m.quantity)}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/subscriptions/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})).body}});var jv=x({name:"get_subscription",classification:"READ",auth:g,displayName:"Get Subscription (Agent)",description:"Retrieve a Stripe subscription by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe subscription by its subscription ID (e.g., sub_...). Use List/Search Subscriptions to discover IDs. Read-only and idempotent.",idempotent:!0},props:{subscription_id:u.ShortText({displayName:"Subscription ID",description:"The subscription ID (e.g., sub_...). Obtain it from List/Search Subscriptions.",required:!0})},outputSchema:xe,async run(e){let{subscription_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/subscriptions/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Fv=x({name:"list_subscriptions",classification:"SEARCH",auth:g,displayName:"List Subscriptions (Agent)",description:"List Stripe subscriptions.",audience:"ai",aiMetadata:{description:"Pages through subscriptions, newest first, optionally filtered by customer, status, or price. Use to enumerate or audit a customer's subscriptions; for rich filters/customer-hydration use Search Subscriptions, or Get Subscription when you have the sub_ ID. Read-only and idempotent.",idempotent:!0},props:{customer:u.ShortText({displayName:"Customer ID",description:"Filter to subscriptions for this customer (cus_...).",required:!1}),status:u.StaticDropdown({displayName:"Status",required:!1,options:{options:[{label:"All",value:"all"},{label:"Active",value:"active"},{label:"Past Due",value:"past_due"},{label:"Unpaid",value:"unpaid"},{label:"Canceled",value:"canceled"},{label:"Incomplete",value:"incomplete"},{label:"Incomplete Expired",value:"incomplete_expired"},{label:"Trialing",value:"trialing"},{label:"Paused",value:"paused"}]}}),price:u.ShortText({displayName:"Price ID",description:"Filter to subscriptions containing this price (price_...).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Zd,async run(e){let{customer:t,status:r,price:n,limit:o}=e.propsValue,i={};return t&&(i.customer=t),r&&(i.status=r),n&&(i.price=n),o&&(i.limit=o.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/subscriptions`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:i})).body}});var Bv=x({name:"list_subscription_items",classification:"SEARCH",auth:g,displayName:"List Subscription Items (Agent)",description:"List the line items of a subscription.",audience:"ai",aiMetadata:{description:"Pages through the items of a single subscription, returning the subscription-item IDs (si_...) needed to update quantity or report usage. Use before Update Subscription when modifying a specific item. Read-only and idempotent.",idempotent:!0},props:{subscription_id:u.ShortText({displayName:"Subscription ID",description:"The subscription ID (e.g., sub_...). Obtain it from List/Search Subscriptions.",required:!0}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Wd,async run(e){let{subscription_id:t,limit:r}=e.propsValue,n={subscription:t};return r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/subscription_items`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var Gv=x({name:"get_payment_link",classification:"READ",auth:g,displayName:"Get Payment Link (Agent)",description:"Retrieve a Stripe payment link by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe payment link by its ID (e.g., plink_...), including its URL, active state, and line items. Use List Payment Links to discover IDs. Read-only and idempotent.",idempotent:!0},props:{payment_link_id:u.ShortText({displayName:"Payment Link ID",description:"The payment link ID (e.g., plink_...). Obtain it from List Payment Links.",required:!0})},outputSchema:ze,async run(e){let{payment_link_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_links/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Vv=x({name:"list_payment_links",classification:"SEARCH",auth:g,displayName:"List Payment Links (Agent)",description:"List Stripe payment links.",audience:"ai",aiMetadata:{description:"Pages through payment links, optionally filtered by active state. Use to enumerate links or resolve a payment link ID; use Get Payment Link when you have the plink_ ID. Read-only and idempotent.",idempotent:!0},props:{active:u.StaticDropdown({displayName:"Active",required:!1,options:{options:[{label:"Active only",value:"true"},{label:"Inactive only",value:"false"}]}}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Jd,async run(e){let{active:t,limit:r}=e.propsValue,n={};return t&&(n.active=t),r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_links`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var Hv=x({name:"create_checkout_session",classification:"WRITE",auth:g,displayName:"Create Checkout Session (Agent)",description:"Create a Stripe-hosted Checkout Session.",audience:"ai",aiMetadata:{description:"Creates a Stripe-hosted Checkout Session for one-time payment, subscription, or setup mode, with line items (price IDs + quantities) and success/cancel URLs. Richer than a payment link for one-off flows; for a reusable shareable URL use Create Payment Link. Not idempotent: each call creates a new session.",idempotent:!1},props:{mode:u.StaticDropdown({displayName:"Mode",description:"The Checkout mode.",required:!0,options:{options:[{label:"Payment (one-time)",value:"payment"},{label:"Subscription",value:"subscription"},{label:"Setup (save payment method)",value:"setup"}]}}),line_items:u.Array({displayName:"Line Items",description:"The prices and quantities. Required for payment and subscription modes.",required:!1,properties:{price:u.ShortText({displayName:"Price ID",description:"The price ID (e.g., price_...).",required:!0}),quantity:u.Number({displayName:"Quantity",required:!0})}}),success_url:u.ShortText({displayName:"Success URL",description:"URL to redirect to after successful payment.",required:!1}),cancel_url:u.ShortText({displayName:"Cancel URL",description:"URL to redirect to if the customer cancels.",required:!1}),customer:u.ShortText({displayName:"Customer ID",description:"An existing customer (cus_...) to associate with the session.",required:!1})},outputSchema:ur,async run(e){let{mode:t,line_items:r,success_url:n,cancel_url:o,customer:i}=e.propsValue,s={mode:t};return n&&(s.success_url=n),o&&(s.cancel_url=o),i&&(s.customer=i),r&&Array.isArray(r)&&r.forEach((f,b)=>{let m=f;s[`line_items[${b}][price]`]=m.price,s[`line_items[${b}][quantity]`]=m.quantity}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/checkout/sessions`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})).body}});var Zv=x({name:"get_checkout_session",classification:"READ",auth:g,displayName:"Get Checkout Session (Agent)",description:"Retrieve a Stripe Checkout Session by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Checkout Session by its ID (e.g., cs_...), including payment status, customer, and amounts. Use List Checkout Sessions to discover IDs. Read-only and idempotent.",idempotent:!0},props:{session_id:u.ShortText({displayName:"Session ID",description:"The Checkout Session ID (e.g., cs_...). Obtain it from List Checkout Sessions.",required:!0})},outputSchema:ur,async run(e){let{session_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/checkout/sessions/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Wv=x({name:"list_checkout_sessions",classification:"SEARCH",auth:g,displayName:"List Checkout Sessions (Agent)",description:"List Stripe Checkout Sessions.",audience:"ai",aiMetadata:{description:"Pages through Checkout Sessions, newest first, optionally filtered by customer, PaymentIntent, or status. Use to enumerate sessions or resolve a session ID; use Get Checkout Session when you have the cs_ ID. Read-only and idempotent.",idempotent:!0},props:{customer:u.ShortText({displayName:"Customer ID",description:"Filter to sessions for this customer (cus_...).",required:!1}),payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"Filter to the session for this PaymentIntent (pi_...).",required:!1}),status:u.StaticDropdown({displayName:"Status",required:!1,options:{options:[{label:"Open",value:"open"},{label:"Complete",value:"complete"},{label:"Expired",value:"expired"}]}}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Xd,async run(e){let{customer:t,payment_intent:r,status:n,limit:o}=e.propsValue,i={};return t&&(i.customer=t),r&&(i.payment_intent=r),n&&(i.status=n),o&&(i.limit=o.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/checkout/sessions`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:i})).body}});var Kv=x({name:"create_payment_method",classification:"WRITE",auth:g,displayName:"Create Payment Method (Agent)",description:"Create a PaymentMethod from a token.",audience:"ai",aiMetadata:{description:"Creates a Stripe PaymentMethod of the given type from a single-use token (e.g. tok_visa, or a token produced by Stripe.js), with optional billing details. NEVER pass raw card numbers \u2014 raw PAN entry is restricted to PCI-compliant integrations; supply a token instead. Use before Attach Payment Method. Not idempotent: each call creates a new PaymentMethod.",idempotent:!1},props:{type:u.ShortText({displayName:"Type",description:"The PaymentMethod type (e.g., card).",required:!0}),token:u.ShortText({displayName:"Card Token",description:"A single-use card token (e.g., tok_visa or a Stripe.js token). Required for card type. Do NOT pass a raw card number.",required:!1}),billing_name:u.ShortText({displayName:"Billing Name",required:!1}),billing_email:u.ShortText({displayName:"Billing Email",required:!1})},outputSchema:ir,async run(e){let{type:t,token:r,billing_name:n,billing_email:o}=e.propsValue,i={type:t};return r&&(i["card[token]"]=r),n&&(i["billing_details[name]"]=n),o&&(i["billing_details[email]"]=o),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_methods`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i})).body}});var Jv=x({name:"attach_payment_method",classification:"WRITE",auth:g,displayName:"Attach Payment Method (Agent)",description:"Attach a PaymentMethod to a customer.",audience:"ai",aiMetadata:{description:"Attaches a PaymentMethod to a customer so it can be charged off-session (e.g. for subscriptions or saved cards). Use after Create Payment Method. Idempotent: re-attaching the same PaymentMethod to the same customer is a no-op.",idempotent:!0},props:{payment_method_id:u.ShortText({displayName:"Payment Method ID",description:"The PaymentMethod ID (e.g., pm_...) to attach. Obtain it from Create Payment Method or List Customer Payment Methods.",required:!0}),customer:u.ShortText({displayName:"Customer ID",description:"The customer ID (e.g., cus_...) to attach the PaymentMethod to.",required:!0})},outputSchema:ir,async run(e){let{payment_method_id:t,customer:r}=e.propsValue;return(await v.sendRequest({method:"POST",url:`${_.baseUrl}/payment_methods/${t}/attach`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{customer:r}})).body}});var Xv=x({name:"get_payment_method",classification:"READ",auth:g,displayName:"Get Payment Method (Agent)",description:"Retrieve a PaymentMethod by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single PaymentMethod by its ID (e.g., pm_...), including type and (masked) card details. Use List Customer Payment Methods to discover a customer's PaymentMethod IDs. Read-only and idempotent.",idempotent:!0},props:{payment_method_id:u.ShortText({displayName:"Payment Method ID",description:"The PaymentMethod ID (e.g., pm_...). Obtain it from List Customer Payment Methods.",required:!0})},outputSchema:ir,async run(e){let{payment_method_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payment_methods/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var Yv=x({name:"list_customer_payment_methods",classification:"SEARCH",auth:g,displayName:"List Customer Payment Methods (Agent)",description:"List a customer's attached payment methods.",audience:"ai",aiMetadata:{description:"Pages through the PaymentMethods attached to a customer, returning the pm_ IDs you can charge off-session. Use to find a customer's saved card before creating a payment. Read-only and idempotent.",idempotent:!0},props:{customer_id:u.ShortText({displayName:"Customer ID",description:"The customer ID (e.g., cus_...). Obtain it from Search/List Customers.",required:!0}),type:u.ShortText({displayName:"Type",description:"Filter by PaymentMethod type (e.g., card).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:jd,async run(e){let{customer_id:t,type:r,limit:n}=e.propsValue,o={};return r&&(o.type=r),n&&(o.limit=n.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/customers/${t}/payment_methods`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:o})).body}});var Qv=x({name:"create_coupon",classification:"WRITE",auth:g,displayName:"Create Coupon (Agent)",description:"Create a discount coupon.",audience:"ai",aiMetadata:{description:"Creates a discount coupon \u2014 either percent_off or amount_off (the latter requires a currency), with a duration of once, repeating (with duration_in_months), or forever. To expose it to customers wrap it in a Promotion Code. Not idempotent: each call creates a new coupon, and supplying a duplicate stable id returns a 409.",idempotent:!1},props:{percent_off:u.Number({displayName:"Percent Off",description:"Percentage discount (e.g., 25 for 25%). Use this OR Amount Off.",required:!1}),amount_off:u.Number({displayName:"Amount Off",description:"Flat discount in the smallest currency unit (e.g., 500 for $5.00). Requires Currency.",required:!1}),currency:u.ShortText({displayName:"Currency",description:"Three-letter ISO currency code. Required with Amount Off.",required:!1}),duration:u.StaticDropdown({displayName:"Duration",description:"How long the discount applies.",required:!0,options:{options:[{label:"Once",value:"once"},{label:"Repeating",value:"repeating"},{label:"Forever",value:"forever"}]}}),duration_in_months:u.Number({displayName:"Duration in Months",description:"Number of months the discount lasts. Required if duration is repeating.",required:!1}),name:u.ShortText({displayName:"Name",description:"Name shown to customers on invoices/receipts.",required:!1}),id:u.ShortText({displayName:"ID",description:"A custom unique coupon ID. If omitted, Stripe generates one. Reusing an existing id returns an error.",required:!1})},outputSchema:_o,async run(e){let{percent_off:t,amount_off:r,currency:n,duration:o,duration_in_months:i,name:s,id:l}=e.propsValue,f={duration:o};return t!=null&&(f.percent_off=t),r!=null&&(f.amount_off=r),n&&(f.currency=n),i!=null&&(f.duration_in_months=i),s&&(f.name=s),l&&(f.id=l),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/coupons`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:f})).body}});var e_=x({name:"get_coupon",classification:"READ",auth:g,displayName:"Get Coupon (Agent)",description:"Retrieve a coupon by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single coupon by its ID. Use List Coupons to discover IDs. Read-only and idempotent.",idempotent:!0},props:{coupon_id:u.ShortText({displayName:"Coupon ID",description:"The coupon ID. Obtain it from List Coupons.",required:!0})},outputSchema:_o,async run(e){let{coupon_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/coupons/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var t_=x({name:"list_coupons",classification:"SEARCH",auth:g,displayName:"List Coupons (Agent)",description:"List Stripe coupons.",audience:"ai",aiMetadata:{description:"Pages through coupons, newest first. Use to enumerate coupons or resolve a coupon ID; use Get Coupon when you have the ID. Read-only and idempotent.",idempotent:!0},props:{limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Ud,async run(e){let{limit:t}=e.propsValue,r={};return t&&(r.limit=t.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/coupons`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:r})).body}});var r_=x({name:"create_promotion_code",classification:"WRITE",auth:g,displayName:"Create Promotion Code (Agent)",description:"Create a customer-facing promotion code for a coupon.",audience:"ai",aiMetadata:{description:"Creates a customer-facing promotion code that maps to an existing coupon, with optional custom code string, customer restriction, max redemptions, and expiry. Create the coupon first with Create Coupon. Not idempotent: each call creates a new promotion code.",idempotent:!1},props:{coupon:u.ShortText({displayName:"Coupon ID",description:"The coupon ID this promotion code applies. Obtain it from List Coupons or Create Coupon.",required:!0}),code:u.ShortText({displayName:"Code",description:"The customer-facing code (e.g., SUMMER25). If omitted, Stripe generates one.",required:!1}),customer:u.ShortText({displayName:"Customer ID",description:"Restrict the code to this customer (cus_...).",required:!1}),max_redemptions:u.Number({displayName:"Max Redemptions",description:"Maximum number of times the code can be redeemed.",required:!1}),expires_at:u.DateTime({displayName:"Expires At",description:"When the promotion code expires.",required:!1}),active:u.Checkbox({displayName:"Active",required:!1})},outputSchema:bo,async run(e){let{coupon:t,code:r,customer:n,max_redemptions:o,expires_at:i,active:s}=e.propsValue,l={coupon:t};return r&&(l.code=r),n&&(l.customer=n),o!=null&&(l.max_redemptions=o),i&&(l.expires_at=Math.floor(new Date(i).getTime()/1e3)),s!==void 0&&(l.active=s),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/promotion_codes`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded","Stripe-Version":"2025-05-28.basil"},body:l})).body}});var n_=x({name:"get_promotion_code",classification:"READ",auth:g,displayName:"Get Promotion Code (Agent)",description:"Retrieve a promotion code by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single promotion code by its ID (e.g., promo_...). Use List Promotion Codes to discover IDs. Read-only and idempotent.",idempotent:!0},props:{promotion_code_id:u.ShortText({displayName:"Promotion Code ID",description:"The promotion code ID (e.g., promo_...). Obtain it from List Promotion Codes.",required:!0})},outputSchema:bo,async run(e){let{promotion_code_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/promotion_codes/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var o_=x({name:"list_promotion_codes",classification:"SEARCH",auth:g,displayName:"List Promotion Codes (Agent)",description:"List Stripe promotion codes.",audience:"ai",aiMetadata:{description:"Pages through promotion codes, optionally filtered by coupon, active state, or the literal code string. Use to enumerate codes or resolve an ID; use Get Promotion Code when you have the promo_ ID. Read-only and idempotent.",idempotent:!0},props:{coupon:u.ShortText({displayName:"Coupon ID",description:"Filter to codes for this coupon.",required:!1}),active:u.StaticDropdown({displayName:"Active",required:!1,options:{options:[{label:"Active only",value:"true"},{label:"Inactive only",value:"false"}]}}),code:u.ShortText({displayName:"Code",description:"Filter to the literal code string (e.g., SUMMER25).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Ld,async run(e){let{coupon:t,active:r,code:n,limit:o}=e.propsValue,i={};return t&&(i.coupon=t),r&&(i.active=r),n&&(i.code=n),o&&(i.limit=o.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/promotion_codes`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:i})).body}});var i_=x({name:"retrieve_balance",classification:"READ",auth:g,displayName:"Retrieve Balance (Agent)",description:"Get the current Stripe account balance.",audience:"ai",aiMetadata:{description:"Fetches the current Stripe account balance, broken down into available and pending funds by currency. Use to check how much can be paid out. Read-only and idempotent; takes no parameters.",idempotent:!0},props:{},outputSchema:Nd,async run(e){return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/balance`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var a_=x({name:"list_balance_transactions",classification:"SEARCH",auth:g,displayName:"List Balance Transactions (Agent)",description:"List balance transactions (the reconciliation ledger).",audience:"ai",aiMetadata:{description:"Pages through the balance-transaction ledger \u2014 every item that affected the account balance (charges, refunds, fees, payouts), newest first. Optionally filter by type, payout, or created range. Use to reconcile activity to a payout. Read-only and idempotent.",idempotent:!0},props:{type:u.ShortText({displayName:"Type",description:"Filter by transaction type (e.g., charge, refund, payout).",required:!1}),payout:u.ShortText({displayName:"Payout ID",description:"Filter to transactions paid out in this payout (po_...).",required:!1}),created_after:u.DateTime({displayName:"Created After",required:!1}),created_before:u.DateTime({displayName:"Created Before",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:rm,async run(e){let{type:t,payout:r,created_after:n,created_before:o,limit:i}=e.propsValue,s={};return t&&(s.type=t),r&&(s.payout=r),i&&(s.limit=i.toString()),n&&(s["created[gte]"]=Math.floor(new Date(n).getTime()/1e3).toString()),o&&(s["created[lte]"]=Math.floor(new Date(o).getTime()/1e3).toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/balance_transactions`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:s})).body}});var s_=x({name:"list_payouts",classification:"SEARCH",auth:g,displayName:"List Payouts (Agent)",description:"List payouts to the bank account.",audience:"ai",aiMetadata:{description:"Pages through payouts (funds sent to your bank account), newest first, optionally filtered by status or arrival date. Use to enumerate payouts or resolve a payout ID; use Get Payout when you have the po_ ID. Read-only and idempotent.",idempotent:!0},props:{status:u.StaticDropdown({displayName:"Status",required:!1,options:{options:[{label:"Pending",value:"pending"},{label:"In Transit",value:"in_transit"},{label:"Paid",value:"paid"},{label:"Failed",value:"failed"},{label:"Canceled",value:"canceled"}]}}),arrival_date_after:u.DateTime({displayName:"Arrival Date After",required:!1}),arrival_date_before:u.DateTime({displayName:"Arrival Date Before",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Qd,async run(e){let{status:t,arrival_date_after:r,arrival_date_before:n,limit:o}=e.propsValue,i={};return t&&(i.status=t),o&&(i.limit=o.toString()),r&&(i["arrival_date[gte]"]=Math.floor(new Date(r).getTime()/1e3).toString()),n&&(i["arrival_date[lte]"]=Math.floor(new Date(n).getTime()/1e3).toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/payouts`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:i})).body}});var u_=x({name:"create_tax_rate",classification:"WRITE",auth:g,displayName:"Create Tax Rate (Agent)",description:"Create a manual tax rate.",audience:"ai",aiMetadata:{description:"Creates a manual Stripe tax rate (a fixed percentage with a display name and inclusive/exclusive flag), for applying to invoices or subscriptions. This is the manual tax-rate object, not Stripe Tax automation. Not idempotent: each call creates a new tax rate.",idempotent:!1},props:{display_name:u.ShortText({displayName:"Display Name",description:"Name shown to customers (e.g., VAT).",required:!0}),percentage:u.Number({displayName:"Percentage",description:"The tax rate percentage (e.g., 20 for 20%).",required:!0}),inclusive:u.Checkbox({displayName:"Inclusive",description:"Whether the tax is included in the price.",required:!0}),jurisdiction:u.ShortText({displayName:"Jurisdiction",description:"Optional jurisdiction text (e.g., UK).",required:!1}),country:u.ShortText({displayName:"Country",description:"Two-letter ISO country code.",required:!1})},outputSchema:Po,async run(e){let{display_name:t,percentage:r,inclusive:n,jurisdiction:o,country:i}=e.propsValue,s={display_name:t,percentage:r,inclusive:n};return o&&(s.jurisdiction=o),i&&(s.country=i),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/tax_rates`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})).body}});var c_=x({name:"get_tax_rate",classification:"READ",auth:g,displayName:"Get Tax Rate (Agent)",description:"Retrieve a tax rate by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single tax rate by its ID (e.g., txr_...). Use List Tax Rates to discover IDs. Read-only and idempotent.",idempotent:!0},props:{tax_rate_id:u.ShortText({displayName:"Tax Rate ID",description:"The tax rate ID (e.g., txr_...). Obtain it from List Tax Rates.",required:!0})},outputSchema:Po,async run(e){let{tax_rate_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/tax_rates/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var l_=x({name:"list_tax_rates",classification:"SEARCH",auth:g,displayName:"List Tax Rates (Agent)",description:"List Stripe tax rates.",audience:"ai",aiMetadata:{description:"Pages through tax rates, optionally filtered by active or inclusive flags. Use to enumerate tax rates or resolve a tax rate ID; use Get Tax Rate when you have the txr_ ID. Read-only and idempotent.",idempotent:!0},props:{active:u.StaticDropdown({displayName:"Active",required:!1,options:{options:[{label:"Active only",value:"true"},{label:"Inactive only",value:"false"}]}}),inclusive:u.StaticDropdown({displayName:"Inclusive",required:!1,options:{options:[{label:"Inclusive only",value:"true"},{label:"Exclusive only",value:"false"}]}}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:qd,async run(e){let{active:t,inclusive:r,limit:n}=e.propsValue,o={};return t&&(o.active=t),r&&(o.inclusive=r),n&&(o.limit=n.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/tax_rates`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:o})).body}});var p_=x({name:"create_credit_note",classification:"WRITE",auth:g,displayName:"Create Credit Note (Agent)",description:"Issue a credit note against a finalized invoice.",audience:"ai",aiMetadata:{description:"Issues a credit note against a finalized invoice \u2014 a post-payment adjustment (credit, refund, or out-of-band amount). Supply either a total credit_amount or itemized lines (in the smallest currency unit). The invoice must already be finalized. Not idempotent: each call creates a new credit note.",idempotent:!1},props:{invoice:u.ShortText({displayName:"Invoice ID",description:"The finalized invoice ID (e.g., in_...) to credit. Obtain it from List/Search Invoices.",required:!0}),amount:u.Number({displayName:"Amount",description:"Total amount of the credit note, in the smallest currency unit (e.g., 500 for $5.00). Stripe requires this (or itemized lines); it must not exceed the invoice total. By default the full amount credits the customer balance unless you also set Credit Amount / Refund Amount to split it.",required:!0}),credit_amount:u.Number({displayName:"Credit Amount",description:"The amount to credit to the customer balance, in the smallest currency unit (e.g., 500 for $5.00).",required:!1}),refund_amount:u.Number({displayName:"Refund Amount",description:"The amount to refund, in the smallest currency unit. Refunds against the original payment.",required:!1}),reason:u.StaticDropdown({displayName:"Reason",required:!1,options:{options:[{label:"Duplicate",value:"duplicate"},{label:"Fraudulent",value:"fraudulent"},{label:"Order Change",value:"order_change"},{label:"Product Unsatisfactory",value:"product_unsatisfactory"}]}}),memo:u.LongText({displayName:"Memo",required:!1})},outputSchema:sr,async run(e){let{invoice:t,amount:r,credit_amount:n,refund_amount:o,reason:i,memo:s}=e.propsValue,l={invoice:t};return r!=null&&(l.amount=r),n!=null&&(l.credit_amount=n),o!=null&&(l.refund_amount=o),i&&(l.reason=i),s&&(l.memo=s),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/credit_notes`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})).body}});var d_=x({name:"void_credit_note",classification:"DESTRUCTIVE",auth:g,displayName:"Void Credit Note (Agent)",description:"Void a credit note.",audience:"ai",aiMetadata:{description:"Voids a Stripe credit note, reversing the credit/refund it represented. Not idempotent: it errors if the credit note is already void.",idempotent:!1},props:{credit_note_id:u.ShortText({displayName:"Credit Note ID",description:"The credit note ID (e.g., cn_...). Obtain it from List Credit Notes.",required:!0})},outputSchema:sr,async run(e){let{credit_note_id:t}=e.propsValue;return(await v.sendRequest({method:"POST",url:`${_.baseUrl}/credit_notes/${t}/void`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{}})).body}});var m_=x({name:"get_credit_note",classification:"READ",auth:g,displayName:"Get Credit Note (Agent)",description:"Retrieve a credit note by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single credit note by its ID (e.g., cn_...), including its line items. Use List Credit Notes to discover IDs. Read-only and idempotent.",idempotent:!0},props:{credit_note_id:u.ShortText({displayName:"Credit Note ID",description:"The credit note ID (e.g., cn_...). Obtain it from List Credit Notes.",required:!0})},outputSchema:sr,async run(e){let{credit_note_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/credit_notes/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var f_=x({name:"list_credit_notes",classification:"SEARCH",auth:g,displayName:"List Credit Notes (Agent)",description:"List Stripe credit notes.",audience:"ai",aiMetadata:{description:"Pages through credit notes, newest first, optionally filtered by invoice or customer. Use to enumerate credit notes or resolve a credit note ID; use Get Credit Note when you have the cn_ ID. Read-only and idempotent.",idempotent:!0},props:{invoice:u.ShortText({displayName:"Invoice ID",description:"Filter to credit notes for this invoice (in_...).",required:!1}),customer:u.ShortText({displayName:"Customer ID",description:"Filter to credit notes for this customer (cus_...).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Kd,async run(e){let{invoice:t,customer:r,limit:n}=e.propsValue,o={};return t&&(o.invoice=t),r&&(o.customer=r),n&&(o.limit=n.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/credit_notes`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:o})).body}});var h_=x({name:"list_events",classification:"SEARCH",auth:g,displayName:"List Events (Agent)",description:"List Stripe account events.",audience:"ai",aiMetadata:{description:"Pages through the account event log (the audit feed of everything that happened), newest first, optionally filtered by event type (e.g. invoice.paid) or created range. Use to investigate what happened to a resource. Read-only and idempotent.",idempotent:!0},props:{type:u.ShortText({displayName:"Type",description:"Filter by event type (e.g., invoice.paid, charge.refunded).",required:!1}),created_after:u.DateTime({displayName:"Created After",required:!1}),created_before:u.DateTime({displayName:"Created Before",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:tm,async run(e){let{type:t,created_after:r,created_before:n,limit:o}=e.propsValue,i={};return t&&(i.type=t),o&&(i.limit=o.toString()),r&&(i["created[gte]"]=Math.floor(new Date(r).getTime()/1e3).toString()),n&&(i["created[lte]"]=Math.floor(new Date(n).getTime()/1e3).toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/events`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:i})).body}});var y_=x({name:"get_event",classification:"READ",auth:g,displayName:"Get Event (Agent)",description:"Retrieve a single Stripe event by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe event by its ID (e.g., evt_...), including the object snapshot it carried. Use List Events or a webhook payload to obtain the ID. Read-only and idempotent.",idempotent:!0},props:{event_id:u.ShortText({displayName:"Event ID",description:"The event ID (e.g., evt_...). Obtain it from List Events or a webhook payload.",required:!0})},outputSchema:$d,async run(e){let{event_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/events/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var g_=x({name:"get_dispute",classification:"READ",auth:g,displayName:"Get Dispute (Agent)",description:"Retrieve a dispute by its ID.",audience:"ai",aiMetadata:{description:"Fetches a single Stripe dispute (chargeback) by its ID (e.g., dp_...), including its status, reason, and evidence due date. Use List Disputes to discover IDs. Read-only and idempotent.",idempotent:!0},props:{dispute_id:u.ShortText({displayName:"Dispute ID",description:"The dispute ID (e.g., dp_...). Obtain it from List Disputes.",required:!0})},outputSchema:St,async run(e){let{dispute_id:t}=e.propsValue;return(await v.sendRequest({method:"GET",url:`${_.baseUrl}/disputes/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})).body}});var v_=x({name:"list_disputes",classification:"SEARCH",auth:g,displayName:"List Disputes (Agent)",description:"List Stripe disputes (chargebacks).",audience:"ai",aiMetadata:{description:"Pages through disputes (chargebacks), newest first, optionally filtered by charge, PaymentIntent, or created range. Use to enumerate disputes or resolve a dispute ID; use Get Dispute when you have the dp_ ID. Read-only and idempotent.",idempotent:!0},props:{charge:u.ShortText({displayName:"Charge ID",description:"Filter to disputes for this charge (ch_...).",required:!1}),payment_intent:u.ShortText({displayName:"Payment Intent ID",description:"Filter to disputes for this PaymentIntent (pi_...).",required:!1}),created_after:u.DateTime({displayName:"Created After",required:!1}),created_before:u.DateTime({displayName:"Created Before",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:Yd,async run(e){let{charge:t,payment_intent:r,created_after:n,created_before:o,limit:i}=e.propsValue,s={};return t&&(s.charge=t),r&&(s.payment_intent=r),i&&(s.limit=i.toString()),n&&(s["created[gte]"]=Math.floor(new Date(n).getTime()/1e3).toString()),o&&(s["created[lte]"]=Math.floor(new Date(o).getTime()/1e3).toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/disputes`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:s})).body}});var __=x({name:"list_transfers",classification:"SEARCH",auth:g,displayName:"List Transfers (Agent)",description:"List transfers to connected accounts (Stripe Connect).",audience:"ai",aiMetadata:{description:"Pages through transfers to connected accounts, newest first, optionally filtered by destination. Stripe Connect platforms only \u2014 on a standard (non-Connect) account this returns an empty list, which is expected, not an error. Read-only and idempotent.",idempotent:!0},props:{destination:u.ShortText({displayName:"Destination Account ID",description:"Filter to transfers to this connected account (acct_...).",required:!1}),limit:u.Number({displayName:"Limit",description:"Number to return (1-100, default 10).",required:!1})},outputSchema:em,async run(e){let{destination:t,limit:r}=e.propsValue,n={};return t&&(n.destination=t),r&&(n.limit=r.toString()),(await v.sendRequest({method:"GET",url:`${_.baseUrl}/transfers`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:n})).body}});var b_=x({name:"update_dispute",classification:"WRITE",auth:g,displayName:"Update Dispute (Agent)",description:"Submit or update evidence on a dispute.",audience:"ai",aiMetadata:{description:"Submits or updates evidence and metadata on a Stripe dispute (chargeback) to contest it. Set submit=true to finalize and submit the evidence to the bank \u2014 once submitted, evidence can no longer be changed. Prefer this (contest with evidence) over Close Dispute (which concedes). Idempotent for metadata/evidence edits; submitting is a one-way action.",idempotent:!0},props:{dispute_id:u.ShortText({displayName:"Dispute ID",description:"The dispute ID (e.g., dp_...). Obtain it from List Disputes.",required:!0}),evidence:u.Json({displayName:"Evidence",description:'A Stripe dispute evidence object (e.g., {"product_description":"...","customer_name":"..."}).',required:!1}),submit:u.Checkbox({displayName:"Submit",description:"If true, finalizes and submits the evidence to the bank. This cannot be undone.",required:!1}),metadata:u.Json({displayName:"Metadata",required:!1})},outputSchema:St,async run(e){let{dispute_id:t,evidence:r,submit:n,metadata:o}=e.propsValue,i={};return n!==void 0&&(i.submit=n),r&&typeof r=="object"&&Object.keys(r).forEach(l=>{i[`evidence[${l}]`]=r[l]}),o&&typeof o=="object"&&Object.keys(o).forEach(l=>{i[`metadata[${l}]`]=o[l]}),(await v.sendRequest({method:"POST",url:`${_.baseUrl}/disputes/${t}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i})).body}});var P_=x({name:"close_dispute",classification:"DESTRUCTIVE",auth:g,displayName:"Close Dispute (Agent)",description:"Concede a dispute (DESTRUCTIVE \u2014 forfeits the funds).",audience:"ai",aiMetadata:{description:"DESTRUCTIVE AND IRREVERSIBLE: closing a dispute concedes the chargeback and permanently forfeits the disputed funds \u2014 the money is lost and cannot be recovered. Almost always prefer Update Dispute (submit evidence to contest) instead. Only use when you explicitly intend to give up the dispute. Not idempotent.",idempotent:!1},props:{dispute_id:u.ShortText({displayName:"Dispute ID",description:"The dispute ID (e.g., dp_...) to concede. Obtain it from List Disputes.",required:!0})},outputSchema:St,async run(e){let{dispute_id:t}=e.propsValue;return(await v.sendRequest({method:"POST",url:`${_.baseUrl}/disputes/${t}/close`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{}})).body}});var g=ua.SecretText({displayName:"Secret API Key",required:!0,description:"Secret key acquired from your Stripe dashboard",validate:a(async({auth:e})=>{try{return await v.sendRequest({method:"GET",url:"https://api.stripe.com/v1/customers",headers:{Authorization:`Bearer ${e}`}}),{valid:!0}}catch{return{valid:!1,error:"Invalid API Key. Please check the key and try again."}}},"validate")}),ZI=el({displayName:"Stripe",description:"Online payment processing for internet businesses",minimumSupportedRelease:"0.86.4",logoUrl:"https://cdn.activepieces.com/pieces/stripe.png",authors:["lldiegon","doskyft","kishanprmr","MoShizzle","AbdulTheActivePiecer","khaledmashaly","abuaboud","Prabhukiran161","sanket-a11y"],categories:["COMMERCE","PAYMENT_PROCESSING"],auth:g,actions:[um,cm,Sg,wg,lm,Ug,Lg,qg,jg,Fg,Bg,Gg,Vg,Hg,Zg,Wg,Kg,Jg,Xg,Yg,Qg,ev,tv,rv,nv,ov,iv,av,sv,uv,cv,lv,pv,dv,mv,fv,hv,yv,gv,vv,_v,bv,Pv,xv,Sv,Tv,Ev,Iv,Av,wv,kv,Rv,Ov,Cv,$v,Nv,Dv,zv,Mv,Uv,Lv,qv,jv,Fv,Bv,Gv,Vv,Hv,Zv,Wv,Kv,Jv,Xv,Yv,Qv,e_,t_,r_,n_,o_,i_,a_,s_,u_,c_,l_,p_,d_,m_,f_,h_,y_,g_,v_,__,b_,P_,yd({baseUrl:a(()=>"https://api.stripe.com/v1","baseUrl"),auth:g,authMapping:a(async e=>({Authorization:`Bearer ${e.secret_text}`}),"authMapping")})],triggers:[Eg,Tg,Ag,Ig,kg,Rg,Og,Cg,$g,Ng,Dg,zg,Mg]});0&&(module.exports={stripe,stripeAuth});
17
17
  /*! Bundled license information:
18
18
 
19
19
  mime-types/index.js: