@activepieces/piece-elastic-email 0.2.3 → 0.2.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-elastic-email",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "main": "./src/index.js",
5
5
  "dependencies": {},
6
6
  "files": [
package/src/index.js CHANGED
@@ -1,13 +1,13 @@
1
- "use strict";var Qs=Object.create;var Qe=Object.defineProperty;var eu=Object.getOwnPropertyDescriptor;var tu=Object.getOwnPropertyNames;var ru=Object.getPrototypeOf,nu=Object.prototype.hasOwnProperty;var o=(e,t)=>Qe(e,"name",{value:t,configurable:!0});var I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hn=(e,t)=>{for(var r in t)Qe(e,r,{get:t[r],enumerable:!0})},vn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tu(t))!nu.call(e,i)&&i!==r&&Qe(e,i,{get:()=>t[i],enumerable:!(n=eu(t,i))||n.enumerable});return e};var we=(e,t,r)=>(r=e!=null?Qs(ru(e)):{},vn(t||!e||!e.__esModule?Qe(r,"default",{value:e,enumerable:!0}):r,e)),ou=e=>vn(Qe({},"__esModule",{value:!0}),e);var Co=I((Do,Bt)=>{(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,}",l="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${l})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${l})|(?:::)(?:${l})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function y(s,p){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let f=0,m=-1,v=(s.match(d.zoneIndex)||[])[0],b,j;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)f++;if(s.substr(0,2)==="::"&&f--,s.substr(-2,2)==="::"&&f--,f>p)return null;for(j=p-f,b=":";j--;)b+="0:";return s=s.replace("::",b),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),p=function(){let re=s.split(":"),ae=[];for(let Ye=0;Ye<re.length;Ye++)ae.push(parseInt(re[Ye],16));return ae}(),{parts:p,zoneId:v}}o(y,"expandIPv6");function h(s,p,f,m){if(s.length!==p.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,b;for(;m>0;){if(b=f-m,b<0&&(b=0),s[v]>>b!==p[v]>>b)return!1;m-=f,v+=1}return!0}o(h,"matchCIDR");function P(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(P,"parseIntAuto");function S(s,p){for(;s.length<p;)s=`0${s}`;return s}o(S,"padPart");let x={};x.IPv4=function(){function s(p){if(p.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let f,m;for(f=0;f<p.length;f++)if(m=p[f],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=p}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(p,f){let m;if(f===void 0&&(m=p,p=m[0],f=m[1]),p.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,p.octets,8,f)},s.prototype.prefixLengthFromSubnetMask=function(){let p=0,f=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,b,j;for(v=3;v>=0;v-=1)if(b=this.octets[v],b in m){if(j=m[b],f&&j!==0)return null;j!==8&&(f=!0),p+=j}else return null;return 32-p},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 p=this.parseCIDR(s),f=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],b=0;for(;b<4;)v.push(parseInt(f[b],10)|parseInt(m[b],10)^255),b++;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 p=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!p?!1:x.IPv4.isValidFourPartDecimal(p[1])},x.IPv4.networkAddressFromCIDR=function(s){let p,f,m,v,b;try{for(p=this.parseCIDR(s),m=p[0].toByteArray(),b=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],f=0;f<4;)v.push(parseInt(m[f],10)&parseInt(b[f],10)),f++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let p=this.parser(s);if(p===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(p)},x.IPv4.parseCIDR=function(s){let p;if(p=s.match(/^(.+)\/(\d+)$/)){let f=parseInt(p[2]);if(f>=0&&f<=32){let m=[this.parse(p[1]),f];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 p,f,m;if(p=s.match(r.fourOctet))return function(){let v=p.slice(1,6),b=[];for(let j=0;j<v.length;j++)f=v[j],b.push(P(f));return b}();if(p=s.match(r.longValue)){if(m=P(p[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],b;for(b=0;b<=24;b+=8)v.push(m>>b&255);return v}().reverse()}else return(p=s.match(r.twoOctet))?function(){let v=p.slice(1,4),b=[];if(m=P(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return b.push(P(v[0])),b.push(m>>16&255),b.push(m>>8&255),b.push(m&255),b}():(p=s.match(r.threeOctet))?function(){let v=p.slice(1,5),b=[];if(m=P(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return b.push(P(v[0])),b.push(P(v[1])),b.push(m>>8&255),b.push(m&255),b}():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let p=[0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)p[f]=255,f++;return m<4&&(p[m]=Math.pow(2,s%8)-1<<8-s%8),new this(p)},x.IPv6=function(){function s(p,f){let m,v;if(p.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(p[m]<<8|p[m+1]);else if(p.length===8)this.parts=p;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");f&&(this.zoneId=f)}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(p,f){let m;if(f===void 0&&(m=p,p=m[0],f=m[1]),p.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,p.parts,16,f)},s.prototype.prefixLengthFromSubnetMask=function(){let p=0,f=!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,b;for(let j=7;j>=0;j-=1)if(v=this.parts[j],v in m){if(b=m[v],f&&b!==0)return null;b!==16&&(f=!0),p+=b}else return null;return 128-p},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let p,f=[],m=this.parts;for(let v=0;v<m.length;v++)p=m[v],f.push(p>>8),f.push(p&255);return f},s.prototype.toFixedLengthString=function(){let p=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(S(this.parts[v].toString(16),4));return m}.call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),p+f},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let p=this.parts.slice(-2),f=p[0],m=p[1];return new x.IPv4([f>>8,f&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let p=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),p+f},s.prototype.toRFC5952String=function(){let p=/((^|:)(0(:|$)){2,})/g,f=this.toNormalizedString(),m=0,v=-1,b;for(;b=p.exec(f);)b[0].length>v&&(m=b.index,v=b[0].length);return v<0?f:`${f.substring(0,m)}::${f.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let p=this.parseCIDR(s),f=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],b=0;for(;b<16;)v.push(parseInt(f[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}catch(p){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${p})`)}},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 p=this.parser(s);return new this(p.parts,p.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 p,f,m,v,b;try{for(p=this.parseCIDR(s),m=p[0].toByteArray(),b=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],f=0;f<16;)v.push(parseInt(m[f],10)&parseInt(b[f],10)),f++;return new this(v)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},x.IPv6.parse=function(s){let p=this.parser(s);if(p.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(p.parts,p.zoneId)},x.IPv6.parseCIDR=function(s){let p,f,m;if((f=s.match(/^(.+)\/(\d+)$/))&&(p=parseInt(f[2]),p>=0&&p<=128))return m=[this.parse(f[1]),p],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 p,f,m,v,b,j;if(m=s.match(d.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(d.native.test(s))return y(s,8);if((m=s.match(d.transitional))&&(j=m[6]||"",p=m[1],m[1].endsWith("::")||(p=p.slice(0,-1)),p=y(p+j,6),p.parts)){for(b=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],f=0;f<b.length;f++)if(v=b[f],!(0<=v&&v<=255))return null;return p.parts.push(b[0]<<8|b[1]),p.parts.push(b[2]<<8|b[3]),{parts:p.parts,zoneId:p.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 p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)p[f]=255,f++;return m<16&&(p[m]=Math.pow(2,s%8)-1<<8-s%8),new this(p)},x.fromByteArray=function(s){let p=s.length;if(p===4)return new x.IPv4(s);if(p===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 p=this.parse(s);return p.kind()==="ipv6"&&p.isIPv4MappedAddress()?p.toIPv4Address():p},x.subnetMatch=function(s,p,f){let m,v,b,j;f==null&&(f="unicast");for(v in p)if(Object.prototype.hasOwnProperty.call(p,v)){for(b=p[v],b[0]&&!(b[0]instanceof Array)&&(b=[b]),m=0;m<b.length;m++)if(j=b[m],s.kind()===j[0].kind()&&s.match.apply(s,j))return v}return f},typeof Bt<"u"&&Bt.exports?Bt.exports=x:e.ipaddr=x})(Do)});var Ni=I((oA,ki)=>{var Oi=require("stream").Stream,wl=require("util");ki.exports=ue;function ue(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ue,"DelayedStream");wl.inherits(ue,Oi);ue.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(ue.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ue.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ue.prototype.resume=function(){this._released||this.release(),this.source.resume()};ue.prototype.pause=function(){this.source.pause()};ue.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ue.prototype.pipe=function(){var e=Oi.prototype.pipe.apply(this,arguments);return this.resume(),e};ue.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)};ue.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 Ci=I((aA,Di)=>{var Rl=require("util"),Ri=require("stream").Stream,wi=Ni();Di.exports=J;function J(){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(J,"CombinedStream");Rl.inherits(J,Ri);J.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};J.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};J.prototype.append=function(e){var t=J.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};J.prototype.pipe=function(e,t){return Ri.prototype.pipe.call(this,e,t),this.resume(),e};J.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}};J.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=J.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};J.prototype._pipeNext=function(e){this._currentStream=e;var t=J.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()};J.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};J.prototype.write=function(e){this.emit("data",e)};J.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};J.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")};J.prototype.end=function(){this._reset(),this.emit("end")};J.prototype.destroy=function(){this._reset(),this.emit("close")};J.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};J.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};J.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)};J.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Mi=I((uA,Ui)=>{"use strict";Ui.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 Fi=I(te=>{"use strict";var Kt=Mi(),Dl=require("path").extname,ji=/^\s*([^;\s]*)(?:;|\s|$)/,Cl=/^text\//i;te.charset=Li;te.charsets={lookup:Li};te.contentType=Ul;te.extension=Ml;te.extensions=Object.create(null);te.lookup=jl;te.types=Object.create(null);Ll(te.extensions,te.types);function Li(e){if(!e||typeof e!="string")return!1;var t=ji.exec(e),r=t&&Kt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Cl.test(t[1])?"UTF-8":!1}o(Li,"charset");function Ul(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Ul,"contentType");function Ml(e){if(!e||typeof e!="string")return!1;var t=ji.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Ml,"extension");function jl(e){if(!e||typeof e!="string")return!1;var t=Dl("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(jl,"lookup");function Ll(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Kt).forEach(o(function(i){var u=Kt[i],l=u.extensions;if(!(!l||!l.length)){e[i]=l;for(var d=0;d<l.length;d++){var y=l[d];if(t[y]){var h=r.indexOf(Kt[t[y]].source),P=r.indexOf(u.source);if(t[y]!=="application/octet-stream"&&(h>P||h===P&&t[y].substr(0,12)==="application/"))continue}t[y]=i}}},"forEachMimeType"))}o(Ll,"populateMaps")});var Zi=I((pA,Bi)=>{Bi.exports=Fl;function Fl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Fl,"defer")});var Gr=I((mA,Hi)=>{var Vi=Zi();Hi.exports=Bl;function Bl(e){var t=!1;return Vi(function(){t=!0}),o(function(n,i){t?e(n,i):Vi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Bl,"async")});var Wr=I((gA,qi)=>{qi.exports=Zl;function Zl(e){Object.keys(e.jobs).forEach(Vl.bind(e)),e.jobs={}}o(Zl,"abort");function Vl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Vl,"clean")});var Kr=I((hA,Wi)=>{var Gi=Gr(),Hl=Wr();Wi.exports=ql;function ql(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Gl(t,i,e[i],function(u,l){i in r.jobs&&(delete r.jobs[i],u?Hl(r):r.results[i]=l,n(u,r.results))})}o(ql,"iterate");function Gl(e,t,r,n){var i;return e.length==2?i=e(r,Gi(n)):i=e(r,t,Gi(n)),i}o(Gl,"runJob")});var Jr=I((xA,Ki)=>{Ki.exports=Wl;function Wl(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(Wl,"state")});var Xr=I((PA,Ji)=>{var Kl=Wr(),Jl=Gr();Ji.exports=Xl;function Xl(e){Object.keys(this.jobs).length&&(this.index=this.size,Kl(this),Jl(e)(null,this.results))}o(Xl,"terminator")});var Yi=I((TA,Xi)=>{var Yl=Kr(),Ql=Jr(),ep=Xr();Xi.exports=tp;function tp(e,t,r){for(var n=Ql(e);n.index<(n.keyedList||e).length;)Yl(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 ep.bind(n,r)}o(tp,"parallel")});var Yr=I((IA,Jt)=>{var Qi=Kr(),rp=Jr(),np=Xr();Jt.exports=op;Jt.exports.ascending=ea;Jt.exports.descending=ip;function op(e,t,r,n){var i=rp(e,r);return Qi(e,t,i,o(function u(l,d){if(l){n(l,d);return}if(i.index++,i.index<(i.keyedList||e).length){Qi(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),np.bind(i,n)}o(op,"serialOrdered");function ea(e,t){return e<t?-1:e>t?1:0}o(ea,"ascending");function ip(e,t){return-1*ea(e,t)}o(ip,"descending")});var ra=I(($A,ta)=>{var ap=Yr();ta.exports=sp;function sp(e,t,r){return ap(e,t,null,r)}o(sp,"serial")});var oa=I((zA,na)=>{na.exports={parallel:Yi(),serial:ra(),serialOrdered:Yr()}});var Qr=I((OA,ia)=>{"use strict";ia.exports=Object});var sa=I((kA,aa)=>{"use strict";aa.exports=Error});var ca=I((NA,ua)=>{"use strict";ua.exports=EvalError});var pa=I((wA,la)=>{"use strict";la.exports=RangeError});var ma=I((RA,da)=>{"use strict";da.exports=ReferenceError});var ga=I((DA,fa)=>{"use strict";fa.exports=SyntaxError});var Xt=I((CA,ya)=>{"use strict";ya.exports=TypeError});var va=I((UA,ha)=>{"use strict";ha.exports=URIError});var _a=I((MA,xa)=>{"use strict";xa.exports=Math.abs});var ba=I((jA,Pa)=>{"use strict";Pa.exports=Math.floor});var Ea=I((LA,Ta)=>{"use strict";Ta.exports=Math.max});var Sa=I((FA,Ia)=>{"use strict";Ia.exports=Math.min});var Aa=I((BA,$a)=>{"use strict";$a.exports=Math.pow});var Oa=I((ZA,za)=>{"use strict";za.exports=Math.round});var Na=I((VA,ka)=>{"use strict";ka.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ra=I((qA,wa)=>{"use strict";var up=Na();wa.exports=o(function(t){return up(t)||t===0?t:t<0?-1:1},"sign")});var Ca=I((WA,Da)=>{"use strict";Da.exports=Object.getOwnPropertyDescriptor});var en=I((KA,Ua)=>{"use strict";var Yt=Ca();if(Yt)try{Yt([],"length")}catch{Yt=null}Ua.exports=Yt});var ja=I((JA,Ma)=>{"use strict";var Qt=Object.defineProperty||!1;if(Qt)try{Qt({},"a",{value:1})}catch{Qt=!1}Ma.exports=Qt});var tn=I((XA,La)=>{"use strict";La.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 l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(t,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var Za=I((QA,Ba)=>{"use strict";var Fa=typeof Symbol<"u"&&Symbol,cp=tn();Ba.exports=o(function(){return typeof Fa!="function"||typeof Symbol!="function"||typeof Fa("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:cp()},"hasNativeSymbols")});var rn=I((tz,Va)=>{"use strict";Va.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var nn=I((rz,Ha)=>{"use strict";var lp=Qr();Ha.exports=lp.getPrototypeOf||null});var Wa=I((nz,Ga)=>{"use strict";var pp="Function.prototype.bind called on incompatible ",dp=Object.prototype.toString,mp=Math.max,fp="[object Function]",qa=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"),gp=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"),yp=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");Ga.exports=o(function(t){var r=this;if(typeof r!="function"||dp.apply(r)!==fp)throw new TypeError(pp+r);for(var n=gp(arguments,1),i,u=o(function(){if(this instanceof i){var P=r.apply(this,qa(n,arguments));return Object(P)===P?P:this}return r.apply(t,qa(n,arguments))},"binder"),l=mp(0,r.length-n.length),d=[],y=0;y<l;y++)d[y]="$"+y;if(i=Function("binder","return function ("+yp(d,",")+"){ 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 Ve=I((iz,Ka)=>{"use strict";var hp=Wa();Ka.exports=Function.prototype.bind||hp});var er=I((az,Ja)=>{"use strict";Ja.exports=Function.prototype.call});var on=I((sz,Xa)=>{"use strict";Xa.exports=Function.prototype.apply});var Qa=I((uz,Ya)=>{"use strict";Ya.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ts=I((cz,es)=>{"use strict";var vp=Ve(),xp=on(),_p=er(),Pp=Qa();es.exports=Pp||vp.call(_p,xp)});var ns=I((lz,rs)=>{"use strict";var bp=Ve(),Tp=Xt(),Ep=er(),Ip=ts();rs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Tp("a function is required");return Ip(bp,Ep,t)},"callBindBasic")});var cs=I((dz,us)=>{"use strict";var Sp=ns(),os=en(),as;try{as=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var an=!!as&&os&&os(Object.prototype,"__proto__"),ss=Object,is=ss.getPrototypeOf;us.exports=an&&typeof an.get=="function"?Sp([an.get]):typeof is=="function"?o(function(t){return is(t==null?t:ss(t))},"getDunder"):!1});var fs=I((fz,ms)=>{"use strict";var ls=rn(),ps=nn(),ds=cs();ms.exports=ls?o(function(t){return ls(t)},"getProto"):ps?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ps(t)},"getProto"):ds?o(function(t){return ds(t)},"getProto"):null});var sn=I((yz,gs)=>{"use strict";var $p=Function.prototype.call,Ap=Object.prototype.hasOwnProperty,zp=Ve();gs.exports=zp.call($p,Ap)});var bs=I((hz,Ps)=>{"use strict";var M,Op=Qr(),kp=sa(),Np=ca(),wp=pa(),Rp=ma(),We=ga(),Ge=Xt(),Dp=va(),Cp=_a(),Up=ba(),Mp=Ea(),jp=Sa(),Lp=Aa(),Fp=Oa(),Bp=Ra(),xs=Function,un=o(function(e){try{return xs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),_t=en(),Zp=ja(),cn=o(function(){throw new Ge},"throwTypeError"),Vp=_t?function(){try{return arguments.callee,cn}catch{try{return _t(arguments,"callee").get}catch{return cn}}}():cn,He=Za()(),Q=fs(),Hp=nn(),qp=rn(),_s=on(),Pt=er(),qe={},Gp=typeof Uint8Array>"u"||!Q?M:Q(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":He&&Q?Q([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":qe,"%AsyncGenerator%":qe,"%AsyncGeneratorFunction%":qe,"%AsyncIteratorPrototype%":qe,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":kp,"%eval%":eval,"%EvalError%":Np,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":xs,"%GeneratorFunction%":qe,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":He&&Q?Q(Q([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!He||!Q?M:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Op,"%Object.getOwnPropertyDescriptor%":_t,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":wp,"%ReferenceError%":Rp,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!He||!Q?M:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":He&&Q?Q(""[Symbol.iterator]()):M,"%Symbol%":He?Symbol:M,"%SyntaxError%":We,"%ThrowTypeError%":Vp,"%TypedArray%":Gp,"%TypeError%":Ge,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":Dp,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Pt,"%Function.prototype.apply%":_s,"%Object.defineProperty%":Zp,"%Object.getPrototypeOf%":Hp,"%Math.abs%":Cp,"%Math.floor%":Up,"%Math.max%":Mp,"%Math.min%":jp,"%Math.pow%":Lp,"%Math.round%":Fp,"%Math.sign%":Bp,"%Reflect.getPrototypeOf%":qp};if(Q)try{null.error}catch(e){ys=Q(Q(e)),Ne["%Error.prototype%"]=ys}var ys,Wp=o(function e(t){var r;if(t==="%AsyncFunction%")r=un("async function () {}");else if(t==="%GeneratorFunction%")r=un("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=un("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Q&&(r=Q(i.prototype))}return Ne[t]=r,r},"doEval"),hs={__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=Ve(),tr=sn(),Kp=bt.call(Pt,Array.prototype.concat),Jp=bt.call(_s,Array.prototype.splice),vs=bt.call(Pt,String.prototype.replace),rr=bt.call(Pt,String.prototype.slice),Xp=bt.call(Pt,RegExp.prototype.exec),Yp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Qp=/\\(\\)?/g,ed=o(function(t){var r=rr(t,0,1),n=rr(t,-1);if(r==="%"&&n!=="%")throw new We("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new We("invalid intrinsic syntax, expected opening `%`");var i=[];return vs(t,Yp,function(u,l,d,y){i[i.length]=d?vs(y,Qp,"$1"):l||u}),i},"stringToPath"),td=o(function(t,r){var n=t,i;if(tr(hs,n)&&(i=hs[n],n="%"+i[0]+"%"),tr(Ne,n)){var u=Ne[n];if(u===qe&&(u=Wp(n)),typeof u>"u"&&!r)throw new Ge("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new We("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ps.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ge("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ge('"allowMissing" argument must be a boolean');if(Xp(/^%?[^%]*%?$/,t)===null)throw new We("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ed(t),i=n.length>0?n[0]:"",u=td("%"+i+"%",r),l=u.name,d=u.value,y=!1,h=u.alias;h&&(i=h[0],Jp(n,Kp([0,1],h)));for(var P=1,S=!0;P<n.length;P+=1){var x=n[P],s=rr(x,0,1),p=rr(x,-1);if((s==='"'||s==="'"||s==="`"||p==='"'||p==="'"||p==="`")&&s!==p)throw new We("property names with quotes must have matching quotes");if((x==="constructor"||!S)&&(y=!0),i+="."+x,l="%"+i+"%",tr(Ne,l))d=Ne[l];else if(d!=null){if(!(x in d)){if(!r)throw new Ge("base intrinsic for "+t+" exists, but the property is not available.");return}if(_t&&P+1>=n.length){var f=_t(d,x);S=!!f,S&&"get"in f&&!("originalValue"in f.get)?d=f.get:d=d[x]}else S=tr(d,x),d=d[x];S&&!y&&(Ne[l]=d)}}return d},"GetIntrinsic")});var Es=I((xz,Ts)=>{"use strict";var rd=tn();Ts.exports=o(function(){return rd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var $s=I((Pz,Ss)=>{"use strict";var nd=bs(),Is=nd("%Object.defineProperty%",!0),od=Es()(),id=sn(),ad=Xt(),nr=od?Symbol.toStringTag:null;Ss.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 ad("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");nr&&(n||!id(t,nr))&&(Is?Is(t,nr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[nr]=r)},"setToStringTag")});var zs=I((Tz,As)=>{"use strict";var sd=Function.prototype.call,ud=Object.prototype.hasOwnProperty,cd=Ve();As.exports=cd.call(sd,ud)});var ks=I((Ez,Os)=>{"use strict";Os.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Rs=I((Iz,ws)=>{"use strict";var mn=Ci(),ld=require("util"),ln=require("path"),pd=require("http"),dd=require("https"),md=require("url").parse,fd=require("fs"),gd=require("stream").Stream,yd=require("crypto"),pn=Fi(),hd=oa(),vd=$s(),Se=zs(),dn=ks();function Ns(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Ns,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],mn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");ld.inherits(L,mn);L.LINE_BREAK=`\r
2
- `;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=mn.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)};L.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)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Se(t,"httpVersion"))&&!(t instanceof gd))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){Se(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):fd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Se(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Se(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.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="",l={"Content-Disposition":["form-data",'name="'+Ns(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&dn(l,r.header);var d;for(var y in l)if(Se(l,y)){if(d=l[y],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(u+=y+": "+d.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=ln.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=ln.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Se(e,"httpVersion")&&(r=ln.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ns(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=pn.lookup(e.name)),!r&&e&&e.path&&(r=pn.lookup(e.path)),!r&&e&&e.readable&&Se(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=pn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Se(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.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(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+yd.randomBytes(12).toString("hex")};L.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};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.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}hd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=md(e),n=dn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=dn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=dd.request(n):r=pd.request(n),this.getLength(function(u,l){if(u&&u!=="Unknown stream"){this._error(u);return}if(l&&r.setHeader("Content-Length",l),this.pipe(r),t){var d,y=o(function(h,P){return r.removeListener("error",y),r.removeListener("response",d),t.call(this,h,P)},"callback");d=y.bind(this,null),r.on("error",y),r.on("response",d)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};vd(L.prototype,"FormData");ws.exports=L});var $d={};hn($d,{elasticEmail:()=>Sd});module.exports=ou($d);var iu=Object.freeze({status:"aborted"});function T(e,t,r){function n(d,y){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:y,constr:l,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,y);let h=l.prototype,P=Object.keys(h);for(let S=0;S<P.length;S++){let x=P[S];x in d||(d[x]=h[x].bind(d))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function l(d){var y;let h=r?.Parent?new u:this;n(h,d),(y=h._zod).deferred??(y.deferred=[]);for(let P of h._zod.deferred)P();return h}return o(l,"_"),Object.defineProperty(l,"init",{value:n}),Object.defineProperty(l,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e),"value")}),Object.defineProperty(l,"name",{value:e}),l}o(T,"$constructor");var au=Symbol("zod_brand"),ce=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"}},ur={};function de(e){return e&&Object.assign(ur,e),ur}o(de,"config");function lr(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(lr,"getEnumValues");function _n(e,t){return typeof t=="bigint"?t.toString():t}o(_n,"jsonStringifyReplacer");function St(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(St,"cached");function Pn(e){return e==null}o(Pn,"nullish");function $t(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o($t,"cleanRegex");var xn=Symbol("evaluating");function X(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==xn)return n===void 0&&(n=xn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(X,"defineLazy");var pr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(et,"isObject");var su=St(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function bn(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(bn,"isPlainObject");var Tn=new Set(["string","number","symbol"]);function Re(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Re,"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 q(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(q,"normalizeParams");function En(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(En,"optionalKeys");var uu={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 De(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(De,"aborted");function _e(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(_e,"prefixIssues");function It(e){return typeof e=="string"?e:e?.message}o(It,"unwrapMessage");function Pe(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(Pe,"finalizeIssue");function In(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(In,"getLengthableOrigin");function dr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(dr,"issue");var Sn=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,_n,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),$n=T("$ZodError",Sn),tt=T("$ZodError",Sn,{Parent:Error});var lu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},l=t._zod.run({value:r,issues:[]},u);if(l instanceof Promise)throw new ce;if(l.issues.length){let d=new(i?.Err??e)(l.issues.map(y=>Pe(y,u,de())));throw pr(d,i?.callee),d}return l.value},"_parse"),zt=lu(tt),pu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},l=t._zod.run({value:r,issues:[]},u);if(l instanceof Promise&&(l=await l),l.issues.length){let d=new(i?.Err??e)(l.issues.map(y=>Pe(y,u,de())));throw pr(d,i?.callee),d}return l.value},"_parseAsync"),Ot=pu(tt),du=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 ce;return u.issues.length?{success:!1,error:new(e??$n)(u.issues.map(l=>Pe(l,i,de())))}:{success:!0,data:u.value}},"_safeParse"),rt=du(tt),mu=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(l=>Pe(l,i,de())))}:{success:!0,data:u.value}},"_safeParseAsync"),nt=mu(tt);var fu="(?:(?:\\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])))",gu=new RegExp(`^${fu}$`);var An=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),zn=/^-?\d+n?$/;var mr=/^-?\d+(?:\.\d+)?$/,On=/^(?:true|false)$/i;var Ce=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var kn=T("$ZodCheckMinLength",(e,t)=>{var r;Ce.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Pn(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 l=In(i);n.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var fr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Ce.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=()=>{})}),Nn=T("$ZodCheckRegex",(e,t)=>{fr.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 Rn={major:4,minor:3,patch:6};var G=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Rn;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((l,d,y)=>{let h=De(l),P;for(let S of d){if(S._zod.def.when){if(!S._zod.def.when(l))continue}else if(h)continue;let x=l.issues.length,s=S._zod.check(l);if(s instanceof Promise&&y?.async===!1)throw new ce;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,l.issues.length!==x&&(h||(h=De(l,x)))});else{if(l.issues.length===x)continue;h||(h=De(l,x))}}return P?P.then(()=>l):l},"runChecks"),u=o((l,d,y)=>{if(De(l))return l.aborted=!0,l;let h=i(d,n,y);if(h instanceof Promise){if(y.async===!1)throw new ce;return h.then(P=>e._zod.parse(P,y))}return e._zod.parse(h,y)},"handleCanaryResult");e._zod.run=(l,d)=>{if(d.skipChecks)return e._zod.parse(l,d);if(d.direction==="backward"){let h=e._zod.parse({value:l.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(P=>u(P,l,d)):u(h,l,d)}let y=e._zod.parse(l,d);if(y instanceof Promise){if(d.async===!1)throw new ce;return y.then(h=>i(h,n,d))}return i(y,n,d)}}X(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(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},"validate"),vendor:"zod",version:1}))}),wt=T("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??An(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}}),gr=T("$ZodStringFormat",(e,t)=>{fr.init(e,t),wt.init(e,t)});var jn=T("$ZodURL",(e,t)=>{gr.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 Ln=T("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??mr,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 yr=T("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=On,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}}),Fn=T("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=zn,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 Bn=T("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),Zn=T("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r});var Vn=T("$ZodVoid",(e,t)=>{G.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}}),Hn=T("$ZodDate",(e,t)=>{G.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 Dn(e,t,r){e.issues.length&&t.issues.push(..._e(r,e.issues)),t.value[r]=e.value}o(Dn,"handleArrayResult");var qn=T("$ZodArray",(e,t)=>{G.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 l=0;l<i.length;l++){let d=i[l],y=t.element._zod.run({value:d,issues:[]},n);y instanceof Promise?u.push(y.then(h=>Dn(h,r,l))):Dn(y,r,l)}return u.length?Promise.all(u).then(()=>r):r}});function Nt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(..._e(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Nt,"handlePropertyResult");function yu(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=En(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(yu,"normalizeDef");function hu(e,t,r,n,i,u){let l=[],d=i.keySet,y=i.catchall._zod,h=y.def.type,P=y.optout==="optional";for(let S in t){if(d.has(S))continue;if(h==="never"){l.push(S);continue}let x=y.run({value:t[S],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Nt(s,r,S,t,P))):Nt(x,r,S,t,P)}return l.length&&r.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(hu,"handleCatchall");var Gn=T("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let d=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let y={...d};return Object.defineProperty(t,"shape",{value:y}),y},"get")})}let n=St(()=>yu(t));X(e._zod,"propValues",()=>{let d=t.shape,y={};for(let h in d){let P=d[h]._zod;if(P.values){y[h]??(y[h]=new Set);for(let S of P.values)y[h].add(S)}}return y});let i=et,u=t.catchall,l;e._zod.parse=(d,y)=>{l??(l=n.value);let h=d.value;if(!i(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d;d.value={};let P=[],S=l.shape;for(let x of l.keys){let s=S[x],p=s._zod.optout==="optional",f=s._zod.run({value:h[x],issues:[]},y);f instanceof Promise?P.push(f.then(m=>Nt(m,d,x,h,p))):Nt(f,d,x,h,p)}return u?hu(P,h,d,y,n.value,e):P.length?Promise.all(P).then(()=>d):d}});function Cn(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=>!De(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(l=>Pe(l,n,de())))}),t)}o(Cn,"handleUnionResults");var hr=T("$ZodUnion",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),X(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),X(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),X(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=>$t(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 l=!1,d=[];for(let y of t.options){let h=y._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)d.push(h),l=!0;else{if(h.issues.length===0)return h;d.push(h)}}return l?Promise.all(d).then(y=>Cn(y,i,e,u)):Cn(d,i,e,u)}});var Wn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,hr.init(e,t);let r=e._zod.parse;X(e._zod,"propValues",()=>{let i={};for(let u of t.options){let l=u._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[d,y]of Object.entries(l)){i[d]||(i[d]=new Set);for(let h of y)i[d].add(h)}}return i});let n=St(()=>{let i=t.options,u=new Map;for(let l of i){let d=l._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(let y of d){if(u.has(y))throw new Error(`Duplicate discriminator value "${String(y)}"`);u.set(y,l)}}return u});e._zod.parse=(i,u)=>{let l=i.value;if(!et(l))return i.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),i;let d=n.value.get(l?.[t.discriminator]);return d?d._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),i)}});var Kn=T("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!bn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],l=t.keyType._zod.values;if(l){r.value={};let d=new Set;for(let h of l)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){d.add(typeof h=="number"?h.toString():h);let P=t.valueType._zod.run({value:i[h],issues:[]},n);P instanceof Promise?u.push(P.then(S=>{S.issues.length&&r.issues.push(..._e(h,S.issues)),r.value[h]=S.value})):(P.issues.length&&r.issues.push(..._e(h,P.issues)),r.value[h]=P.value)}let y;for(let h in i)d.has(h)||(y=y??[],y.push(h));y&&y.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:y})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let y=t.keyType._zod.run({value:d,issues:[]},n);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&mr.test(d)&&y.issues.length){let S=t.keyType._zod.run({value:Number(d),issues:[]},n);if(S instanceof Promise)throw new Error("Async schemas not supported in object keys currently");S.issues.length===0&&(y=S)}if(y.issues.length){t.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map(S=>Pe(S,n,de())),input:d,path:[d],inst:e});continue}let P=t.valueType._zod.run({value:i[d],issues:[]},n);P instanceof Promise?u.push(P.then(S=>{S.issues.length&&r.issues.push(..._e(d,S.issues)),r.value[y.value]=S.value})):(P.issues.length&&r.issues.push(..._e(d,P.issues)),r.value[y.value]=P.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Jn=T("$ZodEnum",(e,t)=>{G.init(e,t);let r=lr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Tn.has(typeof i)).map(i=>typeof i=="string"?Re(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let l=i.value;return n.has(l)||i.issues.push({code:"invalid_value",values:r,input:l,inst:e}),i}}),Xn=T("$ZodLiteral",(e,t)=>{if(G.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"?Re(n):n?Re(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 Yn=T("$ZodTransform",(e,t)=>{G.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(l=>(r.value=l,r));if(i instanceof Promise)throw new ce;return r.value=i,r}});function Un(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Un,"handleOptionalResult");var Qn=T("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(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=>Un(u,r.value)):Un(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var eo=T("$ZodNullable",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.innerType._zod.optin),X(e._zod,"optout",()=>t.innerType._zod.optout),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)}|null)$`):void 0}),X(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 to=T("$ZodPipe",(e,t)=>{G.init(e,t),X(e._zod,"values",()=>t.in._zod.values),X(e._zod,"optin",()=>t.in._zod.optin),X(e._zod,"optout",()=>t.out._zod.optout),X(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(l=>kt(l,t.in,n)):kt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>kt(u,t.out,n)):kt(i,t.out,n)}});function kt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(kt,"handlePipeResult");var ro=T("$ZodCustom",(e,t)=>{Ce.init(e,t),G.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=>Mn(u,r,n,e));Mn(i,r,n,e)}});function Mn(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(dr(i))}}o(Mn,"handleRefineResult");var oo,Pu=Symbol("ZodOutput"),bu=Symbol("ZodInput"),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 io(){return new vr}o(io,"registry");(oo=globalThis).__zod_globalRegistry??(oo.__zod_globalRegistry=io());var xr=globalThis.__zod_globalRegistry;function ao(e,t){return new e({type:"string",...q(t)})}o(ao,"_string");function so(e,t){return new e({type:"string",coerce:!0,...q(t)})}o(so,"_coercedString");function uo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...q(t)})}o(uo,"_url");function co(e,t){return new e({type:"number",checks:[],...q(t)})}o(co,"_number");function lo(e,t){return new e({type:"number",coerce:!0,checks:[],...q(t)})}o(lo,"_coercedNumber");function po(e,t){return new e({type:"boolean",...q(t)})}o(po,"_boolean");function mo(e,t){return new e({type:"boolean",coerce:!0,...q(t)})}o(mo,"_coercedBoolean");function fo(e,t){return new e({type:"bigint",coerce:!0,...q(t)})}o(fo,"_coercedBigint");function go(e){return new e({type:"any"})}o(go,"_any");function yo(e){return new e({type:"unknown"})}o(yo,"_unknown");function ho(e,t){return new e({type:"void",...q(t)})}o(ho,"_void");function vo(e,t){return new e({type:"date",coerce:!0,...q(t)})}o(vo,"_coercedDate");function se(e,t){return new kn({check:"min_length",...q(t),minimum:e})}o(se,"_minLength");function be(e,t){return new Nn({check:"string_format",format:"regex",...q(t),pattern:e})}o(be,"_regex");function xo(e,t,r){let n=q(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(xo,"_custom");var Y=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");G.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)=>Ot(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)=>{wt.init(e,t),Y.init(e,t)});function a(e){return ao(Dt,e)}o(a,"string");var _o=T("ZodMiniStringFormat",(e,t)=>{gr.init(e,t),Dt.init(e,t)});var Nu=T("ZodMiniURL",(e,t)=>{jn.init(e,t),_o.init(e,t)});function Po(e){return uo(Nu,e)}o(Po,"url");var _r=T("ZodMiniNumber",(e,t)=>{Ln.init(e,t),Y.init(e,t)});function ee(e){return co(_r,e)}o(ee,"number");var Pr=T("ZodMiniBoolean",(e,t)=>{yr.init(e,t),Y.init(e,t)});function Z(e){return po(Pr,e)}o(Z,"boolean");var bo=T("ZodMiniBigInt",(e,t)=>{Fn.init(e,t),Y.init(e,t)});var wu=T("ZodMiniAny",(e,t)=>{Bn.init(e,t),Y.init(e,t)});function it(){return go(wu)}o(it,"any");var Ru=T("ZodMiniUnknown",(e,t)=>{Zn.init(e,t),Y.init(e,t)});function k(){return yo(Ru)}o(k,"unknown");var Du=T("ZodMiniVoid",(e,t)=>{Vn.init(e,t),Y.init(e,t)});function To(e){return ho(Du,e)}o(To,"_void");var Eo=T("ZodMiniDate",(e,t)=>{Hn.init(e,t),Y.init(e,t)});var Cu=T("ZodMiniArray",(e,t)=>{qn.init(e,t),Y.init(e,t)});function R(e,t){return new Cu({type:"array",element:e,...q(t)})}o(R,"array");var Uu=T("ZodMiniObject",(e,t)=>{Gn.init(e,t),Y.init(e,t),X(e,"shape",()=>t.shape)});function c(e,t){let r={type:"object",shape:e??{},...q(t)};return new Uu(r)}o(c,"object");var Mu=T("ZodMiniUnion",(e,t)=>{hr.init(e,t),Y.init(e,t)});function D(e,t){return new Mu({type:"union",options:e,...q(t)})}o(D,"union");var ju=T("ZodMiniDiscriminatedUnion",(e,t)=>{Wn.init(e,t),Y.init(e,t)});function Ue(e,t,r){return new ju({type:"union",options:t,discriminator:e,...q(r)})}o(Ue,"discriminatedUnion");var Lu=T("ZodMiniRecord",(e,t)=>{Kn.init(e,t),Y.init(e,t)});function N(e,t,r){return new Lu({type:"record",keyType:e,valueType:t,...q(r)})}o(N,"record");var Fu=T("ZodMiniEnum",(e,t)=>{Jn.init(e,t),Y.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Fu({type:"enum",entries:r,...q(t)})}o(U,"_enum");var Bu=T("ZodMiniLiteral",(e,t)=>{Xn.init(e,t),Y.init(e,t)});function $(e,t){return new Bu({type:"literal",values:Array.isArray(e)?e:[e],...q(t)})}o($,"literal");var Zu=T("ZodMiniTransform",(e,t)=>{Yn.init(e,t),Y.init(e,t)});function Te(e){return new Zu({type:"transform",transform:e})}o(Te,"transform");var Vu=T("ZodMiniOptional",(e,t)=>{Qn.init(e,t),Y.init(e,t)});function g(e){return new Vu({type:"optional",innerType:e})}o(g,"optional");var Hu=T("ZodMiniNullable",(e,t)=>{eo.init(e,t),Y.init(e,t)});function at(e){return new Hu({type:"nullable",innerType:e})}o(at,"nullable");var qu=T("ZodMiniPipe",(e,t)=>{to.init(e,t),Y.init(e,t)});function Ee(e,t){return new qu({type:"pipe",in:e,out:t})}o(Ee,"pipe");var Gu=T("ZodMiniCustom",(e,t)=>{ro.init(e,t),Y.init(e,t)});function Ct(e,t){return xo(Gu,e??(()=>!0),t)}o(Ct,"custom");var st={};hn(st,{bigint:()=>ec,boolean:()=>Qu,date:()=>tc,number:()=>Yu,string:()=>Xu});function Xu(e){return so(Dt,e)}o(Xu,"string");function Yu(e){return lo(_r,e)}o(Yu,"number");function Qu(e){return mo(Pr,e)}o(Qu,"boolean");function ec(e){return fo(bo,e)}o(ec,"bigint");function tc(e){return vo(Eo,e)}o(tc,"date");var Tr=c({retryOnFailure:c({defaultValue:g(Z()),hide:g(Z())}),continueOnFailure:c({defaultValue:g(Z()),hide:g(Z())})}),br=class{constructor(t,r,n,i,u,l,d,y,h,P,S){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=l;this.requireAuth=d;this.errorHandlingOptions=y;this.outputSchema=h;this.audience=P;this.aiMetadata=S}static{o(this,"IAction")}},W=o(e=>new br(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 F=c({displayName:a(),description:g(a())}),C=o((e,t)=>c({type:$(t),required:Z(),defaultValue:g(it())}),"TPropertyValue");var ne=c({...F.shape,...C(a(),"SHORT_TEXT").shape}),me=c({...F.shape,...C(a(),"LONG_TEXT").shape});var So=c({label:a(),value:k()}),Ut=c({disabled:g(Z()),placeholder:g(a()),options:R(So)});var oe=c({...F.shape,options:Ut,...C(k(),"STATIC_DROPDOWN").shape}),fe=c({...F.shape,options:Ut,...C(R(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Er=c({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:R(a())}),ut=c({...F.shape,...C(R(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var ge=c({...F.shape,...C(Z(),"CHECKBOX").shape});var ye=c({...F.shape,...C(ee(),"NUMBER").shape});var ct=c({...F.shape,...C(k(),"FILE").shape});var lt=c({...F.shape,...C(a(),"DATE_TIME").shape});var $o=N(a(),D([ne,me,oe,ut,fe,ge,ye,ct,lt])),pt=c({...F.shape,properties:$o,...C(R(k()),"ARRAY").shape});var dt=c({...F.shape,...C(D([N(a(),k())]),"JSON").shape});var Ao=D([ne,oe,dt,pt,fe]),nc=N(a(),Ao),Ir=c({refreshers:R(a()),...F.shape,...C(k(),"DYNAMIC").shape});var Mt=c({...F.shape,...C(To(),"MARKDOWN").shape});var mt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(mt||{}),Me=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Me||{}),je=(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))(je||{});var ft=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ft||{}),Sr="both_client_credentials_and_authorization_code";var Ae=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Ae||{}),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||{}),oc=c({strategy:U(gt),paramName:g(a())}),yt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(yt||{});var jt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(jt||{}),zo=c({status:g(ee()),body:g(k()),headers:g(N(a(),a()))}),Oo=c({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:g(a()),handlerId:g(a()),streamStepProgress:g(U(jt))}),ko=c({type:$("WEBHOOK"),requestId:a(),requestIdToReply:g(a()),response:zo,handlerId:g(a()),streamStepProgress:g(U(jt))}),ic=D([Oo,ko]);var ac=c({body:k(),rawBody:g(k()),headers:N(a(),a()),queryParams:N(a(),a())});function he(e){return e==null}o(he,"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 $r=we(require("crypto"),1);var sc=128,ze,Le,uc=o(e=>{!ze||ze.length<e?(ze=Buffer.allocUnsafe(e*sc),$r.default.randomFillSync(ze),Le=0):Le+e>ze.length&&($r.default.randomFillSync(ze),Le=0),Le+=e},"fillPool"),cc=o(e=>(uc(e|=0),ze.subarray(Le-e,Le)),"random"),lc=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 l="";for(;;){let d=r(i),y=i;for(;y--;)if(l+=e[d[y]&n]||"",l.length===u)return l}}},"customRandom"),wo=o((e,t=21)=>lc(e,t,cc),"customAlphabet");var pc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ro=21,lb=a().check(be(new RegExp(`^[0-9a-zA-Z]{${Ro}}$`))),dc=wo(pc,Ro);var Ie=Ee(Te(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:Ie,updated:Ie},H=o(e=>g(at(e)),"Nullable");function Ar(e){return g(at(U(e)))}o(Ar,"NullableEnum");var mb=Ee(Te(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),g(Z())),Ft=o(e=>Ee(Te(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),g(R(e))),"OptionalArrayFromQuery");var yb=N(a(),k());var vt=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(vt||{});var Ab=a().check(be(/^#[0-9A-Fa-f]{6}$/));var Ob=c({filename:a(),data:k(),type:$("file"),mimetype:g(a())});var mc=we(Co());var Ub=c({...ie,name:a(),permissions:R(a()),platformId:H(a()),type:a(),userCount:g(ee())});var Uo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Uo||{}),zr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(zr||{}),Or=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Or||{});var kr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(kr||{});var Nr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Nr||{});var fc=c({mode:U(Uo),value:k()}),gc=c({auth:g(a()),fields:N(a(),fc)}),yc=c({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:g(gc)}),hc=c({type:$("PIECE"),toolName:a().check(se(1)),pieceMetadata:yc}),vc=c({type:$("none")}),xc=c({type:$("access_token"),accessToken:a()}),_c=c({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),Pc=c({type:$("headers"),headers:N(a(),a())}),bc=Ue("type",[vc,xc,_c,Pc]),Mo=c({type:$("FLOW"),toolName:a().check(se(1)),externalFlowId:a(),flowDisplayName:g(a())}),jo=c({type:$("MCP"),toolName:a().check(se(1)),serverUrl:Po(),protocol:U(Or),auth:bc}),Lo=c({type:$("KNOWLEDGE_BASE"),toolName:a().check(se(1)),sourceType:U(zr),sourceId:a(),sourceName:a()}),Tc=Ue("type",[hc,Mo,jo,Lo]),Ec=c({displayName:a(),description:g(a()),type:U(kr)}),Fo=c({type:$("MARKDOWN"),markdown:a()}),Fe={type:$("TOOL_CALL"),input:H(N(a(),k())),output:g(k()),toolName:a(),status:U(Nr),toolCallId:a(),startTime:a(),endTime:g(a())},lT=c(Fe),Bo=Ue("toolCallType",[c({...Fe,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),c({...Fe,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),c({...Fe,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),c({...Fe,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),c({...Fe,toolCallType:$("UNKNOWN"),displayName:a()})]),Ic=D([Fo,Bo]);var wr=(r=>(r.IMAGE="image",r.TEXT="text",r))(wr||{}),ve=c({apiKey:a()}),Sc=ve,$c=c({apiKey:a(),apiKeyHash:a()}),Ac=ve,zc=ve,Oc=ve,kc=ve,Nc=ve,wc=ve,Rc=ve,Zo=c({accessKeyId:a().check(se(1)),secretAccessKey:a().check(se(1))}),Dc=c({}),Cc=c({}),Uc=c({}),Mc=c({}),jc=c({}),Lc=c({}),Vo=c({modelId:a(),modelName:a(),modelType:U(wr)}),Ho=c({apiKeyHeader:a(),baseUrl:a(),models:R(Vo),defaultHeaders:g(N(a(),a()))}),qo=c({accountId:a(),gatewayId:a(),models:R(Vo),vertexProject:g(a()),vertexRegion:g(a())}),Go=c({resourceName:a(),apiVersion:Ee(Te(e=>typeof e=="string"&&e.trim().length===0?void 0:e),g(a()))}),Wo=c({region:a().check(se(1))}),Fc=D([Sc,Oc,kc,Nc,wc,zc,Ac,$c,Zo,Rc]),Ko=D([Ho,qo,Go,Wo,Dc,Uc,Mc,jc,Cc,Lc]),Bc=c({id:a(),name:a(),type:U(wr)}),Zc=c({id:a(),name:a(),provider:U(vt),config:Ko,enabledForChat:Z()}),Vc=c({provider:U(vt),config:Ko,auth:Fc,platformId:a()});var fT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Hc=c({base64Url:a(),fileName:a(),extension:g(a())}),qc=c({mimeType:a(),url:a(),fileName:g(a())}),Rr=D([Hc,qc]);var Gc=D([c({type:$("file"),value:Rr}),c({type:$("markdown"),value:a(),files:g(R(Rr))})]),Wc=c({sessionId:a(),message:a(),files:g(R(a()))});var Xo=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Xo||{}),Yo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Yo||{}),Dr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Dr||{});var Kc=D([c({...ie,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:c({options:R(c({value:a()}))})}),c({...ie,name:a(),externalId:a(),type:D([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),Jc=c({...ie,name:a(),folderId:H(a()),projectId:a(),externalId:a(),status:Ar(Yo),trigger:Ar(Xo)}),Xc=c({...ie,tableId:a(),projectId:a(),cells:N(a(),c({updated:a(),created:a(),value:k(),fieldName:a()}))}),Yc=c({events:R(U(Dr)),webhookUrl:a(),flowId:a()}),Qc=c({fields:R(c({id:a(),name:a()})),rows:R(N(a(),a())),name:a()}),el=c({projectId:a(),limit:g(st.number()),cursor:g(a()),name:g(a()),externalIds:Ft(a()),folderId:g(a()),folderIds:Ft(a())}),tl=c({records:R(R(c({fieldId:a(),value:ei()}))),tableId:a()}),rl=c({cells:g(R(c({fieldId:a(),value:ei()}))),tableId:a(),agentUpdate:g(Z())}),Qo=Ue("operator",[Oe("eq"),Oe("neq"),Oe("gt"),Oe("gte"),Oe("lt"),Oe("lte"),Oe("co"),Jo("exists"),Jo("not_exists")]),nl=c({tableId:a(),limit:g(st.number()),cursor:g(a()),filters:Ft(Qo)});function ei(){return Ee(Te(e=>e==null?e:String(e)),at(a()))}o(ei,"coerceToString");function Oe(e){return c({fieldId:a(),operator:$(e),value:a()})}o(Oe,"valueFilter");function Jo(e){return c({fieldId:a(),operator:$(e)})}o(Jo,"existenceFilter");var ol=c({status:g(ee()),body:g(k()),headers:g(N(a(),a()))}),il=c({...ie,deleted:H(Ie),ownerId:a(),displayName:a(),platformId:a(),externalId:H(a())});var ti=c({name:a(),description:g(a()),type:a(),required:Z()}),al=c({pieceName:a(),triggerName:a(),input:c({toolName:a(),toolDescription:a(),inputSchema:R(ti),returnsResponse:Z()})});var ri="^[0-9]+\\.[0-9]+\\.[0-9]+$",wT=new RegExp(ri),ul="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",RT=a().check(be(new RegExp(ri))),DT=a().check(be(new RegExp(ul))),cl=c({packageType:$("ARCHIVE"),pieceType:U(Me),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ni=c({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),oi=c({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),CT=D([ni,oi]),UT=D([cl,ni,oi]),ii=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ii||{}),ll=c({type:U(ii),cronExpression:a(),timezone:a()}),MT=c({...ie,type:U(Ae),projectId:a(),flowId:a(),triggerName:a(),schedule:H(ll),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:H(a()),simulate:Z()}),ai=(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))(ai||{}),si=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(si||{}),ui=(r=>(r.S3="S3",r.DB="DB",r))(ui||{}),jT=c({...ie,projectId:H(a()),platformId:H(a()),type:U(ai),compression:U(si),data:g(k()),location:U(ui),size:H(ee()),fileName:H(a()),s3Key:H(a()),metadata:H(N(a(),a()))}),ci=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(ci||{}),li=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(li||{}),LT=c({id:a(),email:a(),firstName:a(),status:U(li),externalId:H(a()),platformId:H(a()),platformRole:U(ci),lastName:a(),created:Ie,updated:Ie,lastActiveDate:H(Ie),imageUrl:H(a())});var Cr=c({...F.shape,...C(N(a(),k()),"OBJECT").shape});var fi=c({...F.shape,...C(a(),"COLOR").shape});var Ur=D([ne,me,Mt,ge,oe,fe,Er,ut,Ir,ye,pt,Cr,dt,lt,ct,fi]),_={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 le=c({displayName:a(),description:g(a())});var gi=c({username:a(),password:a()}),Mr=c({...le.shape,username:c({displayName:a(),description:g(a())}),password:c({displayName:a(),description:g(a())}),...C(gi,"BASIC_AUTH").shape});var fl=N(a(),D([ne,me,ye,ge,oe])),jr=c({...le.shape,props:fl,...C(k(),"CUSTOM_AUTH").shape});var ke=c({...le.shape,...C(c({auth:a()}),"SECRET_TEXT").shape});var gl=N(a(),D([ne,me,ke,ye,ge,oe,fe,Mt])),yi=c({...le.shape,props:gl,...C(k(),"OIDC").shape});var Lr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Lr||{}),hi=D([ne,ke,oe]),vi=N(a(),hi),yl=c({props:g(N(a(),hi)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:g(D([$("none"),$("consent"),$("login"),$("omit")])),pkce:g(Z()),pkceMethod:g(D([$("plain"),$("S256")])),authorizationMethod:g(U(Lr)),grantType:g(D([U(ft),$(Sr)])),extra:g(N(a(),a()))}),xi=c({access_token:a(),props:g(vi),data:N(a(),it())}),Fr=c({...le.shape,...yl.shape,...C(xi,"OAUTH2").shape});var Be=D([Mr,jr,yi,Fr,ke]),xt="Connection",Br={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 vI={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=c({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var vl=D([Ur,Be]),Zr=N(a(),vl),MI=N(a(),Ur);var _i=D([c({strategy:$("CRON"),cronExpression:a()}),c({strategy:$("NONE")})]);var Pi="2",Zt="0.82.0";var Vr=class{constructor(t,r,n,i,u,l,d,y,h=Zt,P,S=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=y;this.minimumSupportedRelease=h;this.maximumSupportedRelease=P;this.description=S;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Pi}),"getContextInfo");(!xl(h)||_l(h,Zt))&&(this.minimumSupportedRelease=Zt),u.forEach(x=>this._actions[x.name]=x),l.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}},bi=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 Vr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function xl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(xl,"isValidSimpleSemver");function _l(e,t){let[r,n,i]=e.split(".").map(Number),[u,l,d]=t.split(".").map(Number);return r!==u?r<u:n!==l?n<l:i<d}o(_l,"isSemverLessThan");var Pl=g(N(a(),N(a(),a()))),Ti=c({id:g(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:g(a()),directoryPath:g(a()),auth:g(D([Be,R(Be)])),version:a(),categories:g(R(U(je))),minimumSupportedRelease:g(a()),maximumSupportedRelease:g(a()),i18n:Pl}),bl=U(["human","ai","both"]),Ei=c({description:g(a()),idempotent:g(Z())}),Ii=c({name:a(),displayName:a(),description:a(),props:Zr,requireAuth:Z(),errorHandlingOptions:g(Tr),outputSchema:g(Ct()),audience:g(bl),aiMetadata:g(Ei)}),Si=c({name:a(),displayName:a(),description:a(),props:Zr,errorHandlingOptions:g(Tr),type:U(Ae),sampleData:k(),handshakeConfiguration:g(Ct()),renewConfiguration:g(_i),testStrategy:U(yt),outputSchema:g(Ct()),aiMetadata:g(Ei)}),Tl=c({...Ti.shape,actions:N(a(),Ii),triggers:N(a(),Si)}),El=c({...Ti.shape,actions:ee(),triggers:ee(),suggestedActions:g(R(Si)),suggestedTriggers:g(R(Ii))}),$i=c({projectUsage:ee(),tags:g(R(a())),pieceType:U(Me),packageType:U(mt),platformId:g(a()),archiveId:g(a())}),MS=c({...Tl.shape,...$i.shape}),jS=c({...El.shape,...$i.shape}),LS=c({name:a(),version:a()});var Il=we(require("path")),Sl=we(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,l)=>{i.append(l,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 Hr,r=new qr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Hr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},qr=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 qt=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 Gt=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),l=t.queryParams??{};for(let[j,re]of Object.entries(l))i.append(j,re);let d=i.toString(),y=d?`${n}?${d}`:n,h=t.responseType??"json",P=t.followRedirects??!0,S=t.retries??0,{body:x,extraHeaders:s,isStream:p}=$l(t.body,u),f=zl({...u,...s}),m=await Al(async()=>{let j=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let ae={method:t.method.toString(),headers:f,body:x,redirect:P?"follow":"manual",signal:j.signal};return p&&(ae.duplex="half"),r?.dispatcher!==void 0&&(ae.dispatcher=r.dispatcher),await fetch(y,ae)}finally{re!==void 0&&clearTimeout(re)}},S),v=P?300:400;if(m.status<200||m.status>=v){let j=await Ai(m,h),re=new qt(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let b=await Ai(m,h);return{status:m.status,headers:Ol(m.headers),body:b}}};function $l(e,t){return Nl(e)?{body:void 0,extraHeaders:{},isStream:!1}:kl(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($l,"serializeBody");async function Ai(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(Ai,"parseResponseBody");async function Al(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await zi(n);continue}return i}catch(i){if(r=i,n<t){await zi(n);continue}throw i}throw r}o(Al,"sendWithRetries");function zi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(zi,"backoff");function zl(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(zl,"normalizeHeaders");function Ol(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Ol,"toHttpHeaders");function kl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(kl,"isNodeFormData");function Nl(e){return e==null}o(Nl,"isNil");var Ze=new Gt;var Wt=(l=>(l.GET="GET",l.POST="POST",l.PATCH="PATCH",l.PUT="PUT",l.DELETE="DELETE",l.HEAD="HEAD",l))(Wt||{});var xd=we(require("fs")),Ds=we(Rs());var _d={"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 Pd(e){let t=e.split(";")[0].trim().toLowerCase();return _d[t]??""}o(Pd,"contentTypeToExtension");var bd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Td=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 Cs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:l,extraProps:d,authLocation:y="headers"}){return W({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:_.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:_.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
- i.e ${Td(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...l?.url??{}})}),"props")}),method:_.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Wt).map(h=>({label:h,value:h}))},...l?.method??{}}),headers:_.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...l?.headers??{}}),queryParams:_.Object({displayName:"Query Parameters",required:!0,...l?.queryParams??{}}),body_type:_.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:_.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let P=h,S={};switch(P){case"none":break;case"json":S.data=_.Json({displayName:"JSON Body",required:!0,...l?.body??{}});break;case"raw":S.data=_.LongText({displayName:"Raw Body",required:!0});break;case"form_data":S.data=_.Array({displayName:"Form Data",required:!0,properties:{fieldName:_.ShortText({displayName:"Field Name",required:!0}),fieldType:_.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:_.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:_.File({displayName:"File Field Value",required:!1})}});break}return S},"props")}),response_is_binary:_.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:_.Checkbox({displayName:"No Error on Failure",required:!1,...l?.failsafe??{}}),timeout:_.Number({displayName:"Timeout (in seconds)",required:!1,...l?.timeout??{}}),followRedirects:_.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async h=>{let{method:P,url:S,headers:x,queryParams:s,body:p,body_type:f,failsafe:m,timeout:v,response_is_binary:b,followRedirects:j}=h.propsValue;Lt(P,"Method"),Lt(S,"URL");let re=he(r)?{}:await r(h.auth,h.propsValue),ae=S.url,Ye=ae.startsWith("http://")||ae.startsWith("https://")?ae:bd({baseUrl:t(h.auth),relativePath:ae}),$e={method:P,url:Ye,headers:{...x??{},...y==="headers"||!he(y)?re:{}},queryParams:{...y==="queryParams"?re:{},...s??{}},timeout:v?v*1e3:0,followRedirects:j};if(b&&($e.responseType="arraybuffer"),p)if(f&&f!=="none"){let pe=p.data;if(f==="form_data"){let Ys=pe,Tt=new Ds.default;for(let{fieldName:fn,fieldType:gn,textFieldValue:yn,fileFieldValue:sr}of Ys)gn==="text"&&!ht(yn)?Tt.append(fn,yn):gn==="file"&&!ht(sr)&&Tt.append(fn,sr.data,{filename:sr?.filename});$e.body=Tt,$e.headers={...$e.headers,...Tt.getHeaders()}}else $e.body=pe}else f||($e.body=p);try{let pe=await Ze.sendRequest($e);return await Ed(h.files,pe.body,pe.status,pe.headers,b)}catch(pe){if(m)return pe.errorMessage();throw pe}},"run")})}o(Cs,"createCustomApiCallAction");var Ed=o(async(e,t,r,n,i)=>{let u;if(i&&Id(t)){let l=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=Pd(l??"")||"txt",y;t instanceof ArrayBuffer?y=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?y=t:y=Buffer.from(t),u=await e.write({fileName:`output.${d}`,data:y})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Id=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Ke="https://api.elasticemail.com/v4",or=["Transactional","Engaged","Active","Bounced","Unsubscribed","Abuse","Inactive","Stale","NotConfirmed"],ir=["Deleted","Active","Processing","Sending","Completed","Paused","Cancelled","Draft"],Us=["HTML","PlainText","AMP","CSS"],Ms=["UserProvided","None","Raw7bit","Raw8bit","QuotedPrintable","Base64","Uue"],js=["Unknown","Allow","Deny"];var B=Br.SecretText({displayName:"API Key",description:`
1
+ "use strict";var mu=Object.create;var et=Object.defineProperty;var fu=Object.getOwnPropertyDescriptor;var gu=Object.getOwnPropertyNames;var yu=Object.getPrototypeOf,hu=Object.prototype.hasOwnProperty;var o=(e,t)=>et(e,"name",{value:t,configurable:!0});var I=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Pn=(e,t)=>{for(var r in t)et(e,r,{get:t[r],enumerable:!0})},_n=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gu(t))!hu.call(e,i)&&i!==r&&et(e,i,{get:()=>t[i],enumerable:!(n=fu(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?mu(yu(e)):{},_n(t||!e||!e.__esModule?et(r,"default",{value:e,enumerable:!0}):r,e)),vu=e=>_n(et({},"__esModule",{value:!0}),e);var Ho=I((Vo,qt)=>{(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 y(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let f=0,m=-1,v=(s.match(p.zoneIndex)||[])[0],b,L;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)f++;if(s.substr(0,2)==="::"&&f--,s.substr(-2,2)==="::"&&f--,f>d)return null;for(L=d-f,b=":";L--;)b+="0:";return s=s.replace("::",b),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let re=s.split(":"),ae=[];for(let Qe=0;Qe<re.length;Qe++)ae.push(parseInt(re[Qe],16));return ae})(),{parts:d,zoneId:v}}o(y,"expandIPv6");function h(s,d,f,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,b;for(;m>0;){if(b=f-m,b<0&&(b=0),s[v]>>b!==d[v]>>b)return!1;m-=f,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 $(s,d){for(;s.length<d;)s=`0${s}`;return s}o($,"padPart");let x={};x.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let f,m;for(f=0;f<d.length;f++)if(m=d[f],!(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,f){let m;if(f===void 0&&(m=d,d=m[0],f=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,f)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,f=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,b,L;for(v=3;v>=0;v-=1)if(b=this.octets[v],b in m){if(L=m[b],f&&L!==0)return null;L!==8&&(f=!0),d+=L}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),f=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],b=0;for(;b<4;)v.push(parseInt(f[b],10)|parseInt(m[b],10)^255),b++;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,f,m,v,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],f=0;f<4;)v.push(parseInt(m[f],10)&parseInt(b[f],10)),f++;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 f=parseInt(d[2]);if(f>=0&&f<=32){let m=[this.parse(d[1]),f];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,f,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),b=[];for(let L=0;L<v.length;L++)f=v[L],b.push(_(f));return b})();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=[],b;for(b=0;b<=24;b+=8)v.push(m>>b&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),b=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return b.push(_(v[0])),b.push(m>>16&255),b.push(m>>8&255),b.push(m&255),b})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),b=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return b.push(_(v[0])),b.push(_(v[1])),b.push(m>>8&255),b.push(m&255),b})():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],f=0,m=Math.floor(s/8);for(;f<m;)d[f]=255,f++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=(function(){function s(d,f){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");f&&(this.zoneId=f)}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,f){let m;if(f===void 0&&(m=d,d=m[0],f=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,f)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,f=!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,b;for(let L=7;L>=0;L-=1)if(v=this.parts[L],v in m){if(b=m[v],f&&b!==0)return null;b!==16&&(f=!0),d+=b}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,f=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],f.push(d>>8),f.push(d&255);return f},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push($(this.parts[v].toString(16),4));return m}).call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),d+f},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),f=d[0],m=d[1];return new x.IPv4([f>>8,f&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(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),d+f},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,f=this.toNormalizedString(),m=0,v=-1,b;for(;b=d.exec(f);)b[0].length>v&&(m=b.index,v=b[0].length);return v<0?f:`${f.substring(0,m)}::${f.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),f=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],b=0;for(;b<16;)v.push(parseInt(f[b],10)|parseInt(m[b],10)^255),b++;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,f,m,v,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],f=0;f<16;)v.push(parseInt(m[f],10)&parseInt(b[f],10)),f++;return new this(v)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},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,f,m;if((f=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(f[2]),d>=0&&d<=128))return m=[this.parse(f[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,f,m,v,b,L;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return y(s,8);if((m=s.match(p.transitional))&&(L=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=y(d+L,6),d.parts)){for(b=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],f=0;f<b.length;f++)if(v=b[f],!(0<=v&&v<=255))return null;return d.parts.push(b[0]<<8|b[1]),d.parts.push(b[2]<<8|b[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],f=0,m=Math.floor(s/8);for(;f<m;)d[f]=255,f++;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,f){let m,v,b,L;f==null&&(f="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(b=d[v],b[0]&&!(b[0]instanceof Array)&&(b=[b]),m=0;m<b.length;m++)if(L=b[m],s.kind()===L[0].kind()&&s.match.apply(s,L))return v}return f},typeof qt<"u"&&qt.exports?qt.exports=x:e.ipaddr=x})(Vo)});var qi=I((zA,Hi)=>{var Vi=require("stream").Stream,ep=require("util");Hi.exports=ce;function ce(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ce,"DelayedStream");ep.inherits(ce,Vi);ce.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(ce.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ce.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ce.prototype.resume=function(){this._released||this.release(),this.source.resume()};ce.prototype.pause=function(){this.source.pause()};ce.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ce.prototype.pipe=function(){var e=Vi.prototype.pipe.apply(this,arguments);return this.resume(),e};ce.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)};ce.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 Ji=I((kA,Ki)=>{var tp=require("util"),Wi=require("stream").Stream,Gi=qi();Ki.exports=J;function J(){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(J,"CombinedStream");tp.inherits(J,Wi);J.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};J.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};J.prototype.append=function(e){var t=J.isStreamLike(e);if(t){if(!(e instanceof Gi)){var r=Gi.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};J.prototype.pipe=function(e,t){return Wi.prototype.pipe.call(this,e,t),this.resume(),e};J.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}};J.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=J.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};J.prototype._pipeNext=function(e){this._currentStream=e;var t=J.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()};J.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};J.prototype.write=function(e){this.emit("data",e)};J.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};J.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")};J.prototype.end=function(){this._reset(),this.emit("end")};J.prototype.destroy=function(){this._reset(),this.emit("close")};J.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};J.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};J.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)};J.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Yi=I((wA,Xi)=>{"use strict";Xi.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 ta=I(te=>{"use strict";var Yt=Yi(),rp=require("path").extname,Qi=/^\s*([^;\s]*)(?:;|\s|$)/,np=/^text\//i;te.charset=ea;te.charsets={lookup:ea};te.contentType=op;te.extension=ip;te.extensions=Object.create(null);te.lookup=ap;te.types=Object.create(null);sp(te.extensions,te.types);function ea(e){if(!e||typeof e!="string")return!1;var t=Qi.exec(e),r=t&&Yt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&np.test(t[1])?"UTF-8":!1}o(ea,"charset");function op(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(op,"contentType");function ip(e){if(!e||typeof e!="string")return!1;var t=Qi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(ip,"extension");function ap(e){if(!e||typeof e!="string")return!1;var t=rp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(ap,"lookup");function sp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Yt).forEach(o(function(i){var u=Yt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var y=c[p];if(t[y]){var h=r.indexOf(Yt[t[y]].source),_=r.indexOf(u.source);if(t[y]!=="application/octet-stream"&&(h>_||h===_&&t[y].substr(0,12)==="application/"))continue}t[y]=i}}},"forEachMimeType"))}o(sp,"populateMaps")});var na=I((CA,ra)=>{ra.exports=up;function up(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(up,"defer")});var Jr=I((MA,ia)=>{var oa=na();ia.exports=cp;function cp(e){var t=!1;return oa(function(){t=!0}),o(function(n,i){t?e(n,i):oa(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(cp,"async")});var Xr=I((jA,aa)=>{aa.exports=lp;function lp(e){Object.keys(e.jobs).forEach(pp.bind(e)),e.jobs={}}o(lp,"abort");function pp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(pp,"clean")});var Yr=I((BA,ua)=>{var sa=Jr(),dp=Xr();ua.exports=mp;function mp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=fp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?dp(r):r.results[i]=c,n(u,r.results))})}o(mp,"iterate");function fp(e,t,r,n){var i;return e.length==2?i=e(r,sa(n)):i=e(r,t,sa(n)),i}o(fp,"runJob")});var Qr=I((VA,ca)=>{ca.exports=gp;function gp(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(gp,"state")});var en=I((qA,la)=>{var yp=Xr(),hp=Jr();la.exports=vp;function vp(e){Object.keys(this.jobs).length&&(this.index=this.size,yp(this),hp(e)(null,this.results))}o(vp,"terminator")});var da=I((WA,pa)=>{var xp=Yr(),Pp=Qr(),_p=en();pa.exports=bp;function bp(e,t,r){for(var n=Pp(e);n.index<(n.keyedList||e).length;)xp(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 _p.bind(n,r)}o(bp,"parallel")});var tn=I((JA,Qt)=>{var ma=Yr(),Ep=Qr(),Tp=en();Qt.exports=Ip;Qt.exports.ascending=fa;Qt.exports.descending=Sp;function Ip(e,t,r,n){var i=Ep(e,r);return ma(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){ma(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Tp.bind(i,n)}o(Ip,"serialOrdered");function fa(e,t){return e<t?-1:e>t?1:0}o(fa,"ascending");function Sp(e,t){return-1*fa(e,t)}o(Sp,"descending")});var ya=I((YA,ga)=>{var $p=tn();ga.exports=Ap;function Ap(e,t,r){return $p(e,t,null,r)}o(Ap,"serial")});var va=I((ez,ha)=>{ha.exports={parallel:da(),serial:ya(),serialOrdered:tn()}});var rn=I((tz,xa)=>{"use strict";xa.exports=Object});var _a=I((rz,Pa)=>{"use strict";Pa.exports=Error});var Ea=I((nz,ba)=>{"use strict";ba.exports=EvalError});var Ia=I((oz,Ta)=>{"use strict";Ta.exports=RangeError});var $a=I((iz,Sa)=>{"use strict";Sa.exports=ReferenceError});var za=I((az,Aa)=>{"use strict";Aa.exports=SyntaxError});var er=I((sz,Oa)=>{"use strict";Oa.exports=TypeError});var Na=I((uz,ka)=>{"use strict";ka.exports=URIError});var Ra=I((cz,wa)=>{"use strict";wa.exports=Math.abs});var Ca=I((lz,Da)=>{"use strict";Da.exports=Math.floor});var Ma=I((pz,Ua)=>{"use strict";Ua.exports=Math.max});var ja=I((dz,La)=>{"use strict";La.exports=Math.min});var Ba=I((mz,Fa)=>{"use strict";Fa.exports=Math.pow});var Va=I((fz,Za)=>{"use strict";Za.exports=Math.round});var qa=I((gz,Ha)=>{"use strict";Ha.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Wa=I((hz,Ga)=>{"use strict";var zp=qa();Ga.exports=o(function(t){return zp(t)||t===0?t:t<0?-1:1},"sign")});var Ja=I((xz,Ka)=>{"use strict";Ka.exports=Object.getOwnPropertyDescriptor});var nn=I((Pz,Xa)=>{"use strict";var tr=Ja();if(tr)try{tr([],"length")}catch{tr=null}Xa.exports=tr});var Qa=I((_z,Ya)=>{"use strict";var rr=Object.defineProperty||!1;if(rr)try{rr({},"a",{value:1})}catch{rr=!1}Ya.exports=rr});var on=I((bz,es)=>{"use strict";es.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 ns=I((Tz,rs)=>{"use strict";var ts=typeof Symbol<"u"&&Symbol,Op=on();rs.exports=o(function(){return typeof ts!="function"||typeof Symbol!="function"||typeof ts("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Op()},"hasNativeSymbols")});var an=I((Sz,os)=>{"use strict";os.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var sn=I(($z,is)=>{"use strict";var kp=rn();is.exports=kp.getPrototypeOf||null});var us=I((Az,ss)=>{"use strict";var Np="Function.prototype.bind called on incompatible ",wp=Object.prototype.toString,Rp=Math.max,Dp="[object Function]",as=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"),Cp=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"),Up=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");ss.exports=o(function(t){var r=this;if(typeof r!="function"||wp.apply(r)!==Dp)throw new TypeError(Np+r);for(var n=Cp(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,as(n,arguments));return Object(_)===_?_:this}return r.apply(t,as(n,arguments))},"binder"),c=Rp(0,r.length-n.length),p=[],y=0;y<c;y++)p[y]="$"+y;if(i=Function("binder","return function ("+Up(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 He=I((Oz,cs)=>{"use strict";var Mp=us();cs.exports=Function.prototype.bind||Mp});var nr=I((kz,ls)=>{"use strict";ls.exports=Function.prototype.call});var un=I((Nz,ps)=>{"use strict";ps.exports=Function.prototype.apply});var ms=I((wz,ds)=>{"use strict";ds.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var gs=I((Rz,fs)=>{"use strict";var Lp=He(),jp=un(),Fp=nr(),Bp=ms();fs.exports=Bp||Lp.call(Fp,jp)});var hs=I((Dz,ys)=>{"use strict";var Zp=He(),Vp=er(),Hp=nr(),qp=gs();ys.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Vp("a function is required");return qp(Zp,Hp,t)},"callBindBasic")});var Es=I((Uz,bs)=>{"use strict";var Gp=hs(),vs=nn(),Ps;try{Ps=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var cn=!!Ps&&vs&&vs(Object.prototype,"__proto__"),_s=Object,xs=_s.getPrototypeOf;bs.exports=cn&&typeof cn.get=="function"?Gp([cn.get]):typeof xs=="function"?o(function(t){return xs(t==null?t:_s(t))},"getDunder"):!1});var As=I((Lz,$s)=>{"use strict";var Ts=an(),Is=sn(),Ss=Es();$s.exports=Ts?o(function(t){return Ts(t)},"getProto"):Is?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Is(t)},"getProto"):Ss?o(function(t){return Ss(t)},"getProto"):null});var ln=I((Fz,zs)=>{"use strict";var Wp=Function.prototype.call,Kp=Object.prototype.hasOwnProperty,Jp=He();zs.exports=Jp.call(Wp,Kp)});var Cs=I((Bz,Ds)=>{"use strict";var M,Xp=rn(),Yp=_a(),Qp=Ea(),ed=Ia(),td=$a(),Ke=za(),We=er(),rd=Na(),nd=Ra(),od=Ca(),id=Ma(),ad=ja(),sd=Ba(),ud=Va(),cd=Wa(),ws=Function,pn=o(function(e){try{return ws('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),bt=nn(),ld=Qa(),dn=o(function(){throw new We},"throwTypeError"),pd=bt?(function(){try{return arguments.callee,dn}catch{try{return bt(arguments,"callee").get}catch{return dn}}})():dn,qe=ns()(),Q=As(),dd=sn(),md=an(),Rs=un(),Et=nr(),Ge={},fd=typeof Uint8Array>"u"||!Q?M:Q(Uint8Array),De={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":qe&&Q?Q([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":Ge,"%AsyncGenerator%":Ge,"%AsyncGeneratorFunction%":Ge,"%AsyncIteratorPrototype%":Ge,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Yp,"%eval%":eval,"%EvalError%":Qp,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":ws,"%GeneratorFunction%":Ge,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qe&&Q?Q(Q([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qe||!Q?M:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Xp,"%Object.getOwnPropertyDescriptor%":bt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":ed,"%ReferenceError%":td,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qe||!Q?M:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qe&&Q?Q(""[Symbol.iterator]()):M,"%Symbol%":qe?Symbol:M,"%SyntaxError%":Ke,"%ThrowTypeError%":pd,"%TypedArray%":fd,"%TypeError%":We,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":rd,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Et,"%Function.prototype.apply%":Rs,"%Object.defineProperty%":ld,"%Object.getPrototypeOf%":dd,"%Math.abs%":nd,"%Math.floor%":od,"%Math.max%":id,"%Math.min%":ad,"%Math.pow%":sd,"%Math.round%":ud,"%Math.sign%":cd,"%Reflect.getPrototypeOf%":md};if(Q)try{null.error}catch(e){Os=Q(Q(e)),De["%Error.prototype%"]=Os}var Os,gd=o(function e(t){var r;if(t==="%AsyncFunction%")r=pn("async function () {}");else if(t==="%GeneratorFunction%")r=pn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=pn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Q&&(r=Q(i.prototype))}return De[t]=r,r},"doEval"),ks={__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=He(),or=ln(),yd=Tt.call(Et,Array.prototype.concat),hd=Tt.call(Rs,Array.prototype.splice),Ns=Tt.call(Et,String.prototype.replace),ir=Tt.call(Et,String.prototype.slice),vd=Tt.call(Et,RegExp.prototype.exec),xd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Pd=/\\(\\)?/g,_d=o(function(t){var r=ir(t,0,1),n=ir(t,-1);if(r==="%"&&n!=="%")throw new Ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ke("invalid intrinsic syntax, expected opening `%`");var i=[];return Ns(t,xd,function(u,c,p,y){i[i.length]=p?Ns(y,Pd,"$1"):c||u}),i},"stringToPath"),bd=o(function(t,r){var n=t,i;if(or(ks,n)&&(i=ks[n],n="%"+i[0]+"%"),or(De,n)){var u=De[n];if(u===Ge&&(u=gd(n)),typeof u>"u"&&!r)throw new We("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ds.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new We("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new We('"allowMissing" argument must be a boolean');if(vd(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_d(t),i=n.length>0?n[0]:"",u=bd("%"+i+"%",r),c=u.name,p=u.value,y=!1,h=u.alias;h&&(i=h[0],hd(n,yd([0,1],h)));for(var _=1,$=!0;_<n.length;_+=1){var x=n[_],s=ir(x,0,1),d=ir(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ke("property names with quotes must have matching quotes");if((x==="constructor"||!$)&&(y=!0),i+="."+x,c="%"+i+"%",or(De,c))p=De[c];else if(p!=null){if(!(x in p)){if(!r)throw new We("base intrinsic for "+t+" exists, but the property is not available.");return}if(bt&&_+1>=n.length){var f=bt(p,x);$=!!f,$&&"get"in f&&!("originalValue"in f.get)?p=f.get:p=p[x]}else $=or(p,x),p=p[x];$&&!y&&(De[c]=p)}}return p},"GetIntrinsic")});var Ms=I((Vz,Us)=>{"use strict";var Ed=on();Us.exports=o(function(){return Ed()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Fs=I((qz,js)=>{"use strict";var Td=Cs(),Ls=Td("%Object.defineProperty%",!0),Id=Ms()(),Sd=ln(),$d=er(),ar=Id?Symbol.toStringTag:null;js.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 $d("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ar&&(n||!Sd(t,ar))&&(Ls?Ls(t,ar,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ar]=r)},"setToStringTag")});var Zs=I((Wz,Bs)=>{"use strict";var Ad=Function.prototype.call,zd=Object.prototype.hasOwnProperty,Od=He();Bs.exports=Od.call(Ad,zd)});var Hs=I((Kz,Vs)=>{"use strict";Vs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Ws=I((Jz,Gs)=>{"use strict";var yn=Ji(),kd=require("util"),mn=require("path"),Nd=require("http"),wd=require("https"),Rd=require("url").parse,Dd=require("fs"),Cd=require("stream").Stream,Ud=require("crypto"),fn=ta(),Md=va(),Ld=Fs(),Oe=Zs(),gn=Hs();function qs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(qs,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],yn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");kd.inherits(j,yn);j.LINE_BREAK=`\r
2
+ `;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=yn.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)};j.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)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Oe(t,"httpVersion"))&&!(t instanceof Cd))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){Oe(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Dd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Oe(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Oe(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.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="'+qs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&gn(c,r.header);var p;for(var y in c)if(Oe(c,y)){if(p=c[y],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=y+": "+p.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+u+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=mn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=mn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Oe(e,"httpVersion")&&(r=mn.basename(e.client._httpMessage.path||"")),r)return'filename="'+qs(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=fn.lookup(e.name)),!r&&e&&e.path&&(r=fn.lookup(e.path)),!r&&e&&e.readable&&Oe(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=fn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Oe(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.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(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+Ud.randomBytes(12).toString("hex")};j.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};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.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}Md.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Rd(e),n=gn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=gn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=wd.request(n):r=Nd.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,y=o(function(h,_){return r.removeListener("error",y),r.removeListener("response",p),t.call(this,h,_)},"callback");p=y.bind(this,null),r.on("error",y),r.on("response",p)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};Ld(j.prototype,"FormData");Gs.exports=j});var Wd={};Pn(Wd,{elasticEmail:()=>Gd});module.exports=vu(Wd);var xu=Object.freeze({status:"aborted"});function E(e,t,r){function n(p,y){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:y,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,y);let h=c.prototype,_=Object.keys(h);for(let $=0;$<_.length;$++){let x=_[$];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 y;let h=r?.Parent?new u:this;n(h,p),(y=h._zod).deferred??(y.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(E,"$constructor");var le=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},St=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},pr={};function fe(e){return e&&Object.assign(pr,e),pr}o(fe,"config");function mr(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(mr,"getEnumValues");function En(e,t){return typeof t=="bigint"?t.toString():t}o(En,"jsonStringifyReplacer");function At(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(At,"cached");function Tn(e){return e==null}o(Tn,"nullish");function zt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(zt,"cleanRegex");var bn=Symbol("evaluating");function X(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==bn)return n===void 0&&(n=bn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(X,"defineLazy");var fr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(tt,"isObject");var Pu=At(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function In(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(In,"isPlainObject");var Sn=new Set(["string","number","symbol"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ue,"escapeRegex");function Ot(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Ot,"clone");function H(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(H,"normalizeParams");function $n(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o($n,"optionalKeys");var An={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 Me(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(Me,"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 $t(e){return typeof e=="string"?e:e?.message}o($t,"unwrapMessage");function Ee(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=$t(e.inst?._zod.def?.error?.(e))??$t(t?.error?.(e))??$t(r.customError?.(e))??$t(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Ee,"finalizeIssue");function zn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(zn,"getLengthableOrigin");function gr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(gr,"issue");var On=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,En,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),kn=E("$ZodError",On),rt=E("$ZodError",On,{Parent:Error});var bu=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 le;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(y=>Ee(y,u,fe())));throw fr(p,i?.callee),p}return c.value},"_parse"),kt=bu(rt),Eu=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(y=>Ee(y,u,fe())));throw fr(p,i?.callee),p}return c.value},"_parseAsync"),Nt=Eu(rt),Tu=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 le;return u.issues.length?{success:!1,error:new(e??kn)(u.issues.map(c=>Ee(c,i,fe())))}:{success:!0,data:u.value}},"_safeParse"),nt=Tu(rt),Iu=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=>Ee(c,i,fe())))}:{success:!0,data:u.value}},"_safeParseAsync"),ot=Iu(rt);var Su="(?:(?:\\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])))",$u=new RegExp(`^${Su}$`);var Nn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),wn=/^-?\d+n?$/,Rn=/^-?\d+$/,yr=/^-?\d+(?:\.\d+)?$/,Dn=/^(?:true|false)$/i;var Te=E("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Au={number:"number",bigint:"bigint",object:"date"};var Cn=E("$ZodCheckGreaterThan",(e,t)=>{Te.init(e,t);let r=Au[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 Un=E("$ZodCheckNumberFormat",(e,t)=>{Te.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=An[t.format];e._zod.onattach.push(c=>{let p=c._zod.bag;p.format=t.format,p.minimum=i,p.maximum=u,r&&(p.pattern=Rn)}),e._zod.check=c=>{let p=c.value;if(r){if(!Number.isInteger(p)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?c.issues.push({input:p,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:p,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}}p<i&&c.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>u&&c.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Mn=E("$ZodCheckMinLength",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Tn(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=zn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var hr=E("$ZodCheckStringFormat",(e,t)=>{var r,n;Te.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=()=>{})}),Ln=E("$ZodCheckRegex",(e,t)=>{hr.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 Fn={major:4,minor:3,patch:6};var G=E("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fn;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,y)=>{let h=Me(c),_;for(let $ of p){if($._zod.def.when){if(!$._zod.def.when(c))continue}else if(h)continue;let x=c.issues.length,s=$._zod.check(c);if(s instanceof Promise&&y?.async===!1)throw new le;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(h||(h=Me(c,x)))});else{if(c.issues.length===x)continue;h||(h=Me(c,x))}}return _?_.then(()=>c):c},"runChecks"),u=o((c,p,y)=>{if(Me(c))return c.aborted=!0,c;let h=i(p,n,y);if(h instanceof Promise){if(y.async===!1)throw new le;return h.then(_=>e._zod.parse(_,y))}return e._zod.parse(h,y)},"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 y=e._zod.parse(c,p);if(y instanceof Promise){if(p.async===!1)throw new le;return y.then(h=>i(h,n,p))}return i(y,n,p)}}X(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}))}),Dt=E("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Nn(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}}),vr=E("$ZodStringFormat",(e,t)=>{hr.init(e,t),Dt.init(e,t)});var qn=E("$ZodURL",(e,t)=>{vr.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 xr=E("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??yr,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}}),Gn=E("$ZodNumberFormat",(e,t)=>{Un.init(e,t),xr.init(e,t)}),Pr=E("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=Dn,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}}),Wn=E("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=wn,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 Kn=E("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),Jn=E("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r});var Xn=E("$ZodVoid",(e,t)=>{G.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}}),Yn=E("$ZodDate",(e,t)=>{G.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 Bn(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}o(Bn,"handleArrayResult");var Qn=E("$ZodArray",(e,t)=>{G.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],y=t.element._zod.run({value:p,issues:[]},n);y instanceof Promise?u.push(y.then(h=>Bn(h,r,c))):Bn(y,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Rt(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(Rt,"handlePropertyResult");function zu(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=$n(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(zu,"normalizeDef");function Ou(e,t,r,n,i,u){let c=[],p=i.keySet,y=i.catchall._zod,h=y.def.type,_=y.optout==="optional";for(let $ in t){if(p.has($))continue;if(h==="never"){c.push($);continue}let x=y.run({value:t[$],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Rt(s,r,$,t,_))):Rt(x,r,$,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(Ou,"handleCatchall");var eo=E("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let y={...p};return Object.defineProperty(t,"shape",{value:y}),y},"get")})}let n=At(()=>zu(t));X(e._zod,"propValues",()=>{let p=t.shape,y={};for(let h in p){let _=p[h]._zod;if(_.values){y[h]??(y[h]=new Set);for(let $ of _.values)y[h].add($)}}return y});let i=tt,u=t.catchall,c;e._zod.parse=(p,y)=>{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 _=[],$=c.shape;for(let x of c.keys){let s=$[x],d=s._zod.optout==="optional",f=s._zod.run({value:h[x],issues:[]},y);f instanceof Promise?_.push(f.then(m=>Rt(m,p,x,h,d))):Rt(f,p,x,h,d)}return u?Ou(_,h,p,y,n.value,e):_.length?Promise.all(_).then(()=>p):p}});function Zn(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=>!Me(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=>Ee(c,n,fe())))}),t)}o(Zn,"handleUnionResults");var _r=E("$ZodUnion",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),X(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),X(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),X(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=>zt(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 y of t.options){let h=y._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(y=>Zn(y,i,e,u)):Zn(p,i,e,u)}});var to=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,_r.init(e,t);let r=e._zod.parse;X(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,y]of Object.entries(c)){i[p]||(i[p]=new Set);for(let h of y)i[p].add(h)}}return i});let n=At(()=>{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 y of p){if(u.has(y))throw new Error(`Duplicate discriminator value "${String(y)}"`);u.set(y,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 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 ro=E("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!In(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($=>{$.issues.length&&r.issues.push(...be(h,$.issues)),r.value[h]=$.value})):(_.issues.length&&r.issues.push(...be(h,_.issues)),r.value[h]=_.value)}let y;for(let h in i)p.has(h)||(y=y??[],y.push(h));y&&y.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:y})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let y=t.keyType._zod.run({value:p,issues:[]},n);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&yr.test(p)&&y.issues.length){let $=t.keyType._zod.run({value:Number(p),issues:[]},n);if($ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");$.issues.length===0&&(y=$)}if(y.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map($=>Ee($,n,fe())),input:p,path:[p],inst:e});continue}let _=t.valueType._zod.run({value:i[p],issues:[]},n);_ instanceof Promise?u.push(_.then($=>{$.issues.length&&r.issues.push(...be(p,$.issues)),r.value[y.value]=$.value})):(_.issues.length&&r.issues.push(...be(p,_.issues)),r.value[y.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var no=E("$ZodEnum",(e,t)=>{G.init(e,t);let r=mr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Sn.has(typeof i)).map(i=>typeof i=="string"?Ue(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}}),oo=E("$ZodLiteral",(e,t)=>{if(G.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"?Ue(n):n?Ue(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 io=E("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new St(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 le;return r.value=i,r}});function Vn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Vn,"handleOptionalResult");var ao=E("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(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=>Vn(u,r.value)):Vn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var so=E("$ZodNullable",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.innerType._zod.optin),X(e._zod,"optout",()=>t.innerType._zod.optout),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)}|null)$`):void 0}),X(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 uo=E("$ZodPipe",(e,t)=>{G.init(e,t),X(e._zod,"values",()=>t.in._zod.values),X(e._zod,"optin",()=>t.in._zod.optin),X(e._zod,"optout",()=>t.out._zod.optout),X(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=>wt(c,t.in,n)):wt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>wt(u,t.out,n)):wt(i,t.out,n)}});function wt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(wt,"handlePipeResult");var co=E("$ZodCustom",(e,t)=>{Te.init(e,t),G.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=>Hn(u,r,n,e));Hn(i,r,n,e)}});function Hn(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(gr(i))}}o(Hn,"handleRefineResult");var po;var br=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 mo(){return new br}o(mo,"registry");(po=globalThis).__zod_globalRegistry??(po.__zod_globalRegistry=mo());var Er=globalThis.__zod_globalRegistry;function fo(e,t){return new e({type:"string",...H(t)})}o(fo,"_string");function go(e,t){return new e({type:"string",coerce:!0,...H(t)})}o(go,"_coercedString");function yo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}o(yo,"_url");function ho(e,t){return new e({type:"number",checks:[],...H(t)})}o(ho,"_number");function vo(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}o(vo,"_coercedNumber");function xo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...H(t)})}o(xo,"_int");function Po(e,t){return new e({type:"boolean",...H(t)})}o(Po,"_boolean");function _o(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}o(_o,"_coercedBoolean");function bo(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}o(bo,"_coercedBigint");function Eo(e){return new e({type:"any"})}o(Eo,"_any");function To(e){return new e({type:"unknown"})}o(To,"_unknown");function Io(e,t){return new e({type:"void",...H(t)})}o(Io,"_void");function So(e,t){return new e({type:"date",coerce:!0,...H(t)})}o(So,"_coercedDate");function Ct(e,t){return new Cn({check:"greater_than",...H(t),value:e,inclusive:!0})}o(Ct,"_gte");function se(e,t){return new Mn({check:"min_length",...H(t),minimum:e})}o(se,"_minLength");function Ie(e,t){return new Ln({check:"string_format",format:"regex",...H(t),pattern:e})}o(Ie,"_regex");function $o(e,t,r){let n=H(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o($o,"_custom");var Y=E("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");G.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>kt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>nt(e,r,n),e.parseAsync=async(r,n)=>Nt(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)=>Ot(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Mt=E("ZodMiniString",(e,t)=>{Dt.init(e,t),Y.init(e,t)});function a(e){return fo(Mt,e)}o(a,"string");var Ao=E("ZodMiniStringFormat",(e,t)=>{vr.init(e,t),Mt.init(e,t)});var Zu=E("ZodMiniURL",(e,t)=>{qn.init(e,t),Ao.init(e,t)});function zo(e){return yo(Zu,e)}o(zo,"url");var Lt=E("ZodMiniNumber",(e,t)=>{xr.init(e,t),Y.init(e,t)});function ee(e){return ho(Lt,e)}o(ee,"number");var Vu=E("ZodMiniNumberFormat",(e,t)=>{Gn.init(e,t),Lt.init(e,t)});function Oo(e){return xo(Vu,e)}o(Oo,"int");var Tr=E("ZodMiniBoolean",(e,t)=>{Pr.init(e,t),Y.init(e,t)});function B(e){return Po(Tr,e)}o(B,"boolean");var ko=E("ZodMiniBigInt",(e,t)=>{Wn.init(e,t),Y.init(e,t)});var Hu=E("ZodMiniAny",(e,t)=>{Kn.init(e,t),Y.init(e,t)});function at(){return Eo(Hu)}o(at,"any");var qu=E("ZodMiniUnknown",(e,t)=>{Jn.init(e,t),Y.init(e,t)});function k(){return To(qu)}o(k,"unknown");var Gu=E("ZodMiniVoid",(e,t)=>{Xn.init(e,t),Y.init(e,t)});function No(e){return Io(Gu,e)}o(No,"_void");var wo=E("ZodMiniDate",(e,t)=>{Yn.init(e,t),Y.init(e,t)});var Wu=E("ZodMiniArray",(e,t)=>{Qn.init(e,t),Y.init(e,t)});function R(e,t){return new Wu({type:"array",element:e,...H(t)})}o(R,"array");var Ku=E("ZodMiniObject",(e,t)=>{eo.init(e,t),Y.init(e,t),X(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...H(t)};return new Ku(r)}o(l,"object");var Ju=E("ZodMiniUnion",(e,t)=>{_r.init(e,t),Y.init(e,t)});function D(e,t){return new Ju({type:"union",options:e,...H(t)})}o(D,"union");var Xu=E("ZodMiniDiscriminatedUnion",(e,t)=>{to.init(e,t),Y.init(e,t)});function Se(e,t,r){return new Xu({type:"union",options:t,discriminator:e,...H(r)})}o(Se,"discriminatedUnion");var Yu=E("ZodMiniRecord",(e,t)=>{ro.init(e,t),Y.init(e,t)});function N(e,t,r){return new Yu({type:"record",keyType:e,valueType:t,...H(r)})}o(N,"record");var Qu=E("ZodMiniEnum",(e,t)=>{no.init(e,t),Y.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Qu({type:"enum",entries:r,...H(t)})}o(U,"_enum");var ec=E("ZodMiniLiteral",(e,t)=>{oo.init(e,t),Y.init(e,t)});function S(e,t){return new ec({type:"literal",values:Array.isArray(e)?e:[e],...H(t)})}o(S,"literal");var tc=E("ZodMiniTransform",(e,t)=>{io.init(e,t),Y.init(e,t)});function $e(e){return new tc({type:"transform",transform:e})}o($e,"transform");var rc=E("ZodMiniOptional",(e,t)=>{ao.init(e,t),Y.init(e,t)});function g(e){return new rc({type:"optional",innerType:e})}o(g,"optional");var nc=E("ZodMiniNullable",(e,t)=>{so.init(e,t),Y.init(e,t)});function st(e){return new nc({type:"nullable",innerType:e})}o(st,"nullable");var oc=E("ZodMiniPipe",(e,t)=>{uo.init(e,t),Y.init(e,t)});function Ae(e,t){return new oc({type:"pipe",in:e,out:t})}o(Ae,"pipe");var ic=E("ZodMiniCustom",(e,t)=>{co.init(e,t),Y.init(e,t)});function jt(e,t){return $o(ic,e??(()=>!0),t)}o(jt,"custom");var ut={};Pn(ut,{bigint:()=>pc,boolean:()=>lc,date:()=>dc,number:()=>cc,string:()=>uc});function uc(e){return go(Mt,e)}o(uc,"string");function cc(e){return vo(Lt,e)}o(cc,"number");function lc(e){return _o(Tr,e)}o(lc,"boolean");function pc(e){return bo(ko,e)}o(pc,"bigint");function dc(e){return So(wo,e)}o(dc,"date");var Sr=l({retryOnFailure:l({defaultValue:g(B()),hide:g(B())}),continueOnFailure:l({defaultValue:g(B()),hide:g(B())})}),Ir=class{constructor(t,r,n,i,u,c,p,y,h,_,$){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=y;this.outputSchema=h;this.audience=_;this.aiMetadata=$}static{o(this,"IAction")}},W=o(e=>new Ir(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 F=l({displayName:a(),description:g(a())}),C=o((e,t)=>l({type:S(t),required:B(),defaultValue:g(at())}),"TPropertyValue");var ne=l({...F.shape,...C(a(),"SHORT_TEXT").shape}),ge=l({...F.shape,...C(a(),"LONG_TEXT").shape});var Do=l({label:a(),value:k()}),Ft=l({disabled:g(B()),placeholder:g(a()),options:R(Do)});var oe=l({...F.shape,options:Ft,...C(k(),"STATIC_DROPDOWN").shape}),ye=l({...F.shape,options:Ft,...C(R(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var $r=l({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:R(a())}),ct=l({...F.shape,...C(R(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var he=l({...F.shape,...C(B(),"CHECKBOX").shape});var ve=l({...F.shape,...C(ee(),"NUMBER").shape});var lt=l({...F.shape,streaming:g(B()),...C(k(),"FILE").shape});var pt=l({...F.shape,...C(a(),"DATE_TIME").shape});var Co=N(a(),D([ne,ge,oe,ct,ye,he,ve,lt,pt])),dt=l({...F.shape,properties:Co,...C(R(k()),"ARRAY").shape});var mt=l({...F.shape,...C(D([N(a(),k())]),"JSON").shape});var Uo=D([ne,oe,mt,dt,ye]),fc=N(a(),Uo),Ar=l({refreshers:R(a()),...F.shape,...C(k(),"DYNAMIC").shape});var Bt=l({...F.shape,...C(No(),"MARKDOWN").shape});var ft=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ft||{}),Le=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Le||{}),je=(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))(je||{});var gt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(gt||{}),zr="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||{}),gc=l({strategy:U(yt),paramName:g(a())}),ht=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ht||{});var Zt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Zt||{}),Mo=l({status:g(ee()),body:g(k()),headers:g(N(a(),a()))}),Lo=l({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:g(a()),handlerId:g(a()),streamStepProgress:g(U(Zt))}),jo=l({type:S("WEBHOOK"),requestId:a(),requestIdToReply:g(a()),response:Mo,handlerId:g(a()),streamStepProgress:g(U(Zt))}),yc=D([Lo,jo]);var hc=l({body:k(),rawBody:g(k()),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 Vt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Vt,"assertNotNullOrUndefined");var Or=Ce(require("crypto"),1);var vc=128,Ne,Fe,xc=o(e=>{!Ne||Ne.length<e?(Ne=Buffer.allocUnsafe(e*vc),Or.default.randomFillSync(Ne),Fe=0):Fe+e>Ne.length&&(Or.default.randomFillSync(Ne),Fe=0),Fe+=e},"fillPool"),Pc=o(e=>(xc(e|=0),Ne.subarray(Fe-e,Fe)),"random"),_c=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),y=i;for(;y--;)if(c+=e[p[y]&n]||"",c.length===u)return c}}},"customRandom"),Bo=o((e,t=21)=>_c(e,t,Pc),"customAlphabet");var bc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Zo=21,zb=a().check(Ie(new RegExp(`^[0-9a-zA-Z]{${Zo}}$`))),Ec=Bo(bc,Zo);var ze=Ae($e(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:ze,updated:ze},q=o(e=>g(st(e)),"Nullable");function kr(e){return g(st(U(e)))}o(kr,"NullableEnum");var Nb=Ae($e(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),g(B())),Ht=o(e=>Ae($e(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),g(R(e))),"OptionalArrayFromQuery");var Db=N(a(),k());var xt=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(xt||{});var Gb=a().check(Ie(/^#[0-9A-Fa-f]{6}$/));var Kb=l({filename:a(),data:k(),type:S("file"),mimetype:g(a())});var Tc=Ce(Ho());var rE=l({...ie,name:a(),permissions:R(a()),platformId:q(a()),type:a(),userCount:g(ee())});var qo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(qo||{}),Nr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Nr||{}),wr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(wr||{});var Rr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Rr||{});var Dr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Dr||{});var Ic=l({mode:U(qo),value:k()}),Sc=l({auth:g(a()),fields:N(a(),Ic)}),$c=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:g(Sc)}),Ac=l({type:S("PIECE"),toolName:a().check(se(1)),pieceMetadata:$c}),zc=l({type:S("none")}),Oc=l({type:S("access_token"),accessToken:a()}),kc=l({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),Nc=l({type:S("headers"),headers:N(a(),a())}),wc=Se("type",[zc,Oc,kc,Nc]),Go=l({type:S("FLOW"),toolName:a().check(se(1)),externalFlowId:a(),flowDisplayName:g(a())}),Wo=l({type:S("MCP"),toolName:a().check(se(1)),serverUrl:zo(),protocol:U(wr),auth:wc}),Ko=l({type:S("KNOWLEDGE_BASE"),toolName:a().check(se(1)),sourceType:U(Nr),sourceId:a(),sourceName:a()}),Rc=Se("type",[Ac,Go,Wo,Ko]),Dc=l({displayName:a(),description:g(a()),type:U(Rr)}),Jo=l({type:S("MARKDOWN"),markdown:a()}),Be={type:S("TOOL_CALL"),input:q(N(a(),k())),output:g(k()),toolName:a(),status:U(Dr),toolCallId:a(),startTime:a(),endTime:g(a())},wE=l(Be),Xo=Se("toolCallType",[l({...Be,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Be,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),l({...Be,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),l({...Be,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Be,toolCallType:S("UNKNOWN"),displayName:a()})]),Cc=D([Jo,Xo]);var Cr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Cr||{}),xe=l({apiKey:a()}),Uc=xe,Mc=l({apiKey:a(),apiKeyHash:a()}),Lc=xe,jc=xe,Fc=xe,Bc=xe,Zc=xe,Vc=xe,Hc=xe,ri=l({accessKeyId:a().check(se(1)),secretAccessKey:a().check(se(1))}),qc=l({}),Gc=l({}),Wc=l({}),Kc=l({}),Jc=l({}),Xc=l({}),ni=l({modelId:a(),modelName:a(),modelType:U(Cr)}),oi=l({apiKeyHeader:a(),baseUrl:a(),models:R(ni),defaultHeaders:g(N(a(),a()))}),ii=l({accountId:a(),gatewayId:a(),models:R(ni),vertexProject:g(a()),vertexRegion:g(a())}),ai=l({resourceName:a(),apiVersion:Ae($e(e=>typeof e=="string"&&e.trim().length===0?void 0:e),g(a()))}),si=l({region:a().check(se(1))}),Yc=D([Uc,Fc,Bc,Zc,Vc,jc,Lc,Mc,ri,Hc]),ui=D([oi,ii,ai,si,qc,Wc,Kc,Jc,Gc,Xc]),Qc=l({id:a(),name:a(),type:U(Cr)}),el=l({id:a(),name:a(),provider:U(xt),config:ui,enabledForChat:B()}),tl=l({provider:U(xt),config:ui,auth:Yc,platformId:a()});var UE={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Yo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],rl=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],nl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Qo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],ol=["grok-4.20","grok-4.1-fast"],il={openai:Yo,anthropic:rl,google:Qo,activepieces:[...nl.map(e=>`anthropic/${e}`),...Yo.map(e=>`openai/${e}`),...Qo.map(e=>`google/${e}`),...ol.map(e=>`x-ai/${e}`)]};var ei=128e3,al={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function sl({provider:e}){return e?al[e]??ei:ei}o(sl,"getMaxContextTokens");var ti={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"},ul={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},cl=new Set(["anthropic","mistral"]);function pe(e){return{chatModels:il[e],maxContextTokens:sl({provider:e}),defaultEmbeddingModel:ti[e],supportsEmbedding:ti[e]!==void 0,supportsImageGeneration:!cl.has(e),webSearch:ul[e]}}o(pe,"buildProviderCapabilities");var ll={openai:pe("openai"),anthropic:pe("anthropic"),openrouter:pe("openrouter"),azure:pe("azure"),google:pe("google"),"cloudflare-gateway":pe("cloudflare-gateway"),custom:pe("custom"),bedrock:pe("bedrock"),mistral:pe("mistral"),activepieces:pe("activepieces")};var pl=l({base64Url:a(),fileName:a(),extension:g(a())}),dl=l({mimeType:a(),url:a(),fileName:g(a())}),Ur=D([pl,dl]);var ml=D([l({type:S("file"),value:Ur}),l({type:S("markdown"),value:a(),files:g(R(Ur))})]),fl=l({sessionId:a(),message:a(),files:g(R(a()))});var li=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(li||{}),pi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(pi||{}),Mr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Mr||{});var gl=D([l({...ie,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:R(l({value:a()}))})}),l({...ie,name:a(),externalId:a(),type:D([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),yl=l({...ie,name:a(),folderId:q(a()),projectId:a(),externalId:a(),status:kr(pi),trigger:kr(li)}),hl=l({...ie,tableId:a(),projectId:a(),cells:N(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),vl=l({events:R(U(Mr)),webhookUrl:a(),flowId:a()}),xl=l({fields:R(l({id:a(),name:a()})),rows:R(N(a(),a())),name:a()}),Pl=l({projectId:a(),limit:g(ut.number()),cursor:g(a()),name:g(a()),externalIds:Ht(a()),folderId:g(a()),folderIds:Ht(a())}),_l=l({records:R(R(l({fieldId:a(),value:mi()}))),tableId:a()}),bl=l({cells:g(R(l({fieldId:a(),value:mi()}))),tableId:a(),agentUpdate:g(B())}),di=Se("operator",[we("eq"),we("neq"),we("gt"),we("gte"),we("lt"),we("lte"),we("co"),ci("exists"),ci("not_exists")]),El=l({tableId:a(),limit:g(ut.number()),cursor:g(a()),filters:Ht(di)});function mi(){return Ae($e(e=>e==null?e:String(e)),st(a()))}o(mi,"coerceToString");function we(e){return l({fieldId:a(),operator:S(e),value:a()})}o(we,"valueFilter");function ci(e){return l({fieldId:a(),operator:S(e)})}o(ci,"existenceFilter");var Tl=l({status:g(ee()),body:g(k()),headers:g(N(a(),a()))}),Il=l({...ie,deleted:q(ze),ownerId:a(),displayName:a(),platformId:a(),externalId:q(a())});var fi=l({name:a(),description:g(a()),type:a(),required:B()}),Sl=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:R(fi),returnsResponse:B()})});var gi="^[0-9]+\\.[0-9]+\\.[0-9]+$",rT=new RegExp(gi),Al="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",nT=a().check(Ie(new RegExp(gi))),oT=a().check(Ie(new RegExp(Al))),zl=l({packageType:S("ARCHIVE"),pieceType:U(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),yi=l({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),hi=l({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),iT=D([yi,hi]),aT=D([zl,yi,hi]);var Ol=Se("type",[l({type:S("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:S("INTERVAL"),intervalMs:Oo().check(Ct(6e4))})]),sT=l({...ie,type:U(ke),projectId:a(),flowId:a(),triggerName:a(),schedule:q(Ol),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:q(a()),simulate:B()}),vi=(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))(vi||{}),xi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(xi||{}),Pi=(r=>(r.S3="S3",r.DB="DB",r))(Pi||{}),uT=l({...ie,projectId:q(a()),platformId:q(a()),type:U(vi),compression:U(xi),data:g(k()),location:U(Pi),size:q(ee()),fileName:q(a()),s3Key:q(a()),metadata:q(N(a(),a()))}),_i=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(_i||{}),bi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(bi||{}),cT=l({id:a(),email:a(),firstName:a(),status:U(bi),externalId:q(a()),platformId:q(a()),platformRole:U(_i),lastName:a(),created:ze,updated:ze,lastActiveDate:q(ze),imageUrl:q(a())});var Lr=l({...F.shape,...C(N(a(),k()),"OBJECT").shape});var Si=l({...F.shape,...C(a(),"COLOR").shape});var jr=D([ne,ge,Bt,he,oe,ye,$r,ct,Ar,ve,dt,Lr,mt,pt,lt,Si]),P={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 de=l({displayName:a(),description:g(a())});var $i=l({username:a(),password:a()}),Fr=l({...de.shape,username:l({displayName:a(),description:g(a())}),password:l({displayName:a(),description:g(a())}),...C($i,"BASIC_AUTH").shape});var Rl=N(a(),D([ne,ge,ve,he,oe])),Br=l({...de.shape,props:Rl,...C(k(),"CUSTOM_AUTH").shape});var Re=l({...de.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var Dl=N(a(),D([ne,ge,Re,ve,he,oe,ye,Bt])),Ai=l({...de.shape,props:Dl,...C(k(),"OIDC").shape});var Zr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Zr||{}),zi=D([ne,Re,oe]),Oi=N(a(),zi),Cl=l({props:g(N(a(),zi)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:g(D([S("none"),S("consent"),S("login"),S("omit")])),pkce:g(B()),pkceMethod:g(D([S("plain"),S("S256")])),authorizationMethod:g(U(Zr)),grantType:g(D([U(gt),S(zr)])),extra:g(N(a(),a()))}),ki=l({access_token:a(),props:g(Oi),data:N(a(),at())}),Vr=l({...de.shape,...Cl.shape,...C(ki,"OAUTH2").shape});var Ze=D([Fr,Br,Ai,Vr,Re]),Pt="Connection",Hr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Pt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Pt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Pt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Pt}},None(){}};var FI={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 Ul=l({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var Ml=D([jr,Ze]),qr=N(a(),Ml),sS=N(a(),jr);var Ni=D([l({strategy:S("CRON"),cronExpression:a()}),l({strategy:S("NONE")})]);var wi="2",Gt="0.82.0";var Gr=class{constructor(t,r,n,i,u,c,p,y,h=Gt,_,$="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=y;this.minimumSupportedRelease=h;this.maximumSupportedRelease=_;this.description=$;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:wi}),"getContextInfo");(!Ll(h)||jl(h,Gt))&&(this.minimumSupportedRelease=Gt),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}},Ri=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 Gr(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 Ll(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Ll,"isValidSimpleSemver");function jl(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(jl,"isSemverLessThan");var Fl=g(N(a(),N(a(),a()))),Di=l({id:g(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:g(a()),directoryPath:g(a()),auth:g(D([Ze,R(Ze)])),version:a(),categories:g(R(U(je))),minimumSupportedRelease:g(a()),maximumSupportedRelease:g(a()),deprecated:g(B()),i18n:Fl}),Bl=U(["human","ai","both"]),Ci=l({description:g(a()),idempotent:g(B())}),Ui=l({name:a(),displayName:a(),description:a(),props:qr,requireAuth:B(),errorHandlingOptions:g(Sr),outputSchema:g(jt()),audience:g(Bl),aiMetadata:g(Ci)}),Mi=l({name:a(),displayName:a(),description:a(),props:qr,errorHandlingOptions:g(Sr),type:U(ke),sampleData:k(),handshakeConfiguration:g(jt()),renewConfiguration:g(Ni),testStrategy:U(ht),outputSchema:g(jt()),aiMetadata:g(Ci)}),Zl=l({...Di.shape,actions:N(a(),Ui),triggers:N(a(),Mi)}),Vl=l({...Di.shape,actions:ee(),triggers:ee(),suggestedActions:g(R(Ui)),suggestedTriggers:g(R(Mi))}),Li=l({projectUsage:ee(),pieceType:U(Le),packageType:U(ft),platformId:g(a()),archiveId:g(a())}),s$=l({...Zl.shape,...Li.shape}),u$=l({...Vl.shape,...Li.shape}),c$=l({name:a(),version:a()});var Hl=Ce(require("path")),ql=Ce(require("fs/promises"));var Zi=require("node:stream");var Wt=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 Kt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Wr,r=new Kr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Wr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Kr=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 _t=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 ji({error:e,requestBody:t}){return e instanceof _t?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(ji,"toFailsafeOutput");var Jt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Jt||{});var Xt=class extends Wt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Kt){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[L,re]of Object.entries(c))i.append(L,re);let p=i.toString(),y=p?`${n}?${p}`:n,h=t.responseType??"json",_=t.followRedirects??!0,$=t.retries??0,{body:x,extraHeaders:s,isStream:d}=Gl(t.method)?Wl(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},f=Jl({...u,...s}),m=await Kl(async()=>{let L=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let ae={method:t.method.toString(),headers:f,body:x,redirect:_?"follow":"manual",signal:L.signal};return d&&(ae.duplex="half"),r?.dispatcher!==void 0&&(ae.dispatcher=r.dispatcher),await fetch(y,ae)}finally{re!==void 0&&clearTimeout(re)}},$),v=_?300:400;if(m.status<200||m.status>=v){let L=await Fi(m,h),re=new _t(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let b=await Fi(m,h);return{status:m.status,headers:Xl(m.headers),body:b}}};function Gl(e){return e!=="GET"&&e!=="HEAD"}o(Gl,"acceptsRequestBody");function Wl(e,t){if(Ql(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Yl(e)){let n=new Zi.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(Wl,"serializeBody");async function Fi(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(Fi,"parseResponseBody");async function Kl(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(Kl,"sendWithRetries");function Bi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Bi,"backoff");function Jl(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(Jl,"normalizeHeaders");function Xl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Xl,"toHttpHeaders");function Yl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Yl,"isNodeFormData");function Ql(e){return e==null}o(Ql,"isNil");var Ve=new Xt;var jd=Ce(require("fs")),Ks=Ce(Ws());var Fd={"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 Bd(e){let t=e.split(";")[0].trim().toLowerCase();return Fd[t]??""}o(Bd,"contentTypeToExtension");var Zd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Vd=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 Js({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:y="headers"}){return W({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:P.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:P.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${Vd(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:P.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Jt).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:P.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:P.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:P.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:P.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let _=h,$={};switch(_){case"none":break;case"json":$.data=P.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":$.data=P.LongText({displayName:"Raw Body",required:!0});break;case"form_data":$.data=P.Array({displayName:"Form Data",required:!0,properties:{fieldName:P.ShortText({displayName:"Field Name",required:!0}),fieldType:P.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:P.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:P.File({displayName:"File Field Value",required:!1})}});break}return $},"props")}),response_is_binary:P.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:P.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:P.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:P.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async h=>{let{method:_,url:$,headers:x,queryParams:s,body:d,body_type:f,failsafe:m,timeout:v,response_is_binary:b,followRedirects:L}=h.propsValue;Vt(_,"Method"),Vt($,"URL");let re=ue(r)?{}:await r(h.auth,h.propsValue),ae=$.url,Qe=ae.startsWith("http://")||ae.startsWith("https://")?ae:Zd({baseUrl:t(h.auth),relativePath:ae}),_e={method:_,url:Qe,headers:{...x??{},...y==="headers"||!ue(y)?re:{}},queryParams:{...y==="queryParams"?re:{},...s??{}},timeout:v?v*1e3:0,followRedirects:L};if(b&&(_e.responseType="arraybuffer"),d)if(f&&f!=="none"){let me=d.data;if(f==="form_data"){let du=me,It=new Ks.default;for(let{fieldName:hn,fieldType:vn,textFieldValue:xn,fileFieldValue:lr}of du)vn==="text"&&!vt(xn)?It.append(hn,xn):vn==="file"&&!vt(lr)&&It.append(hn,lr.data,{filename:lr?.filename});_e.body=It,_e.headers={..._e.headers,...It.getHeaders()}}else _e.body=me}else f||(_e.body=d);try{let me=await Ve.sendRequest(_e);return await Hd(h.files,me.body,me.status,me.headers,b)}catch(me){if(m)return ji({error:me,requestBody:_e.body});throw me}},"run")})}o(Js,"createCustomApiCallAction");var Hd=o(async(e,t,r,n,i)=>{let u;if(i&&qd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Bd(c??"")||"txt",y;t instanceof ArrayBuffer?y=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?y=t:y=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:y})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),qd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Je="https://api.elasticemail.com/v4",sr=["Transactional","Engaged","Active","Bounced","Unsubscribed","Abuse","Inactive","Stale","NotConfirmed"],ur=["Deleted","Active","Processing","Sending","Completed","Paused","Cancelled","Draft"],Xs=["HTML","PlainText","AMP","CSS"],Ys=["UserProvided","None","Raw7bit","Raw8bit","QuotedPrintable","Base64","Uue"],Qs=["Unknown","Allow","Deny"];var Z=Hr.SecretText({displayName:"API Key",description:`
4
4
  To obtain your Elastic Email API key:
5
5
  1. Log in to your Elastic Email account
6
6
  2. Navigate to **Settings \u2192 Manage API Keys**
7
7
  3. Click **Create API Key**
8
8
  4. Ensure the key has the required permissions (Contacts, Campaigns, Emails, Segments)
9
9
  5. Copy the key and paste it here
10
- `,required:!0,validate:o(async({auth:e})=>{try{return(await Ze.sendRequest({method:"GET",url:`${Ke}/contacts`,headers:{"X-ElasticEmail-ApiKey":e},queryParams:{limit:"1"}})).status===200?{valid:!0}:{valid:!1,error:"Invalid API key \u2014 could not authenticate with Elastic Email."}}catch(t){let r=t!=null&&typeof t=="object"&&"response"in t&&t.response!=null&&typeof t.response=="object"&&"status"in t.response?t.response.status:void 0;return r===401||r===403?{valid:!1,error:"Invalid API key \u2014 could not authenticate with Elastic Email."}:{valid:!1,error:"Could not reach the Elastic Email API. Check your network connection and try again."}}},"validate")});async function V({apiKey:e,method:t,path:r,queryParams:n,body:i}){return(await Ze.sendRequest({method:t,url:`${Ke}${r}`,headers:{"X-ElasticEmail-ApiKey":e,...i?{"Content-Type":"application/json"}:{}},queryParams:n,body:i})).body}o(V,"elasticEmailRequest");var Ls=_.Dropdown({displayName:"Contact Email",description:"Select an existing contact by email address.",required:!0,refreshers:[],auth:B,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/contacts",queryParams:{limit:String(100)}})??[]).filter(r=>r.Email).map(r=>({label:r.Email,value:r.Email}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")}),Fs=_.Dropdown({displayName:"Campaign",description:"Select an existing campaign by name.",required:!0,refreshers:[],auth:B,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/campaigns",queryParams:{limit:String(100)}})??[]).filter(r=>r.Name).map(r=>({label:r.Name,value:r.Name}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")}),Je=_.MultiSelectDropdown({displayName:"Mailing Lists",description:"Select mailing lists.",required:!1,refreshers:[],auth:B,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/lists",queryParams:{limit:String(100)}})??[]).filter(r=>r.ListName).map(r=>({label:r.ListName,value:r.ListName}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")}),ar=_.MultiSelectDropdown({displayName:"Segments",description:"Select segments.",required:!1,refreshers:[],auth:B,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/segments",queryParams:{limit:String(100)}})??[]).filter(r=>r.Name).map(r=>({label:r.Name,value:r.Name}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")}),Xe=_.Dropdown({displayName:"Template",description:"Select an email template.",required:!1,refreshers:[],auth:B,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/templates",queryParams:{limit:String(100),scopeType:"Personal"}})??[]).filter(r=>r.Name).map(r=>({label:r.Name,value:r.Name}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")});var Bs=W({name:"add_contact",displayName:"Add Contact to Mailing List",description:"Add a new contact to one or more mailing lists in Elastic Email.",audience:"both",aiMetadata:{description:"Adds a contact (identified by email) to one or more named mailing lists in Elastic Email, with optional name, status, custom fields, and consent details. Use when subscribing someone to specific lists rather than just creating a bare contact. Each call appends the contact, so it is not idempotent.",idempotent:!1},auth:B,props:{email:_.ShortText({displayName:"Email",description:"The email address of the contact.",required:!0}),listNames:Je,status:_.StaticDropdown({displayName:"Status",description:"Initial status of the contact.",required:!1,options:{options:or.map(e=>({label:e,value:e}))}}),firstName:_.ShortText({displayName:"First Name",required:!1}),lastName:_.ShortText({displayName:"Last Name",required:!1}),customFields:_.Object({displayName:"Custom Fields",description:"Key-value pairs of custom contact fields. Only existing custom fields will be saved.",required:!1}),consentIP:_.ShortText({displayName:"Consent IP",description:"IP address of consent. If not provided, your current public IP is used.",required:!1}),consentDate:_.ShortText({displayName:"Consent Date",description:"ISO 8601 date of consent. If not provided, current date is used.",required:!1}),consentTracking:_.StaticDropdown({displayName:"Consent Tracking",description:'Consent tracking level. Defaults to "Unknown".',required:!1,options:{options:js.map(e=>({label:e,value:e}))}})},async run({auth:e,propsValue:t}){let r={};return t.listNames&&(r.listnames=Array.isArray(t.listNames)?t.listNames.join(","):String(t.listNames)),V({apiKey:e.secret_text,method:"POST",path:"/contacts",queryParams:Object.keys(r).length>0?r:void 0,body:[{Email:t.email,Status:t.status??void 0,FirstName:t.firstName??void 0,LastName:t.lastName??void 0,CustomFields:t.customFields??void 0,Consent:{ConsentIP:t.consentIP??void 0,ConsentDate:t.consentDate??void 0,ConsentTracking:t.consentTracking??void 0}}]})}});var Zs=W({name:"create_campaign",displayName:"Create Campaign",description:"Create a new email campaign in Elastic Email.",audience:"both",aiMetadata:{description:"Creates a new email campaign in Elastic Email targeting the given mailing lists and/or segments, with sender, subject, template, and an initial status (e.g. draft or active). Use to set up a bulk campaign send; for one-off transactional messages use Send Email instead. Each call creates a separate campaign, so it is not idempotent.",idempotent:!1},auth:B,props:{name:_.ShortText({displayName:"Campaign Name",required:!0}),from:_.ShortText({displayName:"From",description:"Sender email with optional name (e.g. `email@domain.com` or `John Doe <email@domain.com>`).",required:!0}),recipientListNames:Je,recipientSegmentNames:ar,replyTo:_.ShortText({displayName:"Reply To",description:"Reply-to email address.",required:!0}),status:_.StaticDropdown({displayName:"Status",description:"Initial campaign status.",required:!0,options:{options:ir.map(e=>({label:e,value:e}))}}),subject:_.ShortText({displayName:"Subject",description:"Default email subject line.",required:!1}),templateName:Xe},async run({auth:e,propsValue:t}){return V({apiKey:e.secret_text,method:"POST",path:"/campaigns",body:{Name:t.name,Recipients:{ListNames:t.recipientListNames&&t.recipientListNames.length>0?t.recipientListNames:void 0,SegmentNames:t.recipientSegmentNames&&t.recipientSegmentNames.length>0?t.recipientSegmentNames:void 0},Content:[{From:t.from,ReplyTo:t.replyTo,Subject:t.subject??void 0,TemplateName:t.templateName??void 0}],Status:t.status}})}});var Vs=W({name:"create_contact",displayName:"Create Contact",description:"Create a new contact in Elastic Email.",audience:"both",aiMetadata:{description:"Creates a new contact in Elastic Email from an email address, with optional name, status, and custom fields, without attaching it to any mailing list. Use when you only need the contact to exist; use Add Contact to Mailing List when it must also join specific lists. Each call appends the contact, so it is not idempotent.",idempotent:!1},auth:B,props:{email:_.ShortText({displayName:"Email",description:"The email address of the contact.",required:!0}),status:_.StaticDropdown({displayName:"Status",description:"Initial status of the contact.",required:!1,options:{options:or.map(e=>({label:e,value:e}))}}),firstName:_.ShortText({displayName:"First Name",required:!1}),lastName:_.ShortText({displayName:"Last Name",required:!1}),customFields:_.Object({displayName:"Custom Fields",description:"Key-value pairs of custom contact fields. Only existing custom fields will be saved.",required:!1})},async run({auth:e,propsValue:t}){return V({apiKey:e.secret_text,method:"POST",path:"/contacts",body:[{Email:t.email,Status:t.status??void 0,FirstName:t.firstName??void 0,LastName:t.lastName??void 0,CustomFields:t.customFields??void 0}]})}});var Hs=W({name:"create_segment",displayName:"Create Segment",description:"Create a new contact segment in Elastic Email using a SQL-like rule.",audience:"both",aiMetadata:{description:"Creates a named contact segment in Elastic Email defined by a SQL-like rule that selects which contacts belong to it. Use to build a reusable audience for campaigns. The rule must follow Elastic Email segment-rule syntax. Each call creates a separate segment, so it is not idempotent.",idempotent:!1},auth:B,props:{name:_.ShortText({displayName:"Segment Name",required:!0}),rule:_.ShortText({displayName:"Rule",description:"SQL-like rule to determine which contacts belong to this segment. See https://help.elasticemail.com/en/articles/5162182-segment-rules",required:!0})},async run({auth:e,propsValue:t}){return V({apiKey:e.secret_text,method:"POST",path:"/segments",body:{Name:t.name,Rule:t.rule}})}});var qs=W({name:"list_campaigns",displayName:"List Campaigns",description:"Fetch a paginated list of campaigns from Elastic Email.",audience:"both",aiMetadata:{description:"Retrieves a paginated list of campaigns from Elastic Email; leave the search field empty to return all campaigns, or set it to filter by campaign name. Use to look up campaigns or find a campaign name before updating it. Read-only and idempotent.",idempotent:!0},auth:B,props:{search:_.ShortText({displayName:"Search",description:"Filter campaigns by name.",required:!1}),limit:_.Number({displayName:"Limit",description:"Maximum number of campaigns to return (max 100).",required:!1,defaultValue:100}),offset:_.Number({displayName:"Offset",description:"Number of campaigns to skip.",required:!1,defaultValue:0})},async run({auth:e,propsValue:t}){let r={};return t.search&&(r.search=t.search),t.limit!==void 0&&(r.limit=String(t.limit)),t.offset!==void 0&&(r.offset=String(t.offset)),V({apiKey:e.secret_text,method:"GET",path:"/campaigns",queryParams:r})}});var Gs=W({name:"list_contacts",displayName:"List Contacts",description:"Fetch a paginated list of contacts from Elastic Email.",audience:"both",aiMetadata:{description:"Retrieves a paginated list of contacts from the Elastic Email account using limit and offset. Use to browse or page through contacts. Read-only and idempotent.",idempotent:!0},auth:B,props:{limit:_.Number({displayName:"Limit",description:"Maximum number of contacts to return (max 100).",required:!1,defaultValue:100}),offset:_.Number({displayName:"Offset",description:"Number of contacts to skip.",required:!1,defaultValue:0})},async run({auth:e,propsValue:t}){let r={};return t.limit!==void 0&&(r.limit=String(t.limit)),t.offset!==void 0&&(r.offset=String(t.offset)),V({apiKey:e.secret_text,method:"GET",path:"/contacts",queryParams:r})}});var Ws=W({name:"send_email",displayName:"Send Email",description:"Send an email to one or more recipients via Elastic Email.",audience:"both",aiMetadata:{description:"Sends a transactional email to one or more recipients via Elastic Email, with either inline body content or a saved template, plus optional merge fields, tracking, and a scheduled time offset. Use for direct one-off sends; use Create Campaign for bulk list/segment marketing. Each call dispatches a new email, so it is not idempotent.",idempotent:!1},auth:B,props:{recipients:_.Array({displayName:"Recipients",description:"List of recipient email addresses.",required:!0}),from:_.ShortText({displayName:"From",description:"Sender email with optional name (e.g. `email@domain.com` or `John Doe <email@domain.com>`).",required:!0}),subject:_.ShortText({displayName:"Subject",description:"Email subject line.",required:!1}),bodyContentType:_.StaticDropdown({displayName:"Body Content Type",description:"Type of body content.",required:!1,options:{options:Us.map(e=>({label:e,value:e}))}}),bodyContent:_.LongText({displayName:"Body Content",description:"The actual body content of the email.",required:!1}),replyTo:_.ShortText({displayName:"Reply To",description:"Reply-to email address.",required:!1}),templateName:Xe,merge:_.Object({displayName:"Merge Fields",description:"Key-value merge fields shared between recipients. Use in email body like {firstname}, {lastname}.",required:!1}),timeOffset:_.Number({displayName:"Time Offset (minutes)",description:"Delay sending by this many minutes. Maximum is 35 days (50400 minutes).",required:!1}),poolName:_.ShortText({displayName:"Pool Name",description:"Name of custom IP pool for sending.",required:!1}),channelName:_.ShortText({displayName:"Channel Name",description:"Name of the sending channel.",required:!1}),encoding:_.StaticDropdown({displayName:"Encoding",description:"Encoding type for email headers.",required:!1,options:{options:Ms.map(e=>({label:e,value:e}))}}),trackOpens:_.Checkbox({displayName:"Track Opens",description:"Track email opens. If not set, uses account default.",required:!1}),trackClicks:_.Checkbox({displayName:"Track Clicks",description:"Track link clicks. If not set, uses account default.",required:!1})},async run({auth:e,propsValue:t}){let r=(t.recipients??[]).map(String);return V({apiKey:e.secret_text,method:"POST",path:"/emails",body:{Recipients:r.map(n=>({Email:n})),Content:{From:t.from,Subject:t.subject??void 0,Body:t.bodyContentType||t.bodyContent?[{ContentType:t.bodyContentType||"HTML",Body:t.bodyContent}]:void 0,ReplyTo:t.replyTo??void 0,TemplateName:t.templateName??void 0,Merge:t.merge??void 0},Options:{TimeOffset:t.timeOffset??void 0,PoolName:t.poolName??void 0,ChannelName:t.channelName??void 0,Encoding:t.encoding??void 0,TrackOpens:t.trackOpens??void 0,TrackClicks:t.trackClicks??void 0}}})}});var Ks=W({name:"unsubscribe_contact",displayName:"Unsubscribe Contact",description:"Unsubscribe one or more email addresses from future emails in Elastic Email.",audience:"both",aiMetadata:{description:"Marks one or more email addresses as unsubscribed in Elastic Email so they no longer receive future emails. Use to honor opt-out or suppression requests. Idempotent: re-running with the same addresses leaves them unsubscribed with no additional effect.",idempotent:!0},auth:B,props:{emails:_.Array({displayName:"Email Addresses",description:"List of email addresses to unsubscribe.",required:!0})},async run({auth:e,propsValue:t}){let r=(t.emails??[]).map(String);return V({apiKey:e.secret_text,method:"POST",path:"/suppressions/unsubscribes",body:r})}});var Js=W({name:"update_campaign",displayName:"Update Campaign",description:"Update an existing campaign in Elastic Email.",audience:"both",aiMetadata:{description:"Updates an existing campaign in Elastic Email, identified by its name, merging any provided fields (name, sender, recipients, subject, template, status) with the campaign's current values so omitted fields are preserved. Use to revise a campaign before it sends. Idempotent: applying the same values yields the same campaign state.",idempotent:!0},auth:B,props:{campaign:Fs,name:_.ShortText({displayName:"New Campaign Name",description:"New name for the campaign. Leave empty to keep existing.",required:!1}),from:_.ShortText({displayName:"From",description:"Sender email with optional name. Leave empty to keep existing.",required:!1}),recipientListNames:Je,recipientSegmentNames:ar,replyTo:_.ShortText({displayName:"Reply To",description:"Reply-to email address. Leave empty to keep existing.",required:!1}),subject:_.ShortText({displayName:"Subject",description:"Email subject. Leave empty to keep existing.",required:!1}),templateName:Xe,status:_.StaticDropdown({displayName:"Status",description:"Campaign status. Leave empty to keep existing.",required:!1,options:{options:ir.map(e=>({label:e,value:e}))}})},async run({auth:e,propsValue:t}){let r=String(t.campaign),n=await V({apiKey:e.secret_text,method:"GET",path:`/campaigns/${encodeURIComponent(r)}`}),i=n.Content?.[0]??{};return V({apiKey:e.secret_text,method:"PUT",path:`/campaigns/${encodeURIComponent(r)}`,body:{Name:t.name||n.Name,Recipients:{ListNames:t.recipientListNames&&t.recipientListNames.length>0?t.recipientListNames:n.Recipients?.ListNames??void 0,SegmentNames:t.recipientSegmentNames&&t.recipientSegmentNames.length>0?t.recipientSegmentNames:n.Recipients?.SegmentNames??void 0},Content:[{From:t.from||i.From,ReplyTo:t.replyTo||i.ReplyTo,Subject:t.subject||i.Subject,TemplateName:t.templateName||i.TemplateName}],Status:t.status||n.Status}})}});var Xs=W({name:"update_contact",displayName:"Update Contact",description:"Update an existing contact in Elastic Email.",audience:"both",aiMetadata:{description:"Updates an existing contact in Elastic Email, identified by email address, setting first name, last name, and/or custom fields. Use to edit contact details after creation. Idempotent: applying the same values yields the same contact state.",idempotent:!0},auth:B,props:{contact:Ls,firstName:_.ShortText({displayName:"First Name",required:!1}),lastName:_.ShortText({displayName:"Last Name",required:!1}),customFields:_.Object({displayName:"Custom Fields",description:"Key-value pairs of custom contact fields. Only existing custom fields will be saved.",required:!1})},async run({auth:e,propsValue:t}){return V({apiKey:e.secret_text,method:"PUT",path:`/contacts/${encodeURIComponent(String(t.contact))}`,body:{FirstName:t.firstName??void 0,LastName:t.lastName??void 0,CustomFields:t.customFields??void 0}})}});var Sd=bi({displayName:"Elastic Email",description:"Email delivery and marketing platform for sending emails, managing contacts, campaigns, and segments.",auth:B,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/elastic-email.png",authors:["Harmatta"],categories:["MARKETING"],actions:[Bs,Zs,Vs,Hs,qs,Gs,Ws,Ks,Js,Xs,Cs({baseUrl:o(()=>Ke,"baseUrl"),auth:B,authMapping:o(async e=>({"X-ElasticEmail-ApiKey":e.secret_text}),"authMapping")})],triggers:[]});0&&(module.exports={elasticEmail});
10
+ `,required:!0,validate:o(async({auth:e})=>{try{return(await Ve.sendRequest({method:"GET",url:`${Je}/contacts`,headers:{"X-ElasticEmail-ApiKey":e},queryParams:{limit:"1"}})).status===200?{valid:!0}:{valid:!1,error:"Invalid API key \u2014 could not authenticate with Elastic Email."}}catch(t){let r=t!=null&&typeof t=="object"&&"response"in t&&t.response!=null&&typeof t.response=="object"&&"status"in t.response?t.response.status:void 0;return r===401||r===403?{valid:!1,error:"Invalid API key \u2014 could not authenticate with Elastic Email."}:{valid:!1,error:"Could not reach the Elastic Email API. Check your network connection and try again."}}},"validate")});async function V({apiKey:e,method:t,path:r,queryParams:n,body:i}){return(await Ve.sendRequest({method:t,url:`${Je}${r}`,headers:{"X-ElasticEmail-ApiKey":e,...i?{"Content-Type":"application/json"}:{}},queryParams:n,body:i})).body}o(V,"elasticEmailRequest");var eu=P.Dropdown({displayName:"Contact Email",description:"Select an existing contact by email address.",required:!0,refreshers:[],auth:Z,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/contacts",queryParams:{limit:String(100)}})??[]).filter(r=>r.Email).map(r=>({label:r.Email,value:r.Email}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")}),tu=P.Dropdown({displayName:"Campaign",description:"Select an existing campaign by name.",required:!0,refreshers:[],auth:Z,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/campaigns",queryParams:{limit:String(100)}})??[]).filter(r=>r.Name).map(r=>({label:r.Name,value:r.Name}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")}),Xe=P.MultiSelectDropdown({displayName:"Mailing Lists",description:"Select mailing lists.",required:!1,refreshers:[],auth:Z,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/lists",queryParams:{limit:String(100)}})??[]).filter(r=>r.ListName).map(r=>({label:r.ListName,value:r.ListName}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")}),cr=P.MultiSelectDropdown({displayName:"Segments",description:"Select segments.",required:!1,refreshers:[],auth:Z,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/segments",queryParams:{limit:String(100)}})??[]).filter(r=>r.Name).map(r=>({label:r.Name,value:r.Name}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")}),Ye=P.Dropdown({displayName:"Template",description:"Select an email template.",required:!1,refreshers:[],auth:Z,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/templates",queryParams:{limit:String(100),scopeType:"Personal"}})??[]).filter(r=>r.Name).map(r=>({label:r.Name,value:r.Name}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")});var ru=W({name:"add_contact",displayName:"Add Contact to Mailing List",description:"Add a new contact to one or more mailing lists in Elastic Email.",audience:"both",aiMetadata:{description:"Adds a contact (identified by email) to one or more named mailing lists in Elastic Email, with optional name, status, custom fields, and consent details. Use when subscribing someone to specific lists rather than just creating a bare contact. Each call appends the contact, so it is not idempotent.",idempotent:!1},auth:Z,props:{email:P.ShortText({displayName:"Email",description:"The email address of the contact.",required:!0}),listNames:Xe,status:P.StaticDropdown({displayName:"Status",description:"Initial status of the contact.",required:!1,options:{options:sr.map(e=>({label:e,value:e}))}}),firstName:P.ShortText({displayName:"First Name",required:!1}),lastName:P.ShortText({displayName:"Last Name",required:!1}),customFields:P.Object({displayName:"Custom Fields",description:"Key-value pairs of custom contact fields. Only existing custom fields will be saved.",required:!1}),consentIP:P.ShortText({displayName:"Consent IP",description:"IP address of consent. If not provided, your current public IP is used.",required:!1}),consentDate:P.ShortText({displayName:"Consent Date",description:"ISO 8601 date of consent. If not provided, current date is used.",required:!1}),consentTracking:P.StaticDropdown({displayName:"Consent Tracking",description:'Consent tracking level. Defaults to "Unknown".',required:!1,options:{options:Qs.map(e=>({label:e,value:e}))}})},async run({auth:e,propsValue:t}){let r={};return t.listNames&&(r.listnames=Array.isArray(t.listNames)?t.listNames.join(","):String(t.listNames)),V({apiKey:e.secret_text,method:"POST",path:"/contacts",queryParams:Object.keys(r).length>0?r:void 0,body:[{Email:t.email,Status:t.status??void 0,FirstName:t.firstName??void 0,LastName:t.lastName??void 0,CustomFields:t.customFields??void 0,Consent:{ConsentIP:t.consentIP??void 0,ConsentDate:t.consentDate??void 0,ConsentTracking:t.consentTracking??void 0}}]})}});var nu=W({name:"create_campaign",displayName:"Create Campaign",description:"Create a new email campaign in Elastic Email.",audience:"both",aiMetadata:{description:"Creates a new email campaign in Elastic Email targeting the given mailing lists and/or segments, with sender, subject, template, and an initial status (e.g. draft or active). Use to set up a bulk campaign send; for one-off transactional messages use Send Email instead. Each call creates a separate campaign, so it is not idempotent.",idempotent:!1},auth:Z,props:{name:P.ShortText({displayName:"Campaign Name",required:!0}),from:P.ShortText({displayName:"From",description:"Sender email with optional name (e.g. `email@domain.com` or `John Doe <email@domain.com>`).",required:!0}),recipientListNames:Xe,recipientSegmentNames:cr,replyTo:P.ShortText({displayName:"Reply To",description:"Reply-to email address.",required:!0}),status:P.StaticDropdown({displayName:"Status",description:"Initial campaign status.",required:!0,options:{options:ur.map(e=>({label:e,value:e}))}}),subject:P.ShortText({displayName:"Subject",description:"Default email subject line.",required:!1}),templateName:Ye},async run({auth:e,propsValue:t}){return V({apiKey:e.secret_text,method:"POST",path:"/campaigns",body:{Name:t.name,Recipients:{ListNames:t.recipientListNames&&t.recipientListNames.length>0?t.recipientListNames:void 0,SegmentNames:t.recipientSegmentNames&&t.recipientSegmentNames.length>0?t.recipientSegmentNames:void 0},Content:[{From:t.from,ReplyTo:t.replyTo,Subject:t.subject??void 0,TemplateName:t.templateName??void 0}],Status:t.status}})}});var ou=W({name:"create_contact",displayName:"Create Contact",description:"Create a new contact in Elastic Email.",audience:"both",aiMetadata:{description:"Creates a new contact in Elastic Email from an email address, with optional name, status, and custom fields, without attaching it to any mailing list. Use when you only need the contact to exist; use Add Contact to Mailing List when it must also join specific lists. Each call appends the contact, so it is not idempotent.",idempotent:!1},auth:Z,props:{email:P.ShortText({displayName:"Email",description:"The email address of the contact.",required:!0}),status:P.StaticDropdown({displayName:"Status",description:"Initial status of the contact.",required:!1,options:{options:sr.map(e=>({label:e,value:e}))}}),firstName:P.ShortText({displayName:"First Name",required:!1}),lastName:P.ShortText({displayName:"Last Name",required:!1}),customFields:P.Object({displayName:"Custom Fields",description:"Key-value pairs of custom contact fields. Only existing custom fields will be saved.",required:!1})},async run({auth:e,propsValue:t}){return V({apiKey:e.secret_text,method:"POST",path:"/contacts",body:[{Email:t.email,Status:t.status??void 0,FirstName:t.firstName??void 0,LastName:t.lastName??void 0,CustomFields:t.customFields??void 0}]})}});var iu=W({name:"create_segment",displayName:"Create Segment",description:"Create a new contact segment in Elastic Email using a SQL-like rule.",audience:"both",aiMetadata:{description:"Creates a named contact segment in Elastic Email defined by a SQL-like rule that selects which contacts belong to it. Use to build a reusable audience for campaigns. The rule must follow Elastic Email segment-rule syntax. Each call creates a separate segment, so it is not idempotent.",idempotent:!1},auth:Z,props:{name:P.ShortText({displayName:"Segment Name",required:!0}),rule:P.ShortText({displayName:"Rule",description:"SQL-like rule to determine which contacts belong to this segment. See https://help.elasticemail.com/en/articles/5162182-segment-rules",required:!0})},async run({auth:e,propsValue:t}){return V({apiKey:e.secret_text,method:"POST",path:"/segments",body:{Name:t.name,Rule:t.rule}})}});var au=W({name:"list_campaigns",displayName:"List Campaigns",description:"Fetch a paginated list of campaigns from Elastic Email.",audience:"both",aiMetadata:{description:"Retrieves a paginated list of campaigns from Elastic Email; leave the search field empty to return all campaigns, or set it to filter by campaign name. Use to look up campaigns or find a campaign name before updating it. Read-only and idempotent.",idempotent:!0},auth:Z,props:{search:P.ShortText({displayName:"Search",description:"Filter campaigns by name.",required:!1}),limit:P.Number({displayName:"Limit",description:"Maximum number of campaigns to return (max 100).",required:!1,defaultValue:100}),offset:P.Number({displayName:"Offset",description:"Number of campaigns to skip.",required:!1,defaultValue:0})},async run({auth:e,propsValue:t}){let r={};return t.search&&(r.search=t.search),t.limit!==void 0&&(r.limit=String(t.limit)),t.offset!==void 0&&(r.offset=String(t.offset)),V({apiKey:e.secret_text,method:"GET",path:"/campaigns",queryParams:r})}});var su=W({name:"list_contacts",displayName:"List Contacts",description:"Fetch a paginated list of contacts from Elastic Email.",audience:"both",aiMetadata:{description:"Retrieves a paginated list of contacts from the Elastic Email account using limit and offset. Use to browse or page through contacts. Read-only and idempotent.",idempotent:!0},auth:Z,props:{limit:P.Number({displayName:"Limit",description:"Maximum number of contacts to return (max 100).",required:!1,defaultValue:100}),offset:P.Number({displayName:"Offset",description:"Number of contacts to skip.",required:!1,defaultValue:0})},async run({auth:e,propsValue:t}){let r={};return t.limit!==void 0&&(r.limit=String(t.limit)),t.offset!==void 0&&(r.offset=String(t.offset)),V({apiKey:e.secret_text,method:"GET",path:"/contacts",queryParams:r})}});var uu=W({name:"send_email",displayName:"Send Email",description:"Send an email to one or more recipients via Elastic Email.",audience:"both",aiMetadata:{description:"Sends a transactional email to one or more recipients via Elastic Email, with either inline body content or a saved template, plus optional merge fields, tracking, and a scheduled time offset. Use for direct one-off sends; use Create Campaign for bulk list/segment marketing. Each call dispatches a new email, so it is not idempotent.",idempotent:!1},auth:Z,props:{recipients:P.Array({displayName:"Recipients",description:"List of recipient email addresses.",required:!0}),from:P.ShortText({displayName:"From",description:"Sender email with optional name (e.g. `email@domain.com` or `John Doe <email@domain.com>`).",required:!0}),subject:P.ShortText({displayName:"Subject",description:"Email subject line.",required:!1}),bodyContentType:P.StaticDropdown({displayName:"Body Content Type",description:"Type of body content.",required:!1,options:{options:Xs.map(e=>({label:e,value:e}))}}),bodyContent:P.LongText({displayName:"Body Content",description:"The actual body content of the email.",required:!1}),replyTo:P.ShortText({displayName:"Reply To",description:"Reply-to email address.",required:!1}),templateName:Ye,merge:P.Object({displayName:"Merge Fields",description:"Key-value merge fields shared between recipients. Use in email body like {firstname}, {lastname}.",required:!1}),timeOffset:P.Number({displayName:"Time Offset (minutes)",description:"Delay sending by this many minutes. Maximum is 35 days (50400 minutes).",required:!1}),poolName:P.ShortText({displayName:"Pool Name",description:"Name of custom IP pool for sending.",required:!1}),channelName:P.ShortText({displayName:"Channel Name",description:"Name of the sending channel.",required:!1}),encoding:P.StaticDropdown({displayName:"Encoding",description:"Encoding type for email headers.",required:!1,options:{options:Ys.map(e=>({label:e,value:e}))}}),trackOpens:P.Checkbox({displayName:"Track Opens",description:"Track email opens. If not set, uses account default.",required:!1}),trackClicks:P.Checkbox({displayName:"Track Clicks",description:"Track link clicks. If not set, uses account default.",required:!1})},async run({auth:e,propsValue:t}){let r=(t.recipients??[]).map(String);return V({apiKey:e.secret_text,method:"POST",path:"/emails",body:{Recipients:r.map(n=>({Email:n})),Content:{From:t.from,Subject:t.subject??void 0,Body:t.bodyContentType||t.bodyContent?[{ContentType:t.bodyContentType||"HTML",Body:t.bodyContent}]:void 0,ReplyTo:t.replyTo??void 0,TemplateName:t.templateName??void 0,Merge:t.merge??void 0},Options:{TimeOffset:t.timeOffset??void 0,PoolName:t.poolName??void 0,ChannelName:t.channelName??void 0,Encoding:t.encoding??void 0,TrackOpens:t.trackOpens??void 0,TrackClicks:t.trackClicks??void 0}}})}});var cu=W({name:"unsubscribe_contact",displayName:"Unsubscribe Contact",description:"Unsubscribe one or more email addresses from future emails in Elastic Email.",audience:"both",aiMetadata:{description:"Marks one or more email addresses as unsubscribed in Elastic Email so they no longer receive future emails. Use to honor opt-out or suppression requests. Idempotent: re-running with the same addresses leaves them unsubscribed with no additional effect.",idempotent:!0},auth:Z,props:{emails:P.Array({displayName:"Email Addresses",description:"List of email addresses to unsubscribe.",required:!0})},async run({auth:e,propsValue:t}){let r=(t.emails??[]).map(String);return V({apiKey:e.secret_text,method:"POST",path:"/suppressions/unsubscribes",body:r})}});var lu=W({name:"update_campaign",displayName:"Update Campaign",description:"Update an existing campaign in Elastic Email.",audience:"both",aiMetadata:{description:"Updates an existing campaign in Elastic Email, identified by its name, merging any provided fields (name, sender, recipients, subject, template, status) with the campaign's current values so omitted fields are preserved. Use to revise a campaign before it sends. Idempotent: applying the same values yields the same campaign state.",idempotent:!0},auth:Z,props:{campaign:tu,name:P.ShortText({displayName:"New Campaign Name",description:"New name for the campaign. Leave empty to keep existing.",required:!1}),from:P.ShortText({displayName:"From",description:"Sender email with optional name. Leave empty to keep existing.",required:!1}),recipientListNames:Xe,recipientSegmentNames:cr,replyTo:P.ShortText({displayName:"Reply To",description:"Reply-to email address. Leave empty to keep existing.",required:!1}),subject:P.ShortText({displayName:"Subject",description:"Email subject. Leave empty to keep existing.",required:!1}),templateName:Ye,status:P.StaticDropdown({displayName:"Status",description:"Campaign status. Leave empty to keep existing.",required:!1,options:{options:ur.map(e=>({label:e,value:e}))}})},async run({auth:e,propsValue:t}){let r=String(t.campaign),n=await V({apiKey:e.secret_text,method:"GET",path:`/campaigns/${encodeURIComponent(r)}`}),i=n.Content?.[0]??{};return V({apiKey:e.secret_text,method:"PUT",path:`/campaigns/${encodeURIComponent(r)}`,body:{Name:t.name||n.Name,Recipients:{ListNames:t.recipientListNames&&t.recipientListNames.length>0?t.recipientListNames:n.Recipients?.ListNames??void 0,SegmentNames:t.recipientSegmentNames&&t.recipientSegmentNames.length>0?t.recipientSegmentNames:n.Recipients?.SegmentNames??void 0},Content:[{From:t.from||i.From,ReplyTo:t.replyTo||i.ReplyTo,Subject:t.subject||i.Subject,TemplateName:t.templateName||i.TemplateName}],Status:t.status||n.Status}})}});var pu=W({name:"update_contact",displayName:"Update Contact",description:"Update an existing contact in Elastic Email.",audience:"both",aiMetadata:{description:"Updates an existing contact in Elastic Email, identified by email address, setting first name, last name, and/or custom fields. Use to edit contact details after creation. Idempotent: applying the same values yields the same contact state.",idempotent:!0},auth:Z,props:{contact:eu,firstName:P.ShortText({displayName:"First Name",required:!1}),lastName:P.ShortText({displayName:"Last Name",required:!1}),customFields:P.Object({displayName:"Custom Fields",description:"Key-value pairs of custom contact fields. Only existing custom fields will be saved.",required:!1})},async run({auth:e,propsValue:t}){return V({apiKey:e.secret_text,method:"PUT",path:`/contacts/${encodeURIComponent(String(t.contact))}`,body:{FirstName:t.firstName??void 0,LastName:t.lastName??void 0,CustomFields:t.customFields??void 0}})}});var Gd=Ri({displayName:"Elastic Email",description:"Email delivery and marketing platform for sending emails, managing contacts, campaigns, and segments.",auth:Z,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/elastic-email.png",authors:["Harmatta"],categories:["MARKETING"],actions:[ru,nu,ou,iu,au,su,uu,cu,lu,pu,Js({baseUrl:o(()=>Je,"baseUrl"),auth:Z,authMapping:o(async e=>({"X-ElasticEmail-ApiKey":e.secret_text}),"authMapping")})],triggers:[]});0&&(module.exports={elasticEmail});
11
11
  /*! Bundled license information:
12
12
 
13
13
  mime-types/index.js: