@activepieces/piece-resend 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/package.json +7 -12
  2. package/src/index.js +14 -102
  3. package/src/index.d.ts +0 -3
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/cancel-scheduled-email.action.d.ts +0 -4
  7. package/src/lib/actions/cancel-scheduled-email.action.d.ts.map +0 -1
  8. package/src/lib/actions/cancel-scheduled-email.action.js +0 -33
  9. package/src/lib/actions/cancel-scheduled-email.action.js.map +0 -1
  10. package/src/lib/actions/create-audience.action.d.ts +0 -4
  11. package/src/lib/actions/create-audience.action.d.ts.map +0 -1
  12. package/src/lib/actions/create-audience.action.js +0 -34
  13. package/src/lib/actions/create-audience.action.js.map +0 -1
  14. package/src/lib/actions/create-broadcast.action.d.ts +0 -11
  15. package/src/lib/actions/create-broadcast.action.d.ts.map +0 -1
  16. package/src/lib/actions/create-broadcast.action.js +0 -84
  17. package/src/lib/actions/create-broadcast.action.js.map +0 -1
  18. package/src/lib/actions/create-contact.action.d.ts +0 -8
  19. package/src/lib/actions/create-contact.action.d.ts.map +0 -1
  20. package/src/lib/actions/create-contact.action.js +0 -47
  21. package/src/lib/actions/create-contact.action.js.map +0 -1
  22. package/src/lib/actions/create-domain.action.d.ts +0 -5
  23. package/src/lib/actions/create-domain.action.d.ts.map +0 -1
  24. package/src/lib/actions/create-domain.action.js +0 -61
  25. package/src/lib/actions/create-domain.action.js.map +0 -1
  26. package/src/lib/actions/delete-audience.action.d.ts +0 -4
  27. package/src/lib/actions/delete-audience.action.d.ts.map +0 -1
  28. package/src/lib/actions/delete-audience.action.js +0 -30
  29. package/src/lib/actions/delete-audience.action.js.map +0 -1
  30. package/src/lib/actions/delete-broadcast.action.d.ts +0 -4
  31. package/src/lib/actions/delete-broadcast.action.d.ts.map +0 -1
  32. package/src/lib/actions/delete-broadcast.action.js +0 -30
  33. package/src/lib/actions/delete-broadcast.action.js.map +0 -1
  34. package/src/lib/actions/delete-contact.action.d.ts +0 -5
  35. package/src/lib/actions/delete-contact.action.d.ts.map +0 -1
  36. package/src/lib/actions/delete-contact.action.js +0 -31
  37. package/src/lib/actions/delete-contact.action.js.map +0 -1
  38. package/src/lib/actions/delete-domain.action.d.ts +0 -4
  39. package/src/lib/actions/delete-domain.action.d.ts.map +0 -1
  40. package/src/lib/actions/delete-domain.action.js +0 -30
  41. package/src/lib/actions/delete-domain.action.js.map +0 -1
  42. package/src/lib/actions/get-email-status.action.d.ts +0 -4
  43. package/src/lib/actions/get-email-status.action.d.ts.map +0 -1
  44. package/src/lib/actions/get-email-status.action.js +0 -36
  45. package/src/lib/actions/get-email-status.action.js.map +0 -1
  46. package/src/lib/actions/list-audiences.action.d.ts +0 -2
  47. package/src/lib/actions/list-audiences.action.d.ts.map +0 -1
  48. package/src/lib/actions/list-audiences.action.js +0 -27
  49. package/src/lib/actions/list-audiences.action.js.map +0 -1
  50. package/src/lib/actions/list-broadcasts.action.d.ts +0 -2
  51. package/src/lib/actions/list-broadcasts.action.d.ts.map +0 -1
  52. package/src/lib/actions/list-broadcasts.action.js +0 -42
  53. package/src/lib/actions/list-broadcasts.action.js.map +0 -1
  54. package/src/lib/actions/list-contacts.action.d.ts +0 -4
  55. package/src/lib/actions/list-contacts.action.d.ts.map +0 -1
  56. package/src/lib/actions/list-contacts.action.js +0 -30
  57. package/src/lib/actions/list-contacts.action.js.map +0 -1
  58. package/src/lib/actions/list-domains.action.d.ts +0 -2
  59. package/src/lib/actions/list-domains.action.d.ts.map +0 -1
  60. package/src/lib/actions/list-domains.action.js +0 -38
  61. package/src/lib/actions/list-domains.action.js.map +0 -1
  62. package/src/lib/actions/list-emails.action.d.ts +0 -2
  63. package/src/lib/actions/list-emails.action.d.ts.map +0 -1
  64. package/src/lib/actions/list-emails.action.js +0 -41
  65. package/src/lib/actions/list-emails.action.js.map +0 -1
  66. package/src/lib/actions/reschedule-email.action.d.ts +0 -5
  67. package/src/lib/actions/reschedule-email.action.d.ts.map +0 -1
  68. package/src/lib/actions/reschedule-email.action.js +0 -39
  69. package/src/lib/actions/reschedule-email.action.js.map +0 -1
  70. package/src/lib/actions/send-batch-emails.action.d.ts +0 -5
  71. package/src/lib/actions/send-batch-emails.action.d.ts.map +0 -1
  72. package/src/lib/actions/send-batch-emails.action.js +0 -113
  73. package/src/lib/actions/send-batch-emails.action.js.map +0 -1
  74. package/src/lib/actions/send-broadcast.action.d.ts +0 -5
  75. package/src/lib/actions/send-broadcast.action.d.ts.map +0 -1
  76. package/src/lib/actions/send-broadcast.action.js +0 -39
  77. package/src/lib/actions/send-broadcast.action.js.map +0 -1
  78. package/src/lib/actions/send-email.d.ts +0 -12
  79. package/src/lib/actions/send-email.d.ts.map +0 -1
  80. package/src/lib/actions/send-email.js +0 -103
  81. package/src/lib/actions/send-email.js.map +0 -1
  82. package/src/lib/actions/update-contact.action.d.ts +0 -8
  83. package/src/lib/actions/update-contact.action.d.ts.map +0 -1
  84. package/src/lib/actions/update-contact.action.js +0 -54
  85. package/src/lib/actions/update-contact.action.js.map +0 -1
  86. package/src/lib/actions/verify-domain.action.d.ts +0 -4
  87. package/src/lib/actions/verify-domain.action.d.ts.map +0 -1
  88. package/src/lib/actions/verify-domain.action.js +0 -30
  89. package/src/lib/actions/verify-domain.action.js.map +0 -1
  90. package/src/lib/common/props.d.ts +0 -7
  91. package/src/lib/common/props.d.ts.map +0 -1
  92. package/src/lib/common/props.js +0 -93
  93. package/src/lib/common/props.js.map +0 -1
  94. package/src/lib/triggers/email-bounced.trigger.d.ts +0 -11
  95. package/src/lib/triggers/email-bounced.trigger.d.ts.map +0 -1
  96. package/src/lib/triggers/email-bounced.trigger.js +0 -138
  97. package/src/lib/triggers/email-bounced.trigger.js.map +0 -1
package/package.json CHANGED
@@ -1,16 +1,11 @@
1
1
  {
2
2
  "name": "@activepieces/piece-resend",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "main": "./src/index.js",
5
- "types": "./src/index.d.ts",
6
- "scripts": {
7
- "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
8
- "lint": "eslint 'src/**/*.ts'"
9
- },
10
- "dependencies": {
11
- "@activepieces/pieces-common": "0.12.3",
12
- "@activepieces/pieces-framework": "0.30.0",
13
- "@activepieces/shared": "0.86.0",
14
- "tslib": "2.6.2"
15
- }
5
+ "dependencies": {},
6
+ "files": [
7
+ "src/index.js",
8
+ "package.json",
9
+ "src/i18n"
10
+ ]
16
11
  }
package/src/index.js CHANGED
@@ -1,104 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resend = exports.resendAuth = 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 shared_1 = require("@activepieces/shared");
8
- const send_email_1 = require("./lib/actions/send-email");
9
- const send_batch_emails_action_1 = require("./lib/actions/send-batch-emails.action");
10
- const create_contact_action_1 = require("./lib/actions/create-contact.action");
11
- const update_contact_action_1 = require("./lib/actions/update-contact.action");
12
- const delete_contact_action_1 = require("./lib/actions/delete-contact.action");
13
- const list_contacts_action_1 = require("./lib/actions/list-contacts.action");
14
- const get_email_status_action_1 = require("./lib/actions/get-email-status.action");
15
- const list_emails_action_1 = require("./lib/actions/list-emails.action");
16
- const cancel_scheduled_email_action_1 = require("./lib/actions/cancel-scheduled-email.action");
17
- const reschedule_email_action_1 = require("./lib/actions/reschedule-email.action");
18
- const list_domains_action_1 = require("./lib/actions/list-domains.action");
19
- const create_domain_action_1 = require("./lib/actions/create-domain.action");
20
- const delete_domain_action_1 = require("./lib/actions/delete-domain.action");
21
- const verify_domain_action_1 = require("./lib/actions/verify-domain.action");
22
- const list_audiences_action_1 = require("./lib/actions/list-audiences.action");
23
- const create_audience_action_1 = require("./lib/actions/create-audience.action");
24
- const delete_audience_action_1 = require("./lib/actions/delete-audience.action");
25
- const list_broadcasts_action_1 = require("./lib/actions/list-broadcasts.action");
26
- const create_broadcast_action_1 = require("./lib/actions/create-broadcast.action");
27
- const send_broadcast_action_1 = require("./lib/actions/send-broadcast.action");
28
- const delete_broadcast_action_1 = require("./lib/actions/delete-broadcast.action");
29
- const email_bounced_trigger_1 = require("./lib/triggers/email-bounced.trigger");
30
- const BASE_URL = 'https://api.resend.com';
31
- exports.resendAuth = pieces_framework_1.PieceAuth.SecretText({
32
- displayName: 'API Key',
33
- description: `To get your API key:
1
+ "use strict";var Pu=Object.create;var et=Object.defineProperty;var bu=Object.getOwnPropertyDescriptor;var Tu=Object.getOwnPropertyNames;var Eu=Object.getPrototypeOf,Iu=Object.prototype.hasOwnProperty;var o=(e,t)=>et(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},vn=(e,t)=>{for(var r in t)et(e,r,{get:t[r],enumerable:!0})},xn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Tu(t))!Iu.call(e,i)&&i!==r&&et(e,i,{get:()=>t[i],enumerable:!(n=bu(t,i))||n.enumerable});return e};var Ne=(e,t,r)=>(r=e!=null?Pu(Eu(e)):{},xn(t||!e||!e.__esModule?et(r,"default",{value:e,enumerable:!0}):r,e)),Su=e=>xn(et({},"__esModule",{value:!0}),e);var Zo=S((Fo,Ht)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(l.zoneIndex)||[])[0],P,F;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(F=d-g,P=":";F--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let ie=s.split(":"),le=[];for(let Qe=0;Qe<ie.length;Qe++)le.push(parseInt(ie[Qe],16));return le})(),{parts:d,zoneId:v}}o(f,"expandIPv6");function h(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=g-m,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;m-=g,v+=1}return!0}o(h,"matchCIDR");function x(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(x,"parseIntAuto");function I(s,d){for(;s.length<d;)s=`0${s}`;return s}o(I,"padPart");let _={};_.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,F;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(F=m[P],g&&F!==0)return null;F!==8&&(g=!0),d+=F}else return null;return 32-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),_.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(s){return this.parser(s)!==null},_.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(s){return!!(_.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(s)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),P=[];for(let F=0;F<v.length;F++)g=v[F],P.push(x(g));return P})();if(d=s.match(r.longValue)){if(m=x(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),P=[];if(m=x(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),P=[];if(m=x(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(x(v[1])),P.push(m>>8&255),P.push(m&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.IPv6=(function(){function s(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=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,P;for(let F=7;F>=0;F-=1)if(v=this.parts[F],v in m){if(P=m[v],g&&P!==0)return null;P!==16&&(g=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(I(this.parts[v].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new _.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,P;for(;P=d.exec(g);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),_.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(s){return this.parser(s)!==null},_.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch(F){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${F})`)}},_.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(s){let d,g,m,v,P,F;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return f(s,8);if((m=s.match(l.transitional))&&(F=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+F,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<P.length;g++)if(v=P[g],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.fromByteArray=function(s){let d=s.length;if(d===4)return new _.IPv4(s);if(d===16)return new _.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(s){return _.IPv6.isValid(s)||_.IPv4.isValid(s)},_.isValidCIDR=function(s){return _.IPv6.isValidCIDR(s)||_.IPv4.isValidCIDR(s)},_.parse=function(s){if(_.IPv6.isValid(s))return _.IPv6.parse(s);if(_.IPv4.isValid(s))return _.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(s){try{return _.IPv6.parseCIDR(s)}catch{try{return _.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(s,d,g){let m,v,P,F;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(F=P[m],s.kind()===F[0].kind()&&s.match.apply(s,F))return v}return g},typeof Ht<"u"&&Ht.exports?Ht.exports=_:e.ipaddr=_})(Fo)});var Hi=S((HA,Vi)=>{var Zi=require("stream").Stream,up=require("util");Vi.exports=de;function de(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(de,"DelayedStream");up.inherits(de,Zi);de.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(de.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});de.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};de.prototype.resume=function(){this._released||this.release(),this.source.resume()};de.prototype.pause=function(){this.source.pause()};de.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};de.prototype.pipe=function(){var e=Zi.prototype.pipe.apply(this,arguments);return this.resume(),e};de.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)};de.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Ki=S((GA,Wi)=>{var cp=require("util"),Gi=require("stream").Stream,qi=Hi();Wi.exports=Y;function Y(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(Y,"CombinedStream");cp.inherits(Y,Gi);Y.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};Y.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};Y.prototype.append=function(e){var t=Y.isStreamLike(e);if(t){if(!(e instanceof qi)){var r=qi.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};Y.prototype.pipe=function(e,t){return Gi.prototype.pipe.call(this,e,t),this.resume(),e};Y.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}};Y.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=Y.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};Y.prototype._pipeNext=function(e){this._currentStream=e;var t=Y.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()};Y.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};Y.prototype.write=function(e){this.emit("data",e)};Y.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};Y.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")};Y.prototype.end=function(){this._reset(),this.emit("end")};Y.prototype.destroy=function(){this._reset(),this.emit("close")};Y.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};Y.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};Y.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)};Y.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Xi=S((KA,Ji)=>{"use strict";Ji.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var ea=S(oe=>{"use strict";var Jt=Xi(),lp=require("path").extname,Yi=/^\s*([^;\s]*)(?:;|\s|$)/,pp=/^text\//i;oe.charset=Qi;oe.charsets={lookup:Qi};oe.contentType=dp;oe.extension=mp;oe.extensions=Object.create(null);oe.lookup=fp;oe.types=Object.create(null);gp(oe.extensions,oe.types);function Qi(e){if(!e||typeof e!="string")return!1;var t=Yi.exec(e),r=t&&Jt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&pp.test(t[1])?"UTF-8":!1}o(Qi,"charset");function dp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?oe.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=oe.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(dp,"contentType");function mp(e){if(!e||typeof e!="string")return!1;var t=Yi.exec(e),r=t&&oe.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(mp,"extension");function fp(e){if(!e||typeof e!="string")return!1;var t=lp("x."+e).toLowerCase().substr(1);return t&&oe.types[t]||!1}o(fp,"lookup");function gp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Jt).forEach(o(function(i){var u=Jt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var h=r.indexOf(Jt[t[f]].source),x=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(h>x||h===x&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(gp,"populateMaps")});var ra=S((YA,ta)=>{ta.exports=yp;function yp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(yp,"defer")});var qr=S((ez,oa)=>{var na=ra();oa.exports=hp;function hp(e){var t=!1;return na(function(){t=!0}),o(function(n,i){t?e(n,i):na(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(hp,"async")});var Gr=S((rz,ia)=>{ia.exports=vp;function vp(e){Object.keys(e.jobs).forEach(xp.bind(e)),e.jobs={}}o(vp,"abort");function xp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(xp,"clean")});var Wr=S((oz,sa)=>{var aa=qr(),_p=Gr();sa.exports=Pp;function Pp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=bp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?_p(r):r.results[i]=c,n(u,r.results))})}o(Pp,"iterate");function bp(e,t,r,n){var i;return e.length==2?i=e(r,aa(n)):i=e(r,t,aa(n)),i}o(bp,"runJob")});var Kr=S((az,ua)=>{ua.exports=Tp;function Tp(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(Tp,"state")});var Jr=S((uz,ca)=>{var Ep=Gr(),Ip=qr();ca.exports=Sp;function Sp(e){Object.keys(this.jobs).length&&(this.index=this.size,Ep(this),Ip(e)(null,this.results))}o(Sp,"terminator")});var pa=S((lz,la)=>{var $p=Wr(),Ap=Kr(),zp=Jr();la.exports=Op;function Op(e,t,r){for(var n=Ap(e);n.index<(n.keyedList||e).length;)$p(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return zp.bind(n,r)}o(Op,"parallel")});var Xr=S((dz,Xt)=>{var da=Wr(),kp=Kr(),Rp=Jr();Xt.exports=wp;Xt.exports.ascending=ma;Xt.exports.descending=Np;function wp(e,t,r,n){var i=kp(e,r);return da(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){da(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Rp.bind(i,n)}o(wp,"serialOrdered");function ma(e,t){return e<t?-1:e>t?1:0}o(ma,"ascending");function Np(e,t){return-1*ma(e,t)}o(Np,"descending")});var ga=S((fz,fa)=>{var Dp=Xr();fa.exports=Cp;function Cp(e,t,r){return Dp(e,t,null,r)}o(Cp,"serial")});var ha=S((yz,ya)=>{ya.exports={parallel:pa(),serial:ga(),serialOrdered:Xr()}});var Yr=S((hz,va)=>{"use strict";va.exports=Object});var _a=S((vz,xa)=>{"use strict";xa.exports=Error});var ba=S((xz,Pa)=>{"use strict";Pa.exports=EvalError});var Ea=S((_z,Ta)=>{"use strict";Ta.exports=RangeError});var Sa=S((Pz,Ia)=>{"use strict";Ia.exports=ReferenceError});var Aa=S((bz,$a)=>{"use strict";$a.exports=SyntaxError});var Yt=S((Tz,za)=>{"use strict";za.exports=TypeError});var ka=S((Ez,Oa)=>{"use strict";Oa.exports=URIError});var wa=S((Iz,Ra)=>{"use strict";Ra.exports=Math.abs});var Da=S((Sz,Na)=>{"use strict";Na.exports=Math.floor});var Ua=S(($z,Ca)=>{"use strict";Ca.exports=Math.max});var La=S((Az,Ma)=>{"use strict";Ma.exports=Math.min});var Ba=S((zz,ja)=>{"use strict";ja.exports=Math.pow});var Za=S((Oz,Fa)=>{"use strict";Fa.exports=Math.round});var Ha=S((kz,Va)=>{"use strict";Va.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ga=S((wz,qa)=>{"use strict";var Up=Ha();qa.exports=o(function(t){return Up(t)||t===0?t:t<0?-1:1},"sign")});var Ka=S((Dz,Wa)=>{"use strict";Wa.exports=Object.getOwnPropertyDescriptor});var Qr=S((Cz,Ja)=>{"use strict";var Qt=Ka();if(Qt)try{Qt([],"length")}catch{Qt=null}Ja.exports=Qt});var Ya=S((Uz,Xa)=>{"use strict";var er=Object.defineProperty||!1;if(er)try{er({},"a",{value:1})}catch{er=!1}Xa.exports=er});var en=S((Mz,Qa)=>{"use strict";Qa.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var rs=S((jz,ts)=>{"use strict";var es=typeof Symbol<"u"&&Symbol,Mp=en();ts.exports=o(function(){return typeof es!="function"||typeof Symbol!="function"||typeof es("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Mp()},"hasNativeSymbols")});var tn=S((Fz,ns)=>{"use strict";ns.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var rn=S((Zz,os)=>{"use strict";var Lp=Yr();os.exports=Lp.getPrototypeOf||null});var ss=S((Vz,as)=>{"use strict";var jp="Function.prototype.bind called on incompatible ",Bp=Object.prototype.toString,Fp=Math.max,Zp="[object Function]",is=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Vp=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),Hp=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");as.exports=o(function(t){var r=this;if(typeof r!="function"||Bp.apply(r)!==Zp)throw new TypeError(jp+r);for(var n=Vp(arguments,1),i,u=o(function(){if(this instanceof i){var x=r.apply(this,is(n,arguments));return Object(x)===x?x:this}return r.apply(t,is(n,arguments))},"binder"),c=Fp(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+Hp(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var We=S((qz,us)=>{"use strict";var qp=ss();us.exports=Function.prototype.bind||qp});var tr=S((Gz,cs)=>{"use strict";cs.exports=Function.prototype.call});var nn=S((Wz,ls)=>{"use strict";ls.exports=Function.prototype.apply});var ds=S((Kz,ps)=>{"use strict";ps.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var fs=S((Jz,ms)=>{"use strict";var Gp=We(),Wp=nn(),Kp=tr(),Jp=ds();ms.exports=Jp||Gp.call(Kp,Wp)});var ys=S((Xz,gs)=>{"use strict";var Xp=We(),Yp=Yt(),Qp=tr(),ed=fs();gs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Yp("a function is required");return ed(Xp,Qp,t)},"callBindBasic")});var bs=S((Qz,Ps)=>{"use strict";var td=ys(),hs=Qr(),xs;try{xs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var on=!!xs&&hs&&hs(Object.prototype,"__proto__"),_s=Object,vs=_s.getPrototypeOf;Ps.exports=on&&typeof on.get=="function"?td([on.get]):typeof vs=="function"?o(function(t){return vs(t==null?t:_s(t))},"getDunder"):!1});var $s=S((tO,Ss)=>{"use strict";var Ts=tn(),Es=rn(),Is=bs();Ss.exports=Ts?o(function(t){return Ts(t)},"getProto"):Es?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Es(t)},"getProto"):Is?o(function(t){return Is(t)},"getProto"):null});var an=S((nO,As)=>{"use strict";var rd=Function.prototype.call,nd=Object.prototype.hasOwnProperty,od=We();As.exports=od.call(rd,nd)});var Ds=S((oO,Ns)=>{"use strict";var B,id=Yr(),ad=_a(),sd=ba(),ud=Ea(),cd=Sa(),Ye=Aa(),Xe=Yt(),ld=ka(),pd=wa(),dd=Da(),md=Ua(),fd=La(),gd=Ba(),yd=Za(),hd=Ga(),Rs=Function,sn=o(function(e){try{return Rs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Pt=Qr(),vd=Ya(),un=o(function(){throw new Xe},"throwTypeError"),xd=Pt?(function(){try{return arguments.callee,un}catch{try{return Pt(arguments,"callee").get}catch{return un}}})():un,Ke=rs()(),re=$s(),_d=rn(),Pd=tn(),ws=nn(),bt=tr(),Je={},bd=typeof Uint8Array>"u"||!re?B:re(Uint8Array),Le={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?B:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?B:ArrayBuffer,"%ArrayIteratorPrototype%":Ke&&re?re([][Symbol.iterator]()):B,"%AsyncFromSyncIteratorPrototype%":B,"%AsyncFunction%":Je,"%AsyncGenerator%":Je,"%AsyncGeneratorFunction%":Je,"%AsyncIteratorPrototype%":Je,"%Atomics%":typeof Atomics>"u"?B:Atomics,"%BigInt%":typeof BigInt>"u"?B:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?B:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?B:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?B:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ad,"%eval%":eval,"%EvalError%":sd,"%Float16Array%":typeof Float16Array>"u"?B:Float16Array,"%Float32Array%":typeof Float32Array>"u"?B:Float32Array,"%Float64Array%":typeof Float64Array>"u"?B:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?B:FinalizationRegistry,"%Function%":Rs,"%GeneratorFunction%":Je,"%Int8Array%":typeof Int8Array>"u"?B:Int8Array,"%Int16Array%":typeof Int16Array>"u"?B:Int16Array,"%Int32Array%":typeof Int32Array>"u"?B:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ke&&re?re(re([][Symbol.iterator]())):B,"%JSON%":typeof JSON=="object"?JSON:B,"%Map%":typeof Map>"u"?B:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ke||!re?B:re(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":id,"%Object.getOwnPropertyDescriptor%":Pt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?B:Promise,"%Proxy%":typeof Proxy>"u"?B:Proxy,"%RangeError%":ud,"%ReferenceError%":cd,"%Reflect%":typeof Reflect>"u"?B:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?B:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ke||!re?B:re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?B:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ke&&re?re(""[Symbol.iterator]()):B,"%Symbol%":Ke?Symbol:B,"%SyntaxError%":Ye,"%ThrowTypeError%":xd,"%TypedArray%":bd,"%TypeError%":Xe,"%Uint8Array%":typeof Uint8Array>"u"?B:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?B:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?B:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?B:Uint32Array,"%URIError%":ld,"%WeakMap%":typeof WeakMap>"u"?B:WeakMap,"%WeakRef%":typeof WeakRef>"u"?B:WeakRef,"%WeakSet%":typeof WeakSet>"u"?B:WeakSet,"%Function.prototype.call%":bt,"%Function.prototype.apply%":ws,"%Object.defineProperty%":vd,"%Object.getPrototypeOf%":_d,"%Math.abs%":pd,"%Math.floor%":dd,"%Math.max%":md,"%Math.min%":fd,"%Math.pow%":gd,"%Math.round%":yd,"%Math.sign%":hd,"%Reflect.getPrototypeOf%":Pd};if(re)try{null.error}catch(e){zs=re(re(e)),Le["%Error.prototype%"]=zs}var zs,Td=o(function e(t){var r;if(t==="%AsyncFunction%")r=sn("async function () {}");else if(t==="%GeneratorFunction%")r=sn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=sn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&re&&(r=re(i.prototype))}return Le[t]=r,r},"doEval"),Os={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Tt=We(),rr=an(),Ed=Tt.call(bt,Array.prototype.concat),Id=Tt.call(ws,Array.prototype.splice),ks=Tt.call(bt,String.prototype.replace),nr=Tt.call(bt,String.prototype.slice),Sd=Tt.call(bt,RegExp.prototype.exec),$d=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ad=/\\(\\)?/g,zd=o(function(t){var r=nr(t,0,1),n=nr(t,-1);if(r==="%"&&n!=="%")throw new Ye("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ye("invalid intrinsic syntax, expected opening `%`");var i=[];return ks(t,$d,function(u,c,l,f){i[i.length]=l?ks(f,Ad,"$1"):c||u}),i},"stringToPath"),Od=o(function(t,r){var n=t,i;if(rr(Os,n)&&(i=Os[n],n="%"+i[0]+"%"),rr(Le,n)){var u=Le[n];if(u===Je&&(u=Td(n)),typeof u>"u"&&!r)throw new Xe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ye("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ns.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Xe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Xe('"allowMissing" argument must be a boolean');if(Sd(/^%?[^%]*%?$/,t)===null)throw new Ye("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=zd(t),i=n.length>0?n[0]:"",u=Od("%"+i+"%",r),c=u.name,l=u.value,f=!1,h=u.alias;h&&(i=h[0],Id(n,Ed([0,1],h)));for(var x=1,I=!0;x<n.length;x+=1){var _=n[x],s=nr(_,0,1),d=nr(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ye("property names with quotes must have matching quotes");if((_==="constructor"||!I)&&(f=!0),i+="."+_,c="%"+i+"%",rr(Le,c))l=Le[c];else if(l!=null){if(!(_ in l)){if(!r)throw new Xe("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pt&&x+1>=n.length){var g=Pt(l,_);I=!!g,I&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[_]}else I=rr(l,_),l=l[_];I&&!f&&(Le[c]=l)}}return l},"GetIntrinsic")});var Us=S((aO,Cs)=>{"use strict";var kd=en();Cs.exports=o(function(){return kd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var js=S((uO,Ls)=>{"use strict";var Rd=Ds(),Ms=Rd("%Object.defineProperty%",!0),wd=Us()(),Nd=an(),Dd=Yt(),or=wd?Symbol.toStringTag:null;Ls.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new Dd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");or&&(n||!Nd(t,or))&&(Ms?Ms(t,or,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[or]=r)},"setToStringTag")});var Fs=S((lO,Bs)=>{"use strict";var Cd=Function.prototype.call,Ud=Object.prototype.hasOwnProperty,Md=We();Bs.exports=Md.call(Cd,Ud)});var Vs=S((pO,Zs)=>{"use strict";Zs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Gs=S((dO,qs)=>{"use strict";var dn=Ki(),Ld=require("util"),cn=require("path"),jd=require("http"),Bd=require("https"),Fd=require("url").parse,Zd=require("fs"),Vd=require("stream").Stream,Hd=require("crypto"),ln=ea(),qd=ha(),Gd=js(),we=Fs(),pn=Vs();function Hs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Hs,"escapeHeaderParam");function Z(e){if(!(this instanceof Z))return new Z(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],dn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(Z,"FormData");Ld.inherits(Z,dn);Z.LINE_BREAK=`\r
2
+ `;Z.DEFAULT_CONTENT_TYPE="application/octet-stream";Z.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=dn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};Z.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)+Z.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&we(t,"httpVersion"))&&!(t instanceof Vd))&&(r.knownLength||this._valuesToMeasure.push(t))};Z.prototype._lengthRetriever=function(e,t){we(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Zd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):we(e,"httpVersion")?t(null,Number(e.headers["content-length"])):we(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};Z.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Hs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&pn(c,r.header);var l;for(var f in c)if(we(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=f+": "+l.join("; ")+Z.LINE_BREAK)}return"--"+this.getBoundary()+Z.LINE_BREAK+u+Z.LINE_BREAK};Z.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=cn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=cn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=cn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Hs(r)+'"'};Z.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=ln.lookup(e.name)),!r&&e&&e.path&&(r=ln.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=ln.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=Z.DEFAULT_CONTENT_TYPE),r};Z.prototype._multiPartFooter=function(){return function(e){var t=Z.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};Z.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Z.LINE_BREAK};Z.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)we(e,t)&&(r[t.toLowerCase()]=e[t]);return r};Z.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};Z.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Z.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(Z.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};Z.prototype._generateBoundary=function(){this._boundary="--------------------------"+Hd.randomBytes(12).toString("hex")};Z.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};Z.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};Z.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}qd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};Z.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Fd(e),n=pn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=pn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Bd.request(n):r=jd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=o(function(h,x){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,h,x)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};Z.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};Z.prototype.toString=function(){return"[object FormData]"};Gd(Z.prototype,"FormData");qs.exports=Z});var lm={};vn(lm,{resend:()=>cm,resendAuth:()=>A});module.exports=Su(lm);var $u=Object.freeze({status:"aborted"});function T(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let h=c.prototype,x=Object.keys(h);for(let I=0;I<x.length;I++){let _=x[I];_ in l||(l[_]=h[_].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var f;let h=r?.Parent?new u:this;n(h,l),(f=h._zod).deferred??(f.deferred=[]);for(let x of h._zod.deferred)x();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var me=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},It=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},sr={};function he(e){return e&&Object.assign(sr,e),sr}o(he,"config");function cr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(cr,"getEnumValues");function Pn(e,t){return typeof t=="bigint"?t.toString():t}o(Pn,"jsonStringifyReplacer");function $t(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o($t,"cached");function bn(e){return e==null}o(bn,"nullish");function At(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(At,"cleanRegex");var _n=Symbol("evaluating");function ee(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==_n)return n===void 0&&(n=_n,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(ee,"defineLazy");var lr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(tt,"isObject");var Au=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Tn(e){if(tt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(tt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Tn,"isPlainObject");var En=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(je,"escapeRegex");function zt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(zt,"clone");function G(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(G,"normalizeParams");function In(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(In,"optionalKeys");var Sn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Be(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Be,"aborted");function Ee(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Ee,"prefixIssues");function St(e){return typeof e=="string"?e:e?.message}o(St,"unwrapMessage");function Ie(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=St(e.inst?._zod.def?.error?.(e))??St(t?.error?.(e))??St(r.customError?.(e))??St(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Ie,"finalizeIssue");function $n(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o($n,"getLengthableOrigin");function pr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(pr,"issue");var An=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Pn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),zn=T("$ZodError",An),rt=T("$ZodError",An,{Parent:Error});var Ou=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new me;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Ie(f,u,he())));throw lr(l,i?.callee),l}return c.value},"_parse"),Ot=Ou(rt),ku=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Ie(f,u,he())));throw lr(l,i?.callee),l}return c.value},"_parseAsync"),kt=ku(rt),Ru=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new me;return u.issues.length?{success:!1,error:new(e??zn)(u.issues.map(c=>Ie(c,i,he())))}:{success:!0,data:u.value}},"_safeParse"),nt=Ru(rt),wu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Ie(c,i,he())))}:{success:!0,data:u.value}},"_safeParseAsync"),ot=wu(rt);var Nu="(?:(?:\\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])))",Du=new RegExp(`^${Nu}$`);var On=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),kn=/^-?\d+n?$/,Rn=/^-?\d+$/,dr=/^-?\d+(?:\.\d+)?$/,wn=/^(?:true|false)$/i;var Se=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Cu={number:"number",bigint:"bigint",object:"date"};var Nn=T("$ZodCheckGreaterThan",(e,t)=>{Se.init(e,t);let r=Cu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Dn=T("$ZodCheckNumberFormat",(e,t)=>{Se.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Sn[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=i,l.maximum=u,r&&(l.pattern=Rn)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<i&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>u&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Cn=T("$ZodCheckMinLength",(e,t)=>{var r;Se.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!bn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=$n(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var mr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Se.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Un=T("$ZodCheckRegex",(e,t)=>{mr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Ln={major:4,minor:3,patch:6};var J=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ln;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,f)=>{let h=Be(c),x;for(let I of l){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(h)continue;let _=c.issues.length,s=I._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new me;if(x||s instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await s,c.issues.length!==_&&(h||(h=Be(c,_)))});else{if(c.issues.length===_)continue;h||(h=Be(c,_))}}return x?x.then(()=>c):c},"runChecks"),u=o((c,l,f)=>{if(Be(c))return c.aborted=!0,c;let h=i(l,n,f);if(h instanceof Promise){if(f.async===!1)throw new me;return h.then(x=>e._zod.parse(x,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(x=>u(x,c,l)):u(h,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new me;return f.then(h=>i(h,n,l))}return i(f,n,l)}}ee(e,"~standard",()=>({validate:o(i=>{try{let u=nt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return ot(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nt=T("$ZodString",(e,t)=>{J.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??On(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),fr=T("$ZodStringFormat",(e,t)=>{mr.init(e,t),Nt.init(e,t)});var Vn=T("$ZodURL",(e,t)=>{fr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var gr=T("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=e._zod.bag.pattern??dr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),Hn=T("$ZodNumberFormat",(e,t)=>{Dn.init(e,t),gr.init(e,t)}),yr=T("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=wn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),qn=T("$ZodBigInt",(e,t)=>{J.init(e,t),e._zod.pattern=kn,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 Gn=T("$ZodAny",(e,t)=>{J.init(e,t),e._zod.parse=r=>r}),Wn=T("$ZodUnknown",(e,t)=>{J.init(e,t),e._zod.parse=r=>r});var Kn=T("$ZodVoid",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Jn=T("$ZodDate",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function jn(e,t,r){e.issues.length&&t.issues.push(...Ee(r,e.issues)),t.value[r]=e.value}o(jn,"handleArrayResult");var Xn=T("$ZodArray",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(h=>jn(h,r,c))):jn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function wt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ee(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(wt,"handlePropertyResult");function Uu(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=In(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Uu,"normalizeDef");function Mu(e,t,r,n,i,u){let c=[],l=i.keySet,f=i.catchall._zod,h=f.def.type,x=f.optout==="optional";for(let I in t){if(l.has(I))continue;if(h==="never"){c.push(I);continue}let _=f.run({value:t[I],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>wt(s,r,I,t,x))):wt(_,r,I,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Mu,"handleCatchall");var Yn=T("$ZodObject",(e,t)=>{if(J.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=$t(()=>Uu(t));ee(e._zod,"propValues",()=>{let l=t.shape,f={};for(let h in l){let x=l[h]._zod;if(x.values){f[h]??(f[h]=new Set);for(let I of x.values)f[h].add(I)}}return f});let i=tt,u=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let h=l.value;if(!i(h))return l.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),l;l.value={};let x=[],I=c.shape;for(let _ of c.keys){let s=I[_],d=s._zod.optout==="optional",g=s._zod.run({value:h[_],issues:[]},f);g instanceof Promise?x.push(g.then(m=>wt(m,l,_,h,d))):wt(g,l,_,h,d)}return u?Mu(x,h,l,f,n.value,e):x.length?Promise.all(x).then(()=>l):l}});function Bn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Be(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Ie(c,n,he())))}),t)}o(Bn,"handleUnionResults");var hr=T("$ZodUnion",(e,t)=>{J.init(e,t),ee(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ee(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ee(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ee(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>At(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let f of t.options){let h=f._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)l.push(h),c=!0;else{if(h.issues.length===0)return h;l.push(h)}}return c?Promise.all(l).then(f=>Bn(f,i,e,u)):Bn(l,i,e,u)}});var Qn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,hr.init(e,t);let r=e._zod.parse;ee(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let h of f)i[l].add(h)}}return i});let n=$t(()=>{let i=t.options,u=new Map;for(let c of i){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of l){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!tt(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var eo=T("$ZodRecord",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Tn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){l.add(typeof h=="number"?h.toString():h);let x=t.valueType._zod.run({value:i[h],issues:[]},n);x instanceof Promise?u.push(x.then(I=>{I.issues.length&&r.issues.push(...Ee(h,I.issues)),r.value[h]=I.value})):(x.issues.length&&r.issues.push(...Ee(h,x.issues)),r.value[h]=x.value)}let f;for(let h in i)l.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&dr.test(l)&&f.issues.length){let I=t.keyType._zod.run({value:Number(l),issues:[]},n);if(I instanceof Promise)throw new Error("Async schemas not supported in object keys currently");I.issues.length===0&&(f=I)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(I=>Ie(I,n,he())),input:l,path:[l],inst:e});continue}let x=t.valueType._zod.run({value:i[l],issues:[]},n);x instanceof Promise?u.push(x.then(I=>{I.issues.length&&r.issues.push(...Ee(l,I.issues)),r.value[f.value]=I.value})):(x.issues.length&&r.issues.push(...Ee(l,x.issues)),r.value[f.value]=x.value)}}return u.length?Promise.all(u).then(()=>r):r}});var to=T("$ZodEnum",(e,t)=>{J.init(e,t);let r=cr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>En.has(typeof i)).map(i=>typeof i=="string"?je(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),ro=T("$ZodLiteral",(e,t)=>{if(J.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?je(n):n?je(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var no=T("$ZodTransform",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new It(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new me;return r.value=i,r}});function Fn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Fn,"handleOptionalResult");var oo=T("$ZodOptional",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${At(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Fn(u,r.value)):Fn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var io=T("$ZodNullable",(e,t)=>{J.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${At(r.source)}|null)$`):void 0}),ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var ao=T("$ZodPipe",(e,t)=>{J.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Rt(c,t.in,n)):Rt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Rt(u,t.out,n)):Rt(i,t.out,n)}});function Rt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Rt,"handlePipeResult");var so=T("$ZodCustom",(e,t)=>{Se.init(e,t),J.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Zn(u,r,n,e));Zn(i,r,n,e)}});function Zn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(pr(i))}}o(Zn,"handleRefineResult");var co;var vr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function lo(){return new vr}o(lo,"registry");(co=globalThis).__zod_globalRegistry??(co.__zod_globalRegistry=lo());var xr=globalThis.__zod_globalRegistry;function po(e,t){return new e({type:"string",...G(t)})}o(po,"_string");function mo(e,t){return new e({type:"string",coerce:!0,...G(t)})}o(mo,"_coercedString");function fo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...G(t)})}o(fo,"_url");function go(e,t){return new e({type:"number",checks:[],...G(t)})}o(go,"_number");function yo(e,t){return new e({type:"number",coerce:!0,checks:[],...G(t)})}o(yo,"_coercedNumber");function ho(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...G(t)})}o(ho,"_int");function vo(e,t){return new e({type:"boolean",...G(t)})}o(vo,"_boolean");function xo(e,t){return new e({type:"boolean",coerce:!0,...G(t)})}o(xo,"_coercedBoolean");function _o(e,t){return new e({type:"bigint",coerce:!0,...G(t)})}o(_o,"_coercedBigint");function Po(e){return new e({type:"any"})}o(Po,"_any");function bo(e){return new e({type:"unknown"})}o(bo,"_unknown");function To(e,t){return new e({type:"void",...G(t)})}o(To,"_void");function Eo(e,t){return new e({type:"date",coerce:!0,...G(t)})}o(Eo,"_coercedDate");function Dt(e,t){return new Nn({check:"greater_than",...G(t),value:e,inclusive:!0})}o(Dt,"_gte");function pe(e,t){return new Cn({check:"min_length",...G(t),minimum:e})}o(pe,"_minLength");function $e(e,t){return new Un({check:"string_format",format:"regex",...G(t),pattern:e})}o($e,"_regex");function Io(e,t,r){let n=G(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Io,"_custom");var te=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");J.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Ot(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>nt(e,r,n),e.parseAsync=async(r,n)=>kt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ot(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>zt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Ut=T("ZodMiniString",(e,t)=>{Nt.init(e,t),te.init(e,t)});function a(e){return po(Ut,e)}o(a,"string");var So=T("ZodMiniStringFormat",(e,t)=>{fr.init(e,t),Ut.init(e,t)});var Xu=T("ZodMiniURL",(e,t)=>{Vn.init(e,t),So.init(e,t)});function $o(e){return fo(Xu,e)}o($o,"url");var Mt=T("ZodMiniNumber",(e,t)=>{gr.init(e,t),te.init(e,t)});function ne(e){return go(Mt,e)}o(ne,"number");var Yu=T("ZodMiniNumberFormat",(e,t)=>{Hn.init(e,t),Mt.init(e,t)});function Ao(e){return ho(Yu,e)}o(Ao,"int");var _r=T("ZodMiniBoolean",(e,t)=>{yr.init(e,t),te.init(e,t)});function H(e){return vo(_r,e)}o(H,"boolean");var zo=T("ZodMiniBigInt",(e,t)=>{qn.init(e,t),te.init(e,t)});var Qu=T("ZodMiniAny",(e,t)=>{Gn.init(e,t),te.init(e,t)});function at(){return Po(Qu)}o(at,"any");var ec=T("ZodMiniUnknown",(e,t)=>{Wn.init(e,t),te.init(e,t)});function w(){return bo(ec)}o(w,"unknown");var tc=T("ZodMiniVoid",(e,t)=>{Kn.init(e,t),te.init(e,t)});function Oo(e){return To(tc,e)}o(Oo,"_void");var ko=T("ZodMiniDate",(e,t)=>{Jn.init(e,t),te.init(e,t)});var rc=T("ZodMiniArray",(e,t)=>{Xn.init(e,t),te.init(e,t)});function U(e,t){return new rc({type:"array",element:e,...G(t)})}o(U,"array");var nc=T("ZodMiniObject",(e,t)=>{Yn.init(e,t),te.init(e,t),ee(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...G(t)};return new nc(r)}o(p,"object");var oc=T("ZodMiniUnion",(e,t)=>{hr.init(e,t),te.init(e,t)});function M(e,t){return new oc({type:"union",options:e,...G(t)})}o(M,"union");var ic=T("ZodMiniDiscriminatedUnion",(e,t)=>{Qn.init(e,t),te.init(e,t)});function Ae(e,t,r){return new ic({type:"union",options:t,discriminator:e,...G(r)})}o(Ae,"discriminatedUnion");var ac=T("ZodMiniRecord",(e,t)=>{eo.init(e,t),te.init(e,t)});function N(e,t,r){return new ac({type:"record",keyType:e,valueType:t,...G(r)})}o(N,"record");var sc=T("ZodMiniEnum",(e,t)=>{to.init(e,t),te.init(e,t),e.options=Object.values(t.entries)});function j(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new sc({type:"enum",entries:r,...G(t)})}o(j,"_enum");var uc=T("ZodMiniLiteral",(e,t)=>{ro.init(e,t),te.init(e,t)});function z(e,t){return new uc({type:"literal",values:Array.isArray(e)?e:[e],...G(t)})}o(z,"literal");var cc=T("ZodMiniTransform",(e,t)=>{no.init(e,t),te.init(e,t)});function ze(e){return new cc({type:"transform",transform:e})}o(ze,"transform");var lc=T("ZodMiniOptional",(e,t)=>{oo.init(e,t),te.init(e,t)});function y(e){return new lc({type:"optional",innerType:e})}o(y,"optional");var pc=T("ZodMiniNullable",(e,t)=>{io.init(e,t),te.init(e,t)});function st(e){return new pc({type:"nullable",innerType:e})}o(st,"nullable");var dc=T("ZodMiniPipe",(e,t)=>{ao.init(e,t),te.init(e,t)});function Oe(e,t){return new dc({type:"pipe",in:e,out:t})}o(Oe,"pipe");var mc=T("ZodMiniCustom",(e,t)=>{so.init(e,t),te.init(e,t)});function Lt(e,t){return Io(mc,e??(()=>!0),t)}o(Lt,"custom");var ut={};vn(ut,{bigint:()=>xc,boolean:()=>vc,date:()=>_c,number:()=>hc,string:()=>yc});function yc(e){return mo(Ut,e)}o(yc,"string");function hc(e){return yo(Mt,e)}o(hc,"number");function vc(e){return xo(_r,e)}o(vc,"boolean");function xc(e){return _o(zo,e)}o(xc,"bigint");function _c(e){return Eo(ko,e)}o(_c,"date");var br=p({retryOnFailure:p({defaultValue:y(H()),hide:y(H())}),continueOnFailure:p({defaultValue:y(H()),hide:y(H())})}),Pr=class{constructor(t,r,n,i,u,c,l,f,h,x,I){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=x;this.aiMetadata=I}static{o(this,"IAction")}},C=o(e=>new Pr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var V=p({displayName:a(),description:y(a())}),L=o((e,t)=>p({type:z(t),required:H(),defaultValue:y(at())}),"TPropertyValue");var ae=p({...V.shape,...L(a(),"SHORT_TEXT").shape}),ve=p({...V.shape,...L(a(),"LONG_TEXT").shape});var wo=p({label:a(),value:w()}),jt=p({disabled:y(H()),placeholder:y(a()),options:U(wo)});var se=p({...V.shape,options:jt,...L(w(),"STATIC_DROPDOWN").shape}),xe=p({...V.shape,options:jt,...L(U(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Tr=p({...V.shape,...L(w(),"DROPDOWN").shape,refreshers:U(a())}),ct=p({...V.shape,...L(U(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:U(a())});var _e=p({...V.shape,...L(H(),"CHECKBOX").shape});var Pe=p({...V.shape,...L(ne(),"NUMBER").shape});var lt=p({...V.shape,streaming:y(H()),...L(w(),"FILE").shape});var pt=p({...V.shape,...L(a(),"DATE_TIME").shape});var No=N(a(),M([ae,ve,se,ct,xe,_e,Pe,lt,pt])),dt=p({...V.shape,properties:No,...L(U(w()),"ARRAY").shape});var mt=p({...V.shape,...L(M([N(a(),w())]),"JSON").shape});var Do=M([ae,se,mt,dt,xe]),bc=N(a(),Do),Er=p({refreshers:U(a()),...V.shape,...L(w(),"DYNAMIC").shape});var Bt=p({...V.shape,...L(Oo(),"MARKDOWN").shape});var ft=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ft||{}),Fe=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Fe||{}),Ze=(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))(Ze||{});var gt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(gt||{}),Ir="both_client_credentials_and_authorization_code";var ke=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ke||{}),yt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(yt||{}),Tc=p({strategy:j(yt),paramName:y(a())}),ht=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ht||{});var Ft=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ft||{}),Co=p({status:y(ne()),body:y(w()),headers:y(N(a(),a()))}),Uo=p({type:z("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(j(Ft))}),Mo=p({type:z("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:Co,handlerId:y(a()),streamStepProgress:y(j(Ft))}),Ec=M([Uo,Mo]);var Ic=p({body:w(),rawBody:y(w()),headers:N(a(),a()),queryParams:N(a(),a())});function ue(e){return e==null}o(ue,"isNil");function vt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(vt,"isEmpty");function Zt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Zt,"assertNotNullOrUndefined");var Sr=Ne(require("crypto"),1);var Sc=128,De,Ve,$c=o(e=>{!De||De.length<e?(De=Buffer.allocUnsafe(e*Sc),Sr.default.randomFillSync(De),Ve=0):Ve+e>De.length&&(Sr.default.randomFillSync(De),Ve=0),Ve+=e},"fillPool"),Ac=o(e=>($c(e|=0),De.subarray(Ve-e,Ve)),"random"),zc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===u)return c}}},"customRandom"),jo=o((e,t=21)=>zc(e,t,Ac),"customAlphabet");var Oc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Bo=21,Hb=a().check($e(new RegExp(`^[0-9a-zA-Z]{${Bo}}$`))),kc=jo(Oc,Bo);var Re=Oe(ze(e=>e instanceof Date?e.toISOString():e),a()),ce={id:a(),created:Re,updated:Re},W=o(e=>y(st(e)),"Nullable");function $r(e){return y(st(j(e)))}o($r,"NullableEnum");var Wb=Oe(ze(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(H())),Vt=o(e=>Oe(ze(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(U(e))),"OptionalArrayFromQuery");var Xb=N(a(),w());var xt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(xt||{});var cT=a().check($e(/^#[0-9A-Fa-f]{6}$/));var pT=p({filename:a(),data:w(),type:z("file"),mimetype:y(a())});var Rc=Ne(Zo());var vT=p({...ce,name:a(),permissions:U(a()),platformId:W(a()),type:a(),userCount:y(ne())});var Vo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Vo||{}),Ar=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ar||{}),zr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(zr||{});var Or=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Or||{});var kr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(kr||{});var wc=p({mode:j(Vo),value:w()}),Nc=p({auth:y(a()),fields:N(a(),wc)}),Dc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(Nc)}),Cc=p({type:z("PIECE"),toolName:a().check(pe(1)),pieceMetadata:Dc}),Uc=p({type:z("none")}),Mc=p({type:z("access_token"),accessToken:a()}),Lc=p({type:z("api_key"),apiKey:a(),apiKeyHeader:a()}),jc=p({type:z("headers"),headers:N(a(),a())}),Bc=Ae("type",[Uc,Mc,Lc,jc]),Ho=p({type:z("FLOW"),toolName:a().check(pe(1)),externalFlowId:a(),flowDisplayName:y(a())}),qo=p({type:z("MCP"),toolName:a().check(pe(1)),serverUrl:$o(),protocol:j(zr),auth:Bc}),Go=p({type:z("KNOWLEDGE_BASE"),toolName:a().check(pe(1)),sourceType:j(Ar),sourceId:a(),sourceName:a()}),Fc=Ae("type",[Cc,Ho,qo,Go]),Zc=p({displayName:a(),description:y(a()),type:j(Or)}),Wo=p({type:z("MARKDOWN"),markdown:a()}),He={type:z("TOOL_CALL"),input:W(N(a(),w())),output:y(w()),toolName:a(),status:j(kr),toolCallId:a(),startTime:a(),endTime:y(a())},KT=p(He),Ko=Ae("toolCallType",[p({...He,toolCallType:z("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...He,toolCallType:z("FLOW"),displayName:a(),externalFlowId:a()}),p({...He,toolCallType:z("MCP"),displayName:a(),serverUrl:a()}),p({...He,toolCallType:z("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...He,toolCallType:z("UNKNOWN"),displayName:a()})]),Vc=M([Wo,Ko]);var Rr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Rr||{}),be=p({apiKey:a()}),Hc=be,qc=p({apiKey:a(),apiKeyHash:a()}),Gc=be,Wc=be,Kc=be,Jc=be,Xc=be,Yc=be,Qc=be,ei=p({accessKeyId:a().check(pe(1)),secretAccessKey:a().check(pe(1))}),el=p({}),tl=p({}),rl=p({}),nl=p({}),ol=p({}),il=p({}),ti=p({modelId:a(),modelName:a(),modelType:j(Rr)}),ri=p({apiKeyHeader:a(),baseUrl:a(),models:U(ti),defaultHeaders:y(N(a(),a()))}),ni=p({accountId:a(),gatewayId:a(),models:U(ti),vertexProject:y(a()),vertexRegion:y(a())}),oi=p({resourceName:a(),apiVersion:Oe(ze(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),ii=p({region:a().check(pe(1))}),al=M([Hc,Kc,Jc,Xc,Yc,Wc,Gc,qc,ei,Qc]),ai=M([ri,ni,oi,ii,el,rl,nl,ol,tl,il]),sl=p({id:a(),name:a(),type:j(Rr)}),ul=p({id:a(),name:a(),provider:j(xt),config:ai,enabledForChat:H()}),cl=p({provider:j(xt),config:ai,auth:al,platformId:a()});var QT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Jo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],ll=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],pl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Xo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],dl=["grok-4.20","grok-4.1-fast"],ml={openai:Jo,anthropic:ll,google:Xo,activepieces:[...pl.map(e=>`anthropic/${e}`),...Jo.map(e=>`openai/${e}`),...Xo.map(e=>`google/${e}`),...dl.map(e=>`x-ai/${e}`)]};var Yo=128e3,fl={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function gl({provider:e}){return e?fl[e]??Yo:Yo}o(gl,"getMaxContextTokens");var Qo={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},yl={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},hl=new Set(["anthropic","mistral"]);function fe(e){return{chatModels:ml[e],maxContextTokens:gl({provider:e}),defaultEmbeddingModel:Qo[e],supportsEmbedding:Qo[e]!==void 0,supportsImageGeneration:!hl.has(e),webSearch:yl[e]}}o(fe,"buildProviderCapabilities");var vl={openai:fe("openai"),anthropic:fe("anthropic"),openrouter:fe("openrouter"),azure:fe("azure"),google:fe("google"),"cloudflare-gateway":fe("cloudflare-gateway"),custom:fe("custom"),bedrock:fe("bedrock"),mistral:fe("mistral"),activepieces:fe("activepieces")};var xl=p({base64Url:a(),fileName:a(),extension:y(a())}),_l=p({mimeType:a(),url:a(),fileName:y(a())}),wr=M([xl,_l]);var Pl=M([p({type:z("file"),value:wr}),p({type:z("markdown"),value:a(),files:y(U(wr))})]),bl=p({sessionId:a(),message:a(),files:y(U(a()))});var ui=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ui||{}),ci=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ci||{}),Nr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Nr||{});var Tl=M([p({...ce,name:a(),externalId:a(),type:z("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:U(p({value:a()}))})}),p({...ce,name:a(),externalId:a(),type:M([z("TEXT"),z("NUMBER"),z("DATE")]),tableId:a(),projectId:a()})]),El=p({...ce,name:a(),folderId:W(a()),projectId:a(),externalId:a(),status:$r(ci),trigger:$r(ui)}),Il=p({...ce,tableId:a(),projectId:a(),cells:N(a(),p({updated:a(),created:a(),value:w(),fieldName:a()}))}),Sl=p({events:U(j(Nr)),webhookUrl:a(),flowId:a()}),$l=p({fields:U(p({id:a(),name:a()})),rows:U(N(a(),a())),name:a()}),Al=p({projectId:a(),limit:y(ut.number()),cursor:y(a()),name:y(a()),externalIds:Vt(a()),folderId:y(a()),folderIds:Vt(a())}),zl=p({records:U(U(p({fieldId:a(),value:pi()}))),tableId:a()}),Ol=p({cells:y(U(p({fieldId:a(),value:pi()}))),tableId:a(),agentUpdate:y(H())}),li=Ae("operator",[Ce("eq"),Ce("neq"),Ce("gt"),Ce("gte"),Ce("lt"),Ce("lte"),Ce("co"),si("exists"),si("not_exists")]),kl=p({tableId:a(),limit:y(ut.number()),cursor:y(a()),filters:Vt(li)});function pi(){return Oe(ze(e=>e==null?e:String(e)),st(a()))}o(pi,"coerceToString");function Ce(e){return p({fieldId:a(),operator:z(e),value:a()})}o(Ce,"valueFilter");function si(e){return p({fieldId:a(),operator:z(e)})}o(si,"existenceFilter");var Rl=p({status:y(ne()),body:y(w()),headers:y(N(a(),a()))}),wl=p({...ce,deleted:W(Re),ownerId:a(),displayName:a(),platformId:a(),externalId:W(a())});var di=p({name:a(),description:y(a()),type:a(),required:H()}),Nl=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:U(di),returnsResponse:H()})});var mi="^[0-9]+\\.[0-9]+\\.[0-9]+$",vE=new RegExp(mi),Cl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",xE=a().check($e(new RegExp(mi))),_E=a().check($e(new RegExp(Cl))),Ul=p({packageType:z("ARCHIVE"),pieceType:j(Fe),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),fi=p({packageType:z("REGISTRY"),pieceType:z("OFFICIAL"),pieceName:a(),pieceVersion:a()}),gi=p({packageType:z("REGISTRY"),pieceType:z("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),PE=M([fi,gi]),bE=M([Ul,fi,gi]);var Ml=Ae("type",[p({type:z("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:z("INTERVAL"),intervalMs:Ao().check(Dt(6e4))})]),TE=p({...ce,type:j(ke),projectId:a(),flowId:a(),triggerName:a(),schedule:W(Ml),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:W(a()),simulate:H()}),yi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(yi||{}),hi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(hi||{}),vi=(r=>(r.S3="S3",r.DB="DB",r))(vi||{}),EE=p({...ce,projectId:W(a()),platformId:W(a()),type:j(yi),compression:j(hi),data:y(w()),location:j(vi),size:W(ne()),fileName:W(a()),s3Key:W(a()),metadata:W(N(a(),a()))}),xi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(xi||{}),_i=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(_i||{}),IE=p({id:a(),email:a(),firstName:a(),status:j(_i),externalId:W(a()),platformId:W(a()),platformRole:j(xi),lastName:a(),created:Re,updated:Re,lastActiveDate:W(Re),imageUrl:W(a())});var Dr=p({...V.shape,...L(N(a(),w()),"OBJECT").shape});var Ei=p({...V.shape,...L(a(),"COLOR").shape});var Cr=M([ae,ve,Bt,_e,se,xe,Tr,ct,Er,Pe,dt,Dr,mt,pt,lt,Ei]),b={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 ge=p({displayName:a(),description:y(a())});var Ii=p({username:a(),password:a()}),Ur=p({...ge.shape,username:p({displayName:a(),description:y(a())}),password:p({displayName:a(),description:y(a())}),...L(Ii,"BASIC_AUTH").shape});var Fl=N(a(),M([ae,ve,Pe,_e,se])),Mr=p({...ge.shape,props:Fl,...L(w(),"CUSTOM_AUTH").shape});var Ue=p({...ge.shape,...L(p({auth:a()}),"SECRET_TEXT").shape});var Zl=N(a(),M([ae,ve,Ue,Pe,_e,se,xe,Bt])),Si=p({...ge.shape,props:Zl,...L(w(),"OIDC").shape});var Lr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Lr||{}),$i=M([ae,Ue,se]),Ai=N(a(),$i),Vl=p({props:y(N(a(),$i)),authUrl:a(),tokenUrl:a(),scope:U(a()),prompt:y(M([z("none"),z("consent"),z("login"),z("omit")])),pkce:y(H()),pkceMethod:y(M([z("plain"),z("S256")])),authorizationMethod:y(j(Lr)),grantType:y(M([j(gt),z(Ir)])),extra:y(N(a(),a()))}),zi=p({access_token:a(),props:y(Ai),data:N(a(),at())}),jr=p({...ge.shape,...Vl.shape,...L(zi,"OAUTH2").shape});var qe=M([Ur,Mr,Si,jr,Ue]),_t="Connection",Br={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||_t}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||_t,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||_t}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||_t}},None(){}};var nS={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var Hl=p({...V.shape,...L(w(),"CUSTOM").shape,code:a()});var ql=M([Cr,qe]),Fr=N(a(),ql),TS=N(a(),Cr);var Oi=M([p({strategy:z("CRON"),cronExpression:a()}),p({strategy:z("NONE")})]),Ge=class{constructor(t,r,n,i,u,c,l,f,h,x,I,_,s,d,g,m,v,P,F){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=l;this.onHandshake=f;this.renewConfiguration=h;this.onRenew=x;this.onEnable=I;this.onDisable=_;this.onStart=s;this.run=d;this.test=g;this.sampleData=m;this.testStrategy=v;this.outputSchema=P;this.aiMetadata=F}static{o(this,"ITrigger")}},ki=o(e=>{switch(e.type){case"WEBHOOK":return new Ge(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 Ge(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 Ge(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 Ge(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,ue(e.sampleData)&&ue(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Ri="2",qt="0.82.0";var Zr=class{constructor(t,r,n,i,u,c,l,f,h=qt,x,I="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=x;this.description=I;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ri}),"getContextInfo");(!Gl(h)||Wl(h,qt))&&(this.minimumSupportedRelease=qt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},wi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Zr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function Gl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Gl,"isValidSimpleSemver");function Wl(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,l]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(Wl,"isSemverLessThan");var Kl=y(N(a(),N(a(),a()))),Ni=p({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:U(a()),platformId:y(a()),directoryPath:y(a()),auth:y(M([qe,U(qe)])),version:a(),categories:y(U(j(Ze))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),deprecated:y(H()),i18n:Kl}),Jl=j(["human","ai","both"]),Di=p({description:y(a()),idempotent:y(H())}),Ci=p({name:a(),displayName:a(),description:a(),props:Fr,requireAuth:H(),errorHandlingOptions:y(br),outputSchema:y(Lt()),audience:y(Jl),aiMetadata:y(Di)}),Ui=p({name:a(),displayName:a(),description:a(),props:Fr,errorHandlingOptions:y(br),type:j(ke),sampleData:w(),handshakeConfiguration:y(Lt()),renewConfiguration:y(Oi),testStrategy:j(ht),outputSchema:y(Lt()),aiMetadata:y(Di)}),Xl=p({...Ni.shape,actions:N(a(),Ci),triggers:N(a(),Ui)}),Yl=p({...Ni.shape,actions:ne(),triggers:ne(),suggestedActions:y(U(Ci)),suggestedTriggers:y(U(Ui))}),Mi=p({projectUsage:ne(),pieceType:j(Fe),packageType:j(ft),platformId:y(a()),archiveId:y(a())}),T$=p({...Xl.shape,...Mi.shape}),E$=p({...Yl.shape,...Mi.shape}),I$=p({name:a(),version:a()});var Ql=Ne(require("path")),ep=Ne(require("fs/promises"));var Fi=require("node:stream");var Gt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Wt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Vr,r=new Hr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Vr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Hr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Me=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Li({error:e,requestBody:t}){return e instanceof Me?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Li,"toFailsafeOutput");var q=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(q||{});var Kt=class extends Gt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Wt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[F,ie]of Object.entries(c))i.append(F,ie);let l=i.toString(),f=l?`${n}?${l}`:n,h=t.responseType??"json",x=t.followRedirects??!0,I=t.retries??0,{body:_,extraHeaders:s,isStream:d}=tp(t.method)?rp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},g=op({...u,...s}),m=await np(async()=>{let F=new AbortController,ie=t.timeout&&t.timeout>0?setTimeout(()=>F.abort(),t.timeout):void 0;try{let le={method:t.method.toString(),headers:g,body:_,redirect:x?"follow":"manual",signal:F.signal};return d&&(le.duplex="half"),r?.dispatcher!==void 0&&(le.dispatcher=r.dispatcher),await fetch(f,le)}finally{ie!==void 0&&clearTimeout(ie)}},I),v=x?300:400;if(m.status<200||m.status>=v){let F=await ji(m,h),ie=new Me(t.body,{status:m.status,responseBody:F});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ie),ie}let P=await ji(m,h);return{status:m.status,headers:ip(m.headers),body:P}}};function tp(e){return e!=="GET"&&e!=="HEAD"}o(tp,"acceptsRequestBody");function rp(e,t){if(sp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(ap(e)){let n=new Fi.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(rp,"serializeBody");async function ji(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(ji,"parseResponseBody");async function np(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Bi(n);continue}return i}catch(i){if(r=i,n<t){await Bi(n);continue}throw i}throw r}o(np,"sendWithRetries");function Bi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Bi,"backoff");function op(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(op,"normalizeHeaders");function ip(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(ip,"toHttpHeaders");function ap(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(ap,"isNodeFormData");function sp(e){return e==null}o(sp,"isNil");var $=new Kt;var Wd=Ne(require("fs")),Ws=Ne(Gs());var Kd={"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 Jd(e){let t=e.split(";")[0].trim().toLowerCase();return Kd[t]??""}o(Jd,"contentTypeToExtension");var Xd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Yd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Ks({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:f="headers"}){return C({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:b.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:b.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${Yd(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:b.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(q).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:b.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:b.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:b.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:b.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let x=h,I={};switch(x){case"none":break;case"json":I.data=b.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=b.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.data=b.Array({displayName:"Form Data",required:!0,properties:{fieldName:b.ShortText({displayName:"Field Name",required:!0}),fieldType:b.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:b.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:b.File({displayName:"File Field Value",required:!1})}});break}return I},"props")}),response_is_binary:b.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:b.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:b.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:b.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async h=>{let{method:x,url:I,headers:_,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:P,followRedirects:F}=h.propsValue;Zt(x,"Method"),Zt(I,"URL");let ie=ue(r)?{}:await r(h.auth,h.propsValue),le=I.url,Qe=le.startsWith("http://")||le.startsWith("https://")?le:Xd({baseUrl:t(h.auth),relativePath:le}),Te={method:x,url:Qe,headers:{..._??{},...f==="headers"||!ue(f)?ie:{}},queryParams:{...f==="queryParams"?ie:{},...s??{}},timeout:v?v*1e3:0,followRedirects:F};if(P&&(Te.responseType="arraybuffer"),d)if(g&&g!=="none"){let ye=d.data;if(g==="form_data"){let _u=ye,Et=new Ws.default;for(let{fieldName:gn,fieldType:yn,textFieldValue:hn,fileFieldValue:ar}of _u)yn==="text"&&!vt(hn)?Et.append(gn,hn):yn==="file"&&!vt(ar)&&Et.append(gn,ar.data,{filename:ar?.filename});Te.body=Et,Te.headers={...Te.headers,...Et.getHeaders()}}else Te.body=ye}else g||(Te.body=d);try{let ye=await $.sendRequest(Te);return await Qd(h.files,ye.body,ye.status,ye.headers,P)}catch(ye){if(m)return Li({error:ye,requestBody:Te.body});throw ye}},"run")})}o(Ks,"createCustomApiCallAction");var Qd=o(async(e,t,r,n,i)=>{let u;if(i&&em(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Jd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${l}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),em=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Js=C({auth:A,name:"send_email",displayName:"Send Email",description:"Send a text or HTML email",audience:"both",aiMetadata:{description:"Sends a single transactional email (plain text or HTML) to one or more recipients via Resend. Use this for one-off messages; the sender address must be on a domain you have verified in Resend. Not idempotent \u2014 each call sends a new email.",idempotent:!1},props:{to:b.Array({displayName:"To",description:"Emails of the recipients",required:!0}),from_name:b.ShortText({displayName:"Sender Name",description:"Sender name",required:!0}),from:b.ShortText({displayName:"Sender Email (From)",description:"Sender email",required:!0}),bcc:b.Array({displayName:"BCC",description:"List of emails in bcc",required:!1}),cc:b.Array({displayName:"CC",description:"List of emails in cc",required:!1}),reply_to:b.ShortText({displayName:"Reply To",description:"Email to receive replies on (defaults to sender)",required:!1}),subject:b.ShortText({displayName:"Subject",description:void 0,required:!0}),content_type:b.Dropdown({auth:A,displayName:"Content Type",refreshers:[],required:!0,defaultValue:"html",options:o(async()=>({disabled:!1,options:[{label:"Plain Text",value:"text"},{label:"HTML",value:"html"}]}),"options")}),content:b.ShortText({displayName:"Content",description:"HTML is only allowed if you selected HTML as type",required:!0})},async run(e){let{to:t,from:r,from_name:n,reply_to:i,subject:u,content_type:c,content:l,cc:f,bcc:h}=e.propsValue,x={to:t,from:n?`${n} <${r}>`:r,reply_to:i??r,cc:f,bcc:h,subject:u};return c==="text"?x.text=l:c==="html"&&(x.html=l),await $.sendRequest({method:"POST",url:"https://api.resend.com/emails",body:x,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:{}})}});var tm="https://api.resend.com",Xs=C({name:"send_batch_emails",auth:A,displayName:"Send Batch Emails",description:"Send up to 100 emails in a single API call",audience:"both",aiMetadata:{description:"Sends up to 100 distinct emails in one Resend API call, each with its own recipient, subject, and body. Use this instead of Send Email when delivering many independent messages at once. Senders must be on verified domains; pass an idempotency key to guard against duplicate batch sends, otherwise each call sends new emails.",idempotent:!1},props:{emails:b.Array({displayName:"Emails",description:"List of emails to send (max 100). Each email is sent independently with its own recipient, subject, and body.",required:!0,properties:{from:b.ShortText({displayName:"From",description:'Sender address. Use "Name <email@domain.com>" for a friendly name.',required:!0}),to:b.ShortText({displayName:"To",description:"Recipient email address.",required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),content_type:b.StaticDropdown({displayName:"Content Type",required:!0,options:{options:[{label:"HTML",value:"html"},{label:"Plain Text",value:"text"}]}}),content:b.LongText({displayName:"Content",description:"Email body. Use HTML markup if Content Type is HTML.",required:!0}),reply_to:b.ShortText({displayName:"Reply To",required:!1}),cc:b.ShortText({displayName:"CC",required:!1}),bcc:b.ShortText({displayName:"BCC",required:!1})}}),idempotency_key:b.ShortText({displayName:"Idempotency Key",description:"Optional unique key to prevent duplicate sends. Must be unique per request, expires after 24 hours, max 256 characters.",required:!1})},async run({auth:e,propsValue:t}){let r=(t.emails??[]).map(u=>{let c=u,l={from:c.from,to:c.to,subject:c.subject};return c.content_type==="html"?l.html=c.content:l.text=c.content,c.reply_to&&(l.reply_to=c.reply_to),c.cc&&(l.cc=c.cc),c.bcc&&(l.bcc=c.bcc),l}),n={};return t.idempotency_key&&(n["Idempotency-Key"]=t.idempotency_key),(await $.sendRequest({method:"POST",url:`${tm}/emails/batch`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},headers:n,body:r})).body.data}});var ir="https://api.resend.com",rm=b.Dropdown({displayName:"Audience",required:!0,auth:A,refreshers:[],options:o(async({auth:e})=>e?{options:(await $.sendRequest({method:"GET",url:`${ir}/audiences`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),nm=b.Dropdown({displayName:"Domain",required:!0,auth:A,refreshers:[],options:o(async({auth:e})=>e?{options:(await $.sendRequest({method:"GET",url:`${ir}/domains`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),om=b.Dropdown({displayName:"Broadcast",required:!0,auth:A,refreshers:[],options:o(async({auth:e})=>e?{options:(await $.sendRequest({method:"GET",url:`${ir}/broadcasts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name?`${r.name} \u2014 ${r.subject}`:r.subject,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),im=b.Dropdown({displayName:"Contact",required:!0,auth:A,refreshers:["audience_id"],options:o(async({auth:e,audience_id:t})=>!e||!t?{disabled:!0,placeholder:"Select an audience first",options:[]}:{options:(await $.sendRequest({method:"GET",url:`${ir}/audiences/${String(t)}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(n=>{let i=[n.first_name,n.last_name].filter(Boolean).join(" ");return{label:i?`${i} <${n.email}>`:n.email,value:n.id}})},"options")}),Q={audienceId:rm,domainId:nm,broadcastId:om,contactId:im};var Ys=C({name:"create_contact",auth:A,displayName:"Create Contact",description:"Add a contact to a Resend audience",audience:"both",aiMetadata:{description:"Adds a new contact (email plus optional name and subscription status) to a specific Resend audience. Use this to grow a mailing list; requires the target audience ID (use List Audiences to find it). Not idempotent \u2014 each call creates a new contact, so guard against re-adding the same email.",idempotent:!1},props:{audience_id:Q.audienceId,email:b.ShortText({displayName:"Email",required:!0}),first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),unsubscribed:b.Checkbox({displayName:"Unsubscribed",description:"If true, the contact will be unsubscribed from all broadcasts",required:!1,defaultValue:!1})},async run({auth:e,propsValue:t}){let r={email:t.email};return t.first_name&&(r.first_name=t.first_name),t.last_name&&(r.last_name=t.last_name),t.unsubscribed!==void 0&&(r.unsubscribed=t.unsubscribed),(await $.sendRequest({method:"POST",url:`https://api.resend.com/audiences/${t.audience_id}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var Qs=C({name:"update_contact",auth:A,displayName:"Update Contact",description:"Update the name or subscription status of a contact in an audience",audience:"both",aiMetadata:{description:"Updates an existing contact's first name, last name, or subscribed/unsubscribed status within an audience, identified by audience ID and contact ID. Use this to change details or toggle subscription for a known contact. Idempotent \u2014 repeating with the same values leaves the contact in the same state.",idempotent:!0},props:{audience_id:Q.audienceId,contact_id:Q.contactId,first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),unsubscribed:b.StaticDropdown({displayName:"Subscription Status",required:!1,options:{options:[{label:"Subscribed",value:!1},{label:"Unsubscribed",value:!0}]}})},async run({auth:e,propsValue:t}){let r={};return t.first_name!==void 0&&t.first_name!==""&&(r.first_name=t.first_name),t.last_name!==void 0&&t.last_name!==""&&(r.last_name=t.last_name),t.unsubscribed!==void 0&&t.unsubscribed!==null&&(r.unsubscribed=t.unsubscribed),(await $.sendRequest({method:"PATCH",url:`https://api.resend.com/audiences/${t.audience_id}/contacts/${t.contact_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var eu=C({name:"delete_contact",auth:A,displayName:"Delete Contact",description:"Remove a contact from an audience",audience:"both",aiMetadata:{description:"Permanently removes a contact from a Resend audience, identified by audience ID and contact ID. Use this to delete a subscriber from a list. Effectively idempotent \u2014 once removed, repeating the call has no further effect.",idempotent:!0},props:{audience_id:Q.audienceId,contact_id:Q.contactId},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"DELETE",url:`https://api.resend.com/audiences/${t.audience_id}/contacts/${t.contact_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var tu=C({name:"list_contacts",auth:A,displayName:"List Contacts",description:"Retrieve all contacts in an audience",audience:"both",aiMetadata:{description:"Retrieves all contacts in a specific Resend audience, including each contact's ID, email, name, and subscription status. Use this to discover contact IDs (e.g. to feed Update Contact or Delete Contact) or to inspect a mailing list; requires the audience ID. Read-only and idempotent.",idempotent:!0},props:{audience_id:Q.audienceId},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"GET",url:`https://api.resend.com/audiences/${t.audience_id}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data}});var ru=C({name:"get_email_status",auth:A,displayName:"Get Email Status",description:"Retrieve the delivery status of a sent email",audience:"both",aiMetadata:{description:"Looks up the current delivery status and details of a single previously sent email by its Resend email ID. Use this to check whether a specific email was delivered, bounced, or is still scheduled. Read-only and idempotent; requires the email ID returned when the email was sent.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:"The ID returned when you sent the email",required:!0})},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"GET",url:`https://api.resend.com/emails/${t.email_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var nu=C({name:"list_emails",auth:A,displayName:"List Sent Emails",description:"Retrieve a list of emails sent from your Resend account",audience:"both",aiMetadata:{description:"Retrieves the list of emails sent from the connected Resend account, including their IDs, recipients, subjects, and latest delivery event. Use this to discover email IDs (e.g. to feed Get Email Status, Cancel Scheduled Email, or Reschedule Email) or to audit recent sends. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await $.sendRequest({method:"GET",url:"https://api.resend.com/emails",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,from:r.from,to:(r.to??[]).join(", "),subject:r.subject,last_event:r.last_event,created_at:r.created_at,scheduled_at:r.scheduled_at??"",cc:(r.cc??[]).join(", "),bcc:(r.bcc??[]).join(", "),reply_to:(r.reply_to??[]).join(", ")}))}});var ou=C({name:"cancel_scheduled_email",auth:A,displayName:"Cancel Scheduled Email",description:"Cancel a scheduled email before it is sent",audience:"both",aiMetadata:{description:"Cancels a previously scheduled email so it will not be delivered, identified by its Resend email ID. Use this to stop a future send before its scheduled time. Effectively idempotent \u2014 once an email is cancelled, repeating the call has no further effect; only works while the email is still pending.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:'The ID of the scheduled email to cancel. Use "List Sent Emails" to find it.',required:!0})},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"POST",url:`https://api.resend.com/emails/${t.email_id}/cancel`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var iu=C({name:"reschedule_email",auth:A,displayName:"Reschedule Email",description:"Update the send time of a scheduled email",audience:"both",aiMetadata:{description:"Changes the future send time of an already scheduled email, identified by its Resend email ID. Use this to move a pending send to a new time without cancelling and recreating it. Idempotent when called with the same target time; requires an ISO 8601 date-time and only works while the email is still scheduled.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:'The ID of the scheduled email to reschedule. Use "List Sent Emails" to find it.',required:!0}),scheduled_at:b.ShortText({displayName:"New Send Time",description:"ISO 8601 date-time for when to send the email, e.g. 2024-12-01T10:00:00Z",required:!0})},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"PATCH",url:`https://api.resend.com/emails/${t.email_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:{scheduled_at:t.scheduled_at}})).body}});var au=C({name:"list_domains",auth:A,displayName:"List Domains",description:"Retrieve all domains added to your Resend account",audience:"both",aiMetadata:{description:"Retrieves all sending domains configured on the connected Resend account, including each domain's ID, name, verification status, and region. Use this to find a domain ID (e.g. for Verify Domain or Delete Domain) or to check which domains are verified before sending. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await $.sendRequest({method:"GET",url:"https://api.resend.com/domains",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,name:r.name,status:r.status,region:r.region,created_at:r.created_at,sending:r.capabilities?.sending??"",receiving:r.capabilities?.receiving??""}))}});var su=C({name:"create_domain",auth:A,displayName:"Create Domain",description:"Add a sending domain to your Resend account and get the DNS records to verify it",audience:"both",aiMetadata:{description:"Registers a new sending domain on the Resend account and returns the DNS records that must be added to verify it. Use this as the first step in setting up a custom sending domain before triggering verification. Not idempotent \u2014 each call attempts to create a new domain entry.",idempotent:!1},props:{name:b.ShortText({displayName:"Domain Name",description:"The domain you want to send from, e.g. mail.yourdomain.com",required:!0}),region:b.StaticDropdown({displayName:"Region",description:"AWS region for email delivery. Defaults to US East.",required:!1,options:{options:[{label:"US East (N. Virginia)",value:"us-east-1"},{label:"EU West (Ireland)",value:"eu-west-1"},{label:"Asia Pacific (Tokyo)",value:"ap-northeast-1"},{label:"South America (S\xE3o Paulo)",value:"sa-east-1"}]}})},async run({auth:e,propsValue:t}){let r={name:t.name};t.region&&(r.region=t.region);let i=(await $.sendRequest({method:"POST",url:"https://api.resend.com/domains",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body;return{id:i.id,name:i.name,status:i.status,region:i.region,created_at:i.created_at,sending:i.capabilities?.sending??"",receiving:i.capabilities?.receiving??"",dns_records:i.records}}});var uu=C({name:"delete_domain",auth:A,displayName:"Delete Domain",description:"Remove a domain from your Resend account",audience:"both",aiMetadata:{description:"Permanently removes a sending domain from the Resend account, identified by its domain ID. Use this to decommission a domain you no longer send from. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{domain_id:Q.domainId},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"DELETE",url:`https://api.resend.com/domains/${t.domain_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var cu=C({name:"verify_domain",auth:A,displayName:"Verify Domain",description:"Trigger a DNS verification check for a domain",audience:"both",aiMetadata:{description:"Triggers Resend to re-check the DNS records of a domain and update its verification status, identified by domain ID. Use this after adding the required DNS records (from Create Domain) to confirm the domain is ready to send. Safe to call repeatedly \u2014 it only re-runs the check.",idempotent:!0},props:{domain_id:Q.domainId},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"POST",url:`https://api.resend.com/domains/${t.domain_id}/verify`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var lu=C({name:"list_audiences",auth:A,displayName:"List Audiences",description:"Retrieve all contact audiences in your Resend account",audience:"both",aiMetadata:{description:"Retrieves all contact audiences (mailing lists) in the connected Resend account, including each audience's ID and name. Use this to discover an audience ID needed by contact and broadcast actions (e.g. Create Contact, List Contacts, Create Broadcast). Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await $.sendRequest({method:"GET",url:"https://api.resend.com/audiences",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data}});var pu=C({name:"create_audience",auth:A,displayName:"Create Audience",description:"Create a new contact audience in Resend",audience:"both",aiMetadata:{description:"Creates a new contact audience (mailing list) in Resend with the given name and returns its ID. Use this before adding contacts or sending broadcasts when no suitable audience exists yet. Not idempotent \u2014 each call creates a new audience even if the name matches an existing one.",idempotent:!1},props:{name:b.ShortText({displayName:"Audience Name",description:'A label for this audience, e.g. "Newsletter Subscribers"',required:!0})},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"POST",url:"https://api.resend.com/audiences",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:{name:t.name}})).body}});var du=C({name:"delete_audience",auth:A,displayName:"Delete Audience",description:"Permanently delete an audience and all its contacts",audience:"both",aiMetadata:{description:"Permanently deletes an entire audience and all of its contacts from Resend, identified by audience ID. Use this to remove a whole mailing list; this is destructive and cannot be undone. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{audience_id:Q.audienceId},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"DELETE",url:`https://api.resend.com/audiences/${t.audience_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var mu=C({name:"list_broadcasts",auth:A,displayName:"List Broadcasts",description:"Retrieve all broadcasts in your Resend account",audience:"both",aiMetadata:{description:"Retrieves all broadcast campaigns in the connected Resend account, including each broadcast's ID, name, audience, subject, and status (draft, scheduled, sent). Use this to find a broadcast ID (e.g. for Send Broadcast or Delete Broadcast) or to check campaign status. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await $.sendRequest({method:"GET",url:"https://api.resend.com/broadcasts",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,name:r.name??"",audience_id:r.audience_id,from:r.from,subject:r.subject,reply_to:Array.isArray(r.reply_to)?r.reply_to.join(", "):r.reply_to??"",preview_text:r.preview_text??"",status:r.status,created_at:r.created_at,scheduled_at:r.scheduled_at??"",sent_at:r.sent_at??""}))}});var fu=C({name:"create_broadcast",auth:A,displayName:"Create Broadcast",description:"Create a new broadcast email to send to an audience",audience:"both",aiMetadata:{description:"Creates a draft broadcast email (subject and body) targeting a Resend audience and returns its ID. Use this to prepare a campaign; it only creates the draft and does not deliver anything \u2014 pair it with Send Broadcast to actually send. Requires the audience ID and a sender on a verified domain. Not idempotent \u2014 each call creates a new broadcast.",idempotent:!1},props:{audience_id:Q.audienceId,from:b.ShortText({displayName:"From",description:'Sender address. Must be from a verified domain. Use "Name <email@yourdomain.com>" for a friendly name.',required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),name:b.ShortText({displayName:"Broadcast Name",description:"Internal label for this broadcast. Not visible to recipients.",required:!1}),reply_to:b.ShortText({displayName:"Reply To",description:"Email address recipients will reply to.",required:!1}),preview_text:b.ShortText({displayName:"Preview Text",description:"Short summary shown in email clients below the subject line.",required:!1}),content_type:b.StaticDropdown({displayName:"Content Type",required:!0,options:{options:[{label:"HTML",value:"html"},{label:"Plain Text",value:"text"}]}}),content:b.LongText({displayName:"Content",description:"Email body. Use HTML markup if Content Type is HTML.",required:!0})},async run({auth:e,propsValue:t}){let r={audience_id:t.audience_id,from:t.from,subject:t.subject};return t.content_type==="html"?r.html=t.content:r.text=t.content,t.name&&(r.name=t.name),t.reply_to&&(r.reply_to=t.reply_to),t.preview_text&&(r.preview_text=t.preview_text),(await $.sendRequest({method:"POST",url:"https://api.resend.com/broadcasts",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var gu=C({name:"send_broadcast",auth:A,displayName:"Send Broadcast",description:"Send or schedule a broadcast email to its audience",audience:"both",aiMetadata:{description:"Sends an existing draft broadcast to its entire audience immediately, or schedules it for a future time, identified by broadcast ID. Use this after Create Broadcast to deliver the campaign. Not idempotent \u2014 repeating the call can dispatch the broadcast again; optionally pass an ISO 8601 time to schedule rather than send now.",idempotent:!1},props:{broadcast_id:Q.broadcastId,scheduled_at:b.ShortText({displayName:"Schedule For",description:"ISO 8601 date-time to schedule the send, e.g. 2024-12-01T10:00:00Z. Leave blank to send immediately.",required:!1})},async run({auth:e,propsValue:t}){let r={};return t.scheduled_at&&(r.scheduled_at=t.scheduled_at),(await $.sendRequest({method:"POST",url:`https://api.resend.com/broadcasts/${t.broadcast_id}/send`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var yu=C({name:"delete_broadcast",auth:A,displayName:"Delete Broadcast",description:"Permanently delete a broadcast from your Resend account",audience:"both",aiMetadata:{description:"Permanently deletes a broadcast from the Resend account, identified by broadcast ID. Use this to remove a draft or unwanted campaign; only broadcasts that have not been sent can be deleted. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{broadcast_id:Q.broadcastId},async run({auth:e,propsValue:t}){return(await $.sendRequest({method:"DELETE",url:`https://api.resend.com/broadcasts/${t.broadcast_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var fn=Ne(require("crypto"));var hu="https://api.resend.com",mn="webhookData",am=300,sm=[{label:"Email Sent",value:"email.sent"},{label:"Email Delivered",value:"email.delivered"},{label:"Email Delivery Delayed",value:"email.delivery_delayed"},{label:"Email Complained",value:"email.complained"},{label:"Email Bounced",value:"email.bounced"},{label:"Email Opened",value:"email.opened"},{label:"Email Clicked",value:"email.clicked"},{label:"Email Failed",value:"email.failed"},{label:"Email Received",value:"email.received"},{label:"Email Scheduled",value:"email.scheduled"},{label:"Email Suppressed",value:"email.suppressed"},{label:"Domain Created",value:"domain.created"},{label:"Domain Updated",value:"domain.updated"},{label:"Domain Deleted",value:"domain.deleted"},{label:"Contact Created",value:"contact.created"},{label:"Contact Updated",value:"contact.updated"},{label:"Contact Deleted",value:"contact.deleted"}];function um({rawBody:e,headers:t,signingSecret:r}){let n=t["svix-id"],i=t["svix-timestamp"],u=t["svix-signature"];if(!n||!i||!u)return!1;let c=Math.floor(Date.now()/1e3);if(Math.abs(c-parseInt(i,10))>am)return!1;let l=Buffer.isBuffer(e)?e.toString("utf8"):String(e),f=Buffer.from(r.replace("whsec_",""),"base64"),h=`${n}.${i}.${l}`,x=fn.default.createHmac("sha256",f).update(h).digest("base64");return u.split(" ").some(I=>{let[_,s]=I.split(",");if(_!=="v1"||!s)return!1;try{return fn.default.timingSafeEqual(Buffer.from(s,"base64"),Buffer.from(x,"base64"))}catch{return!1}})}o(um,"verifyResendWebhook");var vu=ki({name:"email_bounced",auth:A,displayName:"Email Event",description:"Triggers when a selected email or contact event occurs in Resend",aiMetadata:{description:"Fires when one of the subscribed Resend events occurs, such as an email being sent, delivered, bounced, opened, clicked, complained about, or failing, as well as domain and contact lifecycle events. The payload carries the event type and the affected email, domain, or contact. Subscribe to the specific event types you care about."},type:"WEBHOOK",props:{events:b.StaticMultiSelectDropdown({displayName:"Events",description:"Select one or more event types to subscribe to",required:!0,options:{options:sm}})},async onEnable(e){let t=await $.sendRequest({method:"POST",url:`${hu}/webhooks`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},body:{endpoint:e.webhookUrl,events:e.propsValue.events}});await e.store.put(mn,{id:t.body.id,signingSecret:t.body.signing_secret})},async onDisable(e){let t=await e.store.get(mn);t?.id&&await $.sendRequest({method:"DELETE",url:`${hu}/webhooks/${t.id}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})},async run(e){let t=await e.store.get(mn);return um({rawBody:e.payload.rawBody,headers:e.payload.headers,signingSecret:t?.signingSecret??""})?[e.payload.body]:[]},sampleData:{type:"email.bounced",created_at:"2024-03-08T09:37:40.912Z",data:{created_at:"2024-03-08T09:37:40.911Z",email_id:"562e3f00-6bad-4910-b1e3-38c2fca1e2ff",from:"onboarding@resend.dev",to:["john@example.com"],subject:"Re: Follow up"}}});var xu="https://api.resend.com",A=Br.SecretText({displayName:"API Key",description:`To get your API key:
34
4
  1. Log in to your [Resend dashboard](https://resend.com/overview)
35
5
  2. Go to **API Keys** in the left sidebar
36
- 3. Click **Create API Key**, give it a name, and copy the key`,
37
- required: true,
38
- validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
39
- try {
40
- yield pieces_common_1.httpClient.sendRequest({
41
- method: pieces_common_1.HttpMethod.GET,
42
- url: `${BASE_URL}/api-keys`,
43
- authentication: {
44
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
45
- token: auth,
46
- },
47
- });
48
- return { valid: true };
49
- }
50
- catch (error) {
51
- // A restricted (send-only) key returns 401 with name 'restricted_api_key' — it is valid
52
- if (error instanceof pieces_common_1.HttpError) {
53
- const body = error.response.body;
54
- if (typeof body === 'object' && body !== null && 'name' in body && body.name === 'restricted_api_key') {
55
- return { valid: true };
56
- }
57
- }
58
- return { valid: false, error: 'Invalid API key. Please check your Resend API key.' };
59
- }
60
- }),
61
- });
62
- exports.resend = (0, pieces_framework_1.createPiece)({
63
- displayName: 'Resend',
64
- description: 'The email API for developers',
65
- auth: exports.resendAuth,
66
- minimumSupportedRelease: '0.36.1',
67
- logoUrl: 'https://cdn.activepieces.com/pieces/resend.png',
68
- categories: [shared_1.PieceCategory.COMMUNICATION],
69
- authors: ['Tosh94'],
70
- actions: [
71
- send_email_1.sendEmail,
72
- send_batch_emails_action_1.sendBatchEmails,
73
- get_email_status_action_1.getEmailStatus,
74
- list_emails_action_1.listEmails,
75
- cancel_scheduled_email_action_1.cancelScheduledEmail,
76
- reschedule_email_action_1.rescheduleEmail,
77
- create_contact_action_1.createContact,
78
- update_contact_action_1.updateContact,
79
- delete_contact_action_1.deleteContact,
80
- list_contacts_action_1.listContacts,
81
- list_domains_action_1.listDomains,
82
- create_domain_action_1.createDomain,
83
- delete_domain_action_1.deleteDomain,
84
- verify_domain_action_1.verifyDomain,
85
- list_audiences_action_1.listAudiences,
86
- create_audience_action_1.createAudience,
87
- delete_audience_action_1.deleteAudience,
88
- list_broadcasts_action_1.listBroadcasts,
89
- create_broadcast_action_1.createBroadcast,
90
- send_broadcast_action_1.sendBroadcast,
91
- delete_broadcast_action_1.deleteBroadcast,
92
- (0, pieces_common_1.createCustomApiCallAction)({
93
- baseUrl: () => BASE_URL,
94
- auth: exports.resendAuth,
95
- authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
96
- return ({
97
- Authorization: `Bearer ${auth.secret_text}`,
98
- });
99
- }),
100
- }),
101
- ],
102
- triggers: [email_bounced_trigger_1.emailBounced],
103
- });
104
- //# sourceMappingURL=index.js.map
6
+ 3. Click **Create API Key**, give it a name, and copy the key`,required:!0,validate:o(async({auth:e})=>{try{return await $.sendRequest({method:"GET",url:`${xu}/api-keys`,authentication:{type:"BEARER_TOKEN",token:e}}),{valid:!0}}catch(t){if(t instanceof Me){let r=t.response.body;if(typeof r=="object"&&r!==null&&"name"in r&&r.name==="restricted_api_key")return{valid:!0}}return{valid:!1,error:"Invalid API key. Please check your Resend API key."}}},"validate")}),cm=wi({displayName:"Resend",description:"The email API for developers",auth:A,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/resend.png",categories:["COMMUNICATION"],authors:["Tosh94"],actions:[Js,Xs,ru,nu,ou,iu,Ys,Qs,eu,tu,au,su,uu,cu,lu,pu,du,mu,fu,gu,yu,Ks({baseUrl:o(()=>xu,"baseUrl"),auth:A,authMapping:o(async e=>({Authorization:`Bearer ${e.secret_text}`}),"authMapping")})],triggers:[vu]});0&&(module.exports={resend,resendAuth});
7
+ /*! Bundled license information:
8
+
9
+ mime-types/index.js:
10
+ (*!
11
+ * mime-types
12
+ * Copyright(c) 2014 Jonathan Ong
13
+ * Copyright(c) 2015 Douglas Christopher Wilson
14
+ * MIT Licensed
15
+ *)
16
+ */
package/src/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export declare const resendAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
- export declare const resend: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,UAAU,mEA6BrB,CAAC;AAEH,eAAO,MAAM,MAAM,mHAuCjB,CAAC"}
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAMqC;AACrC,iDAAqD;AACrD,yDAAqD;AACrD,qFAAyE;AACzE,+EAAoE;AACpE,+EAAoE;AACpE,+EAAoE;AACpE,6EAAkE;AAClE,mFAAuE;AACvE,yEAA8D;AAC9D,+FAAmF;AACnF,mFAAwE;AACxE,2EAAgE;AAChE,6EAAkE;AAClE,6EAAkE;AAClE,6EAAkE;AAClE,+EAAoE;AACpE,iFAAsE;AACtE,iFAAsE;AACtE,iFAAsE;AACtE,mFAAwE;AACxE,+EAAoE;AACpE,mFAAwE;AACxE,gFAAoE;AAEpE,MAAM,QAAQ,GAAG,wBAAwB,CAAC;AAE7B,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC7C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE;;;8DAG+C;IAC5D,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,QAAQ,WAAW;gBAC3B,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,IAAI;iBACZ;aACF,CAAC,CAAC;YACH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,wFAAwF;YACxF,IAAI,KAAK,YAAY,yBAAS,EAAE,CAAC;gBAC/B,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;gBACjC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;oBACtG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;gBACzB,CAAC;YACH,CAAC;YACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,oDAAoD,EAAE,CAAC;QACvF,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,8BAA8B;IAC3C,IAAI,EAAE,kBAAU;IAChB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,gDAAgD;IACzD,UAAU,EAAE,CAAC,sBAAa,CAAC,aAAa,CAAC;IACzC,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,OAAO,EAAE;QACP,sBAAS;QACT,0CAAe;QACf,wCAAc;QACd,+BAAU;QACV,oDAAoB;QACpB,yCAAe;QACf,qCAAa;QACb,qCAAa;QACb,qCAAa;QACb,mCAAY;QACZ,iCAAW;QACX,mCAAY;QACZ,mCAAY;QACZ,mCAAY;QACZ,qCAAa;QACb,uCAAc;QACd,uCAAc;QACd,uCAAc;QACd,yCAAe;QACf,qCAAa;QACb,yCAAe;QACf,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ;YACvB,IAAI,EAAE,kBAAU;YAChB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAW,IAAgC,CAAC,WAAW,EAAE;iBACzE,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,oCAAY,CAAC;CACzB,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const cancelScheduledEmail: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- email_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- }>;
4
- //# sourceMappingURL=cancel-scheduled-email.action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel-scheduled-email.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/cancel-scheduled-email.action.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB;;EAsB/B,CAAC"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cancelScheduledEmail = 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 __1 = require("../..");
8
- exports.cancelScheduledEmail = (0, pieces_framework_1.createAction)({
9
- name: 'cancel_scheduled_email',
10
- auth: __1.resendAuth,
11
- displayName: 'Cancel Scheduled Email',
12
- description: 'Cancel a scheduled email before it is sent',
13
- audience: 'both',
14
- aiMetadata: { description: 'Cancels a previously scheduled email so it will not be delivered, identified by its Resend email ID. Use this to stop a future send before its scheduled time. Effectively idempotent — once an email is cancelled, repeating the call has no further effect; only works while the email is still pending.', idempotent: true },
15
- props: {
16
- email_id: pieces_framework_1.Property.ShortText({
17
- displayName: 'Email ID',
18
- description: 'The ID of the scheduled email to cancel. Use "List Sent Emails" to find it.',
19
- required: true,
20
- }),
21
- },
22
- run(_a) {
23
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
24
- const response = yield pieces_common_1.httpClient.sendRequest({
25
- method: pieces_common_1.HttpMethod.POST,
26
- url: `https://api.resend.com/emails/${propsValue.email_id}/cancel`,
27
- authentication: { type: pieces_common_1.AuthenticationType.BEARER_TOKEN, token: auth.secret_text },
28
- });
29
- return response.body;
30
- });
31
- },
32
- });
33
- //# sourceMappingURL=cancel-scheduled-email.action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel-scheduled-email.action.js","sourceRoot":"","sources":["../../../../src/lib/actions/cancel-scheduled-email.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,6BAAmC;AAEtB,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,4CAA4C;IACzD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,4SAA4S,EAAE,UAAU,EAAE,IAAI,EAAE;IAC3V,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,6EAA6E;YAC1F,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAiC;gBAC5E,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,iCAAiC,UAAU,CAAC,QAAQ,SAAS;gBAClE,cAAc,EAAE,EAAE,IAAI,EAAE,kCAAkB,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE;aACnF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const createAudience: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- }>;
4
- //# sourceMappingURL=create-audience.action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-audience.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-audience.action.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;EA4BzB,CAAC"}