@activepieces/piece-descript 0.0.3 → 0.0.5
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 +7 -12
- package/src/index.js +14 -44
- package/src/index.d.ts +0 -4
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/agent-edit.d.ts +0 -11
- package/src/lib/actions/agent-edit.d.ts.map +0 -1
- package/src/lib/actions/agent-edit.js +0 -132
- package/src/lib/actions/agent-edit.js.map +0 -1
- package/src/lib/actions/get-job-status.d.ts +0 -4
- package/src/lib/actions/get-job-status.d.ts.map +0 -1
- package/src/lib/actions/get-job-status.js +0 -34
- package/src/lib/actions/get-job-status.js.map +0 -1
- package/src/lib/actions/get-project.d.ts +0 -4
- package/src/lib/actions/get-project.d.ts.map +0 -1
- package/src/lib/actions/get-project.js +0 -30
- package/src/lib/actions/get-project.js.map +0 -1
- package/src/lib/actions/import-media.d.ts +0 -15
- package/src/lib/actions/import-media.d.ts.map +0 -1
- package/src/lib/actions/import-media.js +0 -159
- package/src/lib/actions/import-media.js.map +0 -1
- package/src/lib/actions/list-projects.d.ts +0 -11
- package/src/lib/actions/list-projects.d.ts.map +0 -1
- package/src/lib/actions/list-projects.js +0 -123
- package/src/lib/actions/list-projects.js.map +0 -1
- package/src/lib/actions/publish-project.d.ts +0 -9
- package/src/lib/actions/publish-project.d.ts.map +0 -1
- package/src/lib/actions/publish-project.js +0 -89
- package/src/lib/actions/publish-project.js.map +0 -1
- package/src/lib/auth.d.ts +0 -4
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -41
- package/src/lib/auth.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -26
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -121
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/triggers/job-completed.d.ts +0 -11
- package/src/lib/triggers/job-completed.d.ts.map +0 -1
- package/src/lib/triggers/job-completed.js +0 -112
- package/src/lib/triggers/job-completed.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-descript",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"@activepieces/pieces-common": "0.12.3",
|
|
12
|
-
"@activepieces/pieces-framework": "0.30.0",
|
|
13
|
-
"@activepieces/shared": "0.87.1",
|
|
14
|
-
"tslib": "2.6.2"
|
|
15
|
-
}
|
|
5
|
+
"dependencies": {},
|
|
6
|
+
"files": [
|
|
7
|
+
"src/index.js",
|
|
8
|
+
"package.json",
|
|
9
|
+
"src/i18n"
|
|
10
|
+
]
|
|
16
11
|
}
|
package/src/index.js
CHANGED
|
@@ -1,44 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Object.defineProperty(exports, "descriptAuth", { enumerable: true, get: function () { return auth_1.descriptAuth; } });
|
|
16
|
-
const job_completed_1 = require("./lib/triggers/job-completed");
|
|
17
|
-
exports.descript = (0, pieces_framework_1.createPiece)({
|
|
18
|
-
displayName: 'Descript',
|
|
19
|
-
description: 'AI-powered video and podcast editor. Import media, run AI edits with Underlord, and publish.',
|
|
20
|
-
minimumSupportedRelease: '0.82.1',
|
|
21
|
-
logoUrl: 'https://cdn.activepieces.com/pieces/descript.png',
|
|
22
|
-
categories: [shared_1.PieceCategory.CONTENT_AND_FILES],
|
|
23
|
-
auth: auth_1.descriptAuth,
|
|
24
|
-
authors: ['hugh-codes', 'onyedikachi-david'],
|
|
25
|
-
actions: [
|
|
26
|
-
import_media_1.descriptImportMediaAction,
|
|
27
|
-
agent_edit_1.descriptAgentEditAction,
|
|
28
|
-
publish_project_1.descriptPublishProjectAction,
|
|
29
|
-
get_job_status_1.descriptGetJobStatusAction,
|
|
30
|
-
list_projects_1.descriptListProjectsAction,
|
|
31
|
-
get_project_1.descriptGetProjectAction,
|
|
32
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
33
|
-
baseUrl: () => 'https://descriptapi.com/v1',
|
|
34
|
-
auth: auth_1.descriptAuth,
|
|
35
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
-
return ({
|
|
37
|
-
Authorization: `Bearer ${(0, auth_1.getAuthToken)(auth)}`,
|
|
38
|
-
});
|
|
39
|
-
}),
|
|
40
|
-
}),
|
|
41
|
-
],
|
|
42
|
-
triggers: [job_completed_1.descriptJobCompletedTrigger],
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=index.js.map
|
|
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 ${jd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:I.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(He).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:I.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:I.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:I.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:I.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:g})=>{if(!g)return{};let y=g,b={};switch(y){case"none":break;case"json":b.data=I.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":b.data=I.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=I.Array({displayName:"Form Data",required:!0,properties:{fieldName:I.ShortText({displayName:"Field Name",required:!0}),fieldType:I.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:I.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:I.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:I.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:I.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:I.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:I.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async g=>{let{method:y,url:b,headers:_,queryParams:s,body:d,body_type:h,failsafe:m,timeout:x,response_is_binary:P,followRedirects:M}=g.propsValue;Vt(y,"Method"),Vt(b,"URL");let ne=Y(r)?{}:await r(g.auth,g.propsValue),se=b.url,Ye=se.startsWith("http://")||se.startsWith("https://")?se:Ud({baseUrl:t(g.auth),relativePath:se}),_e={method:y,url:Ye,headers:{..._??{},...f==="headers"||!Y(f)?ne:{}},queryParams:{...f==="queryParams"?ne:{},...s??{}},timeout:x?x*1e3:0,followRedirects:M};if(P&&(_e.responseType="arraybuffer"),d)if(h&&h!=="none"){let me=d.data;if(h==="form_data"){let au=me,Tt=new qs.default;for(let{fieldName:gn,fieldType:yn,textFieldValue:hn,fileFieldValue:ar}of au)yn==="text"&&!ht(hn)?Tt.append(gn,hn):yn==="file"&&!ht(ar)&&Tt.append(gn,ar.data,{filename:ar?.filename});_e.body=Tt,_e.headers={..._e.headers,...Tt.getHeaders()}}else _e.body=me}else h||(_e.body=d);try{let me=await Ge.sendRequest(_e);return await Md(g.files,me.body,me.status,me.headers,P)}catch(me){if(m)return Mi({error:me,requestBody:_e.body});throw me}},"run")})}o(Ks,"createCustomApiCallAction");var Md=o(async(e,t,r,n,i)=>{let u;if(i&&Ld(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Cd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Ld=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var ir={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:i,files:u,server:c}){switch(e.strategy){case 0:{let p=await t.get("lastPoll");if(Y(p))throw new Error("lastPoll doesn't exist in the store.");let f=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:p,server:c}),g=f.reduce((y,b)=>Math.max(y,b.epochMilliSeconds),p);return await t.put("lastPoll",g),f.filter(y=>y.epochMilliSeconds>p).map(y=>y.data)}case 1:{let p=await t.get("lastItem"),f=await e.items({store:t,auth:r,propsValue:n,lastItemId:p,files:u,server:c}),g=f.findIndex(_=>_.id===p),y=[];Y(p)||g==-1?y=f??[]:y=f?.slice(0,g)??[],Y(i)||(y=y.slice(-i));let b=y?.[0]?.id;return Y(b)||await t.put("lastItem",b),y.map(_=>_.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:i}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;Y(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 c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:u});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:i,server:u});break}}return Fd(c.map(p=>p.data))}};function Fd(e){return e.length<=5?e:e.slice(0,5)}o(Fd,"getFirstFiveOrAll");var G=Fr.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 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});
|
|
5
|
+
/*! Bundled license information:
|
|
6
|
+
|
|
7
|
+
mime-types/index.js:
|
|
8
|
+
(*!
|
|
9
|
+
* mime-types
|
|
10
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
11
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
12
|
+
* MIT Licensed
|
|
13
|
+
*)
|
|
14
|
+
*/
|
package/src/index.d.ts
DELETED
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,eAAO,MAAM,QAAQ,mHAyBnB,CAAC"}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAA6D;AAC7D,iDAAqD;AACrD,yDAAmE;AACnE,iEAA0E;AAC1E,2DAAqE;AACrE,6DAAuE;AACvE,+DAAyE;AACzE,mEAA6E;AAC7E,qCAAwD;AAG/C,6FAHA,mBAAY,OAGA;AAFrB,gEAA2E;AAI9D,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,WAAW,EAAE,UAAU;IACvB,WAAW,EACT,8FAA8F;IAChG,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,kDAAkD;IAC3D,UAAU,EAAE,CAAC,sBAAa,CAAC,iBAAiB,CAAC;IAC7C,IAAI,EAAE,mBAAY;IAClB,OAAO,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC5C,OAAO,EAAE;QACP,wCAAyB;QACzB,oCAAuB;QACvB,8CAA4B;QAC5B,2CAA0B;QAC1B,0CAA0B;QAC1B,sCAAwB;QACxB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,4BAA4B;YAC3C,IAAI,EAAE,mBAAY;YAClB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAA,mBAAY,EAAC,IAAI,CAAC,EAAE;iBAC9C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,2CAA2B,CAAC;CACxC,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const descriptAgentEditAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
mode: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
3
|
-
project_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
-
project_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
-
team_access: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
6
|
-
composition_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
7
|
-
prompt: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
8
|
-
model: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
-
callback_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=agent-edit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-edit.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/agent-edit.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,uBAAuB;;;;;;;;;EA6IlC,CAAC"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.descriptAgentEditAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
exports.descriptAgentEditAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.descriptAuth,
|
|
11
|
-
name: 'agent_edit',
|
|
12
|
-
displayName: 'Agent Edit (Underlord)',
|
|
13
|
-
description: 'Use Descript\'s AI agent "Underlord" to edit an existing project or create a new one with a natural language prompt.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
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: false },
|
|
16
|
-
props: {
|
|
17
|
-
mode: pieces_framework_1.Property.StaticDropdown({
|
|
18
|
-
displayName: 'Mode',
|
|
19
|
-
description: 'Choose whether to edit an existing project or create a brand new one.',
|
|
20
|
-
required: true,
|
|
21
|
-
defaultValue: 'existing',
|
|
22
|
-
options: {
|
|
23
|
-
options: [
|
|
24
|
-
{ label: 'Edit existing project', value: 'existing' },
|
|
25
|
-
{ label: 'Create new project from prompt', value: 'new' },
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
}),
|
|
29
|
-
project_id: pieces_framework_1.Property.Dropdown({
|
|
30
|
-
auth: auth_1.descriptAuth,
|
|
31
|
-
displayName: 'Project',
|
|
32
|
-
description: 'Select the project for the agent to edit.',
|
|
33
|
-
refreshers: ['mode'],
|
|
34
|
-
required: false,
|
|
35
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, mode }) {
|
|
36
|
-
if (mode !== 'existing')
|
|
37
|
-
return {
|
|
38
|
-
disabled: true,
|
|
39
|
-
options: [],
|
|
40
|
-
placeholder: 'Not needed for new projects',
|
|
41
|
-
};
|
|
42
|
-
if (!auth)
|
|
43
|
-
return {
|
|
44
|
-
disabled: true,
|
|
45
|
-
options: [],
|
|
46
|
-
placeholder: 'Please connect your account first',
|
|
47
|
-
};
|
|
48
|
-
try {
|
|
49
|
-
const projects = yield common_1.descriptCommon.fetchAllProjects(common_1.descriptCommon.getAuthToken(auth));
|
|
50
|
-
return {
|
|
51
|
-
disabled: false,
|
|
52
|
-
options: projects.map((p) => ({ label: p.name, value: p.id })),
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
catch (_b) {
|
|
56
|
-
return {
|
|
57
|
-
disabled: true,
|
|
58
|
-
options: [],
|
|
59
|
-
placeholder: 'Failed to load projects. Check your connection.',
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
}),
|
|
63
|
-
}),
|
|
64
|
-
project_name: pieces_framework_1.Property.ShortText({
|
|
65
|
-
displayName: 'New Project Name',
|
|
66
|
-
description: 'Name for the new project (only used when creating a new project).',
|
|
67
|
-
required: false,
|
|
68
|
-
}),
|
|
69
|
-
team_access: pieces_framework_1.Property.StaticDropdown({
|
|
70
|
-
displayName: 'Team Access',
|
|
71
|
-
description: 'Access level for team members on the new project. Only applies when creating a new project.',
|
|
72
|
-
required: false,
|
|
73
|
-
defaultValue: 'none',
|
|
74
|
-
options: {
|
|
75
|
-
options: [
|
|
76
|
-
{ label: 'None (private to owner)', value: 'none' },
|
|
77
|
-
{ label: 'View', value: 'view' },
|
|
78
|
-
{ label: 'Comment', value: 'comment' },
|
|
79
|
-
{ label: 'Edit', value: 'edit' },
|
|
80
|
-
],
|
|
81
|
-
},
|
|
82
|
-
}),
|
|
83
|
-
composition_id: common_1.descriptCommon.compositionIdProp(false),
|
|
84
|
-
prompt: pieces_framework_1.Property.LongText({
|
|
85
|
-
displayName: 'Prompt',
|
|
86
|
-
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 — frame edits as a single one-shot instruction.',
|
|
87
|
-
required: true,
|
|
88
|
-
}),
|
|
89
|
-
model: pieces_framework_1.Property.ShortText({
|
|
90
|
-
displayName: 'AI Model',
|
|
91
|
-
description: 'AI model to use for editing. Leave blank to use the Descript default.',
|
|
92
|
-
required: false,
|
|
93
|
-
}),
|
|
94
|
-
callback_url: pieces_framework_1.Property.ShortText({
|
|
95
|
-
displayName: 'Callback URL',
|
|
96
|
-
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).',
|
|
97
|
-
required: false,
|
|
98
|
-
}),
|
|
99
|
-
},
|
|
100
|
-
run(context) {
|
|
101
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
const { mode, project_id, project_name, team_access, composition_id, prompt, model, callback_url, } = context.propsValue;
|
|
103
|
-
const body = { prompt };
|
|
104
|
-
if (mode === 'existing') {
|
|
105
|
-
if (!project_id)
|
|
106
|
-
throw new Error('Please select a project to edit.');
|
|
107
|
-
body['project_id'] = project_id;
|
|
108
|
-
if (composition_id)
|
|
109
|
-
body['composition_id'] = composition_id;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
if (!project_name)
|
|
113
|
-
throw new Error('Please enter a project name for the new project.');
|
|
114
|
-
body['project_name'] = project_name;
|
|
115
|
-
if (team_access)
|
|
116
|
-
body['team_access'] = team_access;
|
|
117
|
-
}
|
|
118
|
-
if (model)
|
|
119
|
-
body['model'] = model;
|
|
120
|
-
if (callback_url)
|
|
121
|
-
body['callback_url'] = callback_url;
|
|
122
|
-
const response = yield common_1.descriptCommon.descriptApiCall({
|
|
123
|
-
apiKey: common_1.descriptCommon.getAuthToken(context.auth),
|
|
124
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
125
|
-
path: '/jobs/agent',
|
|
126
|
-
body,
|
|
127
|
-
});
|
|
128
|
-
return response.body;
|
|
129
|
-
});
|
|
130
|
-
},
|
|
131
|
-
});
|
|
132
|
-
//# sourceMappingURL=agent-edit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-edit.js","sourceRoot":"","sources":["../../../../src/lib/actions/agent-edit.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAuC;AACvC,sCAA2C;AAE9B,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,wBAAwB;IACrC,WAAW,EACT,sHAAsH;IACxH,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,oeAAoe,EAAE,UAAU,EAAE,KAAK,EAAE;IACphB,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC5B,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,uEAAuE;YACzE,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,UAAU;YACxB,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,UAAU,EAAE;oBACrD,EAAE,KAAK,EAAE,gCAAgC,EAAE,KAAK,EAAE,KAAK,EAAE;iBAC1D;aACF;SACF,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,IAAI,EAAE,mBAAY;YAClB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,2CAA2C;YACxD,UAAU,EAAE,CAAC,MAAM,CAAC;YACpB,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAuB,EAAE,oDAAlB,EAAE,IAAI,EAAE,IAAI,EAAE;gBAC5B,IAAI,IAAI,KAAK,UAAU;oBACrB,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,6BAA6B;qBAC3C,CAAC;gBACJ,IAAI,CAAC,IAAI;oBACP,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,mCAAmC;qBACjD,CAAC;gBACJ,IAAI,CAAC;oBACH,MAAM,QAAQ,GAAG,MAAM,uBAAc,CAAC,gBAAgB,CACpD,uBAAc,CAAC,YAAY,CAAC,IAAI,CAAC,CAClC,CAAC;oBACF,OAAO;wBACL,QAAQ,EAAE,KAAK;wBACf,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;qBAC/D,CAAC;gBACJ,CAAC;gBAAC,WAAM,CAAC;oBACP,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,iDAAiD;qBAC/D,CAAC;gBACJ,CAAC;YACH,CAAC,CAAA;SACF,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EACT,mEAAmE;YACrE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,cAAc,CAAC;YACnC,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,6FAA6F;YAC/F,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,MAAM;YACpB,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,EAAE;oBACnD,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;oBAChC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;oBACtC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;iBACjC;aACF;SACF,CAAC;QACF,cAAc,EAAE,uBAAc,CAAC,iBAAiB,CAAC,KAAK,CAAC;QACvD,MAAM,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACxB,WAAW,EAAE,QAAQ;YACrB,WAAW,EACT,2OAA2O;YAC7O,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,UAAU;YACvB,WAAW,EACT,uEAAuE;YACzE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,uIAAuI;YACzI,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EACJ,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,MAAM,EACN,KAAK,EACL,YAAY,GACb,GAAG,OAAO,CAAC,UAAU,CAAC;YAEvB,MAAM,IAAI,GAA4B,EAAE,MAAM,EAAE,CAAC;YAEjD,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;gBACxB,IAAI,CAAC,UAAU;oBAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;gBACrE,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;gBAChC,IAAI,cAAc;oBAAE,IAAI,CAAC,gBAAgB,CAAC,GAAG,cAAc,CAAC;YAC9D,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,YAAY;oBACf,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;gBACtE,IAAI,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;gBACpC,IAAI,WAAW;oBAAE,IAAI,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC;YACrD,CAAC;YAED,IAAI,KAAK;gBAAE,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;YACjC,IAAI,YAAY;gBAAE,IAAI,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;YAEtD,MAAM,QAAQ,GAAG,MAAM,uBAAc,CAAC,eAAe,CAKlD;gBACD,MAAM,EAAE,uBAAc,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;gBACjD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,aAAa;gBACnB,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const descriptGetJobStatusAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
job_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=get-job-status.d.ts.map
|