@activepieces/piece-reddit 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +4 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var tu=Object.create;var Ye=Object.defineProperty;var ru=Object.getOwnPropertyDescriptor;var nu=Object.getOwnPropertyNames;var ou=Object.getPrototypeOf,iu=Object.prototype.hasOwnProperty;var i=(e,t)=>Ye(e,"name",{value:t,configurable:!0});var T=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},mn=(e,t)=>{for(var r in t)Ye(e,r,{get:t[r],enumerable:!0})},fn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of nu(t))!iu.call(e,o)&&o!==r&&Ye(e,o,{get:()=>t[o],enumerable:!(n=ru(t,o))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?tu(ou(e)):{},fn(t||!e||!e.__esModule?Ye(r,"default",{value:e,enumerable:!0}):r,e)),au=e=>fn(Ye({},"__esModule",{value:!0}),e);var Mo=T((Uo,Zt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function f(u,d){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let y=0,m=-1,v=(u.match(l.zoneIndex)||[])[0],P,L;for(v&&(v=v.substring(1),u=u.replace(/%.+$/,""));(m=u.indexOf(":",m+1))>=0;)y++;if(u.substr(0,2)==="::"&&y--,u.substr(-2,2)==="::"&&y--,y>d)return null;for(L=d-y,P=":";L--;)P+="0:";return u=u.replace("::",P),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),d=(function(){let re=u.split(":"),se=[];for(let Xe=0;Xe<re.length;Xe++)se.push(parseInt(re[Xe],16));return se})(),{parts:d,zoneId:v}}i(f,"expandIPv6");function h(u,d,y,m){if(u.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=y-m,P<0&&(P=0),u[v]>>P!==d[v]>>P)return!1;m-=y,v+=1}return!0}i(h,"matchCIDR");function _(u){if(o.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}i(_,"parseIntAuto");function $(u,d){for(;u.length<d;)u=`0${u}`;return u}i($,"padPart");let x={};x.IPv4=(function(){function u(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<d.length;y++)if(m=d[y],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return i(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,L;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(L=m[P],y&&L!==0)return null;L!==8&&(y=!0),d+=L}else return null;return 32-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u})(),x.IPv4.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(u){return this.parser(u)!==null},x.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(u){return!!(x.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(u){let d=u.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(u)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(u){let d,y,m,v,P;try{for(d=this.parseCIDR(u),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<4;)v.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(u){let d=this.parser(u);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(u){let d;if(d=u.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let m=[this.parse(d[1]),y];return Object.defineProperty(m,"toString",{value:i(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(u){let d,y,m;if(d=u.match(r.fourOctet))return(function(){let v=d.slice(1,6),P=[];for(let L=0;L<v.length;L++)y=v[L],P.push(_(y));return P})();if(d=u.match(r.longValue)){if(m=_(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v})().reverse()}else return(d=u.match(r.twoOctet))?(function(){let v=d.slice(1,4),P=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=u.match(r.threeOctet))?(function(){let v=d.slice(1,5),P=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(_(v[1])),P.push(m>>8&255),P.push(m&255),P})():null},x.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,m=Math.floor(u/8);for(;y<m;)d[y]=255,y++;return m<4&&(d[m]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.IPv6=(function(){function u(d,y){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");y&&(this.zoneId=y)}return i(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,P;for(let L=7;L>=0;L-=1)if(v=this.parts[L],v in m){if(P=m[v],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let d,y=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],y.push(d>>8),y.push(d&255);return y},u.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(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.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),y=d[0],m=d[1];return new x.IPv4([y>>8,y&255,m>>8,m&255])},u.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(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,v=-1,P;for(;P=d.exec(y);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?y:`${y.substring(0,m)}::${y.substring(m+v)}`},u.prototype.toString=function(){return this.toRFC5952String()},u})(),x.IPv6.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(u){return this.parser(u)!==null},x.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let d=this.parser(u);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(u){let d,y,m,v,P;try{for(d=this.parseCIDR(u),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<16;)v.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(v)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},x.IPv6.parse=function(u){let d=this.parser(u);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(u){let d,y,m;if((y=u.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return m=[this.parse(y[1]),d],Object.defineProperty(m,"toString",{value:i(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(u){let d,y,m,v,P,L;if(m=u.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(u))return f(u,8);if((m=u.match(l.transitional))&&(L=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+L,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<P.length;y++)if(v=P[y],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>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],y=0,m=Math.floor(u/8);for(;y<m;)d[y]=255,y++;return m<16&&(d[m]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.fromByteArray=function(u){let d=u.length;if(d===4)return new x.IPv4(u);if(d===16)return new x.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(u){return x.IPv6.isValid(u)||x.IPv4.isValid(u)},x.isValidCIDR=function(u){return x.IPv6.isValidCIDR(u)||x.IPv4.isValidCIDR(u)},x.parse=function(u){if(x.IPv6.isValid(u))return x.IPv6.parse(u);if(x.IPv4.isValid(u))return x.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(u){try{return x.IPv6.parseCIDR(u)}catch{try{return x.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(u){let d=this.parse(u);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(u,d,y){let m,v,P,L;y==null&&(y="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(L=P[m],u.kind()===L[0].kind()&&u.match.apply(u,L))return v}return y},typeof Zt<"u"&&Zt.exports?Zt.exports=x:e.ipaddr=x})(Uo)});var ji=T((_A,Li)=>{var Mi=require("stream").Stream,Bp=require("util");Li.exports=pe;function pe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(pe,"DelayedStream");Bp.inherits(pe,Mi);pe.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(pe.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});pe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};pe.prototype.resume=function(){this._released||this.release(),this.source.resume()};pe.prototype.pause=function(){this.source.pause()};pe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};pe.prototype.pipe=function(){var e=Mi.prototype.pipe.apply(this,arguments);return this.resume(),e};pe.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)};pe.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 Vi=T((bA,Zi)=>{var Zp=require("util"),Bi=require("stream").Stream,Fi=ji();Zi.exports=W;function W(){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}i(W,"CombinedStream");Zp.inherits(W,Bi);W.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};W.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};W.prototype.append=function(e){var t=W.isStreamLike(e);if(t){if(!(e instanceof Fi)){var r=Fi.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};W.prototype.pipe=function(e,t){return Bi.prototype.pipe.call(this,e,t),this.resume(),e};W.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}};W.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=W.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};W.prototype._pipeNext=function(e){this._currentStream=e;var t=W.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()};W.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};W.prototype.write=function(e){this.emit("data",e)};W.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};W.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")};W.prototype.end=function(){this._reset(),this.emit("end")};W.prototype.destroy=function(){this._reset(),this.emit("close")};W.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};W.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};W.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)};W.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Gi=T((TA,Hi)=>{"use strict";Hi.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 Ki=T(te=>{"use strict";var Kt=Gi(),Vp=require("path").extname,Wi=/^\s*([^;\s]*)(?:;|\s|$)/,Hp=/^text\//i;te.charset=qi;te.charsets={lookup:qi};te.contentType=Gp;te.extension=Wp;te.extensions=Object.create(null);te.lookup=qp;te.types=Object.create(null);Kp(te.extensions,te.types);function qi(e){if(!e||typeof e!="string")return!1;var t=Wi.exec(e),r=t&&Kt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Hp.test(t[1])?"UTF-8":!1}i(qi,"charset");function Gp(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}i(Gp,"contentType");function Wp(e){if(!e||typeof e!="string")return!1;var t=Wi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(Wp,"extension");function qp(e){if(!e||typeof e!="string")return!1;var t=Vp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}i(qp,"lookup");function Kp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Kt).forEach(i(function(o){var s=Kt[o],c=s.extensions;if(!(!c||!c.length)){e[o]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var h=r.indexOf(Kt[t[f]].source),_=r.indexOf(s.source);if(t[f]!=="application/octet-stream"&&(h>_||h===_&&t[f].substr(0,12)==="application/"))continue}t[f]=o}}},"forEachMimeType"))}i(Kp,"populateMaps")});var Xi=T((SA,Ji)=>{Ji.exports=Jp;function Jp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(Jp,"defer")});var Zr=T((zA,Qi)=>{var Yi=Xi();Qi.exports=Xp;function Xp(e){var t=!1;return Yi(function(){t=!0}),i(function(n,o){t?e(n,o):Yi(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(Xp,"async")});var Vr=T((kA,ea)=>{ea.exports=Yp;function Yp(e){Object.keys(e.jobs).forEach(Qp.bind(e)),e.jobs={}}i(Yp,"abort");function Qp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(Qp,"clean")});var Hr=T((RA,ra)=>{var ta=Zr(),el=Vr();ra.exports=tl;function tl(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=rl(t,o,e[o],function(s,c){o in r.jobs&&(delete r.jobs[o],s?el(r):r.results[o]=c,n(s,r.results))})}i(tl,"iterate");function rl(e,t,r,n){var o;return e.length==2?o=e(r,ta(n)):o=e(r,t,ta(n)),o}i(rl,"runJob")});var Gr=T((DA,na)=>{na.exports=nl;function nl(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,s){return t(e[o],e[s])}),n}i(nl,"state")});var Wr=T((UA,oa)=>{var ol=Vr(),il=Zr();oa.exports=al;function al(e){Object.keys(this.jobs).length&&(this.index=this.size,ol(this),il(e)(null,this.results))}i(al,"terminator")});var aa=T((LA,ia)=>{var sl=Hr(),ul=Gr(),cl=Wr();ia.exports=pl;function pl(e,t,r){for(var n=ul(e);n.index<(n.keyedList||e).length;)sl(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return cl.bind(n,r)}i(pl,"parallel")});var qr=T((FA,Jt)=>{var sa=Hr(),ll=Gr(),dl=Wr();Jt.exports=ml;Jt.exports.ascending=ua;Jt.exports.descending=fl;function ml(e,t,r,n){var o=ll(e,r);return sa(e,t,o,i(function s(c,l){if(c){n(c,l);return}if(o.index++,o.index<(o.keyedList||e).length){sa(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),dl.bind(o,n)}i(ml,"serialOrdered");function ua(e,t){return e<t?-1:e>t?1:0}i(ua,"ascending");function fl(e,t){return-1*ua(e,t)}i(fl,"descending")});var pa=T((ZA,ca)=>{var gl=qr();ca.exports=yl;function yl(e,t,r){return gl(e,t,null,r)}i(yl,"serial")});var da=T((HA,la)=>{la.exports={parallel:aa(),serial:pa(),serialOrdered:qr()}});var Kr=T((GA,ma)=>{"use strict";ma.exports=Object});var ga=T((WA,fa)=>{"use strict";fa.exports=Error});var ha=T((qA,ya)=>{"use strict";ya.exports=EvalError});var xa=T((KA,va)=>{"use strict";va.exports=RangeError});var Pa=T((JA,_a)=>{"use strict";_a.exports=ReferenceError});var Ia=T((XA,ba)=>{"use strict";ba.exports=SyntaxError});var Xt=T((YA,Ta)=>{"use strict";Ta.exports=TypeError});var $a=T((QA,Ea)=>{"use strict";Ea.exports=URIError});var Aa=T((ez,Sa)=>{"use strict";Sa.exports=Math.abs});var Oa=T((tz,za)=>{"use strict";za.exports=Math.floor});var wa=T((rz,ka)=>{"use strict";ka.exports=Math.max});var Na=T((nz,Ra)=>{"use strict";Ra.exports=Math.min});var Ca=T((oz,Da)=>{"use strict";Da.exports=Math.pow});var Ma=T((iz,Ua)=>{"use strict";Ua.exports=Math.round});var ja=T((az,La)=>{"use strict";La.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var Ba=T((uz,Fa)=>{"use strict";var hl=ja();Fa.exports=i(function(t){return hl(t)||t===0?t:t<0?-1:1},"sign")});var Va=T((pz,Za)=>{"use strict";Za.exports=Object.getOwnPropertyDescriptor});var Jr=T((lz,Ha)=>{"use strict";var Yt=Va();if(Yt)try{Yt([],"length")}catch{Yt=null}Ha.exports=Yt});var Wa=T((dz,Ga)=>{"use strict";var Qt=Object.defineProperty||!1;if(Qt)try{Qt({},"a",{value:1})}catch{Qt=!1}Ga.exports=Qt});var Xr=T((mz,qa)=>{"use strict";qa.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Xa=T((gz,Ja)=>{"use strict";var Ka=typeof Symbol<"u"&&Symbol,vl=Xr();Ja.exports=i(function(){return typeof Ka!="function"||typeof Symbol!="function"||typeof Ka("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vl()},"hasNativeSymbols")});var Yr=T((hz,Ya)=>{"use strict";Ya.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Qr=T((vz,Qa)=>{"use strict";var xl=Kr();Qa.exports=xl.getPrototypeOf||null});var rs=T((xz,ts)=>{"use strict";var _l="Function.prototype.bind called on incompatible ",Pl=Object.prototype.toString,bl=Math.max,Il="[object Function]",es=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),Tl=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),El=i(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");ts.exports=i(function(t){var r=this;if(typeof r!="function"||Pl.apply(r)!==Il)throw new TypeError(_l+r);for(var n=Tl(arguments,1),o,s=i(function(){if(this instanceof o){var _=r.apply(this,es(n,arguments));return Object(_)===_?_:this}return r.apply(t,es(n,arguments))},"binder"),c=bl(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(o=Function("binder","return function ("+El(l,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=i(function(){},"Empty");h.prototype=r.prototype,o.prototype=new h,h.prototype=null}return o},"bind")});var Ge=T((Pz,ns)=>{"use strict";var $l=rs();ns.exports=Function.prototype.bind||$l});var er=T((bz,os)=>{"use strict";os.exports=Function.prototype.call});var en=T((Iz,is)=>{"use strict";is.exports=Function.prototype.apply});var ss=T((Tz,as)=>{"use strict";as.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var cs=T((Ez,us)=>{"use strict";var Sl=Ge(),Al=en(),zl=er(),Ol=ss();us.exports=Ol||Sl.call(zl,Al)});var ls=T(($z,ps)=>{"use strict";var kl=Ge(),wl=Xt(),Rl=er(),Nl=cs();ps.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new wl("a function is required");return Nl(kl,Rl,t)},"callBindBasic")});var hs=T((Az,ys)=>{"use strict";var Dl=ls(),ds=Jr(),fs;try{fs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var tn=!!fs&&ds&&ds(Object.prototype,"__proto__"),gs=Object,ms=gs.getPrototypeOf;ys.exports=tn&&typeof tn.get=="function"?Dl([tn.get]):typeof ms=="function"?i(function(t){return ms(t==null?t:gs(t))},"getDunder"):!1});var bs=T((Oz,Ps)=>{"use strict";var vs=Yr(),xs=Qr(),_s=hs();Ps.exports=vs?i(function(t){return vs(t)},"getProto"):xs?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return xs(t)},"getProto"):_s?i(function(t){return _s(t)},"getProto"):null});var rn=T((wz,Is)=>{"use strict";var Cl=Function.prototype.call,Ul=Object.prototype.hasOwnProperty,Ml=Ge();Is.exports=Ml.call(Cl,Ul)});var Os=T((Rz,zs)=>{"use strict";var M,Ll=Kr(),jl=ga(),Fl=ha(),Bl=xa(),Zl=Pa(),Je=Ia(),Ke=Xt(),Vl=$a(),Hl=Aa(),Gl=Oa(),Wl=wa(),ql=Na(),Kl=Ca(),Jl=Ma(),Xl=Ba(),Ss=Function,nn=i(function(e){try{return Ss('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),xt=Jr(),Yl=Wa(),on=i(function(){throw new Ke},"throwTypeError"),Ql=xt?(function(){try{return arguments.callee,on}catch{try{return xt(arguments,"callee").get}catch{return on}}})():on,We=Xa()(),Q=bs(),ed=Qr(),td=Yr(),As=en(),_t=er(),qe={},rd=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%":We&&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%":jl,"%eval%":eval,"%EvalError%":Fl,"%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%":Ss,"%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%":We&&Q?Q(Q([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!We||!Q?M:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ll,"%Object.getOwnPropertyDescriptor%":xt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":Bl,"%ReferenceError%":Zl,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!We||!Q?M:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":We&&Q?Q(""[Symbol.iterator]()):M,"%Symbol%":We?Symbol:M,"%SyntaxError%":Je,"%ThrowTypeError%":Ql,"%TypedArray%":rd,"%TypeError%":Ke,"%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%":Vl,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":_t,"%Function.prototype.apply%":As,"%Object.defineProperty%":Yl,"%Object.getPrototypeOf%":ed,"%Math.abs%":Hl,"%Math.floor%":Gl,"%Math.max%":Wl,"%Math.min%":ql,"%Math.pow%":Kl,"%Math.round%":Jl,"%Math.sign%":Xl,"%Reflect.getPrototypeOf%":td};if(Q)try{null.error}catch(e){Ts=Q(Q(e)),De["%Error.prototype%"]=Ts}var Ts,nd=i(function e(t){var r;if(t==="%AsyncFunction%")r=nn("async function () {}");else if(t==="%GeneratorFunction%")r=nn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=nn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Q&&(r=Q(o.prototype))}return De[t]=r,r},"doEval"),Es={__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"]},Pt=Ge(),tr=rn(),od=Pt.call(_t,Array.prototype.concat),id=Pt.call(As,Array.prototype.splice),$s=Pt.call(_t,String.prototype.replace),rr=Pt.call(_t,String.prototype.slice),ad=Pt.call(_t,RegExp.prototype.exec),sd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ud=/\\(\\)?/g,cd=i(function(t){var r=rr(t,0,1),n=rr(t,-1);if(r==="%"&&n!=="%")throw new Je("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Je("invalid intrinsic syntax, expected opening `%`");var o=[];return $s(t,sd,function(s,c,l,f){o[o.length]=l?$s(f,ud,"$1"):c||s}),o},"stringToPath"),pd=i(function(t,r){var n=t,o;if(tr(Es,n)&&(o=Es[n],n="%"+o[0]+"%"),tr(De,n)){var s=De[n];if(s===qe&&(s=nd(n)),typeof s>"u"&&!r)throw new Ke("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Je("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");zs.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new Ke("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ke('"allowMissing" argument must be a boolean');if(ad(/^%?[^%]*%?$/,t)===null)throw new Je("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=cd(t),o=n.length>0?n[0]:"",s=pd("%"+o+"%",r),c=s.name,l=s.value,f=!1,h=s.alias;h&&(o=h[0],id(n,od([0,1],h)));for(var _=1,$=!0;_<n.length;_+=1){var x=n[_],u=rr(x,0,1),d=rr(x,-1);if((u==='"'||u==="'"||u==="`"||d==='"'||d==="'"||d==="`")&&u!==d)throw new Je("property names with quotes must have matching quotes");if((x==="constructor"||!$)&&(f=!0),o+="."+x,c="%"+o+"%",tr(De,c))l=De[c];else if(l!=null){if(!(x in l)){if(!r)throw new Ke("base intrinsic for "+t+" exists, but the property is not available.");return}if(xt&&_+1>=n.length){var y=xt(l,x);$=!!y,$&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[x]}else $=tr(l,x),l=l[x];$&&!f&&(De[c]=l)}}return l},"GetIntrinsic")});var ws=T((Dz,ks)=>{"use strict";var ld=Xr();ks.exports=i(function(){return ld()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ds=T((Uz,Ns)=>{"use strict";var dd=Os(),Rs=dd("%Object.defineProperty%",!0),md=ws()(),fd=rn(),gd=Xt(),nr=md?Symbol.toStringTag:null;Ns.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new gd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");nr&&(n||!fd(t,nr))&&(Rs?Rs(t,nr,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[nr]=r)},"setToStringTag")});var Us=T((Lz,Cs)=>{"use strict";var yd=Function.prototype.call,hd=Object.prototype.hasOwnProperty,vd=Ge();Cs.exports=vd.call(yd,hd)});var Ls=T((jz,Ms)=>{"use strict";Ms.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Bs=T((Fz,Fs)=>{"use strict";var cn=Vi(),xd=require("util"),an=require("path"),_d=require("http"),Pd=require("https"),bd=require("url").parse,Id=require("fs"),Td=require("stream").Stream,Ed=require("crypto"),sn=Ki(),$d=da(),Sd=Ds(),ke=Us(),un=Ls();function js(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(js,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],cn.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(j,"FormData");xd.inherits(j,cn);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=cn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(o),n(t),n(s),this._trackLength(o,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&&ke(t,"httpVersion"))&&!(t instanceof Td))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){ke(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Id.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):ke(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ke(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),o=this._getContentType(t,r),s="",c={"Content-Disposition":["form-data",'name="'+js(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&un(c,r.header);var l;for(var f in c)if(ke(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(s+=f+": "+l.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+s+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=an.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=an.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ke(e,"httpVersion")&&(r=an.basename(e.client._httpMessage.path||"")),r)return'filename="'+js(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=sn.lookup(e.name)),!r&&e&&e.path&&(r=sn.lookup(e.path)),!r&&e&&e.readable&&ke(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=sn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=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)ke(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="--------------------------"+Ed.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}$d.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=bd(e),n=un({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=un(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Pd.request(n):r=_d.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=i(function(h,_){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,h,_)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.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]"};Sd(j.prototype,"FormData");Fs.exports=j});var Ud={};mn(Ud,{reddit:()=>Cd});module.exports=au(Ud);var su=Object.freeze({status:"aborted"});function b(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let h=c.prototype,_=Object.keys(h);for(let $=0;$<_.length;$++){let x=_[$];x in l||(l[x]=h[x].bind(l))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(l){var f;let h=r?.Parent?new s:this;n(h,l),(f=h._zod).deferred??(f.deferred=[]);for(let _ of h._zod.deferred)_();return h}return i(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:i(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}i(b,"$constructor");var le=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},It=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ir={};function ge(e){return e&&Object.assign(ir,e),ir}i(ge,"config");function sr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(sr,"getEnumValues");function yn(e,t){return typeof t=="bigint"?t.toString():t}i(yn,"jsonStringifyReplacer");function Et(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Et,"cached");function hn(e){return e==null}i(hn,"nullish");function $t(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i($t,"cleanRegex");var gn=Symbol("evaluating");function K(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==gn)return n===void 0&&(n=gn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(K,"defineLazy");var ur="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(Qe,"isObject");var uu=Et(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function vn(e){if(Qe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Qe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(vn,"isPlainObject");var xn=new Set(["string","number","symbol"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Ue,"escapeRegex");function St(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(St,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>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:i(()=>t.error,"error")}:t}i(Z,"normalizeParams");function _n(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(_n,"optionalKeys");var Pn={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}i(Me,"aborted");function be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(be,"prefixIssues");function Tt(e){return typeof e=="string"?e:e?.message}i(Tt,"unwrapMessage");function Ie(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Tt(e.inst?._zod.def?.error?.(e))??Tt(t?.error?.(e))??Tt(r.customError?.(e))??Tt(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Ie,"finalizeIssue");function bn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(bn,"getLengthableOrigin");function cr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(cr,"issue");var In=i((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,yn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),Tn=b("$ZodError",In),et=b("$ZodError",In,{Parent:Error});var pu=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new le;if(c.issues.length){let l=new(o?.Err??e)(c.issues.map(f=>Ie(f,s,ge())));throw ur(l,o?.callee),l}return c.value},"_parse"),At=pu(et),lu=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??e)(c.issues.map(f=>Ie(f,s,ge())));throw ur(l,o?.callee),l}return c.value},"_parseAsync"),zt=lu(et),du=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new le;return s.issues.length?{success:!1,error:new(e??Tn)(s.issues.map(c=>Ie(c,o,ge())))}:{success:!0,data:s.value}},"_safeParse"),tt=du(et),mu=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>Ie(c,o,ge())))}:{success:!0,data:s.value}},"_safeParseAsync"),rt=mu(et);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 En=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),$n=/^-?\d+n?$/,Sn=/^-?\d+$/,pr=/^-?\d+(?:\.\d+)?$/,An=/^(?:true|false)$/i;var Te=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),yu={number:"number",bigint:"bigint",object:"date"};var zn=b("$ZodCheckGreaterThan",(e,t)=>{Te.init(e,t);let r=yu[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var On=b("$ZodCheckNumberFormat",(e,t)=>{Te.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=Pn[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,r&&(l.pattern=Sn)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<o&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>s&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var kn=b("$ZodCheckMinLength",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!hn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let c=bn(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var lr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Te.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),wn=b("$ZodCheckRegex",(e,t)=>{lr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Nn={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Nn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((c,l,f)=>{let h=Me(c),_;for(let $ of l){if($._zod.def.when){if(!$._zod.def.when(c))continue}else if(h)continue;let x=c.issues.length,u=$._zod.check(c);if(u instanceof Promise&&f?.async===!1)throw new le;if(_||u instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await u,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"),s=i((c,l,f)=>{if(Me(c))return c.aborted=!0,c;let h=o(l,n,f);if(h instanceof Promise){if(f.async===!1)throw new le;return h.then(_=>e._zod.parse(_,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(_=>s(_,c,l)):s(h,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new le;return f.then(h=>o(h,n,l))}return o(f,n,l)}}K(e,"~standard",()=>({validate:i(o=>{try{let s=tt(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return rt(e,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),wt=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??En(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}}),dr=b("$ZodStringFormat",(e,t)=>{lr.init(e,t),wt.init(e,t)});var Ln=b("$ZodURL",(e,t)=>{dr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var mr=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??pr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),jn=b("$ZodNumberFormat",(e,t)=>{On.init(e,t),mr.init(e,t)}),fr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=An,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Fn=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=$n,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=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Zn=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Vn=b("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),Hn=b("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Dn(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}i(Dn,"handleArrayResult");var Gn=b("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let c=0;c<o.length;c++){let l=o[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?s.push(f.then(h=>Dn(h,r,c))):Dn(f,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function kt(e,t,r,n,o){if(e.issues.length){if(o&&!(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}i(kt,"handlePropertyResult");function hu(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)}}i(hu,"normalizeDef");function vu(e,t,r,n,o,s){let c=[],l=o.keySet,f=o.catchall._zod,h=f.def.type,_=f.optout==="optional";for(let $ in t){if(l.has($))continue;if(h==="never"){c.push($);continue}let x=f.run({value:t[$],issues:[]},n);x instanceof Promise?e.push(x.then(u=>kt(u,r,$,t,_))):kt(x,r,$,t,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i(vu,"handleCatchall");var Wn=b("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Et(()=>hu(t));K(e._zod,"propValues",()=>{let l=t.shape,f={};for(let h in l){let _=l[h]._zod;if(_.values){f[h]??(f[h]=new Set);for(let $ of _.values)f[h].add($)}}return f});let o=Qe,s=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let h=l.value;if(!o(h))return l.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),l;l.value={};let _=[],$=c.shape;for(let x of c.keys){let u=$[x],d=u._zod.optout==="optional",y=u._zod.run({value:h[x],issues:[]},f);y instanceof Promise?_.push(y.then(m=>kt(m,l,x,h,d))):kt(y,l,x,h,d)}return s?vu(_,h,l,f,n.value,e):_.length?Promise.all(_).then(()=>l):l}});function Cn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!Me(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(c=>Ie(c,n,ge())))}),t)}i(Cn,"handleUnionResults");var gr=b("$ZodUnion",(e,t)=>{H.init(e,t),K(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),K(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),K(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),K(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>$t(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let c=!1,l=[];for(let f of t.options){let h=f._zod.run({value:o.value,issues:[]},s);if(h instanceof Promise)l.push(h),c=!0;else{if(h.issues.length===0)return h;l.push(h)}}return c?Promise.all(l).then(f=>Cn(f,o,e,s)):Cn(l,o,e,s)}});var qn=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gr.init(e,t);let r=e._zod.parse;K(e._zod,"propValues",()=>{let o={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[l,f]of Object.entries(c)){o[l]||(o[l]=new Set);for(let h of f)o[l].add(h)}}return o});let n=Et(()=>{let o=t.options,s=new Map;for(let c of o){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of l){if(s.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);s.set(f,c)}}return s});e._zod.parse=(o,s)=>{let c=o.value;if(!Qe(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),o)}});var Kn=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!vn(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){l.add(typeof h=="number"?h.toString():h);let _=t.valueType._zod.run({value:o[h],issues:[]},n);_ instanceof Promise?s.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 f;for(let h in o)l.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&pr.test(l)&&f.issues.length){let $=t.keyType._zod.run({value:Number(l),issues:[]},n);if($ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");$.issues.length===0&&(f=$)}if(f.issues.length){t.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map($=>Ie($,n,ge())),input:l,path:[l],inst:e});continue}let _=t.valueType._zod.run({value:o[l],issues:[]},n);_ instanceof Promise?s.push(_.then($=>{$.issues.length&&r.issues.push(...be(l,$.issues)),r.value[f.value]=$.value})):(_.issues.length&&r.issues.push(...be(l,_.issues)),r.value[f.value]=_.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Jn=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=sr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>xn.has(typeof o)).map(o=>typeof o=="string"?Ue(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),Xn=b("$ZodLiteral",(e,t)=>{if(H.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,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var Yn=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new It(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new le;return r.value=o,r}});function Un(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Un,"handleOptionalResult");var Qn=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",K(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),K(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 o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Un(s,r.value)):Un(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var eo=b("$ZodNullable",(e,t)=>{H.init(e,t),K(e._zod,"optin",()=>t.innerType._zod.optin),K(e._zod,"optout",()=>t.innerType._zod.optout),K(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)}|null)$`):void 0}),K(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=b("$ZodPipe",(e,t)=>{H.init(e,t),K(e._zod,"values",()=>t.in._zod.values),K(e._zod,"optin",()=>t.in._zod.optin),K(e._zod,"optout",()=>t.out._zod.optout),K(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Ot(c,t.in,n)):Ot(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Ot(s,t.out,n)):Ot(o,t.out,n)}});function Ot(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(Ot,"handlePipeResult");var ro=b("$ZodCustom",(e,t)=>{Te.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>Mn(s,r,n,e));Mn(o,r,n,e)}});function Mn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(cr(o))}}i(Mn,"handleRefineResult");var oo;var yr=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function io(){return new yr}i(io,"registry");(oo=globalThis).__zod_globalRegistry??(oo.__zod_globalRegistry=io());var hr=globalThis.__zod_globalRegistry;function ao(e,t){return new e({type:"string",...Z(t)})}i(ao,"_string");function so(e,t){return new e({type:"string",coerce:!0,...Z(t)})}i(so,"_coercedString");function uo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}i(uo,"_url");function co(e,t){return new e({type:"number",checks:[],...Z(t)})}i(co,"_number");function po(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}i(po,"_coercedNumber");function lo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}i(lo,"_int");function mo(e,t){return new e({type:"boolean",...Z(t)})}i(mo,"_boolean");function fo(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}i(fo,"_coercedBoolean");function go(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}i(go,"_coercedBigint");function yo(e){return new e({type:"any"})}i(yo,"_any");function ho(e){return new e({type:"unknown"})}i(ho,"_unknown");function vo(e,t){return new e({type:"void",...Z(t)})}i(vo,"_void");function xo(e,t){return new e({type:"date",coerce:!0,...Z(t)})}i(xo,"_coercedDate");function Rt(e,t){return new zn({check:"greater_than",...Z(t),value:e,inclusive:!0})}i(Rt,"_gte");function ue(e,t){return new kn({check:"min_length",...Z(t),minimum:e})}i(ue,"_minLength");function Ee(e,t){return new wn({check:"string_format",format:"regex",...Z(t),pattern:e})}i(Ee,"_regex");function _o(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(_o,"_custom");var J=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>At(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>tt(e,r,n),e.parseAsync=async(r,n)=>zt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>rt(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)=>St(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Dt=b("ZodMiniString",(e,t)=>{wt.init(e,t),J.init(e,t)});function a(e){return ao(Dt,e)}i(a,"string");var Po=b("ZodMiniStringFormat",(e,t)=>{dr.init(e,t),Dt.init(e,t)});var ku=b("ZodMiniURL",(e,t)=>{Ln.init(e,t),Po.init(e,t)});function bo(e){return uo(ku,e)}i(bo,"url");var Ct=b("ZodMiniNumber",(e,t)=>{mr.init(e,t),J.init(e,t)});function ee(e){return co(Ct,e)}i(ee,"number");var wu=b("ZodMiniNumberFormat",(e,t)=>{jn.init(e,t),Ct.init(e,t)});function Io(e){return lo(wu,e)}i(Io,"int");var vr=b("ZodMiniBoolean",(e,t)=>{fr.init(e,t),J.init(e,t)});function F(e){return mo(vr,e)}i(F,"boolean");var To=b("ZodMiniBigInt",(e,t)=>{Fn.init(e,t),J.init(e,t)});var Ru=b("ZodMiniAny",(e,t)=>{Bn.init(e,t),J.init(e,t)});function ot(){return yo(Ru)}i(ot,"any");var Nu=b("ZodMiniUnknown",(e,t)=>{Zn.init(e,t),J.init(e,t)});function k(){return ho(Nu)}i(k,"unknown");var Du=b("ZodMiniVoid",(e,t)=>{Vn.init(e,t),J.init(e,t)});function Eo(e){return vo(Du,e)}i(Eo,"_void");var $o=b("ZodMiniDate",(e,t)=>{Hn.init(e,t),J.init(e,t)});var Cu=b("ZodMiniArray",(e,t)=>{Gn.init(e,t),J.init(e,t)});function N(e,t){return new Cu({type:"array",element:e,...Z(t)})}i(N,"array");var Uu=b("ZodMiniObject",(e,t)=>{Wn.init(e,t),J.init(e,t),K(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...Z(t)};return new Uu(r)}i(p,"object");var Mu=b("ZodMiniUnion",(e,t)=>{gr.init(e,t),J.init(e,t)});function D(e,t){return new Mu({type:"union",options:e,...Z(t)})}i(D,"union");var Lu=b("ZodMiniDiscriminatedUnion",(e,t)=>{qn.init(e,t),J.init(e,t)});function $e(e,t,r){return new Lu({type:"union",options:t,discriminator:e,...Z(r)})}i($e,"discriminatedUnion");var ju=b("ZodMiniRecord",(e,t)=>{Kn.init(e,t),J.init(e,t)});function w(e,t,r){return new ju({type:"record",keyType:e,valueType:t,...Z(r)})}i(w,"record");var Fu=b("ZodMiniEnum",(e,t)=>{Jn.init(e,t),J.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,...Z(t)})}i(U,"_enum");var Bu=b("ZodMiniLiteral",(e,t)=>{Xn.init(e,t),J.init(e,t)});function E(e,t){return new Bu({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}i(E,"literal");var Zu=b("ZodMiniTransform",(e,t)=>{Yn.init(e,t),J.init(e,t)});function Se(e){return new Zu({type:"transform",transform:e})}i(Se,"transform");var Vu=b("ZodMiniOptional",(e,t)=>{Qn.init(e,t),J.init(e,t)});function g(e){return new Vu({type:"optional",innerType:e})}i(g,"optional");var Hu=b("ZodMiniNullable",(e,t)=>{eo.init(e,t),J.init(e,t)});function it(e){return new Hu({type:"nullable",innerType:e})}i(it,"nullable");var Gu=b("ZodMiniPipe",(e,t)=>{to.init(e,t),J.init(e,t)});function Ae(e,t){return new Gu({type:"pipe",in:e,out:t})}i(Ae,"pipe");var Wu=b("ZodMiniCustom",(e,t)=>{ro.init(e,t),J.init(e,t)});function Ut(e,t){return _o(Wu,e??(()=>!0),t)}i(Ut,"custom");var at={};mn(at,{bigint:()=>Qu,boolean:()=>Yu,date:()=>ec,number:()=>Xu,string:()=>Ju});function Ju(e){return so(Dt,e)}i(Ju,"string");function Xu(e){return po(Ct,e)}i(Xu,"number");function Yu(e){return fo(vr,e)}i(Yu,"boolean");function Qu(e){return go(To,e)}i(Qu,"bigint");function ec(e){return xo($o,e)}i(ec,"date");var _r=p({retryOnFailure:p({defaultValue:g(F()),hide:g(F())}),continueOnFailure:p({defaultValue:g(F()),hide:g(F())})}),xr=class{constructor(t,r,n,o,s,c,l,f,h,_,$){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=_;this.aiMetadata=$}static{i(this,"IAction")}},X=i(e=>new xr(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 B=p({displayName:a(),description:g(a())}),C=i((e,t)=>p({type:E(t),required:F(),defaultValue:g(ot())}),"TPropertyValue");var ne=p({...B.shape,...C(a(),"SHORT_TEXT").shape}),ye=p({...B.shape,...C(a(),"LONG_TEXT").shape});var Ao=p({label:a(),value:k()}),Mt=p({disabled:g(F()),placeholder:g(a()),options:N(Ao)});var oe=p({...B.shape,options:Mt,...C(k(),"STATIC_DROPDOWN").shape}),he=p({...B.shape,options:Mt,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Pr=p({...B.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),st=p({...B.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var ve=p({...B.shape,...C(F(),"CHECKBOX").shape});var xe=p({...B.shape,...C(ee(),"NUMBER").shape});var ut=p({...B.shape,streaming:g(F()),...C(k(),"FILE").shape});var ct=p({...B.shape,...C(a(),"DATE_TIME").shape});var zo=w(a(),D([ne,ye,oe,st,he,ve,xe,ut,ct])),pt=p({...B.shape,properties:zo,...C(N(k()),"ARRAY").shape});var lt=p({...B.shape,...C(D([w(a(),k())]),"JSON").shape});var Oo=D([ne,oe,lt,pt,he]),rc=w(a(),Oo),br=p({refreshers:N(a()),...B.shape,...C(k(),"DYNAMIC").shape});var Lt=p({...B.shape,...C(Eo(),"MARKDOWN").shape});var dt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(dt||{}),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 Fe=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Fe||{}),Ir="both_client_credentials_and_authorization_code";var we=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(we||{}),mt=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(mt||{}),nc=p({strategy:U(mt),paramName:g(a())}),ft=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ft||{});var jt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(jt||{}),ko=p({status:g(ee()),body:g(k()),headers:g(w(a(),a()))}),wo=p({type:E("DELAY"),resumeDateTime:a(),requestIdToReply:g(a()),handlerId:g(a()),streamStepProgress:g(U(jt))}),Ro=p({type:E("WEBHOOK"),requestId:a(),requestIdToReply:g(a()),response:ko,handlerId:g(a()),streamStepProgress:g(U(jt))}),oc=D([wo,Ro]);var ic=p({body:k(),rawBody:g(k()),headers:w(a(),a()),queryParams:w(a(),a())});function ce(e){return e==null}i(ce,"isNil");function gt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(gt,"isEmpty");function Ft(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(Ft,"assertNotNullOrUndefined");var Tr=Ce(require("crypto"),1);var ac=128,ze,Be,sc=i(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!ze||ze.length<e?(ze=Buffer.allocUnsafe(e*ac),Tr.default.randomFillSync(ze),Be=0):Be+e>ze.length&&(Tr.default.randomFillSync(ze),Be=0)}catch(t){throw ze=void 0,t}Be+=e},"fillPool"),uc=i(e=>(sc(e|=0),ze.subarray(Be-e,Be)),"random"),cc=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(s=t)=>{if(s<=0)return"";let c="";for(;;){let l=r(o),f=o;for(;f--;)if(c+=e[l[f]&n]||"",c.length===s)return c}}},"customRandom"),Do=i((e,t=21)=>cc(e,t,uc),"customAlphabet");var pc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Co=21,vb=a().check(Ee(new RegExp(`^[0-9a-zA-Z]{${Co}}$`))),lc=Do(pc,Co);var Oe=Ae(Se(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:Oe,updated:Oe},V=i(e=>g(it(e)),"Nullable");function Er(e){return g(it(U(e)))}i(Er,"NullableEnum");var Pb=Ae(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),g(F())),Bt=i(e=>Ae(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),g(N(e))),"OptionalArrayFromQuery");var Tb=w(a(),k());var yt=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(yt||{});var Cb=a().check(Ee(/^#[0-9A-Fa-f]{6}$/));var Mb=p({filename:a(),data:k(),type:E("file"),mimetype:g(a())});var dc=Ce(Mo());var Hb=p({...ie,name:a(),permissions:N(a()),platformId:V(a()),type:a(),userCount:g(ee())});var Lo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Lo||{}),$r=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))($r||{}),Sr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Sr||{});var Ar=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Ar||{});var zr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(zr||{});var mc=p({mode:U(Lo),value:k()}),fc=p({auth:g(a()),fields:w(a(),mc)}),gc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:g(fc)}),yc=p({type:E("PIECE"),toolName:a().check(ue(1)),pieceMetadata:gc}),hc=p({type:E("none")}),vc=p({type:E("access_token"),accessToken:a()}),xc=p({type:E("api_key"),apiKey:a(),apiKeyHeader:a()}),_c=p({type:E("headers"),headers:w(a(),a())}),Pc=$e("type",[hc,vc,xc,_c]),jo=p({type:E("FLOW"),toolName:a().check(ue(1)),externalFlowId:a(),flowDisplayName:g(a())}),Fo=p({type:E("MCP"),toolName:a().check(ue(1)),serverUrl:bo(),protocol:U(Sr),auth:Pc}),Bo=p({type:E("KNOWLEDGE_BASE"),toolName:a().check(ue(1)),sourceType:U($r),sourceId:a(),sourceName:a()}),bc=$e("type",[yc,jo,Fo,Bo]),Ic=p({displayName:a(),description:g(a()),type:U(Ar)}),Zo=p({type:E("MARKDOWN"),markdown:a()}),Ze={type:E("TOOL_CALL"),input:V(w(a(),k())),output:g(k()),toolName:a(),status:U(zr),toolCallId:a(),startTime:a(),endTime:g(a())},bI=p(Ze),Vo=$e("toolCallType",[p({...Ze,toolCallType:E("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Ze,toolCallType:E("FLOW"),displayName:a(),externalFlowId:a()}),p({...Ze,toolCallType:E("MCP"),displayName:a(),serverUrl:a()}),p({...Ze,toolCallType:E("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Ze,toolCallType:E("UNKNOWN"),displayName:a()})]),Tc=D([Zo,Vo]);var Or=(r=>(r.IMAGE="image",r.TEXT="text",r))(Or||{}),_e=p({apiKey:a()}),Ec=_e,$c=p({apiKey:a(),apiKeyHash:a()}),Sc=_e,Ac=_e,zc=_e,Oc=_e,kc=_e,wc=_e,Rc=_e,Ko=p({accessKeyId:a().check(ue(1)),secretAccessKey:a().check(ue(1))}),Nc=p({}),Dc=p({}),Cc=p({}),Uc=p({}),Mc=p({}),Lc=p({}),Jo=p({modelId:a(),modelName:a(),modelType:U(Or)}),Xo=p({apiKeyHeader:a(),baseUrl:a(),models:N(Jo),defaultHeaders:g(w(a(),a()))}),Yo=p({accountId:a(),gatewayId:a(),models:N(Jo),vertexProject:g(a()),vertexRegion:g(a())}),Qo=p({resourceName:a(),apiVersion:Ae(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),g(a()))}),ei=p({region:a().check(ue(1))}),jc=D([Ec,zc,Oc,kc,wc,Ac,Sc,$c,Ko,Rc]),ti=D([Xo,Yo,Qo,ei,Nc,Cc,Uc,Mc,Dc,Lc]),Fc=p({id:a(),name:a(),type:U(Or)}),Bc=p({id:a(),name:a(),provider:U(yt),config:ti,enabledForChat:F()}),Zc=p({provider:U(yt),config:ti,auth:jc,platformId:a()});var $I={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Ho=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Vc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Hc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Go=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Gc=["grok-4.20","grok-4.1-fast"],Wc={openai:Ho,anthropic:Vc,google:Go,activepieces:[...Hc.map(e=>`anthropic/${e}`),...Ho.map(e=>`openai/${e}`),...Go.map(e=>`google/${e}`),...Gc.map(e=>`x-ai/${e}`)]};var Wo=128e3,qc={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Kc({provider:e}){return e?qc[e]??Wo:Wo}i(Kc,"getMaxContextTokens");var qo={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},Jc={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Xc=new Set(["anthropic","mistral"]);function de(e){return{chatModels:Wc[e],maxContextTokens:Kc({provider:e}),defaultEmbeddingModel:qo[e],supportsEmbedding:qo[e]!==void 0,supportsImageGeneration:!Xc.has(e),webSearch:Jc[e]}}i(de,"buildProviderCapabilities");var Yc={openai:de("openai"),anthropic:de("anthropic"),openrouter:de("openrouter"),azure:de("azure"),google:de("google"),"cloudflare-gateway":de("cloudflare-gateway"),custom:de("custom"),bedrock:de("bedrock"),mistral:de("mistral"),activepieces:de("activepieces")};var Qc=p({base64Url:a(),fileName:a(),extension:g(a())}),ep=p({mimeType:a(),url:a(),fileName:g(a())}),kr=D([Qc,ep]);var tp=D([p({type:E("file"),value:kr}),p({type:E("markdown"),value:a(),files:g(N(kr))})]),rp=p({sessionId:a(),message:a(),files:g(N(a()))});var ni=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ni||{}),oi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(oi||{}),wr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(wr||{});var np=D([p({...ie,name:a(),externalId:a(),type:E("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...ie,name:a(),externalId:a(),type:D([E("TEXT"),E("NUMBER"),E("DATE")]),tableId:a(),projectId:a()})]),op=p({...ie,name:a(),folderId:V(a()),projectId:a(),externalId:a(),status:Er(oi),trigger:Er(ni)}),ip=p({...ie,tableId:a(),projectId:a(),cells:w(a(),p({updated:a(),created:a(),value:k(),fieldName:a()}))}),ap=p({events:N(U(wr)),webhookUrl:a(),flowId:a()}),sp=p({fields:N(p({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),up=p({projectId:a(),limit:g(at.number()),cursor:g(a()),name:g(a()),externalIds:Bt(a()),folderId:g(a()),folderIds:Bt(a())}),cp=p({records:N(N(p({fieldId:a(),value:ai()}))),tableId:a()}),pp=p({cells:g(N(p({fieldId:a(),value:ai()}))),tableId:a(),agentUpdate:g(F())}),ii=$e("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),ri("exists"),ri("not_exists")]),lp=p({tableId:a(),limit:g(at.number()),cursor:g(a()),filters:Bt(ii)});function ai(){return Ae(Se(e=>e==null?e:String(e)),it(a()))}i(ai,"coerceToString");function Re(e){return p({fieldId:a(),operator:E(e),value:a()})}i(Re,"valueFilter");function ri(e){return p({fieldId:a(),operator:E(e)})}i(ri,"existenceFilter");var dp=p({status:g(ee()),body:g(k()),headers:g(w(a(),a()))}),mp=p({...ie,deleted:V(Oe),ownerId:a(),displayName:a(),platformId:a(),externalId:V(a())});var si=p({name:a(),description:g(a()),type:a(),required:F()}),fp=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(si),returnsResponse:F()})});var ui="^[0-9]+\\.[0-9]+\\.[0-9]+$",HI=new RegExp(ui),yp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",GI=a().check(Ee(new RegExp(ui))),WI=a().check(Ee(new RegExp(yp))),hp=p({packageType:E("ARCHIVE"),pieceType:U(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ci=p({packageType:E("REGISTRY"),pieceType:E("OFFICIAL"),pieceName:a(),pieceVersion:a()}),pi=p({packageType:E("REGISTRY"),pieceType:E("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),qI=D([ci,pi]),KI=D([hp,ci,pi]);var vp=$e("type",[p({type:E("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:E("INTERVAL"),intervalMs:Io().check(Rt(6e4))})]),JI=p({...ie,type:U(we),projectId:a(),flowId:a(),triggerName:a(),schedule:V(vp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:V(a()),simulate:F()}),li=(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))(li||{}),di=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(di||{}),mi=(r=>(r.S3="S3",r.DB="DB",r))(mi||{}),XI=p({...ie,projectId:V(a()),platformId:V(a()),type:U(li),compression:U(di),data:g(k()),location:U(mi),size:V(ee()),fileName:V(a()),s3Key:V(a()),metadata:V(w(a(),a()))}),fi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(fi||{}),gi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(gi||{}),YI=p({id:a(),email:a(),firstName:a(),status:U(gi),externalId:V(a()),platformId:V(a()),platformRole:U(fi),lastName:a(),created:Oe,updated:Oe,lastActiveDate:V(Oe),imageUrl:V(a())});var Rr=p({...B.shape,...C(w(a(),k()),"OBJECT").shape});var xi=p({...B.shape,...C(a(),"COLOR").shape});var Nr=D([ne,ye,Lt,ve,oe,he,Pr,st,br,xe,pt,Rr,lt,ct,ut,xi]),S={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 me=p({displayName:a(),description:g(a()),hasConnectionIdentifier:g(F())});var _i=p({username:a(),password:a()}),Dr=p({...me.shape,username:p({displayName:a(),description:g(a())}),password:p({displayName:a(),description:g(a())}),...C(_i,"BASIC_AUTH").shape});var bp=w(a(),D([ne,ye,xe,ve,oe])),Cr=p({...me.shape,props:bp,...C(k(),"CUSTOM_AUTH").shape});var Ne=p({...me.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var Ip=w(a(),D([ne,ye,Ne,xe,ve,oe,he,Lt])),Pi=p({...me.shape,props:Ip,...C(k(),"OIDC").shape});var Vt=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Vt||{}),bi=D([ne,Ne,oe]),Ii=w(a(),bi),Tp=p({props:g(w(a(),bi)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:g(D([E("none"),E("consent"),E("login"),E("omit")])),pkce:g(F()),pkceMethod:g(D([E("plain"),E("S256")])),authorizationMethod:g(U(Vt)),grantType:g(D([U(Fe),E(Ir)])),extra:g(w(a(),a()))}),Ti=p({access_token:a(),props:g(Ii),data:w(a(),ot())}),Ur=p({...me.shape,...Tp.shape,...C(Ti,"OAUTH2").shape});var Ve=D([Dr,Cr,Pi,Ur,Ne]),ht="Connection",Mr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||ht}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||ht,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||ht}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||ht}},None(){}};var OE={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 Ep=p({...B.shape,...C(k(),"CUSTOM").shape,code:a()});var $p=D([Nr,Ve]),Lr=w(a(),$p),JE=w(a(),Nr);var Ei=D([p({strategy:E("CRON"),cronExpression:a()}),p({strategy:E("NONE")})]);var $i="2",Ht="0.82.0";var jr=class{constructor(t,r,n,o,s,c,l,f,h=Ht,_,$="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=_;this.description=$;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:$i}),"getContextInfo");(!Ap(h)||zp(h,Ht))&&(this.minimumSupportedRelease=Ht),s.forEach(u=>this._actions[u.name]=u),c.forEach(u=>this._triggers[u.name]=u)}static{i(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:Sp(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}},Ai=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new jr(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 Sp(e){if(e!==void 0)return Array.isArray(e)?e.map(Si):Si(e)}i(Sp,"withConnectionIdentifierFlag");function Si(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}i(Si,"flagConnectionIdentifier");function Ap(e){return/^\d+\.\d+\.\d+$/.test(e)}i(Ap,"isValidSimpleSemver");function zp(e,t){let[r,n,o]=e.split(".").map(Number),[s,c,l]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:o<l}i(zp,"isSemverLessThan");var Op=g(w(a(),w(a(),a()))),zi=p({id:g(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:g(a()),directoryPath:g(a()),auth:g(D([Ve,N(Ve)])),version:a(),categories:g(N(U(je))),minimumSupportedRelease:g(a()),maximumSupportedRelease:g(a()),deprecated:g(F()),i18n:Op}),kp=U(["human","ai","both"]),Oi=p({description:g(a()),idempotent:g(F())}),ki=p({name:a(),displayName:a(),description:a(),props:Lr,requireAuth:F(),errorHandlingOptions:g(_r),outputSchema:g(Ut()),audience:g(kp),aiMetadata:g(Oi)}),wi=p({name:a(),displayName:a(),description:a(),props:Lr,errorHandlingOptions:g(_r),type:U(we),sampleData:k(),handshakeConfiguration:g(Ut()),renewConfiguration:g(Ei),testStrategy:U(ft),outputSchema:g(Ut()),aiMetadata:g(Oi)}),wp=p({...zi.shape,actions:w(a(),ki),triggers:w(a(),wi)}),Rp=p({...zi.shape,actions:ee(),triggers:ee(),suggestedActions:g(N(ki)),suggestedTriggers:g(N(wi))}),Ri=p({projectUsage:ee(),pieceType:U(Le),packageType:U(dt),platformId:g(a()),archiveId:g(a())}),J$=p({...wp.shape,...Ri.shape}),X$=p({...Rp.shape,...Ri.shape}),Y$=p({name:a(),version:a()});var Np=Ce(require("path")),Dp=Ce(require("fs/promises"));var He=require("node:stream");var Gt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,c)=>{o.append(c,s)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Wt=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new Fr,r=new Br){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Fr=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Br=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var vt=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(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 Ni({error:e,requestBody:t}){return e instanceof vt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}i(Ni,"toFailsafeOutput");var ae=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(ae||{});var qt=class extends Gt{static{i(this,"FetchHttpClient")}constructor(t="",r=new Wt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[L,re]of Object.entries(c))o.append(L,re);let l=o.toString(),f=l?`${n}?${l}`:n,h=t.responseType??"json",_=t.followRedirects??!0,$=t.retries??0,{body:x,extraHeaders:u,isStream:d}=Cp(t.method)?Up(t.body,s):{body:void 0,extraHeaders:{},isStream:!1},y=Lp({...s,...u}),m=await Mp(async()=>{let L=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let se={method:t.method.toString(),headers:y,body:x,redirect:_?"follow":"manual",signal:L.signal};return d&&(se.duplex="half"),r?.dispatcher!==void 0&&(se.dispatcher=r.dispatcher),await fetch(f,se)}finally{re!==void 0&&clearTimeout(re)}},d?0:$),v=_?300:400;if(m.status<200||m.status>=v){let L=await Di(m,h==="stream"?"text":h),re=new vt(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let P=await Di(m,h);return{status:m.status,headers:jp(m.headers),body:P}}};function Cp(e){return e!=="GET"&&e!=="HEAD"}i(Cp,"acceptsRequestBody");function Up(e,t){if(Ui(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Fp(e)){let n=new He.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof He.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(Up,"serializeBody");async function Di(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Ui(e.body)?He.Readable.from([]):He.Readable.fromWeb(e.body);case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(Di,"parseResponseBody");async function Mp(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Ci(n);continue}return o}catch(o){if(r=o,n<t){await Ci(n);continue}throw o}throw r}i(Mp,"sendWithRetries");function Ci(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Ci,"backoff");function Lp(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}i(Lp,"normalizeHeaders");function jp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(jp,"toHttpHeaders");function Fp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}i(Fp,"isNodeFormData");function Ui(e){return e==null}i(Ui,"isNil");var Y=new qt;var Ad=Ce(require("fs")),Zs=Ce(Bs());var zd={"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 Od(e){let t=e.split(";")[0].trim().toLowerCase();return zd[t]??""}i(Od,"contentTypeToExtension");var kd=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),wd=i((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 Vs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:s,props:c,extraProps:l,authLocation:f="headers"}){return X({audience:"human",name:s||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:S.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:h})=>({url:S.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
-
i.e ${
|
|
1
|
+
"use strict";var uu=Object.create;var Ye=Object.defineProperty;var cu=Object.getOwnPropertyDescriptor;var pu=Object.getOwnPropertyNames;var lu=Object.getPrototypeOf,du=Object.prototype.hasOwnProperty;var i=(e,t)=>Ye(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}},gn=(e,t)=>{for(var r in t)Ye(e,r,{get:t[r],enumerable:!0})},yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of pu(t))!du.call(e,o)&&o!==r&&Ye(e,o,{get:()=>t[o],enumerable:!(n=cu(t,o))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?uu(lu(e)):{},yn(t||!e||!e.__esModule?Ye(r,"default",{value:e,enumerable:!0}):r,e)),mu=e=>yn(Ye({},"__esModule",{value:!0}),e);var Bo=I((Fo,Vt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function g(u,d){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let y=0,f=-1,h=(u.match(l.zoneIndex)||[])[0],P,j;for(h&&(h=h.substring(1),u=u.replace(/%.+$/,""));(f=u.indexOf(":",f+1))>=0;)y++;if(u.substr(0,2)==="::"&&y--,u.substr(-2,2)==="::"&&y--,y>d)return null;for(j=d-y,P=":";j--;)P+="0:";return u=u.replace("::",P),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),d=(function(){let oe=u.split(":"),me=[];for(let Pe=0;Pe<oe.length;Pe++)me.push(parseInt(oe[Pe],16));return me})(),{parts:d,zoneId:h}}i(g,"expandIPv6");function _(u,d,y,f){if(u.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let h=0,P;for(;f>0;){if(P=y-f,P<0&&(P=0),u[h]>>P!==d[h]>>P)return!1;f-=y,h+=1}return!0}i(_,"matchCIDR");function v(u){if(o.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}i(v,"parseIntAuto");function $(u,d){for(;u.length<d;)u=`0${u}`;return u}i($,"padPart");let x={};x.IPv4=(function(){function u(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,f;for(y=0;y<d.length;y++)if(f=d[y],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return i(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return _(this.octets,d.octets,8,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},h,P,j;for(h=3;h>=0;h-=1)if(P=this.octets[h],P in f){if(j=f[P],y&&j!==0)return null;j!==8&&(y=!0),d+=j}else return null;return 32-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u})(),x.IPv4.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),h=[],P=0;for(;P<4;)h.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(h)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(u){return this.parser(u)!==null},x.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(u){return!!(x.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(u){let d=u.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(u)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(u){let d,y,f,h,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),h=[],y=0;y<4;)h.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(h)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(u){let d=this.parser(u);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(u){let d;if(d=u.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let f=[this.parse(d[1]),y];return Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(u){let d,y,f;if(d=u.match(r.fourOctet))return(function(){let h=d.slice(1,6),P=[];for(let j=0;j<h.length;j++)y=h[j],P.push(v(y));return P})();if(d=u.match(r.longValue)){if(f=v(d[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return(function(){let h=[],P;for(P=0;P<=24;P+=8)h.push(f>>P&255);return h})().reverse()}else return(d=u.match(r.twoOctet))?(function(){let h=d.slice(1,4),P=[];if(f=v(h[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return P.push(v(h[0])),P.push(f>>16&255),P.push(f>>8&255),P.push(f&255),P})():(d=u.match(r.threeOctet))?(function(){let h=d.slice(1,5),P=[];if(f=v(h[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return P.push(v(h[0])),P.push(v(h[1])),P.push(f>>8&255),P.push(f&255),P})():null},x.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<4&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.IPv6=(function(){function u(d,y){let f,h;if(d.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(d[f]<<8|d[f+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(h=this.parts[f],!(0<=h&&h<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return i(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return _(this.parts,d.parts,16,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={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},h,P;for(let j=7;j>=0;j-=1)if(h=this.parts[j],h in f){if(P=f[h],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let d,y=[],f=this.parts;for(let h=0;h<f.length;h++)d=f[h],y.push(d>>8),y.push(d&255);return y},u.prototype.toFixedLengthString=function(){let d=(function(){let f=[];for(let h=0;h<this.parts.length;h++)f.push($(this.parts[h].toString(16),4));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.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),y=d[0],f=d[1];return new x.IPv4([y>>8,y&255,f>>8,f&255])},u.prototype.toNormalizedString=function(){let d=(function(){let f=[];for(let h=0;h<this.parts.length;h++)f.push(this.parts[h].toString(16));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,h=-1,P;for(;P=d.exec(y);)P[0].length>h&&(f=P.index,h=P[0].length);return h<0?y:`${y.substring(0,f)}::${y.substring(f+h)}`},u.prototype.toString=function(){return this.toRFC5952String()},u})(),x.IPv6.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),h=[],P=0;for(;P<16;)h.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(h)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(u){return this.parser(u)!==null},x.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let d=this.parser(u);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(u){let d,y,f,h,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),h=[],y=0;y<16;)h.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(h)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},x.IPv6.parse=function(u){let d=this.parser(u);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(u){let d,y,f;if((y=u.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return f=[this.parse(y[1]),d],Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(u){let d,y,f,h,P,j;if(f=u.match(l.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(l.native.test(u))return g(u,8);if((f=u.match(l.transitional))&&(j=f[6]||"",d=f[1],f[1].endsWith("::")||(d=d.slice(0,-1)),d=g(d+j,6),d.parts)){for(P=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<P.length;y++)if(h=P[y],!(0<=h&&h<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>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],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<16&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.fromByteArray=function(u){let d=u.length;if(d===4)return new x.IPv4(u);if(d===16)return new x.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(u){return x.IPv6.isValid(u)||x.IPv4.isValid(u)},x.isValidCIDR=function(u){return x.IPv6.isValidCIDR(u)||x.IPv4.isValidCIDR(u)},x.parse=function(u){if(x.IPv6.isValid(u))return x.IPv6.parse(u);if(x.IPv4.isValid(u))return x.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(u){try{return x.IPv6.parseCIDR(u)}catch{try{return x.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(u){let d=this.parse(u);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(u,d,y){let f,h,P,j;y==null&&(y="unicast");for(h in d)if(Object.prototype.hasOwnProperty.call(d,h)){for(P=d[h],P[0]&&!(P[0]instanceof Array)&&(P=[P]),f=0;f<P.length;f++)if(j=P[f],u.kind()===j[0].kind()&&u.match.apply(u,j))return h}return y},typeof Vt<"u"&&Vt.exports?Vt.exports=x:e.ipaddr=x})(Fo)});var Gi=I((BA,Hi)=>{var Zi=require("stream").Stream,Xp=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=[]}i(ce,"DelayedStream");Xp.inherits(ce,Zi);ce.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ce.prototype,"readable",{configurable:!0,enumerable:!0,get:i(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=Zi.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((ZA,Ki)=>{var Yp=require("util"),qi=require("stream").Stream,Wi=Gi();Ki.exports=W;function W(){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}i(W,"CombinedStream");Yp.inherits(W,qi);W.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};W.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};W.prototype.append=function(e){var t=W.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};W.prototype.pipe=function(e,t){return qi.prototype.pipe.call(this,e,t),this.resume(),e};W.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}};W.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=W.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};W.prototype._pipeNext=function(e){this._currentStream=e;var t=W.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()};W.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};W.prototype.write=function(e){this.emit("data",e)};W.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};W.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")};W.prototype.end=function(){this._reset(),this.emit("end")};W.prototype.destroy=function(){this._reset(),this.emit("close")};W.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};W.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};W.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)};W.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Yi=I((GA,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 Kt=Yi(),Qp=require("path").extname,Qi=/^\s*([^;\s]*)(?:;|\s|$)/,el=/^text\//i;te.charset=ea;te.charsets={lookup:ea};te.contentType=tl;te.extension=rl;te.extensions=Object.create(null);te.lookup=nl;te.types=Object.create(null);ol(te.extensions,te.types);function ea(e){if(!e||typeof e!="string")return!1;var t=Qi.exec(e),r=t&&Kt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&el.test(t[1])?"UTF-8":!1}i(ea,"charset");function tl(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}i(tl,"contentType");function rl(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]}i(rl,"extension");function nl(e){if(!e||typeof e!="string")return!1;var t=Qp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}i(nl,"lookup");function ol(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Kt).forEach(i(function(o){var s=Kt[o],c=s.extensions;if(!(!c||!c.length)){e[o]=c;for(var l=0;l<c.length;l++){var g=c[l];if(t[g]){var _=r.indexOf(Kt[t[g]].source),v=r.indexOf(s.source);if(t[g]!=="application/octet-stream"&&(_>v||_===v&&t[g].substr(0,12)==="application/"))continue}t[g]=o}}},"forEachMimeType"))}i(ol,"populateMaps")});var na=I((KA,ra)=>{ra.exports=il;function il(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(il,"defer")});var Hr=I((XA,ia)=>{var oa=na();ia.exports=al;function al(e){var t=!1;return oa(function(){t=!0}),i(function(n,o){t?e(n,o):oa(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(al,"async")});var Gr=I((QA,aa)=>{aa.exports=sl;function sl(e){Object.keys(e.jobs).forEach(ul.bind(e)),e.jobs={}}i(sl,"abort");function ul(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(ul,"clean")});var Wr=I((tz,ua)=>{var sa=Hr(),cl=Gr();ua.exports=pl;function pl(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=ll(t,o,e[o],function(s,c){o in r.jobs&&(delete r.jobs[o],s?cl(r):r.results[o]=c,n(s,r.results))})}i(pl,"iterate");function ll(e,t,r,n){var o;return e.length==2?o=e(r,sa(n)):o=e(r,t,sa(n)),o}i(ll,"runJob")});var qr=I((nz,ca)=>{ca.exports=dl;function dl(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,s){return t(e[o],e[s])}),n}i(dl,"state")});var Kr=I((iz,pa)=>{var ml=Gr(),fl=Hr();pa.exports=gl;function gl(e){Object.keys(this.jobs).length&&(this.index=this.size,ml(this),fl(e)(null,this.results))}i(gl,"terminator")});var da=I((sz,la)=>{var yl=Wr(),hl=qr(),vl=Kr();la.exports=xl;function xl(e,t,r){for(var n=hl(e);n.index<(n.keyedList||e).length;)yl(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return vl.bind(n,r)}i(xl,"parallel")});var Jr=I((cz,Jt)=>{var ma=Wr(),_l=qr(),Pl=Kr();Jt.exports=bl;Jt.exports.ascending=fa;Jt.exports.descending=Tl;function bl(e,t,r,n){var o=_l(e,r);return ma(e,t,o,i(function s(c,l){if(c){n(c,l);return}if(o.index++,o.index<(o.keyedList||e).length){ma(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),Pl.bind(o,n)}i(bl,"serialOrdered");function fa(e,t){return e<t?-1:e>t?1:0}i(fa,"ascending");function Tl(e,t){return-1*fa(e,t)}i(Tl,"descending")});var ya=I((lz,ga)=>{var Il=Jr();ga.exports=El;function El(e,t,r){return Il(e,t,null,r)}i(El,"serial")});var va=I((mz,ha)=>{ha.exports={parallel:da(),serial:ya(),serialOrdered:Jr()}});var Xr=I((fz,xa)=>{"use strict";xa.exports=Object});var Pa=I((gz,_a)=>{"use strict";_a.exports=Error});var Ta=I((yz,ba)=>{"use strict";ba.exports=EvalError});var Ea=I((hz,Ia)=>{"use strict";Ia.exports=RangeError});var $a=I((vz,Sa)=>{"use strict";Sa.exports=ReferenceError});var za=I((xz,Aa)=>{"use strict";Aa.exports=SyntaxError});var Xt=I((_z,Oa)=>{"use strict";Oa.exports=TypeError});var ka=I((Pz,Ra)=>{"use strict";Ra.exports=URIError});var Da=I((bz,wa)=>{"use strict";wa.exports=Math.abs});var Ca=I((Tz,Na)=>{"use strict";Na.exports=Math.floor});var Ma=I((Iz,Ua)=>{"use strict";Ua.exports=Math.max});var ja=I((Ez,La)=>{"use strict";La.exports=Math.min});var Ba=I((Sz,Fa)=>{"use strict";Fa.exports=Math.pow});var Za=I(($z,Va)=>{"use strict";Va.exports=Math.round});var Ga=I((Az,Ha)=>{"use strict";Ha.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var qa=I((Oz,Wa)=>{"use strict";var Sl=Ga();Wa.exports=i(function(t){return Sl(t)||t===0?t:t<0?-1:1},"sign")});var Ja=I((kz,Ka)=>{"use strict";Ka.exports=Object.getOwnPropertyDescriptor});var Yr=I((wz,Xa)=>{"use strict";var Yt=Ja();if(Yt)try{Yt([],"length")}catch{Yt=null}Xa.exports=Yt});var Qa=I((Dz,Ya)=>{"use strict";var Qt=Object.defineProperty||!1;if(Qt)try{Qt({},"a",{value:1})}catch{Qt=!1}Ya.exports=Qt});var Qr=I((Nz,es)=>{"use strict";es.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var ns=I((Uz,rs)=>{"use strict";var ts=typeof Symbol<"u"&&Symbol,$l=Qr();rs.exports=i(function(){return typeof ts!="function"||typeof Symbol!="function"||typeof ts("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:$l()},"hasNativeSymbols")});var en=I((Lz,os)=>{"use strict";os.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var tn=I((jz,is)=>{"use strict";var Al=Xr();is.exports=Al.getPrototypeOf||null});var us=I((Fz,ss)=>{"use strict";var zl="Function.prototype.bind called on incompatible ",Ol=Object.prototype.toString,Rl=Math.max,kl="[object Function]",as=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),wl=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),Dl=i(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=i(function(t){var r=this;if(typeof r!="function"||Ol.apply(r)!==kl)throw new TypeError(zl+r);for(var n=wl(arguments,1),o,s=i(function(){if(this instanceof o){var v=r.apply(this,as(n,arguments));return Object(v)===v?v:this}return r.apply(t,as(n,arguments))},"binder"),c=Rl(0,r.length-n.length),l=[],g=0;g<c;g++)l[g]="$"+g;if(o=Function("binder","return function ("+Dl(l,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var _=i(function(){},"Empty");_.prototype=r.prototype,o.prototype=new _,_.prototype=null}return o},"bind")});var We=I((Vz,cs)=>{"use strict";var Nl=us();cs.exports=Function.prototype.bind||Nl});var er=I((Zz,ps)=>{"use strict";ps.exports=Function.prototype.call});var rn=I((Hz,ls)=>{"use strict";ls.exports=Function.prototype.apply});var ms=I((Gz,ds)=>{"use strict";ds.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var gs=I((Wz,fs)=>{"use strict";var Cl=We(),Ul=rn(),Ml=er(),Ll=ms();fs.exports=Ll||Cl.call(Ml,Ul)});var hs=I((qz,ys)=>{"use strict";var jl=We(),Fl=Xt(),Bl=er(),Vl=gs();ys.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new Fl("a function is required");return Vl(jl,Bl,t)},"callBindBasic")});var Ts=I((Jz,bs)=>{"use strict";var Zl=hs(),vs=Yr(),_s;try{_s=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var nn=!!_s&&vs&&vs(Object.prototype,"__proto__"),Ps=Object,xs=Ps.getPrototypeOf;bs.exports=nn&&typeof nn.get=="function"?Zl([nn.get]):typeof xs=="function"?i(function(t){return xs(t==null?t:Ps(t))},"getDunder"):!1});var As=I((Yz,$s)=>{"use strict";var Is=en(),Es=tn(),Ss=Ts();$s.exports=Is?i(function(t){return Is(t)},"getProto"):Es?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Es(t)},"getProto"):Ss?i(function(t){return Ss(t)},"getProto"):null});var on=I((eO,zs)=>{"use strict";var Hl=Function.prototype.call,Gl=Object.prototype.hasOwnProperty,Wl=We();zs.exports=Wl.call(Hl,Gl)});var Cs=I((tO,Ns)=>{"use strict";var M,ql=Xr(),Kl=Pa(),Jl=Ta(),Xl=Ea(),Yl=$a(),Xe=za(),Je=Xt(),Ql=ka(),ed=Da(),td=Ca(),rd=Ma(),nd=ja(),od=Ba(),id=Za(),ad=qa(),ws=Function,an=i(function(e){try{return ws('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),xt=Yr(),sd=Qa(),sn=i(function(){throw new Je},"throwTypeError"),ud=xt?(function(){try{return arguments.callee,sn}catch{try{return xt(arguments,"callee").get}catch{return sn}}})():sn,qe=ns()(),ee=As(),cd=tn(),pd=en(),Ds=rn(),_t=er(),Ke={},ld=typeof Uint8Array>"u"||!ee?M:ee(Uint8Array),Ce={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":qe&&ee?ee([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%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%":Kl,"%eval%":eval,"%EvalError%":Jl,"%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%":Ke,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qe&&ee?ee(ee([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qe||!ee?M:ee(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":ql,"%Object.getOwnPropertyDescriptor%":xt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":Xl,"%ReferenceError%":Yl,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qe||!ee?M:ee(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qe&&ee?ee(""[Symbol.iterator]()):M,"%Symbol%":qe?Symbol:M,"%SyntaxError%":Xe,"%ThrowTypeError%":ud,"%TypedArray%":ld,"%TypeError%":Je,"%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%":Ql,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":_t,"%Function.prototype.apply%":Ds,"%Object.defineProperty%":sd,"%Object.getPrototypeOf%":cd,"%Math.abs%":ed,"%Math.floor%":td,"%Math.max%":rd,"%Math.min%":nd,"%Math.pow%":od,"%Math.round%":id,"%Math.sign%":ad,"%Reflect.getPrototypeOf%":pd};if(ee)try{null.error}catch(e){Os=ee(ee(e)),Ce["%Error.prototype%"]=Os}var Os,dd=i(function e(t){var r;if(t==="%AsyncFunction%")r=an("async function () {}");else if(t==="%GeneratorFunction%")r=an("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=an("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&ee&&(r=ee(o.prototype))}return Ce[t]=r,r},"doEval"),Rs={__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"]},Pt=We(),tr=on(),md=Pt.call(_t,Array.prototype.concat),fd=Pt.call(Ds,Array.prototype.splice),ks=Pt.call(_t,String.prototype.replace),rr=Pt.call(_t,String.prototype.slice),gd=Pt.call(_t,RegExp.prototype.exec),yd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,hd=/\\(\\)?/g,vd=i(function(t){var r=rr(t,0,1),n=rr(t,-1);if(r==="%"&&n!=="%")throw new Xe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Xe("invalid intrinsic syntax, expected opening `%`");var o=[];return ks(t,yd,function(s,c,l,g){o[o.length]=l?ks(g,hd,"$1"):c||s}),o},"stringToPath"),xd=i(function(t,r){var n=t,o;if(tr(Rs,n)&&(o=Rs[n],n="%"+o[0]+"%"),tr(Ce,n)){var s=Ce[n];if(s===Ke&&(s=dd(n)),typeof s>"u"&&!r)throw new Je("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Xe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ns.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new Je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Je('"allowMissing" argument must be a boolean');if(gd(/^%?[^%]*%?$/,t)===null)throw new Xe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=vd(t),o=n.length>0?n[0]:"",s=xd("%"+o+"%",r),c=s.name,l=s.value,g=!1,_=s.alias;_&&(o=_[0],fd(n,md([0,1],_)));for(var v=1,$=!0;v<n.length;v+=1){var x=n[v],u=rr(x,0,1),d=rr(x,-1);if((u==='"'||u==="'"||u==="`"||d==='"'||d==="'"||d==="`")&&u!==d)throw new Xe("property names with quotes must have matching quotes");if((x==="constructor"||!$)&&(g=!0),o+="."+x,c="%"+o+"%",tr(Ce,c))l=Ce[c];else if(l!=null){if(!(x in l)){if(!r)throw new Je("base intrinsic for "+t+" exists, but the property is not available.");return}if(xt&&v+1>=n.length){var y=xt(l,x);$=!!y,$&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[x]}else $=tr(l,x),l=l[x];$&&!g&&(Ce[c]=l)}}return l},"GetIntrinsic")});var Ms=I((nO,Us)=>{"use strict";var _d=Qr();Us.exports=i(function(){return _d()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Fs=I((iO,js)=>{"use strict";var Pd=Cs(),Ls=Pd("%Object.defineProperty%",!0),bd=Ms()(),Td=on(),Id=Xt(),nr=bd?Symbol.toStringTag:null;js.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new Id("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");nr&&(n||!Td(t,nr))&&(Ls?Ls(t,nr,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[nr]=r)},"setToStringTag")});var Vs=I((sO,Bs)=>{"use strict";var Ed=Function.prototype.call,Sd=Object.prototype.hasOwnProperty,$d=We();Bs.exports=$d.call(Ed,Sd)});var Hs=I((uO,Zs)=>{"use strict";Zs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var qs=I((cO,Ws)=>{"use strict";var ln=Ji(),Ad=require("util"),un=require("path"),zd=require("http"),Od=require("https"),Rd=require("url").parse,kd=require("fs"),wd=require("stream").Stream,Dd=require("crypto"),cn=ta(),Nd=va(),Cd=Fs(),ke=Vs(),pn=Hs();function Gs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Gs,"escapeHeaderParam");function B(e){if(!(this instanceof B))return new B(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],ln.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(B,"FormData");Ad.inherits(B,ln);B.LINE_BREAK=`\r
|
|
2
|
+
`;B.DEFAULT_CONTENT_TYPE="application/octet-stream";B.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=ln.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(o),n(t),n(s),this._trackLength(o,t,r)};B.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)+B.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ke(t,"httpVersion"))&&!(t instanceof wd))&&(r.knownLength||this._valuesToMeasure.push(t))};B.prototype._lengthRetriever=function(e,t){ke(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):kd.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):ke(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ke(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};B.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),s="",c={"Content-Disposition":["form-data",'name="'+Gs(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&pn(c,r.header);var l;for(var g in c)if(ke(c,g)){if(l=c[g],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(s+=g+": "+l.join("; ")+B.LINE_BREAK)}return"--"+this.getBoundary()+B.LINE_BREAK+s+B.LINE_BREAK};B.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=un.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=un.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ke(e,"httpVersion")&&(r=un.basename(e.client._httpMessage.path||"")),r)return'filename="'+Gs(r)+'"'};B.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=cn.lookup(e.name)),!r&&e&&e.path&&(r=cn.lookup(e.path)),!r&&e&&e.readable&&ke(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=cn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=B.DEFAULT_CONTENT_TYPE),r};B.prototype._multiPartFooter=function(){return function(e){var t=B.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};B.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+B.LINE_BREAK};B.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ke(e,t)&&(r[t.toLowerCase()]=e[t]);return r};B.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};B.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};B.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(B.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};B.prototype._generateBoundary=function(){this._boundary="--------------------------"+Dd.randomBytes(12).toString("hex")};B.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};B.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};B.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}Nd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};B.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=Rd(e),n=pn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=pn(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Od.request(n):r=zd.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,g=i(function(_,v){return r.removeListener("error",g),r.removeListener("response",l),t.call(this,_,v)},"callback");l=g.bind(this,null),r.on("error",g),r.on("response",l)}}.bind(this)),r};B.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};B.prototype.toString=function(){return"[object FormData]"};Cd(B.prototype,"FormData");Ws.exports=B});var Gd={};gn(Gd,{reddit:()=>Hd});module.exports=mu(Gd);var fu=Object.freeze({status:"aborted"});function b(e,t,r){function n(l,g){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:g,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,g);let _=c.prototype,v=Object.keys(_);for(let $=0;$<v.length;$++){let x=v[$];x in l||(l[x]=_[x].bind(l))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(l){var g;let _=r?.Parent?new s:this;n(_,l),(g=_._zod).deferred??(g.deferred=[]);for(let v of _._zod.deferred)v();return _}return i(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:i(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}i(b,"$constructor");var pe=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Tt=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ir={};function ge(e){return e&&Object.assign(ir,e),ir}i(ge,"config");function sr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(sr,"getEnumValues");function vn(e,t){return typeof t=="bigint"?t.toString():t}i(vn,"jsonStringifyReplacer");function Et(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Et,"cached");function xn(e){return e==null}i(xn,"nullish");function St(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(St,"cleanRegex");var hn=Symbol("evaluating");function K(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==hn)return n===void 0&&(n=hn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(K,"defineLazy");var ur="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(Qe,"isObject");var gu=Et(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function _n(e){if(Qe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Qe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(_n,"isPlainObject");var Pn=new Set(["string","number","symbol"]);function Me(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Me,"escapeRegex");function $t(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i($t,"clone");function V(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>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:i(()=>t.error,"error")}:t}i(V,"normalizeParams");function bn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(bn,"optionalKeys");var Tn={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 Le(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}i(Le,"aborted");function Te(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Te,"prefixIssues");function It(e){return typeof e=="string"?e:e?.message}i(It,"unwrapMessage");function Ie(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(r.customError?.(e))??It(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Ie,"finalizeIssue");function In(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(In,"getLengthableOrigin");function cr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(cr,"issue");var En=i((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,vn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),Sn=b("$ZodError",En),et=b("$ZodError",En,{Parent:Error});var hu=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new pe;if(c.issues.length){let l=new(o?.Err??e)(c.issues.map(g=>Ie(g,s,ge())));throw ur(l,o?.callee),l}return c.value},"_parse"),At=hu(et),vu=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??e)(c.issues.map(g=>Ie(g,s,ge())));throw ur(l,o?.callee),l}return c.value},"_parseAsync"),zt=vu(et),xu=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new pe;return s.issues.length?{success:!1,error:new(e??Sn)(s.issues.map(c=>Ie(c,o,ge())))}:{success:!0,data:s.value}},"_safeParse"),tt=xu(et),_u=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>Ie(c,o,ge())))}:{success:!0,data:s.value}},"_safeParseAsync"),rt=_u(et);var Pu="(?:(?:\\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])))",bu=new RegExp(`^${Pu}$`);var $n=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),An=/^-?\d+n?$/,zn=/^-?\d+$/,pr=/^-?\d+(?:\.\d+)?$/,On=/^(?:true|false)$/i;var Ee=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Tu={number:"number",bigint:"bigint",object:"date"};var Rn=b("$ZodCheckGreaterThan",(e,t)=>{Ee.init(e,t);let r=Tu[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var kn=b("$ZodCheckNumberFormat",(e,t)=>{Ee.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=Tn[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,r&&(l.pattern=zn)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<o&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>s&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var wn=b("$ZodCheckMinLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!xn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let c=In(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var lr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Ee.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Dn=b("$ZodCheckRegex",(e,t)=>{lr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Cn={major:4,minor:3,patch:6};var G=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Cn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((c,l,g)=>{let _=Le(c),v;for(let $ of l){if($._zod.def.when){if(!$._zod.def.when(c))continue}else if(_)continue;let x=c.issues.length,u=$._zod.check(c);if(u instanceof Promise&&g?.async===!1)throw new pe;if(v||u instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await u,c.issues.length!==x&&(_||(_=Le(c,x)))});else{if(c.issues.length===x)continue;_||(_=Le(c,x))}}return v?v.then(()=>c):c},"runChecks"),s=i((c,l,g)=>{if(Le(c))return c.aborted=!0,c;let _=o(l,n,g);if(_ instanceof Promise){if(g.async===!1)throw new pe;return _.then(v=>e._zod.parse(v,g))}return e._zod.parse(_,g)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let _=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return _ instanceof Promise?_.then(v=>s(v,c,l)):s(_,c,l)}let g=e._zod.parse(c,l);if(g instanceof Promise){if(l.async===!1)throw new pe;return g.then(_=>o(_,n,l))}return o(g,n,l)}}K(e,"~standard",()=>({validate:i(o=>{try{let s=tt(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return rt(e,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),kt=b("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$n(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),dr=b("$ZodStringFormat",(e,t)=>{lr.init(e,t),kt.init(e,t)});var Fn=b("$ZodURL",(e,t)=>{dr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var mr=b("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??pr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),Bn=b("$ZodNumberFormat",(e,t)=>{kn.init(e,t),mr.init(e,t)}),fr=b("$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 o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Vn=b("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=An,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 Zn=b("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),Hn=b("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r});var Gn=b("$ZodVoid",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),Wn=b("$ZodDate",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Un(e,t,r){e.issues.length&&t.issues.push(...Te(r,e.issues)),t.value[r]=e.value}i(Un,"handleArrayResult");var qn=b("$ZodArray",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let c=0;c<o.length;c++){let l=o[c],g=t.element._zod.run({value:l,issues:[]},n);g instanceof Promise?s.push(g.then(_=>Un(_,r,c))):Un(g,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Rt(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Te(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(Rt,"handlePropertyResult");function Iu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=bn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(Iu,"normalizeDef");function Eu(e,t,r,n,o,s){let c=[],l=o.keySet,g=o.catchall._zod,_=g.def.type,v=g.optout==="optional";for(let $ in t){if(l.has($))continue;if(_==="never"){c.push($);continue}let x=g.run({value:t[$],issues:[]},n);x instanceof Promise?e.push(x.then(u=>Rt(u,r,$,t,v))):Rt(x,r,$,t,v)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i(Eu,"handleCatchall");var Kn=b("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let g={...l};return Object.defineProperty(t,"shape",{value:g}),g},"get")})}let n=Et(()=>Iu(t));K(e._zod,"propValues",()=>{let l=t.shape,g={};for(let _ in l){let v=l[_]._zod;if(v.values){g[_]??(g[_]=new Set);for(let $ of v.values)g[_].add($)}}return g});let o=Qe,s=t.catchall,c;e._zod.parse=(l,g)=>{c??(c=n.value);let _=l.value;if(!o(_))return l.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),l;l.value={};let v=[],$=c.shape;for(let x of c.keys){let u=$[x],d=u._zod.optout==="optional",y=u._zod.run({value:_[x],issues:[]},g);y instanceof Promise?v.push(y.then(f=>Rt(f,l,x,_,d))):Rt(y,l,x,_,d)}return s?Eu(v,_,l,g,n.value,e):v.length?Promise.all(v).then(()=>l):l}});function Mn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!Le(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(c=>Ie(c,n,ge())))}),t)}i(Mn,"handleUnionResults");var gr=b("$ZodUnion",(e,t)=>{G.init(e,t),K(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),K(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),K(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),K(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>St(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let c=!1,l=[];for(let g of t.options){let _=g._zod.run({value:o.value,issues:[]},s);if(_ instanceof Promise)l.push(_),c=!0;else{if(_.issues.length===0)return _;l.push(_)}}return c?Promise.all(l).then(g=>Mn(g,o,e,s)):Mn(l,o,e,s)}});var Jn=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gr.init(e,t);let r=e._zod.parse;K(e._zod,"propValues",()=>{let o={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[l,g]of Object.entries(c)){o[l]||(o[l]=new Set);for(let _ of g)o[l].add(_)}}return o});let n=Et(()=>{let o=t.options,s=new Map;for(let c of o){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let g of l){if(s.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);s.set(g,c)}}return s});e._zod.parse=(o,s)=>{let c=o.value;if(!Qe(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),o)}});var Xn=b("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!_n(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let _ of c)if(typeof _=="string"||typeof _=="number"||typeof _=="symbol"){l.add(typeof _=="number"?_.toString():_);let v=t.valueType._zod.run({value:o[_],issues:[]},n);v instanceof Promise?s.push(v.then($=>{$.issues.length&&r.issues.push(...Te(_,$.issues)),r.value[_]=$.value})):(v.issues.length&&r.issues.push(...Te(_,v.issues)),r.value[_]=v.value)}let g;for(let _ in o)l.has(_)||(g=g??[],g.push(_));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:g})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let g=t.keyType._zod.run({value:l,issues:[]},n);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&pr.test(l)&&g.issues.length){let $=t.keyType._zod.run({value:Number(l),issues:[]},n);if($ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");$.issues.length===0&&(g=$)}if(g.issues.length){t.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map($=>Ie($,n,ge())),input:l,path:[l],inst:e});continue}let v=t.valueType._zod.run({value:o[l],issues:[]},n);v instanceof Promise?s.push(v.then($=>{$.issues.length&&r.issues.push(...Te(l,$.issues)),r.value[g.value]=$.value})):(v.issues.length&&r.issues.push(...Te(l,v.issues)),r.value[g.value]=v.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Yn=b("$ZodEnum",(e,t)=>{G.init(e,t);let r=sr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Pn.has(typeof o)).map(o=>typeof o=="string"?Me(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),Qn=b("$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"?Me(n):n?Me(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var eo=b("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Tt(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new pe;return r.value=o,r}});function Ln(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Ln,"handleOptionalResult");var to=b("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",K(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),K(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Ln(s,r.value)):Ln(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var ro=b("$ZodNullable",(e,t)=>{G.init(e,t),K(e._zod,"optin",()=>t.innerType._zod.optin),K(e._zod,"optout",()=>t.innerType._zod.optout),K(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)}|null)$`):void 0}),K(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 no=b("$ZodPipe",(e,t)=>{G.init(e,t),K(e._zod,"values",()=>t.in._zod.values),K(e._zod,"optin",()=>t.in._zod.optin),K(e._zod,"optout",()=>t.out._zod.optout),K(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Ot(c,t.in,n)):Ot(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Ot(s,t.out,n)):Ot(o,t.out,n)}});function Ot(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(Ot,"handlePipeResult");var oo=b("$ZodCustom",(e,t)=>{Ee.init(e,t),G.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>jn(s,r,n,e));jn(o,r,n,e)}});function jn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(cr(o))}}i(jn,"handleRefineResult");var ao;var yr=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function so(){return new yr}i(so,"registry");(ao=globalThis).__zod_globalRegistry??(ao.__zod_globalRegistry=so());var hr=globalThis.__zod_globalRegistry;function uo(e,t){return new e({type:"string",...V(t)})}i(uo,"_string");function co(e,t){return new e({type:"string",coerce:!0,...V(t)})}i(co,"_coercedString");function po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}i(po,"_url");function lo(e,t){return new e({type:"number",checks:[],...V(t)})}i(lo,"_number");function mo(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}i(mo,"_coercedNumber");function fo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...V(t)})}i(fo,"_int");function go(e,t){return new e({type:"boolean",...V(t)})}i(go,"_boolean");function yo(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}i(yo,"_coercedBoolean");function ho(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}i(ho,"_coercedBigint");function vo(e){return new e({type:"any"})}i(vo,"_any");function xo(e){return new e({type:"unknown"})}i(xo,"_unknown");function _o(e,t){return new e({type:"void",...V(t)})}i(_o,"_void");function Po(e,t){return new e({type:"date",coerce:!0,...V(t)})}i(Po,"_coercedDate");function wt(e,t){return new Rn({check:"greater_than",...V(t),value:e,inclusive:!0})}i(wt,"_gte");function se(e,t){return new wn({check:"min_length",...V(t),minimum:e})}i(se,"_minLength");function Se(e,t){return new Dn({check:"string_format",format:"regex",...V(t),pattern:e})}i(Se,"_regex");function bo(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(bo,"_custom");var J=b("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)=>At(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>tt(e,r,n),e.parseAsync=async(r,n)=>zt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>rt(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)=>$t(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Nt=b("ZodMiniString",(e,t)=>{kt.init(e,t),J.init(e,t)});function a(e){return uo(Nt,e)}i(a,"string");var To=b("ZodMiniStringFormat",(e,t)=>{dr.init(e,t),Nt.init(e,t)});var Mu=b("ZodMiniURL",(e,t)=>{Fn.init(e,t),To.init(e,t)});function Io(e){return po(Mu,e)}i(Io,"url");var Ct=b("ZodMiniNumber",(e,t)=>{mr.init(e,t),J.init(e,t)});function Q(e){return lo(Ct,e)}i(Q,"number");var Lu=b("ZodMiniNumberFormat",(e,t)=>{Bn.init(e,t),Ct.init(e,t)});function Eo(e){return fo(Lu,e)}i(Eo,"int");var vr=b("ZodMiniBoolean",(e,t)=>{fr.init(e,t),J.init(e,t)});function F(e){return go(vr,e)}i(F,"boolean");var So=b("ZodMiniBigInt",(e,t)=>{Vn.init(e,t),J.init(e,t)});var ju=b("ZodMiniAny",(e,t)=>{Zn.init(e,t),J.init(e,t)});function ot(){return vo(ju)}i(ot,"any");var Fu=b("ZodMiniUnknown",(e,t)=>{Hn.init(e,t),J.init(e,t)});function D(){return xo(Fu)}i(D,"unknown");var Bu=b("ZodMiniVoid",(e,t)=>{Gn.init(e,t),J.init(e,t)});function $o(e){return _o(Bu,e)}i($o,"_void");var Ao=b("ZodMiniDate",(e,t)=>{Wn.init(e,t),J.init(e,t)});var Vu=b("ZodMiniArray",(e,t)=>{qn.init(e,t),J.init(e,t)});function z(e,t){return new Vu({type:"array",element:e,...V(t)})}i(z,"array");var Zu=b("ZodMiniObject",(e,t)=>{Kn.init(e,t),J.init(e,t),K(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...V(t)};return new Zu(r)}i(p,"object");var Hu=b("ZodMiniUnion",(e,t)=>{gr.init(e,t),J.init(e,t)});function U(e,t){return new Hu({type:"union",options:e,...V(t)})}i(U,"union");var Gu=b("ZodMiniDiscriminatedUnion",(e,t)=>{Jn.init(e,t),J.init(e,t)});function $e(e,t,r){return new Gu({type:"union",options:t,discriminator:e,...V(r)})}i($e,"discriminatedUnion");var Wu=b("ZodMiniRecord",(e,t)=>{Xn.init(e,t),J.init(e,t)});function N(e,t,r){return new Wu({type:"record",keyType:e,valueType:t,...V(r)})}i(N,"record");var qu=b("ZodMiniEnum",(e,t)=>{Yn.init(e,t),J.init(e,t),e.options=Object.values(t.entries)});function S(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new qu({type:"enum",entries:r,...V(t)})}i(S,"_enum");var Ku=b("ZodMiniLiteral",(e,t)=>{Qn.init(e,t),J.init(e,t)});function E(e,t){return new Ku({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}i(E,"literal");var Ju=b("ZodMiniTransform",(e,t)=>{eo.init(e,t),J.init(e,t)});function Ae(e){return new Ju({type:"transform",transform:e})}i(Ae,"transform");var Xu=b("ZodMiniOptional",(e,t)=>{to.init(e,t),J.init(e,t)});function m(e){return new Xu({type:"optional",innerType:e})}i(m,"optional");var Yu=b("ZodMiniNullable",(e,t)=>{ro.init(e,t),J.init(e,t)});function it(e){return new Yu({type:"nullable",innerType:e})}i(it,"nullable");var Qu=b("ZodMiniPipe",(e,t)=>{no.init(e,t),J.init(e,t)});function ze(e,t){return new Qu({type:"pipe",in:e,out:t})}i(ze,"pipe");var ec=b("ZodMiniCustom",(e,t)=>{oo.init(e,t),J.init(e,t)});function Ut(e,t){return bo(ec,e??(()=>!0),t)}i(Ut,"custom");var at={};gn(at,{bigint:()=>ac,boolean:()=>ic,date:()=>sc,number:()=>oc,string:()=>nc});function nc(e){return co(Nt,e)}i(nc,"string");function oc(e){return mo(Ct,e)}i(oc,"number");function ic(e){return yo(vr,e)}i(ic,"boolean");function ac(e){return ho(So,e)}i(ac,"bigint");function sc(e){return Po(Ao,e)}i(sc,"date");var _r=p({retryOnFailure:p({defaultValue:m(F()),hide:m(F())}),continueOnFailure:p({defaultValue:m(F()),hide:m(F())})}),xr=class{constructor(t,r,n,o,s,c,l,g,_,v,$,x,u){this.name=t;this.displayName=r;this.description=n;this.props=o;this.propertyGroups=s;this.run=c;this.test=l;this.requireAuth=g;this.errorHandlingOptions=_;this.outputSchema=v;this.audience=$;this.aiMetadata=x;this.classification=u}static{i(this,"IAction")}},X=i(e=>new xr(e.name,e.displayName,e.description,e.props,e.propertyGroups,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata,e.classification),"createAction");var L=p({displayName:a(),description:m(a()),advanced:m(F()),width:m(S(["half","full"])),icon:m(a()),placeholder:m(a())}),C=i((e,t)=>p({type:E(t),required:F(),defaultValue:m(ot())}),"TPropertyValue");var re=p({...L.shape,...C(a(),"SHORT_TEXT").shape}),ye=p({...L.shape,...C(a(),"LONG_TEXT").shape});var Oo=p({label:a(),value:D(),description:m(a()),icon:m(a())}),Mt=p({disabled:m(F()),placeholder:m(a()),options:z(Oo)});var cc=S(["cards"]),ne=p({...L.shape,options:Mt,display:m(cc),...C(D(),"STATIC_DROPDOWN").shape}),he=p({...L.shape,options:Mt,...C(z(D()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Pr=p({...L.shape,...C(D(),"DROPDOWN").shape,refreshers:z(a())}),st=p({...L.shape,...C(z(D()),"MULTI_SELECT_DROPDOWN").shape,refreshers:z(a())});var ve=p({...L.shape,reveals:m(z(a())),...C(F(),"CHECKBOX").shape});var xe=p({...L.shape,display:m(S(["stepper"])),min:m(Q()),max:m(Q()),step:m(Q()),...C(Q(),"NUMBER").shape});var ut=p({...L.shape,streaming:m(F()),...C(D(),"FILE").shape});var ct=p({...L.shape,...C(a(),"DATE_TIME").shape});var Ro=N(a(),U([re,ye,ne,st,he,ve,xe,ut,ct])),pt=p({...L.shape,properties:Ro,...C(z(D()),"ARRAY").shape});var ko=S(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),wo=p({preset:m(ko),after:m(a()),before:m(a())}),br=p({...L.shape,display:m(S(["dropdown"])),...C(wo,"DATE_RANGE").shape});var lt=p({...L.shape,...C(U([N(a(),D())]),"JSON").shape});var Do=U([re,ne,lt,pt,he]),pc=N(a(),Do),Tr=p({refreshers:z(a()),...L.shape,...C(D(),"DYNAMIC").shape});var Lt=p({...L.shape,...C($o(),"MARKDOWN").shape});var dt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(dt||{}),je=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(je||{}),Fe=(h=>(h.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",h.COMMUNICATION="COMMUNICATION",h.COMMERCE="COMMERCE",h.CORE="CORE",h.UNIVERSAL_AI="UNIVERSAL_AI",h.FLOW_CONTROL="FLOW_CONTROL",h.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",h.ACCOUNTING="ACCOUNTING",h.PRODUCTIVITY="PRODUCTIVITY",h.CONTENT_AND_FILES="CONTENT_AND_FILES",h.DEVELOPER_TOOLS="DEVELOPER_TOOLS",h.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",h.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",h.HUMAN_RESOURCES="HUMAN_RESOURCES",h.PAYMENT_PROCESSING="PAYMENT_PROCESSING",h.MARKETING="MARKETING",h.SALES_AND_CRM="SALES_AND_CRM",h))(Fe||{});var Be=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Be||{}),Ir="both_client_credentials_and_authorization_code";var we=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(we||{}),mt=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(mt||{}),lc=p({strategy:S(mt),paramName:m(a())}),ft=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ft||{});var jt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(jt||{}),No=p({status:m(Q()),body:m(D()),headers:m(N(a(),a()))}),Co=p({type:E("DELAY"),resumeDateTime:a(),requestIdToReply:m(a()),handlerId:m(a()),streamStepProgress:m(S(jt))}),Uo=p({type:E("WEBHOOK"),requestId:a(),requestIdToReply:m(a()),response:No,handlerId:m(a()),streamStepProgress:m(S(jt))}),dc=U([Co,Uo]);var mc=p({body:D(),rawBody:m(D()),headers:N(a(),a()),queryParams:N(a(),a())});function ue(e){return e==null}i(ue,"isNil");function gt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(gt,"isEmpty");function Ft(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(Ft,"assertNotNullOrUndefined");var Er=Ue(require("crypto"),1);var fc=128,Oe,Ve,gc=i(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*fc),Er.default.randomFillSync(Oe),Ve=0):Ve+e>Oe.length&&(Er.default.randomFillSync(Oe),Ve=0)}catch(t){throw Oe=void 0,t}Ve+=e},"fillPool"),yc=i(e=>(gc(e|=0),Oe.subarray(Ve-e,Ve)),"random"),hc=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(s=t)=>{if(s<=0)return"";let c="";for(;;){let l=r(o),g=o;for(;g--;)if(c+=e[l[g]&n]||"",c.length===s)return c}}},"customRandom"),Lo=i((e,t=21)=>hc(e,t,yc),"customAlphabet");var vc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",jo=21,Rb=a().check(Se(new RegExp(`^[0-9a-zA-Z]{${jo}}$`))),xc=Lo(vc,jo);var Re=ze(Ae(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:Re,updated:Re},H=i(e=>m(it(e)),"Nullable");function Sr(e){return m(it(S(e)))}i(Sr,"NullableEnum");var Db=ze(Ae(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),m(F())),Bt=i(e=>ze(Ae(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),m(z(e))),"OptionalArrayFromQuery");var Ub=N(a(),D());var yt=(v=>(v.OPENAI="openai",v.OPENROUTER="openrouter",v.ANTHROPIC="anthropic",v.AZURE="azure",v.GOOGLE="google",v.ACTIVEPIECES="activepieces",v.CLOUDFLARE_GATEWAY="cloudflare-gateway",v.CUSTOM="custom",v.BEDROCK="bedrock",v.MISTRAL="mistral",v))(yt||{});var Kb=a().check(Se(/^#[0-9A-Fa-f]{6}$/));var Xb=p({filename:a(),data:D(),type:E("file"),mimetype:m(a())});var _c=Ue(Bo());var oT=p({...ie,name:a(),permissions:z(a()),platformId:H(a()),type:a(),userCount:m(Q())});var Vo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Vo||{}),$r=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))($r||{}),Ar=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Ar||{});var zr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(zr||{});var Or=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Or||{});var Pc=p({mode:S(Vo),value:D()}),bc=p({auth:m(a()),fields:N(a(),Pc)}),Tc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:m(bc)}),Ic=p({type:E("PIECE"),toolName:a().check(se(1)),pieceMetadata:Tc}),Ec=p({type:E("none")}),Sc=p({type:E("access_token"),accessToken:a()}),$c=p({type:E("api_key"),apiKey:a(),apiKeyHeader:a()}),Ac=p({type:E("headers"),headers:N(a(),a())}),zc=$e("type",[Ec,Sc,$c,Ac]),Zo=p({type:E("FLOW"),toolName:a().check(se(1)),externalFlowId:a(),flowDisplayName:m(a())}),Ho=p({type:E("MCP"),toolName:a().check(se(1)),serverUrl:Io(),protocol:S(Ar),auth:zc}),Go=p({type:E("KNOWLEDGE_BASE"),toolName:a().check(se(1)),sourceType:S($r),sourceId:a(),sourceName:a()}),Oc=$e("type",[Ic,Zo,Ho,Go]),Rc=p({displayName:a(),description:m(a()),type:S(zr)}),Wo=p({type:E("MARKDOWN"),markdown:a()}),Ze={type:E("TOOL_CALL"),input:H(N(a(),D())),output:m(D()),toolName:a(),status:S(Or),toolCallId:a(),startTime:a(),endTime:m(a())},NT=p(Ze),qo=$e("toolCallType",[p({...Ze,toolCallType:E("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Ze,toolCallType:E("FLOW"),displayName:a(),externalFlowId:a()}),p({...Ze,toolCallType:E("MCP"),displayName:a(),serverUrl:a()}),p({...Ze,toolCallType:E("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Ze,toolCallType:E("UNKNOWN"),displayName:a()})]),kc=U([Wo,qo]);var Rr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Rr||{}),_e=p({apiKey:a()}),wc=_e,Dc=p({apiKey:a(),apiKeyHash:a()}),Nc=_e,Cc=_e,Uc=_e,Mc=_e,Lc=_e,jc=_e,Fc=_e,Qo=p({accessKeyId:a().check(se(1)),secretAccessKey:a().check(se(1))}),Bc=p({}),Vc=p({}),Zc=p({}),Hc=p({}),Gc=p({}),Wc=p({}),ei=p({modelId:a(),modelName:a(),modelType:S(Rr)}),ti=p({apiKeyHeader:a(),baseUrl:a(),models:z(ei),defaultHeaders:m(N(a(),a()))}),ri=p({accountId:a(),gatewayId:a(),models:z(ei),vertexProject:m(a()),vertexRegion:m(a())}),ni=p({resourceName:a(),apiVersion:ze(Ae(e=>typeof e=="string"&&e.trim().length===0?void 0:e),m(a()))}),oi=p({region:a().check(se(1))}),qc=U([wc,Uc,Mc,Lc,jc,Cc,Nc,Dc,Qo,Fc]),ii=U([ti,ri,ni,oi,Bc,Zc,Hc,Gc,Vc,Wc]),Kc=p({id:a(),name:a(),type:S(Rr)}),Jc=p({id:a(),name:a(),provider:S(yt),config:ii,enabledForChat:F()}),Xc=p({provider:S(yt),config:ii,auth:qc,platformId:a()});var LT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Ko=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Yc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Qc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Jo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],ep=["grok-4.20","grok-4.1-fast"],tp={openai:Ko,anthropic:Yc,google:Jo,activepieces:[...Qc.map(e=>`anthropic/${e}`),...Ko.map(e=>`openai/${e}`),...Jo.map(e=>`google/${e}`),...ep.map(e=>`x-ai/${e}`)]};var Xo=128e3,rp={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function np({provider:e}){return e?rp[e]??Xo:Xo}i(np,"getMaxContextTokens");var Yo={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"},op={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},ip=new Set(["anthropic","mistral"]);function le(e){return{chatModels:tp[e],maxContextTokens:np({provider:e}),defaultEmbeddingModel:Yo[e],supportsEmbedding:Yo[e]!==void 0,supportsImageGeneration:!ip.has(e),webSearch:op[e]}}i(le,"buildProviderCapabilities");var ap={openai:le("openai"),anthropic:le("anthropic"),openrouter:le("openrouter"),azure:le("azure"),google:le("google"),"cloudflare-gateway":le("cloudflare-gateway"),custom:le("custom"),bedrock:le("bedrock"),mistral:le("mistral"),activepieces:le("activepieces")};var sp=p({base64Url:a(),fileName:a(),extension:m(a())}),up=p({mimeType:a(),url:a(),fileName:m(a())}),kr=U([sp,up]);var cp=U([p({type:E("file"),value:kr}),p({type:E("markdown"),value:a(),files:m(z(kr))})]),pp=p({sessionId:a(),message:a(),files:m(z(a()))});var si=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(si||{}),ui=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ui||{}),wr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(wr||{});var lp=U([p({...ie,name:a(),externalId:a(),type:E("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:z(p({value:a()}))})}),p({...ie,name:a(),externalId:a(),type:U([E("TEXT"),E("NUMBER"),E("DATE"),E("DATETIME")]),tableId:a(),projectId:a()})]),dp=p({...ie,name:a(),folderId:H(a()),projectId:a(),externalId:a(),status:Sr(ui),trigger:Sr(si)}),mp=p({...ie,tableId:a(),projectId:a(),cells:N(a(),p({updated:a(),created:a(),value:D(),fieldName:a()}))}),fp=p({events:z(S(wr)),webhookUrl:a(),flowId:a()}),gp=p({fields:z(p({id:a(),name:a()})),rows:z(N(a(),a())),name:a()}),yp=p({projectId:a(),limit:m(at.number()),cursor:m(a()),name:m(a()),externalIds:Bt(a()),folderId:m(a()),folderIds:Bt(a())}),hp=p({records:z(z(p({fieldId:a(),value:pi()}))),tableId:a()}),vp=p({cells:m(z(p({fieldId:a(),value:pi()}))),tableId:a(),agentUpdate:m(F())}),ci=$e("operator",[De("eq"),De("neq"),De("gt"),De("gte"),De("lt"),De("lte"),De("co"),ai("exists"),ai("not_exists")]),xp=p({tableId:a(),limit:m(at.number()),cursor:m(a()),filters:Bt(ci)});function pi(){return ze(Ae(e=>e==null?e:String(e)),it(a()))}i(pi,"coerceToString");function De(e){return p({fieldId:a(),operator:E(e),value:a()})}i(De,"valueFilter");function ai(e){return p({fieldId:a(),operator:E(e)})}i(ai,"existenceFilter");var _p=p({status:m(Q()),body:m(D()),headers:m(N(a(),a()))}),Pp=p({...ie,deleted:H(Re),ownerId:a(),displayName:a(),platformId:a(),externalId:H(a())});var li=p({name:a(),description:m(a()),type:a(),required:F()}),bp=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:z(li),returnsResponse:F()})});var di="^[0-9]+\\.[0-9]+\\.[0-9]+$",oI=new RegExp(di),Ip="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",iI=a().check(Se(new RegExp(di))),aI=a().check(Se(new RegExp(Ip))),Ep=p({packageType:E("ARCHIVE"),pieceType:S(je),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),mi=p({packageType:E("REGISTRY"),pieceType:E("OFFICIAL"),pieceName:a(),pieceVersion:a()}),fi=p({packageType:E("REGISTRY"),pieceType:E("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),sI=U([mi,fi]),uI=U([Ep,mi,fi]);var Sp=$e("type",[p({type:E("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:E("INTERVAL"),intervalMs:Eo().check(wt(6e4))})]),cI=p({...ie,type:S(we),projectId:a(),flowId:a(),triggerName:a(),schedule:H(Sp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:H(a()),simulate:F()}),gi=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(gi||{}),yi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(yi||{}),hi=(r=>(r.S3="S3",r.DB="DB",r))(hi||{}),pI=p({...ie,projectId:H(a()),platformId:H(a()),type:S(gi),compression:S(yi),data:m(D()),location:S(hi),size:H(Q()),fileName:H(a()),s3Key:H(a()),metadata:H(N(a(),a()))}),vi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(vi||{}),xi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(xi||{}),lI=p({id:a(),email:a(),firstName:a(),status:S(xi),externalId:H(a()),platformId:H(a()),platformRole:S(vi),lastName:a(),created:Re,updated:Re,lastActiveDate:H(Re),imageUrl:H(a())});var Dr=p({...L.shape,...C(N(a(),D()),"OBJECT").shape});var Nr=p({...L.shape,formatProperty:m(a()),...C(a(),"RICH_TEXT").shape});var Ti=p({...L.shape,...C(a(),"COLOR").shape});var Cr=U([re,ye,Nr,Lt,ve,ne,he,Pr,st,Tr,xe,pt,Dr,lt,ct,br,ut,Ti]),O={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},RichText(e){return{...e,valueSchema:void 0,type:"RICH_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},DateRange(e){return{...e,valueSchema:void 0,type:"DATE_RANGE"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var de=p({displayName:a(),description:m(a()),hasConnectionIdentifier:m(F())});var Ii=p({username:a(),password:a()}),Ur=p({...de.shape,username:p({displayName:a(),description:m(a())}),password:p({displayName:a(),description:m(a())}),...C(Ii,"BASIC_AUTH").shape});var Op=N(a(),U([re,ye,xe,ve,ne])),Mr=p({...de.shape,props:Op,...C(D(),"CUSTOM_AUTH").shape});var Ne=p({...de.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var Rp=N(a(),U([re,ye,Ne,xe,ve,ne,he,Lt])),Ei=p({...de.shape,props:Rp,...C(D(),"OIDC").shape});var Zt=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Zt||{}),Si=U([re,Ne,ne]),$i=N(a(),Si),kp=p({props:m(N(a(),Si)),authUrl:a(),tokenUrl:a(),scope:z(a()),prompt:m(U([E("none"),E("consent"),E("login"),E("omit")])),pkce:m(F()),pkceMethod:m(U([E("plain"),E("S256")])),authorizationMethod:m(S(Zt)),grantType:m(U([S(Be),E(Ir)])),extra:m(N(a(),a()))}),Ai=p({access_token:a(),props:m($i),data:N(a(),ot())}),Lr=p({...de.shape,...kp.shape,...C(Ai,"OAUTH2").shape});var He=U([Ur,Mr,Ei,Lr,Ne]),ht="Connection",jr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||ht}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||ht,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||ht}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||ht}},None(){}};var qE={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var wp=p({...L.shape,...C(D(),"CUSTOM").shape,code:a()});var Dp=U([Cr,He]),Fr=N(a(),Dp),gS=N(a(),Cr);var zi=U([p({strategy:E("CRON"),cronExpression:a()}),p({strategy:E("NONE")})]);var Oi="2",Ht="0.82.0";var Br=class{constructor(t,r,n,o,s,c,l,g,_=Ht,v,$="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=g;this.minimumSupportedRelease=_;this.maximumSupportedRelease=v;this.description=$;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:Oi}),"getContextInfo");(!Cp(_)||Up(_,Ht))&&(this.minimumSupportedRelease=Ht),s.forEach(u=>this._actions[u.name]=u),c.forEach(u=>this._triggers[u.name]=u)}static{i(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:Np(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}},ki=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Br(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 Np(e){if(e!==void 0)return Array.isArray(e)?e.map(Ri):Ri(e)}i(Np,"withConnectionIdentifierFlag");function Ri(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}i(Ri,"flagConnectionIdentifier");function Cp(e){return/^\d+\.\d+\.\d+$/.test(e)}i(Cp,"isValidSimpleSemver");function Up(e,t){let[r,n,o]=e.split(".").map(Number),[s,c,l]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:o<l}i(Up,"isSemverLessThan");var Mp=m(N(a(),N(a(),a()))),wi=p({id:m(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:z(a()),platformId:m(a()),directoryPath:m(a()),auth:m(U([He,z(He)])),version:a(),categories:m(z(S(Fe))),minimumSupportedRelease:m(a()),maximumSupportedRelease:m(a()),deprecated:m(F()),i18n:Mp}),Lp=S(["human","ai","both"]),Di=p({description:m(a()),idempotent:m(F())}),Ni=S(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var jp=S(["tabs","section","summary","builder","footer"]),Ci=p({key:a(),display:jp,label:m(a()),description:m(a()),icon:m(a()),props:z(a())}),Ui=p({name:a(),displayName:a(),description:a(),props:Fr,propertyGroups:m(z(Ci)),requireAuth:F(),errorHandlingOptions:m(_r),outputSchema:m(Ut()),audience:m(Lp),aiMetadata:m(Di),classification:m(Ni)}),Mi=p({name:a(),displayName:a(),description:a(),props:Fr,propertyGroups:m(z(Ci)),errorHandlingOptions:m(_r),type:S(we),sampleData:D(),handshakeConfiguration:m(Ut()),renewConfiguration:m(zi),testStrategy:S(ft),outputSchema:m(Ut()),aiMetadata:m(Di),classification:m(Ni)}),Fp=p({...wi.shape,actions:N(a(),Ui),triggers:N(a(),Mi)}),Bp=p({...wi.shape,actions:Q(),triggers:Q(),suggestedActions:m(z(Ui)),suggestedTriggers:m(z(Mi))}),Li=p({projectUsage:Q(),pieceType:S(je),packageType:S(dt),platformId:m(a()),archiveId:m(a())}),h$=p({...Fp.shape,...Li.shape}),v$=p({...Bp.shape,...Li.shape}),x$=p({name:a(),version:a()});var Vp=Ue(require("path")),Zp=Ue(require("fs/promises"));var Ge=require("node:stream");var Gt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,c)=>{o.append(c,s)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Wt=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new Vr,r=new Zr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Vr=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Zr=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var vt=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(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 vt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}i(ji,"toFailsafeOutput");var ae=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(ae||{});var qt=class extends Gt{static{i(this,"FetchHttpClient")}constructor(t="",r=new Wt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[j,oe]of Object.entries(c))o.append(j,oe);let l=o.toString(),g=l?`${n}?${l}`:n,_=t.responseType??"json",v=t.followRedirects??!0,$=t.retries??0,{body:x,extraHeaders:u,isStream:d}=Hp(t.method)?Gp(t.body,s):{body:void 0,extraHeaders:{},isStream:!1},y=qp({...s,...u}),f=await Wp(async()=>{let j=new AbortController,oe=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let me={method:t.method.toString(),headers:y,body:x,redirect:v?"follow":"manual",signal:j.signal};return d&&(me.duplex="half"),r?.dispatcher!==void 0&&(me.dispatcher=r.dispatcher),await fetch(g,me)}finally{oe!==void 0&&clearTimeout(oe)}},d?0:$),h=v?300:400;if(f.status<200||f.status>=h){let j=await Fi(f,_==="stream"?"text":_),oe=new vt(t.body,{status:f.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",oe),oe}let P=await Fi(f,_);return{status:f.status,headers:Kp(f.headers),body:P}}};function Hp(e){return e!=="GET"&&e!=="HEAD"}i(Hp,"acceptsRequestBody");function Gp(e,t){if(Vi(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Jp(e)){let n=new Ge.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof Ge.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(Gp,"serializeBody");async function Fi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Vi(e.body)?Ge.Readable.from([]):Ge.Readable.fromWeb(e.body);case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(Fi,"parseResponseBody");async function Wp(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Bi(n);continue}return o}catch(o){if(r=o,n<t){await Bi(n);continue}throw o}throw r}i(Wp,"sendWithRetries");function Bi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Bi,"backoff");function qp(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}i(qp,"normalizeHeaders");function Kp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(Kp,"toHttpHeaders");function Jp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}i(Jp,"isNodeFormData");function Vi(e){return e==null}i(Vi,"isNil");var Y=new qt;var Ud=Ue(require("fs")),Ks=Ue(qs());var Md={"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 Ld(e){let t=e.split(";")[0].trim().toLowerCase();return Md[t]??""}i(Ld,"contentTypeToExtension");var jd=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Fd=i((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:o,name:s,props:c,extraProps:l,authLocation:g="headers",classification:_="WRITE"}){return X({audience:"human",name:s||"custom_api_call",classification:_,displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:O.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:v})=>({url:O.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Fd(t,v)}/resource or /resource`,required:!0,defaultValue:v?t(v):"",...c?.url??{}})}),"props")}),method:O.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(ae).map(v=>({label:v,value:v}))},...c?.method??{}}),headers:O.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:O.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:O.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:O.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:v})=>{if(!v)return{};let $=v,x={};switch($){case"none":break;case"json":x.data=O.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":x.data=O.LongText({displayName:"Raw Body",required:!0});break;case"form_data":x.data=O.Array({displayName:"Form Data",required:!0,properties:{fieldName:O.ShortText({displayName:"Field Name",required:!0}),fieldType:O.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:O.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:O.File({displayName:"File Field Value",required:!1})}});break}return x},"props")}),response_is_binary:O.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:O.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:O.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:O.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:i(async v=>{let{method:$,url:x,headers:u,queryParams:d,body:y,body_type:f,failsafe:h,timeout:P,response_is_binary:j,followRedirects:oe}=v.propsValue;Ft($,"Method"),Ft(x,"URL");let me=ue(r)?{}:await r(v.auth,v.propsValue),Pe=x.url,au=Pe.startsWith("http://")||Pe.startsWith("https://")?Pe:jd({baseUrl:t(v.auth),relativePath:Pe}),be={method:$,url:au,headers:{...u??{},...g==="headers"||!ue(g)?me:{}},queryParams:{...g==="queryParams"?me:{},...d??{}},timeout:P?P*1e3:0,followRedirects:oe};if(j&&(be.responseType="arraybuffer"),y)if(f&&f!=="none"){let fe=y.data;if(f==="form_data"){let su=fe,bt=new Ks.default;for(let{fieldName:dn,fieldType:mn,textFieldValue:fn,fileFieldValue:or}of su)mn==="text"&&!gt(fn)?bt.append(dn,fn):mn==="file"&&!gt(or)&&bt.append(dn,or.data,{filename:or?.filename});be.body=bt,be.headers={...be.headers,...bt.getHeaders()}}else be.body=fe}else f||(be.body=y);try{let fe=await Y.sendRequest(be);return await Bd(v.files,fe.body,fe.status,fe.headers,j)}catch(fe){if(h)return ji({error:fe,requestBody:be.body});throw fe}},"run")})}i(Js,"createCustomApiCallAction");var Bd=i(async(e,t,r,n,o)=>{let s;if(o&&Vd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Ld(c??"")||"txt",g;t instanceof ArrayBuffer?g=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?g=t:g=Buffer.from(t),s=await e.write({fileName:`output.${l}`,data:g})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),Vd=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Zd=`
|
|
4
4
|
To obtain your Reddit API credentials:
|
|
5
5
|
|
|
6
6
|
1. Go to https://www.reddit.com/prefs/apps.
|
|
@@ -13,7 +13,7 @@ To obtain your Reddit API credentials:
|
|
|
13
13
|
- redirect uri: as shown in Redirect URL field
|
|
14
14
|
5. Click "create app".
|
|
15
15
|
6. Note down the client ID (under the app name) and client secret.
|
|
16
|
-
`,q=Mr.OAuth2({description:Dd,authUrl:"https://www.reddit.com/api/v1/authorize",tokenUrl:"https://www.reddit.com/api/v1/access_token",required:!0,scope:["identity","read","submit","edit","history","flair"],authorizationMethod:"HEADER",extra:{grantType:"authorization_code",responseType:"code",duration:"permanent"}});var Hs=X({auth:q,name:"retrieveRedditPost",displayName:"Retrieve Post",description:"Fetch top posts in a subreddit with optional size limit.",audience:"both",aiMetadata:{description:"Lists posts from a given subreddit, choosing the listing via a category (hot, new, top, rising, or controversial). Use it to read or monitor a subreddit's feed rather than to look up one known post. Requires the subreddit name; an optional size caps how many posts are returned (max 100). Read-only and idempotent.",idempotent:!0},props:{post_category:S.StaticDropdown({displayName:"Post Category",description:"Select the category of posts to retrieve",required:!0,defaultValue:"hot",options:{options:[{label:"Hot",value:"hot"},{label:"New",value:"new"},{label:"Top",value:"top"},{label:"Rising",value:"rising"},{label:"Controversial",value:"controversial"}]}}),subreddit:S.ShortText({displayName:"Subreddit",description:"The subreddit to fetch posts from",required:!0}),size:S.Number({displayName:"Number of Posts",description:"Number of posts to fetch (max 100)",required:!1,defaultValue:10})},async run(e){let t=`https://oauth.reddit.com/r/${e.propsValue.subreddit}/${e.propsValue.post_category}`,r=e.propsValue.size||10,n=await Y.sendRequest({method:"GET",url:t,queryParams:{limit:r.toString()},headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/json"},timeout:5e3});if(n.status!==200)throw new Error(`Reddit API error: ${n.status} ${JSON.stringify(n.body)}`);return n.body}});var Gs=X({auth:q,name:"getRedditPostDetails",displayName:"Get Post Details",description:"Fetch detailed information about a specific Reddit post using its ID.",audience:"both",aiMetadata:{description:"Looks up one specific Reddit post by its ID and returns its full metadata (title, author, body, score, counts, flags). Use it when you already have a post ID and need details for that single post, not to browse a subreddit. Accepts the ID with or without the t3_ prefix. Read-only and idempotent.",idempotent:!0},props:{post_id:S.ShortText({displayName:"Post ID",description:'The ID of the Reddit post (e.g. "t3_abc123" or "abc123")',required:!0})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r=`https://oauth.reddit.com/api/info?id=t3_${t}`,n=await Y.sendRequest({method:"GET",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/json"},timeout:5e3});if(n.status!==200)return{error:`Failed to retrieve post details: ${n.status}`,details:n.body};let o=n.body?.data?.children??[];if(o.length===0)return{error:"No post found with the given ID"};let s=o[0].data,c={id:s.id,title:s.title,author:s.author,author_fullname:s.author_fullname,subreddit:s.subreddit,subreddit_id:s.subreddit_id,selftext:s.selftext,selftext_html:s.selftext_html,score:s.score,upvote_ratio:s.upvote_ratio,created_utc:s.created_utc,permalink:s.permalink,url:s.url,domain:s.domain,num_comments:s.num_comments,is_self:s.is_self,is_video:s.is_video,is_original_content:s.is_original_content,over_18:s.over_18,spoiler:s.spoiler,locked:s.locked,stickied:s.stickied,post_hint:s.post_hint};return s.media&&(c.media=s.media),s.gallery_data&&(c.gallery_data=s.gallery_data),c}});var Ws=X({auth:q,name:"createRedditPost",displayName:"Create Post",description:"Submit a new self (text) post to a subreddit.",audience:"both",aiMetadata:{description:"Submits a new self (text) post to a subreddit on behalf of the authenticated account. Use it to publish original text content; it cannot post links, images, or media. Requires the target subreddit, a title, and the text body. Not idempotent \u2014 each call creates a separate post.",idempotent:!1},props:{subreddit:S.ShortText({displayName:"Subreddit",description:"The subreddit to post in (without r/).",required:!0}),title:S.ShortText({displayName:"Title",description:"Title of the Reddit post.",required:!0}),content:S.LongText({displayName:"Content",description:"Text content of the post.",required:!0})},async run(e){let{subreddit:t,title:r,content:n}=e.propsValue,o="https://oauth.reddit.com/api/submit",s=new URLSearchParams({api_type:"json",sr:t,title:r,text:n,kind:"self"}),c=await Y.sendRequest({method:"POST",url:o,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:s.toString()});return c.status!==200?{error:`Failed to create post: ${c.status}`,details:c.body}:c.body}});var qs=X({auth:q,name:"createRedditComment",displayName:"Create Comment",description:"Comment on a Reddit post or reply to a comment.",audience:"both",aiMetadata:{description:"Posts a comment from the authenticated account, either as a top-level reply to a post or as a nested reply to another comment, determined by the parent ID type (t3_ for a post, t1_ for a comment). Requires the parent ID and the comment text. Not idempotent \u2014 each call creates a separate comment.",idempotent:!1},props:{parent_id:S.ShortText({displayName:"Parent ID",description:"ID of the post (t3_*) or comment (t1_*) to reply to.",required:!0}),content:S.LongText({displayName:"Comment Text",description:"Text of the comment.",required:!0})},async run(e){let t=e.propsValue.parent_id.trim();!t.startsWith("t1_")&&!t.startsWith("t3_")&&(t=`t3_${t}`);let r="https://oauth.reddit.com/api/comment",n=new URLSearchParams({thing_id:t,text:e.propsValue.content,api_type:"json"}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to create comment: ${o.status}`,details:o.body}:o.body}});var Ks=X({auth:q,name:"fetchPostComments",displayName:"Fetch Post Comments",description:"Fetch comments from a specific Reddit post.",audience:"both",aiMetadata:{description:"Retrieves the threaded comments of one Reddit post identified by its ID, including nested replies. Use it to read discussion on a known post; the sort option (new, top, hot, best, old, controversial) and a limit on top-level comments are configurable. Accepts the post ID with or without the t3_ prefix. Read-only and idempotent.",idempotent:!0},props:{post_id:S.ShortText({displayName:"Post ID",description:'The ID of the Reddit post (e.g. "abc123" or "t3_abc123").',required:!0}),sort:S.StaticDropdown({displayName:"Sort By",description:"Sorting method for comments",defaultValue:"new",required:!1,options:{options:[{label:"New",value:"new"},{label:"Top",value:"top"},{label:"Hot",value:"hot"},{label:"Best",value:"best"},{label:"Old",value:"old"},{label:"Controversial",value:"controversial"}]}}),limit:S.Number({displayName:"Limit",description:"Maximum number of top-level comments to fetch",defaultValue:10,required:!1})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r=await Y.sendRequest({method:"GET",url:`https://oauth.reddit.com/comments/${t}`,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/json"},queryParams:{sort:e.propsValue.sort??"new",limit:(e.propsValue.limit??10).toString()}});if(r.status!==200)return{error:`Failed to retrieve comments: ${r.status}`,details:r.body};function n(c){return c.filter(l=>l.kind==="t1").map(l=>{let f=l.data;return{id:f.id,author:f.author,body:f.body,score:f.score,created_utc:f.created_utc,permalink:f.permalink,edited:f.edited,is_submitter:f.is_submitter,stickied:f.stickied,replies:f.replies&&typeof f.replies=="object"?n(f.replies.data.children):[]}})}i(n,"processComments");let s=r.body[1]?.data?.children??[];return n(s)}});var Js=X({auth:q,name:"editRedditPost",displayName:"Edit Post",description:"Edits the content of an existing Reddit post.",audience:"both",aiMetadata:{description:"Replaces the text body of an existing self post owned by the authenticated account, identified by post ID. Use it to update a post you previously created; it only edits text posts, not link or media posts. Requires the post ID (with or without the t3_ prefix) and the new content. Idempotent \u2014 repeating with the same content leaves the post in the same state.",idempotent:!0},props:{post_id:S.ShortText({displayName:"Post ID",description:'ID of the Reddit post to edit (e.g., "abc123" or "t3_abc123").',required:!0}),content:S.LongText({displayName:"New Post Content",description:"Updated text content for the post.",required:!0})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/editusertext",n=new URLSearchParams({api_type:"json",thing_id:`t3_${t}`,text:e.propsValue.content}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to edit post: ${o.status}`,details:o.body}:o.body}});var Xs=X({auth:q,name:"editRedditComment",displayName:"Edit Comment",description:"Edits the content of an existing Reddit comment.",audience:"both",aiMetadata:{description:"Replaces the text of an existing comment owned by the authenticated account, identified by comment ID. Use it to update a comment you previously posted. Requires the comment ID (with or without the t1_ prefix) and the new content. Idempotent \u2014 repeating with the same content leaves the comment in the same state.",idempotent:!0},props:{comment_id:S.ShortText({displayName:"Comment ID",description:'ID of the Reddit comment to edit (e.g., "def456" or "t1_def456").',required:!0}),content:S.LongText({displayName:"New Comment Content",description:"Updated text content for the comment.",required:!0})},async run(e){let t=e.propsValue.comment_id.trim();t.startsWith("t1_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/editusertext",n=new URLSearchParams({api_type:"json",thing_id:`t1_${t}`,text:e.propsValue.content}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to edit comment: ${o.status}`,details:o.body}:o.body}});var Ys=X({auth:q,name:"deleteRedditPost",displayName:"Delete Post",description:"Delete a specific Reddit post by ID.",audience:"both",aiMetadata:{description:"Deletes a post owned by the authenticated account, identified by post ID. Use it to permanently remove a post you previously created. Requires the post ID (with or without the t3_ prefix). Idempotent \u2014 once deleted, repeating the call leaves the same end state.",idempotent:!0},props:{post_id:S.ShortText({displayName:"Post ID",description:'ID of the Reddit post to delete (e.g., "abc123" or "t3_abc123").',required:!0})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/del",n=new URLSearchParams({api_type:"json",id:`t3_${t}`}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to delete post: ${o.status}`,details:o.body}:{success:!0,response:o.body}}});var Qs=X({auth:q,name:"deleteRedditComment",displayName:"Delete Comment",description:"Delete a specific Reddit comment by ID.",audience:"both",aiMetadata:{description:"Deletes a comment owned by the authenticated account, identified by comment ID. Use it to permanently remove a comment you previously posted. Requires the comment ID (with or without the t1_ prefix). Idempotent \u2014 once deleted, repeating the call leaves the same end state.",idempotent:!0},props:{comment_id:S.ShortText({displayName:"Comment ID",description:'ID of the Reddit comment to delete (e.g., "def456" or "t1_def456").',required:!0})},async run(e){let t=e.propsValue.comment_id.trim();t.startsWith("t1_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/del",n=new URLSearchParams({api_type:"json",id:`t1_${t}`}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to delete comment: ${o.status}`,details:o.body}:{success:!0,response:o.body}}});var Cd=Ai({displayName:"Reddit",description:"Interact with Reddit - fetch and submit posts.",logoUrl:"https://cdn.activepieces.com/pieces/reddit.png",minimumSupportedRelease:"0.36.1",categories:["COMMUNICATION"],authors:["bhaviksingla1403"],auth:q,actions:[Hs,Gs,Ws,qs,Ks,Js,Xs,Ys,Qs,Vs({auth:q,baseUrl:i(()=>"https://oauth.reddit.com","baseUrl"),authMapping:i(async e=>({Authorization:`Bearer ${e.access_token}`,"User-Agent":"ActivePieces/1.0.0"}),"authMapping")})],triggers:[]});0&&(module.exports={reddit});
|
|
16
|
+
`,q=jr.OAuth2({description:Zd,authUrl:"https://www.reddit.com/api/v1/authorize",tokenUrl:"https://www.reddit.com/api/v1/access_token",required:!0,scope:["identity","read","submit","edit","history","flair"],authorizationMethod:"HEADER",extra:{grantType:"authorization_code",responseType:"code",duration:"permanent"}});var Xs=X({auth:q,name:"retrieveRedditPost",classification:"SEARCH",displayName:"Retrieve Post",description:"Fetch top posts in a subreddit with optional size limit.",audience:"both",aiMetadata:{description:"Lists posts from a given subreddit, choosing the listing via a category (hot, new, top, rising, or controversial). Use it to read or monitor a subreddit's feed rather than to look up one known post. Requires the subreddit name; an optional size caps how many posts are returned (max 100). Read-only and idempotent.",idempotent:!0},props:{post_category:O.StaticDropdown({displayName:"Post Category",description:"Select the category of posts to retrieve",required:!0,defaultValue:"hot",options:{options:[{label:"Hot",value:"hot"},{label:"New",value:"new"},{label:"Top",value:"top"},{label:"Rising",value:"rising"},{label:"Controversial",value:"controversial"}]}}),subreddit:O.ShortText({displayName:"Subreddit",description:"The subreddit to fetch posts from",required:!0}),size:O.Number({displayName:"Number of Posts",description:"Number of posts to fetch (max 100)",required:!1,defaultValue:10})},async run(e){let t=`https://oauth.reddit.com/r/${e.propsValue.subreddit}/${e.propsValue.post_category}`,r=e.propsValue.size||10,n=await Y.sendRequest({method:"GET",url:t,queryParams:{limit:r.toString()},headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/json"},timeout:5e3});if(n.status!==200)throw new Error(`Reddit API error: ${n.status} ${JSON.stringify(n.body)}`);return n.body}});var Ys=X({auth:q,name:"getRedditPostDetails",classification:"READ",displayName:"Get Post Details",description:"Fetch detailed information about a specific Reddit post using its ID.",audience:"both",aiMetadata:{description:"Looks up one specific Reddit post by its ID and returns its full metadata (title, author, body, score, counts, flags). Use it when you already have a post ID and need details for that single post, not to browse a subreddit. Accepts the ID with or without the t3_ prefix. Read-only and idempotent.",idempotent:!0},props:{post_id:O.ShortText({displayName:"Post ID",description:'The ID of the Reddit post (e.g. "t3_abc123" or "abc123")',required:!0})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r=`https://oauth.reddit.com/api/info?id=t3_${t}`,n=await Y.sendRequest({method:"GET",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/json"},timeout:5e3});if(n.status!==200)return{error:`Failed to retrieve post details: ${n.status}`,details:n.body};let o=n.body?.data?.children??[];if(o.length===0)return{error:"No post found with the given ID"};let s=o[0].data,c={id:s.id,title:s.title,author:s.author,author_fullname:s.author_fullname,subreddit:s.subreddit,subreddit_id:s.subreddit_id,selftext:s.selftext,selftext_html:s.selftext_html,score:s.score,upvote_ratio:s.upvote_ratio,created_utc:s.created_utc,permalink:s.permalink,url:s.url,domain:s.domain,num_comments:s.num_comments,is_self:s.is_self,is_video:s.is_video,is_original_content:s.is_original_content,over_18:s.over_18,spoiler:s.spoiler,locked:s.locked,stickied:s.stickied,post_hint:s.post_hint};return s.media&&(c.media=s.media),s.gallery_data&&(c.gallery_data=s.gallery_data),c}});var Qs=X({auth:q,name:"createRedditPost",classification:"WRITE",displayName:"Create Post",description:"Submit a new self (text) post to a subreddit.",audience:"both",aiMetadata:{description:"Submits a new self (text) post to a subreddit on behalf of the authenticated account. Use it to publish original text content; it cannot post links, images, or media. Requires the target subreddit, a title, and the text body. Not idempotent \u2014 each call creates a separate post.",idempotent:!1},props:{subreddit:O.ShortText({displayName:"Subreddit",description:"The subreddit to post in (without r/).",required:!0}),title:O.ShortText({displayName:"Title",description:"Title of the Reddit post.",required:!0}),content:O.LongText({displayName:"Content",description:"Text content of the post.",required:!0})},async run(e){let{subreddit:t,title:r,content:n}=e.propsValue,o="https://oauth.reddit.com/api/submit",s=new URLSearchParams({api_type:"json",sr:t,title:r,text:n,kind:"self"}),c=await Y.sendRequest({method:"POST",url:o,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:s.toString()});return c.status!==200?{error:`Failed to create post: ${c.status}`,details:c.body}:c.body}});var eu=X({auth:q,name:"createRedditComment",classification:"WRITE",displayName:"Create Comment",description:"Comment on a Reddit post or reply to a comment.",audience:"both",aiMetadata:{description:"Posts a comment from the authenticated account, either as a top-level reply to a post or as a nested reply to another comment, determined by the parent ID type (t3_ for a post, t1_ for a comment). Requires the parent ID and the comment text. Not idempotent \u2014 each call creates a separate comment.",idempotent:!1},props:{parent_id:O.ShortText({displayName:"Parent ID",description:"ID of the post (t3_*) or comment (t1_*) to reply to.",required:!0}),content:O.LongText({displayName:"Comment Text",description:"Text of the comment.",required:!0})},async run(e){let t=e.propsValue.parent_id.trim();!t.startsWith("t1_")&&!t.startsWith("t3_")&&(t=`t3_${t}`);let r="https://oauth.reddit.com/api/comment",n=new URLSearchParams({thing_id:t,text:e.propsValue.content,api_type:"json"}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to create comment: ${o.status}`,details:o.body}:o.body}});var tu=X({auth:q,name:"fetchPostComments",classification:"SEARCH",displayName:"Fetch Post Comments",description:"Fetch comments from a specific Reddit post.",audience:"both",aiMetadata:{description:"Retrieves the threaded comments of one Reddit post identified by its ID, including nested replies. Use it to read discussion on a known post; the sort option (new, top, hot, best, old, controversial) and a limit on top-level comments are configurable. Accepts the post ID with or without the t3_ prefix. Read-only and idempotent.",idempotent:!0},props:{post_id:O.ShortText({displayName:"Post ID",description:'The ID of the Reddit post (e.g. "abc123" or "t3_abc123").',required:!0}),sort:O.StaticDropdown({displayName:"Sort By",description:"Sorting method for comments",defaultValue:"new",required:!1,options:{options:[{label:"New",value:"new"},{label:"Top",value:"top"},{label:"Hot",value:"hot"},{label:"Best",value:"best"},{label:"Old",value:"old"},{label:"Controversial",value:"controversial"}]}}),limit:O.Number({displayName:"Limit",description:"Maximum number of top-level comments to fetch",defaultValue:10,required:!1})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r=await Y.sendRequest({method:"GET",url:`https://oauth.reddit.com/comments/${t}`,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/json"},queryParams:{sort:e.propsValue.sort??"new",limit:(e.propsValue.limit??10).toString()}});if(r.status!==200)return{error:`Failed to retrieve comments: ${r.status}`,details:r.body};function n(c){return c.filter(l=>l.kind==="t1").map(l=>{let g=l.data;return{id:g.id,author:g.author,body:g.body,score:g.score,created_utc:g.created_utc,permalink:g.permalink,edited:g.edited,is_submitter:g.is_submitter,stickied:g.stickied,replies:g.replies&&typeof g.replies=="object"?n(g.replies.data.children):[]}})}i(n,"processComments");let s=r.body[1]?.data?.children??[];return n(s)}});var ru=X({auth:q,name:"editRedditPost",classification:"WRITE",displayName:"Edit Post",description:"Edits the content of an existing Reddit post.",audience:"both",aiMetadata:{description:"Replaces the text body of an existing self post owned by the authenticated account, identified by post ID. Use it to update a post you previously created; it only edits text posts, not link or media posts. Requires the post ID (with or without the t3_ prefix) and the new content. Idempotent \u2014 repeating with the same content leaves the post in the same state.",idempotent:!0},props:{post_id:O.ShortText({displayName:"Post ID",description:'ID of the Reddit post to edit (e.g., "abc123" or "t3_abc123").',required:!0}),content:O.LongText({displayName:"New Post Content",description:"Updated text content for the post.",required:!0})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/editusertext",n=new URLSearchParams({api_type:"json",thing_id:`t3_${t}`,text:e.propsValue.content}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to edit post: ${o.status}`,details:o.body}:o.body}});var nu=X({auth:q,name:"editRedditComment",classification:"WRITE",displayName:"Edit Comment",description:"Edits the content of an existing Reddit comment.",audience:"both",aiMetadata:{description:"Replaces the text of an existing comment owned by the authenticated account, identified by comment ID. Use it to update a comment you previously posted. Requires the comment ID (with or without the t1_ prefix) and the new content. Idempotent \u2014 repeating with the same content leaves the comment in the same state.",idempotent:!0},props:{comment_id:O.ShortText({displayName:"Comment ID",description:'ID of the Reddit comment to edit (e.g., "def456" or "t1_def456").',required:!0}),content:O.LongText({displayName:"New Comment Content",description:"Updated text content for the comment.",required:!0})},async run(e){let t=e.propsValue.comment_id.trim();t.startsWith("t1_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/editusertext",n=new URLSearchParams({api_type:"json",thing_id:`t1_${t}`,text:e.propsValue.content}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to edit comment: ${o.status}`,details:o.body}:o.body}});var ou=X({auth:q,name:"deleteRedditPost",classification:"DESTRUCTIVE",displayName:"Delete Post",description:"Delete a specific Reddit post by ID.",audience:"both",aiMetadata:{description:"Deletes a post owned by the authenticated account, identified by post ID. Use it to permanently remove a post you previously created. Requires the post ID (with or without the t3_ prefix). Idempotent \u2014 once deleted, repeating the call leaves the same end state.",idempotent:!0},props:{post_id:O.ShortText({displayName:"Post ID",description:'ID of the Reddit post to delete (e.g., "abc123" or "t3_abc123").',required:!0})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/del",n=new URLSearchParams({api_type:"json",id:`t3_${t}`}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to delete post: ${o.status}`,details:o.body}:{success:!0,response:o.body}}});var iu=X({auth:q,name:"deleteRedditComment",classification:"DESTRUCTIVE",displayName:"Delete Comment",description:"Delete a specific Reddit comment by ID.",audience:"both",aiMetadata:{description:"Deletes a comment owned by the authenticated account, identified by comment ID. Use it to permanently remove a comment you previously posted. Requires the comment ID (with or without the t1_ prefix). Idempotent \u2014 once deleted, repeating the call leaves the same end state.",idempotent:!0},props:{comment_id:O.ShortText({displayName:"Comment ID",description:'ID of the Reddit comment to delete (e.g., "def456" or "t1_def456").',required:!0})},async run(e){let t=e.propsValue.comment_id.trim();t.startsWith("t1_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/del",n=new URLSearchParams({api_type:"json",id:`t1_${t}`}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to delete comment: ${o.status}`,details:o.body}:{success:!0,response:o.body}}});var Hd=ki({displayName:"Reddit",description:"Interact with Reddit - fetch and submit posts.",logoUrl:"https://cdn.activepieces.com/pieces/reddit.png",minimumSupportedRelease:"0.36.1",categories:["COMMUNICATION"],authors:["bhaviksingla1403"],auth:q,actions:[Xs,Ys,Qs,eu,tu,ru,nu,ou,iu,Js({auth:q,baseUrl:i(()=>"https://oauth.reddit.com","baseUrl"),authMapping:i(async e=>({Authorization:`Bearer ${e.access_token}`,"User-Agent":"ActivePieces/1.0.0"}),"authMapping")})],triggers:[]});0&&(module.exports={reddit});
|
|
17
17
|
/*! Bundled license information:
|
|
18
18
|
|
|
19
19
|
mime-types/index.js:
|