@activepieces/piece-descript 0.0.5 → 0.0.6
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,7 +1,7 @@
|
|
|
1
|
-
"use strict";var su=Object.create;var Qe=Object.defineProperty;var uu=Object.getOwnPropertyDescriptor;var cu=Object.getOwnPropertyNames;var pu=Object.getPrototypeOf,lu=Object.prototype.hasOwnProperty;var o=(e,t)=>Qe(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},vn=(e,t)=>{for(var r in t)Qe(e,r,{get:t[r],enumerable:!0})},xn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cu(t))!lu.call(e,i)&&i!==r&&Qe(e,i,{get:()=>t[i],enumerable:!(n=uu(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?su(pu(e)):{},xn(t||!e||!e.__esModule?Qe(r,"default",{value:e,enumerable:!0}):r,e)),du=e=>xn(Qe({},"__esModule",{value:!0}),e);var Vo=S((Bo,Ht)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let h=0,m=-1,x=(s.match(p.zoneIndex)||[])[0],P,M;for(x&&(x=x.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)h++;if(s.substr(0,2)==="::"&&h--,s.substr(-2,2)==="::"&&h--,h>d)return null;for(M=d-h,P=":";M--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let ne=s.split(":"),se=[];for(let Ye=0;Ye<ne.length;Ye++)se.push(parseInt(ne[Ye],16));return se})(),{parts:d,zoneId:x}}o(f,"expandIPv6");function g(s,d,h,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,P;for(;m>0;){if(P=h-m,P<0&&(P=0),s[x]>>P!==d[x]>>P)return!1;m-=h,x+=1}return!0}o(g,"matchCIDR");function y(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(y,"parseIntAuto");function b(s,d){for(;s.length<d;)s=`0${s}`;return s}o(b,"padPart");let _={};_.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let h,m;for(h=0;h<d.length;h++)if(m=d[h],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,h){let m;if(h===void 0&&(m=d,d=m[0],h=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,h)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,h=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,P,M;for(x=3;x>=0;x-=1)if(P=this.octets[x],P in m){if(M=m[P],h&&M!==0)return null;M!==8&&(h=!0),d+=M}else return null;return 32-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),_.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),h=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<4;)x.push(parseInt(h[P],10)|parseInt(m[P],10)^255),P++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(s){return this.parser(s)!==null},_.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(s){return!!(_.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(s)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(s){let d,h,m,x,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],h=0;h<4;)x.push(parseInt(m[h],10)&parseInt(P[h],10)),h++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let h=parseInt(d[2]);if(h>=0&&h<=32){let m=[this.parse(d[1]),h];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(s){let d,h,m;if(d=s.match(r.fourOctet))return(function(){let x=d.slice(1,6),P=[];for(let M=0;M<x.length;M++)h=x[M],P.push(y(h));return P})();if(d=s.match(r.longValue)){if(m=y(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],P;for(P=0;P<=24;P+=8)x.push(m>>P&255);return x})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let x=d.slice(1,4),P=[];if(m=y(x[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(y(x[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=s.match(r.threeOctet))?(function(){let x=d.slice(1,5),P=[];if(m=y(x[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(y(x[0])),P.push(y(x[1])),P.push(m>>8&255),P.push(m&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],h=0,m=Math.floor(s/8);for(;h<m;)d[h]=255,h++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.IPv6=(function(){function s(d,h){let m,x;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(x=this.parts[m],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");h&&(this.zoneId=h)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,h){let m;if(h===void 0&&(m=d,d=m[0],h=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,h)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,h=!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},x,P;for(let M=7;M>=0;M-=1)if(x=this.parts[M],x in m){if(P=m[x],h&&P!==0)return null;P!==16&&(h=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,h=[],m=this.parts;for(let x=0;x<m.length;x++)d=m[x],h.push(d>>8),h.push(d&255);return h},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(b(this.parts[x].toString(16),4));return m}).call(this).join(":"),h="";return this.zoneId&&(h=`%${this.zoneId}`),d+h},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),h=d[0],m=d[1];return new _.IPv4([h>>8,h&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(this.parts[x].toString(16));return m}).call(this).join(":"),h="";return this.zoneId&&(h=`%${this.zoneId}`),d+h},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,h=this.toNormalizedString(),m=0,x=-1,P;for(;P=d.exec(h);)P[0].length>x&&(m=P.index,x=P[0].length);return x<0?h:`${h.substring(0,m)}::${h.substring(m+x)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),_.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),h=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<16;)x.push(parseInt(h[P],10)|parseInt(m[P],10)^255),P++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(s){return this.parser(s)!==null},_.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(s){let d,h,m,x,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],h=0;h<16;)x.push(parseInt(m[h],10)&parseInt(P[h],10)),h++;return new this(x)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},_.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(s){let d,h,m;if((h=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(h[2]),d>=0&&d<=128))return m=[this.parse(h[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(s){let d,h,m,x,P,M;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return f(s,8);if((m=s.match(p.transitional))&&(M=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+M,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],h=0;h<P.length;h++)if(x=P[h],!(0<=x&&x<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0,m=Math.floor(s/8);for(;h<m;)d[h]=255,h++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.fromByteArray=function(s){let d=s.length;if(d===4)return new _.IPv4(s);if(d===16)return new _.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(s){return _.IPv6.isValid(s)||_.IPv4.isValid(s)},_.isValidCIDR=function(s){return _.IPv6.isValidCIDR(s)||_.IPv4.isValidCIDR(s)},_.parse=function(s){if(_.IPv6.isValid(s))return _.IPv6.parse(s);if(_.IPv4.isValid(s))return _.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(s){try{return _.IPv6.parseCIDR(s)}catch{try{return _.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(s,d,h){let m,x,P,M;h==null&&(h="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(P=d[x],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(M=P[m],s.kind()===M[0].kind()&&s.match.apply(s,M))return x}return h},typeof Ht<"u"&&Ht.exports?Ht.exports=_:e.ipaddr=_})(Bo)});var Hi=S(($$,Zi)=>{var Vi=require("stream").Stream,qp=require("util");Zi.exports=ce;function ce(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ce,"DelayedStream");qp.inherits(ce,Vi);ce.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ce.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ce.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ce.prototype.resume=function(){this._released||this.release(),this.source.resume()};ce.prototype.pause=function(){this.source.pause()};ce.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ce.prototype.pipe=function(){var e=Vi.prototype.pipe.apply(this,arguments);return this.resume(),e};ce.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};ce.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Ki=S((O$,qi)=>{var Kp=require("util"),Wi=require("stream").Stream,Gi=Hi();qi.exports=K;function K(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(K,"CombinedStream");Kp.inherits(K,Wi);K.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};K.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};K.prototype.append=function(e){var t=K.isStreamLike(e);if(t){if(!(e instanceof Gi)){var r=Gi.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};K.prototype.pipe=function(e,t){return Wi.prototype.pipe.call(this,e,t),this.resume(),e};K.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}};K.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=K.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};K.prototype._pipeNext=function(e){this._currentStream=e;var t=K.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()};K.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};K.prototype.write=function(e){this.emit("data",e)};K.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};K.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")};K.prototype.end=function(){this._reset(),this.emit("end")};K.prototype.destroy=function(){this._reset(),this.emit("close")};K.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};K.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};K.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)};K.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Xi=S((k$,Ji)=>{"use strict";Ji.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var ea=S(re=>{"use strict";var Jt=Xi(),Jp=require("path").extname,Yi=/^\s*([^;\s]*)(?:;|\s|$)/,Xp=/^text\//i;re.charset=Qi;re.charsets={lookup:Qi};re.contentType=Yp;re.extension=Qp;re.extensions=Object.create(null);re.lookup=el;re.types=Object.create(null);tl(re.extensions,re.types);function Qi(e){if(!e||typeof e!="string")return!1;var t=Yi.exec(e),r=t&&Jt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Xp.test(t[1])?"UTF-8":!1}o(Qi,"charset");function Yp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?re.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=re.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Yp,"contentType");function Qp(e){if(!e||typeof e!="string")return!1;var t=Yi.exec(e),r=t&&re.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Qp,"extension");function el(e){if(!e||typeof e!="string")return!1;var t=Jp("x."+e).toLowerCase().substr(1);return t&&re.types[t]||!1}o(el,"lookup");function tl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Jt).forEach(o(function(i){var u=Jt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var f=c[p];if(t[f]){var g=r.indexOf(Jt[t[f]].source),y=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(g>y||g===y&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(tl,"populateMaps")});var ra=S((D$,ta)=>{ta.exports=rl;function rl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(rl,"defer")});var Gr=S((U$,oa)=>{var na=ra();oa.exports=nl;function nl(e){var t=!1;return na(function(){t=!0}),o(function(n,i){t?e(n,i):na(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(nl,"async")});var Wr=S((M$,ia)=>{ia.exports=ol;function ol(e){Object.keys(e.jobs).forEach(il.bind(e)),e.jobs={}}o(ol,"abort");function il(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(il,"clean")});var qr=S((F$,sa)=>{var aa=Gr(),al=Wr();sa.exports=sl;function sl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=ul(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?al(r):r.results[i]=c,n(u,r.results))})}o(sl,"iterate");function ul(e,t,r,n){var i;return e.length==2?i=e(r,aa(n)):i=e(r,t,aa(n)),i}o(ul,"runJob")});var Kr=S((V$,ua)=>{ua.exports=cl;function cl(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(cl,"state")});var Jr=S((H$,ca)=>{var pl=Wr(),ll=Gr();ca.exports=dl;function dl(e){Object.keys(this.jobs).length&&(this.index=this.size,pl(this),ll(e)(null,this.results))}o(dl,"terminator")});var la=S((W$,pa)=>{var ml=qr(),fl=Kr(),gl=Jr();pa.exports=yl;function yl(e,t,r){for(var n=fl(e);n.index<(n.keyedList||e).length;)ml(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return gl.bind(n,r)}o(yl,"parallel")});var Xr=S((K$,Xt)=>{var da=qr(),hl=Kr(),vl=Jr();Xt.exports=xl;Xt.exports.ascending=ma;Xt.exports.descending=_l;function xl(e,t,r,n){var i=hl(e,r);return da(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){da(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),vl.bind(i,n)}o(xl,"serialOrdered");function ma(e,t){return e<t?-1:e>t?1:0}o(ma,"ascending");function _l(e,t){return-1*ma(e,t)}o(_l,"descending")});var ga=S((X$,fa)=>{var Pl=Xr();fa.exports=bl;function bl(e,t,r){return Pl(e,t,null,r)}o(bl,"serial")});var ha=S((Q$,ya)=>{ya.exports={parallel:la(),serial:ga(),serialOrdered:Xr()}});var Yr=S((ez,va)=>{"use strict";va.exports=Object});var _a=S((tz,xa)=>{"use strict";xa.exports=Error});var ba=S((rz,Pa)=>{"use strict";Pa.exports=EvalError});var Ta=S((nz,Ia)=>{"use strict";Ia.exports=RangeError});var Sa=S((oz,Ea)=>{"use strict";Ea.exports=ReferenceError});var $a=S((iz,Aa)=>{"use strict";Aa.exports=SyntaxError});var Yt=S((az,za)=>{"use strict";za.exports=TypeError});var wa=S((sz,Oa)=>{"use strict";Oa.exports=URIError});var Ra=S((uz,ka)=>{"use strict";ka.exports=Math.abs});var Da=S((cz,Na)=>{"use strict";Na.exports=Math.floor});var Ua=S((pz,Ca)=>{"use strict";Ca.exports=Math.max});var Ma=S((lz,ja)=>{"use strict";ja.exports=Math.min});var Fa=S((dz,La)=>{"use strict";La.exports=Math.pow});var Va=S((mz,Ba)=>{"use strict";Ba.exports=Math.round});var Ha=S((fz,Za)=>{"use strict";Za.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Wa=S((yz,Ga)=>{"use strict";var Il=Ha();Ga.exports=o(function(t){return Il(t)||t===0?t:t<0?-1:1},"sign")});var Ka=S((vz,qa)=>{"use strict";qa.exports=Object.getOwnPropertyDescriptor});var Qr=S((xz,Ja)=>{"use strict";var Qt=Ka();if(Qt)try{Qt([],"length")}catch{Qt=null}Ja.exports=Qt});var Ya=S((_z,Xa)=>{"use strict";var er=Object.defineProperty||!1;if(er)try{er({},"a",{value:1})}catch{er=!1}Xa.exports=er});var en=S((Pz,Qa)=>{"use strict";Qa.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var rs=S((Iz,ts)=>{"use strict";var es=typeof Symbol<"u"&&Symbol,Tl=en();ts.exports=o(function(){return typeof es!="function"||typeof Symbol!="function"||typeof es("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Tl()},"hasNativeSymbols")});var tn=S((Ez,ns)=>{"use strict";ns.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var rn=S((Sz,os)=>{"use strict";var El=Yr();os.exports=El.getPrototypeOf||null});var ss=S((Az,as)=>{"use strict";var Sl="Function.prototype.bind called on incompatible ",Al=Object.prototype.toString,$l=Math.max,zl="[object Function]",is=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Ol=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),wl=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");as.exports=o(function(t){var r=this;if(typeof r!="function"||Al.apply(r)!==zl)throw new TypeError(Sl+r);for(var n=Ol(arguments,1),i,u=o(function(){if(this instanceof i){var y=r.apply(this,is(n,arguments));return Object(y)===y?y:this}return r.apply(t,is(n,arguments))},"binder"),c=$l(0,r.length-n.length),p=[],f=0;f<c;f++)p[f]="$"+f;if(i=Function("binder","return function ("+wl(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var g=o(function(){},"Empty");g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},"bind")});var We=S((zz,us)=>{"use strict";var kl=ss();us.exports=Function.prototype.bind||kl});var tr=S((Oz,cs)=>{"use strict";cs.exports=Function.prototype.call});var nn=S((wz,ps)=>{"use strict";ps.exports=Function.prototype.apply});var ds=S((kz,ls)=>{"use strict";ls.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var fs=S((Rz,ms)=>{"use strict";var Rl=We(),Nl=nn(),Dl=tr(),Cl=ds();ms.exports=Cl||Rl.call(Dl,Nl)});var ys=S((Nz,gs)=>{"use strict";var Ul=We(),jl=Yt(),Ml=tr(),Ll=fs();gs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new jl("a function is required");return Ll(Ul,Ml,t)},"callBindBasic")});var bs=S((Cz,Ps)=>{"use strict";var Fl=ys(),hs=Qr(),xs;try{xs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var on=!!xs&&hs&&hs(Object.prototype,"__proto__"),_s=Object,vs=_s.getPrototypeOf;Ps.exports=on&&typeof on.get=="function"?Fl([on.get]):typeof vs=="function"?o(function(t){return vs(t==null?t:_s(t))},"getDunder"):!1});var As=S((jz,Ss)=>{"use strict";var Is=tn(),Ts=rn(),Es=bs();Ss.exports=Is?o(function(t){return Is(t)},"getProto"):Ts?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ts(t)},"getProto"):Es?o(function(t){return Es(t)},"getProto"):null});var an=S((Lz,$s)=>{"use strict";var Bl=Function.prototype.call,Vl=Object.prototype.hasOwnProperty,Zl=We();$s.exports=Zl.call(Bl,Vl)});var Ds=S((Fz,Ns)=>{"use strict";var j,Hl=Yr(),Gl=_a(),Wl=ba(),ql=Ta(),Kl=Sa(),Xe=$a(),Je=Yt(),Jl=wa(),Xl=Ra(),Yl=Da(),Ql=Ua(),ed=Ma(),td=Fa(),rd=Va(),nd=Wa(),ks=Function,sn=o(function(e){try{return ks('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Pt=Qr(),od=Ya(),un=o(function(){throw new Je},"throwTypeError"),id=Pt?(function(){try{return arguments.callee,un}catch{try{return Pt(arguments,"callee").get}catch{return un}}})():un,qe=rs()(),Q=As(),ad=rn(),sd=tn(),Rs=nn(),bt=tr(),Ke={},ud=typeof Uint8Array>"u"||!Q?j:Q(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?j:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?j:ArrayBuffer,"%ArrayIteratorPrototype%":qe&&Q?Q([][Symbol.iterator]()):j,"%AsyncFromSyncIteratorPrototype%":j,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?j:Atomics,"%BigInt%":typeof BigInt>"u"?j:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?j:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?j:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?j:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Gl,"%eval%":eval,"%EvalError%":Wl,"%Float16Array%":typeof Float16Array>"u"?j:Float16Array,"%Float32Array%":typeof Float32Array>"u"?j:Float32Array,"%Float64Array%":typeof Float64Array>"u"?j:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?j:FinalizationRegistry,"%Function%":ks,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?j:Int8Array,"%Int16Array%":typeof Int16Array>"u"?j:Int16Array,"%Int32Array%":typeof Int32Array>"u"?j:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qe&&Q?Q(Q([][Symbol.iterator]())):j,"%JSON%":typeof JSON=="object"?JSON:j,"%Map%":typeof Map>"u"?j:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qe||!Q?j:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Hl,"%Object.getOwnPropertyDescriptor%":Pt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?j:Promise,"%Proxy%":typeof Proxy>"u"?j:Proxy,"%RangeError%":ql,"%ReferenceError%":Kl,"%Reflect%":typeof Reflect>"u"?j:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?j:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qe||!Q?j:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?j:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qe&&Q?Q(""[Symbol.iterator]()):j,"%Symbol%":qe?Symbol:j,"%SyntaxError%":Xe,"%ThrowTypeError%":id,"%TypedArray%":ud,"%TypeError%":Je,"%Uint8Array%":typeof Uint8Array>"u"?j:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?j:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?j:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?j:Uint32Array,"%URIError%":Jl,"%WeakMap%":typeof WeakMap>"u"?j:WeakMap,"%WeakRef%":typeof WeakRef>"u"?j:WeakRef,"%WeakSet%":typeof WeakSet>"u"?j:WeakSet,"%Function.prototype.call%":bt,"%Function.prototype.apply%":Rs,"%Object.defineProperty%":od,"%Object.getPrototypeOf%":ad,"%Math.abs%":Xl,"%Math.floor%":Yl,"%Math.max%":Ql,"%Math.min%":ed,"%Math.pow%":td,"%Math.round%":rd,"%Math.sign%":nd,"%Reflect.getPrototypeOf%":sd};if(Q)try{null.error}catch(e){zs=Q(Q(e)),Ne["%Error.prototype%"]=zs}var zs,cd=o(function e(t){var r;if(t==="%AsyncFunction%")r=sn("async function () {}");else if(t==="%GeneratorFunction%")r=sn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=sn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Q&&(r=Q(i.prototype))}return Ne[t]=r,r},"doEval"),Os={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},It=We(),rr=an(),pd=It.call(bt,Array.prototype.concat),ld=It.call(Rs,Array.prototype.splice),ws=It.call(bt,String.prototype.replace),nr=It.call(bt,String.prototype.slice),dd=It.call(bt,RegExp.prototype.exec),md=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fd=/\\(\\)?/g,gd=o(function(t){var r=nr(t,0,1),n=nr(t,-1);if(r==="%"&&n!=="%")throw new Xe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Xe("invalid intrinsic syntax, expected opening `%`");var i=[];return ws(t,md,function(u,c,p,f){i[i.length]=p?ws(f,fd,"$1"):c||u}),i},"stringToPath"),yd=o(function(t,r){var n=t,i;if(rr(Os,n)&&(i=Os[n],n="%"+i[0]+"%"),rr(Ne,n)){var u=Ne[n];if(u===Ke&&(u=cd(n)),typeof u>"u"&&!r)throw new Je("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Xe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ns.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Je('"allowMissing" argument must be a boolean');if(dd(/^%?[^%]*%?$/,t)===null)throw new Xe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=gd(t),i=n.length>0?n[0]:"",u=yd("%"+i+"%",r),c=u.name,p=u.value,f=!1,g=u.alias;g&&(i=g[0],ld(n,pd([0,1],g)));for(var y=1,b=!0;y<n.length;y+=1){var _=n[y],s=nr(_,0,1),d=nr(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Xe("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(f=!0),i+="."+_,c="%"+i+"%",rr(Ne,c))p=Ne[c];else if(p!=null){if(!(_ in p)){if(!r)throw new Je("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pt&&y+1>=n.length){var h=Pt(p,_);b=!!h,b&&"get"in h&&!("originalValue"in h.get)?p=h.get:p=p[_]}else b=rr(p,_),p=p[_];b&&!f&&(Ne[c]=p)}}return p},"GetIntrinsic")});var Us=S((Vz,Cs)=>{"use strict";var hd=en();Cs.exports=o(function(){return hd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ls=S((Hz,Ms)=>{"use strict";var vd=Ds(),js=vd("%Object.defineProperty%",!0),xd=Us()(),_d=an(),Pd=Yt(),or=xd?Symbol.toStringTag:null;Ms.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new Pd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");or&&(n||!_d(t,or))&&(js?js(t,or,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[or]=r)},"setToStringTag")});var Bs=S((Wz,Fs)=>{"use strict";var bd=Function.prototype.call,Id=Object.prototype.hasOwnProperty,Td=We();Fs.exports=Td.call(bd,Id)});var Zs=S((qz,Vs)=>{"use strict";Vs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Ws=S((Kz,Gs)=>{"use strict";var dn=Ki(),Ed=require("util"),cn=require("path"),Sd=require("http"),Ad=require("https"),$d=require("url").parse,zd=require("fs"),Od=require("stream").Stream,wd=require("crypto"),pn=ea(),kd=ha(),Rd=Ls(),Oe=Bs(),ln=Zs();function Hs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Hs,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],dn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");Ed.inherits(L,dn);L.LINE_BREAK=`\r
|
|
2
|
-
`;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=dn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Oe(t,"httpVersion"))&&!(t instanceof Od))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){Oe(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):zd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Oe(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Oe(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Hs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&ln(c,r.header);var p;for(var f in c)if(Oe(c,f)){if(p=c[f],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=f+": "+p.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=cn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=cn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Oe(e,"httpVersion")&&(r=cn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Hs(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=pn.lookup(e.name)),!r&&e&&e.path&&(r=pn.lookup(e.path)),!r&&e&&e.readable&&Oe(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=pn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Oe(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+wd.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}kd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=$d(e),n=ln({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=ln(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Ad.request(n):r=Sd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,f=o(function(g,y){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,g,y)},"callback");p=f.bind(this,null),r.on("error",f),r.on("response",p)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};Rd(L.prototype,"FormData");Gs.exports=L});var Wd={};vn(Wd,{descript:()=>Gd,descriptAuth:()=>G});module.exports=du(Wd);var mu=Object.freeze({status:"aborted"});function T(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let g=c.prototype,y=Object.keys(g);for(let b=0;b<y.length;b++){let _=y[b];_ in p||(p[_]=g[_].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var f;let g=r?.Parent?new u:this;n(g,p),(f=g._zod).deferred??(f.deferred=[]);for(let y of g._zod.deferred)y();return g}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var pe=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Et=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},sr={};function fe(e){return e&&Object.assign(sr,e),sr}o(fe,"config");function cr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(cr,"getEnumValues");function Pn(e,t){return typeof t=="bigint"?t.toString():t}o(Pn,"jsonStringifyReplacer");function At(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(At,"cached");function bn(e){return e==null}o(bn,"nullish");function $t(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o($t,"cleanRegex");var _n=Symbol("evaluating");function J(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==_n)return n===void 0&&(n=_n,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(J,"defineLazy");var pr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(et,"isObject");var fu=At(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function In(e){if(et(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(et(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(In,"isPlainObject");var Tn=new Set(["string","number","symbol"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ue,"escapeRegex");function zt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(zt,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(Z,"normalizeParams");function En(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(En,"optionalKeys");var Sn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function je(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(je,"aborted");function Pe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Pe,"prefixIssues");function St(e){return typeof e=="string"?e:e?.message}o(St,"unwrapMessage");function be(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=St(e.inst?._zod.def?.error?.(e))??St(t?.error?.(e))??St(r.customError?.(e))??St(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(be,"finalizeIssue");function An(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(An,"getLengthableOrigin");function lr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(lr,"issue");var $n=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Pn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),zn=T("$ZodError",$n),tt=T("$ZodError",$n,{Parent:Error});var yu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new pe;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>be(f,u,fe())));throw pr(p,i?.callee),p}return c.value},"_parse"),Ot=yu(tt),hu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>be(f,u,fe())));throw pr(p,i?.callee),p}return c.value},"_parseAsync"),wt=hu(tt),vu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new pe;return u.issues.length?{success:!1,error:new(e??zn)(u.issues.map(c=>be(c,i,fe())))}:{success:!0,data:u.value}},"_safeParse"),rt=vu(tt),xu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>be(c,i,fe())))}:{success:!0,data:u.value}},"_safeParseAsync"),nt=xu(tt);var _u="(?:(?:\\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])))",Pu=new RegExp(`^${_u}$`);var On=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),wn=/^-?\d+n?$/,kn=/^-?\d+$/,dr=/^-?\d+(?:\.\d+)?$/,Rn=/^(?:true|false)$/i;var Ie=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),bu={number:"number",bigint:"bigint",object:"date"};var Nn=T("$ZodCheckGreaterThan",(e,t)=>{Ie.init(e,t);let r=bu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Dn=T("$ZodCheckNumberFormat",(e,t)=>{Ie.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Sn[t.format];e._zod.onattach.push(c=>{let p=c._zod.bag;p.format=t.format,p.minimum=i,p.maximum=u,r&&(p.pattern=kn)}),e._zod.check=c=>{let p=c.value;if(r){if(!Number.isInteger(p)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?c.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}p<i&&c.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>u&&c.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Cn=T("$ZodCheckMinLength",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!bn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=An(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var mr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Ie.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Un=T("$ZodCheckRegex",(e,t)=>{mr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Mn={major:4,minor:3,patch:6};var W=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Mn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,p,f)=>{let g=je(c),y;for(let b of p){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(g)continue;let _=c.issues.length,s=b._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new pe;if(y||s instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await s,c.issues.length!==_&&(g||(g=je(c,_)))});else{if(c.issues.length===_)continue;g||(g=je(c,_))}}return y?y.then(()=>c):c},"runChecks"),u=o((c,p,f)=>{if(je(c))return c.aborted=!0,c;let g=i(p,n,f);if(g instanceof Promise){if(f.async===!1)throw new pe;return g.then(y=>e._zod.parse(y,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(y=>u(y,c,p)):u(g,c,p)}let f=e._zod.parse(c,p);if(f instanceof Promise){if(p.async===!1)throw new pe;return f.then(g=>i(g,n,p))}return i(f,n,p)}}J(e,"~standard",()=>({validate:o(i=>{try{let u=rt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return nt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nt=T("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??On(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),fr=T("$ZodStringFormat",(e,t)=>{mr.init(e,t),Nt.init(e,t)});var Zn=T("$ZodURL",(e,t)=>{fr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var gr=T("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??dr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),Hn=T("$ZodNumberFormat",(e,t)=>{Dn.init(e,t),gr.init(e,t)}),yr=T("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=Rn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Gn=T("$ZodBigInt",(e,t)=>{W.init(e,t),e._zod.pattern=wn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Wn=T("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),qn=T("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r});var Kn=T("$ZodVoid",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Jn=T("$ZodDate",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Ln(e,t,r){e.issues.length&&t.issues.push(...Pe(r,e.issues)),t.value[r]=e.value}o(Ln,"handleArrayResult");var Xn=T("$ZodArray",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let p=i[c],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?u.push(f.then(g=>Ln(g,r,c))):Ln(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Rt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Pe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(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=En(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Iu,"normalizeDef");function Tu(e,t,r,n,i,u){let c=[],p=i.keySet,f=i.catchall._zod,g=f.def.type,y=f.optout==="optional";for(let b in t){if(p.has(b))continue;if(g==="never"){c.push(b);continue}let _=f.run({value:t[b],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>Rt(s,r,b,t,y))):Rt(_,r,b,t,y)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Tu,"handleCatchall");var Yn=T("$ZodObject",(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...p};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=At(()=>Iu(t));J(e._zod,"propValues",()=>{let p=t.shape,f={};for(let g in p){let y=p[g]._zod;if(y.values){f[g]??(f[g]=new Set);for(let b of y.values)f[g].add(b)}}return f});let i=et,u=t.catchall,c;e._zod.parse=(p,f)=>{c??(c=n.value);let g=p.value;if(!i(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let y=[],b=c.shape;for(let _ of c.keys){let s=b[_],d=s._zod.optout==="optional",h=s._zod.run({value:g[_],issues:[]},f);h instanceof Promise?y.push(h.then(m=>Rt(m,p,_,g,d))):Rt(h,p,_,g,d)}return u?Tu(y,g,p,f,n.value,e):y.length?Promise.all(y).then(()=>p):p}});function Fn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!je(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>be(c,n,fe())))}),t)}o(Fn,"handleUnionResults");var hr=T("$ZodUnion",(e,t)=>{W.init(e,t),J(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),J(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),J(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),J(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>$t(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let f of t.options){let g=f._zod.run({value:i.value,issues:[]},u);if(g instanceof Promise)p.push(g),c=!0;else{if(g.issues.length===0)return g;p.push(g)}}return c?Promise.all(p).then(f=>Fn(f,i,e,u)):Fn(p,i,e,u)}});var Qn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,hr.init(e,t);let r=e._zod.parse;J(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[p,f]of Object.entries(c)){i[p]||(i[p]=new Set);for(let g of f)i[p].add(g)}}return i});let n=At(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of p){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!et(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var eo=T("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!In(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let y=t.valueType._zod.run({value:i[g],issues:[]},n);y instanceof Promise?u.push(y.then(b=>{b.issues.length&&r.issues.push(...Pe(g,b.issues)),r.value[g]=b.value})):(y.issues.length&&r.issues.push(...Pe(g,y.issues)),r.value[g]=y.value)}let f;for(let g in i)p.has(g)||(f=f??[],f.push(g));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&dr.test(p)&&f.issues.length){let b=t.keyType._zod.run({value:Number(p),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(f=b)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(b=>be(b,n,fe())),input:p,path:[p],inst:e});continue}let y=t.valueType._zod.run({value:i[p],issues:[]},n);y instanceof Promise?u.push(y.then(b=>{b.issues.length&&r.issues.push(...Pe(p,b.issues)),r.value[f.value]=b.value})):(y.issues.length&&r.issues.push(...Pe(p,y.issues)),r.value[f.value]=y.value)}}return u.length?Promise.all(u).then(()=>r):r}});var to=T("$ZodEnum",(e,t)=>{W.init(e,t);let r=cr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Tn.has(typeof i)).map(i=>typeof i=="string"?Ue(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),ro=T("$ZodLiteral",(e,t)=>{if(W.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ue(n):n?Ue(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var no=T("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Et(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new pe;return r.value=i,r}});function Bn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Bn,"handleOptionalResult");var oo=T("$ZodOptional",(e,t)=>{W.init(e,t),e._zod.optin="optional",e._zod.optout="optional",J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Bn(u,r.value)):Bn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var io=T("$ZodNullable",(e,t)=>{W.init(e,t),J(e._zod,"optin",()=>t.innerType._zod.optin),J(e._zod,"optout",()=>t.innerType._zod.optout),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)}|null)$`):void 0}),J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var ao=T("$ZodPipe",(e,t)=>{W.init(e,t),J(e._zod,"values",()=>t.in._zod.values),J(e._zod,"optin",()=>t.in._zod.optin),J(e._zod,"optout",()=>t.out._zod.optout),J(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>kt(c,t.in,n)):kt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>kt(u,t.out,n)):kt(i,t.out,n)}});function kt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(kt,"handlePipeResult");var so=T("$ZodCustom",(e,t)=>{Ie.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Vn(u,r,n,e));Vn(i,r,n,e)}});function Vn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(lr(i))}}o(Vn,"handleRefineResult");var co;var vr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function po(){return new vr}o(po,"registry");(co=globalThis).__zod_globalRegistry??(co.__zod_globalRegistry=po());var xr=globalThis.__zod_globalRegistry;function lo(e,t){return new e({type:"string",...Z(t)})}o(lo,"_string");function mo(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(mo,"_coercedString");function fo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(fo,"_url");function go(e,t){return new e({type:"number",checks:[],...Z(t)})}o(go,"_number");function yo(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(yo,"_coercedNumber");function ho(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}o(ho,"_int");function vo(e,t){return new e({type:"boolean",...Z(t)})}o(vo,"_boolean");function xo(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(xo,"_coercedBoolean");function _o(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(_o,"_coercedBigint");function Po(e){return new e({type:"any"})}o(Po,"_any");function bo(e){return new e({type:"unknown"})}o(bo,"_unknown");function Io(e,t){return new e({type:"void",...Z(t)})}o(Io,"_void");function To(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o(To,"_coercedDate");function Dt(e,t){return new Nn({check:"greater_than",...Z(t),value:e,inclusive:!0})}o(Dt,"_gte");function ue(e,t){return new Cn({check:"min_length",...Z(t),minimum:e})}o(ue,"_minLength");function Te(e,t){return new Un({check:"string_format",format:"regex",...Z(t),pattern:e})}o(Te,"_regex");function Eo(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Eo,"_custom");var X=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");W.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Ot(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>rt(e,r,n),e.parseAsync=async(r,n)=>wt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>nt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>zt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Ut=T("ZodMiniString",(e,t)=>{Nt.init(e,t),X.init(e,t)});function a(e){return lo(Ut,e)}o(a,"string");var So=T("ZodMiniStringFormat",(e,t)=>{fr.init(e,t),Ut.init(e,t)});var Uu=T("ZodMiniURL",(e,t)=>{Zn.init(e,t),So.init(e,t)});function Ao(e){return fo(Uu,e)}o(Ao,"url");var jt=T("ZodMiniNumber",(e,t)=>{gr.init(e,t),X.init(e,t)});function ee(e){return go(jt,e)}o(ee,"number");var ju=T("ZodMiniNumberFormat",(e,t)=>{Hn.init(e,t),jt.init(e,t)});function $o(e){return ho(ju,e)}o($o,"int");var _r=T("ZodMiniBoolean",(e,t)=>{yr.init(e,t),X.init(e,t)});function B(e){return vo(_r,e)}o(B,"boolean");var zo=T("ZodMiniBigInt",(e,t)=>{Gn.init(e,t),X.init(e,t)});var Mu=T("ZodMiniAny",(e,t)=>{Wn.init(e,t),X.init(e,t)});function it(){return Po(Mu)}o(it,"any");var Lu=T("ZodMiniUnknown",(e,t)=>{qn.init(e,t),X.init(e,t)});function w(){return bo(Lu)}o(w,"unknown");var Fu=T("ZodMiniVoid",(e,t)=>{Kn.init(e,t),X.init(e,t)});function Oo(e){return Io(Fu,e)}o(Oo,"_void");var wo=T("ZodMiniDate",(e,t)=>{Jn.init(e,t),X.init(e,t)});var Bu=T("ZodMiniArray",(e,t)=>{Xn.init(e,t),X.init(e,t)});function N(e,t){return new Bu({type:"array",element:e,...Z(t)})}o(N,"array");var Vu=T("ZodMiniObject",(e,t)=>{Yn.init(e,t),X.init(e,t),J(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...Z(t)};return new Vu(r)}o(l,"object");var Zu=T("ZodMiniUnion",(e,t)=>{hr.init(e,t),X.init(e,t)});function D(e,t){return new Zu({type:"union",options:e,...Z(t)})}o(D,"union");var Hu=T("ZodMiniDiscriminatedUnion",(e,t)=>{Qn.init(e,t),X.init(e,t)});function Ee(e,t,r){return new Hu({type:"union",options:t,discriminator:e,...Z(r)})}o(Ee,"discriminatedUnion");var Gu=T("ZodMiniRecord",(e,t)=>{eo.init(e,t),X.init(e,t)});function k(e,t,r){return new Gu({type:"record",keyType:e,valueType:t,...Z(r)})}o(k,"record");var Wu=T("ZodMiniEnum",(e,t)=>{to.init(e,t),X.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 Wu({type:"enum",entries:r,...Z(t)})}o(U,"_enum");var qu=T("ZodMiniLiteral",(e,t)=>{ro.init(e,t),X.init(e,t)});function A(e,t){return new qu({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o(A,"literal");var Ku=T("ZodMiniTransform",(e,t)=>{no.init(e,t),X.init(e,t)});function Se(e){return new Ku({type:"transform",transform:e})}o(Se,"transform");var Ju=T("ZodMiniOptional",(e,t)=>{oo.init(e,t),X.init(e,t)});function v(e){return new Ju({type:"optional",innerType:e})}o(v,"optional");var Xu=T("ZodMiniNullable",(e,t)=>{io.init(e,t),X.init(e,t)});function at(e){return new Xu({type:"nullable",innerType:e})}o(at,"nullable");var Yu=T("ZodMiniPipe",(e,t)=>{ao.init(e,t),X.init(e,t)});function Ae(e,t){return new Yu({type:"pipe",in:e,out:t})}o(Ae,"pipe");var Qu=T("ZodMiniCustom",(e,t)=>{so.init(e,t),X.init(e,t)});function Mt(e,t){return Eo(Qu,e??(()=>!0),t)}o(Mt,"custom");var st={};vn(st,{bigint:()=>ic,boolean:()=>oc,date:()=>ac,number:()=>nc,string:()=>rc});function rc(e){return mo(Ut,e)}o(rc,"string");function nc(e){return yo(jt,e)}o(nc,"number");function oc(e){return xo(_r,e)}o(oc,"boolean");function ic(e){return _o(zo,e)}o(ic,"bigint");function ac(e){return To(wo,e)}o(ac,"date");var br=l({retryOnFailure:l({defaultValue:v(B()),hide:v(B())}),continueOnFailure:l({defaultValue:v(B()),hide:v(B())})}),Pr=class{constructor(t,r,n,i,u,c,p,f,g,y,b){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=y;this.aiMetadata=b}static{o(this,"IAction")}},te=o(e=>new Pr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=l({displayName:a(),description:v(a())}),C=o((e,t)=>l({type:A(t),required:B(),defaultValue:v(it())}),"TPropertyValue");var oe=l({...F.shape,...C(a(),"SHORT_TEXT").shape}),ge=l({...F.shape,...C(a(),"LONG_TEXT").shape});var Ro=l({label:a(),value:w()}),Lt=l({disabled:v(B()),placeholder:v(a()),options:N(Ro)});var ie=l({...F.shape,options:Lt,...C(w(),"STATIC_DROPDOWN").shape}),ye=l({...F.shape,options:Lt,...C(N(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Ir=l({...F.shape,...C(w(),"DROPDOWN").shape,refreshers:N(a())}),ut=l({...F.shape,...C(N(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var he=l({...F.shape,...C(B(),"CHECKBOX").shape});var ve=l({...F.shape,...C(ee(),"NUMBER").shape});var ct=l({...F.shape,streaming:v(B()),...C(w(),"FILE").shape});var pt=l({...F.shape,...C(a(),"DATE_TIME").shape});var No=k(a(),D([oe,ge,ie,ut,ye,he,ve,ct,pt])),lt=l({...F.shape,properties:No,...C(N(w()),"ARRAY").shape});var dt=l({...F.shape,...C(D([k(a(),w())]),"JSON").shape});var Do=D([oe,ie,dt,lt,ye]),uc=k(a(),Do),Tr=l({refreshers:N(a()),...F.shape,...C(w(),"DYNAMIC").shape});var Ft=l({...F.shape,...C(Oo(),"MARKDOWN").shape});var mt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(mt||{}),Me=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Me||{}),Le=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(Le||{});var ft=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ft||{}),Er="both_client_credentials_and_authorization_code";var $e=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))($e||{}),gt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(gt||{}),cc=l({strategy:U(gt),paramName:v(a())}),yt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(yt||{});var Bt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Bt||{}),Co=l({status:v(ee()),body:v(w()),headers:v(k(a(),a()))}),Uo=l({type:A("DELAY"),resumeDateTime:a(),requestIdToReply:v(a()),handlerId:v(a()),streamStepProgress:v(U(Bt))}),jo=l({type:A("WEBHOOK"),requestId:a(),requestIdToReply:v(a()),response:Co,handlerId:v(a()),streamStepProgress:v(U(Bt))}),pc=D([Uo,jo]);var lc=l({body:w(),rawBody:v(w()),headers:k(a(),a()),queryParams:k(a(),a())});function Y(e){return e==null}o(Y,"isNil");function ht(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ht,"isEmpty");function Vt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Vt,"assertNotNullOrUndefined");var Sr=Ce(require("crypto"),1);var dc=128,we,Fe,mc=o(e=>{!we||we.length<e?(we=Buffer.allocUnsafe(e*dc),Sr.default.randomFillSync(we),Fe=0):Fe+e>we.length&&(Sr.default.randomFillSync(we),Fe=0),Fe+=e},"fillPool"),fc=o(e=>(mc(e|=0),we.subarray(Fe-e,Fe)),"random"),gc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let p=r(i),f=i;for(;f--;)if(c+=e[p[f]&n]||"",c.length===u)return c}}},"customRandom"),Lo=o((e,t=21)=>gc(e,t,fc),"customAlphabet");var yc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Fo=21,$b=a().check(Te(new RegExp(`^[0-9a-zA-Z]{${Fo}}$`))),hc=Lo(yc,Fo);var ze=Ae(Se(e=>e instanceof Date?e.toISOString():e),a()),ae={id:a(),created:ze,updated:ze},H=o(e=>v(at(e)),"Nullable");function Ar(e){return v(at(U(e)))}o(Ar,"NullableEnum");var wb=Ae(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(B())),Zt=o(e=>Ae(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(N(e))),"OptionalArrayFromQuery");var Nb=k(a(),w());var vt=(y=>(y.OPENAI="openai",y.OPENROUTER="openrouter",y.ANTHROPIC="anthropic",y.AZURE="azure",y.GOOGLE="google",y.ACTIVEPIECES="activepieces",y.CLOUDFLARE_GATEWAY="cloudflare-gateway",y.CUSTOM="custom",y.BEDROCK="bedrock",y.MISTRAL="mistral",y))(vt||{});var Gb=a().check(Te(/^#[0-9A-Fa-f]{6}$/));var qb=l({filename:a(),data:w(),type:A("file"),mimetype:v(a())});var vc=Ce(Vo());var tI=l({...ae,name:a(),permissions:N(a()),platformId:H(a()),type:a(),userCount:v(ee())});var Zo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Zo||{}),$r=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))($r||{}),zr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(zr||{});var Or=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Or||{});var wr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(wr||{});var xc=l({mode:U(Zo),value:w()}),_c=l({auth:v(a()),fields:k(a(),xc)}),Pc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:v(_c)}),bc=l({type:A("PIECE"),toolName:a().check(ue(1)),pieceMetadata:Pc}),Ic=l({type:A("none")}),Tc=l({type:A("access_token"),accessToken:a()}),Ec=l({type:A("api_key"),apiKey:a(),apiKeyHeader:a()}),Sc=l({type:A("headers"),headers:k(a(),a())}),Ac=Ee("type",[Ic,Tc,Ec,Sc]),Ho=l({type:A("FLOW"),toolName:a().check(ue(1)),externalFlowId:a(),flowDisplayName:v(a())}),Go=l({type:A("MCP"),toolName:a().check(ue(1)),serverUrl:Ao(),protocol:U(zr),auth:Ac}),Wo=l({type:A("KNOWLEDGE_BASE"),toolName:a().check(ue(1)),sourceType:U($r),sourceId:a(),sourceName:a()}),$c=Ee("type",[bc,Ho,Go,Wo]),zc=l({displayName:a(),description:v(a()),type:U(Or)}),qo=l({type:A("MARKDOWN"),markdown:a()}),Be={type:A("TOOL_CALL"),input:H(k(a(),w())),output:v(w()),toolName:a(),status:U(wr),toolCallId:a(),startTime:a(),endTime:v(a())},kI=l(Be),Ko=Ee("toolCallType",[l({...Be,toolCallType:A("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Be,toolCallType:A("FLOW"),displayName:a(),externalFlowId:a()}),l({...Be,toolCallType:A("MCP"),displayName:a(),serverUrl:a()}),l({...Be,toolCallType:A("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Be,toolCallType:A("UNKNOWN"),displayName:a()})]),Oc=D([qo,Ko]);var kr=(r=>(r.IMAGE="image",r.TEXT="text",r))(kr||{}),xe=l({apiKey:a()}),wc=xe,kc=l({apiKey:a(),apiKeyHash:a()}),Rc=xe,Nc=xe,Dc=xe,Cc=xe,Uc=xe,jc=xe,Mc=xe,ei=l({accessKeyId:a().check(ue(1)),secretAccessKey:a().check(ue(1))}),Lc=l({}),Fc=l({}),Bc=l({}),Vc=l({}),Zc=l({}),Hc=l({}),ti=l({modelId:a(),modelName:a(),modelType:U(kr)}),ri=l({apiKeyHeader:a(),baseUrl:a(),models:N(ti),defaultHeaders:v(k(a(),a()))}),ni=l({accountId:a(),gatewayId:a(),models:N(ti),vertexProject:v(a()),vertexRegion:v(a())}),oi=l({resourceName:a(),apiVersion:Ae(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(a()))}),ii=l({region:a().check(ue(1))}),Gc=D([wc,Dc,Cc,Uc,jc,Nc,Rc,kc,ei,Mc]),ai=D([ri,ni,oi,ii,Lc,Bc,Vc,Zc,Fc,Hc]),Wc=l({id:a(),name:a(),type:U(kr)}),qc=l({id:a(),name:a(),provider:U(vt),config:ai,enabledForChat:B()}),Kc=l({provider:U(vt),config:ai,auth:Gc,platformId:a()});var CI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Jo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Jc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Xc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Xo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Yc=["grok-4.20","grok-4.1-fast"],Qc={openai:Jo,anthropic:Jc,google:Xo,activepieces:[...Xc.map(e=>`anthropic/${e}`),...Jo.map(e=>`openai/${e}`),...Xo.map(e=>`google/${e}`),...Yc.map(e=>`x-ai/${e}`)]};var Yo=128e3,ep={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function tp({provider:e}){return e?ep[e]??Yo:Yo}o(tp,"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"},rp={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},np=new Set(["anthropic","mistral"]);function le(e){return{chatModels:Qc[e],maxContextTokens:tp({provider:e}),defaultEmbeddingModel:Qo[e],supportsEmbedding:Qo[e]!==void 0,supportsImageGeneration:!np.has(e),webSearch:rp[e]}}o(le,"buildProviderCapabilities");var op={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 ip=l({base64Url:a(),fileName:a(),extension:v(a())}),ap=l({mimeType:a(),url:a(),fileName:v(a())}),Rr=D([ip,ap]);var sp=D([l({type:A("file"),value:Rr}),l({type:A("markdown"),value:a(),files:v(N(Rr))})]),up=l({sessionId:a(),message:a(),files:v(N(a()))});var ui=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ui||{}),ci=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ci||{}),Nr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Nr||{});var cp=D([l({...ae,name:a(),externalId:a(),type:A("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...ae,name:a(),externalId:a(),type:D([A("TEXT"),A("NUMBER"),A("DATE")]),tableId:a(),projectId:a()})]),pp=l({...ae,name:a(),folderId:H(a()),projectId:a(),externalId:a(),status:Ar(ci),trigger:Ar(ui)}),lp=l({...ae,tableId:a(),projectId:a(),cells:k(a(),l({updated:a(),created:a(),value:w(),fieldName:a()}))}),dp=l({events:N(U(Nr)),webhookUrl:a(),flowId:a()}),mp=l({fields:N(l({id:a(),name:a()})),rows:N(k(a(),a())),name:a()}),fp=l({projectId:a(),limit:v(st.number()),cursor:v(a()),name:v(a()),externalIds:Zt(a()),folderId:v(a()),folderIds:Zt(a())}),gp=l({records:N(N(l({fieldId:a(),value:li()}))),tableId:a()}),yp=l({cells:v(N(l({fieldId:a(),value:li()}))),tableId:a(),agentUpdate:v(B())}),pi=Ee("operator",[ke("eq"),ke("neq"),ke("gt"),ke("gte"),ke("lt"),ke("lte"),ke("co"),si("exists"),si("not_exists")]),hp=l({tableId:a(),limit:v(st.number()),cursor:v(a()),filters:Zt(pi)});function li(){return Ae(Se(e=>e==null?e:String(e)),at(a()))}o(li,"coerceToString");function ke(e){return l({fieldId:a(),operator:A(e),value:a()})}o(ke,"valueFilter");function si(e){return l({fieldId:a(),operator:A(e)})}o(si,"existenceFilter");var vp=l({status:v(ee()),body:v(w()),headers:v(k(a(),a()))}),xp=l({...ae,deleted:H(ze),ownerId:a(),displayName:a(),platformId:a(),externalId:H(a())});var di=l({name:a(),description:v(a()),type:a(),required:B()}),_p=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(di),returnsResponse:B()})});var mi="^[0-9]+\\.[0-9]+\\.[0-9]+$",tT=new RegExp(mi),bp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",rT=a().check(Te(new RegExp(mi))),nT=a().check(Te(new RegExp(bp))),Ip=l({packageType:A("ARCHIVE"),pieceType:U(Me),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),fi=l({packageType:A("REGISTRY"),pieceType:A("OFFICIAL"),pieceName:a(),pieceVersion:a()}),gi=l({packageType:A("REGISTRY"),pieceType:A("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),oT=D([fi,gi]),iT=D([Ip,fi,gi]);var Tp=Ee("type",[l({type:A("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:A("INTERVAL"),intervalMs:$o().check(Dt(6e4))})]),aT=l({...ae,type:U($e),projectId:a(),flowId:a(),triggerName:a(),schedule:H(Tp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:H(a()),simulate:B()}),yi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(yi||{}),hi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(hi||{}),vi=(r=>(r.S3="S3",r.DB="DB",r))(vi||{}),sT=l({...ae,projectId:H(a()),platformId:H(a()),type:U(yi),compression:U(hi),data:v(w()),location:U(vi),size:H(ee()),fileName:H(a()),s3Key:H(a()),metadata:H(k(a(),a()))}),xi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(xi||{}),_i=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(_i||{}),uT=l({id:a(),email:a(),firstName:a(),status:U(_i),externalId:H(a()),platformId:H(a()),platformRole:U(xi),lastName:a(),created:ze,updated:ze,lastActiveDate:H(ze),imageUrl:H(a())});var Dr=l({...F.shape,...C(k(a(),w()),"OBJECT").shape});var Ti=l({...F.shape,...C(a(),"COLOR").shape});var Cr=D([oe,ge,Ft,he,ie,ye,Ir,ut,Tr,ve,lt,Dr,dt,pt,ct,Ti]),I={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var de=l({displayName:a(),description:v(a())});var Ei=l({username:a(),password:a()}),Ur=l({...de.shape,username:l({displayName:a(),description:v(a())}),password:l({displayName:a(),description:v(a())}),...C(Ei,"BASIC_AUTH").shape});var $p=k(a(),D([oe,ge,ve,he,ie])),jr=l({...de.shape,props:$p,...C(w(),"CUSTOM_AUTH").shape});var Re=l({...de.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var zp=k(a(),D([oe,ge,Re,ve,he,ie,ye,Ft])),Si=l({...de.shape,props:zp,...C(w(),"OIDC").shape});var Mr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Mr||{}),Ai=D([oe,Re,ie]),$i=k(a(),Ai),Op=l({props:v(k(a(),Ai)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:v(D([A("none"),A("consent"),A("login"),A("omit")])),pkce:v(B()),pkceMethod:v(D([A("plain"),A("S256")])),authorizationMethod:v(U(Mr)),grantType:v(D([U(ft),A(Er)])),extra:v(k(a(),a()))}),zi=l({access_token:a(),props:v($i),data:k(a(),it())}),Lr=l({...de.shape,...Op.shape,...C(zi,"OAUTH2").shape});var Ve=D([Ur,jr,Si,Lr,Re]),xt="Connection",Fr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||xt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||xt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||xt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||xt}},None(){}};var LE={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=l({...F.shape,...C(w(),"CUSTOM").shape,code:a()});var kp=D([Cr,Ve]),Br=k(a(),kp),aS=k(a(),Cr);var Oi=D([l({strategy:A("CRON"),cronExpression:a()}),l({strategy:A("NONE")})]),Ze=class{constructor(t,r,n,i,u,c,p,f,g,y,b,_,s,d,h,m,x,P,M){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=p;this.onHandshake=f;this.renewConfiguration=g;this.onRenew=y;this.onEnable=b;this.onDisable=_;this.onStart=s;this.run=d;this.test=h;this.sampleData=m;this.testStrategy=x;this.outputSchema=P;this.aiMetadata=M}static{o(this,"ITrigger")}},wi=o(e=>{switch(e.type){case"WEBHOOK":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,Y(e.sampleData)&&Y(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var ki="2",Gt="0.82.0";var Vr=class{constructor(t,r,n,i,u,c,p,f,g=Gt,y,b="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=y;this.description=b;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:ki}),"getContextInfo");(!Rp(g)||Np(g,Gt))&&(this.minimumSupportedRelease=Gt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Ri=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Vr(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 Rp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Rp,"isValidSimpleSemver");function Np(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(Np,"isSemverLessThan");var Dp=v(k(a(),k(a(),a()))),Ni=l({id:v(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:v(a()),directoryPath:v(a()),auth:v(D([Ve,N(Ve)])),version:a(),categories:v(N(U(Le))),minimumSupportedRelease:v(a()),maximumSupportedRelease:v(a()),deprecated:v(B()),i18n:Dp}),Cp=U(["human","ai","both"]),Di=l({description:v(a()),idempotent:v(B())}),Ci=l({name:a(),displayName:a(),description:a(),props:Br,requireAuth:B(),errorHandlingOptions:v(br),outputSchema:v(Mt()),audience:v(Cp),aiMetadata:v(Di)}),Ui=l({name:a(),displayName:a(),description:a(),props:Br,errorHandlingOptions:v(br),type:U($e),sampleData:w(),handshakeConfiguration:v(Mt()),renewConfiguration:v(Oi),testStrategy:U(yt),outputSchema:v(Mt()),aiMetadata:v(Di)}),Up=l({...Ni.shape,actions:k(a(),Ci),triggers:k(a(),Ui)}),jp=l({...Ni.shape,actions:ee(),triggers:ee(),suggestedActions:v(N(Ci)),suggestedTriggers:v(N(Ui))}),ji=l({projectUsage:ee(),pieceType:U(Me),packageType:U(mt),platformId:v(a()),archiveId:v(a())}),aA=l({...Up.shape,...ji.shape}),sA=l({...jp.shape,...ji.shape}),uA=l({name:a(),version:a()});var Mp=Ce(require("path")),Lp=Ce(require("fs/promises"));var Bi=require("node:stream");var Wt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var qt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Zr,r=new Hr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Zr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Hr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var _t=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Mi({error:e,requestBody:t}){return e instanceof _t?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Mi,"toFailsafeOutput");var He=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(He||{});var Kt=class extends Wt{static{o(this,"FetchHttpClient")}constructor(t="",r=new qt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[M,ne]of Object.entries(c))i.append(M,ne);let p=i.toString(),f=p?`${n}?${p}`:n,g=t.responseType??"json",y=t.followRedirects??!0,b=t.retries??0,{body:_,extraHeaders:s,isStream:d}=Fp(t.method)?Bp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},h=Zp({...u,...s}),m=await Vp(async()=>{let M=new AbortController,ne=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let se={method:t.method.toString(),headers:h,body:_,redirect:y?"follow":"manual",signal:M.signal};return d&&(se.duplex="half"),r?.dispatcher!==void 0&&(se.dispatcher=r.dispatcher),await fetch(f,se)}finally{ne!==void 0&&clearTimeout(ne)}},b),x=y?300:400;if(m.status<200||m.status>=x){let M=await Li(m,g),ne=new _t(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ne),ne}let P=await Li(m,g);return{status:m.status,headers:Hp(m.headers),body:P}}};function Fp(e){return e!=="GET"&&e!=="HEAD"}o(Fp,"acceptsRequestBody");function Bp(e,t){if(Wp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Gp(e)){let n=new Bi.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Bp,"serializeBody");async function Li(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Li,"parseResponseBody");async function Vp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Fi(n);continue}return i}catch(i){if(r=i,n<t){await Fi(n);continue}throw i}throw r}o(Vp,"sendWithRetries");function Fi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Fi,"backoff");function Zp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(Zp,"normalizeHeaders");function Hp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Hp,"toHttpHeaders");function Gp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Gp,"isNodeFormData");function Wp(e){return e==null}o(Wp,"isNil");var Ge=new Kt;var Nd=Ce(require("fs")),qs=Ce(Ws());var Dd={"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 Cd(e){let t=e.split(";")[0].trim().toLowerCase();return Dd[t]??""}o(Cd,"contentTypeToExtension");var Ud=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),jd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Ks({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:f="headers"}){return te({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:I.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:g})=>({url:I.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
-
i.e ${
|
|
4
|
-
`),required:!0,validate:o(async({auth:e})=>{try{return await Ge.sendRequest({method:"GET",url:"https://descriptapi.com/v1/status",headers:{Authorization:`Bearer ${De(e)}`}}),{valid:!0}}catch{return{valid:!1,error:"Invalid API token. Please check and try again."}}},"validate")});function De(e){return(typeof e=="string"?e:e.secret_text).trim()}o(De,"getAuthToken");var Js="https://descriptapi.com/v1";async function mn({apiKey:e,method:t,path:r,body:n,queryParams:i}){return Ge.sendRequest({method:t,url:`${Js}${r}`,headers:{Authorization:`Bearer ${e}`},body:n,queryParams:i})}o(mn,"descriptApiCall");async function Xs(e){let t=[],r;do{let n={limit:"100",sort:"name",direction:"asc"};r&&(n.cursor=r);let i=await mn({apiKey:e,method:"GET",path:"/projects",queryParams:n});t.push(...i.body.data),r=i.body.pagination.next_cursor}while(r);return t}o(Xs,"fetchAllProjects");var Bd=I.Dropdown({auth:G,displayName:"Project",description:"Select the Descript project to use.",refreshers:[],required:!0,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:(await Xs(De(e))).map(r=>({label:r.name,value:r.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load projects. Check your connection."}}},"options")}),Vd=o(e=>I.Dropdown({auth:G,displayName:"Composition",description:"Select the composition (timeline) within the project. If omitted, the agent chooses automatically.",refreshers:["project_id"],required:e,options:o(async({auth:t,project_id:r})=>{if(!t||!r||typeof r!="string")return{disabled:!0,options:[],placeholder:"Please select a project first"};try{return{disabled:!1,options:(await mn({apiKey:De(t),method:"GET",path:`/projects/${r}`})).body.compositions.map(i=>({label:i.name,value:i.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load compositions. Check your connection."}}},"options")}),"compositionIdProp"),V={BASE_URL:Js,descriptApiCall:mn,fetchAllProjects:Xs,getAuthToken:De,projectIdProp:Bd,compositionIdProp:Vd};var Ys=te({auth:G,name:"agent_edit",displayName:"Agent Edit (Underlord)",description:`Use Descript's AI agent "Underlord" to edit an existing project or create a new one with a natural language prompt.`,audience:"both",aiMetadata:{description:"Starts an asynchronous Descript Underlord AI editing job driven by a natural-language prompt, operating in one of two modes: editing an existing project (optionally targeting a specific composition) or creating a new project from the prompt. Use to apply AI edits like removing filler words, adding studio sound, or assembling highlight reels. Frame the prompt as a single one-shot instruction. Not idempotent: each call queues a new job and returns a job_id to poll for completion.",idempotent:!1},props:{mode:I.StaticDropdown({displayName:"Mode",description:"Choose whether to edit an existing project or create a brand new one.",required:!0,defaultValue:"existing",options:{options:[{label:"Edit existing project",value:"existing"},{label:"Create new project from prompt",value:"new"}]}}),project_id:I.Dropdown({auth:G,displayName:"Project",description:"Select the project for the agent to edit.",refreshers:["mode"],required:!1,options:o(async({auth:e,mode:t})=>{if(t!=="existing")return{disabled:!0,options:[],placeholder:"Not needed for new projects"};if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:(await V.fetchAllProjects(V.getAuthToken(e))).map(n=>({label:n.name,value:n.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load projects. Check your connection."}}},"options")}),project_name:I.ShortText({displayName:"New Project Name",description:"Name for the new project (only used when creating a new project).",required:!1}),team_access:I.StaticDropdown({displayName:"Team Access",description:"Access level for team members on the new project. Only applies when creating a new project.",required:!1,defaultValue:"none",options:{options:[{label:"None (private to owner)",value:"none"},{label:"View",value:"view"},{label:"Comment",value:"comment"},{label:"Edit",value:"edit"}]}}),composition_id:V.compositionIdProp(!1),prompt:I.LongText({displayName:"Prompt",description:'Natural language instruction for Underlord. Examples: "Add studio sound to every clip", "Remove all filler words", "Create a 30-second highlight reel with the best moments". Be specific \u2014 frame edits as a single one-shot instruction.',required:!0}),model:I.ShortText({displayName:"AI Model",description:"AI model to use for editing. Leave blank to use the Descript default.",required:!1}),callback_url:I.ShortText({displayName:"Callback URL",description:"Optional webhook URL. When the job finishes or fails, Descript will POST the job status to this URL (same payload as Get Job Status).",required:!1})},async run(e){let{mode:t,project_id:r,project_name:n,team_access:i,composition_id:u,prompt:c,model:p,callback_url:f}=e.propsValue,g={prompt:c};if(t==="existing"){if(!r)throw new Error("Please select a project to edit.");g.project_id=r,u&&(g.composition_id=u)}else{if(!n)throw new Error("Please enter a project name for the new project.");g.project_name=n,i&&(g.team_access=i)}return p&&(g.model=p),f&&(g.callback_url=f),(await V.descriptApiCall({apiKey:V.getAuthToken(e.auth),method:"POST",path:"/jobs/agent",body:g})).body}});var Qs=te({auth:G,name:"get_job_status",displayName:"Get Job Status",description:"Retrieves the current status of a Descript background job (import, agent edit, or publish). Use the job_id returned by any job-creation action.",audience:"both",aiMetadata:{description:"Looks up the current state and result of a single Descript background job (import, agent edit, or publish) by its job_id. Use to poll for completion after starting an asynchronous job and to read outputs such as share/download URLs or error messages. Read-only and idempotent.",idempotent:!0},props:{job_id:I.ShortText({displayName:"Job ID",description:'The job ID returned when you created the job (e.g. from "Import Media", "Agent Edit", or "Publish Project" actions).',required:!0})},async run(e){return(await V.descriptApiCall({apiKey:V.getAuthToken(e.auth),method:"GET",path:`/jobs/${e.propsValue.job_id}`})).body}});var eu=te({auth:G,name:"get_project",displayName:"Get Project",description:"Retrieves details for a Descript project including its compositions and media files.",audience:"both",aiMetadata:{description:"Fetches full details for a single Descript project by ID, including its compositions and media files. Use to resolve composition IDs or inspect project contents before editing or publishing. Read-only and idempotent.",idempotent:!0},props:{project_id:V.projectIdProp},async run(e){return(await V.descriptApiCall({apiKey:V.getAuthToken(e.auth),method:"GET",path:`/projects/${e.propsValue.project_id}`})).body}});var tu=te({auth:G,name:"import_media",displayName:"Import Media",description:"Imports a media file from a URL into a new or existing Descript project and optionally creates a composition.",audience:"both",aiMetadata:{description:"Starts an asynchronous Descript job that imports a media file from a public URL into either a newly created project or an existing one (selected via the project mode), optionally building a composition/timeline from it. Use to bring audio/video into Descript before editing or publishing; the URL must be reachable by Descript servers and support HTTP Range requests. Not idempotent: each call queues a new import job and returns a job_id to poll for completion.",idempotent:!1},props:{mode:I.StaticDropdown({displayName:"Project",description:"Create a new project or import into an existing one.",required:!0,defaultValue:"new",options:{options:[{label:"Create new project",value:"new"},{label:"Import into existing project",value:"existing"}]}}),project_id:I.Dropdown({auth:G,displayName:"Existing Project",description:"Select the project to import media into.",refreshers:["mode"],required:!1,options:o(async({auth:e,mode:t})=>{if(t!=="existing")return{disabled:!0,options:[],placeholder:"Not needed for new projects"};if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:(await V.fetchAllProjects(V.getAuthToken(e))).map(n=>({label:n.name,value:n.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load projects. Check your connection."}}},"options")}),project_name:I.ShortText({displayName:"New Project Name",description:"Name for the new project. Only used when creating a new project.",required:!1}),folder_name:I.ShortText({displayName:"Project Folder",description:'Folder path for the new project (e.g. "Clients/Acme"). Supports nested paths using "/". Missing folders are created automatically. Only applies when creating a new project.',required:!1}),team_access:I.StaticDropdown({displayName:"Team Access",description:"Access level for Drive members on the new project. Only applies when creating a new project.",required:!1,defaultValue:"none",options:{options:[{label:"None (private to owner)",value:"none"},{label:"View",value:"view"},{label:"Comment",value:"comment"},{label:"Edit",value:"edit"}]}}),media_name:I.ShortText({displayName:"Media File Name",description:'Display name for the media file (e.g. "intro.mp4" or "Recordings/interview.mp4"). Use "/" to organize into sub-folders. Must not conflict with existing file names when importing into an existing project.',required:!0}),media_url:I.ShortText({displayName:"Media URL",description:"Public URL of the media file. Must be accessible by Descript servers and support HTTP Range requests. Sign URLs for 12\u201348 hours if they expire.",required:!0}),language:I.ShortText({displayName:"Transcription Language",description:'ISO 639-1 language code for transcription (e.g. "en", "es", "fr"). Leave blank to auto-detect from the audio.',required:!1}),composition_name:I.ShortText({displayName:"Composition Name",description:"Name for the composition (timeline) to create from the imported media. Leave blank to skip composition creation.",required:!1}),composition_width:I.Number({displayName:"Composition Width (px)",description:"Width of the composition in pixels. Defaults to 1920. Only used when a Composition Name is provided.",required:!1,defaultValue:1920}),composition_height:I.Number({displayName:"Composition Height (px)",description:"Height of the composition in pixels. Defaults to 1080. Only used when a Composition Name is provided.",required:!1,defaultValue:1080}),callback_url:I.ShortText({displayName:"Callback URL",description:"Optional webhook URL. When the import finishes or fails, Descript will POST the job status to this URL (same payload as Get Job Status).",required:!1})},async run(e){let{mode:t,project_id:r,project_name:n,folder_name:i,team_access:u,media_name:c,media_url:p,language:f,composition_name:g,composition_width:y,composition_height:b,callback_url:_}=e.propsValue,s={url:p};f&&(s.language=f);let d={add_media:{[c]:s}};if(t==="existing"){if(!r)throw new Error("Please select a project to import into.");d.project_id=r}else{if(!n)throw new Error("Please enter a name for the new project.");d.project_name=n,i&&(d.folder_name=i),u&&(d.team_access=u)}return g&&(d.add_compositions=[{name:g,width:y??1920,height:b??1080,clips:[{media:c}]}]),_&&(d.callback_url=_),(await V.descriptApiCall({apiKey:V.getAuthToken(e.auth),method:"POST",path:"/jobs/import/project_media",body:d})).body}});var ru=te({auth:G,name:"list_projects",displayName:"List Projects",description:"Returns projects in your Descript Drive. Supports filtering by name, date, and creator.",audience:"both",aiMetadata:{description:"Lists projects in the connected Descript Drive, auto-paginating through all matches. Optional filters narrow by name substring, creator (me vs anyone), and created/updated date ranges, with configurable sort field and direction; leaving filters blank returns all projects. Use to discover project IDs for other actions. Read-only and idempotent.",idempotent:!0},props:{name:I.ShortText({displayName:"Name Filter",description:"Return only projects whose name contains this string (case-insensitive).",required:!1}),created_by:I.StaticDropdown({displayName:"Created By",description:"Filter projects by creator.",required:!1,options:{options:[{label:"Anyone",value:""},{label:"Me",value:"me"}]}}),sort:I.StaticDropdown({displayName:"Sort By",description:"Field to sort results by.",required:!1,defaultValue:"created_at",options:{options:[{label:"Date created",value:"created_at"},{label:"Date updated",value:"updated_at"},{label:"Name",value:"name"},{label:"Last viewed",value:"last_viewed_at"}]}}),direction:I.StaticDropdown({displayName:"Sort Direction",description:"Sort order for results.",required:!1,defaultValue:"desc",options:{options:[{label:"Newest first (desc)",value:"desc"},{label:"Oldest first (asc)",value:"asc"}]}}),created_after:I.ShortText({displayName:"Created After",description:"Return only projects created after this date (ISO 8601, e.g. 2025-01-01T00:00:00Z).",required:!1}),created_before:I.ShortText({displayName:"Created Before",description:"Return only projects created before this date (ISO 8601, e.g. 2025-12-31T23:59:59Z).",required:!1}),updated_after:I.ShortText({displayName:"Updated After",description:"Return only projects updated after this date (ISO 8601, e.g. 2025-01-01T00:00:00Z).",required:!1}),updated_before:I.ShortText({displayName:"Updated Before",description:"Return only projects updated before this date (ISO 8601, e.g. 2025-12-31T23:59:59Z).",required:!1})},async run(e){let{name:t,created_by:r,sort:n,direction:i,created_after:u,created_before:c,updated_after:p,updated_before:f}=e.propsValue,g=V.getAuthToken(e.auth),y={limit:"100"};n&&(y.sort=n),i&&(y.direction=i),t&&(y.name=t),r&&(y.created_by=r),u&&(y.created_after=u),c&&(y.created_before=c),p&&(y.updated_after=p),f&&(y.updated_before=f);let b=[],_;do{let s={...y,..._?{cursor:_}:{}},d=await V.descriptApiCall({apiKey:g,method:"GET",path:"/projects",queryParams:s});b.push(...d.body.data),_=d.body.pagination.next_cursor}while(_);return b.map(s=>({project_id:s.id,project_name:s.name,created_at:s.created_at,updated_at:s.updated_at}))}});var nu=te({auth:G,name:"publish_project",displayName:"Publish Project",description:"Publishes a composition from a project to create a shareable link and a downloadable export file.",audience:"both",aiMetadata:{description:"Starts an asynchronous Descript publish/export job for a project composition, producing a shareable link and a downloadable file as video or audio at a chosen resolution and share access level. Use to render and distribute a finished project. Requesting a share access level the Drive disallows returns an error. Not idempotent: each call queues a new export job and returns a job_id to poll for the share_url and download_url.",idempotent:!1},props:{project_id:V.projectIdProp,composition_id:V.compositionIdProp(!1),media_type:I.StaticDropdown({displayName:"Output Type",description:"Choose whether to export the project as a video or audio file.",required:!1,defaultValue:"Video",options:{options:[{label:"Video",value:"Video"},{label:"Audio only",value:"Audio"}]}}),resolution:I.StaticDropdown({displayName:"Video Resolution",description:"Resolution for the exported video. Only applies when Output Type is Video.",required:!1,defaultValue:"1080p",options:{options:[{label:"480p",value:"480p"},{label:"720p",value:"720p"},{label:"1080p (Full HD)",value:"1080p"},{label:"1440p (2K)",value:"1440p"},{label:"4K",value:"4K"}]}}),access_level:I.StaticDropdown({displayName:"Share Access Level",description:"Who can view the published share page. Leave blank to use your Drive's default. Note: requesting a level your Drive disallows (e.g. Public when search-engine indexing is off) will return an error.",required:!1,options:{options:[{label:"Public (anyone)",value:"public"},{label:"Unlisted (link only)",value:"unlisted"},{label:"Drive members only",value:"drive"},{label:"Private (owner only)",value:"private"}]}}),callback_url:I.ShortText({displayName:"Callback URL",description:"Optional webhook URL. When the publish job finishes or fails, Descript will POST the job status to this URL (same payload as Get Job Status). The result includes share_url and download_url once complete.",required:!1})},async run(e){let{project_id:t,composition_id:r,media_type:n,resolution:i,access_level:u,callback_url:c}=e.propsValue,p={project_id:t};return r&&(p.composition_id=r),n&&(p.media_type=n),n==="Video"&&i&&(p.resolution=i),u&&(p.access_level=u),c&&(p.callback_url=c),(await V.descriptApiCall({apiKey:V.getAuthToken(e.auth),method:"POST",path:"/jobs/publish",body:p})).body}});var Zd=new Set(["stopped","cancelled"]);function Hd(e){return Zd.has(e.job_state)}o(Hd,"isCompletedJob");var ou={job_id:"6dc3f30a-58c2-4174-96a6-dc18cf3c7776",job_type:"import/project_media",job_state:"stopped",created_at:"2025-11-18T10:30:00Z",stopped_at:"2025-11-18T10:35:00Z",drive_id:"c9c5c47e-158a-49f7-846b-4f6ee2a229a2",project_id:"9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb",project_url:"https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb",result:{status:"success",media_seconds_used:136}},fn={strategy:0,items:o(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{job_type_filter:n}=t,i=V.getAuthToken(e),u={limit:"100"};n&&n!=="all"&&(u.type=n),r>0&&(u.created_after=new Date(r).toISOString());let c=[],p,f=0,g=10;do{f++;let y={...u,...p?{cursor:p}:{}},b=await V.descriptApiCall({apiKey:i,method:"GET",path:"/jobs",queryParams:y});c.push(...b.body.data),p=b.body.pagination.next_cursor}while(p&&f<g);return c.filter(Hd).map(y=>({epochMilliSeconds:new Date(y.stopped_at??y.created_at).getTime(),data:{...y}}))},"items")},iu=wi({auth:G,name:"job_completed",displayName:"Job Completed",description:"Triggers when a Descript background job (import, agent edit, or publish) finishes.",aiMetadata:{description:"Fires when a Descript background job reaches a terminal state (completed, failed, or cancelled), representing a finished import, agent edit, or publish job. Can be scoped to a single job type or left open to fire for any completed job type."},props:{job_type_filter:I.StaticDropdown({displayName:"Job Type Filter",description:'Only trigger for jobs of this type. Select "All job types" to trigger for any completed job.',required:!1,defaultValue:"all",options:{options:[{label:"All job types",value:"all"},{label:"Import media",value:"import/project_media"},{label:"Agent edit (Underlord)",value:"agent"}]}})},sampleData:ou,type:"POLLING",async test(){return[ou]},async onEnable(e){await ir.onEnable(fn,e)},async onDisable(e){await ir.onDisable(fn,e)},async run(e){return await ir.poll(fn,e)}});var Gd=Ri({displayName:"Descript",description:"AI-powered video and podcast editor. Import media, run AI edits with Underlord, and publish.",minimumSupportedRelease:"0.82.1",logoUrl:"https://cdn.activepieces.com/pieces/descript.png",categories:["CONTENT_AND_FILES"],auth:G,authors:["hugh-codes","onyedikachi-david"],actions:[tu,Ys,nu,Qs,ru,eu,Ks({baseUrl:o(()=>"https://descriptapi.com/v1","baseUrl"),auth:G,authMapping:o(async e=>({Authorization:`Bearer ${De(e)}`}),"authMapping")})],triggers:[iu]});0&&(module.exports={descript,descriptAuth});
|
|
1
|
+
"use strict";var yu=Object.create;var et=Object.defineProperty;var hu=Object.getOwnPropertyDescriptor;var vu=Object.getOwnPropertyNames;var xu=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty;var o=(e,t)=>et(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Pn=(e,t)=>{for(var r in t)et(e,r,{get:t[r],enumerable:!0})},bn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of vu(t))!_u.call(e,i)&&i!==r&&et(e,i,{get:()=>t[i],enumerable:!(n=hu(t,i))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?yu(xu(e)):{},bn(t||!e||!e.__esModule?et(r,"default",{value:e,enumerable:!0}):r,e)),Pu=e=>bn(et({},"__esModule",{value:!0}),e);var qo=S((Wo,Gt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",p="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${p})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${p})|(?:::)(?:${p})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function g(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let h=0,m=-1,_=(s.match(c.zoneIndex)||[])[0],P,M;for(_&&(_=_.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)h++;if(s.substr(0,2)==="::"&&h--,s.substr(-2,2)==="::"&&h--,h>d)return null;for(M=d-h,P=":";M--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let ne=s.split(":"),ce=[];for(let _e=0;_e<ne.length;_e++)ce.push(parseInt(ne[_e],16));return ce})(),{parts:d,zoneId:_}}o(g,"expandIPv6");function v(s,d,h,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let _=0,P;for(;m>0;){if(P=h-m,P<0&&(P=0),s[_]>>P!==d[_]>>P)return!1;m-=h,_+=1}return!0}o(v,"matchCIDR");function y(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(y,"parseIntAuto");function b(s,d){for(;s.length<d;)s=`0${s}`;return s}o(b,"padPart");let x={};x.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let h,m;for(h=0;h<d.length;h++)if(m=d[h],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,h){let m;if(h===void 0&&(m=d,d=m[0],h=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return v(this.octets,d.octets,8,h)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,h=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},_,P,M;for(_=3;_>=0;_-=1)if(P=this.octets[_],P in m){if(M=m[P],h&&M!==0)return null;M!==8&&(h=!0),d+=M}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),h=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<4;)_.push(parseInt(h[P],10)|parseInt(m[P],10)^255),P++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,h,m,_,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],h=0;h<4;)_.push(parseInt(m[h],10)&parseInt(P[h],10)),h++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let h=parseInt(d[2]);if(h>=0&&h<=32){let m=[this.parse(d[1]),h];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let d,h,m;if(d=s.match(r.fourOctet))return(function(){let _=d.slice(1,6),P=[];for(let M=0;M<_.length;M++)h=_[M],P.push(y(h));return P})();if(d=s.match(r.longValue)){if(m=y(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let _=[],P;for(P=0;P<=24;P+=8)_.push(m>>P&255);return _})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let _=d.slice(1,4),P=[];if(m=y(_[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(y(_[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=s.match(r.threeOctet))?(function(){let _=d.slice(1,5),P=[];if(m=y(_[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(y(_[0])),P.push(y(_[1])),P.push(m>>8&255),P.push(m&255),P})():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],h=0,m=Math.floor(s/8);for(;h<m;)d[h]=255,h++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=(function(){function s(d,h){let m,_;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(_=this.parts[m],!(0<=_&&_<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");h&&(this.zoneId=h)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,h){let m;if(h===void 0&&(m=d,d=m[0],h=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return v(this.parts,d.parts,16,h)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,h=!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},_,P;for(let M=7;M>=0;M-=1)if(_=this.parts[M],_ in m){if(P=m[_],h&&P!==0)return null;P!==16&&(h=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,h=[],m=this.parts;for(let _=0;_<m.length;_++)d=m[_],h.push(d>>8),h.push(d&255);return h},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let _=0;_<this.parts.length;_++)m.push(b(this.parts[_].toString(16),4));return m}).call(this).join(":"),h="";return this.zoneId&&(h=`%${this.zoneId}`),d+h},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),h=d[0],m=d[1];return new x.IPv4([h>>8,h&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let _=0;_<this.parts.length;_++)m.push(this.parts[_].toString(16));return m}).call(this).join(":"),h="";return this.zoneId&&(h=`%${this.zoneId}`),d+h},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,h=this.toNormalizedString(),m=0,_=-1,P;for(;P=d.exec(h);)P[0].length>_&&(m=P.index,_=P[0].length);return _<0?h:`${h.substring(0,m)}::${h.substring(m+_)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),h=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<16;)_.push(parseInt(h[P],10)|parseInt(m[P],10)^255),P++;return new this(_)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,h,m,_,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],h=0;h<16;)_.push(parseInt(m[h],10)&parseInt(P[h],10)),h++;return new this(_)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},x.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(s){let d,h,m;if((h=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(h[2]),d>=0&&d<=128))return m=[this.parse(h[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let d,h,m,_,P,M;if(m=s.match(c.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(c.native.test(s))return g(s,8);if((m=s.match(c.transitional))&&(M=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=g(d+M,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],h=0;h<P.length;h++)if(_=P[h],!(0<=_&&_<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0,m=Math.floor(s/8);for(;h<m;)d[h]=255,h++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,h){let m,_,P,M;h==null&&(h="unicast");for(_ in d)if(Object.prototype.hasOwnProperty.call(d,_)){for(P=d[_],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(M=P[m],s.kind()===M[0].kind()&&s.match.apply(s,M))return _}return h},typeof Gt<"u"&&Gt.exports?Gt.exports=x:e.ipaddr=x})(Wo)});var Qi=S((ez,Yi)=>{var Xi=require("stream").Stream,il=require("util");Yi.exports=ue;function ue(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ue,"DelayedStream");il.inherits(ue,Xi);ue.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ue.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ue.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ue.prototype.resume=function(){this._released||this.release(),this.source.resume()};ue.prototype.pause=function(){this.source.pause()};ue.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ue.prototype.pipe=function(){var e=Xi.prototype.pipe.apply(this,arguments);return this.resume(),e};ue.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};ue.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var na=S((rz,ra)=>{var al=require("util"),ta=require("stream").Stream,ea=Qi();ra.exports=J;function J(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(J,"CombinedStream");al.inherits(J,ta);J.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};J.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};J.prototype.append=function(e){var t=J.isStreamLike(e);if(t){if(!(e instanceof ea)){var r=ea.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};J.prototype.pipe=function(e,t){return ta.prototype.pipe.call(this,e,t),this.resume(),e};J.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};J.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=J.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};J.prototype._pipeNext=function(e){this._currentStream=e;var t=J.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};J.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};J.prototype.write=function(e){this.emit("data",e)};J.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};J.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};J.prototype.end=function(){this._reset(),this.emit("end")};J.prototype.destroy=function(){this._reset(),this.emit("close")};J.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};J.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};J.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};J.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ia=S((oz,oa)=>{"use strict";oa.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 ua=S(re=>{"use strict";var Xt=ia(),sl=require("path").extname,aa=/^\s*([^;\s]*)(?:;|\s|$)/,ul=/^text\//i;re.charset=sa;re.charsets={lookup:sa};re.contentType=cl;re.extension=pl;re.extensions=Object.create(null);re.lookup=ll;re.types=Object.create(null);dl(re.extensions,re.types);function sa(e){if(!e||typeof e!="string")return!1;var t=aa.exec(e),r=t&&Xt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&ul.test(t[1])?"UTF-8":!1}o(sa,"charset");function cl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?re.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=re.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(cl,"contentType");function pl(e){if(!e||typeof e!="string")return!1;var t=aa.exec(e),r=t&&re.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(pl,"extension");function ll(e){if(!e||typeof e!="string")return!1;var t=sl("x."+e).toLowerCase().substr(1);return t&&re.types[t]||!1}o(ll,"lookup");function dl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Xt).forEach(o(function(i){var u=Xt[i],p=u.extensions;if(!(!p||!p.length)){e[i]=p;for(var c=0;c<p.length;c++){var g=p[c];if(t[g]){var v=r.indexOf(Xt[t[g]].source),y=r.indexOf(u.source);if(t[g]!=="application/octet-stream"&&(v>y||v===y&&t[g].substr(0,12)==="application/"))continue}t[g]=i}}},"forEachMimeType"))}o(dl,"populateMaps")});var pa=S((sz,ca)=>{ca.exports=ml;function ml(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(ml,"defer")});var Jr=S((cz,da)=>{var la=pa();da.exports=fl;function fl(e){var t=!1;return la(function(){t=!0}),o(function(n,i){t?e(n,i):la(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(fl,"async")});var Kr=S((lz,ma)=>{ma.exports=gl;function gl(e){Object.keys(e.jobs).forEach(yl.bind(e)),e.jobs={}}o(gl,"abort");function yl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(yl,"clean")});var Xr=S((mz,ga)=>{var fa=Jr(),hl=Kr();ga.exports=vl;function vl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=xl(t,i,e[i],function(u,p){i in r.jobs&&(delete r.jobs[i],u?hl(r):r.results[i]=p,n(u,r.results))})}o(vl,"iterate");function xl(e,t,r,n){var i;return e.length==2?i=e(r,fa(n)):i=e(r,t,fa(n)),i}o(xl,"runJob")});var Yr=S((gz,ya)=>{ya.exports=_l;function _l(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(_l,"state")});var Qr=S((hz,ha)=>{var Pl=Kr(),bl=Jr();ha.exports=Tl;function Tl(e){Object.keys(this.jobs).length&&(this.index=this.size,Pl(this),bl(e)(null,this.results))}o(Tl,"terminator")});var xa=S((xz,va)=>{var Il=Xr(),El=Yr(),Sl=Qr();va.exports=Al;function Al(e,t,r){for(var n=El(e);n.index<(n.keyedList||e).length;)Il(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Sl.bind(n,r)}o(Al,"parallel")});var en=S((Pz,Yt)=>{var _a=Xr(),$l=Yr(),zl=Qr();Yt.exports=Ol;Yt.exports.ascending=Pa;Yt.exports.descending=wl;function Ol(e,t,r,n){var i=$l(e,r);return _a(e,t,i,o(function u(p,c){if(p){n(p,c);return}if(i.index++,i.index<(i.keyedList||e).length){_a(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),zl.bind(i,n)}o(Ol,"serialOrdered");function Pa(e,t){return e<t?-1:e>t?1:0}o(Pa,"ascending");function wl(e,t){return-1*Pa(e,t)}o(wl,"descending")});var Ta=S((Tz,ba)=>{var kl=en();ba.exports=Rl;function Rl(e,t,r){return kl(e,t,null,r)}o(Rl,"serial")});var Ea=S((Ez,Ia)=>{Ia.exports={parallel:xa(),serial:Ta(),serialOrdered:en()}});var tn=S((Sz,Sa)=>{"use strict";Sa.exports=Object});var $a=S((Az,Aa)=>{"use strict";Aa.exports=Error});var Oa=S(($z,za)=>{"use strict";za.exports=EvalError});var ka=S((zz,wa)=>{"use strict";wa.exports=RangeError});var Da=S((Oz,Ra)=>{"use strict";Ra.exports=ReferenceError});var Ca=S((wz,Na)=>{"use strict";Na.exports=SyntaxError});var Qt=S((kz,Ua)=>{"use strict";Ua.exports=TypeError});var Ma=S((Rz,ja)=>{"use strict";ja.exports=URIError});var Fa=S((Dz,La)=>{"use strict";La.exports=Math.abs});var Va=S((Nz,Ba)=>{"use strict";Ba.exports=Math.floor});var Ha=S((Cz,Za)=>{"use strict";Za.exports=Math.max});var Wa=S((Uz,Ga)=>{"use strict";Ga.exports=Math.min});var Ja=S((jz,qa)=>{"use strict";qa.exports=Math.pow});var Xa=S((Mz,Ka)=>{"use strict";Ka.exports=Math.round});var Qa=S((Lz,Ya)=>{"use strict";Ya.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ts=S((Bz,es)=>{"use strict";var Dl=Qa();es.exports=o(function(t){return Dl(t)||t===0?t:t<0?-1:1},"sign")});var ns=S((Zz,rs)=>{"use strict";rs.exports=Object.getOwnPropertyDescriptor});var rn=S((Hz,os)=>{"use strict";var er=ns();if(er)try{er([],"length")}catch{er=null}os.exports=er});var as=S((Gz,is)=>{"use strict";var tr=Object.defineProperty||!1;if(tr)try{tr({},"a",{value:1})}catch{tr=!1}is.exports=tr});var nn=S((Wz,ss)=>{"use strict";ss.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var p=Object.getOwnPropertySymbols(t);if(p.length!==1||p[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(t,r);if(c.value!==i||c.enumerable!==!0)return!1}return!0},"hasSymbols")});var ps=S((Jz,cs)=>{"use strict";var us=typeof Symbol<"u"&&Symbol,Nl=nn();cs.exports=o(function(){return typeof us!="function"||typeof Symbol!="function"||typeof us("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Nl()},"hasNativeSymbols")});var on=S((Xz,ls)=>{"use strict";ls.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var an=S((Yz,ds)=>{"use strict";var Cl=tn();ds.exports=Cl.getPrototypeOf||null});var gs=S((Qz,fs)=>{"use strict";var Ul="Function.prototype.bind called on incompatible ",jl=Object.prototype.toString,Ml=Math.max,Ll="[object Function]",ms=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Fl=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),Bl=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");fs.exports=o(function(t){var r=this;if(typeof r!="function"||jl.apply(r)!==Ll)throw new TypeError(Ul+r);for(var n=Fl(arguments,1),i,u=o(function(){if(this instanceof i){var y=r.apply(this,ms(n,arguments));return Object(y)===y?y:this}return r.apply(t,ms(n,arguments))},"binder"),p=Ml(0,r.length-n.length),c=[],g=0;g<p;g++)c[g]="$"+g;if(i=Function("binder","return function ("+Bl(c,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var v=o(function(){},"Empty");v.prototype=r.prototype,i.prototype=new v,v.prototype=null}return i},"bind")});var Je=S((tO,ys)=>{"use strict";var Vl=gs();ys.exports=Function.prototype.bind||Vl});var rr=S((rO,hs)=>{"use strict";hs.exports=Function.prototype.call});var sn=S((nO,vs)=>{"use strict";vs.exports=Function.prototype.apply});var _s=S((oO,xs)=>{"use strict";xs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var bs=S((iO,Ps)=>{"use strict";var Zl=Je(),Hl=sn(),Gl=rr(),Wl=_s();Ps.exports=Wl||Zl.call(Gl,Hl)});var Is=S((aO,Ts)=>{"use strict";var ql=Je(),Jl=Qt(),Kl=rr(),Xl=bs();Ts.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Jl("a function is required");return Xl(ql,Kl,t)},"callBindBasic")});var Os=S((uO,zs)=>{"use strict";var Yl=Is(),Es=rn(),As;try{As=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var un=!!As&&Es&&Es(Object.prototype,"__proto__"),$s=Object,Ss=$s.getPrototypeOf;zs.exports=un&&typeof un.get=="function"?Yl([un.get]):typeof Ss=="function"?o(function(t){return Ss(t==null?t:$s(t))},"getDunder"):!1});var Ns=S((pO,Ds)=>{"use strict";var ws=on(),ks=an(),Rs=Os();Ds.exports=ws?o(function(t){return ws(t)},"getProto"):ks?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ks(t)},"getProto"):Rs?o(function(t){return Rs(t)},"getProto"):null});var cn=S((dO,Cs)=>{"use strict";var Ql=Function.prototype.call,ed=Object.prototype.hasOwnProperty,td=Je();Cs.exports=td.call(Ql,ed)});var Vs=S((mO,Bs)=>{"use strict";var j,rd=tn(),nd=$a(),od=Oa(),id=ka(),ad=Da(),Qe=Ca(),Ye=Qt(),sd=Ma(),ud=Fa(),cd=Va(),pd=Ha(),ld=Wa(),dd=Ja(),md=Xa(),fd=ts(),Ls=Function,pn=o(function(e){try{return Ls('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),bt=rn(),gd=as(),ln=o(function(){throw new Ye},"throwTypeError"),yd=bt?(function(){try{return arguments.callee,ln}catch{try{return bt(arguments,"callee").get}catch{return ln}}})():ln,Ke=ps()(),ee=Ns(),hd=an(),vd=on(),Fs=sn(),Tt=rr(),Xe={},xd=typeof Uint8Array>"u"||!ee?j:ee(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?j:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?j:ArrayBuffer,"%ArrayIteratorPrototype%":Ke&&ee?ee([][Symbol.iterator]()):j,"%AsyncFromSyncIteratorPrototype%":j,"%AsyncFunction%":Xe,"%AsyncGenerator%":Xe,"%AsyncGeneratorFunction%":Xe,"%AsyncIteratorPrototype%":Xe,"%Atomics%":typeof Atomics>"u"?j:Atomics,"%BigInt%":typeof BigInt>"u"?j:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?j:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?j:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?j:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":nd,"%eval%":eval,"%EvalError%":od,"%Float16Array%":typeof Float16Array>"u"?j:Float16Array,"%Float32Array%":typeof Float32Array>"u"?j:Float32Array,"%Float64Array%":typeof Float64Array>"u"?j:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?j:FinalizationRegistry,"%Function%":Ls,"%GeneratorFunction%":Xe,"%Int8Array%":typeof Int8Array>"u"?j:Int8Array,"%Int16Array%":typeof Int16Array>"u"?j:Int16Array,"%Int32Array%":typeof Int32Array>"u"?j:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ke&&ee?ee(ee([][Symbol.iterator]())):j,"%JSON%":typeof JSON=="object"?JSON:j,"%Map%":typeof Map>"u"?j:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ke||!ee?j:ee(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":rd,"%Object.getOwnPropertyDescriptor%":bt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?j:Promise,"%Proxy%":typeof Proxy>"u"?j:Proxy,"%RangeError%":id,"%ReferenceError%":ad,"%Reflect%":typeof Reflect>"u"?j:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?j:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ke||!ee?j:ee(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?j:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ke&&ee?ee(""[Symbol.iterator]()):j,"%Symbol%":Ke?Symbol:j,"%SyntaxError%":Qe,"%ThrowTypeError%":yd,"%TypedArray%":xd,"%TypeError%":Ye,"%Uint8Array%":typeof Uint8Array>"u"?j:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?j:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?j:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?j:Uint32Array,"%URIError%":sd,"%WeakMap%":typeof WeakMap>"u"?j:WeakMap,"%WeakRef%":typeof WeakRef>"u"?j:WeakRef,"%WeakSet%":typeof WeakSet>"u"?j:WeakSet,"%Function.prototype.call%":Tt,"%Function.prototype.apply%":Fs,"%Object.defineProperty%":gd,"%Object.getPrototypeOf%":hd,"%Math.abs%":ud,"%Math.floor%":cd,"%Math.max%":pd,"%Math.min%":ld,"%Math.pow%":dd,"%Math.round%":md,"%Math.sign%":fd,"%Reflect.getPrototypeOf%":vd};if(ee)try{null.error}catch(e){Us=ee(ee(e)),Ne["%Error.prototype%"]=Us}var Us,_d=o(function e(t){var r;if(t==="%AsyncFunction%")r=pn("async function () {}");else if(t==="%GeneratorFunction%")r=pn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=pn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&ee&&(r=ee(i.prototype))}return Ne[t]=r,r},"doEval"),js={__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"]},It=Je(),nr=cn(),Pd=It.call(Tt,Array.prototype.concat),bd=It.call(Fs,Array.prototype.splice),Ms=It.call(Tt,String.prototype.replace),or=It.call(Tt,String.prototype.slice),Td=It.call(Tt,RegExp.prototype.exec),Id=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ed=/\\(\\)?/g,Sd=o(function(t){var r=or(t,0,1),n=or(t,-1);if(r==="%"&&n!=="%")throw new Qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Qe("invalid intrinsic syntax, expected opening `%`");var i=[];return Ms(t,Id,function(u,p,c,g){i[i.length]=c?Ms(g,Ed,"$1"):p||u}),i},"stringToPath"),Ad=o(function(t,r){var n=t,i;if(nr(js,n)&&(i=js[n],n="%"+i[0]+"%"),nr(Ne,n)){var u=Ne[n];if(u===Xe&&(u=_d(n)),typeof u>"u"&&!r)throw new Ye("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Qe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Bs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ye("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ye('"allowMissing" argument must be a boolean');if(Td(/^%?[^%]*%?$/,t)===null)throw new Qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Sd(t),i=n.length>0?n[0]:"",u=Ad("%"+i+"%",r),p=u.name,c=u.value,g=!1,v=u.alias;v&&(i=v[0],bd(n,Pd([0,1],v)));for(var y=1,b=!0;y<n.length;y+=1){var x=n[y],s=or(x,0,1),d=or(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Qe("property names with quotes must have matching quotes");if((x==="constructor"||!b)&&(g=!0),i+="."+x,p="%"+i+"%",nr(Ne,p))c=Ne[p];else if(c!=null){if(!(x in c)){if(!r)throw new Ye("base intrinsic for "+t+" exists, but the property is not available.");return}if(bt&&y+1>=n.length){var h=bt(c,x);b=!!h,b&&"get"in h&&!("originalValue"in h.get)?c=h.get:c=c[x]}else b=nr(c,x),c=c[x];b&&!g&&(Ne[p]=c)}}return c},"GetIntrinsic")});var Hs=S((gO,Zs)=>{"use strict";var $d=nn();Zs.exports=o(function(){return $d()&&!!Symbol.toStringTag},"hasToStringTagShams")});var qs=S((hO,Ws)=>{"use strict";var zd=Vs(),Gs=zd("%Object.defineProperty%",!0),Od=Hs()(),wd=cn(),kd=Qt(),ir=Od?Symbol.toStringTag:null;Ws.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new kd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ir&&(n||!wd(t,ir))&&(Gs?Gs(t,ir,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ir]=r)},"setToStringTag")});var Ks=S((xO,Js)=>{"use strict";var Rd=Function.prototype.call,Dd=Object.prototype.hasOwnProperty,Nd=Je();Js.exports=Nd.call(Rd,Dd)});var Ys=S((_O,Xs)=>{"use strict";Xs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var tu=S((PO,eu)=>{"use strict";var gn=na(),Cd=require("util"),dn=require("path"),Ud=require("http"),jd=require("https"),Md=require("url").parse,Ld=require("fs"),Fd=require("stream").Stream,Bd=require("crypto"),mn=ua(),Vd=Ea(),Zd=qs(),ke=Ks(),fn=Ys();function Qs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Qs,"escapeHeaderParam");function B(e){if(!(this instanceof B))return new B(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],gn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(B,"FormData");Cd.inherits(B,gn);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=gn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};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 Fd))&&(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)):Ld.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):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),i=this._getContentType(t,r),u="",p={"Content-Disposition":["form-data",'name="'+Qs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&fn(p,r.header);var c;for(var g in p)if(ke(p,g)){if(c=p[g],c==null)continue;Array.isArray(c)||(c=[c]),c.length&&(u+=g+": "+c.join("; ")+B.LINE_BREAK)}return"--"+this.getBoundary()+B.LINE_BREAK+u+B.LINE_BREAK};B.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=dn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=dn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ke(e,"httpVersion")&&(r=dn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Qs(r)+'"'};B.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=mn.lookup(e.name)),!r&&e&&e.path&&(r=mn.lookup(e.path)),!r&&e&&e.readable&&ke(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=mn.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="--------------------------"+Bd.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}Vd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};B.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Md(e),n=fn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=fn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=jd.request(n):r=Ud.request(n),this.getLength(function(u,p){if(u&&u!=="Unknown stream"){this._error(u);return}if(p&&r.setHeader("Content-Length",p),this.pipe(r),t){var c,g=o(function(v,y){return r.removeListener("error",g),r.removeListener("response",c),t.call(this,v,y)},"callback");c=g.bind(this,null),r.on("error",g),r.on("response",c)}}.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]"};Zd(B.prototype,"FormData");eu.exports=B});var om={};Pn(om,{descript:()=>nm,descriptAuth:()=>W});module.exports=Pu(om);var bu=Object.freeze({status:"aborted"});function I(e,t,r){function n(c,g){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:g,constr:p,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,g);let v=p.prototype,y=Object.keys(v);for(let b=0;b<y.length;b++){let x=y[b];x in c||(c[x]=v[x].bind(c))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function p(c){var g;let v=r?.Parent?new u:this;n(v,c),(g=v._zod).deferred??(g.deferred=[]);for(let y of v._zod.deferred)y();return v}return o(p,"_"),Object.defineProperty(p,"init",{value:n}),Object.defineProperty(p,Symbol.hasInstance,{value:o(c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(e),"value")}),Object.defineProperty(p,"name",{value:e}),p}o(I,"$constructor");var pe=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},St=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ur={};function fe(e){return e&&Object.assign(ur,e),ur}o(fe,"config");function pr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(pr,"getEnumValues");function In(e,t){return typeof t=="bigint"?t.toString():t}o(In,"jsonStringifyReplacer");function $t(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o($t,"cached");function En(e){return e==null}o(En,"nullish");function zt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(zt,"cleanRegex");var Tn=Symbol("evaluating");function X(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Tn)return n===void 0&&(n=Tn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(X,"defineLazy");var lr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(tt,"isObject");var Tu=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Sn(e){if(tt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(tt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Sn,"isPlainObject");var An=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(je,"escapeRegex");function Ot(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Ot,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(Z,"normalizeParams");function $n(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o($n,"optionalKeys");var zn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Me(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Me,"aborted");function be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(be,"prefixIssues");function At(e){return typeof e=="string"?e:e?.message}o(At,"unwrapMessage");function Te(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=At(e.inst?._zod.def?.error?.(e))??At(t?.error?.(e))??At(r.customError?.(e))??At(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Te,"finalizeIssue");function On(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(On,"getLengthableOrigin");function dr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(dr,"issue");var wn=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,In,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),kn=I("$ZodError",wn),rt=I("$ZodError",wn,{Parent:Error});var Eu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},p=t._zod.run({value:r,issues:[]},u);if(p instanceof Promise)throw new pe;if(p.issues.length){let c=new(i?.Err??e)(p.issues.map(g=>Te(g,u,fe())));throw lr(c,i?.callee),c}return p.value},"_parse"),wt=Eu(rt),Su=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},p=t._zod.run({value:r,issues:[]},u);if(p instanceof Promise&&(p=await p),p.issues.length){let c=new(i?.Err??e)(p.issues.map(g=>Te(g,u,fe())));throw lr(c,i?.callee),c}return p.value},"_parseAsync"),kt=Su(rt),Au=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new pe;return u.issues.length?{success:!1,error:new(e??kn)(u.issues.map(p=>Te(p,i,fe())))}:{success:!0,data:u.value}},"_safeParse"),nt=Au(rt),$u=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(p=>Te(p,i,fe())))}:{success:!0,data:u.value}},"_safeParseAsync"),ot=$u(rt);var zu="(?:(?:\\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])))",Ou=new RegExp(`^${zu}$`);var Rn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Dn=/^-?\d+n?$/,Nn=/^-?\d+$/,mr=/^-?\d+(?:\.\d+)?$/,Cn=/^(?:true|false)$/i;var Ie=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),wu={number:"number",bigint:"bigint",object:"date"};var Un=I("$ZodCheckGreaterThan",(e,t)=>{Ie.init(e,t);let r=wu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var jn=I("$ZodCheckNumberFormat",(e,t)=>{Ie.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=zn[t.format];e._zod.onattach.push(p=>{let c=p._zod.bag;c.format=t.format,c.minimum=i,c.maximum=u,r&&(c.pattern=Nn)}),e._zod.check=p=>{let c=p.value;if(r){if(!Number.isInteger(c)){p.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?p.issues.push({input:c,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}):p.issues.push({input:c,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}}c<i&&p.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>u&&p.issues.push({origin:"number",input:c,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Mn=I("$ZodCheckMinLength",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!En(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let p=On(i);n.issues.push({origin:p,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var fr=I("$ZodCheckStringFormat",(e,t)=>{var r,n;Ie.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Ln=I("$ZodCheckRegex",(e,t)=>{fr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Bn={major:4,minor:3,patch:6};var q=I("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Bn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((p,c,g)=>{let v=Me(p),y;for(let b of c){if(b._zod.def.when){if(!b._zod.def.when(p))continue}else if(v)continue;let x=p.issues.length,s=b._zod.check(p);if(s instanceof Promise&&g?.async===!1)throw new pe;if(y||s instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await s,p.issues.length!==x&&(v||(v=Me(p,x)))});else{if(p.issues.length===x)continue;v||(v=Me(p,x))}}return y?y.then(()=>p):p},"runChecks"),u=o((p,c,g)=>{if(Me(p))return p.aborted=!0,p;let v=i(c,n,g);if(v instanceof Promise){if(g.async===!1)throw new pe;return v.then(y=>e._zod.parse(y,g))}return e._zod.parse(v,g)},"handleCanaryResult");e._zod.run=(p,c)=>{if(c.skipChecks)return e._zod.parse(p,c);if(c.direction==="backward"){let v=e._zod.parse({value:p.value,issues:[]},{...c,skipChecks:!0});return v instanceof Promise?v.then(y=>u(y,p,c)):u(v,p,c)}let g=e._zod.parse(p,c);if(g instanceof Promise){if(c.async===!1)throw new pe;return g.then(v=>i(v,n,c))}return i(g,n,c)}}X(e,"~standard",()=>({validate:o(i=>{try{let u=nt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return ot(e,i).then(p=>p.success?{value:p.data}:{issues:p.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nt=I("$ZodString",(e,t)=>{q.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Rn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),gr=I("$ZodStringFormat",(e,t)=>{fr.init(e,t),Nt.init(e,t)});var Wn=I("$ZodURL",(e,t)=>{gr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var yr=I("$ZodNumber",(e,t)=>{q.init(e,t),e._zod.pattern=e._zod.bag.pattern??mr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),qn=I("$ZodNumberFormat",(e,t)=>{jn.init(e,t),yr.init(e,t)}),hr=I("$ZodBoolean",(e,t)=>{q.init(e,t),e._zod.pattern=Cn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Jn=I("$ZodBigInt",(e,t)=>{q.init(e,t),e._zod.pattern=Dn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Kn=I("$ZodAny",(e,t)=>{q.init(e,t),e._zod.parse=r=>r}),Xn=I("$ZodUnknown",(e,t)=>{q.init(e,t),e._zod.parse=r=>r});var Yn=I("$ZodVoid",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Qn=I("$ZodDate",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Vn(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}o(Vn,"handleArrayResult");var eo=I("$ZodArray",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let p=0;p<i.length;p++){let c=i[p],g=t.element._zod.run({value:c,issues:[]},n);g instanceof Promise?u.push(g.then(v=>Vn(v,r,p))):Vn(g,r,p)}return u.length?Promise.all(u).then(()=>r):r}});function Dt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Dt,"handlePropertyResult");function ku(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=$n(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(ku,"normalizeDef");function Ru(e,t,r,n,i,u){let p=[],c=i.keySet,g=i.catchall._zod,v=g.def.type,y=g.optout==="optional";for(let b in t){if(c.has(b))continue;if(v==="never"){p.push(b);continue}let x=g.run({value:t[b],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Dt(s,r,b,t,y))):Dt(x,r,b,t,y)}return p.length&&r.issues.push({code:"unrecognized_keys",keys:p,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Ru,"handleCatchall");var to=I("$ZodObject",(e,t)=>{if(q.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let g={...c};return Object.defineProperty(t,"shape",{value:g}),g},"get")})}let n=$t(()=>ku(t));X(e._zod,"propValues",()=>{let c=t.shape,g={};for(let v in c){let y=c[v]._zod;if(y.values){g[v]??(g[v]=new Set);for(let b of y.values)g[v].add(b)}}return g});let i=tt,u=t.catchall,p;e._zod.parse=(c,g)=>{p??(p=n.value);let v=c.value;if(!i(v))return c.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),c;c.value={};let y=[],b=p.shape;for(let x of p.keys){let s=b[x],d=s._zod.optout==="optional",h=s._zod.run({value:v[x],issues:[]},g);h instanceof Promise?y.push(h.then(m=>Dt(m,c,x,v,d))):Dt(h,c,x,v,d)}return u?Ru(y,v,c,g,n.value,e):y.length?Promise.all(y).then(()=>c):c}});function Zn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Me(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(p=>Te(p,n,fe())))}),t)}o(Zn,"handleUnionResults");var vr=I("$ZodUnion",(e,t)=>{q.init(e,t),X(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),X(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),X(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),X(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>zt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let p=!1,c=[];for(let g of t.options){let v=g._zod.run({value:i.value,issues:[]},u);if(v instanceof Promise)c.push(v),p=!0;else{if(v.issues.length===0)return v;c.push(v)}}return p?Promise.all(c).then(g=>Zn(g,i,e,u)):Zn(c,i,e,u)}});var ro=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,vr.init(e,t);let r=e._zod.parse;X(e._zod,"propValues",()=>{let i={};for(let u of t.options){let p=u._zod.propValues;if(!p||Object.keys(p).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[c,g]of Object.entries(p)){i[c]||(i[c]=new Set);for(let v of g)i[c].add(v)}}return i});let n=$t(()=>{let i=t.options,u=new Map;for(let p of i){let c=p._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(p)}"`);for(let g of c){if(u.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);u.set(g,p)}}return u});e._zod.parse=(i,u)=>{let p=i.value;if(!tt(p))return i.issues.push({code:"invalid_type",expected:"object",input:p,inst:e}),i;let c=n.value.get(p?.[t.discriminator]);return c?c._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:p,path:[t.discriminator],inst:e}),i)}});var no=I("$ZodRecord",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Sn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],p=t.keyType._zod.values;if(p){r.value={};let c=new Set;for(let v of p)if(typeof v=="string"||typeof v=="number"||typeof v=="symbol"){c.add(typeof v=="number"?v.toString():v);let y=t.valueType._zod.run({value:i[v],issues:[]},n);y instanceof Promise?u.push(y.then(b=>{b.issues.length&&r.issues.push(...be(v,b.issues)),r.value[v]=b.value})):(y.issues.length&&r.issues.push(...be(v,y.issues)),r.value[v]=y.value)}let g;for(let v in i)c.has(v)||(g=g??[],g.push(v));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:g})}else{r.value={};for(let c of Reflect.ownKeys(i)){if(c==="__proto__")continue;let g=t.keyType._zod.run({value:c,issues:[]},n);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&mr.test(c)&&g.issues.length){let b=t.keyType._zod.run({value:Number(c),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(g=b)}if(g.issues.length){t.mode==="loose"?r.value[c]=i[c]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(b=>Te(b,n,fe())),input:c,path:[c],inst:e});continue}let y=t.valueType._zod.run({value:i[c],issues:[]},n);y instanceof Promise?u.push(y.then(b=>{b.issues.length&&r.issues.push(...be(c,b.issues)),r.value[g.value]=b.value})):(y.issues.length&&r.issues.push(...be(c,y.issues)),r.value[g.value]=y.value)}}return u.length?Promise.all(u).then(()=>r):r}});var oo=I("$ZodEnum",(e,t)=>{q.init(e,t);let r=pr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>An.has(typeof i)).map(i=>typeof i=="string"?je(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let p=i.value;return n.has(p)||i.issues.push({code:"invalid_value",values:r,input:p,inst:e}),i}}),io=I("$ZodLiteral",(e,t)=>{if(q.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?je(n):n?je(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var ao=I("$ZodTransform",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new St(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(p=>(r.value=p,r));if(i instanceof Promise)throw new pe;return r.value=i,r}});function Hn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Hn,"handleOptionalResult");var so=I("$ZodOptional",(e,t)=>{q.init(e,t),e._zod.optin="optional",e._zod.optout="optional",X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Hn(u,r.value)):Hn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var uo=I("$ZodNullable",(e,t)=>{q.init(e,t),X(e._zod,"optin",()=>t.innerType._zod.optin),X(e._zod,"optout",()=>t.innerType._zod.optout),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)}|null)$`):void 0}),X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var co=I("$ZodPipe",(e,t)=>{q.init(e,t),X(e._zod,"values",()=>t.in._zod.values),X(e._zod,"optin",()=>t.in._zod.optin),X(e._zod,"optout",()=>t.out._zod.optout),X(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(p=>Rt(p,t.in,n)):Rt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Rt(u,t.out,n)):Rt(i,t.out,n)}});function Rt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Rt,"handlePipeResult");var po=I("$ZodCustom",(e,t)=>{Ie.init(e,t),q.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Gn(u,r,n,e));Gn(i,r,n,e)}});function Gn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(dr(i))}}o(Gn,"handleRefineResult");var mo;var xr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function fo(){return new xr}o(fo,"registry");(mo=globalThis).__zod_globalRegistry??(mo.__zod_globalRegistry=fo());var _r=globalThis.__zod_globalRegistry;function go(e,t){return new e({type:"string",...Z(t)})}o(go,"_string");function yo(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(yo,"_coercedString");function ho(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(ho,"_url");function vo(e,t){return new e({type:"number",checks:[],...Z(t)})}o(vo,"_number");function xo(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(xo,"_coercedNumber");function _o(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}o(_o,"_int");function Po(e,t){return new e({type:"boolean",...Z(t)})}o(Po,"_boolean");function bo(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(bo,"_coercedBoolean");function To(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(To,"_coercedBigint");function Io(e){return new e({type:"any"})}o(Io,"_any");function Eo(e){return new e({type:"unknown"})}o(Eo,"_unknown");function So(e,t){return new e({type:"void",...Z(t)})}o(So,"_void");function Ao(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o(Ao,"_coercedDate");function Ct(e,t){return new Un({check:"greater_than",...Z(t),value:e,inclusive:!0})}o(Ct,"_gte");function se(e,t){return new Mn({check:"min_length",...Z(t),minimum:e})}o(se,"_minLength");function Ee(e,t){return new Ln({check:"string_format",format:"regex",...Z(t),pattern:e})}o(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})}o($o,"_custom");var Y=I("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");q.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>wt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>nt(e,r,n),e.parseAsync=async(r,n)=>kt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ot(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>Ot(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),jt=I("ZodMiniString",(e,t)=>{Nt.init(e,t),Y.init(e,t)});function a(e){return go(jt,e)}o(a,"string");var zo=I("ZodMiniStringFormat",(e,t)=>{gr.init(e,t),jt.init(e,t)});var Gu=I("ZodMiniURL",(e,t)=>{Wn.init(e,t),zo.init(e,t)});function Oo(e){return ho(Gu,e)}o(Oo,"url");var Mt=I("ZodMiniNumber",(e,t)=>{yr.init(e,t),Y.init(e,t)});function Q(e){return vo(Mt,e)}o(Q,"number");var Wu=I("ZodMiniNumberFormat",(e,t)=>{qn.init(e,t),Mt.init(e,t)});function wo(e){return _o(Wu,e)}o(wo,"int");var Pr=I("ZodMiniBoolean",(e,t)=>{hr.init(e,t),Y.init(e,t)});function F(e){return Po(Pr,e)}o(F,"boolean");var ko=I("ZodMiniBigInt",(e,t)=>{Jn.init(e,t),Y.init(e,t)});var qu=I("ZodMiniAny",(e,t)=>{Kn.init(e,t),Y.init(e,t)});function at(){return Io(qu)}o(at,"any");var Ju=I("ZodMiniUnknown",(e,t)=>{Xn.init(e,t),Y.init(e,t)});function D(){return Eo(Ju)}o(D,"unknown");var Ku=I("ZodMiniVoid",(e,t)=>{Yn.init(e,t),Y.init(e,t)});function Ro(e){return So(Ku,e)}o(Ro,"_void");var Do=I("ZodMiniDate",(e,t)=>{Qn.init(e,t),Y.init(e,t)});var Xu=I("ZodMiniArray",(e,t)=>{eo.init(e,t),Y.init(e,t)});function O(e,t){return new Xu({type:"array",element:e,...Z(t)})}o(O,"array");var Yu=I("ZodMiniObject",(e,t)=>{to.init(e,t),Y.init(e,t),X(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...Z(t)};return new Yu(r)}o(l,"object");var Qu=I("ZodMiniUnion",(e,t)=>{vr.init(e,t),Y.init(e,t)});function U(e,t){return new Qu({type:"union",options:e,...Z(t)})}o(U,"union");var ec=I("ZodMiniDiscriminatedUnion",(e,t)=>{ro.init(e,t),Y.init(e,t)});function Se(e,t,r){return new ec({type:"union",options:t,discriminator:e,...Z(r)})}o(Se,"discriminatedUnion");var tc=I("ZodMiniRecord",(e,t)=>{no.init(e,t),Y.init(e,t)});function N(e,t,r){return new tc({type:"record",keyType:e,valueType:t,...Z(r)})}o(N,"record");var rc=I("ZodMiniEnum",(e,t)=>{oo.init(e,t),Y.init(e,t),e.options=Object.values(t.entries)});function $(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new rc({type:"enum",entries:r,...Z(t)})}o($,"_enum");var nc=I("ZodMiniLiteral",(e,t)=>{io.init(e,t),Y.init(e,t)});function A(e,t){return new nc({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o(A,"literal");var oc=I("ZodMiniTransform",(e,t)=>{ao.init(e,t),Y.init(e,t)});function Ae(e){return new oc({type:"transform",transform:e})}o(Ae,"transform");var ic=I("ZodMiniOptional",(e,t)=>{so.init(e,t),Y.init(e,t)});function f(e){return new ic({type:"optional",innerType:e})}o(f,"optional");var ac=I("ZodMiniNullable",(e,t)=>{uo.init(e,t),Y.init(e,t)});function st(e){return new ac({type:"nullable",innerType:e})}o(st,"nullable");var sc=I("ZodMiniPipe",(e,t)=>{co.init(e,t),Y.init(e,t)});function $e(e,t){return new sc({type:"pipe",in:e,out:t})}o($e,"pipe");var uc=I("ZodMiniCustom",(e,t)=>{po.init(e,t),Y.init(e,t)});function Lt(e,t){return $o(uc,e??(()=>!0),t)}o(Lt,"custom");var ut={};Pn(ut,{bigint:()=>fc,boolean:()=>mc,date:()=>gc,number:()=>dc,string:()=>lc});function lc(e){return yo(jt,e)}o(lc,"string");function dc(e){return xo(Mt,e)}o(dc,"number");function mc(e){return bo(Pr,e)}o(mc,"boolean");function fc(e){return To(ko,e)}o(fc,"bigint");function gc(e){return Ao(Do,e)}o(gc,"date");var Tr=l({retryOnFailure:l({defaultValue:f(F()),hide:f(F())}),continueOnFailure:l({defaultValue:f(F()),hide:f(F())})}),br=class{constructor(t,r,n,i,u,p,c,g,v,y,b,x,s){this.name=t;this.displayName=r;this.description=n;this.props=i;this.propertyGroups=u;this.run=p;this.test=c;this.requireAuth=g;this.errorHandlingOptions=v;this.outputSchema=y;this.audience=b;this.aiMetadata=x;this.classification=s}static{o(this,"IAction")}},te=o(e=>new br(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=l({displayName:a(),description:f(a()),advanced:f(F()),width:f($(["half","full"])),icon:f(a()),placeholder:f(a())}),C=o((e,t)=>l({type:A(t),required:F(),defaultValue:f(at())}),"TPropertyValue");var oe=l({...L.shape,...C(a(),"SHORT_TEXT").shape}),ge=l({...L.shape,...C(a(),"LONG_TEXT").shape});var Co=l({label:a(),value:D(),description:f(a()),icon:f(a())}),Ft=l({disabled:f(F()),placeholder:f(a()),options:O(Co)});var hc=$(["cards"]),ie=l({...L.shape,options:Ft,display:f(hc),...C(D(),"STATIC_DROPDOWN").shape}),ye=l({...L.shape,options:Ft,...C(O(D()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Ir=l({...L.shape,...C(D(),"DROPDOWN").shape,refreshers:O(a())}),ct=l({...L.shape,...C(O(D()),"MULTI_SELECT_DROPDOWN").shape,refreshers:O(a())});var he=l({...L.shape,reveals:f(O(a())),...C(F(),"CHECKBOX").shape});var ve=l({...L.shape,display:f($(["stepper"])),min:f(Q()),max:f(Q()),step:f(Q()),...C(Q(),"NUMBER").shape});var pt=l({...L.shape,streaming:f(F()),...C(D(),"FILE").shape});var lt=l({...L.shape,...C(a(),"DATE_TIME").shape});var Uo=N(a(),U([oe,ge,ie,ct,ye,he,ve,pt,lt])),dt=l({...L.shape,properties:Uo,...C(O(D()),"ARRAY").shape});var jo=$(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Mo=l({preset:f(jo),after:f(a()),before:f(a())}),Er=l({...L.shape,display:f($(["dropdown"])),...C(Mo,"DATE_RANGE").shape});var mt=l({...L.shape,...C(U([N(a(),D())]),"JSON").shape});var Lo=U([oe,ie,mt,dt,ye]),vc=N(a(),Lo),Sr=l({refreshers:O(a()),...L.shape,...C(D(),"DYNAMIC").shape});var Bt=l({...L.shape,...C(Ro(),"MARKDOWN").shape});var ft=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ft||{}),Le=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Le||{}),Fe=(_=>(_.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",_.COMMUNICATION="COMMUNICATION",_.COMMERCE="COMMERCE",_.CORE="CORE",_.UNIVERSAL_AI="UNIVERSAL_AI",_.FLOW_CONTROL="FLOW_CONTROL",_.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",_.ACCOUNTING="ACCOUNTING",_.PRODUCTIVITY="PRODUCTIVITY",_.CONTENT_AND_FILES="CONTENT_AND_FILES",_.DEVELOPER_TOOLS="DEVELOPER_TOOLS",_.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",_.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",_.HUMAN_RESOURCES="HUMAN_RESOURCES",_.PAYMENT_PROCESSING="PAYMENT_PROCESSING",_.MARKETING="MARKETING",_.SALES_AND_CRM="SALES_AND_CRM",_))(Fe||{});var gt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(gt||{}),Ar="both_client_credentials_and_authorization_code";var ze=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ze||{}),yt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(yt||{}),xc=l({strategy:$(yt),paramName:f(a())}),ht=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ht||{});var Vt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Vt||{}),Fo=l({status:f(Q()),body:f(D()),headers:f(N(a(),a()))}),Bo=l({type:A("DELAY"),resumeDateTime:a(),requestIdToReply:f(a()),handlerId:f(a()),streamStepProgress:f($(Vt))}),Vo=l({type:A("WEBHOOK"),requestId:a(),requestIdToReply:f(a()),response:Fo,handlerId:f(a()),streamStepProgress:f($(Vt))}),_c=U([Bo,Vo]);var Pc=l({body:D(),rawBody:f(D()),headers:N(a(),a()),queryParams:N(a(),a())});function K(e){return e==null}o(K,"isNil");function vt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(vt,"isEmpty");function Zt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Zt,"assertNotNullOrUndefined");var $r=Ue(require("crypto"),1);var bc=128,Oe,Be,Tc=o(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*bc),$r.default.randomFillSync(Oe),Be=0):Be+e>Oe.length&&($r.default.randomFillSync(Oe),Be=0)}catch(t){throw Oe=void 0,t}Be+=e},"fillPool"),Ic=o(e=>(Tc(e|=0),Oe.subarray(Be-e,Be)),"random"),Ec=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{if(u<=0)return"";let p="";for(;;){let c=r(i),g=i;for(;g--;)if(p+=e[c[g]&n]||"",p.length===u)return p}}},"customRandom"),Ho=o((e,t=21)=>Ec(e,t,Ic),"customAlphabet");var Sc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Go=21,Vb=a().check(Ee(new RegExp(`^[0-9a-zA-Z]{${Go}}$`))),Ac=Ho(Sc,Go);var we=$e(Ae(e=>e instanceof Date?e.toISOString():e),a()),ae={id:a(),created:we,updated:we},G=o(e=>f(st(e)),"Nullable");function zr(e){return f(st($(e)))}o(zr,"NullableEnum");var Gb=$e(Ae(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),f(F())),Ht=o(e=>$e(Ae(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),f(O(e))),"OptionalArrayFromQuery");var Jb=N(a(),D());var xt=(y=>(y.OPENAI="openai",y.OPENROUTER="openrouter",y.ANTHROPIC="anthropic",y.AZURE="azure",y.GOOGLE="google",y.ACTIVEPIECES="activepieces",y.CLOUDFLARE_GATEWAY="cloudflare-gateway",y.CUSTOM="custom",y.BEDROCK="bedrock",y.MISTRAL="mistral",y))(xt||{});var sT=a().check(Ee(/^#[0-9A-Fa-f]{6}$/));var cT=l({filename:a(),data:D(),type:A("file"),mimetype:f(a())});var $c=Ue(qo());var yT=l({...ae,name:a(),permissions:O(a()),platformId:G(a()),type:a(),userCount:f(Q())});var Jo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Jo||{}),Or=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Or||{}),wr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(wr||{});var kr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(kr||{});var Rr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Rr||{});var zc=l({mode:$(Jo),value:D()}),Oc=l({auth:f(a()),fields:N(a(),zc)}),wc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:f(Oc)}),kc=l({type:A("PIECE"),toolName:a().check(se(1)),pieceMetadata:wc}),Rc=l({type:A("none")}),Dc=l({type:A("access_token"),accessToken:a()}),Nc=l({type:A("api_key"),apiKey:a(),apiKeyHeader:a()}),Cc=l({type:A("headers"),headers:N(a(),a())}),Uc=Se("type",[Rc,Dc,Nc,Cc]),Ko=l({type:A("FLOW"),toolName:a().check(se(1)),externalFlowId:a(),flowDisplayName:f(a())}),Xo=l({type:A("MCP"),toolName:a().check(se(1)),serverUrl:Oo(),protocol:$(wr),auth:Uc}),Yo=l({type:A("KNOWLEDGE_BASE"),toolName:a().check(se(1)),sourceType:$(Or),sourceId:a(),sourceName:a()}),jc=Se("type",[kc,Ko,Xo,Yo]),Mc=l({displayName:a(),description:f(a()),type:$(kr)}),Qo=l({type:A("MARKDOWN"),markdown:a()}),Ve={type:A("TOOL_CALL"),input:G(N(a(),D())),output:f(D()),toolName:a(),status:$(Rr),toolCallId:a(),startTime:a(),endTime:f(a())},WT=l(Ve),ei=Se("toolCallType",[l({...Ve,toolCallType:A("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Ve,toolCallType:A("FLOW"),displayName:a(),externalFlowId:a()}),l({...Ve,toolCallType:A("MCP"),displayName:a(),serverUrl:a()}),l({...Ve,toolCallType:A("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Ve,toolCallType:A("UNKNOWN"),displayName:a()})]),Lc=U([Qo,ei]);var Dr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Dr||{}),xe=l({apiKey:a()}),Fc=xe,Bc=l({apiKey:a(),apiKeyHash:a()}),Vc=xe,Zc=xe,Hc=xe,Gc=xe,Wc=xe,qc=xe,Jc=xe,ii=l({accessKeyId:a().check(se(1)),secretAccessKey:a().check(se(1))}),Kc=l({}),Xc=l({}),Yc=l({}),Qc=l({}),ep=l({}),tp=l({}),ai=l({modelId:a(),modelName:a(),modelType:$(Dr)}),si=l({apiKeyHeader:a(),baseUrl:a(),models:O(ai),defaultHeaders:f(N(a(),a()))}),ui=l({accountId:a(),gatewayId:a(),models:O(ai),vertexProject:f(a()),vertexRegion:f(a())}),ci=l({resourceName:a(),apiVersion:$e(Ae(e=>typeof e=="string"&&e.trim().length===0?void 0:e),f(a()))}),pi=l({region:a().check(se(1))}),rp=U([Fc,Hc,Gc,Wc,qc,Zc,Vc,Bc,ii,Jc]),li=U([si,ui,ci,pi,Kc,Yc,Qc,ep,Xc,tp]),np=l({id:a(),name:a(),type:$(Dr)}),op=l({id:a(),name:a(),provider:$(xt),config:li,enabledForChat:F()}),ip=l({provider:$(xt),config:li,auth:rp,platformId:a()});var XT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},ti=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],ap=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],sp=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],ri=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],up=["grok-4.20","grok-4.1-fast"],cp={openai:ti,anthropic:ap,google:ri,activepieces:[...sp.map(e=>`anthropic/${e}`),...ti.map(e=>`openai/${e}`),...ri.map(e=>`google/${e}`),...up.map(e=>`x-ai/${e}`)]};var ni=128e3,pp={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function lp({provider:e}){return e?pp[e]??ni:ni}o(lp,"getMaxContextTokens");var oi={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"},dp={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},mp=new Set(["anthropic","mistral"]);function le(e){return{chatModels:cp[e],maxContextTokens:lp({provider:e}),defaultEmbeddingModel:oi[e],supportsEmbedding:oi[e]!==void 0,supportsImageGeneration:!mp.has(e),webSearch:dp[e]}}o(le,"buildProviderCapabilities");var fp={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 gp=l({base64Url:a(),fileName:a(),extension:f(a())}),yp=l({mimeType:a(),url:a(),fileName:f(a())}),Nr=U([gp,yp]);var hp=U([l({type:A("file"),value:Nr}),l({type:A("markdown"),value:a(),files:f(O(Nr))})]),vp=l({sessionId:a(),message:a(),files:f(O(a()))});var mi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(mi||{}),fi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(fi||{}),Cr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Cr||{});var xp=U([l({...ae,name:a(),externalId:a(),type:A("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:O(l({value:a()}))})}),l({...ae,name:a(),externalId:a(),type:U([A("TEXT"),A("NUMBER"),A("DATE"),A("DATETIME")]),tableId:a(),projectId:a()})]),_p=l({...ae,name:a(),folderId:G(a()),projectId:a(),externalId:a(),status:zr(fi),trigger:zr(mi)}),Pp=l({...ae,tableId:a(),projectId:a(),cells:N(a(),l({updated:a(),created:a(),value:D(),fieldName:a()}))}),bp=l({events:O($(Cr)),webhookUrl:a(),flowId:a()}),Tp=l({fields:O(l({id:a(),name:a()})),rows:O(N(a(),a())),name:a()}),Ip=l({projectId:a(),limit:f(ut.number()),cursor:f(a()),name:f(a()),externalIds:Ht(a()),folderId:f(a()),folderIds:Ht(a())}),Ep=l({records:O(O(l({fieldId:a(),value:yi()}))),tableId:a()}),Sp=l({cells:f(O(l({fieldId:a(),value:yi()}))),tableId:a(),agentUpdate:f(F())}),gi=Se("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),di("exists"),di("not_exists")]),Ap=l({tableId:a(),limit:f(ut.number()),cursor:f(a()),filters:Ht(gi)});function yi(){return $e(Ae(e=>e==null?e:String(e)),st(a()))}o(yi,"coerceToString");function Re(e){return l({fieldId:a(),operator:A(e),value:a()})}o(Re,"valueFilter");function di(e){return l({fieldId:a(),operator:A(e)})}o(di,"existenceFilter");var $p=l({status:f(Q()),body:f(D()),headers:f(N(a(),a()))}),zp=l({...ae,deleted:G(we),ownerId:a(),displayName:a(),platformId:a(),externalId:G(a())});var hi=l({name:a(),description:f(a()),type:a(),required:F()}),Op=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:O(hi),returnsResponse:F()})});var vi="^[0-9]+\\.[0-9]+\\.[0-9]+$",yI=new RegExp(vi),kp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",hI=a().check(Ee(new RegExp(vi))),vI=a().check(Ee(new RegExp(kp))),Rp=l({packageType:A("ARCHIVE"),pieceType:$(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),xi=l({packageType:A("REGISTRY"),pieceType:A("OFFICIAL"),pieceName:a(),pieceVersion:a()}),_i=l({packageType:A("REGISTRY"),pieceType:A("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),xI=U([xi,_i]),_I=U([Rp,xi,_i]);var Dp=Se("type",[l({type:A("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:A("INTERVAL"),intervalMs:wo().check(Ct(6e4))})]),PI=l({...ae,type:$(ze),projectId:a(),flowId:a(),triggerName:a(),schedule:G(Dp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:G(a()),simulate:F()}),Pi=(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))(Pi||{}),bi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(bi||{}),Ti=(r=>(r.S3="S3",r.DB="DB",r))(Ti||{}),bI=l({...ae,projectId:G(a()),platformId:G(a()),type:$(Pi),compression:$(bi),data:f(D()),location:$(Ti),size:G(Q()),fileName:G(a()),s3Key:G(a()),metadata:G(N(a(),a()))}),Ii=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ii||{}),Ei=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ei||{}),TI=l({id:a(),email:a(),firstName:a(),status:$(Ei),externalId:G(a()),platformId:G(a()),platformRole:$(Ii),lastName:a(),created:we,updated:we,lastActiveDate:G(we),imageUrl:G(a())});var Ur=l({...L.shape,...C(N(a(),D()),"OBJECT").shape});var jr=l({...L.shape,formatProperty:f(a()),...C(a(),"RICH_TEXT").shape});var zi=l({...L.shape,...C(a(),"COLOR").shape});var Mr=U([oe,ge,jr,Bt,he,ie,ye,Ir,ct,Sr,ve,dt,Ur,mt,lt,Er,pt,zi]),T={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=l({displayName:a(),description:f(a()),hasConnectionIdentifier:f(F())});var Oi=l({username:a(),password:a()}),Lr=l({...de.shape,username:l({displayName:a(),description:f(a())}),password:l({displayName:a(),description:f(a())}),...C(Oi,"BASIC_AUTH").shape});var jp=N(a(),U([oe,ge,ve,he,ie])),Fr=l({...de.shape,props:jp,...C(D(),"CUSTOM_AUTH").shape});var De=l({...de.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var Mp=N(a(),U([oe,ge,De,ve,he,ie,ye,Bt])),wi=l({...de.shape,props:Mp,...C(D(),"OIDC").shape});var Br=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Br||{}),ki=U([oe,De,ie]),Ri=N(a(),ki),Lp=l({props:f(N(a(),ki)),authUrl:a(),tokenUrl:a(),scope:O(a()),prompt:f(U([A("none"),A("consent"),A("login"),A("omit")])),pkce:f(F()),pkceMethod:f(U([A("plain"),A("S256")])),authorizationMethod:f($(Br)),grantType:f(U([$(gt),A(Ar)])),extra:f(N(a(),a()))}),Di=l({access_token:a(),props:f(Ri),data:N(a(),at())}),Vr=l({...de.shape,...Lp.shape,...C(Di,"OAUTH2").shape});var Ze=U([Lr,Fr,wi,Vr,De]),_t="Connection",Zr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||_t}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||_t,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||_t}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||_t}},None(){}};var aS={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 Fp=l({...L.shape,...C(D(),"CUSTOM").shape,code:a()});var Bp=U([Mr,Ze]),Hr=N(a(),Bp),AS=N(a(),Mr);var Ni=U([l({strategy:A("CRON"),cronExpression:a()}),l({strategy:A("NONE")})]),He=class{constructor(t,r,n,i,u,p,c,g,v,y,b,x,s,d,h,m,_,P,M,ne,ce){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=p;this.handshakeConfiguration=c;this.onHandshake=g;this.renewConfiguration=v;this.onRenew=y;this.onEnable=b;this.onDisable=x;this.onStart=s;this.run=d;this.test=h;this.sampleData=m;this.testStrategy=_;this.outputSchema=P;this.aiMetadata=M;this.classification=ne;this.propertyGroups=ce}static{o(this,"ITrigger")}},Ci=o(e=>{switch(e.type){case"WEBHOOK":return new He(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"POLLING":return new He(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"MANUAL":return new He(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"APP_WEBHOOK":return new He(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,K(e.sampleData)&&K(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups)}},"createTrigger");var Ui="2",Wt="0.82.0";var Gr=class{constructor(t,r,n,i,u,p,c,g,v=Wt,y,b="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=c;this.auth=g;this.minimumSupportedRelease=v;this.maximumSupportedRelease=y;this.description=b;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ui}),"getContextInfo");(!Zp(v)||Hp(v,Wt))&&(this.minimumSupportedRelease=Wt),u.forEach(s=>this._actions[s.name]=s),p.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:Vp(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}},Mi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Gr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function Vp(e){if(e!==void 0)return Array.isArray(e)?e.map(ji):ji(e)}o(Vp,"withConnectionIdentifierFlag");function ji(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}o(ji,"flagConnectionIdentifier");function Zp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Zp,"isValidSimpleSemver");function Hp(e,t){let[r,n,i]=e.split(".").map(Number),[u,p,c]=t.split(".").map(Number);return r!==u?r<u:n!==p?n<p:i<c}o(Hp,"isSemverLessThan");var Gp=f(N(a(),N(a(),a()))),Li=l({id:f(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:O(a()),platformId:f(a()),directoryPath:f(a()),auth:f(U([Ze,O(Ze)])),version:a(),categories:f(O($(Fe))),minimumSupportedRelease:f(a()),maximumSupportedRelease:f(a()),deprecated:f(F()),i18n:Gp}),Wp=$(["human","ai","both"]),Fi=l({description:f(a()),idempotent:f(F())}),Bi=$(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var qp=$(["tabs","section","summary","builder","footer"]),Vi=l({key:a(),display:qp,label:f(a()),description:f(a()),icon:f(a()),props:O(a())}),Zi=l({name:a(),displayName:a(),description:a(),props:Hr,propertyGroups:f(O(Vi)),requireAuth:F(),errorHandlingOptions:f(Tr),outputSchema:f(Lt()),audience:f(Wp),aiMetadata:f(Fi),classification:f(Bi)}),Hi=l({name:a(),displayName:a(),description:a(),props:Hr,propertyGroups:f(O(Vi)),errorHandlingOptions:f(Tr),type:$(ze),sampleData:D(),handshakeConfiguration:f(Lt()),renewConfiguration:f(Ni),testStrategy:$(ht),outputSchema:f(Lt()),aiMetadata:f(Fi),classification:f(Bi)}),Jp=l({...Li.shape,actions:N(a(),Zi),triggers:N(a(),Hi)}),Kp=l({...Li.shape,actions:Q(),triggers:Q(),suggestedActions:f(O(Zi)),suggestedTriggers:f(O(Hi))}),Gi=l({projectUsage:Q(),pieceType:$(Le),packageType:$(ft),platformId:f(a()),archiveId:f(a())}),zA=l({...Jp.shape,...Gi.shape}),OA=l({...Kp.shape,...Gi.shape}),wA=l({name:a(),version:a()});var Xp=Ue(require("path")),Yp=Ue(require("fs/promises"));var We=require("node:stream");var qt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,p)=>{i.append(p,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Jt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Wr,r=new qr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Wr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},qr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Pt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Wi({error:e,requestBody:t}){return e instanceof Pt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Wi,"toFailsafeOutput");var Ge=(p=>(p.GET="GET",p.POST="POST",p.PATCH="PATCH",p.PUT="PUT",p.DELETE="DELETE",p.HEAD="HEAD",p))(Ge||{});var Kt=class extends qt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Jt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),p=t.queryParams??{};for(let[M,ne]of Object.entries(p))i.append(M,ne);let c=i.toString(),g=c?`${n}?${c}`:n,v=t.responseType??"json",y=t.followRedirects??!0,b=t.retries??0,{body:x,extraHeaders:s,isStream:d}=Qp(t.method)?el(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},h=rl({...u,...s}),m=await tl(async()=>{let M=new AbortController,ne=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let ce={method:t.method.toString(),headers:h,body:x,redirect:y?"follow":"manual",signal:M.signal};return d&&(ce.duplex="half"),r?.dispatcher!==void 0&&(ce.dispatcher=r.dispatcher),await fetch(g,ce)}finally{ne!==void 0&&clearTimeout(ne)}},d?0:b),_=y?300:400;if(m.status<200||m.status>=_){let M=await qi(m,v==="stream"?"text":v),ne=new Pt(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ne),ne}let P=await qi(m,v);return{status:m.status,headers:nl(m.headers),body:P}}};function Qp(e){return e!=="GET"&&e!=="HEAD"}o(Qp,"acceptsRequestBody");function el(e,t){if(Ki(e))return{body:void 0,extraHeaders:{},isStream:!1};if(ol(e)){let n=new We.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof We.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}}o(el,"serializeBody");async function qi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Ki(e.body)?We.Readable.from([]):We.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}}}}o(qi,"parseResponseBody");async function tl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ji(n);continue}return i}catch(i){if(r=i,n<t){await Ji(n);continue}throw i}throw r}o(tl,"sendWithRetries");function Ji(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ji,"backoff");function rl(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(rl,"normalizeHeaders");function nl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(nl,"toHttpHeaders");function ol(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(ol,"isNodeFormData");function Ki(e){return e==null}o(Ki,"isNil");var qe=new Kt;var Hd=Ue(require("fs")),ru=Ue(tu());var Gd={"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 Wd(e){let t=e.split(";")[0].trim().toLowerCase();return Gd[t]??""}o(Wd,"contentTypeToExtension");var qd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Jd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function nu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:p,extraProps:c,authLocation:g="headers",classification:v="WRITE"}){return te({audience:"human",name:u||"custom_api_call",classification:v,displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:T.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:y})=>({url:T.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Jd(t,y)}/resource or /resource`,required:!0,defaultValue:y?t(y):"",...p?.url??{}})}),"props")}),method:T.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Ge).map(y=>({label:y,value:y}))},...p?.method??{}}),headers:T.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...p?.headers??{}}),queryParams:T.Object({displayName:"Query Parameters",required:!0,...p?.queryParams??{}}),body_type:T.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:T.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:y})=>{if(!y)return{};let b=y,x={};switch(b){case"none":break;case"json":x.data=T.Json({displayName:"JSON Body",required:!0,...p?.body??{}});break;case"raw":x.data=T.LongText({displayName:"Raw Body",required:!0});break;case"form_data":x.data=T.Array({displayName:"Form Data",required:!0,properties:{fieldName:T.ShortText({displayName:"Field Name",required:!0}),fieldType:T.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:T.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:T.File({displayName:"File Field Value",required:!1})}});break}return x},"props")}),response_is_binary:T.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:T.Checkbox({displayName:"No Error on Failure",required:!1,...p?.failsafe??{}}),timeout:T.Number({displayName:"Timeout (in seconds)",required:!1,...p?.timeout??{}}),followRedirects:T.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...c},run:o(async y=>{let{method:b,url:x,headers:s,queryParams:d,body:h,body_type:m,failsafe:_,timeout:P,response_is_binary:M,followRedirects:ne}=y.propsValue;Zt(b,"Method"),Zt(x,"URL");let ce=K(r)?{}:await r(y.auth,y.propsValue),_e=x.url,fu=_e.startsWith("http://")||_e.startsWith("https://")?_e:qd({baseUrl:t(y.auth),relativePath:_e}),Pe={method:b,url:fu,headers:{...s??{},...g==="headers"||!K(g)?ce:{}},queryParams:{...g==="queryParams"?ce:{},...d??{}},timeout:P?P*1e3:0,followRedirects:ne};if(M&&(Pe.responseType="arraybuffer"),h)if(m&&m!=="none"){let me=h.data;if(m==="form_data"){let gu=me,Et=new ru.default;for(let{fieldName:vn,fieldType:xn,textFieldValue:_n,fileFieldValue:sr}of gu)xn==="text"&&!vt(_n)?Et.append(vn,_n):xn==="file"&&!vt(sr)&&Et.append(vn,sr.data,{filename:sr?.filename});Pe.body=Et,Pe.headers={...Pe.headers,...Et.getHeaders()}}else Pe.body=me}else m||(Pe.body=h);try{let me=await qe.sendRequest(Pe);return await Kd(y.files,me.body,me.status,me.headers,M)}catch(me){if(_)return Wi({error:me,requestBody:Pe.body});throw me}},"run")})}o(nu,"createCustomApiCallAction");var Kd=o(async(e,t,r,n,i)=>{let u;if(i&&Xd(t)){let p=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],c=Wd(p??"")||"txt",g;t instanceof ArrayBuffer?g=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?g=t:g=Buffer.from(t),u=await e.write({fileName:`output.${c}`,data:g})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Xd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var ar={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:i,files:u,server:p}){switch(e.strategy){case 0:{let c=await t.get("lastPoll");if(K(c))throw new Error("lastPoll doesn't exist in the store.");let g=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:c,server:p}),v=g.reduce((y,b)=>Math.max(y,b.epochMilliSeconds),c);return await t.put("lastPoll",v),g.filter(y=>y.epochMilliSeconds>c).map(y=>y.data)}case 1:{let c=await t.get("lastItem"),g=await e.items({store:t,auth:r,propsValue:n,lastItemId:c,files:u,server:p}),v=g.findIndex(x=>x.id===c),y=[];K(c)||v==-1?y=g??[]:y=g?.slice(0,v)??[],K(i)||(y=y.slice(-i));let b=y?.[0]?.id;return K(b)||await t.put("lastItem",b),y.map(x=>x.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:i,isRepublish:u}){switch(e.strategy){case 0:{if(u&&!K(await t.get("lastPoll")))break;await t.put("lastPoll",Date.now());break}case 1:{if(u&&!K(await t.get("lastItem")))break;let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;K(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:i,server:u}){let p=[];switch(e.strategy){case 0:{p=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:u});break}case 1:{p=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:i,server:u});break}}return Yd(p.map(c=>c.data))}};function Yd(e){return e.length<=5?e:e.slice(0,5)}o(Yd,"getFirstFiveOrAll");var W=Zr.SecretText({displayName:"API Token",description:["To create an API token:","1. Open **Settings** in Descript.","2. Select **API tokens** from the sidebar.","3. Click **Create token**, give it a name, select a Drive, and click **Create token**.","4. Copy the token and paste it here \u2014 you can only view it once."].join(`
|
|
4
|
+
`),required:!0,validate:o(async({auth:e})=>{try{return await qe.sendRequest({method:"GET",url:"https://descriptapi.com/v1/status",headers:{Authorization:`Bearer ${Ce(e)}`}}),{valid:!0}}catch{return{valid:!1,error:"Invalid API token. Please check and try again."}}},"validate")});function Ce(e){return(typeof e=="string"?e:e.secret_text).trim()}o(Ce,"getAuthToken");var ou="https://descriptapi.com/v1";async function yn({apiKey:e,method:t,path:r,body:n,queryParams:i}){return qe.sendRequest({method:t,url:`${ou}${r}`,headers:{Authorization:`Bearer ${e}`},body:n,queryParams:i})}o(yn,"descriptApiCall");async function iu(e){let t=[],r;do{let n={limit:"100",sort:"name",direction:"asc"};r&&(n.cursor=r);let i=await yn({apiKey:e,method:"GET",path:"/projects",queryParams:n});t.push(...i.body.data),r=i.body.pagination.next_cursor}while(r);return t}o(iu,"fetchAllProjects");var Qd=T.Dropdown({auth:W,displayName:"Project",description:"Select the Descript project to use.",refreshers:[],required:!0,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:(await iu(Ce(e))).map(r=>({label:r.name,value:r.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load projects. Check your connection."}}},"options")}),em=o(e=>T.Dropdown({auth:W,displayName:"Composition",description:"Select the composition (timeline) within the project. If omitted, the agent chooses automatically.",refreshers:["project_id"],required:e,options:o(async({auth:t,project_id:r})=>{if(!t||!r||typeof r!="string")return{disabled:!0,options:[],placeholder:"Please select a project first"};try{return{disabled:!1,options:(await yn({apiKey:Ce(t),method:"GET",path:`/projects/${r}`})).body.compositions.map(i=>({label:i.name,value:i.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load compositions. Check your connection."}}},"options")}),"compositionIdProp"),V={BASE_URL:ou,descriptApiCall:yn,fetchAllProjects:iu,getAuthToken:Ce,projectIdProp:Qd,compositionIdProp:em};var au=te({auth:W,name:"agent_edit",classification:"WRITE",displayName:"Agent Edit (Underlord)",description:`Use Descript's AI agent "Underlord" to edit an existing project or create a new one with a natural language prompt.`,audience:"both",aiMetadata:{description:"Starts an asynchronous Descript Underlord AI editing job driven by a natural-language prompt, operating in one of two modes: editing an existing project (optionally targeting a specific composition) or creating a new project from the prompt. Use to apply AI edits like removing filler words, adding studio sound, or assembling highlight reels. Frame the prompt as a single one-shot instruction. Not idempotent: each call queues a new job and returns a job_id to poll for completion.",idempotent:!1},props:{mode:T.StaticDropdown({displayName:"Mode",description:"Choose whether to edit an existing project or create a brand new one.",required:!0,defaultValue:"existing",options:{options:[{label:"Edit existing project",value:"existing"},{label:"Create new project from prompt",value:"new"}]}}),project_id:T.Dropdown({auth:W,displayName:"Project",description:"Select the project for the agent to edit.",refreshers:["mode"],required:!1,options:o(async({auth:e,mode:t})=>{if(t!=="existing")return{disabled:!0,options:[],placeholder:"Not needed for new projects"};if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:(await V.fetchAllProjects(V.getAuthToken(e))).map(n=>({label:n.name,value:n.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load projects. Check your connection."}}},"options")}),project_name:T.ShortText({displayName:"New Project Name",description:"Name for the new project (only used when creating a new project).",required:!1}),team_access:T.StaticDropdown({displayName:"Team Access",description:"Access level for team members on the new project. Only applies when creating a new project.",required:!1,defaultValue:"none",options:{options:[{label:"None (private to owner)",value:"none"},{label:"View",value:"view"},{label:"Comment",value:"comment"},{label:"Edit",value:"edit"}]}}),composition_id:V.compositionIdProp(!1),prompt:T.LongText({displayName:"Prompt",description:'Natural language instruction for Underlord. Examples: "Add studio sound to every clip", "Remove all filler words", "Create a 30-second highlight reel with the best moments". Be specific \u2014 frame edits as a single one-shot instruction.',required:!0}),model:T.ShortText({displayName:"AI Model",description:"AI model to use for editing. Leave blank to use the Descript default.",required:!1}),callback_url:T.ShortText({displayName:"Callback URL",description:"Optional webhook URL. When the job finishes or fails, Descript will POST the job status to this URL (same payload as Get Job Status).",required:!1})},async run(e){let{mode:t,project_id:r,project_name:n,team_access:i,composition_id:u,prompt:p,model:c,callback_url:g}=e.propsValue,v={prompt:p};if(t==="existing"){if(!r)throw new Error("Please select a project to edit.");v.project_id=r,u&&(v.composition_id=u)}else{if(!n)throw new Error("Please enter a project name for the new project.");v.project_name=n,i&&(v.team_access=i)}return c&&(v.model=c),g&&(v.callback_url=g),(await V.descriptApiCall({apiKey:V.getAuthToken(e.auth),method:"POST",path:"/jobs/agent",body:v})).body}});var su=te({auth:W,name:"get_job_status",classification:"READ",displayName:"Get Job Status",description:"Retrieves the current status of a Descript background job (import, agent edit, or publish). Use the job_id returned by any job-creation action.",audience:"both",aiMetadata:{description:"Looks up the current state and result of a single Descript background job (import, agent edit, or publish) by its job_id. Use to poll for completion after starting an asynchronous job and to read outputs such as share/download URLs or error messages. Read-only and idempotent.",idempotent:!0},props:{job_id:T.ShortText({displayName:"Job ID",description:'The job ID returned when you created the job (e.g. from "Import Media", "Agent Edit", or "Publish Project" actions).',required:!0})},async run(e){return(await V.descriptApiCall({apiKey:V.getAuthToken(e.auth),method:"GET",path:`/jobs/${e.propsValue.job_id}`})).body}});var uu=te({auth:W,name:"get_project",classification:"READ",displayName:"Get Project",description:"Retrieves details for a Descript project including its compositions and media files.",audience:"both",aiMetadata:{description:"Fetches full details for a single Descript project by ID, including its compositions and media files. Use to resolve composition IDs or inspect project contents before editing or publishing. Read-only and idempotent.",idempotent:!0},props:{project_id:V.projectIdProp},async run(e){return(await V.descriptApiCall({apiKey:V.getAuthToken(e.auth),method:"GET",path:`/projects/${e.propsValue.project_id}`})).body}});var cu=te({auth:W,name:"import_media",classification:"WRITE",displayName:"Import Media",description:"Imports a media file from a URL into a new or existing Descript project and optionally creates a composition.",audience:"both",aiMetadata:{description:"Starts an asynchronous Descript job that imports a media file from a public URL into either a newly created project or an existing one (selected via the project mode), optionally building a composition/timeline from it. Use to bring audio/video into Descript before editing or publishing; the URL must be reachable by Descript servers and support HTTP Range requests. Not idempotent: each call queues a new import job and returns a job_id to poll for completion.",idempotent:!1},props:{mode:T.StaticDropdown({displayName:"Project",description:"Create a new project or import into an existing one.",required:!0,defaultValue:"new",options:{options:[{label:"Create new project",value:"new"},{label:"Import into existing project",value:"existing"}]}}),project_id:T.Dropdown({auth:W,displayName:"Existing Project",description:"Select the project to import media into.",refreshers:["mode"],required:!1,options:o(async({auth:e,mode:t})=>{if(t!=="existing")return{disabled:!0,options:[],placeholder:"Not needed for new projects"};if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:(await V.fetchAllProjects(V.getAuthToken(e))).map(n=>({label:n.name,value:n.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load projects. Check your connection."}}},"options")}),project_name:T.ShortText({displayName:"New Project Name",description:"Name for the new project. Only used when creating a new project.",required:!1}),folder_name:T.ShortText({displayName:"Project Folder",description:'Folder path for the new project (e.g. "Clients/Acme"). Supports nested paths using "/". Missing folders are created automatically. Only applies when creating a new project.',required:!1}),team_access:T.StaticDropdown({displayName:"Team Access",description:"Access level for Drive members on the new project. Only applies when creating a new project.",required:!1,defaultValue:"none",options:{options:[{label:"None (private to owner)",value:"none"},{label:"View",value:"view"},{label:"Comment",value:"comment"},{label:"Edit",value:"edit"}]}}),media_name:T.ShortText({displayName:"Media File Name",description:'Display name for the media file (e.g. "intro.mp4" or "Recordings/interview.mp4"). Use "/" to organize into sub-folders. Must not conflict with existing file names when importing into an existing project.',required:!0}),media_url:T.ShortText({displayName:"Media URL",description:"Public URL of the media file. Must be accessible by Descript servers and support HTTP Range requests. Sign URLs for 12\u201348 hours if they expire.",required:!0}),language:T.ShortText({displayName:"Transcription Language",description:'ISO 639-1 language code for transcription (e.g. "en", "es", "fr"). Leave blank to auto-detect from the audio.',required:!1}),composition_name:T.ShortText({displayName:"Composition Name",description:"Name for the composition (timeline) to create from the imported media. Leave blank to skip composition creation.",required:!1}),composition_width:T.Number({displayName:"Composition Width (px)",description:"Width of the composition in pixels. Defaults to 1920. Only used when a Composition Name is provided.",required:!1,defaultValue:1920}),composition_height:T.Number({displayName:"Composition Height (px)",description:"Height of the composition in pixels. Defaults to 1080. Only used when a Composition Name is provided.",required:!1,defaultValue:1080}),callback_url:T.ShortText({displayName:"Callback URL",description:"Optional webhook URL. When the import finishes or fails, Descript will POST the job status to this URL (same payload as Get Job Status).",required:!1})},async run(e){let{mode:t,project_id:r,project_name:n,folder_name:i,team_access:u,media_name:p,media_url:c,language:g,composition_name:v,composition_width:y,composition_height:b,callback_url:x}=e.propsValue,s={url:c};g&&(s.language=g);let d={add_media:{[p]:s}};if(t==="existing"){if(!r)throw new Error("Please select a project to import into.");d.project_id=r}else{if(!n)throw new Error("Please enter a name for the new project.");d.project_name=n,i&&(d.folder_name=i),u&&(d.team_access=u)}return v&&(d.add_compositions=[{name:v,width:y??1920,height:b??1080,clips:[{media:p}]}]),x&&(d.callback_url=x),(await V.descriptApiCall({apiKey:V.getAuthToken(e.auth),method:"POST",path:"/jobs/import/project_media",body:d})).body}});var pu=te({auth:W,name:"list_projects",classification:"SEARCH",displayName:"List Projects",description:"Returns projects in your Descript Drive. Supports filtering by name, date, and creator.",audience:"both",aiMetadata:{description:"Lists projects in the connected Descript Drive, auto-paginating through all matches. Optional filters narrow by name substring, creator (me vs anyone), and created/updated date ranges, with configurable sort field and direction; leaving filters blank returns all projects. Use to discover project IDs for other actions. Read-only and idempotent.",idempotent:!0},props:{name:T.ShortText({displayName:"Name Filter",description:"Return only projects whose name contains this string (case-insensitive).",required:!1}),created_by:T.StaticDropdown({displayName:"Created By",description:"Filter projects by creator.",required:!1,options:{options:[{label:"Anyone",value:""},{label:"Me",value:"me"}]}}),sort:T.StaticDropdown({displayName:"Sort By",description:"Field to sort results by.",required:!1,defaultValue:"created_at",options:{options:[{label:"Date created",value:"created_at"},{label:"Date updated",value:"updated_at"},{label:"Name",value:"name"},{label:"Last viewed",value:"last_viewed_at"}]}}),direction:T.StaticDropdown({displayName:"Sort Direction",description:"Sort order for results.",required:!1,defaultValue:"desc",options:{options:[{label:"Newest first (desc)",value:"desc"},{label:"Oldest first (asc)",value:"asc"}]}}),created_after:T.ShortText({displayName:"Created After",description:"Return only projects created after this date (ISO 8601, e.g. 2025-01-01T00:00:00Z).",required:!1}),created_before:T.ShortText({displayName:"Created Before",description:"Return only projects created before this date (ISO 8601, e.g. 2025-12-31T23:59:59Z).",required:!1}),updated_after:T.ShortText({displayName:"Updated After",description:"Return only projects updated after this date (ISO 8601, e.g. 2025-01-01T00:00:00Z).",required:!1}),updated_before:T.ShortText({displayName:"Updated Before",description:"Return only projects updated before this date (ISO 8601, e.g. 2025-12-31T23:59:59Z).",required:!1})},async run(e){let{name:t,created_by:r,sort:n,direction:i,created_after:u,created_before:p,updated_after:c,updated_before:g}=e.propsValue,v=V.getAuthToken(e.auth),y={limit:"100"};n&&(y.sort=n),i&&(y.direction=i),t&&(y.name=t),r&&(y.created_by=r),u&&(y.created_after=u),p&&(y.created_before=p),c&&(y.updated_after=c),g&&(y.updated_before=g);let b=[],x;do{let s={...y,...x?{cursor:x}:{}},d=await V.descriptApiCall({apiKey:v,method:"GET",path:"/projects",queryParams:s});b.push(...d.body.data),x=d.body.pagination.next_cursor}while(x);return b.map(s=>({project_id:s.id,project_name:s.name,created_at:s.created_at,updated_at:s.updated_at}))}});var lu=te({auth:W,name:"publish_project",classification:"WRITE",displayName:"Publish Project",description:"Publishes a composition from a project to create a shareable link and a downloadable export file.",audience:"both",aiMetadata:{description:"Starts an asynchronous Descript publish/export job for a project composition, producing a shareable link and a downloadable file as video or audio at a chosen resolution and share access level. Use to render and distribute a finished project. Requesting a share access level the Drive disallows returns an error. Not idempotent: each call queues a new export job and returns a job_id to poll for the share_url and download_url.",idempotent:!1},props:{project_id:V.projectIdProp,composition_id:V.compositionIdProp(!1),media_type:T.StaticDropdown({displayName:"Output Type",description:"Choose whether to export the project as a video or audio file.",required:!1,defaultValue:"Video",options:{options:[{label:"Video",value:"Video"},{label:"Audio only",value:"Audio"}]}}),resolution:T.StaticDropdown({displayName:"Video Resolution",description:"Resolution for the exported video. Only applies when Output Type is Video.",required:!1,defaultValue:"1080p",options:{options:[{label:"480p",value:"480p"},{label:"720p",value:"720p"},{label:"1080p (Full HD)",value:"1080p"},{label:"1440p (2K)",value:"1440p"},{label:"4K",value:"4K"}]}}),access_level:T.StaticDropdown({displayName:"Share Access Level",description:"Who can view the published share page. Leave blank to use your Drive's default. Note: requesting a level your Drive disallows (e.g. Public when search-engine indexing is off) will return an error.",required:!1,options:{options:[{label:"Public (anyone)",value:"public"},{label:"Unlisted (link only)",value:"unlisted"},{label:"Drive members only",value:"drive"},{label:"Private (owner only)",value:"private"}]}}),callback_url:T.ShortText({displayName:"Callback URL",description:"Optional webhook URL. When the publish job finishes or fails, Descript will POST the job status to this URL (same payload as Get Job Status). The result includes share_url and download_url once complete.",required:!1})},async run(e){let{project_id:t,composition_id:r,media_type:n,resolution:i,access_level:u,callback_url:p}=e.propsValue,c={project_id:t};return r&&(c.composition_id=r),n&&(c.media_type=n),n==="Video"&&i&&(c.resolution=i),u&&(c.access_level=u),p&&(c.callback_url=p),(await V.descriptApiCall({apiKey:V.getAuthToken(e.auth),method:"POST",path:"/jobs/publish",body:c})).body}});var tm=new Set(["stopped","cancelled"]);function rm(e){return tm.has(e.job_state)}o(rm,"isCompletedJob");var du={job_id:"6dc3f30a-58c2-4174-96a6-dc18cf3c7776",job_type:"import/project_media",job_state:"stopped",created_at:"2025-11-18T10:30:00Z",stopped_at:"2025-11-18T10:35:00Z",drive_id:"c9c5c47e-158a-49f7-846b-4f6ee2a229a2",project_id:"9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb",project_url:"https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb",result:{status:"success",media_seconds_used:136}},hn={strategy:0,items:o(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{job_type_filter:n}=t,i=V.getAuthToken(e),u={limit:"100"};n&&n!=="all"&&(u.type=n),r>0&&(u.created_after=new Date(r).toISOString());let p=[],c,g=0,v=10;do{g++;let y={...u,...c?{cursor:c}:{}},b=await V.descriptApiCall({apiKey:i,method:"GET",path:"/jobs",queryParams:y});p.push(...b.body.data),c=b.body.pagination.next_cursor}while(c&&g<v);return p.filter(rm).map(y=>({epochMilliSeconds:new Date(y.stopped_at??y.created_at).getTime(),data:{...y}}))},"items")},mu=Ci({auth:W,name:"job_completed",classification:"READ",displayName:"Job Completed",description:"Triggers when a Descript background job (import, agent edit, or publish) finishes.",aiMetadata:{description:"Fires when a Descript background job reaches a terminal state (completed, failed, or cancelled), representing a finished import, agent edit, or publish job. Can be scoped to a single job type or left open to fire for any completed job type."},props:{job_type_filter:T.StaticDropdown({displayName:"Job Type Filter",description:'Only trigger for jobs of this type. Select "All job types" to trigger for any completed job.',required:!1,defaultValue:"all",options:{options:[{label:"All job types",value:"all"},{label:"Import media",value:"import/project_media"},{label:"Agent edit (Underlord)",value:"agent"}]}})},sampleData:du,type:"POLLING",async test(){return[du]},async onEnable(e){await ar.onEnable(hn,e)},async onDisable(e){await ar.onDisable(hn,e)},async run(e){return await ar.poll(hn,e)}});var nm=Mi({displayName:"Descript",description:"AI-powered video and podcast editor. Import media, run AI edits with Underlord, and publish.",minimumSupportedRelease:"0.82.1",logoUrl:"https://cdn.activepieces.com/pieces/descript.png",categories:["CONTENT_AND_FILES"],auth:W,authors:["hugh-codes","onyedikachi-david"],actions:[cu,au,lu,su,pu,uu,nu({baseUrl:o(()=>"https://descriptapi.com/v1","baseUrl"),auth:W,authMapping:o(async e=>({Authorization:`Bearer ${Ce(e)}`}),"authMapping")})],triggers:[mu]});0&&(module.exports={descript,descriptAuth});
|
|
5
5
|
/*! Bundled license information:
|
|
6
6
|
|
|
7
7
|
mime-types/index.js:
|