@activepieces/piece-dub 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,17 +1,12 @@
1
1
  {
2
2
  "name": "@activepieces/piece-dub",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
- "types": "./src/index.d.ts",
7
- "dependencies": {
8
- "tslib": "2.6.2",
9
- "@activepieces/pieces-common": "0.12.1",
10
- "@activepieces/pieces-framework": "0.26.2",
11
- "@activepieces/shared": "0.57.2"
12
- },
13
- "scripts": {
14
- "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
15
- "lint": "eslint 'src/**/*.ts'"
16
- }
6
+ "dependencies": {},
7
+ "files": [
8
+ "src/index.js",
9
+ "package.json",
10
+ "src/i18n"
11
+ ]
17
12
  }
package/src/index.js CHANGED
@@ -1,42 +1,33 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dub = 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("./lib/auth");
8
- const create_link_1 = require("./lib/actions/create-link");
9
- const get_link_1 = require("./lib/actions/get-link");
10
- const list_links_1 = require("./lib/actions/list-links");
11
- const update_link_1 = require("./lib/actions/update-link");
12
- const delete_link_1 = require("./lib/actions/delete-link");
13
- const link_clicked_1 = require("./lib/triggers/link-clicked");
14
- const link_created_1 = require("./lib/triggers/link-created");
15
- const shared_1 = require("@activepieces/shared");
16
- exports.dub = (0, pieces_framework_1.createPiece)({
17
- displayName: 'Dub',
18
- description: 'Dub is the modern link attribution platform for creating, managing, and analysing short links, tracking conversions, and running affiliate programmes.',
19
- minimumSupportedRelease: '0.30.0',
20
- logoUrl: 'https://cdn.activepieces.com/pieces/dub.png',
21
- categories: [shared_1.PieceCategory.MARKETING, shared_1.PieceCategory.DEVELOPER_TOOLS],
22
- auth: auth_1.dubAuth,
23
- actions: [
24
- create_link_1.createLink,
25
- get_link_1.getLink,
26
- list_links_1.listLinks,
27
- update_link_1.updateLink,
28
- delete_link_1.deleteLink,
29
- (0, pieces_common_1.createCustomApiCallAction)({
30
- auth: auth_1.dubAuth,
31
- baseUrl: () => auth_1.DUB_API_BASE,
32
- authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
33
- return ({
34
- Authorization: `Bearer ${auth.secret_text}`,
35
- });
36
- }),
37
- }),
38
- ],
39
- authors: ['Harmatta'],
40
- triggers: [link_clicked_1.linkClicked, link_created_1.linkCreated],
41
- });
42
- //# sourceMappingURL=index.js.map
1
+ "use strict";var js=Object.create;var Xe=Object.defineProperty;var Fs=Object.getOwnPropertyDescriptor;var Bs=Object.getOwnPropertyNames;var Zs=Object.getPrototypeOf,Vs=Object.prototype.hasOwnProperty;var i=(e,t)=>Xe(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mn=(e,t)=>{for(var r in t)Xe(e,r,{get:t[r],enumerable:!0})},fn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Bs(t))!Vs.call(e,o)&&o!==r&&Xe(e,o,{get:()=>t[o],enumerable:!(n=Fs(t,o))||n.enumerable});return e};var Ne=(e,t,r)=>(r=e!=null?js(Zs(e)):{},fn(t||!e||!e.__esModule?Xe(r,"default",{value:e,enumerable:!0}):r,e)),Hs=e=>fn(Xe({},"__esModule",{value:!0}),e);var Oo=E((wo,jt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function f(u,p){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let g=0,m=-1,v=(u.match(d.zoneIndex)||[])[0],b,L;for(v&&(v=v.substring(1),u=u.replace(/%.+$/,""));(m=u.indexOf(":",m+1))>=0;)g++;if(u.substr(0,2)==="::"&&g--,u.substr(-2,2)==="::"&&g--,g>p)return null;for(L=p-g,b=":";L--;)b+="0:";return u=u.replace("::",b),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),p=function(){let re=u.split(":"),se=[];for(let Je=0;Je<re.length;Je++)se.push(parseInt(re[Je],16));return se}(),{parts:p,zoneId:v}}i(f,"expandIPv6");function h(u,p,g,m){if(u.length!==p.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,b;for(;m>0;){if(b=g-m,b<0&&(b=0),u[v]>>b!==p[v]>>b)return!1;m-=g,v+=1}return!0}i(h,"matchCIDR");function P(u){if(o.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}i(P,"parseIntAuto");function $(u,p){for(;u.length<p;)u=`0${u}`;return u}i($,"padPart");let _={};_.IPv4=function(){function u(p){if(p.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<p.length;g++)if(m=p[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=p}return i(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(p,g){let m;if(g===void 0&&(m=p,p=m[0],g=m[1]),p.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,p.octets,8,g)},u.prototype.prefixLengthFromSubnetMask=function(){let p=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,b,L;for(v=3;v>=0;v-=1)if(b=this.octets[v],b in m){if(L=m[b],g&&L!==0)return null;L!==8&&(g=!0),p+=L}else return null;return 32-p},u.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u}(),_.IPv4.broadcastAddressFromCIDR=function(u){try{let p=this.parseCIDR(u),g=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],b=0;for(;b<4;)v.push(parseInt(g[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(u){return this.parser(u)!==null},_.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(u){return!!(_.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(u){let p=u.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(u)||!p?!1:_.IPv4.isValidFourPartDecimal(p[1])},_.IPv4.networkAddressFromCIDR=function(u){let p,g,m,v,b;try{for(p=this.parseCIDR(u),m=p[0].toByteArray(),b=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(b[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(u){let p=this.parser(u);if(p===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(p)},_.IPv4.parseCIDR=function(u){let p;if(p=u.match(/^(.+)\/(\d+)$/)){let g=parseInt(p[2]);if(g>=0&&g<=32){let m=[this.parse(p[1]),g];return Object.defineProperty(m,"toString",{value:i(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(u){let p,g,m;if(p=u.match(r.fourOctet))return function(){let v=p.slice(1,6),b=[];for(let L=0;L<v.length;L++)g=v[L],b.push(P(g));return b}();if(p=u.match(r.longValue)){if(m=P(p[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],b;for(b=0;b<=24;b+=8)v.push(m>>b&255);return v}().reverse()}else return(p=u.match(r.twoOctet))?function(){let v=p.slice(1,4),b=[];if(m=P(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return b.push(P(v[0])),b.push(m>>16&255),b.push(m>>8&255),b.push(m&255),b}():(p=u.match(r.threeOctet))?function(){let v=p.slice(1,5),b=[];if(m=P(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return b.push(P(v[0])),b.push(P(v[1])),b.push(m>>8&255),b.push(m&255),b}():null},_.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let p=[0,0,0,0],g=0,m=Math.floor(u/8);for(;g<m;)p[g]=255,g++;return m<4&&(p[m]=Math.pow(2,u%8)-1<<8-u%8),new this(p)},_.IPv6=function(){function u(p,g){let m,v;if(p.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(p[m]<<8|p[m+1]);else if(p.length===8)this.parts=p;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return i(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(p,g){let m;if(g===void 0&&(m=p,p=m[0],g=m[1]),p.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,p.parts,16,g)},u.prototype.prefixLengthFromSubnetMask=function(){let p=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,b;for(let L=7;L>=0;L-=1)if(v=this.parts[L],v in m){if(b=m[v],g&&b!==0)return null;b!==16&&(g=!0),p+=b}else return null;return 128-p},u.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let p,g=[],m=this.parts;for(let v=0;v<m.length;v++)p=m[v],g.push(p>>8),g.push(p&255);return g},u.prototype.toFixedLengthString=function(){let p=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push($(this.parts[v].toString(16),4));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),p+g},u.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let p=this.parts.slice(-2),g=p[0],m=p[1];return new _.IPv4([g>>8,g&255,m>>8,m&255])},u.prototype.toNormalizedString=function(){let p=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),p+g},u.prototype.toRFC5952String=function(){let p=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,b;for(;b=p.exec(g);)b[0].length>v&&(m=b.index,v=b[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},u.prototype.toString=function(){return this.toRFC5952String()},u}(),_.IPv6.broadcastAddressFromCIDR=function(u){try{let p=this.parseCIDR(u),g=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],b=0;for(;b<16;)v.push(parseInt(g[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}catch(p){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${p})`)}},_.IPv6.isIPv6=function(u){return this.parser(u)!==null},_.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let p=this.parser(u);return new this(p.parts,p.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(u){let p,g,m,v,b;try{for(p=this.parseCIDR(u),m=p[0].toByteArray(),b=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(b[g],10)),g++;return new this(v)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},_.IPv6.parse=function(u){let p=this.parser(u);if(p.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(p.parts,p.zoneId)},_.IPv6.parseCIDR=function(u){let p,g,m;if((g=u.match(/^(.+)\/(\d+)$/))&&(p=parseInt(g[2]),p>=0&&p<=128))return m=[this.parse(g[1]),p],Object.defineProperty(m,"toString",{value:i(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(u){let p,g,m,v,b,L;if(m=u.match(d.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(d.native.test(u))return f(u,8);if((m=u.match(d.transitional))&&(L=m[6]||"",p=m[1],m[1].endsWith("::")||(p=p.slice(0,-1)),p=f(p+L,6),p.parts)){for(b=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<b.length;g++)if(v=b[g],!(0<=v&&v<=255))return null;return p.parts.push(b[0]<<8|b[1]),p.parts.push(b[2]<<8|b[3]),{parts:p.parts,zoneId:p.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>128)throw new Error("ipaddr: invalid IPv6 prefix length");let p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(u/8);for(;g<m;)p[g]=255,g++;return m<16&&(p[m]=Math.pow(2,u%8)-1<<8-u%8),new this(p)},_.fromByteArray=function(u){let p=u.length;if(p===4)return new _.IPv4(u);if(p===16)return new _.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(u){return _.IPv6.isValid(u)||_.IPv4.isValid(u)},_.isValidCIDR=function(u){return _.IPv6.isValidCIDR(u)||_.IPv4.isValidCIDR(u)},_.parse=function(u){if(_.IPv6.isValid(u))return _.IPv6.parse(u);if(_.IPv4.isValid(u))return _.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(u){try{return _.IPv6.parseCIDR(u)}catch{try{return _.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(u){let p=this.parse(u);return p.kind()==="ipv6"&&p.isIPv4MappedAddress()?p.toIPv4Address():p},_.subnetMatch=function(u,p,g){let m,v,b,L;g==null&&(g="unicast");for(v in p)if(Object.prototype.hasOwnProperty.call(p,v)){for(b=p[v],b[0]&&!(b[0]instanceof Array)&&(b=[b]),m=0;m<b.length;m++)if(L=b[m],u.kind()===L[0].kind()&&u.match.apply(u,L))return v}return g},typeof jt<"u"&&jt.exports?jt.exports=_:e.ipaddr=_})(wo)});var Si=E((qS,$i)=>{var Ei=require("stream").Stream,_l=require("util");$i.exports=le;function le(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(le,"DelayedStream");_l.inherits(le,Ei);le.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(le.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});le.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};le.prototype.resume=function(){this._released||this.release(),this.source.resume()};le.prototype.pause=function(){this.source.pause()};le.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};le.prototype.pipe=function(){var e=Ei.prototype.pipe.apply(this,arguments);return this.resume(),e};le.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)};le.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 wi=E((GS,ki)=>{var Pl=require("util"),zi=require("stream").Stream,Ai=Si();ki.exports=W;function W(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}i(W,"CombinedStream");Pl.inherits(W,zi);W.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};W.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};W.prototype.append=function(e){var t=W.isStreamLike(e);if(t){if(!(e instanceof Ai)){var r=Ai.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};W.prototype.pipe=function(e,t){return zi.prototype.pipe.call(this,e,t),this.resume(),e};W.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};W.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=W.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};W.prototype._pipeNext=function(e){this._currentStream=e;var t=W.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};W.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};W.prototype.write=function(e){this.emit("data",e)};W.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};W.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};W.prototype.end=function(){this._reset(),this.emit("end")};W.prototype.destroy=function(){this._reset(),this.emit("close")};W.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};W.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};W.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};W.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ri=E((JS,Oi)=>{"use strict";Oi.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 Ci=E(te=>{"use strict";var Gt=Ri(),bl=require("path").extname,Ni=/^\s*([^;\s]*)(?:;|\s|$)/,Il=/^text\//i;te.charset=Di;te.charsets={lookup:Di};te.contentType=Tl;te.extension=El;te.extensions=Object.create(null);te.lookup=$l;te.types=Object.create(null);Sl(te.extensions,te.types);function Di(e){if(!e||typeof e!="string")return!1;var t=Ni.exec(e),r=t&&Gt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Il.test(t[1])?"UTF-8":!1}i(Di,"charset");function Tl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(Tl,"contentType");function El(e){if(!e||typeof e!="string")return!1;var t=Ni.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(El,"extension");function $l(e){if(!e||typeof e!="string")return!1;var t=bl("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}i($l,"lookup");function Sl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Gt).forEach(i(function(o){var s=Gt[o],c=s.extensions;if(!(!c||!c.length)){e[o]=c;for(var d=0;d<c.length;d++){var f=c[d];if(t[f]){var h=r.indexOf(Gt[t[f]].source),P=r.indexOf(s.source);if(t[f]!=="application/octet-stream"&&(h>P||h===P&&t[f].substr(0,12)==="application/"))continue}t[f]=o}}},"forEachMimeType"))}i(Sl,"populateMaps")});var Mi=E((QS,Ui)=>{Ui.exports=Al;function Al(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(Al,"defer")});var Zr=E((tA,ji)=>{var Li=Mi();ji.exports=zl;function zl(e){var t=!1;return Li(function(){t=!0}),i(function(n,o){t?e(n,o):Li(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(zl,"async")});var Vr=E((nA,Fi)=>{Fi.exports=kl;function kl(e){Object.keys(e.jobs).forEach(wl.bind(e)),e.jobs={}}i(kl,"abort");function wl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(wl,"clean")});var Hr=E((iA,Zi)=>{var Bi=Zr(),Ol=Vr();Zi.exports=Rl;function Rl(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Nl(t,o,e[o],function(s,c){o in r.jobs&&(delete r.jobs[o],s?Ol(r):r.results[o]=c,n(s,r.results))})}i(Rl,"iterate");function Nl(e,t,r,n){var o;return e.length==2?o=e(r,Bi(n)):o=e(r,t,Bi(n)),o}i(Nl,"runJob")});var qr=E((sA,Vi)=>{Vi.exports=Dl;function Dl(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,s){return t(e[o],e[s])}),n}i(Dl,"state")});var Wr=E((cA,Hi)=>{var Cl=Vr(),Ul=Zr();Hi.exports=Ml;function Ml(e){Object.keys(this.jobs).length&&(this.index=this.size,Cl(this),Ul(e)(null,this.results))}i(Ml,"terminator")});var Wi=E((pA,qi)=>{var Ll=Hr(),jl=qr(),Fl=Wr();qi.exports=Bl;function Bl(e,t,r){for(var n=jl(e);n.index<(n.keyedList||e).length;)Ll(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Fl.bind(n,r)}i(Bl,"parallel")});var Gr=E((mA,Kt)=>{var Gi=Hr(),Zl=qr(),Vl=Wr();Kt.exports=Hl;Kt.exports.ascending=Ki;Kt.exports.descending=ql;function Hl(e,t,r,n){var o=Zl(e,r);return Gi(e,t,o,i(function s(c,d){if(c){n(c,d);return}if(o.index++,o.index<(o.keyedList||e).length){Gi(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),Vl.bind(o,n)}i(Hl,"serialOrdered");function Ki(e,t){return e<t?-1:e>t?1:0}i(Ki,"ascending");function ql(e,t){return-1*Ki(e,t)}i(ql,"descending")});var Xi=E((gA,Ji)=>{var Wl=Gr();Ji.exports=Gl;function Gl(e,t,r){return Wl(e,t,null,r)}i(Gl,"serial")});var Qi=E((hA,Yi)=>{Yi.exports={parallel:Wi(),serial:Xi(),serialOrdered:Gr()}});var Kr=E((vA,ea)=>{"use strict";ea.exports=Object});var ra=E((xA,ta)=>{"use strict";ta.exports=Error});var oa=E((_A,na)=>{"use strict";na.exports=EvalError});var aa=E((PA,ia)=>{"use strict";ia.exports=RangeError});var ua=E((bA,sa)=>{"use strict";sa.exports=ReferenceError});var la=E((IA,ca)=>{"use strict";ca.exports=SyntaxError});var Jt=E((TA,pa)=>{"use strict";pa.exports=TypeError});var ma=E((EA,da)=>{"use strict";da.exports=URIError});var ga=E(($A,fa)=>{"use strict";fa.exports=Math.abs});var ha=E((SA,ya)=>{"use strict";ya.exports=Math.floor});var xa=E((AA,va)=>{"use strict";va.exports=Math.max});var Pa=E((zA,_a)=>{"use strict";_a.exports=Math.min});var Ia=E((kA,ba)=>{"use strict";ba.exports=Math.pow});var Ea=E((wA,Ta)=>{"use strict";Ta.exports=Math.round});var Sa=E((OA,$a)=>{"use strict";$a.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var za=E((NA,Aa)=>{"use strict";var Kl=Sa();Aa.exports=i(function(t){return Kl(t)||t===0?t:t<0?-1:1},"sign")});var wa=E((CA,ka)=>{"use strict";ka.exports=Object.getOwnPropertyDescriptor});var Jr=E((UA,Oa)=>{"use strict";var Xt=wa();if(Xt)try{Xt([],"length")}catch{Xt=null}Oa.exports=Xt});var Na=E((MA,Ra)=>{"use strict";var Yt=Object.defineProperty||!1;if(Yt)try{Yt({},"a",{value:1})}catch{Yt=!1}Ra.exports=Yt});var Xr=E((LA,Da)=>{"use strict";Da.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(t,r);if(d.value!==o||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ma=E((FA,Ua)=>{"use strict";var Ca=typeof Symbol<"u"&&Symbol,Jl=Xr();Ua.exports=i(function(){return typeof Ca!="function"||typeof Symbol!="function"||typeof Ca("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Jl()},"hasNativeSymbols")});var Yr=E((ZA,La)=>{"use strict";La.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Qr=E((VA,ja)=>{"use strict";var Xl=Kr();ja.exports=Xl.getPrototypeOf||null});var Za=E((HA,Ba)=>{"use strict";var Yl="Function.prototype.bind called on incompatible ",Ql=Object.prototype.toString,ep=Math.max,tp="[object Function]",Fa=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),rp=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),np=i(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Ba.exports=i(function(t){var r=this;if(typeof r!="function"||Ql.apply(r)!==tp)throw new TypeError(Yl+r);for(var n=rp(arguments,1),o,s=i(function(){if(this instanceof o){var P=r.apply(this,Fa(n,arguments));return Object(P)===P?P:this}return r.apply(t,Fa(n,arguments))},"binder"),c=ep(0,r.length-n.length),d=[],f=0;f<c;f++)d[f]="$"+f;if(o=Function("binder","return function ("+np(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=i(function(){},"Empty");h.prototype=r.prototype,o.prototype=new h,h.prototype=null}return o},"bind")});var He=E((WA,Va)=>{"use strict";var op=Za();Va.exports=Function.prototype.bind||op});var Qt=E((GA,Ha)=>{"use strict";Ha.exports=Function.prototype.call});var en=E((KA,qa)=>{"use strict";qa.exports=Function.prototype.apply});var Ga=E((JA,Wa)=>{"use strict";Wa.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ja=E((XA,Ka)=>{"use strict";var ip=He(),ap=en(),sp=Qt(),up=Ga();Ka.exports=up||ip.call(sp,ap)});var Ya=E((YA,Xa)=>{"use strict";var cp=He(),lp=Jt(),pp=Qt(),dp=Ja();Xa.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new lp("a function is required");return dp(cp,pp,t)},"callBindBasic")});var os=E((ez,ns)=>{"use strict";var mp=Ya(),Qa=Jr(),ts;try{ts=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var tn=!!ts&&Qa&&Qa(Object.prototype,"__proto__"),rs=Object,es=rs.getPrototypeOf;ns.exports=tn&&typeof tn.get=="function"?mp([tn.get]):typeof es=="function"?i(function(t){return es(t==null?t:rs(t))},"getDunder"):!1});var cs=E((rz,us)=>{"use strict";var is=Yr(),as=Qr(),ss=os();us.exports=is?i(function(t){return is(t)},"getProto"):as?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return as(t)},"getProto"):ss?i(function(t){return ss(t)},"getProto"):null});var rn=E((oz,ls)=>{"use strict";var fp=Function.prototype.call,gp=Object.prototype.hasOwnProperty,yp=He();ls.exports=yp.call(fp,gp)});var hs=E((iz,ys)=>{"use strict";var M,hp=Kr(),vp=ra(),xp=oa(),_p=aa(),Pp=ua(),Ke=la(),Ge=Jt(),bp=ma(),Ip=ga(),Tp=ha(),Ep=xa(),$p=Pa(),Sp=Ia(),Ap=Ea(),zp=za(),fs=Function,nn=i(function(e){try{return fs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),vt=Jr(),kp=Na(),on=i(function(){throw new Ge},"throwTypeError"),wp=vt?function(){try{return arguments.callee,on}catch{try{return vt(arguments,"callee").get}catch{return on}}}():on,qe=Ma()(),J=cs(),Op=Qr(),Rp=Yr(),gs=en(),xt=Qt(),We={},Np=typeof Uint8Array>"u"||!J?M:J(Uint8Array),Re={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":qe&&J?J([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":We,"%AsyncGenerator%":We,"%AsyncGeneratorFunction%":We,"%AsyncIteratorPrototype%":We,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":vp,"%eval%":eval,"%EvalError%":xp,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":fs,"%GeneratorFunction%":We,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qe&&J?J(J([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qe||!J?M:J(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":hp,"%Object.getOwnPropertyDescriptor%":vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":_p,"%ReferenceError%":Pp,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qe||!J?M:J(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qe&&J?J(""[Symbol.iterator]()):M,"%Symbol%":qe?Symbol:M,"%SyntaxError%":Ke,"%ThrowTypeError%":wp,"%TypedArray%":Np,"%TypeError%":Ge,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":bp,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":xt,"%Function.prototype.apply%":gs,"%Object.defineProperty%":kp,"%Object.getPrototypeOf%":Op,"%Math.abs%":Ip,"%Math.floor%":Tp,"%Math.max%":Ep,"%Math.min%":$p,"%Math.pow%":Sp,"%Math.round%":Ap,"%Math.sign%":zp,"%Reflect.getPrototypeOf%":Rp};if(J)try{null.error}catch(e){ps=J(J(e)),Re["%Error.prototype%"]=ps}var ps,Dp=i(function e(t){var r;if(t==="%AsyncFunction%")r=nn("async function () {}");else if(t==="%GeneratorFunction%")r=nn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=nn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&J&&(r=J(o.prototype))}return Re[t]=r,r},"doEval"),ds={__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"]},_t=He(),er=rn(),Cp=_t.call(xt,Array.prototype.concat),Up=_t.call(gs,Array.prototype.splice),ms=_t.call(xt,String.prototype.replace),tr=_t.call(xt,String.prototype.slice),Mp=_t.call(xt,RegExp.prototype.exec),Lp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,jp=/\\(\\)?/g,Fp=i(function(t){var r=tr(t,0,1),n=tr(t,-1);if(r==="%"&&n!=="%")throw new Ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ke("invalid intrinsic syntax, expected opening `%`");var o=[];return ms(t,Lp,function(s,c,d,f){o[o.length]=d?ms(f,jp,"$1"):c||s}),o},"stringToPath"),Bp=i(function(t,r){var n=t,o;if(er(ds,n)&&(o=ds[n],n="%"+o[0]+"%"),er(Re,n)){var s=Re[n];if(s===We&&(s=Dp(n)),typeof s>"u"&&!r)throw new Ge("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");ys.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new Ge("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ge('"allowMissing" argument must be a boolean');if(Mp(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Fp(t),o=n.length>0?n[0]:"",s=Bp("%"+o+"%",r),c=s.name,d=s.value,f=!1,h=s.alias;h&&(o=h[0],Up(n,Cp([0,1],h)));for(var P=1,$=!0;P<n.length;P+=1){var _=n[P],u=tr(_,0,1),p=tr(_,-1);if((u==='"'||u==="'"||u==="`"||p==='"'||p==="'"||p==="`")&&u!==p)throw new Ke("property names with quotes must have matching quotes");if((_==="constructor"||!$)&&(f=!0),o+="."+_,c="%"+o+"%",er(Re,c))d=Re[c];else if(d!=null){if(!(_ in d)){if(!r)throw new Ge("base intrinsic for "+t+" exists, but the property is not available.");return}if(vt&&P+1>=n.length){var g=vt(d,_);$=!!g,$&&"get"in g&&!("originalValue"in g.get)?d=g.get:d=d[_]}else $=er(d,_),d=d[_];$&&!f&&(Re[c]=d)}}return d},"GetIntrinsic")});var xs=E((sz,vs)=>{"use strict";var Zp=Xr();vs.exports=i(function(){return Zp()&&!!Symbol.toStringTag},"hasToStringTagShams")});var bs=E((cz,Ps)=>{"use strict";var Vp=hs(),_s=Vp("%Object.defineProperty%",!0),Hp=xs()(),qp=rn(),Wp=Jt(),rr=Hp?Symbol.toStringTag:null;Ps.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new Wp("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");rr&&(n||!qp(t,rr))&&(_s?_s(t,rr,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[rr]=r)},"setToStringTag")});var Ts=E((pz,Is)=>{"use strict";var Gp=Function.prototype.call,Kp=Object.prototype.hasOwnProperty,Jp=He();Is.exports=Jp.call(Gp,Kp)});var $s=E((dz,Es)=>{"use strict";Es.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var zs=E((mz,As)=>{"use strict";var cn=wi(),Xp=require("util"),an=require("path"),Yp=require("http"),Qp=require("https"),ed=require("url").parse,td=require("fs"),rd=require("stream").Stream,nd=require("crypto"),sn=Ci(),od=Qi(),id=bs(),Ae=Ts(),un=$s();function Ss(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Ss,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],cn.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(j,"FormData");Xp.inherits(j,cn);j.LINE_BREAK=`\r
2
+ `;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=cn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(o),n(t),n(s),this._trackLength(o,t,r)};j.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ae(t,"httpVersion"))&&!(t instanceof rd))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){Ae(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):td.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):Ae(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ae(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),s="",c={"Content-Disposition":["form-data",'name="'+Ss(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&un(c,r.header);var d;for(var f in c)if(Ae(c,f)){if(d=c[f],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=f+": "+d.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+s+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=an.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=an.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ae(e,"httpVersion")&&(r=an.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ss(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=sn.lookup(e.name)),!r&&e&&e.path&&(r=sn.lookup(e.path)),!r&&e&&e.readable&&Ae(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=sn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Ae(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+nd.randomBytes(12).toString("hex")};j.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}od.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=ed(e),n=un({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=un(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Qp.request(n):r=Yp.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var d,f=i(function(h,P){return r.removeListener("error",f),r.removeListener("response",d),t.call(this,h,P)},"callback");d=f.bind(this,null),r.on("error",f),r.on("response",d)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};id(j.prototype,"FormData");As.exports=j});var gd={};mn(gd,{dub:()=>fd});module.exports=Hs(gd);var qs=Object.freeze({status:"aborted"});function I(e,t,r){function n(d,f){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,f);let h=c.prototype,P=Object.keys(h);for(let $=0;$<P.length;$++){let _=P[$];_ in d||(d[_]=h[_].bind(d))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(d){var f;let h=r?.Parent?new s:this;n(h,d),(f=h._zod).deferred??(f.deferred=[]);for(let P of h._zod.deferred)P();return h}return i(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:i(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}i(I,"$constructor");var Ws=Symbol("zod_brand"),pe=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},bt=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},or={};function fe(e){return e&&Object.assign(or,e),or}i(fe,"config");function ar(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(ar,"getEnumValues");function yn(e,t){return typeof t=="bigint"?t.toString():t}i(yn,"jsonStringifyReplacer");function Tt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Tt,"cached");function hn(e){return e==null}i(hn,"nullish");function Et(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(Et,"cleanRegex");var gn=Symbol("evaluating");function G(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==gn)return n===void 0&&(n=gn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(G,"defineLazy");var sr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ye(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(Ye,"isObject");var Gs=Tt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function vn(e){if(Ye(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ye(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(vn,"isPlainObject");var xn=new Set(["string","number","symbol"]);function De(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(De,"escapeRegex");function $t(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i($t,"clone");function V(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:i(()=>t.error,"error")}:t}i(V,"normalizeParams");function _n(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(_n,"optionalKeys");var Ks={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 Ce(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}i(Ce,"aborted");function be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(be,"prefixIssues");function It(e){return typeof e=="string"?e:e?.message}i(It,"unwrapMessage");function Ie(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(r.customError?.(e))??It(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Ie,"finalizeIssue");function Pn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(Pn,"getLengthableOrigin");function ur(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(ur,"issue");var bn=i((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,yn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),In=I("$ZodError",bn),Qe=I("$ZodError",bn,{Parent:Error});var Xs=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new pe;if(c.issues.length){let d=new(o?.Err??e)(c.issues.map(f=>Ie(f,s,fe())));throw sr(d,o?.callee),d}return c.value},"_parse"),St=Xs(Qe),Ys=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(o?.Err??e)(c.issues.map(f=>Ie(f,s,fe())));throw sr(d,o?.callee),d}return c.value},"_parseAsync"),At=Ys(Qe),Qs=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new pe;return s.issues.length?{success:!1,error:new(e??In)(s.issues.map(c=>Ie(c,o,fe())))}:{success:!0,data:s.value}},"_safeParse"),et=Qs(Qe),eu=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>Ie(c,o,fe())))}:{success:!0,data:s.value}},"_safeParseAsync"),tt=eu(Qe);var tu="(?:(?:\\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])))",ru=new RegExp(`^${tu}$`);var Tn=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),En=/^-?\d+n?$/;var cr=/^-?\d+(?:\.\d+)?$/,$n=/^(?:true|false)$/i;var Ue=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Sn=I("$ZodCheckMinLength",(e,t)=>{var r;Ue.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!hn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let c=Pn(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var lr=I("$ZodCheckStringFormat",(e,t)=>{var r,n;Ue.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),An=I("$ZodCheckRegex",(e,t)=>{lr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var kn={major:4,minor:3,patch:6};var H=I("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=kn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((c,d,f)=>{let h=Ce(c),P;for(let $ of d){if($._zod.def.when){if(!$._zod.def.when(c))continue}else if(h)continue;let _=c.issues.length,u=$._zod.check(c);if(u instanceof Promise&&f?.async===!1)throw new pe;if(P||u instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await u,c.issues.length!==_&&(h||(h=Ce(c,_)))});else{if(c.issues.length===_)continue;h||(h=Ce(c,_))}}return P?P.then(()=>c):c},"runChecks"),s=i((c,d,f)=>{if(Ce(c))return c.aborted=!0,c;let h=o(d,n,f);if(h instanceof Promise){if(f.async===!1)throw new pe;return h.then(P=>e._zod.parse(P,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(P=>s(P,c,d)):s(h,c,d)}let f=e._zod.parse(c,d);if(f instanceof Promise){if(d.async===!1)throw new pe;return f.then(h=>o(h,n,d))}return o(f,n,d)}}G(e,"~standard",()=>({validate:i(o=>{try{let s=et(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return tt(e,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),wt=I("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Tn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),pr=I("$ZodStringFormat",(e,t)=>{lr.init(e,t),wt.init(e,t)});var Dn=I("$ZodURL",(e,t)=>{pr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Cn=I("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??cr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}});var dr=I("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=$n,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Un=I("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=En,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 Mn=I("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Ln=I("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var jn=I("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),Fn=I("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function wn(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}i(wn,"handleArrayResult");var Bn=I("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let c=0;c<o.length;c++){let d=o[c],f=t.element._zod.run({value:d,issues:[]},n);f instanceof Promise?s.push(f.then(h=>wn(h,r,c))):wn(f,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function kt(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(kt,"handlePropertyResult");function nu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=_n(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(nu,"normalizeDef");function ou(e,t,r,n,o,s){let c=[],d=o.keySet,f=o.catchall._zod,h=f.def.type,P=f.optout==="optional";for(let $ in t){if(d.has($))continue;if(h==="never"){c.push($);continue}let _=f.run({value:t[$],issues:[]},n);_ instanceof Promise?e.push(_.then(u=>kt(u,r,$,t,P))):kt(_,r,$,t,P)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i(ou,"handleCatchall");var Zn=I("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let d=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let f={...d};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Tt(()=>nu(t));G(e._zod,"propValues",()=>{let d=t.shape,f={};for(let h in d){let P=d[h]._zod;if(P.values){f[h]??(f[h]=new Set);for(let $ of P.values)f[h].add($)}}return f});let o=Ye,s=t.catchall,c;e._zod.parse=(d,f)=>{c??(c=n.value);let h=d.value;if(!o(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d;d.value={};let P=[],$=c.shape;for(let _ of c.keys){let u=$[_],p=u._zod.optout==="optional",g=u._zod.run({value:h[_],issues:[]},f);g instanceof Promise?P.push(g.then(m=>kt(m,d,_,h,p))):kt(g,d,_,h,p)}return s?ou(P,h,d,f,n.value,e):P.length?Promise.all(P).then(()=>d):d}});function On(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!Ce(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(c=>Ie(c,n,fe())))}),t)}i(On,"handleUnionResults");var mr=I("$ZodUnion",(e,t)=>{H.init(e,t),G(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),G(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),G(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),G(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Et(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let c=!1,d=[];for(let f of t.options){let h=f._zod.run({value:o.value,issues:[]},s);if(h instanceof Promise)d.push(h),c=!0;else{if(h.issues.length===0)return h;d.push(h)}}return c?Promise.all(d).then(f=>On(f,o,e,s)):On(d,o,e,s)}});var Vn=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,mr.init(e,t);let r=e._zod.parse;G(e._zod,"propValues",()=>{let o={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[d,f]of Object.entries(c)){o[d]||(o[d]=new Set);for(let h of f)o[d].add(h)}}return o});let n=Tt(()=>{let o=t.options,s=new Map;for(let c of o){let d=c._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of d){if(s.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);s.set(f,c)}}return s});e._zod.parse=(o,s)=>{let c=o.value;if(!Ye(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let d=n.value.get(c?.[t.discriminator]);return d?d._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),o)}});var Hn=I("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!vn(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let d=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){d.add(typeof h=="number"?h.toString():h);let P=t.valueType._zod.run({value:o[h],issues:[]},n);P instanceof Promise?s.push(P.then($=>{$.issues.length&&r.issues.push(...be(h,$.issues)),r.value[h]=$.value})):(P.issues.length&&r.issues.push(...be(h,P.issues)),r.value[h]=P.value)}let f;for(let h in o)d.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:f})}else{r.value={};for(let d of Reflect.ownKeys(o)){if(d==="__proto__")continue;let f=t.keyType._zod.run({value:d,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&cr.test(d)&&f.issues.length){let $=t.keyType._zod.run({value:Number(d),issues:[]},n);if($ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");$.issues.length===0&&(f=$)}if(f.issues.length){t.mode==="loose"?r.value[d]=o[d]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map($=>Ie($,n,fe())),input:d,path:[d],inst:e});continue}let P=t.valueType._zod.run({value:o[d],issues:[]},n);P instanceof Promise?s.push(P.then($=>{$.issues.length&&r.issues.push(...be(d,$.issues)),r.value[f.value]=$.value})):(P.issues.length&&r.issues.push(...be(d,P.issues)),r.value[f.value]=P.value)}}return s.length?Promise.all(s).then(()=>r):r}});var qn=I("$ZodEnum",(e,t)=>{H.init(e,t);let r=ar(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>xn.has(typeof o)).map(o=>typeof o=="string"?De(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),Wn=I("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?De(n):n?De(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var Gn=I("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new bt(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new pe;return r.value=o,r}});function Rn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Rn,"handleOptionalResult");var Kn=I("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",G(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),G(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Rn(s,r.value)):Rn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Jn=I("$ZodNullable",(e,t)=>{H.init(e,t),G(e._zod,"optin",()=>t.innerType._zod.optin),G(e._zod,"optout",()=>t.innerType._zod.optout),G(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)}|null)$`):void 0}),G(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 Xn=I("$ZodPipe",(e,t)=>{H.init(e,t),G(e._zod,"values",()=>t.in._zod.values),G(e._zod,"optin",()=>t.in._zod.optin),G(e._zod,"optout",()=>t.out._zod.optout),G(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>zt(c,t.in,n)):zt(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>zt(s,t.out,n)):zt(o,t.out,n)}});function zt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(zt,"handlePipeResult");var Yn=I("$ZodCustom",(e,t)=>{Ue.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>Nn(s,r,n,e));Nn(o,r,n,e)}});function Nn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(ur(o))}}i(Nn,"handleRefineResult");var eo,uu=Symbol("ZodOutput"),cu=Symbol("ZodInput"),fr=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function to(){return new fr}i(to,"registry");(eo=globalThis).__zod_globalRegistry??(eo.__zod_globalRegistry=to());var gr=globalThis.__zod_globalRegistry;function ro(e,t){return new e({type:"string",...V(t)})}i(ro,"_string");function no(e,t){return new e({type:"string",coerce:!0,...V(t)})}i(no,"_coercedString");function oo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}i(oo,"_url");function io(e,t){return new e({type:"number",checks:[],...V(t)})}i(io,"_number");function ao(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}i(ao,"_coercedNumber");function so(e,t){return new e({type:"boolean",...V(t)})}i(so,"_boolean");function uo(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}i(uo,"_coercedBoolean");function co(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}i(co,"_coercedBigint");function lo(e){return new e({type:"any"})}i(lo,"_any");function po(e){return new e({type:"unknown"})}i(po,"_unknown");function mo(e,t){return new e({type:"void",...V(t)})}i(mo,"_void");function fo(e,t){return new e({type:"date",coerce:!0,...V(t)})}i(fo,"_coercedDate");function ue(e,t){return new Sn({check:"min_length",...V(t),minimum:e})}i(ue,"_minLength");function Te(e,t){return new An({check:"string_format",format:"regex",...V(t),pattern:e})}i(Te,"_regex");function go(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(go,"_custom");var K=I("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>St(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>et(e,r,n),e.parseAsync=async(r,n)=>At(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>tt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>$t(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Rt=I("ZodMiniString",(e,t)=>{wt.init(e,t),K.init(e,t)});function a(e){return ro(Rt,e)}i(a,"string");var yo=I("ZodMiniStringFormat",(e,t)=>{pr.init(e,t),Rt.init(e,t)});var xu=I("ZodMiniURL",(e,t)=>{Dn.init(e,t),yo.init(e,t)});function ho(e){return oo(xu,e)}i(ho,"url");var yr=I("ZodMiniNumber",(e,t)=>{Cn.init(e,t),K.init(e,t)});function Y(e){return io(yr,e)}i(Y,"number");var hr=I("ZodMiniBoolean",(e,t)=>{dr.init(e,t),K.init(e,t)});function B(e){return so(hr,e)}i(B,"boolean");var vo=I("ZodMiniBigInt",(e,t)=>{Un.init(e,t),K.init(e,t)});var _u=I("ZodMiniAny",(e,t)=>{Mn.init(e,t),K.init(e,t)});function nt(){return lo(_u)}i(nt,"any");var Pu=I("ZodMiniUnknown",(e,t)=>{Ln.init(e,t),K.init(e,t)});function w(){return po(Pu)}i(w,"unknown");var bu=I("ZodMiniVoid",(e,t)=>{jn.init(e,t),K.init(e,t)});function xo(e){return mo(bu,e)}i(xo,"_void");var _o=I("ZodMiniDate",(e,t)=>{Fn.init(e,t),K.init(e,t)});var Iu=I("ZodMiniArray",(e,t)=>{Bn.init(e,t),K.init(e,t)});function N(e,t){return new Iu({type:"array",element:e,...V(t)})}i(N,"array");var Tu=I("ZodMiniObject",(e,t)=>{Zn.init(e,t),K.init(e,t),G(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...V(t)};return new Tu(r)}i(l,"object");var Eu=I("ZodMiniUnion",(e,t)=>{mr.init(e,t),K.init(e,t)});function D(e,t){return new Eu({type:"union",options:e,...V(t)})}i(D,"union");var $u=I("ZodMiniDiscriminatedUnion",(e,t)=>{Vn.init(e,t),K.init(e,t)});function Me(e,t,r){return new $u({type:"union",options:t,discriminator:e,...V(r)})}i(Me,"discriminatedUnion");var Su=I("ZodMiniRecord",(e,t)=>{Hn.init(e,t),K.init(e,t)});function O(e,t,r){return new Su({type:"record",keyType:e,valueType:t,...V(r)})}i(O,"record");var Au=I("ZodMiniEnum",(e,t)=>{qn.init(e,t),K.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 Au({type:"enum",entries:r,...V(t)})}i(U,"_enum");var zu=I("ZodMiniLiteral",(e,t)=>{Wn.init(e,t),K.init(e,t)});function S(e,t){return new zu({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}i(S,"literal");var ku=I("ZodMiniTransform",(e,t)=>{Gn.init(e,t),K.init(e,t)});function Ee(e){return new ku({type:"transform",transform:e})}i(Ee,"transform");var wu=I("ZodMiniOptional",(e,t)=>{Kn.init(e,t),K.init(e,t)});function y(e){return new wu({type:"optional",innerType:e})}i(y,"optional");var Ou=I("ZodMiniNullable",(e,t)=>{Jn.init(e,t),K.init(e,t)});function ot(e){return new Ou({type:"nullable",innerType:e})}i(ot,"nullable");var Ru=I("ZodMiniPipe",(e,t)=>{Xn.init(e,t),K.init(e,t)});function $e(e,t){return new Ru({type:"pipe",in:e,out:t})}i($e,"pipe");var Nu=I("ZodMiniCustom",(e,t)=>{Yn.init(e,t),K.init(e,t)});function Nt(e,t){return go(Nu,e??(()=>!0),t)}i(Nt,"custom");var it={};mn(it,{bigint:()=>Fu,boolean:()=>ju,date:()=>Bu,number:()=>Lu,string:()=>Mu});function Mu(e){return no(Rt,e)}i(Mu,"string");function Lu(e){return ao(yr,e)}i(Lu,"number");function ju(e){return uo(hr,e)}i(ju,"boolean");function Fu(e){return co(vo,e)}i(Fu,"bigint");function Bu(e){return fo(_o,e)}i(Bu,"date");var xr=l({retryOnFailure:l({defaultValue:y(B()),hide:y(B())}),continueOnFailure:l({defaultValue:y(B()),hide:y(B())})}),vr=class{constructor(t,r,n,o,s,c,d,f,h,P,$){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=c;this.requireAuth=d;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=P;this.aiMetadata=$}static{i(this,"IAction")}},ie=i(e=>new vr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=l({displayName:a(),description:y(a())}),C=i((e,t)=>l({type:S(t),required:B(),defaultValue:y(nt())}),"TPropertyValue");var ne=l({...F.shape,...C(a(),"SHORT_TEXT").shape}),ge=l({...F.shape,...C(a(),"LONG_TEXT").shape});var bo=l({label:a(),value:w()}),Dt=l({disabled:y(B()),placeholder:y(a()),options:N(bo)});var oe=l({...F.shape,options:Dt,...C(w(),"STATIC_DROPDOWN").shape}),ye=l({...F.shape,options:Dt,...C(N(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var _r=l({...F.shape,...C(w(),"DROPDOWN").shape,refreshers:N(a())}),at=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(Y(),"NUMBER").shape});var st=l({...F.shape,...C(w(),"FILE").shape});var ut=l({...F.shape,...C(a(),"DATE_TIME").shape});var Io=O(a(),D([ne,ge,oe,at,ye,he,ve,st,ut])),ct=l({...F.shape,properties:Io,...C(N(w()),"ARRAY").shape});var lt=l({...F.shape,...C(D([O(a(),w())]),"JSON").shape});var To=D([ne,oe,lt,ct,ye]),Vu=O(a(),To),Pr=l({refreshers:N(a()),...F.shape,...C(w(),"DYNAMIC").shape});var Ct=l({...F.shape,...C(xo(),"MARKDOWN").shape});var pt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(pt||{}),Le=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Le||{}),je=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(je||{});var dt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(dt||{}),br="both_client_credentials_and_authorization_code";var xe=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(xe||{}),mt=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(mt||{}),Hu=l({strategy:U(mt),paramName:y(a())}),ft=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ft||{});var Ut=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ut||{}),Eo=l({status:y(Y()),body:y(w()),headers:y(O(a(),a()))}),$o=l({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(U(Ut))}),So=l({type:S("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:Eo,handlerId:y(a()),streamStepProgress:y(U(Ut))}),qu=D([$o,So]);var Wu=l({body:w(),rawBody:y(w()),headers:O(a(),a()),queryParams:O(a(),a())});function ce(e){return e==null}i(ce,"isNil");function gt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(gt,"isEmpty");function Mt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(Mt,"assertNotNullOrUndefined");var Ir=Ne(require("crypto"),1);var Gu=128,ke,Fe,Ku=i(e=>{!ke||ke.length<e?(ke=Buffer.allocUnsafe(e*Gu),Ir.default.randomFillSync(ke),Fe=0):Fe+e>ke.length&&(Ir.default.randomFillSync(ke),Fe=0),Fe+=e},"fillPool"),Ju=i(e=>(Ku(e|=0),ke.subarray(Fe-e,Fe)),"random"),Xu=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(s=t)=>{let c="";for(;;){let d=r(o),f=o;for(;f--;)if(c+=e[d[f]&n]||"",c.length===s)return c}}},"customRandom"),zo=i((e,t=21)=>Xu(e,t,Ju),"customAlphabet");var Yu="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ko=21,YP=a().check(Te(new RegExp(`^[0-9a-zA-Z]{${ko}}$`))),Qu=zo(Yu,ko);var Se=$e(Ee(e=>e instanceof Date?e.toISOString():e),a()),ae={id:a(),created:Se,updated:Se},Z=i(e=>y(ot(e)),"Nullable");function Tr(e){return y(ot(U(e)))}i(Tr,"NullableEnum");var tb=$e(Ee(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(B())),Lt=i(e=>$e(Ee(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(N(e))),"OptionalArrayFromQuery");var ob=O(a(),w());var yt=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(yt||{});var yb=a().check(Te(/^#[0-9A-Fa-f]{6}$/));var vb=l({filename:a(),data:w(),type:S("file"),mimetype:y(a())});var ec=Ne(Oo());var Eb=l({...ae,name:a(),permissions:N(a()),platformId:Z(a()),type:a(),userCount:y(Y())});var Ro=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ro||{}),Er=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Er||{}),$r=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))($r||{});var Sr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Sr||{});var Ar=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ar||{});var tc=l({mode:U(Ro),value:w()}),rc=l({auth:y(a()),fields:O(a(),tc)}),nc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(rc)}),oc=l({type:S("PIECE"),toolName:a().check(ue(1)),pieceMetadata:nc}),ic=l({type:S("none")}),ac=l({type:S("access_token"),accessToken:a()}),sc=l({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),uc=l({type:S("headers"),headers:O(a(),a())}),cc=Me("type",[ic,ac,sc,uc]),No=l({type:S("FLOW"),toolName:a().check(ue(1)),externalFlowId:a(),flowDisplayName:y(a())}),Do=l({type:S("MCP"),toolName:a().check(ue(1)),serverUrl:ho(),protocol:U($r),auth:cc}),Co=l({type:S("KNOWLEDGE_BASE"),toolName:a().check(ue(1)),sourceType:U(Er),sourceId:a(),sourceName:a()}),lc=Me("type",[oc,No,Do,Co]),pc=l({displayName:a(),description:y(a()),type:U(Sr)}),Uo=l({type:S("MARKDOWN"),markdown:a()}),Be={type:S("TOOL_CALL"),input:Z(O(a(),w())),output:y(w()),toolName:a(),status:U(Ar),toolCallId:a(),startTime:a(),endTime:y(a())},Yb=l(Be),Mo=Me("toolCallType",[l({...Be,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Be,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),l({...Be,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),l({...Be,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Be,toolCallType:S("UNKNOWN"),displayName:a()})]),dc=D([Uo,Mo]);var zr=(r=>(r.IMAGE="image",r.TEXT="text",r))(zr||{}),_e=l({apiKey:a()}),mc=_e,fc=l({apiKey:a(),apiKeyHash:a()}),gc=_e,yc=_e,hc=_e,vc=_e,xc=_e,_c=_e,Pc=_e,Lo=l({accessKeyId:a().check(ue(1)),secretAccessKey:a().check(ue(1))}),bc=l({}),Ic=l({}),Tc=l({}),Ec=l({}),$c=l({}),Sc=l({}),jo=l({modelId:a(),modelName:a(),modelType:U(zr)}),Fo=l({apiKeyHeader:a(),baseUrl:a(),models:N(jo),defaultHeaders:y(O(a(),a()))}),Bo=l({accountId:a(),gatewayId:a(),models:N(jo),vertexProject:y(a()),vertexRegion:y(a())}),Zo=l({resourceName:a(),apiVersion:$e(Ee(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),Vo=l({region:a().check(ue(1))}),Ac=D([mc,hc,vc,xc,_c,yc,gc,fc,Lo,Pc]),Ho=D([Fo,Bo,Zo,Vo,bc,Tc,Ec,$c,Ic,Sc]),zc=l({id:a(),name:a(),type:U(zr)}),kc=l({id:a(),name:a(),provider:U(yt),config:Ho,enabledForChat:B()}),wc=l({provider:U(yt),config:Ho,auth:Ac,platformId:a()});var rI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Oc=l({base64Url:a(),fileName:a(),extension:y(a())}),Rc=l({mimeType:a(),url:a(),fileName:y(a())}),kr=D([Oc,Rc]);var Nc=D([l({type:S("file"),value:kr}),l({type:S("markdown"),value:a(),files:y(N(kr))})]),Dc=l({sessionId:a(),message:a(),files:y(N(a()))});var Wo=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Wo||{}),Go=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Go||{}),wr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(wr||{});var Cc=D([l({...ae,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...ae,name:a(),externalId:a(),type:D([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),Uc=l({...ae,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:Tr(Go),trigger:Tr(Wo)}),Mc=l({...ae,tableId:a(),projectId:a(),cells:O(a(),l({updated:a(),created:a(),value:w(),fieldName:a()}))}),Lc=l({events:N(U(wr)),webhookUrl:a(),flowId:a()}),jc=l({fields:N(l({id:a(),name:a()})),rows:N(O(a(),a())),name:a()}),Fc=l({projectId:a(),limit:y(it.number()),cursor:y(a()),name:y(a()),externalIds:Lt(a()),folderId:y(a()),folderIds:Lt(a())}),Bc=l({records:N(N(l({fieldId:a(),value:Jo()}))),tableId:a()}),Zc=l({cells:y(N(l({fieldId:a(),value:Jo()}))),tableId:a(),agentUpdate:y(B())}),Ko=Me("operator",[we("eq"),we("neq"),we("gt"),we("gte"),we("lt"),we("lte"),we("co"),qo("exists"),qo("not_exists")]),Vc=l({tableId:a(),limit:y(it.number()),cursor:y(a()),filters:Lt(Ko)});function Jo(){return $e(Ee(e=>e==null?e:String(e)),ot(a()))}i(Jo,"coerceToString");function we(e){return l({fieldId:a(),operator:S(e),value:a()})}i(we,"valueFilter");function qo(e){return l({fieldId:a(),operator:S(e)})}i(qo,"existenceFilter");var Hc=l({status:y(Y()),body:y(w()),headers:y(O(a(),a()))}),qc=l({...ae,deleted:Z(Se),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var Xo=l({name:a(),description:y(a()),type:a(),required:B()}),Wc=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(Xo),returnsResponse:B()})});var Yo="^[0-9]+\\.[0-9]+\\.[0-9]+$",PI=new RegExp(Yo),Kc="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",bI=a().check(Te(new RegExp(Yo))),II=a().check(Te(new RegExp(Kc))),Jc=l({packageType:S("ARCHIVE"),pieceType:U(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Qo=l({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ei=l({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),TI=D([Qo,ei]),EI=D([Jc,Qo,ei]),ti=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ti||{}),Xc=l({type:U(ti),cronExpression:a(),timezone:a()}),$I=l({...ae,type:U(xe),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(Xc),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),ri=(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))(ri||{}),ni=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ni||{}),oi=(r=>(r.S3="S3",r.DB="DB",r))(oi||{}),SI=l({...ae,projectId:Z(a()),platformId:Z(a()),type:U(ri),compression:U(ni),data:y(w()),location:U(oi),size:Z(Y()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(O(a(),a()))}),ii=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(ii||{}),ai=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ai||{}),AI=l({id:a(),email:a(),firstName:a(),status:U(ai),externalId:Z(a()),platformId:Z(a()),platformRole:U(ii),lastName:a(),created:Se,updated:Se,lastActiveDate:Z(Se),imageUrl:Z(a())});var Or=l({...F.shape,...C(O(a(),w()),"OBJECT").shape});var ci=l({...F.shape,...C(a(),"COLOR").shape});var Rr=D([ne,ge,Ct,he,oe,ye,_r,at,Pr,ve,ct,Or,lt,ut,st,ci]),x={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:y(a())});var li=l({username:a(),password:a()}),Nr=l({...de.shape,username:l({displayName:a(),description:y(a())}),password:l({displayName:a(),description:y(a())}),...C(li,"BASIC_AUTH").shape});var tl=O(a(),D([ne,ge,ve,he,oe])),Dr=l({...de.shape,props:tl,...C(w(),"CUSTOM_AUTH").shape});var Oe=l({...de.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var rl=O(a(),D([ne,ge,Oe,ve,he,oe,ye,Ct])),pi=l({...de.shape,props:rl,...C(w(),"OIDC").shape});var Cr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Cr||{}),di=D([ne,Oe,oe]),mi=O(a(),di),nl=l({props:y(O(a(),di)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:y(D([S("none"),S("consent"),S("login"),S("omit")])),pkce:y(B()),pkceMethod:y(D([S("plain"),S("S256")])),authorizationMethod:y(U(Cr)),grantType:y(D([U(dt),S(br)])),extra:y(O(a(),a()))}),fi=l({access_token:a(),props:y(mi),data:O(a(),nt())}),Ur=l({...de.shape,...nl.shape,...C(fi,"OAUTH2").shape});var Ze=D([Nr,Dr,pi,Ur,Oe]),ht="Connection",Mr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||ht}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||ht,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||ht}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||ht}},None(){}};var aE={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 ol=l({...F.shape,...C(w(),"CUSTOM").shape,code:a()});var il=D([Rr,Ze]),Lr=O(a(),il),$E=O(a(),Rr);var gi=D([l({strategy:S("CRON"),cronExpression:a()}),l({strategy:S("NONE")})]),Ve=class{constructor(t,r,n,o,s,c,d,f,h,P,$,_,u,p,g,m,v,b,L){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=c;this.handshakeConfiguration=d;this.onHandshake=f;this.renewConfiguration=h;this.onRenew=P;this.onEnable=$;this.onDisable=_;this.onStart=u;this.run=p;this.test=g;this.sampleData=m;this.testStrategy=v;this.outputSchema=b;this.aiMetadata=L}static{i(this,"ITrigger")}},Bt=i(e=>{switch(e.type){case"WEBHOOK":return new Ve(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 Ve(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 Ve(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 Ve(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,ce(e.sampleData)&&ce(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var yi="2",Zt="0.82.0";var jr=class{constructor(t,r,n,o,s,c,d,f,h=Zt,P,$=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=d;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=P;this.description=$;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:yi}),"getContextInfo");(!al(h)||sl(h,Zt))&&(this.minimumSupportedRelease=Zt),s.forEach(_=>this._actions[_.name]=_),c.forEach(_=>this._triggers[_.name]=_)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},hi=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new jr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function al(e){return/^\d+\.\d+\.\d+$/.test(e)}i(al,"isValidSimpleSemver");function sl(e,t){let[r,n,o]=e.split(".").map(Number),[s,c,d]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:o<d}i(sl,"isSemverLessThan");var ul=y(O(a(),O(a(),a()))),vi=l({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:y(a()),directoryPath:y(a()),auth:y(D([Ze,N(Ze)])),version:a(),categories:y(N(U(je))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),i18n:ul}),cl=U(["human","ai","both"]),xi=l({description:y(a()),idempotent:y(B())}),_i=l({name:a(),displayName:a(),description:a(),props:Lr,requireAuth:B(),errorHandlingOptions:y(xr),outputSchema:y(Nt()),audience:y(cl),aiMetadata:y(xi)}),Pi=l({name:a(),displayName:a(),description:a(),props:Lr,errorHandlingOptions:y(xr),type:U(xe),sampleData:w(),handshakeConfiguration:y(Nt()),renewConfiguration:y(gi),testStrategy:U(ft),outputSchema:y(Nt()),aiMetadata:y(xi)}),ll=l({...vi.shape,actions:O(a(),_i),triggers:O(a(),Pi)}),pl=l({...vi.shape,actions:Y(),triggers:Y(),suggestedActions:y(N(Pi)),suggestedTriggers:y(N(_i))}),bi=l({projectUsage:Y(),tags:y(N(a())),pieceType:U(Le),packageType:U(pt),platformId:y(a()),archiveId:y(a())}),$$=l({...ll.shape,...bi.shape}),S$=l({...pl.shape,...bi.shape}),A$=l({name:a(),version:a()});var dl=Ne(require("path")),ml=Ne(require("fs/promises"));var Vt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,c)=>{o.append(c,s)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Ht=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new Fr,r=new Br){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Fr=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Br=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var qt=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Wt=class extends Vt{static{i(this,"FetchHttpClient")}constructor(t="",r=new Ht){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[L,re]of Object.entries(c))o.append(L,re);let d=o.toString(),f=d?`${n}?${d}`:n,h=t.responseType??"json",P=t.followRedirects??!0,$=t.retries??0,{body:_,extraHeaders:u,isStream:p}=fl(t.body,s),g=yl({...s,...u}),m=await gl(async()=>{let L=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let se={method:t.method.toString(),headers:g,body:_,redirect:P?"follow":"manual",signal:L.signal};return p&&(se.duplex="half"),r?.dispatcher!==void 0&&(se.dispatcher=r.dispatcher),await fetch(f,se)}finally{re!==void 0&&clearTimeout(re)}},$),v=P?300:400;if(m.status<200||m.status>=v){let L=await Ii(m,h),re=new qt(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let b=await Ii(m,h);return{status:m.status,headers:hl(m.headers),body:b}}};function fl(e,t){return xl(e)?{body:void 0,extraHeaders:{},isStream:!1}:vl(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(fl,"serializeBody");async function Ii(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(Ii,"parseResponseBody");async function gl(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Ti(n);continue}return o}catch(o){if(r=o,n<t){await Ti(n);continue}throw o}throw r}i(gl,"sendWithRetries");function Ti(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Ti,"backoff");function yl(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}i(yl,"normalizeHeaders");function hl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(hl,"toHttpHeaders");function vl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}i(vl,"isNodeFormData");function xl(e){return e==null}i(xl,"isNil");var ee=new Wt;var Pe=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Pe||{});var ad=Ne(require("fs")),ks=Ne(zs());var sd={"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 ud(e){let t=e.split(";")[0].trim().toLowerCase();return sd[t]??""}i(ud,"contentTypeToExtension");var cd=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),ld=i((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function ws({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:s,props:c,extraProps:d,authLocation:f="headers"}){return ie({audience:"human",name:s||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:x.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:h})=>({url:x.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${ld(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:x.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Pe).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:x.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:x.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:x.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:x.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:h})=>{if(!h)return{};let P=h,$={};switch(P){case"none":break;case"json":$.data=x.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":$.data=x.LongText({displayName:"Raw Body",required:!0});break;case"form_data":$.data=x.Array({displayName:"Form Data",required:!0,properties:{fieldName:x.ShortText({displayName:"Field Name",required:!0}),fieldType:x.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:x.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:x.File({displayName:"File Field Value",required:!1})}});break}return $},"props")}),response_is_binary:x.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:x.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:x.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:x.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:i(async h=>{let{method:P,url:$,headers:_,queryParams:u,body:p,body_type:g,failsafe:m,timeout:v,response_is_binary:b,followRedirects:L}=h.propsValue;Mt(P,"Method"),Mt($,"URL");let re=ce(r)?{}:await r(h.auth,h.propsValue),se=$.url,Je=se.startsWith("http://")||se.startsWith("https://")?se:cd({baseUrl:t(h.auth),relativePath:se}),ze={method:P,url:Je,headers:{..._??{},...f==="headers"||!ce(f)?re:{}},queryParams:{...f==="queryParams"?re:{},...u??{}},timeout:v?v*1e3:0,followRedirects:L};if(b&&(ze.responseType="arraybuffer"),p)if(g&&g!=="none"){let me=p.data;if(g==="form_data"){let Ls=me,Pt=new ks.default;for(let{fieldName:ln,fieldType:pn,textFieldValue:dn,fileFieldValue:nr}of Ls)pn==="text"&&!gt(dn)?Pt.append(ln,dn):pn==="file"&&!gt(nr)&&Pt.append(ln,nr.data,{filename:nr?.filename});ze.body=Pt,ze.headers={...ze.headers,...Pt.getHeaders()}}else ze.body=me}else g||(ze.body=p);try{let me=await ee.sendRequest(ze);return await pd(h.files,me.body,me.status,me.headers,b)}catch(me){if(m)return me.errorMessage();throw me}},"run")})}i(ws,"createCustomApiCallAction");var pd=i(async(e,t,r,n,o)=>{let s;if(o&&dd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=ud(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),s=await e.write({fileName:`output.${d}`,data:f})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),dd=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Q="https://api.dub.co",md="\nTo obtain your Dub API key:\n1. Go to [https://app.dub.co/settings/tokens](https://app.dub.co/settings/tokens)\n2. Click **Create API Key**\n3. Give your key a name and select the required scopes\n4. Copy the key \u2014 it starts with `dub_` (e.g. `dub_xxxxxxxxxxxxxxxx`)\n5. Paste it here\n\n> **Required scopes:** `links.read`, `links.write`, `webhooks.write` (for triggers)\n",X=Mr.SecretText({displayName:"API Key",description:md,required:!0,validate:i(async({auth:e})=>{try{return await ee.sendRequest({method:"GET",url:`${Q}/folders`,headers:{Authorization:`Bearer ${e.trim()}`,"Content-Type":"application/json"}}),{valid:!0}}catch(t){let r=t;return r?.response?.status===401?{valid:!1,error:"Invalid API key. Please check your Dub API credentials."}:r?.response?.status===403?{valid:!1,error:"Insufficient scopes. Ensure your API key has links.read, links.write, and webhooks.write permissions."}:{valid:!1,error:"Unable to validate API key. Please try again."}}},"validate")});var Os=ie({name:"create_link",displayName:"Create Link",description:"Create a new shortened link in your Dub workspace.",audience:"both",aiMetadata:{description:"Creates a new Dub short link for a destination URL, optionally with a custom domain, slug, tags, UTM parameters, expiration, password protection, and device-specific redirects. Use when an agent needs to generate a trackable short link. Not idempotent: each call creates a separate link, and if no slug is supplied a new random one is generated, so repeating the call yields duplicate links.",idempotent:!1},auth:X,props:{url:x.ShortText({displayName:"Destination URL",description:"The full destination URL the short link should redirect to.",required:!0}),domain:x.ShortText({displayName:"Domain",description:"The domain to use for the short link (e.g. `dub.sh`). If omitted, the primary workspace domain is used.",required:!1}),key:x.ShortText({displayName:"Short Link Slug",description:"Custom slug for the short link (e.g. `my-promo`). If omitted, a random 7-character slug is generated.",required:!1}),externalId:x.ShortText({displayName:"External ID",description:"Your internal database ID for this link. Must be unique per workspace. Useful for looking up the link later.",required:!1}),title:x.ShortText({displayName:"Title",description:"A human-readable title for the link (used in the Dub dashboard).",required:!1}),description:x.LongText({displayName:"Description",description:"A short description of what the link points to.",required:!1}),image:x.ShortText({displayName:"OG Image URL",description:"Custom link preview image (og:image). Used when Custom Link Previews (`proxy`) is enabled.",required:!1}),video:x.ShortText({displayName:"OG Video URL",description:"Custom link preview video (og:video). Used when Custom Link Previews (`proxy`) is enabled.",required:!1}),tags:x.Array({displayName:"Tag Names",description:"List of tag names to attach to this link.",required:!1}),folderId:x.ShortText({displayName:"Folder ID",description:"The unique ID of an existing folder to assign this link to.",required:!1}),expiresAt:x.ShortText({displayName:"Expires At",description:"ISO 8601 datetime when the link should expire (e.g. `2025-12-31T23:59:59Z`). Expired links redirect to the expiration URL.",required:!1}),expiredUrl:x.ShortText({displayName:"Expired URL",description:"URL to redirect to after the link expires.",required:!1}),password:x.ShortText({displayName:"Password",description:"Password-protect the link. Visitors must enter this password before being redirected.",required:!1}),trackConversion:x.Checkbox({displayName:"Track Conversions",description:"Whether to track conversions for this link.",required:!1,defaultValue:!1}),proxy:x.Checkbox({displayName:"Custom Link Previews",description:"Enable Custom Link Previews (og:title, og:description, og:image) for this link.",required:!1,defaultValue:!1}),rewrite:x.Checkbox({displayName:"Cloaked URL (URL Rewriting)",description:"Cloak the destination URL \u2014 visitors see the short link URL in the browser.",required:!1,defaultValue:!1}),doIndex:x.Checkbox({displayName:"Allow Search Engine Indexing",description:"Allow search engines to index this short link.",required:!1,defaultValue:!1}),archived:x.Checkbox({displayName:"Archived",description:"Archive this link immediately after creation.",required:!1,defaultValue:!1}),ios:x.ShortText({displayName:"iOS Redirect URL",description:"Redirect iOS device visitors to this URL instead.",required:!1}),android:x.ShortText({displayName:"Android Redirect URL",description:"Redirect Android device visitors to this URL instead.",required:!1}),comments:x.LongText({displayName:"Comments",description:"Internal notes about this link (not shown to visitors).",required:!1}),utm_source:x.ShortText({displayName:"UTM Source",description:"UTM source parameter (e.g. `newsletter`, `twitter`).",required:!1}),utm_medium:x.ShortText({displayName:"UTM Medium",description:"UTM medium parameter (e.g. `email`, `social`).",required:!1}),utm_campaign:x.ShortText({displayName:"UTM Campaign",description:"UTM campaign parameter (e.g. `spring-sale`).",required:!1}),utm_term:x.ShortText({displayName:"UTM Term",description:"UTM term parameter for paid search keywords.",required:!1}),utm_content:x.ShortText({displayName:"UTM Content",description:"UTM content parameter for A/B testing.",required:!1})},async run(e){let{auth:t,propsValue:r}=e,n={url:r.url};return r.domain&&(n.domain=r.domain),r.key&&(n.key=r.key),r.externalId&&(n.externalId=r.externalId),r.title&&(n.title=r.title),r.description&&(n.description=r.description),r.image&&(n.image=r.image),r.video&&(n.video=r.video),r.tags&&r.tags.length>0&&(n.tagNames=r.tags),r.folderId&&(n.folderId=r.folderId),r.expiresAt&&(n.expiresAt=r.expiresAt),r.expiredUrl&&(n.expiredUrl=r.expiredUrl),r.password&&(n.password=r.password),r.trackConversion&&(n.trackConversion=r.trackConversion),r.proxy&&(n.proxy=r.proxy),r.rewrite&&(n.rewrite=r.rewrite),r.doIndex&&(n.doIndex=r.doIndex),r.archived&&(n.archived=r.archived),r.ios&&(n.ios=r.ios),r.android&&(n.android=r.android),r.comments&&(n.comments=r.comments),r.utm_source&&(n.utm_source=r.utm_source),r.utm_medium&&(n.utm_medium=r.utm_medium),r.utm_campaign&&(n.utm_campaign=r.utm_campaign),r.utm_term&&(n.utm_term=r.utm_term),r.utm_content&&(n.utm_content=r.utm_content),(await ee.sendRequest({method:"POST",url:`${Q}/links`,headers:{Authorization:`Bearer ${t.secret_text}`,"Content-Type":"application/json"},body:n})).body}});var Rs=ie({name:"get_link",displayName:"Get Link",description:"Retrieve details of a specific Dub link by its ID, external ID, or domain + key.",audience:"both",aiMetadata:{description:"Fetches the full details of a single existing Dub link. Choose the lookup mode: by Dub link ID, by your own external ID (prefixed with ext_), or by domain + slug key. Use when an agent has a known identifier and needs the current link record. Idempotent read-only lookup.",idempotent:!0},auth:X,props:{lookupMethod:x.StaticDropdown({displayName:"Look Up By",description:"How to identify the link you want to retrieve.",required:!0,defaultValue:"linkId",options:{options:[{label:"Link ID",value:"linkId"},{label:"External ID",value:"externalId"},{label:"Domain + Key",value:"domainKey"}]}}),linkId:x.ShortText({displayName:"Link ID",description:"The Dub-generated link ID (e.g. `clv3g2...`). Used when Look Up By = Link ID.",required:!1}),externalId:x.ShortText({displayName:"External ID",description:"Your internal ID for the link. Pass with prefix `ext_` (e.g. `ext_123456`). Used when Look Up By = External ID.",required:!1}),domain:x.ShortText({displayName:"Domain",description:"The domain of the link (e.g. `dub.sh`). Used when Look Up By = Domain + Key.",required:!1}),key:x.ShortText({displayName:"Key (Slug)",description:"The slug of the link (e.g. `my-promo`). Used when Look Up By = Domain + Key.",required:!1})},async run(e){let{auth:t,propsValue:r}=e,{lookupMethod:n,linkId:o,externalId:s,domain:c,key:d}=r,f;switch(n){case"linkId":if(!o)throw new Error("Link ID is required when Look Up By = Link ID.");f=`${Q}/links/${o}`;break;case"externalId":if(!s)throw new Error("External ID is required when Look Up By = External ID.");f=`${Q}/links/info?externalId=${encodeURIComponent(s)}`;break;case"domainKey":if(!c||!d)throw new Error("Both Domain and Key are required when Look Up By = Domain + Key.");f=`${Q}/links/info?domain=${encodeURIComponent(c)}&key=${encodeURIComponent(d)}`;break;default:throw new Error(`Unsupported lookup method: ${n}`)}return(await ee.sendRequest({method:"GET",url:f,headers:{Authorization:`Bearer ${t.secret_text}`,"Content-Type":"application/json"}})).body}});var Ns=ie({name:"list_links",displayName:"List Links",description:"Retrieve a paginated list of links in your Dub workspace.",audience:"both",aiMetadata:{description:"Lists short links in the Dub workspace, with optional filters by domain, tag names, user, archived status, and a free-text search over URL/title/slug; leave filters empty to return all links. Use when an agent needs to discover links or find a link ID without already knowing an identifier. Supports pagination and sorting. Idempotent read-only query.",idempotent:!0},auth:X,props:{domain:x.ShortText({displayName:"Domain Filter",description:"Filter by a specific domain (e.g. `dub.sh`). Leave empty to return all domains.",required:!1}),tagNames:x.Array({displayName:"Tag Name Filter",description:"Filter by one or more tag names.",required:!1}),search:x.ShortText({displayName:"Search Query",description:"Search links by their URL, title, or slug.",required:!1}),userId:x.ShortText({displayName:"User ID Filter",description:"Filter links created by a specific user ID.",required:!1}),showArchived:x.Checkbox({displayName:"Include Archived Links",description:"Whether to include archived links in the results.",required:!1,defaultValue:!1}),page:x.Number({displayName:"Page",description:"Page number for pagination (starts at 1).",required:!1,defaultValue:1}),pageSize:x.Number({displayName:"Page Size",description:"Number of links to return per page (1\u2013100). Default is 100.",required:!1,defaultValue:100}),sort:x.StaticDropdown({displayName:"Sort By",description:"Field to sort results by.",required:!1,defaultValue:"createdAt",options:{options:[{label:"Created At (newest first)",value:"createdAt"},{label:"Clicks (most clicks first)",value:"clicks"},{label:"Last Clicked",value:"lastClicked"}]}})},async run(e){let{auth:t,propsValue:r}=e,n=new URLSearchParams;if(r.domain&&n.set("domain",r.domain),r.search&&n.set("search",r.search),r.userId&&n.set("userId",r.userId),r.showArchived&&n.set("showArchived","true"),r.page&&n.set("page",String(r.page)),r.pageSize&&n.set("pageSize",String(r.pageSize)),r.sort&&n.set("sort",r.sort),r.tagNames&&r.tagNames.length>0)for(let d of r.tagNames)n.append("tagName",d);let o=n.toString(),s=`${Q}/links${o?`?${o}`:""}`;return(await ee.sendRequest({method:"GET",url:s,headers:{Authorization:`Bearer ${t.secret_text}`,"Content-Type":"application/json"}})).body}});var Ds=ie({name:"update_link",displayName:"Update Link",description:"Update an existing Dub link. Only the fields you fill in will be updated.",audience:"both",aiMetadata:{description:"Updates an existing Dub link identified by its link ID, applying only the fields supplied (destination URL, slug, tags, UTM parameters, expiration, password, device redirects, archived state, etc.). Use when an agent needs to modify a known link rather than create one. Requires the link ID and at least one field to change. Idempotent: applying the same field values repeatedly leaves the link in the same state.",idempotent:!0},auth:X,props:{linkId:x.ShortText({displayName:"Link ID",description:"The ID of the link to update (e.g. `clv3g2...`). Find this from the Create Link or List Links actions.",required:!0}),url:x.ShortText({displayName:"New Destination URL",description:"Update the destination URL the link redirects to.",required:!1}),key:x.ShortText({displayName:"New Slug",description:"Update the short link slug (the part after the domain).",required:!1}),title:x.ShortText({displayName:"Title",description:"Update the human-readable title.",required:!1}),description:x.LongText({displayName:"Description",description:"Update the link description.",required:!1}),image:x.ShortText({displayName:"OG Image URL",description:"Update the custom link preview image (og:image).",required:!1}),video:x.ShortText({displayName:"OG Video URL",description:"Update the custom link preview video (og:video).",required:!1}),tags:x.Array({displayName:"Tag Names",description:"Replace the link's tags with this new list of tag names. Send an empty array to clear all tags.",required:!1}),folderId:x.ShortText({displayName:"Folder ID",description:"Move this link to a different folder by its ID.",required:!1}),expiresAt:x.ShortText({displayName:"Expires At",description:"ISO 8601 datetime when the link should expire. Set to empty to remove expiration.",required:!1}),expiredUrl:x.ShortText({displayName:"Expired URL",description:"URL to redirect to after expiration.",required:!1}),password:x.ShortText({displayName:"Password",description:"Update the password for this link. Leave blank to remove password protection.",required:!1}),trackConversion:x.Checkbox({displayName:"Track Conversions",description:"Whether to track conversions for this link.",required:!1}),proxy:x.Checkbox({displayName:"Custom Link Previews",description:"Enable or disable Custom Link Previews (og:title, og:description, og:image) for this link.",required:!1}),rewrite:x.Checkbox({displayName:"Cloaked URL (URL Rewriting)",description:"Toggle URL cloaking.",required:!1}),doIndex:x.Checkbox({displayName:"Allow Search Engine Indexing",description:"Allow search engines to index this short link.",required:!1}),archived:x.Checkbox({displayName:"Archived",description:"Archive or unarchive the link.",required:!1}),ios:x.ShortText({displayName:"iOS Redirect URL",description:"Update the iOS-specific redirect URL.",required:!1}),android:x.ShortText({displayName:"Android Redirect URL",description:"Update the Android-specific redirect URL.",required:!1}),comments:x.LongText({displayName:"Comments",description:"Update internal notes for this link.",required:!1}),utm_source:x.ShortText({displayName:"UTM Source",description:"Update the UTM source parameter.",required:!1}),utm_medium:x.ShortText({displayName:"UTM Medium",description:"Update the UTM medium parameter.",required:!1}),utm_campaign:x.ShortText({displayName:"UTM Campaign",description:"Update the UTM campaign parameter.",required:!1}),utm_term:x.ShortText({displayName:"UTM Term",description:"Update the UTM term parameter.",required:!1}),utm_content:x.ShortText({displayName:"UTM Content",description:"Update the UTM content parameter.",required:!1})},async run(e){let{auth:t,propsValue:r}=e,{linkId:n,...o}=r,s={};if(o.url!==void 0&&o.url!==null&&o.url!==""&&(s.url=o.url),o.key!==void 0&&o.key!==null&&o.key!==""&&(s.key=o.key),o.title!==void 0&&o.title!==null&&(s.title=o.title),o.description!==void 0&&o.description!==null&&(s.description=o.description),o.image!==void 0&&o.image!==null&&(s.image=o.image),o.video!==void 0&&o.video!==null&&(s.video=o.video),o.tags!==void 0&&(s.tagNames=o.tags),o.folderId!==void 0&&o.folderId!==null&&(s.folderId=o.folderId),o.expiresAt!==void 0&&o.expiresAt!==null&&(s.expiresAt=o.expiresAt),o.expiredUrl!==void 0&&o.expiredUrl!==null&&(s.expiredUrl=o.expiredUrl),o.password!==void 0&&o.password!==null&&(s.password=o.password),o.trackConversion!==void 0&&(s.trackConversion=o.trackConversion),o.proxy!==void 0&&(s.proxy=o.proxy),o.rewrite!==void 0&&(s.rewrite=o.rewrite),o.doIndex!==void 0&&(s.doIndex=o.doIndex),o.archived!==void 0&&(s.archived=o.archived),o.ios!==void 0&&o.ios!==null&&(s.ios=o.ios),o.android!==void 0&&o.android!==null&&(s.android=o.android),o.comments!==void 0&&o.comments!==null&&(s.comments=o.comments),o.utm_source!==void 0&&o.utm_source!==null&&(s.utm_source=o.utm_source),o.utm_medium!==void 0&&o.utm_medium!==null&&(s.utm_medium=o.utm_medium),o.utm_campaign!==void 0&&o.utm_campaign!==null&&(s.utm_campaign=o.utm_campaign),o.utm_term!==void 0&&o.utm_term!==null&&(s.utm_term=o.utm_term),o.utm_content!==void 0&&o.utm_content!==null&&(s.utm_content=o.utm_content),Object.keys(s).length===0)throw new Error("At least one field must be provided to update.");return(await ee.sendRequest({method:"PATCH",url:`${Q}/links/${n}`,headers:{Authorization:`Bearer ${t.secret_text}`,"Content-Type":"application/json"},body:s})).body}});var Cs=ie({name:"delete_link",displayName:"Delete Link",description:"Permanently delete a Dub link. This action cannot be undone.",audience:"both",aiMetadata:{description:"Permanently deletes a Dub link by its link ID; this is destructive and cannot be undone. Use only when an agent is certain the link should be removed. Idempotent on end state \u2014 once deleted the link stays gone \u2014 but a repeat call targets an already-removed link.",idempotent:!0},auth:X,props:{linkId:x.ShortText({displayName:"Link ID",description:"The ID of the link to delete (e.g. `clv3g2...`). Find this from the Create Link or List Links actions.",required:!0})},async run(e){let{auth:t,propsValue:r}=e;return(await ee.sendRequest({method:"DELETE",url:`${Q}/links/${r.linkId}`,headers:{Authorization:`Bearer ${t.secret_text}`,"Content-Type":"application/json"}})).body}});var Us=Bt({auth:X,name:"link_clicked",displayName:"Link Clicked",description:"Triggers in real time whenever one of your Dub short links is clicked.",aiMetadata:{description:"Fires in real time each time any short link in the Dub workspace is clicked, delivering the click event together with the link and visitor context (location, device, browser, referrer). Use to react to traffic or attribution events as they happen."},type:"WEBHOOK",props:{md:x.MarkDown({value:`## Setup Instructions
4
+
5
+ 1. Go to your Dub workspace and navigate to **Settings \u2192 [Webhooks](https://app.dub.co/settings/webhooks)**.
6
+ 2. Click **Create Webhook**.
7
+ 3. Give your webhook a name.
8
+ 4. Paste the following URL into the **URL** field:
9
+ \`\`\`text
10
+ {{webhookUrl}}
11
+ \`\`\`
12
+ 5. Under **Events**, select **link.clicked**.
13
+ 6. Click **Create webhook**.`,variant:"INFO"})},sampleData:{id:"evt_abc123",event:"link.clicked",createdAt:"2024-01-15T10:30:00.000Z",data:{link:{id:"clv3g2xyz",domain:"dub.sh",key:"my-promo",url:"https://example.com/landing",shortLink:"https://dub.sh/my-promo",clicks:42},click:{id:"click_abc",timestamp:"2024-01-15T10:30:00.000Z",identity:"anonymous",url:"https://dub.sh/my-promo",country:"US",city:"San Francisco",region:"CA",continent:"NA",device:"Desktop",browser:"Chrome",os:"macOS",referer:"https://twitter.com",refererUrl:"https://twitter.com"}}},async onEnable(){},async onDisable(){},async run(e){return[e.payload.body]}});var Ms=Bt({auth:X,name:"link_created",displayName:"Link Created",description:"Triggers in real time whenever a new short link is created in your Dub workspace.",aiMetadata:{description:"Fires in real time whenever a new short link is created in the Dub workspace, delivering the newly created link record. Use to react to link creation, regardless of whether the link was made via the API, dashboard, or another integration."},type:"WEBHOOK",props:{md:x.MarkDown({value:`## Setup Instructions
14
+
15
+ 1. Go to your Dub workspace and navigate to **Settings \u2192 [Webhooks](https://app.dub.co/settings/webhooks)**.
16
+ 2. Click **Create Webhook**.
17
+ 3. Give your webhook a name.
18
+ 4. Paste the following URL into the **URL** field:
19
+ \`\`\`text
20
+ {{webhookUrl}}
21
+ \`\`\`
22
+ 5. Under **Events**, select **link.created**.
23
+ 6. Click **Create webhook**.`,variant:"INFO"})},sampleData:{id:"evt_def456",event:"link.created",createdAt:"2024-01-15T10:30:00.000Z",data:{link:{id:"clv3g2xyz",domain:"dub.sh",key:"new-link",url:"https://example.com/new-page",shortLink:"https://dub.sh/new-link",clicks:0,createdAt:"2024-01-15T10:30:00.000Z"}}},async onEnable(){},async onDisable(){},async run(e){return[e.payload.body]}});var fd=hi({displayName:"Dub",description:"Dub is the modern link attribution platform for creating, managing, and analysing short links, tracking conversions, and running affiliate programmes.",minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/dub.png",categories:["MARKETING","DEVELOPER_TOOLS"],auth:X,actions:[Os,Rs,Ns,Ds,Cs,ws({auth:X,baseUrl:i(()=>Q,"baseUrl"),authMapping:i(async e=>({Authorization:`Bearer ${e.secret_text}`}),"authMapping")})],authors:["Harmatta"],triggers:[Us,Ms]});0&&(module.exports={dub});
24
+ /*! Bundled license information:
25
+
26
+ mime-types/index.js:
27
+ (*!
28
+ * mime-types
29
+ * Copyright(c) 2014 Jonathan Ong
30
+ * Copyright(c) 2015 Douglas Christopher Wilson
31
+ * MIT Licensed
32
+ *)
33
+ */
package/src/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const dub: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,+DAAwE;AACxE,qCAAmD;AACnD,2DAAuD;AACvD,qDAAiD;AACjD,yDAAqD;AACrD,2DAAuD;AACvD,2DAAuD;AACvD,8DAA0D;AAC1D,8DAA0D;AAC1D,iDAAqD;AAExC,QAAA,GAAG,GAAG,IAAA,8BAAW,EAAC;IAC7B,WAAW,EAAE,KAAK;IAClB,WAAW,EACT,wJAAwJ;IAC1J,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,6CAA6C;IACtD,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,EAAE,sBAAa,CAAC,eAAe,CAAC;IACpE,IAAI,EAAE,cAAO;IACb,OAAO,EAAE;QACP,wBAAU;QACV,kBAAO;QACP,sBAAS;QACT,wBAAU;QACV,wBAAU;QACV,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,cAAO;YACb,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAY;YAC3B,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;iBAC5C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,QAAQ,EAAE,CAAC,0BAAW,EAAE,0BAAW,CAAC;CACrC,CAAC,CAAC"}
@@ -1,28 +0,0 @@
1
- export declare const createLink: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- domain: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
- key: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
- externalId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
- title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- description: import("@activepieces/pieces-framework").LongTextProperty<false>;
8
- image: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- video: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
11
- folderId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
- expiresAt: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
- expiredUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
- password: import("@activepieces/pieces-framework").ShortTextProperty<false>;
15
- trackConversion: import("@activepieces/pieces-framework").CheckboxProperty<false>;
16
- proxy: import("@activepieces/pieces-framework").CheckboxProperty<false>;
17
- rewrite: import("@activepieces/pieces-framework").CheckboxProperty<false>;
18
- doIndex: import("@activepieces/pieces-framework").CheckboxProperty<false>;
19
- archived: import("@activepieces/pieces-framework").CheckboxProperty<false>;
20
- ios: import("@activepieces/pieces-framework").ShortTextProperty<false>;
21
- android: import("@activepieces/pieces-framework").ShortTextProperty<false>;
22
- comments: import("@activepieces/pieces-framework").LongTextProperty<false>;
23
- utm_source: import("@activepieces/pieces-framework").ShortTextProperty<false>;
24
- utm_medium: import("@activepieces/pieces-framework").ShortTextProperty<false>;
25
- utm_campaign: import("@activepieces/pieces-framework").ShortTextProperty<false>;
26
- utm_term: import("@activepieces/pieces-framework").ShortTextProperty<false>;
27
- utm_content: import("@activepieces/pieces-framework").ShortTextProperty<false>;
28
- }>;