@activepieces/piece-azure-devops 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.4",
4
4
  "main": "./src/index.js",
5
- "types": "./src/index.d.ts",
6
- "scripts": {
7
- "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
8
- "lint": "eslint 'src/**/*.ts'"
9
- },
10
- "dependencies": {
11
- "@activepieces/pieces-common": "0.12.3",
12
- "@activepieces/pieces-framework": "0.30.0",
13
- "@activepieces/shared": "0.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 su=Object.create;var Je=Object.defineProperty;var uu=Object.getOwnPropertyDescriptor;var cu=Object.getOwnPropertyNames;var pu=Object.getPrototypeOf,lu=Object.prototype.hasOwnProperty;var o=(e,t)=>Je(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bn=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:!0})},In=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cu(t))!lu.call(e,i)&&i!==r&&Je(e,i,{get:()=>t[i],enumerable:!(n=uu(t,i))||n.enumerable});return e};var Re=(e,t,r)=>(r=e!=null?su(pu(e)):{},In(t||!e||!e.__esModule?Je(r,"default",{value:e,enumerable:!0}):r,e)),du=e=>In(Je({},"__esModule",{value:!0}),e);var Fo=S((Lo,Zt)=>{(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,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function m(u,d){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let y=0,f=-1,_=(u.match(p.zoneIndex)||[])[0],P,L;for(_&&(_=_.substring(1),u=u.replace(/%.+$/,""));(f=u.indexOf(":",f+1))>=0;)y++;if(u.substr(0,2)==="::"&&y--,u.substr(-2,2)==="::"&&y--,y>d)return null;for(L=d-y,P=":";L--;)P+="0:";return u=u.replace("::",P),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),d=function(){let re=u.split(":"),se=[];for(let Ke=0;Ke<re.length;Ke++)se.push(parseInt(re[Ke],16));return se}(),{parts:d,zoneId:_}}o(m,"expandIPv6");function g(u,d,y,f){if(u.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let _=0,P;for(;f>0;){if(P=y-f,P<0&&(P=0),u[_]>>P!==d[_]>>P)return!1;f-=y,_+=1}return!0}o(g,"matchCIDR");function h(u){if(i.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}o(h,"parseIntAuto");function b(u,d){for(;u.length<d;)u=`0${u}`;return u}o(b,"padPart");let x={};x.IPv4=function(){function u(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(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(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)},u.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},_,P,L;for(_=3;_>=0;_-=1)if(P=this.octets[_],P in f){if(L=f[P],y&&L!==0)return null;L!==8&&(y=!0),d+=L}else return null;return 32-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u}(),x.IPv4.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<4;)_.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(u){return this.parser(u)!==null},x.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(u){return!!(x.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(u){let d=u.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(u)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(u){let d,y,f,_,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],y=0;y<4;)_.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(u){let d=this.parser(u);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(u){let d;if(d=u.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")},x.IPv4.parser=function(u){let d,y,f;if(d=u.match(r.fourOctet))return function(){let _=d.slice(1,6),P=[];for(let L=0;L<_.length;L++)y=_[L],P.push(h(y));return P}();if(d=u.match(r.longValue)){if(f=h(d[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return function(){let _=[],P;for(P=0;P<=24;P+=8)_.push(f>>P&255);return _}().reverse()}else return(d=u.match(r.twoOctet))?function(){let _=d.slice(1,4),P=[];if(f=h(_[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(_[0])),P.push(f>>16&255),P.push(f>>8&255),P.push(f&255),P}():(d=u.match(r.threeOctet))?function(){let _=d.slice(1,5),P=[];if(f=h(_[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(_[0])),P.push(h(_[1])),P.push(f>>8&255),P.push(f&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<4&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.IPv6=function(){function u(d,y){let f,_;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(_=this.parts[f],!(0<=_&&_<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(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)},u.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},_,P;for(let L=7;L>=0;L-=1)if(_=this.parts[L],_ in f){if(P=f[_],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let d,y=[],f=this.parts;for(let _=0;_<f.length;_++)d=f[_],y.push(d>>8),y.push(d&255);return y},u.prototype.toFixedLengthString=function(){let d=function(){let f=[];for(let _=0;_<this.parts.length;_++)f.push(b(this.parts[_].toString(16),4));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.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 x.IPv4([y>>8,y&255,f>>8,f&255])},u.prototype.toNormalizedString=function(){let d=function(){let f=[];for(let _=0;_<this.parts.length;_++)f.push(this.parts[_].toString(16));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,_=-1,P;for(;P=d.exec(y);)P[0].length>_&&(f=P.index,_=P[0].length);return _<0?y:`${y.substring(0,f)}::${y.substring(f+_)}`},u.prototype.toString=function(){return this.toRFC5952String()},u}(),x.IPv6.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<16;)_.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(_)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(u){return this.parser(u)!==null},x.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let d=this.parser(u);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(u){let d,y,f,_,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],y=0;y<16;)_.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(_)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},x.IPv6.parse=function(u){let d=this.parser(u);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(u){let d,y,f;if((y=u.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")},x.IPv6.parser=function(u){let d,y,f,_,P,L;if(f=u.match(p.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(p.native.test(u))return m(u,8);if((f=u.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(_=P[y],!(0<=_&&_<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>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(u/8);for(;y<f;)d[y]=255,y++;return f<16&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.fromByteArray=function(u){let d=u.length;if(d===4)return new x.IPv4(u);if(d===16)return new x.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(u){return x.IPv6.isValid(u)||x.IPv4.isValid(u)},x.isValidCIDR=function(u){return x.IPv6.isValidCIDR(u)||x.IPv4.isValidCIDR(u)},x.parse=function(u){if(x.IPv6.isValid(u))return x.IPv6.parse(u);if(x.IPv4.isValid(u))return x.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(u){try{return x.IPv6.parseCIDR(u)}catch{try{return x.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(u){let d=this.parse(u);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(u,d,y){let f,_,P,L;y==null&&(y="unicast");for(_ in d)if(Object.prototype.hasOwnProperty.call(d,_)){for(P=d[_],P[0]&&!(P[0]instanceof Array)&&(P=[P]),f=0;f<P.length;f++)if(L=P[f],u.kind()===L[0].kind()&&u.match.apply(u,L))return _}return y},typeof Zt<"u"&&Zt.exports?Zt.exports=x:e.ipaddr=x})(Lo)});var Ui=S((NA,Ci)=>{var Ni=require("stream").Stream,Fp=require("util");Ci.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");Fp.inherits(ce,Ni);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=Ni.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 Fi=S((UA,Li)=>{var Bp=require("util"),ji=require("stream").Stream,Mi=Ui();Li.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");Bp.inherits(G,ji);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 Mi)){var r=Mi.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 ji.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 Vi=S((jA,Bi)=>{"use strict";Bi.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 Hi=S(te=>{"use strict";var Yt=Vi(),Vp=require("path").extname,Zi=/^\s*([^;\s]*)(?:;|\s|$)/,Zp=/^text\//i;te.charset=Wi;te.charsets={lookup:Wi};te.contentType=Wp;te.extension=Hp;te.extensions=Object.create(null);te.lookup=qp;te.types=Object.create(null);Gp(te.extensions,te.types);function Wi(e){if(!e||typeof e!="string")return!1;var t=Zi.exec(e),r=t&&Yt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Zp.test(t[1])?"UTF-8":!1}o(Wi,"charset");function Wp(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(Wp,"contentType");function Hp(e){if(!e||typeof e!="string")return!1;var t=Zi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Hp,"extension");function qp(e){if(!e||typeof e!="string")return!1;var t=Vp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(qp,"lookup");function Gp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Yt).forEach(o(function(i){var s=Yt[i],c=s.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var m=c[p];if(t[m]){var g=r.indexOf(Yt[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(Gp,"populateMaps")});var Gi=S((BA,qi)=>{qi.exports=Kp;function Kp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Kp,"defer")});var Gr=S((ZA,Ji)=>{var Ki=Gi();Ji.exports=Jp;function Jp(e){var t=!1;return Ki(function(){t=!0}),o(function(n,i){t?e(n,i):Ki(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Jp,"async")});var Kr=S((HA,Xi)=>{Xi.exports=Xp;function Xp(e){Object.keys(e.jobs).forEach(Yp.bind(e)),e.jobs={}}o(Xp,"abort");function Yp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Yp,"clean")});var Jr=S((GA,Qi)=>{var Yi=Gr(),Qp=Kr();Qi.exports=el;function el(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=tl(t,i,e[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?Qp(r):r.results[i]=c,n(s,r.results))})}o(el,"iterate");function tl(e,t,r,n){var i;return e.length==2?i=e(r,Yi(n)):i=e(r,t,Yi(n)),i}o(tl,"runJob")});var Xr=S((JA,ea)=>{ea.exports=rl;function rl(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(rl,"state")});var Yr=S((YA,ta)=>{var nl=Kr(),ol=Gr();ta.exports=il;function il(e){Object.keys(this.jobs).length&&(this.index=this.size,nl(this),ol(e)(null,this.results))}o(il,"terminator")});var na=S((ez,ra)=>{var al=Jr(),sl=Xr(),ul=Yr();ra.exports=cl;function cl(e,t,r){for(var n=sl(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 ul.bind(n,r)}o(cl,"parallel")});var Qr=S((rz,Qt)=>{var oa=Jr(),pl=Xr(),ll=Yr();Qt.exports=dl;Qt.exports.ascending=ia;Qt.exports.descending=ml;function dl(e,t,r,n){var i=pl(e,r);return oa(e,t,i,o(function s(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){oa(e,t,i,s);return}n(null,i.results)},"iteratorHandler")),ll.bind(i,n)}o(dl,"serialOrdered");function ia(e,t){return e<t?-1:e>t?1:0}o(ia,"ascending");function ml(e,t){return-1*ia(e,t)}o(ml,"descending")});var sa=S((oz,aa)=>{var fl=Qr();aa.exports=gl;function gl(e,t,r){return fl(e,t,null,r)}o(gl,"serial")});var ca=S((az,ua)=>{ua.exports={parallel:na(),serial:sa(),serialOrdered:Qr()}});var en=S((sz,pa)=>{"use strict";pa.exports=Object});var da=S((uz,la)=>{"use strict";la.exports=Error});var fa=S((cz,ma)=>{"use strict";ma.exports=EvalError});var ya=S((pz,ga)=>{"use strict";ga.exports=RangeError});var va=S((lz,ha)=>{"use strict";ha.exports=ReferenceError});var _a=S((dz,xa)=>{"use strict";xa.exports=SyntaxError});var er=S((mz,Pa)=>{"use strict";Pa.exports=TypeError});var Ia=S((fz,ba)=>{"use strict";ba.exports=URIError});var Ea=S((gz,Ta)=>{"use strict";Ta.exports=Math.abs});var $a=S((yz,Sa)=>{"use strict";Sa.exports=Math.floor});var za=S((hz,Aa)=>{"use strict";Aa.exports=Math.max});var wa=S((vz,ka)=>{"use strict";ka.exports=Math.min});var Ra=S((xz,Oa)=>{"use strict";Oa.exports=Math.pow});var Na=S((_z,Da)=>{"use strict";Da.exports=Math.round});var Ua=S((Pz,Ca)=>{"use strict";Ca.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ja=S((Iz,Ma)=>{"use strict";var yl=Ua();Ma.exports=o(function(t){return yl(t)||t===0?t:t<0?-1:1},"sign")});var Fa=S((Ez,La)=>{"use strict";La.exports=Object.getOwnPropertyDescriptor});var tn=S((Sz,Ba)=>{"use strict";var tr=Fa();if(tr)try{tr([],"length")}catch{tr=null}Ba.exports=tr});var Za=S(($z,Va)=>{"use strict";var rr=Object.defineProperty||!1;if(rr)try{rr({},"a",{value:1})}catch{rr=!1}Va.exports=rr});var rn=S((Az,Wa)=>{"use strict";Wa.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 c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ga=S((kz,qa)=>{"use strict";var Ha=typeof Symbol<"u"&&Symbol,hl=rn();qa.exports=o(function(){return typeof Ha!="function"||typeof Symbol!="function"||typeof Ha("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hl()},"hasNativeSymbols")});var nn=S((Oz,Ka)=>{"use strict";Ka.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var on=S((Rz,Ja)=>{"use strict";var vl=en();Ja.exports=vl.getPrototypeOf||null});var Qa=S((Dz,Ya)=>{"use strict";var xl="Function.prototype.bind called on incompatible ",_l=Object.prototype.toString,Pl=Math.max,bl="[object Function]",Xa=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"),Il=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"),Tl=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");Ya.exports=o(function(t){var r=this;if(typeof r!="function"||_l.apply(r)!==bl)throw new TypeError(xl+r);for(var n=Il(arguments,1),i,s=o(function(){if(this instanceof i){var h=r.apply(this,Xa(n,arguments));return Object(h)===h?h:this}return r.apply(t,Xa(n,arguments))},"binder"),c=Pl(0,r.length-n.length),p=[],m=0;m<c;m++)p[m]="$"+m;if(i=Function("binder","return function ("+Tl(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 Ze=S((Cz,es)=>{"use strict";var El=Qa();es.exports=Function.prototype.bind||El});var nr=S((Uz,ts)=>{"use strict";ts.exports=Function.prototype.call});var an=S((Mz,rs)=>{"use strict";rs.exports=Function.prototype.apply});var os=S((jz,ns)=>{"use strict";ns.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var as=S((Lz,is)=>{"use strict";var Sl=Ze(),$l=an(),Al=nr(),zl=os();is.exports=zl||Sl.call(Al,$l)});var us=S((Fz,ss)=>{"use strict";var kl=Ze(),wl=er(),Ol=nr(),Rl=as();ss.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new wl("a function is required");return Rl(kl,Ol,t)},"callBindBasic")});var fs=S((Vz,ms)=>{"use strict";var Dl=us(),cs=tn(),ls;try{ls=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var sn=!!ls&&cs&&cs(Object.prototype,"__proto__"),ds=Object,ps=ds.getPrototypeOf;ms.exports=sn&&typeof sn.get=="function"?Dl([sn.get]):typeof ps=="function"?o(function(t){return ps(t==null?t:ds(t))},"getDunder"):!1});var xs=S((Wz,vs)=>{"use strict";var gs=nn(),ys=on(),hs=fs();vs.exports=gs?o(function(t){return gs(t)},"getProto"):ys?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ys(t)},"getProto"):hs?o(function(t){return hs(t)},"getProto"):null});var un=S((qz,_s)=>{"use strict";var Nl=Function.prototype.call,Cl=Object.prototype.hasOwnProperty,Ul=Ze();_s.exports=Ul.call(Nl,Cl)});var $s=S((Gz,Ss)=>{"use strict";var j,Ml=en(),jl=da(),Ll=fa(),Fl=ya(),Bl=va(),Ge=_a(),qe=er(),Vl=Ia(),Zl=Ea(),Wl=$a(),Hl=za(),ql=wa(),Gl=Ra(),Kl=Na(),Jl=ja(),Ts=Function,cn=o(function(e){try{return Ts('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),xt=tn(),Xl=Za(),pn=o(function(){throw new qe},"throwTypeError"),Yl=xt?function(){try{return arguments.callee,pn}catch{try{return xt(arguments,"callee").get}catch{return pn}}}():pn,We=Ga()(),Y=xs(),Ql=on(),ed=nn(),Es=an(),_t=nr(),He={},td=typeof Uint8Array>"u"||!Y?j:Y(Uint8Array),Oe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?j:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?j:ArrayBuffer,"%ArrayIteratorPrototype%":We&&Y?Y([][Symbol.iterator]()):j,"%AsyncFromSyncIteratorPrototype%":j,"%AsyncFunction%":He,"%AsyncGenerator%":He,"%AsyncGeneratorFunction%":He,"%AsyncIteratorPrototype%":He,"%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%":jl,"%eval%":eval,"%EvalError%":Ll,"%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%":Ts,"%GeneratorFunction%":He,"%Int8Array%":typeof Int8Array>"u"?j:Int8Array,"%Int16Array%":typeof Int16Array>"u"?j:Int16Array,"%Int32Array%":typeof Int32Array>"u"?j:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":We&&Y?Y(Y([][Symbol.iterator]())):j,"%JSON%":typeof JSON=="object"?JSON:j,"%Map%":typeof Map>"u"?j:Map,"%MapIteratorPrototype%":typeof Map>"u"||!We||!Y?j:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ml,"%Object.getOwnPropertyDescriptor%":xt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?j:Promise,"%Proxy%":typeof Proxy>"u"?j:Proxy,"%RangeError%":Fl,"%ReferenceError%":Bl,"%Reflect%":typeof Reflect>"u"?j:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?j:Set,"%SetIteratorPrototype%":typeof Set>"u"||!We||!Y?j:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?j:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":We&&Y?Y(""[Symbol.iterator]()):j,"%Symbol%":We?Symbol:j,"%SyntaxError%":Ge,"%ThrowTypeError%":Yl,"%TypedArray%":td,"%TypeError%":qe,"%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%":Vl,"%WeakMap%":typeof WeakMap>"u"?j:WeakMap,"%WeakRef%":typeof WeakRef>"u"?j:WeakRef,"%WeakSet%":typeof WeakSet>"u"?j:WeakSet,"%Function.prototype.call%":_t,"%Function.prototype.apply%":Es,"%Object.defineProperty%":Xl,"%Object.getPrototypeOf%":Ql,"%Math.abs%":Zl,"%Math.floor%":Wl,"%Math.max%":Hl,"%Math.min%":ql,"%Math.pow%":Gl,"%Math.round%":Kl,"%Math.sign%":Jl,"%Reflect.getPrototypeOf%":ed};if(Y)try{null.error}catch(e){Ps=Y(Y(e)),Oe["%Error.prototype%"]=Ps}var Ps,rd=o(function e(t){var r;if(t==="%AsyncFunction%")r=cn("async function () {}");else if(t==="%GeneratorFunction%")r=cn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=cn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Y&&(r=Y(i.prototype))}return Oe[t]=r,r},"doEval"),bs={__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"]},Pt=Ze(),or=un(),nd=Pt.call(_t,Array.prototype.concat),od=Pt.call(Es,Array.prototype.splice),Is=Pt.call(_t,String.prototype.replace),ir=Pt.call(_t,String.prototype.slice),id=Pt.call(_t,RegExp.prototype.exec),ad=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,sd=/\\(\\)?/g,ud=o(function(t){var r=ir(t,0,1),n=ir(t,-1);if(r==="%"&&n!=="%")throw new Ge("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ge("invalid intrinsic syntax, expected opening `%`");var i=[];return Is(t,ad,function(s,c,p,m){i[i.length]=p?Is(m,sd,"$1"):c||s}),i},"stringToPath"),cd=o(function(t,r){var n=t,i;if(or(bs,n)&&(i=bs[n],n="%"+i[0]+"%"),or(Oe,n)){var s=Oe[n];if(s===He&&(s=rd(n)),typeof s>"u"&&!r)throw new qe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Ge("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ss.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new qe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qe('"allowMissing" argument must be a boolean');if(id(/^%?[^%]*%?$/,t)===null)throw new Ge("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ud(t),i=n.length>0?n[0]:"",s=cd("%"+i+"%",r),c=s.name,p=s.value,m=!1,g=s.alias;g&&(i=g[0],od(n,nd([0,1],g)));for(var h=1,b=!0;h<n.length;h+=1){var x=n[h],u=ir(x,0,1),d=ir(x,-1);if((u==='"'||u==="'"||u==="`"||d==='"'||d==="'"||d==="`")&&u!==d)throw new Ge("property names with quotes must have matching quotes");if((x==="constructor"||!b)&&(m=!0),i+="."+x,c="%"+i+"%",or(Oe,c))p=Oe[c];else if(p!=null){if(!(x in p)){if(!r)throw new qe("base intrinsic for "+t+" exists, but the property is not available.");return}if(xt&&h+1>=n.length){var y=xt(p,x);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[x]}else b=or(p,x),p=p[x];b&&!m&&(Oe[c]=p)}}return p},"GetIntrinsic")});var zs=S((Jz,As)=>{"use strict";var pd=rn();As.exports=o(function(){return pd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Os=S((Yz,ws)=>{"use strict";var ld=$s(),ks=ld("%Object.defineProperty%",!0),dd=zs()(),md=un(),fd=er(),ar=dd?Symbol.toStringTag:null;ws.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new fd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ar&&(n||!md(t,ar))&&(ks?ks(t,ar,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ar]=r)},"setToStringTag")});var Ds=S((ek,Rs)=>{"use strict";var gd=Function.prototype.call,yd=Object.prototype.hasOwnProperty,hd=Ze();Rs.exports=hd.call(gd,yd)});var Cs=S((tk,Ns)=>{"use strict";Ns.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var js=S((rk,Ms)=>{"use strict";var fn=Fi(),vd=require("util"),ln=require("path"),xd=require("http"),_d=require("https"),Pd=require("url").parse,bd=require("fs"),Id=require("stream").Stream,Td=require("crypto"),dn=Hi(),Ed=ca(),Sd=Os(),$e=Ds(),mn=Cs();function Us(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Us,"escapeHeaderParam");function F(e){if(!(this instanceof F))return new F(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(F,"FormData");vd.inherits(F,fn);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=fn.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&&$e(t,"httpVersion"))&&!(t instanceof Id))&&(r.knownLength||this._valuesToMeasure.push(t))};F.prototype._lengthRetriever=function(e,t){$e(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):bd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):$e(e,"httpVersion")?t(null,Number(e.headers["content-length"])):$e(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="",c={"Content-Disposition":["form-data",'name="'+Us(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&mn(c,r.header);var p;for(var m in c)if($e(c,m)){if(p=c[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=ln.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=ln.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&$e(e,"httpVersion")&&(r=ln.basename(e.client._httpMessage.path||"")),r)return'filename="'+Us(r)+'"'};F.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=dn.lookup(e.name)),!r&&e&&e.path&&(r=dn.lookup(e.path)),!r&&e&&e.readable&&$e(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=dn.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)$e(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="--------------------------"+Td.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}Ed.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=Pd(e),n=mn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=mn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=_d.request(n):r=xd.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var 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]"};Sd(F.prototype,"FormData");Ms.exports=F});var om={};bn(om,{azureDevOps:()=>nm});module.exports=du(om);var mu=Object.freeze({status:"aborted"});function T(e,t,r){function n(p,m){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,m);let g=c.prototype,h=Object.keys(g);for(let b=0;b<h.length;b++){let x=h[b];x in p||(p[x]=g[x].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 c(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(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var fu=Symbol("zod_brand"),pe=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},St=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},pr={};function fe(e){return e&&Object.assign(pr,e),pr}o(fe,"config");function dr(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(dr,"getEnumValues");function En(e,t){return typeof t=="bigint"?t.toString():t}o(En,"jsonStringifyReplacer");function At(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(At,"cached");function Sn(e){return e==null}o(Sn,"nullish");function zt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(zt,"cleanRegex");var Tn=Symbol("evaluating");function J(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Tn)return n===void 0&&(n=Tn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(J,"defineLazy");var mr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Xe,"isObject");var gu=At(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function $n(e){if(Xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o($n,"isPlainObject");var An=new Set(["string","number","symbol"]);function De(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(De,"escapeRegex");function kt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(kt,"clone");function W(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(W,"normalizeParams");function zn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(zn,"optionalKeys");var yu={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 Ne(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(Ne,"aborted");function Pe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Pe,"prefixIssues");function $t(e){return typeof e=="string"?e:e?.message}o($t,"unwrapMessage");function be(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=$t(e.inst?._zod.def?.error?.(e))??$t(t?.error?.(e))??$t(r.customError?.(e))??$t(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(be,"finalizeIssue");function kn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(kn,"getLengthableOrigin");function fr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(fr,"issue");var wn=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,En,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),On=T("$ZodError",wn),Ye=T("$ZodError",wn,{Parent:Error});var vu=o(e=>(t,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new pe;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(m=>be(m,s,fe())));throw mr(p,i?.callee),p}return c.value},"_parse"),wt=vu(Ye),xu=o(e=>async(t,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(m=>be(m,s,fe())));throw mr(p,i?.callee),p}return c.value},"_parseAsync"),Ot=xu(Ye),_u=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??On)(s.issues.map(c=>be(c,i,fe())))}:{success:!0,data:s.value}},"_safeParse"),Qe=_u(Ye),Pu=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(c=>be(c,i,fe())))}:{success:!0,data:s.value}},"_safeParseAsync"),et=Pu(Ye);var bu="(?:(?:\\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])))",Iu=new RegExp(`^${bu}$`);var Rn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Dn=/^-?\d+n?$/;var gr=/^-?\d+(?:\.\d+)?$/,Nn=/^(?:true|false)$/i;var Ce=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Cn=T("$ZodCheckMinLength",(e,t)=>{var r;Ce.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Sn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=kn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var yr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Ce.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=()=>{})}),Un=T("$ZodCheckRegex",(e,t)=>{yr.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 jn={major:4,minor:3,patch:6};var H=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=jn;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((c,p,m)=>{let g=Ne(c),h;for(let b of p){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(g)continue;let x=c.issues.length,u=b._zod.check(c);if(u instanceof Promise&&m?.async===!1)throw new pe;if(h||u instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await u,c.issues.length!==x&&(g||(g=Ne(c,x)))});else{if(c.issues.length===x)continue;g||(g=Ne(c,x))}}return h?h.then(()=>c):c},"runChecks"),s=o((c,p,m)=>{if(Ne(c))return c.aborted=!0,c;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=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(h=>s(h,c,p)):s(g,c,p)}let m=e._zod.parse(c,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=Qe(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return et(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nt=T("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Rn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),hr=T("$ZodStringFormat",(e,t)=>{yr.init(e,t),Nt.init(e,t)});var Zn=T("$ZodURL",(e,t)=>{hr.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 Wn=T("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??gr,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}});var vr=T("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=Nn,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}}),Hn=T("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=Dn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var qn=T("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Gn=T("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Kn=T("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Jn=T("$ZodDate",(e,t)=>{H.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 Ln(e,t,r){e.issues.length&&t.issues.push(...Pe(r,e.issues)),t.value[r]=e.value}o(Ln,"handleArrayResult");var Xn=T("$ZodArray",(e,t)=>{H.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 c=0;c<i.length;c++){let p=i[c],m=t.element._zod.run({value:p,issues:[]},n);m instanceof Promise?s.push(m.then(g=>Ln(g,r,c))):Ln(m,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Dt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Pe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Dt,"handlePropertyResult");function Tu(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=zn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Tu,"normalizeDef");function Eu(e,t,r,n,i,s){let c=[],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"){c.push(b);continue}let x=m.run({value:t[b],issues:[]},n);x instanceof Promise?e.push(x.then(u=>Dt(u,r,b,t,h))):Dt(x,r,b,t,h)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}o(Eu,"handleCatchall");var Yn=T("$ZodObject",(e,t)=>{if(H.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=At(()=>Tu(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=Xe,s=t.catchall,c;e._zod.parse=(p,m)=>{c??(c=n.value);let g=p.value;if(!i(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let h=[],b=c.shape;for(let x of c.keys){let u=b[x],d=u._zod.optout==="optional",y=u._zod.run({value:g[x],issues:[]},m);y instanceof Promise?h.push(y.then(f=>Dt(f,p,x,g,d))):Dt(y,p,x,g,d)}return s?Eu(h,g,p,m,n.value,e):h.length?Promise.all(h).then(()=>p):p}});function Fn(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=>!Ne(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(c=>be(c,n,fe())))}),t)}o(Fn,"handleUnionResults");var xr=T("$ZodUnion",(e,t)=>{H.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=>zt(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 c=!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),c=!0;else{if(g.issues.length===0)return g;p.push(g)}}return c?Promise.all(p).then(m=>Fn(m,i,e,s)):Fn(p,i,e,s)}});var Qn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xr.init(e,t);let r=e._zod.parse;J(e._zod,"propValues",()=>{let i={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[p,m]of Object.entries(c)){i[p]||(i[p]=new Set);for(let g of m)i[p].add(g)}}return i});let n=At(()=>{let i=t.options,s=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let m of p){if(s.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);s.set(m,c)}}return s});e._zod.parse=(i,s)=>{let c=i.value;if(!Xe(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,s):t.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var eo=T("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!$n(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let h=t.valueType._zod.run({value:i[g],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Pe(g,b.issues)),r.value[g]=b.value})):(h.issues.length&&r.issues.push(...Pe(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"&&gr.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=>be(b,n,fe())),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(...Pe(p,b.issues)),r.value[m.value]=b.value})):(h.issues.length&&r.issues.push(...Pe(p,h.issues)),r.value[m.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}});var to=T("$ZodEnum",(e,t)=>{H.init(e,t);let r=dr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>An.has(typeof i)).map(i=>typeof i=="string"?De(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),ro=T("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?De(n):n?De(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var no=T("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new St(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new pe;return r.value=i,r}});function Bn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Bn,"handleOptionalResult");var oo=T("$ZodOptional",(e,t)=>{H.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(`^(${zt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Bn(s,r.value)):Bn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var io=T("$ZodNullable",(e,t)=>{H.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(`^(${zt(r.source)}|null)$`):void 0}),J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var ao=T("$ZodPipe",(e,t)=>{H.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(c=>Rt(c,t.in,n)):Rt(s,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Rt(s,t.out,n)):Rt(i,t.out,n)}});function Rt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Rt,"handlePipeResult");var so=T("$ZodCustom",(e,t)=>{Ce.init(e,t),H.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=>Vn(s,r,n,e));Vn(i,r,n,e)}});function Vn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(fr(i))}}o(Vn,"handleRefineResult");var co,zu=Symbol("ZodOutput"),ku=Symbol("ZodInput"),_r=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function po(){return new _r}o(po,"registry");(co=globalThis).__zod_globalRegistry??(co.__zod_globalRegistry=po());var Pr=globalThis.__zod_globalRegistry;function lo(e,t){return new e({type:"string",...W(t)})}o(lo,"_string");function mo(e,t){return new e({type:"string",coerce:!0,...W(t)})}o(mo,"_coercedString");function fo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...W(t)})}o(fo,"_url");function go(e,t){return new e({type:"number",checks:[],...W(t)})}o(go,"_number");function yo(e,t){return new e({type:"number",coerce:!0,checks:[],...W(t)})}o(yo,"_coercedNumber");function ho(e,t){return new e({type:"boolean",...W(t)})}o(ho,"_boolean");function vo(e,t){return new e({type:"boolean",coerce:!0,...W(t)})}o(vo,"_coercedBoolean");function xo(e,t){return new e({type:"bigint",coerce:!0,...W(t)})}o(xo,"_coercedBigint");function _o(e){return new e({type:"any"})}o(_o,"_any");function Po(e){return new e({type:"unknown"})}o(Po,"_unknown");function bo(e,t){return new e({type:"void",...W(t)})}o(bo,"_void");function Io(e,t){return new e({type:"date",coerce:!0,...W(t)})}o(Io,"_coercedDate");function ue(e,t){return new Cn({check:"min_length",...W(t),minimum:e})}o(ue,"_minLength");function Ie(e,t){return new Un({check:"string_format",format:"regex",...W(t),pattern:e})}o(Ie,"_regex");function To(e,t,r){let n=W(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(To,"_custom");var X=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>wt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Qe(e,r,n),e.parseAsync=async(r,n)=>Ot(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>et(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)=>kt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Ut=T("ZodMiniString",(e,t)=>{Nt.init(e,t),X.init(e,t)});function a(e){return lo(Ut,e)}o(a,"string");var Eo=T("ZodMiniStringFormat",(e,t)=>{hr.init(e,t),Ut.init(e,t)});var Lu=T("ZodMiniURL",(e,t)=>{Zn.init(e,t),Eo.init(e,t)});function So(e){return fo(Lu,e)}o(So,"url");var br=T("ZodMiniNumber",(e,t)=>{Wn.init(e,t),X.init(e,t)});function ee(e){return go(br,e)}o(ee,"number");var Ir=T("ZodMiniBoolean",(e,t)=>{vr.init(e,t),X.init(e,t)});function V(e){return ho(Ir,e)}o(V,"boolean");var $o=T("ZodMiniBigInt",(e,t)=>{Hn.init(e,t),X.init(e,t)});var Fu=T("ZodMiniAny",(e,t)=>{qn.init(e,t),X.init(e,t)});function rt(){return _o(Fu)}o(rt,"any");var Bu=T("ZodMiniUnknown",(e,t)=>{Gn.init(e,t),X.init(e,t)});function w(){return Po(Bu)}o(w,"unknown");var Vu=T("ZodMiniVoid",(e,t)=>{Kn.init(e,t),X.init(e,t)});function Ao(e){return bo(Vu,e)}o(Ao,"_void");var zo=T("ZodMiniDate",(e,t)=>{Jn.init(e,t),X.init(e,t)});var Zu=T("ZodMiniArray",(e,t)=>{Xn.init(e,t),X.init(e,t)});function N(e,t){return new Zu({type:"array",element:e,...W(t)})}o(N,"array");var Wu=T("ZodMiniObject",(e,t)=>{Yn.init(e,t),X.init(e,t),J(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...W(t)};return new Wu(r)}o(l,"object");var Hu=T("ZodMiniUnion",(e,t)=>{xr.init(e,t),X.init(e,t)});function C(e,t){return new Hu({type:"union",options:e,...W(t)})}o(C,"union");var qu=T("ZodMiniDiscriminatedUnion",(e,t)=>{Qn.init(e,t),X.init(e,t)});function Ue(e,t,r){return new qu({type:"union",options:t,discriminator:e,...W(r)})}o(Ue,"discriminatedUnion");var Gu=T("ZodMiniRecord",(e,t)=>{eo.init(e,t),X.init(e,t)});function O(e,t,r){return new Gu({type:"record",keyType:e,valueType:t,...W(r)})}o(O,"record");var Ku=T("ZodMiniEnum",(e,t)=>{to.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 Ku({type:"enum",entries:r,...W(t)})}o(M,"_enum");var Ju=T("ZodMiniLiteral",(e,t)=>{ro.init(e,t),X.init(e,t)});function $(e,t){return new Ju({type:"literal",values:Array.isArray(e)?e:[e],...W(t)})}o($,"literal");var Xu=T("ZodMiniTransform",(e,t)=>{no.init(e,t),X.init(e,t)});function Te(e){return new Xu({type:"transform",transform:e})}o(Te,"transform");var Yu=T("ZodMiniOptional",(e,t)=>{oo.init(e,t),X.init(e,t)});function v(e){return new Yu({type:"optional",innerType:e})}o(v,"optional");var Qu=T("ZodMiniNullable",(e,t)=>{io.init(e,t),X.init(e,t)});function nt(e){return new Qu({type:"nullable",innerType:e})}o(nt,"nullable");var ec=T("ZodMiniPipe",(e,t)=>{ao.init(e,t),X.init(e,t)});function Ee(e,t){return new ec({type:"pipe",in:e,out:t})}o(Ee,"pipe");var tc=T("ZodMiniCustom",(e,t)=>{so.init(e,t),X.init(e,t)});function Mt(e,t){return To(tc,e??(()=>!0),t)}o(Mt,"custom");var ot={};bn(ot,{bigint:()=>uc,boolean:()=>sc,date:()=>cc,number:()=>ac,string:()=>ic});function ic(e){return mo(Ut,e)}o(ic,"string");function ac(e){return yo(br,e)}o(ac,"number");function sc(e){return vo(Ir,e)}o(sc,"boolean");function uc(e){return xo($o,e)}o(uc,"bigint");function cc(e){return Io(zo,e)}o(cc,"date");var Er=l({retryOnFailure:l({defaultValue:v(V()),hide:v(V())}),continueOnFailure:l({defaultValue:v(V()),hide:v(V())})}),Tr=class{constructor(t,r,n,i,s,c,p,m,g,h,b){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=p;this.errorHandlingOptions=m;this.outputSchema=g;this.audience=h;this.aiMetadata=b}static{o(this,"IAction")}},ie=o(e=>new Tr(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:$(t),required:V(),defaultValue:v(rt())}),"TPropertyValue");var ne=l({...B.shape,...U(a(),"SHORT_TEXT").shape}),ge=l({...B.shape,...U(a(),"LONG_TEXT").shape});var wo=l({label:a(),value:w()}),jt=l({disabled:v(V()),placeholder:v(a()),options:N(wo)});var oe=l({...B.shape,options:jt,...U(w(),"STATIC_DROPDOWN").shape}),ye=l({...B.shape,options:jt,...U(N(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Sr=l({...B.shape,...U(w(),"DROPDOWN").shape,refreshers:N(a())}),it=l({...B.shape,...U(N(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var he=l({...B.shape,...U(V(),"CHECKBOX").shape});var ve=l({...B.shape,...U(ee(),"NUMBER").shape});var at=l({...B.shape,...U(w(),"FILE").shape});var st=l({...B.shape,...U(a(),"DATE_TIME").shape});var Oo=O(a(),C([ne,ge,oe,it,ye,he,ve,at,st])),ut=l({...B.shape,properties:Oo,...U(N(w()),"ARRAY").shape});var ct=l({...B.shape,...U(C([O(a(),w())]),"JSON").shape});var Ro=C([ne,oe,ct,ut,ye]),lc=O(a(),Ro),$r=l({refreshers:N(a()),...B.shape,...U(w(),"DYNAMIC").shape});var Lt=l({...B.shape,...U(Ao(),"MARKDOWN").shape});var pt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(pt||{}),Me=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Me||{}),je=(_=>(_.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",_.COMMUNICATION="COMMUNICATION",_.COMMERCE="COMMERCE",_.CORE="CORE",_.UNIVERSAL_AI="UNIVERSAL_AI",_.FLOW_CONTROL="FLOW_CONTROL",_.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",_.ACCOUNTING="ACCOUNTING",_.PRODUCTIVITY="PRODUCTIVITY",_.CONTENT_AND_FILES="CONTENT_AND_FILES",_.DEVELOPER_TOOLS="DEVELOPER_TOOLS",_.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",_.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",_.HUMAN_RESOURCES="HUMAN_RESOURCES",_.PAYMENT_PROCESSING="PAYMENT_PROCESSING",_.MARKETING="MARKETING",_.SALES_AND_CRM="SALES_AND_CRM",_))(je||{});var lt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(lt||{}),Ar="both_client_credentials_and_authorization_code";var xe=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(xe||{}),dt=(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))(dt||{}),dc=l({strategy:M(dt),paramName:v(a())}),mt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(mt||{});var Ft=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ft||{}),Do=l({status:v(ee()),body:v(w()),headers:v(O(a(),a()))}),No=l({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:v(a()),handlerId:v(a()),streamStepProgress:v(M(Ft))}),Co=l({type:$("WEBHOOK"),requestId:a(),requestIdToReply:v(a()),response:Do,handlerId:v(a()),streamStepProgress:v(M(Ft))}),mc=C([No,Co]);var fc=l({body:w(),rawBody:v(w()),headers:O(a(),a()),queryParams:O(a(),a())});function Q(e){return e==null}o(Q,"isNil");function ft(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ft,"isEmpty");function Bt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Bt,"assertNotNullOrUndefined");var zr=Re(require("crypto"),1);var gc=128,ze,Le,yc=o(e=>{!ze||ze.length<e?(ze=Buffer.allocUnsafe(e*gc),zr.default.randomFillSync(ze),Le=0):Le+e>ze.length&&(zr.default.randomFillSync(ze),Le=0),Le+=e},"fillPool"),hc=o(e=>(yc(e|=0),ze.subarray(Le-e,Le)),"random"),vc=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 c="";for(;;){let p=r(i),m=i;for(;m--;)if(c+=e[p[m]&n]||"",c.length===s)return c}}},"customRandom"),Mo=o((e,t=21)=>vc(e,t,hc),"customAlphabet");var xc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",jo=21,Fb=a().check(Ie(new RegExp(`^[0-9a-zA-Z]{${jo}}$`))),_c=Mo(xc,jo);var Se=Ee(Te(e=>e instanceof Date?e.toISOString():e),a()),ae={id:a(),created:Se,updated:Se},Z=o(e=>v(nt(e)),"Nullable");function kr(e){return v(nt(M(e)))}o(kr,"NullableEnum");var Zb=Ee(Te(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(V())),Vt=o(e=>Ee(Te(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(N(e))),"OptionalArrayFromQuery");var qb=O(a(),w());var gt=(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))(gt||{});var iI=a().check(Ie(/^#[0-9A-Fa-f]{6}$/));var sI=l({filename:a(),data:w(),type:$("file"),mimetype:v(a())});var Pc=Re(Fo());var fI=l({...ae,name:a(),permissions:N(a()),platformId:Z(a()),type:a(),userCount:v(ee())});var Bo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Bo||{}),wr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(wr||{}),Or=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Or||{});var Rr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Rr||{});var Dr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Dr||{});var bc=l({mode:M(Bo),value:w()}),Ic=l({auth:v(a()),fields:O(a(),bc)}),Tc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:v(Ic)}),Ec=l({type:$("PIECE"),toolName:a().check(ue(1)),pieceMetadata:Tc}),Sc=l({type:$("none")}),$c=l({type:$("access_token"),accessToken:a()}),Ac=l({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),zc=l({type:$("headers"),headers:O(a(),a())}),kc=Ue("type",[Sc,$c,Ac,zc]),Vo=l({type:$("FLOW"),toolName:a().check(ue(1)),externalFlowId:a(),flowDisplayName:v(a())}),Zo=l({type:$("MCP"),toolName:a().check(ue(1)),serverUrl:So(),protocol:M(Or),auth:kc}),Wo=l({type:$("KNOWLEDGE_BASE"),toolName:a().check(ue(1)),sourceType:M(wr),sourceId:a(),sourceName:a()}),wc=Ue("type",[Ec,Vo,Zo,Wo]),Oc=l({displayName:a(),description:v(a()),type:M(Rr)}),Ho=l({type:$("MARKDOWN"),markdown:a()}),Fe={type:$("TOOL_CALL"),input:Z(O(a(),w())),output:v(w()),toolName:a(),status:M(Dr),toolCallId:a(),startTime:a(),endTime:v(a())},FI=l(Fe),qo=Ue("toolCallType",[l({...Fe,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Fe,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),l({...Fe,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),l({...Fe,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Fe,toolCallType:$("UNKNOWN"),displayName:a()})]),Rc=C([Ho,qo]);var Nr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Nr||{}),_e=l({apiKey:a()}),Dc=_e,Nc=l({apiKey:a(),apiKeyHash:a()}),Cc=_e,Uc=_e,Mc=_e,jc=_e,Lc=_e,Fc=_e,Bc=_e,Go=l({accessKeyId:a().check(ue(1)),secretAccessKey:a().check(ue(1))}),Vc=l({}),Zc=l({}),Wc=l({}),Hc=l({}),qc=l({}),Gc=l({}),Ko=l({modelId:a(),modelName:a(),modelType:M(Nr)}),Jo=l({apiKeyHeader:a(),baseUrl:a(),models:N(Ko),defaultHeaders:v(O(a(),a()))}),Xo=l({accountId:a(),gatewayId:a(),models:N(Ko),vertexProject:v(a()),vertexRegion:v(a())}),Yo=l({resourceName:a(),apiVersion:Ee(Te(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(a()))}),Qo=l({region:a().check(ue(1))}),Kc=C([Dc,Mc,jc,Lc,Fc,Uc,Cc,Nc,Go,Bc]),ei=C([Jo,Xo,Yo,Qo,Vc,Wc,Hc,qc,Zc,Gc]),Jc=l({id:a(),name:a(),type:M(Nr)}),Xc=l({id:a(),name:a(),provider:M(gt),config:ei,enabledForChat:V()}),Yc=l({provider:M(gt),config:ei,auth:Kc,platformId:a()});var WI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Qc=l({base64Url:a(),fileName:a(),extension:v(a())}),ep=l({mimeType:a(),url:a(),fileName:v(a())}),Cr=C([Qc,ep]);var tp=C([l({type:$("file"),value:Cr}),l({type:$("markdown"),value:a(),files:v(N(Cr))})]),rp=l({sessionId:a(),message:a(),files:v(N(a()))});var ri=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ri||{}),ni=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ni||{}),Ur=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Ur||{});var np=C([l({...ae,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...ae,name:a(),externalId:a(),type:C([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),op=l({...ae,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:kr(ni),trigger:kr(ri)}),ip=l({...ae,tableId:a(),projectId:a(),cells:O(a(),l({updated:a(),created:a(),value:w(),fieldName:a()}))}),ap=l({events:N(M(Ur)),webhookUrl:a(),flowId:a()}),sp=l({fields:N(l({id:a(),name:a()})),rows:N(O(a(),a())),name:a()}),up=l({projectId:a(),limit:v(ot.number()),cursor:v(a()),name:v(a()),externalIds:Vt(a()),folderId:v(a()),folderIds:Vt(a())}),cp=l({records:N(N(l({fieldId:a(),value:ii()}))),tableId:a()}),pp=l({cells:v(N(l({fieldId:a(),value:ii()}))),tableId:a(),agentUpdate:v(V())}),oi=Ue("operator",[ke("eq"),ke("neq"),ke("gt"),ke("gte"),ke("lt"),ke("lte"),ke("co"),ti("exists"),ti("not_exists")]),lp=l({tableId:a(),limit:v(ot.number()),cursor:v(a()),filters:Vt(oi)});function ii(){return Ee(Te(e=>e==null?e:String(e)),nt(a()))}o(ii,"coerceToString");function ke(e){return l({fieldId:a(),operator:$(e),value:a()})}o(ke,"valueFilter");function ti(e){return l({fieldId:a(),operator:$(e)})}o(ti,"existenceFilter");var dp=l({status:v(ee()),body:v(w()),headers:v(O(a(),a()))}),mp=l({...ae,deleted:Z(Se),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var ai=l({name:a(),description:v(a()),type:a(),required:V()}),fp=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(ai),returnsResponse:V()})});var si="^[0-9]+\\.[0-9]+\\.[0-9]+$",pT=new RegExp(si),yp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",lT=a().check(Ie(new RegExp(si))),dT=a().check(Ie(new RegExp(yp))),hp=l({packageType:$("ARCHIVE"),pieceType:M(Me),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ui=l({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ci=l({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),mT=C([ui,ci]),fT=C([hp,ui,ci]),pi=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(pi||{}),vp=l({type:M(pi),cronExpression:a(),timezone:a()}),gT=l({...ae,type:M(xe),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(vp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:V()}),li=(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))(li||{}),di=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(di||{}),mi=(r=>(r.S3="S3",r.DB="DB",r))(mi||{}),yT=l({...ae,projectId:Z(a()),platformId:Z(a()),type:M(li),compression:M(di),data:v(w()),location:M(mi),size:Z(ee()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(O(a(),a()))}),fi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(fi||{}),gi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(gi||{}),hT=l({id:a(),email:a(),firstName:a(),status:M(gi),externalId:Z(a()),platformId:Z(a()),platformRole:M(fi),lastName:a(),created:Se,updated:Se,lastActiveDate:Z(Se),imageUrl:Z(a())});var Mr=l({...B.shape,...U(O(a(),w()),"OBJECT").shape});var xi=l({...B.shape,...U(a(),"COLOR").shape});var jr=C([ne,ge,Lt,he,oe,ye,Sr,it,$r,ve,ut,Mr,ct,st,at,xi]),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 le=l({displayName:a(),description:v(a())});var _i=l({username:a(),password:a()}),Lr=l({...le.shape,username:l({displayName:a(),description:v(a())}),password:l({displayName:a(),description:v(a())}),...U(_i,"BASIC_AUTH").shape});var bp=O(a(),C([ne,ge,ve,he,oe])),Fr=l({...le.shape,props:bp,...U(w(),"CUSTOM_AUTH").shape});var we=l({...le.shape,...U(l({auth:a()}),"SECRET_TEXT").shape});var Ip=O(a(),C([ne,ge,we,ve,he,oe,ye,Lt])),Pi=l({...le.shape,props:Ip,...U(w(),"OIDC").shape});var Br=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Br||{}),bi=C([ne,we,oe]),Ii=O(a(),bi),Tp=l({props:v(O(a(),bi)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:v(C([$("none"),$("consent"),$("login"),$("omit")])),pkce:v(V()),pkceMethod:v(C([$("plain"),$("S256")])),authorizationMethod:v(M(Br)),grantType:v(C([M(lt),$(Ar)])),extra:v(O(a(),a()))}),Ti=l({access_token:a(),props:v(Ii),data:O(a(),rt())}),Vr=l({...le.shape,...Tp.shape,...U(Ti,"OAUTH2").shape});var Be=C([Lr,Fr,Pi,Vr,we]),yt="Connection",Wt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||yt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||yt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||yt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||yt}},None(){}};var KE={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 Ep=l({...B.shape,...U(w(),"CUSTOM").shape,code:a()});var Sp=C([jr,Be]),Zr=O(a(),Sp),gS=O(a(),jr);var Ei=C([l({strategy:$("CRON"),cronExpression:a()}),l({strategy:$("NONE")})]),Ve=class{constructor(t,r,n,i,s,c,p,m,g,h,b,x,u,d,y,f,_,P,L){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=p;this.onHandshake=m;this.renewConfiguration=g;this.onRenew=h;this.onEnable=b;this.onDisable=x;this.onStart=u;this.run=d;this.test=y;this.sampleData=f;this.testStrategy=_;this.outputSchema=P;this.aiMetadata=L}static{o(this,"ITrigger")}},Ht=o(e=>{switch(e.type){case"WEBHOOK":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,Q(e.sampleData)&&Q(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Si="2",qt="0.82.0";var Wr=class{constructor(t,r,n,i,s,c,p,m,g=qt,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._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Si}),"getContextInfo");(!$p(g)||Ap(g,qt))&&(this.minimumSupportedRelease=qt),s.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}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,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},$i=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 Wr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function $p(e){return/^\d+\.\d+\.\d+$/.test(e)}o($p,"isValidSimpleSemver");function Ap(e,t){let[r,n,i]=e.split(".").map(Number),[s,c,p]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<p}o(Ap,"isSemverLessThan");var zp=v(O(a(),O(a(),a()))),Ai=l({id:v(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:v(a()),directoryPath:v(a()),auth:v(C([Be,N(Be)])),version:a(),categories:v(N(M(je))),minimumSupportedRelease:v(a()),maximumSupportedRelease:v(a()),i18n:zp}),kp=M(["human","ai","both"]),zi=l({description:v(a()),idempotent:v(V())}),ki=l({name:a(),displayName:a(),description:a(),props:Zr,requireAuth:V(),errorHandlingOptions:v(Er),outputSchema:v(Mt()),audience:v(kp),aiMetadata:v(zi)}),wi=l({name:a(),displayName:a(),description:a(),props:Zr,errorHandlingOptions:v(Er),type:M(xe),sampleData:w(),handshakeConfiguration:v(Mt()),renewConfiguration:v(Ei),testStrategy:M(mt),outputSchema:v(Mt()),aiMetadata:v(zi)}),wp=l({...Ai.shape,actions:O(a(),ki),triggers:O(a(),wi)}),Op=l({...Ai.shape,actions:ee(),triggers:ee(),suggestedActions:v(N(wi)),suggestedTriggers:v(N(ki))}),Oi=l({projectUsage:ee(),tags:v(N(a())),pieceType:M(Me),packageType:M(pt),platformId:v(a()),archiveId:v(a())}),g$=l({...wp.shape,...Oi.shape}),y$=l({...Op.shape,...Oi.shape}),h$=l({name:a(),version:a()});var Rp=Re(require("path")),Dp=Re(require("fs/promises"));var Gt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Kt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Hr,r=new qr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Hr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},qr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Jt=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}}};var Xt=class extends Gt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Kt){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),c=t.queryParams??{};for(let[L,re]of Object.entries(c))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:x,extraHeaders:u,isStream:d}=Np(t.body,s),y=Up({...s,...u}),f=await Cp(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:x,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),_=h?300:400;if(f.status<200||f.status>=_){let L=await Ri(f,g),re=new Jt(t.body,{status:f.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let P=await Ri(f,g);return{status:f.status,headers:Mp(f.headers),body:P}}};function Np(e,t){return Lp(e)?{body:void 0,extraHeaders:{},isStream:!1}:jp(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Np,"serializeBody");async function Ri(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Ri,"parseResponseBody");async function Cp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Di(n);continue}return i}catch(i){if(r=i,n<t){await Di(n);continue}throw i}throw r}o(Cp,"sendWithRetries");function Di(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Di,"backoff");function Up(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(Up,"normalizeHeaders");function Mp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Mp,"toHttpHeaders");function jp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(jp,"isNodeFormData");function Lp(e){return e==null}o(Lp,"isNil");var ht=new Xt;var vt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(vt||{});var $d=Re(require("fs")),Ls=Re(js());var Ad={"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 zd(e){let t=e.split(";")[0].trim().toLowerCase();return Ad[t]??""}o(zd,"contentTypeToExtension");var kd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),wd=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 Fs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:s,props:c,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 ${wd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:D.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(vt).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:D.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:D.Object({displayName:"Query Parameters",required:!0,...c?.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,...c?.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,...c?.failsafe??{}}),timeout:D.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:D.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async g=>{let{method:h,url:b,headers:x,queryParams:u,body:d,body_type:y,failsafe:f,timeout:_,response_is_binary:P,followRedirects:L}=g.propsValue;Bt(h,"Method"),Bt(b,"URL");let re=Q(r)?{}:await r(g.auth,g.propsValue),se=b.url,Ke=se.startsWith("http://")||se.startsWith("https://")?se:kd({baseUrl:t(g.auth),relativePath:se}),Ae={method:h,url:Ke,headers:{...x??{},...m==="headers"||!Q(m)?re:{}},queryParams:{...m==="queryParams"?re:{},...u??{}},timeout:_?_*1e3:0,followRedirects:L};if(P&&(Ae.responseType="arraybuffer"),d)if(y&&y!=="none"){let me=d.data;if(y==="form_data"){let au=me,Et=new Ls.default;for(let{fieldName:xn,fieldType:_n,textFieldValue:Pn,fileFieldValue:cr}of au)_n==="text"&&!ft(Pn)?Et.append(xn,Pn):_n==="file"&&!ft(cr)&&Et.append(xn,cr.data,{filename:cr?.filename});Ae.body=Et,Ae.headers={...Ae.headers,...Et.getHeaders()}}else Ae.body=me}else y||(Ae.body=d);try{let me=await ht.sendRequest(Ae);return await Od(g.files,me.body,me.status,me.headers,P)}catch(me){if(f)return me.errorMessage();throw me}},"run")})}o(Fs,"createCustomApiCallAction");var Od=o(async(e,t,r,n,i)=>{let s;if(i&&Rd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=zd(c??"")||"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"),Rd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var bt={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:c}){switch(e.strategy){case 0:{let p=await t.get("lastPoll");if(Q(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:c}),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:c}),g=m.findIndex(x=>x.id===p),h=[];Q(p)||g==-1?h=m??[]:h=m?.slice(0,g)??[],Q(i)||(h=h.slice(-i));let b=h?.[0]?.id;return Q(b)||await t.put("lastItem",b),h.map(x=>x.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:i}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;Q(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:i,server:s}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:i,server:s});break}}return Dd(c.map(p=>p.data))}};function Dd(e){return e.length<=5?e:e.slice(0,5)}o(Dd,"getFirstFiveOrAll");function Nd(e){return e}o(Nd,"asAzureAuth");function It(e,t){if(typeof e!="string"||e.length===0)throw new Error(`Expected non-empty string for "${t}", got ${typeof e}`);return e}o(It,"narrowString");function Bs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Bs,"isRecord");function Cd(){let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}o(Cd,"generateWebhookToken");function Ud(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(Ud,"timingSafeEqual");function Tt(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(Tt,"extractHttpStatus");function Md(e){if(!Bs(e))return null;let{eventType:t,resource:r}=e;return typeof t!="string"||!Bs(r)||t!=="workitem.created"&&t!=="workitem.updated"&&t!=="workitem.commented"?null:{eventType:t,resource:r}}o(Md,"parseWebhookPayload");var jd=`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=Wt.CustomAuth({description:jd,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:Wt.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(!Ks(e.organizationUrl))return{valid:!1,error:"Organization URL must be a valid HTTP/HTTPS URL"};let t=gn(e.organizationUrl),r=Buffer.from(`:${e.pat}`).toString("base64");try{return(await ht.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 de({organizationUrl:e,pat:t,method:r,endpoint:n,body:i,queryParams:s,isJsonPatch:c=!1}){let p=gn(e),m=Buffer.from(`:${t}`).toString("base64"),g={};if(s)for(let[x,u]of Object.entries(s))u!=null&&(g[x]=u);let h={Authorization:`Basic ${m}`};return i!==void 0&&(h["Content-Type"]=c?"application/json-patch+json":"application/json"),(await ht.sendRequest({method:r,url:`${p}${n}`,headers:h,queryParams:g,body:i})).body}o(de,"azureDevOpsApiCall");async function Ld(e){return de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:"/_apis/projects",queryParams:{"api-version":"7.1"}})}o(Ld,"fetchProjects");async function Fd(e,t){return de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitemtypes`,queryParams:{"api-version":"7.1"}})}o(Fd,"fetchWorkItemTypes");function Hs(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(Hs,"flattenWorkItem");async function Bd({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 c=r.slice(s,s+i),p=await de({organizationUrl:e,pat:t,method:"GET",endpoint:"/_apis/wit/workitems",queryParams:{ids:c.join(","),$expand:"all","api-version":"7.1"}});p.value&&n.push(...p.value.map(Hs))}return n}o(Bd,"fetchWorkItemsByIds");async function Vd({auth:e,projectId:t,eventType:r,webhookUrl:n,workItemType:i,basicAuthUsername:s,basicAuthPassword:c}){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),c!==void 0&&(m.basicAuthPassword=c),de({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(Vd,"createSubscription");async function Zd({auth:e,subscriptionId:t}){await de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"DELETE",endpoint:`/_apis/hooks/subscriptions/${t}`,queryParams:{"api-version":"7.1"}})}o(Zd,"deleteSubscription");async function Wd(e,t){return(await de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/_apis/projects/${encodeURIComponent(t)}`,queryParams:{"api-version":"7.1"}})).id??null}o(Wd,"fetchProjectId");var Hd=25,Vs=5;async function qs(e,t){let n=(await de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/_apis/projects/${encodeURIComponent(t)}/teams`,queryParams:{"api-version":"7.1",$top:String(Hd)}})).value??[],i=new Map;for(let s=0;s<n.length;s+=Vs){let c=n.slice(s,s+Vs),p=await Promise.all(c.map(m=>de({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(qs,"fetchTeamMembers");async function Gs(e,t,r){return(await de({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(Gs,"fetchWorkItemTypeStates");function qd(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 qs(n,It(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${Tt(i)}. Check PAT.`}}},"options")})}o(qd,"createAssignedToDropdown");function Zs(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 c=await Gs(s,It(n,"project"),It(i,"work_item_type"));return c.length===0?{disabled:!1,options:[],placeholder:"No states defined for this work item type."}:{disabled:!1,options:c.map(p=>({label:p.category?`${p.name} (${p.category})`:p.name,value:p.name}))}}catch(c){return{disabled:!0,options:[],placeholder:`Load failed${Tt(c)}. Check PAT.`}}},"options")})}o(Zs,"createStateDropdown");function Ws(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 Fd(i,It(n,"project"));return!s.value||s.value.length===0?{disabled:!1,options:[],placeholder:"No work item types found."}:{disabled:!1,options:s.value.map(c=>({label:c.name,value:c.name}))}}catch(s){return{disabled:!0,options:[],placeholder:`Load failed${Tt(s)}. Check PAT.`}}},"options")})}o(Ws,"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 Ld(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${Tt(r)}. Check PAT.`}}},"options")}),workItemTypeDropdown:Ws(!0,"Select the type of work item (e.g. Bug, Task, User Story)"),workItemTypeDropdownOptional:Ws(!1,"Filter by work item type. Leave empty to trigger for all types."),assignedToDropdown:qd(!1),stateDropdown:Zs(!1,"New state for the work item. Leave empty to keep the current state."),stateDropdownOptional:Zs(!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:Gd,sanitizeOrgUrl:gn,isValidUrl:Ks,asAuth:Nd,narrowString:It,parseWebhookPayload:Md,generateWebhookToken:Cd,timingSafeEqual:Ud,extractHttpStatus:Tt,apiCall:de,fetchWorkItemsByIds:Bd,flattenWorkItem:Hs,fetchProjectId:Wd,fetchTeamMembers:qs,fetchWorkItemTypeStates:Gs,createSubscription:Vd,deleteSubscription:Zd};function gn(e){return e.replace(/\/+$/,"")}o(gn,"sanitizeOrgUrl");function Gd(e){return e.replace(/'/g,"''")}o(Gd,"escapeWiqlString");function Ks(e){try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}o(Ks,"isValidUrl");var yn=[{label:"Work Item Created",value:"workitem.created"},{label:"Work Item Updated",value:"workitem.updated"},{label:"Work Item Commented",value:"workitem.commented"}];var Js=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:c}=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}),c&&g.push({op:"add",path:"/fields/Microsoft.VSTS.Common.Priority",value:Number(c)});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 Xs=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 Ys=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:c,priority:p}=e.propsValue,m=e.auth,g=I.sanitizeOrgUrl(m.props.organizationUrl),h=encodeURIComponent(t),b=[];if(sr(n)&&b.push({op:"replace",path:"/fields/System.Title",value:n}),sr(i)&&b.push({op:"replace",path:"/fields/System.Description",value:i}),sr(s)&&b.push({op:"replace",path:"/fields/System.State",value:s}),sr(c)&&b.push({op:"replace",path:"/fields/System.AssignedTo",value:c}),p!=null&&b.push({op:"replace",path:"/fields/Microsoft.VSTS.Common.Priority",value:Number(p)}),b.length===0){let u=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(u)}let x=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(x)}});function sr(e){return typeof e=="string"&&e.length>0}o(sr,"isNonEmptyString");var Kd="SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @project AND [System.WorkItemType] <> '' ORDER BY [System.ChangedDate] DESC",Qs=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),c=r||Kd,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:c}});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 eu=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),c=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:c.id,work_item_id:c.workItemId,text:c.text??null,created_by:c.createdBy?.displayName??null,created_by_email:c.createdBy?.uniqueName??null,created_date:c.createdDate??null,modified_by:c.modifiedBy?.displayName??null,modified_date:c.modifiedDate??null}}});var Jd={project:I.projectDropdown,work_item_type:I.workItemTypeDropdownOptional,state_filter:I.stateDropdownOptional},Xd=14,ur={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:c}=t,p=I.narrowString(i,"project"),m=r&&r>0?r+1:Date.now()-Xd*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(c){let y=I.escapeWiqlString(I.narrowString(c,"state_filter"));b+=` AND [System.State] = '${y}'`}b+=" ORDER BY [System.ChangedDate] DESC";let x=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(!x.workItems||x.workItems.length===0)return[];let u=x.workItems.map(y=>y.id);return(await I.fetchWorkItemsByIds({organizationUrl:n,pat:e.props.pat,ids:u})).map(y=>({epochMilliSeconds:y.changed_date?new Date(y.changed_date).getTime():Date.now(),data:y}))},"items")},Yd={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"},tu=Ht({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:Jd,sampleData:Yd,type:"POLLING",async test(e){return await bt.test(ur,e)},async onEnable(e){await bt.onEnable(ur,e)},async onDisable(e){await bt.onDisable(ur,e)},async run(e){return await bt.poll(ur,e)}});var hn="azure_devops_workitem_subscription_ids",vn="azure_devops_workitem_webhook_token",ru="activepieces",nu={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"},ou=Ht({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:[...yn]}})},sampleData:nu,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=rm(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(vn,s);let c=[];for(let p of n){let m=await I.createSubscription({auth:e.auth,projectId:i,eventType:p,webhookUrl:e.webhookUrl,workItemType:r,basicAuthUsername:ru,basicAuthPassword:s});c.push(m.id),await e.store.put(hn,c)}},async onDisable(e){let t=await e.store.get(hn)??[];for(let r of t)try{await I.deleteSubscription({auth:e.auth,subscriptionId:r})}catch{}await e.store.delete(hn),await e.store.delete(vn)},async run(e){let t=await e.store.get(vn);if(!t)return[];let r=em(e.payload.headers);if(!r||!tm(r,ru,t))return[];let n=I.parseWebhookPayload(e.payload.body);return n?n.eventType==="workitem.commented"?[Qd(n)]:[iu(n.resource)]:[]},async test(){return[nu]}});function iu(e){return I.flattenWorkItem({id:e.id??e.workItemId??0,rev:e.rev??0,url:e.url,fields:e.revision?.fields??e.fields??{}})}o(iu,"flattenResource");function Qd(e){let{resource:t}=e;return{...iu(t),comment:t.revision?.comment?.content??null}}o(Qd,"flattenCommentEvent");function em(e){let t=e.authorization??e.Authorization;return typeof t=="string"?t:null}o(em,"extractAuthHeader");function tm(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 c=i.slice(0,s),p=i.slice(s+1);return I.timingSafeEqual(c,t)&&I.timingSafeEqual(p,r)}o(tm,"verifyBasicAuth");function rm(e){let t=yn.map(r=>r.value);return e.filter(r=>typeof r=="string"&&t.includes(r))}o(rm,"filterToHookEvents");var nm=$i({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:[Js,Xs,Ys,Qs,eu,Fs({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:[ou,tu]});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"}