@activepieces/piece-polydoc 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/piece-polydoc",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "dependencies": {},
package/src/index.js CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var Eu=Object.create;var mt=Object.defineProperty;var Su=Object.getOwnPropertyDescriptor;var $u=Object.getOwnPropertyNames;var Au=Object.getPrototypeOf,zu=Object.prototype.hasOwnProperty;var o=(e,t)=>mt(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Dn=(e,t)=>{for(var r in t)mt(e,r,{get:t[r],enumerable:!0})},Nn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $u(t))!zu.call(e,i)&&i!==r&&mt(e,i,{get:()=>t[i],enumerable:!(n=Su(t,i))||n.enumerable});return e};var De=(e,t,r)=>(r=e!=null?Eu(Au(e)):{},Nn(t||!e||!e.__esModule?mt(r,"default",{value:e,enumerable:!0}):r,e)),Ou=e=>Nn(mt({},"__esModule",{value:!0}),e);var ii=E((oi,ar)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(p.zoneIndex)||[])[0],_,L;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(L=d-g,_=":";L--;)_+="0:";return s=s.replace("::",_),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let Q=s.split(":"),ne=[];for(let dt=0;dt<Q.length;dt++)ne.push(parseInt(Q[dt],16));return ne})(),{parts:d,zoneId:v}}o(f,"expandIPv6");function h(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,_;for(;m>0;){if(_=g-m,_<0&&(_=0),s[v]>>_!==d[v]>>_)return!1;m-=g,v+=1}return!0}o(h,"matchCIDR");function P(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(P,"parseIntAuto");function $(s,d){for(;s.length<d;)s=`0${s}`;return s}o($,"padPart");let x={};x.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,_,L;for(v=3;v>=0;v-=1)if(_=this.octets[v],_ in m){if(L=m[_],g&&L!==0)return null;L!==8&&(g=!0),d+=L}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<4;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),_=[];for(let L=0;L<v.length;L++)g=v[L],_.push(P(g));return _})();if(d=s.match(r.longValue)){if(m=P(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],_;for(_=0;_<=24;_+=8)v.push(m>>_&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),_=[];if(m=P(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(m>>16&255),_.push(m>>8&255),_.push(m&255),_})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),_=[];if(m=P(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(P(v[1])),_.push(m>>8&255),_.push(m&255),_})():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=(function(){function s(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,_;for(let L=7;L>=0;L-=1)if(v=this.parts[L],v in m){if(_=m[v],g&&_!==0)return null;_!==16&&(g=!0),d+=_}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push($(this.parts[v].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new x.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,_;for(;_=d.exec(g);)_[0].length>v&&(m=_.index,v=_[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<16;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,g,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},x.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let d,g,m,v,_,L;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return f(s,8);if((m=s.match(p.transitional))&&(L=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+L,6),d.parts)){for(_=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<_.length;g++)if(v=_[g],!(0<=v&&v<=255))return null;return d.parts.push(_[0]<<8|_[1]),d.parts.push(_[2]<<8|_[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,g){let m,v,_,L;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(_=d[v],_[0]&&!(_[0]instanceof Array)&&(_=[_]),m=0;m<_.length;m++)if(L=_[m],s.kind()===L[0].kind()&&s.match.apply(s,L))return v}return g},typeof ar<"u"&&ar.exports?ar.exports=x:e.ipaddr=x})(oi)});var ia=E((GA,oa)=>{var na=require("stream").Stream,pp=require("util");oa.exports=ae;function ae(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ae,"DelayedStream");pp.inherits(ae,na);ae.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(ae.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ae.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ae.prototype.resume=function(){this._released||this.release(),this.source.resume()};ae.prototype.pause=function(){this.source.pause()};ae.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ae.prototype.pipe=function(){var e=na.prototype.pipe.apply(this,arguments);return this.resume(),e};ae.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)};ae.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 ca=E((WA,ua)=>{var dp=require("util"),sa=require("stream").Stream,aa=ia();ua.exports=q;function q(){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(q,"CombinedStream");dp.inherits(q,sa);q.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};q.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};q.prototype.append=function(e){var t=q.isStreamLike(e);if(t){if(!(e instanceof aa)){var r=aa.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};q.prototype.pipe=function(e,t){return sa.prototype.pipe.call(this,e,t),this.resume(),e};q.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}};q.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=q.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};q.prototype._pipeNext=function(e){this._currentStream=e;var t=q.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()};q.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};q.prototype.write=function(e){this.emit("data",e)};q.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};q.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")};q.prototype.end=function(){this._reset(),this.emit("end")};q.prototype.destroy=function(){this._reset(),this.emit("close")};q.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};q.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};q.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)};q.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var pa=E((KA,la)=>{"use strict";la.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 fa=E(Y=>{"use strict";var mr=pa(),mp=require("path").extname,da=/^\s*([^;\s]*)(?:;|\s|$)/,fp=/^text\//i;Y.charset=ma;Y.charsets={lookup:ma};Y.contentType=gp;Y.extension=yp;Y.extensions=Object.create(null);Y.lookup=hp;Y.types=Object.create(null);vp(Y.extensions,Y.types);function ma(e){if(!e||typeof e!="string")return!1;var t=da.exec(e),r=t&&mr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&fp.test(t[1])?"UTF-8":!1}o(ma,"charset");function gp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Y.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Y.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(gp,"contentType");function yp(e){if(!e||typeof e!="string")return!1;var t=da.exec(e),r=t&&Y.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(yp,"extension");function hp(e){if(!e||typeof e!="string")return!1;var t=mp("x."+e).toLowerCase().substr(1);return t&&Y.types[t]||!1}o(hp,"lookup");function vp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(mr).forEach(o(function(i){var u=mr[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var f=c[p];if(t[f]){var h=r.indexOf(mr[t[f]].source),P=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(h>P||h===P&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(vp,"populateMaps")});var ya=E((QA,ga)=>{ga.exports=xp;function xp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(xp,"defer")});var ln=E((tz,va)=>{var ha=ya();va.exports=Pp;function Pp(e){var t=!1;return ha(function(){t=!0}),o(function(n,i){t?e(n,i):ha(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Pp,"async")});var pn=E((nz,xa)=>{xa.exports=_p;function _p(e){Object.keys(e.jobs).forEach(bp.bind(e)),e.jobs={}}o(_p,"abort");function bp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(bp,"clean")});var dn=E((iz,_a)=>{var Pa=ln(),Tp=pn();_a.exports=Ip;function Ip(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Ep(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Tp(r):r.results[i]=c,n(u,r.results))})}o(Ip,"iterate");function Ep(e,t,r,n){var i;return e.length==2?i=e(r,Pa(n)):i=e(r,t,Pa(n)),i}o(Ep,"runJob")});var mn=E((sz,ba)=>{ba.exports=Sp;function Sp(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(Sp,"state")});var fn=E((cz,Ta)=>{var $p=pn(),Ap=ln();Ta.exports=zp;function zp(e){Object.keys(this.jobs).length&&(this.index=this.size,$p(this),Ap(e)(null,this.results))}o(zp,"terminator")});var Ea=E((pz,Ia)=>{var Op=dn(),kp=mn(),wp=fn();Ia.exports=Rp;function Rp(e,t,r){for(var n=kp(e);n.index<(n.keyedList||e).length;)Op(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return wp.bind(n,r)}o(Rp,"parallel")});var gn=E((mz,fr)=>{var Sa=dn(),Dp=mn(),Np=fn();fr.exports=Cp;fr.exports.ascending=$a;fr.exports.descending=Up;function Cp(e,t,r,n){var i=Dp(e,r);return Sa(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){Sa(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Np.bind(i,n)}o(Cp,"serialOrdered");function $a(e,t){return e<t?-1:e>t?1:0}o($a,"ascending");function Up(e,t){return-1*$a(e,t)}o(Up,"descending")});var za=E((gz,Aa)=>{var Mp=gn();Aa.exports=Lp;function Lp(e,t,r){return Mp(e,t,null,r)}o(Lp,"serial")});var ka=E((hz,Oa)=>{Oa.exports={parallel:Ea(),serial:za(),serialOrdered:gn()}});var yn=E((vz,wa)=>{"use strict";wa.exports=Object});var Da=E((xz,Ra)=>{"use strict";Ra.exports=Error});var Ca=E((Pz,Na)=>{"use strict";Na.exports=EvalError});var Ma=E((_z,Ua)=>{"use strict";Ua.exports=RangeError});var ja=E((bz,La)=>{"use strict";La.exports=ReferenceError});var Ba=E((Tz,Fa)=>{"use strict";Fa.exports=SyntaxError});var gr=E((Iz,Va)=>{"use strict";Va.exports=TypeError});var Ha=E((Ez,Za)=>{"use strict";Za.exports=URIError});var qa=E((Sz,Ga)=>{"use strict";Ga.exports=Math.abs});var Ja=E(($z,Wa)=>{"use strict";Wa.exports=Math.floor});var Xa=E((Az,Ka)=>{"use strict";Ka.exports=Math.max});var Qa=E((zz,Ya)=>{"use strict";Ya.exports=Math.min});var ts=E((Oz,es)=>{"use strict";es.exports=Math.pow});var ns=E((kz,rs)=>{"use strict";rs.exports=Math.round});var is=E((wz,os)=>{"use strict";os.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ss=E((Dz,as)=>{"use strict";var jp=is();as.exports=o(function(t){return jp(t)||t===0?t:t<0?-1:1},"sign")});var cs=E((Cz,us)=>{"use strict";us.exports=Object.getOwnPropertyDescriptor});var hn=E((Uz,ls)=>{"use strict";var yr=cs();if(yr)try{yr([],"length")}catch{yr=null}ls.exports=yr});var ds=E((Mz,ps)=>{"use strict";var hr=Object.defineProperty||!1;if(hr)try{hr({},"a",{value:1})}catch{hr=!1}ps.exports=hr});var vn=E((Lz,ms)=>{"use strict";ms.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var ys=E((Fz,gs)=>{"use strict";var fs=typeof Symbol<"u"&&Symbol,Fp=vn();gs.exports=o(function(){return typeof fs!="function"||typeof Symbol!="function"||typeof fs("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Fp()},"hasNativeSymbols")});var xn=E((Vz,hs)=>{"use strict";hs.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Pn=E((Zz,vs)=>{"use strict";var Bp=yn();vs.exports=Bp.getPrototypeOf||null});var _s=E((Hz,Ps)=>{"use strict";var Vp="Function.prototype.bind called on incompatible ",Zp=Object.prototype.toString,Hp=Math.max,Gp="[object Function]",xs=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),qp=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),Wp=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");Ps.exports=o(function(t){var r=this;if(typeof r!="function"||Zp.apply(r)!==Gp)throw new TypeError(Vp+r);for(var n=qp(arguments,1),i,u=o(function(){if(this instanceof i){var P=r.apply(this,xs(n,arguments));return Object(P)===P?P:this}return r.apply(t,xs(n,arguments))},"binder"),c=Hp(0,r.length-n.length),p=[],f=0;f<c;f++)p[f]="$"+f;if(i=Function("binder","return function ("+Wp(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var Ve=E((qz,bs)=>{"use strict";var Jp=_s();bs.exports=Function.prototype.bind||Jp});var vr=E((Wz,Ts)=>{"use strict";Ts.exports=Function.prototype.call});var _n=E((Jz,Is)=>{"use strict";Is.exports=Function.prototype.apply});var Ss=E((Kz,Es)=>{"use strict";Es.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var As=E((Xz,$s)=>{"use strict";var Kp=Ve(),Xp=_n(),Yp=vr(),Qp=Ss();$s.exports=Qp||Kp.call(Yp,Xp)});var Os=E((Yz,zs)=>{"use strict";var ed=Ve(),td=gr(),rd=vr(),nd=As();zs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new td("a function is required");return nd(ed,rd,t)},"callBindBasic")});var Cs=E((eO,Ns)=>{"use strict";var od=Os(),ks=hn(),Rs;try{Rs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var bn=!!Rs&&ks&&ks(Object.prototype,"__proto__"),Ds=Object,ws=Ds.getPrototypeOf;Ns.exports=bn&&typeof bn.get=="function"?od([bn.get]):typeof ws=="function"?o(function(t){return ws(t==null?t:Ds(t))},"getDunder"):!1});var Fs=E((rO,js)=>{"use strict";var Us=xn(),Ms=Pn(),Ls=Cs();js.exports=Us?o(function(t){return Us(t)},"getProto"):Ms?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ms(t)},"getProto"):Ls?o(function(t){return Ls(t)},"getProto"):null});var Tn=E((oO,Bs)=>{"use strict";var id=Function.prototype.call,ad=Object.prototype.hasOwnProperty,sd=Ve();Bs.exports=sd.call(id,ad)});var Js=E((iO,Ws)=>{"use strict";var M,ud=yn(),cd=Da(),ld=Ca(),pd=Ma(),dd=ja(),qe=Ba(),Ge=gr(),md=Ha(),fd=qa(),gd=Ja(),yd=Xa(),hd=Qa(),vd=ts(),xd=ns(),Pd=ss(),Gs=Function,In=o(function(e){try{return Gs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Nt=hn(),_d=ds(),En=o(function(){throw new Ge},"throwTypeError"),bd=Nt?(function(){try{return arguments.callee,En}catch{try{return Nt(arguments,"callee").get}catch{return En}}})():En,Ze=ys()(),K=Fs(),Td=Pn(),Id=xn(),qs=_n(),Ct=vr(),He={},Ed=typeof Uint8Array>"u"||!K?M:K(Uint8Array),Re={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ze&&K?K([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":He,"%AsyncGenerator%":He,"%AsyncGeneratorFunction%":He,"%AsyncIteratorPrototype%":He,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":cd,"%eval%":eval,"%EvalError%":ld,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":Gs,"%GeneratorFunction%":He,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ze&&K?K(K([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ze||!K?M:K(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":ud,"%Object.getOwnPropertyDescriptor%":Nt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":pd,"%ReferenceError%":dd,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ze||!K?M:K(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ze&&K?K(""[Symbol.iterator]()):M,"%Symbol%":Ze?Symbol:M,"%SyntaxError%":qe,"%ThrowTypeError%":bd,"%TypedArray%":Ed,"%TypeError%":Ge,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":md,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Ct,"%Function.prototype.apply%":qs,"%Object.defineProperty%":_d,"%Object.getPrototypeOf%":Td,"%Math.abs%":fd,"%Math.floor%":gd,"%Math.max%":yd,"%Math.min%":hd,"%Math.pow%":vd,"%Math.round%":xd,"%Math.sign%":Pd,"%Reflect.getPrototypeOf%":Id};if(K)try{null.error}catch(e){Vs=K(K(e)),Re["%Error.prototype%"]=Vs}var Vs,Sd=o(function e(t){var r;if(t==="%AsyncFunction%")r=In("async function () {}");else if(t==="%GeneratorFunction%")r=In("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=In("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&K&&(r=K(i.prototype))}return Re[t]=r,r},"doEval"),Zs={__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"]},Ut=Ve(),xr=Tn(),$d=Ut.call(Ct,Array.prototype.concat),Ad=Ut.call(qs,Array.prototype.splice),Hs=Ut.call(Ct,String.prototype.replace),Pr=Ut.call(Ct,String.prototype.slice),zd=Ut.call(Ct,RegExp.prototype.exec),Od=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,kd=/\\(\\)?/g,wd=o(function(t){var r=Pr(t,0,1),n=Pr(t,-1);if(r==="%"&&n!=="%")throw new qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new qe("invalid intrinsic syntax, expected opening `%`");var i=[];return Hs(t,Od,function(u,c,p,f){i[i.length]=p?Hs(f,kd,"$1"):c||u}),i},"stringToPath"),Rd=o(function(t,r){var n=t,i;if(xr(Zs,n)&&(i=Zs[n],n="%"+i[0]+"%"),xr(Re,n)){var u=Re[n];if(u===He&&(u=Sd(n)),typeof u>"u"&&!r)throw new Ge("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new qe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ws.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ge("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ge('"allowMissing" argument must be a boolean');if(zd(/^%?[^%]*%?$/,t)===null)throw new qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=wd(t),i=n.length>0?n[0]:"",u=Rd("%"+i+"%",r),c=u.name,p=u.value,f=!1,h=u.alias;h&&(i=h[0],Ad(n,$d([0,1],h)));for(var P=1,$=!0;P<n.length;P+=1){var x=n[P],s=Pr(x,0,1),d=Pr(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new qe("property names with quotes must have matching quotes");if((x==="constructor"||!$)&&(f=!0),i+="."+x,c="%"+i+"%",xr(Re,c))p=Re[c];else if(p!=null){if(!(x in p)){if(!r)throw new Ge("base intrinsic for "+t+" exists, but the property is not available.");return}if(Nt&&P+1>=n.length){var g=Nt(p,x);$=!!g,$&&"get"in g&&!("originalValue"in g.get)?p=g.get:p=p[x]}else $=xr(p,x),p=p[x];$&&!f&&(Re[c]=p)}}return p},"GetIntrinsic")});var Xs=E((sO,Ks)=>{"use strict";var Dd=vn();Ks.exports=o(function(){return Dd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var eu=E((cO,Qs)=>{"use strict";var Nd=Js(),Ys=Nd("%Object.defineProperty%",!0),Cd=Xs()(),Ud=Tn(),Md=gr(),_r=Cd?Symbol.toStringTag:null;Qs.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 Md("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");_r&&(n||!Ud(t,_r))&&(Ys?Ys(t,_r,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[_r]=r)},"setToStringTag")});var ru=E((pO,tu)=>{"use strict";var Ld=Function.prototype.call,jd=Object.prototype.hasOwnProperty,Fd=Ve();tu.exports=Fd.call(Ld,jd)});var ou=E((dO,nu)=>{"use strict";nu.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var su=E((mO,au)=>{"use strict";var zn=ca(),Bd=require("util"),Sn=require("path"),Vd=require("http"),Zd=require("https"),Hd=require("url").parse,Gd=require("fs"),qd=require("stream").Stream,Wd=require("crypto"),$n=fa(),Jd=ka(),Kd=eu(),$e=ru(),An=ou();function iu(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(iu,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],zn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");Bd.inherits(j,zn);j.LINE_BREAK=`\r
2
- `;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=zn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};j.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&$e(t,"httpVersion"))&&!(t instanceof qd))&&(r.knownLength||this._valuesToMeasure.push(t))};j.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)):Gd.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")};j.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+iu(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&An(c,r.header);var p;for(var f in c)if($e(c,f)){if(p=c[f],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=f+": "+p.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+u+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=Sn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Sn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&$e(e,"httpVersion")&&(r=Sn.basename(e.client._httpMessage.path||"")),r)return'filename="'+iu(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=$n.lookup(e.name)),!r&&e&&e.path&&(r=$n.lookup(e.path)),!r&&e&&e.readable&&$e(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=$n.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)$e(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+Wd.randomBytes(12).toString("hex")};j.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Jd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Hd(e),n=An({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=An(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Zd.request(n):r=Vd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,f=o(function(h,P){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,h,P)},"callback");p=f.bind(this,null),r.on("error",f),r.on("response",p)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};Kd(j.prototype,"FormData");au.exports=j});var pm={};Dn(pm,{polydoc:()=>lm});module.exports=Ou(pm);var ku=Object.freeze({status:"aborted"});function b(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let h=c.prototype,P=Object.keys(h);for(let $=0;$<P.length;$++){let x=P[$];x in p||(p[x]=h[x].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var f;let h=r?.Parent?new u:this;n(h,p),(f=h._zod).deferred??(f.deferred=[]);for(let P of h._zod.deferred)P();return h}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(b,"$constructor");var se=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},jt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Er={};function pe(e){return e&&Object.assign(Er,e),Er}o(pe,"config");function $r(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($r,"getEnumValues");function Un(e,t){return typeof t=="bigint"?t.toString():t}o(Un,"jsonStringifyReplacer");function Bt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Bt,"cached");function Mn(e){return e==null}o(Mn,"nullish");function Vt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Vt,"cleanRegex");var Cn=Symbol("evaluating");function W(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Cn)return n===void 0&&(n=Cn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(W,"defineLazy");var Ar="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ft(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(ft,"isObject");var wu=Bt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ln(e){if(ft(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ft(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Ln,"isPlainObject");var jn=new Set(["string","number","symbol"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ne,"escapeRegex");function Zt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Zt,"clone");function V(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(V,"normalizeParams");function Fn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(Fn,"optionalKeys");var Bn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ce(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Ce,"aborted");function ve(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(ve,"prefixIssues");function Ft(e){return typeof e=="string"?e:e?.message}o(Ft,"unwrapMessage");function xe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Ft(e.inst?._zod.def?.error?.(e))??Ft(t?.error?.(e))??Ft(r.customError?.(e))??Ft(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(xe,"finalizeIssue");function Vn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Vn,"getLengthableOrigin");function zr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(zr,"issue");var Zn=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,Un,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Hn=b("$ZodError",Zn),gt=b("$ZodError",Zn,{Parent:Error});var Du=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new se;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>xe(f,u,pe())));throw Ar(p,i?.callee),p}return c.value},"_parse"),Ht=Du(gt),Nu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>xe(f,u,pe())));throw Ar(p,i?.callee),p}return c.value},"_parseAsync"),Gt=Nu(gt),Cu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new se;return u.issues.length?{success:!1,error:new(e??Hn)(u.issues.map(c=>xe(c,i,pe())))}:{success:!0,data:u.value}},"_safeParse"),yt=Cu(gt),Uu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>xe(c,i,pe())))}:{success:!0,data:u.value}},"_safeParseAsync"),ht=Uu(gt);var Mu="(?:(?:\\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])))",Lu=new RegExp(`^${Mu}$`);var Gn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),qn=/^-?\d+n?$/,Wn=/^-?\d+$/,Or=/^-?\d+(?:\.\d+)?$/,Jn=/^(?:true|false)$/i;var Pe=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ju={number:"number",bigint:"bigint",object:"date"};var Kn=b("$ZodCheckGreaterThan",(e,t)=>{Pe.init(e,t);let r=ju[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Xn=b("$ZodCheckNumberFormat",(e,t)=>{Pe.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Bn[t.format];e._zod.onattach.push(c=>{let p=c._zod.bag;p.format=t.format,p.minimum=i,p.maximum=u,r&&(p.pattern=Wn)}),e._zod.check=c=>{let p=c.value;if(r){if(!Number.isInteger(p)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?c.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}p<i&&c.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>u&&c.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Yn=b("$ZodCheckMinLength",(e,t)=>{var r;Pe.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Mn(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=Vn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var kr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Pe.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Qn=b("$ZodCheckRegex",(e,t)=>{kr.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 to={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=to;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,p,f)=>{let h=Ce(c),P;for(let $ of p){if($._zod.def.when){if(!$._zod.def.when(c))continue}else if(h)continue;let x=c.issues.length,s=$._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new se;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(h||(h=Ce(c,x)))});else{if(c.issues.length===x)continue;h||(h=Ce(c,x))}}return P?P.then(()=>c):c},"runChecks"),u=o((c,p,f)=>{if(Ce(c))return c.aborted=!0,c;let h=i(p,n,f);if(h instanceof Promise){if(f.async===!1)throw new se;return h.then(P=>e._zod.parse(P,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return h instanceof Promise?h.then(P=>u(P,c,p)):u(h,c,p)}let f=e._zod.parse(c,p);if(f instanceof Promise){if(p.async===!1)throw new se;return f.then(h=>i(h,n,p))}return i(f,n,p)}}W(e,"~standard",()=>({validate:o(i=>{try{let u=yt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return ht(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Jt=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Gn(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}}),wr=b("$ZodStringFormat",(e,t)=>{kr.init(e,t),Jt.init(e,t)});var ao=b("$ZodURL",(e,t)=>{wr.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 Rr=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??Or,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),so=b("$ZodNumberFormat",(e,t)=>{Xn.init(e,t),Rr.init(e,t)}),Dr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=Jn,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}}),uo=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=qn,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 co=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),lo=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var po=b("$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}}),mo=b("$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,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function ro(e,t,r){e.issues.length&&t.issues.push(...ve(r,e.issues)),t.value[r]=e.value}o(ro,"handleArrayResult");var fo=b("$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 u=[];for(let c=0;c<i.length;c++){let p=i[c],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?u.push(f.then(h=>ro(h,r,c))):ro(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Wt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...ve(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Wt,"handlePropertyResult");function Fu(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=Fn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Fu,"normalizeDef");function Bu(e,t,r,n,i,u){let c=[],p=i.keySet,f=i.catchall._zod,h=f.def.type,P=f.optout==="optional";for(let $ in t){if(p.has($))continue;if(h==="never"){c.push($);continue}let x=f.run({value:t[$],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Wt(s,r,$,t,P))):Wt(x,r,$,t,P)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Bu,"handleCatchall");var go=b("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...p};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Bt(()=>Fu(t));W(e._zod,"propValues",()=>{let p=t.shape,f={};for(let h in p){let P=p[h]._zod;if(P.values){f[h]??(f[h]=new Set);for(let $ of P.values)f[h].add($)}}return f});let i=ft,u=t.catchall,c;e._zod.parse=(p,f)=>{c??(c=n.value);let h=p.value;if(!i(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;p.value={};let P=[],$=c.shape;for(let x of c.keys){let s=$[x],d=s._zod.optout==="optional",g=s._zod.run({value:h[x],issues:[]},f);g instanceof Promise?P.push(g.then(m=>Wt(m,p,x,h,d))):Wt(g,p,x,h,d)}return u?Bu(P,h,p,f,n.value,e):P.length?Promise.all(P).then(()=>p):p}});function no(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Ce(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>xe(c,n,pe())))}),t)}o(no,"handleUnionResults");var Nr=b("$ZodUnion",(e,t)=>{H.init(e,t),W(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Vt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let f of t.options){let h=f._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)p.push(h),c=!0;else{if(h.issues.length===0)return h;p.push(h)}}return c?Promise.all(p).then(f=>no(f,i,e,u)):no(p,i,e,u)}});var yo=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Nr.init(e,t);let r=e._zod.parse;W(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[p,f]of Object.entries(c)){i[p]||(i[p]=new Set);for(let h of f)i[p].add(h)}}return i});let n=Bt(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of p){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!ft(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var ho=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Ln(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){p.add(typeof h=="number"?h.toString():h);let P=t.valueType._zod.run({value:i[h],issues:[]},n);P instanceof Promise?u.push(P.then($=>{$.issues.length&&r.issues.push(...ve(h,$.issues)),r.value[h]=$.value})):(P.issues.length&&r.issues.push(...ve(h,P.issues)),r.value[h]=P.value)}let f;for(let h in i)p.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&Or.test(p)&&f.issues.length){let $=t.keyType._zod.run({value:Number(p),issues:[]},n);if($ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");$.issues.length===0&&(f=$)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map($=>xe($,n,pe())),input:p,path:[p],inst:e});continue}let P=t.valueType._zod.run({value:i[p],issues:[]},n);P instanceof Promise?u.push(P.then($=>{$.issues.length&&r.issues.push(...ve(p,$.issues)),r.value[f.value]=$.value})):(P.issues.length&&r.issues.push(...ve(p,P.issues)),r.value[f.value]=P.value)}}return u.length?Promise.all(u).then(()=>r):r}});var vo=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=$r(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>jn.has(typeof i)).map(i=>typeof i=="string"?Ne(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),xo=b("$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"?Ne(n):n?Ne(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Po=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new jt(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 se;return r.value=i,r}});function oo(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(oo,"handleOptionalResult");var _o=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Vt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>oo(u,r.value)):oo(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var bo=b("$ZodNullable",(e,t)=>{H.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Vt(r.source)}|null)$`):void 0}),W(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 To=b("$ZodPipe",(e,t)=>{H.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>qt(c,t.in,n)):qt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>qt(u,t.out,n)):qt(i,t.out,n)}});function qt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(qt,"handlePipeResult");var Io=b("$ZodCustom",(e,t)=>{Pe.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(u=>io(u,r,n,e));io(i,r,n,e)}});function io(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(zr(i))}}o(io,"handleRefineResult");var So;var Cr=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 $o(){return new Cr}o($o,"registry");(So=globalThis).__zod_globalRegistry??(So.__zod_globalRegistry=$o());var Ur=globalThis.__zod_globalRegistry;function Ao(e,t){return new e({type:"string",...V(t)})}o(Ao,"_string");function zo(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(zo,"_coercedString");function Oo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(Oo,"_url");function ko(e,t){return new e({type:"number",checks:[],...V(t)})}o(ko,"_number");function wo(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(wo,"_coercedNumber");function Ro(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...V(t)})}o(Ro,"_int");function Do(e,t){return new e({type:"boolean",...V(t)})}o(Do,"_boolean");function No(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(No,"_coercedBoolean");function Co(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(Co,"_coercedBigint");function Uo(e){return new e({type:"any"})}o(Uo,"_any");function Mo(e){return new e({type:"unknown"})}o(Mo,"_unknown");function Lo(e,t){return new e({type:"void",...V(t)})}o(Lo,"_void");function jo(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(jo,"_coercedDate");function Kt(e,t){return new Kn({check:"greater_than",...V(t),value:e,inclusive:!0})}o(Kt,"_gte");function oe(e,t){return new Yn({check:"min_length",...V(t),minimum:e})}o(oe,"_minLength");function _e(e,t){return new Qn({check:"string_format",format:"regex",...V(t),pattern:e})}o(_e,"_regex");function Fo(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Fo,"_custom");var J=b("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)=>Ht(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>yt(e,r,n),e.parseAsync=async(r,n)=>Gt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ht(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>Zt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Yt=b("ZodMiniString",(e,t)=>{Jt.init(e,t),J.init(e,t)});function a(e){return Ao(Yt,e)}o(a,"string");var Bo=b("ZodMiniStringFormat",(e,t)=>{wr.init(e,t),Yt.init(e,t)});var tc=b("ZodMiniURL",(e,t)=>{ao.init(e,t),Bo.init(e,t)});function Vo(e){return Oo(tc,e)}o(Vo,"url");var Qt=b("ZodMiniNumber",(e,t)=>{Rr.init(e,t),J.init(e,t)});function X(e){return ko(Qt,e)}o(X,"number");var rc=b("ZodMiniNumberFormat",(e,t)=>{so.init(e,t),Qt.init(e,t)});function Zo(e){return Ro(rc,e)}o(Zo,"int");var Mr=b("ZodMiniBoolean",(e,t)=>{Dr.init(e,t),J.init(e,t)});function B(e){return Do(Mr,e)}o(B,"boolean");var Ho=b("ZodMiniBigInt",(e,t)=>{uo.init(e,t),J.init(e,t)});var nc=b("ZodMiniAny",(e,t)=>{co.init(e,t),J.init(e,t)});function xt(){return Uo(nc)}o(xt,"any");var oc=b("ZodMiniUnknown",(e,t)=>{lo.init(e,t),J.init(e,t)});function k(){return Mo(oc)}o(k,"unknown");var ic=b("ZodMiniVoid",(e,t)=>{po.init(e,t),J.init(e,t)});function Go(e){return Lo(ic,e)}o(Go,"_void");var qo=b("ZodMiniDate",(e,t)=>{mo.init(e,t),J.init(e,t)});var ac=b("ZodMiniArray",(e,t)=>{fo.init(e,t),J.init(e,t)});function D(e,t){return new ac({type:"array",element:e,...V(t)})}o(D,"array");var sc=b("ZodMiniObject",(e,t)=>{go.init(e,t),J.init(e,t),W(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...V(t)};return new sc(r)}o(l,"object");var uc=b("ZodMiniUnion",(e,t)=>{Nr.init(e,t),J.init(e,t)});function N(e,t){return new uc({type:"union",options:e,...V(t)})}o(N,"union");var cc=b("ZodMiniDiscriminatedUnion",(e,t)=>{yo.init(e,t),J.init(e,t)});function be(e,t,r){return new cc({type:"union",options:t,discriminator:e,...V(r)})}o(be,"discriminatedUnion");var lc=b("ZodMiniRecord",(e,t)=>{ho.init(e,t),J.init(e,t)});function w(e,t,r){return new lc({type:"record",keyType:e,valueType:t,...V(r)})}o(w,"record");var pc=b("ZodMiniEnum",(e,t)=>{vo.init(e,t),J.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new pc({type:"enum",entries:r,...V(t)})}o(U,"_enum");var dc=b("ZodMiniLiteral",(e,t)=>{xo.init(e,t),J.init(e,t)});function S(e,t){return new dc({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o(S,"literal");var mc=b("ZodMiniTransform",(e,t)=>{Po.init(e,t),J.init(e,t)});function Te(e){return new mc({type:"transform",transform:e})}o(Te,"transform");var fc=b("ZodMiniOptional",(e,t)=>{_o.init(e,t),J.init(e,t)});function y(e){return new fc({type:"optional",innerType:e})}o(y,"optional");var gc=b("ZodMiniNullable",(e,t)=>{bo.init(e,t),J.init(e,t)});function Pt(e){return new gc({type:"nullable",innerType:e})}o(Pt,"nullable");var yc=b("ZodMiniPipe",(e,t)=>{To.init(e,t),J.init(e,t)});function Ie(e,t){return new yc({type:"pipe",in:e,out:t})}o(Ie,"pipe");var hc=b("ZodMiniCustom",(e,t)=>{Io.init(e,t),J.init(e,t)});function er(e,t){return Fo(hc,e??(()=>!0),t)}o(er,"custom");var _t={};Dn(_t,{bigint:()=>Tc,boolean:()=>bc,date:()=>Ic,number:()=>_c,string:()=>Pc});function Pc(e){return zo(Yt,e)}o(Pc,"string");function _c(e){return wo(Qt,e)}o(_c,"number");function bc(e){return No(Mr,e)}o(bc,"boolean");function Tc(e){return Co(Ho,e)}o(Tc,"bigint");function Ic(e){return jo(qo,e)}o(Ic,"date");var jr=l({retryOnFailure:l({defaultValue:y(B()),hide:y(B())}),continueOnFailure:l({defaultValue:y(B()),hide:y(B())})}),Lr=class{constructor(t,r,n,i,u,c,p,f,h,P,$){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=P;this.aiMetadata=$}static{o(this,"IAction")}},Ee=o(e=>new Lr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=l({displayName:a(),description:y(a())}),C=o((e,t)=>l({type:S(t),required:B(),defaultValue:y(xt())}),"TPropertyValue");var ee=l({...F.shape,...C(a(),"SHORT_TEXT").shape}),de=l({...F.shape,...C(a(),"LONG_TEXT").shape});var Jo=l({label:a(),value:k()}),tr=l({disabled:y(B()),placeholder:y(a()),options:D(Jo)});var te=l({...F.shape,options:tr,...C(k(),"STATIC_DROPDOWN").shape}),me=l({...F.shape,options:tr,...C(D(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Fr=l({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:D(a())}),bt=l({...F.shape,...C(D(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:D(a())});var fe=l({...F.shape,...C(B(),"CHECKBOX").shape});var ge=l({...F.shape,...C(X(),"NUMBER").shape});var Tt=l({...F.shape,streaming:y(B()),...C(k(),"FILE").shape});var It=l({...F.shape,...C(a(),"DATE_TIME").shape});var Ko=w(a(),N([ee,de,te,bt,me,fe,ge,Tt,It])),Et=l({...F.shape,properties:Ko,...C(D(k()),"ARRAY").shape});var St=l({...F.shape,...C(N([w(a(),k())]),"JSON").shape});var Xo=N([ee,te,St,Et,me]),Sc=w(a(),Xo),Br=l({refreshers:D(a()),...F.shape,...C(k(),"DYNAMIC").shape});var rr=l({...F.shape,...C(Go(),"MARKDOWN").shape});var $t=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))($t||{}),Ue=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ue||{}),Me=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Me||{});var At=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(At||{}),Vr="both_client_credentials_and_authorization_code";var ze=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ze||{}),zt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(zt||{}),$c=l({strategy:U(zt),paramName:y(a())}),Ot=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Ot||{});var nr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(nr||{}),Yo=l({status:y(X()),body:y(k()),headers:y(w(a(),a()))}),Qo=l({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(U(nr))}),ei=l({type:S("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:Yo,handlerId:y(a()),streamStepProgress:y(U(nr))}),Ac=N([Qo,ei]);var zc=l({body:k(),rawBody:y(k()),headers:w(a(),a()),queryParams:w(a(),a())});function ie(e){return e==null}o(ie,"isNil");function kt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(kt,"isEmpty");function or(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(or,"assertNotNullOrUndefined");var Zr=De(require("crypto"),1);var Oc=128,Oe,Le,kc=o(e=>{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*Oc),Zr.default.randomFillSync(Oe),Le=0):Le+e>Oe.length&&(Zr.default.randomFillSync(Oe),Le=0),Le+=e},"fillPool"),wc=o(e=>(kc(e|=0),Oe.subarray(Le-e,Le)),"random"),Rc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let p=r(i),f=i;for(;f--;)if(c+=e[p[f]&n]||"",c.length===u)return c}}},"customRandom"),ri=o((e,t=21)=>Rc(e,t,wc),"customAlphabet");var Dc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ni=21,Gb=a().check(_e(new RegExp(`^[0-9a-zA-Z]{${ni}}$`))),Nc=ri(Dc,ni);var Se=Ie(Te(e=>e instanceof Date?e.toISOString():e),a()),re={id:a(),created:Se,updated:Se},Z=o(e=>y(Pt(e)),"Nullable");function Hr(e){return y(Pt(U(e)))}o(Hr,"NullableEnum");var Jb=Ie(Te(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(B())),ir=o(e=>Ie(Te(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(D(e))),"OptionalArrayFromQuery");var Yb=w(a(),k());var wt=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(wt||{});var lT=a().check(_e(/^#[0-9A-Fa-f]{6}$/));var dT=l({filename:a(),data:k(),type:S("file"),mimetype:y(a())});var Cc=De(ii());var xT=l({...re,name:a(),permissions:D(a()),platformId:Z(a()),type:a(),userCount:y(X())});var ai=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ai||{}),Gr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Gr||{}),qr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(qr||{});var Wr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Wr||{});var Jr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Jr||{});var Uc=l({mode:U(ai),value:k()}),Mc=l({auth:y(a()),fields:w(a(),Uc)}),Lc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(Mc)}),jc=l({type:S("PIECE"),toolName:a().check(oe(1)),pieceMetadata:Lc}),Fc=l({type:S("none")}),Bc=l({type:S("access_token"),accessToken:a()}),Vc=l({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),Zc=l({type:S("headers"),headers:w(a(),a())}),Hc=be("type",[Fc,Bc,Vc,Zc]),si=l({type:S("FLOW"),toolName:a().check(oe(1)),externalFlowId:a(),flowDisplayName:y(a())}),ui=l({type:S("MCP"),toolName:a().check(oe(1)),serverUrl:Vo(),protocol:U(qr),auth:Hc}),ci=l({type:S("KNOWLEDGE_BASE"),toolName:a().check(oe(1)),sourceType:U(Gr),sourceId:a(),sourceName:a()}),Gc=be("type",[jc,si,ui,ci]),qc=l({displayName:a(),description:y(a()),type:U(Wr)}),li=l({type:S("MARKDOWN"),markdown:a()}),je={type:S("TOOL_CALL"),input:Z(w(a(),k())),output:y(k()),toolName:a(),status:U(Jr),toolCallId:a(),startTime:a(),endTime:y(a())},KT=l(je),pi=be("toolCallType",[l({...je,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...je,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),l({...je,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),l({...je,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...je,toolCallType:S("UNKNOWN"),displayName:a()})]),Wc=N([li,pi]);var Kr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Kr||{}),ye=l({apiKey:a()}),Jc=ye,Kc=l({apiKey:a(),apiKeyHash:a()}),Xc=ye,Yc=ye,Qc=ye,el=ye,tl=ye,rl=ye,nl=ye,yi=l({accessKeyId:a().check(oe(1)),secretAccessKey:a().check(oe(1))}),ol=l({}),il=l({}),al=l({}),sl=l({}),ul=l({}),cl=l({}),hi=l({modelId:a(),modelName:a(),modelType:U(Kr)}),vi=l({apiKeyHeader:a(),baseUrl:a(),models:D(hi),defaultHeaders:y(w(a(),a()))}),xi=l({accountId:a(),gatewayId:a(),models:D(hi),vertexProject:y(a()),vertexRegion:y(a())}),Pi=l({resourceName:a(),apiVersion:Ie(Te(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),_i=l({region:a().check(oe(1))}),ll=N([Jc,Qc,el,tl,rl,Yc,Xc,Kc,yi,nl]),bi=N([vi,xi,Pi,_i,ol,al,sl,ul,il,cl]),pl=l({id:a(),name:a(),type:U(Kr)}),dl=l({id:a(),name:a(),provider:U(wt),config:bi,enabledForChat:B()}),ml=l({provider:U(wt),config:bi,auth:ll,platformId:a()});var eI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},di=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],fl=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],gl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],mi=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],yl=["grok-4.20","grok-4.1-fast"],hl={openai:di,anthropic:fl,google:mi,activepieces:[...gl.map(e=>`anthropic/${e}`),...di.map(e=>`openai/${e}`),...mi.map(e=>`google/${e}`),...yl.map(e=>`x-ai/${e}`)]};var fi=128e3,vl={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function xl({provider:e}){return e?vl[e]??fi:fi}o(xl,"getMaxContextTokens");var gi={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},Pl={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},_l=new Set(["anthropic","mistral"]);function ue(e){return{chatModels:hl[e],maxContextTokens:xl({provider:e}),defaultEmbeddingModel:gi[e],supportsEmbedding:gi[e]!==void 0,supportsImageGeneration:!_l.has(e),webSearch:Pl[e]}}o(ue,"buildProviderCapabilities");var bl={openai:ue("openai"),anthropic:ue("anthropic"),openrouter:ue("openrouter"),azure:ue("azure"),google:ue("google"),"cloudflare-gateway":ue("cloudflare-gateway"),custom:ue("custom"),bedrock:ue("bedrock"),mistral:ue("mistral"),activepieces:ue("activepieces")};var Tl=l({base64Url:a(),fileName:a(),extension:y(a())}),Il=l({mimeType:a(),url:a(),fileName:y(a())}),Xr=N([Tl,Il]);var El=N([l({type:S("file"),value:Xr}),l({type:S("markdown"),value:a(),files:y(D(Xr))})]),Sl=l({sessionId:a(),message:a(),files:y(D(a()))});var Ii=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ii||{}),Ei=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ei||{}),Yr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Yr||{});var $l=N([l({...re,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:D(l({value:a()}))})}),l({...re,name:a(),externalId:a(),type:N([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),Al=l({...re,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:Hr(Ei),trigger:Hr(Ii)}),zl=l({...re,tableId:a(),projectId:a(),cells:w(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),Ol=l({events:D(U(Yr)),webhookUrl:a(),flowId:a()}),kl=l({fields:D(l({id:a(),name:a()})),rows:D(w(a(),a())),name:a()}),wl=l({projectId:a(),limit:y(_t.number()),cursor:y(a()),name:y(a()),externalIds:ir(a()),folderId:y(a()),folderIds:ir(a())}),Rl=l({records:D(D(l({fieldId:a(),value:$i()}))),tableId:a()}),Dl=l({cells:y(D(l({fieldId:a(),value:$i()}))),tableId:a(),agentUpdate:y(B())}),Si=be("operator",[ke("eq"),ke("neq"),ke("gt"),ke("gte"),ke("lt"),ke("lte"),ke("co"),Ti("exists"),Ti("not_exists")]),Nl=l({tableId:a(),limit:y(_t.number()),cursor:y(a()),filters:ir(Si)});function $i(){return Ie(Te(e=>e==null?e:String(e)),Pt(a()))}o($i,"coerceToString");function ke(e){return l({fieldId:a(),operator:S(e),value:a()})}o(ke,"valueFilter");function Ti(e){return l({fieldId:a(),operator:S(e)})}o(Ti,"existenceFilter");var Cl=l({status:y(X()),body:y(k()),headers:y(w(a(),a()))}),Ul=l({...re,deleted:Z(Se),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var Ai=l({name:a(),description:y(a()),type:a(),required:B()}),Ml=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:D(Ai),returnsResponse:B()})});var zi="^[0-9]+\\.[0-9]+\\.[0-9]+$",xI=new RegExp(zi),jl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",PI=a().check(_e(new RegExp(zi))),_I=a().check(_e(new RegExp(jl))),Fl=l({packageType:S("ARCHIVE"),pieceType:U(Ue),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Oi=l({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ki=l({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),bI=N([Oi,ki]),TI=N([Fl,Oi,ki]);var Bl=be("type",[l({type:S("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:S("INTERVAL"),intervalMs:Zo().check(Kt(6e4))})]),II=l({...re,type:U(ze),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(Bl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),wi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(wi||{}),Ri=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Ri||{}),Di=(r=>(r.S3="S3",r.DB="DB",r))(Di||{}),EI=l({...re,projectId:Z(a()),platformId:Z(a()),type:U(wi),compression:U(Ri),data:y(k()),location:U(Di),size:Z(X()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(w(a(),a()))}),Ni=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ni||{}),Ci=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ci||{}),SI=l({id:a(),email:a(),firstName:a(),status:U(Ci),externalId:Z(a()),platformId:Z(a()),platformRole:U(Ni),lastName:a(),created:Se,updated:Se,lastActiveDate:Z(Se),imageUrl:Z(a())});var Qr=l({...F.shape,...C(w(a(),k()),"OBJECT").shape});var ji=l({...F.shape,...C(a(),"COLOR").shape});var en=N([ee,de,rr,fe,te,me,Fr,bt,Br,ge,Et,Qr,St,It,Tt,ji]),T={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 ce=l({displayName:a(),description:y(a())});var Fi=l({username:a(),password:a()}),tn=l({...ce.shape,username:l({displayName:a(),description:y(a())}),password:l({displayName:a(),description:y(a())}),...C(Fi,"BASIC_AUTH").shape});var Gl=w(a(),N([ee,de,ge,fe,te])),rn=l({...ce.shape,props:Gl,...C(k(),"CUSTOM_AUTH").shape});var we=l({...ce.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var ql=w(a(),N([ee,de,we,ge,fe,te,me,rr])),Bi=l({...ce.shape,props:ql,...C(k(),"OIDC").shape});var nn=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(nn||{}),Vi=N([ee,we,te]),Zi=w(a(),Vi),Wl=l({props:y(w(a(),Vi)),authUrl:a(),tokenUrl:a(),scope:D(a()),prompt:y(N([S("none"),S("consent"),S("login"),S("omit")])),pkce:y(B()),pkceMethod:y(N([S("plain"),S("S256")])),authorizationMethod:y(U(nn)),grantType:y(N([U(At),S(Vr)])),extra:y(w(a(),a()))}),Hi=l({access_token:a(),props:y(Zi),data:w(a(),xt())}),on=l({...ce.shape,...Wl.shape,...C(Hi,"OAUTH2").shape});var Fe=N([tn,rn,Bi,on,we]),Rt="Connection",sr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Rt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Rt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Rt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Rt}},None(){}};var oS={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 Jl=l({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var Kl=N([en,Fe]),an=w(a(),Kl),IS=w(a(),en);var Gi=N([l({strategy:S("CRON"),cronExpression:a()}),l({strategy:S("NONE")})]);var qi="2",ur="0.82.0";var sn=class{constructor(t,r,n,i,u,c,p,f,h=ur,P,$="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=P;this.description=$;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:qi}),"getContextInfo");(!Xl(h)||Yl(h,ur))&&(this.minimumSupportedRelease=ur),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Wi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new sn(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function Xl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Xl,"isValidSimpleSemver");function Yl(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(Yl,"isSemverLessThan");var Ql=y(w(a(),w(a(),a()))),Ji=l({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:D(a()),platformId:y(a()),directoryPath:y(a()),auth:y(N([Fe,D(Fe)])),version:a(),categories:y(D(U(Me))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),deprecated:y(B()),i18n:Ql}),ep=U(["human","ai","both"]),Ki=l({description:y(a()),idempotent:y(B())}),Xi=l({name:a(),displayName:a(),description:a(),props:an,requireAuth:B(),errorHandlingOptions:y(jr),outputSchema:y(er()),audience:y(ep),aiMetadata:y(Ki)}),Yi=l({name:a(),displayName:a(),description:a(),props:an,errorHandlingOptions:y(jr),type:U(ze),sampleData:k(),handshakeConfiguration:y(er()),renewConfiguration:y(Gi),testStrategy:U(Ot),outputSchema:y(er()),aiMetadata:y(Ki)}),tp=l({...Ji.shape,actions:w(a(),Xi),triggers:w(a(),Yi)}),rp=l({...Ji.shape,actions:X(),triggers:X(),suggestedActions:y(D(Xi)),suggestedTriggers:y(D(Yi))}),Qi=l({projectUsage:X(),pieceType:U(Ue),packageType:U($t),platformId:y(a()),archiveId:y(a())}),I$=l({...tp.shape,...Qi.shape}),E$=l({...rp.shape,...Qi.shape}),S$=l({name:a(),version:a()});var np=De(require("path")),op=De(require("fs/promises"));var ra=require("node:stream");var cr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var lr=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new un,r=new cn){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},un=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},cn=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 pr=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var dr=class extends cr{static{o(this,"FetchHttpClient")}constructor(t="",r=new lr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[L,Q]of Object.entries(c))i.append(L,Q);let p=i.toString(),f=p?`${n}?${p}`:n,h=t.responseType??"json",P=t.followRedirects??!0,$=t.retries??0,{body:x,extraHeaders:s,isStream:d}=ip(t.body,u),g=sp({...u,...s}),m=await ap(async()=>{let L=new AbortController,Q=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let ne={method:t.method.toString(),headers:g,body:x,redirect:P?"follow":"manual",signal:L.signal};return d&&(ne.duplex="half"),r?.dispatcher!==void 0&&(ne.dispatcher=r.dispatcher),await fetch(f,ne)}finally{Q!==void 0&&clearTimeout(Q)}},$),v=P?300:400;if(m.status<200||m.status>=v){let L=await ea(m,h),Q=new pr(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Q),Q}let _=await ea(m,h);return{status:m.status,headers:up(m.headers),body:_}}};function ip(e,t){if(lp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(cp(e)){let n=new ra.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(ip,"serializeBody");async function ea(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(ea,"parseResponseBody");async function ap(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await ta(n);continue}return i}catch(i){if(r=i,n<t){await ta(n);continue}throw i}throw r}o(ap,"sendWithRetries");function ta(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(ta,"backoff");function sp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(sp,"normalizeHeaders");function up(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(up,"toHttpHeaders");function cp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(cp,"isNodeFormData");function lp(e){return e==null}o(lp,"isNil");var Be=new dr;var Dt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Dt||{});var Xd=De(require("fs")),uu=De(su());var Yd={"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 Qd(e){let t=e.split(";")[0].trim().toLowerCase();return Yd[t]??""}o(Qd,"contentTypeToExtension");var em=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),tm=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 cu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:f="headers"}){return Ee({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:T.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:T.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
- i.e ${tm(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:T.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Dt).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:T.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:T.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:T.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:T.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let P=h,$={};switch(P){case"none":break;case"json":$.data=T.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":$.data=T.LongText({displayName:"Raw Body",required:!0});break;case"form_data":$.data=T.Array({displayName:"Form Data",required:!0,properties:{fieldName:T.ShortText({displayName:"Field Name",required:!0}),fieldType:T.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:T.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:T.File({displayName:"File Field Value",required:!1})}});break}return $},"props")}),response_is_binary:T.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:T.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:T.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:T.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async h=>{let{method:P,url:$,headers:x,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:_,followRedirects:L}=h.propsValue;or(P,"Method"),or($,"URL");let Q=ie(r)?{}:await r(h.auth,h.propsValue),ne=$.url,dt=ne.startsWith("http://")||ne.startsWith("https://")?ne:em({baseUrl:t(h.auth),relativePath:ne}),Ae={method:P,url:dt,headers:{...x??{},...f==="headers"||!ie(f)?Q:{}},queryParams:{...f==="queryParams"?Q:{},...s??{}},timeout:v?v*1e3:0,followRedirects:L};if(_&&(Ae.responseType="arraybuffer"),d)if(g&&g!=="none"){let le=d.data;if(g==="form_data"){let Iu=le,Lt=new uu.default;for(let{fieldName:kn,fieldType:wn,textFieldValue:Rn,fileFieldValue:Ir}of Iu)wn==="text"&&!kt(Rn)?Lt.append(kn,Rn):wn==="file"&&!kt(Ir)&&Lt.append(kn,Ir.data,{filename:Ir?.filename});Ae.body=Lt,Ae.headers={...Ae.headers,...Lt.getHeaders()}}else Ae.body=le}else g||(Ae.body=d);try{let le=await Be.sendRequest(Ae);return await rm(h.files,le.body,le.status,le.headers,_)}catch(le){if(m)return le.errorMessage();throw le}},"run")})}o(cu,"createCustomApiCallAction");var rm=o(async(e,t,r,n,i)=>{let u;if(i&&nm(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Qd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),nm=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var br="https://api.polydoc.tech",lu="/pdf/convert",Tr="/screenshot/convert",pu=[{label:"URL (render a web page)",value:"url"},{label:"HTML (render an inline HTML string)",value:"html"},{label:"Template (render a saved PolyDoc template by ID)",value:"template"}],du=[{label:"Download (return the file)",value:"download"},{label:"Cloud Storage (upload to a presigned URL)",value:"cloudStorage"},{label:"Webhook (deliver the file to a URL)",value:"webhook"}],mu=["A3","A4","A5","Ledger","Legal","Letter","Tabloid"],fu=["png","jpeg","webp"],gu=[{label:"Binary file (write the image to a file)",value:"binaryFile"},{label:"Base64 (return the image as a base64 string)",value:"base64"}],yu=[{label:"ZUGFeRD (Germany / EU)",value:"zugferd"},{label:"Factur-X (France / EU)",value:"facturx"}],hu=["minimum","basicwl","basic","en16931","extended"];var om=`Get an API key from the PolyDoc dashboard (dashboard.polydoc.tech, API Keys). It is sent as Authorization: Bearer <key>.
1
+ "use strict";var Su=Object.create;var mt=Object.defineProperty;var $u=Object.getOwnPropertyDescriptor;var Au=Object.getOwnPropertyNames;var zu=Object.getPrototypeOf,Ou=Object.prototype.hasOwnProperty;var o=(e,t)=>mt(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Dn=(e,t)=>{for(var r in t)mt(e,r,{get:t[r],enumerable:!0})},Nn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Au(t))!Ou.call(e,i)&&i!==r&&mt(e,i,{get:()=>t[i],enumerable:!(n=$u(t,i))||n.enumerable});return e};var De=(e,t,r)=>(r=e!=null?Su(zu(e)):{},Nn(t||!e||!e.__esModule?mt(r,"default",{value:e,enumerable:!0}):r,e)),ku=e=>Nn(mt({},"__esModule",{value:!0}),e);var ii=E((oi,sr)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(p.zoneIndex)||[])[0],_,L;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(L=d-g,_=":";L--;)_+="0:";return s=s.replace("::",_),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let Q=s.split(":"),ne=[];for(let dt=0;dt<Q.length;dt++)ne.push(parseInt(Q[dt],16));return ne})(),{parts:d,zoneId:v}}o(f,"expandIPv6");function h(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,_;for(;m>0;){if(_=g-m,_<0&&(_=0),s[v]>>_!==d[v]>>_)return!1;m-=g,v+=1}return!0}o(h,"matchCIDR");function P(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(P,"parseIntAuto");function $(s,d){for(;s.length<d;)s=`0${s}`;return s}o($,"padPart");let x={};x.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,_,L;for(v=3;v>=0;v-=1)if(_=this.octets[v],_ in m){if(L=m[_],g&&L!==0)return null;L!==8&&(g=!0),d+=L}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<4;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),_=[];for(let L=0;L<v.length;L++)g=v[L],_.push(P(g));return _})();if(d=s.match(r.longValue)){if(m=P(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],_;for(_=0;_<=24;_+=8)v.push(m>>_&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),_=[];if(m=P(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(m>>16&255),_.push(m>>8&255),_.push(m&255),_})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),_=[];if(m=P(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(P(v[1])),_.push(m>>8&255),_.push(m&255),_})():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=(function(){function s(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,_;for(let L=7;L>=0;L-=1)if(v=this.parts[L],v in m){if(_=m[v],g&&_!==0)return null;_!==16&&(g=!0),d+=_}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push($(this.parts[v].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new x.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,_;for(;_=d.exec(g);)_[0].length>v&&(m=_.index,v=_[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<16;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,g,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},x.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let d,g,m,v,_,L;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return f(s,8);if((m=s.match(p.transitional))&&(L=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+L,6),d.parts)){for(_=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<_.length;g++)if(v=_[g],!(0<=v&&v<=255))return null;return d.parts.push(_[0]<<8|_[1]),d.parts.push(_[2]<<8|_[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,g){let m,v,_,L;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(_=d[v],_[0]&&!(_[0]instanceof Array)&&(_=[_]),m=0;m<_.length;m++)if(L=_[m],s.kind()===L[0].kind()&&s.match.apply(s,L))return v}return g},typeof sr<"u"&&sr.exports?sr.exports=x:e.ipaddr=x})(oi)});var aa=E((WA,ia)=>{var oa=require("stream").Stream,mp=require("util");ia.exports=ae;function ae(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ae,"DelayedStream");mp.inherits(ae,oa);ae.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(ae.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ae.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ae.prototype.resume=function(){this._released||this.release(),this.source.resume()};ae.prototype.pause=function(){this.source.pause()};ae.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ae.prototype.pipe=function(){var e=oa.prototype.pipe.apply(this,arguments);return this.resume(),e};ae.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)};ae.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 la=E((KA,ca)=>{var fp=require("util"),ua=require("stream").Stream,sa=aa();ca.exports=q;function q(){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(q,"CombinedStream");fp.inherits(q,ua);q.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};q.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};q.prototype.append=function(e){var t=q.isStreamLike(e);if(t){if(!(e instanceof sa)){var r=sa.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};q.prototype.pipe=function(e,t){return ua.prototype.pipe.call(this,e,t),this.resume(),e};q.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}};q.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=q.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};q.prototype._pipeNext=function(e){this._currentStream=e;var t=q.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()};q.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};q.prototype.write=function(e){this.emit("data",e)};q.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};q.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")};q.prototype.end=function(){this._reset(),this.emit("end")};q.prototype.destroy=function(){this._reset(),this.emit("close")};q.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};q.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};q.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)};q.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var da=E((YA,pa)=>{"use strict";pa.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 ga=E(Y=>{"use strict";var mr=da(),gp=require("path").extname,ma=/^\s*([^;\s]*)(?:;|\s|$)/,yp=/^text\//i;Y.charset=fa;Y.charsets={lookup:fa};Y.contentType=hp;Y.extension=vp;Y.extensions=Object.create(null);Y.lookup=xp;Y.types=Object.create(null);Pp(Y.extensions,Y.types);function fa(e){if(!e||typeof e!="string")return!1;var t=ma.exec(e),r=t&&mr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&yp.test(t[1])?"UTF-8":!1}o(fa,"charset");function hp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Y.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Y.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(hp,"contentType");function vp(e){if(!e||typeof e!="string")return!1;var t=ma.exec(e),r=t&&Y.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(vp,"extension");function xp(e){if(!e||typeof e!="string")return!1;var t=gp("x."+e).toLowerCase().substr(1);return t&&Y.types[t]||!1}o(xp,"lookup");function Pp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(mr).forEach(o(function(i){var u=mr[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var f=c[p];if(t[f]){var h=r.indexOf(mr[t[f]].source),P=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(h>P||h===P&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Pp,"populateMaps")});var ha=E((tz,ya)=>{ya.exports=_p;function _p(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(_p,"defer")});var ln=E((nz,xa)=>{var va=ha();xa.exports=bp;function bp(e){var t=!1;return va(function(){t=!0}),o(function(n,i){t?e(n,i):va(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(bp,"async")});var pn=E((iz,Pa)=>{Pa.exports=Tp;function Tp(e){Object.keys(e.jobs).forEach(Ip.bind(e)),e.jobs={}}o(Tp,"abort");function Ip(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Ip,"clean")});var dn=E((sz,ba)=>{var _a=ln(),Ep=pn();ba.exports=Sp;function Sp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=$p(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Ep(r):r.results[i]=c,n(u,r.results))})}o(Sp,"iterate");function $p(e,t,r,n){var i;return e.length==2?i=e(r,_a(n)):i=e(r,t,_a(n)),i}o($p,"runJob")});var mn=E((cz,Ta)=>{Ta.exports=Ap;function Ap(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(Ap,"state")});var fn=E((pz,Ia)=>{var zp=pn(),Op=ln();Ia.exports=kp;function kp(e){Object.keys(this.jobs).length&&(this.index=this.size,zp(this),Op(e)(null,this.results))}o(kp,"terminator")});var Sa=E((mz,Ea)=>{var wp=dn(),Rp=mn(),Dp=fn();Ea.exports=Np;function Np(e,t,r){for(var n=Rp(e);n.index<(n.keyedList||e).length;)wp(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Dp.bind(n,r)}o(Np,"parallel")});var gn=E((gz,fr)=>{var $a=dn(),Cp=mn(),Up=fn();fr.exports=Mp;fr.exports.ascending=Aa;fr.exports.descending=Lp;function Mp(e,t,r,n){var i=Cp(e,r);return $a(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){$a(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Up.bind(i,n)}o(Mp,"serialOrdered");function Aa(e,t){return e<t?-1:e>t?1:0}o(Aa,"ascending");function Lp(e,t){return-1*Aa(e,t)}o(Lp,"descending")});var Oa=E((hz,za)=>{var jp=gn();za.exports=Fp;function Fp(e,t,r){return jp(e,t,null,r)}o(Fp,"serial")});var wa=E((xz,ka)=>{ka.exports={parallel:Sa(),serial:Oa(),serialOrdered:gn()}});var yn=E((Pz,Ra)=>{"use strict";Ra.exports=Object});var Na=E((_z,Da)=>{"use strict";Da.exports=Error});var Ua=E((bz,Ca)=>{"use strict";Ca.exports=EvalError});var La=E((Tz,Ma)=>{"use strict";Ma.exports=RangeError});var Fa=E((Iz,ja)=>{"use strict";ja.exports=ReferenceError});var Va=E((Ez,Ba)=>{"use strict";Ba.exports=SyntaxError});var gr=E((Sz,Za)=>{"use strict";Za.exports=TypeError});var Ga=E(($z,Ha)=>{"use strict";Ha.exports=URIError});var Wa=E((Az,qa)=>{"use strict";qa.exports=Math.abs});var Ka=E((zz,Ja)=>{"use strict";Ja.exports=Math.floor});var Ya=E((Oz,Xa)=>{"use strict";Xa.exports=Math.max});var es=E((kz,Qa)=>{"use strict";Qa.exports=Math.min});var rs=E((wz,ts)=>{"use strict";ts.exports=Math.pow});var os=E((Rz,ns)=>{"use strict";ns.exports=Math.round});var as=E((Dz,is)=>{"use strict";is.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var us=E((Cz,ss)=>{"use strict";var Bp=as();ss.exports=o(function(t){return Bp(t)||t===0?t:t<0?-1:1},"sign")});var ls=E((Mz,cs)=>{"use strict";cs.exports=Object.getOwnPropertyDescriptor});var hn=E((Lz,ps)=>{"use strict";var yr=ls();if(yr)try{yr([],"length")}catch{yr=null}ps.exports=yr});var ms=E((jz,ds)=>{"use strict";var hr=Object.defineProperty||!1;if(hr)try{hr({},"a",{value:1})}catch{hr=!1}ds.exports=hr});var vn=E((Fz,fs)=>{"use strict";fs.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var hs=E((Vz,ys)=>{"use strict";var gs=typeof Symbol<"u"&&Symbol,Vp=vn();ys.exports=o(function(){return typeof gs!="function"||typeof Symbol!="function"||typeof gs("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Vp()},"hasNativeSymbols")});var xn=E((Hz,vs)=>{"use strict";vs.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Pn=E((Gz,xs)=>{"use strict";var Zp=yn();xs.exports=Zp.getPrototypeOf||null});var bs=E((qz,_s)=>{"use strict";var Hp="Function.prototype.bind called on incompatible ",Gp=Object.prototype.toString,qp=Math.max,Wp="[object Function]",Ps=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Jp=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),Kp=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");_s.exports=o(function(t){var r=this;if(typeof r!="function"||Gp.apply(r)!==Wp)throw new TypeError(Hp+r);for(var n=Jp(arguments,1),i,u=o(function(){if(this instanceof i){var P=r.apply(this,Ps(n,arguments));return Object(P)===P?P:this}return r.apply(t,Ps(n,arguments))},"binder"),c=qp(0,r.length-n.length),p=[],f=0;f<c;f++)p[f]="$"+f;if(i=Function("binder","return function ("+Kp(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var Ve=E((Jz,Ts)=>{"use strict";var Xp=bs();Ts.exports=Function.prototype.bind||Xp});var vr=E((Kz,Is)=>{"use strict";Is.exports=Function.prototype.call});var _n=E((Xz,Es)=>{"use strict";Es.exports=Function.prototype.apply});var $s=E((Yz,Ss)=>{"use strict";Ss.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var zs=E((Qz,As)=>{"use strict";var Yp=Ve(),Qp=_n(),ed=vr(),td=$s();As.exports=td||Yp.call(ed,Qp)});var ks=E((eO,Os)=>{"use strict";var rd=Ve(),nd=gr(),od=vr(),id=zs();Os.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new nd("a function is required");return id(rd,od,t)},"callBindBasic")});var Us=E((rO,Cs)=>{"use strict";var ad=ks(),ws=hn(),Ds;try{Ds=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var bn=!!Ds&&ws&&ws(Object.prototype,"__proto__"),Ns=Object,Rs=Ns.getPrototypeOf;Cs.exports=bn&&typeof bn.get=="function"?ad([bn.get]):typeof Rs=="function"?o(function(t){return Rs(t==null?t:Ns(t))},"getDunder"):!1});var Bs=E((oO,Fs)=>{"use strict";var Ms=xn(),Ls=Pn(),js=Us();Fs.exports=Ms?o(function(t){return Ms(t)},"getProto"):Ls?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ls(t)},"getProto"):js?o(function(t){return js(t)},"getProto"):null});var Tn=E((aO,Vs)=>{"use strict";var sd=Function.prototype.call,ud=Object.prototype.hasOwnProperty,cd=Ve();Vs.exports=cd.call(sd,ud)});var Ks=E((sO,Js)=>{"use strict";var M,ld=yn(),pd=Na(),dd=Ua(),md=La(),fd=Fa(),qe=Va(),Ge=gr(),gd=Ga(),yd=Wa(),hd=Ka(),vd=Ya(),xd=es(),Pd=rs(),_d=os(),bd=us(),qs=Function,In=o(function(e){try{return qs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Ct=hn(),Td=ms(),En=o(function(){throw new Ge},"throwTypeError"),Id=Ct?(function(){try{return arguments.callee,En}catch{try{return Ct(arguments,"callee").get}catch{return En}}})():En,Ze=hs()(),K=Bs(),Ed=Pn(),Sd=xn(),Ws=_n(),Ut=vr(),He={},$d=typeof Uint8Array>"u"||!K?M:K(Uint8Array),Re={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ze&&K?K([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":He,"%AsyncGenerator%":He,"%AsyncGeneratorFunction%":He,"%AsyncIteratorPrototype%":He,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":pd,"%eval%":eval,"%EvalError%":dd,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":qs,"%GeneratorFunction%":He,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ze&&K?K(K([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ze||!K?M:K(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":ld,"%Object.getOwnPropertyDescriptor%":Ct,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":md,"%ReferenceError%":fd,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ze||!K?M:K(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ze&&K?K(""[Symbol.iterator]()):M,"%Symbol%":Ze?Symbol:M,"%SyntaxError%":qe,"%ThrowTypeError%":Id,"%TypedArray%":$d,"%TypeError%":Ge,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":gd,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Ut,"%Function.prototype.apply%":Ws,"%Object.defineProperty%":Td,"%Object.getPrototypeOf%":Ed,"%Math.abs%":yd,"%Math.floor%":hd,"%Math.max%":vd,"%Math.min%":xd,"%Math.pow%":Pd,"%Math.round%":_d,"%Math.sign%":bd,"%Reflect.getPrototypeOf%":Sd};if(K)try{null.error}catch(e){Zs=K(K(e)),Re["%Error.prototype%"]=Zs}var Zs,Ad=o(function e(t){var r;if(t==="%AsyncFunction%")r=In("async function () {}");else if(t==="%GeneratorFunction%")r=In("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=In("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&K&&(r=K(i.prototype))}return Re[t]=r,r},"doEval"),Hs={__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"]},Mt=Ve(),xr=Tn(),zd=Mt.call(Ut,Array.prototype.concat),Od=Mt.call(Ws,Array.prototype.splice),Gs=Mt.call(Ut,String.prototype.replace),Pr=Mt.call(Ut,String.prototype.slice),kd=Mt.call(Ut,RegExp.prototype.exec),wd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Rd=/\\(\\)?/g,Dd=o(function(t){var r=Pr(t,0,1),n=Pr(t,-1);if(r==="%"&&n!=="%")throw new qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new qe("invalid intrinsic syntax, expected opening `%`");var i=[];return Gs(t,wd,function(u,c,p,f){i[i.length]=p?Gs(f,Rd,"$1"):c||u}),i},"stringToPath"),Nd=o(function(t,r){var n=t,i;if(xr(Hs,n)&&(i=Hs[n],n="%"+i[0]+"%"),xr(Re,n)){var u=Re[n];if(u===He&&(u=Ad(n)),typeof u>"u"&&!r)throw new Ge("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new qe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Js.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ge("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ge('"allowMissing" argument must be a boolean');if(kd(/^%?[^%]*%?$/,t)===null)throw new qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Dd(t),i=n.length>0?n[0]:"",u=Nd("%"+i+"%",r),c=u.name,p=u.value,f=!1,h=u.alias;h&&(i=h[0],Od(n,zd([0,1],h)));for(var P=1,$=!0;P<n.length;P+=1){var x=n[P],s=Pr(x,0,1),d=Pr(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new qe("property names with quotes must have matching quotes");if((x==="constructor"||!$)&&(f=!0),i+="."+x,c="%"+i+"%",xr(Re,c))p=Re[c];else if(p!=null){if(!(x in p)){if(!r)throw new Ge("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ct&&P+1>=n.length){var g=Ct(p,x);$=!!g,$&&"get"in g&&!("originalValue"in g.get)?p=g.get:p=p[x]}else $=xr(p,x),p=p[x];$&&!f&&(Re[c]=p)}}return p},"GetIntrinsic")});var Ys=E((cO,Xs)=>{"use strict";var Cd=vn();Xs.exports=o(function(){return Cd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var tu=E((pO,eu)=>{"use strict";var Ud=Ks(),Qs=Ud("%Object.defineProperty%",!0),Md=Ys()(),Ld=Tn(),jd=gr(),_r=Md?Symbol.toStringTag:null;eu.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 jd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");_r&&(n||!Ld(t,_r))&&(Qs?Qs(t,_r,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[_r]=r)},"setToStringTag")});var nu=E((mO,ru)=>{"use strict";var Fd=Function.prototype.call,Bd=Object.prototype.hasOwnProperty,Vd=Ve();ru.exports=Vd.call(Fd,Bd)});var iu=E((fO,ou)=>{"use strict";ou.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var uu=E((gO,su)=>{"use strict";var zn=la(),Zd=require("util"),Sn=require("path"),Hd=require("http"),Gd=require("https"),qd=require("url").parse,Wd=require("fs"),Jd=require("stream").Stream,Kd=require("crypto"),$n=ga(),Xd=wa(),Yd=tu(),Ae=nu(),An=iu();function au(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(au,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],zn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");Zd.inherits(j,zn);j.LINE_BREAK=`\r
2
+ `;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=zn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};j.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ae(t,"httpVersion"))&&!(t instanceof Jd))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){Ae(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Wd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Ae(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ae(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+au(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&An(c,r.header);var p;for(var f in c)if(Ae(c,f)){if(p=c[f],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=f+": "+p.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+u+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=Sn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Sn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ae(e,"httpVersion")&&(r=Sn.basename(e.client._httpMessage.path||"")),r)return'filename="'+au(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=$n.lookup(e.name)),!r&&e&&e.path&&(r=$n.lookup(e.path)),!r&&e&&e.readable&&Ae(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=$n.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Ae(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+Kd.randomBytes(12).toString("hex")};j.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Xd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=qd(e),n=An({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=An(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Gd.request(n):r=Hd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,f=o(function(h,P){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,h,P)},"callback");p=f.bind(this,null),r.on("error",f),r.on("response",p)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};Yd(j.prototype,"FormData");su.exports=j});var mm={};Dn(mm,{polydoc:()=>dm});module.exports=ku(mm);var wu=Object.freeze({status:"aborted"});function b(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let h=c.prototype,P=Object.keys(h);for(let $=0;$<P.length;$++){let x=P[$];x in p||(p[x]=h[x].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var f;let h=r?.Parent?new u:this;n(h,p),(f=h._zod).deferred??(f.deferred=[]);for(let P of h._zod.deferred)P();return h}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(b,"$constructor");var se=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ft=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Er={};function pe(e){return e&&Object.assign(Er,e),Er}o(pe,"config");function $r(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($r,"getEnumValues");function Un(e,t){return typeof t=="bigint"?t.toString():t}o(Un,"jsonStringifyReplacer");function Vt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Vt,"cached");function Mn(e){return e==null}o(Mn,"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 Cn=Symbol("evaluating");function W(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Cn)return n===void 0&&(n=Cn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(W,"defineLazy");var Ar="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ft(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(ft,"isObject");var Ru=Vt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ln(e){if(ft(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ft(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Ln,"isPlainObject");var jn=new Set(["string","number","symbol"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ne,"escapeRegex");function Ht(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Ht,"clone");function V(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(V,"normalizeParams");function Fn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(Fn,"optionalKeys");var Bn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ce(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Ce,"aborted");function xe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(xe,"prefixIssues");function Bt(e){return typeof e=="string"?e:e?.message}o(Bt,"unwrapMessage");function Pe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Bt(e.inst?._zod.def?.error?.(e))??Bt(t?.error?.(e))??Bt(r.customError?.(e))??Bt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Pe,"finalizeIssue");function Vn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Vn,"getLengthableOrigin");function zr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(zr,"issue");var Zn=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,Un,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Hn=b("$ZodError",Zn),gt=b("$ZodError",Zn,{Parent:Error});var Nu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new se;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>Pe(f,u,pe())));throw Ar(p,i?.callee),p}return c.value},"_parse"),Gt=Nu(gt),Cu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>Pe(f,u,pe())));throw Ar(p,i?.callee),p}return c.value},"_parseAsync"),qt=Cu(gt),Uu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new se;return u.issues.length?{success:!1,error:new(e??Hn)(u.issues.map(c=>Pe(c,i,pe())))}:{success:!0,data:u.value}},"_safeParse"),yt=Uu(gt),Mu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Pe(c,i,pe())))}:{success:!0,data:u.value}},"_safeParseAsync"),ht=Mu(gt);var Lu="(?:(?:\\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])))",ju=new RegExp(`^${Lu}$`);var Gn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),qn=/^-?\d+n?$/,Wn=/^-?\d+$/,Or=/^-?\d+(?:\.\d+)?$/,Jn=/^(?:true|false)$/i;var _e=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Fu={number:"number",bigint:"bigint",object:"date"};var Kn=b("$ZodCheckGreaterThan",(e,t)=>{_e.init(e,t);let r=Fu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Xn=b("$ZodCheckNumberFormat",(e,t)=>{_e.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Bn[t.format];e._zod.onattach.push(c=>{let p=c._zod.bag;p.format=t.format,p.minimum=i,p.maximum=u,r&&(p.pattern=Wn)}),e._zod.check=c=>{let p=c.value;if(r){if(!Number.isInteger(p)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?c.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}p<i&&c.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>u&&c.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Yn=b("$ZodCheckMinLength",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Mn(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=Vn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var kr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;_e.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Qn=b("$ZodCheckRegex",(e,t)=>{kr.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 to={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=to;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,p,f)=>{let h=Ce(c),P;for(let $ of p){if($._zod.def.when){if(!$._zod.def.when(c))continue}else if(h)continue;let x=c.issues.length,s=$._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new se;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(h||(h=Ce(c,x)))});else{if(c.issues.length===x)continue;h||(h=Ce(c,x))}}return P?P.then(()=>c):c},"runChecks"),u=o((c,p,f)=>{if(Ce(c))return c.aborted=!0,c;let h=i(p,n,f);if(h instanceof Promise){if(f.async===!1)throw new se;return h.then(P=>e._zod.parse(P,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return h instanceof Promise?h.then(P=>u(P,c,p)):u(h,c,p)}let f=e._zod.parse(c,p);if(f instanceof Promise){if(p.async===!1)throw new se;return f.then(h=>i(h,n,p))}return i(f,n,p)}}W(e,"~standard",()=>({validate:o(i=>{try{let u=yt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return ht(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Kt=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Gn(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}}),wr=b("$ZodStringFormat",(e,t)=>{kr.init(e,t),Kt.init(e,t)});var ao=b("$ZodURL",(e,t)=>{wr.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 Rr=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??Or,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),so=b("$ZodNumberFormat",(e,t)=>{Xn.init(e,t),Rr.init(e,t)}),Dr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=Jn,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}}),uo=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=qn,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 co=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),lo=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var po=b("$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}}),mo=b("$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,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function ro(e,t,r){e.issues.length&&t.issues.push(...xe(r,e.issues)),t.value[r]=e.value}o(ro,"handleArrayResult");var fo=b("$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 u=[];for(let c=0;c<i.length;c++){let p=i[c],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?u.push(f.then(h=>ro(h,r,c))):ro(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Jt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...xe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Jt,"handlePropertyResult");function Bu(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=Fn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Bu,"normalizeDef");function Vu(e,t,r,n,i,u){let c=[],p=i.keySet,f=i.catchall._zod,h=f.def.type,P=f.optout==="optional";for(let $ in t){if(p.has($))continue;if(h==="never"){c.push($);continue}let x=f.run({value:t[$],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Jt(s,r,$,t,P))):Jt(x,r,$,t,P)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Vu,"handleCatchall");var go=b("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...p};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Vt(()=>Bu(t));W(e._zod,"propValues",()=>{let p=t.shape,f={};for(let h in p){let P=p[h]._zod;if(P.values){f[h]??(f[h]=new Set);for(let $ of P.values)f[h].add($)}}return f});let i=ft,u=t.catchall,c;e._zod.parse=(p,f)=>{c??(c=n.value);let h=p.value;if(!i(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;p.value={};let P=[],$=c.shape;for(let x of c.keys){let s=$[x],d=s._zod.optout==="optional",g=s._zod.run({value:h[x],issues:[]},f);g instanceof Promise?P.push(g.then(m=>Jt(m,p,x,h,d))):Jt(g,p,x,h,d)}return u?Vu(P,h,p,f,n.value,e):P.length?Promise.all(P).then(()=>p):p}});function no(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Ce(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Pe(c,n,pe())))}),t)}o(no,"handleUnionResults");var Nr=b("$ZodUnion",(e,t)=>{H.init(e,t),W(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Zt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let f of t.options){let h=f._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)p.push(h),c=!0;else{if(h.issues.length===0)return h;p.push(h)}}return c?Promise.all(p).then(f=>no(f,i,e,u)):no(p,i,e,u)}});var yo=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Nr.init(e,t);let r=e._zod.parse;W(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[p,f]of Object.entries(c)){i[p]||(i[p]=new Set);for(let h of f)i[p].add(h)}}return i});let n=Vt(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of p){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!ft(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var ho=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Ln(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){p.add(typeof h=="number"?h.toString():h);let P=t.valueType._zod.run({value:i[h],issues:[]},n);P instanceof Promise?u.push(P.then($=>{$.issues.length&&r.issues.push(...xe(h,$.issues)),r.value[h]=$.value})):(P.issues.length&&r.issues.push(...xe(h,P.issues)),r.value[h]=P.value)}let f;for(let h in i)p.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&Or.test(p)&&f.issues.length){let $=t.keyType._zod.run({value:Number(p),issues:[]},n);if($ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");$.issues.length===0&&(f=$)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map($=>Pe($,n,pe())),input:p,path:[p],inst:e});continue}let P=t.valueType._zod.run({value:i[p],issues:[]},n);P instanceof Promise?u.push(P.then($=>{$.issues.length&&r.issues.push(...xe(p,$.issues)),r.value[f.value]=$.value})):(P.issues.length&&r.issues.push(...xe(p,P.issues)),r.value[f.value]=P.value)}}return u.length?Promise.all(u).then(()=>r):r}});var vo=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=$r(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>jn.has(typeof i)).map(i=>typeof i=="string"?Ne(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),xo=b("$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"?Ne(n):n?Ne(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Po=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ft(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 se;return r.value=i,r}});function oo(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(oo,"handleOptionalResult");var _o=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(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(u=>oo(u,r.value)):oo(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var bo=b("$ZodNullable",(e,t)=>{H.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Zt(r.source)}|null)$`):void 0}),W(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 To=b("$ZodPipe",(e,t)=>{H.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Wt(c,t.in,n)):Wt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Wt(u,t.out,n)):Wt(i,t.out,n)}});function Wt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Wt,"handlePipeResult");var Io=b("$ZodCustom",(e,t)=>{_e.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(u=>io(u,r,n,e));io(i,r,n,e)}});function io(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(zr(i))}}o(io,"handleRefineResult");var So;var Cr=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 $o(){return new Cr}o($o,"registry");(So=globalThis).__zod_globalRegistry??(So.__zod_globalRegistry=$o());var Ur=globalThis.__zod_globalRegistry;function Ao(e,t){return new e({type:"string",...V(t)})}o(Ao,"_string");function zo(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(zo,"_coercedString");function Oo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(Oo,"_url");function ko(e,t){return new e({type:"number",checks:[],...V(t)})}o(ko,"_number");function wo(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(wo,"_coercedNumber");function Ro(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...V(t)})}o(Ro,"_int");function Do(e,t){return new e({type:"boolean",...V(t)})}o(Do,"_boolean");function No(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(No,"_coercedBoolean");function Co(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(Co,"_coercedBigint");function Uo(e){return new e({type:"any"})}o(Uo,"_any");function Mo(e){return new e({type:"unknown"})}o(Mo,"_unknown");function Lo(e,t){return new e({type:"void",...V(t)})}o(Lo,"_void");function jo(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(jo,"_coercedDate");function Xt(e,t){return new Kn({check:"greater_than",...V(t),value:e,inclusive:!0})}o(Xt,"_gte");function oe(e,t){return new Yn({check:"min_length",...V(t),minimum:e})}o(oe,"_minLength");function be(e,t){return new Qn({check:"string_format",format:"regex",...V(t),pattern:e})}o(be,"_regex");function Fo(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Fo,"_custom");var J=b("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)=>Gt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>yt(e,r,n),e.parseAsync=async(r,n)=>qt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ht(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)=>Ht(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Qt=b("ZodMiniString",(e,t)=>{Kt.init(e,t),J.init(e,t)});function a(e){return Ao(Qt,e)}o(a,"string");var Bo=b("ZodMiniStringFormat",(e,t)=>{wr.init(e,t),Qt.init(e,t)});var rc=b("ZodMiniURL",(e,t)=>{ao.init(e,t),Bo.init(e,t)});function Vo(e){return Oo(rc,e)}o(Vo,"url");var er=b("ZodMiniNumber",(e,t)=>{Rr.init(e,t),J.init(e,t)});function X(e){return ko(er,e)}o(X,"number");var nc=b("ZodMiniNumberFormat",(e,t)=>{so.init(e,t),er.init(e,t)});function Zo(e){return Ro(nc,e)}o(Zo,"int");var Mr=b("ZodMiniBoolean",(e,t)=>{Dr.init(e,t),J.init(e,t)});function B(e){return Do(Mr,e)}o(B,"boolean");var Ho=b("ZodMiniBigInt",(e,t)=>{uo.init(e,t),J.init(e,t)});var oc=b("ZodMiniAny",(e,t)=>{co.init(e,t),J.init(e,t)});function xt(){return Uo(oc)}o(xt,"any");var ic=b("ZodMiniUnknown",(e,t)=>{lo.init(e,t),J.init(e,t)});function k(){return Mo(ic)}o(k,"unknown");var ac=b("ZodMiniVoid",(e,t)=>{po.init(e,t),J.init(e,t)});function Go(e){return Lo(ac,e)}o(Go,"_void");var qo=b("ZodMiniDate",(e,t)=>{mo.init(e,t),J.init(e,t)});var sc=b("ZodMiniArray",(e,t)=>{fo.init(e,t),J.init(e,t)});function D(e,t){return new sc({type:"array",element:e,...V(t)})}o(D,"array");var uc=b("ZodMiniObject",(e,t)=>{go.init(e,t),J.init(e,t),W(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...V(t)};return new uc(r)}o(l,"object");var cc=b("ZodMiniUnion",(e,t)=>{Nr.init(e,t),J.init(e,t)});function N(e,t){return new cc({type:"union",options:e,...V(t)})}o(N,"union");var lc=b("ZodMiniDiscriminatedUnion",(e,t)=>{yo.init(e,t),J.init(e,t)});function Te(e,t,r){return new lc({type:"union",options:t,discriminator:e,...V(r)})}o(Te,"discriminatedUnion");var pc=b("ZodMiniRecord",(e,t)=>{ho.init(e,t),J.init(e,t)});function w(e,t,r){return new pc({type:"record",keyType:e,valueType:t,...V(r)})}o(w,"record");var dc=b("ZodMiniEnum",(e,t)=>{vo.init(e,t),J.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new dc({type:"enum",entries:r,...V(t)})}o(U,"_enum");var mc=b("ZodMiniLiteral",(e,t)=>{xo.init(e,t),J.init(e,t)});function S(e,t){return new mc({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o(S,"literal");var fc=b("ZodMiniTransform",(e,t)=>{Po.init(e,t),J.init(e,t)});function Ie(e){return new fc({type:"transform",transform:e})}o(Ie,"transform");var gc=b("ZodMiniOptional",(e,t)=>{_o.init(e,t),J.init(e,t)});function y(e){return new gc({type:"optional",innerType:e})}o(y,"optional");var yc=b("ZodMiniNullable",(e,t)=>{bo.init(e,t),J.init(e,t)});function Pt(e){return new yc({type:"nullable",innerType:e})}o(Pt,"nullable");var hc=b("ZodMiniPipe",(e,t)=>{To.init(e,t),J.init(e,t)});function Ee(e,t){return new hc({type:"pipe",in:e,out:t})}o(Ee,"pipe");var vc=b("ZodMiniCustom",(e,t)=>{Io.init(e,t),J.init(e,t)});function tr(e,t){return Fo(vc,e??(()=>!0),t)}o(tr,"custom");var _t={};Dn(_t,{bigint:()=>Ic,boolean:()=>Tc,date:()=>Ec,number:()=>bc,string:()=>_c});function _c(e){return zo(Qt,e)}o(_c,"string");function bc(e){return wo(er,e)}o(bc,"number");function Tc(e){return No(Mr,e)}o(Tc,"boolean");function Ic(e){return Co(Ho,e)}o(Ic,"bigint");function Ec(e){return jo(qo,e)}o(Ec,"date");var jr=l({retryOnFailure:l({defaultValue:y(B()),hide:y(B())}),continueOnFailure:l({defaultValue:y(B()),hide:y(B())})}),Lr=class{constructor(t,r,n,i,u,c,p,f,h,P,$){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=P;this.aiMetadata=$}static{o(this,"IAction")}},Se=o(e=>new Lr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=l({displayName:a(),description:y(a())}),C=o((e,t)=>l({type:S(t),required:B(),defaultValue:y(xt())}),"TPropertyValue");var ee=l({...F.shape,...C(a(),"SHORT_TEXT").shape}),de=l({...F.shape,...C(a(),"LONG_TEXT").shape});var Jo=l({label:a(),value:k()}),rr=l({disabled:y(B()),placeholder:y(a()),options:D(Jo)});var te=l({...F.shape,options:rr,...C(k(),"STATIC_DROPDOWN").shape}),me=l({...F.shape,options:rr,...C(D(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Fr=l({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:D(a())}),bt=l({...F.shape,...C(D(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:D(a())});var fe=l({...F.shape,...C(B(),"CHECKBOX").shape});var ge=l({...F.shape,...C(X(),"NUMBER").shape});var Tt=l({...F.shape,streaming:y(B()),...C(k(),"FILE").shape});var It=l({...F.shape,...C(a(),"DATE_TIME").shape});var Ko=w(a(),N([ee,de,te,bt,me,fe,ge,Tt,It])),Et=l({...F.shape,properties:Ko,...C(D(k()),"ARRAY").shape});var St=l({...F.shape,...C(N([w(a(),k())]),"JSON").shape});var Xo=N([ee,te,St,Et,me]),$c=w(a(),Xo),Br=l({refreshers:D(a()),...F.shape,...C(k(),"DYNAMIC").shape});var nr=l({...F.shape,...C(Go(),"MARKDOWN").shape});var $t=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))($t||{}),Ue=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ue||{}),Me=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Me||{});var At=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(At||{}),Vr="both_client_credentials_and_authorization_code";var ze=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ze||{}),zt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(zt||{}),Ac=l({strategy:U(zt),paramName:y(a())}),Ot=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Ot||{});var or=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(or||{}),Yo=l({status:y(X()),body:y(k()),headers:y(w(a(),a()))}),Qo=l({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(U(or))}),ei=l({type:S("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:Yo,handlerId:y(a()),streamStepProgress:y(U(or))}),zc=N([Qo,ei]);var Oc=l({body:k(),rawBody:y(k()),headers:w(a(),a()),queryParams:w(a(),a())});function ie(e){return e==null}o(ie,"isNil");function kt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(kt,"isEmpty");function ir(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(ir,"assertNotNullOrUndefined");var Zr=De(require("crypto"),1);var kc=128,Oe,Le,wc=o(e=>{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*kc),Zr.default.randomFillSync(Oe),Le=0):Le+e>Oe.length&&(Zr.default.randomFillSync(Oe),Le=0),Le+=e},"fillPool"),Rc=o(e=>(wc(e|=0),Oe.subarray(Le-e,Le)),"random"),Dc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let p=r(i),f=i;for(;f--;)if(c+=e[p[f]&n]||"",c.length===u)return c}}},"customRandom"),ri=o((e,t=21)=>Dc(e,t,Rc),"customAlphabet");var Nc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ni=21,Wb=a().check(be(new RegExp(`^[0-9a-zA-Z]{${ni}}$`))),Cc=ri(Nc,ni);var $e=Ee(Ie(e=>e instanceof Date?e.toISOString():e),a()),re={id:a(),created:$e,updated:$e},Z=o(e=>y(Pt(e)),"Nullable");function Hr(e){return y(Pt(U(e)))}o(Hr,"NullableEnum");var Xb=Ee(Ie(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(B())),ar=o(e=>Ee(Ie(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(D(e))),"OptionalArrayFromQuery");var eT=w(a(),k());var wt=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(wt||{});var dT=a().check(be(/^#[0-9A-Fa-f]{6}$/));var fT=l({filename:a(),data:k(),type:S("file"),mimetype:y(a())});var Uc=De(ii());var _T=l({...re,name:a(),permissions:D(a()),platformId:Z(a()),type:a(),userCount:y(X())});var ai=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ai||{}),Gr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Gr||{}),qr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(qr||{});var Wr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Wr||{});var Jr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Jr||{});var Mc=l({mode:U(ai),value:k()}),Lc=l({auth:y(a()),fields:w(a(),Mc)}),jc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(Lc)}),Fc=l({type:S("PIECE"),toolName:a().check(oe(1)),pieceMetadata:jc}),Bc=l({type:S("none")}),Vc=l({type:S("access_token"),accessToken:a()}),Zc=l({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),Hc=l({type:S("headers"),headers:w(a(),a())}),Gc=Te("type",[Bc,Vc,Zc,Hc]),si=l({type:S("FLOW"),toolName:a().check(oe(1)),externalFlowId:a(),flowDisplayName:y(a())}),ui=l({type:S("MCP"),toolName:a().check(oe(1)),serverUrl:Vo(),protocol:U(qr),auth:Gc}),ci=l({type:S("KNOWLEDGE_BASE"),toolName:a().check(oe(1)),sourceType:U(Gr),sourceId:a(),sourceName:a()}),qc=Te("type",[Fc,si,ui,ci]),Wc=l({displayName:a(),description:y(a()),type:U(Wr)}),li=l({type:S("MARKDOWN"),markdown:a()}),je={type:S("TOOL_CALL"),input:Z(w(a(),k())),output:y(k()),toolName:a(),status:U(Jr),toolCallId:a(),startTime:a(),endTime:y(a())},YT=l(je),pi=Te("toolCallType",[l({...je,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...je,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),l({...je,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),l({...je,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...je,toolCallType:S("UNKNOWN"),displayName:a()})]),Jc=N([li,pi]);var Kr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Kr||{}),ye=l({apiKey:a()}),Kc=ye,Xc=l({apiKey:a(),apiKeyHash:a()}),Yc=ye,Qc=ye,el=ye,tl=ye,rl=ye,nl=ye,ol=ye,yi=l({accessKeyId:a().check(oe(1)),secretAccessKey:a().check(oe(1))}),il=l({}),al=l({}),sl=l({}),ul=l({}),cl=l({}),ll=l({}),hi=l({modelId:a(),modelName:a(),modelType:U(Kr)}),vi=l({apiKeyHeader:a(),baseUrl:a(),models:D(hi),defaultHeaders:y(w(a(),a()))}),xi=l({accountId:a(),gatewayId:a(),models:D(hi),vertexProject:y(a()),vertexRegion:y(a())}),Pi=l({resourceName:a(),apiVersion:Ee(Ie(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),_i=l({region:a().check(oe(1))}),pl=N([Kc,el,tl,rl,nl,Qc,Yc,Xc,yi,ol]),bi=N([vi,xi,Pi,_i,il,sl,ul,cl,al,ll]),dl=l({id:a(),name:a(),type:U(Kr)}),ml=l({id:a(),name:a(),provider:U(wt),config:bi,enabledForChat:B()}),fl=l({provider:U(wt),config:bi,auth:pl,platformId:a()});var rI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},di=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],gl=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],yl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],mi=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],hl=["grok-4.20","grok-4.1-fast"],vl={openai:di,anthropic:gl,google:mi,activepieces:[...yl.map(e=>`anthropic/${e}`),...di.map(e=>`openai/${e}`),...mi.map(e=>`google/${e}`),...hl.map(e=>`x-ai/${e}`)]};var fi=128e3,xl={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Pl({provider:e}){return e?xl[e]??fi:fi}o(Pl,"getMaxContextTokens");var gi={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},_l={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},bl=new Set(["anthropic","mistral"]);function ue(e){return{chatModels:vl[e],maxContextTokens:Pl({provider:e}),defaultEmbeddingModel:gi[e],supportsEmbedding:gi[e]!==void 0,supportsImageGeneration:!bl.has(e),webSearch:_l[e]}}o(ue,"buildProviderCapabilities");var Tl={openai:ue("openai"),anthropic:ue("anthropic"),openrouter:ue("openrouter"),azure:ue("azure"),google:ue("google"),"cloudflare-gateway":ue("cloudflare-gateway"),custom:ue("custom"),bedrock:ue("bedrock"),mistral:ue("mistral"),activepieces:ue("activepieces")};var Il=l({base64Url:a(),fileName:a(),extension:y(a())}),El=l({mimeType:a(),url:a(),fileName:y(a())}),Xr=N([Il,El]);var Sl=N([l({type:S("file"),value:Xr}),l({type:S("markdown"),value:a(),files:y(D(Xr))})]),$l=l({sessionId:a(),message:a(),files:y(D(a()))});var Ii=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ii||{}),Ei=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ei||{}),Yr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Yr||{});var Al=N([l({...re,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:D(l({value:a()}))})}),l({...re,name:a(),externalId:a(),type:N([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),zl=l({...re,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:Hr(Ei),trigger:Hr(Ii)}),Ol=l({...re,tableId:a(),projectId:a(),cells:w(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),kl=l({events:D(U(Yr)),webhookUrl:a(),flowId:a()}),wl=l({fields:D(l({id:a(),name:a()})),rows:D(w(a(),a())),name:a()}),Rl=l({projectId:a(),limit:y(_t.number()),cursor:y(a()),name:y(a()),externalIds:ar(a()),folderId:y(a()),folderIds:ar(a())}),Dl=l({records:D(D(l({fieldId:a(),value:$i()}))),tableId:a()}),Nl=l({cells:y(D(l({fieldId:a(),value:$i()}))),tableId:a(),agentUpdate:y(B())}),Si=Te("operator",[ke("eq"),ke("neq"),ke("gt"),ke("gte"),ke("lt"),ke("lte"),ke("co"),Ti("exists"),Ti("not_exists")]),Cl=l({tableId:a(),limit:y(_t.number()),cursor:y(a()),filters:ar(Si)});function $i(){return Ee(Ie(e=>e==null?e:String(e)),Pt(a()))}o($i,"coerceToString");function ke(e){return l({fieldId:a(),operator:S(e),value:a()})}o(ke,"valueFilter");function Ti(e){return l({fieldId:a(),operator:S(e)})}o(Ti,"existenceFilter");var Ul=l({status:y(X()),body:y(k()),headers:y(w(a(),a()))}),Ml=l({...re,deleted:Z($e),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var Ai=l({name:a(),description:y(a()),type:a(),required:B()}),Ll=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:D(Ai),returnsResponse:B()})});var zi="^[0-9]+\\.[0-9]+\\.[0-9]+$",_I=new RegExp(zi),Fl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",bI=a().check(be(new RegExp(zi))),TI=a().check(be(new RegExp(Fl))),Bl=l({packageType:S("ARCHIVE"),pieceType:U(Ue),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Oi=l({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ki=l({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),II=N([Oi,ki]),EI=N([Bl,Oi,ki]);var Vl=Te("type",[l({type:S("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:S("INTERVAL"),intervalMs:Zo().check(Xt(6e4))})]),SI=l({...re,type:U(ze),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(Vl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),wi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(wi||{}),Ri=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Ri||{}),Di=(r=>(r.S3="S3",r.DB="DB",r))(Di||{}),$I=l({...re,projectId:Z(a()),platformId:Z(a()),type:U(wi),compression:U(Ri),data:y(k()),location:U(Di),size:Z(X()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(w(a(),a()))}),Ni=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ni||{}),Ci=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ci||{}),AI=l({id:a(),email:a(),firstName:a(),status:U(Ci),externalId:Z(a()),platformId:Z(a()),platformRole:U(Ni),lastName:a(),created:$e,updated:$e,lastActiveDate:Z($e),imageUrl:Z(a())});var Qr=l({...F.shape,...C(w(a(),k()),"OBJECT").shape});var ji=l({...F.shape,...C(a(),"COLOR").shape});var en=N([ee,de,nr,fe,te,me,Fr,bt,Br,ge,Et,Qr,St,It,Tt,ji]),T={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 ce=l({displayName:a(),description:y(a())});var Fi=l({username:a(),password:a()}),tn=l({...ce.shape,username:l({displayName:a(),description:y(a())}),password:l({displayName:a(),description:y(a())}),...C(Fi,"BASIC_AUTH").shape});var ql=w(a(),N([ee,de,ge,fe,te])),rn=l({...ce.shape,props:ql,...C(k(),"CUSTOM_AUTH").shape});var we=l({...ce.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var Wl=w(a(),N([ee,de,we,ge,fe,te,me,nr])),Bi=l({...ce.shape,props:Wl,...C(k(),"OIDC").shape});var nn=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(nn||{}),Vi=N([ee,we,te]),Zi=w(a(),Vi),Jl=l({props:y(w(a(),Vi)),authUrl:a(),tokenUrl:a(),scope:D(a()),prompt:y(N([S("none"),S("consent"),S("login"),S("omit")])),pkce:y(B()),pkceMethod:y(N([S("plain"),S("S256")])),authorizationMethod:y(U(nn)),grantType:y(N([U(At),S(Vr)])),extra:y(w(a(),a()))}),Hi=l({access_token:a(),props:y(Zi),data:w(a(),xt())}),on=l({...ce.shape,...Jl.shape,...C(Hi,"OAUTH2").shape});var Fe=N([tn,rn,Bi,on,we]),Rt="Connection",ur={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Rt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Rt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Rt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Rt}},None(){}};var aS={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 Kl=l({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var Xl=N([en,Fe]),an=w(a(),Xl),SS=w(a(),en);var Gi=N([l({strategy:S("CRON"),cronExpression:a()}),l({strategy:S("NONE")})]);var qi="2",cr="0.82.0";var sn=class{constructor(t,r,n,i,u,c,p,f,h=cr,P,$="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=P;this.description=$;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:qi}),"getContextInfo");(!Yl(h)||Ql(h,cr))&&(this.minimumSupportedRelease=cr),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Wi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new sn(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function Yl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Yl,"isValidSimpleSemver");function Ql(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(Ql,"isSemverLessThan");var ep=y(w(a(),w(a(),a()))),Ji=l({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:D(a()),platformId:y(a()),directoryPath:y(a()),auth:y(N([Fe,D(Fe)])),version:a(),categories:y(D(U(Me))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),deprecated:y(B()),i18n:ep}),tp=U(["human","ai","both"]),Ki=l({description:y(a()),idempotent:y(B())}),Xi=l({name:a(),displayName:a(),description:a(),props:an,requireAuth:B(),errorHandlingOptions:y(jr),outputSchema:y(tr()),audience:y(tp),aiMetadata:y(Ki)}),Yi=l({name:a(),displayName:a(),description:a(),props:an,errorHandlingOptions:y(jr),type:U(ze),sampleData:k(),handshakeConfiguration:y(tr()),renewConfiguration:y(Gi),testStrategy:U(Ot),outputSchema:y(tr()),aiMetadata:y(Ki)}),rp=l({...Ji.shape,actions:w(a(),Xi),triggers:w(a(),Yi)}),np=l({...Ji.shape,actions:X(),triggers:X(),suggestedActions:y(D(Xi)),suggestedTriggers:y(D(Yi))}),Qi=l({projectUsage:X(),pieceType:U(Ue),packageType:U($t),platformId:y(a()),archiveId:y(a())}),S$=l({...rp.shape,...Qi.shape}),$$=l({...np.shape,...Qi.shape}),A$=l({name:a(),version:a()});var op=De(require("path")),ip=De(require("fs/promises"));var na=require("node:stream");var lr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var pr=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new un,r=new cn){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},un=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},cn=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 Dt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function ea({error:e,requestBody:t}){return e instanceof Dt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(ea,"toFailsafeOutput");var Nt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Nt||{});var dr=class extends lr{static{o(this,"FetchHttpClient")}constructor(t="",r=new pr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[L,Q]of Object.entries(c))i.append(L,Q);let p=i.toString(),f=p?`${n}?${p}`:n,h=t.responseType??"json",P=t.followRedirects??!0,$=t.retries??0,{body:x,extraHeaders:s,isStream:d}=ap(t.method)?sp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},g=cp({...u,...s}),m=await up(async()=>{let L=new AbortController,Q=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let ne={method:t.method.toString(),headers:g,body:x,redirect:P?"follow":"manual",signal:L.signal};return d&&(ne.duplex="half"),r?.dispatcher!==void 0&&(ne.dispatcher=r.dispatcher),await fetch(f,ne)}finally{Q!==void 0&&clearTimeout(Q)}},$),v=P?300:400;if(m.status<200||m.status>=v){let L=await ta(m,h),Q=new Dt(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Q),Q}let _=await ta(m,h);return{status:m.status,headers:lp(m.headers),body:_}}};function ap(e){return e!=="GET"&&e!=="HEAD"}o(ap,"acceptsRequestBody");function sp(e,t){if(dp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(pp(e)){let n=new na.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(sp,"serializeBody");async function ta(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(ta,"parseResponseBody");async function up(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await ra(n);continue}return i}catch(i){if(r=i,n<t){await ra(n);continue}throw i}throw r}o(up,"sendWithRetries");function ra(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(ra,"backoff");function cp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(cp,"normalizeHeaders");function lp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(lp,"toHttpHeaders");function pp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(pp,"isNodeFormData");function dp(e){return e==null}o(dp,"isNil");var Be=new dr;var Qd=De(require("fs")),cu=De(uu());var em={"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 tm(e){let t=e.split(";")[0].trim().toLowerCase();return em[t]??""}o(tm,"contentTypeToExtension");var rm=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),nm=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 lu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:f="headers"}){return Se({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:T.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:T.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${nm(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:T.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Nt).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:T.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:T.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:T.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:T.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let P=h,$={};switch(P){case"none":break;case"json":$.data=T.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":$.data=T.LongText({displayName:"Raw Body",required:!0});break;case"form_data":$.data=T.Array({displayName:"Form Data",required:!0,properties:{fieldName:T.ShortText({displayName:"Field Name",required:!0}),fieldType:T.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:T.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:T.File({displayName:"File Field Value",required:!1})}});break}return $},"props")}),response_is_binary:T.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:T.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:T.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:T.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async h=>{let{method:P,url:$,headers:x,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:_,followRedirects:L}=h.propsValue;ir(P,"Method"),ir($,"URL");let Q=ie(r)?{}:await r(h.auth,h.propsValue),ne=$.url,dt=ne.startsWith("http://")||ne.startsWith("https://")?ne:rm({baseUrl:t(h.auth),relativePath:ne}),ve={method:P,url:dt,headers:{...x??{},...f==="headers"||!ie(f)?Q:{}},queryParams:{...f==="queryParams"?Q:{},...s??{}},timeout:v?v*1e3:0,followRedirects:L};if(_&&(ve.responseType="arraybuffer"),d)if(g&&g!=="none"){let le=d.data;if(g==="form_data"){let Eu=le,jt=new cu.default;for(let{fieldName:kn,fieldType:wn,textFieldValue:Rn,fileFieldValue:Ir}of Eu)wn==="text"&&!kt(Rn)?jt.append(kn,Rn):wn==="file"&&!kt(Ir)&&jt.append(kn,Ir.data,{filename:Ir?.filename});ve.body=jt,ve.headers={...ve.headers,...jt.getHeaders()}}else ve.body=le}else g||(ve.body=d);try{let le=await Be.sendRequest(ve);return await om(h.files,le.body,le.status,le.headers,_)}catch(le){if(m)return ea({error:le,requestBody:ve.body});throw le}},"run")})}o(lu,"createCustomApiCallAction");var om=o(async(e,t,r,n,i)=>{let u;if(i&&im(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=tm(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),im=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var br="https://api.polydoc.tech",pu="/pdf/convert",Tr="/screenshot/convert",du=[{label:"URL (render a web page)",value:"url"},{label:"HTML (render an inline HTML string)",value:"html"},{label:"Template (render a saved PolyDoc template by ID)",value:"template"}],mu=[{label:"Download (return the file)",value:"download"},{label:"Cloud Storage (upload to a presigned URL)",value:"cloudStorage"},{label:"Webhook (deliver the file to a URL)",value:"webhook"}],fu=["A3","A4","A5","Ledger","Legal","Letter","Tabloid"],gu=["png","jpeg","webp"],yu=[{label:"Binary file (write the image to a file)",value:"binaryFile"},{label:"Base64 (return the image as a base64 string)",value:"base64"}],hu=[{label:"ZUGFeRD (Germany / EU)",value:"zugferd"},{label:"Factur-X (France / EU)",value:"facturx"}],vu=["minimum","basicwl","basic","en16931","extended"];var am=`Get an API key from the PolyDoc dashboard (dashboard.polydoc.tech, API Keys). It is sent as Authorization: Bearer <key>.
4
4
 
5
- Turn on **Sandbox** to test against sandbox quota (output is watermarked). Leave it off for production conversions.`,he=sr.CustomAuth({description:om,required:!0,props:{apiKey:sr.SecretText({displayName:"API Key",description:"Your PolyDoc API key from dashboard.polydoc.tech.",required:!0}),sandbox:T.Checkbox({displayName:"Sandbox",description:"Use sandbox quota (watermarked output).",required:!1,defaultValue:!1})},validate:o(async({auth:e})=>{let t=e.apiKey;if(!t)return{valid:!1,error:"API key is required."};try{return await Be.sendRequest({method:"POST",url:`${br.replace(/\/+$/,"")}${Tr}`,headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","X-Sandbox":e.sandbox?"true":"false"},body:{source:"<p>polydoc</p>",screenshot:{type:"png"}},responseType:"arraybuffer"}),{valid:!0}}catch(r){let n=r?.response?.status;return n===401?{valid:!1,error:"Invalid PolyDoc API key."}:{valid:!1,error:`Could not validate the PolyDoc API key (${n?`the API returned HTTP ${n}`:"the API was unreachable"}). Check the key and try again.`}}},"validate")});function vu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(vu,"isPlainObject");function xu(e,t){let r={...e};for(let[n,i]of Object.entries(t))vu(i)&&vu(r[n])?r[n]=xu(r[n],i):r[n]=i;return r}o(xu,"mergeDeep");function im(e){switch(e.sourceType){case"url":return e.url??"";case"html":return e.html??"";case"template":return`[template:${e.templateId??""}]`;default:return""}}o(im,"resolveSource");function am(e){let t={};typeof e.format=="string"&&e.format!==""&&(t.format=e.format);for(let n of["landscape","printBackground","outline","tagged"])typeof e[n]=="boolean"&&(t[n]=e[n]);return typeof e.scale=="number"&&(t.scale=e.scale),typeof e.pageRanges=="string"&&e.pageRanges!==""&&(t.pageRanges=e.pageRanges),["marginTop","marginRight","marginBottom","marginLeft"].some(n=>e[n]!==void 0&&e[n]!=="")&&(t.margin={top:e.marginTop??"2",right:e.marginRight??"1",bottom:e.marginBottom??"2",left:e.marginLeft??"1"}),Object.keys(t).length>0?t:void 0}o(am,"buildLayout");function sm(e){let t={};typeof e.imageType=="string"&&e.imageType!==""&&(t.type=e.imageType),typeof e.fullPage=="boolean"&&(t.fullPage=e.fullPage),typeof e.quality=="number"&&(t.quality=e.quality),e.encoding==="base64"&&(t.encoding="base64");let r=typeof e.viewportWidth=="number",n=typeof e.viewportHeight=="number";if(r!==n)throw new Error("Both viewport width and height are required to set a custom viewport.");if(r&&n){let i={width:e.viewportWidth,height:e.viewportHeight};typeof e.devicePixelRatio=="number"&&e.devicePixelRatio>0&&(i.devicePixelRatio=e.devicePixelRatio),t.viewport=i}return Object.keys(t).length>0?t:void 0}o(sm,"buildScreenshot");function We(e){let t=e.operation==="screenshot"?Tr:lu,r={source:im(e)};if(e.templateData&&Object.keys(e.templateData).length>0&&(r.templateData=e.templateData),e.filename&&(r.filename=e.filename),e.tag&&(r.tag=e.tag),typeof e.timeout=="number"&&e.timeout>0&&(r.timeout=e.timeout),e.operation==="pdf"){let c=e.pdfOptions?am(e.pdfOptions):void 0;c&&(r.layout=c)}if(e.operation==="screenshot"){let c=e.screenshotOptions?sm(e.screenshotOptions):void 0;c&&(r.screenshot=c)}if(e.operation==="einvoice"){let c={standard:e.eInvoiceStandard,profile:e.eInvoiceProfile,invoice:e.invoice??{}};typeof e.eInvoiceVerify=="boolean"&&(c.verify=e.eInvoiceVerify),r.eInvoice=c}let n=e.delivery??{mode:"download"},i=n.mode==="download";n.mode==="cloudStorage"&&n.presignedUrl&&(r.cloudStorage={presignedUrl:n.presignedUrl}),n.mode==="webhook"&&n.webhook&&(r.webhook=n.webhook);let u=e.advanced&&Object.keys(e.advanced).length>0?xu(r,e.advanced):r;return{endpoint:t,body:u,isBinary:i}}o(We,"buildRequestBody");function Pu(e,t){return e==="screenshot"?`screenshot.${t==="jpeg"?"jpg":t??"png"}`:"document.pdf"}o(Pu,"defaultFilename");async function Je(e,t){let r=br.replace(/\/+$/,""),n=await Be.sendRequest({method:"POST",url:`${r}${t.endpoint}`,headers:{Authorization:`Bearer ${e.props.apiKey}`,"Content-Type":"application/json","X-Sandbox":e.props.sandbox?"true":"false"},body:t.body,responseType:t.isBinary?"arraybuffer":"json"});return{status:n.status,headers:n.headers??{},body:n.body}}o(Je,"polyDocRequest");function Ke(e){let r=e?.response?.body;if(r instanceof ArrayBuffer?r=Buffer.from(r).toString("utf8"):Buffer.isBuffer(r)&&(r=r.toString("utf8")),typeof r=="string"){let n=r;try{r=JSON.parse(n)}catch{return n||void 0}}if(r&&typeof r=="object"&&!Array.isArray(r)){let n=r,i=n.message;if(typeof i=="string")return i;let u=n.error;if(typeof u=="string")return u}}o(Ke,"extractApiErrorMessage");async function Xe(e){let{response:t,isBinary:r,files:n,operation:i,filename:u,imageType:c}=e;if(!r)return t.body??{success:!0};let p=(On(t.headers["content-type"])??"application/octet-stream").split(";")[0].trim(),f=um(t.body),h=u||Pu(i,c);return{success:!0,file:await n.write({fileName:h,data:f}),fileName:h,contentType:p,sizeBytes:f.length,conversionId:On(t.headers["x-conversion-id"]),creditUsed:On(t.headers["x-credit-used"])}}o(Xe,"shapeOutput");function On(e){return Array.isArray(e)?e[0]:e}o(On,"headerValue");function um(e){if(Buffer.isBuffer(e))return e;if(e instanceof ArrayBuffer)return Buffer.from(e);if(ArrayBuffer.isView(e))return Buffer.from(e.buffer,e.byteOffset,e.byteLength);if(typeof e=="string")return Buffer.from(e,"binary");throw new Error("PolyDoc returned an unexpected response body for a binary delivery; expected file bytes.")}o(um,"toBuffer");var Ye=o((e="url")=>T.StaticDropdown({displayName:"Source Type",description:"Where the content comes from",required:!0,defaultValue:e,options:{disabled:!1,options:pu.map(t=>({label:t.label,value:t.value}))}}),"sourceTypeProp"),Qe=T.LongText({displayName:"Source",description:"The URL, inline HTML, or saved template ID, matching the Source Type above.",required:!0}),et=T.Json({displayName:"Template Data",description:"Data passed to the Liquid template renderer (used only when Source Type is Template).",required:!1,defaultValue:{}}),tt=T.StaticDropdown({displayName:"Delivery",description:"How the generated file is returned",required:!0,defaultValue:"download",options:{disabled:!1,options:du.map(e=>({label:e.label,value:e.value}))}}),rt=T.ShortText({displayName:"Presigned URL",description:"HTTP PUT presigned URL from your storage provider (required for Cloud Storage delivery).",required:!1}),nt=T.ShortText({displayName:"Webhook URL",description:"URL the generated file is delivered to (required for Webhook delivery).",required:!1}),ot=T.Json({displayName:"Webhook Options",description:"Extra webhook settings merged with the URL: async, method, headers, retries, retryDelay, timeout.",required:!1,defaultValue:{}}),it=T.ShortText({displayName:"Filename",description:"Output filename (overrides the default).",required:!1}),at=T.ShortText({displayName:"Tag",description:"Label for logging and analytics (max 30 characters).",required:!1}),st=T.Number({displayName:"Timeout (ms)",description:"Conversion timeout in milliseconds.",required:!1}),ut=T.Json({displayName:"Advanced (JSON)",description:"Raw fields deep-merged into the request body for any API option not exposed above (e.g. pdf.watermark, pdf.pdfa, render, request).",required:!1,defaultValue:{}});function Mt(e){let t=e;if(typeof t=="string"){let r=t.trim();if(r==="")return;try{t=JSON.parse(r)}catch{return}}if(t&&typeof t=="object"&&!Array.isArray(t)){let r=t;return Object.keys(r).length>0?r:void 0}}o(Mt,"asJsonObject");function ct(e){let t=e.sourceType??"url",r=e.source??"";return t==="html"?{sourceType:t,html:r}:t==="template"?{sourceType:t,templateId:r,templateData:Mt(e.templateData)}:{sourceType:t,url:r}}o(ct,"resolveSourceParams");function lt(e){let t=e.deliveryMode??"download";if(t==="cloudStorage"){let r=e.presignedUrl??"";if(!r)throw new Error("Cloud Storage delivery requires a Presigned URL.");return{mode:t,presignedUrl:r}}if(t==="webhook"){let r=e.webhookUrl??"";if(!r)throw new Error("Webhook delivery requires a Webhook URL.");let n=Mt(e.webhookOptions)??{};return{mode:t,webhook:{url:r,...n}}}return{mode:"download"}}o(lt,"resolveDelivery");function pt(e){return{filename:e.filename||void 0,tag:e.tag||void 0,timeout:typeof e.timeout=="number"?e.timeout:void 0,advanced:Mt(e.advanced)}}o(pt,"resolveMetadata");var _u=Ee({auth:he,name:"capture_screenshot",displayName:"Capture Screenshot",description:"Capture a screenshot of a URL, inline HTML, or a saved template.",aiMetadata:{description:"Captures a screenshot (PNG, JPEG, or WebP) of a URL, an inline HTML string, or a saved PolyDoc template. Supports full-page capture, custom viewport, and base64 or file output. Not idempotent: each call performs a fresh capture on PolyDoc that produces a new file and consumes account credits, and a URL capture reflects the page as it is at capture time.",idempotent:!1},props:{sourceType:Ye("url"),source:Qe,templateData:et,imageType:T.StaticDropdown({displayName:"Image Type",required:!1,defaultValue:"png",options:{disabled:!1,options:fu.map(e=>({label:e,value:e}))}}),fullPage:T.Checkbox({displayName:"Full Page",description:"Capture the entire scrollable page.",required:!1,defaultValue:!1}),quality:T.Number({displayName:"Quality",description:"Compression quality for JPEG/WebP (0 to 100).",required:!1}),viewportWidth:T.Number({displayName:"Viewport Width",description:"Viewport width in CSS pixels.",required:!1}),viewportHeight:T.Number({displayName:"Viewport Height",description:"Viewport height in CSS pixels.",required:!1}),devicePixelRatio:T.Number({displayName:"Device Pixel Ratio",description:"Device pixel ratio, e.g. 2 for retina (0 to 10).",required:!1}),outputEncoding:T.StaticDropdown({displayName:"Output",description:"Return the image as a file (default) or as a base64 string.",required:!1,defaultValue:"binaryFile",options:{disabled:!1,options:gu.map(e=>({label:e.label,value:e.value}))}}),deliveryMode:tt,presignedUrl:rt,webhookUrl:nt,webhookOptions:ot,filename:it,tag:at,timeout:st,advanced:ut},async run(e){let t=e.propsValue,r=t.outputEncoding==="base64",n={operation:"screenshot",...ct(t),...pt(t),delivery:lt(t),screenshotOptions:{imageType:t.imageType,fullPage:t.fullPage,quality:t.quality,encoding:r?"base64":void 0,viewportWidth:t.viewportWidth,viewportHeight:t.viewportHeight,devicePixelRatio:t.devicePixelRatio}},i=We(n);r&&(i.isBinary=!1);try{let u=await Je(e.auth,i);return await Xe({response:u,isBinary:i.isBinary,files:e.files,operation:"screenshot",filename:n.filename,imageType:t.imageType})}catch(u){throw new Error(Ke(u)??u.message)}}});var bu=Ee({auth:he,name:"convert_to_pdf",displayName:"Convert to PDF",description:"Convert HTML, a URL, or a saved template to a PDF.",aiMetadata:{description:"Converts a URL, an inline HTML string, or a saved PolyDoc template into a PDF and returns the file (or delivers it to cloud storage / a webhook). Use it to render documents like invoices, reports, or contracts. Not idempotent: each call performs a fresh conversion on PolyDoc that produces a new file and consumes account credits, and the cloud-storage and webhook delivery modes send the file to an external destination.",idempotent:!1},props:{sourceType:Ye("url"),source:Qe,templateData:et,format:T.StaticDropdown({displayName:"Page Format",required:!1,defaultValue:"A4",options:{disabled:!1,options:mu.map(e=>({label:e,value:e}))}}),landscape:T.Checkbox({displayName:"Landscape",required:!1,defaultValue:!1}),printBackground:T.Checkbox({displayName:"Print Background",description:"Print background graphics and colors.",required:!1,defaultValue:!0}),scale:T.Number({displayName:"Scale",description:"Render scale (0.1 to 2).",required:!1}),pageRanges:T.ShortText({displayName:"Page Ranges",description:'Pages to include, e.g. "1-5, 8". Empty means all pages.',required:!1}),outline:T.Checkbox({displayName:"Outline (Bookmarks)",description:"Generate PDF bookmarks from HTML headings.",required:!1,defaultValue:!1}),tagged:T.Checkbox({displayName:"Tagged (Accessible)",description:"Produce a tagged, accessible PDF.",required:!1,defaultValue:!1}),marginTop:T.ShortText({displayName:"Margin Top",description:"Top margin with optional unit, e.g. 10mm, 1cm, 0.5in.",required:!1}),marginRight:T.ShortText({displayName:"Margin Right",required:!1}),marginBottom:T.ShortText({displayName:"Margin Bottom",required:!1}),marginLeft:T.ShortText({displayName:"Margin Left",required:!1}),deliveryMode:tt,presignedUrl:rt,webhookUrl:nt,webhookOptions:ot,filename:it,tag:at,timeout:st,advanced:ut},async run(e){let t=e.propsValue,r={operation:"pdf",...ct(t),...pt(t),delivery:lt(t),pdfOptions:{format:t.format,landscape:t.landscape,printBackground:t.printBackground,scale:t.scale,pageRanges:t.pageRanges,outline:t.outline,tagged:t.tagged,marginTop:t.marginTop,marginRight:t.marginRight,marginBottom:t.marginBottom,marginLeft:t.marginLeft}},n=We(r);try{let i=await Je(e.auth,n);return await Xe({response:i,isBinary:n.isBinary,files:e.files,operation:"pdf",filename:r.filename})}catch(i){throw new Error(Ke(i)??i.message)}}});var cm={number:"INV-001",issueDate:"2026-01-31",dueDate:"2026-03-02",currencyCode:"EUR",seller:{name:"Your Company GmbH",address:{line1:"Main St 1",city:"Berlin",postalCode:"10115",countryCode:"DE"},taxId:"DE123456789"},buyer:{name:"Customer SARL",address:{line1:"Rue 2",city:"Paris",postalCode:"75001",countryCode:"FR"}},lines:[{description:"Widget",quantity:2,unitPrice:10,lineTotal:20,vatRate:19,vatCategoryCode:"S"}],taxSummary:[{categoryCode:"S",rate:19,taxableAmount:20,taxAmount:3.8}],paymentTerms:"Net 30 days",totalNetAmount:20,totalTaxAmount:3.8,totalGrossAmount:23.8},Tu=Ee({auth:he,name:"generate_einvoice",displayName:"Generate E-Invoice",description:"Generate a hybrid e-invoice PDF (Factur-X / ZUGFeRD, EN 16931) from a visual layout plus structured invoice data.",aiMetadata:{description:"Generates a hybrid e-invoice PDF (Factur-X / ZUGFeRD, EN 16931) by embedding structured invoice XML into a visual PDF layout. EN 16931 requires payment terms or a due date, a seller tax ID for VAT category S, and consistent totals. Not idempotent: each call performs a fresh generation on PolyDoc that produces a new file and consumes account credits, and the cloud-storage and webhook delivery modes send the file to an external destination.",idempotent:!1},props:{sourceType:Ye("html"),source:Qe,templateData:et,standard:T.StaticDropdown({displayName:"Standard",description:"The hybrid e-invoice standard to embed.",required:!0,defaultValue:"zugferd",options:{disabled:!1,options:yu.map(e=>({label:e.label,value:e.value}))}}),profile:T.StaticDropdown({displayName:"Profile",description:"The data granularity profile to validate against.",required:!0,defaultValue:"en16931",options:{disabled:!1,options:hu.map(e=>({label:e,value:e}))}}),invoice:T.Json({displayName:"Invoice Data",description:"Structured invoice data: number, dates, currency, seller, buyer, lines, totals. EN 16931 needs payment terms (or due date), seller taxId for VAT category S, and consistent totals. See docs.polydoc.tech.",required:!0,defaultValue:cm}),verify:T.Checkbox({displayName:"Verify",description:"Validate PDF/A and e-invoice compliance (returns an error if it fails).",required:!1,defaultValue:!1}),deliveryMode:tt,presignedUrl:rt,webhookUrl:nt,webhookOptions:ot,filename:it,tag:at,timeout:st,advanced:ut},async run(e){let t=e.propsValue,r={operation:"einvoice",...ct(t),...pt(t),delivery:lt(t),eInvoiceStandard:t.standard,eInvoiceProfile:t.profile,eInvoiceVerify:t.verify===!0,invoice:Mt(t.invoice)??{}},n=We(r);try{let i=await Je(e.auth,n);return await Xe({response:i,isBinary:n.isBinary,files:e.files,operation:"einvoice",filename:r.filename})}catch(i){throw new Error(Ke(i)??i.message)}}});var lm=Wi({displayName:"PolyDoc",description:"Convert HTML or a URL to PDF, capture screenshots, and generate EU e-invoices (Factur-X / ZUGFeRD).",auth:he,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/polydoc.png",categories:["CONTENT_AND_FILES","PRODUCTIVITY"],authors:["polydoc-tech","sanket-a11y"],actions:[bu,_u,Tu,cu({baseUrl:o(()=>"https://api.podio.com","baseUrl"),auth:he,authMapping:o(async e=>({Authorization:`Bearer ${e.props.apikey}`,"X-Sandbox":e.props.sandbox?"true":"false"}),"authMapping")})],triggers:[]});0&&(module.exports={polydoc});
5
+ Turn on **Sandbox** to test against sandbox quota (output is watermarked). Leave it off for production conversions.`,he=ur.CustomAuth({description:am,required:!0,props:{apiKey:ur.SecretText({displayName:"API Key",description:"Your PolyDoc API key from dashboard.polydoc.tech.",required:!0}),sandbox:T.Checkbox({displayName:"Sandbox",description:"Use sandbox quota (watermarked output).",required:!1,defaultValue:!1})},validate:o(async({auth:e})=>{let t=e.apiKey;if(!t)return{valid:!1,error:"API key is required."};try{return await Be.sendRequest({method:"POST",url:`${br.replace(/\/+$/,"")}${Tr}`,headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","X-Sandbox":e.sandbox?"true":"false"},body:{source:"<p>polydoc</p>",screenshot:{type:"png"}},responseType:"arraybuffer"}),{valid:!0}}catch(r){let n=r?.response?.status;return n===401?{valid:!1,error:"Invalid PolyDoc API key."}:{valid:!1,error:`Could not validate the PolyDoc API key (${n?`the API returned HTTP ${n}`:"the API was unreachable"}). Check the key and try again.`}}},"validate")});function xu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(xu,"isPlainObject");function Pu(e,t){let r={...e};for(let[n,i]of Object.entries(t))xu(i)&&xu(r[n])?r[n]=Pu(r[n],i):r[n]=i;return r}o(Pu,"mergeDeep");function sm(e){switch(e.sourceType){case"url":return e.url??"";case"html":return e.html??"";case"template":return`[template:${e.templateId??""}]`;default:return""}}o(sm,"resolveSource");function um(e){let t={};typeof e.format=="string"&&e.format!==""&&(t.format=e.format);for(let n of["landscape","printBackground","outline","tagged"])typeof e[n]=="boolean"&&(t[n]=e[n]);return typeof e.scale=="number"&&(t.scale=e.scale),typeof e.pageRanges=="string"&&e.pageRanges!==""&&(t.pageRanges=e.pageRanges),["marginTop","marginRight","marginBottom","marginLeft"].some(n=>e[n]!==void 0&&e[n]!=="")&&(t.margin={top:e.marginTop??"2",right:e.marginRight??"1",bottom:e.marginBottom??"2",left:e.marginLeft??"1"}),Object.keys(t).length>0?t:void 0}o(um,"buildLayout");function cm(e){let t={};typeof e.imageType=="string"&&e.imageType!==""&&(t.type=e.imageType),typeof e.fullPage=="boolean"&&(t.fullPage=e.fullPage),typeof e.quality=="number"&&(t.quality=e.quality),e.encoding==="base64"&&(t.encoding="base64");let r=typeof e.viewportWidth=="number",n=typeof e.viewportHeight=="number";if(r!==n)throw new Error("Both viewport width and height are required to set a custom viewport.");if(r&&n){let i={width:e.viewportWidth,height:e.viewportHeight};typeof e.devicePixelRatio=="number"&&e.devicePixelRatio>0&&(i.devicePixelRatio=e.devicePixelRatio),t.viewport=i}return Object.keys(t).length>0?t:void 0}o(cm,"buildScreenshot");function We(e){let t=e.operation==="screenshot"?Tr:pu,r={source:sm(e)};if(e.templateData&&Object.keys(e.templateData).length>0&&(r.templateData=e.templateData),e.filename&&(r.filename=e.filename),e.tag&&(r.tag=e.tag),typeof e.timeout=="number"&&e.timeout>0&&(r.timeout=e.timeout),e.operation==="pdf"){let c=e.pdfOptions?um(e.pdfOptions):void 0;c&&(r.layout=c)}if(e.operation==="screenshot"){let c=e.screenshotOptions?cm(e.screenshotOptions):void 0;c&&(r.screenshot=c)}if(e.operation==="einvoice"){let c={standard:e.eInvoiceStandard,profile:e.eInvoiceProfile,invoice:e.invoice??{}};typeof e.eInvoiceVerify=="boolean"&&(c.verify=e.eInvoiceVerify),r.eInvoice=c}let n=e.delivery??{mode:"download"},i=n.mode==="download";n.mode==="cloudStorage"&&n.presignedUrl&&(r.cloudStorage={presignedUrl:n.presignedUrl}),n.mode==="webhook"&&n.webhook&&(r.webhook=n.webhook);let u=e.advanced&&Object.keys(e.advanced).length>0?Pu(r,e.advanced):r;return{endpoint:t,body:u,isBinary:i}}o(We,"buildRequestBody");function _u(e,t){return e==="screenshot"?`screenshot.${t==="jpeg"?"jpg":t??"png"}`:"document.pdf"}o(_u,"defaultFilename");async function Je(e,t){let r=br.replace(/\/+$/,""),n=await Be.sendRequest({method:"POST",url:`${r}${t.endpoint}`,headers:{Authorization:`Bearer ${e.props.apiKey}`,"Content-Type":"application/json","X-Sandbox":e.props.sandbox?"true":"false"},body:t.body,responseType:t.isBinary?"arraybuffer":"json"});return{status:n.status,headers:n.headers??{},body:n.body}}o(Je,"polyDocRequest");function Ke(e){let r=e?.response?.body;if(r instanceof ArrayBuffer?r=Buffer.from(r).toString("utf8"):Buffer.isBuffer(r)&&(r=r.toString("utf8")),typeof r=="string"){let n=r;try{r=JSON.parse(n)}catch{return n||void 0}}if(r&&typeof r=="object"&&!Array.isArray(r)){let n=r,i=n.message;if(typeof i=="string")return i;let u=n.error;if(typeof u=="string")return u}}o(Ke,"extractApiErrorMessage");async function Xe(e){let{response:t,isBinary:r,files:n,operation:i,filename:u,imageType:c}=e;if(!r)return t.body??{success:!0};let p=(On(t.headers["content-type"])??"application/octet-stream").split(";")[0].trim(),f=lm(t.body),h=u||_u(i,c);return{success:!0,file:await n.write({fileName:h,data:f}),fileName:h,contentType:p,sizeBytes:f.length,conversionId:On(t.headers["x-conversion-id"]),creditUsed:On(t.headers["x-credit-used"])}}o(Xe,"shapeOutput");function On(e){return Array.isArray(e)?e[0]:e}o(On,"headerValue");function lm(e){if(Buffer.isBuffer(e))return e;if(e instanceof ArrayBuffer)return Buffer.from(e);if(ArrayBuffer.isView(e))return Buffer.from(e.buffer,e.byteOffset,e.byteLength);if(typeof e=="string")return Buffer.from(e,"binary");throw new Error("PolyDoc returned an unexpected response body for a binary delivery; expected file bytes.")}o(lm,"toBuffer");var Ye=o((e="url")=>T.StaticDropdown({displayName:"Source Type",description:"Where the content comes from",required:!0,defaultValue:e,options:{disabled:!1,options:du.map(t=>({label:t.label,value:t.value}))}}),"sourceTypeProp"),Qe=T.LongText({displayName:"Source",description:"The URL, inline HTML, or saved template ID, matching the Source Type above.",required:!0}),et=T.Json({displayName:"Template Data",description:"Data passed to the Liquid template renderer (used only when Source Type is Template).",required:!1,defaultValue:{}}),tt=T.StaticDropdown({displayName:"Delivery",description:"How the generated file is returned",required:!0,defaultValue:"download",options:{disabled:!1,options:mu.map(e=>({label:e.label,value:e.value}))}}),rt=T.ShortText({displayName:"Presigned URL",description:"HTTP PUT presigned URL from your storage provider (required for Cloud Storage delivery).",required:!1}),nt=T.ShortText({displayName:"Webhook URL",description:"URL the generated file is delivered to (required for Webhook delivery).",required:!1}),ot=T.Json({displayName:"Webhook Options",description:"Extra webhook settings merged with the URL: async, method, headers, retries, retryDelay, timeout.",required:!1,defaultValue:{}}),it=T.ShortText({displayName:"Filename",description:"Output filename (overrides the default).",required:!1}),at=T.ShortText({displayName:"Tag",description:"Label for logging and analytics (max 30 characters).",required:!1}),st=T.Number({displayName:"Timeout (ms)",description:"Conversion timeout in milliseconds.",required:!1}),ut=T.Json({displayName:"Advanced (JSON)",description:"Raw fields deep-merged into the request body for any API option not exposed above (e.g. pdf.watermark, pdf.pdfa, render, request).",required:!1,defaultValue:{}});function Lt(e){let t=e;if(typeof t=="string"){let r=t.trim();if(r==="")return;try{t=JSON.parse(r)}catch{return}}if(t&&typeof t=="object"&&!Array.isArray(t)){let r=t;return Object.keys(r).length>0?r:void 0}}o(Lt,"asJsonObject");function ct(e){let t=e.sourceType??"url",r=e.source??"";return t==="html"?{sourceType:t,html:r}:t==="template"?{sourceType:t,templateId:r,templateData:Lt(e.templateData)}:{sourceType:t,url:r}}o(ct,"resolveSourceParams");function lt(e){let t=e.deliveryMode??"download";if(t==="cloudStorage"){let r=e.presignedUrl??"";if(!r)throw new Error("Cloud Storage delivery requires a Presigned URL.");return{mode:t,presignedUrl:r}}if(t==="webhook"){let r=e.webhookUrl??"";if(!r)throw new Error("Webhook delivery requires a Webhook URL.");let n=Lt(e.webhookOptions)??{};return{mode:t,webhook:{url:r,...n}}}return{mode:"download"}}o(lt,"resolveDelivery");function pt(e){return{filename:e.filename||void 0,tag:e.tag||void 0,timeout:typeof e.timeout=="number"?e.timeout:void 0,advanced:Lt(e.advanced)}}o(pt,"resolveMetadata");var bu=Se({auth:he,name:"capture_screenshot",displayName:"Capture Screenshot",description:"Capture a screenshot of a URL, inline HTML, or a saved template.",aiMetadata:{description:"Captures a screenshot (PNG, JPEG, or WebP) of a URL, an inline HTML string, or a saved PolyDoc template. Supports full-page capture, custom viewport, and base64 or file output. Not idempotent: each call performs a fresh capture on PolyDoc that produces a new file and consumes account credits, and a URL capture reflects the page as it is at capture time.",idempotent:!1},props:{sourceType:Ye("url"),source:Qe,templateData:et,imageType:T.StaticDropdown({displayName:"Image Type",required:!1,defaultValue:"png",options:{disabled:!1,options:gu.map(e=>({label:e,value:e}))}}),fullPage:T.Checkbox({displayName:"Full Page",description:"Capture the entire scrollable page.",required:!1,defaultValue:!1}),quality:T.Number({displayName:"Quality",description:"Compression quality for JPEG/WebP (0 to 100).",required:!1}),viewportWidth:T.Number({displayName:"Viewport Width",description:"Viewport width in CSS pixels.",required:!1}),viewportHeight:T.Number({displayName:"Viewport Height",description:"Viewport height in CSS pixels.",required:!1}),devicePixelRatio:T.Number({displayName:"Device Pixel Ratio",description:"Device pixel ratio, e.g. 2 for retina (0 to 10).",required:!1}),outputEncoding:T.StaticDropdown({displayName:"Output",description:"Return the image as a file (default) or as a base64 string.",required:!1,defaultValue:"binaryFile",options:{disabled:!1,options:yu.map(e=>({label:e.label,value:e.value}))}}),deliveryMode:tt,presignedUrl:rt,webhookUrl:nt,webhookOptions:ot,filename:it,tag:at,timeout:st,advanced:ut},async run(e){let t=e.propsValue,r=t.outputEncoding==="base64",n={operation:"screenshot",...ct(t),...pt(t),delivery:lt(t),screenshotOptions:{imageType:t.imageType,fullPage:t.fullPage,quality:t.quality,encoding:r?"base64":void 0,viewportWidth:t.viewportWidth,viewportHeight:t.viewportHeight,devicePixelRatio:t.devicePixelRatio}},i=We(n);r&&(i.isBinary=!1);try{let u=await Je(e.auth,i);return await Xe({response:u,isBinary:i.isBinary,files:e.files,operation:"screenshot",filename:n.filename,imageType:t.imageType})}catch(u){throw new Error(Ke(u)??u.message)}}});var Tu=Se({auth:he,name:"convert_to_pdf",displayName:"Convert to PDF",description:"Convert HTML, a URL, or a saved template to a PDF.",aiMetadata:{description:"Converts a URL, an inline HTML string, or a saved PolyDoc template into a PDF and returns the file (or delivers it to cloud storage / a webhook). Use it to render documents like invoices, reports, or contracts. Not idempotent: each call performs a fresh conversion on PolyDoc that produces a new file and consumes account credits, and the cloud-storage and webhook delivery modes send the file to an external destination.",idempotent:!1},props:{sourceType:Ye("url"),source:Qe,templateData:et,format:T.StaticDropdown({displayName:"Page Format",required:!1,defaultValue:"A4",options:{disabled:!1,options:fu.map(e=>({label:e,value:e}))}}),landscape:T.Checkbox({displayName:"Landscape",required:!1,defaultValue:!1}),printBackground:T.Checkbox({displayName:"Print Background",description:"Print background graphics and colors.",required:!1,defaultValue:!0}),scale:T.Number({displayName:"Scale",description:"Render scale (0.1 to 2).",required:!1}),pageRanges:T.ShortText({displayName:"Page Ranges",description:'Pages to include, e.g. "1-5, 8". Empty means all pages.',required:!1}),outline:T.Checkbox({displayName:"Outline (Bookmarks)",description:"Generate PDF bookmarks from HTML headings.",required:!1,defaultValue:!1}),tagged:T.Checkbox({displayName:"Tagged (Accessible)",description:"Produce a tagged, accessible PDF.",required:!1,defaultValue:!1}),marginTop:T.ShortText({displayName:"Margin Top",description:"Top margin with optional unit, e.g. 10mm, 1cm, 0.5in.",required:!1}),marginRight:T.ShortText({displayName:"Margin Right",required:!1}),marginBottom:T.ShortText({displayName:"Margin Bottom",required:!1}),marginLeft:T.ShortText({displayName:"Margin Left",required:!1}),deliveryMode:tt,presignedUrl:rt,webhookUrl:nt,webhookOptions:ot,filename:it,tag:at,timeout:st,advanced:ut},async run(e){let t=e.propsValue,r={operation:"pdf",...ct(t),...pt(t),delivery:lt(t),pdfOptions:{format:t.format,landscape:t.landscape,printBackground:t.printBackground,scale:t.scale,pageRanges:t.pageRanges,outline:t.outline,tagged:t.tagged,marginTop:t.marginTop,marginRight:t.marginRight,marginBottom:t.marginBottom,marginLeft:t.marginLeft}},n=We(r);try{let i=await Je(e.auth,n);return await Xe({response:i,isBinary:n.isBinary,files:e.files,operation:"pdf",filename:r.filename})}catch(i){throw new Error(Ke(i)??i.message)}}});var pm={number:"INV-001",issueDate:"2026-01-31",dueDate:"2026-03-02",currencyCode:"EUR",seller:{name:"Your Company GmbH",address:{line1:"Main St 1",city:"Berlin",postalCode:"10115",countryCode:"DE"},taxId:"DE123456789"},buyer:{name:"Customer SARL",address:{line1:"Rue 2",city:"Paris",postalCode:"75001",countryCode:"FR"}},lines:[{description:"Widget",quantity:2,unitPrice:10,lineTotal:20,vatRate:19,vatCategoryCode:"S"}],taxSummary:[{categoryCode:"S",rate:19,taxableAmount:20,taxAmount:3.8}],paymentTerms:"Net 30 days",totalNetAmount:20,totalTaxAmount:3.8,totalGrossAmount:23.8},Iu=Se({auth:he,name:"generate_einvoice",displayName:"Generate E-Invoice",description:"Generate a hybrid e-invoice PDF (Factur-X / ZUGFeRD, EN 16931) from a visual layout plus structured invoice data.",aiMetadata:{description:"Generates a hybrid e-invoice PDF (Factur-X / ZUGFeRD, EN 16931) by embedding structured invoice XML into a visual PDF layout. EN 16931 requires payment terms or a due date, a seller tax ID for VAT category S, and consistent totals. Not idempotent: each call performs a fresh generation on PolyDoc that produces a new file and consumes account credits, and the cloud-storage and webhook delivery modes send the file to an external destination.",idempotent:!1},props:{sourceType:Ye("html"),source:Qe,templateData:et,standard:T.StaticDropdown({displayName:"Standard",description:"The hybrid e-invoice standard to embed.",required:!0,defaultValue:"zugferd",options:{disabled:!1,options:hu.map(e=>({label:e.label,value:e.value}))}}),profile:T.StaticDropdown({displayName:"Profile",description:"The data granularity profile to validate against.",required:!0,defaultValue:"en16931",options:{disabled:!1,options:vu.map(e=>({label:e,value:e}))}}),invoice:T.Json({displayName:"Invoice Data",description:"Structured invoice data: number, dates, currency, seller, buyer, lines, totals. EN 16931 needs payment terms (or due date), seller taxId for VAT category S, and consistent totals. See docs.polydoc.tech.",required:!0,defaultValue:pm}),verify:T.Checkbox({displayName:"Verify",description:"Validate PDF/A and e-invoice compliance (returns an error if it fails).",required:!1,defaultValue:!1}),deliveryMode:tt,presignedUrl:rt,webhookUrl:nt,webhookOptions:ot,filename:it,tag:at,timeout:st,advanced:ut},async run(e){let t=e.propsValue,r={operation:"einvoice",...ct(t),...pt(t),delivery:lt(t),eInvoiceStandard:t.standard,eInvoiceProfile:t.profile,eInvoiceVerify:t.verify===!0,invoice:Lt(t.invoice)??{}},n=We(r);try{let i=await Je(e.auth,n);return await Xe({response:i,isBinary:n.isBinary,files:e.files,operation:"einvoice",filename:r.filename})}catch(i){throw new Error(Ke(i)??i.message)}}});var dm=Wi({displayName:"PolyDoc",description:"Convert HTML or a URL to PDF, capture screenshots, and generate EU e-invoices (Factur-X / ZUGFeRD).",auth:he,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/polydoc.png",categories:["CONTENT_AND_FILES","PRODUCTIVITY"],authors:["polydoc-tech","sanket-a11y"],actions:[Tu,bu,Iu,lu({baseUrl:o(()=>"https://api.podio.com","baseUrl"),auth:he,authMapping:o(async e=>({Authorization:`Bearer ${e.props.apikey}`,"X-Sandbox":e.props.sandbox?"true":"false"}),"authMapping")})],triggers:[]});0&&(module.exports={polydoc});
6
6
  /*! Bundled license information:
7
7
 
8
8
  mime-types/index.js: