@activepieces/piece-azure-devops 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/package.json +7 -12
  2. package/src/index.js +24 -42
  3. package/src/index.d.ts +0 -5
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/add-comment.d.ts +0 -12
  7. package/src/lib/actions/add-comment.d.ts.map +0 -1
  8. package/src/lib/actions/add-comment.js +0 -59
  9. package/src/lib/actions/add-comment.js.map +0 -1
  10. package/src/lib/actions/create-work-item.d.ts +0 -27
  11. package/src/lib/actions/create-work-item.d.ts.map +0 -1
  12. package/src/lib/actions/create-work-item.js +0 -74
  13. package/src/lib/actions/create-work-item.js.map +0 -1
  14. package/src/lib/actions/get-work-item.d.ts +0 -11
  15. package/src/lib/actions/get-work-item.d.ts.map +0 -1
  16. package/src/lib/actions/get-work-item.js +0 -43
  17. package/src/lib/actions/get-work-item.js.map +0 -1
  18. package/src/lib/actions/list-work-items.d.ts +0 -12
  19. package/src/lib/actions/list-work-items.d.ts.map +0 -1
  20. package/src/lib/actions/list-work-items.js +0 -62
  21. package/src/lib/actions/list-work-items.js.map +0 -1
  22. package/src/lib/actions/update-work-item.d.ts +0 -67
  23. package/src/lib/actions/update-work-item.d.ts.map +0 -1
  24. package/src/lib/actions/update-work-item.js +0 -109
  25. package/src/lib/actions/update-work-item.js.map +0 -1
  26. package/src/lib/common/index.d.ts +0 -210
  27. package/src/lib/common/index.d.ts.map +0 -1
  28. package/src/lib/common/index.js +0 -581
  29. package/src/lib/common/index.js.map +0 -1
  30. package/src/lib/triggers/new-updated-work-item-webhook.d.ts +0 -68
  31. package/src/lib/triggers/new-updated-work-item-webhook.d.ts.map +0 -1
  32. package/src/lib/triggers/new-updated-work-item-webhook.js +0 -170
  33. package/src/lib/triggers/new-updated-work-item-webhook.js.map +0 -1
  34. package/src/lib/triggers/new-updated-work-item.d.ts +0 -91
  35. package/src/lib/triggers/new-updated-work-item.d.ts.map +0 -1
  36. package/src/lib/triggers/new-updated-work-item.js +0 -117
  37. package/src/lib/triggers/new-updated-work-item.js.map +0 -1
package/package.json CHANGED
@@ -1,16 +1,11 @@
1
1
  {
2
2
  "name": "@activepieces/piece-azure-devops",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
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.87.1",
14
- "tslib": "2.6.2"
15
- }
5
+ "dependencies": {},
6
+ "files": [
7
+ "src/index.js",
8
+ "package.json",
9
+ "src/i18n"
10
+ ]
16
11
  }
package/src/index.js CHANGED
@@ -1,42 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.azureDevOps = 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 create_work_item_1 = require("./lib/actions/create-work-item");
9
- const get_work_item_1 = require("./lib/actions/get-work-item");
10
- const update_work_item_1 = require("./lib/actions/update-work-item");
11
- const list_work_items_1 = require("./lib/actions/list-work-items");
12
- const add_comment_1 = require("./lib/actions/add-comment");
13
- const new_updated_work_item_1 = require("./lib/triggers/new-updated-work-item");
14
- const new_updated_work_item_webhook_1 = require("./lib/triggers/new-updated-work-item-webhook");
15
- const common_1 = require("./lib/common");
16
- exports.azureDevOps = (0, pieces_framework_1.createPiece)({
17
- displayName: 'Azure DevOps',
18
- description: 'Track work, code, and ship software with Azure Boards, Repos, and Pipelines.',
19
- minimumSupportedRelease: '0.36.1',
20
- logoUrl: 'https://cdn.activepieces.com/pieces/azure-devops.png',
21
- categories: [shared_1.PieceCategory.DEVELOPER_TOOLS],
22
- auth: common_1.azureDevOpsAuth,
23
- authors: ['majewskibartosz'],
24
- actions: [
25
- create_work_item_1.createWorkItemAction,
26
- get_work_item_1.getWorkItemAction,
27
- update_work_item_1.updateWorkItemAction,
28
- list_work_items_1.listWorkItemsAction,
29
- add_comment_1.addCommentAction,
30
- (0, pieces_common_1.createCustomApiCallAction)({
31
- baseUrl: (auth) => common_1.azureDevOpsCommon.sanitizeOrgUrl(common_1.azureDevOpsCommon.asAuth(auth).props.organizationUrl),
32
- auth: common_1.azureDevOpsAuth,
33
- authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
34
- return ({
35
- Authorization: `Basic ${Buffer.from(`:${common_1.azureDevOpsCommon.asAuth(auth).props.pat}`).toString('base64')}`,
36
- });
37
- }),
38
- }),
39
- ],
40
- triggers: [new_updated_work_item_webhook_1.newUpdatedWorkItemWebhookTrigger, new_updated_work_item_1.newUpdatedWorkItemTrigger],
41
- });
42
- //# sourceMappingURL=index.js.map
1
+ "use strict";var Pu=Object.create;var Xe=Object.defineProperty;var bu=Object.getOwnPropertyDescriptor;var Iu=Object.getOwnPropertyNames;var Tu=Object.getPrototypeOf,Eu=Object.prototype.hasOwnProperty;var o=(e,t)=>Xe(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}},En=(e,t)=>{for(var r in t)Xe(e,r,{get:t[r],enumerable:!0})},Sn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Iu(t))!Eu.call(e,i)&&i!==r&&Xe(e,i,{get:()=>t[i],enumerable:!(n=bu(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?Pu(Tu(e)):{},Sn(t||!e||!e.__esModule?Xe(r,"default",{value:e,enumerable:!0}):r,e)),Su=e=>Sn(Xe({},"__esModule",{value:!0}),e);var Jo=S((Ko,Gt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function m(c,d){if(c.indexOf("::")!==c.lastIndexOf("::"))return null;let y=0,f=-1,x=(c.match(p.zoneIndex)||[])[0],P,L;for(x&&(x=x.substring(1),c=c.replace(/%.+$/,""));(f=c.indexOf(":",f+1))>=0;)y++;if(c.substr(0,2)==="::"&&y--,c.substr(-2,2)==="::"&&y--,y>d)return null;for(L=d-y,P=":";L--;)P+="0:";return c=c.replace("::",P),c[0]===":"&&(c=c.slice(1)),c[c.length-1]===":"&&(c=c.slice(0,-1)),d=(function(){let re=c.split(":"),se=[];for(let Je=0;Je<re.length;Je++)se.push(parseInt(re[Je],16));return se})(),{parts:d,zoneId:x}}o(m,"expandIPv6");function g(c,d,y,f){if(c.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,P;for(;f>0;){if(P=y-f,P<0&&(P=0),c[x]>>P!==d[x]>>P)return!1;f-=y,x+=1}return!0}o(g,"matchCIDR");function h(c){if(i.test(c))return parseInt(c,16);if(c[0]==="0"&&!isNaN(parseInt(c[1],10))){if(n.test(c))return parseInt(c,8);throw new Error(`ipaddr: cannot parse ${c} as octal`)}return parseInt(c,10)}o(h,"parseIntAuto");function b(c,d){for(;c.length<d;)c=`0${c}`;return c}o(b,"padPart");let _={};_.IPv4=(function(){function c(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,f;for(y=0;y<d.length;y++)if(f=d[y],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(c,"IPv4"),c.prototype.SpecialRanges={unspecified:[[new c([0,0,0,0]),8]],broadcast:[[new c([255,255,255,255]),32]],multicast:[[new c([224,0,0,0]),4]],linkLocal:[[new c([169,254,0,0]),16]],loopback:[[new c([127,0,0,0]),8]],carrierGradeNat:[[new c([100,64,0,0]),10]],private:[[new c([10,0,0,0]),8],[new c([172,16,0,0]),12],[new c([192,168,0,0]),16]],reserved:[[new c([192,0,0,0]),24],[new c([192,0,2,0]),24],[new c([192,88,99,0]),24],[new c([198,18,0,0]),15],[new c([198,51,100,0]),24],[new c([203,0,113,0]),24],[new c([240,0,0,0]),4]],as112:[[new c([192,175,48,0]),24],[new c([192,31,196,0]),24]],amt:[[new c([192,52,193,0]),24]]},c.prototype.kind=function(){return"ipv4"},c.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},c.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,P,L;for(x=3;x>=0;x-=1)if(P=this.octets[x],P in f){if(L=f[P],y&&L!==0)return null;L!==8&&(y=!0),d+=L}else return null;return 32-d},c.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){return this.octets.slice(0)},c.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},c.prototype.toNormalizedString=function(){return this.toString()},c.prototype.toString=function(){return this.octets.join(".")},c})(),_.IPv4.broadcastAddressFromCIDR=function(c){try{let d=this.parseCIDR(c),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<4;)x.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(c){return this.parser(c)!==null},_.IPv4.isValid=function(c){try{return new this(this.parser(c)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(c){try{return this.parseCIDR(c),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(c){return!!(_.IPv4.isValid(c)&&c.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(c){let d=c.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(c)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(c){let d,y,f,x,P;try{for(d=this.parseCIDR(c),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<4;)x.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(c){let d=this.parser(c);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(c){let d;if(d=c.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let f=[this.parse(d[1]),y];return Object.defineProperty(f,"toString",{value:o(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(c){let d,y,f;if(d=c.match(r.fourOctet))return(function(){let x=d.slice(1,6),P=[];for(let L=0;L<x.length;L++)y=x[L],P.push(h(y));return P})();if(d=c.match(r.longValue)){if(f=h(d[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],P;for(P=0;P<=24;P+=8)x.push(f>>P&255);return x})().reverse()}else return(d=c.match(r.twoOctet))?(function(){let x=d.slice(1,4),P=[];if(f=h(x[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(x[0])),P.push(f>>16&255),P.push(f>>8&255),P.push(f&255),P})():(d=c.match(r.threeOctet))?(function(){let x=d.slice(1,5),P=[];if(f=h(x[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(x[0])),P.push(h(x[1])),P.push(f>>8&255),P.push(f&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,f=Math.floor(c/8);for(;y<f;)d[y]=255,y++;return f<4&&(d[f]=Math.pow(2,c%8)-1<<8-c%8),new this(d)},_.IPv6=(function(){function c(d,y){let f,x;if(d.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(d[f]<<8|d[f+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(x=this.parts[f],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(c,"IPv6"),c.prototype.SpecialRanges={unspecified:[new c([0,0,0,0,0,0,0,0]),128],linkLocal:[new c([65152,0,0,0,0,0,0,0]),10],multicast:[new c([65280,0,0,0,0,0,0,0]),8],loopback:[new c([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new c([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new c([0,0,0,0,0,65535,0,0]),96],discard:[new c([256,0,0,0,0,0,0,0]),64],rfc6145:[new c([0,0,0,0,65535,0,0,0]),96],rfc6052:[new c([100,65435,0,0,0,0,0,0]),96],"6to4":[new c([8194,0,0,0,0,0,0,0]),16],teredo:[new c([8193,0,0,0,0,0,0,0]),32],benchmarking:[new c([8193,2,0,0,0,0,0,0]),48],amt:[new c([8193,3,0,0,0,0,0,0]),32],as112v6:[[new c([8193,4,274,0,0,0,0,0]),48],[new c([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new c([8193,16,0,0,0,0,0,0]),28],orchid2:[new c([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new c([8193,48,0,0,0,0,0,0]),28],reserved:[[new c([8193,0,0,0,0,0,0,0]),23],[new c([8193,3512,0,0,0,0,0,0]),32]]},c.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},c.prototype.kind=function(){return"ipv6"},c.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},c.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,P;for(let L=7;L>=0;L-=1)if(x=this.parts[L],x in f){if(P=f[x],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},c.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){let d,y=[],f=this.parts;for(let x=0;x<f.length;x++)d=f[x],y.push(d>>8),y.push(d&255);return y},c.prototype.toFixedLengthString=function(){let d=(function(){let f=[];for(let x=0;x<this.parts.length;x++)f.push(b(this.parts[x].toString(16),4));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},c.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],f=d[1];return new _.IPv4([y>>8,y&255,f>>8,f&255])},c.prototype.toNormalizedString=function(){let d=(function(){let f=[];for(let x=0;x<this.parts.length;x++)f.push(this.parts[x].toString(16));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},c.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,x=-1,P;for(;P=d.exec(y);)P[0].length>x&&(f=P.index,x=P[0].length);return x<0?y:`${y.substring(0,f)}::${y.substring(f+x)}`},c.prototype.toString=function(){return this.toRFC5952String()},c})(),_.IPv6.broadcastAddressFromCIDR=function(c){try{let d=this.parseCIDR(c),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<16;)x.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(c){return this.parser(c)!==null},_.IPv6.isValid=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{let d=this.parser(c);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{return this.parseCIDR(c),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(c){let d,y,f,x,P;try{for(d=this.parseCIDR(c),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<16;)x.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},_.IPv6.parse=function(c){let d=this.parser(c);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(c){let d,y,f;if((y=c.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return f=[this.parse(y[1]),d],Object.defineProperty(f,"toString",{value:o(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(c){let d,y,f,x,P,L;if(f=c.match(p.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(p.native.test(c))return m(c,8);if((f=c.match(p.transitional))&&(L=f[6]||"",d=f[1],f[1].endsWith("::")||(d=d.slice(0,-1)),d=m(d+L,6),d.parts)){for(P=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<P.length;y++)if(x=P[y],!(0<=x&&x<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,f=Math.floor(c/8);for(;y<f;)d[y]=255,y++;return f<16&&(d[f]=Math.pow(2,c%8)-1<<8-c%8),new this(d)},_.fromByteArray=function(c){let d=c.length;if(d===4)return new _.IPv4(c);if(d===16)return new _.IPv6(c);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(c){return _.IPv6.isValid(c)||_.IPv4.isValid(c)},_.isValidCIDR=function(c){return _.IPv6.isValidCIDR(c)||_.IPv4.isValidCIDR(c)},_.parse=function(c){if(_.IPv6.isValid(c))return _.IPv6.parse(c);if(_.IPv4.isValid(c))return _.IPv4.parse(c);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(c){try{return _.IPv6.parseCIDR(c)}catch{try{return _.IPv4.parseCIDR(c)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(c){let d=this.parse(c);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(c,d,y){let f,x,P,L;y==null&&(y="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(P=d[x],P[0]&&!(P[0]instanceof Array)&&(P=[P]),f=0;f<P.length;f++)if(L=P[f],c.kind()===L[0].kind()&&c.match.apply(c,L))return x}return y},typeof Gt<"u"&&Gt.exports?Gt.exports=_:e.ipaddr=_})(Ko)});var Xi=S((az,Ji)=>{var Ki=require("stream").Stream,ul=require("util");Ji.exports=ce;function ce(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ce,"DelayedStream");ul.inherits(ce,Ki);ce.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ce.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ce.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ce.prototype.resume=function(){this._released||this.release(),this.source.resume()};ce.prototype.pause=function(){this.source.pause()};ce.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ce.prototype.pipe=function(){var e=Ki.prototype.pipe.apply(this,arguments);return this.resume(),e};ce.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};ce.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var ta=S((uz,ea)=>{var cl=require("util"),Qi=require("stream").Stream,Yi=Xi();ea.exports=G;function G(){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(G,"CombinedStream");cl.inherits(G,Qi);G.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};G.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};G.prototype.append=function(e){var t=G.isStreamLike(e);if(t){if(!(e instanceof Yi)){var r=Yi.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};G.prototype.pipe=function(e,t){return Qi.prototype.pipe.call(this,e,t),this.resume(),e};G.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}};G.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=G.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};G.prototype._pipeNext=function(e){this._currentStream=e;var t=G.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()};G.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};G.prototype.write=function(e){this.emit("data",e)};G.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};G.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")};G.prototype.end=function(){this._reset(),this.emit("end")};G.prototype.destroy=function(){this._reset(),this.emit("close")};G.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};G.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};G.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)};G.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var na=S((pz,ra)=>{"use strict";ra.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 aa=S(te=>{"use strict";var tr=na(),pl=require("path").extname,oa=/^\s*([^;\s]*)(?:;|\s|$)/,ll=/^text\//i;te.charset=ia;te.charsets={lookup:ia};te.contentType=dl;te.extension=ml;te.extensions=Object.create(null);te.lookup=fl;te.types=Object.create(null);gl(te.extensions,te.types);function ia(e){if(!e||typeof e!="string")return!1;var t=oa.exec(e),r=t&&tr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&ll.test(t[1])?"UTF-8":!1}o(ia,"charset");function dl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(dl,"contentType");function ml(e){if(!e||typeof e!="string")return!1;var t=oa.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(ml,"extension");function fl(e){if(!e||typeof e!="string")return!1;var t=pl("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(fl,"lookup");function gl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(tr).forEach(o(function(i){var s=tr[i],u=s.extensions;if(!(!u||!u.length)){e[i]=u;for(var p=0;p<u.length;p++){var m=u[p];if(t[m]){var g=r.indexOf(tr[t[m]].source),h=r.indexOf(s.source);if(t[m]!=="application/octet-stream"&&(g>h||g===h&&t[m].substr(0,12)==="application/"))continue}t[m]=i}}},"forEachMimeType"))}o(gl,"populateMaps")});var ua=S((mz,sa)=>{sa.exports=yl;function yl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(yl,"defer")});var Xr=S((gz,pa)=>{var ca=ua();pa.exports=hl;function hl(e){var t=!1;return ca(function(){t=!0}),o(function(n,i){t?e(n,i):ca(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(hl,"async")});var Yr=S((hz,la)=>{la.exports=vl;function vl(e){Object.keys(e.jobs).forEach(xl.bind(e)),e.jobs={}}o(vl,"abort");function xl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(xl,"clean")});var Qr=S((xz,ma)=>{var da=Xr(),_l=Yr();ma.exports=Pl;function Pl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=bl(t,i,e[i],function(s,u){i in r.jobs&&(delete r.jobs[i],s?_l(r):r.results[i]=u,n(s,r.results))})}o(Pl,"iterate");function bl(e,t,r,n){var i;return e.length==2?i=e(r,da(n)):i=e(r,t,da(n)),i}o(bl,"runJob")});var en=S((Pz,fa)=>{fa.exports=Il;function Il(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,s){return t(e[i],e[s])}),n}o(Il,"state")});var tn=S((Iz,ga)=>{var Tl=Yr(),El=Xr();ga.exports=Sl;function Sl(e){Object.keys(this.jobs).length&&(this.index=this.size,Tl(this),El(e)(null,this.results))}o(Sl,"terminator")});var ha=S((Ez,ya)=>{var Al=Qr(),$l=en(),zl=tn();ya.exports=kl;function kl(e,t,r){for(var n=$l(e);n.index<(n.keyedList||e).length;)Al(e,t,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return zl.bind(n,r)}o(kl,"parallel")});var rn=S((Az,rr)=>{var va=Qr(),wl=en(),Ol=tn();rr.exports=Rl;rr.exports.ascending=xa;rr.exports.descending=Dl;function Rl(e,t,r,n){var i=wl(e,r);return va(e,t,i,o(function s(u,p){if(u){n(u,p);return}if(i.index++,i.index<(i.keyedList||e).length){va(e,t,i,s);return}n(null,i.results)},"iteratorHandler")),Ol.bind(i,n)}o(Rl,"serialOrdered");function xa(e,t){return e<t?-1:e>t?1:0}o(xa,"ascending");function Dl(e,t){return-1*xa(e,t)}o(Dl,"descending")});var Pa=S((zz,_a)=>{var Nl=rn();_a.exports=Cl;function Cl(e,t,r){return Nl(e,t,null,r)}o(Cl,"serial")});var Ia=S((wz,ba)=>{ba.exports={parallel:ha(),serial:Pa(),serialOrdered:rn()}});var nn=S((Oz,Ta)=>{"use strict";Ta.exports=Object});var Sa=S((Rz,Ea)=>{"use strict";Ea.exports=Error});var $a=S((Dz,Aa)=>{"use strict";Aa.exports=EvalError});var ka=S((Nz,za)=>{"use strict";za.exports=RangeError});var Oa=S((Cz,wa)=>{"use strict";wa.exports=ReferenceError});var Da=S((Uz,Ra)=>{"use strict";Ra.exports=SyntaxError});var nr=S((Mz,Na)=>{"use strict";Na.exports=TypeError});var Ua=S((jz,Ca)=>{"use strict";Ca.exports=URIError});var ja=S((Lz,Ma)=>{"use strict";Ma.exports=Math.abs});var Fa=S((Fz,La)=>{"use strict";La.exports=Math.floor});var Va=S((Bz,Ba)=>{"use strict";Ba.exports=Math.max});var Ha=S((Vz,Za)=>{"use strict";Za.exports=Math.min});var qa=S((Zz,Wa)=>{"use strict";Wa.exports=Math.pow});var Ka=S((Hz,Ga)=>{"use strict";Ga.exports=Math.round});var Xa=S((Wz,Ja)=>{"use strict";Ja.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Qa=S((Gz,Ya)=>{"use strict";var Ul=Xa();Ya.exports=o(function(t){return Ul(t)||t===0?t:t<0?-1:1},"sign")});var ts=S((Jz,es)=>{"use strict";es.exports=Object.getOwnPropertyDescriptor});var on=S((Xz,rs)=>{"use strict";var or=ts();if(or)try{or([],"length")}catch{or=null}rs.exports=or});var os=S((Yz,ns)=>{"use strict";var ir=Object.defineProperty||!1;if(ir)try{ir({},"a",{value:1})}catch{ir=!1}ns.exports=ir});var an=S((Qz,is)=>{"use strict";is.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 s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var us=S((tk,ss)=>{"use strict";var as=typeof Symbol<"u"&&Symbol,Ml=an();ss.exports=o(function(){return typeof as!="function"||typeof Symbol!="function"||typeof as("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ml()},"hasNativeSymbols")});var sn=S((nk,cs)=>{"use strict";cs.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var un=S((ok,ps)=>{"use strict";var jl=nn();ps.exports=jl.getPrototypeOf||null});var ms=S((ik,ds)=>{"use strict";var Ll="Function.prototype.bind called on incompatible ",Fl=Object.prototype.toString,Bl=Math.max,Vl="[object Function]",ls=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),Zl=o(function(t,r){for(var n=[],i=r||0,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},"slicy"),Hl=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");ds.exports=o(function(t){var r=this;if(typeof r!="function"||Fl.apply(r)!==Vl)throw new TypeError(Ll+r);for(var n=Zl(arguments,1),i,s=o(function(){if(this instanceof i){var h=r.apply(this,ls(n,arguments));return Object(h)===h?h:this}return r.apply(t,ls(n,arguments))},"binder"),u=Bl(0,r.length-n.length),p=[],m=0;m<u;m++)p[m]="$"+m;if(i=Function("binder","return function ("+Hl(p,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=o(function(){},"Empty");g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},"bind")});var He=S((sk,fs)=>{"use strict";var Wl=ms();fs.exports=Function.prototype.bind||Wl});var ar=S((uk,gs)=>{"use strict";gs.exports=Function.prototype.call});var cn=S((ck,ys)=>{"use strict";ys.exports=Function.prototype.apply});var vs=S((pk,hs)=>{"use strict";hs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var _s=S((lk,xs)=>{"use strict";var ql=He(),Gl=cn(),Kl=ar(),Jl=vs();xs.exports=Jl||ql.call(Kl,Gl)});var bs=S((dk,Ps)=>{"use strict";var Xl=He(),Yl=nr(),Ql=ar(),ed=_s();Ps.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Yl("a function is required");return ed(Xl,Ql,t)},"callBindBasic")});var $s=S((fk,As)=>{"use strict";var td=bs(),Is=on(),Es;try{Es=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var pn=!!Es&&Is&&Is(Object.prototype,"__proto__"),Ss=Object,Ts=Ss.getPrototypeOf;As.exports=pn&&typeof pn.get=="function"?td([pn.get]):typeof Ts=="function"?o(function(t){return Ts(t==null?t:Ss(t))},"getDunder"):!1});var Rs=S((yk,Os)=>{"use strict";var zs=sn(),ks=un(),ws=$s();Os.exports=zs?o(function(t){return zs(t)},"getProto"):ks?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ks(t)},"getProto"):ws?o(function(t){return ws(t)},"getProto"):null});var ln=S((vk,Ds)=>{"use strict";var rd=Function.prototype.call,nd=Object.prototype.hasOwnProperty,od=He();Ds.exports=od.call(rd,nd)});var Fs=S((xk,Ls)=>{"use strict";var j,id=nn(),ad=Sa(),sd=$a(),ud=ka(),cd=Oa(),Ke=Da(),Ge=nr(),pd=Ua(),ld=ja(),dd=Fa(),md=Va(),fd=Ha(),gd=qa(),yd=Ka(),hd=Qa(),Ms=Function,dn=o(function(e){try{return Ms('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Pt=on(),vd=os(),mn=o(function(){throw new Ge},"throwTypeError"),xd=Pt?(function(){try{return arguments.callee,mn}catch{try{return Pt(arguments,"callee").get}catch{return mn}}})():mn,We=us()(),Q=Rs(),_d=un(),Pd=sn(),js=cn(),bt=ar(),qe={},bd=typeof Uint8Array>"u"||!Q?j:Q(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?j:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?j:ArrayBuffer,"%ArrayIteratorPrototype%":We&&Q?Q([][Symbol.iterator]()):j,"%AsyncFromSyncIteratorPrototype%":j,"%AsyncFunction%":qe,"%AsyncGenerator%":qe,"%AsyncGeneratorFunction%":qe,"%AsyncIteratorPrototype%":qe,"%Atomics%":typeof Atomics>"u"?j:Atomics,"%BigInt%":typeof BigInt>"u"?j:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?j:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?j:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?j:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ad,"%eval%":eval,"%EvalError%":sd,"%Float16Array%":typeof Float16Array>"u"?j:Float16Array,"%Float32Array%":typeof Float32Array>"u"?j:Float32Array,"%Float64Array%":typeof Float64Array>"u"?j:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?j:FinalizationRegistry,"%Function%":Ms,"%GeneratorFunction%":qe,"%Int8Array%":typeof Int8Array>"u"?j:Int8Array,"%Int16Array%":typeof Int16Array>"u"?j:Int16Array,"%Int32Array%":typeof Int32Array>"u"?j:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":We&&Q?Q(Q([][Symbol.iterator]())):j,"%JSON%":typeof JSON=="object"?JSON:j,"%Map%":typeof Map>"u"?j:Map,"%MapIteratorPrototype%":typeof Map>"u"||!We||!Q?j:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":id,"%Object.getOwnPropertyDescriptor%":Pt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?j:Promise,"%Proxy%":typeof Proxy>"u"?j:Proxy,"%RangeError%":ud,"%ReferenceError%":cd,"%Reflect%":typeof Reflect>"u"?j:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?j:Set,"%SetIteratorPrototype%":typeof Set>"u"||!We||!Q?j:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?j:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":We&&Q?Q(""[Symbol.iterator]()):j,"%Symbol%":We?Symbol:j,"%SyntaxError%":Ke,"%ThrowTypeError%":xd,"%TypedArray%":bd,"%TypeError%":Ge,"%Uint8Array%":typeof Uint8Array>"u"?j:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?j:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?j:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?j:Uint32Array,"%URIError%":pd,"%WeakMap%":typeof WeakMap>"u"?j:WeakMap,"%WeakRef%":typeof WeakRef>"u"?j:WeakRef,"%WeakSet%":typeof WeakSet>"u"?j:WeakSet,"%Function.prototype.call%":bt,"%Function.prototype.apply%":js,"%Object.defineProperty%":vd,"%Object.getPrototypeOf%":_d,"%Math.abs%":ld,"%Math.floor%":dd,"%Math.max%":md,"%Math.min%":fd,"%Math.pow%":gd,"%Math.round%":yd,"%Math.sign%":hd,"%Reflect.getPrototypeOf%":Pd};if(Q)try{null.error}catch(e){Ns=Q(Q(e)),Ne["%Error.prototype%"]=Ns}var Ns,Id=o(function e(t){var r;if(t==="%AsyncFunction%")r=dn("async function () {}");else if(t==="%GeneratorFunction%")r=dn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=dn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Q&&(r=Q(i.prototype))}return Ne[t]=r,r},"doEval"),Cs={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},It=He(),sr=ln(),Td=It.call(bt,Array.prototype.concat),Ed=It.call(js,Array.prototype.splice),Us=It.call(bt,String.prototype.replace),ur=It.call(bt,String.prototype.slice),Sd=It.call(bt,RegExp.prototype.exec),Ad=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$d=/\\(\\)?/g,zd=o(function(t){var r=ur(t,0,1),n=ur(t,-1);if(r==="%"&&n!=="%")throw new Ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ke("invalid intrinsic syntax, expected opening `%`");var i=[];return Us(t,Ad,function(s,u,p,m){i[i.length]=p?Us(m,$d,"$1"):u||s}),i},"stringToPath"),kd=o(function(t,r){var n=t,i;if(sr(Cs,n)&&(i=Cs[n],n="%"+i[0]+"%"),sr(Ne,n)){var s=Ne[n];if(s===qe&&(s=Id(n)),typeof s>"u"&&!r)throw new Ge("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ls.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ge("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ge('"allowMissing" argument must be a boolean');if(Sd(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` 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]:"",s=kd("%"+i+"%",r),u=s.name,p=s.value,m=!1,g=s.alias;g&&(i=g[0],Ed(n,Td([0,1],g)));for(var h=1,b=!0;h<n.length;h+=1){var _=n[h],c=ur(_,0,1),d=ur(_,-1);if((c==='"'||c==="'"||c==="`"||d==='"'||d==="'"||d==="`")&&c!==d)throw new Ke("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(m=!0),i+="."+_,u="%"+i+"%",sr(Ne,u))p=Ne[u];else if(p!=null){if(!(_ in p)){if(!r)throw new Ge("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pt&&h+1>=n.length){var y=Pt(p,_);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[_]}else b=sr(p,_),p=p[_];b&&!m&&(Ne[u]=p)}}return p},"GetIntrinsic")});var Vs=S((Pk,Bs)=>{"use strict";var wd=an();Bs.exports=o(function(){return wd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ws=S((Ik,Hs)=>{"use strict";var Od=Fs(),Zs=Od("%Object.defineProperty%",!0),Rd=Vs()(),Dd=ln(),Nd=nr(),cr=Rd?Symbol.toStringTag:null;Hs.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 Nd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");cr&&(n||!Dd(t,cr))&&(Zs?Zs(t,cr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[cr]=r)},"setToStringTag")});var Gs=S((Ek,qs)=>{"use strict";var Cd=Function.prototype.call,Ud=Object.prototype.hasOwnProperty,Md=He();qs.exports=Md.call(Cd,Ud)});var Js=S((Sk,Ks)=>{"use strict";Ks.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Qs=S((Ak,Ys)=>{"use strict";var hn=ta(),jd=require("util"),fn=require("path"),Ld=require("http"),Fd=require("https"),Bd=require("url").parse,Vd=require("fs"),Zd=require("stream").Stream,Hd=require("crypto"),gn=aa(),Wd=Ia(),qd=Ws(),we=Gs(),yn=Js();function Xs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Xs,"escapeHeaderParam");function F(e){if(!(this instanceof F))return new F(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],hn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(F,"FormData");jd.inherits(F,hn);F.LINE_BREAK=`\r
2
+ `;F.DEFAULT_CONTENT_TYPE="application/octet-stream";F.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=hn.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),s=this._multiPartFooter();n(i),n(t),n(s),this._trackLength(i,t,r)};F.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)+F.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&we(t,"httpVersion"))&&!(t instanceof Zd))&&(r.knownLength||this._valuesToMeasure.push(t))};F.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)):Vd.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")};F.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),s="",u={"Content-Disposition":["form-data",'name="'+Xs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&yn(u,r.header);var p;for(var m in u)if(we(u,m)){if(p=u[m],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(s+=m+": "+p.join("; ")+F.LINE_BREAK)}return"--"+this.getBoundary()+F.LINE_BREAK+s+F.LINE_BREAK};F.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=fn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=fn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=fn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Xs(r)+'"'};F.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=gn.lookup(e.name)),!r&&e&&e.path&&(r=gn.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=gn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=F.DEFAULT_CONTENT_TYPE),r};F.prototype._multiPartFooter=function(){return function(e){var t=F.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};F.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+F.LINE_BREAK};F.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};F.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};F.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};F.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(F.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};F.prototype._generateBoundary=function(){this._boundary="--------------------------"+Hd.randomBytes(12).toString("hex")};F.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};F.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};F.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}Wd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};F.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Bd(e),n=yn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=yn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Fd.request(n):r=Ld.request(n),this.getLength(function(s,u){if(s&&s!=="Unknown stream"){this._error(s);return}if(u&&r.setHeader("Content-Length",u),this.pipe(r),t){var p,m=o(function(g,h){return r.removeListener("error",m),r.removeListener("response",p),t.call(this,g,h)},"callback");p=m.bind(this,null),r.on("error",m),r.on("response",p)}}.bind(this)),r};F.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};F.prototype.toString=function(){return"[object FormData]"};qd(F.prototype,"FormData");Ys.exports=F});var Em={};En(Em,{azureDevOps:()=>Tm});module.exports=Su(Em);var Au=Object.freeze({status:"aborted"});function T(e,t,r){function n(p,m){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,m);let g=u.prototype,h=Object.keys(g);for(let b=0;b<h.length;b++){let _=h[b];_ in p||(p[_]=g[_].bind(p))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function u(p){var m;let g=r?.Parent?new s:this;n(g,p),(m=g._zod).deferred??(m.deferred=[]);for(let h of g._zod.deferred)h();return g}return o(u,"_"),Object.defineProperty(u,"init",{value:n}),Object.defineProperty(u,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(u,"name",{value:e}),u}o(T,"$constructor");var pe=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},$t=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},mr={};function ge(e){return e&&Object.assign(mr,e),mr}o(ge,"config");function gr(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(gr,"getEnumValues");function $n(e,t){return typeof t=="bigint"?t.toString():t}o($n,"jsonStringifyReplacer");function kt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(kt,"cached");function zn(e){return e==null}o(zn,"nullish");function wt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(wt,"cleanRegex");var An=Symbol("evaluating");function J(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==An)return n===void 0&&(n=An,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(J,"defineLazy");var yr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ye(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ye,"isObject");var $u=kt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function kn(e){if(Ye(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ye(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(kn,"isPlainObject");var wn=new Set(["string","number","symbol"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ue,"escapeRegex");function Ot(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Ot,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(Z,"normalizeParams");function On(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(On,"optionalKeys");var Rn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Me(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Me,"aborted");function Ie(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Ie,"prefixIssues");function zt(e){return typeof e=="string"?e:e?.message}o(zt,"unwrapMessage");function Te(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=zt(e.inst?._zod.def?.error?.(e))??zt(t?.error?.(e))??zt(r.customError?.(e))??zt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Te,"finalizeIssue");function Dn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Dn,"getLengthableOrigin");function hr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(hr,"issue");var Nn=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,$n,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Cn=T("$ZodError",Nn),Qe=T("$ZodError",Nn,{Parent:Error});var ku=o(e=>(t,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},u=t._zod.run({value:r,issues:[]},s);if(u instanceof Promise)throw new pe;if(u.issues.length){let p=new(i?.Err??e)(u.issues.map(m=>Te(m,s,ge())));throw yr(p,i?.callee),p}return u.value},"_parse"),Rt=ku(Qe),wu=o(e=>async(t,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},s);if(u instanceof Promise&&(u=await u),u.issues.length){let p=new(i?.Err??e)(u.issues.map(m=>Te(m,s,ge())));throw yr(p,i?.callee),p}return u.value},"_parseAsync"),Dt=wu(Qe),Ou=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new pe;return s.issues.length?{success:!1,error:new(e??Cn)(s.issues.map(u=>Te(u,i,ge())))}:{success:!0,data:s.value}},"_safeParse"),et=Ou(Qe),Ru=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(u=>Te(u,i,ge())))}:{success:!0,data:s.value}},"_safeParseAsync"),tt=Ru(Qe);var Du="(?:(?:\\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])))",Nu=new RegExp(`^${Du}$`);var Un=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Mn=/^-?\d+n?$/,jn=/^-?\d+$/,vr=/^-?\d+(?:\.\d+)?$/,Ln=/^(?:true|false)$/i;var Ee=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 Fn=T("$ZodCheckGreaterThan",(e,t)=>{Ee.init(e,t);let r=Cu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(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 Bn=T("$ZodCheckNumberFormat",(e,t)=>{Ee.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,s]=Rn[t.format];e._zod.onattach.push(u=>{let p=u._zod.bag;p.format=t.format,p.minimum=i,p.maximum=s,r&&(p.pattern=jn)}),e._zod.check=u=>{let p=u.value;if(r){if(!Number.isInteger(p)){u.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?u.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):u.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}p<i&&u.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>s&&u.issues.push({origin:"number",input:p,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Vn=T("$ZodCheckMinLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!zn(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 u=Dn(i);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var xr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Ee.init(e,t),e._zod.onattach.push(i=>{let s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=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=()=>{})}),Zn=T("$ZodCheckRegex",(e,t)=>{xr.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 Wn={major:4,minor:3,patch:6};var W=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Wn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let s of i._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((u,p,m)=>{let g=Me(u),h;for(let b of p){if(b._zod.def.when){if(!b._zod.def.when(u))continue}else if(g)continue;let _=u.issues.length,c=b._zod.check(u);if(c instanceof Promise&&m?.async===!1)throw new pe;if(h||c instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await c,u.issues.length!==_&&(g||(g=Me(u,_)))});else{if(u.issues.length===_)continue;g||(g=Me(u,_))}}return h?h.then(()=>u):u},"runChecks"),s=o((u,p,m)=>{if(Me(u))return u.aborted=!0,u;let g=i(p,n,m);if(g instanceof Promise){if(m.async===!1)throw new pe;return g.then(h=>e._zod.parse(h,m))}return e._zod.parse(g,m)},"handleCanaryResult");e._zod.run=(u,p)=>{if(p.skipChecks)return e._zod.parse(u,p);if(p.direction==="backward"){let g=e._zod.parse({value:u.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(h=>s(h,u,p)):s(g,u,p)}let m=e._zod.parse(u,p);if(m instanceof Promise){if(p.async===!1)throw new pe;return m.then(g=>i(g,n,p))}return i(m,n,p)}}J(e,"~standard",()=>({validate:o(i=>{try{let s=et(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return tt(e,i).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ut=T("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Un(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}}),_r=T("$ZodStringFormat",(e,t)=>{xr.init(e,t),Ut.init(e,t)});var Xn=T("$ZodURL",(e,t)=>{_r.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 Pr=T("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??vr,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 s=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,...s?{received:s}:{}}),r}}),Yn=T("$ZodNumberFormat",(e,t)=>{Bn.init(e,t),Pr.init(e,t)}),br=T("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=Ln,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)=>{W.init(e,t),e._zod.pattern=Mn,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 eo=T("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),to=T("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r});var ro=T("$ZodVoid",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),no=T("$ZodDate",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:e}),r}});function qn(e,t,r){e.issues.length&&t.issues.push(...Ie(r,e.issues)),t.value[r]=e.value}o(qn,"handleArrayResult");var oo=T("$ZodArray",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let s=[];for(let u=0;u<i.length;u++){let p=i[u],m=t.element._zod.run({value:p,issues:[]},n);m instanceof Promise?s.push(m.then(g=>qn(g,r,u))):qn(m,r,u)}return s.length?Promise.all(s).then(()=>r):r}});function Ct(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ie(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Ct,"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=On(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,s){let u=[],p=i.keySet,m=i.catchall._zod,g=m.def.type,h=m.optout==="optional";for(let b in t){if(p.has(b))continue;if(g==="never"){u.push(b);continue}let _=m.run({value:t[b],issues:[]},n);_ instanceof Promise?e.push(_.then(c=>Ct(c,r,b,t,h))):Ct(_,r,b,t,h)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}o(Mu,"handleCatchall");var io=T("$ZodObject",(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let m={...p};return Object.defineProperty(t,"shape",{value:m}),m},"get")})}let n=kt(()=>Uu(t));J(e._zod,"propValues",()=>{let p=t.shape,m={};for(let g in p){let h=p[g]._zod;if(h.values){m[g]??(m[g]=new Set);for(let b of h.values)m[g].add(b)}}return m});let i=Ye,s=t.catchall,u;e._zod.parse=(p,m)=>{u??(u=n.value);let g=p.value;if(!i(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let h=[],b=u.shape;for(let _ of u.keys){let c=b[_],d=c._zod.optout==="optional",y=c._zod.run({value:g[_],issues:[]},m);y instanceof Promise?h.push(y.then(f=>Ct(f,p,_,g,d))):Ct(y,p,_,g,d)}return s?Mu(h,g,p,m,n.value,e):h.length?Promise.all(h).then(()=>p):p}});function Gn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let i=e.filter(s=>!Me(s));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(s=>s.issues.map(u=>Te(u,n,ge())))}),t)}o(Gn,"handleUnionResults");var Ir=T("$ZodUnion",(e,t)=>{W.init(e,t),J(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),J(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),J(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),J(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>wt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(r)return n(i,s);let u=!1,p=[];for(let m of t.options){let g=m._zod.run({value:i.value,issues:[]},s);if(g instanceof Promise)p.push(g),u=!0;else{if(g.issues.length===0)return g;p.push(g)}}return u?Promise.all(p).then(m=>Gn(m,i,e,s)):Gn(p,i,e,s)}});var ao=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ir.init(e,t);let r=e._zod.parse;J(e._zod,"propValues",()=>{let i={};for(let s of t.options){let u=s._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[p,m]of Object.entries(u)){i[p]||(i[p]=new Set);for(let g of m)i[p].add(g)}}return i});let n=kt(()=>{let i=t.options,s=new Map;for(let u of i){let p=u._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let m of p){if(s.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);s.set(m,u)}}return s});e._zod.parse=(i,s)=>{let u=i.value;if(!Ye(u))return i.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),i;let p=n.value.get(u?.[t.discriminator]);return p?p._zod.run(i,s):t.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),i)}});var so=T("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!kn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let s=[],u=t.keyType._zod.values;if(u){r.value={};let p=new Set;for(let g of u)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let h=t.valueType._zod.run({value:i[g],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Ie(g,b.issues)),r.value[g]=b.value})):(h.issues.length&&r.issues.push(...Ie(g,h.issues)),r.value[g]=h.value)}let m;for(let g in i)p.has(g)||(m=m??[],m.push(g));m&&m.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:m})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let m=t.keyType._zod.run({value:p,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&vr.test(p)&&m.issues.length){let b=t.keyType._zod.run({value:Number(p),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(m=b)}if(m.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(b=>Te(b,n,ge())),input:p,path:[p],inst:e});continue}let h=t.valueType._zod.run({value:i[p],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Ie(p,b.issues)),r.value[m.value]=b.value})):(h.issues.length&&r.issues.push(...Ie(p,h.issues)),r.value[m.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}});var uo=T("$ZodEnum",(e,t)=>{W.init(e,t);let r=gr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>wn.has(typeof i)).map(i=>typeof i=="string"?Ue(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{let u=i.value;return n.has(u)||i.issues.push({code:"invalid_value",values:r,input:u,inst:e}),i}}),co=T("$ZodLiteral",(e,t)=>{if(W.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ue(n):n?Ue(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var po=T("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $t(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(u=>(r.value=u,r));if(i instanceof Promise)throw new pe;return r.value=i,r}});function Kn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Kn,"handleOptionalResult");var lo=T("$ZodOptional",(e,t)=>{W.init(e,t),e._zod.optin="optional",e._zod.optout="optional",J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${wt(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(s=>Kn(s,r.value)):Kn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var mo=T("$ZodNullable",(e,t)=>{W.init(e,t),J(e._zod,"optin",()=>t.innerType._zod.optin),J(e._zod,"optout",()=>t.innerType._zod.optout),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${wt(r.source)}|null)$`):void 0}),J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var fo=T("$ZodPipe",(e,t)=>{W.init(e,t),J(e._zod,"values",()=>t.in._zod.values),J(e._zod,"optin",()=>t.in._zod.optin),J(e._zod,"optout",()=>t.out._zod.optout),J(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(u=>Nt(u,t.in,n)):Nt(s,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Nt(s,t.out,n)):Nt(i,t.out,n)}});function Nt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Nt,"handlePipeResult");var go=T("$ZodCustom",(e,t)=>{Ee.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(s=>Jn(s,r,n,e));Jn(i,r,n,e)}});function Jn(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(hr(i))}}o(Jn,"handleRefineResult");var ho;var Tr=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 vo(){return new Tr}o(vo,"registry");(ho=globalThis).__zod_globalRegistry??(ho.__zod_globalRegistry=vo());var Er=globalThis.__zod_globalRegistry;function xo(e,t){return new e({type:"string",...Z(t)})}o(xo,"_string");function _o(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(_o,"_coercedString");function Po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(Po,"_url");function bo(e,t){return new e({type:"number",checks:[],...Z(t)})}o(bo,"_number");function Io(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(Io,"_coercedNumber");function To(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}o(To,"_int");function Eo(e,t){return new e({type:"boolean",...Z(t)})}o(Eo,"_boolean");function So(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(So,"_coercedBoolean");function Ao(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(Ao,"_coercedBigint");function $o(e){return new e({type:"any"})}o($o,"_any");function zo(e){return new e({type:"unknown"})}o(zo,"_unknown");function ko(e,t){return new e({type:"void",...Z(t)})}o(ko,"_void");function wo(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o(wo,"_coercedDate");function Mt(e,t){return new Fn({check:"greater_than",...Z(t),value:e,inclusive:!0})}o(Mt,"_gte");function ue(e,t){return new Vn({check:"min_length",...Z(t),minimum:e})}o(ue,"_minLength");function Se(e,t){return new Zn({check:"string_format",format:"regex",...Z(t),pattern:e})}o(Se,"_regex");function Oo(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Oo,"_custom");var X=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");W.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Rt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>et(e,r,n),e.parseAsync=async(r,n)=>Dt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>tt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>Ot(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Lt=T("ZodMiniString",(e,t)=>{Ut.init(e,t),X.init(e,t)});function a(e){return xo(Lt,e)}o(a,"string");var Ro=T("ZodMiniStringFormat",(e,t)=>{_r.init(e,t),Lt.init(e,t)});var Xu=T("ZodMiniURL",(e,t)=>{Xn.init(e,t),Ro.init(e,t)});function Do(e){return Po(Xu,e)}o(Do,"url");var Ft=T("ZodMiniNumber",(e,t)=>{Pr.init(e,t),X.init(e,t)});function ee(e){return bo(Ft,e)}o(ee,"number");var Yu=T("ZodMiniNumberFormat",(e,t)=>{Yn.init(e,t),Ft.init(e,t)});function No(e){return To(Yu,e)}o(No,"int");var Sr=T("ZodMiniBoolean",(e,t)=>{br.init(e,t),X.init(e,t)});function V(e){return Eo(Sr,e)}o(V,"boolean");var Co=T("ZodMiniBigInt",(e,t)=>{Qn.init(e,t),X.init(e,t)});var Qu=T("ZodMiniAny",(e,t)=>{eo.init(e,t),X.init(e,t)});function nt(){return $o(Qu)}o(nt,"any");var ec=T("ZodMiniUnknown",(e,t)=>{to.init(e,t),X.init(e,t)});function w(){return zo(ec)}o(w,"unknown");var tc=T("ZodMiniVoid",(e,t)=>{ro.init(e,t),X.init(e,t)});function Uo(e){return ko(tc,e)}o(Uo,"_void");var Mo=T("ZodMiniDate",(e,t)=>{no.init(e,t),X.init(e,t)});var rc=T("ZodMiniArray",(e,t)=>{oo.init(e,t),X.init(e,t)});function N(e,t){return new rc({type:"array",element:e,...Z(t)})}o(N,"array");var nc=T("ZodMiniObject",(e,t)=>{io.init(e,t),X.init(e,t),J(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...Z(t)};return new nc(r)}o(l,"object");var oc=T("ZodMiniUnion",(e,t)=>{Ir.init(e,t),X.init(e,t)});function C(e,t){return new oc({type:"union",options:e,...Z(t)})}o(C,"union");var ic=T("ZodMiniDiscriminatedUnion",(e,t)=>{ao.init(e,t),X.init(e,t)});function Ae(e,t,r){return new ic({type:"union",options:t,discriminator:e,...Z(r)})}o(Ae,"discriminatedUnion");var ac=T("ZodMiniRecord",(e,t)=>{so.init(e,t),X.init(e,t)});function O(e,t,r){return new ac({type:"record",keyType:e,valueType:t,...Z(r)})}o(O,"record");var sc=T("ZodMiniEnum",(e,t)=>{uo.init(e,t),X.init(e,t),e.options=Object.values(t.entries)});function M(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new sc({type:"enum",entries:r,...Z(t)})}o(M,"_enum");var uc=T("ZodMiniLiteral",(e,t)=>{co.init(e,t),X.init(e,t)});function A(e,t){return new uc({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o(A,"literal");var cc=T("ZodMiniTransform",(e,t)=>{po.init(e,t),X.init(e,t)});function $e(e){return new cc({type:"transform",transform:e})}o($e,"transform");var pc=T("ZodMiniOptional",(e,t)=>{lo.init(e,t),X.init(e,t)});function v(e){return new pc({type:"optional",innerType:e})}o(v,"optional");var lc=T("ZodMiniNullable",(e,t)=>{mo.init(e,t),X.init(e,t)});function ot(e){return new lc({type:"nullable",innerType:e})}o(ot,"nullable");var dc=T("ZodMiniPipe",(e,t)=>{fo.init(e,t),X.init(e,t)});function ze(e,t){return new dc({type:"pipe",in:e,out:t})}o(ze,"pipe");var mc=T("ZodMiniCustom",(e,t)=>{go.init(e,t),X.init(e,t)});function Bt(e,t){return Oo(mc,e??(()=>!0),t)}o(Bt,"custom");var it={};En(it,{bigint:()=>xc,boolean:()=>vc,date:()=>_c,number:()=>hc,string:()=>yc});function yc(e){return _o(Lt,e)}o(yc,"string");function hc(e){return Io(Ft,e)}o(hc,"number");function vc(e){return So(Sr,e)}o(vc,"boolean");function xc(e){return Ao(Co,e)}o(xc,"bigint");function _c(e){return wo(Mo,e)}o(_c,"date");var $r=l({retryOnFailure:l({defaultValue:v(V()),hide:v(V())}),continueOnFailure:l({defaultValue:v(V()),hide:v(V())})}),Ar=class{constructor(t,r,n,i,s,u,p,m,g,h,b){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=u;this.requireAuth=p;this.errorHandlingOptions=m;this.outputSchema=g;this.audience=h;this.aiMetadata=b}static{o(this,"IAction")}},ie=o(e=>new Ar(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var B=l({displayName:a(),description:v(a())}),U=o((e,t)=>l({type:A(t),required:V(),defaultValue:v(nt())}),"TPropertyValue");var ne=l({...B.shape,...U(a(),"SHORT_TEXT").shape}),ye=l({...B.shape,...U(a(),"LONG_TEXT").shape});var Lo=l({label:a(),value:w()}),Vt=l({disabled:v(V()),placeholder:v(a()),options:N(Lo)});var oe=l({...B.shape,options:Vt,...U(w(),"STATIC_DROPDOWN").shape}),he=l({...B.shape,options:Vt,...U(N(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var zr=l({...B.shape,...U(w(),"DROPDOWN").shape,refreshers:N(a())}),at=l({...B.shape,...U(N(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var ve=l({...B.shape,...U(V(),"CHECKBOX").shape});var xe=l({...B.shape,...U(ee(),"NUMBER").shape});var st=l({...B.shape,streaming:v(V()),...U(w(),"FILE").shape});var ut=l({...B.shape,...U(a(),"DATE_TIME").shape});var Fo=O(a(),C([ne,ye,oe,at,he,ve,xe,st,ut])),ct=l({...B.shape,properties:Fo,...U(N(w()),"ARRAY").shape});var pt=l({...B.shape,...U(C([O(a(),w())]),"JSON").shape});var Bo=C([ne,oe,pt,ct,he]),bc=O(a(),Bo),kr=l({refreshers:N(a()),...B.shape,...U(w(),"DYNAMIC").shape});var Zt=l({...B.shape,...U(Uo(),"MARKDOWN").shape});var lt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(lt||{}),je=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(je||{}),Le=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(Le||{});var dt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(dt||{}),wr="both_client_credentials_and_authorization_code";var _e=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(_e||{}),mt=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(mt||{}),Ic=l({strategy:M(mt),paramName:v(a())}),ft=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ft||{});var Ht=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ht||{}),Vo=l({status:v(ee()),body:v(w()),headers:v(O(a(),a()))}),Zo=l({type:A("DELAY"),resumeDateTime:a(),requestIdToReply:v(a()),handlerId:v(a()),streamStepProgress:v(M(Ht))}),Ho=l({type:A("WEBHOOK"),requestId:a(),requestIdToReply:v(a()),response:Vo,handlerId:v(a()),streamStepProgress:v(M(Ht))}),Tc=C([Zo,Ho]);var Ec=l({body:w(),rawBody:v(w()),headers:O(a(),a()),queryParams:O(a(),a())});function Y(e){return e==null}o(Y,"isNil");function gt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(gt,"isEmpty");function Wt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Wt,"assertNotNullOrUndefined");var Or=Ce(require("crypto"),1);var Sc=128,Oe,Fe,Ac=o(e=>{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*Sc),Or.default.randomFillSync(Oe),Fe=0):Fe+e>Oe.length&&(Or.default.randomFillSync(Oe),Fe=0),Fe+=e},"fillPool"),$c=o(e=>(Ac(e|=0),Oe.subarray(Fe-e,Fe)),"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(s=t)=>{let u="";for(;;){let p=r(i),m=i;for(;m--;)if(u+=e[p[m]&n]||"",u.length===s)return u}}},"customRandom"),qo=o((e,t=21)=>zc(e,t,$c),"customAlphabet");var kc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Go=21,aI=a().check(Se(new RegExp(`^[0-9a-zA-Z]{${Go}}$`))),wc=qo(kc,Go);var ke=ze($e(e=>e instanceof Date?e.toISOString():e),a()),ae={id:a(),created:ke,updated:ke},H=o(e=>v(ot(e)),"Nullable");function Rr(e){return v(ot(M(e)))}o(Rr,"NullableEnum");var cI=ze($e(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(V())),qt=o(e=>ze($e(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(N(e))),"OptionalArrayFromQuery");var dI=O(a(),w());var yt=(h=>(h.OPENAI="openai",h.OPENROUTER="openrouter",h.ANTHROPIC="anthropic",h.AZURE="azure",h.GOOGLE="google",h.ACTIVEPIECES="activepieces",h.CLOUDFLARE_GATEWAY="cloudflare-gateway",h.CUSTOM="custom",h.BEDROCK="bedrock",h.MISTRAL="mistral",h))(yt||{});var TI=a().check(Se(/^#[0-9A-Fa-f]{6}$/));var SI=l({filename:a(),data:w(),type:A("file"),mimetype:v(a())});var Oc=Ce(Jo());var RI=l({...ae,name:a(),permissions:N(a()),platformId:H(a()),type:a(),userCount:v(ee())});var Xo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Xo||{}),Dr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Dr||{}),Nr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Nr||{});var Cr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Cr||{});var Ur=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ur||{});var Rc=l({mode:M(Xo),value:w()}),Dc=l({auth:v(a()),fields:O(a(),Rc)}),Nc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:v(Dc)}),Cc=l({type:A("PIECE"),toolName:a().check(ue(1)),pieceMetadata:Nc}),Uc=l({type:A("none")}),Mc=l({type:A("access_token"),accessToken:a()}),jc=l({type:A("api_key"),apiKey:a(),apiKeyHeader:a()}),Lc=l({type:A("headers"),headers:O(a(),a())}),Fc=Ae("type",[Uc,Mc,jc,Lc]),Yo=l({type:A("FLOW"),toolName:a().check(ue(1)),externalFlowId:a(),flowDisplayName:v(a())}),Qo=l({type:A("MCP"),toolName:a().check(ue(1)),serverUrl:Do(),protocol:M(Nr),auth:Fc}),ei=l({type:A("KNOWLEDGE_BASE"),toolName:a().check(ue(1)),sourceType:M(Dr),sourceId:a(),sourceName:a()}),Bc=Ae("type",[Cc,Yo,Qo,ei]),Vc=l({displayName:a(),description:v(a()),type:M(Cr)}),ti=l({type:A("MARKDOWN"),markdown:a()}),Be={type:A("TOOL_CALL"),input:H(O(a(),w())),output:v(w()),toolName:a(),status:M(Ur),toolCallId:a(),startTime:a(),endTime:v(a())},pT=l(Be),ri=Ae("toolCallType",[l({...Be,toolCallType:A("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Be,toolCallType:A("FLOW"),displayName:a(),externalFlowId:a()}),l({...Be,toolCallType:A("MCP"),displayName:a(),serverUrl:a()}),l({...Be,toolCallType:A("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Be,toolCallType:A("UNKNOWN"),displayName:a()})]),Zc=C([ti,ri]);var Mr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Mr||{}),Pe=l({apiKey:a()}),Hc=Pe,Wc=l({apiKey:a(),apiKeyHash:a()}),qc=Pe,Gc=Pe,Kc=Pe,Jc=Pe,Xc=Pe,Yc=Pe,Qc=Pe,si=l({accessKeyId:a().check(ue(1)),secretAccessKey:a().check(ue(1))}),ep=l({}),tp=l({}),rp=l({}),np=l({}),op=l({}),ip=l({}),ui=l({modelId:a(),modelName:a(),modelType:M(Mr)}),ci=l({apiKeyHeader:a(),baseUrl:a(),models:N(ui),defaultHeaders:v(O(a(),a()))}),pi=l({accountId:a(),gatewayId:a(),models:N(ui),vertexProject:v(a()),vertexRegion:v(a())}),li=l({resourceName:a(),apiVersion:ze($e(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(a()))}),di=l({region:a().check(ue(1))}),ap=C([Hc,Kc,Jc,Xc,Yc,Gc,qc,Wc,si,Qc]),mi=C([ci,pi,li,di,ep,rp,np,op,tp,ip]),sp=l({id:a(),name:a(),type:M(Mr)}),up=l({id:a(),name:a(),provider:M(yt),config:mi,enabledForChat:V()}),cp=l({provider:M(yt),config:mi,auth:ap,platformId:a()});var fT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},ni=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],pp=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],lp=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],oi=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],dp=["grok-4.20","grok-4.1-fast"],mp={openai:ni,anthropic:pp,google:oi,activepieces:[...lp.map(e=>`anthropic/${e}`),...ni.map(e=>`openai/${e}`),...oi.map(e=>`google/${e}`),...dp.map(e=>`x-ai/${e}`)]};var ii=128e3,fp={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function gp({provider:e}){return e?fp[e]??ii:ii}o(gp,"getMaxContextTokens");var ai={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"},yp={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},hp=new Set(["anthropic","mistral"]);function le(e){return{chatModels:mp[e],maxContextTokens:gp({provider:e}),defaultEmbeddingModel:ai[e],supportsEmbedding:ai[e]!==void 0,supportsImageGeneration:!hp.has(e),webSearch:yp[e]}}o(le,"buildProviderCapabilities");var vp={openai:le("openai"),anthropic:le("anthropic"),openrouter:le("openrouter"),azure:le("azure"),google:le("google"),"cloudflare-gateway":le("cloudflare-gateway"),custom:le("custom"),bedrock:le("bedrock"),mistral:le("mistral"),activepieces:le("activepieces")};var xp=l({base64Url:a(),fileName:a(),extension:v(a())}),_p=l({mimeType:a(),url:a(),fileName:v(a())}),jr=C([xp,_p]);var Pp=C([l({type:A("file"),value:jr}),l({type:A("markdown"),value:a(),files:v(N(jr))})]),bp=l({sessionId:a(),message:a(),files:v(N(a()))});var gi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(gi||{}),yi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(yi||{}),Lr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Lr||{});var Ip=C([l({...ae,name:a(),externalId:a(),type:A("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...ae,name:a(),externalId:a(),type:C([A("TEXT"),A("NUMBER"),A("DATE")]),tableId:a(),projectId:a()})]),Tp=l({...ae,name:a(),folderId:H(a()),projectId:a(),externalId:a(),status:Rr(yi),trigger:Rr(gi)}),Ep=l({...ae,tableId:a(),projectId:a(),cells:O(a(),l({updated:a(),created:a(),value:w(),fieldName:a()}))}),Sp=l({events:N(M(Lr)),webhookUrl:a(),flowId:a()}),Ap=l({fields:N(l({id:a(),name:a()})),rows:N(O(a(),a())),name:a()}),$p=l({projectId:a(),limit:v(it.number()),cursor:v(a()),name:v(a()),externalIds:qt(a()),folderId:v(a()),folderIds:qt(a())}),zp=l({records:N(N(l({fieldId:a(),value:vi()}))),tableId:a()}),kp=l({cells:v(N(l({fieldId:a(),value:vi()}))),tableId:a(),agentUpdate:v(V())}),hi=Ae("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),fi("exists"),fi("not_exists")]),wp=l({tableId:a(),limit:v(it.number()),cursor:v(a()),filters:qt(hi)});function vi(){return ze($e(e=>e==null?e:String(e)),ot(a()))}o(vi,"coerceToString");function Re(e){return l({fieldId:a(),operator:A(e),value:a()})}o(Re,"valueFilter");function fi(e){return l({fieldId:a(),operator:A(e)})}o(fi,"existenceFilter");var Op=l({status:v(ee()),body:v(w()),headers:v(O(a(),a()))}),Rp=l({...ae,deleted:H(ke),ownerId:a(),displayName:a(),platformId:a(),externalId:H(a())});var xi=l({name:a(),description:v(a()),type:a(),required:V()}),Dp=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(xi),returnsResponse:V()})});var _i="^[0-9]+\\.[0-9]+\\.[0-9]+$",RT=new RegExp(_i),Cp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",DT=a().check(Se(new RegExp(_i))),NT=a().check(Se(new RegExp(Cp))),Up=l({packageType:A("ARCHIVE"),pieceType:M(je),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Pi=l({packageType:A("REGISTRY"),pieceType:A("OFFICIAL"),pieceName:a(),pieceVersion:a()}),bi=l({packageType:A("REGISTRY"),pieceType:A("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),CT=C([Pi,bi]),UT=C([Up,Pi,bi]);var Mp=Ae("type",[l({type:A("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:A("INTERVAL"),intervalMs:No().check(Mt(6e4))})]),MT=l({...ae,type:M(_e),projectId:a(),flowId:a(),triggerName:a(),schedule:H(Mp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:H(a()),simulate:V()}),Ii=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(Ii||{}),Ti=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Ti||{}),Ei=(r=>(r.S3="S3",r.DB="DB",r))(Ei||{}),jT=l({...ae,projectId:H(a()),platformId:H(a()),type:M(Ii),compression:M(Ti),data:v(w()),location:M(Ei),size:H(ee()),fileName:H(a()),s3Key:H(a()),metadata:H(O(a(),a()))}),Si=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Si||{}),Ai=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ai||{}),LT=l({id:a(),email:a(),firstName:a(),status:M(Ai),externalId:H(a()),platformId:H(a()),platformRole:M(Si),lastName:a(),created:ke,updated:ke,lastActiveDate:H(ke),imageUrl:H(a())});var Fr=l({...B.shape,...U(O(a(),w()),"OBJECT").shape});var wi=l({...B.shape,...U(a(),"COLOR").shape});var Br=C([ne,ye,Zt,ve,oe,he,zr,at,kr,xe,ct,Fr,pt,ut,st,wi]),D={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var de=l({displayName:a(),description:v(a())});var Oi=l({username:a(),password:a()}),Vr=l({...de.shape,username:l({displayName:a(),description:v(a())}),password:l({displayName:a(),description:v(a())}),...U(Oi,"BASIC_AUTH").shape});var Bp=O(a(),C([ne,ye,xe,ve,oe])),Zr=l({...de.shape,props:Bp,...U(w(),"CUSTOM_AUTH").shape});var De=l({...de.shape,...U(l({auth:a()}),"SECRET_TEXT").shape});var Vp=O(a(),C([ne,ye,De,xe,ve,oe,he,Zt])),Ri=l({...de.shape,props:Vp,...U(w(),"OIDC").shape});var Hr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Hr||{}),Di=C([ne,De,oe]),Ni=O(a(),Di),Zp=l({props:v(O(a(),Di)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:v(C([A("none"),A("consent"),A("login"),A("omit")])),pkce:v(V()),pkceMethod:v(C([A("plain"),A("S256")])),authorizationMethod:v(M(Hr)),grantType:v(C([M(dt),A(wr)])),extra:v(O(a(),a()))}),Ci=l({access_token:a(),props:v(Ni),data:O(a(),nt())}),Wr=l({...de.shape,...Zp.shape,...U(Ci,"OAUTH2").shape});var Ve=C([Vr,Zr,Ri,Wr,De]),ht="Connection",Kt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||ht}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||ht,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||ht}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||ht}},None(){}};var vS={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 Hp=l({...B.shape,...U(w(),"CUSTOM").shape,code:a()});var Wp=C([Br,Ve]),qr=O(a(),Wp),MS=O(a(),Br);var Ui=C([l({strategy:A("CRON"),cronExpression:a()}),l({strategy:A("NONE")})]),Ze=class{constructor(t,r,n,i,s,u,p,m,g,h,b,_,c,d,y,f,x,P,L){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=u;this.handshakeConfiguration=p;this.onHandshake=m;this.renewConfiguration=g;this.onRenew=h;this.onEnable=b;this.onDisable=_;this.onStart=c;this.run=d;this.test=y;this.sampleData=f;this.testStrategy=x;this.outputSchema=P;this.aiMetadata=L}static{o(this,"ITrigger")}},Jt=o(e=>{switch(e.type){case"WEBHOOK":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,Y(e.sampleData)&&Y(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Mi="2",Xt="0.82.0";var Gr=class{constructor(t,r,n,i,s,u,p,m,g=Xt,h,b="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=m;this.minimumSupportedRelease=g;this.maximumSupportedRelease=h;this.description=b;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Mi}),"getContextInfo");(!qp(g)||Gp(g,Xt))&&(this.minimumSupportedRelease=Xt),s.forEach(c=>this._actions[c.name]=c),u.forEach(c=>this._triggers[c.name]=c)}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}},ji=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Gr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function qp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(qp,"isValidSimpleSemver");function Gp(e,t){let[r,n,i]=e.split(".").map(Number),[s,u,p]=t.split(".").map(Number);return r!==s?r<s:n!==u?n<u:i<p}o(Gp,"isSemverLessThan");var Kp=v(O(a(),O(a(),a()))),Li=l({id:v(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:v(a()),directoryPath:v(a()),auth:v(C([Ve,N(Ve)])),version:a(),categories:v(N(M(Le))),minimumSupportedRelease:v(a()),maximumSupportedRelease:v(a()),deprecated:v(V()),i18n:Kp}),Jp=M(["human","ai","both"]),Fi=l({description:v(a()),idempotent:v(V())}),Bi=l({name:a(),displayName:a(),description:a(),props:qr,requireAuth:V(),errorHandlingOptions:v($r),outputSchema:v(Bt()),audience:v(Jp),aiMetadata:v(Fi)}),Vi=l({name:a(),displayName:a(),description:a(),props:qr,errorHandlingOptions:v($r),type:M(_e),sampleData:w(),handshakeConfiguration:v(Bt()),renewConfiguration:v(Ui),testStrategy:M(ft),outputSchema:v(Bt()),aiMetadata:v(Fi)}),Xp=l({...Li.shape,actions:O(a(),Bi),triggers:O(a(),Vi)}),Yp=l({...Li.shape,actions:ee(),triggers:ee(),suggestedActions:v(N(Bi)),suggestedTriggers:v(N(Vi))}),Zi=l({projectUsage:ee(),pieceType:M(je),packageType:M(lt),platformId:v(a()),archiveId:v(a())}),MA=l({...Xp.shape,...Zi.shape}),jA=l({...Yp.shape,...Zi.shape}),LA=l({name:a(),version:a()});var Qp=Ce(require("path")),el=Ce(require("fs/promises"));var Gi=require("node:stream");var Yt=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((s,u)=>{i.append(u,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Qt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Kr,r=new Jr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Kr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Jr=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 vt=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}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 Hi({error:e,requestBody:t}){return e instanceof vt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Hi,"toFailsafeOutput");var xt=(u=>(u.GET="GET",u.POST="POST",u.PATCH="PATCH",u.PUT="PUT",u.DELETE="DELETE",u.HEAD="HEAD",u))(xt||{});var er=class extends Yt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Qt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),s=this.getHeaders(t),u=t.queryParams??{};for(let[L,re]of Object.entries(u))i.append(L,re);let p=i.toString(),m=p?`${n}?${p}`:n,g=t.responseType??"json",h=t.followRedirects??!0,b=t.retries??0,{body:_,extraHeaders:c,isStream:d}=tl(t.method)?rl(t.body,s):{body:void 0,extraHeaders:{},isStream:!1},y=ol({...s,...c}),f=await nl(async()=>{let L=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let se={method:t.method.toString(),headers:y,body:_,redirect:h?"follow":"manual",signal:L.signal};return d&&(se.duplex="half"),r?.dispatcher!==void 0&&(se.dispatcher=r.dispatcher),await fetch(m,se)}finally{re!==void 0&&clearTimeout(re)}},b),x=h?300:400;if(f.status<200||f.status>=x){let L=await Wi(f,g),re=new vt(t.body,{status:f.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let P=await Wi(f,g);return{status:f.status,headers:il(f.headers),body:P}}};function tl(e){return e!=="GET"&&e!=="HEAD"}o(tl,"acceptsRequestBody");function rl(e,t){if(sl(e))return{body:void 0,extraHeaders:{},isStream:!1};if(al(e)){let n=new Gi.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(rl,"serializeBody");async function Wi(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(Wi,"parseResponseBody");async function nl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await qi(n);continue}return i}catch(i){if(r=i,n<t){await qi(n);continue}throw i}throw r}o(nl,"sendWithRetries");function qi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(qi,"backoff");function ol(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(ol,"normalizeHeaders");function il(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(il,"toHttpHeaders");function al(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(al,"isNodeFormData");function sl(e){return e==null}o(sl,"isNil");var _t=new er;var Gd=Ce(require("fs")),eu=Ce(Qs());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 tu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:s,props:u,extraProps:p,authLocation:m="headers"}){return ie({audience:"human",name:s||"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:D.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:g})=>({url:D.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${Yd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...u?.url??{}})}),"props")}),method:D.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(xt).map(g=>({label:g,value:g}))},...u?.method??{}}),headers:D.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...u?.headers??{}}),queryParams:D.Object({displayName:"Query Parameters",required:!0,...u?.queryParams??{}}),body_type:D.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:D.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:g})=>{if(!g)return{};let h=g,b={};switch(h){case"none":break;case"json":b.data=D.Json({displayName:"JSON Body",required:!0,...u?.body??{}});break;case"raw":b.data=D.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=D.Array({displayName:"Form Data",required:!0,properties:{fieldName:D.ShortText({displayName:"Field Name",required:!0}),fieldType:D.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:D.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:D.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:D.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:D.Checkbox({displayName:"No Error on Failure",required:!1,...u?.failsafe??{}}),timeout:D.Number({displayName:"Timeout (in seconds)",required:!1,...u?.timeout??{}}),followRedirects:D.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async g=>{let{method:h,url:b,headers:_,queryParams:c,body:d,body_type:y,failsafe:f,timeout:x,response_is_binary:P,followRedirects:L}=g.propsValue;Wt(h,"Method"),Wt(b,"URL");let re=Y(r)?{}:await r(g.auth,g.propsValue),se=b.url,Je=se.startsWith("http://")||se.startsWith("https://")?se:Xd({baseUrl:t(g.auth),relativePath:se}),be={method:h,url:Je,headers:{..._??{},...m==="headers"||!Y(m)?re:{}},queryParams:{...m==="queryParams"?re:{},...c??{}},timeout:x?x*1e3:0,followRedirects:L};if(P&&(be.responseType="arraybuffer"),d)if(y&&y!=="none"){let fe=d.data;if(y==="form_data"){let _u=fe,At=new eu.default;for(let{fieldName:bn,fieldType:In,textFieldValue:Tn,fileFieldValue:dr}of _u)In==="text"&&!gt(Tn)?At.append(bn,Tn):In==="file"&&!gt(dr)&&At.append(bn,dr.data,{filename:dr?.filename});be.body=At,be.headers={...be.headers,...At.getHeaders()}}else be.body=fe}else y||(be.body=d);try{let fe=await _t.sendRequest(be);return await Qd(g.files,fe.body,fe.status,fe.headers,P)}catch(fe){if(f)return Hi({error:fe,requestBody:be.body});throw fe}},"run")})}o(tu,"createCustomApiCallAction");var Qd=o(async(e,t,r,n,i)=>{let s;if(i&&em(t)){let u=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Jd(u??"")||"txt",m;t instanceof ArrayBuffer?m=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?m=t:m=Buffer.from(t),s=await e.write({fileName:`output.${p}`,data:m})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),em=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Tt={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:u}){switch(e.strategy){case 0:{let p=await t.get("lastPoll");if(Y(p))throw new Error("lastPoll doesn't exist in the store.");let m=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:p,server:u}),g=m.reduce((h,b)=>Math.max(h,b.epochMilliSeconds),p);return await t.put("lastPoll",g),m.filter(h=>h.epochMilliSeconds>p).map(h=>h.data)}case 1:{let p=await t.get("lastItem"),m=await e.items({store:t,auth:r,propsValue:n,lastItemId:p,files:s,server:u}),g=m.findIndex(_=>_.id===p),h=[];Y(p)||g==-1?h=m??[]:h=m?.slice(0,g)??[],Y(i)||(h=h.slice(-i));let b=h?.[0]?.id;return Y(b)||await t.put("lastItem",b),h.map(_=>_.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:i}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let u=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;Y(u)?await t.delete("lastItem"):await t.put("lastItem",u);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:i,server:s}){let u=[];switch(e.strategy){case 0:{u=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{u=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:i,server:s});break}}return tm(u.map(p=>p.data))}};function tm(e){return e.length<=5?e:e.slice(0,5)}o(tm,"getFirstFiveOrAll");function rm(e){return e}o(rm,"asAzureAuth");function Et(e,t){if(typeof e!="string"||e.length===0)throw new Error(`Expected non-empty string for "${t}", got ${typeof e}`);return e}o(Et,"narrowString");function ru(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(ru,"isRecord");function nm(){let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}o(nm,"generateWebhookToken");function om(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e.charCodeAt(n)^t.charCodeAt(n);return r===0}o(om,"timingSafeEqual");function St(e){if(typeof e=="object"&&e!==null){let t=e,r=t.response?.status??t.status;if(typeof r=="number")return` (HTTP ${r})`}return""}o(St,"extractHttpStatus");function im(e){if(!ru(e))return null;let{eventType:t,resource:r}=e;return typeof t!="string"||!ru(r)||t!=="workitem.created"&&t!=="workitem.updated"&&t!=="workitem.commented"?null:{eventType:t,resource:r}}o(im,"parseWebhookPayload");var am=`To get your Personal Access Token (PAT):
4
+
5
+ 1. Go to **Azure DevOps** and click your profile icon (top-right)
6
+ 2. Select **Personal access tokens**
7
+ 3. Click **+ New Token**
8
+ 4. Give it a name and set expiration
9
+ 5. Under **Scopes**, select:
10
+ - **Work Items**: Read & Write
11
+ - **Project and Team**: Read
12
+ 6. Click **Create** and copy the token (you won't see it again)
13
+
14
+ **Organization URL** is your Azure DevOps URL, e.g. \`https://dev.azure.com/mycompany\``,K=Kt.CustomAuth({description:am,required:!0,props:{organizationUrl:D.ShortText({displayName:"Organization URL",description:"Your Azure DevOps organization URL (e.g. https://dev.azure.com/mycompany)",required:!0}),pat:Kt.SecretText({displayName:"Personal Access Token",description:"Your Azure DevOps PAT with Work Items (Read & Write) and Project and Team (Read) scopes.",required:!0})},validate:o(async({auth:e})=>{if(!cu(e.organizationUrl))return{valid:!1,error:"Organization URL must be a valid HTTP/HTTPS URL"};let t=vn(e.organizationUrl),r=Buffer.from(`:${e.pat}`).toString("base64");try{return(await _t.sendRequest({method:"GET",url:`${t}/_apis/projects`,headers:{Authorization:`Basic ${r}`},queryParams:{"api-version":"7.1"}})).body.value!==void 0?{valid:!0}:{valid:!1,error:"Invalid PAT or Organization URL"}}catch{return{valid:!1,error:"Invalid PAT or Organization URL"}}},"validate")});async function me({organizationUrl:e,pat:t,method:r,endpoint:n,body:i,queryParams:s,isJsonPatch:u=!1}){let p=vn(e),m=Buffer.from(`:${t}`).toString("base64"),g={};if(s)for(let[_,c]of Object.entries(s))c!=null&&(g[_]=c);let h={Authorization:`Basic ${m}`};return i!==void 0&&(h["Content-Type"]=u?"application/json-patch+json":"application/json"),(await _t.sendRequest({method:r,url:`${p}${n}`,headers:h,queryParams:g,body:i})).body}o(me,"azureDevOpsApiCall");async function sm(e){return me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:"/_apis/projects",queryParams:{"api-version":"7.1"}})}o(sm,"fetchProjects");async function um(e,t){return me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitemtypes`,queryParams:{"api-version":"7.1"}})}o(um,"fetchWorkItemTypes");function au(e){let t=e.fields;return{id:e.id,rev:e.rev,url:e.url??null,title:t["System.Title"]??null,work_item_type:t["System.WorkItemType"]??null,state:t["System.State"]??null,reason:t["System.Reason"]??null,assigned_to:t["System.AssignedTo"]?.displayName??null,assigned_to_email:t["System.AssignedTo"]?.uniqueName??null,created_date:t["System.CreatedDate"]??null,created_by:t["System.CreatedBy"]?.displayName??null,changed_date:t["System.ChangedDate"]??null,changed_by:t["System.ChangedBy"]?.displayName??null,area_path:t["System.AreaPath"]??null,iteration_path:t["System.IterationPath"]??null,priority:t["Microsoft.VSTS.Common.Priority"]??null,description:t["System.Description"]??null,project:t["System.TeamProject"]??null}}o(au,"flattenWorkItem");async function cm({organizationUrl:e,pat:t,ids:r}){if(r.length===0)return[];let n=[],i=200;for(let s=0;s<r.length;s+=i){let u=r.slice(s,s+i),p=await me({organizationUrl:e,pat:t,method:"GET",endpoint:"/_apis/wit/workitems",queryParams:{ids:u.join(","),$expand:"all","api-version":"7.1"}});p.value&&n.push(...p.value.map(au))}return n}o(cm,"fetchWorkItemsByIds");async function pm({auth:e,projectId:t,eventType:r,webhookUrl:n,workItemType:i,basicAuthUsername:s,basicAuthPassword:u}){let p={projectId:t};i&&(p.workItemType=i);let m={url:n,resourceDetailsToSend:"all",messagesToSend:"none",detailedMessagesToSend:"none"};return s!==void 0&&(m.basicAuthUsername=s),u!==void 0&&(m.basicAuthPassword=u),me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"POST",endpoint:"/_apis/hooks/subscriptions",queryParams:{"api-version":"7.1"},body:{publisherId:"tfs",eventType:r,resourceVersion:"1.0",consumerId:"webHooks",consumerActionId:"httpRequest",publisherInputs:p,consumerInputs:m}})}o(pm,"createSubscription");async function lm({auth:e,subscriptionId:t}){await me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"DELETE",endpoint:`/_apis/hooks/subscriptions/${t}`,queryParams:{"api-version":"7.1"}})}o(lm,"deleteSubscription");async function dm(e,t){return(await me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/_apis/projects/${encodeURIComponent(t)}`,queryParams:{"api-version":"7.1"}})).id??null}o(dm,"fetchProjectId");var mm=25,nu=5;async function su(e,t){let n=(await me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/_apis/projects/${encodeURIComponent(t)}/teams`,queryParams:{"api-version":"7.1",$top:String(mm)}})).value??[],i=new Map;for(let s=0;s<n.length;s+=nu){let u=n.slice(s,s+nu),p=await Promise.all(u.map(m=>me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/_apis/projects/${encodeURIComponent(t)}/teams/${m.id}/members`,queryParams:{"api-version":"7.1",$top:"200"}})));for(let m of p)for(let g of m.value??[]){let h=g.identity;h?.id&&!i.has(h.id)&&i.set(h.id,h)}}return Array.from(i.values())}o(su,"fetchTeamMembers");async function uu(e,t,r){return(await me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitemtypes/${encodeURIComponent(r)}`,queryParams:{"api-version":"7.1"}})).states??[]}o(uu,"fetchWorkItemTypeStates");function fm(e){return D.Dropdown({displayName:"Assigned To",description:"Select the person to assign this work item to. Only project team members are listed \u2014 use the Custom API Call action if you need to assign a user outside your teams.",refreshers:["project"],required:e,auth:K,options:o(async({auth:t,project:r})=>{if(!t)return{disabled:!0,options:[],placeholder:"Please connect your Azure DevOps account first"};if(!r)return{disabled:!0,options:[],placeholder:"Please select a project first"};let n=t;try{let i=await su(n,Et(r,"project"));return i.length===0?{disabled:!1,options:[],placeholder:"No team members found in this project."}:{disabled:!1,options:i.map(s=>({label:s.uniqueName?`${s.displayName} (${s.uniqueName})`:s.displayName,value:s.uniqueName??s.displayName}))}}catch(i){return{disabled:!0,options:[],placeholder:`Load failed${St(i)}. Check PAT.`}}},"options")})}o(fm,"createAssignedToDropdown");function ou(e,t){return D.Dropdown({displayName:"State",description:t,refreshers:["project","work_item_type"],required:e,auth:K,options:o(async({auth:r,project:n,work_item_type:i})=>{if(!r)return{disabled:!0,options:[],placeholder:"Please connect your Azure DevOps account first"};if(!n)return{disabled:!0,options:[],placeholder:"Please select a project first"};if(!i)return{disabled:!0,options:[],placeholder:"Please select a work item type first"};let s=r;try{let u=await uu(s,Et(n,"project"),Et(i,"work_item_type"));return u.length===0?{disabled:!1,options:[],placeholder:"No states defined for this work item type."}:{disabled:!1,options:u.map(p=>({label:p.category?`${p.name} (${p.category})`:p.name,value:p.name}))}}catch(u){return{disabled:!0,options:[],placeholder:`Load failed${St(u)}. Check PAT.`}}},"options")})}o(ou,"createStateDropdown");function iu(e,t){return D.Dropdown({displayName:"Work Item Type",description:t,refreshers:["project"],required:e,auth:K,options:o(async({auth:r,project:n})=>{if(!r)return{disabled:!0,options:[],placeholder:"Please connect your Azure DevOps account first"};if(!n)return{disabled:!0,options:[],placeholder:"Please select a project first"};let i=r;try{let s=await um(i,Et(n,"project"));return!s.value||s.value.length===0?{disabled:!1,options:[],placeholder:"No work item types found."}:{disabled:!1,options:s.value.map(u=>({label:u.name,value:u.name}))}}catch(s){return{disabled:!0,options:[],placeholder:`Load failed${St(s)}. Check PAT.`}}},"options")})}o(iu,"createWorkItemTypeDropdown");var I={projectDropdown:D.Dropdown({displayName:"Project",description:"Select the Azure DevOps project",refreshers:[],required:!0,auth:K,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your Azure DevOps account first"};let t=e;try{let r=await sm(t);return!r.value||r.value.length===0?{disabled:!1,options:[],placeholder:"No projects found. Create one in Azure DevOps first."}:{disabled:!1,options:r.value.map(n=>({label:n.name,value:n.name}))}}catch(r){return{disabled:!0,options:[],placeholder:`Load failed${St(r)}. Check PAT.`}}},"options")}),workItemTypeDropdown:iu(!0,"Select the type of work item (e.g. Bug, Task, User Story)"),workItemTypeDropdownOptional:iu(!1,"Filter by work item type. Leave empty to trigger for all types."),assignedToDropdown:fm(!1),stateDropdown:ou(!1,"New state for the work item. Leave empty to keep the current state."),stateDropdownOptional:ou(!1,"Filter by state. Leave empty to trigger for all states."),priorityDropdown:D.StaticDropdown({displayName:"Priority",description:"The priority of the work item",required:!1,options:{options:[{label:"1 - Critical",value:"1"},{label:"2 - High",value:"2"},{label:"3 - Medium",value:"3"},{label:"4 - Low",value:"4"}]}}),escapeWiqlString:gm,sanitizeOrgUrl:vn,isValidUrl:cu,asAuth:rm,narrowString:Et,parseWebhookPayload:im,generateWebhookToken:nm,timingSafeEqual:om,extractHttpStatus:St,apiCall:me,fetchWorkItemsByIds:cm,flattenWorkItem:au,fetchProjectId:dm,fetchTeamMembers:su,fetchWorkItemTypeStates:uu,createSubscription:pm,deleteSubscription:lm};function vn(e){return e.replace(/\/+$/,"")}o(vn,"sanitizeOrgUrl");function gm(e){return e.replace(/'/g,"''")}o(gm,"escapeWiqlString");function cu(e){try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}o(cu,"isValidUrl");var xn=[{label:"Work Item Created",value:"workitem.created"},{label:"Work Item Updated",value:"workitem.updated"},{label:"Work Item Commented",value:"workitem.commented"}];var pu=ie({auth:K,name:"create_work_item",displayName:"Create Work Item",description:"Creates a new work item (Bug, Task, User Story, etc.) in Azure DevOps",audience:"both",aiMetadata:{description:"Creates a new work item of the chosen type (Bug, Task, User Story, etc.) in an Azure DevOps project, optionally setting description, assignee, and priority. Use to file a new tracked item. Requires a project and work item type; not idempotent, as each call creates a separate item with a new ID.",idempotent:!1},props:{project:I.projectDropdown,work_item_type:I.workItemTypeDropdown,title:D.ShortText({displayName:"Title",description:"The title of the work item",required:!0}),description:D.LongText({displayName:"Description",description:"Detailed description of the work item (supports HTML)",required:!1}),assigned_to:I.assignedToDropdown,priority:I.priorityDropdown},async run(e){let{project:t,work_item_type:r,title:n,description:i,assigned_to:s,priority:u}=e.propsValue,p=e.auth,m=I.sanitizeOrgUrl(p.props.organizationUrl),g=[{op:"add",path:"/fields/System.Title",value:n}];i&&g.push({op:"add",path:"/fields/System.Description",value:i}),s&&g.push({op:"add",path:"/fields/System.AssignedTo",value:s}),u&&g.push({op:"add",path:"/fields/Microsoft.VSTS.Common.Priority",value:Number(u)});let h=await I.apiCall({organizationUrl:m,pat:p.props.pat,method:"POST",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitems/$${encodeURIComponent(I.narrowString(r,"work_item_type"))}`,queryParams:{"api-version":"7.1"},body:g,isJsonPatch:!0});return I.flattenWorkItem(h)}});var lu=ie({auth:K,name:"get_work_item",displayName:"Get Work Item",description:"Retrieves a work item by ID from Azure DevOps",audience:"both",aiMetadata:{description:"Fetches a single Azure DevOps work item by its numeric ID, returning its fields (title, state, assignee, etc.). Use to look up details of a known work item; requires the project and the numeric work item ID, not a title. Read-only and idempotent.",idempotent:!0},props:{project:I.projectDropdown,work_item_id:D.Number({displayName:"Work Item ID",description:"Numeric ID of the work item (e.g. 123). To pass it dynamically, reference the ID from a previous step (e.g. `{{trigger.id}}`), not the title.",required:!0})},async run(e){let{project:t,work_item_id:r}=e.propsValue,n=e.auth,i=I.sanitizeOrgUrl(n.props.organizationUrl),s=await I.apiCall({organizationUrl:i,pat:n.props.pat,method:"GET",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitems/${r}`,queryParams:{$expand:"all","api-version":"7.1"}});return I.flattenWorkItem(s)}});var du=ie({auth:K,name:"update_work_item",displayName:"Update Work Item",description:"Updates an existing work item in Azure DevOps",audience:"both",aiMetadata:{description:"Updates fields (title, description, state, assignee, priority) on an existing Azure DevOps work item identified by its numeric ID; only the fields you provide are changed. Use to modify a known work item rather than to look it up or create one. Requires the project and numeric work item ID; the work item type prop only loads the matching state list and does not change the item type. Idempotent, since it replaces fields to a fixed target value keyed on a stable ID.",idempotent:!0},props:{project:I.projectDropdown,work_item_type:{...I.workItemTypeDropdown,description:"Type of the work item. Used only to load the matching list of states below \u2014 it does not change the work item's type. Changing type requires a separate Azure DevOps operation not supported here."},work_item_id:D.Number({displayName:"Work Item ID",description:"Numeric ID of the work item (e.g. 123). To pass it dynamically from a previous step, use a reference like `{{trigger.id}}` or the output of a Get/List step \u2014 not the title.",required:!0}),title:D.ShortText({displayName:"Title",description:"New title for the work item",required:!1}),description:D.LongText({displayName:"Description",description:"New description for the work item (supports HTML)",required:!1}),state:I.stateDropdown,assigned_to:I.assignedToDropdown,priority:I.priorityDropdown},async run(e){let{project:t,work_item_id:r,title:n,description:i,state:s,assigned_to:u,priority:p}=e.propsValue,m=e.auth,g=I.sanitizeOrgUrl(m.props.organizationUrl),h=encodeURIComponent(t),b=[];if(pr(n)&&b.push({op:"replace",path:"/fields/System.Title",value:n}),pr(i)&&b.push({op:"replace",path:"/fields/System.Description",value:i}),pr(s)&&b.push({op:"replace",path:"/fields/System.State",value:s}),pr(u)&&b.push({op:"replace",path:"/fields/System.AssignedTo",value:u}),p!=null&&b.push({op:"replace",path:"/fields/Microsoft.VSTS.Common.Priority",value:Number(p)}),b.length===0){let c=await I.apiCall({organizationUrl:g,pat:m.props.pat,method:"GET",endpoint:`/${h}/_apis/wit/workitems/${r}`,queryParams:{$expand:"all","api-version":"7.1"}});return I.flattenWorkItem(c)}let _=await I.apiCall({organizationUrl:g,pat:m.props.pat,method:"PATCH",endpoint:`/${h}/_apis/wit/workitems/${r}`,queryParams:{"api-version":"7.1"},body:b,isJsonPatch:!0});return I.flattenWorkItem(_)}});function pr(e){return typeof e=="string"&&e.length>0}o(pr,"isNonEmptyString");var ym="SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @project AND [System.WorkItemType] <> '' ORDER BY [System.ChangedDate] DESC",mu=ie({auth:K,name:"list_work_items",displayName:"List Work Items",description:"Lists work items from Azure DevOps using a WIQL query",audience:"both",aiMetadata:{description:"Queries work items in an Azure DevOps project and returns their fields. Leave the WIQL query empty to list all work items ordered by most recently changed, or supply a custom WIQL query to filter (by type, state, assignee, etc.). Use to search or enumerate work items; requires a project, and results are capped by the limit (default 50, max 200). Read-only and idempotent.",idempotent:!0},props:{project:I.projectDropdown,wiql_query:D.LongText({displayName:"WIQL Query",description:"The WIQL query to execute. Default: SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @project ORDER BY [System.ChangedDate] DESC",required:!1}),limit:D.Number({displayName:"Limit",description:"Maximum number of work items to return (default: 50, max: 200)",required:!1,defaultValue:50})},async run(e){let{project:t,wiql_query:r,limit:n}=e.propsValue,i=e.auth,s=I.sanitizeOrgUrl(i.props.organizationUrl),u=r||ym,p=Math.max(1,Math.min(n??50,200)),m=await I.apiCall({organizationUrl:s,pat:i.props.pat,method:"POST",endpoint:`/${encodeURIComponent(t)}/_apis/wit/wiql`,queryParams:{$top:`${p}`,"api-version":"7.1"},body:{query:u}});if(!m.workItems||m.workItems.length===0)return[];let g=m.workItems.map(b=>b.id);return await I.fetchWorkItemsByIds({organizationUrl:s,pat:i.props.pat,ids:g})}});var fu=ie({auth:K,name:"add_comment",displayName:"Add Comment",description:"Adds a comment to an existing work item in Azure DevOps",audience:"both",aiMetadata:{description:"Posts a new comment (HTML supported) on an existing Azure DevOps work item identified by its numeric ID. Use to add a note or update to a known work item. Requires the project, numeric work item ID, and comment text; not idempotent, as each call appends a separate comment.",idempotent:!1},props:{project:I.projectDropdown,work_item_id:D.Number({displayName:"Work Item ID",description:"Numeric ID of the work item (e.g. 123). To pass it dynamically, reference the ID from a previous step (e.g. `{{trigger.id}}`), not the title.",required:!0}),comment:D.LongText({displayName:"Comment",description:"The comment text to add (supports HTML)",required:!0})},async run(e){let{project:t,work_item_id:r,comment:n}=e.propsValue,i=e.auth,s=I.sanitizeOrgUrl(i.props.organizationUrl),u=await I.apiCall({organizationUrl:s,pat:i.props.pat,method:"POST",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workItems/${r}/comments`,queryParams:{"api-version":"7.1-preview.4"},body:{text:n}});return{id:u.id,work_item_id:u.workItemId,text:u.text??null,created_by:u.createdBy?.displayName??null,created_by_email:u.createdBy?.uniqueName??null,created_date:u.createdDate??null,modified_by:u.modifiedBy?.displayName??null,modified_date:u.modifiedDate??null}}});var hm={project:I.projectDropdown,work_item_type:I.workItemTypeDropdownOptional,state_filter:I.stateDropdownOptional},vm=14,lr={strategy:0,items:o(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let n=I.sanitizeOrgUrl(e.props.organizationUrl),{project:i,work_item_type:s,state_filter:u}=t,p=I.narrowString(i,"project"),m=r&&r>0?r+1:Date.now()-vm*24*60*60*1e3,g=new Date(m).toISOString().slice(0,10),b=`SELECT [System.Id], [System.ChangedDate] FROM WorkItems WHERE [System.TeamProject] = '${I.escapeWiqlString(p)}' AND [System.ChangedDate] >= '${g}'`;if(s){let y=I.escapeWiqlString(I.narrowString(s,"work_item_type"));b+=` AND [System.WorkItemType] = '${y}'`}if(u){let y=I.escapeWiqlString(I.narrowString(u,"state_filter"));b+=` AND [System.State] = '${y}'`}b+=" ORDER BY [System.ChangedDate] DESC";let _=await I.apiCall({organizationUrl:n,pat:e.props.pat,method:"POST",endpoint:`/${encodeURIComponent(p)}/_apis/wit/wiql`,queryParams:{$top:"200","api-version":"7.1"},body:{query:b}});if(!_.workItems||_.workItems.length===0)return[];let c=_.workItems.map(y=>y.id);return(await I.fetchWorkItemsByIds({organizationUrl:n,pat:e.props.pat,ids:c})).map(y=>({epochMilliSeconds:y.changed_date?new Date(y.changed_date).getTime():Date.now(),data:y}))},"items")},xm={id:123,rev:1,url:"https://dev.azure.com/myorg/myproject/_apis/wit/workItems/123",title:"Fix login page bug",work_item_type:"Bug",state:"Active",reason:"New",assigned_to:"John Doe",assigned_to_email:"john.doe@example.com",created_date:"2024-03-15T10:30:00Z",created_by:"Jane Smith",changed_date:"2024-03-15T14:45:00Z",changed_by:"John Doe",area_path:"MyProject\\Backend",iteration_path:"MyProject\\Sprint 5",priority:2,description:"<p>Users cannot log in after password reset.</p>",project:"MyProject"},gu=Jt({auth:K,name:"new_updated_work_item",displayName:"New or Updated Work Item (Polling)",description:"Polls Azure DevOps every few minutes and fires when a work item is created or updated. Use this when your Activepieces instance is not reachable from the public internet; otherwise prefer the Instant trigger. Pick a work item type to unlock the state filter.",aiMetadata:{description:"Fires for each Azure DevOps work item created or changed since the last poll in the chosen project, discovered by periodic polling rather than instantly. Optionally narrow to a single work item type and, once a type is set, to a specific state. Prefer the Instant trigger when the Activepieces instance is publicly reachable."},props:hm,sampleData:xm,type:"POLLING",async test(e){return await Tt.test(lr,e)},async onEnable(e){await Tt.onEnable(lr,e)},async onDisable(e){await Tt.onDisable(lr,e)},async run(e){return await Tt.poll(lr,e)}});var _n="azure_devops_workitem_subscription_ids",Pn="azure_devops_workitem_webhook_token",yu="activepieces",hu={id:123,rev:2,url:"https://dev.azure.com/myorg/_apis/wit/workItems/123",title:"Fix login page bug",work_item_type:"Bug",state:"Active",reason:"New",assigned_to:"John Doe",assigned_to_email:"john.doe@example.com",created_date:"2024-03-15T10:30:00Z",created_by:"Jane Smith",changed_date:"2024-03-15T14:45:00Z",changed_by:"John Doe",area_path:"MyProject\\Backend",iteration_path:"MyProject\\Sprint 5",priority:2,description:"<p>Users cannot log in after password reset.</p>",project:"MyProject"},vu=Jt({auth:K,name:"new_updated_work_item_webhook",displayName:"New or Updated Work Item (Instant)",description:"Fires instantly when a work item is created, updated, or commented on in Azure DevOps via a Service Hooks subscription. Requires a public webhook URL reachable from Azure DevOps.",aiMetadata:{description:"Fires in real time via an Azure DevOps Service Hooks subscription when a work item in the chosen project is created, updated, or commented on, depending on which of those event types are selected. Optionally scope to a single work item type. Requires a publicly reachable webhook URL; use the Polling trigger instead when the instance is not internet-reachable."},props:{project:I.projectDropdown,work_item_type:I.workItemTypeDropdownOptional,events:D.StaticMultiSelectDropdown({displayName:"Events",description:"Which work item lifecycle events should trigger this flow. Select at least one.",required:!0,defaultValue:["workitem.created","workitem.updated"],options:{options:[...xn]}})},sampleData:hu,type:"WEBHOOK",async onEnable(e){let t=I.narrowString(e.propsValue.project,"project"),r=typeof e.propsValue.work_item_type=="string"&&e.propsValue.work_item_type.length>0?e.propsValue.work_item_type:void 0,n=Im(e.propsValue.events??[]),i=await I.fetchProjectId(e.auth,t);if(!i)throw new Error(`Project "${t}" not found in Azure DevOps.`);let s=I.generateWebhookToken();await e.store.put(Pn,s);let u=[];for(let p of n){let m=await I.createSubscription({auth:e.auth,projectId:i,eventType:p,webhookUrl:e.webhookUrl,workItemType:r,basicAuthUsername:yu,basicAuthPassword:s});u.push(m.id),await e.store.put(_n,u)}},async onDisable(e){let t=await e.store.get(_n)??[];for(let r of t)try{await I.deleteSubscription({auth:e.auth,subscriptionId:r})}catch{}await e.store.delete(_n),await e.store.delete(Pn)},async run(e){let t=await e.store.get(Pn);if(!t)return[];let r=Pm(e.payload.headers);if(!r||!bm(r,yu,t))return[];let n=I.parseWebhookPayload(e.payload.body);return n?n.eventType==="workitem.commented"?[_m(n)]:[xu(n.resource)]:[]},async test(){return[hu]}});function xu(e){return I.flattenWorkItem({id:e.id??e.workItemId??0,rev:e.rev??0,url:e.url,fields:e.revision?.fields??e.fields??{}})}o(xu,"flattenResource");function _m(e){let{resource:t}=e;return{...xu(t),comment:t.revision?.comment?.content??null}}o(_m,"flattenCommentEvent");function Pm(e){let t=e.authorization??e.Authorization;return typeof t=="string"?t:null}o(Pm,"extractAuthHeader");function bm(e,t,r){let n="Basic ";if(!e.startsWith(n))return!1;let i;try{i=Buffer.from(e.slice(n.length),"base64").toString("utf-8")}catch{return!1}let s=i.indexOf(":");if(s<0)return!1;let u=i.slice(0,s),p=i.slice(s+1);return I.timingSafeEqual(u,t)&&I.timingSafeEqual(p,r)}o(bm,"verifyBasicAuth");function Im(e){let t=xn.map(r=>r.value);return e.filter(r=>typeof r=="string"&&t.includes(r))}o(Im,"filterToHookEvents");var Tm=ji({displayName:"Azure DevOps",description:"Track work, code, and ship software with Azure Boards, Repos, and Pipelines.",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/azure-devops.png",categories:["DEVELOPER_TOOLS"],auth:K,authors:["majewskibartosz"],actions:[pu,lu,du,mu,fu,tu({baseUrl:o(e=>I.sanitizeOrgUrl(I.asAuth(e).props.organizationUrl),"baseUrl"),auth:K,authMapping:o(async e=>({Authorization:`Basic ${Buffer.from(`:${I.asAuth(e).props.pat}`).toString("base64")}`}),"authMapping")})],triggers:[vu,gu]});0&&(module.exports={azureDevOps});
15
+ /*! Bundled license information:
16
+
17
+ mime-types/index.js:
18
+ (*!
19
+ * mime-types
20
+ * Copyright(c) 2014 Jonathan Ong
21
+ * Copyright(c) 2015 Douglas Christopher Wilson
22
+ * MIT Licensed
23
+ *)
24
+ */
package/src/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export declare const azureDevOps: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- }>>;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,WAAW;;;GA4BtB,CAAC"}
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,+DAAwE;AACxE,iDAAqD;AACrD,qEAAsE;AACtE,+DAAgE;AAChE,qEAAsE;AACtE,mEAAoE;AACpE,2DAA6D;AAC7D,gFAAiF;AACjF,gGAAgG;AAChG,yCAAkE;AAErD,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC;IACrC,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,8EAA8E;IAC3F,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,sDAAsD;IAC/D,UAAU,EAAE,CAAC,sBAAa,CAAC,eAAe,CAAC;IAC3C,IAAI,EAAE,wBAAe;IACrB,OAAO,EAAE,CAAC,iBAAiB,CAAC;IAC5B,OAAO,EAAE;QACP,uCAAoB;QACpB,iCAAiB;QACjB,uCAAoB;QACpB,qCAAmB;QACnB,8BAAgB;QAChB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAChB,0BAAiB,CAAC,cAAc,CAC9B,0BAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,eAAe,CACrD;YACH,IAAI,EAAE,wBAAe;YACrB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CACjC,IAAI,0BAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAC/C,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;iBACvB,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,gEAAgC,EAAE,iDAAyB,CAAC;CACxE,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- export declare const addCommentAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- }>, {
5
- project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
- organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
- pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
- }>>;
9
- work_item_id: import("@activepieces/pieces-framework").NumberProperty<true>;
10
- comment: import("@activepieces/pieces-framework").LongTextProperty<true>;
11
- }>;
12
- //# sourceMappingURL=add-comment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-comment.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-comment.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;;;;EAiD3B,CAAC"}
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addCommentAction = 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 common_1 = require("../common");
8
- const common_2 = require("../common");
9
- exports.addCommentAction = (0, pieces_framework_1.createAction)({
10
- auth: common_1.azureDevOpsAuth,
11
- name: 'add_comment',
12
- displayName: 'Add Comment',
13
- description: 'Adds a comment to an existing work item in Azure DevOps',
14
- audience: 'both',
15
- aiMetadata: { description: 'Posts a new comment (HTML supported) on an existing Azure DevOps work item identified by its numeric ID. Use to add a note or update to a known work item. Requires the project, numeric work item ID, and comment text; not idempotent, as each call appends a separate comment.', idempotent: false },
16
- props: {
17
- project: common_2.azureDevOpsCommon.projectDropdown,
18
- work_item_id: pieces_framework_1.Property.Number({
19
- displayName: 'Work Item ID',
20
- description: 'Numeric ID of the work item (e.g. 123). To pass it dynamically, reference the ID from a previous step (e.g. `{{trigger.id}}`), not the title.',
21
- required: true,
22
- }),
23
- comment: pieces_framework_1.Property.LongText({
24
- displayName: 'Comment',
25
- description: 'The comment text to add (supports HTML)',
26
- required: true,
27
- }),
28
- },
29
- run(context) {
30
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
32
- const { project, work_item_id, comment } = context.propsValue;
33
- const auth = context.auth;
34
- const orgUrl = common_2.azureDevOpsCommon.sanitizeOrgUrl(auth.props.organizationUrl);
35
- const response = yield common_2.azureDevOpsCommon.apiCall({
36
- organizationUrl: orgUrl,
37
- pat: auth.props.pat,
38
- method: pieces_common_1.HttpMethod.POST,
39
- endpoint: `/${encodeURIComponent(project)}/_apis/wit/workItems/${work_item_id}/comments`,
40
- // Work-item comments remain in preview on REST 7.1; the stable 7.1
41
- // endpoint does not exist. See
42
- // https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/comments
43
- queryParams: { 'api-version': '7.1-preview.4' },
44
- body: { text: comment },
45
- });
46
- return {
47
- id: response.id,
48
- work_item_id: response.workItemId,
49
- text: (_a = response.text) !== null && _a !== void 0 ? _a : null,
50
- created_by: (_c = (_b = response.createdBy) === null || _b === void 0 ? void 0 : _b.displayName) !== null && _c !== void 0 ? _c : null,
51
- created_by_email: (_e = (_d = response.createdBy) === null || _d === void 0 ? void 0 : _d.uniqueName) !== null && _e !== void 0 ? _e : null,
52
- created_date: (_f = response.createdDate) !== null && _f !== void 0 ? _f : null,
53
- modified_by: (_h = (_g = response.modifiedBy) === null || _g === void 0 ? void 0 : _g.displayName) !== null && _h !== void 0 ? _h : null,
54
- modified_date: (_j = response.modifiedDate) !== null && _j !== void 0 ? _j : null,
55
- };
56
- });
57
- },
58
- });
59
- //# sourceMappingURL=add-comment.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-comment.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-comment.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAA4C;AAC5C,sCAA2D;AAE9C,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,wBAAe;IACrB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,yDAAyD;IACtE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,mRAAmR,EAAE,UAAU,EAAE,KAAK,EAAE;IACnU,KAAK,EAAE;QACL,OAAO,EAAE,0BAAiB,CAAC,eAAe;QAC1C,YAAY,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC5B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,+IAA+I;YACjJ,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAC1B,MAAM,MAAM,GAAG,0BAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAE5E,MAAM,QAAQ,GAAG,MAAM,0BAAiB,CAAC,OAAO,CAAkB;gBAChE,eAAe,EAAE,MAAM;gBACvB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG;gBACnB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,QAAQ,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,wBAAwB,YAAY,WAAW;gBACxF,mEAAmE;gBACnE,+BAA+B;gBAC/B,uEAAuE;gBACvE,WAAW,EAAE,EAAE,aAAa,EAAE,eAAe,EAAE;gBAC/C,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;aACxB,CAAC,CAAC;YAEH,OAAO;gBACL,EAAE,EAAE,QAAQ,CAAC,EAAE;gBACf,YAAY,EAAE,QAAQ,CAAC,UAAU;gBACjC,IAAI,EAAE,MAAA,QAAQ,CAAC,IAAI,mCAAI,IAAI;gBAC3B,UAAU,EAAE,MAAA,MAAA,QAAQ,CAAC,SAAS,0CAAE,WAAW,mCAAI,IAAI;gBACnD,gBAAgB,EAAE,MAAA,MAAA,QAAQ,CAAC,SAAS,0CAAE,UAAU,mCAAI,IAAI;gBACxD,YAAY,EAAE,MAAA,QAAQ,CAAC,WAAW,mCAAI,IAAI;gBAC1C,WAAW,EAAE,MAAA,MAAA,QAAQ,CAAC,UAAU,0CAAE,WAAW,mCAAI,IAAI;gBACrD,aAAa,EAAE,MAAA,QAAQ,CAAC,YAAY,mCAAI,IAAI;aAC7C,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,27 +0,0 @@
1
- export declare const createWorkItemAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- }>, {
5
- project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
- organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
- pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
- }>>;
9
- work_item_type: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
10
- organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
12
- }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
13
- organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
- pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
15
- }>>;
16
- title: import("@activepieces/pieces-framework").ShortTextProperty<true>;
17
- description: import("@activepieces/pieces-framework").LongTextProperty<false>;
18
- assigned_to: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
19
- organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
20
- pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
21
- }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
22
- organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
23
- pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
24
- }>>;
25
- priority: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
26
- }>;
27
- //# sourceMappingURL=create-work-item.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-work-item.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-work-item.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;EAqE/B,CAAC"}