@activepieces/piece-resend 0.4.3 → 0.4.4

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 +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/piece-resend",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "main": "./src/index.js",
5
5
  "dependencies": {},
6
6
  "files": [
package/src/index.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";var su=Object.create;var Qe=Object.defineProperty;var uu=Object.getOwnPropertyDescriptor;var cu=Object.getOwnPropertyNames;var lu=Object.getPrototypeOf,pu=Object.prototype.hasOwnProperty;var o=(e,t)=>Qe(e,"name",{value:t,configurable:!0});var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gn=(e,t)=>{for(var r in t)Qe(e,r,{get:t[r],enumerable:!0})},yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cu(t))!pu.call(e,i)&&i!==r&&Qe(e,i,{get:()=>t[i],enumerable:!(n=uu(t,i))||n.enumerable});return e};var Oe=(e,t,r)=>(r=e!=null?su(lu(e)):{},yn(t||!e||!e.__esModule?Qe(r,"default",{value:e,enumerable:!0}):r,e)),du=e=>yn(Qe({},"__esModule",{value:!0}),e);var No=$((Ro,Ft)=>{(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"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(p.zoneIndex)||[])[0],P,F;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(F=d-g,P=":";F--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=function(){let ie=s.split(":"),ce=[];for(let Ye=0;Ye<ie.length;Ye++)ce.push(parseInt(ie[Ye],16));return ce}(),{parts:d,zoneId:v}}o(f,"expandIPv6");function h(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=g-m,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;m-=g,v+=1}return!0}o(h,"matchCIDR");function _(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(_,"parseIntAuto");function I(s,d){for(;s.length<d;)s=`0${s}`;return s}o(I,"padPart");let x={};x.IPv4=function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,F;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(F=m[P],g&&F!==0)return null;F!==8&&(g=!0),d+=F}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s}(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return function(){let v=d.slice(1,6),P=[];for(let F=0;F<v.length;F++)g=v[F],P.push(_(g));return P}();if(d=s.match(r.longValue)){if(m=_(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v}().reverse()}else return(d=s.match(r.twoOctet))?function(){let v=d.slice(1,4),P=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P}():(d=s.match(r.threeOctet))?function(){let v=d.slice(1,5),P=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(_(v[1])),P.push(m>>8&255),P.push(m&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=function(){function s(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={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},v,P;for(let F=7;F>=0;F-=1)if(v=this.parts[F],v in m){if(P=m[v],g&&P!==0)return null;P!==16&&(g=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(I(this.parts[v].toString(16),4));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new x.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,P;for(;P=d.exec(g);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch(F){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${F})`)}},x.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let d,g,m,v,P,F;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return f(s,8);if((m=s.match(p.transitional))&&(F=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+F,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<P.length;g++)if(v=P[g],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,g){let m,v,P,F;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(F=P[m],s.kind()===F[0].kind()&&s.match.apply(s,F))return v}return g},typeof Ft<"u"&&Ft.exports?Ft.exports=x:e.ipaddr=x})(Ro)});var Oi=$((_A,ki)=>{var zi=require("stream").Stream,Bl=require("util");ki.exports=de;function de(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(de,"DelayedStream");Bl.inherits(de,zi);de.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(de.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});de.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};de.prototype.resume=function(){this._released||this.release(),this.source.resume()};de.prototype.pause=function(){this.source.pause()};de.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};de.prototype.pipe=function(){var e=zi.prototype.pipe.apply(this,arguments);return this.resume(),e};de.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)};de.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 Di=$((bA,Ni)=>{var Fl=require("util"),Ri=require("stream").Stream,wi=Oi();Ni.exports=Y;function Y(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(Y,"CombinedStream");Fl.inherits(Y,Ri);Y.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};Y.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};Y.prototype.append=function(e){var t=Y.isStreamLike(e);if(t){if(!(e instanceof wi)){var r=wi.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};Y.prototype.pipe=function(e,t){return Ri.prototype.pipe.call(this,e,t),this.resume(),e};Y.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}};Y.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=Y.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};Y.prototype._pipeNext=function(e){this._currentStream=e;var t=Y.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()};Y.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};Y.prototype.write=function(e){this.emit("data",e)};Y.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};Y.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")};Y.prototype.end=function(){this._reset(),this.emit("end")};Y.prototype.destroy=function(){this._reset(),this.emit("close")};Y.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};Y.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};Y.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)};Y.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ui=$((EA,Ci)=>{"use strict";Ci.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 Li=$(oe=>{"use strict";var Wt=Ui(),Zl=require("path").extname,Mi=/^\s*([^;\s]*)(?:;|\s|$)/,Vl=/^text\//i;oe.charset=ji;oe.charsets={lookup:ji};oe.contentType=Hl;oe.extension=ql;oe.extensions=Object.create(null);oe.lookup=Wl;oe.types=Object.create(null);Gl(oe.extensions,oe.types);function ji(e){if(!e||typeof e!="string")return!1;var t=Mi.exec(e),r=t&&Wt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Vl.test(t[1])?"UTF-8":!1}o(ji,"charset");function Hl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?oe.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=oe.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Hl,"contentType");function ql(e){if(!e||typeof e!="string")return!1;var t=Mi.exec(e),r=t&&oe.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(ql,"extension");function Wl(e){if(!e||typeof e!="string")return!1;var t=Zl("x."+e).toLowerCase().substr(1);return t&&oe.types[t]||!1}o(Wl,"lookup");function Gl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Wt).forEach(o(function(i){var u=Wt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var f=c[p];if(t[f]){var h=r.indexOf(Wt[t[f]].source),_=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(h>_||h===_&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Gl,"populateMaps")});var Fi=$((SA,Bi)=>{Bi.exports=Kl;function Kl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Kl,"defer")});var Zr=$((zA,Vi)=>{var Zi=Fi();Vi.exports=Jl;function Jl(e){var t=!1;return Zi(function(){t=!0}),o(function(n,i){t?e(n,i):Zi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Jl,"async")});var Vr=$((OA,Hi)=>{Hi.exports=Xl;function Xl(e){Object.keys(e.jobs).forEach(Yl.bind(e)),e.jobs={}}o(Xl,"abort");function Yl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Yl,"clean")});var Hr=$((RA,Wi)=>{var qi=Zr(),Ql=Vr();Wi.exports=ep;function ep(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=tp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Ql(r):r.results[i]=c,n(u,r.results))})}o(ep,"iterate");function tp(e,t,r,n){var i;return e.length==2?i=e(r,qi(n)):i=e(r,t,qi(n)),i}o(tp,"runJob")});var qr=$((DA,Gi)=>{Gi.exports=rp;function rp(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(i,u){return t(e[i],e[u])}),n}o(rp,"state")});var Wr=$((UA,Ki)=>{var np=Vr(),op=Zr();Ki.exports=ip;function ip(e){Object.keys(this.jobs).length&&(this.index=this.size,np(this),op(e)(null,this.results))}o(ip,"terminator")});var Xi=$((jA,Ji)=>{var ap=Hr(),sp=qr(),up=Wr();Ji.exports=cp;function cp(e,t,r){for(var n=sp(e);n.index<(n.keyedList||e).length;)ap(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return up.bind(n,r)}o(cp,"parallel")});var Gr=$((BA,Gt)=>{var Yi=Hr(),lp=qr(),pp=Wr();Gt.exports=dp;Gt.exports.ascending=Qi;Gt.exports.descending=mp;function dp(e,t,r,n){var i=lp(e,r);return Yi(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){Yi(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),pp.bind(i,n)}o(dp,"serialOrdered");function Qi(e,t){return e<t?-1:e>t?1:0}o(Qi,"ascending");function mp(e,t){return-1*Qi(e,t)}o(mp,"descending")});var ta=$((ZA,ea)=>{var fp=Gr();ea.exports=gp;function gp(e,t,r){return fp(e,t,null,r)}o(gp,"serial")});var na=$((HA,ra)=>{ra.exports={parallel:Xi(),serial:ta(),serialOrdered:Gr()}});var Kr=$((qA,oa)=>{"use strict";oa.exports=Object});var aa=$((WA,ia)=>{"use strict";ia.exports=Error});var ua=$((GA,sa)=>{"use strict";sa.exports=EvalError});var la=$((KA,ca)=>{"use strict";ca.exports=RangeError});var da=$((JA,pa)=>{"use strict";pa.exports=ReferenceError});var fa=$((XA,ma)=>{"use strict";ma.exports=SyntaxError});var Kt=$((YA,ga)=>{"use strict";ga.exports=TypeError});var ha=$((QA,ya)=>{"use strict";ya.exports=URIError});var xa=$((ez,va)=>{"use strict";va.exports=Math.abs});var Pa=$((tz,_a)=>{"use strict";_a.exports=Math.floor});var Ta=$((rz,ba)=>{"use strict";ba.exports=Math.max});var Ia=$((nz,Ea)=>{"use strict";Ea.exports=Math.min});var Sa=$((oz,$a)=>{"use strict";$a.exports=Math.pow});var za=$((iz,Aa)=>{"use strict";Aa.exports=Math.round});var Oa=$((az,ka)=>{"use strict";ka.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ra=$((uz,wa)=>{"use strict";var yp=Oa();wa.exports=o(function(t){return yp(t)||t===0?t:t<0?-1:1},"sign")});var Da=$((lz,Na)=>{"use strict";Na.exports=Object.getOwnPropertyDescriptor});var Jr=$((pz,Ca)=>{"use strict";var Jt=Da();if(Jt)try{Jt([],"length")}catch{Jt=null}Ca.exports=Jt});var Ma=$((dz,Ua)=>{"use strict";var Xt=Object.defineProperty||!1;if(Xt)try{Xt({},"a",{value:1})}catch{Xt=!1}Ua.exports=Xt});var Xr=$((mz,ja)=>{"use strict";ja.exports=o(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 i=42;t[r]=i;for(var u 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 c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var Fa=$((gz,Ba)=>{"use strict";var La=typeof Symbol<"u"&&Symbol,hp=Xr();Ba.exports=o(function(){return typeof La!="function"||typeof Symbol!="function"||typeof La("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hp()},"hasNativeSymbols")});var Yr=$((hz,Za)=>{"use strict";Za.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Qr=$((vz,Va)=>{"use strict";var vp=Kr();Va.exports=vp.getPrototypeOf||null});var Wa=$((xz,qa)=>{"use strict";var xp="Function.prototype.bind called on incompatible ",_p=Object.prototype.toString,Pp=Math.max,bp="[object Function]",Ha=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Tp=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),Ep=o(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");qa.exports=o(function(t){var r=this;if(typeof r!="function"||_p.apply(r)!==bp)throw new TypeError(xp+r);for(var n=Tp(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,Ha(n,arguments));return Object(_)===_?_:this}return r.apply(t,Ha(n,arguments))},"binder"),c=Pp(0,r.length-n.length),p=[],f=0;f<c;f++)p[f]="$"+f;if(i=Function("binder","return function ("+Ep(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var We=$((Pz,Ga)=>{"use strict";var Ip=Wa();Ga.exports=Function.prototype.bind||Ip});var Yt=$((bz,Ka)=>{"use strict";Ka.exports=Function.prototype.call});var en=$((Tz,Ja)=>{"use strict";Ja.exports=Function.prototype.apply});var Ya=$((Ez,Xa)=>{"use strict";Xa.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var es=$((Iz,Qa)=>{"use strict";var $p=We(),Sp=en(),Ap=Yt(),zp=Ya();Qa.exports=zp||$p.call(Ap,Sp)});var rs=$(($z,ts)=>{"use strict";var kp=We(),Op=Kt(),wp=Yt(),Rp=es();ts.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Op("a function is required");return Rp(kp,wp,t)},"callBindBasic")});var us=$((Az,ss)=>{"use strict";var Np=rs(),ns=Jr(),is;try{is=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var tn=!!is&&ns&&ns(Object.prototype,"__proto__"),as=Object,os=as.getPrototypeOf;ss.exports=tn&&typeof tn.get=="function"?Np([tn.get]):typeof os=="function"?o(function(t){return os(t==null?t:as(t))},"getDunder"):!1});var ms=$((kz,ds)=>{"use strict";var cs=Yr(),ls=Qr(),ps=us();ds.exports=cs?o(function(t){return cs(t)},"getProto"):ls?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ls(t)},"getProto"):ps?o(function(t){return ps(t)},"getProto"):null});var rn=$((wz,fs)=>{"use strict";var Dp=Function.prototype.call,Cp=Object.prototype.hasOwnProperty,Up=We();fs.exports=Up.call(Dp,Cp)});var Ps=$((Rz,_s)=>{"use strict";var B,Mp=Kr(),jp=aa(),Lp=ua(),Bp=la(),Fp=da(),Xe=fa(),Je=Kt(),Zp=ha(),Vp=xa(),Hp=Pa(),qp=Ta(),Wp=Ia(),Gp=Sa(),Kp=za(),Jp=Ra(),vs=Function,nn=o(function(e){try{return vs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),_t=Jr(),Xp=Ma(),on=o(function(){throw new Je},"throwTypeError"),Yp=_t?function(){try{return arguments.callee,on}catch{try{return _t(arguments,"callee").get}catch{return on}}}():on,Ge=Fa()(),re=ms(),Qp=Qr(),ed=Yr(),xs=en(),Pt=Yt(),Ke={},td=typeof Uint8Array>"u"||!re?B:re(Uint8Array),De={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?B:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?B:ArrayBuffer,"%ArrayIteratorPrototype%":Ge&&re?re([][Symbol.iterator]()):B,"%AsyncFromSyncIteratorPrototype%":B,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?B:Atomics,"%BigInt%":typeof BigInt>"u"?B:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?B:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?B:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?B:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":jp,"%eval%":eval,"%EvalError%":Lp,"%Float16Array%":typeof Float16Array>"u"?B:Float16Array,"%Float32Array%":typeof Float32Array>"u"?B:Float32Array,"%Float64Array%":typeof Float64Array>"u"?B:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?B:FinalizationRegistry,"%Function%":vs,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?B:Int8Array,"%Int16Array%":typeof Int16Array>"u"?B:Int16Array,"%Int32Array%":typeof Int32Array>"u"?B:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ge&&re?re(re([][Symbol.iterator]())):B,"%JSON%":typeof JSON=="object"?JSON:B,"%Map%":typeof Map>"u"?B:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ge||!re?B:re(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Mp,"%Object.getOwnPropertyDescriptor%":_t,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?B:Promise,"%Proxy%":typeof Proxy>"u"?B:Proxy,"%RangeError%":Bp,"%ReferenceError%":Fp,"%Reflect%":typeof Reflect>"u"?B:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?B:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ge||!re?B:re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?B:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ge&&re?re(""[Symbol.iterator]()):B,"%Symbol%":Ge?Symbol:B,"%SyntaxError%":Xe,"%ThrowTypeError%":Yp,"%TypedArray%":td,"%TypeError%":Je,"%Uint8Array%":typeof Uint8Array>"u"?B:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?B:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?B:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?B:Uint32Array,"%URIError%":Zp,"%WeakMap%":typeof WeakMap>"u"?B:WeakMap,"%WeakRef%":typeof WeakRef>"u"?B:WeakRef,"%WeakSet%":typeof WeakSet>"u"?B:WeakSet,"%Function.prototype.call%":Pt,"%Function.prototype.apply%":xs,"%Object.defineProperty%":Xp,"%Object.getPrototypeOf%":Qp,"%Math.abs%":Vp,"%Math.floor%":Hp,"%Math.max%":qp,"%Math.min%":Wp,"%Math.pow%":Gp,"%Math.round%":Kp,"%Math.sign%":Jp,"%Reflect.getPrototypeOf%":ed};if(re)try{null.error}catch(e){gs=re(re(e)),De["%Error.prototype%"]=gs}var gs,rd=o(function e(t){var r;if(t==="%AsyncFunction%")r=nn("async function () {}");else if(t==="%GeneratorFunction%")r=nn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=nn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&re&&(r=re(i.prototype))}return De[t]=r,r},"doEval"),ys={__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"]},bt=We(),Qt=rn(),nd=bt.call(Pt,Array.prototype.concat),od=bt.call(xs,Array.prototype.splice),hs=bt.call(Pt,String.prototype.replace),er=bt.call(Pt,String.prototype.slice),id=bt.call(Pt,RegExp.prototype.exec),ad=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,sd=/\\(\\)?/g,ud=o(function(t){var r=er(t,0,1),n=er(t,-1);if(r==="%"&&n!=="%")throw new Xe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Xe("invalid intrinsic syntax, expected opening `%`");var i=[];return hs(t,ad,function(u,c,p,f){i[i.length]=p?hs(f,sd,"$1"):c||u}),i},"stringToPath"),cd=o(function(t,r){var n=t,i;if(Qt(ys,n)&&(i=ys[n],n="%"+i[0]+"%"),Qt(De,n)){var u=De[n];if(u===Ke&&(u=rd(n)),typeof u>"u"&&!r)throw new Je("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Xe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");_s.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Je('"allowMissing" argument must be a boolean');if(id(/^%?[^%]*%?$/,t)===null)throw new Xe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ud(t),i=n.length>0?n[0]:"",u=cd("%"+i+"%",r),c=u.name,p=u.value,f=!1,h=u.alias;h&&(i=h[0],od(n,nd([0,1],h)));for(var _=1,I=!0;_<n.length;_+=1){var x=n[_],s=er(x,0,1),d=er(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Xe("property names with quotes must have matching quotes");if((x==="constructor"||!I)&&(f=!0),i+="."+x,c="%"+i+"%",Qt(De,c))p=De[c];else if(p!=null){if(!(x in p)){if(!r)throw new Je("base intrinsic for "+t+" exists, but the property is not available.");return}if(_t&&_+1>=n.length){var g=_t(p,x);I=!!g,I&&"get"in g&&!("originalValue"in g.get)?p=g.get:p=p[x]}else I=Qt(p,x),p=p[x];I&&!f&&(De[c]=p)}}return p},"GetIntrinsic")});var Ts=$((Dz,bs)=>{"use strict";var ld=Xr();bs.exports=o(function(){return ld()&&!!Symbol.toStringTag},"hasToStringTagShams")});var $s=$((Uz,Is)=>{"use strict";var pd=Ps(),Es=pd("%Object.defineProperty%",!0),dd=Ts()(),md=rn(),fd=Kt(),tr=dd?Symbol.toStringTag:null;Is.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new fd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");tr&&(n||!md(t,tr))&&(Es?Es(t,tr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[tr]=r)},"setToStringTag")});var As=$((jz,Ss)=>{"use strict";var gd=Function.prototype.call,yd=Object.prototype.hasOwnProperty,hd=We();Ss.exports=hd.call(gd,yd)});var ks=$((Lz,zs)=>{"use strict";zs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Rs=$((Bz,ws)=>{"use strict";var cn=Di(),vd=require("util"),an=require("path"),xd=require("http"),_d=require("https"),Pd=require("url").parse,bd=require("fs"),Td=require("stream").Stream,Ed=require("crypto"),sn=Li(),Id=na(),$d=$s(),ze=As(),un=ks();function Os(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Os,"escapeHeaderParam");function Z(e){if(!(this instanceof Z))return new Z(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],cn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(Z,"FormData");vd.inherits(Z,cn);Z.LINE_BREAK=`\r
2
- `;Z.DEFAULT_CONTENT_TYPE="application/octet-stream";Z.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=cn.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 i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};Z.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)+Z.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ze(t,"httpVersion"))&&!(t instanceof Td))&&(r.knownLength||this._valuesToMeasure.push(t))};Z.prototype._lengthRetriever=function(e,t){ze(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):bd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):ze(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ze(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};Z.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Os(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&un(c,r.header);var p;for(var f in c)if(ze(c,f)){if(p=c[f],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=f+": "+p.join("; ")+Z.LINE_BREAK)}return"--"+this.getBoundary()+Z.LINE_BREAK+u+Z.LINE_BREAK};Z.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=an.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=an.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ze(e,"httpVersion")&&(r=an.basename(e.client._httpMessage.path||"")),r)return'filename="'+Os(r)+'"'};Z.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=sn.lookup(e.name)),!r&&e&&e.path&&(r=sn.lookup(e.path)),!r&&e&&e.readable&&ze(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=sn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=Z.DEFAULT_CONTENT_TYPE),r};Z.prototype._multiPartFooter=function(){return function(e){var t=Z.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};Z.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Z.LINE_BREAK};Z.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ze(e,t)&&(r[t.toLowerCase()]=e[t]);return r};Z.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};Z.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Z.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(Z.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};Z.prototype._generateBoundary=function(){this._boundary="--------------------------"+Ed.randomBytes(12).toString("hex")};Z.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};Z.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};Z.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}Id.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};Z.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Pd(e),n=un({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=un(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=_d.request(n):r=xd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,f=o(function(h,_){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,h,_)},"callback");p=f.bind(this,null),r.on("error",f),r.on("response",p)}}.bind(this)),r};Z.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};Z.prototype.toString=function(){return"[object FormData]"};$d(Z.prototype,"FormData");ws.exports=Z});var Zd={};gn(Zd,{resend:()=>Fd,resendAuth:()=>A});module.exports=du(Zd);var mu=Object.freeze({status:"aborted"});function T(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let h=c.prototype,_=Object.keys(h);for(let I=0;I<_.length;I++){let x=_[I];x in p||(p[x]=h[x].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var f;let h=r?.Parent?new u:this;n(h,p),(f=h._zod).deferred??(f.deferred=[]);for(let _ of h._zod.deferred)_();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var fu=Symbol("zod_brand"),me=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Et=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},or={};function ye(e){return e&&Object.assign(or,e),or}o(ye,"config");function ar(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(ar,"getEnumValues");function vn(e,t){return typeof t=="bigint"?t.toString():t}o(vn,"jsonStringifyReplacer");function $t(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o($t,"cached");function xn(e){return e==null}o(xn,"nullish");function St(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(St,"cleanRegex");var hn=Symbol("evaluating");function ee(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==hn)return n===void 0&&(n=hn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(ee,"defineLazy");var sr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(et,"isObject");var gu=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function _n(e){if(et(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(et(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(_n,"isPlainObject");var Pn=new Set(["string","number","symbol"]);function Ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ce,"escapeRegex");function At(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(At,"clone");function K(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>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:o(()=>t.error,"error")}:t}o(K,"normalizeParams");function bn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(bn,"optionalKeys");var yu={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 Ue(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}o(Ue,"aborted");function be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(be,"prefixIssues");function It(e){return typeof e=="string"?e:e?.message}o(It,"unwrapMessage");function Te(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(r.customError?.(e))??It(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Te,"finalizeIssue");function Tn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Tn,"getLengthableOrigin");function ur(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(ur,"issue");var En=o((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,vn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),In=T("$ZodError",En),tt=T("$ZodError",En,{Parent:Error});var vu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new me;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>Te(f,u,ye())));throw sr(p,i?.callee),p}return c.value},"_parse"),zt=vu(tt),xu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>Te(f,u,ye())));throw sr(p,i?.callee),p}return c.value},"_parseAsync"),kt=xu(tt),_u=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new me;return u.issues.length?{success:!1,error:new(e??In)(u.issues.map(c=>Te(c,i,ye())))}:{success:!0,data:u.value}},"_safeParse"),rt=_u(tt),Pu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Te(c,i,ye())))}:{success:!0,data:u.value}},"_safeParseAsync"),nt=Pu(tt);var bu="(?:(?:\\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])))",Tu=new RegExp(`^${bu}$`);var $n=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Sn=/^-?\d+n?$/;var cr=/^-?\d+(?:\.\d+)?$/,An=/^(?:true|false)$/i;var Me=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var zn=T("$ZodCheckMinLength",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!xn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=Tn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var lr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Me.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),kn=T("$ZodCheckRegex",(e,t)=>{lr.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 wn={major:4,minor:3,patch:6};var J=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,p,f)=>{let h=Ue(c),_;for(let I of p){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(h)continue;let x=c.issues.length,s=I._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new me;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(h||(h=Ue(c,x)))});else{if(c.issues.length===x)continue;h||(h=Ue(c,x))}}return _?_.then(()=>c):c},"runChecks"),u=o((c,p,f)=>{if(Ue(c))return c.aborted=!0,c;let h=i(p,n,f);if(h instanceof Promise){if(f.async===!1)throw new me;return h.then(_=>e._zod.parse(_,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return h instanceof Promise?h.then(_=>u(_,c,p)):u(h,c,p)}let f=e._zod.parse(c,p);if(f instanceof Promise){if(p.async===!1)throw new me;return f.then(h=>i(h,n,p))}return i(f,n,p)}}ee(e,"~standard",()=>({validate:o(i=>{try{let u=rt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return nt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Rt=T("$ZodString",(e,t)=>{J.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$n(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}}),pr=T("$ZodStringFormat",(e,t)=>{lr.init(e,t),Rt.init(e,t)});var Un=T("$ZodURL",(e,t)=>{pr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.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=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Mn=T("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=e._zod.bag.pattern??cr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}});var dr=T("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=An,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),jn=T("$ZodBigInt",(e,t)=>{J.init(e,t),e._zod.pattern=Sn,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 Ln=T("$ZodAny",(e,t)=>{J.init(e,t),e._zod.parse=r=>r}),Bn=T("$ZodUnknown",(e,t)=>{J.init(e,t),e._zod.parse=r=>r});var Fn=T("$ZodVoid",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Zn=T("$ZodDate",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Rn(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}o(Rn,"handleArrayResult");var Vn=T("$ZodArray",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let p=i[c],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?u.push(f.then(h=>Rn(h,r,c))):Rn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function wt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(wt,"handlePropertyResult");function Eu(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=bn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Eu,"normalizeDef");function Iu(e,t,r,n,i,u){let c=[],p=i.keySet,f=i.catchall._zod,h=f.def.type,_=f.optout==="optional";for(let I in t){if(p.has(I))continue;if(h==="never"){c.push(I);continue}let x=f.run({value:t[I],issues:[]},n);x instanceof Promise?e.push(x.then(s=>wt(s,r,I,t,_))):wt(x,r,I,t,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Iu,"handleCatchall");var Hn=T("$ZodObject",(e,t)=>{if(J.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...p};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=$t(()=>Eu(t));ee(e._zod,"propValues",()=>{let p=t.shape,f={};for(let h in p){let _=p[h]._zod;if(_.values){f[h]??(f[h]=new Set);for(let I of _.values)f[h].add(I)}}return f});let i=et,u=t.catchall,c;e._zod.parse=(p,f)=>{c??(c=n.value);let h=p.value;if(!i(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;p.value={};let _=[],I=c.shape;for(let x of c.keys){let s=I[x],d=s._zod.optout==="optional",g=s._zod.run({value:h[x],issues:[]},f);g instanceof Promise?_.push(g.then(m=>wt(m,p,x,h,d))):wt(g,p,x,h,d)}return u?Iu(_,h,p,f,n.value,e):_.length?Promise.all(_).then(()=>p):p}});function Nn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Ue(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Te(c,n,ye())))}),t)}o(Nn,"handleUnionResults");var mr=T("$ZodUnion",(e,t)=>{J.init(e,t),ee(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ee(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ee(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ee(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>St(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let f of t.options){let h=f._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)p.push(h),c=!0;else{if(h.issues.length===0)return h;p.push(h)}}return c?Promise.all(p).then(f=>Nn(f,i,e,u)):Nn(p,i,e,u)}});var qn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,mr.init(e,t);let r=e._zod.parse;ee(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[p,f]of Object.entries(c)){i[p]||(i[p]=new Set);for(let h of f)i[p].add(h)}}return i});let n=$t(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of p){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!et(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var Wn=T("$ZodRecord",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!_n(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){p.add(typeof h=="number"?h.toString():h);let _=t.valueType._zod.run({value:i[h],issues:[]},n);_ instanceof Promise?u.push(_.then(I=>{I.issues.length&&r.issues.push(...be(h,I.issues)),r.value[h]=I.value})):(_.issues.length&&r.issues.push(...be(h,_.issues)),r.value[h]=_.value)}let f;for(let h in i)p.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&cr.test(p)&&f.issues.length){let I=t.keyType._zod.run({value:Number(p),issues:[]},n);if(I instanceof Promise)throw new Error("Async schemas not supported in object keys currently");I.issues.length===0&&(f=I)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(I=>Te(I,n,ye())),input:p,path:[p],inst:e});continue}let _=t.valueType._zod.run({value:i[p],issues:[]},n);_ instanceof Promise?u.push(_.then(I=>{I.issues.length&&r.issues.push(...be(p,I.issues)),r.value[f.value]=I.value})):(_.issues.length&&r.issues.push(...be(p,_.issues)),r.value[f.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Gn=T("$ZodEnum",(e,t)=>{J.init(e,t);let r=ar(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Pn.has(typeof i)).map(i=>typeof i=="string"?Ce(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),Kn=T("$ZodLiteral",(e,t)=>{if(J.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"?Ce(n):n?Ce(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Jn=T("$ZodTransform",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Et(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new me;return r.value=i,r}});function Dn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Dn,"handleOptionalResult");var Xn=T("$ZodOptional",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Dn(u,r.value)):Dn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Yn=T("$ZodNullable",(e,t)=>{J.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)}|null)$`):void 0}),ee(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 Qn=T("$ZodPipe",(e,t)=>{J.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Ot(c,t.in,n)):Ot(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Ot(u,t.out,n)):Ot(i,t.out,n)}});function Ot(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Ot,"handlePipeResult");var eo=T("$ZodCustom",(e,t)=>{Me.init(e,t),J.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Cn(u,r,n,e));Cn(i,r,n,e)}});function Cn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(ur(i))}}o(Cn,"handleRefineResult");var ro,zu=Symbol("ZodOutput"),ku=Symbol("ZodInput"),fr=class{static{o(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 i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function no(){return new fr}o(no,"registry");(ro=globalThis).__zod_globalRegistry??(ro.__zod_globalRegistry=no());var gr=globalThis.__zod_globalRegistry;function oo(e,t){return new e({type:"string",...K(t)})}o(oo,"_string");function io(e,t){return new e({type:"string",coerce:!0,...K(t)})}o(io,"_coercedString");function ao(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...K(t)})}o(ao,"_url");function so(e,t){return new e({type:"number",checks:[],...K(t)})}o(so,"_number");function uo(e,t){return new e({type:"number",coerce:!0,checks:[],...K(t)})}o(uo,"_coercedNumber");function co(e,t){return new e({type:"boolean",...K(t)})}o(co,"_boolean");function lo(e,t){return new e({type:"boolean",coerce:!0,...K(t)})}o(lo,"_coercedBoolean");function po(e,t){return new e({type:"bigint",coerce:!0,...K(t)})}o(po,"_coercedBigint");function mo(e){return new e({type:"any"})}o(mo,"_any");function fo(e){return new e({type:"unknown"})}o(fo,"_unknown");function go(e,t){return new e({type:"void",...K(t)})}o(go,"_void");function yo(e,t){return new e({type:"date",coerce:!0,...K(t)})}o(yo,"_coercedDate");function le(e,t){return new zn({check:"min_length",...K(t),minimum:e})}o(le,"_minLength");function Ee(e,t){return new kn({check:"string_format",format:"regex",...K(t),pattern:e})}o(Ee,"_regex");function ho(e,t,r){let n=K(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(ho,"_custom");var te=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");J.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>zt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>rt(e,r,n),e.parseAsync=async(r,n)=>kt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>nt(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)=>At(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Dt=T("ZodMiniString",(e,t)=>{Rt.init(e,t),te.init(e,t)});function a(e){return oo(Dt,e)}o(a,"string");var vo=T("ZodMiniStringFormat",(e,t)=>{pr.init(e,t),Dt.init(e,t)});var Lu=T("ZodMiniURL",(e,t)=>{Un.init(e,t),vo.init(e,t)});function xo(e){return ao(Lu,e)}o(xo,"url");var yr=T("ZodMiniNumber",(e,t)=>{Mn.init(e,t),te.init(e,t)});function ne(e){return so(yr,e)}o(ne,"number");var hr=T("ZodMiniBoolean",(e,t)=>{dr.init(e,t),te.init(e,t)});function H(e){return co(hr,e)}o(H,"boolean");var _o=T("ZodMiniBigInt",(e,t)=>{jn.init(e,t),te.init(e,t)});var Bu=T("ZodMiniAny",(e,t)=>{Ln.init(e,t),te.init(e,t)});function it(){return mo(Bu)}o(it,"any");var Fu=T("ZodMiniUnknown",(e,t)=>{Bn.init(e,t),te.init(e,t)});function R(){return fo(Fu)}o(R,"unknown");var Zu=T("ZodMiniVoid",(e,t)=>{Fn.init(e,t),te.init(e,t)});function Po(e){return go(Zu,e)}o(Po,"_void");var bo=T("ZodMiniDate",(e,t)=>{Zn.init(e,t),te.init(e,t)});var Vu=T("ZodMiniArray",(e,t)=>{Vn.init(e,t),te.init(e,t)});function U(e,t){return new Vu({type:"array",element:e,...K(t)})}o(U,"array");var Hu=T("ZodMiniObject",(e,t)=>{Hn.init(e,t),te.init(e,t),ee(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...K(t)};return new Hu(r)}o(l,"object");var qu=T("ZodMiniUnion",(e,t)=>{mr.init(e,t),te.init(e,t)});function M(e,t){return new qu({type:"union",options:e,...K(t)})}o(M,"union");var Wu=T("ZodMiniDiscriminatedUnion",(e,t)=>{qn.init(e,t),te.init(e,t)});function je(e,t,r){return new Wu({type:"union",options:t,discriminator:e,...K(r)})}o(je,"discriminatedUnion");var Gu=T("ZodMiniRecord",(e,t)=>{Wn.init(e,t),te.init(e,t)});function N(e,t,r){return new Gu({type:"record",keyType:e,valueType:t,...K(r)})}o(N,"record");var Ku=T("ZodMiniEnum",(e,t)=>{Gn.init(e,t),te.init(e,t),e.options=Object.values(t.entries)});function L(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ku({type:"enum",entries:r,...K(t)})}o(L,"_enum");var Ju=T("ZodMiniLiteral",(e,t)=>{Kn.init(e,t),te.init(e,t)});function z(e,t){return new Ju({type:"literal",values:Array.isArray(e)?e:[e],...K(t)})}o(z,"literal");var Xu=T("ZodMiniTransform",(e,t)=>{Jn.init(e,t),te.init(e,t)});function Ie(e){return new Xu({type:"transform",transform:e})}o(Ie,"transform");var Yu=T("ZodMiniOptional",(e,t)=>{Xn.init(e,t),te.init(e,t)});function y(e){return new Yu({type:"optional",innerType:e})}o(y,"optional");var Qu=T("ZodMiniNullable",(e,t)=>{Yn.init(e,t),te.init(e,t)});function at(e){return new Qu({type:"nullable",innerType:e})}o(at,"nullable");var ec=T("ZodMiniPipe",(e,t)=>{Qn.init(e,t),te.init(e,t)});function $e(e,t){return new ec({type:"pipe",in:e,out:t})}o($e,"pipe");var tc=T("ZodMiniCustom",(e,t)=>{eo.init(e,t),te.init(e,t)});function Ct(e,t){return ho(tc,e??(()=>!0),t)}o(Ct,"custom");var st={};gn(st,{bigint:()=>uc,boolean:()=>sc,date:()=>cc,number:()=>ac,string:()=>ic});function ic(e){return io(Dt,e)}o(ic,"string");function ac(e){return uo(yr,e)}o(ac,"number");function sc(e){return lo(hr,e)}o(sc,"boolean");function uc(e){return po(_o,e)}o(uc,"bigint");function cc(e){return yo(bo,e)}o(cc,"date");var xr=l({retryOnFailure:l({defaultValue:y(H()),hide:y(H())}),continueOnFailure:l({defaultValue:y(H()),hide:y(H())})}),vr=class{constructor(t,r,n,i,u,c,p,f,h,_,I){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=_;this.aiMetadata=I}static{o(this,"IAction")}},C=o(e=>new vr(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 V=l({displayName:a(),description:y(a())}),j=o((e,t)=>l({type:z(t),required:H(),defaultValue:y(it())}),"TPropertyValue");var ae=l({...V.shape,...j(a(),"SHORT_TEXT").shape}),he=l({...V.shape,...j(a(),"LONG_TEXT").shape});var Eo=l({label:a(),value:R()}),Ut=l({disabled:y(H()),placeholder:y(a()),options:U(Eo)});var se=l({...V.shape,options:Ut,...j(R(),"STATIC_DROPDOWN").shape}),ve=l({...V.shape,options:Ut,...j(U(R()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var _r=l({...V.shape,...j(R(),"DROPDOWN").shape,refreshers:U(a())}),ut=l({...V.shape,...j(U(R()),"MULTI_SELECT_DROPDOWN").shape,refreshers:U(a())});var xe=l({...V.shape,...j(H(),"CHECKBOX").shape});var _e=l({...V.shape,...j(ne(),"NUMBER").shape});var ct=l({...V.shape,...j(R(),"FILE").shape});var lt=l({...V.shape,...j(a(),"DATE_TIME").shape});var Io=N(a(),M([ae,he,se,ut,ve,xe,_e,ct,lt])),pt=l({...V.shape,properties:Io,...j(U(R()),"ARRAY").shape});var dt=l({...V.shape,...j(M([N(a(),R())]),"JSON").shape});var $o=M([ae,se,dt,pt,ve]),pc=N(a(),$o),Pr=l({refreshers:U(a()),...V.shape,...j(R(),"DYNAMIC").shape});var Mt=l({...V.shape,...j(Po(),"MARKDOWN").shape});var mt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(mt||{}),Le=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Le||{}),Be=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Be||{});var ft=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ft||{}),br="both_client_credentials_and_authorization_code";var Se=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Se||{}),gt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(gt||{}),dc=l({strategy:L(gt),paramName:y(a())}),yt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(yt||{});var jt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(jt||{}),So=l({status:y(ne()),body:y(R()),headers:y(N(a(),a()))}),Ao=l({type:z("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(L(jt))}),zo=l({type:z("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:So,handlerId:y(a()),streamStepProgress:y(L(jt))}),mc=M([Ao,zo]);var fc=l({body:R(),rawBody:y(R()),headers:N(a(),a()),queryParams:N(a(),a())});function pe(e){return e==null}o(pe,"isNil");function ht(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ht,"isEmpty");function Lt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Lt,"assertNotNullOrUndefined");var Tr=Oe(require("crypto"),1);var gc=128,we,Fe,yc=o(e=>{!we||we.length<e?(we=Buffer.allocUnsafe(e*gc),Tr.default.randomFillSync(we),Fe=0):Fe+e>we.length&&(Tr.default.randomFillSync(we),Fe=0),Fe+=e},"fillPool"),hc=o(e=>(yc(e|=0),we.subarray(Fe-e,Fe)),"random"),vc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let p=r(i),f=i;for(;f--;)if(c+=e[p[f]&n]||"",c.length===u)return c}}},"customRandom"),Oo=o((e,t=21)=>vc(e,t,hc),"customAlphabet");var xc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",wo=21,$b=a().check(Ee(new RegExp(`^[0-9a-zA-Z]{${wo}}$`))),_c=Oo(xc,wo);var Ae=$e(Ie(e=>e instanceof Date?e.toISOString():e),a()),ue={id:a(),created:Ae,updated:Ae},W=o(e=>y(at(e)),"Nullable");function Er(e){return y(at(L(e)))}o(Er,"NullableEnum");var zb=$e(Ie(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(H())),Bt=o(e=>$e(Ie(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(U(e))),"OptionalArrayFromQuery");var wb=N(a(),R());var vt=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(vt||{});var Vb=a().check(Ee(/^#[0-9A-Fa-f]{6}$/));var qb=l({filename:a(),data:R(),type:z("file"),mimetype:y(a())});var Pc=Oe(No());var Qb=l({...ue,name:a(),permissions:U(a()),platformId:W(a()),type:a(),userCount:y(ne())});var Do=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Do||{}),Ir=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ir||{}),$r=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))($r||{});var Sr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Sr||{});var Ar=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ar||{});var bc=l({mode:L(Do),value:R()}),Tc=l({auth:y(a()),fields:N(a(),bc)}),Ec=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(Tc)}),Ic=l({type:z("PIECE"),toolName:a().check(le(1)),pieceMetadata:Ec}),$c=l({type:z("none")}),Sc=l({type:z("access_token"),accessToken:a()}),Ac=l({type:z("api_key"),apiKey:a(),apiKeyHeader:a()}),zc=l({type:z("headers"),headers:N(a(),a())}),kc=je("type",[$c,Sc,Ac,zc]),Co=l({type:z("FLOW"),toolName:a().check(le(1)),externalFlowId:a(),flowDisplayName:y(a())}),Uo=l({type:z("MCP"),toolName:a().check(le(1)),serverUrl:xo(),protocol:L($r),auth:kc}),Mo=l({type:z("KNOWLEDGE_BASE"),toolName:a().check(le(1)),sourceType:L(Ir),sourceId:a(),sourceName:a()}),Oc=je("type",[Ic,Co,Uo,Mo]),wc=l({displayName:a(),description:y(a()),type:L(Sr)}),jo=l({type:z("MARKDOWN"),markdown:a()}),Ze={type:z("TOOL_CALL"),input:W(N(a(),R())),output:y(R()),toolName:a(),status:L(Ar),toolCallId:a(),startTime:a(),endTime:y(a())},$T=l(Ze),Lo=je("toolCallType",[l({...Ze,toolCallType:z("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Ze,toolCallType:z("FLOW"),displayName:a(),externalFlowId:a()}),l({...Ze,toolCallType:z("MCP"),displayName:a(),serverUrl:a()}),l({...Ze,toolCallType:z("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Ze,toolCallType:z("UNKNOWN"),displayName:a()})]),Rc=M([jo,Lo]);var zr=(r=>(r.IMAGE="image",r.TEXT="text",r))(zr||{}),Pe=l({apiKey:a()}),Nc=Pe,Dc=l({apiKey:a(),apiKeyHash:a()}),Cc=Pe,Uc=Pe,Mc=Pe,jc=Pe,Lc=Pe,Bc=Pe,Fc=Pe,Bo=l({accessKeyId:a().check(le(1)),secretAccessKey:a().check(le(1))}),Zc=l({}),Vc=l({}),Hc=l({}),qc=l({}),Wc=l({}),Gc=l({}),Fo=l({modelId:a(),modelName:a(),modelType:L(zr)}),Zo=l({apiKeyHeader:a(),baseUrl:a(),models:U(Fo),defaultHeaders:y(N(a(),a()))}),Vo=l({accountId:a(),gatewayId:a(),models:U(Fo),vertexProject:y(a()),vertexRegion:y(a())}),Ho=l({resourceName:a(),apiVersion:$e(Ie(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),qo=l({region:a().check(le(1))}),Kc=M([Nc,Mc,jc,Lc,Bc,Uc,Cc,Dc,Bo,Fc]),Wo=M([Zo,Vo,Ho,qo,Zc,Hc,qc,Wc,Vc,Gc]),Jc=l({id:a(),name:a(),type:L(zr)}),Xc=l({id:a(),name:a(),provider:L(vt),config:Wo,enabledForChat:H()}),Yc=l({provider:L(vt),config:Wo,auth:Kc,platformId:a()});var kT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Qc=l({base64Url:a(),fileName:a(),extension:y(a())}),el=l({mimeType:a(),url:a(),fileName:y(a())}),kr=M([Qc,el]);var tl=M([l({type:z("file"),value:kr}),l({type:z("markdown"),value:a(),files:y(U(kr))})]),rl=l({sessionId:a(),message:a(),files:y(U(a()))});var Ko=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ko||{}),Jo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Jo||{}),Or=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Or||{});var nl=M([l({...ue,name:a(),externalId:a(),type:z("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:U(l({value:a()}))})}),l({...ue,name:a(),externalId:a(),type:M([z("TEXT"),z("NUMBER"),z("DATE")]),tableId:a(),projectId:a()})]),ol=l({...ue,name:a(),folderId:W(a()),projectId:a(),externalId:a(),status:Er(Jo),trigger:Er(Ko)}),il=l({...ue,tableId:a(),projectId:a(),cells:N(a(),l({updated:a(),created:a(),value:R(),fieldName:a()}))}),al=l({events:U(L(Or)),webhookUrl:a(),flowId:a()}),sl=l({fields:U(l({id:a(),name:a()})),rows:U(N(a(),a())),name:a()}),ul=l({projectId:a(),limit:y(st.number()),cursor:y(a()),name:y(a()),externalIds:Bt(a()),folderId:y(a()),folderIds:Bt(a())}),cl=l({records:U(U(l({fieldId:a(),value:Yo()}))),tableId:a()}),ll=l({cells:y(U(l({fieldId:a(),value:Yo()}))),tableId:a(),agentUpdate:y(H())}),Xo=je("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),Go("exists"),Go("not_exists")]),pl=l({tableId:a(),limit:y(st.number()),cursor:y(a()),filters:Bt(Xo)});function Yo(){return $e(Ie(e=>e==null?e:String(e)),at(a()))}o(Yo,"coerceToString");function Re(e){return l({fieldId:a(),operator:z(e),value:a()})}o(Re,"valueFilter");function Go(e){return l({fieldId:a(),operator:z(e)})}o(Go,"existenceFilter");var dl=l({status:y(ne()),body:y(R()),headers:y(N(a(),a()))}),ml=l({...ue,deleted:W(Ae),ownerId:a(),displayName:a(),platformId:a(),externalId:W(a())});var Qo=l({name:a(),description:y(a()),type:a(),required:H()}),fl=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:U(Qo),returnsResponse:H()})});var ei="^[0-9]+\\.[0-9]+\\.[0-9]+$",KT=new RegExp(ei),yl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",JT=a().check(Ee(new RegExp(ei))),XT=a().check(Ee(new RegExp(yl))),hl=l({packageType:z("ARCHIVE"),pieceType:L(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ti=l({packageType:z("REGISTRY"),pieceType:z("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ri=l({packageType:z("REGISTRY"),pieceType:z("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),YT=M([ti,ri]),QT=M([hl,ti,ri]),ni=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ni||{}),vl=l({type:L(ni),cronExpression:a(),timezone:a()}),eE=l({...ue,type:L(Se),projectId:a(),flowId:a(),triggerName:a(),schedule:W(vl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:W(a()),simulate:H()}),oi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(oi||{}),ii=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ii||{}),ai=(r=>(r.S3="S3",r.DB="DB",r))(ai||{}),tE=l({...ue,projectId:W(a()),platformId:W(a()),type:L(oi),compression:L(ii),data:y(R()),location:L(ai),size:W(ne()),fileName:W(a()),s3Key:W(a()),metadata:W(N(a(),a()))}),si=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(si||{}),ui=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ui||{}),rE=l({id:a(),email:a(),firstName:a(),status:L(ui),externalId:W(a()),platformId:W(a()),platformRole:L(si),lastName:a(),created:Ae,updated:Ae,lastActiveDate:W(Ae),imageUrl:W(a())});var wr=l({...V.shape,...j(N(a(),R()),"OBJECT").shape});var di=l({...V.shape,...j(a(),"COLOR").shape});var Rr=M([ae,he,Mt,xe,se,ve,_r,ut,Pr,_e,pt,wr,dt,lt,ct,di]),b={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 fe=l({displayName:a(),description:y(a())});var mi=l({username:a(),password:a()}),Nr=l({...fe.shape,username:l({displayName:a(),description:y(a())}),password:l({displayName:a(),description:y(a())}),...j(mi,"BASIC_AUTH").shape});var bl=N(a(),M([ae,he,_e,xe,se])),Dr=l({...fe.shape,props:bl,...j(R(),"CUSTOM_AUTH").shape});var Ne=l({...fe.shape,...j(l({auth:a()}),"SECRET_TEXT").shape});var Tl=N(a(),M([ae,he,Ne,_e,xe,se,ve,Mt])),fi=l({...fe.shape,props:Tl,...j(R(),"OIDC").shape});var Cr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Cr||{}),gi=M([ae,Ne,se]),yi=N(a(),gi),El=l({props:y(N(a(),gi)),authUrl:a(),tokenUrl:a(),scope:U(a()),prompt:y(M([z("none"),z("consent"),z("login"),z("omit")])),pkce:y(H()),pkceMethod:y(M([z("plain"),z("S256")])),authorizationMethod:y(L(Cr)),grantType:y(M([L(ft),z(br)])),extra:y(N(a(),a()))}),hi=l({access_token:a(),props:y(yi),data:N(a(),it())}),Ur=l({...fe.shape,...El.shape,...j(hi,"OAUTH2").shape});var Ve=M([Nr,Dr,fi,Ur,Ne]),xt="Connection",Mr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||xt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||xt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||xt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||xt}},None(){}};var NI={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 Il=l({...V.shape,...j(R(),"CUSTOM").shape,code:a()});var $l=M([Rr,Ve]),jr=N(a(),$l),e$=N(a(),Rr);var vi=M([l({strategy:z("CRON"),cronExpression:a()}),l({strategy:z("NONE")})]),He=class{constructor(t,r,n,i,u,c,p,f,h,_,I,x,s,d,g,m,v,P,F){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=p;this.onHandshake=f;this.renewConfiguration=h;this.onRenew=_;this.onEnable=I;this.onDisable=x;this.onStart=s;this.run=d;this.test=g;this.sampleData=m;this.testStrategy=v;this.outputSchema=P;this.aiMetadata=F}static{o(this,"ITrigger")}},xi=o(e=>{switch(e.type){case"WEBHOOK":return new He(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 He(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 He(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 He(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,pe(e.sampleData)&&pe(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var _i="2",Zt="0.82.0";var Lr=class{constructor(t,r,n,i,u,c,p,f,h=Zt,_,I=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=_;this.description=I;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:_i}),"getContextInfo");(!Sl(h)||Al(h,Zt))&&(this.minimumSupportedRelease=Zt),u.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Pi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Lr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function Sl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Sl,"isValidSimpleSemver");function Al(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(Al,"isSemverLessThan");var zl=y(N(a(),N(a(),a()))),bi=l({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:U(a()),platformId:y(a()),directoryPath:y(a()),auth:y(M([Ve,U(Ve)])),version:a(),categories:y(U(L(Be))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),i18n:zl}),kl=L(["human","ai","both"]),Ti=l({description:y(a()),idempotent:y(H())}),Ei=l({name:a(),displayName:a(),description:a(),props:jr,requireAuth:H(),errorHandlingOptions:y(xr),outputSchema:y(Ct()),audience:y(kl),aiMetadata:y(Ti)}),Ii=l({name:a(),displayName:a(),description:a(),props:jr,errorHandlingOptions:y(xr),type:L(Se),sampleData:R(),handshakeConfiguration:y(Ct()),renewConfiguration:y(vi),testStrategy:L(yt),outputSchema:y(Ct()),aiMetadata:y(Ti)}),Ol=l({...bi.shape,actions:N(a(),Ei),triggers:N(a(),Ii)}),wl=l({...bi.shape,actions:ne(),triggers:ne(),suggestedActions:y(U(Ii)),suggestedTriggers:y(U(Ei))}),$i=l({projectUsage:ne(),tags:y(U(a())),pieceType:L(Le),packageType:L(mt),platformId:y(a()),archiveId:y(a())}),eS=l({...Ol.shape,...$i.shape}),tS=l({...wl.shape,...$i.shape}),rS=l({name:a(),version:a()});var Rl=Oe(require("path")),Nl=Oe(require("fs/promises"));var Vt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Ht=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Br,r=new Fr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Br=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Fr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var qe=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var qt=class extends Vt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Ht){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[F,ie]of Object.entries(c))i.append(F,ie);let p=i.toString(),f=p?`${n}?${p}`:n,h=t.responseType??"json",_=t.followRedirects??!0,I=t.retries??0,{body:x,extraHeaders:s,isStream:d}=Dl(t.body,u),g=Ul({...u,...s}),m=await Cl(async()=>{let F=new AbortController,ie=t.timeout&&t.timeout>0?setTimeout(()=>F.abort(),t.timeout):void 0;try{let ce={method:t.method.toString(),headers:g,body:x,redirect:_?"follow":"manual",signal:F.signal};return d&&(ce.duplex="half"),r?.dispatcher!==void 0&&(ce.dispatcher=r.dispatcher),await fetch(f,ce)}finally{ie!==void 0&&clearTimeout(ie)}},I),v=_?300:400;if(m.status<200||m.status>=v){let F=await Si(m,h),ie=new qe(t.body,{status:m.status,responseBody:F});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ie),ie}let P=await Si(m,h);return{status:m.status,headers:Ml(m.headers),body:P}}};function Dl(e,t){return Ll(e)?{body:void 0,extraHeaders:{},isStream:!1}:jl(e)?{body:e,extraHeaders:e.getHeaders(),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}}o(Dl,"serializeBody");async function Si(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Si,"parseResponseBody");async function Cl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ai(n);continue}return i}catch(i){if(r=i,n<t){await Ai(n);continue}throw i}throw r}o(Cl,"sendWithRetries");function Ai(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ai,"backoff");function Ul(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(Ul,"normalizeHeaders");function Ml(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Ml,"toHttpHeaders");function jl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(jl,"isNodeFormData");function Ll(e){return e==null}o(Ll,"isNil");var S=new qt;var q=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(q||{});var Sd=Oe(require("fs")),Ns=Oe(Rs());var Ad={"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 zd(e){let t=e.split(";")[0].trim().toLowerCase();return Ad[t]??""}o(zd,"contentTypeToExtension");var kd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Od=o((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 Ds({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:f="headers"}){return C({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:b.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:b.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
- i.e ${Od(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:b.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(q).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:b.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:b.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:b.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:b.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let _=h,I={};switch(_){case"none":break;case"json":I.data=b.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=b.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.data=b.Array({displayName:"Form Data",required:!0,properties:{fieldName:b.ShortText({displayName:"Field Name",required:!0}),fieldType:b.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:b.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:b.File({displayName:"File Field Value",required:!1})}});break}return I},"props")}),response_is_binary:b.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:b.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:b.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:b.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async h=>{let{method:_,url:I,headers:x,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:P,followRedirects:F}=h.propsValue;Lt(_,"Method"),Lt(I,"URL");let ie=pe(r)?{}:await r(h.auth,h.propsValue),ce=I.url,Ye=ce.startsWith("http://")||ce.startsWith("https://")?ce:kd({baseUrl:t(h.auth),relativePath:ce}),ke={method:_,url:Ye,headers:{...x??{},...f==="headers"||!pe(f)?ie:{}},queryParams:{...f==="queryParams"?ie:{},...s??{}},timeout:v?v*1e3:0,followRedirects:F};if(P&&(ke.responseType="arraybuffer"),d)if(g&&g!=="none"){let ge=d.data;if(g==="form_data"){let au=ge,Tt=new Ns.default;for(let{fieldName:dn,fieldType:mn,textFieldValue:fn,fileFieldValue:nr}of au)mn==="text"&&!ht(fn)?Tt.append(dn,fn):mn==="file"&&!ht(nr)&&Tt.append(dn,nr.data,{filename:nr?.filename});ke.body=Tt,ke.headers={...ke.headers,...Tt.getHeaders()}}else ke.body=ge}else g||(ke.body=d);try{let ge=await S.sendRequest(ke);return await wd(h.files,ge.body,ge.status,ge.headers,P)}catch(ge){if(m)return ge.errorMessage();throw ge}},"run")})}o(Ds,"createCustomApiCallAction");var wd=o(async(e,t,r,n,i)=>{let u;if(i&&Rd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=zd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Rd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Cs=C({auth:A,name:"send_email",displayName:"Send Email",description:"Send a text or HTML email",audience:"both",aiMetadata:{description:"Sends a single transactional email (plain text or HTML) to one or more recipients via Resend. Use this for one-off messages; the sender address must be on a domain you have verified in Resend. Not idempotent \u2014 each call sends a new email.",idempotent:!1},props:{to:b.Array({displayName:"To",description:"Emails of the recipients",required:!0}),from_name:b.ShortText({displayName:"Sender Name",description:"Sender name",required:!0}),from:b.ShortText({displayName:"Sender Email (From)",description:"Sender email",required:!0}),bcc:b.Array({displayName:"BCC",description:"List of emails in bcc",required:!1}),cc:b.Array({displayName:"CC",description:"List of emails in cc",required:!1}),reply_to:b.ShortText({displayName:"Reply To",description:"Email to receive replies on (defaults to sender)",required:!1}),subject:b.ShortText({displayName:"Subject",description:void 0,required:!0}),content_type:b.Dropdown({auth:A,displayName:"Content Type",refreshers:[],required:!0,defaultValue:"html",options:o(async()=>({disabled:!1,options:[{label:"Plain Text",value:"text"},{label:"HTML",value:"html"}]}),"options")}),content:b.ShortText({displayName:"Content",description:"HTML is only allowed if you selected HTML as type",required:!0})},async run(e){let{to:t,from:r,from_name:n,reply_to:i,subject:u,content_type:c,content:p,cc:f,bcc:h}=e.propsValue,_={to:t,from:n?`${n} <${r}>`:r,reply_to:i??r,cc:f,bcc:h,subject:u};return c==="text"?_.text=p:c==="html"&&(_.html=p),await S.sendRequest({method:"POST",url:"https://api.resend.com/emails",body:_,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:{}})}});var Nd="https://api.resend.com",Us=C({name:"send_batch_emails",auth:A,displayName:"Send Batch Emails",description:"Send up to 100 emails in a single API call",audience:"both",aiMetadata:{description:"Sends up to 100 distinct emails in one Resend API call, each with its own recipient, subject, and body. Use this instead of Send Email when delivering many independent messages at once. Senders must be on verified domains; pass an idempotency key to guard against duplicate batch sends, otherwise each call sends new emails.",idempotent:!1},props:{emails:b.Array({displayName:"Emails",description:"List of emails to send (max 100). Each email is sent independently with its own recipient, subject, and body.",required:!0,properties:{from:b.ShortText({displayName:"From",description:'Sender address. Use "Name <email@domain.com>" for a friendly name.',required:!0}),to:b.ShortText({displayName:"To",description:"Recipient email address.",required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),content_type:b.StaticDropdown({displayName:"Content Type",required:!0,options:{options:[{label:"HTML",value:"html"},{label:"Plain Text",value:"text"}]}}),content:b.LongText({displayName:"Content",description:"Email body. Use HTML markup if Content Type is HTML.",required:!0}),reply_to:b.ShortText({displayName:"Reply To",required:!1}),cc:b.ShortText({displayName:"CC",required:!1}),bcc:b.ShortText({displayName:"BCC",required:!1})}}),idempotency_key:b.ShortText({displayName:"Idempotency Key",description:"Optional unique key to prevent duplicate sends. Must be unique per request, expires after 24 hours, max 256 characters.",required:!1})},async run({auth:e,propsValue:t}){let r=(t.emails??[]).map(u=>{let c=u,p={from:c.from,to:c.to,subject:c.subject};return c.content_type==="html"?p.html=c.content:p.text=c.content,c.reply_to&&(p.reply_to=c.reply_to),c.cc&&(p.cc=c.cc),c.bcc&&(p.bcc=c.bcc),p}),n={};return t.idempotency_key&&(n["Idempotency-Key"]=t.idempotency_key),(await S.sendRequest({method:"POST",url:`${Nd}/emails/batch`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},headers:n,body:r})).body.data}});var rr="https://api.resend.com",Dd=b.Dropdown({displayName:"Audience",required:!0,auth:A,refreshers:[],options:o(async({auth:e})=>e?{options:(await S.sendRequest({method:"GET",url:`${rr}/audiences`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),Cd=b.Dropdown({displayName:"Domain",required:!0,auth:A,refreshers:[],options:o(async({auth:e})=>e?{options:(await S.sendRequest({method:"GET",url:`${rr}/domains`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),Ud=b.Dropdown({displayName:"Broadcast",required:!0,auth:A,refreshers:[],options:o(async({auth:e})=>e?{options:(await S.sendRequest({method:"GET",url:`${rr}/broadcasts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name?`${r.name} \u2014 ${r.subject}`:r.subject,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),Md=b.Dropdown({displayName:"Contact",required:!0,auth:A,refreshers:["audience_id"],options:o(async({auth:e,audience_id:t})=>!e||!t?{disabled:!0,placeholder:"Select an audience first",options:[]}:{options:(await S.sendRequest({method:"GET",url:`${rr}/audiences/${String(t)}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(n=>{let i=[n.first_name,n.last_name].filter(Boolean).join(" ");return{label:i?`${i} <${n.email}>`:n.email,value:n.id}})},"options")}),Q={audienceId:Dd,domainId:Cd,broadcastId:Ud,contactId:Md};var Ms=C({name:"create_contact",auth:A,displayName:"Create Contact",description:"Add a contact to a Resend audience",audience:"both",aiMetadata:{description:"Adds a new contact (email plus optional name and subscription status) to a specific Resend audience. Use this to grow a mailing list; requires the target audience ID (use List Audiences to find it). Not idempotent \u2014 each call creates a new contact, so guard against re-adding the same email.",idempotent:!1},props:{audience_id:Q.audienceId,email:b.ShortText({displayName:"Email",required:!0}),first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),unsubscribed:b.Checkbox({displayName:"Unsubscribed",description:"If true, the contact will be unsubscribed from all broadcasts",required:!1,defaultValue:!1})},async run({auth:e,propsValue:t}){let r={email:t.email};return t.first_name&&(r.first_name=t.first_name),t.last_name&&(r.last_name=t.last_name),t.unsubscribed!==void 0&&(r.unsubscribed=t.unsubscribed),(await S.sendRequest({method:"POST",url:`https://api.resend.com/audiences/${t.audience_id}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var js=C({name:"update_contact",auth:A,displayName:"Update Contact",description:"Update the name or subscription status of a contact in an audience",audience:"both",aiMetadata:{description:"Updates an existing contact's first name, last name, or subscribed/unsubscribed status within an audience, identified by audience ID and contact ID. Use this to change details or toggle subscription for a known contact. Idempotent \u2014 repeating with the same values leaves the contact in the same state.",idempotent:!0},props:{audience_id:Q.audienceId,contact_id:Q.contactId,first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),unsubscribed:b.StaticDropdown({displayName:"Subscription Status",required:!1,options:{options:[{label:"Subscribed",value:!1},{label:"Unsubscribed",value:!0}]}})},async run({auth:e,propsValue:t}){let r={};return t.first_name!==void 0&&t.first_name!==""&&(r.first_name=t.first_name),t.last_name!==void 0&&t.last_name!==""&&(r.last_name=t.last_name),t.unsubscribed!==void 0&&t.unsubscribed!==null&&(r.unsubscribed=t.unsubscribed),(await S.sendRequest({method:"PATCH",url:`https://api.resend.com/audiences/${t.audience_id}/contacts/${t.contact_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var Ls=C({name:"delete_contact",auth:A,displayName:"Delete Contact",description:"Remove a contact from an audience",audience:"both",aiMetadata:{description:"Permanently removes a contact from a Resend audience, identified by audience ID and contact ID. Use this to delete a subscriber from a list. Effectively idempotent \u2014 once removed, repeating the call has no further effect.",idempotent:!0},props:{audience_id:Q.audienceId,contact_id:Q.contactId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"DELETE",url:`https://api.resend.com/audiences/${t.audience_id}/contacts/${t.contact_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Bs=C({name:"list_contacts",auth:A,displayName:"List Contacts",description:"Retrieve all contacts in an audience",audience:"both",aiMetadata:{description:"Retrieves all contacts in a specific Resend audience, including each contact's ID, email, name, and subscription status. Use this to discover contact IDs (e.g. to feed Update Contact or Delete Contact) or to inspect a mailing list; requires the audience ID. Read-only and idempotent.",idempotent:!0},props:{audience_id:Q.audienceId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"GET",url:`https://api.resend.com/audiences/${t.audience_id}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data}});var Fs=C({name:"get_email_status",auth:A,displayName:"Get Email Status",description:"Retrieve the delivery status of a sent email",audience:"both",aiMetadata:{description:"Looks up the current delivery status and details of a single previously sent email by its Resend email ID. Use this to check whether a specific email was delivered, bounced, or is still scheduled. Read-only and idempotent; requires the email ID returned when the email was sent.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:"The ID returned when you sent the email",required:!0})},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"GET",url:`https://api.resend.com/emails/${t.email_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Zs=C({name:"list_emails",auth:A,displayName:"List Sent Emails",description:"Retrieve a list of emails sent from your Resend account",audience:"both",aiMetadata:{description:"Retrieves the list of emails sent from the connected Resend account, including their IDs, recipients, subjects, and latest delivery event. Use this to discover email IDs (e.g. to feed Get Email Status, Cancel Scheduled Email, or Reschedule Email) or to audit recent sends. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await S.sendRequest({method:"GET",url:"https://api.resend.com/emails",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,from:r.from,to:(r.to??[]).join(", "),subject:r.subject,last_event:r.last_event,created_at:r.created_at,scheduled_at:r.scheduled_at??"",cc:(r.cc??[]).join(", "),bcc:(r.bcc??[]).join(", "),reply_to:(r.reply_to??[]).join(", ")}))}});var Vs=C({name:"cancel_scheduled_email",auth:A,displayName:"Cancel Scheduled Email",description:"Cancel a scheduled email before it is sent",audience:"both",aiMetadata:{description:"Cancels a previously scheduled email so it will not be delivered, identified by its Resend email ID. Use this to stop a future send before its scheduled time. Effectively idempotent \u2014 once an email is cancelled, repeating the call has no further effect; only works while the email is still pending.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:'The ID of the scheduled email to cancel. Use "List Sent Emails" to find it.',required:!0})},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"POST",url:`https://api.resend.com/emails/${t.email_id}/cancel`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Hs=C({name:"reschedule_email",auth:A,displayName:"Reschedule Email",description:"Update the send time of a scheduled email",audience:"both",aiMetadata:{description:"Changes the future send time of an already scheduled email, identified by its Resend email ID. Use this to move a pending send to a new time without cancelling and recreating it. Idempotent when called with the same target time; requires an ISO 8601 date-time and only works while the email is still scheduled.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:'The ID of the scheduled email to reschedule. Use "List Sent Emails" to find it.',required:!0}),scheduled_at:b.ShortText({displayName:"New Send Time",description:"ISO 8601 date-time for when to send the email, e.g. 2024-12-01T10:00:00Z",required:!0})},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"PATCH",url:`https://api.resend.com/emails/${t.email_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:{scheduled_at:t.scheduled_at}})).body}});var qs=C({name:"list_domains",auth:A,displayName:"List Domains",description:"Retrieve all domains added to your Resend account",audience:"both",aiMetadata:{description:"Retrieves all sending domains configured on the connected Resend account, including each domain's ID, name, verification status, and region. Use this to find a domain ID (e.g. for Verify Domain or Delete Domain) or to check which domains are verified before sending. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await S.sendRequest({method:"GET",url:"https://api.resend.com/domains",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,name:r.name,status:r.status,region:r.region,created_at:r.created_at,sending:r.capabilities?.sending??"",receiving:r.capabilities?.receiving??""}))}});var Ws=C({name:"create_domain",auth:A,displayName:"Create Domain",description:"Add a sending domain to your Resend account and get the DNS records to verify it",audience:"both",aiMetadata:{description:"Registers a new sending domain on the Resend account and returns the DNS records that must be added to verify it. Use this as the first step in setting up a custom sending domain before triggering verification. Not idempotent \u2014 each call attempts to create a new domain entry.",idempotent:!1},props:{name:b.ShortText({displayName:"Domain Name",description:"The domain you want to send from, e.g. mail.yourdomain.com",required:!0}),region:b.StaticDropdown({displayName:"Region",description:"AWS region for email delivery. Defaults to US East.",required:!1,options:{options:[{label:"US East (N. Virginia)",value:"us-east-1"},{label:"EU West (Ireland)",value:"eu-west-1"},{label:"Asia Pacific (Tokyo)",value:"ap-northeast-1"},{label:"South America (S\xE3o Paulo)",value:"sa-east-1"}]}})},async run({auth:e,propsValue:t}){let r={name:t.name};t.region&&(r.region=t.region);let i=(await S.sendRequest({method:"POST",url:"https://api.resend.com/domains",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body;return{id:i.id,name:i.name,status:i.status,region:i.region,created_at:i.created_at,sending:i.capabilities?.sending??"",receiving:i.capabilities?.receiving??"",dns_records:i.records}}});var Gs=C({name:"delete_domain",auth:A,displayName:"Delete Domain",description:"Remove a domain from your Resend account",audience:"both",aiMetadata:{description:"Permanently removes a sending domain from the Resend account, identified by its domain ID. Use this to decommission a domain you no longer send from. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{domain_id:Q.domainId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"DELETE",url:`https://api.resend.com/domains/${t.domain_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Ks=C({name:"verify_domain",auth:A,displayName:"Verify Domain",description:"Trigger a DNS verification check for a domain",audience:"both",aiMetadata:{description:"Triggers Resend to re-check the DNS records of a domain and update its verification status, identified by domain ID. Use this after adding the required DNS records (from Create Domain) to confirm the domain is ready to send. Safe to call repeatedly \u2014 it only re-runs the check.",idempotent:!0},props:{domain_id:Q.domainId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"POST",url:`https://api.resend.com/domains/${t.domain_id}/verify`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Js=C({name:"list_audiences",auth:A,displayName:"List Audiences",description:"Retrieve all contact audiences in your Resend account",audience:"both",aiMetadata:{description:"Retrieves all contact audiences (mailing lists) in the connected Resend account, including each audience's ID and name. Use this to discover an audience ID needed by contact and broadcast actions (e.g. Create Contact, List Contacts, Create Broadcast). Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await S.sendRequest({method:"GET",url:"https://api.resend.com/audiences",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data}});var Xs=C({name:"create_audience",auth:A,displayName:"Create Audience",description:"Create a new contact audience in Resend",audience:"both",aiMetadata:{description:"Creates a new contact audience (mailing list) in Resend with the given name and returns its ID. Use this before adding contacts or sending broadcasts when no suitable audience exists yet. Not idempotent \u2014 each call creates a new audience even if the name matches an existing one.",idempotent:!1},props:{name:b.ShortText({displayName:"Audience Name",description:'A label for this audience, e.g. "Newsletter Subscribers"',required:!0})},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"POST",url:"https://api.resend.com/audiences",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:{name:t.name}})).body}});var Ys=C({name:"delete_audience",auth:A,displayName:"Delete Audience",description:"Permanently delete an audience and all its contacts",audience:"both",aiMetadata:{description:"Permanently deletes an entire audience and all of its contacts from Resend, identified by audience ID. Use this to remove a whole mailing list; this is destructive and cannot be undone. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{audience_id:Q.audienceId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"DELETE",url:`https://api.resend.com/audiences/${t.audience_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Qs=C({name:"list_broadcasts",auth:A,displayName:"List Broadcasts",description:"Retrieve all broadcasts in your Resend account",audience:"both",aiMetadata:{description:"Retrieves all broadcast campaigns in the connected Resend account, including each broadcast's ID, name, audience, subject, and status (draft, scheduled, sent). Use this to find a broadcast ID (e.g. for Send Broadcast or Delete Broadcast) or to check campaign status. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await S.sendRequest({method:"GET",url:"https://api.resend.com/broadcasts",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,name:r.name??"",audience_id:r.audience_id,from:r.from,subject:r.subject,reply_to:Array.isArray(r.reply_to)?r.reply_to.join(", "):r.reply_to??"",preview_text:r.preview_text??"",status:r.status,created_at:r.created_at,scheduled_at:r.scheduled_at??"",sent_at:r.sent_at??""}))}});var eu=C({name:"create_broadcast",auth:A,displayName:"Create Broadcast",description:"Create a new broadcast email to send to an audience",audience:"both",aiMetadata:{description:"Creates a draft broadcast email (subject and body) targeting a Resend audience and returns its ID. Use this to prepare a campaign; it only creates the draft and does not deliver anything \u2014 pair it with Send Broadcast to actually send. Requires the audience ID and a sender on a verified domain. Not idempotent \u2014 each call creates a new broadcast.",idempotent:!1},props:{audience_id:Q.audienceId,from:b.ShortText({displayName:"From",description:'Sender address. Must be from a verified domain. Use "Name <email@yourdomain.com>" for a friendly name.',required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),name:b.ShortText({displayName:"Broadcast Name",description:"Internal label for this broadcast. Not visible to recipients.",required:!1}),reply_to:b.ShortText({displayName:"Reply To",description:"Email address recipients will reply to.",required:!1}),preview_text:b.ShortText({displayName:"Preview Text",description:"Short summary shown in email clients below the subject line.",required:!1}),content_type:b.StaticDropdown({displayName:"Content Type",required:!0,options:{options:[{label:"HTML",value:"html"},{label:"Plain Text",value:"text"}]}}),content:b.LongText({displayName:"Content",description:"Email body. Use HTML markup if Content Type is HTML.",required:!0})},async run({auth:e,propsValue:t}){let r={audience_id:t.audience_id,from:t.from,subject:t.subject};return t.content_type==="html"?r.html=t.content:r.text=t.content,t.name&&(r.name=t.name),t.reply_to&&(r.reply_to=t.reply_to),t.preview_text&&(r.preview_text=t.preview_text),(await S.sendRequest({method:"POST",url:"https://api.resend.com/broadcasts",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var tu=C({name:"send_broadcast",auth:A,displayName:"Send Broadcast",description:"Send or schedule a broadcast email to its audience",audience:"both",aiMetadata:{description:"Sends an existing draft broadcast to its entire audience immediately, or schedules it for a future time, identified by broadcast ID. Use this after Create Broadcast to deliver the campaign. Not idempotent \u2014 repeating the call can dispatch the broadcast again; optionally pass an ISO 8601 time to schedule rather than send now.",idempotent:!1},props:{broadcast_id:Q.broadcastId,scheduled_at:b.ShortText({displayName:"Schedule For",description:"ISO 8601 date-time to schedule the send, e.g. 2024-12-01T10:00:00Z. Leave blank to send immediately.",required:!1})},async run({auth:e,propsValue:t}){let r={};return t.scheduled_at&&(r.scheduled_at=t.scheduled_at),(await S.sendRequest({method:"POST",url:`https://api.resend.com/broadcasts/${t.broadcast_id}/send`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var ru=C({name:"delete_broadcast",auth:A,displayName:"Delete Broadcast",description:"Permanently delete a broadcast from your Resend account",audience:"both",aiMetadata:{description:"Permanently deletes a broadcast from the Resend account, identified by broadcast ID. Use this to remove a draft or unwanted campaign; only broadcasts that have not been sent can be deleted. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{broadcast_id:Q.broadcastId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"DELETE",url:`https://api.resend.com/broadcasts/${t.broadcast_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var pn=Oe(require("crypto"));var nu="https://api.resend.com",ln="webhookData",jd=300,Ld=[{label:"Email Sent",value:"email.sent"},{label:"Email Delivered",value:"email.delivered"},{label:"Email Delivery Delayed",value:"email.delivery_delayed"},{label:"Email Complained",value:"email.complained"},{label:"Email Bounced",value:"email.bounced"},{label:"Email Opened",value:"email.opened"},{label:"Email Clicked",value:"email.clicked"},{label:"Email Failed",value:"email.failed"},{label:"Email Received",value:"email.received"},{label:"Email Scheduled",value:"email.scheduled"},{label:"Email Suppressed",value:"email.suppressed"},{label:"Domain Created",value:"domain.created"},{label:"Domain Updated",value:"domain.updated"},{label:"Domain Deleted",value:"domain.deleted"},{label:"Contact Created",value:"contact.created"},{label:"Contact Updated",value:"contact.updated"},{label:"Contact Deleted",value:"contact.deleted"}];function Bd({rawBody:e,headers:t,signingSecret:r}){let n=t["svix-id"],i=t["svix-timestamp"],u=t["svix-signature"];if(!n||!i||!u)return!1;let c=Math.floor(Date.now()/1e3);if(Math.abs(c-parseInt(i,10))>jd)return!1;let p=Buffer.isBuffer(e)?e.toString("utf8"):String(e),f=Buffer.from(r.replace("whsec_",""),"base64"),h=`${n}.${i}.${p}`,_=pn.default.createHmac("sha256",f).update(h).digest("base64");return u.split(" ").some(I=>{let[x,s]=I.split(",");if(x!=="v1"||!s)return!1;try{return pn.default.timingSafeEqual(Buffer.from(s,"base64"),Buffer.from(_,"base64"))}catch{return!1}})}o(Bd,"verifyResendWebhook");var ou=xi({name:"email_bounced",auth:A,displayName:"Email Event",description:"Triggers when a selected email or contact event occurs in Resend",aiMetadata:{description:"Fires when one of the subscribed Resend events occurs, such as an email being sent, delivered, bounced, opened, clicked, complained about, or failing, as well as domain and contact lifecycle events. The payload carries the event type and the affected email, domain, or contact. Subscribe to the specific event types you care about."},type:"WEBHOOK",props:{events:b.StaticMultiSelectDropdown({displayName:"Events",description:"Select one or more event types to subscribe to",required:!0,options:{options:Ld}})},async onEnable(e){let t=await S.sendRequest({method:"POST",url:`${nu}/webhooks`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},body:{endpoint:e.webhookUrl,events:e.propsValue.events}});await e.store.put(ln,{id:t.body.id,signingSecret:t.body.signing_secret})},async onDisable(e){let t=await e.store.get(ln);t?.id&&await S.sendRequest({method:"DELETE",url:`${nu}/webhooks/${t.id}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})},async run(e){let t=await e.store.get(ln);return Bd({rawBody:e.payload.rawBody,headers:e.payload.headers,signingSecret:t?.signingSecret??""})?[e.payload.body]:[]},sampleData:{type:"email.bounced",created_at:"2024-03-08T09:37:40.912Z",data:{created_at:"2024-03-08T09:37:40.911Z",email_id:"562e3f00-6bad-4910-b1e3-38c2fca1e2ff",from:"onboarding@resend.dev",to:["john@example.com"],subject:"Re: Follow up"}}});var iu="https://api.resend.com",A=Mr.SecretText({displayName:"API Key",description:`To get your API key:
1
+ "use strict";var Pu=Object.create;var et=Object.defineProperty;var bu=Object.getOwnPropertyDescriptor;var Tu=Object.getOwnPropertyNames;var Eu=Object.getPrototypeOf,Iu=Object.prototype.hasOwnProperty;var o=(e,t)=>et(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},vn=(e,t)=>{for(var r in t)et(e,r,{get:t[r],enumerable:!0})},xn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Tu(t))!Iu.call(e,i)&&i!==r&&et(e,i,{get:()=>t[i],enumerable:!(n=bu(t,i))||n.enumerable});return e};var Ne=(e,t,r)=>(r=e!=null?Pu(Eu(e)):{},xn(t||!e||!e.__esModule?et(r,"default",{value:e,enumerable:!0}):r,e)),Su=e=>xn(et({},"__esModule",{value:!0}),e);var Zo=S((Fo,Ht)=>{(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"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(l.zoneIndex)||[])[0],P,F;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(F=d-g,P=":";F--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let ie=s.split(":"),le=[];for(let Qe=0;Qe<ie.length;Qe++)le.push(parseInt(ie[Qe],16));return le})(),{parts:d,zoneId:v}}o(f,"expandIPv6");function h(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=g-m,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;m-=g,v+=1}return!0}o(h,"matchCIDR");function x(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(x,"parseIntAuto");function I(s,d){for(;s.length<d;)s=`0${s}`;return s}o(I,"padPart");let _={};_.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,F;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(F=m[P],g&&F!==0)return null;F!==8&&(g=!0),d+=F}else return null;return 32-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),_.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(s){return this.parser(s)!==null},_.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(s){return!!(_.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(s)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),P=[];for(let F=0;F<v.length;F++)g=v[F],P.push(x(g));return P})();if(d=s.match(r.longValue)){if(m=x(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),P=[];if(m=x(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),P=[];if(m=x(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(x(v[1])),P.push(m>>8&255),P.push(m&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.IPv6=(function(){function s(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={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},v,P;for(let F=7;F>=0;F-=1)if(v=this.parts[F],v in m){if(P=m[v],g&&P!==0)return null;P!==16&&(g=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(I(this.parts[v].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new _.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,P;for(;P=d.exec(g);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),_.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(s){return this.parser(s)!==null},_.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch(F){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${F})`)}},_.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(s){let d,g,m,v,P,F;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return f(s,8);if((m=s.match(l.transitional))&&(F=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+F,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<P.length;g++)if(v=P[g],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.fromByteArray=function(s){let d=s.length;if(d===4)return new _.IPv4(s);if(d===16)return new _.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(s){return _.IPv6.isValid(s)||_.IPv4.isValid(s)},_.isValidCIDR=function(s){return _.IPv6.isValidCIDR(s)||_.IPv4.isValidCIDR(s)},_.parse=function(s){if(_.IPv6.isValid(s))return _.IPv6.parse(s);if(_.IPv4.isValid(s))return _.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(s){try{return _.IPv6.parseCIDR(s)}catch{try{return _.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(s,d,g){let m,v,P,F;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(F=P[m],s.kind()===F[0].kind()&&s.match.apply(s,F))return v}return g},typeof Ht<"u"&&Ht.exports?Ht.exports=_:e.ipaddr=_})(Fo)});var Hi=S((HA,Vi)=>{var Zi=require("stream").Stream,up=require("util");Vi.exports=de;function de(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(de,"DelayedStream");up.inherits(de,Zi);de.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(de.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});de.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};de.prototype.resume=function(){this._released||this.release(),this.source.resume()};de.prototype.pause=function(){this.source.pause()};de.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};de.prototype.pipe=function(){var e=Zi.prototype.pipe.apply(this,arguments);return this.resume(),e};de.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)};de.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 Ki=S((GA,Wi)=>{var cp=require("util"),Gi=require("stream").Stream,qi=Hi();Wi.exports=Y;function Y(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(Y,"CombinedStream");cp.inherits(Y,Gi);Y.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};Y.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};Y.prototype.append=function(e){var t=Y.isStreamLike(e);if(t){if(!(e instanceof qi)){var r=qi.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};Y.prototype.pipe=function(e,t){return Gi.prototype.pipe.call(this,e,t),this.resume(),e};Y.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}};Y.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=Y.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};Y.prototype._pipeNext=function(e){this._currentStream=e;var t=Y.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()};Y.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};Y.prototype.write=function(e){this.emit("data",e)};Y.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};Y.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")};Y.prototype.end=function(){this._reset(),this.emit("end")};Y.prototype.destroy=function(){this._reset(),this.emit("close")};Y.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};Y.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};Y.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)};Y.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Xi=S((KA,Ji)=>{"use strict";Ji.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 ea=S(oe=>{"use strict";var Jt=Xi(),lp=require("path").extname,Yi=/^\s*([^;\s]*)(?:;|\s|$)/,pp=/^text\//i;oe.charset=Qi;oe.charsets={lookup:Qi};oe.contentType=dp;oe.extension=mp;oe.extensions=Object.create(null);oe.lookup=fp;oe.types=Object.create(null);gp(oe.extensions,oe.types);function Qi(e){if(!e||typeof e!="string")return!1;var t=Yi.exec(e),r=t&&Jt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&pp.test(t[1])?"UTF-8":!1}o(Qi,"charset");function dp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?oe.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=oe.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(dp,"contentType");function mp(e){if(!e||typeof e!="string")return!1;var t=Yi.exec(e),r=t&&oe.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(mp,"extension");function fp(e){if(!e||typeof e!="string")return!1;var t=lp("x."+e).toLowerCase().substr(1);return t&&oe.types[t]||!1}o(fp,"lookup");function gp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Jt).forEach(o(function(i){var u=Jt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var h=r.indexOf(Jt[t[f]].source),x=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(h>x||h===x&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(gp,"populateMaps")});var ra=S((YA,ta)=>{ta.exports=yp;function yp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(yp,"defer")});var qr=S((ez,oa)=>{var na=ra();oa.exports=hp;function hp(e){var t=!1;return na(function(){t=!0}),o(function(n,i){t?e(n,i):na(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(hp,"async")});var Gr=S((rz,ia)=>{ia.exports=vp;function vp(e){Object.keys(e.jobs).forEach(xp.bind(e)),e.jobs={}}o(vp,"abort");function xp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(xp,"clean")});var Wr=S((oz,sa)=>{var aa=qr(),_p=Gr();sa.exports=Pp;function Pp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=bp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?_p(r):r.results[i]=c,n(u,r.results))})}o(Pp,"iterate");function bp(e,t,r,n){var i;return e.length==2?i=e(r,aa(n)):i=e(r,t,aa(n)),i}o(bp,"runJob")});var Kr=S((az,ua)=>{ua.exports=Tp;function Tp(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(i,u){return t(e[i],e[u])}),n}o(Tp,"state")});var Jr=S((uz,ca)=>{var Ep=Gr(),Ip=qr();ca.exports=Sp;function Sp(e){Object.keys(this.jobs).length&&(this.index=this.size,Ep(this),Ip(e)(null,this.results))}o(Sp,"terminator")});var pa=S((lz,la)=>{var $p=Wr(),Ap=Kr(),zp=Jr();la.exports=Op;function Op(e,t,r){for(var n=Ap(e);n.index<(n.keyedList||e).length;)$p(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return zp.bind(n,r)}o(Op,"parallel")});var Xr=S((dz,Xt)=>{var da=Wr(),kp=Kr(),Rp=Jr();Xt.exports=wp;Xt.exports.ascending=ma;Xt.exports.descending=Np;function wp(e,t,r,n){var i=kp(e,r);return da(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){da(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Rp.bind(i,n)}o(wp,"serialOrdered");function ma(e,t){return e<t?-1:e>t?1:0}o(ma,"ascending");function Np(e,t){return-1*ma(e,t)}o(Np,"descending")});var ga=S((fz,fa)=>{var Dp=Xr();fa.exports=Cp;function Cp(e,t,r){return Dp(e,t,null,r)}o(Cp,"serial")});var ha=S((yz,ya)=>{ya.exports={parallel:pa(),serial:ga(),serialOrdered:Xr()}});var Yr=S((hz,va)=>{"use strict";va.exports=Object});var _a=S((vz,xa)=>{"use strict";xa.exports=Error});var ba=S((xz,Pa)=>{"use strict";Pa.exports=EvalError});var Ea=S((_z,Ta)=>{"use strict";Ta.exports=RangeError});var Sa=S((Pz,Ia)=>{"use strict";Ia.exports=ReferenceError});var Aa=S((bz,$a)=>{"use strict";$a.exports=SyntaxError});var Yt=S((Tz,za)=>{"use strict";za.exports=TypeError});var ka=S((Ez,Oa)=>{"use strict";Oa.exports=URIError});var wa=S((Iz,Ra)=>{"use strict";Ra.exports=Math.abs});var Da=S((Sz,Na)=>{"use strict";Na.exports=Math.floor});var Ua=S(($z,Ca)=>{"use strict";Ca.exports=Math.max});var La=S((Az,Ma)=>{"use strict";Ma.exports=Math.min});var Ba=S((zz,ja)=>{"use strict";ja.exports=Math.pow});var Za=S((Oz,Fa)=>{"use strict";Fa.exports=Math.round});var Ha=S((kz,Va)=>{"use strict";Va.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ga=S((wz,qa)=>{"use strict";var Up=Ha();qa.exports=o(function(t){return Up(t)||t===0?t:t<0?-1:1},"sign")});var Ka=S((Dz,Wa)=>{"use strict";Wa.exports=Object.getOwnPropertyDescriptor});var Qr=S((Cz,Ja)=>{"use strict";var Qt=Ka();if(Qt)try{Qt([],"length")}catch{Qt=null}Ja.exports=Qt});var Ya=S((Uz,Xa)=>{"use strict";var er=Object.defineProperty||!1;if(er)try{er({},"a",{value:1})}catch{er=!1}Xa.exports=er});var en=S((Mz,Qa)=>{"use strict";Qa.exports=o(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 i=42;t[r]=i;for(var u 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 c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var rs=S((jz,ts)=>{"use strict";var es=typeof Symbol<"u"&&Symbol,Mp=en();ts.exports=o(function(){return typeof es!="function"||typeof Symbol!="function"||typeof es("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Mp()},"hasNativeSymbols")});var tn=S((Fz,ns)=>{"use strict";ns.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var rn=S((Zz,os)=>{"use strict";var Lp=Yr();os.exports=Lp.getPrototypeOf||null});var ss=S((Vz,as)=>{"use strict";var jp="Function.prototype.bind called on incompatible ",Bp=Object.prototype.toString,Fp=Math.max,Zp="[object Function]",is=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Vp=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),Hp=o(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");as.exports=o(function(t){var r=this;if(typeof r!="function"||Bp.apply(r)!==Zp)throw new TypeError(jp+r);for(var n=Vp(arguments,1),i,u=o(function(){if(this instanceof i){var x=r.apply(this,is(n,arguments));return Object(x)===x?x:this}return r.apply(t,is(n,arguments))},"binder"),c=Fp(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+Hp(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var We=S((qz,us)=>{"use strict";var qp=ss();us.exports=Function.prototype.bind||qp});var tr=S((Gz,cs)=>{"use strict";cs.exports=Function.prototype.call});var nn=S((Wz,ls)=>{"use strict";ls.exports=Function.prototype.apply});var ds=S((Kz,ps)=>{"use strict";ps.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var fs=S((Jz,ms)=>{"use strict";var Gp=We(),Wp=nn(),Kp=tr(),Jp=ds();ms.exports=Jp||Gp.call(Kp,Wp)});var ys=S((Xz,gs)=>{"use strict";var Xp=We(),Yp=Yt(),Qp=tr(),ed=fs();gs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Yp("a function is required");return ed(Xp,Qp,t)},"callBindBasic")});var bs=S((Qz,Ps)=>{"use strict";var td=ys(),hs=Qr(),xs;try{xs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var on=!!xs&&hs&&hs(Object.prototype,"__proto__"),_s=Object,vs=_s.getPrototypeOf;Ps.exports=on&&typeof on.get=="function"?td([on.get]):typeof vs=="function"?o(function(t){return vs(t==null?t:_s(t))},"getDunder"):!1});var $s=S((tO,Ss)=>{"use strict";var Ts=tn(),Es=rn(),Is=bs();Ss.exports=Ts?o(function(t){return Ts(t)},"getProto"):Es?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Es(t)},"getProto"):Is?o(function(t){return Is(t)},"getProto"):null});var an=S((nO,As)=>{"use strict";var rd=Function.prototype.call,nd=Object.prototype.hasOwnProperty,od=We();As.exports=od.call(rd,nd)});var Ds=S((oO,Ns)=>{"use strict";var B,id=Yr(),ad=_a(),sd=ba(),ud=Ea(),cd=Sa(),Ye=Aa(),Xe=Yt(),ld=ka(),pd=wa(),dd=Da(),md=Ua(),fd=La(),gd=Ba(),yd=Za(),hd=Ga(),Rs=Function,sn=o(function(e){try{return Rs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Pt=Qr(),vd=Ya(),un=o(function(){throw new Xe},"throwTypeError"),xd=Pt?(function(){try{return arguments.callee,un}catch{try{return Pt(arguments,"callee").get}catch{return un}}})():un,Ke=rs()(),re=$s(),_d=rn(),Pd=tn(),ws=nn(),bt=tr(),Je={},bd=typeof Uint8Array>"u"||!re?B:re(Uint8Array),Le={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?B:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?B:ArrayBuffer,"%ArrayIteratorPrototype%":Ke&&re?re([][Symbol.iterator]()):B,"%AsyncFromSyncIteratorPrototype%":B,"%AsyncFunction%":Je,"%AsyncGenerator%":Je,"%AsyncGeneratorFunction%":Je,"%AsyncIteratorPrototype%":Je,"%Atomics%":typeof Atomics>"u"?B:Atomics,"%BigInt%":typeof BigInt>"u"?B:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?B:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?B:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?B:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ad,"%eval%":eval,"%EvalError%":sd,"%Float16Array%":typeof Float16Array>"u"?B:Float16Array,"%Float32Array%":typeof Float32Array>"u"?B:Float32Array,"%Float64Array%":typeof Float64Array>"u"?B:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?B:FinalizationRegistry,"%Function%":Rs,"%GeneratorFunction%":Je,"%Int8Array%":typeof Int8Array>"u"?B:Int8Array,"%Int16Array%":typeof Int16Array>"u"?B:Int16Array,"%Int32Array%":typeof Int32Array>"u"?B:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ke&&re?re(re([][Symbol.iterator]())):B,"%JSON%":typeof JSON=="object"?JSON:B,"%Map%":typeof Map>"u"?B:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ke||!re?B:re(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":id,"%Object.getOwnPropertyDescriptor%":Pt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?B:Promise,"%Proxy%":typeof Proxy>"u"?B:Proxy,"%RangeError%":ud,"%ReferenceError%":cd,"%Reflect%":typeof Reflect>"u"?B:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?B:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ke||!re?B:re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?B:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ke&&re?re(""[Symbol.iterator]()):B,"%Symbol%":Ke?Symbol:B,"%SyntaxError%":Ye,"%ThrowTypeError%":xd,"%TypedArray%":bd,"%TypeError%":Xe,"%Uint8Array%":typeof Uint8Array>"u"?B:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?B:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?B:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?B:Uint32Array,"%URIError%":ld,"%WeakMap%":typeof WeakMap>"u"?B:WeakMap,"%WeakRef%":typeof WeakRef>"u"?B:WeakRef,"%WeakSet%":typeof WeakSet>"u"?B:WeakSet,"%Function.prototype.call%":bt,"%Function.prototype.apply%":ws,"%Object.defineProperty%":vd,"%Object.getPrototypeOf%":_d,"%Math.abs%":pd,"%Math.floor%":dd,"%Math.max%":md,"%Math.min%":fd,"%Math.pow%":gd,"%Math.round%":yd,"%Math.sign%":hd,"%Reflect.getPrototypeOf%":Pd};if(re)try{null.error}catch(e){zs=re(re(e)),Le["%Error.prototype%"]=zs}var zs,Td=o(function e(t){var r;if(t==="%AsyncFunction%")r=sn("async function () {}");else if(t==="%GeneratorFunction%")r=sn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=sn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&re&&(r=re(i.prototype))}return Le[t]=r,r},"doEval"),Os={__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"]},Tt=We(),rr=an(),Ed=Tt.call(bt,Array.prototype.concat),Id=Tt.call(ws,Array.prototype.splice),ks=Tt.call(bt,String.prototype.replace),nr=Tt.call(bt,String.prototype.slice),Sd=Tt.call(bt,RegExp.prototype.exec),$d=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ad=/\\(\\)?/g,zd=o(function(t){var r=nr(t,0,1),n=nr(t,-1);if(r==="%"&&n!=="%")throw new Ye("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ye("invalid intrinsic syntax, expected opening `%`");var i=[];return ks(t,$d,function(u,c,l,f){i[i.length]=l?ks(f,Ad,"$1"):c||u}),i},"stringToPath"),Od=o(function(t,r){var n=t,i;if(rr(Os,n)&&(i=Os[n],n="%"+i[0]+"%"),rr(Le,n)){var u=Le[n];if(u===Je&&(u=Td(n)),typeof u>"u"&&!r)throw new Xe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ye("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ns.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Xe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Xe('"allowMissing" argument must be a boolean');if(Sd(/^%?[^%]*%?$/,t)===null)throw new Ye("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=zd(t),i=n.length>0?n[0]:"",u=Od("%"+i+"%",r),c=u.name,l=u.value,f=!1,h=u.alias;h&&(i=h[0],Id(n,Ed([0,1],h)));for(var x=1,I=!0;x<n.length;x+=1){var _=n[x],s=nr(_,0,1),d=nr(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ye("property names with quotes must have matching quotes");if((_==="constructor"||!I)&&(f=!0),i+="."+_,c="%"+i+"%",rr(Le,c))l=Le[c];else if(l!=null){if(!(_ in l)){if(!r)throw new Xe("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pt&&x+1>=n.length){var g=Pt(l,_);I=!!g,I&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[_]}else I=rr(l,_),l=l[_];I&&!f&&(Le[c]=l)}}return l},"GetIntrinsic")});var Us=S((aO,Cs)=>{"use strict";var kd=en();Cs.exports=o(function(){return kd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var js=S((uO,Ls)=>{"use strict";var Rd=Ds(),Ms=Rd("%Object.defineProperty%",!0),wd=Us()(),Nd=an(),Dd=Yt(),or=wd?Symbol.toStringTag:null;Ls.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new Dd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");or&&(n||!Nd(t,or))&&(Ms?Ms(t,or,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[or]=r)},"setToStringTag")});var Fs=S((lO,Bs)=>{"use strict";var Cd=Function.prototype.call,Ud=Object.prototype.hasOwnProperty,Md=We();Bs.exports=Md.call(Cd,Ud)});var Vs=S((pO,Zs)=>{"use strict";Zs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Gs=S((dO,qs)=>{"use strict";var dn=Ki(),Ld=require("util"),cn=require("path"),jd=require("http"),Bd=require("https"),Fd=require("url").parse,Zd=require("fs"),Vd=require("stream").Stream,Hd=require("crypto"),ln=ea(),qd=ha(),Gd=js(),we=Fs(),pn=Vs();function Hs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Hs,"escapeHeaderParam");function Z(e){if(!(this instanceof Z))return new Z(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],dn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(Z,"FormData");Ld.inherits(Z,dn);Z.LINE_BREAK=`\r
2
+ `;Z.DEFAULT_CONTENT_TYPE="application/octet-stream";Z.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=dn.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 i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};Z.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)+Z.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&we(t,"httpVersion"))&&!(t instanceof Vd))&&(r.knownLength||this._valuesToMeasure.push(t))};Z.prototype._lengthRetriever=function(e,t){we(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Zd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):we(e,"httpVersion")?t(null,Number(e.headers["content-length"])):we(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};Z.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Hs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&pn(c,r.header);var l;for(var f in c)if(we(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=f+": "+l.join("; ")+Z.LINE_BREAK)}return"--"+this.getBoundary()+Z.LINE_BREAK+u+Z.LINE_BREAK};Z.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=cn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=cn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=cn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Hs(r)+'"'};Z.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=ln.lookup(e.name)),!r&&e&&e.path&&(r=ln.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=ln.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=Z.DEFAULT_CONTENT_TYPE),r};Z.prototype._multiPartFooter=function(){return function(e){var t=Z.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};Z.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Z.LINE_BREAK};Z.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)we(e,t)&&(r[t.toLowerCase()]=e[t]);return r};Z.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};Z.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Z.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(Z.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};Z.prototype._generateBoundary=function(){this._boundary="--------------------------"+Hd.randomBytes(12).toString("hex")};Z.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};Z.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};Z.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}qd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};Z.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Fd(e),n=pn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=pn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Bd.request(n):r=jd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=o(function(h,x){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,h,x)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};Z.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};Z.prototype.toString=function(){return"[object FormData]"};Gd(Z.prototype,"FormData");qs.exports=Z});var lm={};vn(lm,{resend:()=>cm,resendAuth:()=>A});module.exports=Su(lm);var $u=Object.freeze({status:"aborted"});function T(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let h=c.prototype,x=Object.keys(h);for(let I=0;I<x.length;I++){let _=x[I];_ in l||(l[_]=h[_].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var f;let h=r?.Parent?new u:this;n(h,l),(f=h._zod).deferred??(f.deferred=[]);for(let x of h._zod.deferred)x();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var me=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},It=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},sr={};function he(e){return e&&Object.assign(sr,e),sr}o(he,"config");function cr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(cr,"getEnumValues");function Pn(e,t){return typeof t=="bigint"?t.toString():t}o(Pn,"jsonStringifyReplacer");function $t(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o($t,"cached");function bn(e){return e==null}o(bn,"nullish");function At(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(At,"cleanRegex");var _n=Symbol("evaluating");function ee(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==_n)return n===void 0&&(n=_n,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(ee,"defineLazy");var lr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(tt,"isObject");var Au=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Tn(e){if(tt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(tt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Tn,"isPlainObject");var En=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(je,"escapeRegex");function zt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(zt,"clone");function G(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>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:o(()=>t.error,"error")}:t}o(G,"normalizeParams");function In(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(In,"optionalKeys");var Sn={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 Be(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}o(Be,"aborted");function Ee(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Ee,"prefixIssues");function St(e){return typeof e=="string"?e:e?.message}o(St,"unwrapMessage");function Ie(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=St(e.inst?._zod.def?.error?.(e))??St(t?.error?.(e))??St(r.customError?.(e))??St(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Ie,"finalizeIssue");function $n(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o($n,"getLengthableOrigin");function pr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(pr,"issue");var An=o((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,Pn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),zn=T("$ZodError",An),rt=T("$ZodError",An,{Parent:Error});var Ou=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new me;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Ie(f,u,he())));throw lr(l,i?.callee),l}return c.value},"_parse"),Ot=Ou(rt),ku=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Ie(f,u,he())));throw lr(l,i?.callee),l}return c.value},"_parseAsync"),kt=ku(rt),Ru=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new me;return u.issues.length?{success:!1,error:new(e??zn)(u.issues.map(c=>Ie(c,i,he())))}:{success:!0,data:u.value}},"_safeParse"),nt=Ru(rt),wu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Ie(c,i,he())))}:{success:!0,data:u.value}},"_safeParseAsync"),ot=wu(rt);var Nu="(?:(?:\\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])))",Du=new RegExp(`^${Nu}$`);var On=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),kn=/^-?\d+n?$/,Rn=/^-?\d+$/,dr=/^-?\d+(?:\.\d+)?$/,wn=/^(?:true|false)$/i;var Se=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Cu={number:"number",bigint:"bigint",object:"date"};var Nn=T("$ZodCheckGreaterThan",(e,t)=>{Se.init(e,t);let r=Cu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.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 Dn=T("$ZodCheckNumberFormat",(e,t)=>{Se.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Sn[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=i,l.maximum=u,r&&(l.pattern=Rn)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.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}):c.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<i&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>u&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Cn=T("$ZodCheckMinLength",(e,t)=>{var r;Se.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!bn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=$n(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var mr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Se.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Un=T("$ZodCheckRegex",(e,t)=>{mr.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 Ln={major:4,minor:3,patch:6};var J=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ln;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,f)=>{let h=Be(c),x;for(let I of l){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(h)continue;let _=c.issues.length,s=I._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new me;if(x||s instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await s,c.issues.length!==_&&(h||(h=Be(c,_)))});else{if(c.issues.length===_)continue;h||(h=Be(c,_))}}return x?x.then(()=>c):c},"runChecks"),u=o((c,l,f)=>{if(Be(c))return c.aborted=!0,c;let h=i(l,n,f);if(h instanceof Promise){if(f.async===!1)throw new me;return h.then(x=>e._zod.parse(x,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(x=>u(x,c,l)):u(h,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new me;return f.then(h=>i(h,n,l))}return i(f,n,l)}}ee(e,"~standard",()=>({validate:o(i=>{try{let u=nt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return ot(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nt=T("$ZodString",(e,t)=>{J.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??On(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}}),fr=T("$ZodStringFormat",(e,t)=>{mr.init(e,t),Nt.init(e,t)});var Vn=T("$ZodURL",(e,t)=>{fr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.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=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var gr=T("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=e._zod.bag.pattern??dr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),Hn=T("$ZodNumberFormat",(e,t)=>{Dn.init(e,t),gr.init(e,t)}),yr=T("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=wn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),qn=T("$ZodBigInt",(e,t)=>{J.init(e,t),e._zod.pattern=kn,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 Gn=T("$ZodAny",(e,t)=>{J.init(e,t),e._zod.parse=r=>r}),Wn=T("$ZodUnknown",(e,t)=>{J.init(e,t),e._zod.parse=r=>r});var Kn=T("$ZodVoid",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Jn=T("$ZodDate",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function jn(e,t,r){e.issues.length&&t.issues.push(...Ee(r,e.issues)),t.value[r]=e.value}o(jn,"handleArrayResult");var Xn=T("$ZodArray",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(h=>jn(h,r,c))):jn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function wt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ee(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(wt,"handlePropertyResult");function Uu(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=In(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Uu,"normalizeDef");function Mu(e,t,r,n,i,u){let c=[],l=i.keySet,f=i.catchall._zod,h=f.def.type,x=f.optout==="optional";for(let I in t){if(l.has(I))continue;if(h==="never"){c.push(I);continue}let _=f.run({value:t[I],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>wt(s,r,I,t,x))):wt(_,r,I,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Mu,"handleCatchall");var Yn=T("$ZodObject",(e,t)=>{if(J.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=$t(()=>Uu(t));ee(e._zod,"propValues",()=>{let l=t.shape,f={};for(let h in l){let x=l[h]._zod;if(x.values){f[h]??(f[h]=new Set);for(let I of x.values)f[h].add(I)}}return f});let i=tt,u=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let h=l.value;if(!i(h))return l.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),l;l.value={};let x=[],I=c.shape;for(let _ of c.keys){let s=I[_],d=s._zod.optout==="optional",g=s._zod.run({value:h[_],issues:[]},f);g instanceof Promise?x.push(g.then(m=>wt(m,l,_,h,d))):wt(g,l,_,h,d)}return u?Mu(x,h,l,f,n.value,e):x.length?Promise.all(x).then(()=>l):l}});function Bn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Be(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Ie(c,n,he())))}),t)}o(Bn,"handleUnionResults");var hr=T("$ZodUnion",(e,t)=>{J.init(e,t),ee(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ee(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ee(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ee(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>At(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let f of t.options){let h=f._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)l.push(h),c=!0;else{if(h.issues.length===0)return h;l.push(h)}}return c?Promise.all(l).then(f=>Bn(f,i,e,u)):Bn(l,i,e,u)}});var Qn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,hr.init(e,t);let r=e._zod.parse;ee(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let h of f)i[l].add(h)}}return i});let n=$t(()=>{let i=t.options,u=new Map;for(let c of i){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of l){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!tt(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var eo=T("$ZodRecord",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Tn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){l.add(typeof h=="number"?h.toString():h);let x=t.valueType._zod.run({value:i[h],issues:[]},n);x instanceof Promise?u.push(x.then(I=>{I.issues.length&&r.issues.push(...Ee(h,I.issues)),r.value[h]=I.value})):(x.issues.length&&r.issues.push(...Ee(h,x.issues)),r.value[h]=x.value)}let f;for(let h in i)l.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(i)){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"&&dr.test(l)&&f.issues.length){let I=t.keyType._zod.run({value:Number(l),issues:[]},n);if(I instanceof Promise)throw new Error("Async schemas not supported in object keys currently");I.issues.length===0&&(f=I)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(I=>Ie(I,n,he())),input:l,path:[l],inst:e});continue}let x=t.valueType._zod.run({value:i[l],issues:[]},n);x instanceof Promise?u.push(x.then(I=>{I.issues.length&&r.issues.push(...Ee(l,I.issues)),r.value[f.value]=I.value})):(x.issues.length&&r.issues.push(...Ee(l,x.issues)),r.value[f.value]=x.value)}}return u.length?Promise.all(u).then(()=>r):r}});var to=T("$ZodEnum",(e,t)=>{J.init(e,t);let r=cr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>En.has(typeof i)).map(i=>typeof i=="string"?je(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),ro=T("$ZodLiteral",(e,t)=>{if(J.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"?je(n):n?je(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var no=T("$ZodTransform",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new It(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new me;return r.value=i,r}});function Fn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Fn,"handleOptionalResult");var oo=T("$ZodOptional",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${At(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Fn(u,r.value)):Fn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var io=T("$ZodNullable",(e,t)=>{J.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${At(r.source)}|null)$`):void 0}),ee(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 ao=T("$ZodPipe",(e,t)=>{J.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Rt(c,t.in,n)):Rt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Rt(u,t.out,n)):Rt(i,t.out,n)}});function Rt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Rt,"handlePipeResult");var so=T("$ZodCustom",(e,t)=>{Se.init(e,t),J.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Zn(u,r,n,e));Zn(i,r,n,e)}});function Zn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(pr(i))}}o(Zn,"handleRefineResult");var co;var vr=class{static{o(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 i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function lo(){return new vr}o(lo,"registry");(co=globalThis).__zod_globalRegistry??(co.__zod_globalRegistry=lo());var xr=globalThis.__zod_globalRegistry;function po(e,t){return new e({type:"string",...G(t)})}o(po,"_string");function mo(e,t){return new e({type:"string",coerce:!0,...G(t)})}o(mo,"_coercedString");function fo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...G(t)})}o(fo,"_url");function go(e,t){return new e({type:"number",checks:[],...G(t)})}o(go,"_number");function yo(e,t){return new e({type:"number",coerce:!0,checks:[],...G(t)})}o(yo,"_coercedNumber");function ho(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...G(t)})}o(ho,"_int");function vo(e,t){return new e({type:"boolean",...G(t)})}o(vo,"_boolean");function xo(e,t){return new e({type:"boolean",coerce:!0,...G(t)})}o(xo,"_coercedBoolean");function _o(e,t){return new e({type:"bigint",coerce:!0,...G(t)})}o(_o,"_coercedBigint");function Po(e){return new e({type:"any"})}o(Po,"_any");function bo(e){return new e({type:"unknown"})}o(bo,"_unknown");function To(e,t){return new e({type:"void",...G(t)})}o(To,"_void");function Eo(e,t){return new e({type:"date",coerce:!0,...G(t)})}o(Eo,"_coercedDate");function Dt(e,t){return new Nn({check:"greater_than",...G(t),value:e,inclusive:!0})}o(Dt,"_gte");function pe(e,t){return new Cn({check:"min_length",...G(t),minimum:e})}o(pe,"_minLength");function $e(e,t){return new Un({check:"string_format",format:"regex",...G(t),pattern:e})}o($e,"_regex");function Io(e,t,r){let n=G(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Io,"_custom");var te=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");J.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Ot(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>nt(e,r,n),e.parseAsync=async(r,n)=>kt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ot(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)=>zt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Ut=T("ZodMiniString",(e,t)=>{Nt.init(e,t),te.init(e,t)});function a(e){return po(Ut,e)}o(a,"string");var So=T("ZodMiniStringFormat",(e,t)=>{fr.init(e,t),Ut.init(e,t)});var Xu=T("ZodMiniURL",(e,t)=>{Vn.init(e,t),So.init(e,t)});function $o(e){return fo(Xu,e)}o($o,"url");var Mt=T("ZodMiniNumber",(e,t)=>{gr.init(e,t),te.init(e,t)});function ne(e){return go(Mt,e)}o(ne,"number");var Yu=T("ZodMiniNumberFormat",(e,t)=>{Hn.init(e,t),Mt.init(e,t)});function Ao(e){return ho(Yu,e)}o(Ao,"int");var _r=T("ZodMiniBoolean",(e,t)=>{yr.init(e,t),te.init(e,t)});function H(e){return vo(_r,e)}o(H,"boolean");var zo=T("ZodMiniBigInt",(e,t)=>{qn.init(e,t),te.init(e,t)});var Qu=T("ZodMiniAny",(e,t)=>{Gn.init(e,t),te.init(e,t)});function at(){return Po(Qu)}o(at,"any");var ec=T("ZodMiniUnknown",(e,t)=>{Wn.init(e,t),te.init(e,t)});function w(){return bo(ec)}o(w,"unknown");var tc=T("ZodMiniVoid",(e,t)=>{Kn.init(e,t),te.init(e,t)});function Oo(e){return To(tc,e)}o(Oo,"_void");var ko=T("ZodMiniDate",(e,t)=>{Jn.init(e,t),te.init(e,t)});var rc=T("ZodMiniArray",(e,t)=>{Xn.init(e,t),te.init(e,t)});function U(e,t){return new rc({type:"array",element:e,...G(t)})}o(U,"array");var nc=T("ZodMiniObject",(e,t)=>{Yn.init(e,t),te.init(e,t),ee(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...G(t)};return new nc(r)}o(p,"object");var oc=T("ZodMiniUnion",(e,t)=>{hr.init(e,t),te.init(e,t)});function M(e,t){return new oc({type:"union",options:e,...G(t)})}o(M,"union");var ic=T("ZodMiniDiscriminatedUnion",(e,t)=>{Qn.init(e,t),te.init(e,t)});function Ae(e,t,r){return new ic({type:"union",options:t,discriminator:e,...G(r)})}o(Ae,"discriminatedUnion");var ac=T("ZodMiniRecord",(e,t)=>{eo.init(e,t),te.init(e,t)});function N(e,t,r){return new ac({type:"record",keyType:e,valueType:t,...G(r)})}o(N,"record");var sc=T("ZodMiniEnum",(e,t)=>{to.init(e,t),te.init(e,t),e.options=Object.values(t.entries)});function j(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new sc({type:"enum",entries:r,...G(t)})}o(j,"_enum");var uc=T("ZodMiniLiteral",(e,t)=>{ro.init(e,t),te.init(e,t)});function z(e,t){return new uc({type:"literal",values:Array.isArray(e)?e:[e],...G(t)})}o(z,"literal");var cc=T("ZodMiniTransform",(e,t)=>{no.init(e,t),te.init(e,t)});function ze(e){return new cc({type:"transform",transform:e})}o(ze,"transform");var lc=T("ZodMiniOptional",(e,t)=>{oo.init(e,t),te.init(e,t)});function y(e){return new lc({type:"optional",innerType:e})}o(y,"optional");var pc=T("ZodMiniNullable",(e,t)=>{io.init(e,t),te.init(e,t)});function st(e){return new pc({type:"nullable",innerType:e})}o(st,"nullable");var dc=T("ZodMiniPipe",(e,t)=>{ao.init(e,t),te.init(e,t)});function Oe(e,t){return new dc({type:"pipe",in:e,out:t})}o(Oe,"pipe");var mc=T("ZodMiniCustom",(e,t)=>{so.init(e,t),te.init(e,t)});function Lt(e,t){return Io(mc,e??(()=>!0),t)}o(Lt,"custom");var ut={};vn(ut,{bigint:()=>xc,boolean:()=>vc,date:()=>_c,number:()=>hc,string:()=>yc});function yc(e){return mo(Ut,e)}o(yc,"string");function hc(e){return yo(Mt,e)}o(hc,"number");function vc(e){return xo(_r,e)}o(vc,"boolean");function xc(e){return _o(zo,e)}o(xc,"bigint");function _c(e){return Eo(ko,e)}o(_c,"date");var br=p({retryOnFailure:p({defaultValue:y(H()),hide:y(H())}),continueOnFailure:p({defaultValue:y(H()),hide:y(H())})}),Pr=class{constructor(t,r,n,i,u,c,l,f,h,x,I){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=x;this.aiMetadata=I}static{o(this,"IAction")}},C=o(e=>new Pr(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 V=p({displayName:a(),description:y(a())}),L=o((e,t)=>p({type:z(t),required:H(),defaultValue:y(at())}),"TPropertyValue");var ae=p({...V.shape,...L(a(),"SHORT_TEXT").shape}),ve=p({...V.shape,...L(a(),"LONG_TEXT").shape});var wo=p({label:a(),value:w()}),jt=p({disabled:y(H()),placeholder:y(a()),options:U(wo)});var se=p({...V.shape,options:jt,...L(w(),"STATIC_DROPDOWN").shape}),xe=p({...V.shape,options:jt,...L(U(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Tr=p({...V.shape,...L(w(),"DROPDOWN").shape,refreshers:U(a())}),ct=p({...V.shape,...L(U(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:U(a())});var _e=p({...V.shape,...L(H(),"CHECKBOX").shape});var Pe=p({...V.shape,...L(ne(),"NUMBER").shape});var lt=p({...V.shape,streaming:y(H()),...L(w(),"FILE").shape});var pt=p({...V.shape,...L(a(),"DATE_TIME").shape});var No=N(a(),M([ae,ve,se,ct,xe,_e,Pe,lt,pt])),dt=p({...V.shape,properties:No,...L(U(w()),"ARRAY").shape});var mt=p({...V.shape,...L(M([N(a(),w())]),"JSON").shape});var Do=M([ae,se,mt,dt,xe]),bc=N(a(),Do),Er=p({refreshers:U(a()),...V.shape,...L(w(),"DYNAMIC").shape});var Bt=p({...V.shape,...L(Oo(),"MARKDOWN").shape});var ft=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ft||{}),Fe=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Fe||{}),Ze=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Ze||{});var gt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(gt||{}),Ir="both_client_credentials_and_authorization_code";var ke=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ke||{}),yt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(yt||{}),Tc=p({strategy:j(yt),paramName:y(a())}),ht=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ht||{});var Ft=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ft||{}),Co=p({status:y(ne()),body:y(w()),headers:y(N(a(),a()))}),Uo=p({type:z("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(j(Ft))}),Mo=p({type:z("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:Co,handlerId:y(a()),streamStepProgress:y(j(Ft))}),Ec=M([Uo,Mo]);var Ic=p({body:w(),rawBody:y(w()),headers:N(a(),a()),queryParams:N(a(),a())});function ue(e){return e==null}o(ue,"isNil");function vt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(vt,"isEmpty");function Zt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Zt,"assertNotNullOrUndefined");var Sr=Ne(require("crypto"),1);var Sc=128,De,Ve,$c=o(e=>{!De||De.length<e?(De=Buffer.allocUnsafe(e*Sc),Sr.default.randomFillSync(De),Ve=0):Ve+e>De.length&&(Sr.default.randomFillSync(De),Ve=0),Ve+=e},"fillPool"),Ac=o(e=>($c(e|=0),De.subarray(Ve-e,Ve)),"random"),zc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===u)return c}}},"customRandom"),jo=o((e,t=21)=>zc(e,t,Ac),"customAlphabet");var Oc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Bo=21,Hb=a().check($e(new RegExp(`^[0-9a-zA-Z]{${Bo}}$`))),kc=jo(Oc,Bo);var Re=Oe(ze(e=>e instanceof Date?e.toISOString():e),a()),ce={id:a(),created:Re,updated:Re},W=o(e=>y(st(e)),"Nullable");function $r(e){return y(st(j(e)))}o($r,"NullableEnum");var Wb=Oe(ze(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(H())),Vt=o(e=>Oe(ze(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(U(e))),"OptionalArrayFromQuery");var Xb=N(a(),w());var xt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(xt||{});var cT=a().check($e(/^#[0-9A-Fa-f]{6}$/));var pT=p({filename:a(),data:w(),type:z("file"),mimetype:y(a())});var Rc=Ne(Zo());var vT=p({...ce,name:a(),permissions:U(a()),platformId:W(a()),type:a(),userCount:y(ne())});var Vo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Vo||{}),Ar=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ar||{}),zr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(zr||{});var Or=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Or||{});var kr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(kr||{});var wc=p({mode:j(Vo),value:w()}),Nc=p({auth:y(a()),fields:N(a(),wc)}),Dc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(Nc)}),Cc=p({type:z("PIECE"),toolName:a().check(pe(1)),pieceMetadata:Dc}),Uc=p({type:z("none")}),Mc=p({type:z("access_token"),accessToken:a()}),Lc=p({type:z("api_key"),apiKey:a(),apiKeyHeader:a()}),jc=p({type:z("headers"),headers:N(a(),a())}),Bc=Ae("type",[Uc,Mc,Lc,jc]),Ho=p({type:z("FLOW"),toolName:a().check(pe(1)),externalFlowId:a(),flowDisplayName:y(a())}),qo=p({type:z("MCP"),toolName:a().check(pe(1)),serverUrl:$o(),protocol:j(zr),auth:Bc}),Go=p({type:z("KNOWLEDGE_BASE"),toolName:a().check(pe(1)),sourceType:j(Ar),sourceId:a(),sourceName:a()}),Fc=Ae("type",[Cc,Ho,qo,Go]),Zc=p({displayName:a(),description:y(a()),type:j(Or)}),Wo=p({type:z("MARKDOWN"),markdown:a()}),He={type:z("TOOL_CALL"),input:W(N(a(),w())),output:y(w()),toolName:a(),status:j(kr),toolCallId:a(),startTime:a(),endTime:y(a())},KT=p(He),Ko=Ae("toolCallType",[p({...He,toolCallType:z("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...He,toolCallType:z("FLOW"),displayName:a(),externalFlowId:a()}),p({...He,toolCallType:z("MCP"),displayName:a(),serverUrl:a()}),p({...He,toolCallType:z("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...He,toolCallType:z("UNKNOWN"),displayName:a()})]),Vc=M([Wo,Ko]);var Rr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Rr||{}),be=p({apiKey:a()}),Hc=be,qc=p({apiKey:a(),apiKeyHash:a()}),Gc=be,Wc=be,Kc=be,Jc=be,Xc=be,Yc=be,Qc=be,ei=p({accessKeyId:a().check(pe(1)),secretAccessKey:a().check(pe(1))}),el=p({}),tl=p({}),rl=p({}),nl=p({}),ol=p({}),il=p({}),ti=p({modelId:a(),modelName:a(),modelType:j(Rr)}),ri=p({apiKeyHeader:a(),baseUrl:a(),models:U(ti),defaultHeaders:y(N(a(),a()))}),ni=p({accountId:a(),gatewayId:a(),models:U(ti),vertexProject:y(a()),vertexRegion:y(a())}),oi=p({resourceName:a(),apiVersion:Oe(ze(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),ii=p({region:a().check(pe(1))}),al=M([Hc,Kc,Jc,Xc,Yc,Wc,Gc,qc,ei,Qc]),ai=M([ri,ni,oi,ii,el,rl,nl,ol,tl,il]),sl=p({id:a(),name:a(),type:j(Rr)}),ul=p({id:a(),name:a(),provider:j(xt),config:ai,enabledForChat:H()}),cl=p({provider:j(xt),config:ai,auth:al,platformId:a()});var QT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Jo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],ll=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],pl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Xo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],dl=["grok-4.20","grok-4.1-fast"],ml={openai:Jo,anthropic:ll,google:Xo,activepieces:[...pl.map(e=>`anthropic/${e}`),...Jo.map(e=>`openai/${e}`),...Xo.map(e=>`google/${e}`),...dl.map(e=>`x-ai/${e}`)]};var Yo=128e3,fl={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function gl({provider:e}){return e?fl[e]??Yo:Yo}o(gl,"getMaxContextTokens");var Qo={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"},yl={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},hl=new Set(["anthropic","mistral"]);function fe(e){return{chatModels:ml[e],maxContextTokens:gl({provider:e}),defaultEmbeddingModel:Qo[e],supportsEmbedding:Qo[e]!==void 0,supportsImageGeneration:!hl.has(e),webSearch:yl[e]}}o(fe,"buildProviderCapabilities");var vl={openai:fe("openai"),anthropic:fe("anthropic"),openrouter:fe("openrouter"),azure:fe("azure"),google:fe("google"),"cloudflare-gateway":fe("cloudflare-gateway"),custom:fe("custom"),bedrock:fe("bedrock"),mistral:fe("mistral"),activepieces:fe("activepieces")};var xl=p({base64Url:a(),fileName:a(),extension:y(a())}),_l=p({mimeType:a(),url:a(),fileName:y(a())}),wr=M([xl,_l]);var Pl=M([p({type:z("file"),value:wr}),p({type:z("markdown"),value:a(),files:y(U(wr))})]),bl=p({sessionId:a(),message:a(),files:y(U(a()))});var ui=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ui||{}),ci=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ci||{}),Nr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Nr||{});var Tl=M([p({...ce,name:a(),externalId:a(),type:z("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:U(p({value:a()}))})}),p({...ce,name:a(),externalId:a(),type:M([z("TEXT"),z("NUMBER"),z("DATE")]),tableId:a(),projectId:a()})]),El=p({...ce,name:a(),folderId:W(a()),projectId:a(),externalId:a(),status:$r(ci),trigger:$r(ui)}),Il=p({...ce,tableId:a(),projectId:a(),cells:N(a(),p({updated:a(),created:a(),value:w(),fieldName:a()}))}),Sl=p({events:U(j(Nr)),webhookUrl:a(),flowId:a()}),$l=p({fields:U(p({id:a(),name:a()})),rows:U(N(a(),a())),name:a()}),Al=p({projectId:a(),limit:y(ut.number()),cursor:y(a()),name:y(a()),externalIds:Vt(a()),folderId:y(a()),folderIds:Vt(a())}),zl=p({records:U(U(p({fieldId:a(),value:pi()}))),tableId:a()}),Ol=p({cells:y(U(p({fieldId:a(),value:pi()}))),tableId:a(),agentUpdate:y(H())}),li=Ae("operator",[Ce("eq"),Ce("neq"),Ce("gt"),Ce("gte"),Ce("lt"),Ce("lte"),Ce("co"),si("exists"),si("not_exists")]),kl=p({tableId:a(),limit:y(ut.number()),cursor:y(a()),filters:Vt(li)});function pi(){return Oe(ze(e=>e==null?e:String(e)),st(a()))}o(pi,"coerceToString");function Ce(e){return p({fieldId:a(),operator:z(e),value:a()})}o(Ce,"valueFilter");function si(e){return p({fieldId:a(),operator:z(e)})}o(si,"existenceFilter");var Rl=p({status:y(ne()),body:y(w()),headers:y(N(a(),a()))}),wl=p({...ce,deleted:W(Re),ownerId:a(),displayName:a(),platformId:a(),externalId:W(a())});var di=p({name:a(),description:y(a()),type:a(),required:H()}),Nl=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:U(di),returnsResponse:H()})});var mi="^[0-9]+\\.[0-9]+\\.[0-9]+$",vE=new RegExp(mi),Cl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",xE=a().check($e(new RegExp(mi))),_E=a().check($e(new RegExp(Cl))),Ul=p({packageType:z("ARCHIVE"),pieceType:j(Fe),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),fi=p({packageType:z("REGISTRY"),pieceType:z("OFFICIAL"),pieceName:a(),pieceVersion:a()}),gi=p({packageType:z("REGISTRY"),pieceType:z("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),PE=M([fi,gi]),bE=M([Ul,fi,gi]);var Ml=Ae("type",[p({type:z("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:z("INTERVAL"),intervalMs:Ao().check(Dt(6e4))})]),TE=p({...ce,type:j(ke),projectId:a(),flowId:a(),triggerName:a(),schedule:W(Ml),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:W(a()),simulate:H()}),yi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(yi||{}),hi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(hi||{}),vi=(r=>(r.S3="S3",r.DB="DB",r))(vi||{}),EE=p({...ce,projectId:W(a()),platformId:W(a()),type:j(yi),compression:j(hi),data:y(w()),location:j(vi),size:W(ne()),fileName:W(a()),s3Key:W(a()),metadata:W(N(a(),a()))}),xi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(xi||{}),_i=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(_i||{}),IE=p({id:a(),email:a(),firstName:a(),status:j(_i),externalId:W(a()),platformId:W(a()),platformRole:j(xi),lastName:a(),created:Re,updated:Re,lastActiveDate:W(Re),imageUrl:W(a())});var Dr=p({...V.shape,...L(N(a(),w()),"OBJECT").shape});var Ei=p({...V.shape,...L(a(),"COLOR").shape});var Cr=M([ae,ve,Bt,_e,se,xe,Tr,ct,Er,Pe,dt,Dr,mt,pt,lt,Ei]),b={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=p({displayName:a(),description:y(a())});var Ii=p({username:a(),password:a()}),Ur=p({...ge.shape,username:p({displayName:a(),description:y(a())}),password:p({displayName:a(),description:y(a())}),...L(Ii,"BASIC_AUTH").shape});var Fl=N(a(),M([ae,ve,Pe,_e,se])),Mr=p({...ge.shape,props:Fl,...L(w(),"CUSTOM_AUTH").shape});var Ue=p({...ge.shape,...L(p({auth:a()}),"SECRET_TEXT").shape});var Zl=N(a(),M([ae,ve,Ue,Pe,_e,se,xe,Bt])),Si=p({...ge.shape,props:Zl,...L(w(),"OIDC").shape});var Lr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Lr||{}),$i=M([ae,Ue,se]),Ai=N(a(),$i),Vl=p({props:y(N(a(),$i)),authUrl:a(),tokenUrl:a(),scope:U(a()),prompt:y(M([z("none"),z("consent"),z("login"),z("omit")])),pkce:y(H()),pkceMethod:y(M([z("plain"),z("S256")])),authorizationMethod:y(j(Lr)),grantType:y(M([j(gt),z(Ir)])),extra:y(N(a(),a()))}),zi=p({access_token:a(),props:y(Ai),data:N(a(),at())}),jr=p({...ge.shape,...Vl.shape,...L(zi,"OAUTH2").shape});var qe=M([Ur,Mr,Si,jr,Ue]),_t="Connection",Br={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||_t}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||_t,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||_t}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||_t}},None(){}};var nS={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 Hl=p({...V.shape,...L(w(),"CUSTOM").shape,code:a()});var ql=M([Cr,qe]),Fr=N(a(),ql),TS=N(a(),Cr);var Oi=M([p({strategy:z("CRON"),cronExpression:a()}),p({strategy:z("NONE")})]),Ge=class{constructor(t,r,n,i,u,c,l,f,h,x,I,_,s,d,g,m,v,P,F){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=l;this.onHandshake=f;this.renewConfiguration=h;this.onRenew=x;this.onEnable=I;this.onDisable=_;this.onStart=s;this.run=d;this.test=g;this.sampleData=m;this.testStrategy=v;this.outputSchema=P;this.aiMetadata=F}static{o(this,"ITrigger")}},ki=o(e=>{switch(e.type){case"WEBHOOK":return new Ge(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 Ge(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 Ge(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 Ge(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,ue(e.sampleData)&&ue(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Ri="2",qt="0.82.0";var Zr=class{constructor(t,r,n,i,u,c,l,f,h=qt,x,I="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=x;this.description=I;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ri}),"getContextInfo");(!Gl(h)||Wl(h,qt))&&(this.minimumSupportedRelease=qt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,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}},wi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Zr(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 Gl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Gl,"isValidSimpleSemver");function Wl(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,l]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(Wl,"isSemverLessThan");var Kl=y(N(a(),N(a(),a()))),Ni=p({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:U(a()),platformId:y(a()),directoryPath:y(a()),auth:y(M([qe,U(qe)])),version:a(),categories:y(U(j(Ze))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),deprecated:y(H()),i18n:Kl}),Jl=j(["human","ai","both"]),Di=p({description:y(a()),idempotent:y(H())}),Ci=p({name:a(),displayName:a(),description:a(),props:Fr,requireAuth:H(),errorHandlingOptions:y(br),outputSchema:y(Lt()),audience:y(Jl),aiMetadata:y(Di)}),Ui=p({name:a(),displayName:a(),description:a(),props:Fr,errorHandlingOptions:y(br),type:j(ke),sampleData:w(),handshakeConfiguration:y(Lt()),renewConfiguration:y(Oi),testStrategy:j(ht),outputSchema:y(Lt()),aiMetadata:y(Di)}),Xl=p({...Ni.shape,actions:N(a(),Ci),triggers:N(a(),Ui)}),Yl=p({...Ni.shape,actions:ne(),triggers:ne(),suggestedActions:y(U(Ci)),suggestedTriggers:y(U(Ui))}),Mi=p({projectUsage:ne(),pieceType:j(Fe),packageType:j(ft),platformId:y(a()),archiveId:y(a())}),T$=p({...Xl.shape,...Mi.shape}),E$=p({...Yl.shape,...Mi.shape}),I$=p({name:a(),version:a()});var Ql=Ne(require("path")),ep=Ne(require("fs/promises"));var Fi=require("node:stream");var Gt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}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 Wt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Vr,r=new Hr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Vr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Hr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Me=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Li({error:e,requestBody:t}){return e instanceof Me?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Li,"toFailsafeOutput");var q=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(q||{});var Kt=class extends Gt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Wt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[F,ie]of Object.entries(c))i.append(F,ie);let l=i.toString(),f=l?`${n}?${l}`:n,h=t.responseType??"json",x=t.followRedirects??!0,I=t.retries??0,{body:_,extraHeaders:s,isStream:d}=tp(t.method)?rp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},g=op({...u,...s}),m=await np(async()=>{let F=new AbortController,ie=t.timeout&&t.timeout>0?setTimeout(()=>F.abort(),t.timeout):void 0;try{let le={method:t.method.toString(),headers:g,body:_,redirect:x?"follow":"manual",signal:F.signal};return d&&(le.duplex="half"),r?.dispatcher!==void 0&&(le.dispatcher=r.dispatcher),await fetch(f,le)}finally{ie!==void 0&&clearTimeout(ie)}},I),v=x?300:400;if(m.status<200||m.status>=v){let F=await ji(m,h),ie=new Me(t.body,{status:m.status,responseBody:F});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ie),ie}let P=await ji(m,h);return{status:m.status,headers:ip(m.headers),body:P}}};function tp(e){return e!=="GET"&&e!=="HEAD"}o(tp,"acceptsRequestBody");function rp(e,t){if(sp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(ap(e)){let n=new Fi.PassThrough;return e.on("error",i=>n.destroy(i)),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}}o(rp,"serializeBody");async function ji(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}}}}o(ji,"parseResponseBody");async function np(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Bi(n);continue}return i}catch(i){if(r=i,n<t){await Bi(n);continue}throw i}throw r}o(np,"sendWithRetries");function Bi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Bi,"backoff");function op(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}o(op,"normalizeHeaders");function ip(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(ip,"toHttpHeaders");function ap(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(ap,"isNodeFormData");function sp(e){return e==null}o(sp,"isNil");var $=new Kt;var Wd=Ne(require("fs")),Ws=Ne(Gs());var Kd={"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 Jd(e){let t=e.split(";")[0].trim().toLowerCase();return Kd[t]??""}o(Jd,"contentTypeToExtension");var Xd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Yd=o((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 Ks({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:f="headers"}){return C({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:b.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:b.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${Yd(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:b.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(q).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:b.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:b.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:b.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:b.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let x=h,I={};switch(x){case"none":break;case"json":I.data=b.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=b.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.data=b.Array({displayName:"Form Data",required:!0,properties:{fieldName:b.ShortText({displayName:"Field Name",required:!0}),fieldType:b.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:b.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:b.File({displayName:"File Field Value",required:!1})}});break}return I},"props")}),response_is_binary:b.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:b.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:b.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:b.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async h=>{let{method:x,url:I,headers:_,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:P,followRedirects:F}=h.propsValue;Zt(x,"Method"),Zt(I,"URL");let ie=ue(r)?{}:await r(h.auth,h.propsValue),le=I.url,Qe=le.startsWith("http://")||le.startsWith("https://")?le:Xd({baseUrl:t(h.auth),relativePath:le}),Te={method:x,url:Qe,headers:{..._??{},...f==="headers"||!ue(f)?ie:{}},queryParams:{...f==="queryParams"?ie:{},...s??{}},timeout:v?v*1e3:0,followRedirects:F};if(P&&(Te.responseType="arraybuffer"),d)if(g&&g!=="none"){let ye=d.data;if(g==="form_data"){let _u=ye,Et=new Ws.default;for(let{fieldName:gn,fieldType:yn,textFieldValue:hn,fileFieldValue:ar}of _u)yn==="text"&&!vt(hn)?Et.append(gn,hn):yn==="file"&&!vt(ar)&&Et.append(gn,ar.data,{filename:ar?.filename});Te.body=Et,Te.headers={...Te.headers,...Et.getHeaders()}}else Te.body=ye}else g||(Te.body=d);try{let ye=await $.sendRequest(Te);return await Qd(h.files,ye.body,ye.status,ye.headers,P)}catch(ye){if(m)return Li({error:ye,requestBody:Te.body});throw ye}},"run")})}o(Ks,"createCustomApiCallAction");var Qd=o(async(e,t,r,n,i)=>{let u;if(i&&em(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Jd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${l}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),em=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Js=C({auth:A,name:"send_email",displayName:"Send Email",description:"Send a text or HTML email",audience:"both",aiMetadata:{description:"Sends a single transactional email (plain text or HTML) to one or more recipients via Resend. Use this for one-off messages; the sender address must be on a domain you have verified in Resend. Not idempotent \u2014 each call sends a new email.",idempotent:!1},props:{to:b.Array({displayName:"To",description:"Emails of the recipients",required:!0}),from_name:b.ShortText({displayName:"Sender Name",description:"Sender name",required:!0}),from:b.ShortText({displayName:"Sender Email (From)",description:"Sender email",required:!0}),bcc:b.Array({displayName:"BCC",description:"List of emails in bcc",required:!1}),cc:b.Array({displayName:"CC",description:"List of emails in cc",required:!1}),reply_to:b.ShortText({displayName:"Reply To",description:"Email to receive replies on (defaults to sender)",required:!1}),subject:b.ShortText({displayName:"Subject",description:void 0,required:!0}),content_type:b.Dropdown({auth:A,displayName:"Content Type",refreshers:[],required:!0,defaultValue:"html",options:o(async()=>({disabled:!1,options:[{label:"Plain Text",value:"text"},{label:"HTML",value:"html"}]}),"options")}),content:b.ShortText({displayName:"Content",description:"HTML is only allowed if you selected HTML as type",required:!0})},async run(e){let{to:t,from:r,from_name:n,reply_to:i,subject:u,content_type:c,content:l,cc:f,bcc:h}=e.propsValue,x={to:t,from:n?`${n} <${r}>`:r,reply_to:i??r,cc:f,bcc:h,subject:u};return c==="text"?x.text=l:c==="html"&&(x.html=l),await $.sendRequest({method:"POST",url:"https://api.resend.com/emails",body:x,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:{}})}});var tm="https://api.resend.com",Xs=C({name:"send_batch_emails",auth:A,displayName:"Send Batch Emails",description:"Send up to 100 emails in a single API call",audience:"both",aiMetadata:{description:"Sends up to 100 distinct emails in one Resend API call, each with its own recipient, subject, and body. Use this instead of Send Email when delivering many independent messages at once. Senders must be on verified domains; pass an idempotency key to guard against duplicate batch sends, otherwise each call sends new emails.",idempotent:!1},props:{emails:b.Array({displayName:"Emails",description:"List of emails to send (max 100). Each email is sent independently with its own recipient, subject, and body.",required:!0,properties:{from:b.ShortText({displayName:"From",description:'Sender address. Use "Name <email@domain.com>" for a friendly name.',required:!0}),to:b.ShortText({displayName:"To",description:"Recipient email address.",required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),content_type:b.StaticDropdown({displayName:"Content Type",required:!0,options:{options:[{label:"HTML",value:"html"},{label:"Plain Text",value:"text"}]}}),content:b.LongText({displayName:"Content",description:"Email body. Use HTML markup if Content Type is HTML.",required:!0}),reply_to:b.ShortText({displayName:"Reply To",required:!1}),cc:b.ShortText({displayName:"CC",required:!1}),bcc:b.ShortText({displayName:"BCC",required:!1})}}),idempotency_key:b.ShortText({displayName:"Idempotency Key",description:"Optional unique key to prevent duplicate sends. Must be unique per request, expires after 24 hours, max 256 characters.",required:!1})},async run({auth:e,propsValue:t}){let r=(t.emails??[]).map(u=>{let c=u,l={from:c.from,to:c.to,subject:c.subject};return c.content_type==="html"?l.html=c.content:l.text=c.content,c.reply_to&&(l.reply_to=c.reply_to),c.cc&&(l.cc=c.cc),c.bcc&&(l.bcc=c.bcc),l}),n={};return t.idempotency_key&&(n["Idempotency-Key"]=t.idempotency_key),(await $.sendRequest({method:"POST",url:`${tm}/emails/batch`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},headers:n,body:r})).body.data}});var ir="https://api.resend.com",rm=b.Dropdown({displayName:"Audience",required:!0,auth:A,refreshers:[],options:o(async({auth:e})=>e?{options:(await $.sendRequest({method:"GET",url:`${ir}/audiences`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),nm=b.Dropdown({displayName:"Domain",required:!0,auth:A,refreshers:[],options:o(async({auth:e})=>e?{options:(await $.sendRequest({method:"GET",url:`${ir}/domains`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),om=b.Dropdown({displayName:"Broadcast",required:!0,auth:A,refreshers:[],options:o(async({auth:e})=>e?{options:(await $.sendRequest({method:"GET",url:`${ir}/broadcasts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name?`${r.name} \u2014 ${r.subject}`:r.subject,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),im=b.Dropdown({displayName:"Contact",required:!0,auth:A,refreshers:["audience_id"],options:o(async({auth:e,audience_id:t})=>!e||!t?{disabled:!0,placeholder:"Select an audience first",options:[]}:{options:(await $.sendRequest({method:"GET",url:`${ir}/audiences/${String(t)}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(n=>{let i=[n.first_name,n.last_name].filter(Boolean).join(" ");return{label:i?`${i} <${n.email}>`:n.email,value:n.id}})},"options")}),Q={audienceId:rm,domainId:nm,broadcastId:om,contactId:im};var Ys=C({name:"create_contact",auth:A,displayName:"Create Contact",description:"Add a contact to a Resend audience",audience:"both",aiMetadata:{description:"Adds a new contact (email plus optional name and subscription status) to a specific Resend audience. Use this to grow a mailing list; requires the target audience ID (use List Audiences to find it). Not idempotent \u2014 each call creates a new contact, so guard against re-adding the same email.",idempotent:!1},props:{audience_id:Q.audienceId,email:b.ShortText({displayName:"Email",required:!0}),first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),unsubscribed:b.Checkbox({displayName:"Unsubscribed",description:"If true, the contact will be unsubscribed from all broadcasts",required:!1,defaultValue:!1})},async run({auth:e,propsValue:t}){let r={email:t.email};return t.first_name&&(r.first_name=t.first_name),t.last_name&&(r.last_name=t.last_name),t.unsubscribed!==void 0&&(r.unsubscribed=t.unsubscribed),(await $.sendRequest({method:"POST",url:`https://api.resend.com/audiences/${t.audience_id}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var Qs=C({name:"update_contact",auth:A,displayName:"Update Contact",description:"Update the name or subscription status of a contact in an audience",audience:"both",aiMetadata:{description:"Updates an existing contact's first name, last name, or subscribed/unsubscribed status within an audience, identified by audience ID and contact ID. Use this to change details or toggle subscription for a known contact. Idempotent \u2014 repeating with the same values leaves the contact in the same state.",idempotent:!0},props:{audience_id:Q.audienceId,contact_id:Q.contactId,first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),unsubscribed:b.StaticDropdown({displayName:"Subscription Status",required:!1,options:{options:[{label:"Subscribed",value:!1},{label:"Unsubscribed",value:!0}]}})},async run({auth:e,propsValue:t}){let r={};return t.first_name!==void 0&&t.first_name!==""&&(r.first_name=t.first_name),t.last_name!==void 0&&t.last_name!==""&&(r.last_name=t.last_name),t.unsubscribed!==void 0&&t.unsubscribed!==null&&(r.unsubscribed=t.unsubscribed),(await $.sendRequest({method:"PATCH",url:`https://api.resend.com/audiences/${t.audience_id}/contacts/${t.contact_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var eu=C({name:"delete_contact",auth:A,displayName:"Delete Contact",description:"Remove a contact from an audience",audience:"both",aiMetadata:{description:"Permanently removes a contact from a Resend audience, identified by audience ID and contact ID. Use this to delete a subscriber from a list. Effectively idempotent \u2014 once removed, repeating the call has no further effect.",idempotent:!0},props:{audience_id:Q.audienceId,contact_id:Q.contactId},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"DELETE",url:`https://api.resend.com/audiences/${t.audience_id}/contacts/${t.contact_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var tu=C({name:"list_contacts",auth:A,displayName:"List Contacts",description:"Retrieve all contacts in an audience",audience:"both",aiMetadata:{description:"Retrieves all contacts in a specific Resend audience, including each contact's ID, email, name, and subscription status. Use this to discover contact IDs (e.g. to feed Update Contact or Delete Contact) or to inspect a mailing list; requires the audience ID. Read-only and idempotent.",idempotent:!0},props:{audience_id:Q.audienceId},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"GET",url:`https://api.resend.com/audiences/${t.audience_id}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data}});var ru=C({name:"get_email_status",auth:A,displayName:"Get Email Status",description:"Retrieve the delivery status of a sent email",audience:"both",aiMetadata:{description:"Looks up the current delivery status and details of a single previously sent email by its Resend email ID. Use this to check whether a specific email was delivered, bounced, or is still scheduled. Read-only and idempotent; requires the email ID returned when the email was sent.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:"The ID returned when you sent the email",required:!0})},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"GET",url:`https://api.resend.com/emails/${t.email_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var nu=C({name:"list_emails",auth:A,displayName:"List Sent Emails",description:"Retrieve a list of emails sent from your Resend account",audience:"both",aiMetadata:{description:"Retrieves the list of emails sent from the connected Resend account, including their IDs, recipients, subjects, and latest delivery event. Use this to discover email IDs (e.g. to feed Get Email Status, Cancel Scheduled Email, or Reschedule Email) or to audit recent sends. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await $.sendRequest({method:"GET",url:"https://api.resend.com/emails",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,from:r.from,to:(r.to??[]).join(", "),subject:r.subject,last_event:r.last_event,created_at:r.created_at,scheduled_at:r.scheduled_at??"",cc:(r.cc??[]).join(", "),bcc:(r.bcc??[]).join(", "),reply_to:(r.reply_to??[]).join(", ")}))}});var ou=C({name:"cancel_scheduled_email",auth:A,displayName:"Cancel Scheduled Email",description:"Cancel a scheduled email before it is sent",audience:"both",aiMetadata:{description:"Cancels a previously scheduled email so it will not be delivered, identified by its Resend email ID. Use this to stop a future send before its scheduled time. Effectively idempotent \u2014 once an email is cancelled, repeating the call has no further effect; only works while the email is still pending.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:'The ID of the scheduled email to cancel. Use "List Sent Emails" to find it.',required:!0})},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"POST",url:`https://api.resend.com/emails/${t.email_id}/cancel`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var iu=C({name:"reschedule_email",auth:A,displayName:"Reschedule Email",description:"Update the send time of a scheduled email",audience:"both",aiMetadata:{description:"Changes the future send time of an already scheduled email, identified by its Resend email ID. Use this to move a pending send to a new time without cancelling and recreating it. Idempotent when called with the same target time; requires an ISO 8601 date-time and only works while the email is still scheduled.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:'The ID of the scheduled email to reschedule. Use "List Sent Emails" to find it.',required:!0}),scheduled_at:b.ShortText({displayName:"New Send Time",description:"ISO 8601 date-time for when to send the email, e.g. 2024-12-01T10:00:00Z",required:!0})},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"PATCH",url:`https://api.resend.com/emails/${t.email_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:{scheduled_at:t.scheduled_at}})).body}});var au=C({name:"list_domains",auth:A,displayName:"List Domains",description:"Retrieve all domains added to your Resend account",audience:"both",aiMetadata:{description:"Retrieves all sending domains configured on the connected Resend account, including each domain's ID, name, verification status, and region. Use this to find a domain ID (e.g. for Verify Domain or Delete Domain) or to check which domains are verified before sending. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await $.sendRequest({method:"GET",url:"https://api.resend.com/domains",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,name:r.name,status:r.status,region:r.region,created_at:r.created_at,sending:r.capabilities?.sending??"",receiving:r.capabilities?.receiving??""}))}});var su=C({name:"create_domain",auth:A,displayName:"Create Domain",description:"Add a sending domain to your Resend account and get the DNS records to verify it",audience:"both",aiMetadata:{description:"Registers a new sending domain on the Resend account and returns the DNS records that must be added to verify it. Use this as the first step in setting up a custom sending domain before triggering verification. Not idempotent \u2014 each call attempts to create a new domain entry.",idempotent:!1},props:{name:b.ShortText({displayName:"Domain Name",description:"The domain you want to send from, e.g. mail.yourdomain.com",required:!0}),region:b.StaticDropdown({displayName:"Region",description:"AWS region for email delivery. Defaults to US East.",required:!1,options:{options:[{label:"US East (N. Virginia)",value:"us-east-1"},{label:"EU West (Ireland)",value:"eu-west-1"},{label:"Asia Pacific (Tokyo)",value:"ap-northeast-1"},{label:"South America (S\xE3o Paulo)",value:"sa-east-1"}]}})},async run({auth:e,propsValue:t}){let r={name:t.name};t.region&&(r.region=t.region);let i=(await $.sendRequest({method:"POST",url:"https://api.resend.com/domains",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body;return{id:i.id,name:i.name,status:i.status,region:i.region,created_at:i.created_at,sending:i.capabilities?.sending??"",receiving:i.capabilities?.receiving??"",dns_records:i.records}}});var uu=C({name:"delete_domain",auth:A,displayName:"Delete Domain",description:"Remove a domain from your Resend account",audience:"both",aiMetadata:{description:"Permanently removes a sending domain from the Resend account, identified by its domain ID. Use this to decommission a domain you no longer send from. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{domain_id:Q.domainId},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"DELETE",url:`https://api.resend.com/domains/${t.domain_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var cu=C({name:"verify_domain",auth:A,displayName:"Verify Domain",description:"Trigger a DNS verification check for a domain",audience:"both",aiMetadata:{description:"Triggers Resend to re-check the DNS records of a domain and update its verification status, identified by domain ID. Use this after adding the required DNS records (from Create Domain) to confirm the domain is ready to send. Safe to call repeatedly \u2014 it only re-runs the check.",idempotent:!0},props:{domain_id:Q.domainId},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"POST",url:`https://api.resend.com/domains/${t.domain_id}/verify`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var lu=C({name:"list_audiences",auth:A,displayName:"List Audiences",description:"Retrieve all contact audiences in your Resend account",audience:"both",aiMetadata:{description:"Retrieves all contact audiences (mailing lists) in the connected Resend account, including each audience's ID and name. Use this to discover an audience ID needed by contact and broadcast actions (e.g. Create Contact, List Contacts, Create Broadcast). Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await $.sendRequest({method:"GET",url:"https://api.resend.com/audiences",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data}});var pu=C({name:"create_audience",auth:A,displayName:"Create Audience",description:"Create a new contact audience in Resend",audience:"both",aiMetadata:{description:"Creates a new contact audience (mailing list) in Resend with the given name and returns its ID. Use this before adding contacts or sending broadcasts when no suitable audience exists yet. Not idempotent \u2014 each call creates a new audience even if the name matches an existing one.",idempotent:!1},props:{name:b.ShortText({displayName:"Audience Name",description:'A label for this audience, e.g. "Newsletter Subscribers"',required:!0})},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"POST",url:"https://api.resend.com/audiences",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:{name:t.name}})).body}});var du=C({name:"delete_audience",auth:A,displayName:"Delete Audience",description:"Permanently delete an audience and all its contacts",audience:"both",aiMetadata:{description:"Permanently deletes an entire audience and all of its contacts from Resend, identified by audience ID. Use this to remove a whole mailing list; this is destructive and cannot be undone. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{audience_id:Q.audienceId},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"DELETE",url:`https://api.resend.com/audiences/${t.audience_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var mu=C({name:"list_broadcasts",auth:A,displayName:"List Broadcasts",description:"Retrieve all broadcasts in your Resend account",audience:"both",aiMetadata:{description:"Retrieves all broadcast campaigns in the connected Resend account, including each broadcast's ID, name, audience, subject, and status (draft, scheduled, sent). Use this to find a broadcast ID (e.g. for Send Broadcast or Delete Broadcast) or to check campaign status. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await $.sendRequest({method:"GET",url:"https://api.resend.com/broadcasts",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,name:r.name??"",audience_id:r.audience_id,from:r.from,subject:r.subject,reply_to:Array.isArray(r.reply_to)?r.reply_to.join(", "):r.reply_to??"",preview_text:r.preview_text??"",status:r.status,created_at:r.created_at,scheduled_at:r.scheduled_at??"",sent_at:r.sent_at??""}))}});var fu=C({name:"create_broadcast",auth:A,displayName:"Create Broadcast",description:"Create a new broadcast email to send to an audience",audience:"both",aiMetadata:{description:"Creates a draft broadcast email (subject and body) targeting a Resend audience and returns its ID. Use this to prepare a campaign; it only creates the draft and does not deliver anything \u2014 pair it with Send Broadcast to actually send. Requires the audience ID and a sender on a verified domain. Not idempotent \u2014 each call creates a new broadcast.",idempotent:!1},props:{audience_id:Q.audienceId,from:b.ShortText({displayName:"From",description:'Sender address. Must be from a verified domain. Use "Name <email@yourdomain.com>" for a friendly name.',required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),name:b.ShortText({displayName:"Broadcast Name",description:"Internal label for this broadcast. Not visible to recipients.",required:!1}),reply_to:b.ShortText({displayName:"Reply To",description:"Email address recipients will reply to.",required:!1}),preview_text:b.ShortText({displayName:"Preview Text",description:"Short summary shown in email clients below the subject line.",required:!1}),content_type:b.StaticDropdown({displayName:"Content Type",required:!0,options:{options:[{label:"HTML",value:"html"},{label:"Plain Text",value:"text"}]}}),content:b.LongText({displayName:"Content",description:"Email body. Use HTML markup if Content Type is HTML.",required:!0})},async run({auth:e,propsValue:t}){let r={audience_id:t.audience_id,from:t.from,subject:t.subject};return t.content_type==="html"?r.html=t.content:r.text=t.content,t.name&&(r.name=t.name),t.reply_to&&(r.reply_to=t.reply_to),t.preview_text&&(r.preview_text=t.preview_text),(await $.sendRequest({method:"POST",url:"https://api.resend.com/broadcasts",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var gu=C({name:"send_broadcast",auth:A,displayName:"Send Broadcast",description:"Send or schedule a broadcast email to its audience",audience:"both",aiMetadata:{description:"Sends an existing draft broadcast to its entire audience immediately, or schedules it for a future time, identified by broadcast ID. Use this after Create Broadcast to deliver the campaign. Not idempotent \u2014 repeating the call can dispatch the broadcast again; optionally pass an ISO 8601 time to schedule rather than send now.",idempotent:!1},props:{broadcast_id:Q.broadcastId,scheduled_at:b.ShortText({displayName:"Schedule For",description:"ISO 8601 date-time to schedule the send, e.g. 2024-12-01T10:00:00Z. Leave blank to send immediately.",required:!1})},async run({auth:e,propsValue:t}){let r={};return t.scheduled_at&&(r.scheduled_at=t.scheduled_at),(await $.sendRequest({method:"POST",url:`https://api.resend.com/broadcasts/${t.broadcast_id}/send`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var yu=C({name:"delete_broadcast",auth:A,displayName:"Delete Broadcast",description:"Permanently delete a broadcast from your Resend account",audience:"both",aiMetadata:{description:"Permanently deletes a broadcast from the Resend account, identified by broadcast ID. Use this to remove a draft or unwanted campaign; only broadcasts that have not been sent can be deleted. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{broadcast_id:Q.broadcastId},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"DELETE",url:`https://api.resend.com/broadcasts/${t.broadcast_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var fn=Ne(require("crypto"));var hu="https://api.resend.com",mn="webhookData",am=300,sm=[{label:"Email Sent",value:"email.sent"},{label:"Email Delivered",value:"email.delivered"},{label:"Email Delivery Delayed",value:"email.delivery_delayed"},{label:"Email Complained",value:"email.complained"},{label:"Email Bounced",value:"email.bounced"},{label:"Email Opened",value:"email.opened"},{label:"Email Clicked",value:"email.clicked"},{label:"Email Failed",value:"email.failed"},{label:"Email Received",value:"email.received"},{label:"Email Scheduled",value:"email.scheduled"},{label:"Email Suppressed",value:"email.suppressed"},{label:"Domain Created",value:"domain.created"},{label:"Domain Updated",value:"domain.updated"},{label:"Domain Deleted",value:"domain.deleted"},{label:"Contact Created",value:"contact.created"},{label:"Contact Updated",value:"contact.updated"},{label:"Contact Deleted",value:"contact.deleted"}];function um({rawBody:e,headers:t,signingSecret:r}){let n=t["svix-id"],i=t["svix-timestamp"],u=t["svix-signature"];if(!n||!i||!u)return!1;let c=Math.floor(Date.now()/1e3);if(Math.abs(c-parseInt(i,10))>am)return!1;let l=Buffer.isBuffer(e)?e.toString("utf8"):String(e),f=Buffer.from(r.replace("whsec_",""),"base64"),h=`${n}.${i}.${l}`,x=fn.default.createHmac("sha256",f).update(h).digest("base64");return u.split(" ").some(I=>{let[_,s]=I.split(",");if(_!=="v1"||!s)return!1;try{return fn.default.timingSafeEqual(Buffer.from(s,"base64"),Buffer.from(x,"base64"))}catch{return!1}})}o(um,"verifyResendWebhook");var vu=ki({name:"email_bounced",auth:A,displayName:"Email Event",description:"Triggers when a selected email or contact event occurs in Resend",aiMetadata:{description:"Fires when one of the subscribed Resend events occurs, such as an email being sent, delivered, bounced, opened, clicked, complained about, or failing, as well as domain and contact lifecycle events. The payload carries the event type and the affected email, domain, or contact. Subscribe to the specific event types you care about."},type:"WEBHOOK",props:{events:b.StaticMultiSelectDropdown({displayName:"Events",description:"Select one or more event types to subscribe to",required:!0,options:{options:sm}})},async onEnable(e){let t=await $.sendRequest({method:"POST",url:`${hu}/webhooks`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},body:{endpoint:e.webhookUrl,events:e.propsValue.events}});await e.store.put(mn,{id:t.body.id,signingSecret:t.body.signing_secret})},async onDisable(e){let t=await e.store.get(mn);t?.id&&await $.sendRequest({method:"DELETE",url:`${hu}/webhooks/${t.id}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})},async run(e){let t=await e.store.get(mn);return um({rawBody:e.payload.rawBody,headers:e.payload.headers,signingSecret:t?.signingSecret??""})?[e.payload.body]:[]},sampleData:{type:"email.bounced",created_at:"2024-03-08T09:37:40.912Z",data:{created_at:"2024-03-08T09:37:40.911Z",email_id:"562e3f00-6bad-4910-b1e3-38c2fca1e2ff",from:"onboarding@resend.dev",to:["john@example.com"],subject:"Re: Follow up"}}});var xu="https://api.resend.com",A=Br.SecretText({displayName:"API Key",description:`To get your API key:
4
4
  1. Log in to your [Resend dashboard](https://resend.com/overview)
5
5
  2. Go to **API Keys** in the left sidebar
6
- 3. Click **Create API Key**, give it a name, and copy the key`,required:!0,validate:o(async({auth:e})=>{try{return await S.sendRequest({method:"GET",url:`${iu}/api-keys`,authentication:{type:"BEARER_TOKEN",token:e}}),{valid:!0}}catch(t){if(t instanceof qe){let r=t.response.body;if(typeof r=="object"&&r!==null&&"name"in r&&r.name==="restricted_api_key")return{valid:!0}}return{valid:!1,error:"Invalid API key. Please check your Resend API key."}}},"validate")}),Fd=Pi({displayName:"Resend",description:"The email API for developers",auth:A,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/resend.png",categories:["COMMUNICATION"],authors:["Tosh94"],actions:[Cs,Us,Fs,Zs,Vs,Hs,Ms,js,Ls,Bs,qs,Ws,Gs,Ks,Js,Xs,Ys,Qs,eu,tu,ru,Ds({baseUrl:o(()=>iu,"baseUrl"),auth:A,authMapping:o(async e=>({Authorization:`Bearer ${e.secret_text}`}),"authMapping")})],triggers:[ou]});0&&(module.exports={resend,resendAuth});
6
+ 3. Click **Create API Key**, give it a name, and copy the key`,required:!0,validate:o(async({auth:e})=>{try{return await $.sendRequest({method:"GET",url:`${xu}/api-keys`,authentication:{type:"BEARER_TOKEN",token:e}}),{valid:!0}}catch(t){if(t instanceof Me){let r=t.response.body;if(typeof r=="object"&&r!==null&&"name"in r&&r.name==="restricted_api_key")return{valid:!0}}return{valid:!1,error:"Invalid API key. Please check your Resend API key."}}},"validate")}),cm=wi({displayName:"Resend",description:"The email API for developers",auth:A,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/resend.png",categories:["COMMUNICATION"],authors:["Tosh94"],actions:[Js,Xs,ru,nu,ou,iu,Ys,Qs,eu,tu,au,su,uu,cu,lu,pu,du,mu,fu,gu,yu,Ks({baseUrl:o(()=>xu,"baseUrl"),auth:A,authMapping:o(async e=>({Authorization:`Bearer ${e.secret_text}`}),"authMapping")})],triggers:[vu]});0&&(module.exports={resend,resendAuth});
7
7
  /*! Bundled license information:
8
8
 
9
9
  mime-types/index.js: